@sensiblestats/widget-react 0.62.0 → 0.63.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 +11 -0
- package/dist/index.cjs +923 -820
- 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 +881 -778
- package/dist/index.js.map +1 -1
- package/dist/styles.css +15 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/StatsWidget.tsx
|
|
2
|
-
import { useCallback as useCallback10, useEffect as useEffect19, useMemo as useMemo3, useRef as useRef15, useState as
|
|
2
|
+
import { useCallback as useCallback10, useEffect as useEffect19, useMemo as useMemo3, useRef as useRef15, useState as useState39 } from "react";
|
|
3
3
|
import { StatsWidgetClient } from "@sensiblestats/widget-sdk";
|
|
4
4
|
|
|
5
5
|
// src/kickoff.ts
|
|
@@ -89,6 +89,10 @@ var STRINGS = {
|
|
|
89
89
|
inSlipLabel: "In slip",
|
|
90
90
|
oddsUnavailable: "Odds unavailable right now",
|
|
91
91
|
momentumLabel: "Momentum",
|
|
92
|
+
liveFactLabel: "Live fact",
|
|
93
|
+
liveFactAsk: "Ask about this",
|
|
94
|
+
liveFactEarlier: (n) => `Earlier facts (${n})`,
|
|
95
|
+
liveFactHideEarlier: "Hide earlier facts",
|
|
92
96
|
accordionValueLabel: "Value",
|
|
93
97
|
accordionRetry: "Couldn't load odds \u2014 tap to retry",
|
|
94
98
|
accordionSuspended: "Suspended",
|
|
@@ -385,6 +389,10 @@ var STRINGS = {
|
|
|
385
389
|
inSlipLabel: "Kuponda",
|
|
386
390
|
oddsUnavailable: "Oranlar \u015Fu anda kullan\u0131lam\u0131yor",
|
|
387
391
|
momentumLabel: "Momentum",
|
|
392
|
+
liveFactLabel: "Canl\u0131 bilgi",
|
|
393
|
+
liveFactAsk: "Bunu sor",
|
|
394
|
+
liveFactEarlier: (n) => `\xD6nceki bilgiler (${n})`,
|
|
395
|
+
liveFactHideEarlier: "\xD6nceki bilgileri gizle",
|
|
388
396
|
accordionValueLabel: "De\u011Fer",
|
|
389
397
|
accordionRetry: "Oranlar y\xFCklenemedi \u2014 yeniden dene",
|
|
390
398
|
accordionSuspended: "Ask\u0131da",
|
|
@@ -709,6 +717,10 @@ function normalizeUi(cfg) {
|
|
|
709
717
|
inSlipLabel: strings.inSlipLabel,
|
|
710
718
|
oddsUnavailable: strings.oddsUnavailable,
|
|
711
719
|
momentumLabel: strings.momentumLabel,
|
|
720
|
+
liveFactLabel: strings.liveFactLabel,
|
|
721
|
+
liveFactAsk: strings.liveFactAsk,
|
|
722
|
+
liveFactEarlier: strings.liveFactEarlier,
|
|
723
|
+
liveFactHideEarlier: strings.liveFactHideEarlier,
|
|
712
724
|
accordionValueLabel: strings.accordionValueLabel,
|
|
713
725
|
accordionRetry: strings.accordionRetry,
|
|
714
726
|
accordionSuspended: strings.accordionSuspended,
|
|
@@ -755,6 +767,12 @@ function slipPickFields(selection, label, line) {
|
|
|
755
767
|
if (Number.isFinite(odds) && odds > 1 && odds <= MAX_ODDS) fields.odds = odds;
|
|
756
768
|
return fields;
|
|
757
769
|
}
|
|
770
|
+
function chipSelection(market, matchId, conversationId) {
|
|
771
|
+
if (!market || !market.addToSlipEnabled || typeof market.matchOddsId !== "number" || typeof market.price !== "number") return null;
|
|
772
|
+
const selection = { matchOddsId: market.matchOddsId, matchId, oddsDecimal: market.price };
|
|
773
|
+
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
774
|
+
return selection;
|
|
775
|
+
}
|
|
758
776
|
function wasAdded(result) {
|
|
759
777
|
if (!result) return true;
|
|
760
778
|
if (result.status === "price_changed") return result.accepted;
|
|
@@ -1473,7 +1491,7 @@ function useChatStream(conversation, starterTexts, greetingMessage, storageKey)
|
|
|
1473
1491
|
const send = useCallback((text, opts) => {
|
|
1474
1492
|
const trimmed = text.trim();
|
|
1475
1493
|
if (!trimmed) return;
|
|
1476
|
-
run({ message: trimmed, actionId: opts?.actionId, actionRef: opts?.actionRef }, opts?.displayText);
|
|
1494
|
+
run({ message: trimmed, actionId: opts?.actionId, actionRef: opts?.actionRef, grounding: opts?.grounding }, opts?.displayText);
|
|
1477
1495
|
}, [run]);
|
|
1478
1496
|
const retry = useCallback(() => {
|
|
1479
1497
|
const last = stateRef.current.lastUserInput;
|
|
@@ -2347,7 +2365,7 @@ function ChatFab({ label, greeting, popupText, logoUrl, onOpen, onDismissPopup,
|
|
|
2347
2365
|
}
|
|
2348
2366
|
|
|
2349
2367
|
// src/components/ChatPanel.tsx
|
|
2350
|
-
import { useEffect as useEffect18, useState as
|
|
2368
|
+
import { useEffect as useEffect18, useState as useState38 } from "react";
|
|
2351
2369
|
|
|
2352
2370
|
// src/components/ChatHeader.tsx
|
|
2353
2371
|
import { useEffect as useEffect9, useRef as useRef9, useState as useState8 } from "react";
|
|
@@ -4176,15 +4194,79 @@ function MarketAccordion({ match, monitor, ui, slip }) {
|
|
|
4176
4194
|
}) });
|
|
4177
4195
|
}
|
|
4178
4196
|
|
|
4179
|
-
// src/components/
|
|
4197
|
+
// src/components/LiveFactBlock.tsx
|
|
4198
|
+
import { useState as useState22 } from "react";
|
|
4180
4199
|
import { jsx as jsx47, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
4181
|
-
function
|
|
4182
|
-
const
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
return
|
|
4200
|
+
function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
|
|
4201
|
+
const [expanded, setExpanded] = useState22(false);
|
|
4202
|
+
const [current, ...earlier] = facts;
|
|
4203
|
+
if (!current) return null;
|
|
4204
|
+
const m = current.market;
|
|
4205
|
+
return /* @__PURE__ */ jsxs42("section", { className: "ss-w-fact", "aria-label": ui.liveFactLabel, children: [
|
|
4206
|
+
/* @__PURE__ */ jsxs42("div", { className: "ss-w-fact-k", children: [
|
|
4207
|
+
/* @__PURE__ */ jsx47("span", { children: ui.liveFactLabel }),
|
|
4208
|
+
/* @__PURE__ */ jsxs42("span", { className: "ss-w-fact-min", children: [
|
|
4209
|
+
"\xB7 ",
|
|
4210
|
+
current.minuteLabel
|
|
4211
|
+
] }),
|
|
4212
|
+
/* @__PURE__ */ jsx47("span", { className: "ss-w-fact-subj", children: current.subjectLabel })
|
|
4213
|
+
] }),
|
|
4214
|
+
/* @__PURE__ */ jsx47("p", { className: "ss-w-fact-text", children: current.text }),
|
|
4215
|
+
/* @__PURE__ */ jsx47("div", { className: "ss-w-fact-basis", children: current.basis }),
|
|
4216
|
+
m && !m.isSuspended && /* @__PURE__ */ jsxs42("div", { className: "ss-w-fact-mkt", children: [
|
|
4217
|
+
/* @__PURE__ */ jsxs42("span", { children: [
|
|
4218
|
+
m.marketLabel,
|
|
4219
|
+
" \xB7 ",
|
|
4220
|
+
m.selectionLabel
|
|
4221
|
+
] }),
|
|
4222
|
+
/* @__PURE__ */ jsxs42("span", { className: "ss-w-mon-stat-mkt-right", children: [
|
|
4223
|
+
typeof m.price === "number" && /* @__PURE__ */ jsx47("span", { className: "ss-w-mon-price", children: m.price.toFixed(2) }),
|
|
4224
|
+
/* @__PURE__ */ jsx47(
|
|
4225
|
+
SlipButton,
|
|
4226
|
+
{
|
|
4227
|
+
selection: chipSelection(m, matchId, slip.conversationId),
|
|
4228
|
+
shownOdds: typeof m.price === "number" ? m.price.toFixed(2) : "",
|
|
4229
|
+
marketDeveloperName: m.marketDeveloperName,
|
|
4230
|
+
selectionLabel: m.selectionLabel,
|
|
4231
|
+
slip,
|
|
4232
|
+
ui
|
|
4233
|
+
}
|
|
4234
|
+
)
|
|
4235
|
+
] })
|
|
4236
|
+
] }),
|
|
4237
|
+
expanded && earlier.length > 0 && /* @__PURE__ */ jsx47("ul", { className: "ss-w-fact-hist", children: earlier.map((f) => /* @__PURE__ */ jsxs42("li", { children: [
|
|
4238
|
+
/* @__PURE__ */ jsx47("span", { className: "ss-w-fact-hmin", children: f.minuteLabel }),
|
|
4239
|
+
/* @__PURE__ */ jsxs42("div", { children: [
|
|
4240
|
+
/* @__PURE__ */ jsx47("p", { className: "ss-w-fact-htext", children: f.text }),
|
|
4241
|
+
/* @__PURE__ */ jsx47("div", { className: "ss-w-fact-basis", children: f.basis })
|
|
4242
|
+
] })
|
|
4243
|
+
] }, f.id)) }),
|
|
4244
|
+
/* @__PURE__ */ jsxs42("div", { className: "ss-w-fact-foot", children: [
|
|
4245
|
+
onAsk && /* @__PURE__ */ jsx47(
|
|
4246
|
+
"button",
|
|
4247
|
+
{
|
|
4248
|
+
type: "button",
|
|
4249
|
+
className: "ss-w-fact-link",
|
|
4250
|
+
onClick: () => onAsk(current.text, { kind: "liveFact", matchId, subject: current.text.slice(0, 400) }),
|
|
4251
|
+
children: ui.liveFactAsk
|
|
4252
|
+
}
|
|
4253
|
+
),
|
|
4254
|
+
earlier.length > 0 && /* @__PURE__ */ jsx47(
|
|
4255
|
+
"button",
|
|
4256
|
+
{
|
|
4257
|
+
type: "button",
|
|
4258
|
+
className: "ss-w-fact-link ss-w-fact-link--muted",
|
|
4259
|
+
"aria-expanded": expanded,
|
|
4260
|
+
onClick: () => setExpanded((v) => !v),
|
|
4261
|
+
children: expanded ? ui.liveFactHideEarlier : ui.liveFactEarlier(earlier.length)
|
|
4262
|
+
}
|
|
4263
|
+
)
|
|
4264
|
+
] })
|
|
4265
|
+
] });
|
|
4187
4266
|
}
|
|
4267
|
+
|
|
4268
|
+
// src/components/MonitorMatchCard.tsx
|
|
4269
|
+
import { jsx as jsx48, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
4188
4270
|
function isPromoted(row, promotedPins) {
|
|
4189
4271
|
const chip = row.market;
|
|
4190
4272
|
if (!chip) return false;
|
|
@@ -4210,7 +4292,7 @@ function groupScorers(goals, ownGoalLabel) {
|
|
|
4210
4292
|
return { player: name, label: name ? `${name} ${minutes}` : minutes };
|
|
4211
4293
|
});
|
|
4212
4294
|
}
|
|
4213
|
-
function MonitorMatchCard({ match, promotedPins, monitor, ui, slip }) {
|
|
4295
|
+
function MonitorMatchCard({ match, promotedPins, monitor, ui, slip, onAsk }) {
|
|
4214
4296
|
const live = match.phase === "live";
|
|
4215
4297
|
const goals = match.events.filter((e) => e.type === "goal");
|
|
4216
4298
|
const homeScorers = groupScorers(goals.filter((e) => e.side === "home"), ui.ownGoalLabel);
|
|
@@ -4219,67 +4301,68 @@ function MonitorMatchCard({ match, promotedPins, monitor, ui, slip }) {
|
|
|
4219
4301
|
const otherRows = match.statRows.filter((row) => !isPromoted(row, promotedPins));
|
|
4220
4302
|
const orderedRows = [...promotedRows, ...otherRows];
|
|
4221
4303
|
const kickoff = match.phase === "preMatch" && match.kickoffUtc ? ui.bettingKickoff(match.kickoffUtc) : void 0;
|
|
4222
|
-
return /* @__PURE__ */
|
|
4223
|
-
/* @__PURE__ */
|
|
4224
|
-
live && /* @__PURE__ */
|
|
4225
|
-
/* @__PURE__ */
|
|
4304
|
+
return /* @__PURE__ */ jsxs43("div", { className: "ss-w-mon", children: [
|
|
4305
|
+
/* @__PURE__ */ jsxs43("div", { className: "ss-w-mon-top", children: [
|
|
4306
|
+
live && /* @__PURE__ */ jsxs43("span", { className: "ss-w-fandash-live-pill", children: [
|
|
4307
|
+
/* @__PURE__ */ jsx48("span", { className: "ss-w-fandash-live-dot", "aria-hidden": "true" }),
|
|
4226
4308
|
ui.liveLabel
|
|
4227
4309
|
] }),
|
|
4228
|
-
match.phase === "fullTime" && /* @__PURE__ */
|
|
4229
|
-
kickoff && /* @__PURE__ */
|
|
4310
|
+
match.phase === "fullTime" && /* @__PURE__ */ jsx48("span", { className: "ss-w-mon-pill", children: ui.fullTimeLabel }),
|
|
4311
|
+
kickoff && /* @__PURE__ */ jsxs43("span", { className: "ss-w-mon-pill", children: [
|
|
4230
4312
|
kickoff.dayLabel,
|
|
4231
4313
|
" \xB7 ",
|
|
4232
4314
|
kickoff.time
|
|
4233
4315
|
] }),
|
|
4234
|
-
live && match.minuteLabel && /* @__PURE__ */
|
|
4235
|
-
match.competitionName && /* @__PURE__ */
|
|
4236
|
-
/* @__PURE__ */
|
|
4316
|
+
live && match.minuteLabel && /* @__PURE__ */ jsx48("span", { className: "ss-w-mon-min", children: match.minuteLabel }),
|
|
4317
|
+
match.competitionName && /* @__PURE__ */ jsx48("span", { className: "ss-w-mon-comp", children: match.competitionName }),
|
|
4318
|
+
/* @__PURE__ */ jsx48(PinToggle, { ui, monitor, pin: { kind: "match", matchId: match.matchId } })
|
|
4237
4319
|
] }),
|
|
4238
|
-
/* @__PURE__ */
|
|
4239
|
-
/* @__PURE__ */
|
|
4240
|
-
/* @__PURE__ */
|
|
4241
|
-
/* @__PURE__ */
|
|
4320
|
+
/* @__PURE__ */ jsxs43("div", { className: "ss-w-mon-main", children: [
|
|
4321
|
+
/* @__PURE__ */ jsxs43("span", { className: "ss-w-mon-side", children: [
|
|
4322
|
+
/* @__PURE__ */ jsx48(Crest2, { kind: "team", url: match.homeCrestUrl ?? void 0, name: match.homeTeamName ?? void 0 }),
|
|
4323
|
+
/* @__PURE__ */ jsx48("span", { className: "ss-w-mon-name", children: match.homeTeamName })
|
|
4242
4324
|
] }),
|
|
4243
|
-
match.phase === "preMatch" ? /* @__PURE__ */
|
|
4325
|
+
match.phase === "preMatch" ? /* @__PURE__ */ jsx48("span", { className: "ss-w-mon-vs", children: "vs" }) : /* @__PURE__ */ jsxs43("span", { className: "ss-w-mon-score", children: [
|
|
4244
4326
|
match.homeScore,
|
|
4245
|
-
/* @__PURE__ */
|
|
4327
|
+
/* @__PURE__ */ jsx48("i", { children: "\u2013" }),
|
|
4246
4328
|
match.awayScore
|
|
4247
4329
|
] }),
|
|
4248
|
-
/* @__PURE__ */
|
|
4249
|
-
/* @__PURE__ */
|
|
4250
|
-
/* @__PURE__ */
|
|
4330
|
+
/* @__PURE__ */ jsxs43("span", { className: "ss-w-mon-side ss-w-mon-side--away", children: [
|
|
4331
|
+
/* @__PURE__ */ jsx48(Crest2, { kind: "team", url: match.awayCrestUrl ?? void 0, name: match.awayTeamName ?? void 0 }),
|
|
4332
|
+
/* @__PURE__ */ jsx48("span", { className: "ss-w-mon-name", children: match.awayTeamName })
|
|
4251
4333
|
] })
|
|
4252
4334
|
] }),
|
|
4253
|
-
(homeScorers.length > 0 || awayScorers.length > 0) && /* @__PURE__ */
|
|
4254
|
-
/* @__PURE__ */
|
|
4255
|
-
/* @__PURE__ */
|
|
4256
|
-
/* @__PURE__ */
|
|
4335
|
+
(homeScorers.length > 0 || awayScorers.length > 0) && /* @__PURE__ */ jsxs43("div", { className: "ss-w-mon-scorers", children: [
|
|
4336
|
+
/* @__PURE__ */ jsx48("ul", { className: "ss-w-mon-scorers-col ss-w-mon-scorers-home", children: homeScorers.map((s, i) => /* @__PURE__ */ jsx48("li", { children: s.label }, `${s.player}-${i}`)) }),
|
|
4337
|
+
/* @__PURE__ */ jsx48("span", { className: "ss-w-mon-scorers-ball", "aria-hidden": "true", children: "\u26BD" }),
|
|
4338
|
+
/* @__PURE__ */ jsx48("ul", { className: "ss-w-mon-scorers-col ss-w-mon-scorers-away", children: awayScorers.map((s, i) => /* @__PURE__ */ jsx48("li", { children: s.label }, `${s.player}-${i}`)) })
|
|
4257
4339
|
] }),
|
|
4258
|
-
/* @__PURE__ */
|
|
4340
|
+
live && match.facts && match.facts.length > 0 && /* @__PURE__ */ jsx48(LiveFactBlock, { facts: match.facts, matchId: match.matchId, ui, slip, onAsk }),
|
|
4341
|
+
/* @__PURE__ */ jsx48("div", { className: "ss-w-mon-stats", children: orderedRows.map((row) => {
|
|
4259
4342
|
const total = row.homeNum + row.awayNum;
|
|
4260
4343
|
const homePct = total > 0 ? row.homeNum / total * 75 : 0;
|
|
4261
4344
|
const awayPct = total > 0 ? row.awayNum / total * 75 : 0;
|
|
4262
4345
|
const promoted = isPromoted(row, promotedPins);
|
|
4263
|
-
const selection = chipSelection(row, match.matchId, slip.conversationId);
|
|
4264
|
-
return /* @__PURE__ */
|
|
4265
|
-
/* @__PURE__ */
|
|
4266
|
-
/* @__PURE__ */
|
|
4267
|
-
/* @__PURE__ */
|
|
4268
|
-
/* @__PURE__ */
|
|
4346
|
+
const selection = chipSelection(row.market, match.matchId, slip.conversationId);
|
|
4347
|
+
return /* @__PURE__ */ jsxs43("div", { className: promoted ? "ss-w-mon-stat ss-w-mon-pstrip" : "ss-w-mon-stat", children: [
|
|
4348
|
+
/* @__PURE__ */ jsxs43("div", { className: "ss-w-mon-stat-row", children: [
|
|
4349
|
+
/* @__PURE__ */ jsx48("span", { className: "ss-w-mon-stat-v ss-w-mon-stat-v--home", children: row.homeValue }),
|
|
4350
|
+
/* @__PURE__ */ jsx48("span", { className: "ss-w-mon-stat-l", children: row.label }),
|
|
4351
|
+
/* @__PURE__ */ jsx48("span", { className: "ss-w-mon-stat-v ss-w-mon-stat-v--away", children: row.awayValue })
|
|
4269
4352
|
] }),
|
|
4270
|
-
/* @__PURE__ */
|
|
4271
|
-
/* @__PURE__ */
|
|
4272
|
-
/* @__PURE__ */
|
|
4353
|
+
/* @__PURE__ */ jsxs43("div", { className: "ss-w-mon-bar", children: [
|
|
4354
|
+
/* @__PURE__ */ jsx48("b", { className: "ss-w-mon-bar-home", style: { width: `${homePct}%` } }),
|
|
4355
|
+
/* @__PURE__ */ jsx48("i", { className: "ss-w-mon-bar-away", style: { width: `${awayPct}%` } })
|
|
4273
4356
|
] }),
|
|
4274
|
-
row.market && !row.market.isSuspended && /* @__PURE__ */
|
|
4275
|
-
/* @__PURE__ */
|
|
4357
|
+
row.market && !row.market.isSuspended && /* @__PURE__ */ jsxs43("div", { className: promoted ? "ss-w-mon-stat-mkt ss-w-mon-mkt" : "ss-w-mon-stat-mkt", children: [
|
|
4358
|
+
/* @__PURE__ */ jsxs43("span", { children: [
|
|
4276
4359
|
row.market.marketLabel,
|
|
4277
4360
|
" \xB7 ",
|
|
4278
4361
|
row.market.selectionLabel
|
|
4279
4362
|
] }),
|
|
4280
|
-
/* @__PURE__ */
|
|
4281
|
-
typeof row.market.price === "number" && /* @__PURE__ */
|
|
4282
|
-
/* @__PURE__ */
|
|
4363
|
+
/* @__PURE__ */ jsxs43("span", { className: "ss-w-mon-stat-mkt-right", children: [
|
|
4364
|
+
typeof row.market.price === "number" && /* @__PURE__ */ jsx48("span", { className: "ss-w-mon-price", children: row.market.price.toFixed(2) }),
|
|
4365
|
+
/* @__PURE__ */ jsx48(
|
|
4283
4366
|
SlipButton,
|
|
4284
4367
|
{
|
|
4285
4368
|
selection,
|
|
@@ -4294,23 +4377,23 @@ function MonitorMatchCard({ match, promotedPins, monitor, ui, slip }) {
|
|
|
4294
4377
|
] })
|
|
4295
4378
|
] }, row.label);
|
|
4296
4379
|
}) }),
|
|
4297
|
-
match.status === "stale" && /* @__PURE__ */
|
|
4298
|
-
match.momentum.length > 0 && /* @__PURE__ */
|
|
4299
|
-
/* @__PURE__ */
|
|
4300
|
-
/* @__PURE__ */
|
|
4380
|
+
match.status === "stale" && /* @__PURE__ */ jsx48("span", { className: "ss-w-mon-asof", children: ui.asOf(formatTime(match.asOfUtc)) }),
|
|
4381
|
+
match.momentum.length > 0 && /* @__PURE__ */ jsxs43("div", { className: "ss-w-mon-mom", children: [
|
|
4382
|
+
/* @__PURE__ */ jsx48("span", { className: "ss-w-mon-stat-l", children: ui.momentumLabel }),
|
|
4383
|
+
/* @__PURE__ */ jsx48(MomentumWave, { points: match.momentum, clubIsHome: true })
|
|
4301
4384
|
] }),
|
|
4302
|
-
match.phase === "fullTime" && /* @__PURE__ */
|
|
4385
|
+
match.phase === "fullTime" && /* @__PURE__ */ jsx48("div", { className: "ss-w-mon-grace", children: ui.graceNote })
|
|
4303
4386
|
] });
|
|
4304
4387
|
}
|
|
4305
4388
|
|
|
4306
4389
|
// src/components/MonitorTabs.tsx
|
|
4307
|
-
import { jsx as
|
|
4390
|
+
import { jsx as jsx49, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
4308
4391
|
function OddsLiveStrip({ m, ui }) {
|
|
4309
4392
|
const showScore = m.phase !== "preMatch" && typeof m.homeScore === "number";
|
|
4310
4393
|
const stale = m.status === "stale";
|
|
4311
4394
|
if (!showScore && !m.minuteLabel && !(m.isSuspended && !m.isSettled) && !m.isSettled && !stale) return null;
|
|
4312
|
-
return /* @__PURE__ */
|
|
4313
|
-
showScore && /* @__PURE__ */
|
|
4395
|
+
return /* @__PURE__ */ jsxs44("div", { className: "ss-w-mk-live", children: [
|
|
4396
|
+
showScore && /* @__PURE__ */ jsxs44("b", { className: "ss-w-mk-live-score", children: [
|
|
4314
4397
|
m.homeTeamName,
|
|
4315
4398
|
" ",
|
|
4316
4399
|
m.homeScore,
|
|
@@ -4319,27 +4402,28 @@ function OddsLiveStrip({ m, ui }) {
|
|
|
4319
4402
|
" ",
|
|
4320
4403
|
m.awayTeamName
|
|
4321
4404
|
] }),
|
|
4322
|
-
m.minuteLabel && /* @__PURE__ */
|
|
4323
|
-
m.isSuspended && !m.isSettled && /* @__PURE__ */
|
|
4324
|
-
m.isSettled && /* @__PURE__ */
|
|
4325
|
-
stale && /* @__PURE__ */
|
|
4405
|
+
m.minuteLabel && /* @__PURE__ */ jsx49("span", { className: "ss-w-mon-min", children: m.minuteLabel }),
|
|
4406
|
+
m.isSuspended && !m.isSettled && /* @__PURE__ */ jsx49("span", { className: "ss-w-mon-susp", children: ui.suspendedLabel }),
|
|
4407
|
+
m.isSettled && /* @__PURE__ */ jsx49("span", { className: "ss-w-mon-pill", children: ui.fullTimeLabel }),
|
|
4408
|
+
stale && /* @__PURE__ */ jsx49("span", { className: "ss-w-mon-asof", children: ui.asOf(new Date(m.asOfUtc).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })) })
|
|
4326
4409
|
] });
|
|
4327
4410
|
}
|
|
4328
|
-
function MatchesPanel({ monitor, ui, slip }) {
|
|
4411
|
+
function MatchesPanel({ monitor, ui, slip, onAsk }) {
|
|
4329
4412
|
const matches = (monitor.snapshot?.matches ?? []).filter((m) => monitor.pins.some((p) => p.kind === "match" && p.matchId === m.matchId));
|
|
4330
|
-
if (matches.length === 0) return /* @__PURE__ */
|
|
4331
|
-
return /* @__PURE__ */
|
|
4332
|
-
/* @__PURE__ */
|
|
4413
|
+
if (matches.length === 0) return /* @__PURE__ */ jsx49("div", { className: "ss-w-mon-empty", children: ui.emptyMatchesTab });
|
|
4414
|
+
return /* @__PURE__ */ jsx49("div", { className: "ss-w-mon-list", children: matches.map((m) => /* @__PURE__ */ jsxs44("div", { className: "ss-w-mon-item", children: [
|
|
4415
|
+
/* @__PURE__ */ jsx49(
|
|
4333
4416
|
MonitorMatchCard,
|
|
4334
4417
|
{
|
|
4335
4418
|
match: m,
|
|
4336
4419
|
promotedPins: monitor.pins.filter((p) => p.kind !== "match" && p.matchId === m.matchId),
|
|
4337
4420
|
monitor,
|
|
4338
4421
|
ui,
|
|
4339
|
-
slip
|
|
4422
|
+
slip,
|
|
4423
|
+
onAsk
|
|
4340
4424
|
}
|
|
4341
4425
|
),
|
|
4342
|
-
/* @__PURE__ */
|
|
4426
|
+
/* @__PURE__ */ jsx49(MarketAccordion, { match: m, monitor, ui, slip })
|
|
4343
4427
|
] }, m.matchId)) });
|
|
4344
4428
|
}
|
|
4345
4429
|
function withSinceViewMovement(vm, prev) {
|
|
@@ -4354,12 +4438,12 @@ function withSinceViewMovement(vm, prev) {
|
|
|
4354
4438
|
}
|
|
4355
4439
|
function OddsPanel({ monitor, ui, slip }) {
|
|
4356
4440
|
const markets = (monitor.snapshot?.markets ?? []).filter((m) => monitor.pins.some((p) => p.key === m.key));
|
|
4357
|
-
if (markets.length === 0) return /* @__PURE__ */
|
|
4358
|
-
return /* @__PURE__ */
|
|
4441
|
+
if (markets.length === 0) return /* @__PURE__ */ jsx49("div", { className: "ss-w-mon-empty", children: ui.emptyOddsTab });
|
|
4442
|
+
return /* @__PURE__ */ jsx49("div", { className: "ss-w-mon-list", children: markets.map((m) => {
|
|
4359
4443
|
const pin = monitor.pins.find((p) => p.key === m.key);
|
|
4360
|
-
return /* @__PURE__ */
|
|
4361
|
-
/* @__PURE__ */
|
|
4362
|
-
m.card && /* @__PURE__ */
|
|
4444
|
+
return /* @__PURE__ */ jsxs44("div", { className: "ss-w-mon-oddspin", "data-settled": m.isSettled || void 0, children: [
|
|
4445
|
+
/* @__PURE__ */ jsx49(OddsLiveStrip, { m, ui }),
|
|
4446
|
+
m.card && /* @__PURE__ */ jsx49(
|
|
4363
4447
|
MarketOddsCardList,
|
|
4364
4448
|
{
|
|
4365
4449
|
cards: [withSinceViewMovement(toMarketOddsVM(m.card), monitor.lastViewedPrices[m.key])],
|
|
@@ -4370,22 +4454,22 @@ function OddsPanel({ monitor, ui, slip }) {
|
|
|
4370
4454
|
inSlipIds: monitor.inSlip
|
|
4371
4455
|
}
|
|
4372
4456
|
),
|
|
4373
|
-
m.history && /* @__PURE__ */
|
|
4374
|
-
!m.card && !m.history && /* @__PURE__ */
|
|
4457
|
+
m.history && /* @__PURE__ */ jsx49(OddsMovementCardList, { cards: [toOddsMovementVM(m.history)], ui }),
|
|
4458
|
+
!m.card && !m.history && /* @__PURE__ */ jsx49("div", { className: "ss-w-mon-empty-card", children: ui.oddsUnavailable })
|
|
4375
4459
|
] }, m.key);
|
|
4376
4460
|
}) });
|
|
4377
4461
|
}
|
|
4378
4462
|
|
|
4379
4463
|
// src/components/FixtureRow.tsx
|
|
4380
|
-
import { jsx as
|
|
4464
|
+
import { jsx as jsx50, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
4381
4465
|
function kickoffLabel(kickoffUnix) {
|
|
4382
4466
|
const d = new Date(kickoffUnix * 1e3);
|
|
4383
4467
|
return `${`${d.getHours()}`.padStart(2, "0")}:${`${d.getMinutes()}`.padStart(2, "0")}`;
|
|
4384
4468
|
}
|
|
4385
4469
|
function Side({ name, crest, away = false }) {
|
|
4386
|
-
return /* @__PURE__ */
|
|
4387
|
-
crest ? /* @__PURE__ */
|
|
4388
|
-
/* @__PURE__ */
|
|
4470
|
+
return /* @__PURE__ */ jsxs45("span", { className: away ? "ss-w-drow-side ss-w-drow-side--away" : "ss-w-drow-side", children: [
|
|
4471
|
+
crest ? /* @__PURE__ */ jsx50("img", { className: "ss-w-drow-crest", src: crest, alt: "" }) : null,
|
|
4472
|
+
/* @__PURE__ */ jsx50("span", { className: "ss-w-drow-nm", children: name })
|
|
4389
4473
|
] });
|
|
4390
4474
|
}
|
|
4391
4475
|
function FixtureRow({ match, state, stale, ui, monitor }) {
|
|
@@ -4393,45 +4477,45 @@ function FixtureRow({ match, state, stale, ui, monitor }) {
|
|
|
4393
4477
|
const hasScore = (state?.phase === "live" || state?.phase === "fullTime") && typeof state.homeScore === "number" && typeof state.awayScore === "number";
|
|
4394
4478
|
const ticked = state?.phase === "live" ? state.minuteLabel ?? null : null;
|
|
4395
4479
|
const when = state?.isHalfTime && !stale ? ui.halfTime : isLive ? ticked ?? "\u2014" : state?.phase === "live" ? "\u2014" : kickoffLabel(match.kickoffUnix);
|
|
4396
|
-
return /* @__PURE__ */
|
|
4397
|
-
/* @__PURE__ */
|
|
4398
|
-
/* @__PURE__ */
|
|
4399
|
-
/* @__PURE__ */
|
|
4400
|
-
/* @__PURE__ */
|
|
4401
|
-
/* @__PURE__ */
|
|
4480
|
+
return /* @__PURE__ */ jsxs45("div", { className: isLive || state?.isHalfTime ? "ss-w-drow ss-w-drow--live" : "ss-w-drow", children: [
|
|
4481
|
+
/* @__PURE__ */ jsx50("span", { className: isLive || state?.isHalfTime ? "ss-w-drow-when ss-w-drow-when--live" : "ss-w-drow-when", children: when }),
|
|
4482
|
+
/* @__PURE__ */ jsxs45("span", { className: "ss-w-drow-fx", children: [
|
|
4483
|
+
/* @__PURE__ */ jsx50(Side, { name: match.homeTeamName, crest: match.homeTeamImagePath }),
|
|
4484
|
+
/* @__PURE__ */ jsx50("span", { className: hasScore ? "ss-w-drow-sc" : "ss-w-drow-sc ss-w-drow-sc--idle", children: hasScore ? `${state.homeScore}\u2013${state.awayScore}` : "\u2013" }),
|
|
4485
|
+
/* @__PURE__ */ jsx50(Side, { name: match.awayTeamName, crest: match.awayTeamImagePath, away: true })
|
|
4402
4486
|
] }),
|
|
4403
|
-
/* @__PURE__ */
|
|
4487
|
+
/* @__PURE__ */ jsx50(PinToggle, { ui, monitor, pin: { kind: "match", matchId: match.matchId } })
|
|
4404
4488
|
] });
|
|
4405
4489
|
}
|
|
4406
4490
|
|
|
4407
4491
|
// src/components/CompetitionGroup.tsx
|
|
4408
|
-
import { jsx as
|
|
4492
|
+
import { jsx as jsx51, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
4409
4493
|
function CompetitionGroup({ group, open, onToggle, states, stale, ui, monitor, disambiguate = false }) {
|
|
4410
4494
|
const own = group.matches.filter((m) => !isTreatedLive(states[m.matchId], stale));
|
|
4411
4495
|
const hasLive = own.length !== group.matches.length;
|
|
4412
4496
|
if (own.length === 0) {
|
|
4413
4497
|
return null;
|
|
4414
4498
|
}
|
|
4415
|
-
return /* @__PURE__ */
|
|
4416
|
-
/* @__PURE__ */
|
|
4417
|
-
/* @__PURE__ */
|
|
4418
|
-
hasLive && /* @__PURE__ */
|
|
4419
|
-
/* @__PURE__ */
|
|
4499
|
+
return /* @__PURE__ */ jsxs46("div", { className: "ss-w-grp", children: [
|
|
4500
|
+
/* @__PURE__ */ jsxs46("button", { type: "button", className: "ss-w-grp-head", "aria-expanded": open, onClick: onToggle, children: [
|
|
4501
|
+
/* @__PURE__ */ jsx51("span", { className: "ss-w-grp-chev", children: open ? "\u25BE" : "\u25B8" }),
|
|
4502
|
+
hasLive && /* @__PURE__ */ jsx51("span", { className: "ss-w-sec-dot", "aria-hidden": "true" }),
|
|
4503
|
+
/* @__PURE__ */ jsxs46("span", { className: "ss-w-grp-name", children: [
|
|
4420
4504
|
group.competitionName,
|
|
4421
|
-
disambiguate && group.competitionCountry ? /* @__PURE__ */
|
|
4505
|
+
disambiguate && group.competitionCountry ? /* @__PURE__ */ jsxs46("span", { className: "ss-w-grp-country", children: [
|
|
4422
4506
|
" (",
|
|
4423
4507
|
group.competitionCountry,
|
|
4424
4508
|
")"
|
|
4425
4509
|
] }) : null
|
|
4426
4510
|
] }),
|
|
4427
|
-
/* @__PURE__ */
|
|
4511
|
+
/* @__PURE__ */ jsx51("span", { className: "ss-w-grp-count", children: own.length })
|
|
4428
4512
|
] }),
|
|
4429
|
-
open && /* @__PURE__ */
|
|
4513
|
+
open && /* @__PURE__ */ jsx51("div", { className: "ss-w-grp-body", children: own.map((m) => /* @__PURE__ */ jsx51(FixtureRow, { match: m, state: states[m.matchId], stale, ui, monitor }, m.matchId)) })
|
|
4430
4514
|
] });
|
|
4431
4515
|
}
|
|
4432
4516
|
|
|
4433
4517
|
// src/components/TodayPanel.tsx
|
|
4434
|
-
import { Fragment as Fragment7, jsx as
|
|
4518
|
+
import { Fragment as Fragment7, jsx as jsx52, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
4435
4519
|
function TodayPanel({ discovery, ui, monitor }) {
|
|
4436
4520
|
const { groups, states, stale, expanded, toggleGroup } = discovery;
|
|
4437
4521
|
const visibleGroups = visibleGroupsOf(groups, states);
|
|
@@ -4440,14 +4524,14 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
4440
4524
|
acc[g.competitionName] = (acc[g.competitionName] ?? 0) + 1;
|
|
4441
4525
|
return acc;
|
|
4442
4526
|
}, {});
|
|
4443
|
-
return /* @__PURE__ */
|
|
4444
|
-
stale && /* @__PURE__ */
|
|
4445
|
-
liveRows.length > 0 && /* @__PURE__ */
|
|
4446
|
-
/* @__PURE__ */
|
|
4447
|
-
/* @__PURE__ */
|
|
4527
|
+
return /* @__PURE__ */ jsxs47("div", { className: "ss-w-mon-list", children: [
|
|
4528
|
+
stale && /* @__PURE__ */ jsx52("div", { className: "ss-w-stale", children: ui.staleStates }),
|
|
4529
|
+
liveRows.length > 0 && /* @__PURE__ */ jsxs47(Fragment7, { children: [
|
|
4530
|
+
/* @__PURE__ */ jsxs47("div", { className: "ss-w-sec-head", children: [
|
|
4531
|
+
/* @__PURE__ */ jsx52("span", { className: "ss-w-sec-dot", "aria-hidden": "true" }),
|
|
4448
4532
|
ui.sectionLive
|
|
4449
4533
|
] }),
|
|
4450
|
-
/* @__PURE__ */
|
|
4534
|
+
/* @__PURE__ */ jsx52("div", { className: "ss-w-today-live", children: liveRows.map(({ match }) => /* @__PURE__ */ jsx52(
|
|
4451
4535
|
FixtureRow,
|
|
4452
4536
|
{
|
|
4453
4537
|
match,
|
|
@@ -4459,7 +4543,7 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
4459
4543
|
match.matchId
|
|
4460
4544
|
)) })
|
|
4461
4545
|
] }),
|
|
4462
|
-
visibleGroups.map((group) => /* @__PURE__ */
|
|
4546
|
+
visibleGroups.map((group) => /* @__PURE__ */ jsx52(
|
|
4463
4547
|
CompetitionGroup,
|
|
4464
4548
|
{
|
|
4465
4549
|
group,
|
|
@@ -4477,16 +4561,16 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
4477
4561
|
}
|
|
4478
4562
|
|
|
4479
4563
|
// src/components/GamesPanel.tsx
|
|
4480
|
-
import { useEffect as useEffect17, useState as
|
|
4564
|
+
import { useEffect as useEffect17, useState as useState36 } from "react";
|
|
4481
4565
|
|
|
4482
4566
|
// src/components/GamesLoginWall.tsx
|
|
4483
|
-
import { jsx as
|
|
4567
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
4484
4568
|
function GamesLoginWall({ ui }) {
|
|
4485
|
-
return /* @__PURE__ */
|
|
4569
|
+
return /* @__PURE__ */ jsx53("div", { className: "ss-w-mon-list", children: /* @__PURE__ */ jsx53("div", { className: "ss-w-games-wall", children: /* @__PURE__ */ jsx53("p", { children: ui.gamesLoginRequired }) }) });
|
|
4486
4570
|
}
|
|
4487
4571
|
|
|
4488
4572
|
// src/components/GamesHub.tsx
|
|
4489
|
-
import { useEffect as useEffect14, useState as
|
|
4573
|
+
import { useEffect as useEffect14, useState as useState23 } from "react";
|
|
4490
4574
|
|
|
4491
4575
|
// src/components/games/ui/gameMeta.ts
|
|
4492
4576
|
function prettifyGameId(gameId) {
|
|
@@ -4502,75 +4586,75 @@ function splitName(full) {
|
|
|
4502
4586
|
}
|
|
4503
4587
|
|
|
4504
4588
|
// src/components/GameTileArt.tsx
|
|
4505
|
-
import { Fragment as Fragment8, jsx as
|
|
4589
|
+
import { Fragment as Fragment8, jsx as jsx54, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
4506
4590
|
function GameTileArt({ gameId }) {
|
|
4507
|
-
return /* @__PURE__ */
|
|
4591
|
+
return /* @__PURE__ */ jsx54("svg", { className: "ss-g-art", viewBox: "0 0 120 74", "aria-hidden": "true", children: ART[gameId] ?? ART.default });
|
|
4508
4592
|
}
|
|
4509
|
-
var head = (cx, cy, r, cls = "ss-g-art-fg") => /* @__PURE__ */
|
|
4510
|
-
/* @__PURE__ */
|
|
4511
|
-
/* @__PURE__ */
|
|
4593
|
+
var head = (cx, cy, r, cls = "ss-g-art-fg") => /* @__PURE__ */ jsxs48("g", { className: cls, children: [
|
|
4594
|
+
/* @__PURE__ */ jsx54("circle", { cx, cy: cy - r * 0.3, r: r * 0.45 }),
|
|
4595
|
+
/* @__PURE__ */ jsx54("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` })
|
|
4512
4596
|
] });
|
|
4513
4597
|
var ART = {
|
|
4514
|
-
"mystery-tiger": /* @__PURE__ */
|
|
4598
|
+
"mystery-tiger": /* @__PURE__ */ jsxs48(Fragment8, { children: [
|
|
4515
4599
|
head(60, 38, 26, "ss-g-art-fg"),
|
|
4516
|
-
/* @__PURE__ */
|
|
4600
|
+
/* @__PURE__ */ jsx54("text", { x: "60", y: "36", className: "ss-g-art-q", textAnchor: "middle", children: "?" })
|
|
4517
4601
|
] }),
|
|
4518
|
-
"higher-or-lower": /* @__PURE__ */
|
|
4602
|
+
"higher-or-lower": /* @__PURE__ */ jsxs48(Fragment8, { children: [
|
|
4519
4603
|
head(32, 38, 20),
|
|
4520
4604
|
head(88, 38, 20),
|
|
4521
|
-
/* @__PURE__ */
|
|
4522
|
-
/* @__PURE__ */
|
|
4605
|
+
/* @__PURE__ */ jsx54("circle", { cx: "60", cy: "37", r: "11", className: "ss-g-art-accent" }),
|
|
4606
|
+
/* @__PURE__ */ jsx54("path", { d: "M57 33l3-3 3 3M57 41l3 3 3-3", className: "ss-g-art-ink" })
|
|
4523
4607
|
] }),
|
|
4524
|
-
"guess-the-xi": /* @__PURE__ */
|
|
4525
|
-
/* @__PURE__ */
|
|
4526
|
-
[[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__ */
|
|
4608
|
+
"guess-the-xi": /* @__PURE__ */ jsxs48(Fragment8, { children: [
|
|
4609
|
+
/* @__PURE__ */ jsx54("rect", { x: "8", y: "4", width: "104", height: "66", rx: "6", className: "ss-g-art-pitch" }),
|
|
4610
|
+
[[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__ */ jsx54("circle", { cx: x, cy: y, r: "4", className: a ? "ss-g-art-accent" : "ss-g-art-dot" }, i))
|
|
4527
4611
|
] }),
|
|
4528
|
-
"daily-quiz": /* @__PURE__ */
|
|
4529
|
-
"career-path": /* @__PURE__ */
|
|
4530
|
-
/* @__PURE__ */
|
|
4531
|
-
/* @__PURE__ */
|
|
4532
|
-
/* @__PURE__ */
|
|
4533
|
-
/* @__PURE__ */
|
|
4534
|
-
/* @__PURE__ */
|
|
4612
|
+
"daily-quiz": /* @__PURE__ */ jsx54(Fragment8, { children: [[14, 8], [62, 8], [14, 40], [62, 40]].map(([x, y], i) => /* @__PURE__ */ jsx54("rect", { x, y, width: "44", height: "26", rx: "5", className: i === 1 ? "ss-g-art-correct" : "ss-g-art-block" }, i)) }),
|
|
4613
|
+
"career-path": /* @__PURE__ */ jsxs48(Fragment8, { children: [
|
|
4614
|
+
/* @__PURE__ */ jsx54("path", { d: "M18 22h24v10c0 7-5 11-12 13-7-2-12-6-12-13z", className: "ss-g-art-fg" }),
|
|
4615
|
+
/* @__PURE__ */ jsx54("path", { d: "M48 37h8M84 37h8", className: "ss-g-art-line" }),
|
|
4616
|
+
/* @__PURE__ */ jsx54("path", { d: "M60 22h24v10c0 7-5 11-12 13-7-2-12-6-12-13z", className: "ss-g-art-fg" }),
|
|
4617
|
+
/* @__PURE__ */ jsx54("rect", { x: "96", y: "22", width: "18", height: "26", rx: "4", className: "ss-g-art-dash" }),
|
|
4618
|
+
/* @__PURE__ */ jsx54("text", { x: "105", y: "40", className: "ss-g-art-q", textAnchor: "middle", children: "?" })
|
|
4535
4619
|
] }),
|
|
4536
|
-
"beat-the-grid": /* @__PURE__ */
|
|
4537
|
-
"matchday-predictor": /* @__PURE__ */
|
|
4538
|
-
/* @__PURE__ */
|
|
4539
|
-
/* @__PURE__ */
|
|
4540
|
-
/* @__PURE__ */
|
|
4541
|
-
/* @__PURE__ */
|
|
4620
|
+
"beat-the-grid": /* @__PURE__ */ jsx54(Fragment8, { children: [0, 1, 2].flatMap((r) => [0, 1, 2].map((c) => /* @__PURE__ */ jsx54("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}`))) }),
|
|
4621
|
+
"matchday-predictor": /* @__PURE__ */ jsxs48(Fragment8, { children: [
|
|
4622
|
+
/* @__PURE__ */ jsx54("path", { d: "M10 20h20v9c0 6-4 9-10 11-6-2-10-5-10-11z", className: "ss-g-art-fg" }),
|
|
4623
|
+
/* @__PURE__ */ jsx54("rect", { x: "38", y: "22", width: "18", height: "24", rx: "4", className: "ss-g-art-accent-stroke" }),
|
|
4624
|
+
/* @__PURE__ */ jsx54("rect", { x: "64", y: "22", width: "18", height: "24", rx: "4", className: "ss-g-art-dash" }),
|
|
4625
|
+
/* @__PURE__ */ jsx54("path", { d: "M90 20h20v9c0 6-4 9-10 11-6-2-10-5-10-11z", className: "ss-g-art-fg" })
|
|
4542
4626
|
] }),
|
|
4543
|
-
"starting-xi": /* @__PURE__ */
|
|
4544
|
-
/* @__PURE__ */
|
|
4545
|
-
[[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__ */
|
|
4627
|
+
"starting-xi": /* @__PURE__ */ jsxs48(Fragment8, { children: [
|
|
4628
|
+
/* @__PURE__ */ jsx54("rect", { x: "8", y: "4", width: "104", height: "66", rx: "6", className: "ss-g-art-pitch" }),
|
|
4629
|
+
[[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__ */ jsx54("circle", { cx: x, cy: y, r: "5", className: i < 7 ? "ss-g-art-accent" : "ss-g-art-dash" }, i))
|
|
4546
4630
|
] }),
|
|
4547
|
-
"stat-ladder": /* @__PURE__ */
|
|
4548
|
-
"fan-motm": /* @__PURE__ */
|
|
4549
|
-
/* @__PURE__ */
|
|
4631
|
+
"stat-ladder": /* @__PURE__ */ jsx54(Fragment8, { children: [[20, 70], [34, 52], [48, 34]].map(([y, w], i) => /* @__PURE__ */ jsx54("rect", { x: "24", y, width: w, height: "12", rx: "3", className: i === 1 ? "ss-g-art-accent" : "ss-g-art-block" }, i)) }),
|
|
4632
|
+
"fan-motm": /* @__PURE__ */ jsxs48(Fragment8, { children: [
|
|
4633
|
+
/* @__PURE__ */ jsx54("circle", { cx: "60", cy: "37", r: "26", className: "ss-g-art-accent-stroke" }),
|
|
4550
4634
|
head(60, 40, 18),
|
|
4551
|
-
/* @__PURE__ */
|
|
4635
|
+
/* @__PURE__ */ jsx54("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" })
|
|
4552
4636
|
] }),
|
|
4553
|
-
default: /* @__PURE__ */
|
|
4637
|
+
default: /* @__PURE__ */ jsx54("circle", { cx: "60", cy: "37", r: "22", className: "ss-g-art-fg" })
|
|
4554
4638
|
};
|
|
4555
4639
|
|
|
4556
4640
|
// src/components/games/ui/Chip.tsx
|
|
4557
|
-
import { jsx as
|
|
4641
|
+
import { jsx as jsx55, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
4558
4642
|
function Chip({ variant = "neutral", icon, children, className }) {
|
|
4559
|
-
return /* @__PURE__ */
|
|
4643
|
+
return /* @__PURE__ */ jsxs49("span", { className: `ss-g-chip ss-g-chip--${variant}${className ? ` ${className}` : ""}`, children: [
|
|
4560
4644
|
icon,
|
|
4561
4645
|
children
|
|
4562
4646
|
] });
|
|
4563
4647
|
}
|
|
4564
4648
|
function StatStack({ value, label }) {
|
|
4565
|
-
return /* @__PURE__ */
|
|
4566
|
-
/* @__PURE__ */
|
|
4567
|
-
/* @__PURE__ */
|
|
4649
|
+
return /* @__PURE__ */ jsxs49("span", { className: "ss-g-statstack", children: [
|
|
4650
|
+
/* @__PURE__ */ jsx55("span", { className: "ss-g-statstack-v", children: value }),
|
|
4651
|
+
/* @__PURE__ */ jsx55("span", { className: "ss-g-statstack-l", children: label })
|
|
4568
4652
|
] });
|
|
4569
4653
|
}
|
|
4570
4654
|
|
|
4571
4655
|
// src/components/games/ui/icons.tsx
|
|
4572
|
-
import { jsx as
|
|
4573
|
-
var svg = (size, children, fill = false) => /* @__PURE__ */
|
|
4656
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
4657
|
+
var svg = (size, children, fill = false) => /* @__PURE__ */ jsx56(
|
|
4574
4658
|
"svg",
|
|
4575
4659
|
{
|
|
4576
4660
|
width: size,
|
|
@@ -4585,25 +4669,25 @@ var svg = (size, children, fill = false) => /* @__PURE__ */ jsx55(
|
|
|
4585
4669
|
children
|
|
4586
4670
|
}
|
|
4587
4671
|
);
|
|
4588
|
-
var IconChevronLeft = ({ size = 20 }) => svg(size, /* @__PURE__ */
|
|
4589
|
-
var IconLock = ({ size = 14 }) => svg(size, [/* @__PURE__ */
|
|
4590
|
-
var IconCheck = ({ size = 14 }) => svg(size, /* @__PURE__ */
|
|
4591
|
-
var IconClose = ({ size = 16 }) => svg(size, /* @__PURE__ */
|
|
4592
|
-
var IconSearch = ({ size = 18 }) => svg(size, [/* @__PURE__ */
|
|
4593
|
-
var IconPlus = ({ size = 20 }) => svg(size, /* @__PURE__ */
|
|
4594
|
-
var IconBulb = ({ size = 16 }) => svg(size, [/* @__PURE__ */
|
|
4595
|
-
var IconArrowUp = ({ size = 12 }) => svg(size, /* @__PURE__ */
|
|
4596
|
-
var IconArrowDown = ({ size = 12 }) => svg(size, /* @__PURE__ */
|
|
4597
|
-
var IconCalendar = ({ size = 18 }) => svg(size, [/* @__PURE__ */
|
|
4598
|
-
var IconShield = ({ size = 18 }) => svg(size, /* @__PURE__ */
|
|
4599
|
-
var IconFlag = ({ size = 18 }) => svg(size, /* @__PURE__ */
|
|
4600
|
-
var IconBall = ({ size = 18 }) => svg(size, [/* @__PURE__ */
|
|
4601
|
-
var IconBoot = ({ size = 18 }) => svg(size, /* @__PURE__ */
|
|
4602
|
-
var IconGloves = ({ size = 18 }) => svg(size, /* @__PURE__ */
|
|
4603
|
-
var IconFlame = ({ size = 16 }) => svg(size, /* @__PURE__ */
|
|
4672
|
+
var IconChevronLeft = ({ size = 20 }) => svg(size, /* @__PURE__ */ jsx56("path", { d: "M15 18l-6-6 6-6" }));
|
|
4673
|
+
var IconLock = ({ size = 14 }) => svg(size, [/* @__PURE__ */ jsx56("rect", { x: "5", y: "11", width: "14", height: "10", rx: "2" }, "a"), /* @__PURE__ */ jsx56("path", { d: "M8 11V7a4 4 0 0 1 8 0v4" }, "b")]);
|
|
4674
|
+
var IconCheck = ({ size = 14 }) => svg(size, /* @__PURE__ */ jsx56("path", { d: "M5 12l5 5 9-10" }));
|
|
4675
|
+
var IconClose = ({ size = 16 }) => svg(size, /* @__PURE__ */ jsx56("path", { d: "M6 6l12 12M18 6L6 18" }));
|
|
4676
|
+
var IconSearch = ({ size = 18 }) => svg(size, [/* @__PURE__ */ jsx56("circle", { cx: "11", cy: "11", r: "7" }, "a"), /* @__PURE__ */ jsx56("path", { d: "M20 20l-3.5-3.5" }, "b")]);
|
|
4677
|
+
var IconPlus = ({ size = 20 }) => svg(size, /* @__PURE__ */ jsx56("path", { d: "M12 5v14M5 12h14" }));
|
|
4678
|
+
var IconBulb = ({ size = 16 }) => svg(size, [/* @__PURE__ */ jsx56("path", { d: "M9 18h6M10 21h4" }, "a"), /* @__PURE__ */ jsx56("path", { d: "M12 3a6 6 0 0 0-3.5 10.9V16h7v-2.1A6 6 0 0 0 12 3z" }, "b")]);
|
|
4679
|
+
var IconArrowUp = ({ size = 12 }) => svg(size, /* @__PURE__ */ jsx56("path", { d: "M12 19V5M5 12l7-7 7 7" }));
|
|
4680
|
+
var IconArrowDown = ({ size = 12 }) => svg(size, /* @__PURE__ */ jsx56("path", { d: "M12 5v14M19 12l-7 7-7-7" }));
|
|
4681
|
+
var IconCalendar = ({ size = 18 }) => svg(size, [/* @__PURE__ */ jsx56("rect", { x: "4", y: "5", width: "16", height: "15", rx: "2" }, "a"), /* @__PURE__ */ jsx56("path", { d: "M4 10h16M9 3v4M15 3v4" }, "b")]);
|
|
4682
|
+
var IconShield = ({ size = 18 }) => svg(size, /* @__PURE__ */ jsx56("path", { d: "M12 3l7 3v6c0 5-3 8-7 9-4-1-7-4-7-9V6z" }));
|
|
4683
|
+
var IconFlag = ({ size = 18 }) => svg(size, /* @__PURE__ */ jsx56("path", { d: "M5 21V4M5 4h12l-2 4 2 4H5" }));
|
|
4684
|
+
var IconBall = ({ size = 18 }) => svg(size, [/* @__PURE__ */ jsx56("circle", { cx: "12", cy: "12", r: "9" }, "a"), /* @__PURE__ */ jsx56("path", { d: "M12 7l4 3-1.5 4.5h-5L8 10z" }, "b")]);
|
|
4685
|
+
var IconBoot = ({ size = 18 }) => svg(size, /* @__PURE__ */ jsx56("path", { d: "M4 6h6l1 6 8 3v3H4z" }));
|
|
4686
|
+
var IconGloves = ({ size = 18 }) => svg(size, /* @__PURE__ */ jsx56("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" }));
|
|
4687
|
+
var IconFlame = ({ size = 16 }) => svg(size, /* @__PURE__ */ jsx56("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);
|
|
4604
4688
|
|
|
4605
4689
|
// src/components/GameTile.tsx
|
|
4606
|
-
import { Fragment as Fragment9, jsx as
|
|
4690
|
+
import { Fragment as Fragment9, jsx as jsx57, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
4607
4691
|
function tileStatus(game, ui) {
|
|
4608
4692
|
switch (game.status) {
|
|
4609
4693
|
case "locked":
|
|
@@ -4627,38 +4711,38 @@ function GameTile({ game, onOpen, ui, variant = "tile" }) {
|
|
|
4627
4711
|
const status = tileStatus(game, ui);
|
|
4628
4712
|
const disabled = DISABLED.has(game.status);
|
|
4629
4713
|
const title = gameTitle(game, ui.games.titles);
|
|
4630
|
-
const body = variant === "hero" ? /* @__PURE__ */
|
|
4631
|
-
/* @__PURE__ */
|
|
4632
|
-
/* @__PURE__ */
|
|
4633
|
-
status.tone === "new" && /* @__PURE__ */
|
|
4634
|
-
/* @__PURE__ */
|
|
4635
|
-
/* @__PURE__ */
|
|
4636
|
-
status.tone === "success" ? /* @__PURE__ */
|
|
4714
|
+
const body = variant === "hero" ? /* @__PURE__ */ jsxs50(Fragment9, { children: [
|
|
4715
|
+
/* @__PURE__ */ jsxs50("span", { className: "ss-g-hero-text", children: [
|
|
4716
|
+
/* @__PURE__ */ jsx57("span", { className: "ss-g-hero-eyebrow", children: ui.games.dailyChallenge }),
|
|
4717
|
+
status.tone === "new" && /* @__PURE__ */ jsx57(Chip, { variant: "badge", children: ui.games.newToday }),
|
|
4718
|
+
/* @__PURE__ */ jsx57("span", { className: "ss-g-hero-title", children: title }),
|
|
4719
|
+
/* @__PURE__ */ jsx57("span", { className: "ss-g-hero-sub", children: ui.games.taglines[game.gameId] ?? "" }),
|
|
4720
|
+
status.tone === "success" ? /* @__PURE__ */ jsx57("span", { className: "ss-g-tile-status", "data-tone": "success", children: status.text }) : /* @__PURE__ */ jsxs50("span", { className: "ss-g-hero-cta", children: [
|
|
4637
4721
|
status.tone === "accent" ? ui.games.resume : ui.games.playNow,
|
|
4638
4722
|
" \u2192"
|
|
4639
4723
|
] })
|
|
4640
4724
|
] }),
|
|
4641
|
-
/* @__PURE__ */
|
|
4642
|
-
] }) : variant === "wide" ? /* @__PURE__ */
|
|
4643
|
-
/* @__PURE__ */
|
|
4644
|
-
/* @__PURE__ */
|
|
4645
|
-
/* @__PURE__ */
|
|
4646
|
-
/* @__PURE__ */
|
|
4647
|
-
status.tone === "new" && /* @__PURE__ */
|
|
4725
|
+
/* @__PURE__ */ jsx57("span", { className: "ss-g-hero-art", children: /* @__PURE__ */ jsx57(GameTileArt, { gameId: game.gameId }) })
|
|
4726
|
+
] }) : variant === "wide" ? /* @__PURE__ */ jsxs50(Fragment9, { children: [
|
|
4727
|
+
/* @__PURE__ */ jsx57("span", { className: "ss-g-wide-art", children: /* @__PURE__ */ jsx57(GameTileArt, { gameId: game.gameId }) }),
|
|
4728
|
+
/* @__PURE__ */ jsxs50("span", { className: "ss-g-wide-text", children: [
|
|
4729
|
+
/* @__PURE__ */ jsx57("span", { className: "ss-g-tile-title", children: title }),
|
|
4730
|
+
/* @__PURE__ */ jsx57("span", { className: "ss-g-tile-status", "data-tone": status.tone, children: status.text }),
|
|
4731
|
+
status.tone === "new" && /* @__PURE__ */ jsx57(Chip, { variant: "badge", children: ui.games.newToday })
|
|
4648
4732
|
] }),
|
|
4649
|
-
/* @__PURE__ */
|
|
4650
|
-
] }) : /* @__PURE__ */
|
|
4651
|
-
/* @__PURE__ */
|
|
4652
|
-
/* @__PURE__ */
|
|
4653
|
-
/* @__PURE__ */
|
|
4733
|
+
/* @__PURE__ */ jsx57("span", { className: "ss-g-wide-chev", children: /* @__PURE__ */ jsx57(IconChevronLeft, { size: 18 }) })
|
|
4734
|
+
] }) : /* @__PURE__ */ jsxs50(Fragment9, { children: [
|
|
4735
|
+
/* @__PURE__ */ jsx57("span", { className: "ss-g-tile-art", children: /* @__PURE__ */ jsx57(GameTileArt, { gameId: game.gameId }) }),
|
|
4736
|
+
/* @__PURE__ */ jsx57("span", { className: "ss-g-tile-title", children: title }),
|
|
4737
|
+
/* @__PURE__ */ jsx57("span", { className: "ss-g-tile-status", "data-tone": status.tone, children: status.text })
|
|
4654
4738
|
] });
|
|
4655
4739
|
const cls = `ss-g-tile ss-g-tile--${variant}`;
|
|
4656
|
-
if (disabled) return /* @__PURE__ */
|
|
4657
|
-
return /* @__PURE__ */
|
|
4740
|
+
if (disabled) return /* @__PURE__ */ jsx57("div", { className: cls, "data-disabled": true, "aria-disabled": "true", children: body });
|
|
4741
|
+
return /* @__PURE__ */ jsx57("button", { type: "button", className: cls, "aria-label": `${title} \u2014 ${status.text}`, onClick: () => onOpen(game), children: body });
|
|
4658
4742
|
}
|
|
4659
4743
|
|
|
4660
4744
|
// src/components/GamesHub.tsx
|
|
4661
|
-
import { Fragment as Fragment10, jsx as
|
|
4745
|
+
import { Fragment as Fragment10, jsx as jsx58, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
4662
4746
|
var PLAYABLE = /* @__PURE__ */ new Set(["available", "in_progress"]);
|
|
4663
4747
|
var DONE = /* @__PURE__ */ new Set(["played", "graded"]);
|
|
4664
4748
|
function pickHeroGame(games) {
|
|
@@ -4671,7 +4755,7 @@ function pickHeroGame(games) {
|
|
|
4671
4755
|
}
|
|
4672
4756
|
var tileKey = (g) => `${g.gameId}-${g.gameDay}-${g.fixtureId}`;
|
|
4673
4757
|
function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
4674
|
-
const [, setTick] =
|
|
4758
|
+
const [, setTick] = useState23(0);
|
|
4675
4759
|
useEffect14(() => {
|
|
4676
4760
|
const id = setInterval(() => setTick((t) => t + 1), 6e4);
|
|
4677
4761
|
return () => clearInterval(id);
|
|
@@ -4684,58 +4768,58 @@ function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
|
4684
4768
|
const kickoffs = fixtures.map((g) => g.kickoffUtc).filter((k) => !!k).sort();
|
|
4685
4769
|
const todayPts = games.filter((g) => DONE.has(g.status)).reduce((s, g) => s + (g.score ?? 0), 0);
|
|
4686
4770
|
const dash = "\u2014";
|
|
4687
|
-
return /* @__PURE__ */
|
|
4688
|
-
/* @__PURE__ */
|
|
4689
|
-
/* @__PURE__ */
|
|
4690
|
-
/* @__PURE__ */
|
|
4691
|
-
/* @__PURE__ */
|
|
4692
|
-
myWeeklyRow ? /* @__PURE__ */
|
|
4693
|
-
/* @__PURE__ */
|
|
4771
|
+
return /* @__PURE__ */ jsxs51("div", { className: "ss-g-hub", children: [
|
|
4772
|
+
/* @__PURE__ */ jsxs51("div", { className: "ss-g-stats", children: [
|
|
4773
|
+
/* @__PURE__ */ jsxs51("div", { className: "ss-g-stat", children: [
|
|
4774
|
+
/* @__PURE__ */ jsx58("span", { className: "ss-g-stat-l", children: ui.games.statStreak }),
|
|
4775
|
+
/* @__PURE__ */ jsxs51("span", { className: "ss-g-stat-v", "data-testid": "stat-streak", children: [
|
|
4776
|
+
myWeeklyRow ? /* @__PURE__ */ jsxs51(Fragment10, { children: [
|
|
4777
|
+
/* @__PURE__ */ jsx58(IconFlame, {}),
|
|
4694
4778
|
myWeeklyRow.currentStreak
|
|
4695
4779
|
] }) : dash,
|
|
4696
|
-
myWeeklyRow && /* @__PURE__ */
|
|
4780
|
+
myWeeklyRow && /* @__PURE__ */ jsx58("small", { children: ui.games.unitDays })
|
|
4697
4781
|
] })
|
|
4698
4782
|
] }),
|
|
4699
|
-
/* @__PURE__ */
|
|
4700
|
-
/* @__PURE__ */
|
|
4701
|
-
/* @__PURE__ */
|
|
4783
|
+
/* @__PURE__ */ jsxs51("div", { className: "ss-g-stat", children: [
|
|
4784
|
+
/* @__PURE__ */ jsx58("span", { className: "ss-g-stat-l", children: ui.games.statToday }),
|
|
4785
|
+
/* @__PURE__ */ jsxs51("span", { className: "ss-g-stat-v ss-g-stat-v--accent", "data-testid": "stat-today", children: [
|
|
4702
4786
|
ui.games.formatPts(todayPts),
|
|
4703
|
-
/* @__PURE__ */
|
|
4787
|
+
/* @__PURE__ */ jsx58("small", { children: ui.games.unitPts })
|
|
4704
4788
|
] })
|
|
4705
4789
|
] }),
|
|
4706
|
-
/* @__PURE__ */
|
|
4707
|
-
/* @__PURE__ */
|
|
4708
|
-
/* @__PURE__ */
|
|
4790
|
+
/* @__PURE__ */ jsxs51("div", { className: "ss-g-stat", children: [
|
|
4791
|
+
/* @__PURE__ */ jsx58("span", { className: "ss-g-stat-l", children: ui.games.statRank }),
|
|
4792
|
+
/* @__PURE__ */ jsxs51("span", { className: "ss-g-stat-v", "data-testid": "stat-rank", children: [
|
|
4709
4793
|
myWeeklyRow ? `#${myWeeklyRow.rank}` : dash,
|
|
4710
|
-
myWeeklyRow && /* @__PURE__ */
|
|
4794
|
+
myWeeklyRow && /* @__PURE__ */ jsx58("small", { children: ui.games.thisWeek })
|
|
4711
4795
|
] })
|
|
4712
4796
|
] })
|
|
4713
4797
|
] }),
|
|
4714
|
-
weeklyPrize && /* @__PURE__ */
|
|
4715
|
-
hero && /* @__PURE__ */
|
|
4716
|
-
(grid.length > 0 || wide) && /* @__PURE__ */
|
|
4717
|
-
/* @__PURE__ */
|
|
4718
|
-
/* @__PURE__ */
|
|
4719
|
-
/* @__PURE__ */
|
|
4798
|
+
weeklyPrize && /* @__PURE__ */ jsx58(Chip, { variant: "accent", className: "ss-g-prize", children: weeklyPrize }),
|
|
4799
|
+
hero && /* @__PURE__ */ jsx58(GameTile, { game: hero, onOpen, ui, variant: "hero" }),
|
|
4800
|
+
(grid.length > 0 || wide) && /* @__PURE__ */ jsxs51("section", { className: "ss-g-sec", children: [
|
|
4801
|
+
/* @__PURE__ */ jsxs51("div", { className: "ss-g-sec-head", children: [
|
|
4802
|
+
/* @__PURE__ */ jsx58("h3", { children: ui.games.dailyGames }),
|
|
4803
|
+
/* @__PURE__ */ jsx58("span", { children: ui.games.newSetAtMidnight })
|
|
4720
4804
|
] }),
|
|
4721
|
-
grid.length > 0 && /* @__PURE__ */
|
|
4722
|
-
wide && /* @__PURE__ */
|
|
4805
|
+
grid.length > 0 && /* @__PURE__ */ jsx58("div", { className: "ss-g-grid", children: grid.map((g) => /* @__PURE__ */ jsx58(GameTile, { game: g, onOpen, ui }, tileKey(g))) }),
|
|
4806
|
+
wide && /* @__PURE__ */ jsx58(GameTile, { game: wide, onOpen, ui, variant: "wide" })
|
|
4723
4807
|
] }),
|
|
4724
|
-
fixtures.length > 0 && /* @__PURE__ */
|
|
4725
|
-
/* @__PURE__ */
|
|
4726
|
-
/* @__PURE__ */
|
|
4727
|
-
kickoffs[0] && /* @__PURE__ */
|
|
4808
|
+
fixtures.length > 0 && /* @__PURE__ */ jsxs51("section", { className: "ss-g-sec", children: [
|
|
4809
|
+
/* @__PURE__ */ jsxs51("div", { className: "ss-g-sec-head", children: [
|
|
4810
|
+
/* @__PURE__ */ jsx58("h3", { children: ui.games.matchdayGames }),
|
|
4811
|
+
kickoffs[0] && /* @__PURE__ */ jsx58("span", { children: ui.games.kickoffAt(ui.games.formatDayTime(kickoffs[0])) })
|
|
4728
4812
|
] }),
|
|
4729
|
-
/* @__PURE__ */
|
|
4813
|
+
/* @__PURE__ */ jsx58("div", { className: "ss-g-grid", children: fixtures.map((g) => /* @__PURE__ */ jsx58(GameTile, { game: g, onOpen, ui }, tileKey(g))) })
|
|
4730
4814
|
] })
|
|
4731
4815
|
] });
|
|
4732
4816
|
}
|
|
4733
4817
|
|
|
4734
4818
|
// src/components/GameScreenHost.tsx
|
|
4735
|
-
import { useEffect as useEffect16, useRef as useRef14, useState as
|
|
4819
|
+
import { useEffect as useEffect16, useRef as useRef14, useState as useState35 } from "react";
|
|
4736
4820
|
|
|
4737
4821
|
// src/useGamePlay.ts
|
|
4738
|
-
import { useCallback as useCallback9, useRef as useRef12, useState as
|
|
4822
|
+
import { useCallback as useCallback9, useRef as useRef12, useState as useState24 } from "react";
|
|
4739
4823
|
function toSubmitResult(payload) {
|
|
4740
4824
|
return {
|
|
4741
4825
|
// 'pending' means the play is recorded but awaiting resolution (fixture games)
|
|
@@ -4747,9 +4831,9 @@ function toSubmitResult(payload) {
|
|
|
4747
4831
|
};
|
|
4748
4832
|
}
|
|
4749
4833
|
function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh }) {
|
|
4750
|
-
const [result, setResult] =
|
|
4751
|
-
const [submitting, setSubmitting] =
|
|
4752
|
-
const [rawStatus, setRawStatus] =
|
|
4834
|
+
const [result, setResult] = useState24(null);
|
|
4835
|
+
const [submitting, setSubmitting] = useState24(false);
|
|
4836
|
+
const [rawStatus, setRawStatus] = useState24(null);
|
|
4753
4837
|
const inFlightRef = useRef12(false);
|
|
4754
4838
|
const convRef = useRef12(conversation);
|
|
4755
4839
|
convRef.current = conversation;
|
|
@@ -4807,7 +4891,7 @@ function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh
|
|
|
4807
4891
|
}
|
|
4808
4892
|
|
|
4809
4893
|
// src/components/games/MysteryTigerGame.tsx
|
|
4810
|
-
import { useState as
|
|
4894
|
+
import { useState as useState26, useId as useId2 } from "react";
|
|
4811
4895
|
|
|
4812
4896
|
// src/components/games/nationFlags.ts
|
|
4813
4897
|
var FLAGS = {
|
|
@@ -5018,8 +5102,8 @@ function isNationCode(flag) {
|
|
|
5018
5102
|
}
|
|
5019
5103
|
|
|
5020
5104
|
// src/components/games/PlayerAvatar.tsx
|
|
5021
|
-
import { useState as
|
|
5022
|
-
import { jsx as
|
|
5105
|
+
import { useState as useState25 } from "react";
|
|
5106
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
5023
5107
|
function initialsOf(name) {
|
|
5024
5108
|
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
5025
5109
|
const first = parts[0];
|
|
@@ -5036,41 +5120,41 @@ function PlayerAvatar({
|
|
|
5036
5120
|
imagePath,
|
|
5037
5121
|
className
|
|
5038
5122
|
}) {
|
|
5039
|
-
const [failed, setFailed] =
|
|
5123
|
+
const [failed, setFailed] = useState25(false);
|
|
5040
5124
|
const showImage = Boolean(imagePath) && !isPlaceholderImage(imagePath) && !failed;
|
|
5041
|
-
return /* @__PURE__ */
|
|
5125
|
+
return /* @__PURE__ */ jsx59("div", { className, "aria-hidden": "true", children: showImage ? /* @__PURE__ */ jsx59("img", { src: imagePath, alt: "", loading: "lazy", onError: () => setFailed(true) }) : /* @__PURE__ */ jsx59("span", { className: "ss-w-av-initials", children: initialsOf(name) }) });
|
|
5042
5126
|
}
|
|
5043
5127
|
|
|
5044
5128
|
// src/components/games/ui/GameHeader.tsx
|
|
5045
|
-
import { jsx as
|
|
5129
|
+
import { jsx as jsx60, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
5046
5130
|
function GameHeader({ title, eyebrow, right, onBack, backLabel }) {
|
|
5047
|
-
return /* @__PURE__ */
|
|
5048
|
-
onBack && /* @__PURE__ */
|
|
5049
|
-
/* @__PURE__ */
|
|
5050
|
-
eyebrow && /* @__PURE__ */
|
|
5051
|
-
/* @__PURE__ */
|
|
5131
|
+
return /* @__PURE__ */ jsxs52("div", { className: "ss-g-head", children: [
|
|
5132
|
+
onBack && /* @__PURE__ */ jsx60("button", { type: "button", className: "ss-g-back", "aria-label": backLabel, onClick: onBack, children: /* @__PURE__ */ jsx60(IconChevronLeft, {}) }),
|
|
5133
|
+
/* @__PURE__ */ jsxs52("div", { className: "ss-g-head-text", children: [
|
|
5134
|
+
eyebrow && /* @__PURE__ */ jsx60("span", { className: "ss-g-eyebrow", children: eyebrow }),
|
|
5135
|
+
/* @__PURE__ */ jsx60("h2", { className: "ss-g-title", children: title })
|
|
5052
5136
|
] }),
|
|
5053
|
-
right && /* @__PURE__ */
|
|
5137
|
+
right && /* @__PURE__ */ jsx60("div", { className: "ss-g-head-right", children: right })
|
|
5054
5138
|
] });
|
|
5055
5139
|
}
|
|
5056
5140
|
|
|
5057
5141
|
// src/components/games/ui/SegmentProgress.tsx
|
|
5058
|
-
import { jsx as
|
|
5142
|
+
import { jsx as jsx61, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
5059
5143
|
function SegmentProgress({ segments, ariaLabel, leftLabel, rightLabel, right }) {
|
|
5060
|
-
return /* @__PURE__ */
|
|
5061
|
-
/* @__PURE__ */
|
|
5062
|
-
(leftLabel || rightLabel) && /* @__PURE__ */
|
|
5063
|
-
/* @__PURE__ */
|
|
5064
|
-
/* @__PURE__ */
|
|
5144
|
+
return /* @__PURE__ */ jsxs53("div", { className: "ss-g-progress", children: [
|
|
5145
|
+
/* @__PURE__ */ jsxs53("div", { className: "ss-g-progress-main", children: [
|
|
5146
|
+
(leftLabel || rightLabel) && /* @__PURE__ */ jsxs53("div", { className: "ss-g-progress-labels", children: [
|
|
5147
|
+
/* @__PURE__ */ jsx61("span", { children: leftLabel }),
|
|
5148
|
+
/* @__PURE__ */ jsx61("span", { className: "ss-g-progress-rl", children: rightLabel })
|
|
5065
5149
|
] }),
|
|
5066
|
-
/* @__PURE__ */
|
|
5150
|
+
/* @__PURE__ */ jsx61(
|
|
5067
5151
|
"div",
|
|
5068
5152
|
{
|
|
5069
5153
|
className: "ss-g-segs",
|
|
5070
5154
|
role: "img",
|
|
5071
5155
|
"aria-label": ariaLabel,
|
|
5072
5156
|
style: { gridTemplateColumns: `repeat(${segments.length}, minmax(0, 1fr))` },
|
|
5073
|
-
children: segments.map((s, i) => /* @__PURE__ */
|
|
5157
|
+
children: segments.map((s, i) => /* @__PURE__ */ jsx61("span", { className: "ss-g-seg", "data-state": s }, i))
|
|
5074
5158
|
}
|
|
5075
5159
|
)
|
|
5076
5160
|
] }),
|
|
@@ -5079,13 +5163,13 @@ function SegmentProgress({ segments, ariaLabel, leftLabel, rightLabel, right })
|
|
|
5079
5163
|
}
|
|
5080
5164
|
|
|
5081
5165
|
// src/components/games/ui/SearchField.tsx
|
|
5082
|
-
import { jsx as
|
|
5166
|
+
import { jsx as jsx62, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
5083
5167
|
function SearchField({ id, label, labelHidden = false, placeholder, value, onChange, disabled, inputRef, onKeyDown }) {
|
|
5084
|
-
return /* @__PURE__ */
|
|
5085
|
-
/* @__PURE__ */
|
|
5086
|
-
/* @__PURE__ */
|
|
5087
|
-
/* @__PURE__ */
|
|
5088
|
-
/* @__PURE__ */
|
|
5168
|
+
return /* @__PURE__ */ jsxs54("div", { className: "ss-g-search", children: [
|
|
5169
|
+
/* @__PURE__ */ jsx62("label", { htmlFor: id, className: labelHidden ? "ss-g-sr" : "ss-g-search-label", children: label }),
|
|
5170
|
+
/* @__PURE__ */ jsxs54("div", { className: "ss-g-search-box", children: [
|
|
5171
|
+
/* @__PURE__ */ jsx62(IconSearch, {}),
|
|
5172
|
+
/* @__PURE__ */ jsx62(
|
|
5089
5173
|
"input",
|
|
5090
5174
|
{
|
|
5091
5175
|
id,
|
|
@@ -5104,52 +5188,52 @@ function SearchField({ id, label, labelHidden = false, placeholder, value, onCha
|
|
|
5104
5188
|
}
|
|
5105
5189
|
|
|
5106
5190
|
// src/components/games/ui/FooterBar.tsx
|
|
5107
|
-
import { jsx as
|
|
5191
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
5108
5192
|
function FooterBar({ children }) {
|
|
5109
|
-
return /* @__PURE__ */
|
|
5193
|
+
return /* @__PURE__ */ jsx63("div", { className: "ss-g-footer", children });
|
|
5110
5194
|
}
|
|
5111
5195
|
|
|
5112
5196
|
// src/components/games/ui/Silhouette.tsx
|
|
5113
|
-
import { jsx as
|
|
5197
|
+
import { jsx as jsx64, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
5114
5198
|
function Silhouette({ size, variant = "default" }) {
|
|
5115
|
-
return /* @__PURE__ */
|
|
5116
|
-
/* @__PURE__ */
|
|
5117
|
-
/* @__PURE__ */
|
|
5118
|
-
/* @__PURE__ */
|
|
5199
|
+
return /* @__PURE__ */ jsxs55("span", { className: `ss-g-sil ss-g-sil--${variant}`, style: { width: size, height: size }, "aria-hidden": "true", children: [
|
|
5200
|
+
/* @__PURE__ */ jsxs55("svg", { width: size * 0.86, height: size * 0.86, viewBox: "0 0 100 100", children: [
|
|
5201
|
+
/* @__PURE__ */ jsx64("circle", { cx: "50", cy: "40", r: "19", fill: "currentColor" }),
|
|
5202
|
+
/* @__PURE__ */ jsx64("path", { d: "M12 100c0-23 17-38 38-38s38 15 38 38z", fill: "currentColor" })
|
|
5119
5203
|
] }),
|
|
5120
|
-
variant === "mystery" && /* @__PURE__ */
|
|
5204
|
+
variant === "mystery" && /* @__PURE__ */ jsx64("span", { className: "ss-g-sil-q", children: "?" })
|
|
5121
5205
|
] });
|
|
5122
5206
|
}
|
|
5123
5207
|
|
|
5124
5208
|
// src/components/games/ui/GameButton.tsx
|
|
5125
|
-
import { jsx as
|
|
5209
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
5126
5210
|
function GameButton({ variant = "primary", block = false, className, type = "button", ...rest }) {
|
|
5127
5211
|
const cls = `ss-g-btn ss-g-btn--${variant}${block ? " ss-g-btn--block" : ""}${className ? ` ${className}` : ""}`;
|
|
5128
|
-
return /* @__PURE__ */
|
|
5212
|
+
return /* @__PURE__ */ jsx65("button", { type, className: cls, ...rest });
|
|
5129
5213
|
}
|
|
5130
5214
|
|
|
5131
5215
|
// src/components/games/ui/ResultCard.tsx
|
|
5132
|
-
import { jsx as
|
|
5216
|
+
import { jsx as jsx66, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
5133
5217
|
function ResultCard({ tone, title, score, detail, onBack, ui }) {
|
|
5134
|
-
return /* @__PURE__ */
|
|
5135
|
-
/* @__PURE__ */
|
|
5136
|
-
score !== void 0 && /* @__PURE__ */
|
|
5137
|
-
/* @__PURE__ */
|
|
5218
|
+
return /* @__PURE__ */ jsxs56("div", { className: "ss-g-result", "data-tone": tone, role: "status", children: [
|
|
5219
|
+
/* @__PURE__ */ jsx66("span", { className: "ss-g-result-title", children: title }),
|
|
5220
|
+
score !== void 0 && /* @__PURE__ */ jsxs56("span", { className: "ss-g-result-score", children: [
|
|
5221
|
+
/* @__PURE__ */ jsx66("span", { className: "ss-g-result-num", children: score }),
|
|
5138
5222
|
ui.games.unitPts
|
|
5139
5223
|
] }),
|
|
5140
|
-
detail && /* @__PURE__ */
|
|
5141
|
-
onBack && /* @__PURE__ */
|
|
5224
|
+
detail && /* @__PURE__ */ jsx66("span", { className: "ss-g-result-detail", children: detail }),
|
|
5225
|
+
onBack && /* @__PURE__ */ jsx66(GameButton, { variant: "outline", onClick: onBack, children: ui.games.backToGames })
|
|
5142
5226
|
] });
|
|
5143
5227
|
}
|
|
5144
5228
|
|
|
5145
5229
|
// src/components/games/ui/OptionList.tsx
|
|
5146
|
-
import { jsx as
|
|
5230
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
5147
5231
|
function OptionList({ label, options, onPick }) {
|
|
5148
|
-
return /* @__PURE__ */
|
|
5232
|
+
return /* @__PURE__ */ jsx67("div", { className: "ss-g-opts", role: "listbox", "aria-label": label, children: options.map((o) => /* @__PURE__ */ jsx67("button", { type: "button", role: "option", "aria-selected": false, className: "ss-g-opt", onClick: () => onPick(o.key), children: o.content }, o.key)) });
|
|
5149
5233
|
}
|
|
5150
5234
|
|
|
5151
5235
|
// src/components/games/MysteryTigerGame.tsx
|
|
5152
|
-
import { Fragment as Fragment11, jsx as
|
|
5236
|
+
import { Fragment as Fragment11, jsx as jsx68, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
5153
5237
|
function parseClientState(json) {
|
|
5154
5238
|
if (!json) return null;
|
|
5155
5239
|
try {
|
|
@@ -5251,7 +5335,7 @@ function MysteryTigerGame({
|
|
|
5251
5335
|
onBack
|
|
5252
5336
|
}) {
|
|
5253
5337
|
const t = ui.games.mysteryTiger;
|
|
5254
|
-
const [query, setQuery] =
|
|
5338
|
+
const [query, setQuery] = useState26("");
|
|
5255
5339
|
const inputId = useId2();
|
|
5256
5340
|
const clientState = parseClientState(result?.clientStateJson);
|
|
5257
5341
|
const guessResults = clientState?.guessResults ?? [];
|
|
@@ -5273,22 +5357,22 @@ function MysteryTigerGame({
|
|
|
5273
5357
|
setQuery("");
|
|
5274
5358
|
onSubmit(JSON.stringify({ guesses: newGuesses }));
|
|
5275
5359
|
}
|
|
5276
|
-
const headerRight = !config ? void 0 : isOver ? /* @__PURE__ */
|
|
5360
|
+
const headerRight = !config ? void 0 : isOver ? /* @__PURE__ */ jsxs57(Chip, { variant: "accent", children: [
|
|
5277
5361
|
score,
|
|
5278
5362
|
" ",
|
|
5279
5363
|
ui.games.unitPts
|
|
5280
|
-
] }) : /* @__PURE__ */
|
|
5364
|
+
] }) : /* @__PURE__ */ jsx68("span", { "data-testid": "mt-chip", children: /* @__PURE__ */ jsxs57(Chip, { children: [
|
|
5281
5365
|
ui.games.guess,
|
|
5282
5366
|
" ",
|
|
5283
|
-
/* @__PURE__ */
|
|
5367
|
+
/* @__PURE__ */ jsx68("span", { className: "ss-g-num", children: guessesUsed + 1 }),
|
|
5284
5368
|
" / ",
|
|
5285
5369
|
totalGuesses
|
|
5286
5370
|
] }) });
|
|
5287
5371
|
const segments = Array.from({ length: totalGuesses }, (_, i) => i < guessesUsed ? "done" : i === guessesUsed ? "current" : "todo");
|
|
5288
5372
|
const cols = { gridTemplateColumns: `minmax(0, 1fr) repeat(${keys.length}, 42px)` };
|
|
5289
5373
|
const known = deriveKnownAttributes(guessResults, keys);
|
|
5290
|
-
return /* @__PURE__ */
|
|
5291
|
-
/* @__PURE__ */
|
|
5374
|
+
return /* @__PURE__ */ jsxs57("div", { className: "ss-g-screen ss-g-mt", "data-testid": "game-screen-mystery-tiger", children: [
|
|
5375
|
+
/* @__PURE__ */ jsx68(
|
|
5292
5376
|
GameHeader,
|
|
5293
5377
|
{
|
|
5294
5378
|
title: gameTitle({ gameId: "mystery-tiger" }, ui.games.titles),
|
|
@@ -5298,40 +5382,40 @@ function MysteryTigerGame({
|
|
|
5298
5382
|
backLabel: ui.back
|
|
5299
5383
|
}
|
|
5300
5384
|
),
|
|
5301
|
-
!config && /* @__PURE__ */
|
|
5302
|
-
config && /* @__PURE__ */
|
|
5303
|
-
/* @__PURE__ */
|
|
5304
|
-
/* @__PURE__ */
|
|
5305
|
-
/* @__PURE__ */
|
|
5306
|
-
revealName ? /* @__PURE__ */
|
|
5307
|
-
revealName && /* @__PURE__ */
|
|
5385
|
+
!config && /* @__PURE__ */ jsx68("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading }),
|
|
5386
|
+
config && /* @__PURE__ */ jsxs57(Fragment11, { children: [
|
|
5387
|
+
/* @__PURE__ */ jsxs57("div", { className: "ss-g-body", children: [
|
|
5388
|
+
/* @__PURE__ */ jsxs57("div", { className: `ss-g-mt-card${isOver ? " ss-g-mt-card--reveal" : ""}`, children: [
|
|
5389
|
+
/* @__PURE__ */ jsxs57("div", { className: "ss-g-mt-portrait", children: [
|
|
5390
|
+
revealName ? /* @__PURE__ */ jsx68(PlayerAvatar, { className: "ss-g-mt-photo", name: revealName, imagePath: clientState?.revealedPlayerImagePath }) : /* @__PURE__ */ jsx68(Silhouette, { size: 150, variant: "mystery" }),
|
|
5391
|
+
revealName && /* @__PURE__ */ jsx68("span", { className: "ss-g-mt-reveal-name", children: revealName })
|
|
5308
5392
|
] }),
|
|
5309
|
-
/* @__PURE__ */
|
|
5310
|
-
/* @__PURE__ */
|
|
5311
|
-
/* @__PURE__ */
|
|
5393
|
+
/* @__PURE__ */ jsx68("div", { className: "ss-g-mt-known", style: { gridTemplateColumns: `repeat(${keys.length}, minmax(0, 1fr))` }, children: known.map((k) => /* @__PURE__ */ jsxs57("div", { className: "ss-g-mt-known-cell", children: [
|
|
5394
|
+
/* @__PURE__ */ jsx68("span", { className: "ss-g-mt-lab", children: t.labels[k.key] }),
|
|
5395
|
+
/* @__PURE__ */ jsx68("span", { className: "ss-g-mt-known-v", "data-state": k.state, "data-testid": `known-${k.key}`, children: k.text })
|
|
5312
5396
|
] }, k.key)) })
|
|
5313
5397
|
] }),
|
|
5314
|
-
!isOver && /* @__PURE__ */
|
|
5315
|
-
guessResults.length > 0 && /* @__PURE__ */
|
|
5316
|
-
/* @__PURE__ */
|
|
5317
|
-
/* @__PURE__ */
|
|
5318
|
-
keys.map((k) => /* @__PURE__ */
|
|
5398
|
+
!isOver && /* @__PURE__ */ jsx68(SegmentProgress, { segments, ariaLabel: t.progress(guessesUsed, totalGuesses) }),
|
|
5399
|
+
guessResults.length > 0 && /* @__PURE__ */ jsxs57("div", { className: "ss-g-mt-table", children: [
|
|
5400
|
+
/* @__PURE__ */ jsxs57("div", { className: "ss-g-mt-thead", style: cols, children: [
|
|
5401
|
+
/* @__PURE__ */ jsx68("span", { children: t.yourGuesses }),
|
|
5402
|
+
keys.map((k) => /* @__PURE__ */ jsx68("span", { children: t.labels[k] }, k))
|
|
5319
5403
|
] }),
|
|
5320
5404
|
guessResults.map((gr, i) => {
|
|
5321
5405
|
const name = config.squadPlayers.find((p) => p.id === gr.playerId)?.name ?? `#${gr.playerId}`;
|
|
5322
5406
|
const { first, last } = splitName(name);
|
|
5323
|
-
return /* @__PURE__ */
|
|
5324
|
-
/* @__PURE__ */
|
|
5325
|
-
/* @__PURE__ */
|
|
5326
|
-
/* @__PURE__ */
|
|
5327
|
-
first && /* @__PURE__ */
|
|
5328
|
-
/* @__PURE__ */
|
|
5407
|
+
return /* @__PURE__ */ jsxs57("div", { className: "ss-g-mt-row", style: cols, children: [
|
|
5408
|
+
/* @__PURE__ */ jsxs57("div", { className: "ss-g-mt-who", children: [
|
|
5409
|
+
/* @__PURE__ */ jsx68(PlayerAvatar, { className: "ss-g-mt-av", name }),
|
|
5410
|
+
/* @__PURE__ */ jsxs57("span", { className: "ss-g-mt-names", children: [
|
|
5411
|
+
first && /* @__PURE__ */ jsx68("span", { className: "ss-g-mt-first", children: first }),
|
|
5412
|
+
/* @__PURE__ */ jsx68("span", { className: "ss-g-mt-last", children: last })
|
|
5329
5413
|
] })
|
|
5330
5414
|
] }),
|
|
5331
5415
|
keys.map((key) => {
|
|
5332
5416
|
const v = gr[key];
|
|
5333
5417
|
const arrow = directionArrow(v);
|
|
5334
|
-
return /* @__PURE__ */
|
|
5418
|
+
return /* @__PURE__ */ jsxs57(
|
|
5335
5419
|
"div",
|
|
5336
5420
|
{
|
|
5337
5421
|
className: "ss-g-mt-cell",
|
|
@@ -5339,8 +5423,8 @@ function MysteryTigerGame({
|
|
|
5339
5423
|
"data-verdict": v.verdict,
|
|
5340
5424
|
"aria-label": `${t.labels[key]}: ${v.value ?? v.verdict}${v.direction ? ` ${v.direction}` : ""}`,
|
|
5341
5425
|
children: [
|
|
5342
|
-
/* @__PURE__ */
|
|
5343
|
-
arrow && /* @__PURE__ */
|
|
5426
|
+
/* @__PURE__ */ jsx68("span", { className: "ss-g-mt-cell-v", "aria-hidden": "true", children: tileFace(key, v) }),
|
|
5427
|
+
arrow && /* @__PURE__ */ jsx68("span", { className: "ss-g-mt-cell-dir", "aria-hidden": "true", children: arrow })
|
|
5344
5428
|
]
|
|
5345
5429
|
},
|
|
5346
5430
|
key
|
|
@@ -5349,25 +5433,25 @@ function MysteryTigerGame({
|
|
|
5349
5433
|
] }, gr.playerId);
|
|
5350
5434
|
})
|
|
5351
5435
|
] }),
|
|
5352
|
-
!isOver && /* @__PURE__ */
|
|
5353
|
-
/* @__PURE__ */
|
|
5354
|
-
/* @__PURE__ */
|
|
5436
|
+
!isOver && /* @__PURE__ */ jsxs57("div", { className: "ss-g-mt-legend", children: [
|
|
5437
|
+
/* @__PURE__ */ jsxs57("span", { children: [
|
|
5438
|
+
/* @__PURE__ */ jsx68("i", { className: "ss-g-mt-sw", "data-verdict": "exact" }),
|
|
5355
5439
|
t.legendMatch
|
|
5356
5440
|
] }),
|
|
5357
|
-
/* @__PURE__ */
|
|
5358
|
-
/* @__PURE__ */
|
|
5441
|
+
/* @__PURE__ */ jsxs57("span", { children: [
|
|
5442
|
+
/* @__PURE__ */ jsx68("i", { className: "ss-g-mt-sw", "data-verdict": "near" }),
|
|
5359
5443
|
t.legendClose
|
|
5360
5444
|
] }),
|
|
5361
|
-
/* @__PURE__ */
|
|
5445
|
+
/* @__PURE__ */ jsxs57("span", { children: [
|
|
5362
5446
|
"\u25B2 ",
|
|
5363
5447
|
t.legendHigher
|
|
5364
5448
|
] })
|
|
5365
5449
|
] }),
|
|
5366
|
-
clientState?.hintLine && !isOver && /* @__PURE__ */
|
|
5367
|
-
/* @__PURE__ */
|
|
5368
|
-
/* @__PURE__ */
|
|
5450
|
+
clientState?.hintLine && !isOver && /* @__PURE__ */ jsxs57("div", { className: "ss-g-mt-hint", children: [
|
|
5451
|
+
/* @__PURE__ */ jsx68(IconBulb, {}),
|
|
5452
|
+
/* @__PURE__ */ jsx68("span", { children: clientState.hintLine })
|
|
5369
5453
|
] }),
|
|
5370
|
-
isOver && /* @__PURE__ */
|
|
5454
|
+
isOver && /* @__PURE__ */ jsx68(
|
|
5371
5455
|
ResultCard,
|
|
5372
5456
|
{
|
|
5373
5457
|
tone: clientState?.solved ? "win" : clientState?.failed ? "lose" : "neutral",
|
|
@@ -5379,22 +5463,22 @@ function MysteryTigerGame({
|
|
|
5379
5463
|
}
|
|
5380
5464
|
)
|
|
5381
5465
|
] }),
|
|
5382
|
-
!isOver && /* @__PURE__ */
|
|
5383
|
-
query.length > 0 && filtered.length > 0 && /* @__PURE__ */
|
|
5466
|
+
!isOver && /* @__PURE__ */ jsxs57(FooterBar, { children: [
|
|
5467
|
+
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ jsx68(
|
|
5384
5468
|
OptionList,
|
|
5385
5469
|
{
|
|
5386
5470
|
label: t.optionsLabel,
|
|
5387
5471
|
options: filtered.map((p) => ({
|
|
5388
5472
|
key: p.id,
|
|
5389
|
-
content: /* @__PURE__ */
|
|
5390
|
-
/* @__PURE__ */
|
|
5391
|
-
/* @__PURE__ */
|
|
5473
|
+
content: /* @__PURE__ */ jsxs57(Fragment11, { children: [
|
|
5474
|
+
/* @__PURE__ */ jsx68(PlayerAvatar, { className: "ss-g-opt-av", name: p.name }),
|
|
5475
|
+
/* @__PURE__ */ jsx68("span", { children: p.name })
|
|
5392
5476
|
] })
|
|
5393
5477
|
})),
|
|
5394
5478
|
onPick: (k) => handleSelect(Number(k))
|
|
5395
5479
|
}
|
|
5396
5480
|
),
|
|
5397
|
-
/* @__PURE__ */
|
|
5481
|
+
/* @__PURE__ */ jsx68(
|
|
5398
5482
|
SearchField,
|
|
5399
5483
|
{
|
|
5400
5484
|
id: inputId,
|
|
@@ -5411,7 +5495,7 @@ function MysteryTigerGame({
|
|
|
5411
5495
|
}
|
|
5412
5496
|
|
|
5413
5497
|
// src/components/games/HigherOrLowerGame.tsx
|
|
5414
|
-
import { Fragment as Fragment12, jsx as
|
|
5498
|
+
import { Fragment as Fragment12, jsx as jsx69, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
5415
5499
|
var POINTS_PER_CORRECT = 10;
|
|
5416
5500
|
function parseClientState2(json) {
|
|
5417
5501
|
if (!json) return null;
|
|
@@ -5423,11 +5507,11 @@ function parseClientState2(json) {
|
|
|
5423
5507
|
}
|
|
5424
5508
|
function PlayerCard({ name, imagePath, highlight, children }) {
|
|
5425
5509
|
const { first, last } = splitName(name);
|
|
5426
|
-
return /* @__PURE__ */
|
|
5427
|
-
/* @__PURE__ */
|
|
5428
|
-
/* @__PURE__ */
|
|
5429
|
-
first && /* @__PURE__ */
|
|
5430
|
-
/* @__PURE__ */
|
|
5510
|
+
return /* @__PURE__ */ jsxs58("div", { className: `ss-g-hl-card${highlight ? " ss-g-hl-card--b" : ""}`, children: [
|
|
5511
|
+
/* @__PURE__ */ jsx69("div", { className: "ss-g-hl-photo-wrap", children: imagePath ? /* @__PURE__ */ jsx69(PlayerAvatar, { className: "ss-g-hl-photo", name, imagePath }) : /* @__PURE__ */ jsx69(Silhouette, { size: 150 }) }),
|
|
5512
|
+
/* @__PURE__ */ jsxs58("div", { className: "ss-g-hl-info", children: [
|
|
5513
|
+
first && /* @__PURE__ */ jsx69("span", { className: "ss-g-hl-first", children: first }),
|
|
5514
|
+
/* @__PURE__ */ jsx69("span", { className: "ss-g-hl-surname", children: last }),
|
|
5431
5515
|
children
|
|
5432
5516
|
] })
|
|
5433
5517
|
] });
|
|
@@ -5459,47 +5543,47 @@ function HigherOrLowerGame({
|
|
|
5459
5543
|
const newAnswers = [...prevAnswers, { pairIndex: currentPair.pairIndex, pick }];
|
|
5460
5544
|
onSubmit(JSON.stringify({ answers: newAnswers }));
|
|
5461
5545
|
}
|
|
5462
|
-
return /* @__PURE__ */
|
|
5463
|
-
/* @__PURE__ */
|
|
5546
|
+
return /* @__PURE__ */ jsxs58("div", { className: "ss-g-screen ss-g-hl", "data-testid": "game-screen-higher-or-lower", children: [
|
|
5547
|
+
/* @__PURE__ */ jsx69(
|
|
5464
5548
|
GameHeader,
|
|
5465
5549
|
{
|
|
5466
5550
|
title: gameTitle({ gameId: "higher-or-lower" }, ui.games.titles),
|
|
5467
5551
|
eyebrow: t.eyebrow(POINTS_PER_CORRECT),
|
|
5468
|
-
right: config ? /* @__PURE__ */
|
|
5552
|
+
right: config ? /* @__PURE__ */ jsx69(StatStack, { value: runLength, label: t.streak }) : void 0,
|
|
5469
5553
|
onBack,
|
|
5470
5554
|
backLabel: ui.back
|
|
5471
5555
|
}
|
|
5472
5556
|
),
|
|
5473
|
-
!config && /* @__PURE__ */
|
|
5474
|
-
config && /* @__PURE__ */
|
|
5475
|
-
/* @__PURE__ */
|
|
5476
|
-
/* @__PURE__ */
|
|
5477
|
-
/* @__PURE__ */
|
|
5478
|
-
/* @__PURE__ */
|
|
5479
|
-
/* @__PURE__ */
|
|
5557
|
+
!config && /* @__PURE__ */ jsx69("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading }),
|
|
5558
|
+
config && /* @__PURE__ */ jsxs58(Fragment12, { children: [
|
|
5559
|
+
/* @__PURE__ */ jsxs58("div", { className: "ss-g-body", children: [
|
|
5560
|
+
/* @__PURE__ */ jsxs58("div", { className: "ss-g-hl-prompt", "data-testid": "hol-prompt", children: [
|
|
5561
|
+
/* @__PURE__ */ jsx69("span", { className: "ss-g-hl-prompt-q", children: t.whoHadMore }),
|
|
5562
|
+
/* @__PURE__ */ jsx69("span", { className: "ss-g-hl-prompt-stat", children: config.statLabel }),
|
|
5563
|
+
/* @__PURE__ */ jsx69("span", { className: "ss-g-hl-prompt-season", children: t.season(config.seasonLabel) })
|
|
5480
5564
|
] }),
|
|
5481
|
-
currentPair && /* @__PURE__ */
|
|
5482
|
-
/* @__PURE__ */
|
|
5483
|
-
/* @__PURE__ */
|
|
5484
|
-
/* @__PURE__ */
|
|
5565
|
+
currentPair && /* @__PURE__ */ jsxs58("div", { className: "ss-g-hl-pair", children: [
|
|
5566
|
+
/* @__PURE__ */ jsxs58(PlayerCard, { name: currentPair.playerAName, imagePath: currentPair.playerAImagePath, children: [
|
|
5567
|
+
/* @__PURE__ */ jsx69("span", { className: "ss-g-hl-value", children: currentPair.playerAValue }),
|
|
5568
|
+
/* @__PURE__ */ jsx69("span", { className: "ss-g-hl-stat", children: config.statLabel })
|
|
5485
5569
|
] }),
|
|
5486
|
-
/* @__PURE__ */
|
|
5487
|
-
/* @__PURE__ */
|
|
5488
|
-
/* @__PURE__ */
|
|
5489
|
-
/* @__PURE__ */
|
|
5570
|
+
/* @__PURE__ */ jsx69("span", { className: "ss-g-hl-vs", "aria-hidden": "true", children: t.vs }),
|
|
5571
|
+
/* @__PURE__ */ jsx69(PlayerCard, { name: currentPair.playerBName, imagePath: currentPair.playerBImagePath, highlight: true, children: /* @__PURE__ */ jsxs58("div", { className: "ss-g-hl-btns", children: [
|
|
5572
|
+
/* @__PURE__ */ jsxs58(GameButton, { variant: "primary", disabled: submitting, onClick: () => handlePick("higher"), children: [
|
|
5573
|
+
/* @__PURE__ */ jsx69(IconArrowUp, { size: 16 }),
|
|
5490
5574
|
t.higher
|
|
5491
5575
|
] }),
|
|
5492
|
-
/* @__PURE__ */
|
|
5493
|
-
/* @__PURE__ */
|
|
5576
|
+
/* @__PURE__ */ jsxs58(GameButton, { variant: "outline", disabled: submitting, onClick: () => handlePick("lower"), children: [
|
|
5577
|
+
/* @__PURE__ */ jsx69(IconArrowDown, { size: 16 }),
|
|
5494
5578
|
t.lower
|
|
5495
5579
|
] })
|
|
5496
5580
|
] }) })
|
|
5497
5581
|
] }),
|
|
5498
|
-
lastAnswer && lastAnswerPair && /* @__PURE__ */
|
|
5499
|
-
lastAnswer.wasCorrect ? /* @__PURE__ */
|
|
5582
|
+
lastAnswer && lastAnswerPair && /* @__PURE__ */ jsxs58("p", { className: "ss-g-hl-feedback", "data-testid": "hol-last", "data-correct": lastAnswer.wasCorrect ? "true" : "false", children: [
|
|
5583
|
+
lastAnswer.wasCorrect ? /* @__PURE__ */ jsx69(IconCheck, {}) : /* @__PURE__ */ jsx69(IconClose, {}),
|
|
5500
5584
|
t.lastAnswer(splitName(lastAnswerPair.playerBName).last, lastAnswer.playerBValue)
|
|
5501
5585
|
] }),
|
|
5502
|
-
isOver && /* @__PURE__ */
|
|
5586
|
+
isOver && /* @__PURE__ */ jsx69(
|
|
5503
5587
|
ResultCard,
|
|
5504
5588
|
{
|
|
5505
5589
|
tone: runEndedWrong ? "lose" : allPairsAnswered ? "win" : "neutral",
|
|
@@ -5511,15 +5595,15 @@ function HigherOrLowerGame({
|
|
|
5511
5595
|
}
|
|
5512
5596
|
)
|
|
5513
5597
|
] }),
|
|
5514
|
-
!isOver && /* @__PURE__ */
|
|
5515
|
-
/* @__PURE__ */
|
|
5598
|
+
!isOver && /* @__PURE__ */ jsx69(FooterBar, { children: /* @__PURE__ */ jsxs58("div", { className: "ss-g-hl-foot", children: [
|
|
5599
|
+
/* @__PURE__ */ jsx69("div", { className: "ss-g-hl-dots", role: "img", "aria-label": t.answersSoFar(answeredCount, config.pairs.length), children: config.pairs.map((p, i) => {
|
|
5516
5600
|
const a = answeredPairs[i];
|
|
5517
|
-
return /* @__PURE__ */
|
|
5601
|
+
return /* @__PURE__ */ jsx69("span", { className: "ss-g-hl-dot", "data-state": a ? a.wasCorrect ? "correct" : "wrong" : "todo" }, p.pairIndex);
|
|
5518
5602
|
}) }),
|
|
5519
|
-
/* @__PURE__ */
|
|
5520
|
-
/* @__PURE__ */
|
|
5603
|
+
/* @__PURE__ */ jsxs58("span", { className: "ss-g-hl-pts", children: [
|
|
5604
|
+
/* @__PURE__ */ jsx69("span", { "data-testid": "hol-score", children: score }),
|
|
5521
5605
|
" ",
|
|
5522
|
-
/* @__PURE__ */
|
|
5606
|
+
/* @__PURE__ */ jsx69("span", { className: "ss-g-hl-pts-unit", children: ui.games.unitPts })
|
|
5523
5607
|
] })
|
|
5524
5608
|
] }) })
|
|
5525
5609
|
] })
|
|
@@ -5527,21 +5611,21 @@ function HigherOrLowerGame({
|
|
|
5527
5611
|
}
|
|
5528
5612
|
|
|
5529
5613
|
// src/components/games/CareerPathGame.tsx
|
|
5530
|
-
import { useState as
|
|
5614
|
+
import { useState as useState28, useId as useId3 } from "react";
|
|
5531
5615
|
|
|
5532
5616
|
// src/components/games/ui/CrestShield.tsx
|
|
5533
|
-
import { useState as
|
|
5534
|
-
import { jsx as
|
|
5617
|
+
import { useState as useState27 } from "react";
|
|
5618
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
5535
5619
|
function CrestShield({ src, name, size = 28 }) {
|
|
5536
|
-
const [failed, setFailed] =
|
|
5620
|
+
const [failed, setFailed] = useState27(false);
|
|
5537
5621
|
if (src && !isPlaceholderImage(src) && !failed) {
|
|
5538
|
-
return /* @__PURE__ */
|
|
5622
|
+
return /* @__PURE__ */ jsx70("img", { className: "ss-g-crest", src, alt: name, width: size, height: size, loading: "lazy", onError: () => setFailed(true) });
|
|
5539
5623
|
}
|
|
5540
|
-
return /* @__PURE__ */
|
|
5624
|
+
return /* @__PURE__ */ jsx70("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__ */ jsx70("path", { d: "M2 3h24v12c0 9-6 14-12 17C8 29 2 24 2 15z", fill: "currentColor" }) });
|
|
5541
5625
|
}
|
|
5542
5626
|
|
|
5543
5627
|
// src/components/games/CareerPathGame.tsx
|
|
5544
|
-
import { Fragment as Fragment13, jsx as
|
|
5628
|
+
import { Fragment as Fragment13, jsx as jsx71, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
5545
5629
|
function parseClientState3(json) {
|
|
5546
5630
|
if (!json) return null;
|
|
5547
5631
|
try {
|
|
@@ -5565,15 +5649,15 @@ function CareerPathGame({
|
|
|
5565
5649
|
}) {
|
|
5566
5650
|
const s = ui.games.careerPath;
|
|
5567
5651
|
const title = gameTitle({ gameId: "career-path" }, ui.games.titles);
|
|
5568
|
-
const [query, setQuery] =
|
|
5652
|
+
const [query, setQuery] = useState28("");
|
|
5569
5653
|
const inputId = useId3();
|
|
5570
5654
|
const clientState = parseClientState3(result?.clientStateJson);
|
|
5571
5655
|
const alreadyGuessedIds = new Set(clientState?.guessResults.map((g) => g.playerId) ?? []);
|
|
5572
5656
|
const isOver = result?.alreadyPlayed === true || clientState?.solved === true || clientState?.failed === true;
|
|
5573
5657
|
if (!config) {
|
|
5574
|
-
return /* @__PURE__ */
|
|
5575
|
-
/* @__PURE__ */
|
|
5576
|
-
/* @__PURE__ */
|
|
5658
|
+
return /* @__PURE__ */ jsxs59("div", { className: "ss-g-screen", "data-testid": "game-screen-career-path", children: [
|
|
5659
|
+
/* @__PURE__ */ jsx71(GameHeader, { title, eyebrow: s.eyebrow, onBack, backLabel: ui.back }),
|
|
5660
|
+
/* @__PURE__ */ jsx71("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
5577
5661
|
] });
|
|
5578
5662
|
}
|
|
5579
5663
|
const visiblePath = clientState?.visiblePath ?? config.initialPath;
|
|
@@ -5589,60 +5673,60 @@ function CareerPathGame({
|
|
|
5589
5673
|
setQuery("");
|
|
5590
5674
|
onSubmit(JSON.stringify({ guesses: newGuesses }));
|
|
5591
5675
|
}
|
|
5592
|
-
const right = !isOver && clientState ? /* @__PURE__ */
|
|
5676
|
+
const right = !isOver && clientState ? /* @__PURE__ */ jsx71("span", { "data-testid": "cp-guess-chip", children: /* @__PURE__ */ jsxs59(Chip, { variant: "neutral", children: [
|
|
5593
5677
|
ui.games.guess,
|
|
5594
5678
|
" ",
|
|
5595
|
-
/* @__PURE__ */
|
|
5679
|
+
/* @__PURE__ */ jsx71("span", { className: "ss-g-num", children: clientState.guessesUsed + 1 }),
|
|
5596
5680
|
" / ",
|
|
5597
5681
|
clientState.guessesUsed + clientState.guessesRemaining
|
|
5598
5682
|
] }) }) : void 0;
|
|
5599
5683
|
const outcome = clientState?.solved ? s.solved : clientState?.failed ? s.failed : ui.games.done;
|
|
5600
|
-
return /* @__PURE__ */
|
|
5601
|
-
/* @__PURE__ */
|
|
5602
|
-
/* @__PURE__ */
|
|
5603
|
-
/* @__PURE__ */
|
|
5604
|
-
isOver && clientState?.revealedPlayerName ? /* @__PURE__ */
|
|
5605
|
-
/* @__PURE__ */
|
|
5606
|
-
/* @__PURE__ */
|
|
5607
|
-
clientState?.hintLine ? /* @__PURE__ */
|
|
5608
|
-
/* @__PURE__ */
|
|
5609
|
-
/* @__PURE__ */
|
|
5684
|
+
return /* @__PURE__ */ jsxs59("div", { className: "ss-g-screen", "data-testid": "game-screen-career-path", children: [
|
|
5685
|
+
/* @__PURE__ */ jsx71(GameHeader, { title, eyebrow: s.eyebrow, right, onBack, backLabel: ui.back }),
|
|
5686
|
+
/* @__PURE__ */ jsxs59("div", { className: "ss-g-body", children: [
|
|
5687
|
+
/* @__PURE__ */ jsxs59("div", { className: "ss-g-cp-card", children: [
|
|
5688
|
+
isOver && clientState?.revealedPlayerName ? /* @__PURE__ */ jsx71(PlayerAvatar, { className: "ss-g-cp-photo", name: clientState.revealedPlayerName, imagePath: clientState.revealedPlayerImagePath }) : /* @__PURE__ */ jsx71(Silhouette, { size: 64, variant: isOver ? "default" : "mystery" }),
|
|
5689
|
+
/* @__PURE__ */ jsxs59("div", { className: "ss-g-cp-card-text", children: [
|
|
5690
|
+
/* @__PURE__ */ jsx71("span", { className: "ss-g-cp-card-title", children: isOver && clientState?.revealedPlayerName ? clientState.revealedPlayerName : s.mysteryPlayer }),
|
|
5691
|
+
clientState?.hintLine ? /* @__PURE__ */ jsx71("span", { className: "ss-g-cp-hint", children: clientState.hintLine }) : !isOver ? /* @__PURE__ */ jsxs59("span", { className: "ss-g-cp-locks", children: [
|
|
5692
|
+
/* @__PURE__ */ jsx71(Chip, { variant: "lock", icon: /* @__PURE__ */ jsx71(IconLock, { size: 11 }), children: s.lockPosition }),
|
|
5693
|
+
/* @__PURE__ */ jsx71(Chip, { variant: "lock", icon: /* @__PURE__ */ jsx71(IconLock, { size: 11 }), children: s.lockNationality })
|
|
5610
5694
|
] }) : null
|
|
5611
5695
|
] })
|
|
5612
5696
|
] }),
|
|
5613
|
-
/* @__PURE__ */
|
|
5697
|
+
/* @__PURE__ */ jsxs59("ol", { className: "ss-g-cp-line", children: [
|
|
5614
5698
|
visiblePath.map((spell, i) => {
|
|
5615
5699
|
const years = i === 0 ? s.firstClub : spellYears(spell);
|
|
5616
|
-
return /* @__PURE__ */
|
|
5617
|
-
/* @__PURE__ */
|
|
5618
|
-
/* @__PURE__ */
|
|
5619
|
-
/* @__PURE__ */
|
|
5700
|
+
return /* @__PURE__ */ jsxs59("li", { className: "ss-g-cp-step", children: [
|
|
5701
|
+
/* @__PURE__ */ jsxs59("span", { className: "ss-g-cp-rail", children: [
|
|
5702
|
+
/* @__PURE__ */ jsx71("span", { className: "ss-g-cp-tile", children: /* @__PURE__ */ jsx71(CrestShield, { src: spell.crestUrl, name: spell.clubName, size: 30 }) }),
|
|
5703
|
+
/* @__PURE__ */ jsx71("span", { className: "ss-g-cp-conn", "aria-hidden": "true" })
|
|
5620
5704
|
] }),
|
|
5621
|
-
/* @__PURE__ */
|
|
5622
|
-
/* @__PURE__ */
|
|
5623
|
-
/* @__PURE__ */
|
|
5624
|
-
/* @__PURE__ */
|
|
5625
|
-
spell.isLoan && /* @__PURE__ */
|
|
5705
|
+
/* @__PURE__ */ jsxs59("span", { className: "ss-g-cp-step-text", children: [
|
|
5706
|
+
/* @__PURE__ */ jsx71("span", { className: "ss-g-cp-club", children: spell.clubName }),
|
|
5707
|
+
/* @__PURE__ */ jsxs59("span", { className: "ss-g-cp-sub", children: [
|
|
5708
|
+
/* @__PURE__ */ jsx71("span", { className: "ss-g-cp-years", children: years }),
|
|
5709
|
+
spell.isLoan && /* @__PURE__ */ jsxs59(Fragment13, { children: [
|
|
5626
5710
|
years ? " \xB7 " : "",
|
|
5627
|
-
/* @__PURE__ */
|
|
5711
|
+
/* @__PURE__ */ jsx71("span", { className: "ss-g-cp-loan", children: s.loan })
|
|
5628
5712
|
] })
|
|
5629
5713
|
] })
|
|
5630
5714
|
] })
|
|
5631
5715
|
] }, `${spell.clubName}-${i}`);
|
|
5632
5716
|
}),
|
|
5633
|
-
hidden > 0 && /* @__PURE__ */
|
|
5634
|
-
/* @__PURE__ */
|
|
5635
|
-
/* @__PURE__ */
|
|
5636
|
-
hidden > 1 && /* @__PURE__ */
|
|
5717
|
+
hidden > 0 && /* @__PURE__ */ jsxs59("li", { className: "ss-g-cp-step ss-g-cp-step--hidden", children: [
|
|
5718
|
+
/* @__PURE__ */ jsxs59("span", { className: "ss-g-cp-rail", children: [
|
|
5719
|
+
/* @__PURE__ */ jsx71("span", { className: "ss-g-cp-tile ss-g-cp-tile--locked", children: /* @__PURE__ */ jsx71(IconLock, { size: 18 }) }),
|
|
5720
|
+
hidden > 1 && /* @__PURE__ */ jsx71("span", { className: "ss-g-cp-conn ss-g-cp-conn--faint", "aria-hidden": "true" })
|
|
5637
5721
|
] }),
|
|
5638
|
-
/* @__PURE__ */
|
|
5722
|
+
/* @__PURE__ */ jsx71("span", { className: "ss-g-cp-step-text", children: /* @__PURE__ */ jsx71("span", { className: "ss-g-cp-sub", children: s.nextClubHidden }) })
|
|
5639
5723
|
] }),
|
|
5640
|
-
hidden > 1 && /* @__PURE__ */
|
|
5641
|
-
/* @__PURE__ */
|
|
5642
|
-
/* @__PURE__ */
|
|
5724
|
+
hidden > 1 && /* @__PURE__ */ jsxs59("li", { className: "ss-g-cp-step ss-g-cp-step--more", children: [
|
|
5725
|
+
/* @__PURE__ */ jsx71("span", { className: "ss-g-cp-rail", children: /* @__PURE__ */ jsx71("span", { className: "ss-g-cp-tile ss-g-cp-tile--faint", children: /* @__PURE__ */ jsx71(IconLock, { size: 18 }) }) }),
|
|
5726
|
+
/* @__PURE__ */ jsx71("span", { className: "ss-g-cp-step-text", children: /* @__PURE__ */ jsx71("span", { className: "ss-g-cp-sub", children: s.moreClubs(hidden - 1) }) })
|
|
5643
5727
|
] })
|
|
5644
5728
|
] }),
|
|
5645
|
-
isOver && /* @__PURE__ */
|
|
5729
|
+
isOver && /* @__PURE__ */ jsx71(
|
|
5646
5730
|
ResultCard,
|
|
5647
5731
|
{
|
|
5648
5732
|
tone: clientState?.solved ? "win" : clientState?.failed ? "lose" : "neutral",
|
|
@@ -5654,22 +5738,22 @@ function CareerPathGame({
|
|
|
5654
5738
|
}
|
|
5655
5739
|
)
|
|
5656
5740
|
] }),
|
|
5657
|
-
!isOver && /* @__PURE__ */
|
|
5658
|
-
query.length > 0 && filtered.length > 0 && /* @__PURE__ */
|
|
5741
|
+
!isOver && /* @__PURE__ */ jsxs59(FooterBar, { children: [
|
|
5742
|
+
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ jsx71(
|
|
5659
5743
|
OptionList,
|
|
5660
5744
|
{
|
|
5661
5745
|
label: s.searchLabel,
|
|
5662
5746
|
options: filtered.map((p) => ({
|
|
5663
5747
|
key: p.id,
|
|
5664
|
-
content: /* @__PURE__ */
|
|
5665
|
-
/* @__PURE__ */
|
|
5666
|
-
/* @__PURE__ */
|
|
5748
|
+
content: /* @__PURE__ */ jsxs59(Fragment13, { children: [
|
|
5749
|
+
/* @__PURE__ */ jsx71(PlayerAvatar, { className: "ss-g-opt-av", name: p.name }),
|
|
5750
|
+
/* @__PURE__ */ jsx71("span", { children: p.name })
|
|
5667
5751
|
] })
|
|
5668
5752
|
})),
|
|
5669
5753
|
onPick: (k) => handleSelect(Number(k))
|
|
5670
5754
|
}
|
|
5671
5755
|
),
|
|
5672
|
-
/* @__PURE__ */
|
|
5756
|
+
/* @__PURE__ */ jsx71(
|
|
5673
5757
|
SearchField,
|
|
5674
5758
|
{
|
|
5675
5759
|
id: inputId,
|
|
@@ -5685,8 +5769,8 @@ function CareerPathGame({
|
|
|
5685
5769
|
}
|
|
5686
5770
|
|
|
5687
5771
|
// src/components/games/BeatTheGridGame.tsx
|
|
5688
|
-
import React, { useEffect as useEffect15, useId as useId4, useRef as useRef13, useState as
|
|
5689
|
-
import { Fragment as Fragment14, jsx as
|
|
5772
|
+
import React, { useEffect as useEffect15, useId as useId4, useRef as useRef13, useState as useState29 } from "react";
|
|
5773
|
+
import { Fragment as Fragment14, jsx as jsx72, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
5690
5774
|
function criterionIconKind(label, key) {
|
|
5691
5775
|
const l = (key ?? label).toLowerCase();
|
|
5692
5776
|
if (l.includes("app")) return "calendar";
|
|
@@ -5704,34 +5788,34 @@ function rowAbbrev(label, map, key) {
|
|
|
5704
5788
|
function CriterionIcon({ kind }) {
|
|
5705
5789
|
switch (kind) {
|
|
5706
5790
|
case "calendar":
|
|
5707
|
-
return /* @__PURE__ */
|
|
5791
|
+
return /* @__PURE__ */ jsx72(IconCalendar, {});
|
|
5708
5792
|
case "ball":
|
|
5709
|
-
return /* @__PURE__ */
|
|
5793
|
+
return /* @__PURE__ */ jsx72(IconBall, {});
|
|
5710
5794
|
case "boot":
|
|
5711
|
-
return /* @__PURE__ */
|
|
5795
|
+
return /* @__PURE__ */ jsx72(IconBoot, {});
|
|
5712
5796
|
case "gloves":
|
|
5713
|
-
return /* @__PURE__ */
|
|
5797
|
+
return /* @__PURE__ */ jsx72(IconGloves, {});
|
|
5714
5798
|
case "shield":
|
|
5715
|
-
return /* @__PURE__ */
|
|
5799
|
+
return /* @__PURE__ */ jsx72(IconShield, {});
|
|
5716
5800
|
default:
|
|
5717
|
-
return /* @__PURE__ */
|
|
5801
|
+
return /* @__PURE__ */ jsx72(IconFlag, {});
|
|
5718
5802
|
}
|
|
5719
5803
|
}
|
|
5720
5804
|
function HeaderVisual({ label, textKey: iKey, meta }) {
|
|
5721
5805
|
if (!meta) {
|
|
5722
|
-
return /* @__PURE__ */
|
|
5806
|
+
return /* @__PURE__ */ jsx72(CriterionIcon, { kind: criterionIconKind(label, iKey) });
|
|
5723
5807
|
}
|
|
5724
5808
|
switch (meta.kind) {
|
|
5725
5809
|
case "club":
|
|
5726
|
-
return /* @__PURE__ */
|
|
5810
|
+
return /* @__PURE__ */ jsx72(CrestShield, { src: meta.imageUrl, name: label, size: 24 });
|
|
5727
5811
|
case "coach":
|
|
5728
|
-
return /* @__PURE__ */
|
|
5812
|
+
return /* @__PURE__ */ jsx72(PlayerAvatar, { name: label, imagePath: meta.imageUrl, className: "ss-g-btg-coach-av" });
|
|
5729
5813
|
case "country":
|
|
5730
|
-
return /* @__PURE__ */
|
|
5814
|
+
return /* @__PURE__ */ jsx72("span", { className: "ss-g-btg-hdr-flag", "aria-hidden": "true", children: nationalityFlag(meta.country ?? label) });
|
|
5731
5815
|
case "position":
|
|
5732
|
-
return /* @__PURE__ */
|
|
5816
|
+
return /* @__PURE__ */ jsx72(Fragment14, {});
|
|
5733
5817
|
default:
|
|
5734
|
-
return /* @__PURE__ */
|
|
5818
|
+
return /* @__PURE__ */ jsx72(CriterionIcon, { kind: criterionIconKind(label, iKey) });
|
|
5735
5819
|
}
|
|
5736
5820
|
}
|
|
5737
5821
|
function parseClientState4(json) {
|
|
@@ -5766,7 +5850,7 @@ function SearchSheet({
|
|
|
5766
5850
|
ui
|
|
5767
5851
|
}) {
|
|
5768
5852
|
const s = ui.games.beatTheGrid;
|
|
5769
|
-
const [query, setQuery] =
|
|
5853
|
+
const [query, setQuery] = useState29("");
|
|
5770
5854
|
const inputId = useId4();
|
|
5771
5855
|
const inputRef = useRef13(null);
|
|
5772
5856
|
useEffect15(() => {
|
|
@@ -5775,12 +5859,12 @@ function SearchSheet({
|
|
|
5775
5859
|
const filtered = playerPool.filter(
|
|
5776
5860
|
(p) => !alreadyFilledIds.has(p.id) && p.name.toLowerCase().includes(query.toLowerCase())
|
|
5777
5861
|
);
|
|
5778
|
-
return /* @__PURE__ */
|
|
5779
|
-
/* @__PURE__ */
|
|
5780
|
-
/* @__PURE__ */
|
|
5781
|
-
/* @__PURE__ */
|
|
5782
|
-
/* @__PURE__ */
|
|
5783
|
-
/* @__PURE__ */
|
|
5862
|
+
return /* @__PURE__ */ jsxs60("div", { className: "ss-g-btg-sheet", "data-testid": "btg-search-sheet", children: [
|
|
5863
|
+
/* @__PURE__ */ jsxs60("div", { className: "ss-g-btg-sheet-hdr", children: [
|
|
5864
|
+
/* @__PURE__ */ jsx72(Chip, { variant: "neutral", children: rowLabel }),
|
|
5865
|
+
/* @__PURE__ */ jsx72("span", { className: "ss-g-btg-sheet-x", "aria-hidden": "true", children: /* @__PURE__ */ jsx72(IconClose, { size: 12 }) }),
|
|
5866
|
+
/* @__PURE__ */ jsx72(Chip, { variant: "accent", children: colLabel }),
|
|
5867
|
+
/* @__PURE__ */ jsx72(
|
|
5784
5868
|
"button",
|
|
5785
5869
|
{
|
|
5786
5870
|
type: "button",
|
|
@@ -5788,12 +5872,12 @@ function SearchSheet({
|
|
|
5788
5872
|
"data-testid": "btg-sheet-dismiss",
|
|
5789
5873
|
"aria-label": s.closeSearch,
|
|
5790
5874
|
onClick: onDismiss,
|
|
5791
|
-
children: /* @__PURE__ */
|
|
5875
|
+
children: /* @__PURE__ */ jsx72(IconClose, {})
|
|
5792
5876
|
}
|
|
5793
5877
|
)
|
|
5794
5878
|
] }),
|
|
5795
|
-
playerPool.length === 0 ? /* @__PURE__ */
|
|
5796
|
-
/* @__PURE__ */
|
|
5879
|
+
playerPool.length === 0 ? /* @__PURE__ */ jsx72("div", { className: "ss-g-btg-sheet-empty", children: s.emptyPool }) : /* @__PURE__ */ jsxs60(Fragment14, { children: [
|
|
5880
|
+
/* @__PURE__ */ jsx72(
|
|
5797
5881
|
SearchField,
|
|
5798
5882
|
{
|
|
5799
5883
|
id: inputId,
|
|
@@ -5805,16 +5889,16 @@ function SearchSheet({
|
|
|
5805
5889
|
inputRef
|
|
5806
5890
|
}
|
|
5807
5891
|
),
|
|
5808
|
-
query.length > 0 && filtered.length > 0 && /* @__PURE__ */
|
|
5892
|
+
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ jsx72(
|
|
5809
5893
|
OptionList,
|
|
5810
5894
|
{
|
|
5811
5895
|
label: s.searchLabel(rowLabel, colLabel),
|
|
5812
5896
|
options: filtered.map((p) => ({
|
|
5813
5897
|
key: p.id,
|
|
5814
|
-
content: /* @__PURE__ */
|
|
5815
|
-
/* @__PURE__ */
|
|
5816
|
-
/* @__PURE__ */
|
|
5817
|
-
/* @__PURE__ */
|
|
5898
|
+
content: /* @__PURE__ */ jsxs60(Fragment14, { children: [
|
|
5899
|
+
/* @__PURE__ */ jsx72(PlayerAvatar, { name: p.name, imagePath: p.imagePath, className: "ss-g-opt-av" }),
|
|
5900
|
+
/* @__PURE__ */ jsx72("span", { className: "ss-g-btg-result-name", children: p.name }),
|
|
5901
|
+
/* @__PURE__ */ jsx72("span", { className: "ss-g-btg-result-plus", "aria-hidden": "true", children: /* @__PURE__ */ jsx72(IconPlus, { size: 18 }) })
|
|
5818
5902
|
] })
|
|
5819
5903
|
})),
|
|
5820
5904
|
onPick: (k) => onPick(row, col, Number(k))
|
|
@@ -5834,7 +5918,7 @@ function BeatTheGridGame({
|
|
|
5834
5918
|
}) {
|
|
5835
5919
|
const s = ui.games.beatTheGrid;
|
|
5836
5920
|
const title = gameTitle({ gameId: "beat-the-grid" }, ui.games.titles);
|
|
5837
|
-
const [activeCell, setActiveCell] =
|
|
5921
|
+
const [activeCell, setActiveCell] = useState29(null);
|
|
5838
5922
|
const clientState = parseClientState4(result?.clientStateJson);
|
|
5839
5923
|
const filledCells = clientState?.cells ?? [];
|
|
5840
5924
|
const isLocked2 = result?.alreadyPlayed === true || clientState?.isComplete === true;
|
|
@@ -5852,9 +5936,9 @@ function BeatTheGridGame({
|
|
|
5852
5936
|
onSubmit(JSON.stringify({ cells: newCells }));
|
|
5853
5937
|
}
|
|
5854
5938
|
if (!config) {
|
|
5855
|
-
return /* @__PURE__ */
|
|
5856
|
-
/* @__PURE__ */
|
|
5857
|
-
/* @__PURE__ */
|
|
5939
|
+
return /* @__PURE__ */ jsxs60("div", { className: "ss-g-screen", "data-testid": "game-screen-beat-the-grid", children: [
|
|
5940
|
+
/* @__PURE__ */ jsx72(GameHeader, { title, eyebrow: s.eyebrow, onBack, backLabel: ui.back }),
|
|
5941
|
+
/* @__PURE__ */ jsx72("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
5858
5942
|
] });
|
|
5859
5943
|
}
|
|
5860
5944
|
const rows = config.rows;
|
|
@@ -5867,20 +5951,20 @@ function BeatTheGridGame({
|
|
|
5867
5951
|
(_, i) => i < correctCount ? "correct" : i < correctCount + wrongCount ? "wrong" : "todo"
|
|
5868
5952
|
);
|
|
5869
5953
|
const totalScore = clientState?.totalScore ?? result?.score ?? 0;
|
|
5870
|
-
return /* @__PURE__ */
|
|
5871
|
-
/* @__PURE__ */
|
|
5872
|
-
/* @__PURE__ */
|
|
5954
|
+
return /* @__PURE__ */ jsxs60("div", { className: "ss-g-screen", "data-testid": "game-screen-beat-the-grid", children: [
|
|
5955
|
+
/* @__PURE__ */ jsx72(GameHeader, { title, eyebrow: s.eyebrow, onBack, backLabel: ui.back }),
|
|
5956
|
+
/* @__PURE__ */ jsx72(
|
|
5873
5957
|
SegmentProgress,
|
|
5874
5958
|
{
|
|
5875
5959
|
segments,
|
|
5876
5960
|
ariaLabel: s.progressAria(filledCells.length, total),
|
|
5877
5961
|
leftLabel: s.filled(filledCells.length, total),
|
|
5878
5962
|
rightLabel: s.toGo(Math.max(0, total - filledCells.length)),
|
|
5879
|
-
right: /* @__PURE__ */
|
|
5963
|
+
right: /* @__PURE__ */ jsx72(Chip, { variant: "accent", children: `${totalScore} ${ui.games.unitPts}` })
|
|
5880
5964
|
}
|
|
5881
5965
|
),
|
|
5882
|
-
/* @__PURE__ */
|
|
5883
|
-
/* @__PURE__ */
|
|
5966
|
+
/* @__PURE__ */ jsxs60("div", { className: "ss-g-body", children: [
|
|
5967
|
+
/* @__PURE__ */ jsxs60(
|
|
5884
5968
|
"div",
|
|
5885
5969
|
{
|
|
5886
5970
|
className: activeCell !== null ? "ss-g-btg-grid ss-g-btg-grid--fit" : "ss-g-btg-grid",
|
|
@@ -5890,31 +5974,31 @@ function BeatTheGridGame({
|
|
|
5890
5974
|
},
|
|
5891
5975
|
role: "grid",
|
|
5892
5976
|
children: [
|
|
5893
|
-
/* @__PURE__ */
|
|
5977
|
+
/* @__PURE__ */ jsx72("div", { className: "ss-g-btg-corner" }),
|
|
5894
5978
|
cols.map((col, colIdx) => {
|
|
5895
5979
|
const colMeta = config.colsMeta?.[colIdx];
|
|
5896
|
-
return /* @__PURE__ */
|
|
5897
|
-
/* @__PURE__ */
|
|
5898
|
-
/* @__PURE__ */
|
|
5980
|
+
return /* @__PURE__ */ jsxs60("div", { className: "ss-g-btg-colhdr", "data-meta": colMeta ? "true" : void 0, children: [
|
|
5981
|
+
/* @__PURE__ */ jsx72(HeaderVisual, { label: col, textKey: config.colsI18n?.[colIdx]?.key, meta: colMeta }),
|
|
5982
|
+
/* @__PURE__ */ jsx72("span", { children: col })
|
|
5899
5983
|
] }, col);
|
|
5900
5984
|
}),
|
|
5901
5985
|
rows.map((rowLabel, rowIdx) => {
|
|
5902
5986
|
const rowMeta = config.rowsMeta?.[rowIdx];
|
|
5903
5987
|
const abbr = rowAbbrev(rowLabel, s.rowAbbrev, config.rowsI18n?.[rowIdx]?.key);
|
|
5904
|
-
const rowHeaderContent = rowMeta ? /* @__PURE__ */
|
|
5905
|
-
/* @__PURE__ */
|
|
5906
|
-
/* @__PURE__ */
|
|
5907
|
-
] }) : abbr === rowLabel ? /* @__PURE__ */
|
|
5908
|
-
/* @__PURE__ */
|
|
5909
|
-
/* @__PURE__ */
|
|
5988
|
+
const rowHeaderContent = rowMeta ? /* @__PURE__ */ jsxs60(Fragment14, { children: [
|
|
5989
|
+
/* @__PURE__ */ jsx72(HeaderVisual, { label: rowLabel, textKey: config.rowsI18n?.[rowIdx]?.key, meta: rowMeta }),
|
|
5990
|
+
/* @__PURE__ */ jsx72("span", { children: rowLabel })
|
|
5991
|
+
] }) : abbr === rowLabel ? /* @__PURE__ */ jsx72("span", { children: rowLabel }) : /* @__PURE__ */ jsxs60(Fragment14, { children: [
|
|
5992
|
+
/* @__PURE__ */ jsx72("span", { "aria-hidden": "true", children: abbr }),
|
|
5993
|
+
/* @__PURE__ */ jsx72("span", { className: "ss-g-sr", children: rowLabel })
|
|
5910
5994
|
] });
|
|
5911
|
-
return /* @__PURE__ */
|
|
5912
|
-
/* @__PURE__ */
|
|
5995
|
+
return /* @__PURE__ */ jsxs60(React.Fragment, { children: [
|
|
5996
|
+
/* @__PURE__ */ jsx72("div", { className: "ss-g-btg-rowhdr", "data-meta": rowMeta ? "true" : void 0, children: rowHeaderContent }),
|
|
5913
5997
|
cols.map((colLabel, colIdx) => {
|
|
5914
5998
|
const filled = findCellResult(filledCells, rowIdx, colIdx);
|
|
5915
5999
|
const isActive = activeCell?.row === rowIdx && activeCell?.col === colIdx;
|
|
5916
6000
|
const state = filled ? filled.isCorrect ? "correct" : "wrong" : isActive ? "active" : "empty";
|
|
5917
|
-
return /* @__PURE__ */
|
|
6001
|
+
return /* @__PURE__ */ jsx72(
|
|
5918
6002
|
"button",
|
|
5919
6003
|
{
|
|
5920
6004
|
type: "button",
|
|
@@ -5925,20 +6009,20 @@ function BeatTheGridGame({
|
|
|
5925
6009
|
className: "ss-g-btg-cell",
|
|
5926
6010
|
disabled: isLocked2 || submitting,
|
|
5927
6011
|
onClick: () => handleCellClick(rowIdx, colIdx),
|
|
5928
|
-
children: filled ? /* @__PURE__ */
|
|
5929
|
-
/* @__PURE__ */
|
|
6012
|
+
children: filled ? /* @__PURE__ */ jsxs60(Fragment14, { children: [
|
|
6013
|
+
/* @__PURE__ */ jsx72(
|
|
5930
6014
|
"span",
|
|
5931
6015
|
{
|
|
5932
6016
|
className: `ss-g-btg-badge ss-g-btg-badge--${filled.isCorrect ? "correct" : "wrong"}`,
|
|
5933
6017
|
role: "img",
|
|
5934
6018
|
"aria-label": filled.isCorrect ? s.correct : s.wrong,
|
|
5935
|
-
children: filled.isCorrect ? /* @__PURE__ */
|
|
6019
|
+
children: filled.isCorrect ? /* @__PURE__ */ jsx72(IconCheck, { size: 11 }) : /* @__PURE__ */ jsx72(IconClose, { size: 11 })
|
|
5936
6020
|
}
|
|
5937
6021
|
),
|
|
5938
|
-
/* @__PURE__ */
|
|
6022
|
+
/* @__PURE__ */ jsx72("span", { className: "ss-g-btg-rarity", children: filled.rarityScore }),
|
|
5939
6023
|
(() => {
|
|
5940
6024
|
const entry = playerPool.find((p) => p.id === filled.playerId);
|
|
5941
|
-
return /* @__PURE__ */
|
|
6025
|
+
return /* @__PURE__ */ jsx72(
|
|
5942
6026
|
PlayerAvatar,
|
|
5943
6027
|
{
|
|
5944
6028
|
name: entry?.name ?? "",
|
|
@@ -5947,8 +6031,8 @@ function BeatTheGridGame({
|
|
|
5947
6031
|
}
|
|
5948
6032
|
);
|
|
5949
6033
|
})(),
|
|
5950
|
-
/* @__PURE__ */
|
|
5951
|
-
] }) : /* @__PURE__ */
|
|
6034
|
+
/* @__PURE__ */ jsx72("span", { className: "ss-g-btg-name", children: shortName(playerPool.find((p) => p.id === filled.playerId)?.name) })
|
|
6035
|
+
] }) : /* @__PURE__ */ jsx72("span", { className: "ss-g-btg-plus", "aria-hidden": "true", children: /* @__PURE__ */ jsx72(IconPlus, { size: 22 }) })
|
|
5952
6036
|
},
|
|
5953
6037
|
`cell-${rowIdx}-${colIdx}`
|
|
5954
6038
|
);
|
|
@@ -5958,7 +6042,7 @@ function BeatTheGridGame({
|
|
|
5958
6042
|
]
|
|
5959
6043
|
}
|
|
5960
6044
|
),
|
|
5961
|
-
isLocked2 && /* @__PURE__ */
|
|
6045
|
+
isLocked2 && /* @__PURE__ */ jsx72(
|
|
5962
6046
|
ResultCard,
|
|
5963
6047
|
{
|
|
5964
6048
|
tone: "neutral",
|
|
@@ -5970,7 +6054,7 @@ function BeatTheGridGame({
|
|
|
5970
6054
|
}
|
|
5971
6055
|
)
|
|
5972
6056
|
] }),
|
|
5973
|
-
activeCell !== null && /* @__PURE__ */
|
|
6057
|
+
activeCell !== null && /* @__PURE__ */ jsx72("div", { className: "ss-g-btg-pin", children: /* @__PURE__ */ jsx72(
|
|
5974
6058
|
SearchSheet,
|
|
5975
6059
|
{
|
|
5976
6060
|
row: activeCell.row,
|
|
@@ -5989,21 +6073,21 @@ function BeatTheGridGame({
|
|
|
5989
6073
|
}
|
|
5990
6074
|
|
|
5991
6075
|
// src/components/games/GuessTheXiGame.tsx
|
|
5992
|
-
import { useState as
|
|
6076
|
+
import { useState as useState30, useId as useId5 } from "react";
|
|
5993
6077
|
|
|
5994
6078
|
// src/components/games/ui/PitchSvg.tsx
|
|
5995
|
-
import { Fragment as Fragment15, jsx as
|
|
6079
|
+
import { Fragment as Fragment15, jsx as jsx73, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
5996
6080
|
function PitchSvg({ variant }) {
|
|
5997
|
-
return /* @__PURE__ */
|
|
5998
|
-
/* @__PURE__ */
|
|
5999
|
-
variant === "full" ? /* @__PURE__ */
|
|
6000
|
-
/* @__PURE__ */
|
|
6001
|
-
/* @__PURE__ */
|
|
6002
|
-
/* @__PURE__ */
|
|
6003
|
-
/* @__PURE__ */
|
|
6004
|
-
] }) : /* @__PURE__ */
|
|
6005
|
-
/* @__PURE__ */
|
|
6006
|
-
/* @__PURE__ */
|
|
6081
|
+
return /* @__PURE__ */ jsxs61("svg", { className: "ss-g-pitch-svg", viewBox: variant === "full" ? "0 0 100 150" : "0 0 100 100", preserveAspectRatio: "none", "aria-hidden": "true", children: [
|
|
6082
|
+
/* @__PURE__ */ jsx73("rect", { x: "4", y: "4", width: "92", height: variant === "full" ? 142 : 92, fill: "none" }),
|
|
6083
|
+
variant === "full" ? /* @__PURE__ */ jsxs61(Fragment15, { children: [
|
|
6084
|
+
/* @__PURE__ */ jsx73("line", { x1: "4", y1: "75", x2: "96", y2: "75" }),
|
|
6085
|
+
/* @__PURE__ */ jsx73("circle", { cx: "50", cy: "75", r: "12", fill: "none" }),
|
|
6086
|
+
/* @__PURE__ */ jsx73("rect", { x: "26", y: "4", width: "48", height: "20", fill: "none" }),
|
|
6087
|
+
/* @__PURE__ */ jsx73("rect", { x: "26", y: "126", width: "48", height: "20", fill: "none" })
|
|
6088
|
+
] }) : /* @__PURE__ */ jsxs61(Fragment15, { children: [
|
|
6089
|
+
/* @__PURE__ */ jsx73("path", { d: "M38 4a12 12 0 0 0 24 0", fill: "none" }),
|
|
6090
|
+
/* @__PURE__ */ jsx73("rect", { x: "26", y: "76", width: "48", height: "20", fill: "none" })
|
|
6007
6091
|
] })
|
|
6008
6092
|
] });
|
|
6009
6093
|
}
|
|
@@ -6059,7 +6143,7 @@ function positionsBySlot(formation, rowsAttackFirst) {
|
|
|
6059
6143
|
}
|
|
6060
6144
|
|
|
6061
6145
|
// src/components/games/GuessTheXiGame.tsx
|
|
6062
|
-
import { Fragment as Fragment16, jsx as
|
|
6146
|
+
import { Fragment as Fragment16, jsx as jsx74, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
6063
6147
|
var MAX_GUESSES2 = 3;
|
|
6064
6148
|
function parseClientState5(json) {
|
|
6065
6149
|
if (!json) return null;
|
|
@@ -6078,7 +6162,7 @@ function GuessTheXiGame({
|
|
|
6078
6162
|
onBack
|
|
6079
6163
|
}) {
|
|
6080
6164
|
const t = ui.games.guessTheXi;
|
|
6081
|
-
const [query, setQuery] =
|
|
6165
|
+
const [query, setQuery] = useState30("");
|
|
6082
6166
|
const inputId = useId5();
|
|
6083
6167
|
const clientState = parseClientState5(result?.clientStateJson);
|
|
6084
6168
|
const isOver = result?.alreadyPlayed === true || clientState?.status === "solved" || clientState?.status === "failed";
|
|
@@ -6109,30 +6193,30 @@ function GuessTheXiGame({
|
|
|
6109
6193
|
const wrongGuesses = (clientState?.guessHistory ?? []).filter((g) => !g.wasCorrect);
|
|
6110
6194
|
const guessesLeft = Math.max(0, MAX_GUESSES2 - (clientState?.guessesUsed ?? 0));
|
|
6111
6195
|
const teamName = (id) => config?.teamPool.find((tm) => tm.teamId === id)?.teamName ?? `#${id}`;
|
|
6112
|
-
return /* @__PURE__ */
|
|
6113
|
-
/* @__PURE__ */
|
|
6196
|
+
return /* @__PURE__ */ jsxs62("div", { className: "ss-g-screen ss-g-gxi", "data-testid": "game-screen-guess-the-xi", children: [
|
|
6197
|
+
/* @__PURE__ */ jsx74(
|
|
6114
6198
|
GameHeader,
|
|
6115
6199
|
{
|
|
6116
6200
|
title: gameTitle({ gameId: "guess-the-xi" }, ui.games.titles),
|
|
6117
6201
|
eyebrow: config?.poolLabel,
|
|
6118
|
-
right: formation ? /* @__PURE__ */
|
|
6202
|
+
right: formation ? /* @__PURE__ */ jsx74(Chip, { variant: "accent", children: formation }) : void 0,
|
|
6119
6203
|
onBack,
|
|
6120
6204
|
backLabel: ui.back
|
|
6121
6205
|
}
|
|
6122
6206
|
),
|
|
6123
|
-
!config && /* @__PURE__ */
|
|
6124
|
-
config && /* @__PURE__ */
|
|
6125
|
-
/* @__PURE__ */
|
|
6126
|
-
rows.length > 0 && /* @__PURE__ */
|
|
6127
|
-
/* @__PURE__ */
|
|
6128
|
-
/* @__PURE__ */
|
|
6207
|
+
!config && /* @__PURE__ */ jsx74("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading }),
|
|
6208
|
+
config && /* @__PURE__ */ jsxs62(Fragment16, { children: [
|
|
6209
|
+
/* @__PURE__ */ jsxs62("div", { className: "ss-g-body", children: [
|
|
6210
|
+
rows.length > 0 && /* @__PURE__ */ jsxs62("div", { className: "ss-g-gxi-pitch", role: "group", "aria-label": t.pitchLabel, children: [
|
|
6211
|
+
/* @__PURE__ */ jsx74(PitchSvg, { variant: "full" }),
|
|
6212
|
+
/* @__PURE__ */ jsx74("div", { className: "ss-g-gxi-rows", children: rows.map((row, r) => /* @__PURE__ */ jsx74("div", { className: "ss-g-gxi-row", children: row.map((pos, c) => {
|
|
6129
6213
|
const posLabel = pos.slot ? posBySlot.get(pos.slot) ?? "" : "";
|
|
6130
6214
|
const name = pos.slot ? nameBySlot.get(pos.slot) : void 0;
|
|
6131
6215
|
const lineupEntry = pos.slot ? lineupBySlot.get(pos.slot) : void 0;
|
|
6132
6216
|
const flag = nationalityFlag(pos.nationality);
|
|
6133
6217
|
if (lineupEntry) {
|
|
6134
|
-
return /* @__PURE__ */
|
|
6135
|
-
/* @__PURE__ */
|
|
6218
|
+
return /* @__PURE__ */ jsxs62("div", { className: "ss-g-gxi-node", "data-revealed": "true", children: [
|
|
6219
|
+
/* @__PURE__ */ jsx74(
|
|
6136
6220
|
PlayerAvatar,
|
|
6137
6221
|
{
|
|
6138
6222
|
name: lineupEntry.name,
|
|
@@ -6140,11 +6224,11 @@ function GuessTheXiGame({
|
|
|
6140
6224
|
className: "ss-g-gxi-disc ss-g-gxi-disc--photo"
|
|
6141
6225
|
}
|
|
6142
6226
|
),
|
|
6143
|
-
/* @__PURE__ */
|
|
6227
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-gxi-pos ss-g-gxi-pos--name", children: splitName(lineupEntry.name).last })
|
|
6144
6228
|
] }, `${pos.slot}-${c}`);
|
|
6145
6229
|
}
|
|
6146
|
-
return /* @__PURE__ */
|
|
6147
|
-
/* @__PURE__ */
|
|
6230
|
+
return /* @__PURE__ */ jsxs62("div", { className: "ss-g-gxi-node", "data-revealed": name ? "true" : void 0, children: [
|
|
6231
|
+
/* @__PURE__ */ jsx74(
|
|
6148
6232
|
"span",
|
|
6149
6233
|
{
|
|
6150
6234
|
className: "ss-g-gxi-disc",
|
|
@@ -6155,22 +6239,22 @@ function GuessTheXiGame({
|
|
|
6155
6239
|
children: flag
|
|
6156
6240
|
}
|
|
6157
6241
|
),
|
|
6158
|
-
name ? /* @__PURE__ */
|
|
6242
|
+
name ? /* @__PURE__ */ jsx74("span", { className: "ss-g-gxi-pos ss-g-gxi-pos--name", children: splitName(name).last }) : posLabel && /* @__PURE__ */ jsx74("span", { className: "ss-g-gxi-pos", children: posLabel })
|
|
6159
6243
|
] }, `${pos.slot}-${c}`);
|
|
6160
6244
|
}) }, r)) })
|
|
6161
6245
|
] }),
|
|
6162
|
-
!isOver && wrongGuesses.length > 0 && /* @__PURE__ */
|
|
6163
|
-
/* @__PURE__ */
|
|
6246
|
+
!isOver && wrongGuesses.length > 0 && /* @__PURE__ */ jsxs62("div", { className: "ss-g-gxi-wrong", children: [
|
|
6247
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-gxi-wrong-l", children: t.notThem }),
|
|
6164
6248
|
wrongGuesses.map((g) => {
|
|
6165
6249
|
const crestUrl = config?.teamPool.find((tm) => tm.teamId === g.teamId)?.crestUrl;
|
|
6166
|
-
return /* @__PURE__ */
|
|
6167
|
-
/* @__PURE__ */
|
|
6168
|
-
/* @__PURE__ */
|
|
6250
|
+
return /* @__PURE__ */ jsxs62("span", { className: "ss-g-gxi-wrong-chip", children: [
|
|
6251
|
+
/* @__PURE__ */ jsx74(CrestShield, { src: crestUrl, name: teamName(g.teamId), size: 18 }),
|
|
6252
|
+
/* @__PURE__ */ jsx74("s", { children: teamName(g.teamId) })
|
|
6169
6253
|
] }, g.teamId);
|
|
6170
6254
|
})
|
|
6171
6255
|
] }),
|
|
6172
|
-
isOver && /* @__PURE__ */
|
|
6173
|
-
/* @__PURE__ */
|
|
6256
|
+
isOver && /* @__PURE__ */ jsxs62(Fragment16, { children: [
|
|
6257
|
+
/* @__PURE__ */ jsx74(
|
|
6174
6258
|
ResultCard,
|
|
6175
6259
|
{
|
|
6176
6260
|
tone: solved ? "win" : failed ? "lose" : "neutral",
|
|
@@ -6181,29 +6265,29 @@ function GuessTheXiGame({
|
|
|
6181
6265
|
ui
|
|
6182
6266
|
}
|
|
6183
6267
|
),
|
|
6184
|
-
(solved || failed) && clientState?.answer && /* @__PURE__ */
|
|
6185
|
-
/* @__PURE__ */
|
|
6186
|
-
/* @__PURE__ */
|
|
6187
|
-
/* @__PURE__ */
|
|
6268
|
+
(solved || failed) && clientState?.answer && /* @__PURE__ */ jsxs62("div", { className: "ss-g-gxi-answer", "data-testid": "gxi-answer-reveal", children: [
|
|
6269
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-gxi-answer-label", children: t.theAnswer }),
|
|
6270
|
+
/* @__PURE__ */ jsx74(CrestShield, { src: clientState.answer.crestUrl, name: clientState.answer.teamName, size: 32 }),
|
|
6271
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-gxi-answer-name", children: clientState.answer.teamName })
|
|
6188
6272
|
] })
|
|
6189
6273
|
] })
|
|
6190
6274
|
] }),
|
|
6191
|
-
!isOver && /* @__PURE__ */
|
|
6192
|
-
query.length > 0 && filtered.length > 0 && /* @__PURE__ */
|
|
6275
|
+
!isOver && /* @__PURE__ */ jsxs62(FooterBar, { children: [
|
|
6276
|
+
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ jsx74(
|
|
6193
6277
|
OptionList,
|
|
6194
6278
|
{
|
|
6195
6279
|
label: t.optionsLabel,
|
|
6196
6280
|
options: filtered.map((tm) => ({
|
|
6197
6281
|
key: tm.teamId,
|
|
6198
|
-
content: /* @__PURE__ */
|
|
6199
|
-
/* @__PURE__ */
|
|
6200
|
-
/* @__PURE__ */
|
|
6282
|
+
content: /* @__PURE__ */ jsxs62(Fragment16, { children: [
|
|
6283
|
+
/* @__PURE__ */ jsx74(CrestShield, { src: tm.crestUrl, name: tm.teamName, size: 28 }),
|
|
6284
|
+
/* @__PURE__ */ jsx74("span", { children: tm.teamName })
|
|
6201
6285
|
] })
|
|
6202
6286
|
})),
|
|
6203
6287
|
onPick: (k) => handlePick(Number(k))
|
|
6204
6288
|
}
|
|
6205
6289
|
),
|
|
6206
|
-
/* @__PURE__ */
|
|
6290
|
+
/* @__PURE__ */ jsx74(
|
|
6207
6291
|
SearchField,
|
|
6208
6292
|
{
|
|
6209
6293
|
id: inputId,
|
|
@@ -6220,8 +6304,8 @@ function GuessTheXiGame({
|
|
|
6220
6304
|
}
|
|
6221
6305
|
|
|
6222
6306
|
// src/components/games/DailyQuizGame.tsx
|
|
6223
|
-
import { useState as
|
|
6224
|
-
import { Fragment as Fragment17, jsx as
|
|
6307
|
+
import { useState as useState31 } from "react";
|
|
6308
|
+
import { Fragment as Fragment17, jsx as jsx75, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
6225
6309
|
function parseClientState6(json) {
|
|
6226
6310
|
if (!json) return null;
|
|
6227
6311
|
try {
|
|
@@ -6242,13 +6326,13 @@ function OptionName({ text }) {
|
|
|
6242
6326
|
const tokens = base.split(/\s+/).filter(Boolean);
|
|
6243
6327
|
const isPlainName = tokens.length >= 1 && tokens.length <= 4 && tokens.every((t) => NAME_TOKEN.test(t));
|
|
6244
6328
|
if (!isPlainName || base === "") {
|
|
6245
|
-
return /* @__PURE__ */
|
|
6329
|
+
return /* @__PURE__ */ jsx75("span", { className: "ss-g-dq-opt-name", children: /* @__PURE__ */ jsx75("span", { className: "ss-g-dq-opt-full", children: text }) });
|
|
6246
6330
|
}
|
|
6247
6331
|
const { first, last } = splitName(base);
|
|
6248
|
-
return /* @__PURE__ */
|
|
6249
|
-
first && /* @__PURE__ */
|
|
6250
|
-
/* @__PURE__ */
|
|
6251
|
-
suffix && /* @__PURE__ */
|
|
6332
|
+
return /* @__PURE__ */ jsxs63("span", { className: "ss-g-dq-opt-name", children: [
|
|
6333
|
+
first && /* @__PURE__ */ jsx75("span", { className: "ss-g-dq-opt-first", children: first }),
|
|
6334
|
+
/* @__PURE__ */ jsx75("span", { className: "ss-g-dq-opt-last", children: last }),
|
|
6335
|
+
suffix && /* @__PURE__ */ jsx75("span", { className: "ss-g-dq-opt-suffix", children: suffix })
|
|
6252
6336
|
] });
|
|
6253
6337
|
}
|
|
6254
6338
|
function DailyQuizGame({
|
|
@@ -6261,15 +6345,15 @@ function DailyQuizGame({
|
|
|
6261
6345
|
}) {
|
|
6262
6346
|
const s = ui.games.dailyQuiz;
|
|
6263
6347
|
const title = gameTitle({ gameId: "daily-quiz" }, ui.games.titles);
|
|
6264
|
-
const [selections, setSelections] =
|
|
6265
|
-
const [page, setPage] =
|
|
6348
|
+
const [selections, setSelections] = useState31(/* @__PURE__ */ new Map());
|
|
6349
|
+
const [page, setPage] = useState31(0);
|
|
6266
6350
|
const clientState = parseClientState6(result?.clientStateJson);
|
|
6267
6351
|
const results = clientState?.results ?? [];
|
|
6268
6352
|
const isRevealed = results.length > 0 || result?.alreadyPlayed === true;
|
|
6269
6353
|
if (!config) {
|
|
6270
|
-
return /* @__PURE__ */
|
|
6271
|
-
/* @__PURE__ */
|
|
6272
|
-
/* @__PURE__ */
|
|
6354
|
+
return /* @__PURE__ */ jsxs63("div", { className: "ss-g-screen", "data-testid": "game-screen-daily-quiz", children: [
|
|
6355
|
+
/* @__PURE__ */ jsx75(GameHeader, { title, onBack, backLabel: ui.back }),
|
|
6356
|
+
/* @__PURE__ */ jsx75("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
6273
6357
|
] });
|
|
6274
6358
|
}
|
|
6275
6359
|
const questions = config.questions;
|
|
@@ -6304,11 +6388,11 @@ function DailyQuizGame({
|
|
|
6304
6388
|
return r.isCorrect ? "correct" : "wrong";
|
|
6305
6389
|
});
|
|
6306
6390
|
const correctCount = results.filter((r) => r.isCorrect).length;
|
|
6307
|
-
return /* @__PURE__ */
|
|
6308
|
-
/* @__PURE__ */
|
|
6309
|
-
/* @__PURE__ */
|
|
6310
|
-
/* @__PURE__ */
|
|
6311
|
-
/* @__PURE__ */
|
|
6391
|
+
return /* @__PURE__ */ jsxs63("div", { className: "ss-g-screen", "data-testid": "game-screen-daily-quiz", children: [
|
|
6392
|
+
/* @__PURE__ */ jsx75(GameHeader, { title, eyebrow: s.results, onBack, backLabel: ui.back }),
|
|
6393
|
+
/* @__PURE__ */ jsx75(SegmentProgress, { segments: segments2, ariaLabel: s.results }),
|
|
6394
|
+
/* @__PURE__ */ jsxs63("div", { className: "ss-g-body", children: [
|
|
6395
|
+
/* @__PURE__ */ jsx75(
|
|
6312
6396
|
ResultCard,
|
|
6313
6397
|
{
|
|
6314
6398
|
tone: "neutral",
|
|
@@ -6321,15 +6405,15 @@ function DailyQuizGame({
|
|
|
6321
6405
|
questions.map((q) => {
|
|
6322
6406
|
const r = findResult(results, q.index);
|
|
6323
6407
|
const picked = selections.get(q.index);
|
|
6324
|
-
return /* @__PURE__ */
|
|
6325
|
-
/* @__PURE__ */
|
|
6326
|
-
r && /* @__PURE__ */
|
|
6408
|
+
return /* @__PURE__ */ jsxs63("div", { className: "ss-g-dq-rq", children: [
|
|
6409
|
+
/* @__PURE__ */ jsx75("div", { className: "ss-g-dq-rq-stem", children: q.stem }),
|
|
6410
|
+
r && /* @__PURE__ */ jsx75("div", { className: "ss-g-dq-rq-opts", children: q.options.map((opt, optIdx) => {
|
|
6327
6411
|
let cls = "ss-g-dq-rq-opt";
|
|
6328
6412
|
if (optIdx === r.correctOptionIndex) cls += " ss-g-dq-rq-opt--correct";
|
|
6329
6413
|
else if (optIdx === picked && !r.isCorrect) cls += " ss-g-dq-rq-opt--wrong";
|
|
6330
|
-
return /* @__PURE__ */
|
|
6414
|
+
return /* @__PURE__ */ jsx75("span", { className: cls, children: opt }, optIdx);
|
|
6331
6415
|
}) }),
|
|
6332
|
-
r?.revealText && /* @__PURE__ */
|
|
6416
|
+
r?.revealText && /* @__PURE__ */ jsx75("div", { className: "ss-g-dq-why", children: r.revealText })
|
|
6333
6417
|
] }, q.index);
|
|
6334
6418
|
})
|
|
6335
6419
|
] })
|
|
@@ -6337,16 +6421,16 @@ function DailyQuizGame({
|
|
|
6337
6421
|
}
|
|
6338
6422
|
const segments = questions.map((_, i) => i < page ? "done" : i === page ? "current" : "todo");
|
|
6339
6423
|
const selectedIdx = current ? selections.get(current.index) : void 0;
|
|
6340
|
-
return /* @__PURE__ */
|
|
6341
|
-
/* @__PURE__ */
|
|
6342
|
-
/* @__PURE__ */
|
|
6343
|
-
/* @__PURE__ */
|
|
6344
|
-
/* @__PURE__ */
|
|
6345
|
-
/* @__PURE__ */
|
|
6424
|
+
return /* @__PURE__ */ jsxs63("div", { className: "ss-g-screen", "data-testid": "game-screen-daily-quiz", children: [
|
|
6425
|
+
/* @__PURE__ */ jsx75(GameHeader, { title, eyebrow: s.questionOf(page + 1, total), onBack, backLabel: ui.back }),
|
|
6426
|
+
/* @__PURE__ */ jsx75(SegmentProgress, { segments, ariaLabel: s.progressAria(page + 1, total) }),
|
|
6427
|
+
/* @__PURE__ */ jsx75("div", { className: "ss-g-body", children: current && /* @__PURE__ */ jsxs63(Fragment17, { children: [
|
|
6428
|
+
/* @__PURE__ */ jsx75("h3", { className: "ss-g-dq-stem", children: current.stem }),
|
|
6429
|
+
/* @__PURE__ */ jsx75("div", { className: "ss-g-dq-opts", children: current.options.map((opt, optIdx) => {
|
|
6346
6430
|
const selected = optIdx === selectedIdx;
|
|
6347
6431
|
const imagePath = current.optionImagePaths?.[optIdx] ?? void 0;
|
|
6348
6432
|
const playerName = opt;
|
|
6349
|
-
return /* @__PURE__ */
|
|
6433
|
+
return /* @__PURE__ */ jsxs63(
|
|
6350
6434
|
"button",
|
|
6351
6435
|
{
|
|
6352
6436
|
type: "button",
|
|
@@ -6355,25 +6439,25 @@ function DailyQuizGame({
|
|
|
6355
6439
|
disabled: submitting,
|
|
6356
6440
|
onClick: () => handleSelect(current.index, optIdx),
|
|
6357
6441
|
children: [
|
|
6358
|
-
current.optionImagePaths && /* @__PURE__ */
|
|
6359
|
-
/* @__PURE__ */
|
|
6360
|
-
/* @__PURE__ */
|
|
6442
|
+
current.optionImagePaths && /* @__PURE__ */ jsx75(PlayerAvatar, { name: playerName, imagePath, className: "ss-g-dq-opt-av" }),
|
|
6443
|
+
/* @__PURE__ */ jsx75("span", { className: "ss-g-dq-badge", "aria-hidden": "true", children: selected ? /* @__PURE__ */ jsx75(IconCheck, {}) : String.fromCharCode(65 + optIdx) }),
|
|
6444
|
+
/* @__PURE__ */ jsx75(OptionName, { text: opt })
|
|
6361
6445
|
]
|
|
6362
6446
|
},
|
|
6363
6447
|
optIdx
|
|
6364
6448
|
);
|
|
6365
6449
|
}) })
|
|
6366
6450
|
] }) }),
|
|
6367
|
-
/* @__PURE__ */
|
|
6368
|
-
page > 0 && /* @__PURE__ */
|
|
6369
|
-
isLast ? /* @__PURE__ */
|
|
6451
|
+
/* @__PURE__ */ jsx75(FooterBar, { children: /* @__PURE__ */ jsxs63("div", { className: "ss-g-dq-nav", children: [
|
|
6452
|
+
page > 0 && /* @__PURE__ */ jsx75(GameButton, { variant: "outline", onClick: goPrev, disabled: submitting, children: s.previous }),
|
|
6453
|
+
isLast ? /* @__PURE__ */ jsx75(GameButton, { variant: "primary", block: true, onClick: handleSubmit, disabled: !currentAnswered || !allAnswered || submitting, children: submitting ? s.submitting : s.submit }) : /* @__PURE__ */ jsx75(GameButton, { variant: "primary", block: true, onClick: goNext, disabled: !currentAnswered || submitting, children: s.next })
|
|
6370
6454
|
] }) })
|
|
6371
6455
|
] });
|
|
6372
6456
|
}
|
|
6373
6457
|
|
|
6374
6458
|
// src/components/games/MatchdayPredictorGame.tsx
|
|
6375
|
-
import { useId as useId6, useState as
|
|
6376
|
-
import { jsx as
|
|
6459
|
+
import { useId as useId6, useState as useState32 } from "react";
|
|
6460
|
+
import { jsx as jsx76, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
6377
6461
|
var SCORER_SEARCH_THRESHOLD = 9;
|
|
6378
6462
|
function parseClientState7(json) {
|
|
6379
6463
|
if (!json) return null;
|
|
@@ -6391,7 +6475,7 @@ function isLocked(kickoffUtc) {
|
|
|
6391
6475
|
}
|
|
6392
6476
|
}
|
|
6393
6477
|
function IconMinus() {
|
|
6394
|
-
return /* @__PURE__ */
|
|
6478
|
+
return /* @__PURE__ */ jsx76(
|
|
6395
6479
|
"svg",
|
|
6396
6480
|
{
|
|
6397
6481
|
width: 18,
|
|
@@ -6402,20 +6486,20 @@ function IconMinus() {
|
|
|
6402
6486
|
strokeWidth: 2.2,
|
|
6403
6487
|
strokeLinecap: "round",
|
|
6404
6488
|
"aria-hidden": "true",
|
|
6405
|
-
children: /* @__PURE__ */
|
|
6489
|
+
children: /* @__PURE__ */ jsx76("path", { d: "M5 12h14" })
|
|
6406
6490
|
}
|
|
6407
6491
|
);
|
|
6408
6492
|
}
|
|
6409
6493
|
function TeamBadge({ team, label }) {
|
|
6410
|
-
return /* @__PURE__ */
|
|
6411
|
-
/* @__PURE__ */
|
|
6412
|
-
/* @__PURE__ */
|
|
6413
|
-
/* @__PURE__ */
|
|
6494
|
+
return /* @__PURE__ */ jsxs64("div", { className: "ss-g-mp-team", children: [
|
|
6495
|
+
/* @__PURE__ */ jsx76(CrestShield, { name: team.name, size: 44 }),
|
|
6496
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-mp-team-name", children: team.name }),
|
|
6497
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-mp-team-side", children: label })
|
|
6414
6498
|
] });
|
|
6415
6499
|
}
|
|
6416
6500
|
function ScoreCard({ home, away, h, a, t, edit }) {
|
|
6417
|
-
const col = (side, team, value) => /* @__PURE__ */
|
|
6418
|
-
edit && /* @__PURE__ */
|
|
6501
|
+
const col = (side, team, value) => /* @__PURE__ */ jsxs64("div", { className: "ss-g-mp-col", children: [
|
|
6502
|
+
edit && /* @__PURE__ */ jsx76(
|
|
6419
6503
|
"button",
|
|
6420
6504
|
{
|
|
6421
6505
|
type: "button",
|
|
@@ -6423,11 +6507,11 @@ function ScoreCard({ home, away, h, a, t, edit }) {
|
|
|
6423
6507
|
"aria-label": t.goalsUp(team.name),
|
|
6424
6508
|
disabled: edit.disabled,
|
|
6425
6509
|
onClick: () => edit.onStep(side, 1),
|
|
6426
|
-
children: /* @__PURE__ */
|
|
6510
|
+
children: /* @__PURE__ */ jsx76(IconPlus, { size: 18 })
|
|
6427
6511
|
}
|
|
6428
6512
|
),
|
|
6429
|
-
/* @__PURE__ */
|
|
6430
|
-
edit && /* @__PURE__ */
|
|
6513
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-mp-digit", "data-testid": "mp-digit", "data-active": edit ? String(edit.active === side) : "false", children: value }),
|
|
6514
|
+
edit && /* @__PURE__ */ jsx76(
|
|
6431
6515
|
"button",
|
|
6432
6516
|
{
|
|
6433
6517
|
type: "button",
|
|
@@ -6435,27 +6519,27 @@ function ScoreCard({ home, away, h, a, t, edit }) {
|
|
|
6435
6519
|
"aria-label": t.goalsDown(team.name),
|
|
6436
6520
|
disabled: edit.disabled || value <= 0,
|
|
6437
6521
|
onClick: () => edit.onStep(side, -1),
|
|
6438
|
-
children: /* @__PURE__ */
|
|
6522
|
+
children: /* @__PURE__ */ jsx76(IconMinus, {})
|
|
6439
6523
|
}
|
|
6440
6524
|
)
|
|
6441
6525
|
] });
|
|
6442
|
-
return /* @__PURE__ */
|
|
6443
|
-
/* @__PURE__ */
|
|
6444
|
-
/* @__PURE__ */
|
|
6526
|
+
return /* @__PURE__ */ jsxs64("div", { className: "ss-g-mp-card", children: [
|
|
6527
|
+
/* @__PURE__ */ jsx76(TeamBadge, { team: home, label: t.home }),
|
|
6528
|
+
/* @__PURE__ */ jsxs64("div", { className: "ss-g-mp-scores", children: [
|
|
6445
6529
|
col("home", home, h),
|
|
6446
|
-
/* @__PURE__ */
|
|
6530
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-mp-dash", "aria-hidden": "true", children: "\u2013" }),
|
|
6447
6531
|
col("away", away, a)
|
|
6448
6532
|
] }),
|
|
6449
|
-
/* @__PURE__ */
|
|
6533
|
+
/* @__PURE__ */ jsx76(TeamBadge, { team: away, label: t.away })
|
|
6450
6534
|
] });
|
|
6451
6535
|
}
|
|
6452
6536
|
function OutcomeRow({ label, ok, detail, t }) {
|
|
6453
|
-
return /* @__PURE__ */
|
|
6454
|
-
/* @__PURE__ */
|
|
6455
|
-
/* @__PURE__ */
|
|
6456
|
-
ok ? /* @__PURE__ */
|
|
6457
|
-
/* @__PURE__ */
|
|
6458
|
-
detail ? /* @__PURE__ */
|
|
6537
|
+
return /* @__PURE__ */ jsxs64("li", { className: "ss-g-mp-row", "data-testid": "mp-row", "data-ok": String(ok), children: [
|
|
6538
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-mp-row-k", children: label }),
|
|
6539
|
+
/* @__PURE__ */ jsxs64("span", { className: "ss-g-mp-row-v", children: [
|
|
6540
|
+
ok ? /* @__PURE__ */ jsx76(IconCheck, {}) : /* @__PURE__ */ jsx76(IconClose, { size: 14 }),
|
|
6541
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-sr", children: ok ? t.correct : t.incorrect }),
|
|
6542
|
+
detail ? /* @__PURE__ */ jsx76("span", { className: "ss-g-mp-row-d", children: detail }) : null
|
|
6459
6543
|
] })
|
|
6460
6544
|
] });
|
|
6461
6545
|
}
|
|
@@ -6468,20 +6552,20 @@ function MatchdayPredictorGame({
|
|
|
6468
6552
|
onBack
|
|
6469
6553
|
}) {
|
|
6470
6554
|
const t = ui.games.predictor;
|
|
6471
|
-
const [homeScore, setHomeScore] =
|
|
6472
|
-
const [awayScore, setAwayScore] =
|
|
6473
|
-
const [firstScorerPlayerId, setFirstScorerPlayerId] =
|
|
6474
|
-
const [lastEdited, setLastEdited] =
|
|
6475
|
-
const [query, setQuery] =
|
|
6555
|
+
const [homeScore, setHomeScore] = useState32(0);
|
|
6556
|
+
const [awayScore, setAwayScore] = useState32(0);
|
|
6557
|
+
const [firstScorerPlayerId, setFirstScorerPlayerId] = useState32(null);
|
|
6558
|
+
const [lastEdited, setLastEdited] = useState32("home");
|
|
6559
|
+
const [query, setQuery] = useState32("");
|
|
6476
6560
|
const searchId = useId6();
|
|
6477
6561
|
const clientState = parseClientState7(result?.clientStateJson);
|
|
6478
6562
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
6479
|
-
const header = /* @__PURE__ */
|
|
6563
|
+
const header = /* @__PURE__ */ jsx76(
|
|
6480
6564
|
GameHeader,
|
|
6481
6565
|
{
|
|
6482
6566
|
title: gameTitle({ gameId: "matchday-predictor" }, ui.games.titles),
|
|
6483
6567
|
eyebrow: config ? t.eyebrow(config.homeTeam.name, config.awayTeam.name) : void 0,
|
|
6484
|
-
right: config ? /* @__PURE__ */
|
|
6568
|
+
right: config ? /* @__PURE__ */ jsx76(Chip, { icon: /* @__PURE__ */ jsx76(IconLock, {}), children: ui.games.formatDayTime(config.kickoffUtc) }) : void 0,
|
|
6485
6569
|
onBack,
|
|
6486
6570
|
backLabel: ui.back
|
|
6487
6571
|
}
|
|
@@ -6489,10 +6573,10 @@ function MatchdayPredictorGame({
|
|
|
6489
6573
|
if (alreadyPlayed && clientState) {
|
|
6490
6574
|
if (!clientState.graded) {
|
|
6491
6575
|
const scorer = config?.scorerPool.find((p) => p.playerId === clientState.predictedFirstScorerPlayerId) ?? null;
|
|
6492
|
-
return /* @__PURE__ */
|
|
6576
|
+
return /* @__PURE__ */ jsxs64("div", { className: "ss-g-screen", "data-testid": "game-screen-matchday-predictor", children: [
|
|
6493
6577
|
header,
|
|
6494
|
-
/* @__PURE__ */
|
|
6495
|
-
config && /* @__PURE__ */
|
|
6578
|
+
/* @__PURE__ */ jsxs64("div", { className: "ss-g-body", children: [
|
|
6579
|
+
config && /* @__PURE__ */ jsx76(
|
|
6496
6580
|
ScoreCard,
|
|
6497
6581
|
{
|
|
6498
6582
|
home: config.homeTeam,
|
|
@@ -6502,7 +6586,7 @@ function MatchdayPredictorGame({
|
|
|
6502
6586
|
t
|
|
6503
6587
|
}
|
|
6504
6588
|
),
|
|
6505
|
-
/* @__PURE__ */
|
|
6589
|
+
/* @__PURE__ */ jsx76(
|
|
6506
6590
|
ResultCard,
|
|
6507
6591
|
{
|
|
6508
6592
|
tone: "neutral",
|
|
@@ -6519,28 +6603,28 @@ function MatchdayPredictorGame({
|
|
|
6519
6603
|
}
|
|
6520
6604
|
)
|
|
6521
6605
|
] }),
|
|
6522
|
-
/* @__PURE__ */
|
|
6606
|
+
/* @__PURE__ */ jsx76(FooterBar, { children: /* @__PURE__ */ jsx76("p", { className: "ss-g-mp-fun", children: t.forFun }) })
|
|
6523
6607
|
] });
|
|
6524
6608
|
}
|
|
6525
6609
|
const r = clientState.result;
|
|
6526
|
-
return /* @__PURE__ */
|
|
6610
|
+
return /* @__PURE__ */ jsxs64("div", { className: "ss-g-screen", "data-testid": "game-screen-matchday-predictor", children: [
|
|
6527
6611
|
header,
|
|
6528
|
-
/* @__PURE__ */
|
|
6529
|
-
config && /* @__PURE__ */
|
|
6530
|
-
/* @__PURE__ */
|
|
6531
|
-
/* @__PURE__ */
|
|
6532
|
-
/* @__PURE__ */
|
|
6533
|
-
/* @__PURE__ */
|
|
6534
|
-
!clientState.firstScorerVoid && /* @__PURE__ */
|
|
6612
|
+
/* @__PURE__ */ jsxs64("div", { className: "ss-g-body", children: [
|
|
6613
|
+
config && /* @__PURE__ */ jsx76(ScoreCard, { home: config.homeTeam, away: config.awayTeam, h: r.homeScore, a: r.awayScore, t }),
|
|
6614
|
+
/* @__PURE__ */ jsx76(ResultCard, { tone: "neutral", title: t.fullTime(r.homeScore, r.awayScore), onBack, ui }),
|
|
6615
|
+
/* @__PURE__ */ jsxs64("ul", { className: "ss-g-mp-rows", children: [
|
|
6616
|
+
/* @__PURE__ */ jsx76(OutcomeRow, { label: t.exactScore, ok: clientState.exactScoreCorrect, t }),
|
|
6617
|
+
/* @__PURE__ */ jsx76(OutcomeRow, { label: t.outcome, ok: clientState.outcomeCorrect, t }),
|
|
6618
|
+
!clientState.firstScorerVoid && /* @__PURE__ */ jsx76(OutcomeRow, { label: t.firstScorerRow, ok: clientState.firstScorerCorrect, detail: r.firstScorerName, t })
|
|
6535
6619
|
] })
|
|
6536
6620
|
] }),
|
|
6537
|
-
/* @__PURE__ */
|
|
6621
|
+
/* @__PURE__ */ jsx76(FooterBar, { children: /* @__PURE__ */ jsx76("p", { className: "ss-g-mp-fun", children: t.forFun }) })
|
|
6538
6622
|
] });
|
|
6539
6623
|
}
|
|
6540
6624
|
if (!config) {
|
|
6541
|
-
return /* @__PURE__ */
|
|
6625
|
+
return /* @__PURE__ */ jsxs64("div", { className: "ss-g-screen", "data-testid": "game-screen-matchday-predictor", children: [
|
|
6542
6626
|
header,
|
|
6543
|
-
/* @__PURE__ */
|
|
6627
|
+
/* @__PURE__ */ jsx76("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
6544
6628
|
] });
|
|
6545
6629
|
}
|
|
6546
6630
|
const locked = isLocked(config.kickoffUtc);
|
|
@@ -6564,10 +6648,10 @@ function MatchdayPredictorGame({
|
|
|
6564
6648
|
const showSearch = pool.length > SCORER_SEARCH_THRESHOLD;
|
|
6565
6649
|
const q = query.trim().toLowerCase();
|
|
6566
6650
|
const visible = showSearch && q ? pool.filter((p) => p.playerName.toLowerCase().includes(q)) : pool;
|
|
6567
|
-
return /* @__PURE__ */
|
|
6651
|
+
return /* @__PURE__ */ jsxs64("div", { className: "ss-g-screen", "data-testid": "game-screen-matchday-predictor", children: [
|
|
6568
6652
|
header,
|
|
6569
|
-
/* @__PURE__ */
|
|
6570
|
-
/* @__PURE__ */
|
|
6653
|
+
/* @__PURE__ */ jsxs64("div", { className: "ss-g-body", children: [
|
|
6654
|
+
/* @__PURE__ */ jsx76(
|
|
6571
6655
|
ScoreCard,
|
|
6572
6656
|
{
|
|
6573
6657
|
home: config.homeTeam,
|
|
@@ -6578,12 +6662,12 @@ function MatchdayPredictorGame({
|
|
|
6578
6662
|
edit: { disabled, active: lastEdited, onStep: step }
|
|
6579
6663
|
}
|
|
6580
6664
|
),
|
|
6581
|
-
pool.length > 0 && /* @__PURE__ */
|
|
6582
|
-
/* @__PURE__ */
|
|
6583
|
-
/* @__PURE__ */
|
|
6584
|
-
/* @__PURE__ */
|
|
6665
|
+
pool.length > 0 && /* @__PURE__ */ jsxs64("section", { className: "ss-g-mp-scorer", children: [
|
|
6666
|
+
/* @__PURE__ */ jsxs64("div", { className: "ss-g-mp-sec-head", children: [
|
|
6667
|
+
/* @__PURE__ */ jsx76("h3", { children: t.firstScorer }),
|
|
6668
|
+
/* @__PURE__ */ jsx76("span", { children: t.optional })
|
|
6585
6669
|
] }),
|
|
6586
|
-
showSearch && /* @__PURE__ */
|
|
6670
|
+
showSearch && /* @__PURE__ */ jsx76(
|
|
6587
6671
|
SearchField,
|
|
6588
6672
|
{
|
|
6589
6673
|
id: searchId,
|
|
@@ -6595,9 +6679,9 @@ function MatchdayPredictorGame({
|
|
|
6595
6679
|
disabled
|
|
6596
6680
|
}
|
|
6597
6681
|
),
|
|
6598
|
-
/* @__PURE__ */
|
|
6682
|
+
/* @__PURE__ */ jsx76("div", { className: "ss-g-mp-grid", children: visible.map((p) => {
|
|
6599
6683
|
const selected = firstScorerPlayerId === p.playerId;
|
|
6600
|
-
return /* @__PURE__ */
|
|
6684
|
+
return /* @__PURE__ */ jsxs64(
|
|
6601
6685
|
"button",
|
|
6602
6686
|
{
|
|
6603
6687
|
type: "button",
|
|
@@ -6607,15 +6691,15 @@ function MatchdayPredictorGame({
|
|
|
6607
6691
|
disabled,
|
|
6608
6692
|
onClick: () => setFirstScorerPlayerId((id) => id === p.playerId ? null : p.playerId),
|
|
6609
6693
|
children: [
|
|
6610
|
-
selected && /* @__PURE__ */
|
|
6611
|
-
/* @__PURE__ */
|
|
6612
|
-
/* @__PURE__ */
|
|
6694
|
+
selected && /* @__PURE__ */ jsx76("span", { className: "ss-g-mp-pcheck", children: /* @__PURE__ */ jsx76(IconCheck, { size: 12 }) }),
|
|
6695
|
+
/* @__PURE__ */ jsx76(Silhouette, { size: 52, variant: selected ? "selected" : "default" }),
|
|
6696
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-mp-pname", children: splitName(p.playerName).last })
|
|
6613
6697
|
]
|
|
6614
6698
|
},
|
|
6615
6699
|
p.playerId
|
|
6616
6700
|
);
|
|
6617
6701
|
}) }),
|
|
6618
|
-
/* @__PURE__ */
|
|
6702
|
+
/* @__PURE__ */ jsxs64(
|
|
6619
6703
|
"button",
|
|
6620
6704
|
{
|
|
6621
6705
|
type: "button",
|
|
@@ -6624,24 +6708,24 @@ function MatchdayPredictorGame({
|
|
|
6624
6708
|
disabled,
|
|
6625
6709
|
onClick: () => setFirstScorerPlayerId(null),
|
|
6626
6710
|
children: [
|
|
6627
|
-
/* @__PURE__ */
|
|
6711
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-mp-radio", "aria-hidden": "true" }),
|
|
6628
6712
|
t.noScorer
|
|
6629
6713
|
]
|
|
6630
6714
|
}
|
|
6631
6715
|
)
|
|
6632
6716
|
] }),
|
|
6633
|
-
locked && /* @__PURE__ */
|
|
6717
|
+
locked && /* @__PURE__ */ jsx76("p", { className: "ss-g-mp-closed", children: t.closed })
|
|
6634
6718
|
] }),
|
|
6635
|
-
/* @__PURE__ */
|
|
6636
|
-
/* @__PURE__ */
|
|
6637
|
-
/* @__PURE__ */
|
|
6719
|
+
/* @__PURE__ */ jsxs64(FooterBar, { children: [
|
|
6720
|
+
/* @__PURE__ */ jsx76(GameButton, { variant: "primary", block: true, disabled, onClick: handleSubmit, children: submitting ? t.saving : t.save }),
|
|
6721
|
+
/* @__PURE__ */ jsx76("p", { className: "ss-g-mp-fun", children: t.forFun })
|
|
6638
6722
|
] })
|
|
6639
6723
|
] });
|
|
6640
6724
|
}
|
|
6641
6725
|
|
|
6642
6726
|
// src/components/games/StartingXiGame.tsx
|
|
6643
|
-
import { useId as useId7, useState as
|
|
6644
|
-
import { Fragment as Fragment18, jsx as
|
|
6727
|
+
import { useId as useId7, useState as useState33 } from "react";
|
|
6728
|
+
import { Fragment as Fragment18, jsx as jsx77, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
6645
6729
|
var POINTS_PER_STARTER = 8;
|
|
6646
6730
|
var XI_SIZE = 11;
|
|
6647
6731
|
var DEFAULT_FORMATION = "4-3-3";
|
|
@@ -6684,26 +6768,26 @@ function StartingXiGame({
|
|
|
6684
6768
|
lockAtUtc
|
|
6685
6769
|
}) {
|
|
6686
6770
|
const t = ui.games.startingXi;
|
|
6687
|
-
const [slotPlayers, setSlotPlayers] =
|
|
6688
|
-
const [active, setActive] =
|
|
6689
|
-
const [query, setQuery] =
|
|
6771
|
+
const [slotPlayers, setSlotPlayers] = useState33(() => Array(XI_SIZE).fill(null));
|
|
6772
|
+
const [active, setActive] = useState33(0);
|
|
6773
|
+
const [query, setQuery] = useState33("");
|
|
6690
6774
|
const searchId = useId7();
|
|
6691
6775
|
const clientState = parseClientState8(result?.clientStateJson);
|
|
6692
6776
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
6693
|
-
const header = /* @__PURE__ */
|
|
6777
|
+
const header = /* @__PURE__ */ jsx77(
|
|
6694
6778
|
GameHeader,
|
|
6695
6779
|
{
|
|
6696
6780
|
title: gameTitle({ gameId: "starting-xi" }, ui.games.titles),
|
|
6697
6781
|
eyebrow: t.eyebrow,
|
|
6698
|
-
right: /* @__PURE__ */
|
|
6782
|
+
right: /* @__PURE__ */ jsx77(Chip, { variant: "accent", children: t.perStarter(POINTS_PER_STARTER) }),
|
|
6699
6783
|
onBack,
|
|
6700
6784
|
backLabel: ui.back
|
|
6701
6785
|
}
|
|
6702
6786
|
);
|
|
6703
6787
|
function statusScreen(title, score) {
|
|
6704
|
-
return /* @__PURE__ */
|
|
6788
|
+
return /* @__PURE__ */ jsxs65("div", { className: "ss-g-screen", "data-testid": "game-screen-starting-xi", children: [
|
|
6705
6789
|
header,
|
|
6706
|
-
/* @__PURE__ */
|
|
6790
|
+
/* @__PURE__ */ jsx77("div", { className: "ss-g-body", children: /* @__PURE__ */ jsx77(ResultCard, { tone: "neutral", title, score, onBack, ui }) })
|
|
6707
6791
|
] });
|
|
6708
6792
|
}
|
|
6709
6793
|
if (alreadyPlayed) {
|
|
@@ -6712,9 +6796,9 @@ function StartingXiGame({
|
|
|
6712
6796
|
if (clientState.status === "graded") return statusScreen(t.gradedLine(clientState.correctCount), clientState.score);
|
|
6713
6797
|
}
|
|
6714
6798
|
if (!config) {
|
|
6715
|
-
return /* @__PURE__ */
|
|
6799
|
+
return /* @__PURE__ */ jsxs65("div", { className: "ss-g-screen", "data-testid": "game-screen-starting-xi", children: [
|
|
6716
6800
|
header,
|
|
6717
|
-
/* @__PURE__ */
|
|
6801
|
+
/* @__PURE__ */ jsx77("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
6718
6802
|
] });
|
|
6719
6803
|
}
|
|
6720
6804
|
const { formation, slots } = formationSlots(config.formation);
|
|
@@ -6749,27 +6833,27 @@ function StartingXiGame({
|
|
|
6749
6833
|
onSubmit(JSON.stringify({ predictedPlayerIds: slotPlayers }));
|
|
6750
6834
|
}
|
|
6751
6835
|
const segments = slotPlayers.map((p) => p !== null ? "current" : "todo");
|
|
6752
|
-
return /* @__PURE__ */
|
|
6836
|
+
return /* @__PURE__ */ jsxs65("div", { className: "ss-g-screen", "data-testid": "game-screen-starting-xi", children: [
|
|
6753
6837
|
header,
|
|
6754
|
-
/* @__PURE__ */
|
|
6838
|
+
/* @__PURE__ */ jsx77(
|
|
6755
6839
|
SegmentProgress,
|
|
6756
6840
|
{
|
|
6757
6841
|
segments,
|
|
6758
6842
|
ariaLabel: t.picked(pickedCount),
|
|
6759
6843
|
leftLabel: t.picked(pickedCount),
|
|
6760
6844
|
rightLabel: t.toGo(XI_SIZE - pickedCount),
|
|
6761
|
-
right: /* @__PURE__ */
|
|
6845
|
+
right: /* @__PURE__ */ jsx77(Chip, { children: formation })
|
|
6762
6846
|
}
|
|
6763
6847
|
),
|
|
6764
|
-
/* @__PURE__ */
|
|
6765
|
-
/* @__PURE__ */
|
|
6766
|
-
/* @__PURE__ */
|
|
6848
|
+
/* @__PURE__ */ jsxs65("div", { className: "ss-g-body", children: [
|
|
6849
|
+
/* @__PURE__ */ jsxs65("div", { className: "ss-g-xi-pitch", children: [
|
|
6850
|
+
/* @__PURE__ */ jsx77(PitchSvg, { variant: "half" }),
|
|
6767
6851
|
slots.map((s) => {
|
|
6768
6852
|
const playerId = slotPlayers[s.index] ?? null;
|
|
6769
6853
|
const player = playerId !== null ? byId.get(playerId) ?? null : null;
|
|
6770
6854
|
const name = player?.playerName ?? "";
|
|
6771
6855
|
const state = player ? "filled" : active === s.index ? "active" : "empty";
|
|
6772
|
-
return /* @__PURE__ */
|
|
6856
|
+
return /* @__PURE__ */ jsxs65(
|
|
6773
6857
|
"button",
|
|
6774
6858
|
{
|
|
6775
6859
|
type: "button",
|
|
@@ -6781,21 +6865,21 @@ function StartingXiGame({
|
|
|
6781
6865
|
disabled: submitting,
|
|
6782
6866
|
onClick: () => tapSlot(s.index),
|
|
6783
6867
|
children: [
|
|
6784
|
-
/* @__PURE__ */
|
|
6785
|
-
/* @__PURE__ */
|
|
6868
|
+
/* @__PURE__ */ jsx77("span", { className: "ss-g-xi-ring", "aria-hidden": "true", children: player ? player.jerseyNumber ?? "" : /* @__PURE__ */ jsx77(IconPlus, { size: 18 }) }),
|
|
6869
|
+
/* @__PURE__ */ jsx77("span", { className: "ss-g-xi-tag", "aria-hidden": "true", children: player ? splitName(name).last : s.label })
|
|
6786
6870
|
]
|
|
6787
6871
|
},
|
|
6788
6872
|
s.index
|
|
6789
6873
|
);
|
|
6790
6874
|
})
|
|
6791
6875
|
] }),
|
|
6792
|
-
/* @__PURE__ */
|
|
6793
|
-
/* @__PURE__ */
|
|
6794
|
-
/* @__PURE__ */
|
|
6795
|
-
/* @__PURE__ */
|
|
6796
|
-
] }) : /* @__PURE__ */
|
|
6797
|
-
activeSlot && /* @__PURE__ */
|
|
6798
|
-
/* @__PURE__ */
|
|
6876
|
+
/* @__PURE__ */ jsxs65("div", { className: "ss-g-xi-picker", children: [
|
|
6877
|
+
/* @__PURE__ */ jsx77("div", { className: "ss-g-xi-picker-head", children: activeSlot ? /* @__PURE__ */ jsxs65(Fragment18, { children: [
|
|
6878
|
+
/* @__PURE__ */ jsx77(Chip, { variant: "badge", children: activeSlot.label }),
|
|
6879
|
+
/* @__PURE__ */ jsx77("strong", { children: t.pickFor(activeSlot.label) })
|
|
6880
|
+
] }) : /* @__PURE__ */ jsx77("strong", { children: t.allPicked }) }),
|
|
6881
|
+
activeSlot && /* @__PURE__ */ jsxs65(Fragment18, { children: [
|
|
6882
|
+
/* @__PURE__ */ jsx77(
|
|
6799
6883
|
SearchField,
|
|
6800
6884
|
{
|
|
6801
6885
|
id: searchId,
|
|
@@ -6807,18 +6891,18 @@ function StartingXiGame({
|
|
|
6807
6891
|
disabled: submitting
|
|
6808
6892
|
}
|
|
6809
6893
|
),
|
|
6810
|
-
/* @__PURE__ */
|
|
6811
|
-
/* @__PURE__ */
|
|
6812
|
-
/* @__PURE__ */
|
|
6813
|
-
/* @__PURE__ */
|
|
6894
|
+
/* @__PURE__ */ jsx77("ul", { className: "ss-g-xi-list", children: available.map((p) => /* @__PURE__ */ jsx77("li", { children: /* @__PURE__ */ jsxs65("button", { type: "button", className: "ss-g-xi-opt", disabled: submitting, onClick: () => pick(p.playerId), children: [
|
|
6895
|
+
/* @__PURE__ */ jsx77("span", { className: "ss-g-xi-opt-no", "aria-hidden": "true", children: p.jerseyNumber ?? "" }),
|
|
6896
|
+
/* @__PURE__ */ jsx77("span", { className: "ss-g-xi-opt-name", children: p.playerName }),
|
|
6897
|
+
/* @__PURE__ */ jsx77("span", { className: "ss-g-xi-opt-pos", children: p.positionName })
|
|
6814
6898
|
] }) }, p.playerId)) })
|
|
6815
6899
|
] })
|
|
6816
6900
|
] })
|
|
6817
6901
|
] }),
|
|
6818
|
-
/* @__PURE__ */
|
|
6819
|
-
/* @__PURE__ */
|
|
6820
|
-
/* @__PURE__ */
|
|
6821
|
-
/* @__PURE__ */
|
|
6902
|
+
/* @__PURE__ */ jsxs65(FooterBar, { children: [
|
|
6903
|
+
/* @__PURE__ */ jsx77(GameButton, { variant: "primary", block: true, disabled: !canSubmit, onClick: handleSubmit, children: submitting ? t.submitting : t.submit }),
|
|
6904
|
+
/* @__PURE__ */ jsxs65("p", { className: "ss-g-xi-lock", children: [
|
|
6905
|
+
/* @__PURE__ */ jsx77(IconLock, {}),
|
|
6822
6906
|
lockAtUtc ? t.locksAt(ui.games.formatDayTime(lockAtUtc)) : t.locksSoon
|
|
6823
6907
|
] })
|
|
6824
6908
|
] })
|
|
@@ -6826,8 +6910,8 @@ function StartingXiGame({
|
|
|
6826
6910
|
}
|
|
6827
6911
|
|
|
6828
6912
|
// src/components/games/StatLadderGame.tsx
|
|
6829
|
-
import { useId as useId8, useState as
|
|
6830
|
-
import { jsx as
|
|
6913
|
+
import { useId as useId8, useState as useState34 } from "react";
|
|
6914
|
+
import { jsx as jsx78, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
6831
6915
|
function ladderClue(ladder) {
|
|
6832
6916
|
const mystery = ladder.find((r) => r.rank === 2);
|
|
6833
6917
|
if (!mystery) return null;
|
|
@@ -6849,9 +6933,9 @@ function parseClientState9(json) {
|
|
|
6849
6933
|
}
|
|
6850
6934
|
function NameStack({ name }) {
|
|
6851
6935
|
const { first, last } = splitName(name);
|
|
6852
|
-
return /* @__PURE__ */
|
|
6853
|
-
first && /* @__PURE__ */
|
|
6854
|
-
/* @__PURE__ */
|
|
6936
|
+
return /* @__PURE__ */ jsxs66("span", { className: "ss-g-sl-name", children: [
|
|
6937
|
+
first && /* @__PURE__ */ jsx78("small", { children: `${first[0]}.` }),
|
|
6938
|
+
/* @__PURE__ */ jsx78("b", { children: last })
|
|
6855
6939
|
] });
|
|
6856
6940
|
}
|
|
6857
6941
|
function StatLadderGame({
|
|
@@ -6863,16 +6947,16 @@ function StatLadderGame({
|
|
|
6863
6947
|
onBack
|
|
6864
6948
|
}) {
|
|
6865
6949
|
const t = ui.games.statLadder;
|
|
6866
|
-
const [query, setQuery] =
|
|
6867
|
-
const [selectedId, setSelectedId] =
|
|
6950
|
+
const [query, setQuery] = useState34("");
|
|
6951
|
+
const [selectedId, setSelectedId] = useState34(null);
|
|
6868
6952
|
const searchId = useId8();
|
|
6869
6953
|
const clientState = parseClientState9(result?.clientStateJson);
|
|
6870
6954
|
const revealed = clientState != null;
|
|
6871
|
-
const header = /* @__PURE__ */
|
|
6955
|
+
const header = /* @__PURE__ */ jsx78(GameHeader, { title: gameTitle({ gameId: "stat-ladder" }, ui.games.titles), eyebrow: t.eyebrow, onBack, backLabel: ui.back });
|
|
6872
6956
|
if (!config) {
|
|
6873
|
-
return /* @__PURE__ */
|
|
6957
|
+
return /* @__PURE__ */ jsxs66("div", { className: "ss-g-screen", "data-testid": "game-screen-stat-ladder", children: [
|
|
6874
6958
|
header,
|
|
6875
|
-
/* @__PURE__ */
|
|
6959
|
+
/* @__PURE__ */ jsx78("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
6876
6960
|
] });
|
|
6877
6961
|
}
|
|
6878
6962
|
const question = t.question(config.statLabel);
|
|
@@ -6884,44 +6968,44 @@ function StatLadderGame({
|
|
|
6884
6968
|
if (selectedId === null || submitting || revealed) return;
|
|
6885
6969
|
onSubmit(JSON.stringify({ guessedPlayerId: selectedId }));
|
|
6886
6970
|
}
|
|
6887
|
-
return /* @__PURE__ */
|
|
6971
|
+
return /* @__PURE__ */ jsxs66("div", { className: "ss-g-screen", "data-testid": "game-screen-stat-ladder", children: [
|
|
6888
6972
|
header,
|
|
6889
|
-
/* @__PURE__ */
|
|
6890
|
-
/* @__PURE__ */
|
|
6891
|
-
/* @__PURE__ */
|
|
6892
|
-
/* @__PURE__ */
|
|
6973
|
+
/* @__PURE__ */ jsxs66("div", { className: "ss-g-body", children: [
|
|
6974
|
+
/* @__PURE__ */ jsxs66("div", { className: "ss-g-sl-prompt", children: [
|
|
6975
|
+
/* @__PURE__ */ jsx78(Chip, { variant: "accent", icon: /* @__PURE__ */ jsx78(IconShield, { size: 14 }), className: "ss-g-sl-stat", children: config.statLabel }),
|
|
6976
|
+
/* @__PURE__ */ jsxs66("h3", { className: "ss-g-sl-q", children: [
|
|
6893
6977
|
question.pre,
|
|
6894
|
-
/* @__PURE__ */
|
|
6978
|
+
/* @__PURE__ */ jsx78("em", { children: question.emph }),
|
|
6895
6979
|
question.post
|
|
6896
6980
|
] })
|
|
6897
6981
|
] }),
|
|
6898
|
-
/* @__PURE__ */
|
|
6899
|
-
(rung) => rung.rank === 2 ? /* @__PURE__ */
|
|
6982
|
+
/* @__PURE__ */ jsx78("ol", { className: "ss-g-sl-rungs", children: rungs.map(
|
|
6983
|
+
(rung) => rung.rank === 2 ? /* @__PURE__ */ jsxs66(
|
|
6900
6984
|
"li",
|
|
6901
6985
|
{
|
|
6902
6986
|
className: "ss-g-sl-rung ss-g-sl-rung--mystery",
|
|
6903
6987
|
"data-testid": "sl-mystery-rung",
|
|
6904
6988
|
"data-result": revealed ? clientState.isCorrect ? "correct" : "wrong" : void 0,
|
|
6905
6989
|
children: [
|
|
6906
|
-
/* @__PURE__ */
|
|
6907
|
-
revealed ? /* @__PURE__ */
|
|
6908
|
-
revealed ? /* @__PURE__ */
|
|
6909
|
-
/* @__PURE__ */
|
|
6990
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-sl-rank", children: "2" }),
|
|
6991
|
+
revealed ? /* @__PURE__ */ jsx78(PlayerAvatar, { name: clientState.revealedRank2.playerName, className: "ss-g-sl-av" }) : /* @__PURE__ */ jsx78(Silhouette, { size: 52, variant: "mystery" }),
|
|
6992
|
+
revealed ? /* @__PURE__ */ jsx78(NameStack, { name: clientState.revealedRank2.playerName }) : /* @__PURE__ */ jsx78("span", { className: "ss-g-sl-who", children: t.whoSecond }),
|
|
6993
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-sl-val ss-g-sl-val--mystery", children: rung.statValue })
|
|
6910
6994
|
]
|
|
6911
6995
|
},
|
|
6912
6996
|
rung.rank
|
|
6913
|
-
) : /* @__PURE__ */
|
|
6914
|
-
/* @__PURE__ */
|
|
6915
|
-
/* @__PURE__ */
|
|
6916
|
-
/* @__PURE__ */
|
|
6917
|
-
/* @__PURE__ */
|
|
6997
|
+
) : /* @__PURE__ */ jsxs66("li", { className: "ss-g-sl-rung", children: [
|
|
6998
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-sl-rank", children: rung.rank }),
|
|
6999
|
+
/* @__PURE__ */ jsx78(PlayerAvatar, { name: rung.playerName ?? "?", className: "ss-g-sl-av" }),
|
|
7000
|
+
/* @__PURE__ */ jsx78(NameStack, { name: rung.playerName ?? "?" }),
|
|
7001
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-sl-val", children: rung.statValue })
|
|
6918
7002
|
] }, rung.rank)
|
|
6919
7003
|
) }),
|
|
6920
|
-
clue && /* @__PURE__ */
|
|
6921
|
-
/* @__PURE__ */
|
|
6922
|
-
/* @__PURE__ */
|
|
7004
|
+
clue && /* @__PURE__ */ jsxs66("p", { className: "ss-g-sl-clue", children: [
|
|
7005
|
+
/* @__PURE__ */ jsx78(IconBulb, {}),
|
|
7006
|
+
/* @__PURE__ */ jsx78("span", { children: t.clue(clue, config.statLabel) })
|
|
6923
7007
|
] }),
|
|
6924
|
-
!revealed && /* @__PURE__ */
|
|
7008
|
+
!revealed && /* @__PURE__ */ jsx78("ul", { className: "ss-g-sl-pool", children: pool.map((p) => /* @__PURE__ */ jsx78("li", { children: /* @__PURE__ */ jsxs66(
|
|
6925
7009
|
"button",
|
|
6926
7010
|
{
|
|
6927
7011
|
type: "button",
|
|
@@ -6934,13 +7018,13 @@ function StatLadderGame({
|
|
|
6934
7018
|
setQuery(p.playerName);
|
|
6935
7019
|
},
|
|
6936
7020
|
children: [
|
|
6937
|
-
/* @__PURE__ */
|
|
6938
|
-
/* @__PURE__ */
|
|
6939
|
-
selectedId === p.playerId && /* @__PURE__ */
|
|
7021
|
+
/* @__PURE__ */ jsx78(PlayerAvatar, { name: p.playerName, className: "ss-g-sl-opt-av" }),
|
|
7022
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-sl-opt-name", children: p.playerName }),
|
|
7023
|
+
selectedId === p.playerId && /* @__PURE__ */ jsx78(IconCheck, {})
|
|
6940
7024
|
]
|
|
6941
7025
|
}
|
|
6942
7026
|
) }, p.playerId)) }),
|
|
6943
|
-
revealed && /* @__PURE__ */
|
|
7027
|
+
revealed && /* @__PURE__ */ jsx78(
|
|
6944
7028
|
ResultCard,
|
|
6945
7029
|
{
|
|
6946
7030
|
tone: clientState.isCorrect ? "win" : "lose",
|
|
@@ -6951,8 +7035,8 @@ function StatLadderGame({
|
|
|
6951
7035
|
}
|
|
6952
7036
|
)
|
|
6953
7037
|
] }),
|
|
6954
|
-
!revealed && /* @__PURE__ */
|
|
6955
|
-
/* @__PURE__ */
|
|
7038
|
+
!revealed && /* @__PURE__ */ jsx78(FooterBar, { children: /* @__PURE__ */ jsxs66("div", { className: "ss-g-sl-guess", children: [
|
|
7039
|
+
/* @__PURE__ */ jsx78(
|
|
6956
7040
|
SearchField,
|
|
6957
7041
|
{
|
|
6958
7042
|
id: searchId,
|
|
@@ -6967,13 +7051,13 @@ function StatLadderGame({
|
|
|
6967
7051
|
disabled: submitting
|
|
6968
7052
|
}
|
|
6969
7053
|
),
|
|
6970
|
-
/* @__PURE__ */
|
|
7054
|
+
/* @__PURE__ */ jsx78(GameButton, { variant: "primary", disabled: selectedId === null || submitting, onClick: guess, children: t.guess })
|
|
6971
7055
|
] }) })
|
|
6972
7056
|
] });
|
|
6973
7057
|
}
|
|
6974
7058
|
|
|
6975
7059
|
// src/components/games/FanMotmGame.tsx
|
|
6976
|
-
import { jsx as
|
|
7060
|
+
import { jsx as jsx79, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
6977
7061
|
function parseClientState10(json) {
|
|
6978
7062
|
if (!json) return null;
|
|
6979
7063
|
try {
|
|
@@ -6994,20 +7078,20 @@ function FanMotmGame({
|
|
|
6994
7078
|
const clientState = parseClientState10(result?.clientStateJson);
|
|
6995
7079
|
const alreadyVoted = result?.alreadyPlayed === true;
|
|
6996
7080
|
const pickedId = clientState?.pickedPlayerId ?? null;
|
|
6997
|
-
const header = /* @__PURE__ */
|
|
7081
|
+
const header = /* @__PURE__ */ jsx79(
|
|
6998
7082
|
GameHeader,
|
|
6999
7083
|
{
|
|
7000
7084
|
title: t.title,
|
|
7001
7085
|
eyebrow: t.eyebrow,
|
|
7002
|
-
right: alreadyVoted ? /* @__PURE__ */
|
|
7086
|
+
right: alreadyVoted ? /* @__PURE__ */ jsx79(Chip, { variant: "success", icon: /* @__PURE__ */ jsx79(IconCheck, {}), children: t.voted }) : void 0,
|
|
7003
7087
|
onBack,
|
|
7004
7088
|
backLabel: ui.back
|
|
7005
7089
|
}
|
|
7006
7090
|
);
|
|
7007
7091
|
if (!config) {
|
|
7008
|
-
return /* @__PURE__ */
|
|
7092
|
+
return /* @__PURE__ */ jsxs67("div", { className: "ss-g-screen", "data-testid": "game-screen-fan-motm", children: [
|
|
7009
7093
|
header,
|
|
7010
|
-
/* @__PURE__ */
|
|
7094
|
+
/* @__PURE__ */ jsx79("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
7011
7095
|
] });
|
|
7012
7096
|
}
|
|
7013
7097
|
const picked = config.candidates.find((c) => c.playerId === pickedId) ?? null;
|
|
@@ -7015,12 +7099,12 @@ function FanMotmGame({
|
|
|
7015
7099
|
if (alreadyVoted || submitting) return;
|
|
7016
7100
|
onSubmit(JSON.stringify({ pickedPlayerId: candidateId }));
|
|
7017
7101
|
}
|
|
7018
|
-
return /* @__PURE__ */
|
|
7102
|
+
return /* @__PURE__ */ jsxs67("div", { className: "ss-g-screen", "data-testid": "game-screen-fan-motm", children: [
|
|
7019
7103
|
header,
|
|
7020
|
-
/* @__PURE__ */
|
|
7021
|
-
/* @__PURE__ */
|
|
7104
|
+
/* @__PURE__ */ jsxs67("div", { className: "ss-g-body", children: [
|
|
7105
|
+
/* @__PURE__ */ jsx79("ul", { className: "ss-g-motm-list", children: config.candidates.map((c) => {
|
|
7022
7106
|
const isVoted = alreadyVoted && pickedId === c.playerId;
|
|
7023
|
-
return /* @__PURE__ */
|
|
7107
|
+
return /* @__PURE__ */ jsx79("li", { children: /* @__PURE__ */ jsxs67(
|
|
7024
7108
|
"button",
|
|
7025
7109
|
{
|
|
7026
7110
|
type: "button",
|
|
@@ -7029,24 +7113,24 @@ function FanMotmGame({
|
|
|
7029
7113
|
disabled: alreadyVoted || submitting,
|
|
7030
7114
|
onClick: () => handleVote(c.playerId),
|
|
7031
7115
|
children: [
|
|
7032
|
-
/* @__PURE__ */
|
|
7033
|
-
/* @__PURE__ */
|
|
7034
|
-
isVoted && /* @__PURE__ */
|
|
7116
|
+
/* @__PURE__ */ jsx79(PlayerAvatar, { name: c.playerName, className: "ss-g-motm-av" }),
|
|
7117
|
+
/* @__PURE__ */ jsx79("span", { className: "ss-g-motm-name", children: c.playerName }),
|
|
7118
|
+
isVoted && /* @__PURE__ */ jsx79(Chip, { variant: "accent", className: "ss-g-motm-pill", children: t.yourVote })
|
|
7035
7119
|
]
|
|
7036
7120
|
}
|
|
7037
7121
|
) }, c.playerId);
|
|
7038
7122
|
}) }),
|
|
7039
|
-
alreadyVoted && picked && /* @__PURE__ */
|
|
7123
|
+
alreadyVoted && picked && /* @__PURE__ */ jsx79(ResultCard, { tone: "neutral", title: t.youVoted(picked.playerName), detail: t.thanks, onBack, ui })
|
|
7040
7124
|
] }),
|
|
7041
|
-
/* @__PURE__ */
|
|
7042
|
-
!alreadyVoted && /* @__PURE__ */
|
|
7043
|
-
/* @__PURE__ */
|
|
7125
|
+
/* @__PURE__ */ jsxs67(FooterBar, { children: [
|
|
7126
|
+
!alreadyVoted && /* @__PURE__ */ jsx79("p", { className: "ss-g-motm-foot", children: t.tapToVote }),
|
|
7127
|
+
/* @__PURE__ */ jsx79("p", { className: "ss-g-motm-fun", children: t.forFun })
|
|
7044
7128
|
] })
|
|
7045
7129
|
] });
|
|
7046
7130
|
}
|
|
7047
7131
|
|
|
7048
7132
|
// src/components/GameScreenHost.tsx
|
|
7049
|
-
import { jsx as
|
|
7133
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
7050
7134
|
var FIXTURE_GAME_IDS = /* @__PURE__ */ new Set([
|
|
7051
7135
|
"matchday-predictor",
|
|
7052
7136
|
"starting-xi",
|
|
@@ -7070,7 +7154,7 @@ function GameScreenHost({
|
|
|
7070
7154
|
ui
|
|
7071
7155
|
}) {
|
|
7072
7156
|
const { gameId, fixtureId, gameDay = "", lockAtUtc = null } = selected;
|
|
7073
|
-
const [configJson, setConfigJson] =
|
|
7157
|
+
const [configJson, setConfigJson] = useState35(null);
|
|
7074
7158
|
useEffect16(() => {
|
|
7075
7159
|
setConfigJson(null);
|
|
7076
7160
|
if (!conversation) return;
|
|
@@ -7122,7 +7206,7 @@ function GameScreenHost({
|
|
|
7122
7206
|
function renderScreen() {
|
|
7123
7207
|
switch (gameId) {
|
|
7124
7208
|
case "mystery-tiger":
|
|
7125
|
-
return /* @__PURE__ */
|
|
7209
|
+
return /* @__PURE__ */ jsx80(
|
|
7126
7210
|
MysteryTigerGame,
|
|
7127
7211
|
{
|
|
7128
7212
|
...sharedProps,
|
|
@@ -7130,7 +7214,7 @@ function GameScreenHost({
|
|
|
7130
7214
|
}
|
|
7131
7215
|
);
|
|
7132
7216
|
case "higher-or-lower":
|
|
7133
|
-
return /* @__PURE__ */
|
|
7217
|
+
return /* @__PURE__ */ jsx80(
|
|
7134
7218
|
HigherOrLowerGame,
|
|
7135
7219
|
{
|
|
7136
7220
|
...sharedProps,
|
|
@@ -7138,7 +7222,7 @@ function GameScreenHost({
|
|
|
7138
7222
|
}
|
|
7139
7223
|
);
|
|
7140
7224
|
case "career-path":
|
|
7141
|
-
return /* @__PURE__ */
|
|
7225
|
+
return /* @__PURE__ */ jsx80(
|
|
7142
7226
|
CareerPathGame,
|
|
7143
7227
|
{
|
|
7144
7228
|
...sharedProps,
|
|
@@ -7147,7 +7231,7 @@ function GameScreenHost({
|
|
|
7147
7231
|
);
|
|
7148
7232
|
case "beat-the-grid": {
|
|
7149
7233
|
const btgConfig = safeParseConfig(configJson);
|
|
7150
|
-
return /* @__PURE__ */
|
|
7234
|
+
return /* @__PURE__ */ jsx80(
|
|
7151
7235
|
BeatTheGridGame,
|
|
7152
7236
|
{
|
|
7153
7237
|
...sharedProps,
|
|
@@ -7157,7 +7241,7 @@ function GameScreenHost({
|
|
|
7157
7241
|
);
|
|
7158
7242
|
}
|
|
7159
7243
|
case "guess-the-xi":
|
|
7160
|
-
return /* @__PURE__ */
|
|
7244
|
+
return /* @__PURE__ */ jsx80(
|
|
7161
7245
|
GuessTheXiGame,
|
|
7162
7246
|
{
|
|
7163
7247
|
...sharedProps,
|
|
@@ -7165,7 +7249,7 @@ function GameScreenHost({
|
|
|
7165
7249
|
}
|
|
7166
7250
|
);
|
|
7167
7251
|
case "daily-quiz":
|
|
7168
|
-
return /* @__PURE__ */
|
|
7252
|
+
return /* @__PURE__ */ jsx80(
|
|
7169
7253
|
DailyQuizGame,
|
|
7170
7254
|
{
|
|
7171
7255
|
...sharedProps,
|
|
@@ -7173,7 +7257,7 @@ function GameScreenHost({
|
|
|
7173
7257
|
}
|
|
7174
7258
|
);
|
|
7175
7259
|
case "matchday-predictor":
|
|
7176
|
-
return /* @__PURE__ */
|
|
7260
|
+
return /* @__PURE__ */ jsx80(
|
|
7177
7261
|
MatchdayPredictorGame,
|
|
7178
7262
|
{
|
|
7179
7263
|
...sharedProps,
|
|
@@ -7181,7 +7265,7 @@ function GameScreenHost({
|
|
|
7181
7265
|
}
|
|
7182
7266
|
);
|
|
7183
7267
|
case "starting-xi":
|
|
7184
|
-
return /* @__PURE__ */
|
|
7268
|
+
return /* @__PURE__ */ jsx80(
|
|
7185
7269
|
StartingXiGame,
|
|
7186
7270
|
{
|
|
7187
7271
|
...sharedProps,
|
|
@@ -7189,7 +7273,7 @@ function GameScreenHost({
|
|
|
7189
7273
|
}
|
|
7190
7274
|
);
|
|
7191
7275
|
case "stat-ladder":
|
|
7192
|
-
return /* @__PURE__ */
|
|
7276
|
+
return /* @__PURE__ */ jsx80(
|
|
7193
7277
|
StatLadderGame,
|
|
7194
7278
|
{
|
|
7195
7279
|
...sharedProps,
|
|
@@ -7197,7 +7281,7 @@ function GameScreenHost({
|
|
|
7197
7281
|
}
|
|
7198
7282
|
);
|
|
7199
7283
|
case "fan-motm":
|
|
7200
|
-
return /* @__PURE__ */
|
|
7284
|
+
return /* @__PURE__ */ jsx80(
|
|
7201
7285
|
FanMotmGame,
|
|
7202
7286
|
{
|
|
7203
7287
|
...sharedProps,
|
|
@@ -7205,10 +7289,10 @@ function GameScreenHost({
|
|
|
7205
7289
|
}
|
|
7206
7290
|
);
|
|
7207
7291
|
default:
|
|
7208
|
-
return /* @__PURE__ */
|
|
7292
|
+
return /* @__PURE__ */ jsx80("div", { className: "ss-g-screen", "data-testid": `game-screen-${gameId}`, children: /* @__PURE__ */ jsx80(GameHeader, { title: gameTitle({ gameId }, ui.games.titles), onBack, backLabel: ui.back }) });
|
|
7209
7293
|
}
|
|
7210
7294
|
}
|
|
7211
|
-
return /* @__PURE__ */
|
|
7295
|
+
return /* @__PURE__ */ jsx80("div", { className: "ss-w-gscreen", "data-testid": "gscreen", "data-lock-at": lockAtUtc ?? void 0, children: renderScreen() });
|
|
7212
7296
|
}
|
|
7213
7297
|
|
|
7214
7298
|
// src/components/games/ui/fonts.ts
|
|
@@ -7225,7 +7309,7 @@ function ensureGamesFonts(doc = document) {
|
|
|
7225
7309
|
}
|
|
7226
7310
|
|
|
7227
7311
|
// src/components/GamesPanel.tsx
|
|
7228
|
-
import { jsx as
|
|
7312
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
7229
7313
|
function GamesPanel({
|
|
7230
7314
|
loggedIn,
|
|
7231
7315
|
games,
|
|
@@ -7234,13 +7318,13 @@ function GamesPanel({
|
|
|
7234
7318
|
leaderboard,
|
|
7235
7319
|
refreshHub
|
|
7236
7320
|
}) {
|
|
7237
|
-
const [selected, setSelected] =
|
|
7321
|
+
const [selected, setSelected] = useState36(null);
|
|
7238
7322
|
useEffect17(() => {
|
|
7239
7323
|
ensureGamesFonts();
|
|
7240
7324
|
}, []);
|
|
7241
|
-
if (!loggedIn) return /* @__PURE__ */
|
|
7325
|
+
if (!loggedIn) return /* @__PURE__ */ jsx81(GamesLoginWall, { ui });
|
|
7242
7326
|
if (selected !== null) {
|
|
7243
|
-
return /* @__PURE__ */
|
|
7327
|
+
return /* @__PURE__ */ jsx81("div", { className: "ss-w-gscreen-wrap", lang: ui.games.lang, children: /* @__PURE__ */ jsx81(
|
|
7244
7328
|
GameScreenHost,
|
|
7245
7329
|
{
|
|
7246
7330
|
selected,
|
|
@@ -7254,7 +7338,7 @@ function GamesPanel({
|
|
|
7254
7338
|
}
|
|
7255
7339
|
) });
|
|
7256
7340
|
}
|
|
7257
|
-
return /* @__PURE__ */
|
|
7341
|
+
return /* @__PURE__ */ jsx81("div", { className: "ss-g-hub-wrap", "data-testid": "games-hub", lang: ui.games.lang, children: /* @__PURE__ */ jsx81(
|
|
7258
7342
|
GamesHub,
|
|
7259
7343
|
{
|
|
7260
7344
|
games,
|
|
@@ -7266,10 +7350,10 @@ function GamesPanel({
|
|
|
7266
7350
|
}
|
|
7267
7351
|
|
|
7268
7352
|
// src/components/Leaderboard.tsx
|
|
7269
|
-
import { useState as
|
|
7353
|
+
import { useState as useState37 } from "react";
|
|
7270
7354
|
|
|
7271
7355
|
// src/components/LeaderboardRow.tsx
|
|
7272
|
-
import { jsx as
|
|
7356
|
+
import { jsx as jsx82, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
7273
7357
|
function formatPoints(n) {
|
|
7274
7358
|
return n.toLocaleString("en");
|
|
7275
7359
|
}
|
|
@@ -7278,14 +7362,14 @@ function LeaderboardWeeklyRow({
|
|
|
7278
7362
|
isMe
|
|
7279
7363
|
}) {
|
|
7280
7364
|
const rankClass = `ss-w-lb2-rank${row.rank <= 3 ? " ss-w-lb2-rank--top3" : ""}`;
|
|
7281
|
-
return /* @__PURE__ */
|
|
7282
|
-
/* @__PURE__ */
|
|
7365
|
+
return /* @__PURE__ */ jsxs68("div", { className: `ss-w-lb2-row${isMe ? " ss-w-lb2-row--you" : ""}`, children: [
|
|
7366
|
+
/* @__PURE__ */ jsxs68("span", { className: rankClass, children: [
|
|
7283
7367
|
"#",
|
|
7284
7368
|
row.rank
|
|
7285
7369
|
] }),
|
|
7286
|
-
/* @__PURE__ */
|
|
7287
|
-
/* @__PURE__ */
|
|
7288
|
-
row.currentStreak > 0 && /* @__PURE__ */
|
|
7370
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-w-lb2-handle", children: row.handle }),
|
|
7371
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-w-lb2-points", children: formatPoints(row.points) }),
|
|
7372
|
+
row.currentStreak > 0 && /* @__PURE__ */ jsxs68("span", { className: "ss-w-lb2-streak", children: [
|
|
7289
7373
|
"\u{1F525} ",
|
|
7290
7374
|
row.currentStreak
|
|
7291
7375
|
] })
|
|
@@ -7296,18 +7380,18 @@ function LeaderboardAllTimeRow({
|
|
|
7296
7380
|
isMe
|
|
7297
7381
|
}) {
|
|
7298
7382
|
const rankClass = `ss-w-lb2-rank${row.rank <= 3 ? " ss-w-lb2-rank--top3" : ""}`;
|
|
7299
|
-
return /* @__PURE__ */
|
|
7300
|
-
/* @__PURE__ */
|
|
7383
|
+
return /* @__PURE__ */ jsxs68("div", { className: `ss-w-lb2-row${isMe ? " ss-w-lb2-row--you" : ""}`, children: [
|
|
7384
|
+
/* @__PURE__ */ jsxs68("span", { className: rankClass, children: [
|
|
7301
7385
|
"#",
|
|
7302
7386
|
row.rank
|
|
7303
7387
|
] }),
|
|
7304
|
-
/* @__PURE__ */
|
|
7305
|
-
/* @__PURE__ */
|
|
7388
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-w-lb2-handle", children: row.handle }),
|
|
7389
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-w-lb2-points", children: formatPoints(row.allTimePoints) })
|
|
7306
7390
|
] });
|
|
7307
7391
|
}
|
|
7308
7392
|
|
|
7309
7393
|
// src/components/LeaderboardEmpty.tsx
|
|
7310
|
-
import { jsx as
|
|
7394
|
+
import { jsx as jsx83, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
7311
7395
|
function LeaderboardEmpty({
|
|
7312
7396
|
segment,
|
|
7313
7397
|
lastWeek,
|
|
@@ -7316,48 +7400,48 @@ function LeaderboardEmpty({
|
|
|
7316
7400
|
ui
|
|
7317
7401
|
}) {
|
|
7318
7402
|
if (segment === "alltime") {
|
|
7319
|
-
return /* @__PURE__ */
|
|
7320
|
-
/* @__PURE__ */
|
|
7321
|
-
/* @__PURE__ */
|
|
7403
|
+
return /* @__PURE__ */ jsxs69("div", { className: "ss-w-lb-empty ss-w-lb-empty--alltime", children: [
|
|
7404
|
+
/* @__PURE__ */ jsx83("div", { className: "ss-w-lb-empty-icon", "aria-hidden": "true", children: "\u{1F4CA}" }),
|
|
7405
|
+
/* @__PURE__ */ jsx83("p", { className: "ss-w-lb-empty-body", children: ui.leaderboardAllTimeEmpty })
|
|
7322
7406
|
] });
|
|
7323
7407
|
}
|
|
7324
7408
|
const fresh = lastWeek != null;
|
|
7325
7409
|
const title = fresh ? ui.leaderboardEmptyFreshTitle : ui.leaderboardEmptyColdTitle;
|
|
7326
7410
|
const body = fresh ? ui.leaderboardEmptyFreshBody : ui.leaderboardEmptyColdBody;
|
|
7327
|
-
return /* @__PURE__ */
|
|
7328
|
-
weeklyPrize && /* @__PURE__ */
|
|
7329
|
-
/* @__PURE__ */
|
|
7330
|
-
/* @__PURE__ */
|
|
7411
|
+
return /* @__PURE__ */ jsxs69("div", { className: "ss-w-lb-empty", children: [
|
|
7412
|
+
weeklyPrize && /* @__PURE__ */ jsxs69("div", { className: "ss-w-prize", children: [
|
|
7413
|
+
/* @__PURE__ */ jsx83("span", { className: "ss-w-prize-icon", "aria-hidden": "true", children: "\u{1F3C6}" }),
|
|
7414
|
+
/* @__PURE__ */ jsx83("div", { className: "ss-w-prize-body", children: /* @__PURE__ */ jsx83("span", { className: "ss-w-prize-text", children: weeklyPrize }) })
|
|
7331
7415
|
] }),
|
|
7332
|
-
/* @__PURE__ */
|
|
7333
|
-
/* @__PURE__ */
|
|
7334
|
-
/* @__PURE__ */
|
|
7335
|
-
/* @__PURE__ */
|
|
7336
|
-
onPlay && /* @__PURE__ */
|
|
7416
|
+
/* @__PURE__ */ jsxs69("div", { className: "ss-w-lb-empty-hero", children: [
|
|
7417
|
+
/* @__PURE__ */ jsx83("div", { className: "ss-w-lb-empty-icon", "aria-hidden": "true", children: fresh ? "\u{1F3C6}" : "\u{1F3AE}" }),
|
|
7418
|
+
/* @__PURE__ */ jsx83("h4", { className: "ss-w-lb-empty-title", children: title }),
|
|
7419
|
+
/* @__PURE__ */ jsx83("p", { className: "ss-w-lb-empty-body", children: body }),
|
|
7420
|
+
onPlay && /* @__PURE__ */ jsx83("button", { type: "button", className: "ss-w-lb-empty-cta", onClick: onPlay, children: ui.leaderboardEmptyCta })
|
|
7337
7421
|
] }),
|
|
7338
|
-
fresh && lastWeek && /* @__PURE__ */
|
|
7339
|
-
/* @__PURE__ */
|
|
7340
|
-
/* @__PURE__ */
|
|
7341
|
-
/* @__PURE__ */
|
|
7342
|
-
/* @__PURE__ */
|
|
7422
|
+
fresh && lastWeek && /* @__PURE__ */ jsxs69("div", { className: "ss-w-lb-last", children: [
|
|
7423
|
+
/* @__PURE__ */ jsx83("span", { className: "ss-w-lb-last-label", children: ui.leaderboardLastWeekLabel }),
|
|
7424
|
+
/* @__PURE__ */ jsx83("span", { className: "ss-w-lb-last-champ", "aria-hidden": "true", children: "\u{1F947}" }),
|
|
7425
|
+
/* @__PURE__ */ jsx83("span", { className: "ss-w-lb-last-handle", children: lastWeek.handle }),
|
|
7426
|
+
/* @__PURE__ */ jsx83("span", { className: "ss-w-lb-last-points", children: formatPoints(lastWeek.points) })
|
|
7343
7427
|
] })
|
|
7344
7428
|
] });
|
|
7345
7429
|
}
|
|
7346
7430
|
|
|
7347
7431
|
// src/components/Leaderboard.tsx
|
|
7348
|
-
import { Fragment as Fragment19, jsx as
|
|
7432
|
+
import { Fragment as Fragment19, jsx as jsx84, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
7349
7433
|
function Leaderboard({
|
|
7350
7434
|
data,
|
|
7351
7435
|
ui,
|
|
7352
7436
|
onPlay
|
|
7353
7437
|
}) {
|
|
7354
|
-
const [segment, setSegment] =
|
|
7438
|
+
const [segment, setSegment] = useState37("weekly");
|
|
7355
7439
|
const myRow = segment === "weekly" ? data.myWeeklyRow : data.myAllTimeRow;
|
|
7356
7440
|
const offBoard = myRow !== null && myRow !== void 0 && myRow.rank === -1;
|
|
7357
7441
|
const isEmpty = segment === "weekly" ? data.weeklyTop.length === 0 : data.allTimeTop.length === 0;
|
|
7358
|
-
return /* @__PURE__ */
|
|
7359
|
-
/* @__PURE__ */
|
|
7360
|
-
/* @__PURE__ */
|
|
7442
|
+
return /* @__PURE__ */ jsxs70("div", { className: "ss-w-lb2", children: [
|
|
7443
|
+
/* @__PURE__ */ jsxs70("div", { className: "ss-w-seg", children: [
|
|
7444
|
+
/* @__PURE__ */ jsx84(
|
|
7361
7445
|
"button",
|
|
7362
7446
|
{
|
|
7363
7447
|
type: "button",
|
|
@@ -7367,7 +7451,7 @@ function Leaderboard({
|
|
|
7367
7451
|
children: ui.leaderboardThisWeek
|
|
7368
7452
|
}
|
|
7369
7453
|
),
|
|
7370
|
-
/* @__PURE__ */
|
|
7454
|
+
/* @__PURE__ */ jsx84(
|
|
7371
7455
|
"button",
|
|
7372
7456
|
{
|
|
7373
7457
|
type: "button",
|
|
@@ -7378,7 +7462,7 @@ function Leaderboard({
|
|
|
7378
7462
|
}
|
|
7379
7463
|
)
|
|
7380
7464
|
] }),
|
|
7381
|
-
isEmpty ? /* @__PURE__ */
|
|
7465
|
+
isEmpty ? /* @__PURE__ */ jsx84(
|
|
7382
7466
|
LeaderboardEmpty,
|
|
7383
7467
|
{
|
|
7384
7468
|
segment,
|
|
@@ -7387,15 +7471,15 @@ function Leaderboard({
|
|
|
7387
7471
|
onPlay,
|
|
7388
7472
|
ui
|
|
7389
7473
|
}
|
|
7390
|
-
) : /* @__PURE__ */
|
|
7391
|
-
/* @__PURE__ */
|
|
7474
|
+
) : /* @__PURE__ */ jsxs70(Fragment19, { children: [
|
|
7475
|
+
/* @__PURE__ */ jsx84("div", { className: "ss-w-lb2-rows", children: segment === "weekly" ? data.weeklyTop.map((row) => /* @__PURE__ */ jsx84(
|
|
7392
7476
|
LeaderboardWeeklyRow,
|
|
7393
7477
|
{
|
|
7394
7478
|
row,
|
|
7395
7479
|
isMe: row.operatorUserId === data.myWeeklyRow?.operatorUserId
|
|
7396
7480
|
},
|
|
7397
7481
|
row.operatorUserId
|
|
7398
|
-
)) : data.allTimeTop.map((row) => /* @__PURE__ */
|
|
7482
|
+
)) : data.allTimeTop.map((row) => /* @__PURE__ */ jsx84(
|
|
7399
7483
|
LeaderboardAllTimeRow,
|
|
7400
7484
|
{
|
|
7401
7485
|
row,
|
|
@@ -7403,18 +7487,18 @@ function Leaderboard({
|
|
|
7403
7487
|
},
|
|
7404
7488
|
row.operatorUserId
|
|
7405
7489
|
)) }),
|
|
7406
|
-
/* @__PURE__ */
|
|
7407
|
-
myRow != null && (offBoard ? /* @__PURE__ */
|
|
7408
|
-
segment === "weekly" && data.myWeeklyRow && /* @__PURE__ */
|
|
7409
|
-
segment === "alltime" && data.myAllTimeRow && /* @__PURE__ */
|
|
7490
|
+
/* @__PURE__ */ jsx84("div", { className: "ss-w-kitline", children: "\u{1F3BD}" }),
|
|
7491
|
+
myRow != null && (offBoard ? /* @__PURE__ */ jsx84("div", { className: "ss-w-lbgap", children: ui.leaderboardOffBoard }) : /* @__PURE__ */ jsxs70("div", { className: "ss-w-lb2-rows", children: [
|
|
7492
|
+
segment === "weekly" && data.myWeeklyRow && /* @__PURE__ */ jsx84(LeaderboardWeeklyRow, { row: data.myWeeklyRow, isMe: true }),
|
|
7493
|
+
segment === "alltime" && data.myAllTimeRow && /* @__PURE__ */ jsx84(LeaderboardAllTimeRow, { row: data.myAllTimeRow, isMe: true })
|
|
7410
7494
|
] })),
|
|
7411
|
-
segment === "alltime" && data.myAllTimeRow && !offBoard && /* @__PURE__ */
|
|
7495
|
+
segment === "alltime" && data.myAllTimeRow && !offBoard && /* @__PURE__ */ jsx84("div", { className: "ss-w-lb2-rows", children: /* @__PURE__ */ jsx84("div", { className: "ss-w-lb2-row", children: /* @__PURE__ */ jsx84("span", { className: "ss-w-lb2-handle", children: formatPoints(data.allTimeTop.reduce((s, r) => s + r.allTimePoints, 0)) }) }) })
|
|
7412
7496
|
] })
|
|
7413
7497
|
] });
|
|
7414
7498
|
}
|
|
7415
7499
|
|
|
7416
7500
|
// src/components/LeaderboardPanel.tsx
|
|
7417
|
-
import { jsx as
|
|
7501
|
+
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
7418
7502
|
var EMPTY_PAYLOAD = {
|
|
7419
7503
|
week: "",
|
|
7420
7504
|
weeklyTop: [],
|
|
@@ -7425,16 +7509,16 @@ var EMPTY_PAYLOAD = {
|
|
|
7425
7509
|
lastWeek: null
|
|
7426
7510
|
};
|
|
7427
7511
|
function LeaderboardPanel({ loggedIn, data, loading, onPlay, ui }) {
|
|
7428
|
-
if (!loggedIn) return /* @__PURE__ */
|
|
7429
|
-
if (data === null && loading) return /* @__PURE__ */
|
|
7430
|
-
return /* @__PURE__ */
|
|
7512
|
+
if (!loggedIn) return /* @__PURE__ */ jsx85(GamesLoginWall, { ui });
|
|
7513
|
+
if (data === null && loading) return /* @__PURE__ */ jsx85("div", { className: "ss-w-mon-list" });
|
|
7514
|
+
return /* @__PURE__ */ jsx85("div", { className: "ss-w-mon-list", children: /* @__PURE__ */ jsx85(Leaderboard, { data: data ?? EMPTY_PAYLOAD, ui, onPlay }) });
|
|
7431
7515
|
}
|
|
7432
7516
|
|
|
7433
7517
|
// src/components/ChatPanel.tsx
|
|
7434
|
-
import { jsx as
|
|
7518
|
+
import { jsx as jsx86, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
7435
7519
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
7436
7520
|
function useIsModal() {
|
|
7437
|
-
const [modal, setModal] =
|
|
7521
|
+
const [modal, setModal] = useState38(false);
|
|
7438
7522
|
useEffect18(() => {
|
|
7439
7523
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
7440
7524
|
const mql = window.matchMedia(FULLSCREEN_QUERY);
|
|
@@ -7459,11 +7543,15 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
7459
7543
|
monitor?.setActiveTab("chat");
|
|
7460
7544
|
send(text);
|
|
7461
7545
|
};
|
|
7546
|
+
const handleAsk = (text, grounding) => {
|
|
7547
|
+
monitor?.setActiveTab("chat");
|
|
7548
|
+
send(text, { grounding });
|
|
7549
|
+
};
|
|
7462
7550
|
useEffect18(() => {
|
|
7463
7551
|
if (monitor && monitor.activeTab !== "chat" && state.isStreaming) monitor.markChatActivity();
|
|
7464
7552
|
}, [monitor, state.isStreaming, state.messages.length]);
|
|
7465
|
-
return /* @__PURE__ */
|
|
7466
|
-
/* @__PURE__ */
|
|
7553
|
+
return /* @__PURE__ */ jsxs71("div", { className: "ss-w-panel", role: "dialog", "aria-modal": isModal, "aria-label": ui.chatDialogLabel, children: [
|
|
7554
|
+
/* @__PURE__ */ jsx86(
|
|
7467
7555
|
ChatHeader,
|
|
7468
7556
|
{
|
|
7469
7557
|
onClose: close,
|
|
@@ -7476,7 +7564,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
7476
7564
|
moreOptionsLabel: ui.moreOptions
|
|
7477
7565
|
}
|
|
7478
7566
|
),
|
|
7479
|
-
monitor && /* @__PURE__ */
|
|
7567
|
+
monitor && /* @__PURE__ */ jsx86(
|
|
7480
7568
|
TabBar,
|
|
7481
7569
|
{
|
|
7482
7570
|
monitor,
|
|
@@ -7488,17 +7576,17 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
7488
7576
|
gamesEnabled: gamesResult?.enabled ?? false
|
|
7489
7577
|
}
|
|
7490
7578
|
),
|
|
7491
|
-
/* @__PURE__ */
|
|
7579
|
+
/* @__PURE__ */ jsx86(
|
|
7492
7580
|
"div",
|
|
7493
7581
|
{
|
|
7494
7582
|
style: !monitor || monitor.activeTab === "chat" ? { display: "contents" } : { position: "absolute", inset: 0, visibility: "hidden", display: "flex", flexDirection: "column" },
|
|
7495
|
-
children: /* @__PURE__ */
|
|
7583
|
+
children: /* @__PURE__ */ jsx86(MessageList, { controller, ui, slip, onDashboardTap, monitor })
|
|
7496
7584
|
}
|
|
7497
7585
|
),
|
|
7498
|
-
monitor && discovery && monitor.activeTab === "today" && /* @__PURE__ */
|
|
7499
|
-
monitor && monitor.activeTab === "following" && /* @__PURE__ */
|
|
7500
|
-
monitor && monitor.activeTab === "odds" && /* @__PURE__ */
|
|
7501
|
-
monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */
|
|
7586
|
+
monitor && discovery && monitor.activeTab === "today" && /* @__PURE__ */ jsx86(TodayPanel, { discovery, ui, monitor }),
|
|
7587
|
+
monitor && monitor.activeTab === "following" && /* @__PURE__ */ jsx86(MatchesPanel, { monitor, ui, slip, onAsk: handleAsk }),
|
|
7588
|
+
monitor && monitor.activeTab === "odds" && /* @__PURE__ */ jsx86(OddsPanel, { monitor, ui, slip }),
|
|
7589
|
+
monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */ jsx86(
|
|
7502
7590
|
GamesPanel,
|
|
7503
7591
|
{
|
|
7504
7592
|
loggedIn: !!loggedIn,
|
|
@@ -7512,7 +7600,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
7512
7600
|
}
|
|
7513
7601
|
}
|
|
7514
7602
|
),
|
|
7515
|
-
monitor && monitor.activeTab === "leaderboard" && leaderboardResult && /* @__PURE__ */
|
|
7603
|
+
monitor && monitor.activeTab === "leaderboard" && leaderboardResult && /* @__PURE__ */ jsx86(
|
|
7516
7604
|
LeaderboardPanel,
|
|
7517
7605
|
{
|
|
7518
7606
|
loggedIn: !!loggedIn,
|
|
@@ -7522,7 +7610,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
7522
7610
|
ui
|
|
7523
7611
|
}
|
|
7524
7612
|
),
|
|
7525
|
-
(!monitor || monitor.activeTab !== "games" && monitor.activeTab !== "leaderboard") && /* @__PURE__ */
|
|
7613
|
+
(!monitor || monitor.activeTab !== "games" && monitor.activeTab !== "leaderboard") && /* @__PURE__ */ jsx86(ChatInput, { placeholder: ui.placeholder, streaming: state.isStreaming, onSend: handleSend, onStop: stop, stopLabel: ui.stopResponse, sendLabel: ui.sendMessage })
|
|
7526
7614
|
] });
|
|
7527
7615
|
}
|
|
7528
7616
|
|
|
@@ -8463,6 +8551,21 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
8463
8551
|
.ss-w-mon-scorers-home { text-align: right; }
|
|
8464
8552
|
.ss-w-mon-scorers-away { text-align: left; }
|
|
8465
8553
|
.ss-w-mon-scorers-ball { flex: none; align-self: start; line-height: 1.35; }
|
|
8554
|
+
.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); }
|
|
8555
|
+
.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); }
|
|
8556
|
+
.ss-w-fact-min { color: var(--ss-w-ink); letter-spacing: 0; }
|
|
8557
|
+
.ss-w-fact-subj { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 650; color: var(--ss-w-faint); }
|
|
8558
|
+
.ss-w-fact-text { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--ss-w-ink); }
|
|
8559
|
+
.ss-w-fact-basis { font-size: 10.5px; color: var(--ss-w-faint); }
|
|
8560
|
+
.ss-w-fact-mkt { display: flex; align-items: center; gap: 8px; font-size: 11.5px; border: 1px solid var(--ss-w-line); border-radius: 8px; padding: 6px 8px; }
|
|
8561
|
+
.ss-w-fact-foot { display: flex; align-items: center; gap: 14px; }
|
|
8562
|
+
.ss-w-fact-link { font: inherit; font-size: 11.5px; font-weight: 700; color: var(--ss-w-accent); background: none; border: none; padding: 4px 0; min-height: 32px; cursor: pointer; }
|
|
8563
|
+
.ss-w-fact-link--muted { color: var(--ss-w-faint); margin-left: auto; }
|
|
8564
|
+
.ss-w-fact-hist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ss-w-line); }
|
|
8565
|
+
.ss-w-fact-hist li { display: grid; grid-template-columns: 34px 1fr; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--ss-w-line); }
|
|
8566
|
+
.ss-w-fact-hist li:last-child { border-bottom: none; }
|
|
8567
|
+
.ss-w-fact-hmin { font-size: 11px; font-weight: 800; color: var(--ss-w-faint); font-variant-numeric: tabular-nums; }
|
|
8568
|
+
.ss-w-fact-htext { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--ss-w-ink); }
|
|
8466
8569
|
.ss-w-mon-stats { display: flex; flex-direction: column; gap: 10px; }
|
|
8467
8570
|
.ss-w-mon-stat { display: flex; flex-direction: column; gap: 5px; }
|
|
8468
8571
|
.ss-w-mon-pstrip { padding: 6px 8px; border-radius: 8px; background: color-mix(in srgb, var(--ss-w-accent) 8%, transparent); }
|
|
@@ -8996,7 +9099,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
8996
9099
|
`;
|
|
8997
9100
|
|
|
8998
9101
|
// src/StatsWidget.tsx
|
|
8999
|
-
import { jsx as
|
|
9102
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
9000
9103
|
function buildClient(props) {
|
|
9001
9104
|
try {
|
|
9002
9105
|
if ("client" in props && props.client) {
|
|
@@ -9037,7 +9140,7 @@ function StatsWidget(props) {
|
|
|
9037
9140
|
}, []);
|
|
9038
9141
|
const convStorageKey = `ss-w-conv:${cfg?.operatorId ?? ""}:${cfg?.userContext?.operatorUserId ?? "anon"}`;
|
|
9039
9142
|
const controller = useChatStream(built?.conversation ?? emptyConversation(), ui.starters, built ? ui.greetingMessage : void 0, convStorageKey);
|
|
9040
|
-
const [hasToday, setHasToday] =
|
|
9143
|
+
const [hasToday, setHasToday] = useState39(false);
|
|
9041
9144
|
const monitor = useLiveMonitor({
|
|
9042
9145
|
getLiveMonitor: (pins) => built ? built.conversation.getLiveMonitor(pins) : Promise.resolve(null),
|
|
9043
9146
|
getMarketOdds: (matchId, dev) => built ? built.conversation.getMarketOdds(matchId, dev) : Promise.resolve(null),
|
|
@@ -9130,7 +9233,7 @@ function StatsWidget(props) {
|
|
|
9130
9233
|
}, [built, ui.injectStyles]);
|
|
9131
9234
|
if (!built) return null;
|
|
9132
9235
|
const attrs = themeAttrs(ui);
|
|
9133
|
-
return /* @__PURE__ */
|
|
9236
|
+
return /* @__PURE__ */ jsx87(EventLogContext.Provider, { value: logger, children: /* @__PURE__ */ jsx87("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__ */ jsx87(
|
|
9134
9237
|
ChatPanel,
|
|
9135
9238
|
{
|
|
9136
9239
|
controller,
|
|
@@ -9144,7 +9247,7 @@ function StatsWidget(props) {
|
|
|
9144
9247
|
loggedIn: !!operatorUserId,
|
|
9145
9248
|
conversation: built?.conversation ?? null
|
|
9146
9249
|
}
|
|
9147
|
-
) : /* @__PURE__ */
|
|
9250
|
+
) : /* @__PURE__ */ jsx87(
|
|
9148
9251
|
ChatFab,
|
|
9149
9252
|
{
|
|
9150
9253
|
label: ui.launcherLabel,
|