@sensiblestats/widget-react 0.129.0 → 0.130.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1257,6 +1257,21 @@ function buildLocaleStrings(table, tag2, clock3 = "24h", timeZone) {
1257
1257
  }
1258
1258
 
1259
1259
  // src/odds.ts
1260
+ var DISPLAY_KEYS = ["home", "away", "kickoffUtc", "market", "marketLabel", "selection", "line", "player"];
1261
+ var DISPLAY_MAX = 80;
1262
+ function slipDisplay(parts2) {
1263
+ const out = {};
1264
+ for (const k of DISPLAY_KEYS) {
1265
+ const v = typeof parts2[k] === "string" ? parts2[k].trim() : "";
1266
+ if (!v || k === "kickoffUtc" && !Number.isFinite(Date.parse(v))) continue;
1267
+ out[k] = v.slice(0, DISPLAY_MAX);
1268
+ }
1269
+ return Object.keys(out).length > 0 ? out : void 0;
1270
+ }
1271
+ function withMatch(selection, match) {
1272
+ const display = slipDisplay({ home: match.home, away: match.away, kickoffUtc: match.kickoffUtc, marketLabel: match.marketLabel, player: match.player });
1273
+ return display ? { ...selection, display } : selection;
1274
+ }
1260
1275
  function formatOdds(forms, format2) {
1261
1276
  return (format2 === "american" ? forms.american : format2 === "fractional" ? forms.fractional : forms.decimal) ?? forms.decimal;
1262
1277
  }
@@ -1270,7 +1285,7 @@ function parseOddsFormat(value) {
1270
1285
  }
1271
1286
 
1272
1287
  // src/version.generated.ts
1273
- var WIDGET_REACT_VERSION = "0.129.0";
1288
+ var WIDGET_REACT_VERSION = "0.130.1";
1274
1289
 
1275
1290
  // src/config.ts
1276
1291
  function hostTag(cfg) {
@@ -1948,7 +1963,7 @@ function toSlipSelection(vm, conversationId) {
1948
1963
  if (vm.quotedAtUtc !== void 0) selection.quotedAtUtc = vm.quotedAtUtc;
1949
1964
  if (vm.id !== void 0) selection.insightId = vm.id;
1950
1965
  if (conversationId !== void 0) selection.conversationId = conversationId;
1951
- return selection;
1966
+ return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, marketLabel: vm.market });
1952
1967
  }
1953
1968
  function toMarketOddsVM(card) {
1954
1969
  const rows = Array.isArray(card.rows) ? card.rows : [];
@@ -2065,7 +2080,7 @@ function marketOddsRowToSlipSelection(vm, row, conversationId) {
2065
2080
  const slipSport = slipSportOf(vm.sport);
2066
2081
  if (slipSport) selection.sport = slipSport;
2067
2082
  if (conversationId !== void 0) selection.conversationId = conversationId;
2068
- return selection;
2083
+ return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, marketLabel: vm.market });
2069
2084
  }
