@sensiblestats/widget-react 0.86.1 → 0.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/index.cjs +1347 -1206
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1251 -1110
- package/dist/index.js.map +1 -1
- package/dist/styles.css +35 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/StatsWidget.tsx
|
|
2
|
-
import { useCallback as useCallback23, useEffect as useEffect34, useMemo as useMemo6, useRef as useRef31, useState as
|
|
2
|
+
import { useCallback as useCallback23, useEffect as useEffect34, useMemo as useMemo6, useRef as useRef31, useState as useState56 } from "react";
|
|
3
3
|
import { StatsWidgetClient } from "@sensiblestats/widget-sdk";
|
|
4
4
|
|
|
5
5
|
// src/kickoff.ts
|
|
@@ -111,6 +111,7 @@ var STRINGS = {
|
|
|
111
111
|
inSlipLabel: "In slip",
|
|
112
112
|
oddsUnavailable: "Odds unavailable right now",
|
|
113
113
|
momentumLabel: "Momentum",
|
|
114
|
+
formAndH2HLabel: "Form & Head-to-head",
|
|
114
115
|
liveFactLabel: "Live fact",
|
|
115
116
|
liveFactAsk: "Ask about this",
|
|
116
117
|
liveFactEarlier: (n) => `Earlier facts (${n})`,
|
|
@@ -578,6 +579,7 @@ var STRINGS = {
|
|
|
578
579
|
inSlipLabel: "Kuponda",
|
|
579
580
|
oddsUnavailable: "Oranlar \u015Fu anda kullan\u0131lam\u0131yor",
|
|
580
581
|
momentumLabel: "Momentum",
|
|
582
|
+
formAndH2HLabel: "Form ve Kar\u015F\u0131l\u0131kl\u0131 Ma\xE7lar",
|
|
581
583
|
liveFactLabel: "Canl\u0131 bilgi",
|
|
582
584
|
liveFactAsk: "Bunu sor",
|
|
583
585
|
liveFactEarlier: (n) => `\xD6nceki bilgiler (${n})`,
|
|
@@ -1168,6 +1170,7 @@ function normalizeUi(cfg) {
|
|
|
1168
1170
|
inSlipLabel: strings.inSlipLabel,
|
|
1169
1171
|
oddsUnavailable: strings.oddsUnavailable,
|
|
1170
1172
|
momentumLabel: strings.momentumLabel,
|
|
1173
|
+
formAndH2HLabel: strings.formAndH2HLabel,
|
|
1171
1174
|
liveFactLabel: strings.liveFactLabel,
|
|
1172
1175
|
liveFactAsk: strings.liveFactAsk,
|
|
1173
1176
|
liveFactEarlier: strings.liveFactEarlier,
|
|
@@ -3935,7 +3938,7 @@ function ChatFab({ label, greeting, popupText, logoUrl, onOpen, onDismissPopup,
|
|
|
3935
3938
|
}
|
|
3936
3939
|
|
|
3937
3940
|
// src/components/ChatPanel.tsx
|
|
3938
|
-
import { useCallback as useCallback22, useEffect as useEffect33, useLayoutEffect, useMemo as useMemo5, useRef as useRef30, useState as
|
|
3941
|
+
import { useCallback as useCallback22, useEffect as useEffect33, useLayoutEffect, useMemo as useMemo5, useRef as useRef30, useState as useState55 } from "react";
|
|
3939
3942
|
|
|
3940
3943
|
// src/components/ChatHeader.tsx
|
|
3941
3944
|
import { useEffect as useEffect16, useRef as useRef17, useState as useState15 } from "react";
|
|
@@ -6267,8 +6270,102 @@ function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
|
|
|
6267
6270
|
] });
|
|
6268
6271
|
}
|
|
6269
6272
|
|
|
6273
|
+
// src/components/MonitorFormH2H.tsx
|
|
6274
|
+
import { useState as useState32 } from "react";
|
|
6275
|
+
import { Fragment as Fragment8, jsx as jsx53, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
6276
|
+
function resultClass2(result) {
|
|
6277
|
+
if (result === "W") return "ss-w-h2h-result--win";
|
|
6278
|
+
if (result === "L") return "ss-w-h2h-result--loss";
|
|
6279
|
+
return "ss-w-h2h-result--draw";
|
|
6280
|
+
}
|
|
6281
|
+
function resultLabel(result, ui) {
|
|
6282
|
+
if (result === "W") return ui.standingsColWon;
|
|
6283
|
+
if (result === "L") return ui.standingsColLost;
|
|
6284
|
+
return ui.standingsColDrawn;
|
|
6285
|
+
}
|
|
6286
|
+
function FormDots({ form, ui }) {
|
|
6287
|
+
return /* @__PURE__ */ jsx53("div", { className: "ss-w-h2h-dots", children: form.map((m, i) => /* @__PURE__ */ jsx53("span", { className: `ss-w-h2h-result ${resultClass2(m.result)}`, children: resultLabel(m.result, ui) }, i)) });
|
|
6288
|
+
}
|
|
6289
|
+
function MonitorFormH2H({ formAndH2H, homeTeamName, awayTeamName, ui }) {
|
|
6290
|
+
const [expanded, setExpanded] = useState32(false);
|
|
6291
|
+
const { homeForm, awayForm, h2h, homeShortCode, awayShortCode } = formAndH2H;
|
|
6292
|
+
if (homeForm.length === 0 && awayForm.length === 0 && !h2h) {
|
|
6293
|
+
return /* @__PURE__ */ jsx53(Fragment8, {});
|
|
6294
|
+
}
|
|
6295
|
+
const homeLabel = homeShortCode || homeTeamName;
|
|
6296
|
+
const awayLabel = awayShortCode || awayTeamName;
|
|
6297
|
+
const total = h2h ? h2h.wins + h2h.draws + h2h.losses : 0;
|
|
6298
|
+
const winsPct = total > 0 && h2h ? h2h.wins / total * 100 : 0;
|
|
6299
|
+
const drawsPct = total > 0 && h2h ? h2h.draws / total * 100 : 0;
|
|
6300
|
+
const lossesPct = total > 0 && h2h ? h2h.losses / total * 100 : 0;
|
|
6301
|
+
return /* @__PURE__ */ jsxs48("div", { className: "ss-w-h2h", children: [
|
|
6302
|
+
/* @__PURE__ */ jsxs48("button", { type: "button", className: "ss-w-h2h-head", "aria-expanded": expanded, onClick: () => setExpanded((v) => !v), children: [
|
|
6303
|
+
/* @__PURE__ */ jsxs48("span", { className: "ss-w-h2h-head-l", children: [
|
|
6304
|
+
/* @__PURE__ */ jsx53("span", { className: "ss-w-h2h-dot", "aria-hidden": "true" }),
|
|
6305
|
+
/* @__PURE__ */ jsx53("span", { className: "ss-w-h2h-title", children: ui.formAndH2HLabel })
|
|
6306
|
+
] }),
|
|
6307
|
+
/* @__PURE__ */ jsx53(
|
|
6308
|
+
"svg",
|
|
6309
|
+
{
|
|
6310
|
+
className: expanded ? "ss-w-h2h-chevron ss-w-h2h-chevron--open" : "ss-w-h2h-chevron",
|
|
6311
|
+
width: "16",
|
|
6312
|
+
height: "16",
|
|
6313
|
+
viewBox: "0 0 24 24",
|
|
6314
|
+
fill: "none",
|
|
6315
|
+
stroke: "currentColor",
|
|
6316
|
+
strokeWidth: "2",
|
|
6317
|
+
strokeLinecap: "round",
|
|
6318
|
+
strokeLinejoin: "round",
|
|
6319
|
+
"aria-hidden": "true",
|
|
6320
|
+
children: /* @__PURE__ */ jsx53("path", { d: "M6 9l6 6 6-6" })
|
|
6321
|
+
}
|
|
6322
|
+
)
|
|
6323
|
+
] }),
|
|
6324
|
+
expanded && /* @__PURE__ */ jsxs48("div", { className: "ss-w-h2h-body", children: [
|
|
6325
|
+
/* @__PURE__ */ jsxs48("div", { className: "ss-w-h2h-forms", children: [
|
|
6326
|
+
/* @__PURE__ */ jsxs48("div", { className: "ss-w-h2h-form-col", children: [
|
|
6327
|
+
/* @__PURE__ */ jsx53("span", { className: "ss-w-h2h-form-team", children: homeLabel }),
|
|
6328
|
+
/* @__PURE__ */ jsx53(FormDots, { form: homeForm, ui })
|
|
6329
|
+
] }),
|
|
6330
|
+
/* @__PURE__ */ jsxs48("div", { className: "ss-w-h2h-form-col ss-w-h2h-form-col--away", children: [
|
|
6331
|
+
/* @__PURE__ */ jsx53("span", { className: "ss-w-h2h-form-team", children: awayLabel }),
|
|
6332
|
+
/* @__PURE__ */ jsx53(FormDots, { form: awayForm, ui })
|
|
6333
|
+
] })
|
|
6334
|
+
] }),
|
|
6335
|
+
h2h && /* @__PURE__ */ jsxs48("div", { className: "ss-w-h2h-record", children: [
|
|
6336
|
+
/* @__PURE__ */ jsx53("span", { className: "ss-w-h2h-meta", children: h2h.label }),
|
|
6337
|
+
/* @__PURE__ */ jsxs48("div", { className: "ss-w-h2h-bar", children: [
|
|
6338
|
+
/* @__PURE__ */ jsx53("span", { className: "ss-w-h2h-bar-seg ss-w-h2h-bar-seg--win", style: { width: `${winsPct}%` } }),
|
|
6339
|
+
/* @__PURE__ */ jsx53("span", { className: "ss-w-h2h-bar-seg ss-w-h2h-bar-seg--draw", style: { width: `${drawsPct}%` } }),
|
|
6340
|
+
/* @__PURE__ */ jsx53("span", { className: "ss-w-h2h-bar-seg ss-w-h2h-bar-seg--loss", style: { width: `${lossesPct}%` } })
|
|
6341
|
+
] }),
|
|
6342
|
+
/* @__PURE__ */ jsxs48("div", { className: "ss-w-h2h-legend", children: [
|
|
6343
|
+
/* @__PURE__ */ jsxs48("span", { className: "ss-w-h2h-legend-item", children: [
|
|
6344
|
+
/* @__PURE__ */ jsx53("span", { className: "ss-w-h2h-legend-dot ss-w-h2h-legend-dot--win", "aria-hidden": "true" }),
|
|
6345
|
+
h2h.wins,
|
|
6346
|
+
" ",
|
|
6347
|
+
h2h.homeWinsLabel
|
|
6348
|
+
] }),
|
|
6349
|
+
/* @__PURE__ */ jsxs48("span", { className: "ss-w-h2h-legend-item", children: [
|
|
6350
|
+
/* @__PURE__ */ jsx53("span", { className: "ss-w-h2h-legend-dot ss-w-h2h-legend-dot--draw", "aria-hidden": "true" }),
|
|
6351
|
+
h2h.draws,
|
|
6352
|
+
" ",
|
|
6353
|
+
h2h.drawsLabel
|
|
6354
|
+
] }),
|
|
6355
|
+
/* @__PURE__ */ jsxs48("span", { className: "ss-w-h2h-legend-item", children: [
|
|
6356
|
+
/* @__PURE__ */ jsx53("span", { className: "ss-w-h2h-legend-dot ss-w-h2h-legend-dot--loss", "aria-hidden": "true" }),
|
|
6357
|
+
h2h.losses,
|
|
6358
|
+
" ",
|
|
6359
|
+
h2h.awayWinsLabel
|
|
6360
|
+
] })
|
|
6361
|
+
] })
|
|
6362
|
+
] })
|
|
6363
|
+
] })
|
|
6364
|
+
] });
|
|
6365
|
+
}
|
|
6366
|
+
|
|
6270
6367
|
// src/components/MonitorMatchCard.tsx
|
|
6271
|
-
import { jsx as
|
|
6368
|
+
import { jsx as jsx54, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
6272
6369
|
function isPromoted(row, promotedPins) {
|
|
6273
6370
|
const chip = row.market;
|
|
6274
6371
|
if (!chip) return false;
|
|
@@ -6303,68 +6400,77 @@ function MonitorMatchCard({ match, promotedPins, monitor, ui, slip, onAsk }) {
|
|
|
6303
6400
|
const otherRows = match.statRows.filter((row) => !isPromoted(row, promotedPins));
|
|
6304
6401
|
const orderedRows = [...promotedRows, ...otherRows];
|
|
6305
6402
|
const kickoff = match.phase === "preMatch" && match.kickoffUtc ? ui.bettingKickoff(match.kickoffUtc) : void 0;
|
|
6306
|
-
return /* @__PURE__ */
|
|
6307
|
-
/* @__PURE__ */
|
|
6308
|
-
live && /* @__PURE__ */
|
|
6309
|
-
/* @__PURE__ */
|
|
6403
|
+
return /* @__PURE__ */ jsxs49("div", { className: "ss-w-mon", children: [
|
|
6404
|
+
/* @__PURE__ */ jsxs49("div", { className: "ss-w-mon-top", children: [
|
|
6405
|
+
live && /* @__PURE__ */ jsxs49("span", { className: "ss-w-fandash-live-pill", children: [
|
|
6406
|
+
/* @__PURE__ */ jsx54("span", { className: "ss-w-fandash-live-dot", "aria-hidden": "true" }),
|
|
6310
6407
|
ui.liveLabel
|
|
6311
6408
|
] }),
|
|
6312
|
-
match.phase === "fullTime" && /* @__PURE__ */
|
|
6313
|
-
kickoff && /* @__PURE__ */
|
|
6409
|
+
match.phase === "fullTime" && /* @__PURE__ */ jsx54("span", { className: "ss-w-mon-pill", children: ui.fullTimeLabel }),
|
|
6410
|
+
kickoff && /* @__PURE__ */ jsxs49("span", { className: "ss-w-mon-pill", children: [
|
|
6314
6411
|
kickoff.dayLabel,
|
|
6315
6412
|
" \xB7 ",
|
|
6316
6413
|
kickoff.time
|
|
6317
6414
|
] }),
|
|
6318
|
-
live && match.minuteLabel && /* @__PURE__ */
|
|
6319
|
-
match.competitionName && /* @__PURE__ */
|
|
6320
|
-
/* @__PURE__ */
|
|
6415
|
+
live && match.minuteLabel && /* @__PURE__ */ jsx54("span", { className: "ss-w-mon-min", children: match.minuteLabel }),
|
|
6416
|
+
match.competitionName && /* @__PURE__ */ jsx54("span", { className: "ss-w-mon-comp", children: match.competitionName }),
|
|
6417
|
+
/* @__PURE__ */ jsx54(PinToggle, { ui, monitor, pin: { kind: "match", matchId: match.matchId } })
|
|
6321
6418
|
] }),
|
|
6322
|
-
/* @__PURE__ */
|
|
6323
|
-
/* @__PURE__ */
|
|
6324
|
-
/* @__PURE__ */
|
|
6325
|
-
/* @__PURE__ */
|
|
6419
|
+
/* @__PURE__ */ jsxs49("div", { className: "ss-w-mon-main", children: [
|
|
6420
|
+
/* @__PURE__ */ jsxs49("span", { className: "ss-w-mon-side", children: [
|
|
6421
|
+
/* @__PURE__ */ jsx54(Crest2, { kind: "team", url: match.homeCrestUrl ?? void 0, name: match.homeTeamName ?? void 0 }),
|
|
6422
|
+
/* @__PURE__ */ jsx54("span", { className: "ss-w-mon-name", children: match.homeTeamName })
|
|
6326
6423
|
] }),
|
|
6327
|
-
match.phase === "preMatch" ? /* @__PURE__ */
|
|
6424
|
+
match.phase === "preMatch" ? /* @__PURE__ */ jsx54("span", { className: "ss-w-mon-vs", children: "vs" }) : /* @__PURE__ */ jsxs49("span", { className: "ss-w-mon-score", children: [
|
|
6328
6425
|
match.homeScore,
|
|
6329
|
-
/* @__PURE__ */
|
|
6426
|
+
/* @__PURE__ */ jsx54("i", { children: "\u2013" }),
|
|
6330
6427
|
match.awayScore
|
|
6331
6428
|
] }),
|
|
6332
|
-
/* @__PURE__ */
|
|
6333
|
-
/* @__PURE__ */
|
|
6334
|
-
/* @__PURE__ */
|
|
6429
|
+
/* @__PURE__ */ jsxs49("span", { className: "ss-w-mon-side ss-w-mon-side--away", children: [
|
|
6430
|
+
/* @__PURE__ */ jsx54(Crest2, { kind: "team", url: match.awayCrestUrl ?? void 0, name: match.awayTeamName ?? void 0 }),
|
|
6431
|
+
/* @__PURE__ */ jsx54("span", { className: "ss-w-mon-name", children: match.awayTeamName })
|
|
6335
6432
|
] })
|
|
6336
6433
|
] }),
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6434
|
+
match.phase === "preMatch" && match.formAndH2H && /* @__PURE__ */ jsx54(
|
|
6435
|
+
MonitorFormH2H,
|
|
6436
|
+
{
|
|
6437
|
+
formAndH2H: match.formAndH2H,
|
|
6438
|
+
homeTeamName: match.homeTeamName,
|
|
6439
|
+
awayTeamName: match.awayTeamName,
|
|
6440
|
+
ui
|
|
6441
|
+
}
|
|
6442
|
+
),
|
|
6443
|
+
(homeScorers.length > 0 || awayScorers.length > 0) && /* @__PURE__ */ jsxs49("div", { className: "ss-w-mon-scorers", children: [
|
|
6444
|
+
/* @__PURE__ */ jsx54("ul", { className: "ss-w-mon-scorers-col ss-w-mon-scorers-home", children: homeScorers.map((s, i) => /* @__PURE__ */ jsx54("li", { children: s.label }, `${s.player}-${i}`)) }),
|
|
6445
|
+
/* @__PURE__ */ jsx54("span", { className: "ss-w-mon-scorers-ball", "aria-hidden": "true", children: "\u26BD" }),
|
|
6446
|
+
/* @__PURE__ */ jsx54("ul", { className: "ss-w-mon-scorers-col ss-w-mon-scorers-away", children: awayScorers.map((s, i) => /* @__PURE__ */ jsx54("li", { children: s.label }, `${s.player}-${i}`)) })
|
|
6341
6447
|
] }),
|
|
6342
|
-
live && match.facts && match.facts.length > 0 && /* @__PURE__ */
|
|
6343
|
-
/* @__PURE__ */
|
|
6448
|
+
live && match.facts && match.facts.length > 0 && /* @__PURE__ */ jsx54(LiveFactBlock, { facts: match.facts, matchId: match.matchId, ui, slip, onAsk }),
|
|
6449
|
+
/* @__PURE__ */ jsx54("div", { className: "ss-w-mon-stats", children: orderedRows.map((row) => {
|
|
6344
6450
|
const total = row.homeNum + row.awayNum;
|
|
6345
6451
|
const homePct = total > 0 ? row.homeNum / total * 75 : 0;
|
|
6346
6452
|
const awayPct = total > 0 ? row.awayNum / total * 75 : 0;
|
|
6347
6453
|
const promoted = isPromoted(row, promotedPins);
|
|
6348
6454
|
const selection = chipSelection(row.market, match.matchId, slip.conversationId);
|
|
6349
|
-
return /* @__PURE__ */
|
|
6350
|
-
/* @__PURE__ */
|
|
6351
|
-
/* @__PURE__ */
|
|
6352
|
-
/* @__PURE__ */
|
|
6353
|
-
/* @__PURE__ */
|
|
6455
|
+
return /* @__PURE__ */ jsxs49("div", { className: promoted ? "ss-w-mon-stat ss-w-mon-pstrip" : "ss-w-mon-stat", children: [
|
|
6456
|
+
/* @__PURE__ */ jsxs49("div", { className: "ss-w-mon-stat-row", children: [
|
|
6457
|
+
/* @__PURE__ */ jsx54("span", { className: "ss-w-mon-stat-v ss-w-mon-stat-v--home", children: row.homeValue }),
|
|
6458
|
+
/* @__PURE__ */ jsx54("span", { className: "ss-w-mon-stat-l", children: row.label }),
|
|
6459
|
+
/* @__PURE__ */ jsx54("span", { className: "ss-w-mon-stat-v ss-w-mon-stat-v--away", children: row.awayValue })
|
|
6354
6460
|
] }),
|
|
6355
|
-
/* @__PURE__ */
|
|
6356
|
-
/* @__PURE__ */
|
|
6357
|
-
/* @__PURE__ */
|
|
6461
|
+
/* @__PURE__ */ jsxs49("div", { className: "ss-w-mon-bar", children: [
|
|
6462
|
+
/* @__PURE__ */ jsx54("b", { className: "ss-w-mon-bar-home", style: { width: `${homePct}%` } }),
|
|
6463
|
+
/* @__PURE__ */ jsx54("i", { className: "ss-w-mon-bar-away", style: { width: `${awayPct}%` } })
|
|
6358
6464
|
] }),
|
|
6359
|
-
row.market && !row.market.isSuspended && /* @__PURE__ */
|
|
6360
|
-
/* @__PURE__ */
|
|
6465
|
+
row.market && !row.market.isSuspended && /* @__PURE__ */ jsxs49("div", { className: promoted ? "ss-w-mon-stat-mkt ss-w-mon-mkt" : "ss-w-mon-stat-mkt", children: [
|
|
6466
|
+
/* @__PURE__ */ jsxs49("span", { children: [
|
|
6361
6467
|
row.market.marketLabel,
|
|
6362
6468
|
" \xB7 ",
|
|
6363
6469
|
row.market.selectionLabel
|
|
6364
6470
|
] }),
|
|
6365
|
-
/* @__PURE__ */
|
|
6366
|
-
typeof row.market.price === "number" && /* @__PURE__ */
|
|
6367
|
-
/* @__PURE__ */
|
|
6471
|
+
/* @__PURE__ */ jsxs49("span", { className: "ss-w-mon-stat-mkt-right", children: [
|
|
6472
|
+
typeof row.market.price === "number" && /* @__PURE__ */ jsx54("span", { className: "ss-w-mon-price", children: row.market.price.toFixed(2) }),
|
|
6473
|
+
/* @__PURE__ */ jsx54(
|
|
6368
6474
|
SlipButton,
|
|
6369
6475
|
{
|
|
6370
6476
|
selection,
|
|
@@ -6379,23 +6485,23 @@ function MonitorMatchCard({ match, promotedPins, monitor, ui, slip, onAsk }) {
|
|
|
6379
6485
|
] })
|
|
6380
6486
|
] }, row.label);
|
|
6381
6487
|
}) }),
|
|
6382
|
-
match.status === "stale" && /* @__PURE__ */
|
|
6383
|
-
match.momentum.length > 0 && /* @__PURE__ */
|
|
6384
|
-
/* @__PURE__ */
|
|
6385
|
-
/* @__PURE__ */
|
|
6488
|
+
match.status === "stale" && /* @__PURE__ */ jsx54("span", { className: "ss-w-mon-asof", children: ui.asOf(formatTime(match.asOfUtc)) }),
|
|
6489
|
+
match.momentum.length > 0 && /* @__PURE__ */ jsxs49("div", { className: "ss-w-mon-mom", children: [
|
|
6490
|
+
/* @__PURE__ */ jsx54("span", { className: "ss-w-mon-stat-l", children: ui.momentumLabel }),
|
|
6491
|
+
/* @__PURE__ */ jsx54(MomentumWave, { points: match.momentum, clubIsHome: true })
|
|
6386
6492
|
] }),
|
|
6387
|
-
match.phase === "fullTime" && /* @__PURE__ */
|
|
6493
|
+
match.phase === "fullTime" && /* @__PURE__ */ jsx54("div", { className: "ss-w-mon-grace", children: ui.graceNote })
|
|
6388
6494
|
] });
|
|
6389
6495
|
}
|
|
6390
6496
|
|
|
6391
6497
|
// src/components/MonitorTabs.tsx
|
|
6392
|
-
import { jsx as
|
|
6498
|
+
import { jsx as jsx55, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
6393
6499
|
function OddsLiveStrip({ m, ui }) {
|
|
6394
6500
|
const showScore = m.phase !== "preMatch" && typeof m.homeScore === "number";
|
|
6395
6501
|
const stale = m.status === "stale";
|
|
6396
6502
|
if (!showScore && !m.minuteLabel && !(m.isSuspended && !m.isSettled) && !m.isSettled && !stale) return null;
|
|
6397
|
-
return /* @__PURE__ */
|
|
6398
|
-
showScore && /* @__PURE__ */
|
|
6503
|
+
return /* @__PURE__ */ jsxs50("div", { className: "ss-w-mk-live", children: [
|
|
6504
|
+
showScore && /* @__PURE__ */ jsxs50("b", { className: "ss-w-mk-live-score", children: [
|
|
6399
6505
|
m.homeTeamName,
|
|
6400
6506
|
" ",
|
|
6401
6507
|
m.homeScore,
|
|
@@ -6404,19 +6510,19 @@ function OddsLiveStrip({ m, ui }) {
|
|
|
6404
6510
|
" ",
|
|
6405
6511
|
m.awayTeamName
|
|
6406
6512
|
] }),
|
|
6407
|
-
m.minuteLabel && /* @__PURE__ */
|
|
6408
|
-
m.isSuspended && !m.isSettled && /* @__PURE__ */
|
|
6409
|
-
m.isSettled && /* @__PURE__ */
|
|
6410
|
-
stale && /* @__PURE__ */
|
|
6513
|
+
m.minuteLabel && /* @__PURE__ */ jsx55("span", { className: "ss-w-mon-min", children: m.minuteLabel }),
|
|
6514
|
+
m.isSuspended && !m.isSettled && /* @__PURE__ */ jsx55("span", { className: "ss-w-mon-susp", children: ui.suspendedLabel }),
|
|
6515
|
+
m.isSettled && /* @__PURE__ */ jsx55("span", { className: "ss-w-mon-pill", children: ui.fullTimeLabel }),
|
|
6516
|
+
stale && /* @__PURE__ */ jsx55("span", { className: "ss-w-mon-asof", children: ui.asOf(new Date(m.asOfUtc).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })) })
|
|
6411
6517
|
] });
|
|
6412
6518
|
}
|
|
6413
6519
|
function MatchesPanel({ monitor, ui, slip, onAsk }) {
|
|
6414
6520
|
const matches = (monitor.snapshot?.matches ?? []).filter((m) => monitor.pins.some((p) => p.kind === "match" && p.matchId === m.matchId));
|
|
6415
6521
|
if (matches.length === 0) {
|
|
6416
|
-
return monitor.pins.some((p) => p.kind === "match") ? /* @__PURE__ */
|
|
6522
|
+
return monitor.pins.some((p) => p.kind === "match") ? /* @__PURE__ */ jsx55("div", { className: "ss-w-mon-list" }) : /* @__PURE__ */ jsx55("div", { className: "ss-w-mon-empty", children: ui.emptyMatchesTab });
|
|
6417
6523
|
}
|
|
6418
|
-
return /* @__PURE__ */
|
|
6419
|
-
/* @__PURE__ */
|
|
6524
|
+
return /* @__PURE__ */ jsx55("div", { className: "ss-w-mon-list", children: matches.map((m) => /* @__PURE__ */ jsxs50("div", { className: "ss-w-mon-item", children: [
|
|
6525
|
+
/* @__PURE__ */ jsx55(
|
|
6420
6526
|
MonitorMatchCard,
|
|
6421
6527
|
{
|
|
6422
6528
|
match: m,
|
|
@@ -6427,7 +6533,7 @@ function MatchesPanel({ monitor, ui, slip, onAsk }) {
|
|
|
6427
6533
|
onAsk
|
|
6428
6534
|
}
|
|
6429
6535
|
),
|
|
6430
|
-
/* @__PURE__ */
|
|
6536
|
+
/* @__PURE__ */ jsx55(MarketAccordion, { match: m, monitor, ui, slip })
|
|
6431
6537
|
] }, m.matchId)) });
|
|
6432
6538
|
}
|
|
6433
6539
|
function withSinceViewMovement(vm, prev) {
|
|
@@ -6443,12 +6549,12 @@ function withSinceViewMovement(vm, prev) {
|
|
|
6443
6549
|
function OddsPanel({ monitor, ui, slip }) {
|
|
6444
6550
|
const slipState = useSlipState();
|
|
6445
6551
|
const markets = (monitor.snapshot?.markets ?? []).filter((m) => monitor.pins.some((p) => p.key === m.key));
|
|
6446
|
-
if (markets.length === 0) return /* @__PURE__ */
|
|
6447
|
-
return /* @__PURE__ */
|
|
6552
|
+
if (markets.length === 0) return /* @__PURE__ */ jsx55("div", { className: "ss-w-mon-empty", children: ui.emptyOddsTab });
|
|
6553
|
+
return /* @__PURE__ */ jsx55("div", { className: "ss-w-mon-list", children: markets.map((m) => {
|
|
6448
6554
|
const pin = monitor.pins.find((p) => p.key === m.key);
|
|
6449
|
-
return /* @__PURE__ */
|
|
6450
|
-
/* @__PURE__ */
|
|
6451
|
-
m.card && /* @__PURE__ */
|
|
6555
|
+
return /* @__PURE__ */ jsxs50("div", { className: "ss-w-mon-oddspin", "data-settled": m.isSettled || void 0, children: [
|
|
6556
|
+
/* @__PURE__ */ jsx55(OddsLiveStrip, { m, ui }),
|
|
6557
|
+
m.card && /* @__PURE__ */ jsx55(
|
|
6452
6558
|
MarketOddsCardList,
|
|
6453
6559
|
{
|
|
6454
6560
|
cards: [withSinceViewMovement(toMarketOddsVM(m.card), monitor.lastViewedPrices[m.key])],
|
|
@@ -6459,14 +6565,14 @@ function OddsPanel({ monitor, ui, slip }) {
|
|
|
6459
6565
|
inSlipIds: slipState?.added
|
|
6460
6566
|
}
|
|
6461
6567
|
),
|
|
6462
|
-
m.history && /* @__PURE__ */
|
|
6463
|
-
!m.card && !m.history && /* @__PURE__ */
|
|
6568
|
+
m.history && /* @__PURE__ */ jsx55(OddsMovementCardList, { cards: [toOddsMovementVM(m.history)], ui }),
|
|
6569
|
+
!m.card && !m.history && /* @__PURE__ */ jsx55("div", { className: "ss-w-mon-empty-card", children: ui.oddsUnavailable })
|
|
6464
6570
|
] }, m.key);
|
|
6465
6571
|
}) });
|
|
6466
6572
|
}
|
|
6467
6573
|
|
|
6468
6574
|
// src/components/TodayPanel.tsx
|
|
6469
|
-
import { useEffect as useEffect26, useId as useId2, useMemo as useMemo4, useState as
|
|
6575
|
+
import { useEffect as useEffect26, useId as useId2, useMemo as useMemo4, useState as useState35 } from "react";
|
|
6470
6576
|
|
|
6471
6577
|
// src/placement.ts
|
|
6472
6578
|
function placeLeagues(visible, pinnedMatchIds) {
|
|
@@ -6529,9 +6635,9 @@ function matchingFixtures(group, query) {
|
|
|
6529
6635
|
}
|
|
6530
6636
|
|
|
6531
6637
|
// src/useStarTap.ts
|
|
6532
|
-
import { useCallback as useCallback18, useRef as useRef23, useState as
|
|
6638
|
+
import { useCallback as useCallback18, useRef as useRef23, useState as useState33 } from "react";
|
|
6533
6639
|
function useStarTap(starLeague) {
|
|
6534
|
-
const [pendingId, setPendingId] =
|
|
6640
|
+
const [pendingId, setPendingId] = useState33(null);
|
|
6535
6641
|
const pendingRef = useRef23(null);
|
|
6536
6642
|
const tap = useCallback18(async (competitionId, next) => {
|
|
6537
6643
|
if (pendingRef.current !== null) return false;
|
|
@@ -6548,25 +6654,25 @@ function useStarTap(starLeague) {
|
|
|
6548
6654
|
}
|
|
6549
6655
|
|
|
6550
6656
|
// src/components/LeagueTile.tsx
|
|
6551
|
-
import { jsx as
|
|
6657
|
+
import { jsx as jsx56, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
6552
6658
|
var STAR_PATH = "M12 2.5l2.9 5.9 6.5.95-4.7 4.58 1.1 6.47L12 17.35 6.1 20.4l1.1-6.47L2.5 9.35l6.5-.95z";
|
|
6553
6659
|
function LeagueTile({ group, starClickable: starClickable2, disambiguate, onOpen, starTap, ui }) {
|
|
6554
6660
|
const onStarClick = () => {
|
|
6555
6661
|
void starTap.tap(group.competitionId, !group.isStarred);
|
|
6556
6662
|
};
|
|
6557
|
-
return /* @__PURE__ */
|
|
6558
|
-
/* @__PURE__ */
|
|
6559
|
-
/* @__PURE__ */
|
|
6560
|
-
/* @__PURE__ */
|
|
6663
|
+
return /* @__PURE__ */ jsxs51("div", { className: "ss-w-today-tile", children: [
|
|
6664
|
+
/* @__PURE__ */ jsxs51("button", { type: "button", className: "ss-w-today-tile-body", onClick: onOpen, children: [
|
|
6665
|
+
/* @__PURE__ */ jsx56(Crest2, { url: group.competitionImagePath ?? void 0, name: group.competitionName, kind: "comp" }),
|
|
6666
|
+
/* @__PURE__ */ jsxs51("span", { className: "ss-w-today-tile-name", children: [
|
|
6561
6667
|
group.competitionName,
|
|
6562
|
-
disambiguate && group.competitionCountry ? /* @__PURE__ */
|
|
6668
|
+
disambiguate && group.competitionCountry ? /* @__PURE__ */ jsxs51("span", { className: "ss-w-today-tile-country", children: [
|
|
6563
6669
|
" (",
|
|
6564
6670
|
group.competitionCountry,
|
|
6565
6671
|
")"
|
|
6566
6672
|
] }) : null
|
|
6567
6673
|
] })
|
|
6568
6674
|
] }),
|
|
6569
|
-
/* @__PURE__ */
|
|
6675
|
+
/* @__PURE__ */ jsx56(
|
|
6570
6676
|
"button",
|
|
6571
6677
|
{
|
|
6572
6678
|
type: "button",
|
|
@@ -6575,7 +6681,7 @@ function LeagueTile({ group, starClickable: starClickable2, disambiguate, onOpen
|
|
|
6575
6681
|
"aria-label": group.isStarred ? ui.starOffLabel : ui.starOnLabel,
|
|
6576
6682
|
disabled: !starClickable2 || starTap.pendingId !== null,
|
|
6577
6683
|
onClick: onStarClick,
|
|
6578
|
-
children: /* @__PURE__ */
|
|
6684
|
+
children: /* @__PURE__ */ jsx56("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx56(
|
|
6579
6685
|
"path",
|
|
6580
6686
|
{
|
|
6581
6687
|
d: STAR_PATH,
|
|
@@ -6592,18 +6698,18 @@ function LeagueTile({ group, starClickable: starClickable2, disambiguate, onOpen
|
|
|
6592
6698
|
}
|
|
6593
6699
|
|
|
6594
6700
|
// src/components/LeagueDetail.tsx
|
|
6595
|
-
import { useEffect as useEffect25, useState as
|
|
6701
|
+
import { useEffect as useEffect25, useState as useState34 } from "react";
|
|
6596
6702
|
|
|
6597
6703
|
// src/components/FixtureRow.tsx
|
|
6598
|
-
import { jsx as
|
|
6704
|
+
import { jsx as jsx57, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
6599
6705
|
function kickoffLabel(kickoffUnix) {
|
|
6600
6706
|
const d = new Date(kickoffUnix * 1e3);
|
|
6601
6707
|
return `${`${d.getHours()}`.padStart(2, "0")}:${`${d.getMinutes()}`.padStart(2, "0")}`;
|
|
6602
6708
|
}
|
|
6603
6709
|
function Side({ name, crest, away = false }) {
|
|
6604
|
-
return /* @__PURE__ */
|
|
6605
|
-
crest ? /* @__PURE__ */
|
|
6606
|
-
/* @__PURE__ */
|
|
6710
|
+
return /* @__PURE__ */ jsxs52("span", { className: away ? "ss-w-drow-side ss-w-drow-side--away" : "ss-w-drow-side", children: [
|
|
6711
|
+
crest ? /* @__PURE__ */ jsx57("img", { className: "ss-w-drow-crest", src: crest, alt: "" }) : null,
|
|
6712
|
+
/* @__PURE__ */ jsx57("span", { className: "ss-w-drow-nm", children: name })
|
|
6607
6713
|
] });
|
|
6608
6714
|
}
|
|
6609
6715
|
function FixtureRow({ match, state, stale, ui, monitor }) {
|
|
@@ -6612,22 +6718,22 @@ function FixtureRow({ match, state, stale, ui, monitor }) {
|
|
|
6612
6718
|
const score = hasScore ? `${state.homeScore}\u2013${state.awayScore}` : void 0;
|
|
6613
6719
|
const ticked = state?.phase === "live" ? state.minuteLabel ?? null : null;
|
|
6614
6720
|
const when = state?.isHalfTime && !stale ? ui.halfTime : isLive ? ticked ?? "\u2014" : state?.phase === "live" ? "\u2014" : kickoffLabel(match.kickoffUnix);
|
|
6615
|
-
return /* @__PURE__ */
|
|
6616
|
-
/* @__PURE__ */
|
|
6617
|
-
/* @__PURE__ */
|
|
6618
|
-
/* @__PURE__ */
|
|
6619
|
-
/* @__PURE__ */
|
|
6620
|
-
/* @__PURE__ */
|
|
6721
|
+
return /* @__PURE__ */ jsxs52("div", { className: isLive || state?.isHalfTime ? "ss-w-drow ss-w-drow--live" : "ss-w-drow", children: [
|
|
6722
|
+
/* @__PURE__ */ jsx57("span", { className: isLive || state?.isHalfTime ? "ss-w-drow-when ss-w-drow-when--live" : "ss-w-drow-when", children: when }),
|
|
6723
|
+
/* @__PURE__ */ jsxs52("span", { className: "ss-w-drow-fx", children: [
|
|
6724
|
+
/* @__PURE__ */ jsx57(Side, { name: match.homeTeamName, crest: match.homeTeamImagePath }),
|
|
6725
|
+
/* @__PURE__ */ jsx57("span", { className: hasScore ? "ss-w-drow-sc" : "ss-w-drow-sc ss-w-drow-sc--idle", children: score ?? "\u2013" }),
|
|
6726
|
+
/* @__PURE__ */ jsx57(Side, { name: match.awayTeamName, crest: match.awayTeamImagePath, away: true })
|
|
6621
6727
|
] }),
|
|
6622
|
-
/* @__PURE__ */
|
|
6728
|
+
/* @__PURE__ */ jsx57(PinToggle, { ui, monitor, pin: { kind: "match", matchId: match.matchId } })
|
|
6623
6729
|
] });
|
|
6624
6730
|
}
|
|
6625
6731
|
|
|
6626
6732
|
// src/components/LeagueDetail.tsx
|
|
6627
|
-
import { jsx as
|
|
6733
|
+
import { jsx as jsx58, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
6628
6734
|
var STAR_PATH2 = "M12 2.5l2.9 5.9 6.5.95-4.7 4.58 1.1 6.47L12 17.35 6.1 20.4l1.1-6.47L2.5 9.35l6.5-.95z";
|
|
6629
6735
|
function LeagueDetail({ group, position, states, stale, ui, monitor, starTap, onBack, onPrev, onNext }) {
|
|
6630
|
-
const [toast, setToast] =
|
|
6736
|
+
const [toast, setToast] = useState34(null);
|
|
6631
6737
|
useEffect25(() => {
|
|
6632
6738
|
setToast(null);
|
|
6633
6739
|
}, [group.competitionId]);
|
|
@@ -6643,12 +6749,12 @@ function LeagueDetail({ group, position, states, stale, ui, monitor, starTap, on
|
|
|
6643
6749
|
if (ok) setToast(next ? ui.starredToast : ui.unstarredToast);
|
|
6644
6750
|
});
|
|
6645
6751
|
};
|
|
6646
|
-
return /* @__PURE__ */
|
|
6647
|
-
/* @__PURE__ */
|
|
6648
|
-
/* @__PURE__ */
|
|
6649
|
-
/* @__PURE__ */
|
|
6650
|
-
/* @__PURE__ */
|
|
6651
|
-
/* @__PURE__ */
|
|
6752
|
+
return /* @__PURE__ */ jsxs53("div", { className: "ss-w-today-detail", children: [
|
|
6753
|
+
/* @__PURE__ */ jsxs53("div", { className: "ss-w-today-detail-head", children: [
|
|
6754
|
+
/* @__PURE__ */ jsx58("button", { type: "button", className: "ss-w-today-detail-back", "aria-label": ui.back, onClick: onBack, children: /* @__PURE__ */ jsx58(ChevronIcon, {}) }),
|
|
6755
|
+
/* @__PURE__ */ jsx58(Crest2, { url: group.competitionImagePath ?? void 0, name: group.competitionName, kind: "comp" }),
|
|
6756
|
+
/* @__PURE__ */ jsx58("span", { className: "ss-w-today-detail-name", children: group.competitionName }),
|
|
6757
|
+
/* @__PURE__ */ jsx58(
|
|
6652
6758
|
"button",
|
|
6653
6759
|
{
|
|
6654
6760
|
type: "button",
|
|
@@ -6657,7 +6763,7 @@ function LeagueDetail({ group, position, states, stale, ui, monitor, starTap, on
|
|
|
6657
6763
|
"aria-label": group.isStarred ? ui.starOffLabel : ui.starOnLabel,
|
|
6658
6764
|
disabled: starTap.pendingId !== null,
|
|
6659
6765
|
onClick: onStarClick,
|
|
6660
|
-
children: /* @__PURE__ */
|
|
6766
|
+
children: /* @__PURE__ */ jsx58("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx58(
|
|
6661
6767
|
"path",
|
|
6662
6768
|
{
|
|
6663
6769
|
d: STAR_PATH2,
|
|
@@ -6671,8 +6777,8 @@ function LeagueDetail({ group, position, states, stale, ui, monitor, starTap, on
|
|
|
6671
6777
|
}
|
|
6672
6778
|
)
|
|
6673
6779
|
] }),
|
|
6674
|
-
/* @__PURE__ */
|
|
6675
|
-
/* @__PURE__ */
|
|
6780
|
+
/* @__PURE__ */ jsxs53("div", { className: "ss-w-today-detail-nav", children: [
|
|
6781
|
+
/* @__PURE__ */ jsx58(
|
|
6676
6782
|
"button",
|
|
6677
6783
|
{
|
|
6678
6784
|
type: "button",
|
|
@@ -6680,11 +6786,11 @@ function LeagueDetail({ group, position, states, stale, ui, monitor, starTap, on
|
|
|
6680
6786
|
"aria-label": ui.prevLeagueLabel,
|
|
6681
6787
|
disabled: position.index <= 1,
|
|
6682
6788
|
onClick: onPrev,
|
|
6683
|
-
children: /* @__PURE__ */
|
|
6789
|
+
children: /* @__PURE__ */ jsx58(ChevronIcon, {})
|
|
6684
6790
|
}
|
|
6685
6791
|
),
|
|
6686
|
-
/* @__PURE__ */
|
|
6687
|
-
/* @__PURE__ */
|
|
6792
|
+
/* @__PURE__ */ jsx58("span", { className: "ss-w-today-detail-pos", children: ui.leagueDetailPosition(position.index, position.total) }),
|
|
6793
|
+
/* @__PURE__ */ jsx58(
|
|
6688
6794
|
"button",
|
|
6689
6795
|
{
|
|
6690
6796
|
type: "button",
|
|
@@ -6692,20 +6798,20 @@ function LeagueDetail({ group, position, states, stale, ui, monitor, starTap, on
|
|
|
6692
6798
|
"aria-label": ui.nextLeagueLabel,
|
|
6693
6799
|
disabled: position.index >= position.total,
|
|
6694
6800
|
onClick: onNext,
|
|
6695
|
-
children: /* @__PURE__ */
|
|
6801
|
+
children: /* @__PURE__ */ jsx58(ChevronIcon, {})
|
|
6696
6802
|
}
|
|
6697
6803
|
)
|
|
6698
6804
|
] }),
|
|
6699
|
-
/* @__PURE__ */
|
|
6700
|
-
/* @__PURE__ */
|
|
6701
|
-
own.map((m) => /* @__PURE__ */
|
|
6805
|
+
/* @__PURE__ */ jsxs53("div", { className: "ss-w-today-detail-body", children: [
|
|
6806
|
+
/* @__PURE__ */ jsx58("span", { className: "ss-w-today-detail-count", children: own.length }),
|
|
6807
|
+
own.map((m) => /* @__PURE__ */ jsx58(FixtureRow, { match: m, state: states[m.matchId], stale, ui, monitor }, m.matchId))
|
|
6702
6808
|
] }),
|
|
6703
|
-
toast !== null && /* @__PURE__ */
|
|
6809
|
+
toast !== null && /* @__PURE__ */ jsx58("p", { className: "ss-w-today-toast", role: "status", "aria-live": "polite", children: toast })
|
|
6704
6810
|
] });
|
|
6705
6811
|
}
|
|
6706
6812
|
|
|
6707
6813
|
// src/components/LeagueRowGroup.tsx
|
|
6708
|
-
import { jsx as
|
|
6814
|
+
import { jsx as jsx59, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
6709
6815
|
var ROW_CAP_PER_LEAGUE = 3;
|
|
6710
6816
|
var SECTION_ROW_BUDGET = 12;
|
|
6711
6817
|
function rowsFor(group, states, stale) {
|
|
@@ -6721,20 +6827,20 @@ function LeagueRowGroup({ group, states, stale, cap, starClickable: starClickabl
|
|
|
6721
6827
|
const onStarClick = () => {
|
|
6722
6828
|
void starTap.tap(group.competitionId, !group.isStarred);
|
|
6723
6829
|
};
|
|
6724
|
-
return /* @__PURE__ */
|
|
6725
|
-
/* @__PURE__ */
|
|
6726
|
-
/* @__PURE__ */
|
|
6727
|
-
/* @__PURE__ */
|
|
6728
|
-
/* @__PURE__ */
|
|
6830
|
+
return /* @__PURE__ */ jsxs54("div", { className: "ss-w-today-rowgroup", children: [
|
|
6831
|
+
/* @__PURE__ */ jsxs54("div", { className: "ss-w-today-rowgroup-head", children: [
|
|
6832
|
+
/* @__PURE__ */ jsxs54("button", { type: "button", className: "ss-w-today-rowgroup-head-body", onClick: onOpen, children: [
|
|
6833
|
+
/* @__PURE__ */ jsx59(Crest2, { url: group.competitionImagePath ?? void 0, name: group.competitionName, kind: "comp" }),
|
|
6834
|
+
/* @__PURE__ */ jsxs54("span", { className: "ss-w-today-rowgroup-name", children: [
|
|
6729
6835
|
group.competitionName,
|
|
6730
|
-
disambiguate && group.competitionCountry ? /* @__PURE__ */
|
|
6836
|
+
disambiguate && group.competitionCountry ? /* @__PURE__ */ jsxs54("span", { className: "ss-w-today-tile-country", children: [
|
|
6731
6837
|
" (",
|
|
6732
6838
|
group.competitionCountry,
|
|
6733
6839
|
")"
|
|
6734
6840
|
] }) : null
|
|
6735
6841
|
] })
|
|
6736
6842
|
] }),
|
|
6737
|
-
/* @__PURE__ */
|
|
6843
|
+
/* @__PURE__ */ jsx59(
|
|
6738
6844
|
"button",
|
|
6739
6845
|
{
|
|
6740
6846
|
type: "button",
|
|
@@ -6743,7 +6849,7 @@ function LeagueRowGroup({ group, states, stale, cap, starClickable: starClickabl
|
|
|
6743
6849
|
"aria-label": group.isStarred ? ui.starOffLabel : ui.starOnLabel,
|
|
6744
6850
|
disabled: !starClickable2 || starTap.pendingId !== null,
|
|
6745
6851
|
onClick: onStarClick,
|
|
6746
|
-
children: /* @__PURE__ */
|
|
6852
|
+
children: /* @__PURE__ */ jsx59("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx59(
|
|
6747
6853
|
"path",
|
|
6748
6854
|
{
|
|
6749
6855
|
d: STAR_PATH3,
|
|
@@ -6757,8 +6863,8 @@ function LeagueRowGroup({ group, states, stale, cap, starClickable: starClickabl
|
|
|
6757
6863
|
}
|
|
6758
6864
|
)
|
|
6759
6865
|
] }),
|
|
6760
|
-
/* @__PURE__ */
|
|
6761
|
-
overflow > 0 && /* @__PURE__ */
|
|
6866
|
+
/* @__PURE__ */ jsx59("div", { className: "ss-w-today-rowgroup-rows", children: shown.map((m) => /* @__PURE__ */ jsx59(FixtureRow, { match: m, state: states[m.matchId], stale, ui, monitor }, m.matchId)) }),
|
|
6867
|
+
overflow > 0 && /* @__PURE__ */ jsx59("button", { type: "button", className: "ss-w-today-rowgroup-seeall", onClick: onOpen, children: ui.seeAllFixturesLabel(sorted.length) })
|
|
6762
6868
|
] });
|
|
6763
6869
|
}
|
|
6764
6870
|
|
|
@@ -6766,8 +6872,8 @@ function LeagueRowGroup({ group, states, stale, cap, starClickable: starClickabl
|
|
|
6766
6872
|
import { useCallback as useCallback19, useRef as useRef24 } from "react";
|
|
6767
6873
|
|
|
6768
6874
|
// src/components/games/ui/icons.tsx
|
|
6769
|
-
import { jsx as
|
|
6770
|
-
var svg = (size, children, fill = false) => /* @__PURE__ */
|
|
6875
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
6876
|
+
var svg = (size, children, fill = false) => /* @__PURE__ */ jsx60(
|
|
6771
6877
|
"svg",
|
|
6772
6878
|
{
|
|
6773
6879
|
width: size,
|
|
@@ -6782,25 +6888,25 @@ var svg = (size, children, fill = false) => /* @__PURE__ */ jsx59(
|
|
|
6782
6888
|
children
|
|
6783
6889
|
}
|
|
6784
6890
|
);
|
|
6785
|
-
var IconChevronLeft = ({ size = 20 }) => svg(size, /* @__PURE__ */
|
|
6786
|
-
var IconLock = ({ size = 14 }) => svg(size, [/* @__PURE__ */
|
|
6787
|
-
var IconCheck = ({ size = 14 }) => svg(size, /* @__PURE__ */
|
|
6788
|
-
var IconClose = ({ size = 16 }) => svg(size, /* @__PURE__ */
|
|
6789
|
-
var IconSearch = ({ size = 18 }) => svg(size, [/* @__PURE__ */
|
|
6790
|
-
var IconPlus = ({ size = 20 }) => svg(size, /* @__PURE__ */
|
|
6791
|
-
var IconBulb = ({ size = 16 }) => svg(size, [/* @__PURE__ */
|
|
6792
|
-
var IconArrowUp = ({ size = 12 }) => svg(size, /* @__PURE__ */
|
|
6793
|
-
var IconArrowDown = ({ size = 12 }) => svg(size, /* @__PURE__ */
|
|
6794
|
-
var IconCalendar = ({ size = 18 }) => svg(size, [/* @__PURE__ */
|
|
6795
|
-
var IconShield = ({ size = 18 }) => svg(size, /* @__PURE__ */
|
|
6796
|
-
var IconFlag = ({ size = 18 }) => svg(size, /* @__PURE__ */
|
|
6797
|
-
var IconBall = ({ size = 18 }) => svg(size, [/* @__PURE__ */
|
|
6798
|
-
var IconBoot = ({ size = 18 }) => svg(size, /* @__PURE__ */
|
|
6799
|
-
var IconGloves = ({ size = 18 }) => svg(size, /* @__PURE__ */
|
|
6800
|
-
var IconFlame = ({ size = 16 }) => svg(size, /* @__PURE__ */
|
|
6891
|
+
var IconChevronLeft = ({ size = 20 }) => svg(size, /* @__PURE__ */ jsx60("path", { d: "M15 18l-6-6 6-6" }));
|
|
6892
|
+
var IconLock = ({ size = 14 }) => svg(size, [/* @__PURE__ */ jsx60("rect", { x: "5", y: "11", width: "14", height: "10", rx: "2" }, "a"), /* @__PURE__ */ jsx60("path", { d: "M8 11V7a4 4 0 0 1 8 0v4" }, "b")]);
|
|
6893
|
+
var IconCheck = ({ size = 14 }) => svg(size, /* @__PURE__ */ jsx60("path", { d: "M5 12l5 5 9-10" }));
|
|
6894
|
+
var IconClose = ({ size = 16 }) => svg(size, /* @__PURE__ */ jsx60("path", { d: "M6 6l12 12M18 6L6 18" }));
|
|
6895
|
+
var IconSearch = ({ size = 18 }) => svg(size, [/* @__PURE__ */ jsx60("circle", { cx: "11", cy: "11", r: "7" }, "a"), /* @__PURE__ */ jsx60("path", { d: "M20 20l-3.5-3.5" }, "b")]);
|
|
6896
|
+
var IconPlus = ({ size = 20 }) => svg(size, /* @__PURE__ */ jsx60("path", { d: "M12 5v14M5 12h14" }));
|
|
6897
|
+
var IconBulb = ({ size = 16 }) => svg(size, [/* @__PURE__ */ jsx60("path", { d: "M9 18h6M10 21h4" }, "a"), /* @__PURE__ */ jsx60("path", { d: "M12 3a6 6 0 0 0-3.5 10.9V16h7v-2.1A6 6 0 0 0 12 3z" }, "b")]);
|
|
6898
|
+
var IconArrowUp = ({ size = 12 }) => svg(size, /* @__PURE__ */ jsx60("path", { d: "M12 19V5M5 12l7-7 7 7" }));
|
|
6899
|
+
var IconArrowDown = ({ size = 12 }) => svg(size, /* @__PURE__ */ jsx60("path", { d: "M12 5v14M19 12l-7 7-7-7" }));
|
|
6900
|
+
var IconCalendar = ({ size = 18 }) => svg(size, [/* @__PURE__ */ jsx60("rect", { x: "4", y: "5", width: "16", height: "15", rx: "2" }, "a"), /* @__PURE__ */ jsx60("path", { d: "M4 10h16M9 3v4M15 3v4" }, "b")]);
|
|
6901
|
+
var IconShield = ({ size = 18 }) => svg(size, /* @__PURE__ */ jsx60("path", { d: "M12 3l7 3v6c0 5-3 8-7 9-4-1-7-4-7-9V6z" }));
|
|
6902
|
+
var IconFlag = ({ size = 18 }) => svg(size, /* @__PURE__ */ jsx60("path", { d: "M5 21V4M5 4h12l-2 4 2 4H5" }));
|
|
6903
|
+
var IconBall = ({ size = 18 }) => svg(size, [/* @__PURE__ */ jsx60("circle", { cx: "12", cy: "12", r: "9" }, "a"), /* @__PURE__ */ jsx60("path", { d: "M12 7l4 3-1.5 4.5h-5L8 10z" }, "b")]);
|
|
6904
|
+
var IconBoot = ({ size = 18 }) => svg(size, /* @__PURE__ */ jsx60("path", { d: "M4 6h6l1 6 8 3v3H4z" }));
|
|
6905
|
+
var IconGloves = ({ size = 18 }) => svg(size, /* @__PURE__ */ jsx60("path", { d: "M7 21v-8l-2-3V6a1.5 1.5 0 0 1 3 0v3V4a1.5 1.5 0 0 1 3 0v5V3.5a1.5 1.5 0 0 1 3 0V9V5a1.5 1.5 0 0 1 3 0v9l-2 3v4z" }));
|
|
6906
|
+
var IconFlame = ({ size = 16 }) => svg(size, /* @__PURE__ */ jsx60("path", { d: "M12 3c1 4 5 5 5 10a5 5 0 0 1-10 0c0-3 2-4 2-7 1.5 1 2 2 2 3 1-2 1-4 1-6z" }), true);
|
|
6801
6907
|
|
|
6802
6908
|
// src/components/games/ui/SearchField.tsx
|
|
6803
|
-
import { jsx as
|
|
6909
|
+
import { jsx as jsx61, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
6804
6910
|
function SearchField({ id, label, labelHidden = false, placeholder, value, onChange, disabled, inputRef, onKeyDown, clearLabel }) {
|
|
6805
6911
|
const localRef = useRef24(null);
|
|
6806
6912
|
const setInputRef = useCallback19((node) => {
|
|
@@ -6808,11 +6914,11 @@ function SearchField({ id, label, labelHidden = false, placeholder, value, onCha
|
|
|
6808
6914
|
if (typeof inputRef === "function") inputRef(node);
|
|
6809
6915
|
else if (inputRef) inputRef.current = node;
|
|
6810
6916
|
}, [inputRef]);
|
|
6811
|
-
return /* @__PURE__ */
|
|
6812
|
-
/* @__PURE__ */
|
|
6813
|
-
/* @__PURE__ */
|
|
6814
|
-
/* @__PURE__ */
|
|
6815
|
-
/* @__PURE__ */
|
|
6917
|
+
return /* @__PURE__ */ jsxs55("div", { className: "ss-g-search", children: [
|
|
6918
|
+
/* @__PURE__ */ jsx61("label", { htmlFor: id, className: labelHidden ? "ss-g-sr" : "ss-g-search-label", children: label }),
|
|
6919
|
+
/* @__PURE__ */ jsxs55("div", { className: "ss-g-search-box", children: [
|
|
6920
|
+
/* @__PURE__ */ jsx61(IconSearch, {}),
|
|
6921
|
+
/* @__PURE__ */ jsx61(
|
|
6816
6922
|
"input",
|
|
6817
6923
|
{
|
|
6818
6924
|
id,
|
|
@@ -6826,7 +6932,7 @@ function SearchField({ id, label, labelHidden = false, placeholder, value, onCha
|
|
|
6826
6932
|
onChange: (e) => onChange(e.target.value)
|
|
6827
6933
|
}
|
|
6828
6934
|
),
|
|
6829
|
-
clearLabel && value.length > 0 ? /* @__PURE__ */
|
|
6935
|
+
clearLabel && value.length > 0 ? /* @__PURE__ */ jsx61(
|
|
6830
6936
|
"button",
|
|
6831
6937
|
{
|
|
6832
6938
|
type: "button",
|
|
@@ -6836,7 +6942,7 @@ function SearchField({ id, label, labelHidden = false, placeholder, value, onCha
|
|
|
6836
6942
|
onChange("");
|
|
6837
6943
|
localRef.current?.focus();
|
|
6838
6944
|
},
|
|
6839
|
-
children: /* @__PURE__ */
|
|
6945
|
+
children: /* @__PURE__ */ jsx61(IconClose, { size: 11 })
|
|
6840
6946
|
}
|
|
6841
6947
|
) : null
|
|
6842
6948
|
] })
|
|
@@ -6844,13 +6950,13 @@ function SearchField({ id, label, labelHidden = false, placeholder, value, onCha
|
|
|
6844
6950
|
}
|
|
6845
6951
|
|
|
6846
6952
|
// src/components/TodayPanel.tsx
|
|
6847
|
-
import { Fragment as
|
|
6953
|
+
import { Fragment as Fragment9, jsx as jsx62, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
6848
6954
|
function TodayPanel({ discovery, ui, monitor }) {
|
|
6849
6955
|
const { groups, states, stale, starLeague } = discovery;
|
|
6850
6956
|
const searchId = useId2();
|
|
6851
|
-
const [query, setQuery] =
|
|
6852
|
-
const [selectedCompetitionId, setSelectedCompetitionId] =
|
|
6853
|
-
const [toast, setToast] =
|
|
6957
|
+
const [query, setQuery] = useState35("");
|
|
6958
|
+
const [selectedCompetitionId, setSelectedCompetitionId] = useState35(null);
|
|
6959
|
+
const [toast, setToast] = useState35(null);
|
|
6854
6960
|
useEffect26(() => {
|
|
6855
6961
|
if (toast === null) return;
|
|
6856
6962
|
const id = setTimeout(() => setToast(null), 4e3);
|
|
@@ -6901,12 +7007,12 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
6901
7007
|
if (selectedCompetitionId !== null && openGroup === void 0) setSelectedCompetitionId(null);
|
|
6902
7008
|
}, [selectedCompetitionId, openGroup]);
|
|
6903
7009
|
const liveRows = stale ? [] : visibleGroups.flatMap((group) => group.matches.filter((m) => isTreatedLive(states[m.matchId], stale)).map((match) => ({ match, rank: group.rank }))).sort((a, b) => a.rank - b.rank);
|
|
6904
|
-
const liveBand = liveRows.length > 0 && /* @__PURE__ */
|
|
6905
|
-
/* @__PURE__ */
|
|
6906
|
-
/* @__PURE__ */
|
|
7010
|
+
const liveBand = liveRows.length > 0 && /* @__PURE__ */ jsxs56(Fragment9, { children: [
|
|
7011
|
+
/* @__PURE__ */ jsxs56("div", { className: "ss-w-sec-head", children: [
|
|
7012
|
+
/* @__PURE__ */ jsx62("span", { className: "ss-w-sec-dot", "aria-hidden": "true" }),
|
|
6907
7013
|
ui.sectionLive
|
|
6908
7014
|
] }),
|
|
6909
|
-
/* @__PURE__ */
|
|
7015
|
+
/* @__PURE__ */ jsx62("div", { className: "ss-w-today-live", children: liveRows.map(({ match }) => /* @__PURE__ */ jsx62(
|
|
6910
7016
|
FixtureRow,
|
|
6911
7017
|
{
|
|
6912
7018
|
match,
|
|
@@ -6919,10 +7025,10 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
6919
7025
|
)) })
|
|
6920
7026
|
] });
|
|
6921
7027
|
if (openGroup !== void 0) {
|
|
6922
|
-
return /* @__PURE__ */
|
|
6923
|
-
stale && /* @__PURE__ */
|
|
7028
|
+
return /* @__PURE__ */ jsx62("div", { className: "ss-w-today-root", children: /* @__PURE__ */ jsxs56("div", { className: "ss-w-mon-list", children: [
|
|
7029
|
+
stale && /* @__PURE__ */ jsx62("div", { className: "ss-w-stale", children: ui.staleStates }),
|
|
6924
7030
|
liveBand,
|
|
6925
|
-
/* @__PURE__ */
|
|
7031
|
+
/* @__PURE__ */ jsx62(
|
|
6926
7032
|
LeagueDetail,
|
|
6927
7033
|
{
|
|
6928
7034
|
group: openGroup,
|
|
@@ -6943,11 +7049,11 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
6943
7049
|
}
|
|
6944
7050
|
const searching = query.trim().length > 0;
|
|
6945
7051
|
const searchResults = searching ? placement.order.filter((g) => matchesQuery(g, query)) : [];
|
|
6946
|
-
return /* @__PURE__ */
|
|
6947
|
-
/* @__PURE__ */
|
|
6948
|
-
stale && /* @__PURE__ */
|
|
7052
|
+
return /* @__PURE__ */ jsxs56("div", { className: "ss-w-today-root", children: [
|
|
7053
|
+
/* @__PURE__ */ jsxs56("div", { className: "ss-w-mon-list", children: [
|
|
7054
|
+
stale && /* @__PURE__ */ jsx62("div", { className: "ss-w-stale", children: ui.staleStates }),
|
|
6949
7055
|
!searching && liveBand,
|
|
6950
|
-
/* @__PURE__ */
|
|
7056
|
+
/* @__PURE__ */ jsx62(
|
|
6951
7057
|
SearchField,
|
|
6952
7058
|
{
|
|
6953
7059
|
id: searchId,
|
|
@@ -6959,19 +7065,19 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
6959
7065
|
clearLabel: ui.clearSearchLabel
|
|
6960
7066
|
}
|
|
6961
7067
|
),
|
|
6962
|
-
searching ? searchResults.length === 0 ? /* @__PURE__ */
|
|
6963
|
-
/* @__PURE__ */
|
|
6964
|
-
/* @__PURE__ */
|
|
6965
|
-
/* @__PURE__ */
|
|
7068
|
+
searching ? searchResults.length === 0 ? /* @__PURE__ */ jsx62("div", { className: "ss-w-today-empty", children: ui.noLeagueResults }) : /* @__PURE__ */ jsx62(Fragment9, { children: searchResults.map((group) => /* @__PURE__ */ jsxs56("div", { className: "ss-w-today-search-block", children: [
|
|
7069
|
+
/* @__PURE__ */ jsxs56("div", { className: "ss-w-today-search-group", children: [
|
|
7070
|
+
/* @__PURE__ */ jsx62(Crest2, { url: group.competitionImagePath ?? void 0, name: group.competitionName, kind: "comp" }),
|
|
7071
|
+
/* @__PURE__ */ jsxs56("span", { className: "ss-w-today-search-group-name", children: [
|
|
6966
7072
|
group.competitionName,
|
|
6967
|
-
(nameCounts[group.competitionName] ?? 0) > 1 && group.competitionCountry ? /* @__PURE__ */
|
|
7073
|
+
(nameCounts[group.competitionName] ?? 0) > 1 && group.competitionCountry ? /* @__PURE__ */ jsxs56("span", { className: "ss-w-today-tile-country", children: [
|
|
6968
7074
|
" (",
|
|
6969
7075
|
group.competitionCountry,
|
|
6970
7076
|
")"
|
|
6971
7077
|
] }) : null
|
|
6972
7078
|
] })
|
|
6973
7079
|
] }),
|
|
6974
|
-
matchingFixtures(group, query).map((match) => /* @__PURE__ */
|
|
7080
|
+
matchingFixtures(group, query).map((match) => /* @__PURE__ */ jsx62(
|
|
6975
7081
|
"div",
|
|
6976
7082
|
{
|
|
6977
7083
|
role: "button",
|
|
@@ -6985,17 +7091,17 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
6985
7091
|
setSelectedCompetitionId(group.competitionId);
|
|
6986
7092
|
}
|
|
6987
7093
|
},
|
|
6988
|
-
children: /* @__PURE__ */
|
|
7094
|
+
children: /* @__PURE__ */ jsx62(FixtureRow, { match, state: states[match.matchId], stale, ui, monitor })
|
|
6989
7095
|
},
|
|
6990
7096
|
match.matchId
|
|
6991
7097
|
))
|
|
6992
|
-
] }, group.competitionId)) }) : /* @__PURE__ */
|
|
6993
|
-
/* @__PURE__ */
|
|
7098
|
+
] }, group.competitionId)) }) : /* @__PURE__ */ jsxs56(Fragment9, { children: [
|
|
7099
|
+
/* @__PURE__ */ jsxs56("div", { className: "ss-w-today-sec", children: [
|
|
6994
7100
|
placement.personal ? ui.yourLeagues : ui.topLeagues,
|
|
6995
|
-
!placement.personal && /* @__PURE__ */
|
|
7101
|
+
!placement.personal && /* @__PURE__ */ jsx62("span", { className: "ss-w-today-sec-sub", children: ui.topLeaguesSub })
|
|
6996
7102
|
] }),
|
|
6997
|
-
/* @__PURE__ */
|
|
6998
|
-
rowedCandidates.map((group) => /* @__PURE__ */
|
|
7103
|
+
/* @__PURE__ */ jsxs56("div", { className: "ss-w-today-rowsection", children: [
|
|
7104
|
+
rowedCandidates.map((group) => /* @__PURE__ */ jsx62(
|
|
6999
7105
|
LeagueRowGroup,
|
|
7000
7106
|
{
|
|
7001
7107
|
group,
|
|
@@ -7011,7 +7117,7 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
7011
7117
|
},
|
|
7012
7118
|
group.competitionId
|
|
7013
7119
|
)),
|
|
7014
|
-
tiledCandidates.length > 0 && /* @__PURE__ */
|
|
7120
|
+
tiledCandidates.length > 0 && /* @__PURE__ */ jsx62("div", { className: "ss-w-today-tiles", children: tiledCandidates.map((group) => /* @__PURE__ */ jsx62(
|
|
7015
7121
|
LeagueTile,
|
|
7016
7122
|
{
|
|
7017
7123
|
group,
|
|
@@ -7024,8 +7130,8 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
7024
7130
|
group.competitionId
|
|
7025
7131
|
)) })
|
|
7026
7132
|
] }),
|
|
7027
|
-
/* @__PURE__ */
|
|
7028
|
-
/* @__PURE__ */
|
|
7133
|
+
/* @__PURE__ */ jsx62("div", { className: "ss-w-today-sec", children: ui.allLeagues }),
|
|
7134
|
+
/* @__PURE__ */ jsx62("div", { className: "ss-w-today-tiles", children: placement.others.map((group) => /* @__PURE__ */ jsx62(
|
|
7029
7135
|
LeagueTile,
|
|
7030
7136
|
{
|
|
7031
7137
|
group,
|
|
@@ -7039,21 +7145,21 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
7039
7145
|
)) })
|
|
7040
7146
|
] })
|
|
7041
7147
|
] }),
|
|
7042
|
-
toast !== null && /* @__PURE__ */
|
|
7148
|
+
toast !== null && /* @__PURE__ */ jsx62("p", { className: "ss-w-today-toast", role: "status", "aria-live": "polite", children: toast === "starred" ? ui.starredToast : ui.unstarredToast })
|
|
7043
7149
|
] });
|
|
7044
7150
|
}
|
|
7045
7151
|
|
|
7046
7152
|
// src/components/GamesPanel.tsx
|
|
7047
|
-
import { useEffect as useEffect30, useState as
|
|
7153
|
+
import { useEffect as useEffect30, useState as useState50 } from "react";
|
|
7048
7154
|
|
|
7049
7155
|
// src/components/GamesLoginWall.tsx
|
|
7050
|
-
import { jsx as
|
|
7156
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
7051
7157
|
function GamesLoginWall({ ui }) {
|
|
7052
|
-
return /* @__PURE__ */
|
|
7158
|
+
return /* @__PURE__ */ jsx63("div", { className: "ss-w-mon-list", children: /* @__PURE__ */ jsx63("div", { className: "ss-w-games-wall", children: /* @__PURE__ */ jsx63("p", { children: ui.gamesLoginRequired }) }) });
|
|
7053
7159
|
}
|
|
7054
7160
|
|
|
7055
7161
|
// src/components/GamesHub.tsx
|
|
7056
|
-
import { useEffect as useEffect27, useState as
|
|
7162
|
+
import { useEffect as useEffect27, useState as useState36 } from "react";
|
|
7057
7163
|
|
|
7058
7164
|
// src/components/games/ui/gameMeta.ts
|
|
7059
7165
|
function prettifyGameId(gameId) {
|
|
@@ -7069,74 +7175,74 @@ function splitName(full) {
|
|
|
7069
7175
|
}
|
|
7070
7176
|
|
|
7071
7177
|
// src/components/GameTileArt.tsx
|
|
7072
|
-
import { Fragment as
|
|
7178
|
+
import { Fragment as Fragment10, jsx as jsx64, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
7073
7179
|
function GameTileArt({ gameId }) {
|
|
7074
|
-
return /* @__PURE__ */
|
|
7180
|
+
return /* @__PURE__ */ jsx64("svg", { className: "ss-g-art", viewBox: "0 0 120 74", "aria-hidden": "true", children: ART[gameId] ?? ART.default });
|
|
7075
7181
|
}
|
|
7076
|
-
var head = (cx, cy, r, cls = "ss-g-art-fg") => /* @__PURE__ */
|
|
7077
|
-
/* @__PURE__ */
|
|
7078
|
-
/* @__PURE__ */
|
|
7182
|
+
var head = (cx, cy, r, cls = "ss-g-art-fg") => /* @__PURE__ */ jsxs57("g", { className: cls, children: [
|
|
7183
|
+
/* @__PURE__ */ jsx64("circle", { cx, cy: cy - r * 0.3, r: r * 0.45 }),
|
|
7184
|
+
/* @__PURE__ */ jsx64("path", { d: `M${cx - r} ${cy + r}c0-${r * 0.8} ${r * 0.45}-${r * 1.1} ${r}-${r * 1.1}s${r} ${r * 0.3} ${r} ${r * 1.1}z` })
|
|
7079
7185
|
] });
|
|
7080
7186
|
var ART = {
|
|
7081
|
-
"mystery-tiger": /* @__PURE__ */
|
|
7187
|
+
"mystery-tiger": /* @__PURE__ */ jsxs57(Fragment10, { children: [
|
|
7082
7188
|
head(60, 38, 26, "ss-g-art-fg"),
|
|
7083
|
-
/* @__PURE__ */
|
|
7189
|
+
/* @__PURE__ */ jsx64("text", { x: "60", y: "36", className: "ss-g-art-q", textAnchor: "middle", children: "?" })
|
|
7084
7190
|
] }),
|
|
7085
|
-
"higher-or-lower": /* @__PURE__ */
|
|
7191
|
+
"higher-or-lower": /* @__PURE__ */ jsxs57(Fragment10, { children: [
|
|
7086
7192
|
head(32, 38, 20),
|
|
7087
7193
|
head(88, 38, 20),
|
|
7088
|
-
/* @__PURE__ */
|
|
7089
|
-
/* @__PURE__ */
|
|
7194
|
+
/* @__PURE__ */ jsx64("circle", { cx: "60", cy: "37", r: "11", className: "ss-g-art-accent" }),
|
|
7195
|
+
/* @__PURE__ */ jsx64("path", { d: "M57 33l3-3 3 3M57 41l3 3 3-3", className: "ss-g-art-ink" })
|
|
7090
7196
|
] }),
|
|
7091
|
-
"guess-the-xi": /* @__PURE__ */
|
|
7092
|
-
/* @__PURE__ */
|
|
7093
|
-
[[60, 60, "a"], [24, 46], [48, 46], [72, 46], [96, 46], [36, 30], [60, 30], [84, 30], [40, 14], [60, 14], [80, 14]].map(([x, y, a], i) => /* @__PURE__ */
|
|
7197
|
+
"guess-the-xi": /* @__PURE__ */ jsxs57(Fragment10, { children: [
|
|
7198
|
+
/* @__PURE__ */ jsx64("rect", { x: "8", y: "4", width: "104", height: "66", rx: "6", className: "ss-g-art-pitch" }),
|
|
7199
|
+
[[60, 60, "a"], [24, 46], [48, 46], [72, 46], [96, 46], [36, 30], [60, 30], [84, 30], [40, 14], [60, 14], [80, 14]].map(([x, y, a], i) => /* @__PURE__ */ jsx64("circle", { cx: x, cy: y, r: "4", className: a ? "ss-g-art-accent" : "ss-g-art-dot" }, i))
|
|
7094
7200
|
] }),
|
|
7095
|
-
"daily-quiz": /* @__PURE__ */
|
|
7096
|
-
"career-path": /* @__PURE__ */
|
|
7097
|
-
/* @__PURE__ */
|
|
7098
|
-
/* @__PURE__ */
|
|
7099
|
-
/* @__PURE__ */
|
|
7100
|
-
/* @__PURE__ */
|
|
7101
|
-
/* @__PURE__ */
|
|
7201
|
+
"daily-quiz": /* @__PURE__ */ jsx64(Fragment10, { children: [[14, 8], [62, 8], [14, 40], [62, 40]].map(([x, y], i) => /* @__PURE__ */ jsx64("rect", { x, y, width: "44", height: "26", rx: "5", className: i === 1 ? "ss-g-art-correct" : "ss-g-art-block" }, i)) }),
|
|
7202
|
+
"career-path": /* @__PURE__ */ jsxs57(Fragment10, { children: [
|
|
7203
|
+
/* @__PURE__ */ jsx64("path", { d: "M18 22h24v10c0 7-5 11-12 13-7-2-12-6-12-13z", className: "ss-g-art-fg" }),
|
|
7204
|
+
/* @__PURE__ */ jsx64("path", { d: "M48 37h8M84 37h8", className: "ss-g-art-line" }),
|
|
7205
|
+
/* @__PURE__ */ jsx64("path", { d: "M60 22h24v10c0 7-5 11-12 13-7-2-12-6-12-13z", className: "ss-g-art-fg" }),
|
|
7206
|
+
/* @__PURE__ */ jsx64("rect", { x: "96", y: "22", width: "18", height: "26", rx: "4", className: "ss-g-art-dash" }),
|
|
7207
|
+
/* @__PURE__ */ jsx64("text", { x: "105", y: "40", className: "ss-g-art-q", textAnchor: "middle", children: "?" })
|
|
7102
7208
|
] }),
|
|
7103
|
-
"beat-the-grid": /* @__PURE__ */
|
|
7104
|
-
"matchday-predictor": /* @__PURE__ */
|
|
7105
|
-
/* @__PURE__ */
|
|
7106
|
-
/* @__PURE__ */
|
|
7107
|
-
/* @__PURE__ */
|
|
7108
|
-
/* @__PURE__ */
|
|
7209
|
+
"beat-the-grid": /* @__PURE__ */ jsx64(Fragment10, { children: [0, 1, 2].flatMap((r) => [0, 1, 2].map((c) => /* @__PURE__ */ jsx64("rect", { x: 33 + c * 19, y: 10 + r * 19, width: "16", height: "16", rx: "3", className: (r + c) % 3 === 0 ? "ss-g-art-accent" : "ss-g-art-block" }, `${r}${c}`))) }),
|
|
7210
|
+
"matchday-predictor": /* @__PURE__ */ jsxs57(Fragment10, { children: [
|
|
7211
|
+
/* @__PURE__ */ jsx64("path", { d: "M10 20h20v9c0 6-4 9-10 11-6-2-10-5-10-11z", className: "ss-g-art-fg" }),
|
|
7212
|
+
/* @__PURE__ */ jsx64("rect", { x: "38", y: "22", width: "18", height: "24", rx: "4", className: "ss-g-art-accent-stroke" }),
|
|
7213
|
+
/* @__PURE__ */ jsx64("rect", { x: "64", y: "22", width: "18", height: "24", rx: "4", className: "ss-g-art-dash" }),
|
|
7214
|
+
/* @__PURE__ */ jsx64("path", { d: "M90 20h20v9c0 6-4 9-10 11-6-2-10-5-10-11z", className: "ss-g-art-fg" })
|
|
7109
7215
|
] }),
|
|
7110
|
-
"starting-xi": /* @__PURE__ */
|
|
7111
|
-
/* @__PURE__ */
|
|
7112
|
-
[[60, 60], [30, 46], [50, 46], [70, 46], [90, 46], [45, 30], [75, 30], [30, 16], [60, 16], [90, 16]].map(([x, y], i) => /* @__PURE__ */
|
|
7216
|
+
"starting-xi": /* @__PURE__ */ jsxs57(Fragment10, { children: [
|
|
7217
|
+
/* @__PURE__ */ jsx64("rect", { x: "8", y: "4", width: "104", height: "66", rx: "6", className: "ss-g-art-pitch" }),
|
|
7218
|
+
[[60, 60], [30, 46], [50, 46], [70, 46], [90, 46], [45, 30], [75, 30], [30, 16], [60, 16], [90, 16]].map(([x, y], i) => /* @__PURE__ */ jsx64("circle", { cx: x, cy: y, r: "5", className: i < 7 ? "ss-g-art-accent" : "ss-g-art-dash" }, i))
|
|
7113
7219
|
] }),
|
|
7114
|
-
"stat-ladder": /* @__PURE__ */
|
|
7115
|
-
"fan-motm": /* @__PURE__ */
|
|
7116
|
-
/* @__PURE__ */
|
|
7220
|
+
"stat-ladder": /* @__PURE__ */ jsx64(Fragment10, { children: [[20, 70], [34, 52], [48, 34]].map(([y, w], i) => /* @__PURE__ */ jsx64("rect", { x: "24", y, width: w, height: "12", rx: "3", className: i === 1 ? "ss-g-art-accent" : "ss-g-art-block" }, i)) }),
|
|
7221
|
+
"fan-motm": /* @__PURE__ */ jsxs57(Fragment10, { children: [
|
|
7222
|
+
/* @__PURE__ */ jsx64("circle", { cx: "60", cy: "37", r: "26", className: "ss-g-art-accent-stroke" }),
|
|
7117
7223
|
head(60, 40, 18),
|
|
7118
|
-
/* @__PURE__ */
|
|
7224
|
+
/* @__PURE__ */ jsx64("path", { d: "M84 8l2.4 5 5.4.6-4 3.7 1.1 5.4-4.9-2.7-4.9 2.7 1.1-5.4-4-3.7 5.4-.6z", className: "ss-g-art-accent" })
|
|
7119
7225
|
] }),
|
|
7120
|
-
default: /* @__PURE__ */
|
|
7226
|
+
default: /* @__PURE__ */ jsx64("circle", { cx: "60", cy: "37", r: "22", className: "ss-g-art-fg" })
|
|
7121
7227
|
};
|
|
7122
7228
|
|
|
7123
7229
|
// src/components/games/ui/Chip.tsx
|
|
7124
|
-
import { jsx as
|
|
7230
|
+
import { jsx as jsx65, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
7125
7231
|
function Chip({ variant = "neutral", icon, children, className }) {
|
|
7126
|
-
return /* @__PURE__ */
|
|
7232
|
+
return /* @__PURE__ */ jsxs58("span", { className: `ss-g-chip ss-g-chip--${variant}${className ? ` ${className}` : ""}`, children: [
|
|
7127
7233
|
icon,
|
|
7128
7234
|
children
|
|
7129
7235
|
] });
|
|
7130
7236
|
}
|
|
7131
7237
|
function StatStack({ value, label }) {
|
|
7132
|
-
return /* @__PURE__ */
|
|
7133
|
-
/* @__PURE__ */
|
|
7134
|
-
/* @__PURE__ */
|
|
7238
|
+
return /* @__PURE__ */ jsxs58("span", { className: "ss-g-statstack", children: [
|
|
7239
|
+
/* @__PURE__ */ jsx65("span", { className: "ss-g-statstack-v", children: value }),
|
|
7240
|
+
/* @__PURE__ */ jsx65("span", { className: "ss-g-statstack-l", children: label })
|
|
7135
7241
|
] });
|
|
7136
7242
|
}
|
|
7137
7243
|
|
|
7138
7244
|
// src/components/GameTile.tsx
|
|
7139
|
-
import { Fragment as
|
|
7245
|
+
import { Fragment as Fragment11, jsx as jsx66, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
7140
7246
|
function tileStatus(game, ui) {
|
|
7141
7247
|
switch (game.status) {
|
|
7142
7248
|
case "locked":
|
|
@@ -7160,38 +7266,38 @@ function GameTile({ game, onOpen, ui, variant = "tile" }) {
|
|
|
7160
7266
|
const status = tileStatus(game, ui);
|
|
7161
7267
|
const disabled = DISABLED.has(game.status);
|
|
7162
7268
|
const title = gameTitle(game, ui.games.titles);
|
|
7163
|
-
const body = variant === "hero" ? /* @__PURE__ */
|
|
7164
|
-
/* @__PURE__ */
|
|
7165
|
-
/* @__PURE__ */
|
|
7166
|
-
status.tone === "new" && /* @__PURE__ */
|
|
7167
|
-
/* @__PURE__ */
|
|
7168
|
-
/* @__PURE__ */
|
|
7169
|
-
status.tone === "success" ? /* @__PURE__ */
|
|
7269
|
+
const body = variant === "hero" ? /* @__PURE__ */ jsxs59(Fragment11, { children: [
|
|
7270
|
+
/* @__PURE__ */ jsxs59("span", { className: "ss-g-hero-text", children: [
|
|
7271
|
+
/* @__PURE__ */ jsx66("span", { className: "ss-g-hero-eyebrow", children: ui.games.dailyChallenge }),
|
|
7272
|
+
status.tone === "new" && /* @__PURE__ */ jsx66(Chip, { variant: "badge", children: ui.games.newToday }),
|
|
7273
|
+
/* @__PURE__ */ jsx66("span", { className: "ss-g-hero-title", children: title }),
|
|
7274
|
+
/* @__PURE__ */ jsx66("span", { className: "ss-g-hero-sub", children: ui.games.taglines[game.gameId] ?? "" }),
|
|
7275
|
+
status.tone === "success" ? /* @__PURE__ */ jsx66("span", { className: "ss-g-tile-status", "data-tone": "success", children: status.text }) : /* @__PURE__ */ jsxs59("span", { className: "ss-g-hero-cta", children: [
|
|
7170
7276
|
status.tone === "accent" ? ui.games.resume : ui.games.playNow,
|
|
7171
7277
|
" \u2192"
|
|
7172
7278
|
] })
|
|
7173
7279
|
] }),
|
|
7174
|
-
/* @__PURE__ */
|
|
7175
|
-
] }) : variant === "wide" ? /* @__PURE__ */
|
|
7176
|
-
/* @__PURE__ */
|
|
7177
|
-
/* @__PURE__ */
|
|
7178
|
-
/* @__PURE__ */
|
|
7179
|
-
/* @__PURE__ */
|
|
7180
|
-
status.tone === "new" && /* @__PURE__ */
|
|
7280
|
+
/* @__PURE__ */ jsx66("span", { className: "ss-g-hero-art", children: /* @__PURE__ */ jsx66(GameTileArt, { gameId: game.gameId }) })
|
|
7281
|
+
] }) : variant === "wide" ? /* @__PURE__ */ jsxs59(Fragment11, { children: [
|
|
7282
|
+
/* @__PURE__ */ jsx66("span", { className: "ss-g-wide-art", children: /* @__PURE__ */ jsx66(GameTileArt, { gameId: game.gameId }) }),
|
|
7283
|
+
/* @__PURE__ */ jsxs59("span", { className: "ss-g-wide-text", children: [
|
|
7284
|
+
/* @__PURE__ */ jsx66("span", { className: "ss-g-tile-title", children: title }),
|
|
7285
|
+
/* @__PURE__ */ jsx66("span", { className: "ss-g-tile-status", "data-tone": status.tone, children: status.text }),
|
|
7286
|
+
status.tone === "new" && /* @__PURE__ */ jsx66(Chip, { variant: "badge", children: ui.games.newToday })
|
|
7181
7287
|
] }),
|
|
7182
|
-
/* @__PURE__ */
|
|
7183
|
-
] }) : /* @__PURE__ */
|
|
7184
|
-
/* @__PURE__ */
|
|
7185
|
-
/* @__PURE__ */
|
|
7186
|
-
/* @__PURE__ */
|
|
7288
|
+
/* @__PURE__ */ jsx66("span", { className: "ss-g-wide-chev", children: /* @__PURE__ */ jsx66(IconChevronLeft, { size: 18 }) })
|
|
7289
|
+
] }) : /* @__PURE__ */ jsxs59(Fragment11, { children: [
|
|
7290
|
+
/* @__PURE__ */ jsx66("span", { className: "ss-g-tile-art", children: /* @__PURE__ */ jsx66(GameTileArt, { gameId: game.gameId }) }),
|
|
7291
|
+
/* @__PURE__ */ jsx66("span", { className: "ss-g-tile-title", children: title }),
|
|
7292
|
+
/* @__PURE__ */ jsx66("span", { className: "ss-g-tile-status", "data-tone": status.tone, children: status.text })
|
|
7187
7293
|
] });
|
|
7188
7294
|
const cls = `ss-g-tile ss-g-tile--${variant}`;
|
|
7189
|
-
if (disabled) return /* @__PURE__ */
|
|
7190
|
-
return /* @__PURE__ */
|
|
7295
|
+
if (disabled) return /* @__PURE__ */ jsx66("div", { className: cls, "data-disabled": true, "aria-disabled": "true", children: body });
|
|
7296
|
+
return /* @__PURE__ */ jsx66("button", { type: "button", className: cls, "aria-label": `${title} \u2014 ${status.text}`, onClick: () => onOpen(game), children: body });
|
|
7191
7297
|
}
|
|
7192
7298
|
|
|
7193
7299
|
// src/components/GamesHub.tsx
|
|
7194
|
-
import { Fragment as
|
|
7300
|
+
import { Fragment as Fragment12, jsx as jsx67, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
7195
7301
|
var PLAYABLE = /* @__PURE__ */ new Set(["available", "in_progress"]);
|
|
7196
7302
|
var DONE = /* @__PURE__ */ new Set(["played", "graded"]);
|
|
7197
7303
|
function pickHeroGame(games) {
|
|
@@ -7204,7 +7310,7 @@ function pickHeroGame(games) {
|
|
|
7204
7310
|
}
|
|
7205
7311
|
var tileKey = (g) => `${g.gameId}-${g.gameDay}-${g.fixtureId}`;
|
|
7206
7312
|
function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
7207
|
-
const [, setTick] =
|
|
7313
|
+
const [, setTick] = useState36(0);
|
|
7208
7314
|
useEffect27(() => {
|
|
7209
7315
|
const id = setInterval(() => setTick((t) => t + 1), 6e4);
|
|
7210
7316
|
return () => clearInterval(id);
|
|
@@ -7217,58 +7323,58 @@ function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
|
7217
7323
|
const kickoffs = fixtures.map((g) => g.kickoffUtc).filter((k) => !!k).sort();
|
|
7218
7324
|
const todayPts = games.filter((g) => DONE.has(g.status)).reduce((s, g) => s + (g.score ?? 0), 0);
|
|
7219
7325
|
const dash = "\u2014";
|
|
7220
|
-
return /* @__PURE__ */
|
|
7221
|
-
/* @__PURE__ */
|
|
7222
|
-
/* @__PURE__ */
|
|
7223
|
-
/* @__PURE__ */
|
|
7224
|
-
/* @__PURE__ */
|
|
7225
|
-
myWeeklyRow ? /* @__PURE__ */
|
|
7226
|
-
/* @__PURE__ */
|
|
7326
|
+
return /* @__PURE__ */ jsxs60("div", { className: "ss-g-hub", children: [
|
|
7327
|
+
/* @__PURE__ */ jsxs60("div", { className: "ss-g-stats", children: [
|
|
7328
|
+
/* @__PURE__ */ jsxs60("div", { className: "ss-g-stat", children: [
|
|
7329
|
+
/* @__PURE__ */ jsx67("span", { className: "ss-g-stat-l", children: ui.games.statStreak }),
|
|
7330
|
+
/* @__PURE__ */ jsxs60("span", { className: "ss-g-stat-v", "data-testid": "stat-streak", children: [
|
|
7331
|
+
myWeeklyRow ? /* @__PURE__ */ jsxs60(Fragment12, { children: [
|
|
7332
|
+
/* @__PURE__ */ jsx67(IconFlame, {}),
|
|
7227
7333
|
myWeeklyRow.currentStreak
|
|
7228
7334
|
] }) : dash,
|
|
7229
|
-
myWeeklyRow && /* @__PURE__ */
|
|
7335
|
+
myWeeklyRow && /* @__PURE__ */ jsx67("small", { children: ui.games.unitDays })
|
|
7230
7336
|
] })
|
|
7231
7337
|
] }),
|
|
7232
|
-
/* @__PURE__ */
|
|
7233
|
-
/* @__PURE__ */
|
|
7234
|
-
/* @__PURE__ */
|
|
7338
|
+
/* @__PURE__ */ jsxs60("div", { className: "ss-g-stat", children: [
|
|
7339
|
+
/* @__PURE__ */ jsx67("span", { className: "ss-g-stat-l", children: ui.games.statToday }),
|
|
7340
|
+
/* @__PURE__ */ jsxs60("span", { className: "ss-g-stat-v ss-g-stat-v--accent", "data-testid": "stat-today", children: [
|
|
7235
7341
|
ui.games.formatPts(todayPts),
|
|
7236
|
-
/* @__PURE__ */
|
|
7342
|
+
/* @__PURE__ */ jsx67("small", { children: ui.games.unitPts })
|
|
7237
7343
|
] })
|
|
7238
7344
|
] }),
|
|
7239
|
-
/* @__PURE__ */
|
|
7240
|
-
/* @__PURE__ */
|
|
7241
|
-
/* @__PURE__ */
|
|
7345
|
+
/* @__PURE__ */ jsxs60("div", { className: "ss-g-stat", children: [
|
|
7346
|
+
/* @__PURE__ */ jsx67("span", { className: "ss-g-stat-l", children: ui.games.statRank }),
|
|
7347
|
+
/* @__PURE__ */ jsxs60("span", { className: "ss-g-stat-v", "data-testid": "stat-rank", children: [
|
|
7242
7348
|
myWeeklyRow ? `#${myWeeklyRow.rank}` : dash,
|
|
7243
|
-
myWeeklyRow && /* @__PURE__ */
|
|
7349
|
+
myWeeklyRow && /* @__PURE__ */ jsx67("small", { children: ui.games.thisWeek })
|
|
7244
7350
|
] })
|
|
7245
7351
|
] })
|
|
7246
7352
|
] }),
|
|
7247
|
-
weeklyPrize && /* @__PURE__ */
|
|
7248
|
-
hero && /* @__PURE__ */
|
|
7249
|
-
(grid.length > 0 || wide) && /* @__PURE__ */
|
|
7250
|
-
/* @__PURE__ */
|
|
7251
|
-
/* @__PURE__ */
|
|
7252
|
-
/* @__PURE__ */
|
|
7353
|
+
weeklyPrize && /* @__PURE__ */ jsx67(Chip, { variant: "accent", className: "ss-g-prize", children: weeklyPrize }),
|
|
7354
|
+
hero && /* @__PURE__ */ jsx67(GameTile, { game: hero, onOpen, ui, variant: "hero" }),
|
|
7355
|
+
(grid.length > 0 || wide) && /* @__PURE__ */ jsxs60("section", { className: "ss-g-sec", children: [
|
|
7356
|
+
/* @__PURE__ */ jsxs60("div", { className: "ss-g-sec-head", children: [
|
|
7357
|
+
/* @__PURE__ */ jsx67("h3", { children: ui.games.dailyGames }),
|
|
7358
|
+
/* @__PURE__ */ jsx67("span", { children: ui.games.newSetAtMidnight })
|
|
7253
7359
|
] }),
|
|
7254
|
-
grid.length > 0 && /* @__PURE__ */
|
|
7255
|
-
wide && /* @__PURE__ */
|
|
7360
|
+
grid.length > 0 && /* @__PURE__ */ jsx67("div", { className: "ss-g-grid", children: grid.map((g) => /* @__PURE__ */ jsx67(GameTile, { game: g, onOpen, ui }, tileKey(g))) }),
|
|
7361
|
+
wide && /* @__PURE__ */ jsx67(GameTile, { game: wide, onOpen, ui, variant: "wide" })
|
|
7256
7362
|
] }),
|
|
7257
|
-
fixtures.length > 0 && /* @__PURE__ */
|
|
7258
|
-
/* @__PURE__ */
|
|
7259
|
-
/* @__PURE__ */
|
|
7260
|
-
kickoffs[0] && /* @__PURE__ */
|
|
7363
|
+
fixtures.length > 0 && /* @__PURE__ */ jsxs60("section", { className: "ss-g-sec", children: [
|
|
7364
|
+
/* @__PURE__ */ jsxs60("div", { className: "ss-g-sec-head", children: [
|
|
7365
|
+
/* @__PURE__ */ jsx67("h3", { children: ui.games.matchdayGames }),
|
|
7366
|
+
kickoffs[0] && /* @__PURE__ */ jsx67("span", { children: ui.games.kickoffAt(ui.games.formatDayTime(kickoffs[0])) })
|
|
7261
7367
|
] }),
|
|
7262
|
-
/* @__PURE__ */
|
|
7368
|
+
/* @__PURE__ */ jsx67("div", { className: "ss-g-grid", children: fixtures.map((g) => /* @__PURE__ */ jsx67(GameTile, { game: g, onOpen, ui }, tileKey(g))) })
|
|
7263
7369
|
] })
|
|
7264
7370
|
] });
|
|
7265
7371
|
}
|
|
7266
7372
|
|
|
7267
7373
|
// src/components/GameScreenHost.tsx
|
|
7268
|
-
import { useEffect as useEffect29, useRef as useRef27, useState as
|
|
7374
|
+
import { useEffect as useEffect29, useRef as useRef27, useState as useState48 } from "react";
|
|
7269
7375
|
|
|
7270
7376
|
// src/useGamePlay.ts
|
|
7271
|
-
import { useCallback as useCallback20, useRef as useRef25, useState as
|
|
7377
|
+
import { useCallback as useCallback20, useRef as useRef25, useState as useState37 } from "react";
|
|
7272
7378
|
function toSubmitResult(payload) {
|
|
7273
7379
|
return {
|
|
7274
7380
|
// 'pending' means the play is recorded but awaiting resolution (fixture games)
|
|
@@ -7280,9 +7386,9 @@ function toSubmitResult(payload) {
|
|
|
7280
7386
|
};
|
|
7281
7387
|
}
|
|
7282
7388
|
function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh }) {
|
|
7283
|
-
const [result, setResult] =
|
|
7284
|
-
const [submitting, setSubmitting] =
|
|
7285
|
-
const [rawStatus, setRawStatus] =
|
|
7389
|
+
const [result, setResult] = useState37(null);
|
|
7390
|
+
const [submitting, setSubmitting] = useState37(false);
|
|
7391
|
+
const [rawStatus, setRawStatus] = useState37(null);
|
|
7286
7392
|
const inFlightRef = useRef25(false);
|
|
7287
7393
|
const convRef = useRef25(conversation);
|
|
7288
7394
|
convRef.current = conversation;
|
|
@@ -7340,7 +7446,7 @@ function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh
|
|
|
7340
7446
|
}
|
|
7341
7447
|
|
|
7342
7448
|
// src/components/games/MysteryTigerGame.tsx
|
|
7343
|
-
import { useState as
|
|
7449
|
+
import { useState as useState39, useId as useId3 } from "react";
|
|
7344
7450
|
|
|
7345
7451
|
// src/components/games/nationFlags.ts
|
|
7346
7452
|
var FLAGS = {
|
|
@@ -7551,8 +7657,8 @@ function isNationCode(flag) {
|
|
|
7551
7657
|
}
|
|
7552
7658
|
|
|
7553
7659
|
// src/components/games/PlayerAvatar.tsx
|
|
7554
|
-
import { useState as
|
|
7555
|
-
import { jsx as
|
|
7660
|
+
import { useState as useState38 } from "react";
|
|
7661
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
7556
7662
|
function initialsOf(name) {
|
|
7557
7663
|
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
7558
7664
|
const first = parts[0];
|
|
@@ -7569,41 +7675,41 @@ function PlayerAvatar({
|
|
|
7569
7675
|
imagePath,
|
|
7570
7676
|
className
|
|
7571
7677
|
}) {
|
|
7572
|
-
const [failed, setFailed] =
|
|
7678
|
+
const [failed, setFailed] = useState38(false);
|
|
7573
7679
|
const showImage = Boolean(imagePath) && !isPlaceholderImage(imagePath) && !failed;
|
|
7574
|
-
return /* @__PURE__ */
|
|
7680
|
+
return /* @__PURE__ */ jsx68("div", { className, "aria-hidden": "true", children: showImage ? /* @__PURE__ */ jsx68("img", { src: imagePath, alt: "", loading: "lazy", onError: () => setFailed(true) }) : /* @__PURE__ */ jsx68("span", { className: "ss-w-av-initials", children: initialsOf(name) }) });
|
|
7575
7681
|
}
|
|
7576
7682
|
|
|
7577
7683
|
// src/components/games/ui/GameHeader.tsx
|
|
7578
|
-
import { jsx as
|
|
7684
|
+
import { jsx as jsx69, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
7579
7685
|
function GameHeader({ title, eyebrow, right, onBack, backLabel }) {
|
|
7580
|
-
return /* @__PURE__ */
|
|
7581
|
-
onBack && /* @__PURE__ */
|
|
7582
|
-
/* @__PURE__ */
|
|
7583
|
-
eyebrow && /* @__PURE__ */
|
|
7584
|
-
/* @__PURE__ */
|
|
7686
|
+
return /* @__PURE__ */ jsxs61("div", { className: "ss-g-head", children: [
|
|
7687
|
+
onBack && /* @__PURE__ */ jsx69("button", { type: "button", className: "ss-g-back", "aria-label": backLabel, onClick: onBack, children: /* @__PURE__ */ jsx69(IconChevronLeft, {}) }),
|
|
7688
|
+
/* @__PURE__ */ jsxs61("div", { className: "ss-g-head-text", children: [
|
|
7689
|
+
eyebrow && /* @__PURE__ */ jsx69("span", { className: "ss-g-eyebrow", children: eyebrow }),
|
|
7690
|
+
/* @__PURE__ */ jsx69("h2", { className: "ss-g-title", children: title })
|
|
7585
7691
|
] }),
|
|
7586
|
-
right && /* @__PURE__ */
|
|
7692
|
+
right && /* @__PURE__ */ jsx69("div", { className: "ss-g-head-right", children: right })
|
|
7587
7693
|
] });
|
|
7588
7694
|
}
|
|
7589
7695
|
|
|
7590
7696
|
// src/components/games/ui/SegmentProgress.tsx
|
|
7591
|
-
import { jsx as
|
|
7697
|
+
import { jsx as jsx70, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
7592
7698
|
function SegmentProgress({ segments, ariaLabel, leftLabel, rightLabel, right }) {
|
|
7593
|
-
return /* @__PURE__ */
|
|
7594
|
-
/* @__PURE__ */
|
|
7595
|
-
(leftLabel || rightLabel) && /* @__PURE__ */
|
|
7596
|
-
/* @__PURE__ */
|
|
7597
|
-
/* @__PURE__ */
|
|
7699
|
+
return /* @__PURE__ */ jsxs62("div", { className: "ss-g-progress", children: [
|
|
7700
|
+
/* @__PURE__ */ jsxs62("div", { className: "ss-g-progress-main", children: [
|
|
7701
|
+
(leftLabel || rightLabel) && /* @__PURE__ */ jsxs62("div", { className: "ss-g-progress-labels", children: [
|
|
7702
|
+
/* @__PURE__ */ jsx70("span", { children: leftLabel }),
|
|
7703
|
+
/* @__PURE__ */ jsx70("span", { className: "ss-g-progress-rl", children: rightLabel })
|
|
7598
7704
|
] }),
|
|
7599
|
-
/* @__PURE__ */
|
|
7705
|
+
/* @__PURE__ */ jsx70(
|
|
7600
7706
|
"div",
|
|
7601
7707
|
{
|
|
7602
7708
|
className: "ss-g-segs",
|
|
7603
7709
|
role: "img",
|
|
7604
7710
|
"aria-label": ariaLabel,
|
|
7605
7711
|
style: { gridTemplateColumns: `repeat(${segments.length}, minmax(0, 1fr))` },
|
|
7606
|
-
children: segments.map((s, i) => /* @__PURE__ */
|
|
7712
|
+
children: segments.map((s, i) => /* @__PURE__ */ jsx70("span", { className: "ss-g-seg", "data-state": s }, i))
|
|
7607
7713
|
}
|
|
7608
7714
|
)
|
|
7609
7715
|
] }),
|
|
@@ -7612,12 +7718,12 @@ function SegmentProgress({ segments, ariaLabel, leftLabel, rightLabel, right })
|
|
|
7612
7718
|
}
|
|
7613
7719
|
|
|
7614
7720
|
// src/components/games/ui/AnswerTray.tsx
|
|
7615
|
-
import { Fragment as
|
|
7721
|
+
import { Fragment as Fragment13, jsx as jsx71, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
7616
7722
|
function AnswerTray({ id, label, placeholder, optionsLabel, options, query, onQuery, onPick, disabled, minQuery = 0 }) {
|
|
7617
7723
|
const needle = query.trim().toLowerCase();
|
|
7618
7724
|
const shown = needle.length < minQuery ? [] : needle ? options.filter((o) => o.name.toLowerCase().includes(needle)) : options;
|
|
7619
|
-
return /* @__PURE__ */
|
|
7620
|
-
/* @__PURE__ */
|
|
7725
|
+
return /* @__PURE__ */ jsxs63(Fragment13, { children: [
|
|
7726
|
+
/* @__PURE__ */ jsx71(
|
|
7621
7727
|
SearchField,
|
|
7622
7728
|
{
|
|
7623
7729
|
id,
|
|
@@ -7629,9 +7735,9 @@ function AnswerTray({ id, label, placeholder, optionsLabel, options, query, onQu
|
|
|
7629
7735
|
disabled
|
|
7630
7736
|
}
|
|
7631
7737
|
),
|
|
7632
|
-
shown.length > 0 && /* @__PURE__ */
|
|
7738
|
+
shown.length > 0 && /* @__PURE__ */ jsx71("div", { className: "ss-g-tray", role: "listbox", "aria-label": optionsLabel, children: shown.map((o) => {
|
|
7633
7739
|
const { first, last } = splitName(o.name);
|
|
7634
|
-
return /* @__PURE__ */
|
|
7740
|
+
return /* @__PURE__ */ jsxs63(
|
|
7635
7741
|
"button",
|
|
7636
7742
|
{
|
|
7637
7743
|
type: "button",
|
|
@@ -7642,10 +7748,10 @@ function AnswerTray({ id, label, placeholder, optionsLabel, options, query, onQu
|
|
|
7642
7748
|
disabled,
|
|
7643
7749
|
onClick: () => onPick(o.id),
|
|
7644
7750
|
children: [
|
|
7645
|
-
/* @__PURE__ */
|
|
7646
|
-
/* @__PURE__ */
|
|
7647
|
-
first && /* @__PURE__ */
|
|
7648
|
-
/* @__PURE__ */
|
|
7751
|
+
/* @__PURE__ */ jsx71(PlayerAvatar, { className: "ss-g-tray-av", name: o.name, imagePath: o.imagePath }),
|
|
7752
|
+
/* @__PURE__ */ jsxs63("span", { className: "ss-g-tray-name", "aria-hidden": "true", children: [
|
|
7753
|
+
first && /* @__PURE__ */ jsx71("span", { className: "ss-g-tray-first", children: first }),
|
|
7754
|
+
/* @__PURE__ */ jsx71("span", { className: "ss-g-tray-last", children: last })
|
|
7649
7755
|
] })
|
|
7650
7756
|
]
|
|
7651
7757
|
},
|
|
@@ -7656,59 +7762,59 @@ function AnswerTray({ id, label, placeholder, optionsLabel, options, query, onQu
|
|
|
7656
7762
|
}
|
|
7657
7763
|
|
|
7658
7764
|
// src/components/games/ui/FooterBar.tsx
|
|
7659
|
-
import { jsx as
|
|
7765
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
7660
7766
|
function FooterBar({ children }) {
|
|
7661
|
-
return /* @__PURE__ */
|
|
7767
|
+
return /* @__PURE__ */ jsx72("div", { className: "ss-g-footer", children });
|
|
7662
7768
|
}
|
|
7663
7769
|
|
|
7664
7770
|
// src/components/games/ui/Silhouette.tsx
|
|
7665
|
-
import { jsx as
|
|
7771
|
+
import { jsx as jsx73, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
7666
7772
|
function Silhouette({ size, variant = "default" }) {
|
|
7667
|
-
return /* @__PURE__ */
|
|
7668
|
-
/* @__PURE__ */
|
|
7669
|
-
/* @__PURE__ */
|
|
7670
|
-
/* @__PURE__ */
|
|
7773
|
+
return /* @__PURE__ */ jsxs64("span", { className: `ss-g-sil ss-g-sil--${variant}`, style: { width: size, height: size }, "aria-hidden": "true", children: [
|
|
7774
|
+
/* @__PURE__ */ jsxs64("svg", { width: size * 0.86, height: size * 0.86, viewBox: "0 0 100 100", children: [
|
|
7775
|
+
/* @__PURE__ */ jsx73("circle", { cx: "50", cy: "40", r: "19", fill: "currentColor" }),
|
|
7776
|
+
/* @__PURE__ */ jsx73("path", { d: "M12 100c0-23 17-38 38-38s38 15 38 38z", fill: "currentColor" })
|
|
7671
7777
|
] }),
|
|
7672
|
-
variant === "mystery" && /* @__PURE__ */
|
|
7778
|
+
variant === "mystery" && /* @__PURE__ */ jsx73("span", { className: "ss-g-sil-q", children: "?" })
|
|
7673
7779
|
] });
|
|
7674
7780
|
}
|
|
7675
7781
|
|
|
7676
7782
|
// src/components/games/ui/GameButton.tsx
|
|
7677
|
-
import { jsx as
|
|
7783
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
7678
7784
|
function GameButton({ variant = "primary", block = false, className, type = "button", ...rest }) {
|
|
7679
7785
|
const cls = `ss-g-btn ss-g-btn--${variant}${block ? " ss-g-btn--block" : ""}${className ? ` ${className}` : ""}`;
|
|
7680
|
-
return /* @__PURE__ */
|
|
7786
|
+
return /* @__PURE__ */ jsx74("button", { type, className: cls, ...rest });
|
|
7681
7787
|
}
|
|
7682
7788
|
|
|
7683
7789
|
// src/components/games/ui/ResultCard.tsx
|
|
7684
|
-
import { jsx as
|
|
7790
|
+
import { jsx as jsx75, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
7685
7791
|
function ResultCard({ tone, title, score, detail, onBack, ui }) {
|
|
7686
|
-
return /* @__PURE__ */
|
|
7687
|
-
/* @__PURE__ */
|
|
7688
|
-
score !== void 0 && /* @__PURE__ */
|
|
7689
|
-
/* @__PURE__ */
|
|
7792
|
+
return /* @__PURE__ */ jsxs65("div", { className: "ss-g-result", "data-tone": tone, role: "status", children: [
|
|
7793
|
+
/* @__PURE__ */ jsx75("span", { className: "ss-g-result-title", children: title }),
|
|
7794
|
+
score !== void 0 && /* @__PURE__ */ jsxs65("span", { className: "ss-g-result-score", children: [
|
|
7795
|
+
/* @__PURE__ */ jsx75("span", { className: "ss-g-result-num", children: score }),
|
|
7690
7796
|
ui.games.unitPts
|
|
7691
7797
|
] }),
|
|
7692
|
-
detail && /* @__PURE__ */
|
|
7693
|
-
onBack && /* @__PURE__ */
|
|
7798
|
+
detail && /* @__PURE__ */ jsx75("span", { className: "ss-g-result-detail", children: detail }),
|
|
7799
|
+
onBack && /* @__PURE__ */ jsx75(GameButton, { variant: "outline", onClick: onBack, children: ui.games.backToGames })
|
|
7694
7800
|
] });
|
|
7695
7801
|
}
|
|
7696
7802
|
|
|
7697
7803
|
// src/components/games/ui/PointsLadderRow.tsx
|
|
7698
|
-
import { jsx as
|
|
7804
|
+
import { jsx as jsx76, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
7699
7805
|
function PointsLadderRow({ ladder, guessesUsed, ui }) {
|
|
7700
7806
|
if (!ladder || ladder.length === 0) return null;
|
|
7701
7807
|
const now = ladder[Math.min(guessesUsed, ladder.length - 1)];
|
|
7702
7808
|
const next = ladder[guessesUsed + 1];
|
|
7703
7809
|
if (now === void 0) return null;
|
|
7704
|
-
return /* @__PURE__ */
|
|
7705
|
-
/* @__PURE__ */
|
|
7706
|
-
next !== void 0 && next !== now && /* @__PURE__ */
|
|
7810
|
+
return /* @__PURE__ */ jsxs66("div", { className: "ss-g-worth", "data-testid": "points-ladder", children: [
|
|
7811
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-worth-now", children: ui.games.worthNow(now) }),
|
|
7812
|
+
next !== void 0 && next !== now && /* @__PURE__ */ jsx76("span", { className: "ss-g-worth-next", children: ui.games.worthAfterMiss(next) })
|
|
7707
7813
|
] });
|
|
7708
7814
|
}
|
|
7709
7815
|
|
|
7710
7816
|
// src/components/games/MysteryTigerGame.tsx
|
|
7711
|
-
import { Fragment as
|
|
7817
|
+
import { Fragment as Fragment14, jsx as jsx77, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
7712
7818
|
function parseClientState(json) {
|
|
7713
7819
|
if (!json) return null;
|
|
7714
7820
|
try {
|
|
@@ -7810,7 +7916,7 @@ function MysteryTigerGame({
|
|
|
7810
7916
|
onBack
|
|
7811
7917
|
}) {
|
|
7812
7918
|
const t = ui.games.mysteryTiger;
|
|
7813
|
-
const [query, setQuery] =
|
|
7919
|
+
const [query, setQuery] = useState39("");
|
|
7814
7920
|
const inputId = useId3();
|
|
7815
7921
|
const clientState = parseClientState(result?.clientStateJson);
|
|
7816
7922
|
const guessResults = clientState?.guessResults ?? [];
|
|
@@ -7830,22 +7936,22 @@ function MysteryTigerGame({
|
|
|
7830
7936
|
setQuery("");
|
|
7831
7937
|
onSubmit(JSON.stringify({ guesses: newGuesses }));
|
|
7832
7938
|
}
|
|
7833
|
-
const headerRight = !config ? void 0 : isOver ? /* @__PURE__ */
|
|
7939
|
+
const headerRight = !config ? void 0 : isOver ? /* @__PURE__ */ jsxs67(Chip, { variant: "accent", children: [
|
|
7834
7940
|
score,
|
|
7835
7941
|
" ",
|
|
7836
7942
|
ui.games.unitPts
|
|
7837
|
-
] }) : /* @__PURE__ */
|
|
7943
|
+
] }) : /* @__PURE__ */ jsx77("span", { "data-testid": "mt-chip", children: /* @__PURE__ */ jsxs67(Chip, { children: [
|
|
7838
7944
|
ui.games.guess,
|
|
7839
7945
|
" ",
|
|
7840
|
-
/* @__PURE__ */
|
|
7946
|
+
/* @__PURE__ */ jsx77("span", { className: "ss-g-num", children: guessesUsed + 1 }),
|
|
7841
7947
|
" / ",
|
|
7842
7948
|
totalGuesses
|
|
7843
7949
|
] }) });
|
|
7844
7950
|
const segments = Array.from({ length: totalGuesses }, (_, i) => i < guessesUsed ? "done" : i === guessesUsed ? "current" : "todo");
|
|
7845
7951
|
const cols = { gridTemplateColumns: `minmax(0, 1fr) repeat(${keys.length}, 42px)` };
|
|
7846
7952
|
const known = deriveKnownAttributes(guessResults, keys);
|
|
7847
|
-
return /* @__PURE__ */
|
|
7848
|
-
/* @__PURE__ */
|
|
7953
|
+
return /* @__PURE__ */ jsxs67("div", { className: "ss-g-screen ss-g-mt", "data-game": "mystery-tiger", "data-testid": "game-screen-mystery-tiger", children: [
|
|
7954
|
+
/* @__PURE__ */ jsx77(
|
|
7849
7955
|
GameHeader,
|
|
7850
7956
|
{
|
|
7851
7957
|
title: gameTitle({ gameId: "mystery-tiger" }, ui.games.titles),
|
|
@@ -7855,41 +7961,41 @@ function MysteryTigerGame({
|
|
|
7855
7961
|
backLabel: ui.back
|
|
7856
7962
|
}
|
|
7857
7963
|
),
|
|
7858
|
-
!config && /* @__PURE__ */
|
|
7859
|
-
config && /* @__PURE__ */
|
|
7860
|
-
/* @__PURE__ */
|
|
7861
|
-
!isOver && /* @__PURE__ */
|
|
7862
|
-
/* @__PURE__ */
|
|
7863
|
-
/* @__PURE__ */
|
|
7864
|
-
revealName ? /* @__PURE__ */
|
|
7865
|
-
revealName && /* @__PURE__ */
|
|
7964
|
+
!config && /* @__PURE__ */ jsx77("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading }),
|
|
7965
|
+
config && /* @__PURE__ */ jsxs67(Fragment14, { children: [
|
|
7966
|
+
/* @__PURE__ */ jsxs67("div", { className: "ss-g-body", children: [
|
|
7967
|
+
!isOver && /* @__PURE__ */ jsx77(PointsLadderRow, { ladder: config.pointsLadder, guessesUsed, ui }),
|
|
7968
|
+
/* @__PURE__ */ jsxs67("div", { className: `ss-g-mt-card${isOver ? " ss-g-mt-card--reveal" : ""}`, children: [
|
|
7969
|
+
/* @__PURE__ */ jsxs67("div", { className: "ss-g-mt-portrait", children: [
|
|
7970
|
+
revealName ? /* @__PURE__ */ jsx77(PlayerAvatar, { className: "ss-g-mt-photo", name: revealName, imagePath: clientState?.revealedPlayerImagePath }) : /* @__PURE__ */ jsx77(Silhouette, { size: 150, variant: "mystery" }),
|
|
7971
|
+
revealName && /* @__PURE__ */ jsx77("span", { className: "ss-g-mt-reveal-name", children: revealName })
|
|
7866
7972
|
] }),
|
|
7867
|
-
/* @__PURE__ */
|
|
7868
|
-
/* @__PURE__ */
|
|
7869
|
-
/* @__PURE__ */
|
|
7973
|
+
/* @__PURE__ */ jsx77("div", { className: "ss-g-mt-known", style: { gridTemplateColumns: `repeat(${keys.length}, minmax(0, 1fr))` }, children: known.map((k) => /* @__PURE__ */ jsxs67("div", { className: "ss-g-mt-known-cell", children: [
|
|
7974
|
+
/* @__PURE__ */ jsx77("span", { className: "ss-g-mt-lab", children: t.labels[k.key] }),
|
|
7975
|
+
/* @__PURE__ */ jsx77("span", { className: "ss-g-mt-known-v", "data-state": k.state, "data-testid": `known-${k.key}`, children: k.text })
|
|
7870
7976
|
] }, k.key)) })
|
|
7871
7977
|
] }),
|
|
7872
|
-
!isOver && /* @__PURE__ */
|
|
7873
|
-
guessResults.length > 0 && /* @__PURE__ */
|
|
7874
|
-
/* @__PURE__ */
|
|
7875
|
-
/* @__PURE__ */
|
|
7876
|
-
keys.map((k) => /* @__PURE__ */
|
|
7978
|
+
!isOver && /* @__PURE__ */ jsx77(SegmentProgress, { segments, ariaLabel: t.progress(guessesUsed, totalGuesses) }),
|
|
7979
|
+
guessResults.length > 0 && /* @__PURE__ */ jsxs67("div", { className: "ss-g-mt-table", children: [
|
|
7980
|
+
/* @__PURE__ */ jsxs67("div", { className: "ss-g-mt-thead", style: cols, children: [
|
|
7981
|
+
/* @__PURE__ */ jsx77("span", { children: t.yourGuesses }),
|
|
7982
|
+
keys.map((k) => /* @__PURE__ */ jsx77("span", { children: t.labels[k] }, k))
|
|
7877
7983
|
] }),
|
|
7878
7984
|
guessResults.map((gr, i) => {
|
|
7879
7985
|
const name = config.squadPlayers.find((p) => p.id === gr.playerId)?.name ?? `#${gr.playerId}`;
|
|
7880
7986
|
const { first, last } = splitName(name);
|
|
7881
|
-
return /* @__PURE__ */
|
|
7882
|
-
/* @__PURE__ */
|
|
7883
|
-
/* @__PURE__ */
|
|
7884
|
-
/* @__PURE__ */
|
|
7885
|
-
first && /* @__PURE__ */
|
|
7886
|
-
/* @__PURE__ */
|
|
7987
|
+
return /* @__PURE__ */ jsxs67("div", { className: "ss-g-mt-row", style: cols, children: [
|
|
7988
|
+
/* @__PURE__ */ jsxs67("div", { className: "ss-g-mt-who", children: [
|
|
7989
|
+
/* @__PURE__ */ jsx77(PlayerAvatar, { className: "ss-g-mt-av", name }),
|
|
7990
|
+
/* @__PURE__ */ jsxs67("span", { className: "ss-g-mt-names", children: [
|
|
7991
|
+
first && /* @__PURE__ */ jsx77("span", { className: "ss-g-mt-first", children: first }),
|
|
7992
|
+
/* @__PURE__ */ jsx77("span", { className: "ss-g-mt-last", children: last })
|
|
7887
7993
|
] })
|
|
7888
7994
|
] }),
|
|
7889
7995
|
keys.map((key) => {
|
|
7890
7996
|
const v = gr[key];
|
|
7891
7997
|
const arrow = directionArrow(v);
|
|
7892
|
-
return /* @__PURE__ */
|
|
7998
|
+
return /* @__PURE__ */ jsxs67(
|
|
7893
7999
|
"div",
|
|
7894
8000
|
{
|
|
7895
8001
|
className: "ss-g-mt-cell",
|
|
@@ -7897,8 +8003,8 @@ function MysteryTigerGame({
|
|
|
7897
8003
|
"data-verdict": v.verdict,
|
|
7898
8004
|
"aria-label": `${t.labels[key]}: ${v.value ?? v.verdict}${v.direction ? ` ${v.direction}` : ""}`,
|
|
7899
8005
|
children: [
|
|
7900
|
-
/* @__PURE__ */
|
|
7901
|
-
arrow && /* @__PURE__ */
|
|
8006
|
+
/* @__PURE__ */ jsx77("span", { className: "ss-g-mt-cell-v", "aria-hidden": "true", children: tileFace(key, v) }),
|
|
8007
|
+
arrow && /* @__PURE__ */ jsx77("span", { className: "ss-g-mt-cell-dir", "aria-hidden": "true", children: arrow })
|
|
7902
8008
|
]
|
|
7903
8009
|
},
|
|
7904
8010
|
key
|
|
@@ -7907,25 +8013,25 @@ function MysteryTigerGame({
|
|
|
7907
8013
|
] }, gr.playerId);
|
|
7908
8014
|
})
|
|
7909
8015
|
] }),
|
|
7910
|
-
!isOver && /* @__PURE__ */
|
|
7911
|
-
/* @__PURE__ */
|
|
7912
|
-
/* @__PURE__ */
|
|
8016
|
+
!isOver && /* @__PURE__ */ jsxs67("div", { className: "ss-g-mt-legend", children: [
|
|
8017
|
+
/* @__PURE__ */ jsxs67("span", { children: [
|
|
8018
|
+
/* @__PURE__ */ jsx77("i", { className: "ss-g-mt-sw", "data-verdict": "exact" }),
|
|
7913
8019
|
t.legendMatch
|
|
7914
8020
|
] }),
|
|
7915
|
-
/* @__PURE__ */
|
|
7916
|
-
/* @__PURE__ */
|
|
8021
|
+
/* @__PURE__ */ jsxs67("span", { children: [
|
|
8022
|
+
/* @__PURE__ */ jsx77("i", { className: "ss-g-mt-sw", "data-verdict": "near" }),
|
|
7917
8023
|
t.legendClose
|
|
7918
8024
|
] }),
|
|
7919
|
-
/* @__PURE__ */
|
|
8025
|
+
/* @__PURE__ */ jsxs67("span", { children: [
|
|
7920
8026
|
"\u25B2 ",
|
|
7921
8027
|
t.legendHigher
|
|
7922
8028
|
] })
|
|
7923
8029
|
] }),
|
|
7924
|
-
clientState?.hintLine && !isOver && /* @__PURE__ */
|
|
7925
|
-
/* @__PURE__ */
|
|
7926
|
-
/* @__PURE__ */
|
|
8030
|
+
clientState?.hintLine && !isOver && /* @__PURE__ */ jsxs67("div", { className: "ss-g-mt-hint", children: [
|
|
8031
|
+
/* @__PURE__ */ jsx77(IconBulb, {}),
|
|
8032
|
+
/* @__PURE__ */ jsx77("span", { children: clientState.hintLine })
|
|
7927
8033
|
] }),
|
|
7928
|
-
isOver && /* @__PURE__ */
|
|
8034
|
+
isOver && /* @__PURE__ */ jsx77(
|
|
7929
8035
|
ResultCard,
|
|
7930
8036
|
{
|
|
7931
8037
|
tone: clientState?.solved ? "win" : clientState?.failed ? "lose" : "neutral",
|
|
@@ -7937,7 +8043,7 @@ function MysteryTigerGame({
|
|
|
7937
8043
|
}
|
|
7938
8044
|
)
|
|
7939
8045
|
] }),
|
|
7940
|
-
!isOver && /* @__PURE__ */
|
|
8046
|
+
!isOver && /* @__PURE__ */ jsx77(FooterBar, { children: /* @__PURE__ */ jsx77(
|
|
7941
8047
|
AnswerTray,
|
|
7942
8048
|
{
|
|
7943
8049
|
id: inputId,
|
|
@@ -7956,7 +8062,7 @@ function MysteryTigerGame({
|
|
|
7956
8062
|
}
|
|
7957
8063
|
|
|
7958
8064
|
// src/components/games/HigherOrLowerGame.tsx
|
|
7959
|
-
import { Fragment as
|
|
8065
|
+
import { Fragment as Fragment15, jsx as jsx78, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
7960
8066
|
var POINTS_PER_CORRECT = 10;
|
|
7961
8067
|
function parseClientState2(json) {
|
|
7962
8068
|
if (!json) return null;
|
|
@@ -7968,11 +8074,11 @@ function parseClientState2(json) {
|
|
|
7968
8074
|
}
|
|
7969
8075
|
function PlayerCard({ name, imagePath, highlight, children }) {
|
|
7970
8076
|
const { first, last } = splitName(name);
|
|
7971
|
-
return /* @__PURE__ */
|
|
7972
|
-
/* @__PURE__ */
|
|
7973
|
-
/* @__PURE__ */
|
|
7974
|
-
first && /* @__PURE__ */
|
|
7975
|
-
/* @__PURE__ */
|
|
8077
|
+
return /* @__PURE__ */ jsxs68("div", { className: `ss-g-hl-card${highlight ? " ss-g-hl-card--b" : ""}`, children: [
|
|
8078
|
+
/* @__PURE__ */ jsx78("div", { className: "ss-g-hl-photo-wrap", children: imagePath ? /* @__PURE__ */ jsx78(PlayerAvatar, { className: "ss-g-hl-photo", name, imagePath }) : /* @__PURE__ */ jsx78(Silhouette, { size: 150 }) }),
|
|
8079
|
+
/* @__PURE__ */ jsxs68("div", { className: "ss-g-hl-info", children: [
|
|
8080
|
+
first && /* @__PURE__ */ jsx78("span", { className: "ss-g-hl-first", children: first }),
|
|
8081
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-hl-surname", children: last }),
|
|
7976
8082
|
children
|
|
7977
8083
|
] })
|
|
7978
8084
|
] });
|
|
@@ -8004,47 +8110,47 @@ function HigherOrLowerGame({
|
|
|
8004
8110
|
const newAnswers = [...prevAnswers, { pairIndex: currentPair.pairIndex, pick }];
|
|
8005
8111
|
onSubmit(JSON.stringify({ answers: newAnswers }));
|
|
8006
8112
|
}
|
|
8007
|
-
return /* @__PURE__ */
|
|
8008
|
-
/* @__PURE__ */
|
|
8113
|
+
return /* @__PURE__ */ jsxs68("div", { className: "ss-g-screen ss-g-hl", "data-game": "higher-or-lower", "data-testid": "game-screen-higher-or-lower", children: [
|
|
8114
|
+
/* @__PURE__ */ jsx78(
|
|
8009
8115
|
GameHeader,
|
|
8010
8116
|
{
|
|
8011
8117
|
title: gameTitle({ gameId: "higher-or-lower" }, ui.games.titles),
|
|
8012
8118
|
eyebrow: t.eyebrow(POINTS_PER_CORRECT),
|
|
8013
|
-
right: config ? /* @__PURE__ */
|
|
8119
|
+
right: config ? /* @__PURE__ */ jsx78(StatStack, { value: runLength, label: t.streak }) : void 0,
|
|
8014
8120
|
onBack,
|
|
8015
8121
|
backLabel: ui.back
|
|
8016
8122
|
}
|
|
8017
8123
|
),
|
|
8018
|
-
!config && /* @__PURE__ */
|
|
8019
|
-
config && /* @__PURE__ */
|
|
8020
|
-
/* @__PURE__ */
|
|
8021
|
-
/* @__PURE__ */
|
|
8022
|
-
/* @__PURE__ */
|
|
8023
|
-
/* @__PURE__ */
|
|
8024
|
-
/* @__PURE__ */
|
|
8124
|
+
!config && /* @__PURE__ */ jsx78("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading }),
|
|
8125
|
+
config && /* @__PURE__ */ jsxs68(Fragment15, { children: [
|
|
8126
|
+
/* @__PURE__ */ jsxs68("div", { className: "ss-g-body", children: [
|
|
8127
|
+
/* @__PURE__ */ jsxs68("div", { className: "ss-g-hl-prompt", "data-testid": "hol-prompt", children: [
|
|
8128
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-hl-prompt-q", children: t.whoHadMore }),
|
|
8129
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-hl-prompt-stat", children: config.statLabel }),
|
|
8130
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-hl-prompt-season", children: t.season(config.seasonLabel) })
|
|
8025
8131
|
] }),
|
|
8026
|
-
currentPair && /* @__PURE__ */
|
|
8027
|
-
/* @__PURE__ */
|
|
8028
|
-
/* @__PURE__ */
|
|
8029
|
-
/* @__PURE__ */
|
|
8132
|
+
currentPair && /* @__PURE__ */ jsxs68("div", { className: "ss-g-hl-pair", children: [
|
|
8133
|
+
/* @__PURE__ */ jsxs68(PlayerCard, { name: currentPair.playerAName, imagePath: currentPair.playerAImagePath, children: [
|
|
8134
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-hl-value", children: currentPair.playerAValue }),
|
|
8135
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-hl-stat", children: config.statLabel })
|
|
8030
8136
|
] }),
|
|
8031
|
-
/* @__PURE__ */
|
|
8032
|
-
/* @__PURE__ */
|
|
8033
|
-
/* @__PURE__ */
|
|
8034
|
-
/* @__PURE__ */
|
|
8137
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-hl-vs", "aria-hidden": "true", children: t.vs }),
|
|
8138
|
+
/* @__PURE__ */ jsx78(PlayerCard, { name: currentPair.playerBName, imagePath: currentPair.playerBImagePath, highlight: true, children: /* @__PURE__ */ jsxs68("div", { className: "ss-g-hl-btns", children: [
|
|
8139
|
+
/* @__PURE__ */ jsxs68(GameButton, { variant: "primary", disabled: submitting, onClick: () => handlePick("higher"), children: [
|
|
8140
|
+
/* @__PURE__ */ jsx78(IconArrowUp, { size: 16 }),
|
|
8035
8141
|
t.higher
|
|
8036
8142
|
] }),
|
|
8037
|
-
/* @__PURE__ */
|
|
8038
|
-
/* @__PURE__ */
|
|
8143
|
+
/* @__PURE__ */ jsxs68(GameButton, { variant: "outline", disabled: submitting, onClick: () => handlePick("lower"), children: [
|
|
8144
|
+
/* @__PURE__ */ jsx78(IconArrowDown, { size: 16 }),
|
|
8039
8145
|
t.lower
|
|
8040
8146
|
] })
|
|
8041
8147
|
] }) })
|
|
8042
8148
|
] }),
|
|
8043
|
-
lastAnswer && lastAnswerPair && /* @__PURE__ */
|
|
8044
|
-
lastAnswer.wasCorrect ? /* @__PURE__ */
|
|
8149
|
+
lastAnswer && lastAnswerPair && /* @__PURE__ */ jsxs68("p", { className: "ss-g-hl-feedback", "data-testid": "hol-last", "data-correct": lastAnswer.wasCorrect ? "true" : "false", children: [
|
|
8150
|
+
lastAnswer.wasCorrect ? /* @__PURE__ */ jsx78(IconCheck, {}) : /* @__PURE__ */ jsx78(IconClose, {}),
|
|
8045
8151
|
t.lastAnswer(splitName(lastAnswerPair.playerBName).last, lastAnswer.playerBValue)
|
|
8046
8152
|
] }),
|
|
8047
|
-
isOver && /* @__PURE__ */
|
|
8153
|
+
isOver && /* @__PURE__ */ jsx78(
|
|
8048
8154
|
ResultCard,
|
|
8049
8155
|
{
|
|
8050
8156
|
tone: runEndedWrong ? "lose" : allPairsAnswered ? "win" : "neutral",
|
|
@@ -8056,15 +8162,15 @@ function HigherOrLowerGame({
|
|
|
8056
8162
|
}
|
|
8057
8163
|
)
|
|
8058
8164
|
] }),
|
|
8059
|
-
!isOver && /* @__PURE__ */
|
|
8060
|
-
/* @__PURE__ */
|
|
8165
|
+
!isOver && /* @__PURE__ */ jsx78(FooterBar, { children: /* @__PURE__ */ jsxs68("div", { className: "ss-g-hl-foot", children: [
|
|
8166
|
+
/* @__PURE__ */ jsx78("div", { className: "ss-g-hl-dots", role: "img", "aria-label": t.answersSoFar(answeredCount, config.pairs.length), children: config.pairs.map((p, i) => {
|
|
8061
8167
|
const a = answeredPairs[i];
|
|
8062
|
-
return /* @__PURE__ */
|
|
8168
|
+
return /* @__PURE__ */ jsx78("span", { className: "ss-g-hl-dot", "data-state": a ? a.wasCorrect ? "correct" : "wrong" : "todo" }, p.pairIndex);
|
|
8063
8169
|
}) }),
|
|
8064
|
-
/* @__PURE__ */
|
|
8065
|
-
/* @__PURE__ */
|
|
8170
|
+
/* @__PURE__ */ jsxs68("span", { className: "ss-g-hl-pts", children: [
|
|
8171
|
+
/* @__PURE__ */ jsx78("span", { "data-testid": "hol-score", children: score }),
|
|
8066
8172
|
" ",
|
|
8067
|
-
/* @__PURE__ */
|
|
8173
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-hl-pts-unit", children: ui.games.unitPts })
|
|
8068
8174
|
] })
|
|
8069
8175
|
] }) })
|
|
8070
8176
|
] })
|
|
@@ -8072,21 +8178,21 @@ function HigherOrLowerGame({
|
|
|
8072
8178
|
}
|
|
8073
8179
|
|
|
8074
8180
|
// src/components/games/CareerPathGame.tsx
|
|
8075
|
-
import { useState as
|
|
8181
|
+
import { useState as useState41, useId as useId4 } from "react";
|
|
8076
8182
|
|
|
8077
8183
|
// src/components/games/ui/CrestShield.tsx
|
|
8078
|
-
import { useState as
|
|
8079
|
-
import { jsx as
|
|
8184
|
+
import { useState as useState40 } from "react";
|
|
8185
|
+
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
8080
8186
|
function CrestShield({ src, name, size = 28 }) {
|
|
8081
|
-
const [failed, setFailed] =
|
|
8187
|
+
const [failed, setFailed] = useState40(false);
|
|
8082
8188
|
if (src && !isPlaceholderImage(src) && !failed) {
|
|
8083
|
-
return /* @__PURE__ */
|
|
8189
|
+
return /* @__PURE__ */ jsx79("img", { className: "ss-g-crest", src, alt: name, width: size, height: size, loading: "lazy", onError: () => setFailed(true) });
|
|
8084
8190
|
}
|
|
8085
|
-
return /* @__PURE__ */
|
|
8191
|
+
return /* @__PURE__ */ jsx79("svg", { className: "ss-g-crest ss-g-crest--ph", width: size, height: size * 32 / 28, viewBox: "0 0 28 32", role: "img", "aria-label": name, children: /* @__PURE__ */ jsx79("path", { d: "M2 3h24v12c0 9-6 14-12 17C8 29 2 24 2 15z", fill: "currentColor" }) });
|
|
8086
8192
|
}
|
|
8087
8193
|
|
|
8088
8194
|
// src/components/games/CareerPathGame.tsx
|
|
8089
|
-
import { Fragment as
|
|
8195
|
+
import { Fragment as Fragment16, jsx as jsx80, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
8090
8196
|
function parseClientState3(json) {
|
|
8091
8197
|
if (!json) return null;
|
|
8092
8198
|
try {
|
|
@@ -8110,15 +8216,15 @@ function CareerPathGame({
|
|
|
8110
8216
|
}) {
|
|
8111
8217
|
const s = ui.games.careerPath;
|
|
8112
8218
|
const title = gameTitle({ gameId: "career-path" }, ui.games.titles);
|
|
8113
|
-
const [query, setQuery] =
|
|
8219
|
+
const [query, setQuery] = useState41("");
|
|
8114
8220
|
const inputId = useId4();
|
|
8115
8221
|
const clientState = parseClientState3(result?.clientStateJson);
|
|
8116
8222
|
const alreadyGuessedIds = new Set(clientState?.guessResults.map((g) => g.playerId) ?? []);
|
|
8117
8223
|
const isOver = result?.alreadyPlayed === true || clientState?.solved === true || clientState?.failed === true;
|
|
8118
8224
|
if (!config) {
|
|
8119
|
-
return /* @__PURE__ */
|
|
8120
|
-
/* @__PURE__ */
|
|
8121
|
-
/* @__PURE__ */
|
|
8225
|
+
return /* @__PURE__ */ jsxs69("div", { className: "ss-g-screen", "data-game": "career-path", "data-testid": "game-screen-career-path", children: [
|
|
8226
|
+
/* @__PURE__ */ jsx80(GameHeader, { title, eyebrow: s.eyebrow, onBack, backLabel: ui.back }),
|
|
8227
|
+
/* @__PURE__ */ jsx80("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
8122
8228
|
] });
|
|
8123
8229
|
}
|
|
8124
8230
|
const visiblePath = clientState?.visiblePath ?? config.initialPath;
|
|
@@ -8132,61 +8238,61 @@ function CareerPathGame({
|
|
|
8132
8238
|
setQuery("");
|
|
8133
8239
|
onSubmit(JSON.stringify({ guesses: newGuesses }));
|
|
8134
8240
|
}
|
|
8135
|
-
const right = !isOver && clientState ? /* @__PURE__ */
|
|
8241
|
+
const right = !isOver && clientState ? /* @__PURE__ */ jsx80("span", { "data-testid": "cp-guess-chip", children: /* @__PURE__ */ jsxs69(Chip, { variant: "neutral", children: [
|
|
8136
8242
|
ui.games.guess,
|
|
8137
8243
|
" ",
|
|
8138
|
-
/* @__PURE__ */
|
|
8244
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-num", children: clientState.guessesUsed + 1 }),
|
|
8139
8245
|
" / ",
|
|
8140
8246
|
clientState.guessesUsed + clientState.guessesRemaining
|
|
8141
8247
|
] }) }) : void 0;
|
|
8142
8248
|
const outcome = clientState?.solved ? s.solved : clientState?.failed ? s.failed : ui.games.done;
|
|
8143
|
-
return /* @__PURE__ */
|
|
8144
|
-
/* @__PURE__ */
|
|
8145
|
-
/* @__PURE__ */
|
|
8146
|
-
!isOver && /* @__PURE__ */
|
|
8147
|
-
/* @__PURE__ */
|
|
8148
|
-
isOver && clientState?.revealedPlayerName ? /* @__PURE__ */
|
|
8149
|
-
/* @__PURE__ */
|
|
8150
|
-
/* @__PURE__ */
|
|
8151
|
-
clientState?.hintLine ? /* @__PURE__ */
|
|
8152
|
-
/* @__PURE__ */
|
|
8153
|
-
/* @__PURE__ */
|
|
8249
|
+
return /* @__PURE__ */ jsxs69("div", { className: "ss-g-screen", "data-game": "career-path", "data-testid": "game-screen-career-path", children: [
|
|
8250
|
+
/* @__PURE__ */ jsx80(GameHeader, { title, eyebrow: s.eyebrow, right, onBack, backLabel: ui.back }),
|
|
8251
|
+
/* @__PURE__ */ jsxs69("div", { className: "ss-g-body", children: [
|
|
8252
|
+
!isOver && /* @__PURE__ */ jsx80(PointsLadderRow, { ladder: config.pointsLadder, guessesUsed: clientState?.guessesUsed ?? 0, ui }),
|
|
8253
|
+
/* @__PURE__ */ jsxs69("div", { className: "ss-g-cp-card", children: [
|
|
8254
|
+
isOver && clientState?.revealedPlayerName ? /* @__PURE__ */ jsx80(PlayerAvatar, { className: "ss-g-cp-photo", name: clientState.revealedPlayerName, imagePath: clientState.revealedPlayerImagePath }) : /* @__PURE__ */ jsx80(Silhouette, { size: 64, variant: isOver ? "default" : "mystery" }),
|
|
8255
|
+
/* @__PURE__ */ jsxs69("div", { className: "ss-g-cp-card-text", children: [
|
|
8256
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-cp-card-title", children: isOver && clientState?.revealedPlayerName ? clientState.revealedPlayerName : s.mysteryPlayer }),
|
|
8257
|
+
clientState?.hintLine ? /* @__PURE__ */ jsx80("span", { className: "ss-g-cp-hint", children: clientState.hintLine }) : !isOver ? /* @__PURE__ */ jsxs69("span", { className: "ss-g-cp-locks", children: [
|
|
8258
|
+
/* @__PURE__ */ jsx80(Chip, { variant: "lock", icon: /* @__PURE__ */ jsx80(IconLock, { size: 11 }), children: s.lockPosition }),
|
|
8259
|
+
/* @__PURE__ */ jsx80(Chip, { variant: "lock", icon: /* @__PURE__ */ jsx80(IconLock, { size: 11 }), children: s.lockNationality })
|
|
8154
8260
|
] }) : null
|
|
8155
8261
|
] })
|
|
8156
8262
|
] }),
|
|
8157
|
-
/* @__PURE__ */
|
|
8263
|
+
/* @__PURE__ */ jsxs69("ol", { className: "ss-g-cp-line", children: [
|
|
8158
8264
|
visiblePath.map((spell, i) => {
|
|
8159
8265
|
const years = i === 0 ? s.firstClub : spellYears(spell);
|
|
8160
|
-
return /* @__PURE__ */
|
|
8161
|
-
/* @__PURE__ */
|
|
8162
|
-
/* @__PURE__ */
|
|
8163
|
-
/* @__PURE__ */
|
|
8266
|
+
return /* @__PURE__ */ jsxs69("li", { className: "ss-g-cp-step", children: [
|
|
8267
|
+
/* @__PURE__ */ jsxs69("span", { className: "ss-g-cp-rail", children: [
|
|
8268
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-cp-tile", children: /* @__PURE__ */ jsx80(CrestShield, { src: spell.crestUrl, name: spell.clubName, size: 30 }) }),
|
|
8269
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-cp-conn", "aria-hidden": "true" })
|
|
8164
8270
|
] }),
|
|
8165
|
-
/* @__PURE__ */
|
|
8166
|
-
/* @__PURE__ */
|
|
8167
|
-
/* @__PURE__ */
|
|
8168
|
-
/* @__PURE__ */
|
|
8169
|
-
spell.isLoan && /* @__PURE__ */
|
|
8271
|
+
/* @__PURE__ */ jsxs69("span", { className: "ss-g-cp-step-text", children: [
|
|
8272
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-cp-club", children: spell.clubName }),
|
|
8273
|
+
/* @__PURE__ */ jsxs69("span", { className: "ss-g-cp-sub", children: [
|
|
8274
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-cp-years", children: years }),
|
|
8275
|
+
spell.isLoan && /* @__PURE__ */ jsxs69(Fragment16, { children: [
|
|
8170
8276
|
years ? " \xB7 " : "",
|
|
8171
|
-
/* @__PURE__ */
|
|
8277
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-cp-loan", children: s.loan })
|
|
8172
8278
|
] })
|
|
8173
8279
|
] })
|
|
8174
8280
|
] })
|
|
8175
8281
|
] }, `${spell.clubName}-${i}`);
|
|
8176
8282
|
}),
|
|
8177
|
-
hidden > 0 && /* @__PURE__ */
|
|
8178
|
-
/* @__PURE__ */
|
|
8179
|
-
/* @__PURE__ */
|
|
8180
|
-
hidden > 1 && /* @__PURE__ */
|
|
8283
|
+
hidden > 0 && /* @__PURE__ */ jsxs69("li", { className: "ss-g-cp-step ss-g-cp-step--hidden", children: [
|
|
8284
|
+
/* @__PURE__ */ jsxs69("span", { className: "ss-g-cp-rail", children: [
|
|
8285
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-cp-tile ss-g-cp-tile--locked", children: /* @__PURE__ */ jsx80(IconLock, { size: 18 }) }),
|
|
8286
|
+
hidden > 1 && /* @__PURE__ */ jsx80("span", { className: "ss-g-cp-conn ss-g-cp-conn--faint", "aria-hidden": "true" })
|
|
8181
8287
|
] }),
|
|
8182
|
-
/* @__PURE__ */
|
|
8288
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-cp-step-text", children: /* @__PURE__ */ jsx80("span", { className: "ss-g-cp-sub", children: s.nextClubHidden }) })
|
|
8183
8289
|
] }),
|
|
8184
|
-
hidden > 1 && /* @__PURE__ */
|
|
8185
|
-
/* @__PURE__ */
|
|
8186
|
-
/* @__PURE__ */
|
|
8290
|
+
hidden > 1 && /* @__PURE__ */ jsxs69("li", { className: "ss-g-cp-step ss-g-cp-step--more", children: [
|
|
8291
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-cp-rail", children: /* @__PURE__ */ jsx80("span", { className: "ss-g-cp-tile ss-g-cp-tile--faint", children: /* @__PURE__ */ jsx80(IconLock, { size: 18 }) }) }),
|
|
8292
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-cp-step-text", children: /* @__PURE__ */ jsx80("span", { className: "ss-g-cp-sub", children: s.moreClubs(hidden - 1) }) })
|
|
8187
8293
|
] })
|
|
8188
8294
|
] }),
|
|
8189
|
-
isOver && /* @__PURE__ */
|
|
8295
|
+
isOver && /* @__PURE__ */ jsx80(
|
|
8190
8296
|
ResultCard,
|
|
8191
8297
|
{
|
|
8192
8298
|
tone: clientState?.solved ? "win" : clientState?.failed ? "lose" : "neutral",
|
|
@@ -8198,7 +8304,7 @@ function CareerPathGame({
|
|
|
8198
8304
|
}
|
|
8199
8305
|
)
|
|
8200
8306
|
] }),
|
|
8201
|
-
!isOver && /* @__PURE__ */
|
|
8307
|
+
!isOver && /* @__PURE__ */ jsx80(FooterBar, { children: /* @__PURE__ */ jsx80(
|
|
8202
8308
|
AnswerTray,
|
|
8203
8309
|
{
|
|
8204
8310
|
id: inputId,
|
|
@@ -8217,16 +8323,16 @@ function CareerPathGame({
|
|
|
8217
8323
|
}
|
|
8218
8324
|
|
|
8219
8325
|
// src/components/games/BeatTheGridGame.tsx
|
|
8220
|
-
import React, { useEffect as useEffect28, useId as useId5, useRef as useRef26, useState as
|
|
8326
|
+
import React, { useEffect as useEffect28, useId as useId5, useRef as useRef26, useState as useState42 } from "react";
|
|
8221
8327
|
|
|
8222
8328
|
// src/components/games/ui/OptionList.tsx
|
|
8223
|
-
import { jsx as
|
|
8329
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
8224
8330
|
function OptionList({ label, options, onPick }) {
|
|
8225
|
-
return /* @__PURE__ */
|
|
8331
|
+
return /* @__PURE__ */ jsx81("div", { className: "ss-g-opts", role: "listbox", "aria-label": label, children: options.map((o) => /* @__PURE__ */ jsx81("button", { type: "button", role: "option", "aria-selected": false, className: "ss-g-opt", onClick: () => onPick(o.key), children: o.content }, o.key)) });
|
|
8226
8332
|
}
|
|
8227
8333
|
|
|
8228
8334
|
// src/components/games/BeatTheGridGame.tsx
|
|
8229
|
-
import { Fragment as
|
|
8335
|
+
import { Fragment as Fragment17, jsx as jsx82, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
8230
8336
|
function criterionIconKind(label, key) {
|
|
8231
8337
|
const l = (key ?? label).toLowerCase();
|
|
8232
8338
|
if (l.includes("app")) return "calendar";
|
|
@@ -8244,34 +8350,34 @@ function rowAbbrev(label, map, key) {
|
|
|
8244
8350
|
function CriterionIcon({ kind }) {
|
|
8245
8351
|
switch (kind) {
|
|
8246
8352
|
case "calendar":
|
|
8247
|
-
return /* @__PURE__ */
|
|
8353
|
+
return /* @__PURE__ */ jsx82(IconCalendar, {});
|
|
8248
8354
|
case "ball":
|
|
8249
|
-
return /* @__PURE__ */
|
|
8355
|
+
return /* @__PURE__ */ jsx82(IconBall, {});
|
|
8250
8356
|
case "boot":
|
|
8251
|
-
return /* @__PURE__ */
|
|
8357
|
+
return /* @__PURE__ */ jsx82(IconBoot, {});
|
|
8252
8358
|
case "gloves":
|
|
8253
|
-
return /* @__PURE__ */
|
|
8359
|
+
return /* @__PURE__ */ jsx82(IconGloves, {});
|
|
8254
8360
|
case "shield":
|
|
8255
|
-
return /* @__PURE__ */
|
|
8361
|
+
return /* @__PURE__ */ jsx82(IconShield, {});
|
|
8256
8362
|
default:
|
|
8257
|
-
return /* @__PURE__ */
|
|
8363
|
+
return /* @__PURE__ */ jsx82(IconFlag, {});
|
|
8258
8364
|
}
|
|
8259
8365
|
}
|
|
8260
8366
|
function HeaderVisual({ label, textKey: iKey, meta }) {
|
|
8261
8367
|
if (!meta) {
|
|
8262
|
-
return /* @__PURE__ */
|
|
8368
|
+
return /* @__PURE__ */ jsx82(CriterionIcon, { kind: criterionIconKind(label, iKey) });
|
|
8263
8369
|
}
|
|
8264
8370
|
switch (meta.kind) {
|
|
8265
8371
|
case "club":
|
|
8266
|
-
return /* @__PURE__ */
|
|
8372
|
+
return /* @__PURE__ */ jsx82(CrestShield, { src: meta.imageUrl, name: label, size: 24 });
|
|
8267
8373
|
case "coach":
|
|
8268
|
-
return /* @__PURE__ */
|
|
8374
|
+
return /* @__PURE__ */ jsx82(PlayerAvatar, { name: label, imagePath: meta.imageUrl, className: "ss-g-btg-coach-av" });
|
|
8269
8375
|
case "country":
|
|
8270
|
-
return /* @__PURE__ */
|
|
8376
|
+
return /* @__PURE__ */ jsx82("span", { className: "ss-g-btg-hdr-flag", "aria-hidden": "true", children: nationalityFlag(meta.country ?? label) });
|
|
8271
8377
|
case "position":
|
|
8272
|
-
return /* @__PURE__ */
|
|
8378
|
+
return /* @__PURE__ */ jsx82(Fragment17, {});
|
|
8273
8379
|
default:
|
|
8274
|
-
return /* @__PURE__ */
|
|
8380
|
+
return /* @__PURE__ */ jsx82(CriterionIcon, { kind: criterionIconKind(label, iKey) });
|
|
8275
8381
|
}
|
|
8276
8382
|
}
|
|
8277
8383
|
function parseClientState4(json) {
|
|
@@ -8306,7 +8412,7 @@ function SearchSheet({
|
|
|
8306
8412
|
ui
|
|
8307
8413
|
}) {
|
|
8308
8414
|
const s = ui.games.beatTheGrid;
|
|
8309
|
-
const [query, setQuery] =
|
|
8415
|
+
const [query, setQuery] = useState42("");
|
|
8310
8416
|
const inputId = useId5();
|
|
8311
8417
|
const inputRef = useRef26(null);
|
|
8312
8418
|
useEffect28(() => {
|
|
@@ -8315,12 +8421,12 @@ function SearchSheet({
|
|
|
8315
8421
|
const filtered = playerPool.filter(
|
|
8316
8422
|
(p) => !alreadyFilledIds.has(p.id) && p.name.toLowerCase().includes(query.toLowerCase())
|
|
8317
8423
|
);
|
|
8318
|
-
return /* @__PURE__ */
|
|
8319
|
-
/* @__PURE__ */
|
|
8320
|
-
/* @__PURE__ */
|
|
8321
|
-
/* @__PURE__ */
|
|
8322
|
-
/* @__PURE__ */
|
|
8323
|
-
/* @__PURE__ */
|
|
8424
|
+
return /* @__PURE__ */ jsxs70("div", { className: "ss-g-btg-sheet", "data-testid": "btg-search-sheet", children: [
|
|
8425
|
+
/* @__PURE__ */ jsxs70("div", { className: "ss-g-btg-sheet-hdr", children: [
|
|
8426
|
+
/* @__PURE__ */ jsx82(Chip, { variant: "neutral", children: rowLabel }),
|
|
8427
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-btg-sheet-x", "aria-hidden": "true", children: /* @__PURE__ */ jsx82(IconClose, { size: 12 }) }),
|
|
8428
|
+
/* @__PURE__ */ jsx82(Chip, { variant: "accent", children: colLabel }),
|
|
8429
|
+
/* @__PURE__ */ jsx82(
|
|
8324
8430
|
"button",
|
|
8325
8431
|
{
|
|
8326
8432
|
type: "button",
|
|
@@ -8328,12 +8434,12 @@ function SearchSheet({
|
|
|
8328
8434
|
"data-testid": "btg-sheet-dismiss",
|
|
8329
8435
|
"aria-label": s.closeSearch,
|
|
8330
8436
|
onClick: onDismiss,
|
|
8331
|
-
children: /* @__PURE__ */
|
|
8437
|
+
children: /* @__PURE__ */ jsx82(IconClose, {})
|
|
8332
8438
|
}
|
|
8333
8439
|
)
|
|
8334
8440
|
] }),
|
|
8335
|
-
playerPool.length === 0 ? /* @__PURE__ */
|
|
8336
|
-
/* @__PURE__ */
|
|
8441
|
+
playerPool.length === 0 ? /* @__PURE__ */ jsx82("div", { className: "ss-g-btg-sheet-empty", children: s.emptyPool }) : /* @__PURE__ */ jsxs70(Fragment17, { children: [
|
|
8442
|
+
/* @__PURE__ */ jsx82(
|
|
8337
8443
|
SearchField,
|
|
8338
8444
|
{
|
|
8339
8445
|
id: inputId,
|
|
@@ -8345,16 +8451,16 @@ function SearchSheet({
|
|
|
8345
8451
|
inputRef
|
|
8346
8452
|
}
|
|
8347
8453
|
),
|
|
8348
|
-
query.length > 0 && filtered.length > 0 && /* @__PURE__ */
|
|
8454
|
+
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ jsx82(
|
|
8349
8455
|
OptionList,
|
|
8350
8456
|
{
|
|
8351
8457
|
label: s.searchLabel(rowLabel, colLabel),
|
|
8352
8458
|
options: filtered.map((p) => ({
|
|
8353
8459
|
key: p.id,
|
|
8354
|
-
content: /* @__PURE__ */
|
|
8355
|
-
/* @__PURE__ */
|
|
8356
|
-
/* @__PURE__ */
|
|
8357
|
-
/* @__PURE__ */
|
|
8460
|
+
content: /* @__PURE__ */ jsxs70(Fragment17, { children: [
|
|
8461
|
+
/* @__PURE__ */ jsx82(PlayerAvatar, { name: p.name, imagePath: p.imagePath, className: "ss-g-opt-av" }),
|
|
8462
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-btg-result-name", children: p.name }),
|
|
8463
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-btg-result-plus", "aria-hidden": "true", children: /* @__PURE__ */ jsx82(IconPlus, { size: 18 }) })
|
|
8358
8464
|
] })
|
|
8359
8465
|
})),
|
|
8360
8466
|
onPick: (k) => onPick(row, col, Number(k))
|
|
@@ -8374,7 +8480,7 @@ function BeatTheGridGame({
|
|
|
8374
8480
|
}) {
|
|
8375
8481
|
const s = ui.games.beatTheGrid;
|
|
8376
8482
|
const title = gameTitle({ gameId: "beat-the-grid" }, ui.games.titles);
|
|
8377
|
-
const [activeCell, setActiveCell] =
|
|
8483
|
+
const [activeCell, setActiveCell] = useState42(null);
|
|
8378
8484
|
const clientState = parseClientState4(result?.clientStateJson);
|
|
8379
8485
|
const filledCells = clientState?.cells ?? [];
|
|
8380
8486
|
const isLocked2 = result?.alreadyPlayed === true || clientState?.isComplete === true;
|
|
@@ -8392,9 +8498,9 @@ function BeatTheGridGame({
|
|
|
8392
8498
|
onSubmit(JSON.stringify({ cells: newCells }));
|
|
8393
8499
|
}
|
|
8394
8500
|
if (!config) {
|
|
8395
|
-
return /* @__PURE__ */
|
|
8396
|
-
/* @__PURE__ */
|
|
8397
|
-
/* @__PURE__ */
|
|
8501
|
+
return /* @__PURE__ */ jsxs70("div", { className: "ss-g-screen", "data-game": "beat-the-grid", "data-testid": "game-screen-beat-the-grid", children: [
|
|
8502
|
+
/* @__PURE__ */ jsx82(GameHeader, { title, eyebrow: s.eyebrow, onBack, backLabel: ui.back }),
|
|
8503
|
+
/* @__PURE__ */ jsx82("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
8398
8504
|
] });
|
|
8399
8505
|
}
|
|
8400
8506
|
const rows = config.rows;
|
|
@@ -8407,20 +8513,20 @@ function BeatTheGridGame({
|
|
|
8407
8513
|
(_, i) => i < correctCount ? "correct" : i < correctCount + wrongCount ? "wrong" : "todo"
|
|
8408
8514
|
);
|
|
8409
8515
|
const totalScore = clientState?.totalScore ?? result?.score ?? 0;
|
|
8410
|
-
return /* @__PURE__ */
|
|
8411
|
-
/* @__PURE__ */
|
|
8412
|
-
/* @__PURE__ */
|
|
8516
|
+
return /* @__PURE__ */ jsxs70("div", { className: "ss-g-screen", "data-game": "beat-the-grid", "data-testid": "game-screen-beat-the-grid", children: [
|
|
8517
|
+
/* @__PURE__ */ jsx82(GameHeader, { title, eyebrow: s.eyebrow, onBack, backLabel: ui.back }),
|
|
8518
|
+
/* @__PURE__ */ jsx82(
|
|
8413
8519
|
SegmentProgress,
|
|
8414
8520
|
{
|
|
8415
8521
|
segments,
|
|
8416
8522
|
ariaLabel: s.progressAria(filledCells.length, total),
|
|
8417
8523
|
leftLabel: s.filled(filledCells.length, total),
|
|
8418
8524
|
rightLabel: s.toGo(Math.max(0, total - filledCells.length)),
|
|
8419
|
-
right: /* @__PURE__ */
|
|
8525
|
+
right: /* @__PURE__ */ jsx82(Chip, { variant: "accent", children: `${totalScore} ${ui.games.unitPts}` })
|
|
8420
8526
|
}
|
|
8421
8527
|
),
|
|
8422
|
-
/* @__PURE__ */
|
|
8423
|
-
/* @__PURE__ */
|
|
8528
|
+
/* @__PURE__ */ jsxs70("div", { className: "ss-g-body", children: [
|
|
8529
|
+
/* @__PURE__ */ jsxs70(
|
|
8424
8530
|
"div",
|
|
8425
8531
|
{
|
|
8426
8532
|
className: activeCell !== null ? "ss-g-btg-grid ss-g-btg-grid--fit" : "ss-g-btg-grid",
|
|
@@ -8430,31 +8536,31 @@ function BeatTheGridGame({
|
|
|
8430
8536
|
},
|
|
8431
8537
|
role: "grid",
|
|
8432
8538
|
children: [
|
|
8433
|
-
/* @__PURE__ */
|
|
8539
|
+
/* @__PURE__ */ jsx82("div", { className: "ss-g-btg-corner" }),
|
|
8434
8540
|
cols.map((col, colIdx) => {
|
|
8435
8541
|
const colMeta = config.colsMeta?.[colIdx];
|
|
8436
|
-
return /* @__PURE__ */
|
|
8437
|
-
/* @__PURE__ */
|
|
8438
|
-
/* @__PURE__ */
|
|
8542
|
+
return /* @__PURE__ */ jsxs70("div", { className: "ss-g-btg-colhdr", "data-meta": colMeta ? "true" : void 0, children: [
|
|
8543
|
+
/* @__PURE__ */ jsx82(HeaderVisual, { label: col, textKey: config.colsI18n?.[colIdx]?.key, meta: colMeta }),
|
|
8544
|
+
/* @__PURE__ */ jsx82("span", { children: col })
|
|
8439
8545
|
] }, col);
|
|
8440
8546
|
}),
|
|
8441
8547
|
rows.map((rowLabel, rowIdx) => {
|
|
8442
8548
|
const rowMeta = config.rowsMeta?.[rowIdx];
|
|
8443
8549
|
const abbr = rowAbbrev(rowLabel, s.rowAbbrev, config.rowsI18n?.[rowIdx]?.key);
|
|
8444
|
-
const rowHeaderContent = rowMeta ? /* @__PURE__ */
|
|
8445
|
-
/* @__PURE__ */
|
|
8446
|
-
/* @__PURE__ */
|
|
8447
|
-
] }) : abbr === rowLabel ? /* @__PURE__ */
|
|
8448
|
-
/* @__PURE__ */
|
|
8449
|
-
/* @__PURE__ */
|
|
8550
|
+
const rowHeaderContent = rowMeta ? /* @__PURE__ */ jsxs70(Fragment17, { children: [
|
|
8551
|
+
/* @__PURE__ */ jsx82(HeaderVisual, { label: rowLabel, textKey: config.rowsI18n?.[rowIdx]?.key, meta: rowMeta }),
|
|
8552
|
+
/* @__PURE__ */ jsx82("span", { children: rowLabel })
|
|
8553
|
+
] }) : abbr === rowLabel ? /* @__PURE__ */ jsx82("span", { children: rowLabel }) : /* @__PURE__ */ jsxs70(Fragment17, { children: [
|
|
8554
|
+
/* @__PURE__ */ jsx82("span", { "aria-hidden": "true", children: abbr }),
|
|
8555
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-sr", children: rowLabel })
|
|
8450
8556
|
] });
|
|
8451
|
-
return /* @__PURE__ */
|
|
8452
|
-
/* @__PURE__ */
|
|
8557
|
+
return /* @__PURE__ */ jsxs70(React.Fragment, { children: [
|
|
8558
|
+
/* @__PURE__ */ jsx82("div", { className: "ss-g-btg-rowhdr", "data-meta": rowMeta ? "true" : void 0, children: rowHeaderContent }),
|
|
8453
8559
|
cols.map((colLabel, colIdx) => {
|
|
8454
8560
|
const filled = findCellResult(filledCells, rowIdx, colIdx);
|
|
8455
8561
|
const isActive = activeCell?.row === rowIdx && activeCell?.col === colIdx;
|
|
8456
8562
|
const state = filled ? filled.isCorrect ? "correct" : "wrong" : isActive ? "active" : "empty";
|
|
8457
|
-
return /* @__PURE__ */
|
|
8563
|
+
return /* @__PURE__ */ jsx82(
|
|
8458
8564
|
"button",
|
|
8459
8565
|
{
|
|
8460
8566
|
type: "button",
|
|
@@ -8465,20 +8571,20 @@ function BeatTheGridGame({
|
|
|
8465
8571
|
className: "ss-g-btg-cell",
|
|
8466
8572
|
disabled: isLocked2 || submitting,
|
|
8467
8573
|
onClick: () => handleCellClick(rowIdx, colIdx),
|
|
8468
|
-
children: filled ? /* @__PURE__ */
|
|
8469
|
-
/* @__PURE__ */
|
|
8574
|
+
children: filled ? /* @__PURE__ */ jsxs70(Fragment17, { children: [
|
|
8575
|
+
/* @__PURE__ */ jsx82(
|
|
8470
8576
|
"span",
|
|
8471
8577
|
{
|
|
8472
8578
|
className: `ss-g-btg-badge ss-g-btg-badge--${filled.isCorrect ? "correct" : "wrong"}`,
|
|
8473
8579
|
role: "img",
|
|
8474
8580
|
"aria-label": filled.isCorrect ? s.correct : s.wrong,
|
|
8475
|
-
children: filled.isCorrect ? /* @__PURE__ */
|
|
8581
|
+
children: filled.isCorrect ? /* @__PURE__ */ jsx82(IconCheck, { size: 11 }) : /* @__PURE__ */ jsx82(IconClose, { size: 11 })
|
|
8476
8582
|
}
|
|
8477
8583
|
),
|
|
8478
|
-
/* @__PURE__ */
|
|
8584
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-btg-rarity", children: filled.rarityScore }),
|
|
8479
8585
|
(() => {
|
|
8480
8586
|
const entry = playerPool.find((p) => p.id === filled.playerId);
|
|
8481
|
-
return /* @__PURE__ */
|
|
8587
|
+
return /* @__PURE__ */ jsx82(
|
|
8482
8588
|
PlayerAvatar,
|
|
8483
8589
|
{
|
|
8484
8590
|
name: entry?.name ?? "",
|
|
@@ -8487,8 +8593,8 @@ function BeatTheGridGame({
|
|
|
8487
8593
|
}
|
|
8488
8594
|
);
|
|
8489
8595
|
})(),
|
|
8490
|
-
/* @__PURE__ */
|
|
8491
|
-
] }) : /* @__PURE__ */
|
|
8596
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-btg-name", children: shortName(playerPool.find((p) => p.id === filled.playerId)?.name) })
|
|
8597
|
+
] }) : /* @__PURE__ */ jsx82("span", { className: "ss-g-btg-plus", "aria-hidden": "true", children: /* @__PURE__ */ jsx82(IconPlus, { size: 22 }) })
|
|
8492
8598
|
},
|
|
8493
8599
|
`cell-${rowIdx}-${colIdx}`
|
|
8494
8600
|
);
|
|
@@ -8498,7 +8604,7 @@ function BeatTheGridGame({
|
|
|
8498
8604
|
]
|
|
8499
8605
|
}
|
|
8500
8606
|
),
|
|
8501
|
-
isLocked2 && /* @__PURE__ */
|
|
8607
|
+
isLocked2 && /* @__PURE__ */ jsx82(
|
|
8502
8608
|
ResultCard,
|
|
8503
8609
|
{
|
|
8504
8610
|
tone: "neutral",
|
|
@@ -8510,7 +8616,7 @@ function BeatTheGridGame({
|
|
|
8510
8616
|
}
|
|
8511
8617
|
)
|
|
8512
8618
|
] }),
|
|
8513
|
-
activeCell !== null && /* @__PURE__ */
|
|
8619
|
+
activeCell !== null && /* @__PURE__ */ jsx82("div", { className: "ss-g-btg-pin", children: /* @__PURE__ */ jsx82(
|
|
8514
8620
|
SearchSheet,
|
|
8515
8621
|
{
|
|
8516
8622
|
row: activeCell.row,
|
|
@@ -8529,21 +8635,21 @@ function BeatTheGridGame({
|
|
|
8529
8635
|
}
|
|
8530
8636
|
|
|
8531
8637
|
// src/components/games/GuessTheXiGame.tsx
|
|
8532
|
-
import { useState as
|
|
8638
|
+
import { useState as useState43, useId as useId6 } from "react";
|
|
8533
8639
|
|
|
8534
8640
|
// src/components/games/ui/PitchSvg.tsx
|
|
8535
|
-
import { Fragment as
|
|
8641
|
+
import { Fragment as Fragment18, jsx as jsx83, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
8536
8642
|
function PitchSvg({ variant }) {
|
|
8537
|
-
return /* @__PURE__ */
|
|
8538
|
-
/* @__PURE__ */
|
|
8539
|
-
variant === "full" ? /* @__PURE__ */
|
|
8540
|
-
/* @__PURE__ */
|
|
8541
|
-
/* @__PURE__ */
|
|
8542
|
-
/* @__PURE__ */
|
|
8543
|
-
/* @__PURE__ */
|
|
8544
|
-
] }) : /* @__PURE__ */
|
|
8545
|
-
/* @__PURE__ */
|
|
8546
|
-
/* @__PURE__ */
|
|
8643
|
+
return /* @__PURE__ */ jsxs71("svg", { className: "ss-g-pitch-svg", viewBox: variant === "full" ? "0 0 100 150" : "0 0 100 100", preserveAspectRatio: "none", "aria-hidden": "true", children: [
|
|
8644
|
+
/* @__PURE__ */ jsx83("rect", { x: "4", y: "4", width: "92", height: variant === "full" ? 142 : 92, fill: "none" }),
|
|
8645
|
+
variant === "full" ? /* @__PURE__ */ jsxs71(Fragment18, { children: [
|
|
8646
|
+
/* @__PURE__ */ jsx83("line", { x1: "4", y1: "75", x2: "96", y2: "75" }),
|
|
8647
|
+
/* @__PURE__ */ jsx83("circle", { cx: "50", cy: "75", r: "12", fill: "none" }),
|
|
8648
|
+
/* @__PURE__ */ jsx83("rect", { x: "26", y: "4", width: "48", height: "20", fill: "none" }),
|
|
8649
|
+
/* @__PURE__ */ jsx83("rect", { x: "26", y: "126", width: "48", height: "20", fill: "none" })
|
|
8650
|
+
] }) : /* @__PURE__ */ jsxs71(Fragment18, { children: [
|
|
8651
|
+
/* @__PURE__ */ jsx83("path", { d: "M38 4a12 12 0 0 0 24 0", fill: "none" }),
|
|
8652
|
+
/* @__PURE__ */ jsx83("rect", { x: "26", y: "76", width: "48", height: "20", fill: "none" })
|
|
8547
8653
|
] })
|
|
8548
8654
|
] });
|
|
8549
8655
|
}
|
|
@@ -8599,7 +8705,7 @@ function positionsBySlot(formation, rowsAttackFirst) {
|
|
|
8599
8705
|
}
|
|
8600
8706
|
|
|
8601
8707
|
// src/components/games/GuessTheXiGame.tsx
|
|
8602
|
-
import { Fragment as
|
|
8708
|
+
import { Fragment as Fragment19, jsx as jsx84, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
8603
8709
|
var MAX_GUESSES2 = 3;
|
|
8604
8710
|
function parseClientState5(json) {
|
|
8605
8711
|
if (!json) return null;
|
|
@@ -8618,7 +8724,7 @@ function GuessTheXiGame({
|
|
|
8618
8724
|
onBack
|
|
8619
8725
|
}) {
|
|
8620
8726
|
const t = ui.games.guessTheXi;
|
|
8621
|
-
const [query, setQuery] =
|
|
8727
|
+
const [query, setQuery] = useState43("");
|
|
8622
8728
|
const inputId = useId6();
|
|
8623
8729
|
const clientState = parseClientState5(result?.clientStateJson);
|
|
8624
8730
|
const isOver = result?.alreadyPlayed === true || clientState?.status === "solved" || clientState?.status === "failed";
|
|
@@ -8649,31 +8755,31 @@ function GuessTheXiGame({
|
|
|
8649
8755
|
const wrongGuesses = (clientState?.guessHistory ?? []).filter((g) => !g.wasCorrect);
|
|
8650
8756
|
const guessesLeft = Math.max(0, MAX_GUESSES2 - (clientState?.guessesUsed ?? 0));
|
|
8651
8757
|
const teamName = (id) => config?.teamPool.find((tm) => tm.teamId === id)?.teamName ?? `#${id}`;
|
|
8652
|
-
return /* @__PURE__ */
|
|
8653
|
-
/* @__PURE__ */
|
|
8758
|
+
return /* @__PURE__ */ jsxs72("div", { className: "ss-g-screen ss-g-gxi", "data-game": "guess-the-xi", "data-testid": "game-screen-guess-the-xi", children: [
|
|
8759
|
+
/* @__PURE__ */ jsx84(
|
|
8654
8760
|
GameHeader,
|
|
8655
8761
|
{
|
|
8656
8762
|
title: gameTitle({ gameId: "guess-the-xi" }, ui.games.titles),
|
|
8657
8763
|
eyebrow: config?.poolLabel,
|
|
8658
|
-
right: formation ? /* @__PURE__ */
|
|
8764
|
+
right: formation ? /* @__PURE__ */ jsx84(Chip, { variant: "accent", children: formation }) : void 0,
|
|
8659
8765
|
onBack,
|
|
8660
8766
|
backLabel: ui.back
|
|
8661
8767
|
}
|
|
8662
8768
|
),
|
|
8663
|
-
!config && /* @__PURE__ */
|
|
8664
|
-
config && /* @__PURE__ */
|
|
8665
|
-
/* @__PURE__ */
|
|
8666
|
-
!isOver && /* @__PURE__ */
|
|
8667
|
-
rows.length > 0 && /* @__PURE__ */
|
|
8668
|
-
/* @__PURE__ */
|
|
8669
|
-
/* @__PURE__ */
|
|
8769
|
+
!config && /* @__PURE__ */ jsx84("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading }),
|
|
8770
|
+
config && /* @__PURE__ */ jsxs72(Fragment19, { children: [
|
|
8771
|
+
/* @__PURE__ */ jsxs72("div", { className: "ss-g-body", children: [
|
|
8772
|
+
!isOver && /* @__PURE__ */ jsx84(PointsLadderRow, { ladder: config.pointsLadder, guessesUsed: clientState?.guessHistory.length ?? 0, ui }),
|
|
8773
|
+
rows.length > 0 && /* @__PURE__ */ jsxs72("div", { className: "ss-g-gxi-pitch", role: "group", "aria-label": t.pitchLabel, children: [
|
|
8774
|
+
/* @__PURE__ */ jsx84(PitchSvg, { variant: "full" }),
|
|
8775
|
+
/* @__PURE__ */ jsx84("div", { className: "ss-g-gxi-rows", children: rows.map((row, r) => /* @__PURE__ */ jsx84("div", { className: "ss-g-gxi-row", children: row.map((pos, c) => {
|
|
8670
8776
|
const posLabel = pos.slot ? posBySlot.get(pos.slot) ?? "" : "";
|
|
8671
8777
|
const name = pos.slot ? nameBySlot.get(pos.slot) : void 0;
|
|
8672
8778
|
const lineupEntry = pos.slot ? lineupBySlot.get(pos.slot) : void 0;
|
|
8673
8779
|
const flag = nationalityFlag(pos.nationality);
|
|
8674
8780
|
if (lineupEntry) {
|
|
8675
|
-
return /* @__PURE__ */
|
|
8676
|
-
/* @__PURE__ */
|
|
8781
|
+
return /* @__PURE__ */ jsxs72("div", { className: "ss-g-gxi-node", "data-revealed": "true", children: [
|
|
8782
|
+
/* @__PURE__ */ jsx84(
|
|
8677
8783
|
PlayerAvatar,
|
|
8678
8784
|
{
|
|
8679
8785
|
name: lineupEntry.name,
|
|
@@ -8681,11 +8787,11 @@ function GuessTheXiGame({
|
|
|
8681
8787
|
className: "ss-g-gxi-disc ss-g-gxi-disc--photo"
|
|
8682
8788
|
}
|
|
8683
8789
|
),
|
|
8684
|
-
/* @__PURE__ */
|
|
8790
|
+
/* @__PURE__ */ jsx84("span", { className: "ss-g-gxi-pos ss-g-gxi-pos--name", children: splitName(lineupEntry.name).last })
|
|
8685
8791
|
] }, `${pos.slot}-${c}`);
|
|
8686
8792
|
}
|
|
8687
|
-
return /* @__PURE__ */
|
|
8688
|
-
/* @__PURE__ */
|
|
8793
|
+
return /* @__PURE__ */ jsxs72("div", { className: "ss-g-gxi-node", "data-revealed": name ? "true" : void 0, children: [
|
|
8794
|
+
/* @__PURE__ */ jsx84(
|
|
8689
8795
|
"span",
|
|
8690
8796
|
{
|
|
8691
8797
|
className: "ss-g-gxi-disc",
|
|
@@ -8696,22 +8802,22 @@ function GuessTheXiGame({
|
|
|
8696
8802
|
children: flag
|
|
8697
8803
|
}
|
|
8698
8804
|
),
|
|
8699
|
-
name ? /* @__PURE__ */
|
|
8805
|
+
name ? /* @__PURE__ */ jsx84("span", { className: "ss-g-gxi-pos ss-g-gxi-pos--name", children: splitName(name).last }) : posLabel && /* @__PURE__ */ jsx84("span", { className: "ss-g-gxi-pos", children: posLabel })
|
|
8700
8806
|
] }, `${pos.slot}-${c}`);
|
|
8701
8807
|
}) }, r)) })
|
|
8702
8808
|
] }),
|
|
8703
|
-
!isOver && wrongGuesses.length > 0 && /* @__PURE__ */
|
|
8704
|
-
/* @__PURE__ */
|
|
8809
|
+
!isOver && wrongGuesses.length > 0 && /* @__PURE__ */ jsxs72("div", { className: "ss-g-gxi-wrong", children: [
|
|
8810
|
+
/* @__PURE__ */ jsx84("span", { className: "ss-g-gxi-wrong-l", children: t.notThem }),
|
|
8705
8811
|
wrongGuesses.map((g) => {
|
|
8706
8812
|
const crestUrl = config?.teamPool.find((tm) => tm.teamId === g.teamId)?.crestUrl;
|
|
8707
|
-
return /* @__PURE__ */
|
|
8708
|
-
/* @__PURE__ */
|
|
8709
|
-
/* @__PURE__ */
|
|
8813
|
+
return /* @__PURE__ */ jsxs72("span", { className: "ss-g-gxi-wrong-chip", children: [
|
|
8814
|
+
/* @__PURE__ */ jsx84(CrestShield, { src: crestUrl, name: teamName(g.teamId), size: 18 }),
|
|
8815
|
+
/* @__PURE__ */ jsx84("s", { children: teamName(g.teamId) })
|
|
8710
8816
|
] }, g.teamId);
|
|
8711
8817
|
})
|
|
8712
8818
|
] }),
|
|
8713
|
-
isOver && /* @__PURE__ */
|
|
8714
|
-
/* @__PURE__ */
|
|
8819
|
+
isOver && /* @__PURE__ */ jsxs72(Fragment19, { children: [
|
|
8820
|
+
/* @__PURE__ */ jsx84(
|
|
8715
8821
|
ResultCard,
|
|
8716
8822
|
{
|
|
8717
8823
|
tone: solved ? "win" : failed ? "lose" : "neutral",
|
|
@@ -8722,29 +8828,29 @@ function GuessTheXiGame({
|
|
|
8722
8828
|
ui
|
|
8723
8829
|
}
|
|
8724
8830
|
),
|
|
8725
|
-
(solved || failed) && clientState?.answer && /* @__PURE__ */
|
|
8726
|
-
/* @__PURE__ */
|
|
8727
|
-
/* @__PURE__ */
|
|
8728
|
-
/* @__PURE__ */
|
|
8831
|
+
(solved || failed) && clientState?.answer && /* @__PURE__ */ jsxs72("div", { className: "ss-g-gxi-answer", "data-testid": "gxi-answer-reveal", children: [
|
|
8832
|
+
/* @__PURE__ */ jsx84("span", { className: "ss-g-gxi-answer-label", children: t.theAnswer }),
|
|
8833
|
+
/* @__PURE__ */ jsx84(CrestShield, { src: clientState.answer.crestUrl, name: clientState.answer.teamName, size: 32 }),
|
|
8834
|
+
/* @__PURE__ */ jsx84("span", { className: "ss-g-gxi-answer-name", children: clientState.answer.teamName })
|
|
8729
8835
|
] })
|
|
8730
8836
|
] })
|
|
8731
8837
|
] }),
|
|
8732
|
-
!isOver && /* @__PURE__ */
|
|
8733
|
-
query.length > 0 && filtered.length > 0 && /* @__PURE__ */
|
|
8838
|
+
!isOver && /* @__PURE__ */ jsxs72(FooterBar, { children: [
|
|
8839
|
+
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ jsx84(
|
|
8734
8840
|
OptionList,
|
|
8735
8841
|
{
|
|
8736
8842
|
label: t.optionsLabel,
|
|
8737
8843
|
options: filtered.map((tm) => ({
|
|
8738
8844
|
key: tm.teamId,
|
|
8739
|
-
content: /* @__PURE__ */
|
|
8740
|
-
/* @__PURE__ */
|
|
8741
|
-
/* @__PURE__ */
|
|
8845
|
+
content: /* @__PURE__ */ jsxs72(Fragment19, { children: [
|
|
8846
|
+
/* @__PURE__ */ jsx84(CrestShield, { src: tm.crestUrl, name: tm.teamName, size: 28 }),
|
|
8847
|
+
/* @__PURE__ */ jsx84("span", { children: tm.teamName })
|
|
8742
8848
|
] })
|
|
8743
8849
|
})),
|
|
8744
8850
|
onPick: (k) => handlePick(Number(k))
|
|
8745
8851
|
}
|
|
8746
8852
|
),
|
|
8747
|
-
/* @__PURE__ */
|
|
8853
|
+
/* @__PURE__ */ jsx84(
|
|
8748
8854
|
SearchField,
|
|
8749
8855
|
{
|
|
8750
8856
|
id: inputId,
|
|
@@ -8761,8 +8867,8 @@ function GuessTheXiGame({
|
|
|
8761
8867
|
}
|
|
8762
8868
|
|
|
8763
8869
|
// src/components/games/DailyQuizGame.tsx
|
|
8764
|
-
import { useState as
|
|
8765
|
-
import { Fragment as
|
|
8870
|
+
import { useState as useState44 } from "react";
|
|
8871
|
+
import { Fragment as Fragment20, jsx as jsx85, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
8766
8872
|
function parseClientState6(json) {
|
|
8767
8873
|
if (!json) return null;
|
|
8768
8874
|
try {
|
|
@@ -8783,13 +8889,13 @@ function OptionName({ text }) {
|
|
|
8783
8889
|
const tokens = base.split(/\s+/).filter(Boolean);
|
|
8784
8890
|
const isPlainName = tokens.length >= 1 && tokens.length <= 4 && tokens.every((t) => NAME_TOKEN.test(t));
|
|
8785
8891
|
if (!isPlainName || base === "") {
|
|
8786
|
-
return /* @__PURE__ */
|
|
8892
|
+
return /* @__PURE__ */ jsx85("span", { className: "ss-g-dq-opt-name", children: /* @__PURE__ */ jsx85("span", { className: "ss-g-dq-opt-full", children: text }) });
|
|
8787
8893
|
}
|
|
8788
8894
|
const { first, last } = splitName(base);
|
|
8789
|
-
return /* @__PURE__ */
|
|
8790
|
-
first && /* @__PURE__ */
|
|
8791
|
-
/* @__PURE__ */
|
|
8792
|
-
suffix && /* @__PURE__ */
|
|
8895
|
+
return /* @__PURE__ */ jsxs73("span", { className: "ss-g-dq-opt-name", children: [
|
|
8896
|
+
first && /* @__PURE__ */ jsx85("span", { className: "ss-g-dq-opt-first", children: first }),
|
|
8897
|
+
/* @__PURE__ */ jsx85("span", { className: "ss-g-dq-opt-last", children: last }),
|
|
8898
|
+
suffix && /* @__PURE__ */ jsx85("span", { className: "ss-g-dq-opt-suffix", children: suffix })
|
|
8793
8899
|
] });
|
|
8794
8900
|
}
|
|
8795
8901
|
function DailyQuizGame({
|
|
@@ -8802,15 +8908,15 @@ function DailyQuizGame({
|
|
|
8802
8908
|
}) {
|
|
8803
8909
|
const s = ui.games.dailyQuiz;
|
|
8804
8910
|
const title = gameTitle({ gameId: "daily-quiz" }, ui.games.titles);
|
|
8805
|
-
const [selections, setSelections] =
|
|
8806
|
-
const [page, setPage] =
|
|
8911
|
+
const [selections, setSelections] = useState44(/* @__PURE__ */ new Map());
|
|
8912
|
+
const [page, setPage] = useState44(0);
|
|
8807
8913
|
const clientState = parseClientState6(result?.clientStateJson);
|
|
8808
8914
|
const results = clientState?.results ?? [];
|
|
8809
8915
|
const isRevealed = results.length > 0 || result?.alreadyPlayed === true;
|
|
8810
8916
|
if (!config) {
|
|
8811
|
-
return /* @__PURE__ */
|
|
8812
|
-
/* @__PURE__ */
|
|
8813
|
-
/* @__PURE__ */
|
|
8917
|
+
return /* @__PURE__ */ jsxs73("div", { className: "ss-g-screen", "data-game": "daily-quiz", "data-testid": "game-screen-daily-quiz", children: [
|
|
8918
|
+
/* @__PURE__ */ jsx85(GameHeader, { title, onBack, backLabel: ui.back }),
|
|
8919
|
+
/* @__PURE__ */ jsx85("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
8814
8920
|
] });
|
|
8815
8921
|
}
|
|
8816
8922
|
const questions = config.questions;
|
|
@@ -8845,11 +8951,11 @@ function DailyQuizGame({
|
|
|
8845
8951
|
return r.isCorrect ? "correct" : "wrong";
|
|
8846
8952
|
});
|
|
8847
8953
|
const correctCount = results.filter((r) => r.isCorrect).length;
|
|
8848
|
-
return /* @__PURE__ */
|
|
8849
|
-
/* @__PURE__ */
|
|
8850
|
-
/* @__PURE__ */
|
|
8851
|
-
/* @__PURE__ */
|
|
8852
|
-
/* @__PURE__ */
|
|
8954
|
+
return /* @__PURE__ */ jsxs73("div", { className: "ss-g-screen", "data-game": "daily-quiz", "data-testid": "game-screen-daily-quiz", children: [
|
|
8955
|
+
/* @__PURE__ */ jsx85(GameHeader, { title, eyebrow: s.results, onBack, backLabel: ui.back }),
|
|
8956
|
+
/* @__PURE__ */ jsx85(SegmentProgress, { segments: segments2, ariaLabel: s.results }),
|
|
8957
|
+
/* @__PURE__ */ jsxs73("div", { className: "ss-g-body", children: [
|
|
8958
|
+
/* @__PURE__ */ jsx85(
|
|
8853
8959
|
ResultCard,
|
|
8854
8960
|
{
|
|
8855
8961
|
tone: "neutral",
|
|
@@ -8862,15 +8968,15 @@ function DailyQuizGame({
|
|
|
8862
8968
|
questions.map((q) => {
|
|
8863
8969
|
const r = findResult(results, q.index);
|
|
8864
8970
|
const picked = selections.get(q.index);
|
|
8865
|
-
return /* @__PURE__ */
|
|
8866
|
-
/* @__PURE__ */
|
|
8867
|
-
r && /* @__PURE__ */
|
|
8971
|
+
return /* @__PURE__ */ jsxs73("div", { className: "ss-g-dq-rq", children: [
|
|
8972
|
+
/* @__PURE__ */ jsx85("div", { className: "ss-g-dq-rq-stem", children: q.stem }),
|
|
8973
|
+
r && /* @__PURE__ */ jsx85("div", { className: "ss-g-dq-rq-opts", children: q.options.map((opt, optIdx) => {
|
|
8868
8974
|
let cls = "ss-g-dq-rq-opt";
|
|
8869
8975
|
if (optIdx === r.correctOptionIndex) cls += " ss-g-dq-rq-opt--correct";
|
|
8870
8976
|
else if (optIdx === picked && !r.isCorrect) cls += " ss-g-dq-rq-opt--wrong";
|
|
8871
|
-
return /* @__PURE__ */
|
|
8977
|
+
return /* @__PURE__ */ jsx85("span", { className: cls, children: opt }, optIdx);
|
|
8872
8978
|
}) }),
|
|
8873
|
-
r?.revealText && /* @__PURE__ */
|
|
8979
|
+
r?.revealText && /* @__PURE__ */ jsx85("div", { className: "ss-g-dq-why", children: r.revealText })
|
|
8874
8980
|
] }, q.index);
|
|
8875
8981
|
})
|
|
8876
8982
|
] })
|
|
@@ -8878,16 +8984,16 @@ function DailyQuizGame({
|
|
|
8878
8984
|
}
|
|
8879
8985
|
const segments = questions.map((_, i) => i < page ? "done" : i === page ? "current" : "todo");
|
|
8880
8986
|
const selectedIdx = current ? selections.get(current.index) : void 0;
|
|
8881
|
-
return /* @__PURE__ */
|
|
8882
|
-
/* @__PURE__ */
|
|
8883
|
-
/* @__PURE__ */
|
|
8884
|
-
/* @__PURE__ */
|
|
8885
|
-
/* @__PURE__ */
|
|
8886
|
-
/* @__PURE__ */
|
|
8987
|
+
return /* @__PURE__ */ jsxs73("div", { className: "ss-g-screen", "data-game": "daily-quiz", "data-testid": "game-screen-daily-quiz", children: [
|
|
8988
|
+
/* @__PURE__ */ jsx85(GameHeader, { title, eyebrow: s.questionOf(page + 1, total), onBack, backLabel: ui.back }),
|
|
8989
|
+
/* @__PURE__ */ jsx85(SegmentProgress, { segments, ariaLabel: s.progressAria(page + 1, total) }),
|
|
8990
|
+
/* @__PURE__ */ jsx85("div", { className: "ss-g-body", children: current && /* @__PURE__ */ jsxs73(Fragment20, { children: [
|
|
8991
|
+
/* @__PURE__ */ jsx85("h3", { className: "ss-g-dq-stem", children: current.stem }),
|
|
8992
|
+
/* @__PURE__ */ jsx85("div", { className: "ss-g-dq-opts", children: current.options.map((opt, optIdx) => {
|
|
8887
8993
|
const selected = optIdx === selectedIdx;
|
|
8888
8994
|
const imagePath = current.optionImagePaths?.[optIdx] ?? void 0;
|
|
8889
8995
|
const playerName = opt;
|
|
8890
|
-
return /* @__PURE__ */
|
|
8996
|
+
return /* @__PURE__ */ jsxs73(
|
|
8891
8997
|
"button",
|
|
8892
8998
|
{
|
|
8893
8999
|
type: "button",
|
|
@@ -8896,25 +9002,25 @@ function DailyQuizGame({
|
|
|
8896
9002
|
disabled: submitting,
|
|
8897
9003
|
onClick: () => handleSelect(current.index, optIdx),
|
|
8898
9004
|
children: [
|
|
8899
|
-
current.optionImagePaths && /* @__PURE__ */
|
|
8900
|
-
/* @__PURE__ */
|
|
8901
|
-
/* @__PURE__ */
|
|
9005
|
+
current.optionImagePaths && /* @__PURE__ */ jsx85(PlayerAvatar, { name: playerName, imagePath, className: "ss-g-dq-opt-av" }),
|
|
9006
|
+
/* @__PURE__ */ jsx85("span", { className: "ss-g-dq-badge", "aria-hidden": "true", children: selected ? /* @__PURE__ */ jsx85(IconCheck, {}) : String.fromCharCode(65 + optIdx) }),
|
|
9007
|
+
/* @__PURE__ */ jsx85(OptionName, { text: opt })
|
|
8902
9008
|
]
|
|
8903
9009
|
},
|
|
8904
9010
|
optIdx
|
|
8905
9011
|
);
|
|
8906
9012
|
}) })
|
|
8907
9013
|
] }) }),
|
|
8908
|
-
/* @__PURE__ */
|
|
8909
|
-
page > 0 && /* @__PURE__ */
|
|
8910
|
-
isLast ? /* @__PURE__ */
|
|
9014
|
+
/* @__PURE__ */ jsx85(FooterBar, { children: /* @__PURE__ */ jsxs73("div", { className: "ss-g-dq-nav", children: [
|
|
9015
|
+
page > 0 && /* @__PURE__ */ jsx85(GameButton, { variant: "outline", onClick: goPrev, disabled: submitting, children: s.previous }),
|
|
9016
|
+
isLast ? /* @__PURE__ */ jsx85(GameButton, { variant: "primary", block: true, onClick: handleSubmit, disabled: !currentAnswered || !allAnswered || submitting, children: submitting ? s.submitting : s.submit }) : /* @__PURE__ */ jsx85(GameButton, { variant: "primary", block: true, onClick: goNext, disabled: !currentAnswered || submitting, children: s.next })
|
|
8911
9017
|
] }) })
|
|
8912
9018
|
] });
|
|
8913
9019
|
}
|
|
8914
9020
|
|
|
8915
9021
|
// src/components/games/MatchdayPredictorGame.tsx
|
|
8916
|
-
import { useId as useId7, useState as
|
|
8917
|
-
import { jsx as
|
|
9022
|
+
import { useId as useId7, useState as useState45 } from "react";
|
|
9023
|
+
import { jsx as jsx86, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
8918
9024
|
var SCORER_SEARCH_THRESHOLD = 9;
|
|
8919
9025
|
function parseClientState7(json) {
|
|
8920
9026
|
if (!json) return null;
|
|
@@ -8932,7 +9038,7 @@ function isLocked(kickoffUtc) {
|
|
|
8932
9038
|
}
|
|
8933
9039
|
}
|
|
8934
9040
|
function IconMinus() {
|
|
8935
|
-
return /* @__PURE__ */
|
|
9041
|
+
return /* @__PURE__ */ jsx86(
|
|
8936
9042
|
"svg",
|
|
8937
9043
|
{
|
|
8938
9044
|
width: 18,
|
|
@@ -8943,20 +9049,20 @@ function IconMinus() {
|
|
|
8943
9049
|
strokeWidth: 2.2,
|
|
8944
9050
|
strokeLinecap: "round",
|
|
8945
9051
|
"aria-hidden": "true",
|
|
8946
|
-
children: /* @__PURE__ */
|
|
9052
|
+
children: /* @__PURE__ */ jsx86("path", { d: "M5 12h14" })
|
|
8947
9053
|
}
|
|
8948
9054
|
);
|
|
8949
9055
|
}
|
|
8950
9056
|
function TeamBadge({ team, label }) {
|
|
8951
|
-
return /* @__PURE__ */
|
|
8952
|
-
/* @__PURE__ */
|
|
8953
|
-
/* @__PURE__ */
|
|
8954
|
-
/* @__PURE__ */
|
|
9057
|
+
return /* @__PURE__ */ jsxs74("div", { className: "ss-g-mp-team", children: [
|
|
9058
|
+
/* @__PURE__ */ jsx86(CrestShield, { name: team.name, size: 44 }),
|
|
9059
|
+
/* @__PURE__ */ jsx86("span", { className: "ss-g-mp-team-name", children: team.name }),
|
|
9060
|
+
/* @__PURE__ */ jsx86("span", { className: "ss-g-mp-team-side", children: label })
|
|
8955
9061
|
] });
|
|
8956
9062
|
}
|
|
8957
9063
|
function ScoreCard({ home, away, h, a, t, edit }) {
|
|
8958
|
-
const col = (side, team, value) => /* @__PURE__ */
|
|
8959
|
-
edit && /* @__PURE__ */
|
|
9064
|
+
const col = (side, team, value) => /* @__PURE__ */ jsxs74("div", { className: "ss-g-mp-col", children: [
|
|
9065
|
+
edit && /* @__PURE__ */ jsx86(
|
|
8960
9066
|
"button",
|
|
8961
9067
|
{
|
|
8962
9068
|
type: "button",
|
|
@@ -8964,11 +9070,11 @@ function ScoreCard({ home, away, h, a, t, edit }) {
|
|
|
8964
9070
|
"aria-label": t.goalsUp(team.name),
|
|
8965
9071
|
disabled: edit.disabled,
|
|
8966
9072
|
onClick: () => edit.onStep(side, 1),
|
|
8967
|
-
children: /* @__PURE__ */
|
|
9073
|
+
children: /* @__PURE__ */ jsx86(IconPlus, { size: 18 })
|
|
8968
9074
|
}
|
|
8969
9075
|
),
|
|
8970
|
-
/* @__PURE__ */
|
|
8971
|
-
edit && /* @__PURE__ */
|
|
9076
|
+
/* @__PURE__ */ jsx86("span", { className: "ss-g-mp-digit", "data-testid": "mp-digit", "data-active": edit ? String(edit.active === side) : "false", children: value }),
|
|
9077
|
+
edit && /* @__PURE__ */ jsx86(
|
|
8972
9078
|
"button",
|
|
8973
9079
|
{
|
|
8974
9080
|
type: "button",
|
|
@@ -8976,27 +9082,27 @@ function ScoreCard({ home, away, h, a, t, edit }) {
|
|
|
8976
9082
|
"aria-label": t.goalsDown(team.name),
|
|
8977
9083
|
disabled: edit.disabled || value <= 0,
|
|
8978
9084
|
onClick: () => edit.onStep(side, -1),
|
|
8979
|
-
children: /* @__PURE__ */
|
|
9085
|
+
children: /* @__PURE__ */ jsx86(IconMinus, {})
|
|
8980
9086
|
}
|
|
8981
9087
|
)
|
|
8982
9088
|
] });
|
|
8983
|
-
return /* @__PURE__ */
|
|
8984
|
-
/* @__PURE__ */
|
|
8985
|
-
/* @__PURE__ */
|
|
9089
|
+
return /* @__PURE__ */ jsxs74("div", { className: "ss-g-mp-card", children: [
|
|
9090
|
+
/* @__PURE__ */ jsx86(TeamBadge, { team: home, label: t.home }),
|
|
9091
|
+
/* @__PURE__ */ jsxs74("div", { className: "ss-g-mp-scores", children: [
|
|
8986
9092
|
col("home", home, h),
|
|
8987
|
-
/* @__PURE__ */
|
|
9093
|
+
/* @__PURE__ */ jsx86("span", { className: "ss-g-mp-dash", "aria-hidden": "true", children: "\u2013" }),
|
|
8988
9094
|
col("away", away, a)
|
|
8989
9095
|
] }),
|
|
8990
|
-
/* @__PURE__ */
|
|
9096
|
+
/* @__PURE__ */ jsx86(TeamBadge, { team: away, label: t.away })
|
|
8991
9097
|
] });
|
|
8992
9098
|
}
|
|
8993
9099
|
function OutcomeRow({ label, ok, detail, t }) {
|
|
8994
|
-
return /* @__PURE__ */
|
|
8995
|
-
/* @__PURE__ */
|
|
8996
|
-
/* @__PURE__ */
|
|
8997
|
-
ok ? /* @__PURE__ */
|
|
8998
|
-
/* @__PURE__ */
|
|
8999
|
-
detail ? /* @__PURE__ */
|
|
9100
|
+
return /* @__PURE__ */ jsxs74("li", { className: "ss-g-mp-row", "data-testid": "mp-row", "data-ok": String(ok), children: [
|
|
9101
|
+
/* @__PURE__ */ jsx86("span", { className: "ss-g-mp-row-k", children: label }),
|
|
9102
|
+
/* @__PURE__ */ jsxs74("span", { className: "ss-g-mp-row-v", children: [
|
|
9103
|
+
ok ? /* @__PURE__ */ jsx86(IconCheck, {}) : /* @__PURE__ */ jsx86(IconClose, { size: 14 }),
|
|
9104
|
+
/* @__PURE__ */ jsx86("span", { className: "ss-g-sr", children: ok ? t.correct : t.incorrect }),
|
|
9105
|
+
detail ? /* @__PURE__ */ jsx86("span", { className: "ss-g-mp-row-d", children: detail }) : null
|
|
9000
9106
|
] })
|
|
9001
9107
|
] });
|
|
9002
9108
|
}
|
|
@@ -9009,20 +9115,20 @@ function MatchdayPredictorGame({
|
|
|
9009
9115
|
onBack
|
|
9010
9116
|
}) {
|
|
9011
9117
|
const t = ui.games.predictor;
|
|
9012
|
-
const [homeScore, setHomeScore] =
|
|
9013
|
-
const [awayScore, setAwayScore] =
|
|
9014
|
-
const [firstScorerPlayerId, setFirstScorerPlayerId] =
|
|
9015
|
-
const [lastEdited, setLastEdited] =
|
|
9016
|
-
const [query, setQuery] =
|
|
9118
|
+
const [homeScore, setHomeScore] = useState45(0);
|
|
9119
|
+
const [awayScore, setAwayScore] = useState45(0);
|
|
9120
|
+
const [firstScorerPlayerId, setFirstScorerPlayerId] = useState45(null);
|
|
9121
|
+
const [lastEdited, setLastEdited] = useState45("home");
|
|
9122
|
+
const [query, setQuery] = useState45("");
|
|
9017
9123
|
const searchId = useId7();
|
|
9018
9124
|
const clientState = parseClientState7(result?.clientStateJson);
|
|
9019
9125
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
9020
|
-
const header = /* @__PURE__ */
|
|
9126
|
+
const header = /* @__PURE__ */ jsx86(
|
|
9021
9127
|
GameHeader,
|
|
9022
9128
|
{
|
|
9023
9129
|
title: gameTitle({ gameId: "matchday-predictor" }, ui.games.titles),
|
|
9024
9130
|
eyebrow: config ? t.eyebrow(config.homeTeam.name, config.awayTeam.name) : void 0,
|
|
9025
|
-
right: config ? /* @__PURE__ */
|
|
9131
|
+
right: config ? /* @__PURE__ */ jsx86(Chip, { icon: /* @__PURE__ */ jsx86(IconLock, {}), children: ui.games.formatDayTime(config.kickoffUtc) }) : void 0,
|
|
9026
9132
|
onBack,
|
|
9027
9133
|
backLabel: ui.back
|
|
9028
9134
|
}
|
|
@@ -9030,10 +9136,10 @@ function MatchdayPredictorGame({
|
|
|
9030
9136
|
if (alreadyPlayed && clientState) {
|
|
9031
9137
|
if (!clientState.graded) {
|
|
9032
9138
|
const scorer = config?.scorerPool.find((p) => p.playerId === clientState.predictedFirstScorerPlayerId) ?? null;
|
|
9033
|
-
return /* @__PURE__ */
|
|
9139
|
+
return /* @__PURE__ */ jsxs74("div", { className: "ss-g-screen", "data-game": "matchday-predictor", "data-testid": "game-screen-matchday-predictor", children: [
|
|
9034
9140
|
header,
|
|
9035
|
-
/* @__PURE__ */
|
|
9036
|
-
config && /* @__PURE__ */
|
|
9141
|
+
/* @__PURE__ */ jsxs74("div", { className: "ss-g-body", children: [
|
|
9142
|
+
config && /* @__PURE__ */ jsx86(
|
|
9037
9143
|
ScoreCard,
|
|
9038
9144
|
{
|
|
9039
9145
|
home: config.homeTeam,
|
|
@@ -9043,7 +9149,7 @@ function MatchdayPredictorGame({
|
|
|
9043
9149
|
t
|
|
9044
9150
|
}
|
|
9045
9151
|
),
|
|
9046
|
-
/* @__PURE__ */
|
|
9152
|
+
/* @__PURE__ */ jsx86(
|
|
9047
9153
|
ResultCard,
|
|
9048
9154
|
{
|
|
9049
9155
|
tone: "neutral",
|
|
@@ -9060,28 +9166,28 @@ function MatchdayPredictorGame({
|
|
|
9060
9166
|
}
|
|
9061
9167
|
)
|
|
9062
9168
|
] }),
|
|
9063
|
-
/* @__PURE__ */
|
|
9169
|
+
/* @__PURE__ */ jsx86(FooterBar, { children: /* @__PURE__ */ jsx86("p", { className: "ss-g-mp-fun", children: t.forFun }) })
|
|
9064
9170
|
] });
|
|
9065
9171
|
}
|
|
9066
9172
|
const r = clientState.result;
|
|
9067
|
-
return /* @__PURE__ */
|
|
9173
|
+
return /* @__PURE__ */ jsxs74("div", { className: "ss-g-screen", "data-game": "matchday-predictor", "data-testid": "game-screen-matchday-predictor", children: [
|
|
9068
9174
|
header,
|
|
9069
|
-
/* @__PURE__ */
|
|
9070
|
-
config && /* @__PURE__ */
|
|
9071
|
-
/* @__PURE__ */
|
|
9072
|
-
/* @__PURE__ */
|
|
9073
|
-
/* @__PURE__ */
|
|
9074
|
-
/* @__PURE__ */
|
|
9075
|
-
!clientState.firstScorerVoid && /* @__PURE__ */
|
|
9175
|
+
/* @__PURE__ */ jsxs74("div", { className: "ss-g-body", children: [
|
|
9176
|
+
config && /* @__PURE__ */ jsx86(ScoreCard, { home: config.homeTeam, away: config.awayTeam, h: r.homeScore, a: r.awayScore, t }),
|
|
9177
|
+
/* @__PURE__ */ jsx86(ResultCard, { tone: "neutral", title: t.fullTime(r.homeScore, r.awayScore), onBack, ui }),
|
|
9178
|
+
/* @__PURE__ */ jsxs74("ul", { className: "ss-g-mp-rows", children: [
|
|
9179
|
+
/* @__PURE__ */ jsx86(OutcomeRow, { label: t.exactScore, ok: clientState.exactScoreCorrect, t }),
|
|
9180
|
+
/* @__PURE__ */ jsx86(OutcomeRow, { label: t.outcome, ok: clientState.outcomeCorrect, t }),
|
|
9181
|
+
!clientState.firstScorerVoid && /* @__PURE__ */ jsx86(OutcomeRow, { label: t.firstScorerRow, ok: clientState.firstScorerCorrect, detail: r.firstScorerName, t })
|
|
9076
9182
|
] })
|
|
9077
9183
|
] }),
|
|
9078
|
-
/* @__PURE__ */
|
|
9184
|
+
/* @__PURE__ */ jsx86(FooterBar, { children: /* @__PURE__ */ jsx86("p", { className: "ss-g-mp-fun", children: t.forFun }) })
|
|
9079
9185
|
] });
|
|
9080
9186
|
}
|
|
9081
9187
|
if (!config) {
|
|
9082
|
-
return /* @__PURE__ */
|
|
9188
|
+
return /* @__PURE__ */ jsxs74("div", { className: "ss-g-screen", "data-game": "matchday-predictor", "data-testid": "game-screen-matchday-predictor", children: [
|
|
9083
9189
|
header,
|
|
9084
|
-
/* @__PURE__ */
|
|
9190
|
+
/* @__PURE__ */ jsx86("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
9085
9191
|
] });
|
|
9086
9192
|
}
|
|
9087
9193
|
const locked = isLocked(config.kickoffUtc);
|
|
@@ -9105,10 +9211,10 @@ function MatchdayPredictorGame({
|
|
|
9105
9211
|
const showSearch = pool.length > SCORER_SEARCH_THRESHOLD;
|
|
9106
9212
|
const q = query.trim().toLowerCase();
|
|
9107
9213
|
const visible = showSearch && q ? pool.filter((p) => p.playerName.toLowerCase().includes(q)) : pool;
|
|
9108
|
-
return /* @__PURE__ */
|
|
9214
|
+
return /* @__PURE__ */ jsxs74("div", { className: "ss-g-screen", "data-game": "matchday-predictor", "data-testid": "game-screen-matchday-predictor", children: [
|
|
9109
9215
|
header,
|
|
9110
|
-
/* @__PURE__ */
|
|
9111
|
-
/* @__PURE__ */
|
|
9216
|
+
/* @__PURE__ */ jsxs74("div", { className: "ss-g-body", children: [
|
|
9217
|
+
/* @__PURE__ */ jsx86(
|
|
9112
9218
|
ScoreCard,
|
|
9113
9219
|
{
|
|
9114
9220
|
home: config.homeTeam,
|
|
@@ -9119,12 +9225,12 @@ function MatchdayPredictorGame({
|
|
|
9119
9225
|
edit: { disabled, active: lastEdited, onStep: step }
|
|
9120
9226
|
}
|
|
9121
9227
|
),
|
|
9122
|
-
pool.length > 0 && /* @__PURE__ */
|
|
9123
|
-
/* @__PURE__ */
|
|
9124
|
-
/* @__PURE__ */
|
|
9125
|
-
/* @__PURE__ */
|
|
9228
|
+
pool.length > 0 && /* @__PURE__ */ jsxs74("section", { className: "ss-g-mp-scorer", children: [
|
|
9229
|
+
/* @__PURE__ */ jsxs74("div", { className: "ss-g-mp-sec-head", children: [
|
|
9230
|
+
/* @__PURE__ */ jsx86("h3", { children: t.firstScorer }),
|
|
9231
|
+
/* @__PURE__ */ jsx86("span", { children: t.optional })
|
|
9126
9232
|
] }),
|
|
9127
|
-
showSearch && /* @__PURE__ */
|
|
9233
|
+
showSearch && /* @__PURE__ */ jsx86(
|
|
9128
9234
|
SearchField,
|
|
9129
9235
|
{
|
|
9130
9236
|
id: searchId,
|
|
@@ -9136,9 +9242,9 @@ function MatchdayPredictorGame({
|
|
|
9136
9242
|
disabled
|
|
9137
9243
|
}
|
|
9138
9244
|
),
|
|
9139
|
-
/* @__PURE__ */
|
|
9245
|
+
/* @__PURE__ */ jsx86("div", { className: "ss-g-mp-grid", children: visible.map((p) => {
|
|
9140
9246
|
const selected = firstScorerPlayerId === p.playerId;
|
|
9141
|
-
return /* @__PURE__ */
|
|
9247
|
+
return /* @__PURE__ */ jsxs74(
|
|
9142
9248
|
"button",
|
|
9143
9249
|
{
|
|
9144
9250
|
type: "button",
|
|
@@ -9148,15 +9254,15 @@ function MatchdayPredictorGame({
|
|
|
9148
9254
|
disabled,
|
|
9149
9255
|
onClick: () => setFirstScorerPlayerId((id) => id === p.playerId ? null : p.playerId),
|
|
9150
9256
|
children: [
|
|
9151
|
-
selected && /* @__PURE__ */
|
|
9152
|
-
/* @__PURE__ */
|
|
9153
|
-
/* @__PURE__ */
|
|
9257
|
+
selected && /* @__PURE__ */ jsx86("span", { className: "ss-g-mp-pcheck", children: /* @__PURE__ */ jsx86(IconCheck, { size: 12 }) }),
|
|
9258
|
+
/* @__PURE__ */ jsx86(Silhouette, { size: 52, variant: selected ? "selected" : "default" }),
|
|
9259
|
+
/* @__PURE__ */ jsx86("span", { className: "ss-g-mp-pname", children: splitName(p.playerName).last })
|
|
9154
9260
|
]
|
|
9155
9261
|
},
|
|
9156
9262
|
p.playerId
|
|
9157
9263
|
);
|
|
9158
9264
|
}) }),
|
|
9159
|
-
/* @__PURE__ */
|
|
9265
|
+
/* @__PURE__ */ jsxs74(
|
|
9160
9266
|
"button",
|
|
9161
9267
|
{
|
|
9162
9268
|
type: "button",
|
|
@@ -9165,24 +9271,24 @@ function MatchdayPredictorGame({
|
|
|
9165
9271
|
disabled,
|
|
9166
9272
|
onClick: () => setFirstScorerPlayerId(null),
|
|
9167
9273
|
children: [
|
|
9168
|
-
/* @__PURE__ */
|
|
9274
|
+
/* @__PURE__ */ jsx86("span", { className: "ss-g-mp-radio", "aria-hidden": "true" }),
|
|
9169
9275
|
t.noScorer
|
|
9170
9276
|
]
|
|
9171
9277
|
}
|
|
9172
9278
|
)
|
|
9173
9279
|
] }),
|
|
9174
|
-
locked && /* @__PURE__ */
|
|
9280
|
+
locked && /* @__PURE__ */ jsx86("p", { className: "ss-g-mp-closed", children: t.closed })
|
|
9175
9281
|
] }),
|
|
9176
|
-
/* @__PURE__ */
|
|
9177
|
-
/* @__PURE__ */
|
|
9178
|
-
/* @__PURE__ */
|
|
9282
|
+
/* @__PURE__ */ jsxs74(FooterBar, { children: [
|
|
9283
|
+
/* @__PURE__ */ jsx86(GameButton, { variant: "primary", block: true, disabled, onClick: handleSubmit, children: submitting ? t.saving : t.save }),
|
|
9284
|
+
/* @__PURE__ */ jsx86("p", { className: "ss-g-mp-fun", children: t.forFun })
|
|
9179
9285
|
] })
|
|
9180
9286
|
] });
|
|
9181
9287
|
}
|
|
9182
9288
|
|
|
9183
9289
|
// src/components/games/StartingXiGame.tsx
|
|
9184
|
-
import { useId as useId8, useState as
|
|
9185
|
-
import { Fragment as
|
|
9290
|
+
import { useId as useId8, useState as useState46 } from "react";
|
|
9291
|
+
import { Fragment as Fragment21, jsx as jsx87, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
9186
9292
|
var POINTS_PER_STARTER = 8;
|
|
9187
9293
|
var XI_SIZE = 11;
|
|
9188
9294
|
var DEFAULT_FORMATION = "4-3-3";
|
|
@@ -9225,26 +9331,26 @@ function StartingXiGame({
|
|
|
9225
9331
|
lockAtUtc
|
|
9226
9332
|
}) {
|
|
9227
9333
|
const t = ui.games.startingXi;
|
|
9228
|
-
const [slotPlayers, setSlotPlayers] =
|
|
9229
|
-
const [active, setActive] =
|
|
9230
|
-
const [query, setQuery] =
|
|
9334
|
+
const [slotPlayers, setSlotPlayers] = useState46(() => Array(XI_SIZE).fill(null));
|
|
9335
|
+
const [active, setActive] = useState46(0);
|
|
9336
|
+
const [query, setQuery] = useState46("");
|
|
9231
9337
|
const searchId = useId8();
|
|
9232
9338
|
const clientState = parseClientState8(result?.clientStateJson);
|
|
9233
9339
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
9234
|
-
const header = /* @__PURE__ */
|
|
9340
|
+
const header = /* @__PURE__ */ jsx87(
|
|
9235
9341
|
GameHeader,
|
|
9236
9342
|
{
|
|
9237
9343
|
title: gameTitle({ gameId: "starting-xi" }, ui.games.titles),
|
|
9238
9344
|
eyebrow: t.eyebrow,
|
|
9239
|
-
right: /* @__PURE__ */
|
|
9345
|
+
right: /* @__PURE__ */ jsx87(Chip, { variant: "accent", children: t.perStarter(POINTS_PER_STARTER) }),
|
|
9240
9346
|
onBack,
|
|
9241
9347
|
backLabel: ui.back
|
|
9242
9348
|
}
|
|
9243
9349
|
);
|
|
9244
9350
|
function statusScreen(title, score) {
|
|
9245
|
-
return /* @__PURE__ */
|
|
9351
|
+
return /* @__PURE__ */ jsxs75("div", { className: "ss-g-screen", "data-game": "starting-xi", "data-testid": "game-screen-starting-xi", children: [
|
|
9246
9352
|
header,
|
|
9247
|
-
/* @__PURE__ */
|
|
9353
|
+
/* @__PURE__ */ jsx87("div", { className: "ss-g-body", children: /* @__PURE__ */ jsx87(ResultCard, { tone: "neutral", title, score, onBack, ui }) })
|
|
9248
9354
|
] });
|
|
9249
9355
|
}
|
|
9250
9356
|
if (alreadyPlayed) {
|
|
@@ -9253,9 +9359,9 @@ function StartingXiGame({
|
|
|
9253
9359
|
if (clientState.status === "graded") return statusScreen(t.gradedLine(clientState.correctCount), clientState.score);
|
|
9254
9360
|
}
|
|
9255
9361
|
if (!config) {
|
|
9256
|
-
return /* @__PURE__ */
|
|
9362
|
+
return /* @__PURE__ */ jsxs75("div", { className: "ss-g-screen", "data-game": "starting-xi", "data-testid": "game-screen-starting-xi", children: [
|
|
9257
9363
|
header,
|
|
9258
|
-
/* @__PURE__ */
|
|
9364
|
+
/* @__PURE__ */ jsx87("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
9259
9365
|
] });
|
|
9260
9366
|
}
|
|
9261
9367
|
const { formation, slots } = formationSlots(config.formation);
|
|
@@ -9290,27 +9396,27 @@ function StartingXiGame({
|
|
|
9290
9396
|
onSubmit(JSON.stringify({ predictedPlayerIds: slotPlayers }));
|
|
9291
9397
|
}
|
|
9292
9398
|
const segments = slotPlayers.map((p) => p !== null ? "current" : "todo");
|
|
9293
|
-
return /* @__PURE__ */
|
|
9399
|
+
return /* @__PURE__ */ jsxs75("div", { className: "ss-g-screen", "data-game": "starting-xi", "data-testid": "game-screen-starting-xi", children: [
|
|
9294
9400
|
header,
|
|
9295
|
-
/* @__PURE__ */
|
|
9401
|
+
/* @__PURE__ */ jsx87(
|
|
9296
9402
|
SegmentProgress,
|
|
9297
9403
|
{
|
|
9298
9404
|
segments,
|
|
9299
9405
|
ariaLabel: t.picked(pickedCount),
|
|
9300
9406
|
leftLabel: t.picked(pickedCount),
|
|
9301
9407
|
rightLabel: t.toGo(XI_SIZE - pickedCount),
|
|
9302
|
-
right: /* @__PURE__ */
|
|
9408
|
+
right: /* @__PURE__ */ jsx87(Chip, { children: formation })
|
|
9303
9409
|
}
|
|
9304
9410
|
),
|
|
9305
|
-
/* @__PURE__ */
|
|
9306
|
-
/* @__PURE__ */
|
|
9307
|
-
/* @__PURE__ */
|
|
9411
|
+
/* @__PURE__ */ jsxs75("div", { className: "ss-g-body", children: [
|
|
9412
|
+
/* @__PURE__ */ jsxs75("div", { className: "ss-g-xi-pitch", children: [
|
|
9413
|
+
/* @__PURE__ */ jsx87(PitchSvg, { variant: "half" }),
|
|
9308
9414
|
slots.map((s) => {
|
|
9309
9415
|
const playerId = slotPlayers[s.index] ?? null;
|
|
9310
9416
|
const player = playerId !== null ? byId.get(playerId) ?? null : null;
|
|
9311
9417
|
const name = player?.playerName ?? "";
|
|
9312
9418
|
const state = player ? "filled" : active === s.index ? "active" : "empty";
|
|
9313
|
-
return /* @__PURE__ */
|
|
9419
|
+
return /* @__PURE__ */ jsxs75(
|
|
9314
9420
|
"button",
|
|
9315
9421
|
{
|
|
9316
9422
|
type: "button",
|
|
@@ -9322,21 +9428,21 @@ function StartingXiGame({
|
|
|
9322
9428
|
disabled: submitting,
|
|
9323
9429
|
onClick: () => tapSlot(s.index),
|
|
9324
9430
|
children: [
|
|
9325
|
-
/* @__PURE__ */
|
|
9326
|
-
/* @__PURE__ */
|
|
9431
|
+
/* @__PURE__ */ jsx87("span", { className: "ss-g-xi-ring", "aria-hidden": "true", children: player ? player.jerseyNumber ?? "" : /* @__PURE__ */ jsx87(IconPlus, { size: 18 }) }),
|
|
9432
|
+
/* @__PURE__ */ jsx87("span", { className: "ss-g-xi-tag", "aria-hidden": "true", children: player ? splitName(name).last : s.label })
|
|
9327
9433
|
]
|
|
9328
9434
|
},
|
|
9329
9435
|
s.index
|
|
9330
9436
|
);
|
|
9331
9437
|
})
|
|
9332
9438
|
] }),
|
|
9333
|
-
/* @__PURE__ */
|
|
9334
|
-
/* @__PURE__ */
|
|
9335
|
-
/* @__PURE__ */
|
|
9336
|
-
/* @__PURE__ */
|
|
9337
|
-
] }) : /* @__PURE__ */
|
|
9338
|
-
activeSlot && /* @__PURE__ */
|
|
9339
|
-
/* @__PURE__ */
|
|
9439
|
+
/* @__PURE__ */ jsxs75("div", { className: "ss-g-xi-picker", children: [
|
|
9440
|
+
/* @__PURE__ */ jsx87("div", { className: "ss-g-xi-picker-head", children: activeSlot ? /* @__PURE__ */ jsxs75(Fragment21, { children: [
|
|
9441
|
+
/* @__PURE__ */ jsx87(Chip, { variant: "badge", children: activeSlot.label }),
|
|
9442
|
+
/* @__PURE__ */ jsx87("strong", { children: t.pickFor(activeSlot.label) })
|
|
9443
|
+
] }) : /* @__PURE__ */ jsx87("strong", { children: t.allPicked }) }),
|
|
9444
|
+
activeSlot && /* @__PURE__ */ jsxs75(Fragment21, { children: [
|
|
9445
|
+
/* @__PURE__ */ jsx87(
|
|
9340
9446
|
SearchField,
|
|
9341
9447
|
{
|
|
9342
9448
|
id: searchId,
|
|
@@ -9348,18 +9454,18 @@ function StartingXiGame({
|
|
|
9348
9454
|
disabled: submitting
|
|
9349
9455
|
}
|
|
9350
9456
|
),
|
|
9351
|
-
/* @__PURE__ */
|
|
9352
|
-
/* @__PURE__ */
|
|
9353
|
-
/* @__PURE__ */
|
|
9354
|
-
/* @__PURE__ */
|
|
9457
|
+
/* @__PURE__ */ jsx87("ul", { className: "ss-g-xi-list", children: available.map((p) => /* @__PURE__ */ jsx87("li", { children: /* @__PURE__ */ jsxs75("button", { type: "button", className: "ss-g-xi-opt", disabled: submitting, onClick: () => pick(p.playerId), children: [
|
|
9458
|
+
/* @__PURE__ */ jsx87("span", { className: "ss-g-xi-opt-no", "aria-hidden": "true", children: p.jerseyNumber ?? "" }),
|
|
9459
|
+
/* @__PURE__ */ jsx87("span", { className: "ss-g-xi-opt-name", children: p.playerName }),
|
|
9460
|
+
/* @__PURE__ */ jsx87("span", { className: "ss-g-xi-opt-pos", children: p.positionName })
|
|
9355
9461
|
] }) }, p.playerId)) })
|
|
9356
9462
|
] })
|
|
9357
9463
|
] })
|
|
9358
9464
|
] }),
|
|
9359
|
-
/* @__PURE__ */
|
|
9360
|
-
/* @__PURE__ */
|
|
9361
|
-
/* @__PURE__ */
|
|
9362
|
-
/* @__PURE__ */
|
|
9465
|
+
/* @__PURE__ */ jsxs75(FooterBar, { children: [
|
|
9466
|
+
/* @__PURE__ */ jsx87(GameButton, { variant: "primary", block: true, disabled: !canSubmit, onClick: handleSubmit, children: submitting ? t.submitting : t.submit }),
|
|
9467
|
+
/* @__PURE__ */ jsxs75("p", { className: "ss-g-xi-lock", children: [
|
|
9468
|
+
/* @__PURE__ */ jsx87(IconLock, {}),
|
|
9363
9469
|
lockAtUtc ? t.locksAt(ui.games.formatDayTime(lockAtUtc)) : t.locksSoon
|
|
9364
9470
|
] })
|
|
9365
9471
|
] })
|
|
@@ -9367,8 +9473,8 @@ function StartingXiGame({
|
|
|
9367
9473
|
}
|
|
9368
9474
|
|
|
9369
9475
|
// src/components/games/StatLadderGame.tsx
|
|
9370
|
-
import { useId as useId9, useState as
|
|
9371
|
-
import { jsx as
|
|
9476
|
+
import { useId as useId9, useState as useState47 } from "react";
|
|
9477
|
+
import { jsx as jsx88, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
9372
9478
|
function ladderClue(ladder) {
|
|
9373
9479
|
const mystery = ladder.find((r) => r.rank === 2);
|
|
9374
9480
|
if (!mystery) return null;
|
|
@@ -9390,9 +9496,9 @@ function parseClientState9(json) {
|
|
|
9390
9496
|
}
|
|
9391
9497
|
function NameStack({ name }) {
|
|
9392
9498
|
const { first, last } = splitName(name);
|
|
9393
|
-
return /* @__PURE__ */
|
|
9394
|
-
first && /* @__PURE__ */
|
|
9395
|
-
/* @__PURE__ */
|
|
9499
|
+
return /* @__PURE__ */ jsxs76("span", { className: "ss-g-sl-name", children: [
|
|
9500
|
+
first && /* @__PURE__ */ jsx88("small", { children: `${first[0]}.` }),
|
|
9501
|
+
/* @__PURE__ */ jsx88("b", { children: last })
|
|
9396
9502
|
] });
|
|
9397
9503
|
}
|
|
9398
9504
|
function StatLadderGame({
|
|
@@ -9404,16 +9510,16 @@ function StatLadderGame({
|
|
|
9404
9510
|
onBack
|
|
9405
9511
|
}) {
|
|
9406
9512
|
const t = ui.games.statLadder;
|
|
9407
|
-
const [query, setQuery] =
|
|
9408
|
-
const [selectedId, setSelectedId] =
|
|
9513
|
+
const [query, setQuery] = useState47("");
|
|
9514
|
+
const [selectedId, setSelectedId] = useState47(null);
|
|
9409
9515
|
const searchId = useId9();
|
|
9410
9516
|
const clientState = parseClientState9(result?.clientStateJson);
|
|
9411
9517
|
const revealed = clientState != null;
|
|
9412
|
-
const header = /* @__PURE__ */
|
|
9518
|
+
const header = /* @__PURE__ */ jsx88(GameHeader, { title: gameTitle({ gameId: "stat-ladder" }, ui.games.titles), eyebrow: t.eyebrow, onBack, backLabel: ui.back });
|
|
9413
9519
|
if (!config) {
|
|
9414
|
-
return /* @__PURE__ */
|
|
9520
|
+
return /* @__PURE__ */ jsxs76("div", { className: "ss-g-screen", "data-game": "stat-ladder", "data-testid": "game-screen-stat-ladder", children: [
|
|
9415
9521
|
header,
|
|
9416
|
-
/* @__PURE__ */
|
|
9522
|
+
/* @__PURE__ */ jsx88("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
9417
9523
|
] });
|
|
9418
9524
|
}
|
|
9419
9525
|
const question = t.question(config.statLabel);
|
|
@@ -9425,45 +9531,45 @@ function StatLadderGame({
|
|
|
9425
9531
|
if (selectedId === null || submitting || revealed) return;
|
|
9426
9532
|
onSubmit(JSON.stringify({ guessedPlayerId: selectedId }));
|
|
9427
9533
|
}
|
|
9428
|
-
return /* @__PURE__ */
|
|
9534
|
+
return /* @__PURE__ */ jsxs76("div", { className: "ss-g-screen", "data-game": "stat-ladder", "data-testid": "game-screen-stat-ladder", children: [
|
|
9429
9535
|
header,
|
|
9430
|
-
/* @__PURE__ */
|
|
9431
|
-
!revealed && /* @__PURE__ */
|
|
9432
|
-
/* @__PURE__ */
|
|
9433
|
-
/* @__PURE__ */
|
|
9434
|
-
/* @__PURE__ */
|
|
9536
|
+
/* @__PURE__ */ jsxs76("div", { className: "ss-g-body", children: [
|
|
9537
|
+
!revealed && /* @__PURE__ */ jsx88(PointsLadderRow, { ladder: config.pointsLadder, guessesUsed: 0, ui }),
|
|
9538
|
+
/* @__PURE__ */ jsxs76("div", { className: "ss-g-sl-prompt", children: [
|
|
9539
|
+
/* @__PURE__ */ jsx88(Chip, { variant: "accent", icon: /* @__PURE__ */ jsx88(IconShield, { size: 14 }), className: "ss-g-sl-stat", children: config.statLabel }),
|
|
9540
|
+
/* @__PURE__ */ jsxs76("h3", { className: "ss-g-sl-q", children: [
|
|
9435
9541
|
question.pre,
|
|
9436
|
-
/* @__PURE__ */
|
|
9542
|
+
/* @__PURE__ */ jsx88("em", { children: question.emph }),
|
|
9437
9543
|
question.post
|
|
9438
9544
|
] })
|
|
9439
9545
|
] }),
|
|
9440
|
-
/* @__PURE__ */
|
|
9441
|
-
(rung) => rung.rank === 2 ? /* @__PURE__ */
|
|
9546
|
+
/* @__PURE__ */ jsx88("ol", { className: "ss-g-sl-rungs", children: rungs.map(
|
|
9547
|
+
(rung) => rung.rank === 2 ? /* @__PURE__ */ jsxs76(
|
|
9442
9548
|
"li",
|
|
9443
9549
|
{
|
|
9444
9550
|
className: "ss-g-sl-rung ss-g-sl-rung--mystery",
|
|
9445
9551
|
"data-testid": "sl-mystery-rung",
|
|
9446
9552
|
"data-result": revealed ? clientState.isCorrect ? "correct" : "wrong" : void 0,
|
|
9447
9553
|
children: [
|
|
9448
|
-
/* @__PURE__ */
|
|
9449
|
-
revealed ? /* @__PURE__ */
|
|
9450
|
-
revealed ? /* @__PURE__ */
|
|
9451
|
-
/* @__PURE__ */
|
|
9554
|
+
/* @__PURE__ */ jsx88("span", { className: "ss-g-sl-rank", children: "2" }),
|
|
9555
|
+
revealed ? /* @__PURE__ */ jsx88(PlayerAvatar, { name: clientState.revealedRank2.playerName, className: "ss-g-sl-av" }) : /* @__PURE__ */ jsx88(Silhouette, { size: 52, variant: "mystery" }),
|
|
9556
|
+
revealed ? /* @__PURE__ */ jsx88(NameStack, { name: clientState.revealedRank2.playerName }) : /* @__PURE__ */ jsx88("span", { className: "ss-g-sl-who", children: t.whoSecond }),
|
|
9557
|
+
/* @__PURE__ */ jsx88("span", { className: "ss-g-sl-val ss-g-sl-val--mystery", children: rung.statValue })
|
|
9452
9558
|
]
|
|
9453
9559
|
},
|
|
9454
9560
|
rung.rank
|
|
9455
|
-
) : /* @__PURE__ */
|
|
9456
|
-
/* @__PURE__ */
|
|
9457
|
-
/* @__PURE__ */
|
|
9458
|
-
/* @__PURE__ */
|
|
9459
|
-
/* @__PURE__ */
|
|
9561
|
+
) : /* @__PURE__ */ jsxs76("li", { className: "ss-g-sl-rung", children: [
|
|
9562
|
+
/* @__PURE__ */ jsx88("span", { className: "ss-g-sl-rank", children: rung.rank }),
|
|
9563
|
+
/* @__PURE__ */ jsx88(PlayerAvatar, { name: rung.playerName ?? "?", className: "ss-g-sl-av" }),
|
|
9564
|
+
/* @__PURE__ */ jsx88(NameStack, { name: rung.playerName ?? "?" }),
|
|
9565
|
+
/* @__PURE__ */ jsx88("span", { className: "ss-g-sl-val", children: rung.statValue })
|
|
9460
9566
|
] }, rung.rank)
|
|
9461
9567
|
) }),
|
|
9462
|
-
clue && /* @__PURE__ */
|
|
9463
|
-
/* @__PURE__ */
|
|
9464
|
-
/* @__PURE__ */
|
|
9568
|
+
clue && /* @__PURE__ */ jsxs76("p", { className: "ss-g-sl-clue", children: [
|
|
9569
|
+
/* @__PURE__ */ jsx88(IconBulb, {}),
|
|
9570
|
+
/* @__PURE__ */ jsx88("span", { children: t.clue(clue, config.statLabel) })
|
|
9465
9571
|
] }),
|
|
9466
|
-
!revealed && /* @__PURE__ */
|
|
9572
|
+
!revealed && /* @__PURE__ */ jsx88("ul", { className: "ss-g-sl-pool", children: pool.map((p) => /* @__PURE__ */ jsx88("li", { children: /* @__PURE__ */ jsxs76(
|
|
9467
9573
|
"button",
|
|
9468
9574
|
{
|
|
9469
9575
|
type: "button",
|
|
@@ -9476,13 +9582,13 @@ function StatLadderGame({
|
|
|
9476
9582
|
setQuery(p.playerName);
|
|
9477
9583
|
},
|
|
9478
9584
|
children: [
|
|
9479
|
-
/* @__PURE__ */
|
|
9480
|
-
/* @__PURE__ */
|
|
9481
|
-
selectedId === p.playerId && /* @__PURE__ */
|
|
9585
|
+
/* @__PURE__ */ jsx88(PlayerAvatar, { name: p.playerName, className: "ss-g-sl-opt-av" }),
|
|
9586
|
+
/* @__PURE__ */ jsx88("span", { className: "ss-g-sl-opt-name", children: p.playerName }),
|
|
9587
|
+
selectedId === p.playerId && /* @__PURE__ */ jsx88(IconCheck, {})
|
|
9482
9588
|
]
|
|
9483
9589
|
}
|
|
9484
9590
|
) }, p.playerId)) }),
|
|
9485
|
-
revealed && /* @__PURE__ */
|
|
9591
|
+
revealed && /* @__PURE__ */ jsx88(
|
|
9486
9592
|
ResultCard,
|
|
9487
9593
|
{
|
|
9488
9594
|
tone: clientState.isCorrect ? "win" : "lose",
|
|
@@ -9493,8 +9599,8 @@ function StatLadderGame({
|
|
|
9493
9599
|
}
|
|
9494
9600
|
)
|
|
9495
9601
|
] }),
|
|
9496
|
-
!revealed && /* @__PURE__ */
|
|
9497
|
-
/* @__PURE__ */
|
|
9602
|
+
!revealed && /* @__PURE__ */ jsx88(FooterBar, { children: /* @__PURE__ */ jsxs76("div", { className: "ss-g-sl-guess", children: [
|
|
9603
|
+
/* @__PURE__ */ jsx88(
|
|
9498
9604
|
SearchField,
|
|
9499
9605
|
{
|
|
9500
9606
|
id: searchId,
|
|
@@ -9509,13 +9615,13 @@ function StatLadderGame({
|
|
|
9509
9615
|
disabled: submitting
|
|
9510
9616
|
}
|
|
9511
9617
|
),
|
|
9512
|
-
/* @__PURE__ */
|
|
9618
|
+
/* @__PURE__ */ jsx88(GameButton, { variant: "primary", disabled: selectedId === null || submitting, onClick: guess, children: t.guess })
|
|
9513
9619
|
] }) })
|
|
9514
9620
|
] });
|
|
9515
9621
|
}
|
|
9516
9622
|
|
|
9517
9623
|
// src/components/games/FanMotmGame.tsx
|
|
9518
|
-
import { jsx as
|
|
9624
|
+
import { jsx as jsx89, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
9519
9625
|
function parseClientState10(json) {
|
|
9520
9626
|
if (!json) return null;
|
|
9521
9627
|
try {
|
|
@@ -9536,20 +9642,20 @@ function FanMotmGame({
|
|
|
9536
9642
|
const clientState = parseClientState10(result?.clientStateJson);
|
|
9537
9643
|
const alreadyVoted = result?.alreadyPlayed === true;
|
|
9538
9644
|
const pickedId = clientState?.pickedPlayerId ?? null;
|
|
9539
|
-
const header = /* @__PURE__ */
|
|
9645
|
+
const header = /* @__PURE__ */ jsx89(
|
|
9540
9646
|
GameHeader,
|
|
9541
9647
|
{
|
|
9542
9648
|
title: t.title,
|
|
9543
9649
|
eyebrow: t.eyebrow,
|
|
9544
|
-
right: alreadyVoted ? /* @__PURE__ */
|
|
9650
|
+
right: alreadyVoted ? /* @__PURE__ */ jsx89(Chip, { variant: "success", icon: /* @__PURE__ */ jsx89(IconCheck, {}), children: t.voted }) : void 0,
|
|
9545
9651
|
onBack,
|
|
9546
9652
|
backLabel: ui.back
|
|
9547
9653
|
}
|
|
9548
9654
|
);
|
|
9549
9655
|
if (!config) {
|
|
9550
|
-
return /* @__PURE__ */
|
|
9656
|
+
return /* @__PURE__ */ jsxs77("div", { className: "ss-g-screen", "data-game": "fan-motm", "data-testid": "game-screen-fan-motm", children: [
|
|
9551
9657
|
header,
|
|
9552
|
-
/* @__PURE__ */
|
|
9658
|
+
/* @__PURE__ */ jsx89("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
9553
9659
|
] });
|
|
9554
9660
|
}
|
|
9555
9661
|
const picked = config.candidates.find((c) => c.playerId === pickedId) ?? null;
|
|
@@ -9557,12 +9663,12 @@ function FanMotmGame({
|
|
|
9557
9663
|
if (alreadyVoted || submitting) return;
|
|
9558
9664
|
onSubmit(JSON.stringify({ pickedPlayerId: candidateId }));
|
|
9559
9665
|
}
|
|
9560
|
-
return /* @__PURE__ */
|
|
9666
|
+
return /* @__PURE__ */ jsxs77("div", { className: "ss-g-screen", "data-game": "fan-motm", "data-testid": "game-screen-fan-motm", children: [
|
|
9561
9667
|
header,
|
|
9562
|
-
/* @__PURE__ */
|
|
9563
|
-
/* @__PURE__ */
|
|
9668
|
+
/* @__PURE__ */ jsxs77("div", { className: "ss-g-body", children: [
|
|
9669
|
+
/* @__PURE__ */ jsx89("ul", { className: "ss-g-motm-list", children: config.candidates.map((c) => {
|
|
9564
9670
|
const isVoted = alreadyVoted && pickedId === c.playerId;
|
|
9565
|
-
return /* @__PURE__ */
|
|
9671
|
+
return /* @__PURE__ */ jsx89("li", { children: /* @__PURE__ */ jsxs77(
|
|
9566
9672
|
"button",
|
|
9567
9673
|
{
|
|
9568
9674
|
type: "button",
|
|
@@ -9571,24 +9677,24 @@ function FanMotmGame({
|
|
|
9571
9677
|
disabled: alreadyVoted || submitting,
|
|
9572
9678
|
onClick: () => handleVote(c.playerId),
|
|
9573
9679
|
children: [
|
|
9574
|
-
/* @__PURE__ */
|
|
9575
|
-
/* @__PURE__ */
|
|
9576
|
-
isVoted && /* @__PURE__ */
|
|
9680
|
+
/* @__PURE__ */ jsx89(PlayerAvatar, { name: c.playerName, className: "ss-g-motm-av" }),
|
|
9681
|
+
/* @__PURE__ */ jsx89("span", { className: "ss-g-motm-name", children: c.playerName }),
|
|
9682
|
+
isVoted && /* @__PURE__ */ jsx89(Chip, { variant: "accent", className: "ss-g-motm-pill", children: t.yourVote })
|
|
9577
9683
|
]
|
|
9578
9684
|
}
|
|
9579
9685
|
) }, c.playerId);
|
|
9580
9686
|
}) }),
|
|
9581
|
-
alreadyVoted && picked && /* @__PURE__ */
|
|
9687
|
+
alreadyVoted && picked && /* @__PURE__ */ jsx89(ResultCard, { tone: "neutral", title: t.youVoted(picked.playerName), detail: t.thanks, onBack, ui })
|
|
9582
9688
|
] }),
|
|
9583
|
-
/* @__PURE__ */
|
|
9584
|
-
!alreadyVoted && /* @__PURE__ */
|
|
9585
|
-
/* @__PURE__ */
|
|
9689
|
+
/* @__PURE__ */ jsxs77(FooterBar, { children: [
|
|
9690
|
+
!alreadyVoted && /* @__PURE__ */ jsx89("p", { className: "ss-g-motm-foot", children: t.tapToVote }),
|
|
9691
|
+
/* @__PURE__ */ jsx89("p", { className: "ss-g-motm-fun", children: t.forFun })
|
|
9586
9692
|
] })
|
|
9587
9693
|
] });
|
|
9588
9694
|
}
|
|
9589
9695
|
|
|
9590
9696
|
// src/components/GameScreenHost.tsx
|
|
9591
|
-
import { jsx as
|
|
9697
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
9592
9698
|
var FIXTURE_GAME_IDS = /* @__PURE__ */ new Set([
|
|
9593
9699
|
"matchday-predictor",
|
|
9594
9700
|
"starting-xi",
|
|
@@ -9612,7 +9718,7 @@ function GameScreenHost({
|
|
|
9612
9718
|
ui
|
|
9613
9719
|
}) {
|
|
9614
9720
|
const { gameId, fixtureId, gameDay = "", lockAtUtc = null } = selected;
|
|
9615
|
-
const [configJson, setConfigJson] =
|
|
9721
|
+
const [configJson, setConfigJson] = useState48(null);
|
|
9616
9722
|
useEffect29(() => {
|
|
9617
9723
|
setConfigJson(null);
|
|
9618
9724
|
if (!conversation) return;
|
|
@@ -9664,7 +9770,7 @@ function GameScreenHost({
|
|
|
9664
9770
|
function renderScreen() {
|
|
9665
9771
|
switch (gameId) {
|
|
9666
9772
|
case "mystery-tiger":
|
|
9667
|
-
return /* @__PURE__ */
|
|
9773
|
+
return /* @__PURE__ */ jsx90(
|
|
9668
9774
|
MysteryTigerGame,
|
|
9669
9775
|
{
|
|
9670
9776
|
...sharedProps,
|
|
@@ -9672,7 +9778,7 @@ function GameScreenHost({
|
|
|
9672
9778
|
}
|
|
9673
9779
|
);
|
|
9674
9780
|
case "higher-or-lower":
|
|
9675
|
-
return /* @__PURE__ */
|
|
9781
|
+
return /* @__PURE__ */ jsx90(
|
|
9676
9782
|
HigherOrLowerGame,
|
|
9677
9783
|
{
|
|
9678
9784
|
...sharedProps,
|
|
@@ -9680,7 +9786,7 @@ function GameScreenHost({
|
|
|
9680
9786
|
}
|
|
9681
9787
|
);
|
|
9682
9788
|
case "career-path":
|
|
9683
|
-
return /* @__PURE__ */
|
|
9789
|
+
return /* @__PURE__ */ jsx90(
|
|
9684
9790
|
CareerPathGame,
|
|
9685
9791
|
{
|
|
9686
9792
|
...sharedProps,
|
|
@@ -9689,7 +9795,7 @@ function GameScreenHost({
|
|
|
9689
9795
|
);
|
|
9690
9796
|
case "beat-the-grid": {
|
|
9691
9797
|
const btgConfig = safeParseConfig(configJson);
|
|
9692
|
-
return /* @__PURE__ */
|
|
9798
|
+
return /* @__PURE__ */ jsx90(
|
|
9693
9799
|
BeatTheGridGame,
|
|
9694
9800
|
{
|
|
9695
9801
|
...sharedProps,
|
|
@@ -9699,7 +9805,7 @@ function GameScreenHost({
|
|
|
9699
9805
|
);
|
|
9700
9806
|
}
|
|
9701
9807
|
case "guess-the-xi":
|
|
9702
|
-
return /* @__PURE__ */
|
|
9808
|
+
return /* @__PURE__ */ jsx90(
|
|
9703
9809
|
GuessTheXiGame,
|
|
9704
9810
|
{
|
|
9705
9811
|
...sharedProps,
|
|
@@ -9707,7 +9813,7 @@ function GameScreenHost({
|
|
|
9707
9813
|
}
|
|
9708
9814
|
);
|
|
9709
9815
|
case "daily-quiz":
|
|
9710
|
-
return /* @__PURE__ */
|
|
9816
|
+
return /* @__PURE__ */ jsx90(
|
|
9711
9817
|
DailyQuizGame,
|
|
9712
9818
|
{
|
|
9713
9819
|
...sharedProps,
|
|
@@ -9715,7 +9821,7 @@ function GameScreenHost({
|
|
|
9715
9821
|
}
|
|
9716
9822
|
);
|
|
9717
9823
|
case "matchday-predictor":
|
|
9718
|
-
return /* @__PURE__ */
|
|
9824
|
+
return /* @__PURE__ */ jsx90(
|
|
9719
9825
|
MatchdayPredictorGame,
|
|
9720
9826
|
{
|
|
9721
9827
|
...sharedProps,
|
|
@@ -9723,7 +9829,7 @@ function GameScreenHost({
|
|
|
9723
9829
|
}
|
|
9724
9830
|
);
|
|
9725
9831
|
case "starting-xi":
|
|
9726
|
-
return /* @__PURE__ */
|
|
9832
|
+
return /* @__PURE__ */ jsx90(
|
|
9727
9833
|
StartingXiGame,
|
|
9728
9834
|
{
|
|
9729
9835
|
...sharedProps,
|
|
@@ -9731,7 +9837,7 @@ function GameScreenHost({
|
|
|
9731
9837
|
}
|
|
9732
9838
|
);
|
|
9733
9839
|
case "stat-ladder":
|
|
9734
|
-
return /* @__PURE__ */
|
|
9840
|
+
return /* @__PURE__ */ jsx90(
|
|
9735
9841
|
StatLadderGame,
|
|
9736
9842
|
{
|
|
9737
9843
|
...sharedProps,
|
|
@@ -9739,7 +9845,7 @@ function GameScreenHost({
|
|
|
9739
9845
|
}
|
|
9740
9846
|
);
|
|
9741
9847
|
case "fan-motm":
|
|
9742
|
-
return /* @__PURE__ */
|
|
9848
|
+
return /* @__PURE__ */ jsx90(
|
|
9743
9849
|
FanMotmGame,
|
|
9744
9850
|
{
|
|
9745
9851
|
...sharedProps,
|
|
@@ -9747,17 +9853,17 @@ function GameScreenHost({
|
|
|
9747
9853
|
}
|
|
9748
9854
|
);
|
|
9749
9855
|
default:
|
|
9750
|
-
return /* @__PURE__ */
|
|
9856
|
+
return /* @__PURE__ */ jsx90("div", { className: "ss-g-screen", "data-testid": `game-screen-${gameId}`, children: /* @__PURE__ */ jsx90(GameHeader, { title: gameTitle({ gameId }, ui.games.titles), onBack, backLabel: ui.back }) });
|
|
9751
9857
|
}
|
|
9752
9858
|
}
|
|
9753
|
-
return /* @__PURE__ */
|
|
9859
|
+
return /* @__PURE__ */ jsx90("div", { className: "ss-w-gscreen", "data-testid": "gscreen", "data-lock-at": lockAtUtc ?? void 0, children: renderScreen() });
|
|
9754
9860
|
}
|
|
9755
9861
|
|
|
9756
9862
|
// src/components/Leaderboard.tsx
|
|
9757
|
-
import { useState as
|
|
9863
|
+
import { useState as useState49 } from "react";
|
|
9758
9864
|
|
|
9759
9865
|
// src/components/LeaderboardRow.tsx
|
|
9760
|
-
import { jsx as
|
|
9866
|
+
import { jsx as jsx91, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
9761
9867
|
function formatPoints(n) {
|
|
9762
9868
|
return n.toLocaleString("en");
|
|
9763
9869
|
}
|
|
@@ -9766,14 +9872,14 @@ function LeaderboardWeeklyRow({
|
|
|
9766
9872
|
isMe
|
|
9767
9873
|
}) {
|
|
9768
9874
|
const rankClass = `ss-w-lb2-rank${row.rank <= 3 ? " ss-w-lb2-rank--top3" : ""}`;
|
|
9769
|
-
return /* @__PURE__ */
|
|
9770
|
-
/* @__PURE__ */
|
|
9875
|
+
return /* @__PURE__ */ jsxs78("div", { className: `ss-w-lb2-row${isMe ? " ss-w-lb2-row--you" : ""}`, children: [
|
|
9876
|
+
/* @__PURE__ */ jsxs78("span", { className: rankClass, children: [
|
|
9771
9877
|
"#",
|
|
9772
9878
|
row.rank
|
|
9773
9879
|
] }),
|
|
9774
|
-
/* @__PURE__ */
|
|
9775
|
-
/* @__PURE__ */
|
|
9776
|
-
row.currentStreak > 0 && /* @__PURE__ */
|
|
9880
|
+
/* @__PURE__ */ jsx91("span", { className: "ss-w-lb2-handle", children: row.handle }),
|
|
9881
|
+
/* @__PURE__ */ jsx91("span", { className: "ss-w-lb2-points", children: formatPoints(row.points) }),
|
|
9882
|
+
row.currentStreak > 0 && /* @__PURE__ */ jsxs78("span", { className: "ss-w-lb2-streak", children: [
|
|
9777
9883
|
"\u{1F525} ",
|
|
9778
9884
|
row.currentStreak
|
|
9779
9885
|
] })
|
|
@@ -9784,18 +9890,18 @@ function LeaderboardAllTimeRow({
|
|
|
9784
9890
|
isMe
|
|
9785
9891
|
}) {
|
|
9786
9892
|
const rankClass = `ss-w-lb2-rank${row.rank <= 3 ? " ss-w-lb2-rank--top3" : ""}`;
|
|
9787
|
-
return /* @__PURE__ */
|
|
9788
|
-
/* @__PURE__ */
|
|
9893
|
+
return /* @__PURE__ */ jsxs78("div", { className: `ss-w-lb2-row${isMe ? " ss-w-lb2-row--you" : ""}`, children: [
|
|
9894
|
+
/* @__PURE__ */ jsxs78("span", { className: rankClass, children: [
|
|
9789
9895
|
"#",
|
|
9790
9896
|
row.rank
|
|
9791
9897
|
] }),
|
|
9792
|
-
/* @__PURE__ */
|
|
9793
|
-
/* @__PURE__ */
|
|
9898
|
+
/* @__PURE__ */ jsx91("span", { className: "ss-w-lb2-handle", children: row.handle }),
|
|
9899
|
+
/* @__PURE__ */ jsx91("span", { className: "ss-w-lb2-points", children: formatPoints(row.allTimePoints) })
|
|
9794
9900
|
] });
|
|
9795
9901
|
}
|
|
9796
9902
|
|
|
9797
9903
|
// src/components/LeaderboardEmpty.tsx
|
|
9798
|
-
import { jsx as
|
|
9904
|
+
import { jsx as jsx92, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
9799
9905
|
function LeaderboardEmpty({
|
|
9800
9906
|
segment,
|
|
9801
9907
|
lastWeek,
|
|
@@ -9804,48 +9910,48 @@ function LeaderboardEmpty({
|
|
|
9804
9910
|
ui
|
|
9805
9911
|
}) {
|
|
9806
9912
|
if (segment === "alltime") {
|
|
9807
|
-
return /* @__PURE__ */
|
|
9808
|
-
/* @__PURE__ */
|
|
9809
|
-
/* @__PURE__ */
|
|
9913
|
+
return /* @__PURE__ */ jsxs79("div", { className: "ss-w-lb-empty ss-w-lb-empty--alltime", children: [
|
|
9914
|
+
/* @__PURE__ */ jsx92("div", { className: "ss-w-lb-empty-icon", "aria-hidden": "true", children: "\u{1F4CA}" }),
|
|
9915
|
+
/* @__PURE__ */ jsx92("p", { className: "ss-w-lb-empty-body", children: ui.leaderboardAllTimeEmpty })
|
|
9810
9916
|
] });
|
|
9811
9917
|
}
|
|
9812
9918
|
const fresh = lastWeek != null;
|
|
9813
9919
|
const title = fresh ? ui.leaderboardEmptyFreshTitle : ui.leaderboardEmptyColdTitle;
|
|
9814
9920
|
const body = fresh ? ui.leaderboardEmptyFreshBody : ui.leaderboardEmptyColdBody;
|
|
9815
|
-
return /* @__PURE__ */
|
|
9816
|
-
weeklyPrize && /* @__PURE__ */
|
|
9817
|
-
/* @__PURE__ */
|
|
9818
|
-
/* @__PURE__ */
|
|
9921
|
+
return /* @__PURE__ */ jsxs79("div", { className: "ss-w-lb-empty", children: [
|
|
9922
|
+
weeklyPrize && /* @__PURE__ */ jsxs79("div", { className: "ss-w-prize", children: [
|
|
9923
|
+
/* @__PURE__ */ jsx92("span", { className: "ss-w-prize-icon", "aria-hidden": "true", children: "\u{1F3C6}" }),
|
|
9924
|
+
/* @__PURE__ */ jsx92("div", { className: "ss-w-prize-body", children: /* @__PURE__ */ jsx92("span", { className: "ss-w-prize-text", children: weeklyPrize }) })
|
|
9819
9925
|
] }),
|
|
9820
|
-
/* @__PURE__ */
|
|
9821
|
-
/* @__PURE__ */
|
|
9822
|
-
/* @__PURE__ */
|
|
9823
|
-
/* @__PURE__ */
|
|
9824
|
-
onPlay && /* @__PURE__ */
|
|
9926
|
+
/* @__PURE__ */ jsxs79("div", { className: "ss-w-lb-empty-hero", children: [
|
|
9927
|
+
/* @__PURE__ */ jsx92("div", { className: "ss-w-lb-empty-icon", "aria-hidden": "true", children: fresh ? "\u{1F3C6}" : "\u{1F3AE}" }),
|
|
9928
|
+
/* @__PURE__ */ jsx92("h4", { className: "ss-w-lb-empty-title", children: title }),
|
|
9929
|
+
/* @__PURE__ */ jsx92("p", { className: "ss-w-lb-empty-body", children: body }),
|
|
9930
|
+
onPlay && /* @__PURE__ */ jsx92("button", { type: "button", className: "ss-w-lb-empty-cta", onClick: onPlay, children: ui.leaderboardEmptyCta })
|
|
9825
9931
|
] }),
|
|
9826
|
-
fresh && lastWeek && /* @__PURE__ */
|
|
9827
|
-
/* @__PURE__ */
|
|
9828
|
-
/* @__PURE__ */
|
|
9829
|
-
/* @__PURE__ */
|
|
9830
|
-
/* @__PURE__ */
|
|
9932
|
+
fresh && lastWeek && /* @__PURE__ */ jsxs79("div", { className: "ss-w-lb-last", children: [
|
|
9933
|
+
/* @__PURE__ */ jsx92("span", { className: "ss-w-lb-last-label", children: ui.leaderboardLastWeekLabel }),
|
|
9934
|
+
/* @__PURE__ */ jsx92("span", { className: "ss-w-lb-last-champ", "aria-hidden": "true", children: "\u{1F947}" }),
|
|
9935
|
+
/* @__PURE__ */ jsx92("span", { className: "ss-w-lb-last-handle", children: lastWeek.handle }),
|
|
9936
|
+
/* @__PURE__ */ jsx92("span", { className: "ss-w-lb-last-points", children: formatPoints(lastWeek.points) })
|
|
9831
9937
|
] })
|
|
9832
9938
|
] });
|
|
9833
9939
|
}
|
|
9834
9940
|
|
|
9835
9941
|
// src/components/Leaderboard.tsx
|
|
9836
|
-
import { Fragment as
|
|
9942
|
+
import { Fragment as Fragment22, jsx as jsx93, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
9837
9943
|
function Leaderboard({
|
|
9838
9944
|
data,
|
|
9839
9945
|
ui,
|
|
9840
9946
|
onPlay
|
|
9841
9947
|
}) {
|
|
9842
|
-
const [segment, setSegment] =
|
|
9948
|
+
const [segment, setSegment] = useState49("weekly");
|
|
9843
9949
|
const myRow = segment === "weekly" ? data.myWeeklyRow : data.myAllTimeRow;
|
|
9844
9950
|
const offBoard = myRow !== null && myRow !== void 0 && myRow.rank === -1;
|
|
9845
9951
|
const isEmpty = segment === "weekly" ? data.weeklyTop.length === 0 : data.allTimeTop.length === 0;
|
|
9846
|
-
return /* @__PURE__ */
|
|
9847
|
-
/* @__PURE__ */
|
|
9848
|
-
/* @__PURE__ */
|
|
9952
|
+
return /* @__PURE__ */ jsxs80("div", { className: "ss-w-lb2", children: [
|
|
9953
|
+
/* @__PURE__ */ jsxs80("div", { className: "ss-w-seg", children: [
|
|
9954
|
+
/* @__PURE__ */ jsx93(
|
|
9849
9955
|
"button",
|
|
9850
9956
|
{
|
|
9851
9957
|
type: "button",
|
|
@@ -9855,7 +9961,7 @@ function Leaderboard({
|
|
|
9855
9961
|
children: ui.leaderboardThisWeek
|
|
9856
9962
|
}
|
|
9857
9963
|
),
|
|
9858
|
-
/* @__PURE__ */
|
|
9964
|
+
/* @__PURE__ */ jsx93(
|
|
9859
9965
|
"button",
|
|
9860
9966
|
{
|
|
9861
9967
|
type: "button",
|
|
@@ -9866,7 +9972,7 @@ function Leaderboard({
|
|
|
9866
9972
|
}
|
|
9867
9973
|
)
|
|
9868
9974
|
] }),
|
|
9869
|
-
isEmpty ? /* @__PURE__ */
|
|
9975
|
+
isEmpty ? /* @__PURE__ */ jsx93(
|
|
9870
9976
|
LeaderboardEmpty,
|
|
9871
9977
|
{
|
|
9872
9978
|
segment,
|
|
@@ -9875,15 +9981,15 @@ function Leaderboard({
|
|
|
9875
9981
|
onPlay,
|
|
9876
9982
|
ui
|
|
9877
9983
|
}
|
|
9878
|
-
) : /* @__PURE__ */
|
|
9879
|
-
/* @__PURE__ */
|
|
9984
|
+
) : /* @__PURE__ */ jsxs80(Fragment22, { children: [
|
|
9985
|
+
/* @__PURE__ */ jsx93("div", { className: "ss-w-lb2-rows", children: segment === "weekly" ? data.weeklyTop.map((row) => /* @__PURE__ */ jsx93(
|
|
9880
9986
|
LeaderboardWeeklyRow,
|
|
9881
9987
|
{
|
|
9882
9988
|
row,
|
|
9883
9989
|
isMe: row.operatorUserId === data.myWeeklyRow?.operatorUserId
|
|
9884
9990
|
},
|
|
9885
9991
|
row.operatorUserId
|
|
9886
|
-
)) : data.allTimeTop.map((row) => /* @__PURE__ */
|
|
9992
|
+
)) : data.allTimeTop.map((row) => /* @__PURE__ */ jsx93(
|
|
9887
9993
|
LeaderboardAllTimeRow,
|
|
9888
9994
|
{
|
|
9889
9995
|
row,
|
|
@@ -9891,18 +9997,18 @@ function Leaderboard({
|
|
|
9891
9997
|
},
|
|
9892
9998
|
row.operatorUserId
|
|
9893
9999
|
)) }),
|
|
9894
|
-
/* @__PURE__ */
|
|
9895
|
-
myRow != null && (offBoard ? /* @__PURE__ */
|
|
9896
|
-
segment === "weekly" && data.myWeeklyRow && /* @__PURE__ */
|
|
9897
|
-
segment === "alltime" && data.myAllTimeRow && /* @__PURE__ */
|
|
10000
|
+
/* @__PURE__ */ jsx93("div", { className: "ss-w-kitline", children: "\u{1F3BD}" }),
|
|
10001
|
+
myRow != null && (offBoard ? /* @__PURE__ */ jsx93("div", { className: "ss-w-lbgap", children: ui.leaderboardOffBoard }) : /* @__PURE__ */ jsxs80("div", { className: "ss-w-lb2-rows", children: [
|
|
10002
|
+
segment === "weekly" && data.myWeeklyRow && /* @__PURE__ */ jsx93(LeaderboardWeeklyRow, { row: data.myWeeklyRow, isMe: true }),
|
|
10003
|
+
segment === "alltime" && data.myAllTimeRow && /* @__PURE__ */ jsx93(LeaderboardAllTimeRow, { row: data.myAllTimeRow, isMe: true })
|
|
9898
10004
|
] })),
|
|
9899
|
-
segment === "alltime" && data.myAllTimeRow && !offBoard && /* @__PURE__ */
|
|
10005
|
+
segment === "alltime" && data.myAllTimeRow && !offBoard && /* @__PURE__ */ jsx93("div", { className: "ss-w-lb2-rows", children: /* @__PURE__ */ jsx93("div", { className: "ss-w-lb2-row", children: /* @__PURE__ */ jsx93("span", { className: "ss-w-lb2-handle", children: formatPoints(data.allTimeTop.reduce((s, r) => s + r.allTimePoints, 0)) }) }) })
|
|
9900
10006
|
] })
|
|
9901
10007
|
] });
|
|
9902
10008
|
}
|
|
9903
10009
|
|
|
9904
10010
|
// src/components/LeaderboardPanel.tsx
|
|
9905
|
-
import { jsx as
|
|
10011
|
+
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
9906
10012
|
var EMPTY_PAYLOAD = {
|
|
9907
10013
|
week: "",
|
|
9908
10014
|
weeklyTop: [],
|
|
@@ -9913,9 +10019,9 @@ var EMPTY_PAYLOAD = {
|
|
|
9913
10019
|
lastWeek: null
|
|
9914
10020
|
};
|
|
9915
10021
|
function LeaderboardPanel({ loggedIn, data, loading, onPlay, ui }) {
|
|
9916
|
-
if (!loggedIn) return /* @__PURE__ */
|
|
9917
|
-
if (data === null && loading) return /* @__PURE__ */
|
|
9918
|
-
return /* @__PURE__ */
|
|
10022
|
+
if (!loggedIn) return /* @__PURE__ */ jsx94(GamesLoginWall, { ui });
|
|
10023
|
+
if (data === null && loading) return /* @__PURE__ */ jsx94("div", { className: "ss-w-mon-list" });
|
|
10024
|
+
return /* @__PURE__ */ jsx94("div", { className: "ss-w-mon-list", children: /* @__PURE__ */ jsx94(Leaderboard, { data: data ?? EMPTY_PAYLOAD, ui, onPlay }) });
|
|
9919
10025
|
}
|
|
9920
10026
|
|
|
9921
10027
|
// src/components/games/ui/fonts.ts
|
|
@@ -9932,7 +10038,7 @@ function ensureGamesFonts(doc = document) {
|
|
|
9932
10038
|
}
|
|
9933
10039
|
|
|
9934
10040
|
// src/components/GamesPanel.tsx
|
|
9935
|
-
import { jsx as
|
|
10041
|
+
import { jsx as jsx95, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
9936
10042
|
function GamesPanel({
|
|
9937
10043
|
loggedIn,
|
|
9938
10044
|
games,
|
|
@@ -9942,14 +10048,14 @@ function GamesPanel({
|
|
|
9942
10048
|
leaderboardLoading,
|
|
9943
10049
|
refreshHub
|
|
9944
10050
|
}) {
|
|
9945
|
-
const [selected, setSelected] =
|
|
9946
|
-
const [segment, setSegment] =
|
|
10051
|
+
const [selected, setSelected] = useState50(null);
|
|
10052
|
+
const [segment, setSegment] = useState50("play");
|
|
9947
10053
|
useEffect30(() => {
|
|
9948
10054
|
ensureGamesFonts();
|
|
9949
10055
|
}, []);
|
|
9950
|
-
if (!loggedIn) return /* @__PURE__ */
|
|
10056
|
+
if (!loggedIn) return /* @__PURE__ */ jsx95(GamesLoginWall, { ui });
|
|
9951
10057
|
if (selected !== null) {
|
|
9952
|
-
return /* @__PURE__ */
|
|
10058
|
+
return /* @__PURE__ */ jsx95("div", { className: "ss-w-gscreen-wrap", lang: ui.games.lang, children: /* @__PURE__ */ jsx95(
|
|
9953
10059
|
GameScreenHost,
|
|
9954
10060
|
{
|
|
9955
10061
|
selected,
|
|
@@ -9963,9 +10069,9 @@ function GamesPanel({
|
|
|
9963
10069
|
}
|
|
9964
10070
|
) });
|
|
9965
10071
|
}
|
|
9966
|
-
return /* @__PURE__ */
|
|
9967
|
-
/* @__PURE__ */
|
|
9968
|
-
/* @__PURE__ */
|
|
10072
|
+
return /* @__PURE__ */ jsxs81("div", { className: "ss-g-hub-wrap", lang: ui.games.lang, children: [
|
|
10073
|
+
/* @__PURE__ */ jsxs81("div", { className: "ss-w-seg", children: [
|
|
10074
|
+
/* @__PURE__ */ jsx95(
|
|
9969
10075
|
"button",
|
|
9970
10076
|
{
|
|
9971
10077
|
type: "button",
|
|
@@ -9975,7 +10081,7 @@ function GamesPanel({
|
|
|
9975
10081
|
children: ui.gamesPlaySegment
|
|
9976
10082
|
}
|
|
9977
10083
|
),
|
|
9978
|
-
/* @__PURE__ */
|
|
10084
|
+
/* @__PURE__ */ jsx95(
|
|
9979
10085
|
"button",
|
|
9980
10086
|
{
|
|
9981
10087
|
type: "button",
|
|
@@ -9986,7 +10092,7 @@ function GamesPanel({
|
|
|
9986
10092
|
}
|
|
9987
10093
|
)
|
|
9988
10094
|
] }),
|
|
9989
|
-
segment === "play" ? /* @__PURE__ */
|
|
10095
|
+
segment === "play" ? /* @__PURE__ */ jsx95("div", { "data-testid": "games-hub", lang: ui.games.lang, children: /* @__PURE__ */ jsx95(
|
|
9990
10096
|
GamesHub,
|
|
9991
10097
|
{
|
|
9992
10098
|
games,
|
|
@@ -9994,7 +10100,7 @@ function GamesPanel({
|
|
|
9994
10100
|
myWeeklyRow: leaderboard?.myWeeklyRow ?? null,
|
|
9995
10101
|
ui
|
|
9996
10102
|
}
|
|
9997
|
-
) }) : /* @__PURE__ */
|
|
10103
|
+
) }) : /* @__PURE__ */ jsx95(
|
|
9998
10104
|
LeaderboardPanel,
|
|
9999
10105
|
{
|
|
10000
10106
|
loggedIn,
|
|
@@ -10008,7 +10114,7 @@ function GamesPanel({
|
|
|
10008
10114
|
}
|
|
10009
10115
|
|
|
10010
10116
|
// src/components/Fixtures.tsx
|
|
10011
|
-
import { jsx as
|
|
10117
|
+
import { jsx as jsx96, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
10012
10118
|
function groupByRound(fixtures) {
|
|
10013
10119
|
const groups = [];
|
|
10014
10120
|
for (const fx of fixtures) {
|
|
@@ -10020,31 +10126,31 @@ function groupByRound(fixtures) {
|
|
|
10020
10126
|
}
|
|
10021
10127
|
function Fixtures({ fixtures, loading, ui }) {
|
|
10022
10128
|
if (fixtures.length === 0) {
|
|
10023
|
-
if (loading) return /* @__PURE__ */
|
|
10024
|
-
return /* @__PURE__ */
|
|
10129
|
+
if (loading) return /* @__PURE__ */ jsx96("div", { className: "ss-w-mon-list" });
|
|
10130
|
+
return /* @__PURE__ */ jsx96("div", { className: "ss-w-mon-empty", children: ui.clubFixturesEmpty });
|
|
10025
10131
|
}
|
|
10026
|
-
return /* @__PURE__ */
|
|
10027
|
-
group.round && /* @__PURE__ */
|
|
10132
|
+
return /* @__PURE__ */ jsx96("div", { className: "ss-w-mon-list", children: groupByRound(fixtures).map((group, gi) => /* @__PURE__ */ jsxs82("div", { children: [
|
|
10133
|
+
group.round && /* @__PURE__ */ jsx96("div", { className: "ss-w-club-eyebrow", children: group.round }),
|
|
10028
10134
|
group.items.map((fx) => {
|
|
10029
10135
|
const played = fx.homeScore !== null && fx.awayScore !== null;
|
|
10030
10136
|
const kickoff = fx.matchDateTime ? ui.bettingKickoff(fx.matchDateTime) : null;
|
|
10031
|
-
return /* @__PURE__ */
|
|
10032
|
-
/* @__PURE__ */
|
|
10033
|
-
fx.competitionName && /* @__PURE__ */
|
|
10034
|
-
!played && kickoff && /* @__PURE__ */
|
|
10137
|
+
return /* @__PURE__ */ jsxs82("div", { className: "ss-w-mon", children: [
|
|
10138
|
+
/* @__PURE__ */ jsxs82("div", { className: "ss-w-mon-top", children: [
|
|
10139
|
+
fx.competitionName && /* @__PURE__ */ jsx96("span", { className: "ss-w-mon-comp", children: fx.competitionName }),
|
|
10140
|
+
!played && kickoff && /* @__PURE__ */ jsxs82("span", { className: "ss-w-mon-pill", children: [
|
|
10035
10141
|
kickoff.dayLabel,
|
|
10036
10142
|
" \xB7 ",
|
|
10037
10143
|
kickoff.time
|
|
10038
10144
|
] })
|
|
10039
10145
|
] }),
|
|
10040
|
-
/* @__PURE__ */
|
|
10041
|
-
/* @__PURE__ */
|
|
10042
|
-
played ? /* @__PURE__ */
|
|
10146
|
+
/* @__PURE__ */ jsxs82("div", { className: "ss-w-mon-main", children: [
|
|
10147
|
+
/* @__PURE__ */ jsx96("span", { className: "ss-w-mon-side", children: /* @__PURE__ */ jsx96("span", { className: "ss-w-mon-name", children: fx.homeTeamName }) }),
|
|
10148
|
+
played ? /* @__PURE__ */ jsxs82("span", { className: "ss-w-mon-score", children: [
|
|
10043
10149
|
fx.homeScore,
|
|
10044
|
-
/* @__PURE__ */
|
|
10150
|
+
/* @__PURE__ */ jsx96("i", { children: "-" }),
|
|
10045
10151
|
fx.awayScore
|
|
10046
|
-
] }) : /* @__PURE__ */
|
|
10047
|
-
/* @__PURE__ */
|
|
10152
|
+
] }) : /* @__PURE__ */ jsx96("span", { className: "ss-w-mon-vs", children: "vs" }),
|
|
10153
|
+
/* @__PURE__ */ jsx96("span", { className: "ss-w-mon-side ss-w-mon-side--away", children: /* @__PURE__ */ jsx96("span", { className: "ss-w-mon-name", children: fx.awayTeamName }) })
|
|
10048
10154
|
] })
|
|
10049
10155
|
] }, fx.id);
|
|
10050
10156
|
})
|
|
@@ -10052,7 +10158,7 @@ function Fixtures({ fixtures, loading, ui }) {
|
|
|
10052
10158
|
}
|
|
10053
10159
|
|
|
10054
10160
|
// src/components/Standings.tsx
|
|
10055
|
-
import { jsx as
|
|
10161
|
+
import { jsx as jsx97, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
10056
10162
|
function groupByTable(rows) {
|
|
10057
10163
|
const groups = [];
|
|
10058
10164
|
for (const row of rows) {
|
|
@@ -10063,30 +10169,30 @@ function groupByTable(rows) {
|
|
|
10063
10169
|
return groups;
|
|
10064
10170
|
}
|
|
10065
10171
|
function Standings({ standings, loading, ui }) {
|
|
10066
|
-
if (standings === null && loading) return /* @__PURE__ */
|
|
10067
|
-
if (standings === null || standings.length === 0) return /* @__PURE__ */
|
|
10068
|
-
return /* @__PURE__ */
|
|
10069
|
-
group.table && /* @__PURE__ */
|
|
10070
|
-
/* @__PURE__ */
|
|
10071
|
-
/* @__PURE__ */
|
|
10072
|
-
/* @__PURE__ */
|
|
10073
|
-
/* @__PURE__ */
|
|
10074
|
-
/* @__PURE__ */
|
|
10075
|
-
/* @__PURE__ */
|
|
10076
|
-
/* @__PURE__ */
|
|
10077
|
-
/* @__PURE__ */
|
|
10078
|
-
/* @__PURE__ */
|
|
10079
|
-
/* @__PURE__ */
|
|
10172
|
+
if (standings === null && loading) return /* @__PURE__ */ jsx97("div", { className: "ss-w-mon-list" });
|
|
10173
|
+
if (standings === null || standings.length === 0) return /* @__PURE__ */ jsx97("div", { className: "ss-w-mon-empty", children: ui.clubStandingsEmpty });
|
|
10174
|
+
return /* @__PURE__ */ jsx97("div", { className: "ss-w-mon-list", children: groupByTable(standings).map((group, gi) => /* @__PURE__ */ jsxs83("div", { className: "ss-w-table-wrap", children: [
|
|
10175
|
+
group.table && /* @__PURE__ */ jsx97("div", { className: "ss-w-club-eyebrow", children: group.table }),
|
|
10176
|
+
/* @__PURE__ */ jsxs83("table", { className: "ss-w-md-table", children: [
|
|
10177
|
+
/* @__PURE__ */ jsx97("thead", { children: /* @__PURE__ */ jsxs83("tr", { children: [
|
|
10178
|
+
/* @__PURE__ */ jsx97("th", { children: "#" }),
|
|
10179
|
+
/* @__PURE__ */ jsx97("th", { children: ui.standingsColClub }),
|
|
10180
|
+
/* @__PURE__ */ jsx97("th", { children: ui.standingsColPlayed }),
|
|
10181
|
+
/* @__PURE__ */ jsx97("th", { children: ui.standingsColWon }),
|
|
10182
|
+
/* @__PURE__ */ jsx97("th", { children: ui.standingsColDrawn }),
|
|
10183
|
+
/* @__PURE__ */ jsx97("th", { children: ui.standingsColLost }),
|
|
10184
|
+
/* @__PURE__ */ jsx97("th", { children: ui.standingsColGoalDiff }),
|
|
10185
|
+
/* @__PURE__ */ jsx97("th", { children: ui.standingsColPoints })
|
|
10080
10186
|
] }) }),
|
|
10081
|
-
/* @__PURE__ */
|
|
10082
|
-
/* @__PURE__ */
|
|
10083
|
-
/* @__PURE__ */
|
|
10084
|
-
/* @__PURE__ */
|
|
10085
|
-
/* @__PURE__ */
|
|
10086
|
-
/* @__PURE__ */
|
|
10087
|
-
/* @__PURE__ */
|
|
10088
|
-
/* @__PURE__ */
|
|
10089
|
-
/* @__PURE__ */
|
|
10187
|
+
/* @__PURE__ */ jsx97("tbody", { children: group.items.map((row) => /* @__PURE__ */ jsxs83("tr", { children: [
|
|
10188
|
+
/* @__PURE__ */ jsx97("td", { children: row.position }),
|
|
10189
|
+
/* @__PURE__ */ jsx97("td", { children: row.teamName }),
|
|
10190
|
+
/* @__PURE__ */ jsx97("td", { children: row.playedGames }),
|
|
10191
|
+
/* @__PURE__ */ jsx97("td", { children: row.wins }),
|
|
10192
|
+
/* @__PURE__ */ jsx97("td", { children: row.draws }),
|
|
10193
|
+
/* @__PURE__ */ jsx97("td", { children: row.losses }),
|
|
10194
|
+
/* @__PURE__ */ jsx97("td", { children: row.goalDifference }),
|
|
10195
|
+
/* @__PURE__ */ jsx97("td", { children: row.points })
|
|
10090
10196
|
] }, row.teamId)) })
|
|
10091
10197
|
] })
|
|
10092
10198
|
] }, `${gi}-${group.table ?? "none"}`)) });
|
|
@@ -10144,7 +10250,7 @@ function statsEyebrow(ui, season, competition, matches) {
|
|
|
10144
10250
|
}
|
|
10145
10251
|
|
|
10146
10252
|
// src/components/SquadStats.tsx
|
|
10147
|
-
import { jsx as
|
|
10253
|
+
import { jsx as jsx98, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
10148
10254
|
function leader(stats, pick) {
|
|
10149
10255
|
let best = null;
|
|
10150
10256
|
for (const p of stats) {
|
|
@@ -10158,53 +10264,53 @@ function ratingClass(rating) {
|
|
|
10158
10264
|
return Number(rating.toFixed(1)) >= 7 ? "ss-w-sq-c36 ss-w-sq-rtg ss-w-pos-ink" : "ss-w-sq-c36 ss-w-sq-rtg";
|
|
10159
10265
|
}
|
|
10160
10266
|
function SquadStats({ stats, loading, ui, onSelectPlayer }) {
|
|
10161
|
-
if (stats === null && loading) return /* @__PURE__ */
|
|
10162
|
-
if (stats === null || stats.length === 0) return /* @__PURE__ */
|
|
10267
|
+
if (stats === null && loading) return /* @__PURE__ */ jsx98("div", { className: "ss-w-mon-list" });
|
|
10268
|
+
if (stats === null || stats.length === 0) return /* @__PURE__ */ jsx98("div", { className: "ss-w-mon-empty", children: ui.clubSquadStatsEmpty });
|
|
10163
10269
|
const scorer = leader(stats, (p) => p.goals);
|
|
10164
10270
|
const assister = leader(stats, (p) => p.assists);
|
|
10165
10271
|
const footer = [
|
|
10166
10272
|
scorer && ui.squadTopScorer(scorer.playerName, scorer.goals),
|
|
10167
10273
|
assister && ui.squadTopAssists(assister.playerName, assister.assists)
|
|
10168
10274
|
].filter((part) => !!part).join(" \xB7 ");
|
|
10169
|
-
return /* @__PURE__ */
|
|
10170
|
-
/* @__PURE__ */
|
|
10171
|
-
/* @__PURE__ */
|
|
10172
|
-
/* @__PURE__ */
|
|
10173
|
-
/* @__PURE__ */
|
|
10174
|
-
/* @__PURE__ */
|
|
10175
|
-
/* @__PURE__ */
|
|
10176
|
-
/* @__PURE__ */
|
|
10177
|
-
/* @__PURE__ */
|
|
10178
|
-
/* @__PURE__ */
|
|
10179
|
-
/* @__PURE__ */
|
|
10180
|
-
/* @__PURE__ */
|
|
10275
|
+
return /* @__PURE__ */ jsxs84("div", { className: "ss-w-mon-list ss-w-sq-stats", children: [
|
|
10276
|
+
/* @__PURE__ */ jsxs84("div", { className: "ss-w-sq-card", children: [
|
|
10277
|
+
/* @__PURE__ */ jsxs84("div", { className: "ss-w-sq-row ss-w-sq-head", "aria-hidden": "true", children: [
|
|
10278
|
+
/* @__PURE__ */ jsx98("span", { className: "ss-w-sq-name" }),
|
|
10279
|
+
/* @__PURE__ */ jsx98("span", { className: "ss-w-sq-pos", children: ui.statHeadPos }),
|
|
10280
|
+
/* @__PURE__ */ jsx98("span", { className: "ss-w-sq-c30", children: ui.statColApps }),
|
|
10281
|
+
/* @__PURE__ */ jsx98("span", { className: "ss-w-sq-c36", children: ui.statHeadMins }),
|
|
10282
|
+
/* @__PURE__ */ jsx98("span", { className: "ss-w-sq-c20", children: ui.statHeadGoals }),
|
|
10283
|
+
/* @__PURE__ */ jsx98("span", { className: "ss-w-sq-c20", children: ui.statHeadAssists }),
|
|
10284
|
+
/* @__PURE__ */ jsx98("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: ui.statHeadYellow }),
|
|
10285
|
+
/* @__PURE__ */ jsx98("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: ui.statHeadRed }),
|
|
10286
|
+
/* @__PURE__ */ jsx98("span", { className: "ss-w-sq-c36", children: ui.statHeadRating })
|
|
10181
10287
|
] }),
|
|
10182
|
-
stats.map((p) => /* @__PURE__ */
|
|
10183
|
-
/* @__PURE__ */
|
|
10184
|
-
p.jerseyNumber !== null && /* @__PURE__ */
|
|
10185
|
-
/* @__PURE__ */
|
|
10288
|
+
stats.map((p) => /* @__PURE__ */ jsxs84("button", { type: "button", className: "ss-w-sq-row ss-w-sq-tap", onClick: () => onSelectPlayer(p.playerId), children: [
|
|
10289
|
+
/* @__PURE__ */ jsxs84("span", { className: "ss-w-sq-player", children: [
|
|
10290
|
+
p.jerseyNumber !== null && /* @__PURE__ */ jsx98("span", { className: "ss-w-sq-badge", children: p.jerseyNumber }),
|
|
10291
|
+
/* @__PURE__ */ jsx98("span", { className: "ss-w-sq-name ss-w-sq-name-1", children: p.playerName })
|
|
10186
10292
|
] }),
|
|
10187
|
-
/* @__PURE__ */
|
|
10188
|
-
/* @__PURE__ */
|
|
10189
|
-
/* @__PURE__ */
|
|
10190
|
-
/* @__PURE__ */
|
|
10191
|
-
/* @__PURE__ */
|
|
10192
|
-
/* @__PURE__ */
|
|
10193
|
-
/* @__PURE__ */
|
|
10194
|
-
/* @__PURE__ */
|
|
10293
|
+
/* @__PURE__ */ jsx98("span", { className: "ss-w-sq-pos", children: positionShort(p.positionCode, p.positionName) }),
|
|
10294
|
+
/* @__PURE__ */ jsx98("span", { className: "ss-w-sq-c30", children: p.appearances }),
|
|
10295
|
+
/* @__PURE__ */ jsx98("span", { className: "ss-w-sq-c36", children: p.minutesPlayed }),
|
|
10296
|
+
/* @__PURE__ */ jsx98("span", { className: "ss-w-sq-c20", children: p.goals }),
|
|
10297
|
+
/* @__PURE__ */ jsx98("span", { className: "ss-w-sq-c20", children: p.assists }),
|
|
10298
|
+
/* @__PURE__ */ jsx98("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: p.yellowCards }),
|
|
10299
|
+
/* @__PURE__ */ jsx98("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: p.redCards }),
|
|
10300
|
+
/* @__PURE__ */ jsx98("span", { className: ratingClass(p.averageRating), children: p.averageRating === null ? "\u2013" : p.averageRating.toFixed(1) })
|
|
10195
10301
|
] }, p.playerId))
|
|
10196
10302
|
] }),
|
|
10197
|
-
footer !== "" && /* @__PURE__ */
|
|
10303
|
+
footer !== "" && /* @__PURE__ */ jsx98("div", { className: "ss-w-sq-foot", children: footer })
|
|
10198
10304
|
] });
|
|
10199
10305
|
}
|
|
10200
10306
|
|
|
10201
10307
|
// src/components/Squad.tsx
|
|
10202
|
-
import { Fragment as
|
|
10308
|
+
import { Fragment as Fragment23, jsx as jsx99, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
10203
10309
|
function Squad({ squad, loading, ui, view, onToggleView, stats, statsLoading, seasonName = null, competitionName = null, matchesPlayed = null, onSelectPlayer }) {
|
|
10204
10310
|
const eyebrow = view === "stats" ? statsEyebrow(ui, seasonName, competitionName, matchesPlayed) : null;
|
|
10205
|
-
const toggle = /* @__PURE__ */
|
|
10206
|
-
eyebrow !== null && /* @__PURE__ */
|
|
10207
|
-
/* @__PURE__ */
|
|
10311
|
+
const toggle = /* @__PURE__ */ jsxs85("div", { className: "ss-w-sq-bar", children: [
|
|
10312
|
+
eyebrow !== null && /* @__PURE__ */ jsx99("div", { className: "ss-w-sq-eyebrow", children: eyebrow }),
|
|
10313
|
+
/* @__PURE__ */ jsx99("div", { className: "ss-w-sq-seg", role: "group", children: ["roster", "stats"].map((v) => /* @__PURE__ */ jsx99(
|
|
10208
10314
|
"button",
|
|
10209
10315
|
{
|
|
10210
10316
|
type: "button",
|
|
@@ -10219,45 +10325,45 @@ function Squad({ squad, loading, ui, view, onToggleView, stats, statsLoading, se
|
|
|
10219
10325
|
)) })
|
|
10220
10326
|
] });
|
|
10221
10327
|
if (view === "stats") {
|
|
10222
|
-
return /* @__PURE__ */
|
|
10328
|
+
return /* @__PURE__ */ jsxs85(Fragment23, { children: [
|
|
10223
10329
|
toggle,
|
|
10224
|
-
/* @__PURE__ */
|
|
10330
|
+
/* @__PURE__ */ jsx99(SquadStats, { stats, loading: statsLoading, ui, onSelectPlayer })
|
|
10225
10331
|
] });
|
|
10226
10332
|
}
|
|
10227
|
-
if (squad === null && loading) return /* @__PURE__ */
|
|
10333
|
+
if (squad === null && loading) return /* @__PURE__ */ jsxs85(Fragment23, { children: [
|
|
10228
10334
|
toggle,
|
|
10229
|
-
/* @__PURE__ */
|
|
10335
|
+
/* @__PURE__ */ jsx99("div", { className: "ss-w-mon-list" })
|
|
10230
10336
|
] });
|
|
10231
|
-
if (squad === null || squad.length === 0) return /* @__PURE__ */
|
|
10337
|
+
if (squad === null || squad.length === 0) return /* @__PURE__ */ jsxs85(Fragment23, { children: [
|
|
10232
10338
|
toggle,
|
|
10233
|
-
/* @__PURE__ */
|
|
10339
|
+
/* @__PURE__ */ jsx99("div", { className: "ss-w-mon-empty", children: ui.clubSquadEmpty })
|
|
10234
10340
|
] });
|
|
10235
|
-
return /* @__PURE__ */
|
|
10341
|
+
return /* @__PURE__ */ jsxs85(Fragment23, { children: [
|
|
10236
10342
|
toggle,
|
|
10237
|
-
/* @__PURE__ */
|
|
10238
|
-
group.positionName && /* @__PURE__ */
|
|
10239
|
-
group.items.map((p) => /* @__PURE__ */
|
|
10240
|
-
/* @__PURE__ */
|
|
10241
|
-
/* @__PURE__ */
|
|
10343
|
+
/* @__PURE__ */ jsx99("div", { className: "ss-w-mon-list", children: groupByPosition(squad).map((group, gi) => /* @__PURE__ */ jsxs85("div", { children: [
|
|
10344
|
+
group.positionName && /* @__PURE__ */ jsx99("div", { className: "ss-w-club-eyebrow", children: positionLabel(ui, group.positionName) }),
|
|
10345
|
+
group.items.map((p) => /* @__PURE__ */ jsxs85("button", { type: "button", className: "ss-w-sq-row ss-w-sq-tap", onClick: () => onSelectPlayer(p.playerId), children: [
|
|
10346
|
+
/* @__PURE__ */ jsx99("span", { className: "ss-w-sq-num", children: p.jerseyNumber ?? "" }),
|
|
10347
|
+
/* @__PURE__ */ jsx99("span", { className: "ss-w-sq-name", children: p.playerName })
|
|
10242
10348
|
] }, p.playerId))
|
|
10243
10349
|
] }, `${gi}-${group.positionName ?? "none"}`)) })
|
|
10244
10350
|
] });
|
|
10245
10351
|
}
|
|
10246
10352
|
|
|
10247
10353
|
// src/components/PlayerPhoto.tsx
|
|
10248
|
-
import { useState as
|
|
10249
|
-
import { jsx as
|
|
10354
|
+
import { useState as useState51 } from "react";
|
|
10355
|
+
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
10250
10356
|
function PlayerPhoto({ photoUrl, jerseyNumber, size }) {
|
|
10251
|
-
const [failed, setFailed] =
|
|
10357
|
+
const [failed, setFailed] = useState51(false);
|
|
10252
10358
|
const box = { width: size, height: size };
|
|
10253
10359
|
if (photoUrl && !failed) {
|
|
10254
|
-
return /* @__PURE__ */
|
|
10360
|
+
return /* @__PURE__ */ jsx100("img", { className: "ss-w-pd-photo", style: box, src: photoUrl, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
10255
10361
|
}
|
|
10256
|
-
return /* @__PURE__ */
|
|
10362
|
+
return /* @__PURE__ */ jsx100("span", { className: "ss-w-pd-photo ss-w-pd-avatar", style: { ...box, fontSize: Math.round(size * 0.35) }, "aria-hidden": "true", children: jerseyNumber ?? "" });
|
|
10257
10363
|
}
|
|
10258
10364
|
|
|
10259
10365
|
// src/components/MiniPitch.tsx
|
|
10260
|
-
import { jsx as
|
|
10366
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
10261
10367
|
var SPOT = {
|
|
10262
10368
|
GK: [50, 90],
|
|
10263
10369
|
CB: [50, 75],
|
|
@@ -10279,12 +10385,12 @@ var SPOT = {
|
|
|
10279
10385
|
function MiniPitch({ positionCode }) {
|
|
10280
10386
|
const spot = SPOT[positionCode?.trim().toUpperCase() ?? ""];
|
|
10281
10387
|
if (spot === void 0) return null;
|
|
10282
|
-
return /* @__PURE__ */
|
|
10388
|
+
return /* @__PURE__ */ jsx101("div", { className: "ss-w-pd-pitch", "aria-hidden": "true", children: /* @__PURE__ */ jsx101("div", { className: "ss-w-pd-pitch-dot", style: { left: `${spot[0]}%`, top: `${spot[1]}%` } }) });
|
|
10283
10389
|
}
|
|
10284
10390
|
|
|
10285
10391
|
// src/components/PerformanceBars.tsx
|
|
10286
|
-
import { useState as
|
|
10287
|
-
import { jsx as
|
|
10392
|
+
import { useState as useState52 } from "react";
|
|
10393
|
+
import { jsx as jsx102, jsxs as jsxs86 } from "react/jsx-runtime";
|
|
10288
10394
|
var GROUPS = ["shooting", "passing", "possession", "defending"];
|
|
10289
10395
|
function finite3(v) {
|
|
10290
10396
|
return typeof v === "number" && Number.isFinite(v) ? v : null;
|
|
@@ -10329,40 +10435,40 @@ function unrankedLine(ui, reason) {
|
|
|
10329
10435
|
}
|
|
10330
10436
|
}
|
|
10331
10437
|
function PerformanceBars({ performance, competitionName, strings }) {
|
|
10332
|
-
const [mode, setMode] =
|
|
10438
|
+
const [mode, setMode] = useState52("total");
|
|
10333
10439
|
const labelled = performance.metrics.filter((m) => Object.prototype.hasOwnProperty.call(strings.perfMetric, m.key));
|
|
10334
10440
|
if (!labelled.some((m) => valueOf(m, "total") !== null || valueOf(m, "per90") !== null)) return null;
|
|
10335
10441
|
const subtitle = !performance.ranked ? unrankedLine(strings, performance.unrankedReason) : competitionName ? strings.perfRankedAgainst(competitionName, performance.positionGroup) : null;
|
|
10336
10442
|
const cards = GROUPS.map((g) => {
|
|
10337
10443
|
const rows = labelled.filter((m) => m.group === g && valueOf(m, mode) !== null);
|
|
10338
10444
|
if (rows.length === 0) return null;
|
|
10339
|
-
return /* @__PURE__ */
|
|
10340
|
-
/* @__PURE__ */
|
|
10445
|
+
return /* @__PURE__ */ jsxs86("div", { className: "ss-w-pd-card ss-w-pd-perf-card", children: [
|
|
10446
|
+
/* @__PURE__ */ jsx102("div", { className: "ss-w-pd-perf-group", children: groupTitle(strings, g) }),
|
|
10341
10447
|
rows.map((m) => {
|
|
10342
10448
|
const v = valueOf(m, mode);
|
|
10343
10449
|
const rank = performance.ranked ? rankOf(m, mode) : null;
|
|
10344
|
-
return /* @__PURE__ */
|
|
10345
|
-
/* @__PURE__ */
|
|
10346
|
-
/* @__PURE__ */
|
|
10347
|
-
/* @__PURE__ */
|
|
10450
|
+
return /* @__PURE__ */ jsxs86("div", { className: "ss-w-pd-bar-row", children: [
|
|
10451
|
+
/* @__PURE__ */ jsxs86("div", { className: "ss-w-pd-bar-top", children: [
|
|
10452
|
+
/* @__PURE__ */ jsx102("span", { className: "ss-w-pd-bar-label", children: strings.perfMetric[m.key] }),
|
|
10453
|
+
/* @__PURE__ */ jsx102("span", { className: "ss-w-pd-bar-value", children: format(m, v, mode) })
|
|
10348
10454
|
] }),
|
|
10349
|
-
rank !== null && /* @__PURE__ */
|
|
10455
|
+
rank !== null && /* @__PURE__ */ jsx102("div", { className: "ss-w-pd-track", children: /* @__PURE__ */ jsx102("div", { className: `ss-w-pd-fill ss-w-pd-fill--${band(rank)}`, style: { width: `${rank}%` } }) })
|
|
10350
10456
|
] }, m.key);
|
|
10351
10457
|
})
|
|
10352
10458
|
] }, g);
|
|
10353
10459
|
});
|
|
10354
|
-
return /* @__PURE__ */
|
|
10355
|
-
/* @__PURE__ */
|
|
10356
|
-
/* @__PURE__ */
|
|
10357
|
-
/* @__PURE__ */
|
|
10460
|
+
return /* @__PURE__ */ jsxs86("div", { children: [
|
|
10461
|
+
/* @__PURE__ */ jsxs86("div", { className: "ss-w-pd-perf-head", children: [
|
|
10462
|
+
/* @__PURE__ */ jsx102("div", { className: "ss-w-pd-eyebrow", children: strings.perfTitle }),
|
|
10463
|
+
/* @__PURE__ */ jsx102("div", { className: "ss-w-pd-seg", role: "group", children: ["total", "per90"].map((m) => /* @__PURE__ */ jsx102("button", { type: "button", className: "ss-w-pd-seg-btn", "aria-pressed": mode === m, onClick: () => setMode(m), children: m === "total" ? strings.perfTotal : strings.perfPer90 }, m)) })
|
|
10358
10464
|
] }),
|
|
10359
|
-
subtitle !== null && /* @__PURE__ */
|
|
10360
|
-
/* @__PURE__ */
|
|
10465
|
+
subtitle !== null && /* @__PURE__ */ jsx102("div", { className: "ss-w-pd-perf-sub", children: subtitle }),
|
|
10466
|
+
/* @__PURE__ */ jsx102("div", { className: "ss-w-pd-perf-cards", children: cards })
|
|
10361
10467
|
] });
|
|
10362
10468
|
}
|
|
10363
10469
|
|
|
10364
10470
|
// src/components/PlayerDetail.tsx
|
|
10365
|
-
import { Fragment as
|
|
10471
|
+
import { Fragment as Fragment24, jsx as jsx103, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
10366
10472
|
var DASH = "\u2014";
|
|
10367
10473
|
function ageFrom(dobMs) {
|
|
10368
10474
|
if (dobMs === null) return DASH;
|
|
@@ -10382,16 +10488,16 @@ function ratingTone(rounded) {
|
|
|
10382
10488
|
return "neg";
|
|
10383
10489
|
}
|
|
10384
10490
|
function Bio({ label, value }) {
|
|
10385
|
-
return /* @__PURE__ */
|
|
10386
|
-
/* @__PURE__ */
|
|
10491
|
+
return /* @__PURE__ */ jsxs87("div", { className: "ss-w-pd-bio-item", children: [
|
|
10492
|
+
/* @__PURE__ */ jsx103("span", { className: "ss-w-pd-faint", children: label }),
|
|
10387
10493
|
" ",
|
|
10388
|
-
/* @__PURE__ */
|
|
10494
|
+
/* @__PURE__ */ jsx103("span", { children: value })
|
|
10389
10495
|
] });
|
|
10390
10496
|
}
|
|
10391
10497
|
function Tile({ label, value, pos }) {
|
|
10392
|
-
return /* @__PURE__ */
|
|
10393
|
-
/* @__PURE__ */
|
|
10394
|
-
/* @__PURE__ */
|
|
10498
|
+
return /* @__PURE__ */ jsxs87("div", { className: "ss-w-pd-tile", children: [
|
|
10499
|
+
/* @__PURE__ */ jsx103("div", { className: "ss-w-pd-tile-label", children: label }),
|
|
10500
|
+
/* @__PURE__ */ jsx103("div", { className: pos ? "ss-w-pd-tile-value ss-w-pd-pos-ink" : "ss-w-pd-tile-value", children: value })
|
|
10395
10501
|
] });
|
|
10396
10502
|
}
|
|
10397
10503
|
function AvailabilityCard({ ui, next, availability }) {
|
|
@@ -10407,12 +10513,12 @@ function AvailabilityCard({ ui, next, availability }) {
|
|
|
10407
10513
|
pill = availability.status === "injured" ? { text: ui.availabilityInjured, tone: "neg" } : availability.status === "suspended" ? { text: ui.availabilitySuspended, tone: "warn" } : { text: ui.availabilityUnavailable, tone: "warn" };
|
|
10408
10514
|
}
|
|
10409
10515
|
}
|
|
10410
|
-
return /* @__PURE__ */
|
|
10411
|
-
/* @__PURE__ */
|
|
10412
|
-
next !== null && /* @__PURE__ */
|
|
10413
|
-
note !== null && /* @__PURE__ */
|
|
10516
|
+
return /* @__PURE__ */ jsxs87("div", { className: "ss-w-pd-card ss-w-pd-avail", children: [
|
|
10517
|
+
/* @__PURE__ */ jsxs87("div", { className: "ss-w-pd-avail-text", children: [
|
|
10518
|
+
next !== null && /* @__PURE__ */ jsx103("div", { className: "ss-w-pd-avail-next", children: ui.availabilityNext(next.opponentName, next.isHome, validMs(next.kickoffUnixMs)) }),
|
|
10519
|
+
note !== null && /* @__PURE__ */ jsx103("div", { className: "ss-w-pd-avail-note", children: note })
|
|
10414
10520
|
] }),
|
|
10415
|
-
pill !== null && /* @__PURE__ */
|
|
10521
|
+
pill !== null && /* @__PURE__ */ jsx103("div", { className: `ss-w-pd-pill ss-w-pd-pill--${pill.tone}`, children: pill.text })
|
|
10416
10522
|
] });
|
|
10417
10523
|
}
|
|
10418
10524
|
function MatchRow({ ui, row }) {
|
|
@@ -10426,28 +10532,28 @@ function MatchRow({ ui, row }) {
|
|
|
10426
10532
|
const sub = [`${ui.resultLetter[row.result]} ${row.goalsFor}\u2013${row.goalsAgainst}`, `${row.minutes}\u2032`, ...extras].join(" \xB7 ");
|
|
10427
10533
|
const rating = typeof row.rating === "number" && Number.isFinite(row.rating) ? Math.round(row.rating * 10) / 10 : null;
|
|
10428
10534
|
const pillTone = row.result === "W" ? "pos" : row.result === "L" ? "neg" : "draw";
|
|
10429
|
-
return /* @__PURE__ */
|
|
10430
|
-
/* @__PURE__ */
|
|
10431
|
-
/* @__PURE__ */
|
|
10432
|
-
/* @__PURE__ */
|
|
10433
|
-
/* @__PURE__ */
|
|
10535
|
+
return /* @__PURE__ */ jsxs87("div", { className: "ss-w-pd-match", children: [
|
|
10536
|
+
/* @__PURE__ */ jsx103("div", { className: "ss-w-pd-match-date", children: date === null ? "" : ui.logShortDate(date) }),
|
|
10537
|
+
/* @__PURE__ */ jsxs87("div", { className: "ss-w-pd-match-main", children: [
|
|
10538
|
+
/* @__PURE__ */ jsx103("div", { className: "ss-w-pd-match-opp", children: ui.matchLogOpponent(row.opponentName, row.isHome) }),
|
|
10539
|
+
/* @__PURE__ */ jsx103("div", { className: "ss-w-pd-match-sub", children: sub })
|
|
10434
10540
|
] }),
|
|
10435
|
-
/* @__PURE__ */
|
|
10436
|
-
rating === null ? /* @__PURE__ */
|
|
10541
|
+
/* @__PURE__ */ jsx103("div", { className: `ss-w-pd-pill ss-w-pd-pill--${pillTone}`, children: ui.resultLetter[row.result] }),
|
|
10542
|
+
rating === null ? /* @__PURE__ */ jsx103("div", { className: "ss-w-pd-chip-empty" }) : /* @__PURE__ */ jsx103("div", { className: `ss-w-pd-chip ss-w-pd-chip--${ratingTone(rating)}`, children: rating.toFixed(1) })
|
|
10437
10543
|
] });
|
|
10438
10544
|
}
|
|
10439
10545
|
function PlayerDetail({ detail, loading, ui, seasonName, onClose }) {
|
|
10440
|
-
const back = /* @__PURE__ */
|
|
10441
|
-
/* @__PURE__ */
|
|
10546
|
+
const back = /* @__PURE__ */ jsxs87("button", { type: "button", className: "ss-w-pd-back", onClick: onClose, children: [
|
|
10547
|
+
/* @__PURE__ */ jsx103("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx103("path", { d: "M15 18l-6-6 6-6" }) }),
|
|
10442
10548
|
ui.clubPlayerBack
|
|
10443
10549
|
] });
|
|
10444
10550
|
if (detail === null) {
|
|
10445
|
-
return loading ? /* @__PURE__ */
|
|
10446
|
-
/* @__PURE__ */
|
|
10447
|
-
/* @__PURE__ */
|
|
10448
|
-
] }) : /* @__PURE__ */
|
|
10449
|
-
/* @__PURE__ */
|
|
10450
|
-
/* @__PURE__ */
|
|
10551
|
+
return loading ? /* @__PURE__ */ jsxs87(Fragment24, { children: [
|
|
10552
|
+
/* @__PURE__ */ jsx103("div", { className: "ss-w-pd-bar", children: back }),
|
|
10553
|
+
/* @__PURE__ */ jsx103("div", { className: "ss-w-mon-list" })
|
|
10554
|
+
] }) : /* @__PURE__ */ jsxs87(Fragment24, { children: [
|
|
10555
|
+
/* @__PURE__ */ jsx103("div", { className: "ss-w-pd-bar", children: back }),
|
|
10556
|
+
/* @__PURE__ */ jsx103("div", { className: "ss-w-mon-empty", children: ui.clubPlayerDetailEmpty })
|
|
10451
10557
|
] });
|
|
10452
10558
|
}
|
|
10453
10559
|
const s = detail.seasonStats;
|
|
@@ -10460,41 +10566,41 @@ function PlayerDetail({ detail, loading, ui, seasonName, onClose }) {
|
|
|
10460
10566
|
const next = detail.nextFixture ?? null;
|
|
10461
10567
|
const availability = detail.availability ?? null;
|
|
10462
10568
|
const log = detail.matchLog ?? [];
|
|
10463
|
-
return /* @__PURE__ */
|
|
10464
|
-
/* @__PURE__ */
|
|
10465
|
-
/* @__PURE__ */
|
|
10466
|
-
/* @__PURE__ */
|
|
10467
|
-
/* @__PURE__ */
|
|
10468
|
-
/* @__PURE__ */
|
|
10469
|
-
/* @__PURE__ */
|
|
10470
|
-
subLine !== "" && /* @__PURE__ */
|
|
10471
|
-
/* @__PURE__ */
|
|
10472
|
-
/* @__PURE__ */
|
|
10473
|
-
/* @__PURE__ */
|
|
10474
|
-
foot !== null && /* @__PURE__ */
|
|
10475
|
-
/* @__PURE__ */
|
|
10569
|
+
return /* @__PURE__ */ jsxs87(Fragment24, { children: [
|
|
10570
|
+
/* @__PURE__ */ jsx103("div", { className: "ss-w-pd-bar", children: back }),
|
|
10571
|
+
/* @__PURE__ */ jsxs87("div", { className: "ss-w-mon-list ss-w-pd-list", children: [
|
|
10572
|
+
/* @__PURE__ */ jsxs87("div", { className: "ss-w-pd-card ss-w-pd-profile", children: [
|
|
10573
|
+
/* @__PURE__ */ jsx103(PlayerPhoto, { photoUrl: detail.photoUrl, jerseyNumber: detail.jerseyNumber, size: 52 }, detail.photoUrl ?? ""),
|
|
10574
|
+
/* @__PURE__ */ jsxs87("div", { className: "ss-w-pd-profile-main", children: [
|
|
10575
|
+
/* @__PURE__ */ jsx103("div", { className: "ss-w-pd-name", children: detail.playerName }),
|
|
10576
|
+
subLine !== "" && /* @__PURE__ */ jsx103("div", { className: "ss-w-pd-sub", children: subLine }),
|
|
10577
|
+
/* @__PURE__ */ jsxs87("div", { className: "ss-w-pd-bio", children: [
|
|
10578
|
+
/* @__PURE__ */ jsx103(Bio, { label: ui.detailAge, value: ageFrom(detail.dateOfBirthUnixMs) }),
|
|
10579
|
+
/* @__PURE__ */ jsx103(Bio, { label: ui.detailHeight, value: detail.heightCm === null ? DASH : `${detail.heightCm} cm` }),
|
|
10580
|
+
foot !== null && /* @__PURE__ */ jsx103(Bio, { label: ui.detailFoot, value: foot }),
|
|
10581
|
+
/* @__PURE__ */ jsx103(Bio, { label: ui.detailNatShort, value: detail.nationality ?? DASH })
|
|
10476
10582
|
] })
|
|
10477
10583
|
] }),
|
|
10478
|
-
/* @__PURE__ */
|
|
10584
|
+
/* @__PURE__ */ jsx103(MiniPitch, { positionCode: detail.positionCode })
|
|
10479
10585
|
] }),
|
|
10480
|
-
(next !== null || availability !== null) && /* @__PURE__ */
|
|
10481
|
-
/* @__PURE__ */
|
|
10482
|
-
eyebrow !== null && /* @__PURE__ */
|
|
10483
|
-
/* @__PURE__ */
|
|
10484
|
-
/* @__PURE__ */
|
|
10485
|
-
/* @__PURE__ */
|
|
10486
|
-
typeof s.starts === "number" && /* @__PURE__ */
|
|
10487
|
-
/* @__PURE__ */
|
|
10488
|
-
/* @__PURE__ */
|
|
10489
|
-
rating !== null && /* @__PURE__ */
|
|
10490
|
-
/* @__PURE__ */
|
|
10491
|
-
/* @__PURE__ */
|
|
10586
|
+
(next !== null || availability !== null) && /* @__PURE__ */ jsx103(AvailabilityCard, { ui, next, availability }),
|
|
10587
|
+
/* @__PURE__ */ jsxs87("div", { children: [
|
|
10588
|
+
eyebrow !== null && /* @__PURE__ */ jsx103("div", { className: "ss-w-pd-eyebrow ss-w-pd-eyebrow--block", children: eyebrow }),
|
|
10589
|
+
/* @__PURE__ */ jsxs87("div", { className: "ss-w-pd-tiles", children: [
|
|
10590
|
+
/* @__PURE__ */ jsx103(Tile, { label: ui.statColGoals, value: String(s.goals) }),
|
|
10591
|
+
/* @__PURE__ */ jsx103(Tile, { label: ui.statColAssists, value: String(s.assists) }),
|
|
10592
|
+
typeof s.starts === "number" && /* @__PURE__ */ jsx103(Tile, { label: ui.detailStarted, value: String(s.starts) }),
|
|
10593
|
+
/* @__PURE__ */ jsx103(Tile, { label: ui.detailMatches, value: String(s.appearances) }),
|
|
10594
|
+
/* @__PURE__ */ jsx103(Tile, { label: ui.statColMinutes, value: String(s.minutesPlayed) }),
|
|
10595
|
+
rating !== null && /* @__PURE__ */ jsx103(Tile, { label: ui.statColRating, value: rating.toFixed(2), pos: Math.round(rating * 100) / 100 >= 7 }),
|
|
10596
|
+
/* @__PURE__ */ jsx103(Tile, { label: ui.detailYellows, value: String(s.yellowCards) }),
|
|
10597
|
+
/* @__PURE__ */ jsx103(Tile, { label: ui.detailReds, value: String(s.redCards) })
|
|
10492
10598
|
] })
|
|
10493
10599
|
] }),
|
|
10494
|
-
detail.performance != null && /* @__PURE__ */
|
|
10495
|
-
log.length > 0 && /* @__PURE__ */
|
|
10496
|
-
/* @__PURE__ */
|
|
10497
|
-
/* @__PURE__ */
|
|
10600
|
+
detail.performance != null && /* @__PURE__ */ jsx103(PerformanceBars, { performance: detail.performance, competitionName: competition, strings: ui }),
|
|
10601
|
+
log.length > 0 && /* @__PURE__ */ jsxs87("div", { children: [
|
|
10602
|
+
/* @__PURE__ */ jsx103("div", { className: "ss-w-pd-eyebrow ss-w-pd-eyebrow--block", children: ui.matchLogTitle }),
|
|
10603
|
+
/* @__PURE__ */ jsx103("div", { className: "ss-w-pd-card ss-w-pd-log", children: log.map((row) => /* @__PURE__ */ jsx103(MatchRow, { ui, row }, row.matchId)) })
|
|
10498
10604
|
] })
|
|
10499
10605
|
] })
|
|
10500
10606
|
] });
|
|
@@ -10502,12 +10608,12 @@ function PlayerDetail({ detail, loading, ui, seasonName, onClose }) {
|
|
|
10502
10608
|
|
|
10503
10609
|
// src/components/PresetSpeedDial.tsx
|
|
10504
10610
|
import { useId as useId10 } from "react";
|
|
10505
|
-
import { jsx as
|
|
10611
|
+
import { jsx as jsx104, jsxs as jsxs88 } from "react/jsx-runtime";
|
|
10506
10612
|
function PresetSpeedDial({ expanded, showDot, strings, onToggle, onOpen, rootRef, buttonRef }) {
|
|
10507
10613
|
const pillsId = useId10();
|
|
10508
10614
|
const tabIndex = expanded ? 0 : -1;
|
|
10509
|
-
return /* @__PURE__ */
|
|
10510
|
-
/* @__PURE__ */
|
|
10615
|
+
return /* @__PURE__ */ jsxs88("div", { ref: rootRef, className: "ss-w-dial", children: [
|
|
10616
|
+
/* @__PURE__ */ jsxs88(
|
|
10511
10617
|
"button",
|
|
10512
10618
|
{
|
|
10513
10619
|
ref: buttonRef,
|
|
@@ -10518,28 +10624,28 @@ function PresetSpeedDial({ expanded, showDot, strings, onToggle, onOpen, rootRef
|
|
|
10518
10624
|
"aria-label": strings.dialName,
|
|
10519
10625
|
onClick: onToggle,
|
|
10520
10626
|
children: [
|
|
10521
|
-
/* @__PURE__ */
|
|
10522
|
-
/* @__PURE__ */
|
|
10523
|
-
showDot && !expanded ? /* @__PURE__ */
|
|
10627
|
+
/* @__PURE__ */ jsx104("span", { className: "ss-w-dial-icon ss-w-dial-icon--open", children: /* @__PURE__ */ jsx104(SlidersIcon, {}) }),
|
|
10628
|
+
/* @__PURE__ */ jsx104("span", { className: "ss-w-dial-icon ss-w-dial-icon--close", children: /* @__PURE__ */ jsx104(CloseIcon, {}) }),
|
|
10629
|
+
showDot && !expanded ? /* @__PURE__ */ jsx104("span", { className: "ss-w-dial-dot", "aria-hidden": "true" }) : null
|
|
10524
10630
|
]
|
|
10525
10631
|
}
|
|
10526
10632
|
),
|
|
10527
|
-
/* @__PURE__ */
|
|
10528
|
-
/* @__PURE__ */
|
|
10529
|
-
/* @__PURE__ */
|
|
10530
|
-
/* @__PURE__ */
|
|
10633
|
+
/* @__PURE__ */ jsxs88("div", { id: pillsId, className: "ss-w-dial-pills", "data-open": expanded ? "" : void 0, children: [
|
|
10634
|
+
/* @__PURE__ */ jsxs88("button", { type: "button", className: "ss-w-dial-pill", tabIndex, onClick: () => onOpen("numbers"), children: [
|
|
10635
|
+
/* @__PURE__ */ jsx104(SlidersIcon, {}),
|
|
10636
|
+
/* @__PURE__ */ jsx104("span", { className: "ss-w-dial-pill-label", children: strings.setNumbers })
|
|
10531
10637
|
] }),
|
|
10532
|
-
/* @__PURE__ */
|
|
10533
|
-
/* @__PURE__ */
|
|
10534
|
-
/* @__PURE__ */
|
|
10638
|
+
/* @__PURE__ */ jsxs88("button", { type: "button", className: "ss-w-dial-pill", tabIndex, onClick: () => onOpen("combo"), children: [
|
|
10639
|
+
/* @__PURE__ */ jsx104(ComboIcon, {}),
|
|
10640
|
+
/* @__PURE__ */ jsx104("span", { className: "ss-w-dial-pill-label", children: strings.buildCombo })
|
|
10535
10641
|
] })
|
|
10536
10642
|
] })
|
|
10537
10643
|
] });
|
|
10538
10644
|
}
|
|
10539
10645
|
|
|
10540
10646
|
// src/components/PresetTools.tsx
|
|
10541
|
-
import { Fragment as
|
|
10542
|
-
import { Fragment as
|
|
10647
|
+
import { Fragment as Fragment25, useEffect as useEffect31, useId as useId11, useRef as useRef28, useState as useState53 } from "react";
|
|
10648
|
+
import { Fragment as Fragment26, jsx as jsx105, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
10543
10649
|
var FOCUSABLE = 'button:not([disabled]), [href], input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
10544
10650
|
function PresetToolModal({ title, closeLabel, onClose, children, footer }) {
|
|
10545
10651
|
const dialogRef = useRef28(null);
|
|
@@ -10577,79 +10683,79 @@ function PresetToolModal({ title, closeLabel, onClose, children, footer }) {
|
|
|
10577
10683
|
first.focus();
|
|
10578
10684
|
}
|
|
10579
10685
|
};
|
|
10580
|
-
return /* @__PURE__ */
|
|
10581
|
-
/* @__PURE__ */
|
|
10582
|
-
/* @__PURE__ */
|
|
10583
|
-
/* @__PURE__ */
|
|
10686
|
+
return /* @__PURE__ */ jsx105("div", { className: "ss-w-tool-backdrop", children: /* @__PURE__ */ jsxs89("div", { ref: dialogRef, className: "ss-w-tool", role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, tabIndex: -1, onKeyDown: trapTab, children: [
|
|
10687
|
+
/* @__PURE__ */ jsxs89("div", { className: "ss-w-tool-head", children: [
|
|
10688
|
+
/* @__PURE__ */ jsx105("h2", { id: titleId, className: "ss-w-tool-title", children: title }),
|
|
10689
|
+
/* @__PURE__ */ jsx105("button", { type: "button", className: "ss-w-tool-close", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ jsx105(CloseIcon, {}) })
|
|
10584
10690
|
] }),
|
|
10585
|
-
/* @__PURE__ */
|
|
10586
|
-
footer ? /* @__PURE__ */
|
|
10691
|
+
/* @__PURE__ */ jsx105("div", { className: "ss-w-tool-body", children }),
|
|
10692
|
+
footer ? /* @__PURE__ */ jsx105("div", { className: "ss-w-tool-foot", children: footer }) : null
|
|
10587
10693
|
] }) });
|
|
10588
10694
|
}
|
|
10589
10695
|
function fillTemplate(template, slots) {
|
|
10590
10696
|
return template.split(/(\{[a-z]+\})/).filter((part) => part !== "").map((part, i) => {
|
|
10591
10697
|
const key = /^\{([a-z]+)\}$/.exec(part)?.[1];
|
|
10592
|
-
return /* @__PURE__ */
|
|
10698
|
+
return /* @__PURE__ */ jsx105(Fragment25, { children: key !== void 0 && key in slots ? slots[key] : part }, i);
|
|
10593
10699
|
});
|
|
10594
10700
|
}
|
|
10595
10701
|
function NumberSelect({ current, choices: choices2, label, notToday, lockEmpty = true, onChoose }) {
|
|
10596
10702
|
const selected = Math.max(0, choices2.findIndex((c) => c.text === current));
|
|
10597
|
-
return /* @__PURE__ */
|
|
10598
|
-
/* @__PURE__ */
|
|
10599
|
-
/* @__PURE__ */
|
|
10703
|
+
return /* @__PURE__ */ jsxs89("span", { className: "ss-w-tool-num", children: [
|
|
10704
|
+
/* @__PURE__ */ jsx105("span", { className: "ss-w-tool-num-size", "aria-hidden": "true", children: current }),
|
|
10705
|
+
/* @__PURE__ */ jsx105("select", { className: "ss-w-tool-num-select", "aria-label": label, value: String(selected), onChange: (e) => {
|
|
10600
10706
|
const c = choices2[Number(e.target.value)];
|
|
10601
10707
|
if (c) onChoose(c.value);
|
|
10602
|
-
}, children: choices2.map((c, i) => /* @__PURE__ */
|
|
10708
|
+
}, children: choices2.map((c, i) => /* @__PURE__ */ jsx105("option", { value: String(i), disabled: lockEmpty && !c.available && i !== selected, children: c.available ? c.text : `${c.text}${notToday}` }, i)) })
|
|
10603
10709
|
] });
|
|
10604
10710
|
}
|
|
10605
10711
|
function ChoiceSelect({ currentIdx, sizeLabels, optionLabels, label, onChoose }) {
|
|
10606
10712
|
const sizeText = sizeLabels[currentIdx] ?? "";
|
|
10607
|
-
return /* @__PURE__ */
|
|
10608
|
-
/* @__PURE__ */
|
|
10609
|
-
/* @__PURE__ */
|
|
10713
|
+
return /* @__PURE__ */ jsxs89("span", { className: "ss-w-tool-num", children: [
|
|
10714
|
+
/* @__PURE__ */ jsx105("span", { className: "ss-w-tool-num-size", "aria-hidden": "true", children: sizeText }),
|
|
10715
|
+
/* @__PURE__ */ jsx105("select", { className: "ss-w-tool-num-select", "aria-label": label, value: String(currentIdx), onChange: (e) => onChoose(Number(e.target.value)), children: optionLabels.map((opt, i) => /* @__PURE__ */ jsx105("option", { value: String(i), children: opt }, i)) })
|
|
10610
10716
|
] });
|
|
10611
10717
|
}
|
|
10612
10718
|
function SendButton({ label, display, disabled, onClick }) {
|
|
10613
|
-
return /* @__PURE__ */
|
|
10719
|
+
return /* @__PURE__ */ jsx105("button", { type: "button", className: "ss-w-tool-send", "aria-label": `${label}: ${display}`, disabled, onClick, children: label });
|
|
10614
10720
|
}
|
|
10615
10721
|
function PickList({ picks, formatKickoff }) {
|
|
10616
|
-
return /* @__PURE__ */
|
|
10617
|
-
/* @__PURE__ */
|
|
10722
|
+
return /* @__PURE__ */ jsx105("ul", { className: "ss-w-tool-picks", role: "list", children: picks.map((p) => /* @__PURE__ */ jsxs89("li", { className: "ss-w-tool-pick", children: [
|
|
10723
|
+
/* @__PURE__ */ jsxs89("span", { className: "ss-w-tool-pick-match", children: [
|
|
10618
10724
|
p.homeTeamName,
|
|
10619
10725
|
" \u2013 ",
|
|
10620
10726
|
p.awayTeamName
|
|
10621
10727
|
] }),
|
|
10622
|
-
/* @__PURE__ */
|
|
10728
|
+
/* @__PURE__ */ jsxs89("span", { className: "ss-w-tool-pick-sel", children: [
|
|
10623
10729
|
p.marketLabel,
|
|
10624
10730
|
": ",
|
|
10625
10731
|
p.selectionLabel,
|
|
10626
10732
|
p.line ? ` ${p.line}` : ""
|
|
10627
10733
|
] }),
|
|
10628
|
-
/* @__PURE__ */
|
|
10629
|
-
/* @__PURE__ */
|
|
10734
|
+
/* @__PURE__ */ jsx105("span", { className: "ss-w-tool-pick-kick", children: formatKickoff(p.kickoffUtc) }),
|
|
10735
|
+
/* @__PURE__ */ jsx105("span", { className: "ss-w-tool-pick-price", children: p.price.toFixed(2) })
|
|
10630
10736
|
] }, p.matchOddsId)) });
|
|
10631
10737
|
}
|
|
10632
10738
|
function ComboPreview({ cell, formatKickoff }) {
|
|
10633
|
-
return /* @__PURE__ */
|
|
10634
|
-
/* @__PURE__ */
|
|
10635
|
-
/* @__PURE__ */
|
|
10739
|
+
return /* @__PURE__ */ jsxs89(Fragment26, { children: [
|
|
10740
|
+
/* @__PURE__ */ jsx105(PickList, { picks: cell.combo.legs, formatKickoff }),
|
|
10741
|
+
/* @__PURE__ */ jsx105("div", { className: "ss-w-tool-math", children: cell.combo.multiplication })
|
|
10636
10742
|
] });
|
|
10637
10743
|
}
|
|
10638
10744
|
function Unavailable({ text }) {
|
|
10639
|
-
return /* @__PURE__ */
|
|
10745
|
+
return /* @__PURE__ */ jsx105("p", { className: "ss-w-tool-unavailable", children: text });
|
|
10640
10746
|
}
|
|
10641
10747
|
function AskRow({ icon, ask, ready, send }) {
|
|
10642
|
-
return /* @__PURE__ */
|
|
10643
|
-
/* @__PURE__ */
|
|
10644
|
-
/* @__PURE__ */
|
|
10645
|
-
/* @__PURE__ */
|
|
10646
|
-
ready ? /* @__PURE__ */
|
|
10748
|
+
return /* @__PURE__ */ jsxs89("section", { className: "ss-w-tool-row ss-w-tool-row--ask", children: [
|
|
10749
|
+
/* @__PURE__ */ jsx105("span", { className: "ss-w-tool-icon", "aria-hidden": "true", children: icon }),
|
|
10750
|
+
/* @__PURE__ */ jsxs89("div", { className: "ss-w-tool-main", children: [
|
|
10751
|
+
/* @__PURE__ */ jsx105("p", { className: "ss-w-tool-ask", children: ask }),
|
|
10752
|
+
ready ? /* @__PURE__ */ jsx105("span", { className: "ss-w-tool-ready", children: ready }) : null
|
|
10647
10753
|
] }),
|
|
10648
10754
|
send
|
|
10649
10755
|
] });
|
|
10650
10756
|
}
|
|
10651
10757
|
function RoundSend({ label, display, disabled, onClick }) {
|
|
10652
|
-
return /* @__PURE__ */
|
|
10758
|
+
return /* @__PURE__ */ jsx105("button", { type: "button", className: "ss-w-tool-go", "aria-label": `${label}: ${display}`, disabled, onClick, children: /* @__PURE__ */ jsx105(SendIcon, {}) });
|
|
10653
10759
|
}
|
|
10654
10760
|
var BIG_COMBO = { total: 50, legs: 6 };
|
|
10655
10761
|
function SetNumbersTool({ grid, strings, streaming, onSend, onClose }) {
|
|
@@ -10658,15 +10764,15 @@ function SetNumbersTool({ grid, strings, streaming, onSend, onClose }) {
|
|
|
10658
10764
|
const totals = comboTotals(grid);
|
|
10659
10765
|
const legChoices = comboLegChoices(grid);
|
|
10660
10766
|
const count = FIXED_SINGLES_COUNT;
|
|
10661
|
-
const [maxPrice, setMaxPrice] =
|
|
10662
|
-
const [minPrice, setMinPrice] =
|
|
10663
|
-
const [start] =
|
|
10664
|
-
const [total, setTotal] =
|
|
10665
|
-
const [legs, setLegs] =
|
|
10666
|
-
const [bigStart] =
|
|
10667
|
-
const [bigTotal, setBigTotal] =
|
|
10668
|
-
const [bigLegs, setBigLegs] =
|
|
10669
|
-
const [announcement, setAnnouncement] =
|
|
10767
|
+
const [maxPrice, setMaxPrice] = useState53(() => startSingles(grid.singles, limits, START.maxPrice, count));
|
|
10768
|
+
const [minPrice, setMinPrice] = useState53(() => startSingles(grid.singlesFrom, floors, START.minPrice, count));
|
|
10769
|
+
const [start] = useState53(() => startCombo(grid, totals, legChoices, START.comboTotal, START.comboLegs));
|
|
10770
|
+
const [total, setTotal] = useState53(start.total);
|
|
10771
|
+
const [legs, setLegs] = useState53(start.legs);
|
|
10772
|
+
const [bigStart] = useState53(() => startCombo(grid, totals, legChoices, BIG_COMBO.total, BIG_COMBO.legs));
|
|
10773
|
+
const [bigTotal, setBigTotal] = useState53(bigStart.total);
|
|
10774
|
+
const [bigLegs, setBigLegs] = useState53(bigStart.legs);
|
|
10775
|
+
const [announcement, setAnnouncement] = useState53("");
|
|
10670
10776
|
const maxCell = findSingles(grid.singles, maxPrice, count);
|
|
10671
10777
|
const minCell = findSingles(grid.singlesFrom, minPrice, count);
|
|
10672
10778
|
const comboCell = findCombo(grid, total, legs);
|
|
@@ -10710,95 +10816,95 @@ function SetNumbersTool({ grid, strings, streaming, onSend, onClose }) {
|
|
|
10710
10816
|
const totalChoices = totals.map((v) => ({ value: v, text: v.toFixed(1), available: legChoices.some((n) => !!findCombo(grid, v, n)) }));
|
|
10711
10817
|
const legChoicesFor = (t) => legChoices.map((n) => ({ value: n, text: String(n), available: !!findCombo(grid, t, n) }));
|
|
10712
10818
|
const markets = grid.markets ?? [];
|
|
10713
|
-
const [marketIdx, setMarketIdx] =
|
|
10819
|
+
const [marketIdx, setMarketIdx] = useState53(0);
|
|
10714
10820
|
const marketCell = markets[marketIdx] ?? null;
|
|
10715
10821
|
const marketLabels = markets.map((c) => strings.marketShort(c.marketDeveloperName, c.marketLabel, c.selectionLabel ?? null));
|
|
10716
10822
|
const singlesReady = (cell) => cell ? strings.readyCount(cell.picks.length) : strings.unavailable;
|
|
10717
10823
|
const comboReady = (cell) => cell ? strings.readyAt(cell.combo.total) : strings.unavailable;
|
|
10718
|
-
return /* @__PURE__ */
|
|
10719
|
-
/* @__PURE__ */
|
|
10824
|
+
return /* @__PURE__ */ jsxs89(PresetToolModal, { title: strings.setNumbers, closeLabel: strings.close, onClose, children: [
|
|
10825
|
+
/* @__PURE__ */ jsx105(
|
|
10720
10826
|
AskRow,
|
|
10721
10827
|
{
|
|
10722
10828
|
icon: "\u{1F3AF}",
|
|
10723
10829
|
ask: fillTemplate(strings.maxPriceRow, {
|
|
10724
10830
|
count: String(count),
|
|
10725
|
-
price: /* @__PURE__ */
|
|
10831
|
+
price: /* @__PURE__ */ jsx105(NumberSelect, { current: maxPrice.toFixed(2), choices: maxChoices, label: strings.maxPriceName, notToday: strings.notToday, onChoose: chooseMax })
|
|
10726
10832
|
}),
|
|
10727
10833
|
ready: singlesReady(maxCell),
|
|
10728
|
-
send: /* @__PURE__ */
|
|
10834
|
+
send: /* @__PURE__ */ jsx105(RoundSend, { label: strings.send, display: strings.maxPriceDisplay(count, maxPrice), disabled: !maxCell || streaming, onClick: () => {
|
|
10729
10835
|
if (maxCell) onSend(maxPriceAsk(maxCell, strings));
|
|
10730
10836
|
} })
|
|
10731
10837
|
}
|
|
10732
10838
|
),
|
|
10733
|
-
/* @__PURE__ */
|
|
10839
|
+
/* @__PURE__ */ jsx105(
|
|
10734
10840
|
AskRow,
|
|
10735
10841
|
{
|
|
10736
10842
|
icon: "\u{1F4C8}",
|
|
10737
10843
|
ask: fillTemplate(strings.minPriceRow, {
|
|
10738
10844
|
count: String(count),
|
|
10739
|
-
price: /* @__PURE__ */
|
|
10845
|
+
price: /* @__PURE__ */ jsx105(NumberSelect, { current: minPrice.toFixed(2), choices: minChoices, label: strings.minPriceName, notToday: strings.notToday, onChoose: chooseMin })
|
|
10740
10846
|
}),
|
|
10741
10847
|
ready: singlesReady(minCell),
|
|
10742
|
-
send: /* @__PURE__ */
|
|
10848
|
+
send: /* @__PURE__ */ jsx105(RoundSend, { label: strings.send, display: strings.minPriceDisplay(count, minPrice), disabled: !minCell || streaming, onClick: () => {
|
|
10743
10849
|
if (minCell) onSend(minPriceAsk(minCell, strings));
|
|
10744
10850
|
} })
|
|
10745
10851
|
}
|
|
10746
10852
|
),
|
|
10747
|
-
/* @__PURE__ */
|
|
10853
|
+
/* @__PURE__ */ jsx105(
|
|
10748
10854
|
AskRow,
|
|
10749
10855
|
{
|
|
10750
10856
|
icon: "\u2728",
|
|
10751
10857
|
ask: fillTemplate(strings.comboRow, {
|
|
10752
|
-
legs: /* @__PURE__ */
|
|
10753
|
-
total: /* @__PURE__ */
|
|
10858
|
+
legs: /* @__PURE__ */ jsx105(NumberSelect, { current: String(legs), choices: legChoicesFor(total), label: strings.matchesLabel, notToday: strings.notToday, lockEmpty: false, onChoose: chooseLegs }),
|
|
10859
|
+
total: /* @__PURE__ */ jsx105(NumberSelect, { current: total.toFixed(1), choices: totalChoices, label: strings.totalLabel, notToday: strings.notToday, onChoose: chooseTotal })
|
|
10754
10860
|
}),
|
|
10755
10861
|
ready: comboReady(comboCell),
|
|
10756
|
-
send: /* @__PURE__ */
|
|
10862
|
+
send: /* @__PURE__ */ jsx105(RoundSend, { label: strings.send, display: strings.comboDisplay(legs, total), disabled: !comboCell || streaming, onClick: () => {
|
|
10757
10863
|
if (comboCell) onSend(comboAsk(comboCell, strings));
|
|
10758
10864
|
} })
|
|
10759
10865
|
}
|
|
10760
10866
|
),
|
|
10761
|
-
/* @__PURE__ */
|
|
10867
|
+
/* @__PURE__ */ jsx105(
|
|
10762
10868
|
AskRow,
|
|
10763
10869
|
{
|
|
10764
10870
|
icon: "\u{1F3C6}",
|
|
10765
10871
|
ask: fillTemplate(strings.bigComboRow, {
|
|
10766
|
-
legs: /* @__PURE__ */
|
|
10767
|
-
total: /* @__PURE__ */
|
|
10872
|
+
legs: /* @__PURE__ */ jsx105(NumberSelect, { current: String(bigLegs), choices: legChoicesFor(bigTotal), label: strings.matchesLabel, notToday: strings.notToday, lockEmpty: false, onChoose: chooseBigLegs }),
|
|
10873
|
+
total: /* @__PURE__ */ jsx105(NumberSelect, { current: bigTotal.toFixed(1), choices: totalChoices, label: strings.totalLabel, notToday: strings.notToday, onChoose: chooseBigTotal })
|
|
10768
10874
|
}),
|
|
10769
10875
|
ready: comboReady(bigCell),
|
|
10770
|
-
send: /* @__PURE__ */
|
|
10876
|
+
send: /* @__PURE__ */ jsx105(RoundSend, { label: strings.send, display: strings.comboDisplay(bigLegs, bigTotal), disabled: !bigCell || streaming, onClick: () => {
|
|
10771
10877
|
if (bigCell) onSend(comboAsk(bigCell, strings));
|
|
10772
10878
|
} })
|
|
10773
10879
|
}
|
|
10774
10880
|
),
|
|
10775
|
-
markets.length > 0 && /* @__PURE__ */
|
|
10881
|
+
markets.length > 0 && /* @__PURE__ */ jsx105(
|
|
10776
10882
|
AskRow,
|
|
10777
10883
|
{
|
|
10778
10884
|
icon: "\u26BD",
|
|
10779
10885
|
ask: fillTemplate(strings.marketRow, {
|
|
10780
|
-
market: /* @__PURE__ */
|
|
10886
|
+
market: /* @__PURE__ */ jsx105(ChoiceSelect, { currentIdx: marketIdx, sizeLabels: marketLabels, optionLabels: marketLabels, label: strings.marketName, onChoose: chooseMarket })
|
|
10781
10887
|
}),
|
|
10782
10888
|
ready: marketCell ? strings.readyCount(marketCell.count) : null,
|
|
10783
|
-
send: /* @__PURE__ */
|
|
10889
|
+
send: /* @__PURE__ */ jsx105(RoundSend, { label: strings.send, display: marketCell ? marketDisplay(marketCell, strings) : "", disabled: !marketCell || streaming, onClick: () => {
|
|
10784
10890
|
if (marketCell) onSend(marketAsk(marketCell, strings));
|
|
10785
10891
|
} })
|
|
10786
10892
|
}
|
|
10787
10893
|
),
|
|
10788
|
-
/* @__PURE__ */
|
|
10894
|
+
/* @__PURE__ */ jsx105("p", { className: "ss-w-vh", "aria-live": "polite", children: announcement })
|
|
10789
10895
|
] });
|
|
10790
10896
|
}
|
|
10791
10897
|
function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal, initialLegs, onSend, onClose }) {
|
|
10792
10898
|
const totals = comboTotals(grid);
|
|
10793
10899
|
const legChoices = comboLegChoices(grid);
|
|
10794
|
-
const [start] =
|
|
10795
|
-
const [total, setTotal] =
|
|
10796
|
-
const [legs, setLegs] =
|
|
10900
|
+
const [start] = useState53(() => initialTotal === void 0 ? startCombo(grid, totals, legChoices, START.comboTotal, START.comboLegs) : null);
|
|
10901
|
+
const [total, setTotal] = useState53(() => initialTotal !== void 0 ? nearest(totals, initialTotal) : start.total);
|
|
10902
|
+
const [legs, setLegs] = useState53(() => {
|
|
10797
10903
|
if (initialTotal === void 0) return initialLegs !== void 0 ? clampLegs(legChoices, initialLegs) : start.legs;
|
|
10798
10904
|
const from = initialLegs !== void 0 ? clampLegs(legChoices, initialLegs) : startValue(legChoices, START.comboLegs);
|
|
10799
10905
|
return legsForTotal(grid, nearest(totals, initialTotal), from);
|
|
10800
10906
|
});
|
|
10801
|
-
const [announcement, setAnnouncement] =
|
|
10907
|
+
const [announcement, setAnnouncement] = useState53("");
|
|
10802
10908
|
const cell = findCombo(grid, total, legs);
|
|
10803
10909
|
const minLegs = legChoices[0] ?? legs;
|
|
10804
10910
|
const maxLegs = legChoices[legChoices.length - 1] ?? legs;
|
|
@@ -10809,29 +10915,29 @@ function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal,
|
|
|
10809
10915
|
const d = strings.comboDisplay(nextLegs, nextTotal);
|
|
10810
10916
|
setAnnouncement(findCombo(grid, nextTotal, nextLegs) ? d : `${d}. ${strings.unavailable}`);
|
|
10811
10917
|
};
|
|
10812
|
-
const footer = /* @__PURE__ */
|
|
10918
|
+
const footer = /* @__PURE__ */ jsx105(SendButton, { label: strings.send, display, disabled: !cell || streaming, onClick: () => {
|
|
10813
10919
|
if (cell) onSend(comboAsk(cell, strings));
|
|
10814
10920
|
} });
|
|
10815
|
-
return /* @__PURE__ */
|
|
10816
|
-
/* @__PURE__ */
|
|
10817
|
-
/* @__PURE__ */
|
|
10818
|
-
/* @__PURE__ */
|
|
10921
|
+
return /* @__PURE__ */ jsxs89(PresetToolModal, { title: strings.buildCombo, closeLabel: strings.close, onClose, footer, children: [
|
|
10922
|
+
/* @__PURE__ */ jsxs89("div", { className: "ss-w-tool-section", role: "group", "aria-label": strings.totalLabel, children: [
|
|
10923
|
+
/* @__PURE__ */ jsx105("span", { className: "ss-w-tool-label", "aria-hidden": "true", children: strings.totalLabel }),
|
|
10924
|
+
/* @__PURE__ */ jsx105("div", { className: "ss-w-tool-chips", children: totals.map((t) => /* @__PURE__ */ jsx105("button", { type: "button", className: "ss-w-tool-chip", "aria-pressed": samePrice(t, total), onClick: () => choose(t, samePrice(t, total) ? legs : legsForTotal(grid, t, legs)), children: t.toFixed(1) }, t)) })
|
|
10819
10925
|
] }),
|
|
10820
|
-
/* @__PURE__ */
|
|
10821
|
-
/* @__PURE__ */
|
|
10822
|
-
/* @__PURE__ */
|
|
10823
|
-
/* @__PURE__ */
|
|
10824
|
-
/* @__PURE__ */
|
|
10825
|
-
/* @__PURE__ */
|
|
10926
|
+
/* @__PURE__ */ jsxs89("div", { className: "ss-w-tool-section", role: "group", "aria-label": strings.matchesLabel, children: [
|
|
10927
|
+
/* @__PURE__ */ jsx105("span", { className: "ss-w-tool-label", "aria-hidden": "true", children: strings.matchesLabel }),
|
|
10928
|
+
/* @__PURE__ */ jsxs89("div", { className: "ss-w-tool-stepper", children: [
|
|
10929
|
+
/* @__PURE__ */ jsx105("button", { type: "button", className: "ss-w-tool-step", "aria-label": strings.fewerMatches, disabled: legs <= minLegs, onClick: () => choose(total, legs - 1), children: "\u2212" }),
|
|
10930
|
+
/* @__PURE__ */ jsx105("span", { className: "ss-w-tool-count", children: legs }),
|
|
10931
|
+
/* @__PURE__ */ jsx105("button", { type: "button", className: "ss-w-tool-step", "aria-label": strings.moreMatches, disabled: legs >= maxLegs, onClick: () => choose(total, legs + 1), children: "+" })
|
|
10826
10932
|
] })
|
|
10827
10933
|
] }),
|
|
10828
|
-
cell ? /* @__PURE__ */
|
|
10829
|
-
/* @__PURE__ */
|
|
10934
|
+
cell ? /* @__PURE__ */ jsx105(ComboPreview, { cell, formatKickoff }) : /* @__PURE__ */ jsx105(Unavailable, { text: strings.unavailable }),
|
|
10935
|
+
/* @__PURE__ */ jsx105("p", { className: "ss-w-vh", "aria-live": "polite", children: announcement })
|
|
10830
10936
|
] });
|
|
10831
10937
|
}
|
|
10832
10938
|
|
|
10833
10939
|
// src/usePresetDial.ts
|
|
10834
|
-
import { useCallback as useCallback21, useEffect as useEffect32, useRef as useRef29, useState as
|
|
10940
|
+
import { useCallback as useCallback21, useEffect as useEffect32, useRef as useRef29, useState as useState54 } from "react";
|
|
10835
10941
|
function sendInFlight(messages, isStreaming) {
|
|
10836
10942
|
const last = messages[messages.length - 1];
|
|
10837
10943
|
return isStreaming && !!last && last.role === "assistant" && !last.done && !last.isGreeting;
|
|
@@ -10845,7 +10951,7 @@ function lastUserId(messages) {
|
|
|
10845
10951
|
}
|
|
10846
10952
|
var SCROLL_KEYS = /* @__PURE__ */ new Set(["ArrowUp", "ArrowDown", "PageUp", "PageDown", "Home", "End", " "]);
|
|
10847
10953
|
function usePresetDial({ layerRef, dialRef, dialButtonRef, messages, isStreaming, activeTab }) {
|
|
10848
|
-
const [expanded, setExpanded] =
|
|
10954
|
+
const [expanded, setExpanded] = useState54(() => !sendInFlight(messages, isStreaming));
|
|
10849
10955
|
const fold = useCallback21(() => setExpanded(false), []);
|
|
10850
10956
|
const toggle = useCallback21(() => setExpanded((e) => !e), []);
|
|
10851
10957
|
const currentUserId = lastUserId(messages);
|
|
@@ -10928,10 +11034,10 @@ function markToolSeen() {
|
|
|
10928
11034
|
}
|
|
10929
11035
|
|
|
10930
11036
|
// src/components/ChatPanel.tsx
|
|
10931
|
-
import { Fragment as
|
|
11037
|
+
import { Fragment as Fragment27, jsx as jsx106, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
10932
11038
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
10933
11039
|
function useIsModal() {
|
|
10934
|
-
const [modal, setModal] =
|
|
11040
|
+
const [modal, setModal] = useState55(false);
|
|
10935
11041
|
useEffect33(() => {
|
|
10936
11042
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
10937
11043
|
const mql = window.matchMedia(FULLSCREEN_QUERY);
|
|
@@ -10946,8 +11052,8 @@ var HIDDEN_LAYER_STYLE = { position: "absolute", inset: 0, visibility: "hidden",
|
|
|
10946
11052
|
var SQUAD_LAYER_STYLE = { display: "flex", flexDirection: "column", flex: 1, minHeight: 0 };
|
|
10947
11053
|
function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, gamesResult, leaderboardResult, clubFixturesResult, clubStandingsResult, clubSquadResult, clubSquadStatsResult, clubPlayerDetailResult, loggedIn, conversation, presetGrid }) {
|
|
10948
11054
|
const { state, close, stop, send, reset } = controller;
|
|
10949
|
-
const [squadView, setSquadView] =
|
|
10950
|
-
const [selectedPlayerId, setSelectedPlayerId] =
|
|
11055
|
+
const [squadView, setSquadView] = useState55("roster");
|
|
11056
|
+
const [selectedPlayerId, setSelectedPlayerId] = useState55(null);
|
|
10951
11057
|
const clearPlayerDetail = clubPlayerDetailResult?.clear;
|
|
10952
11058
|
const fetchPlayerDetail = clubPlayerDetailResult?.fetch;
|
|
10953
11059
|
const squadLayerRef = useRef30(null);
|
|
@@ -11001,8 +11107,8 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
11001
11107
|
const limitRef = useRef30(null);
|
|
11002
11108
|
const typedSendRef = useRef30(false);
|
|
11003
11109
|
const focusAfterCloseRef = useRef30(null);
|
|
11004
|
-
const [tool, setTool] =
|
|
11005
|
-
const [toolSeen, setToolSeen] =
|
|
11110
|
+
const [tool, setTool] = useState55(null);
|
|
11111
|
+
const [toolSeen, setToolSeen] = useState55(readToolSeen);
|
|
11006
11112
|
const dial = usePresetDial({
|
|
11007
11113
|
layerRef,
|
|
11008
11114
|
dialRef,
|
|
@@ -11059,8 +11165,8 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
11059
11165
|
focusAfterCloseRef.current = "composer";
|
|
11060
11166
|
setTool(null);
|
|
11061
11167
|
}, [tool, onChatTab, presetGrid]);
|
|
11062
|
-
return /* @__PURE__ */
|
|
11063
|
-
/* @__PURE__ */
|
|
11168
|
+
return /* @__PURE__ */ jsxs90("div", { className: "ss-w-panel", role: "dialog", "aria-modal": isModal, "aria-label": ui.chatDialogLabel, children: [
|
|
11169
|
+
/* @__PURE__ */ jsx106(
|
|
11064
11170
|
ChatHeader,
|
|
11065
11171
|
{
|
|
11066
11172
|
onClose: close,
|
|
@@ -11073,7 +11179,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
11073
11179
|
moreOptionsLabel: ui.moreOptions
|
|
11074
11180
|
}
|
|
11075
11181
|
),
|
|
11076
|
-
monitor && /* @__PURE__ */
|
|
11182
|
+
monitor && /* @__PURE__ */ jsx106(
|
|
11077
11183
|
TabBar,
|
|
11078
11184
|
{
|
|
11079
11185
|
monitor,
|
|
@@ -11086,9 +11192,9 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
11086
11192
|
clubEnabled: clubFixturesResult?.enabled ?? false
|
|
11087
11193
|
}
|
|
11088
11194
|
),
|
|
11089
|
-
/* @__PURE__ */
|
|
11090
|
-
/* @__PURE__ */
|
|
11091
|
-
showDial ? /* @__PURE__ */
|
|
11195
|
+
/* @__PURE__ */ jsxs90("div", { ref: layerRef, className: "ss-w-chat-layer", "data-dial": presetGrid ? "" : void 0, style: onChatTab ? void 0 : HIDDEN_LAYER_STYLE, children: [
|
|
11196
|
+
/* @__PURE__ */ jsx106(PresetToolsContext.Provider, { value: toolsValue, children: /* @__PURE__ */ jsx106(MessageList, { controller, ui, slip, onDashboardTap, monitor }) }),
|
|
11197
|
+
showDial ? /* @__PURE__ */ jsx106(
|
|
11092
11198
|
PresetSpeedDial,
|
|
11093
11199
|
{
|
|
11094
11200
|
expanded: dial.expanded,
|
|
@@ -11100,21 +11206,21 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
11100
11206
|
buttonRef: dialButtonRef
|
|
11101
11207
|
}
|
|
11102
11208
|
) : null,
|
|
11103
|
-
tool && presetGrid && onChatTab && !paused ? tool.kind === "numbers" ? /* @__PURE__ */
|
|
11209
|
+
tool && presetGrid && onChatTab && !paused ? tool.kind === "numbers" ? /* @__PURE__ */ jsx106(SetNumbersTool, { grid: presetGrid, strings: ui.presets, streaming: state.isStreaming, onSend: sendAsk, onClose: closeTool }) : /* @__PURE__ */ jsx106(BuildComboTool, { grid: presetGrid, strings: ui.presets, streaming: state.isStreaming, formatKickoff, initialTotal: tool.total, initialLegs: tool.legs, onSend: sendAsk, onClose: closeTool }) : null
|
|
11104
11210
|
] }),
|
|
11105
|
-
monitor && discovery && monitor.activeTab === "today" && /* @__PURE__ */
|
|
11106
|
-
monitor && monitor.activeTab === "following" && /* @__PURE__ */
|
|
11107
|
-
monitor && monitor.activeTab === "odds" && /* @__PURE__ */
|
|
11108
|
-
monitor && monitor.activeTab === "fixtures" && /* @__PURE__ */
|
|
11109
|
-
monitor && monitor.activeTab === "standings" && /* @__PURE__ */
|
|
11110
|
-
monitor && monitor.activeTab === "squad" && /* @__PURE__ */
|
|
11111
|
-
/* @__PURE__ */
|
|
11211
|
+
monitor && discovery && monitor.activeTab === "today" && /* @__PURE__ */ jsx106(TodayPanel, { discovery, ui, monitor }),
|
|
11212
|
+
monitor && monitor.activeTab === "following" && /* @__PURE__ */ jsx106(MatchesPanel, { monitor, ui, slip, onAsk: paused ? void 0 : handleAsk }),
|
|
11213
|
+
monitor && monitor.activeTab === "odds" && /* @__PURE__ */ jsx106(OddsPanel, { monitor, ui, slip }),
|
|
11214
|
+
monitor && monitor.activeTab === "fixtures" && /* @__PURE__ */ jsx106(Fixtures, { fixtures: clubFixturesResult?.fixtures ?? [], loading: clubFixturesResult?.loading ?? false, ui }),
|
|
11215
|
+
monitor && monitor.activeTab === "standings" && /* @__PURE__ */ jsx106(Standings, { standings: clubStandingsResult?.data ?? null, loading: clubStandingsResult?.loading ?? false, ui }),
|
|
11216
|
+
monitor && monitor.activeTab === "squad" && /* @__PURE__ */ jsxs90(Fragment27, { children: [
|
|
11217
|
+
/* @__PURE__ */ jsx106(
|
|
11112
11218
|
"div",
|
|
11113
11219
|
{
|
|
11114
11220
|
ref: squadLayerRef,
|
|
11115
11221
|
style: selectedPlayerId === null ? SQUAD_LAYER_STYLE : HIDDEN_LAYER_STYLE,
|
|
11116
11222
|
"aria-hidden": selectedPlayerId !== null ? true : void 0,
|
|
11117
|
-
children: /* @__PURE__ */
|
|
11223
|
+
children: /* @__PURE__ */ jsx106(
|
|
11118
11224
|
Squad,
|
|
11119
11225
|
{
|
|
11120
11226
|
squad: clubSquadResult?.data ?? null,
|
|
@@ -11132,9 +11238,9 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
11132
11238
|
)
|
|
11133
11239
|
}
|
|
11134
11240
|
),
|
|
11135
|
-
selectedPlayerId !== null && /* @__PURE__ */
|
|
11241
|
+
selectedPlayerId !== null && /* @__PURE__ */ jsx106(PlayerDetail, { detail: clubPlayerDetailResult?.data ?? null, loading: clubPlayerDetailResult?.loading ?? false, ui, seasonName: clubSquadStatsResult?.seasonName ?? null, onClose: closePlayer })
|
|
11136
11242
|
] }),
|
|
11137
|
-
monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */
|
|
11243
|
+
monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */ jsx106(
|
|
11138
11244
|
GamesPanel,
|
|
11139
11245
|
{
|
|
11140
11246
|
loggedIn: !!loggedIn,
|
|
@@ -11149,9 +11255,9 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
11149
11255
|
}
|
|
11150
11256
|
}
|
|
11151
11257
|
),
|
|
11152
|
-
(!monitor || monitor.activeTab !== "games") && /* @__PURE__ */
|
|
11153
|
-
/* @__PURE__ */
|
|
11154
|
-
paused ? null : /* @__PURE__ */
|
|
11258
|
+
(!monitor || monitor.activeTab !== "games") && /* @__PURE__ */ jsxs90(Fragment27, { children: [
|
|
11259
|
+
/* @__PURE__ */ jsx106("div", { ref: limitRef, className: "ss-w-limit", role: "status", tabIndex: -1, children: state.limit ? limitText(state.limit, ui) : null }),
|
|
11260
|
+
paused ? null : /* @__PURE__ */ jsx106(
|
|
11155
11261
|
ChatInput,
|
|
11156
11262
|
{
|
|
11157
11263
|
ref: inputRef,
|
|
@@ -11170,9 +11276,9 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
11170
11276
|
}
|
|
11171
11277
|
|
|
11172
11278
|
// src/components/HostEventsProvider.tsx
|
|
11173
|
-
import { jsx as
|
|
11279
|
+
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
11174
11280
|
function HostEventsProvider({ value, children }) {
|
|
11175
|
-
return /* @__PURE__ */
|
|
11281
|
+
return /* @__PURE__ */ jsx107(SlipStateContext.Provider, { value: value.slipState, children });
|
|
11176
11282
|
}
|
|
11177
11283
|
|
|
11178
11284
|
// src/styles/css.generated.ts
|
|
@@ -12286,6 +12392,41 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
12286
12392
|
.ss-w-mon-scorers-home { text-align: right; }
|
|
12287
12393
|
.ss-w-mon-scorers-away { text-align: left; }
|
|
12288
12394
|
.ss-w-mon-scorers-ball { flex: none; align-self: start; line-height: 1.35; }
|
|
12395
|
+
|
|
12396
|
+
/* Pinned pre-match form + head-to-head (MonitorFormH2H): collapsed by default, a real <button>
|
|
12397
|
+
header toggles it. W/D/L dots and the H2H bar/legend keep fixed, theme-independent colors
|
|
12398
|
+
(same convention as the dashboard tile accents above) since they're self-contained badges
|
|
12399
|
+
carrying their own ink color, not page-background-dependent text. */
|
|
12400
|
+
.ss-w-h2h { border-left: 3px solid #16A34A; padding-left: 12px; }
|
|
12401
|
+
.ss-w-h2h-head { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: none; cursor: pointer; text-align: left; font: inherit; color: inherit; padding: 0; }
|
|
12402
|
+
.ss-w-h2h-head-l { display: flex; align-items: center; gap: 6px; }
|
|
12403
|
+
.ss-w-h2h-dot { width: 4px; height: 4px; border-radius: 999px; background: var(--ss-w-faint); flex: none; }
|
|
12404
|
+
.ss-w-h2h-title { font-size: 13px; font-weight: 700; color: var(--ss-w-ink); }
|
|
12405
|
+
.ss-w-h2h-chevron { flex: none; color: var(--ss-w-faint); transition: transform .15s ease; }
|
|
12406
|
+
.ss-w-h2h-chevron--open { transform: rotate(180deg); }
|
|
12407
|
+
.ss-w-h2h-body { padding-top: 12px; display: flex; flex-direction: column; gap: 12px; }
|
|
12408
|
+
.ss-w-h2h-forms { display: flex; align-items: flex-start; justify-content: space-between; }
|
|
12409
|
+
.ss-w-h2h-form-col { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
|
|
12410
|
+
.ss-w-h2h-form-col--away { align-items: flex-end; }
|
|
12411
|
+
.ss-w-h2h-form-team { font-size: 11px; color: var(--ss-w-faint); }
|
|
12412
|
+
.ss-w-h2h-dots { display: flex; gap: 4px; }
|
|
12413
|
+
.ss-w-h2h-result { width: 20px; height: 20px; border-radius: 999px; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
|
|
12414
|
+
.ss-w-h2h-result--win { background: #16A34A; color: #FFFFFF; }
|
|
12415
|
+
.ss-w-h2h-result--draw { background: #E5E7EB; color: #4B5563; }
|
|
12416
|
+
.ss-w-h2h-result--loss { background: #F5A623; color: #1F2937; }
|
|
12417
|
+
.ss-w-h2h-record { display: flex; flex-direction: column; gap: 6px; }
|
|
12418
|
+
.ss-w-h2h-meta { font-size: 11px; color: var(--ss-w-faint); }
|
|
12419
|
+
.ss-w-h2h-bar { display: flex; width: 100%; height: 8px; border-radius: 999px; overflow: hidden; }
|
|
12420
|
+
.ss-w-h2h-bar-seg--win { background: #16A34A; }
|
|
12421
|
+
.ss-w-h2h-bar-seg--draw { background: #D1D5DB; }
|
|
12422
|
+
.ss-w-h2h-bar-seg--loss { background: #2563EB; }
|
|
12423
|
+
.ss-w-h2h-legend { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
|
|
12424
|
+
.ss-w-h2h-legend-item { font-size: 11px; color: var(--ss-w-ink); display: flex; align-items: center; gap: 5px; }
|
|
12425
|
+
.ss-w-h2h-legend-dot { width: 7px; height: 7px; border-radius: 999px; display: inline-block; flex: none; }
|
|
12426
|
+
.ss-w-h2h-legend-dot--win { background: #16A34A; }
|
|
12427
|
+
.ss-w-h2h-legend-dot--draw { background: #D1D5DB; }
|
|
12428
|
+
.ss-w-h2h-legend-dot--loss { background: #2563EB; }
|
|
12429
|
+
|
|
12289
12430
|
.ss-w-fact { display: flex; flex-direction: column; gap: 7px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--ss-w-accent) 9%, transparent); border: 1px solid color-mix(in srgb, var(--ss-w-accent) 22%, transparent); }
|
|
12290
12431
|
.ss-w-fact-k { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ss-w-accent); }
|
|
12291
12432
|
.ss-w-fact-min { color: var(--ss-w-ink); letter-spacing: 0; }
|
|
@@ -13043,7 +13184,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
13043
13184
|
`;
|
|
13044
13185
|
|
|
13045
13186
|
// src/StatsWidget.tsx
|
|
13046
|
-
import { jsx as
|
|
13187
|
+
import { jsx as jsx108 } from "react/jsx-runtime";
|
|
13047
13188
|
function buildClient(props) {
|
|
13048
13189
|
try {
|
|
13049
13190
|
if ("client" in props && props.client) {
|
|
@@ -13084,7 +13225,7 @@ function StatsWidget(props) {
|
|
|
13084
13225
|
}, []);
|
|
13085
13226
|
const convStorageKey = `ss-w-conv:${cfg?.operatorId ?? ""}:${cfg?.userContext?.operatorUserId ?? "anon"}`;
|
|
13086
13227
|
const controller = useChatStream(built?.conversation ?? emptyConversation(), ui.starters, built ? ui.greetingMessage : void 0, convStorageKey);
|
|
13087
|
-
const [hasToday, setHasToday] =
|
|
13228
|
+
const [hasToday, setHasToday] = useState56(false);
|
|
13088
13229
|
const liveCardWatches = useMemo6(() => {
|
|
13089
13230
|
const seen = /* @__PURE__ */ new Set();
|
|
13090
13231
|
const out = [];
|
|
@@ -13268,7 +13409,7 @@ function StatsWidget(props) {
|
|
|
13268
13409
|
}, [built, ui.injectStyles]);
|
|
13269
13410
|
if (!built) return null;
|
|
13270
13411
|
const attrs = themeAttrs(ui);
|
|
13271
|
-
return /* @__PURE__ */
|
|
13412
|
+
return /* @__PURE__ */ jsx108(EventLogContext.Provider, { value: logger, children: /* @__PURE__ */ jsx108(HostEventsProvider, { value: hostEvents, children: /* @__PURE__ */ jsx108("div", { ref: rootRef, className: "ss-w-root", "data-ss-w-theme": attrs["data-ss-w-theme"], "data-ss-w-pos": attrs["data-ss-w-pos"], style: attrs.style, children: controller.state.isOpen ? /* @__PURE__ */ jsx108(
|
|
13272
13413
|
ChatPanel,
|
|
13273
13414
|
{
|
|
13274
13415
|
controller,
|
|
@@ -13288,7 +13429,7 @@ function StatsWidget(props) {
|
|
|
13288
13429
|
conversation: built?.conversation ?? null,
|
|
13289
13430
|
presetGrid
|
|
13290
13431
|
}
|
|
13291
|
-
) : /* @__PURE__ */
|
|
13432
|
+
) : /* @__PURE__ */ jsx108(
|
|
13292
13433
|
ChatFab,
|
|
13293
13434
|
{
|
|
13294
13435
|
label: ui.launcherLabel,
|