@sensiblestats/widget-react 0.103.0 → 0.105.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/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/StatsWidget.tsx
2
- import { useCallback as useCallback24, useEffect as useEffect37, useMemo as useMemo7, useRef as useRef33, useState as useState60 } from "react";
2
+ import { useCallback as useCallback24, useEffect as useEffect37, useMemo as useMemo7, useRef as useRef33, useState as useState61 } from "react";
3
3
  import { StatsWidgetClient } from "@sensiblestats/widget-sdk";
4
4
 
5
5
  // src/kickoff.ts
@@ -1170,7 +1170,7 @@ function isEnglishLocale(locale) {
1170
1170
  }
1171
1171
 
1172
1172
  // src/version.generated.ts
1173
- var WIDGET_REACT_VERSION = "0.103.0";
1173
+ var WIDGET_REACT_VERSION = "0.105.0";
1174
1174
 
1175
1175
  // src/config.ts
1176
1176
  function normalizeUi(cfg) {
@@ -4598,6 +4598,9 @@ var DASHBOARD_EMOJI = {
4598
4598
  plus: "\u2795",
4599
4599
  scale: "\u2696\uFE0F",
4600
4600
  rebound: "\u{1F64C}",
4601
+ gridiron: "\u{1F3C8}",
4602
+ run: "\u{1F3C3}",
4603
+ catch: "\u{1F9E4}",
4601
4604
  assist: "\u{1F91D}",
4602
4605
  injury: "\u{1FA79}",
4603
4606
  stopwatch: "\u23F1\uFE0F",
@@ -4663,7 +4666,7 @@ function ChatFab({ label, greeting, popupText, logoUrl, onOpen, onDismissPopup,
4663
4666
  }
4664
4667
 
4665
4668
  // src/components/ChatPanel.tsx
4666
- import { useCallback as useCallback23, useEffect as useEffect36, useLayoutEffect, useMemo as useMemo6, useRef as useRef32, useState as useState59 } from "react";
4669
+ import { useCallback as useCallback23, useEffect as useEffect36, useLayoutEffect, useMemo as useMemo6, useRef as useRef32, useState as useState60 } from "react";
4667
4670
 
4668
4671
  // src/components/ChatHeader.tsx
4669
4672
  import { useEffect as useEffect16, useRef as useRef17, useState as useState15 } from "react";
@@ -4744,6 +4747,9 @@ function ChatHeader({
4744
4747
  // src/components/MessageList.tsx
4745
4748
  import { useEffect as useEffect23, useRef as useRef21 } from "react";
4746
4749
 
4750
+ // src/components/ChatMessage.tsx
4751
+ import { useState as useState33 } from "react";
4752
+
4747
4753
  // src/components/Markdown.tsx
4748
4754
  import ReactMarkdown from "react-markdown";
4749
4755
  import remarkGfm from "remark-gfm";
@@ -6765,16 +6771,23 @@ var LAYOUT_CLASSES = {
6765
6771
  function layoutClass(layout) {
6766
6772
  return Object.prototype.hasOwnProperty.call(LAYOUT_CLASSES, layout) ? LAYOUT_CLASSES[layout] : LAYOUT_CLASSES.goal;
6767
6773
  }
6768
- function GreetingDashboard({ dashboard, dashboards, defaultSport, onTap, oddsLabel, liveLabel: liveLabel3, sportGroupLabel }) {
6774
+ function switchSets(dashboards) {
6775
+ return dashboards && dashboards.length >= 2 ? dashboards : null;
6776
+ }
6777
+ function initialSport(sets, defaultSport) {
6778
+ return (sets?.some((s) => s.sport === defaultSport) ? defaultSport : sets?.[0]?.sport) ?? "";
6779
+ }
6780
+ function GreetingDashboard({ dashboard, dashboards, defaultSport, onTap, onSportChange, oddsLabel, liveLabel: liveLabel3, sportGroupLabel }) {
6769
6781
  const log = useEventLog();
6770
6782
  const scope = useSportScope();
6771
- const sets = dashboards && dashboards.length >= 2 ? dashboards : null;
6772
- const [selected, setSelected] = useState26(() => (sets?.some((s) => s.sport === defaultSport) ? defaultSport : sets?.[0]?.sport) ?? "");
6783
+ const sets = switchSets(dashboards);
6784
+ const [selected, setSelected] = useState26(() => initialSport(sets, defaultSport));
6773
6785
  const active = sets?.find((s) => s.sport === selected) ?? null;
6774
6786
  const shown = active ? active.dashboard : dashboard;
6775
6787
  const select = (sport) => {
6776
6788
  if (sport === selected) return;
6777
6789
  setSelected(sport);
6790
+ onSportChange?.(sport);
6778
6791
  if (scope) writeSportChoice(scope.operatorId, encodedUserKey(scope.operatorUserId, scope.anonymousUserId), sport, Date.now());
6779
6792
  log?.log({ name: "dashboard_sport_switch", outcome: sport });
6780
6793
  };
@@ -7613,6 +7626,7 @@ function FanDashboardCard({ card, onTap, ui, goalEvents }) {
7613
7626
  // src/components/ChatMessage.tsx
7614
7627
  import { jsx as jsx49, jsxs as jsxs45 } from "react/jsx-runtime";
7615
7628
  function ChatMessage({ message, disabled, onAct, onTap, ui, slip, monitor }) {
7629
+ const [sport, setSport] = useState33(null);
7616
7630
  if (message.role === "user") {
7617
7631
  return /* @__PURE__ */ jsx49("div", { className: "ss-w-msg ss-w-user", "data-msg-id": message.id, children: /* @__PURE__ */ jsx49("div", { className: "ss-w-bubble", children: message.text }) });
7618
7632
  }
@@ -7620,9 +7634,12 @@ function ChatMessage({ message, disabled, onAct, onTap, ui, slip, monitor }) {
7620
7634
  onAct({ message: card.actionLabel, actionRef: card.actionRef, label: card.actionLabel || card.title || "" });
7621
7635
  };
7622
7636
  const compact = toCompactList(message.marketOdds);
7637
+ const sets = message.greetingDashboard ? switchSets(message.greetingDashboards) : null;
7638
+ const setChips = sets?.some((s) => s.suggestedActions) ? sets.find((s) => s.sport === (sport ?? initialSport(sets, message.defaultSport)))?.suggestedActions ?? [] : null;
7639
+ const actions = setChips ? setChips.map((c) => toActionVM({ ...c })) : message.actions;
7623
7640
  return /* @__PURE__ */ jsxs45("div", { className: "ss-w-msg ss-w-bot", "data-msg-id": message.id, children: [
7624
7641
  message.text && !message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ jsx49(Markdown, { text: message.text }) : null,
7625
- message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ jsx49(GreetingDashboard, { dashboard: message.greetingDashboard, dashboards: message.greetingDashboards, defaultSport: message.defaultSport, onTap, oddsLabel: ui?.oddsLabel, liveLabel: ui?.liveLabel, sportGroupLabel: ui?.sportGroupLabel }) : null,
7642
+ message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ jsx49(GreetingDashboard, { dashboard: message.greetingDashboard, dashboards: message.greetingDashboards, defaultSport: message.defaultSport, onTap, onSportChange: setSport, oddsLabel: ui?.oddsLabel, liveLabel: ui?.liveLabel, sportGroupLabel: ui?.sportGroupLabel }) : null,
7626
7643
  message.clubFanDashboard ? /* @__PURE__ */ jsx49(ClubFanDashboard, { dashboard: message.clubFanDashboard, onTap: onFanDashboardTap, ui }) : null,
7627
7644
  /* @__PURE__ */ jsx49(EntityCardList, { cards: message.cards, disabled, showLessLabel: ui?.showLess, showMoreLabel: ui?.showMore }),
7628
7645
  /* @__PURE__ */ jsx49(BettingInsightList, { insights: message.insights, ui, slip, monitor }),
@@ -7631,7 +7648,7 @@ function ChatMessage({ message, disabled, onAct, onTap, ui, slip, monitor }) {
7631
7648
  /* @__PURE__ */ jsx49(ComboCardList, { cards: message.comboCards ?? [], ui, slip, monitor }),
7632
7649
  compact ? /* @__PURE__ */ jsx49(CompactOddsList, { list: compact, ui, slip, monitor }) : /* @__PURE__ */ jsx49(MarketOddsCardList, { cards: message.marketOdds, ui, slip, monitor }),
7633
7650
  /* @__PURE__ */ jsx49(OddsMovementCardList, { cards: message.oddsMovement, ui, monitor }),
7634
- /* @__PURE__ */ jsx49(ActionButtons, { actions: message.actions, loading: false, disabled, onAct })
7651
+ /* @__PURE__ */ jsx49(ActionButtons, { actions, loading: false, disabled, onAct })
7635
7652
  ] });
7636
7653
  }
7637
7654
 
@@ -7719,10 +7736,10 @@ function MessageList({ controller, ui, slip, onDashboardTap, monitor }) {
7719
7736
  }
7720
7737
 
7721
7738
  // src/components/ChatInput.tsx
7722
- import { forwardRef, useEffect as useEffect24, useImperativeHandle, useRef as useRef22, useState as useState33 } from "react";
7739
+ import { forwardRef, useEffect as useEffect24, useImperativeHandle, useRef as useRef22, useState as useState34 } from "react";
7723
7740
  import { jsx as jsx52, jsxs as jsxs47 } from "react/jsx-runtime";
7724
7741
  var ChatInput = forwardRef(function ChatInput2({ placeholder, streaming, onSend, onStop, stopLabel = "Stop response", sendLabel = "Send message", disabled = false, onType }, ref) {
7725
- const [value, setValue] = useState33("");
7742
+ const [value, setValue] = useState34("");
7726
7743
  const textareaRef = useRef22(null);
7727
7744
  const stopRef = useRef22(null);
7728
7745
  const textBoxWantsFocusRef = useRef22(false);
@@ -7893,10 +7910,10 @@ function MarketAccordion({ match, monitor, ui, slip }) {
7893
7910
  }
7894
7911
 
7895
7912
  // src/components/LiveFactBlock.tsx
7896
- import { useState as useState34 } from "react";
7913
+ import { useState as useState35 } from "react";
7897
7914
  import { jsx as jsx55, jsxs as jsxs50 } from "react/jsx-runtime";
7898
7915
  function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
7899
- const [expanded, setExpanded] = useState34(false);
7916
+ const [expanded, setExpanded] = useState35(false);
7900
7917
  const [current, ...earlier] = facts;
7901
7918
  if (!current) return null;
7902
7919
  const m = current.market;
@@ -7964,7 +7981,7 @@ function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
7964
7981
  }
7965
7982
 
7966
7983
  // src/components/MonitorFormH2H.tsx
7967
- import { useState as useState35 } from "react";
7984
+ import { useState as useState36 } from "react";
7968
7985
  import { Fragment as Fragment11, jsx as jsx56, jsxs as jsxs51 } from "react/jsx-runtime";
7969
7986
  function resultClass2(result) {
7970
7987
  if (result === "W") return "ss-w-h2h-result--win";
@@ -7980,7 +7997,7 @@ function FormDots({ form, ui }) {
7980
7997
  return /* @__PURE__ */ jsx56("div", { className: "ss-w-h2h-dots", children: form.map((m, i) => /* @__PURE__ */ jsx56("span", { className: `ss-w-h2h-result ${resultClass2(m.result)}`, children: resultLabel(m.result, ui) }, i)) });
7981
7998
  }
7982
7999
  function MonitorFormH2H({ formAndH2H, homeTeamName, awayTeamName, ui }) {
7983
- const [expanded, setExpanded] = useState35(false);
8000
+ const [expanded, setExpanded] = useState36(false);
7984
8001
  const { homeForm, awayForm, h2h, homeShortCode, awayShortCode } = formAndH2H;
7985
8002
  if (homeForm.length === 0 && awayForm.length === 0 && !h2h) {
7986
8003
  return /* @__PURE__ */ jsx56(Fragment11, {});
@@ -8213,7 +8230,7 @@ function MonitorSkeleton({ pin, monitor, ui }) {
8213
8230
  import { SPORTS as SPORTS5 } from "@sensiblestats/widget-sdk";
8214
8231
 
8215
8232
  // src/components/NbaPropsSection.tsx
8216
- import { useEffect as useEffect26, useState as useState36 } from "react";
8233
+ import { useEffect as useEffect26, useState as useState37 } from "react";
8217
8234
  import { Fragment as Fragment12, jsx as jsx59, jsxs as jsxs54 } from "react/jsx-runtime";
8218
8235
  var STAT_ORDER = ["points", "rebounds", "assists", "threes"];
8219
8236
  var MAX_TIMER_MS = 2147483647;
@@ -8275,7 +8292,7 @@ function Last5({ games, stat, line, ui }) {
8275
8292
  }
8276
8293
  function PlayerPanel({ player, bundle, ui, slip }) {
8277
8294
  const stats = STAT_ORDER.map((k) => player.stats.find((s) => s.stat === k)).filter((s) => s != null);
8278
- const [picked, setPicked] = useState36(null);
8295
+ const [picked, setPicked] = useState37(null);
8279
8296
  const active = stats.find((s) => s.stat === picked) ?? stats[0];
8280
8297
  return /* @__PURE__ */ jsxs54("div", { className: "ss-w-props-panel", children: [
8281
8298
  /* @__PURE__ */ jsx59("div", { className: "ss-w-props-chips", children: stats.map((s) => /* @__PURE__ */ jsx59(
@@ -8312,7 +8329,7 @@ function PlayerPanel({ player, bundle, ui, slip }) {
8312
8329
  ] });
8313
8330
  }
8314
8331
  function Roster({ bundle, players, side, ui, slip }) {
8315
- const [openId, setOpenId] = useState36(null);
8332
+ const [openId, setOpenId] = useState37(null);
8316
8333
  return /* @__PURE__ */ jsx59("div", { className: "ss-w-props-list", children: players.map((p) => {
8317
8334
  const isOpen = openId === p.playerId;
8318
8335
  const main = p.stats.find((s) => s.stat === "points" && hasMainLine(s)) ?? p.stats.find(hasMainLine);
@@ -8343,8 +8360,8 @@ function Roster({ bundle, players, side, ui, slip }) {
8343
8360
  }) });
8344
8361
  }
8345
8362
  function NbaPropsSection({ match, monitor, ui, slip }) {
8346
- const [side, setSide] = useState36("home");
8347
- const [, setTick] = useState36(0);
8363
+ const [side, setSide] = useState37("home");
8364
+ const [, setTick] = useState37(0);
8348
8365
  const pre = preTip(match);
8349
8366
  const live = match.phase === "live";
8350
8367
  const open = pre || live;
@@ -8830,7 +8847,7 @@ function OddsPanel({ monitor, ui, slip }) {
8830
8847
  }
8831
8848
 
8832
8849
  // src/components/TodayPanel.tsx
8833
- import { useEffect as useEffect29, useId as useId2, useMemo as useMemo5, useState as useState39 } from "react";
8850
+ import { useEffect as useEffect29, useId as useId2, useMemo as useMemo5, useState as useState40 } from "react";
8834
8851
  import { matchKey as matchKey7 } from "@sensiblestats/widget-sdk";
8835
8852
 
8836
8853
  // src/placement.ts
@@ -8895,9 +8912,9 @@ function matchingFixtures(group, query) {
8895
8912
  }
8896
8913
 
8897
8914
  // src/useStarTap.ts
8898
- import { useCallback as useCallback19, useRef as useRef25, useState as useState37 } from "react";
8915
+ import { useCallback as useCallback19, useRef as useRef25, useState as useState38 } from "react";
8899
8916
  function useStarTap(starLeague) {
8900
- const [pendingId, setPendingId] = useState37(null);
8917
+ const [pendingId, setPendingId] = useState38(null);
8901
8918
  const pendingRef = useRef25(null);
8902
8919
  const tap = useCallback19(async (competitionId, next) => {
8903
8920
  if (pendingRef.current !== null) return false;
@@ -8958,7 +8975,7 @@ function LeagueTile({ group, starClickable: starClickable2, disambiguate, onOpen
8958
8975
  }
8959
8976
 
8960
8977
  // src/components/LeagueDetail.tsx
8961
- import { useEffect as useEffect28, useState as useState38 } from "react";
8978
+ import { useEffect as useEffect28, useState as useState39 } from "react";
8962
8979
  import { matchKey as matchKey5 } from "@sensiblestats/widget-sdk";
8963
8980
 
8964
8981
  // src/components/FixtureRow.tsx
@@ -9021,7 +9038,7 @@ function FixtureRow({ match, state, stale, ui, monitor }) {
9021
9038
  import { jsx as jsx66, jsxs as jsxs61 } from "react/jsx-runtime";
9022
9039
  var STAR_PATH2 = "M12 2.5l2.9 5.9 6.5.95-4.7 4.58 1.1 6.47L12 17.35 6.1 20.4l1.1-6.47L2.5 9.35l6.5-.95z";
9023
9040
  function LeagueDetail({ group, position, states, stale, ui, monitor, starTap, onBack, onPrev, onNext }) {
9024
- const [toast, setToast] = useState38(null);
9041
+ const [toast, setToast] = useState39(null);
9025
9042
  useEffect28(() => {
9026
9043
  setToast(null);
9027
9044
  }, [group.competitionId]);
@@ -9263,9 +9280,9 @@ import { Fragment as Fragment16, jsx as jsx70, jsxs as jsxs64 } from "react/jsx-
9263
9280
  function TodayPanel({ discovery, ui, monitor }) {
9264
9281
  const { groups, states, stale, starLeague } = discovery;
9265
9282
  const searchId = useId2();
9266
- const [query, setQuery] = useState39("");
9267
- const [selectedCompetitionId, setSelectedCompetitionId] = useState39(null);
9268
- const [toast, setToast] = useState39(null);
9283
+ const [query, setQuery] = useState40("");
9284
+ const [selectedCompetitionId, setSelectedCompetitionId] = useState40(null);
9285
+ const [toast, setToast] = useState40(null);
9269
9286
  useEffect29(() => {
9270
9287
  if (toast === null) return;
9271
9288
  const id = setTimeout(() => setToast(null), 4e3);
@@ -9468,7 +9485,7 @@ function TodayPanel({ discovery, ui, monitor }) {
9468
9485
  }
9469
9486
 
9470
9487
  // src/components/GamesPanel.tsx
9471
- import { useEffect as useEffect33, useState as useState54 } from "react";
9488
+ import { useEffect as useEffect33, useState as useState55 } from "react";
9472
9489
 
9473
9490
  // src/components/GamesLoginWall.tsx
9474
9491
  import { jsx as jsx71 } from "react/jsx-runtime";
@@ -9477,7 +9494,7 @@ function GamesLoginWall({ ui }) {
9477
9494
  }
9478
9495
 
9479
9496
  // src/components/GamesHub.tsx
9480
- import { useEffect as useEffect30, useState as useState40 } from "react";
9497
+ import { useEffect as useEffect30, useState as useState41 } from "react";
9481
9498
 
9482
9499
  // src/components/games/ui/gameMeta.ts
9483
9500
  function prettifyGameId(gameId) {
@@ -9628,7 +9645,7 @@ function pickHeroGame(games) {
9628
9645
  }
9629
9646
  var tileKey = (g) => `${g.gameId}-${g.gameDay}-${g.fixtureId}`;
9630
9647
  function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
9631
- const [, setTick] = useState40(0);
9648
+ const [, setTick] = useState41(0);
9632
9649
  useEffect30(() => {
9633
9650
  const id = setInterval(() => setTick((t) => t + 1), 6e4);
9634
9651
  return () => clearInterval(id);
@@ -9689,10 +9706,10 @@ function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
9689
9706
  }
9690
9707
 
9691
9708
  // src/components/GameScreenHost.tsx
9692
- import { useEffect as useEffect32, useRef as useRef29, useState as useState52 } from "react";
9709
+ import { useEffect as useEffect32, useRef as useRef29, useState as useState53 } from "react";
9693
9710
 
9694
9711
  // src/useGamePlay.ts
9695
- import { useCallback as useCallback21, useRef as useRef27, useState as useState41 } from "react";
9712
+ import { useCallback as useCallback21, useRef as useRef27, useState as useState42 } from "react";
9696
9713
  function toSubmitResult(payload) {
9697
9714
  return {
9698
9715
  // 'pending' means the play is recorded but awaiting resolution (fixture games)
@@ -9704,9 +9721,9 @@ function toSubmitResult(payload) {
9704
9721
  };
9705
9722
  }
9706
9723
  function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh }) {
9707
- const [result, setResult] = useState41(null);
9708
- const [submitting, setSubmitting] = useState41(false);
9709
- const [rawStatus, setRawStatus] = useState41(null);
9724
+ const [result, setResult] = useState42(null);
9725
+ const [submitting, setSubmitting] = useState42(false);
9726
+ const [rawStatus, setRawStatus] = useState42(null);
9710
9727
  const inFlightRef = useRef27(false);
9711
9728
  const convRef = useRef27(conversation);
9712
9729
  convRef.current = conversation;
@@ -9764,7 +9781,7 @@ function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh
9764
9781
  }
9765
9782
 
9766
9783
  // src/components/games/MysteryTigerGame.tsx
9767
- import { useState as useState43, useId as useId3 } from "react";
9784
+ import { useState as useState44, useId as useId3 } from "react";
9768
9785
 
9769
9786
  // src/components/games/nationFlags.ts
9770
9787
  var FLAGS = {
@@ -9975,7 +9992,7 @@ function isNationCode(flag) {
9975
9992
  }
9976
9993
 
9977
9994
  // src/components/games/PlayerAvatar.tsx
9978
- import { useState as useState42 } from "react";
9995
+ import { useState as useState43 } from "react";
9979
9996
  import { jsx as jsx76 } from "react/jsx-runtime";
9980
9997
  function initialsOf(name) {
9981
9998
  const parts = name.trim().split(/\s+/).filter(Boolean);
@@ -9993,7 +10010,7 @@ function PlayerAvatar({
9993
10010
  imagePath,
9994
10011
  className
9995
10012
  }) {
9996
- const [failed, setFailed] = useState42(false);
10013
+ const [failed, setFailed] = useState43(false);
9997
10014
  const showImage = Boolean(imagePath) && !isPlaceholderImage(imagePath) && !failed;
9998
10015
  return /* @__PURE__ */ jsx76("div", { className, "aria-hidden": "true", children: showImage ? /* @__PURE__ */ jsx76("img", { src: imagePath, alt: "", loading: "lazy", onError: () => setFailed(true) }) : /* @__PURE__ */ jsx76("span", { className: "ss-w-av-initials", children: initialsOf(name) }) });
9999
10016
  }
@@ -10234,7 +10251,7 @@ function MysteryTigerGame({
10234
10251
  onBack
10235
10252
  }) {
10236
10253
  const t = ui.games.mysteryTiger;
10237
- const [query, setQuery] = useState43("");
10254
+ const [query, setQuery] = useState44("");
10238
10255
  const inputId = useId3();
10239
10256
  const clientState = parseClientState(result?.clientStateJson);
10240
10257
  const guessResults = clientState?.guessResults ?? [];
@@ -10496,13 +10513,13 @@ function HigherOrLowerGame({
10496
10513
  }
10497
10514
 
10498
10515
  // src/components/games/CareerPathGame.tsx
10499
- import { useState as useState45, useId as useId4 } from "react";
10516
+ import { useState as useState46, useId as useId4 } from "react";
10500
10517
 
10501
10518
  // src/components/games/ui/CrestShield.tsx
10502
- import { useState as useState44 } from "react";
10519
+ import { useState as useState45 } from "react";
10503
10520
  import { jsx as jsx87 } from "react/jsx-runtime";
10504
10521
  function CrestShield({ src, name, size = 28 }) {
10505
- const [failed, setFailed] = useState44(false);
10522
+ const [failed, setFailed] = useState45(false);
10506
10523
  if (src && !isPlaceholderImage(src) && !failed) {
10507
10524
  return /* @__PURE__ */ jsx87("img", { className: "ss-g-crest", src, alt: name, width: size, height: size, loading: "lazy", onError: () => setFailed(true) });
10508
10525
  }
@@ -10534,7 +10551,7 @@ function CareerPathGame({
10534
10551
  }) {
10535
10552
  const s = ui.games.careerPath;
10536
10553
  const title = gameTitle({ gameId: "career-path" }, ui.games.titles);
10537
- const [query, setQuery] = useState45("");
10554
+ const [query, setQuery] = useState46("");
10538
10555
  const inputId = useId4();
10539
10556
  const clientState = parseClientState3(result?.clientStateJson);
10540
10557
  const alreadyGuessedIds = new Set(clientState?.guessResults.map((g) => g.playerId) ?? []);
@@ -10641,7 +10658,7 @@ function CareerPathGame({
10641
10658
  }
10642
10659
 
10643
10660
  // src/components/games/BeatTheGridGame.tsx
10644
- import React, { useEffect as useEffect31, useId as useId5, useRef as useRef28, useState as useState46 } from "react";
10661
+ import React, { useEffect as useEffect31, useId as useId5, useRef as useRef28, useState as useState47 } from "react";
10645
10662
 
10646
10663
  // src/components/games/ui/OptionList.tsx
10647
10664
  import { jsx as jsx89 } from "react/jsx-runtime";
@@ -10730,7 +10747,7 @@ function SearchSheet({
10730
10747
  ui
10731
10748
  }) {
10732
10749
  const s = ui.games.beatTheGrid;
10733
- const [query, setQuery] = useState46("");
10750
+ const [query, setQuery] = useState47("");
10734
10751
  const inputId = useId5();
10735
10752
  const inputRef = useRef28(null);
10736
10753
  useEffect31(() => {
@@ -10798,7 +10815,7 @@ function BeatTheGridGame({
10798
10815
  }) {
10799
10816
  const s = ui.games.beatTheGrid;
10800
10817
  const title = gameTitle({ gameId: "beat-the-grid" }, ui.games.titles);
10801
- const [activeCell, setActiveCell] = useState46(null);
10818
+ const [activeCell, setActiveCell] = useState47(null);
10802
10819
  const clientState = parseClientState4(result?.clientStateJson);
10803
10820
  const filledCells = clientState?.cells ?? [];
10804
10821
  const isLocked2 = result?.alreadyPlayed === true || clientState?.isComplete === true;
@@ -10953,7 +10970,7 @@ function BeatTheGridGame({
10953
10970
  }
10954
10971
 
10955
10972
  // src/components/games/GuessTheXiGame.tsx
10956
- import { useState as useState47, useId as useId6 } from "react";
10973
+ import { useState as useState48, useId as useId6 } from "react";
10957
10974
 
10958
10975
  // src/components/games/ui/PitchSvg.tsx
10959
10976
  import { Fragment as Fragment25, jsx as jsx91, jsxs as jsxs79 } from "react/jsx-runtime";
@@ -11042,7 +11059,7 @@ function GuessTheXiGame({
11042
11059
  onBack
11043
11060
  }) {
11044
11061
  const t = ui.games.guessTheXi;
11045
- const [query, setQuery] = useState47("");
11062
+ const [query, setQuery] = useState48("");
11046
11063
  const inputId = useId6();
11047
11064
  const clientState = parseClientState5(result?.clientStateJson);
11048
11065
  const isOver = result?.alreadyPlayed === true || clientState?.status === "solved" || clientState?.status === "failed";
@@ -11185,7 +11202,7 @@ function GuessTheXiGame({
11185
11202
  }
11186
11203
 
11187
11204
  // src/components/games/DailyQuizGame.tsx
11188
- import { useState as useState48 } from "react";
11205
+ import { useState as useState49 } from "react";
11189
11206
  import { Fragment as Fragment27, jsx as jsx93, jsxs as jsxs81 } from "react/jsx-runtime";
11190
11207
  function parseClientState6(json) {
11191
11208
  if (!json) return null;
@@ -11226,8 +11243,8 @@ function DailyQuizGame({
11226
11243
  }) {
11227
11244
  const s = ui.games.dailyQuiz;
11228
11245
  const title = gameTitle({ gameId: "daily-quiz" }, ui.games.titles);
11229
- const [selections, setSelections] = useState48(/* @__PURE__ */ new Map());
11230
- const [page, setPage] = useState48(0);
11246
+ const [selections, setSelections] = useState49(/* @__PURE__ */ new Map());
11247
+ const [page, setPage] = useState49(0);
11231
11248
  const clientState = parseClientState6(result?.clientStateJson);
11232
11249
  const results = clientState?.results ?? [];
11233
11250
  const isRevealed = results.length > 0 || result?.alreadyPlayed === true;
@@ -11337,7 +11354,7 @@ function DailyQuizGame({
11337
11354
  }
11338
11355
 
11339
11356
  // src/components/games/MatchdayPredictorGame.tsx
11340
- import { useId as useId7, useState as useState49 } from "react";
11357
+ import { useId as useId7, useState as useState50 } from "react";
11341
11358
  import { jsx as jsx94, jsxs as jsxs82 } from "react/jsx-runtime";
11342
11359
  var SCORER_SEARCH_THRESHOLD = 9;
11343
11360
  function parseClientState7(json) {
@@ -11433,11 +11450,11 @@ function MatchdayPredictorGame({
11433
11450
  onBack
11434
11451
  }) {
11435
11452
  const t = ui.games.predictor;
11436
- const [homeScore, setHomeScore] = useState49(0);
11437
- const [awayScore, setAwayScore] = useState49(0);
11438
- const [firstScorerPlayerId, setFirstScorerPlayerId] = useState49(null);
11439
- const [lastEdited, setLastEdited] = useState49("home");
11440
- const [query, setQuery] = useState49("");
11453
+ const [homeScore, setHomeScore] = useState50(0);
11454
+ const [awayScore, setAwayScore] = useState50(0);
11455
+ const [firstScorerPlayerId, setFirstScorerPlayerId] = useState50(null);
11456
+ const [lastEdited, setLastEdited] = useState50("home");
11457
+ const [query, setQuery] = useState50("");
11441
11458
  const searchId = useId7();
11442
11459
  const clientState = parseClientState7(result?.clientStateJson);
11443
11460
  const alreadyPlayed = result?.alreadyPlayed === true;
@@ -11605,7 +11622,7 @@ function MatchdayPredictorGame({
11605
11622
  }
11606
11623
 
11607
11624
  // src/components/games/StartingXiGame.tsx
11608
- import { useId as useId8, useState as useState50 } from "react";
11625
+ import { useId as useId8, useState as useState51 } from "react";
11609
11626
  import { Fragment as Fragment28, jsx as jsx95, jsxs as jsxs83 } from "react/jsx-runtime";
11610
11627
  var POINTS_PER_STARTER = 8;
11611
11628
  var XI_SIZE = 11;
@@ -11649,9 +11666,9 @@ function StartingXiGame({
11649
11666
  lockAtUtc
11650
11667
  }) {
11651
11668
  const t = ui.games.startingXi;
11652
- const [slotPlayers, setSlotPlayers] = useState50(() => Array(XI_SIZE).fill(null));
11653
- const [active, setActive] = useState50(0);
11654
- const [query, setQuery] = useState50("");
11669
+ const [slotPlayers, setSlotPlayers] = useState51(() => Array(XI_SIZE).fill(null));
11670
+ const [active, setActive] = useState51(0);
11671
+ const [query, setQuery] = useState51("");
11655
11672
  const searchId = useId8();
11656
11673
  const clientState = parseClientState8(result?.clientStateJson);
11657
11674
  const alreadyPlayed = result?.alreadyPlayed === true;
@@ -11791,7 +11808,7 @@ function StartingXiGame({
11791
11808
  }
11792
11809
 
11793
11810
  // src/components/games/StatLadderGame.tsx
11794
- import { useId as useId9, useState as useState51 } from "react";
11811
+ import { useId as useId9, useState as useState52 } from "react";
11795
11812
  import { jsx as jsx96, jsxs as jsxs84 } from "react/jsx-runtime";
11796
11813
  function ladderClue(ladder) {
11797
11814
  const mystery = ladder.find((r) => r.rank === 2);
@@ -11828,8 +11845,8 @@ function StatLadderGame({
11828
11845
  onBack
11829
11846
  }) {
11830
11847
  const t = ui.games.statLadder;
11831
- const [query, setQuery] = useState51("");
11832
- const [selectedId, setSelectedId] = useState51(null);
11848
+ const [query, setQuery] = useState52("");
11849
+ const [selectedId, setSelectedId] = useState52(null);
11833
11850
  const searchId = useId9();
11834
11851
  const clientState = parseClientState9(result?.clientStateJson);
11835
11852
  const revealed = clientState != null;
@@ -12036,7 +12053,7 @@ function GameScreenHost({
12036
12053
  ui
12037
12054
  }) {
12038
12055
  const { gameId, fixtureId, gameDay = "", lockAtUtc = null } = selected;
12039
- const [configJson, setConfigJson] = useState52(null);
12056
+ const [configJson, setConfigJson] = useState53(null);
12040
12057
  useEffect32(() => {
12041
12058
  setConfigJson(null);
12042
12059
  if (!conversation) return;
@@ -12178,7 +12195,7 @@ function GameScreenHost({
12178
12195
  }
12179
12196
 
12180
12197
  // src/components/Leaderboard.tsx
12181
- import { useState as useState53 } from "react";
12198
+ import { useState as useState54 } from "react";
12182
12199
 
12183
12200
  // src/components/LeaderboardRow.tsx
12184
12201
  import { jsx as jsx99, jsxs as jsxs86 } from "react/jsx-runtime";
@@ -12263,7 +12280,7 @@ function Leaderboard({
12263
12280
  ui,
12264
12281
  onPlay
12265
12282
  }) {
12266
- const [segment, setSegment] = useState53("weekly");
12283
+ const [segment, setSegment] = useState54("weekly");
12267
12284
  const myRow = segment === "weekly" ? data.myWeeklyRow : data.myAllTimeRow;
12268
12285
  const offBoard = myRow !== null && myRow !== void 0 && myRow.rank === -1;
12269
12286
  const isEmpty = segment === "weekly" ? data.weeklyTop.length === 0 : data.allTimeTop.length === 0;
@@ -12366,8 +12383,8 @@ function GamesPanel({
12366
12383
  leaderboardLoading,
12367
12384
  refreshHub
12368
12385
  }) {
12369
- const [selected, setSelected] = useState54(null);
12370
- const [segment, setSegment] = useState54("play");
12386
+ const [selected, setSelected] = useState55(null);
12387
+ const [segment, setSegment] = useState55("play");
12371
12388
  useEffect33(() => {
12372
12389
  ensureGamesFonts();
12373
12390
  }, []);
@@ -12669,10 +12686,10 @@ function Squad({ squad, loading, ui, view, onToggleView, stats, statsLoading, se
12669
12686
  }
12670
12687
 
12671
12688
  // src/components/PlayerPhoto.tsx
12672
- import { useState as useState55 } from "react";
12689
+ import { useState as useState56 } from "react";
12673
12690
  import { jsx as jsx108 } from "react/jsx-runtime";
12674
12691
  function PlayerPhoto({ photoUrl, jerseyNumber, size }) {
12675
- const [failed, setFailed] = useState55(false);
12692
+ const [failed, setFailed] = useState56(false);
12676
12693
  const box = { width: size, height: size };
12677
12694
  if (photoUrl && !failed) {
12678
12695
  return /* @__PURE__ */ jsx108("img", { className: "ss-w-pd-photo", style: box, src: photoUrl, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
@@ -12707,7 +12724,7 @@ function MiniPitch({ positionCode }) {
12707
12724
  }
12708
12725
 
12709
12726
  // src/components/PerformanceBars.tsx
12710
- import { useState as useState56 } from "react";
12727
+ import { useState as useState57 } from "react";
12711
12728
  import { jsx as jsx110, jsxs as jsxs94 } from "react/jsx-runtime";
12712
12729
  var GROUPS = ["shooting", "passing", "possession", "defending"];
12713
12730
  function finite3(v) {
@@ -12753,7 +12770,7 @@ function unrankedLine(ui, reason) {
12753
12770
  }
12754
12771
  }
12755
12772
  function PerformanceBars({ performance, competitionName, strings }) {
12756
- const [mode, setMode] = useState56("total");
12773
+ const [mode, setMode] = useState57("total");
12757
12774
  const labelled = performance.metrics.filter((m) => Object.prototype.hasOwnProperty.call(strings.perfMetric, m.key));
12758
12775
  if (!labelled.some((m) => valueOf(m, "total") !== null || valueOf(m, "per90") !== null)) return null;
12759
12776
  const subtitle = !performance.ranked ? unrankedLine(strings, performance.unrankedReason) : competitionName ? strings.perfRankedAgainst(competitionName, performance.positionGroup) : null;
@@ -12962,7 +12979,7 @@ function PresetSpeedDial({ expanded, showDot, strings, onToggle, onOpen, rootRef
12962
12979
  }
12963
12980
 
12964
12981
  // src/components/PresetTools.tsx
12965
- import { Fragment as Fragment32, useEffect as useEffect34, useId as useId11, useRef as useRef30, useState as useState57 } from "react";
12982
+ import { Fragment as Fragment32, useEffect as useEffect34, useId as useId11, useRef as useRef30, useState as useState58 } from "react";
12966
12983
  import { Fragment as Fragment33, jsx as jsx113, jsxs as jsxs97 } from "react/jsx-runtime";
12967
12984
  var FOCUSABLE = 'button:not([disabled]), [href], input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
12968
12985
  function PresetToolModal({ title, closeLabel, onClose, children, footer }) {
@@ -13082,15 +13099,15 @@ function SetNumbersTool({ grid, strings, streaming, onSend, onClose }) {
13082
13099
  const totals = comboTotals(grid);
13083
13100
  const legChoices = comboLegChoices(grid);
13084
13101
  const count = FIXED_SINGLES_COUNT;
13085
- const [maxPrice, setMaxPrice] = useState57(() => startSingles(grid.singles, limits, START.maxPrice, count));
13086
- const [minPrice, setMinPrice] = useState57(() => startSingles(grid.singlesFrom, floors, START.minPrice, count));
13087
- const [start] = useState57(() => startCombo(grid, totals, legChoices, START.comboTotal, START.comboLegs));
13088
- const [total, setTotal] = useState57(start.total);
13089
- const [legs, setLegs] = useState57(start.legs);
13090
- const [bigStart] = useState57(() => startCombo(grid, totals, legChoices, BIG_COMBO.total, BIG_COMBO.legs));
13091
- const [bigTotal, setBigTotal] = useState57(bigStart.total);
13092
- const [bigLegs, setBigLegs] = useState57(bigStart.legs);
13093
- const [announcement, setAnnouncement] = useState57("");
13102
+ const [maxPrice, setMaxPrice] = useState58(() => startSingles(grid.singles, limits, START.maxPrice, count));
13103
+ const [minPrice, setMinPrice] = useState58(() => startSingles(grid.singlesFrom, floors, START.minPrice, count));
13104
+ const [start] = useState58(() => startCombo(grid, totals, legChoices, START.comboTotal, START.comboLegs));
13105
+ const [total, setTotal] = useState58(start.total);
13106
+ const [legs, setLegs] = useState58(start.legs);
13107
+ const [bigStart] = useState58(() => startCombo(grid, totals, legChoices, BIG_COMBO.total, BIG_COMBO.legs));
13108
+ const [bigTotal, setBigTotal] = useState58(bigStart.total);
13109
+ const [bigLegs, setBigLegs] = useState58(bigStart.legs);
13110
+ const [announcement, setAnnouncement] = useState58("");
13094
13111
  const maxCell = findSingles(grid.singles, maxPrice, count);
13095
13112
  const minCell = findSingles(grid.singlesFrom, minPrice, count);
13096
13113
  const comboCell = findCombo(grid, total, legs);
@@ -13134,7 +13151,7 @@ function SetNumbersTool({ grid, strings, streaming, onSend, onClose }) {
13134
13151
  const totalChoices = totals.map((v) => ({ value: v, text: v.toFixed(1), available: legChoices.some((n) => !!findCombo(grid, v, n)) }));
13135
13152
  const legChoicesFor = (t) => legChoices.map((n) => ({ value: n, text: String(n), available: !!findCombo(grid, t, n) }));
13136
13153
  const markets = grid.markets ?? [];
13137
- const [marketIdx, setMarketIdx] = useState57(0);
13154
+ const [marketIdx, setMarketIdx] = useState58(0);
13138
13155
  const marketCell = markets[marketIdx] ?? null;
13139
13156
  const marketLabels = markets.map((c) => strings.marketShort(c.marketDeveloperName, c.marketLabel, c.selectionLabel ?? null));
13140
13157
  const singlesReady = (cell2) => cell2 ? strings.readyCount(cell2.picks.length) : strings.unavailable;
@@ -13215,14 +13232,14 @@ function SetNumbersTool({ grid, strings, streaming, onSend, onClose }) {
13215
13232
  function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal, initialLegs, onSend, onClose }) {
13216
13233
  const totals = comboTotals(grid);
13217
13234
  const legChoices = comboLegChoices(grid);
13218
- const [start] = useState57(() => initialTotal === void 0 ? startCombo(grid, totals, legChoices, START.comboTotal, START.comboLegs) : null);
13219
- const [total, setTotal] = useState57(() => initialTotal !== void 0 ? nearest(totals, initialTotal) : start.total);
13220
- const [legs, setLegs] = useState57(() => {
13235
+ const [start] = useState58(() => initialTotal === void 0 ? startCombo(grid, totals, legChoices, START.comboTotal, START.comboLegs) : null);
13236
+ const [total, setTotal] = useState58(() => initialTotal !== void 0 ? nearest(totals, initialTotal) : start.total);
13237
+ const [legs, setLegs] = useState58(() => {
13221
13238
  if (initialTotal === void 0) return initialLegs !== void 0 ? clampLegs(legChoices, initialLegs) : start.legs;
13222
13239
  const from = initialLegs !== void 0 ? clampLegs(legChoices, initialLegs) : startValue(legChoices, START.comboLegs);
13223
13240
  return legsForTotal(grid, nearest(totals, initialTotal), from);
13224
13241
  });
13225
- const [announcement, setAnnouncement] = useState57("");
13242
+ const [announcement, setAnnouncement] = useState58("");
13226
13243
  const cell2 = findCombo(grid, total, legs);
13227
13244
  const minLegs = legChoices[0] ?? legs;
13228
13245
  const maxLegs = legChoices[legChoices.length - 1] ?? legs;
@@ -13255,7 +13272,7 @@ function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal,
13255
13272
  }
13256
13273
 
13257
13274
  // src/usePresetDial.ts
13258
- import { useCallback as useCallback22, useEffect as useEffect35, useRef as useRef31, useState as useState58 } from "react";
13275
+ import { useCallback as useCallback22, useEffect as useEffect35, useRef as useRef31, useState as useState59 } from "react";
13259
13276
  function sendInFlight(messages, isStreaming) {
13260
13277
  const last = messages[messages.length - 1];
13261
13278
  return isStreaming && !!last && last.role === "assistant" && !last.done && !last.isGreeting;
@@ -13269,7 +13286,7 @@ function lastUserId(messages) {
13269
13286
  }
13270
13287
  var SCROLL_KEYS = /* @__PURE__ */ new Set(["ArrowUp", "ArrowDown", "PageUp", "PageDown", "Home", "End", " "]);
13271
13288
  function usePresetDial({ layerRef, dialRef, dialButtonRef, messages, isStreaming, activeTab }) {
13272
- const [expanded, setExpanded] = useState58(() => !sendInFlight(messages, isStreaming));
13289
+ const [expanded, setExpanded] = useState59(() => !sendInFlight(messages, isStreaming));
13273
13290
  const fold = useCallback22(() => setExpanded(false), []);
13274
13291
  const toggle = useCallback22(() => setExpanded((e) => !e), []);
13275
13292
  const currentUserId = lastUserId(messages);
@@ -13355,7 +13372,7 @@ function markToolSeen() {
13355
13372
  import { Fragment as Fragment34, jsx as jsx114, jsxs as jsxs98 } from "react/jsx-runtime";
13356
13373
  var FULLSCREEN_QUERY = "(max-width: 639px)";
13357
13374
  function useIsModal() {
13358
- const [modal, setModal] = useState59(false);
13375
+ const [modal, setModal] = useState60(false);
13359
13376
  useEffect36(() => {
13360
13377
  if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
13361
13378
  const mql = window.matchMedia(FULLSCREEN_QUERY);
@@ -13370,8 +13387,8 @@ var HIDDEN_LAYER_STYLE = { position: "absolute", inset: 0, visibility: "hidden",
13370
13387
  var SQUAD_LAYER_STYLE = { display: "flex", flexDirection: "column", flex: 1, minHeight: 0 };
13371
13388
  function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, gamesResult, leaderboardResult, clubFixturesResult, clubStandingsResult, clubSquadResult, clubSquadStatsResult, clubPlayerDetailResult, loggedIn, conversation, presetGrid }) {
13372
13389
  const { state, close, stop, send, reset } = controller;
13373
- const [squadView, setSquadView] = useState59("roster");
13374
- const [selectedPlayerId, setSelectedPlayerId] = useState59(null);
13390
+ const [squadView, setSquadView] = useState60("roster");
13391
+ const [selectedPlayerId, setSelectedPlayerId] = useState60(null);
13375
13392
  const clearPlayerDetail = clubPlayerDetailResult?.clear;
13376
13393
  const fetchPlayerDetail = clubPlayerDetailResult?.fetch;
13377
13394
  const squadLayerRef = useRef32(null);
@@ -13425,8 +13442,8 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
13425
13442
  const limitRef = useRef32(null);
13426
13443
  const typedSendRef = useRef32(false);
13427
13444
  const focusAfterCloseRef = useRef32(null);
13428
- const [tool, setTool] = useState59(null);
13429
- const [toolSeen, setToolSeen] = useState59(readToolSeen);
13445
+ const [tool, setTool] = useState60(null);
13446
+ const [toolSeen, setToolSeen] = useState60(readToolSeen);
13430
13447
  const dial = usePresetDial({
13431
13448
  layerRef,
13432
13449
  dialRef,
@@ -15873,7 +15890,7 @@ function StatsWidget(props) {
15873
15890
  [cfg?.operatorId, cfg?.userContext?.operatorUserId, cfg?.userContext?.anonymousUserId]
15874
15891
  );
15875
15892
  const controller = useChatStream(built?.conversation ?? emptyConversation(), ui.starters, built ? ui.greetingMessage : void 0, convStorageKey, cfg?.page, sportScope);
15876
- const [hasToday, setHasToday] = useState60(false);
15893
+ const [hasToday, setHasToday] = useState61(false);
15877
15894
  const liveCardWatches = useMemo7(() => {
15878
15895
  const seen = /* @__PURE__ */ new Set();
15879
15896
  const out = [];