2070
2085
  function finite(v) {
2071
2086
  return typeof v === "number" && Number.isFinite(v) ? v : void 0;
@@ -2139,7 +2154,7 @@ function comboLegToSlipSelection(leg, conversationId) {
2139
2154
  if (leg.quotedAtUtc !== void 0) selection.quotedAtUtc = leg.quotedAtUtc;
2140
2155
  if (leg.sport !== void 0) selection.sport = leg.sport;
2141
2156
  if (conversationId !== void 0) selection.conversationId = conversationId;
2142
- return selection;
2157
+ return withMatch(selection, { home: leg.homeTeamName, away: leg.awayTeamName, kickoffUtc: leg.kickoffUtc, marketLabel: leg.market, player: leg.player });
2143
2158
  }
2144
2159
  var isNum = (v) => typeof v === "number" && Number.isFinite(v);
2145
2160
  var isObj = (v) => typeof v === "object" && v !== null;
@@ -2272,7 +2287,37 @@ function toNbaSlipSelection(vm, key, conversationId) {
2272
2287
  sport: "basketball"
2273
2288
  };
2274
2289
  if (conversationId !== void 0) selection.conversationId = conversationId;
2275
- return selection;
2290
+ return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, ...nbaPropOf(vm.evidence, key) });
2291
+ }
2292
+ function nbaPropOf(evidence, key) {
2293
+ switch (evidence.kind) {
2294
+ case "prop_reason":
2295
+ return { player: evidence.propReason.playerName, marketLabel: evidence.propReason.statLabel };
2296
+ case "vs_opponent":
2297
+ return { player: evidence.vsOpponent.playerName, marketLabel: evidence.vsOpponent.statLabel };
2298
+ case "teammate_out": {
2299
+ const row = evidence.teammateOut.rows.find((r) => r.selectionKey === key);
2300
+ return row ? { player: row.playerName, marketLabel: row.statLabel } : null;
2301
+ }
2302
+ case "co_hit": {
2303
+ const leg = evidence.coHit.legs.find((l) => l.selectionKey === key);
2304
+ return leg ? { player: leg.playerName, marketLabel: leg.statLabel } : null;
2305
+ }
2306
+ case "ladder": {
2307
+ const stat = evidence.ladder.stats.find((st) => st.rungs.some((r) => r.selectionKey === key));
2308
+ return stat ? { player: evidence.ladder.playerName, marketLabel: stat.statLabel } : null;
2309
+ }
2310
+ case "quarter_ladder": {
2311
+ const stat = evidence.quarterLadder.stats.find((st) => st.rungs.some((r) => r.selectionKey === key));
2312
+ return stat ? { player: evidence.quarterLadder.playerName, marketLabel: stat.statLabel } : null;
2313
+ }
2314
+ case "matchup": {
2315
+ const pos = evidence.matchup.position;
2316
+ return pos?.playerName && (pos.overSelectionKey === key || pos.underSelectionKey === key) ? { player: pos.playerName, marketLabel: pos.statLabel } : null;
2317
+ }
2318
+ default:
2319
+ return null;
2320
+ }
2276
2321
  }
2277
2322
  function nbaCoHitLegs(vm, conversationId) {
2278
2323
  if (vm.evidence.kind !== "co_hit") return [];
@@ -2285,7 +2330,9 @@ function nbaCoHitLegs(vm, conversationId) {
2285
2330
  matchId: vm.matchId,
2286
2331
  homeTeamName: vm.homeTeamName ?? "",
2287
2332
  awayTeamName: vm.awayTeamName ?? "",
2288
- market: vm.title,
2333
+ kickoffUtc: vm.kickoffUtc ?? void 0,
2334
+ market: leg.statLabel,
2335
+ player: leg.playerName,
2289
2336
  marketDeveloperName: s.marketDeveloperName,
2290
2337
  selection: s.selectionLabel,
2291
2338
  selectionLabel: s.selectionLabel,
@@ -2391,7 +2438,17 @@ function toNflSlipSelection(vm, key, nowMs, conversationId) {
2391
2438
  sport: "americanfootball"
2392
2439
  };
2393
2440
  if (conversationId !== void 0) selection.conversationId = conversationId;
2394
- return selection;
2441
+ return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, ...nflPropOf(vm.evidence) });
2442
+ }
2443
+ function nflPropOf(evidence) {
2444
+ switch (evidence.kind) {
2445
+ case "prop_reason":
2446
+ return { player: evidence.propReason.playerName, marketLabel: evidence.propReason.propLabel };
2447
+ case "ladder":
2448
+ return { player: evidence.ladder.playerName, marketLabel: evidence.ladder.propLabel };
2449
+ default:
2450
+ return null;
2451
+ }
2395
2452
  }
2396
2453
 
2397
2454
  // src/slipKey.ts
@@ -2450,11 +2507,11 @@ function slipPickFields(selection, label, line) {
2450
2507
  if (Number.isFinite(odds) && odds > 1 && odds <= MAX_ODDS) fields.odds = odds;
2451
2508
  return fields;
2452
2509
  }
2453
- function chipSelection(market, matchId, conversationId) {
2510
+ function chipSelection(market, match, conversationId) {
2454
2511
  if (!market || !market.addToSlipEnabled || typeof market.matchOddsId !== "number" || typeof market.price !== "number" || !market.priceFormats) return null;
2455
- const selection = { matchOddsId: market.matchOddsId, matchId, oddsDecimal: market.price, forms: market.priceFormats };
2512
+ const selection = { matchOddsId: market.matchOddsId, matchId: match.matchId, oddsDecimal: market.price, forms: market.priceFormats };
2456
2513
  if (conversationId !== void 0) selection.conversationId = conversationId;
2457
- return selection;
2514
+ return withMatch(selection, { home: match.homeTeamName, away: match.awayTeamName, kickoffUtc: match.kickoffUtc, marketLabel: market.marketLabel });
2458
2515
  }
2459
2516
  function chipPriceText(market, format2) {
2460
2517
  return typeof market.price === "number" && market.priceFormats ? formatOdds(market.priceFormats, format2) : void 0;
@@ -5947,7 +6004,8 @@ function useSlipAdd(slip, ui) {
5947
6004
  const operatorFormat = ui?.oddsFormat ?? "decimal";
5948
6005
  return useCallback14(async (selection, { marketDeveloperName, selectionLabel, line }) => {
5949
6006
  if (!handler) return { kind: "failed" };
5950
- const out = toHostSelection(selection, operatorFormat);
6007
+ const display = slipDisplay({ ...selection.display, market: marketDeveloperName, selection: selectionLabel, line });
6008
+ const out = toHostSelection(display ? { ...selection, display } : selection, operatorFormat);
5951
6009
  const pick = slipPickFields(out, rawLabels ? selectionLabel : void 0, line);
5952
6010
  const wireSport = toWireSport3(out.sport);
5953
6011
  const sportField = {
@@ -10520,7 +10578,7 @@ function MarketAccordion({ match, monitor, ui, slip }) {
10520
10578
  // src/components/LiveFactBlock.tsx
10521
10579
  import { useState as useState44 } from "react";
10522
10580
  import { jsx as jsx70, jsxs as jsxs65 } from "react/jsx-runtime";
10523
- function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
10581
+ function LiveFactBlock({ facts, match, ui, slip, onAsk }) {
10524
10582
  const [expanded, setExpanded] = useState44(false);
10525
10583
  const { oddsFormat } = useOddsSettings();
10526
10584
  const [current, ...earlier] = facts;
@@ -10549,7 +10607,7 @@ function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
10549
10607
  /* @__PURE__ */ jsx70(
10550
10608
  SlipButton,
10551
10609
  {
10552
- selection: chipSelection(m, matchId, slip.conversationId),
10610
+ selection: chipSelection(m, match, slip.conversationId),
10553
10611
  marketDeveloperName: m.marketDeveloperName,
10554
10612
  selectionLabel: m.selectionLabel,
10555
10613
  slip,
@@ -10571,7 +10629,7 @@ function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
10571
10629
  {
10572
10630
  type: "button",
10573
10631
  className: "ss-w-fact-link",
10574
- onClick: () => onAsk(current.text, { kind: "liveFact", matchId, subject: current.text.slice(0, 400) }),
10632
+ onClick: () => onAsk(current.text, { kind: "liveFact", matchId: match.matchId, subject: current.text.slice(0, 400) }),
10575
10633
  children: ui.liveFactAsk
10576
10634
  }
10577
10635
  ),
@@ -10762,11 +10820,11 @@ function MonitorMatchCard({ match, promotedPins, monitor, ui, slip, onAsk }) {
10762
10820
  /* @__PURE__ */ jsx72("span", { className: "ss-w-mon-scorers-ball", "aria-hidden": "true", children: "\u26BD" }),
10763
10821
  /* @__PURE__ */ jsx72("ul", { className: "ss-w-mon-scorers-col ss-w-mon-scorers-away", children: awayScorers.map((s, i) => /* @__PURE__ */ jsx72("li", { children: s.label }, `${s.player}-${i}`)) })
10764
10822
  ] }),
10765
- live && match.facts && match.facts.length > 0 && /* @__PURE__ */ jsx72(LiveFactBlock, { facts: match.facts, matchId: match.matchId, ui, slip, onAsk }),
10823
+ live && match.facts && match.facts.length > 0 && /* @__PURE__ */ jsx72(LiveFactBlock, { facts: match.facts, match, ui, slip, onAsk }),
10766
10824
  /* @__PURE__ */ jsx72("div", { className: "ss-w-mon-stats", children: orderedRows.map((row) => {
10767
10825
  const { home, away } = splitWidths2(row.homeNum, row.awayNum);
10768
10826
  const promoted = isPromoted(row, promotedPins);
10769
- const selection = chipSelection(row.market, match.matchId, slip.conversationId);
10827
+ const selection = chipSelection(row.market, match, slip.conversationId);
10770
10828
  const chipPrice = row.market ? chipPriceText(row.market, oddsFormat) : void 0;
10771
10829
  return /* @__PURE__ */ jsxs67("div", { className: promoted ? "ss-w-mon-stat ss-w-mon-pstrip" : "ss-w-mon-stat", children: [
10772
10830
  /* @__PURE__ */ jsxs67("div", { className: "ss-w-mon-stat-row", children: [
@@ -11020,7 +11078,7 @@ function usePropsOpen(match, monitor, descriptor) {
11020
11078
  }, [match.matchId, match.asOfUtc, open]);
11021
11079
  return { bundle: monitor.playerProps?.[monitorMatchKey(sport, match.matchId)]?.bundle, live, open };
11022
11080
  }
11023
- function PropPrice({ price, label, ariaName, stat, bundle, descriptor, ui, slip }) {
11081
+ function PropPrice({ price, label, ariaName, player, stat, bundle, descriptor, ui, slip }) {
11024
11082
  const { oddsFormat } = useOddsSettings();
11025
11083
  const shown2 = formatOdds(price.priceFormats, oddsFormat);
11026
11084
  if (bundle.addToSlipEnabled && takesSport(slip, descriptor.sport)) {
@@ -11036,7 +11094,7 @@ function PropPrice({ price, label, ariaName, stat, bundle, descriptor, ui, slip
11036
11094
  return /* @__PURE__ */ jsx76(
11037
11095
  SlipButton,
11038
11096
  {
11039
- selection,
11097
+ selection: withMatch(selection, { home: bundle.homeAbbreviation, away: bundle.awayAbbreviation, kickoffUtc: bundle.startsAtUtc, marketLabel: stat.label, player }),
11040
11098
  marketDeveloperName: stat.marketDeveloperName,
11041
11099
  selectionLabel: price.label,
11042
11100
  line: price.line != null ? String(price.line) : void 0,
@@ -11097,7 +11155,7 @@ function PropPlayerPanel({ player: given, bundle, descriptor, ui, slip }) {
11097
11155
  const hitsOf = (price, text2) => descriptor.showHits && sample > 0 && price.hits != null ? text2(price.hits) : null;
11098
11156
  const bars = active ? descriptor.bars(active, player) : [];
11099
11157
  const title = typeof descriptor.barsTitle === "function" ? descriptor.barsTitle(bars.length, bars.some((b) => b.live)) : descriptor.barsTitle;
11100
- const priceProps = { bundle, descriptor, ui, slip };
11158
+ const priceProps = { bundle, descriptor, ui, slip, player: player.name };
11101
11159
  const liveValue = (s) => hasLiveLine(player) ? descriptor.live?.(s, player) ?? null : null;
11102
11160
  const liveChips = stats.some((s) => liveValue(s) !== null);
11103
11161
  return /* @__PURE__ */ jsxs71("div", { className: "ss-w-props-panel", children: [
@@ -11588,6 +11646,7 @@ function Trends({ bundle, facts, descriptor, ui, slip }) {
11588
11646
  price: f.price,
11589
11647
  label: "",
11590
11648
  ariaName: `${f.playerName}, ${bet}`,
11649
+ player: f.playerName,
11591
11650
  stat: f,
11592
11651
  bundle,
11593
11652
  descriptor,
@@ -11603,7 +11662,7 @@ function Trends({ bundle, facts, descriptor, ui, slip }) {
11603
11662
  function Scorers({ bundle, scorers, abbreviations, descriptor, ui, slip }) {
11604
11663
  const [all, setAll] = useState50(false);
11605
11664
  const shown2 = all ? scorers : scorers.slice(0, SCORERS_SHOWN);
11606
- const cell2 = (name, column, price, stat) => price && stat ? /* @__PURE__ */ jsx80(PropPrice, { price, label: "", ariaName: `${name}, ${column}`, stat, bundle, descriptor, ui, slip }) : /* @__PURE__ */ jsx80("span", { className: "ss-w-props-scorer-none", children: "\u2014" });
11665
+ const cell2 = (name, column, price, stat) => price && stat ? /* @__PURE__ */ jsx80(PropPrice, { price, label: "", ariaName: `${name}, ${column}`, player: name, stat, bundle, descriptor, ui, slip }) : /* @__PURE__ */ jsx80("span", { className: "ss-w-props-scorer-none", children: "\u2014" });
11607
11666
  return /* @__PURE__ */ jsxs75("div", { className: "ss-w-props-scorers", children: [
11608
11667
  /* @__PURE__ */ jsxs75("div", { className: "ss-w-props-scorer ss-w-props-scorer-head", children: [
11609
11668
  /* @__PURE__ */ jsx80("span", { children: ui.nfl.propsPlayer }),
@@ -11918,12 +11977,12 @@ var hasGames = (s) => s.sets.some((x) => (x.p1Games ?? 0) > 0 || (x.p2Games ?? 0
11918
11977
 
11919
11978
  // src/components/TennisFixtureRow.tsx
11920
11979
  import { Fragment as Fragment21, jsx as jsx85, jsxs as jsxs80 } from "react/jsx-runtime";
11921
- function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, ui, slip, name, lead, movedLabel }) {
11980
+ function TennisSidePrice({ matchId, tour, pair, price, forms, value, oddsId, player, ui, slip, name, lead, movedLabel }) {
11922
11981
  const { oddsFormat } = useOddsSettings();
11923
11982
  const added = useSlipState()?.added;
11924
11983
  const slipAllowed = !!slip && price.addToSlipEnabled && slipOpenFor(slip, "tennis");
11925
11984
  const label = formatOdds(forms, oddsFormat);
11926
- const selection = slipAllowed && oddsId != null ? {
11985
+ const selection = slipAllowed && oddsId != null ? withMatch({
11927
11986
  matchOddsId: oddsId,
11928
11987
  matchId,
11929
11988
  oddsDecimal: value,
@@ -11932,7 +11991,7 @@ function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, u
11932
11991
  sport: "tennis",
11933
11992
  ...tour ? { tour } : {},
11934
11993
  ...slip.conversationId !== void 0 ? { conversationId: slip.conversationId } : {}
11935
- } : null;
11994
+ }, pair) : null;
11936
11995
  const inSlip = oddsId != null && !!added?.[slipKey({ matchOddsId: oddsId, sport: "tennis" })];
11937
11996
  const ariaLabel = `${player} ${label}${movedLabel ? `, ${movedLabel}` : ""}`;
11938
11997
  if (selection) {
@@ -11968,7 +12027,14 @@ function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, u
11968
12027
  ] });
11969
12028
  }
11970
12029
  function TennisPriceCell({ match, price, ui, slip }) {
11971
- const common = { matchId: match.matchId, tour: match.tour, price, ui, slip };
12030
+ const common = {
12031
+ matchId: match.matchId,
12032
+ tour: match.tour,
12033
+ price,
12034
+ ui,
12035
+ slip,
12036
+ pair: { home: match.homeTeamName, away: match.awayTeamName, kickoffUtc: match.kickoffUnix > 0 ? new Date(match.kickoffUnix * 1e3).toISOString() : null }
12037
+ };
11972
12038
  return /* @__PURE__ */ jsxs80("span", { className: "ss-w-trow-prices", children: [
11973
12039
  /* @__PURE__ */ jsx85(TennisSidePrice, { ...common, forms: price.p1, value: price.p1Value, oddsId: price.p1OddsId, player: match.homeTeamName }),
11974
12040
  /* @__PURE__ */ jsx85(TennisSidePrice, { ...common, forms: price.p2, value: price.p2Value, oddsId: price.p2OddsId, player: match.awayTeamName })
@@ -12176,7 +12242,7 @@ function WinnerPrice({ match, t, price, ui, slip }) {
12176
12242
  const liveBlock = t.live ?? null;
12177
12243
  const paused = !!liveBlock?.pricesPaused;
12178
12244
  const effective = price && paused ? { ...price, addToSlipEnabled: false } : price;
12179
- const common = effective ? { matchId: match.matchId, tour: t.header.tour, price: effective, ui, slip } : null;
12245
+ const common = effective ? { matchId: match.matchId, tour: t.header.tour, price: effective, ui, slip, pair: { home: t.p1.name, away: t.p2.name, kickoffUtc: t.header.startsAtUtc } } : null;
12180
12246
  const moved = price && (direction(price.p1Direction) || direction(price.p2Direction));
12181
12247
  const since = price?.previousAtUtc ? ui.bettingKickoff(price.previousAtUtc).dayLabel : null;
12182
12248
  const sides = price && common ? [
@@ -16773,8 +16839,8 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
16773
16839
  send(requestFor(next));
16774
16840
  }, [empty2, singles, widened, canWiden, view]);
16775
16841
  useEffect49(() => {
16776
- if (coolOff) onCoolOff?.();
16777
- }, [coolOff, onCoolOff]);
16842
+ if (coolOff) onCoolOff?.(sport);
16843
+ }, [coolOff, onCoolOff, sport]);
16778
16844
  if (coolOff) return null;
16779
16845
  const nextGames = preset.nextGames?.trim() || null;
16780
16846
  const nextAtMs = instantMs(preset.nextGamesAtUtc);
@@ -18471,7 +18537,10 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
18471
18537
  .ss-w-combo-leg-market { font-size: 11.5px; font-weight: 600; line-height: 1.25; color: var(--ss-w-faint); overflow-wrap: break-word; }
18472
18538
  .ss-w-combo-leg-sel { font-size: 13px; font-weight: 700; line-height: 1.2; color: var(--ss-w-ink); overflow-wrap: break-word; }
18473
18539
  .ss-w-combo-leg-price { flex: none; font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 800; line-height: 1.05; color: var(--ss-w-accent); }
18474
- .ss-w-combo-leg-pick .ss-w-slip { flex: none; }
18540
+ .ss-w-combo-leg-pick .ss-w-slip { display: contents; }
18541
+ .ss-w-combo-leg-pick .ss-w-slip-btn { flex: none; }
18542
+ .ss-w-combo-leg .ss-w-bi-team { white-space: normal; text-overflow: clip; overflow-wrap: break-word; line-height: 1.25; }
18543
+ .ss-w-combo-leg-pick .ss-w-toast { position: static; flex-basis: 100%; width: auto; max-width: none; box-shadow: none; }
18475
18544
  .ss-w-combo-leg-stat { font-size: 12px; line-height: 1.45; color: var(--ss-w-ink); background: var(--ss-w-bubble); border-radius: 8px; padding: 6px 9px; }
18476
18545
  .ss-w-combo-math { font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--ss-w-ink); text-align: right; background: color-mix(in srgb, var(--ss-w-accent) 9%, var(--ss-w-panel)); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; }
18477
18546
  .ss-w-combo-note { font-size: 11px; line-height: 1.4; color: var(--ss-w-faint); }
@@ -20809,17 +20878,26 @@ function StatsWidget(props) {
20809
20878
  () => [...controller.state.messages].reverse().find((m) => m.role === "assistant" && (m.greetingDashboard !== void 0 || m.greetingDashboards !== void 0)) ?? null,
20810
20879
  [controller.state.messages]
20811
20880
  );
20812
- const [coolOffGreeting, setCoolOffGreeting] = useState79(null);
20813
- const onBuilderCoolOff = useCallback27(() => setCoolOffGreeting(builderGreeting), [builderGreeting]);
20881
+ const [coolOff, setCoolOff] = useState79(null);
20882
+ const onBuilderCoolOff = useCallback27((sport) => {
20883
+ if (!builderGreeting) return;
20884
+ setCoolOff((prev) => {
20885
+ const sports = prev?.greeting === builderGreeting ? prev.sports : [];
20886
+ return sports.includes(sport) ? prev : { greeting: builderGreeting, sports: [...sports, sport] };
20887
+ });
20888
+ }, [builderGreeting]);
20814
20889
  const builderOptions = useMemo13(() => {
20815
20890
  const greeting = builderGreeting;
20816
- if (!greeting || greeting === coolOffGreeting) return [];
20891
+ if (!greeting) return [];
20892
+ const cooled = coolOff?.greeting === greeting ? coolOff.sports : [];
20817
20893
  const sets = switchSets(greeting.greetingDashboards);
20818
- if (sets) return sets.flatMap((s) => s.dashboard.personal?.builder ? [{ sport: s.sport, label: s.label, preset: s.dashboard.personal.builder }] : []);
20819
- const preset = greeting.greetingDashboard?.personal?.builder;
20820
- const sport = greeting.defaultSport || "football";
20821
- return preset ? [{ sport, label: sportLabel(ui, sport), preset }] : [];
20822
- }, [builderGreeting, coolOffGreeting, ui]);
20894
+ const options = sets ? sets.flatMap((s) => s.dashboard.personal?.builder ? [{ sport: s.sport, label: s.label, preset: s.dashboard.personal.builder }] : []) : (() => {
20895
+ const preset = greeting.greetingDashboard?.personal?.builder;
20896
+ const sport = greeting.defaultSport || "football";
20897
+ return preset ? [{ sport, label: sportLabel(ui, sport), preset }] : [];
20898
+ })();
20899
+ return options.filter((o) => !cooled.includes(o.sport));
20900
+ }, [builderGreeting, coolOff, ui]);
20823
20901
  const builderSport = [builderSportPick, rememberedSport, latestGreeting?.defaultSport].find((s) => !!s && builderOptions.some((o) => o.sport === s)) ?? builderOptions[0]?.sport ?? "";
20824
20902
  const [panelEverOpened, setPanelEverOpened] = useState79(panelOpen);
20825
20903
  if (panelOpen && !panelEverOpened) setPanelEverOpened(true);