@wral/hsot-data 0.2.0 → 0.3.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.
@@ -1,70 +1,33 @@
1
1
  import { LitElement as ie, html as n, css as $, nothing as p, svg as J } from "lit";
2
- const ye = 50;
3
- function $e(a = {}) {
4
- const e = Object.entries(a).filter(([, s]) => s != null && s !== "");
5
- if (!e.length) return "";
6
- const t = new URLSearchParams();
7
- return e.forEach(([s, o]) => t.set(s, String(o))), `?${t.toString()}`;
8
- }
9
- function we({ baseUrl: a, token: e = "", fetchFn: t } = {}) {
10
- if (!a) throw new Error("createClient requires a baseUrl");
11
- const s = a.replace(/\/+$/, ""), o = t || ((...i) => fetch(...i));
12
- async function r(i) {
13
- const h = { Accept: "application/json" };
14
- e && (h.Authorization = `Bearer ${e}`);
15
- const c = await o(`${s}${i}`, { headers: h });
16
- if (!c.ok) {
17
- const d = new Error(`api-hsot ${c.status} on ${i}`);
18
- throw d.status = c.status, d;
19
- }
20
- return c.json();
21
- }
22
- async function l(i, h = {}) {
23
- const c = [];
24
- let d = null;
25
- for (let m = 0; m < ye; m += 1) {
26
- const f = $e(d ? { ...h, cursor: d } : h), u = await r(`${i}${f}`);
27
- if (c.push(...u.items || []), d = u.nextCursor || null, !d) break;
28
- }
29
- return { items: c, total: c.length, nextCursor: null };
30
- }
31
- return {
32
- listSchools: (i) => l("/schools", i),
33
- getSchool: (i) => r(`/schools/${i}`),
34
- listTeams: (i) => l("/teams", i),
35
- getTeam: (i) => r(`/teams/${i}`),
36
- listConferences: (i) => l("/conferences", i),
37
- listPlayers: (i) => l("/players", i),
38
- listRosters: (i) => l("/rosters", i),
39
- listGames: (i) => l("/games", i),
40
- getGame: (i) => r(`/games/${i}`),
41
- listTournaments: (i) => l("/tournaments", i),
42
- listSeedings: (i, h) => l(`/tournaments/${i}/seedings`, h),
43
- listEdges: (i, h) => l(`/tournaments/${i}/edges`, h),
44
- listRankings: (i) => l("/rankings", i),
45
- listSports: () => r("/sports")
46
- };
47
- }
48
- const j = {
2
+ import { createClient as $e } from "./client.mjs";
3
+ const A = {
49
4
  game: "/{sport}/game/{id}/",
50
5
  school: "/school/{id}/",
51
- section: "/{sport}/{view}/"
6
+ section: "/{sport}/{view}/",
7
+ // The "Report a Score" page; {id} is the game being reported on, and
8
+ // reportHref() drops the parameter when there is none.
9
+ report: "/report-a-score/?game={id}"
52
10
  };
53
11
  function g(a, e) {
54
12
  return String(a).replace(/\{(\w+)\}/g, (t, s) => e[s] !== void 0 && e[s] !== null ? String(e[s]) : t);
55
13
  }
56
14
  function z(a) {
57
15
  return {
58
- game: a.getAttribute("game-href") || j.game,
59
- school: a.getAttribute("school-href") || j.school,
60
- section: a.getAttribute("section-href") || j.section
16
+ game: a.getAttribute("game-href") || A.game,
17
+ school: a.getAttribute("school-href") || A.school,
18
+ section: a.getAttribute("section-href") || A.section,
19
+ report: a.getAttribute("report-href") || A.report
61
20
  };
62
21
  }
22
+ function le(a, e = "") {
23
+ const t = g(a.report || A.report, { id: e || "" });
24
+ return e ? t : t.replace(/([?&])game=(?=&|$)/, "$1").replace(/[?&]$/, "").replace(/\?&/, "?");
25
+ }
63
26
  const B = (a) => a ? a.charAt(0).toUpperCase() + a.slice(1) : "";
64
27
  function w(a, e) {
65
28
  if (!a) return "TBD";
66
- const [t, s, o] = String(a).split("-").map(Number);
67
- return !t || !s || !o ? "TBD" : new Date(t, s - 1, o).toLocaleDateString("en-US", e || { weekday: "short", month: "short", day: "numeric" });
29
+ const [t, s, r] = String(a).split("-").map(Number);
30
+ return !t || !s || !r ? "TBD" : new Date(t, s - 1, r).toLocaleDateString("en-US", e || { weekday: "short", month: "short", day: "numeric" });
68
31
  }
69
32
  function q(a) {
70
33
  if (!a) return "";
@@ -73,13 +36,13 @@ function q(a) {
73
36
  const s = e >= 12 ? "PM" : "AM";
74
37
  return `${(e + 11) % 12 + 1}:${String(t || 0).padStart(2, "0")} ${s}`;
75
38
  }
76
- function xe(a) {
39
+ function we(a) {
77
40
  return a ? `${Math.floor(a / 12)}-${a % 12}` : "·";
78
41
  }
79
- function ke(a) {
42
+ function xe(a) {
80
43
  return (Array.isArray(a?.positions) ? a.positions : String(a?.position ?? "").split(/[/,]/)).map((t) => String(t ?? "").trim()).filter(Boolean).join("/");
81
44
  }
82
- function E(a = /* @__PURE__ */ new Date()) {
45
+ function _(a = /* @__PURE__ */ new Date()) {
83
46
  const e = a.getFullYear();
84
47
  return a.getMonth() >= 6 ? `${e}-${e + 1}` : `${e - 1}-${e}`;
85
48
  }
@@ -87,36 +50,36 @@ function W(a = /* @__PURE__ */ new Date()) {
87
50
  const e = (t) => String(t).padStart(2, "0");
88
51
  return `${a.getFullYear()}-${e(a.getMonth() + 1)}-${e(a.getDate())}`;
89
52
  }
90
- function Se(a, e = W()) {
53
+ function ke(a, e = W()) {
91
54
  const t = [...new Set((a || []).filter(Boolean))].sort();
92
55
  if (!t.length || t.includes(e)) return e;
93
- const s = t.filter((o) => o < e);
56
+ const s = t.filter((r) => r < e);
94
57
  return s.length ? s[s.length - 1] : t[0];
95
58
  }
96
59
  function V(a) {
97
60
  return a ? (a.abbr || a.name || "?").slice(0, 4).toUpperCase() : "?";
98
61
  }
99
- function N(a) {
62
+ function M(a) {
100
63
  if (!a || !/^#[0-9a-fA-F]{6}$/.test(a)) return "#FFFFFF";
101
- const e = parseInt(a.slice(1), 16), t = e >> 16 & 255, s = e >> 8 & 255, o = e & 255;
102
- return 0.299 * t + 0.587 * s + 0.114 * o > 150 ? "#0F1B33" : "#FFFFFF";
64
+ const e = parseInt(a.slice(1), 16), t = e >> 16 & 255, s = e >> 8 & 255, r = e & 255;
65
+ return 0.299 * t + 0.587 * s + 0.114 * r > 150 ? "#0F1B33" : "#FFFFFF";
103
66
  }
104
- const Ie = (a) => {
67
+ const Se = (a) => {
105
68
  const e = ["th", "st", "nd", "rd"], t = a % 100;
106
69
  return a + (e[(t - 20) % 10] || e[t] || e[0]);
107
70
  };
108
71
  function ee(a, e) {
109
- const t = (r) => {
110
- const l = /^\d+/.exec(String(r ?? ""));
72
+ const t = (o) => {
73
+ const l = /^\d+/.exec(String(o ?? ""));
111
74
  return l ? Number(l[0]) : null;
112
- }, s = t(a), o = t(e);
113
- return s !== null && o !== null && s !== o ? o - s : s !== null && o === null ? -1 : s === null && o !== null ? 1 : String(a ?? "").localeCompare(String(e ?? ""), "en", { sensitivity: "base" });
75
+ }, s = t(a), r = t(e);
76
+ return s !== null && r !== null && s !== r ? r - s : s !== null && r === null ? -1 : s === null && r !== null ? 1 : String(a ?? "").localeCompare(String(e ?? ""), "en", { sensitivity: "base" });
114
77
  }
115
- function Te(a, e) {
78
+ function Ie(a, e) {
116
79
  const t = (s) => String(s?.name ?? s ?? "");
117
80
  return t(a).localeCompare(t(e), "en", { numeric: !0, sensitivity: "base" });
118
81
  }
119
- function le(a) {
82
+ function ce(a) {
120
83
  if (a.state === "live") {
121
84
  const e = [a.period, a.clock].filter(Boolean).join(" ");
122
85
  return { kind: "live", label: e ? `Live · ${e}` : "Live" };
@@ -127,35 +90,35 @@ function le(a) {
127
90
  }
128
91
  return a.state === "postponed" ? { kind: "warn", label: "Postponed" } : a.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${w(a.date, { month: "short", day: "numeric" })} · ${q(a.time)}`.replace(/ · $/, "") };
129
92
  }
130
- const Ce = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
93
+ const Te = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
131
94
  function S(a) {
132
95
  let e = String(a || "").replace(/^[a-z][a-z0-9+.-]*:\/\/[^/#?]*/i, "");
133
96
  const t = e.indexOf("#");
134
97
  let s = "";
135
98
  t !== -1 && (s = e.slice(t).split("?")[0], e = e.slice(0, t));
136
- let o = e.split("?")[0] + s;
137
- return o = o.replace(/([^:])\/{2,}/g, "$1/").replace(/^\/{2,}/, "/"), o = o.replace(/^\/(?=#)/, ""), o.length > 1 && (o = o.replace(/\/+$/, "")), o.toLowerCase();
99
+ let r = e.split("?")[0] + s;
100
+ return r = r.replace(/([^:])\/{2,}/g, "$1/").replace(/^\/{2,}/, "/"), r = r.replace(/^\/(?=#)/, ""), r.length > 1 && (r = r.replace(/\/+$/, "")), r.toLowerCase();
138
101
  }
139
- function ce() {
102
+ function de() {
140
103
  const a = globalThis.location;
141
104
  if (!a) return "";
142
105
  const e = (a.hash || "").startsWith("#/") ? a.hash : "";
143
106
  return S((a.pathname || "") + e);
144
107
  }
145
- function De(a, e, t) {
108
+ function Ce(a, e, t) {
146
109
  if (!t) return null;
147
110
  const s = S(a);
148
111
  if (!s) return null;
149
- const o = S(g(e.game, { sport: t, id: "" })), r = S(g(e.school, { id: "" }));
150
- if (s === o || s.startsWith(`${o}/`) || s === r || s.startsWith(`${r}/`)) return null;
112
+ const r = S(g(e.game, { sport: t, id: "" })), o = S(g(e.school, { id: "" }));
113
+ if (s === r || s.startsWith(`${r}/`) || s === o || s.startsWith(`${o}/`)) return null;
151
114
  const l = S(g(e.section, { sport: t, view: "" }));
152
115
  if (s === l) return "";
153
116
  if (!s.startsWith(`${l}/`)) return null;
154
- const i = s.slice(l.length + 1), h = i.split("/");
155
- return h.length > 2 || h.some((c) => !/^[a-z][a-z-]*$/.test(c)) || Ce.has(h[0]) ? null : i;
117
+ const h = s.slice(l.length + 1), d = h.split("/");
118
+ return d.length > 2 || d.some((i) => !/^[a-z][a-z-]*$/.test(i)) || Te.has(d[0]) ? null : h;
156
119
  }
157
- function Be(a, e, t) {
158
- const s = (l) => g(t.section, { sport: a, view: l }).replace(/([^:])\/{2,}/g, "$1/"), r = new Set((e || []).map((l) => l && l.gender).filter((l) => l === "boys" || l === "girls")).size === 2 ? [
120
+ function De(a, e, t) {
121
+ const s = (l) => g(t.section, { sport: a, view: l }).replace(/([^:])\/{2,}/g, "$1/"), o = new Set((e || []).map((l) => l && l.gender).filter((l) => l === "boys" || l === "girls")).size === 2 ? [
159
122
  { label: "Boys Standings", href: s("boys/standings") },
160
123
  { label: "Girls Standings", href: s("girls/standings") }
161
124
  ] : [{ label: "Standings", href: s("standings") }];
@@ -163,11 +126,11 @@ function Be(a, e, t) {
163
126
  { label: `${B(a)} Home`, href: s("") },
164
127
  { label: "Scores/Schedule", href: s("scores") },
165
128
  { label: "Playoff Brackets", href: s("brackets") },
166
- ...r,
129
+ ...o,
167
130
  { label: "Polls & Rankings", href: s("rankings") }
168
131
  ];
169
132
  }
170
- function Fe(a, e = ce()) {
133
+ function Be(a, e = de()) {
171
134
  const t = S(e);
172
135
  for (const s of a.querySelectorAll(':scope > a[slot="nav"]'))
173
136
  t && S(s.getAttribute("href")) === t ? s.setAttribute("aria-current", "page") : s.removeAttribute("aria-current");
@@ -191,7 +154,7 @@ class y extends ie {
191
154
  this._client = e, this.isConnected && this.load();
192
155
  }
193
156
  get client() {
194
- return this._client ? this._client : this.api ? we({ baseUrl: this.api }) : null;
157
+ return this._client ? this._client : this.api ? $e({ baseUrl: this.api }) : null;
195
158
  }
196
159
  connectedCallback() {
197
160
  super.connectedCallback(), this._setupInterval();
@@ -203,7 +166,7 @@ class y extends ie {
203
166
  this.load();
204
167
  }
205
168
  updated(e) {
206
- e.has("api") && e.get("api") !== void 0 && e.get("api") !== this.api && this.load(), e.has("refreshInterval") && this._setupInterval(), Fe(this);
169
+ e.has("api") && e.get("api") !== void 0 && e.get("api") !== this.api && this.load(), e.has("refreshInterval") && this._setupInterval(), Be(this);
207
170
  }
208
171
  async load() {
209
172
  const e = this.client;
@@ -238,7 +201,7 @@ class y extends ie {
238
201
  return n``;
239
202
  }
240
203
  }
241
- const b = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), ze = $`
204
+ const b = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), Fe = $`
242
205
  :host {
243
206
  --hsot-red: var(--color-red, #D1232A);
244
207
  --hsot-red-deep: var(--color-red-dark, #951C21);
@@ -276,7 +239,7 @@ const b = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), ze = $`
276
239
  outline-offset: 1px;
277
240
  }
278
241
  .mut { color: var(--hsot-gray-5); }
279
- `, Pe = $`
242
+ `, ze = $`
280
243
  .band { background: var(--hsot-white); color: var(--hsot-black); }
281
244
  .band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
282
245
  .band h1, .band h2.bandtitle {
@@ -325,7 +288,7 @@ const b = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), ze = $`
325
288
  @media (max-width: 720px) {
326
289
  .band h1, .band h2.bandtitle, .band.section h1, .band.section h2.bandtitle { font-size: 1.8rem; }
327
290
  }
328
- `, Ae = $`
291
+ `, Pe = $`
329
292
  .view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
330
293
  /* Optional right rail (slot="rail" light-DOM children): a divided 300px
331
294
  column on desktop, stacked under the view content on smaller screens. */
@@ -389,7 +352,7 @@ const b = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), ze = $`
389
352
  .error { padding: 1.2rem 1rem; color: var(--hsot-red-deep); font-size: 0.9rem; }
390
353
  .note { font-size: 0.8125rem; color: var(--hsot-gray-5); margin: 0.6rem 0 0; }
391
354
  .loading { padding: 1.2rem; color: var(--hsot-gray-5); font-family: var(--hsot-heading-font); }
392
- `, Ee = $`
355
+ `, Ae = $`
393
356
  .pill {
394
357
  display: inline-block; font-family: var(--hsot-heading-font); font-weight: 700;
395
358
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
@@ -404,7 +367,7 @@ const b = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), ze = $`
404
367
  .pill.champ { background: var(--hsot-straw); color: #6b5900; }
405
368
  @keyframes hsot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
406
369
  @media (prefers-reduced-motion: reduce) { .pill.live { animation: none; } }
407
- `, _e = $`
370
+ `, Ee = $`
408
371
  .tablewrap { overflow-x: auto; }
409
372
  table.data { font-family: var(--hsot-heading-font); font-size: 14px; border-collapse: collapse; width: 100%; }
410
373
  table.data th {
@@ -422,7 +385,7 @@ const b = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), ze = $`
422
385
  table.data tbody tr.rowlink:hover { background: var(--hsot-gray-1); }
423
386
  table.data td.teamcell a { color: inherit; text-decoration: none; font-weight: 500; }
424
387
  table.data td.teamcell a:hover { text-decoration: underline; }
425
- `, Re = $`
388
+ `, _e = $`
426
389
  .swatch {
427
390
  display: inline-flex; align-items: center; justify-content: center;
428
391
  width: 26px; height: 26px; border-radius: 50%;
@@ -496,29 +459,29 @@ const b = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), ze = $`
496
459
  .gamelist .ff { color: var(--hsot-gray-5); font-size: 0.78rem; font-style: italic; }
497
460
  .gamelist .where { color: var(--hsot-gray-5); font-size: 0.78rem; }
498
461
  .gamelist a.box { font-size: 0.78rem; }
499
- `, P = [ze, Pe, Ae, Ee, _e, Re, Ne];
500
- function O(a) {
462
+ `, P = [Fe, ze, Pe, Ae, Ee, _e, Ne];
463
+ function H(a) {
501
464
  return a.state !== "final" ? null : a.forfeit === "home" ? "away" : a.forfeit === "away" || a.homeScore > a.awayScore ? "home" : a.awayScore > a.homeScore ? "away" : a.tiebreakWinner && a.tiebreakWinner !== "none" ? a.tiebreakWinner : "tie";
502
465
  }
503
- function Me(a) {
466
+ function Re(a) {
504
467
  return a && (a.forfeit === "home" || a.forfeit === "away") ? a.forfeit : null;
505
468
  }
506
- function _(a, e) {
507
- const t = {}, s = (r) => (t[r] = t[r] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, t[r]), o = a.filter((r) => r.state === "final" && r.gameType !== "scrimmage" && (!e || r.date <= e)).sort((r, l) => String(r.date).localeCompare(String(l.date)));
508
- for (const r of o) {
509
- const l = O(r), i = r.gameType === "conference";
510
- for (const h of ["home", "away"]) {
511
- const c = h === "home" ? r.homeTeamId : r.awayTeamId;
512
- if (!c) continue;
513
- const d = s(c), m = h === "home" ? r.homeScore : r.awayScore, f = h === "home" ? r.awayScore : r.homeScore;
514
- d.pf += m, d.pa += f;
469
+ function N(a, e) {
470
+ const t = {}, s = (o) => (t[o] = t[o] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, t[o]), r = a.filter((o) => o.state === "final" && o.gameType !== "scrimmage" && (!e || o.date <= e)).sort((o, l) => String(o.date).localeCompare(String(l.date)));
471
+ for (const o of r) {
472
+ const l = H(o), h = o.gameType === "conference";
473
+ for (const d of ["home", "away"]) {
474
+ const i = d === "home" ? o.homeTeamId : o.awayTeamId;
475
+ if (!i) continue;
476
+ const c = s(i), m = d === "home" ? o.homeScore : o.awayScore, f = d === "home" ? o.awayScore : o.homeScore;
477
+ c.pf += m, c.pa += f;
515
478
  let u = "T";
516
- l === "tie" ? (d.t += 1, i && (d.ct += 1)) : l === h ? (d.w += 1, i && (d.cw += 1), u = "W") : (d.l += 1, i && (d.cl += 1), u = "L"), d.results.push({ gameId: r.id, date: r.date, mark: u, my: m, their: f, opp: h === "home" ? r.awayTeamId : r.homeTeamId, conf: i });
479
+ l === "tie" ? (c.t += 1, h && (c.ct += 1)) : l === d ? (c.w += 1, h && (c.cw += 1), u = "W") : (c.l += 1, h && (c.cl += 1), u = "L"), c.results.push({ gameId: o.id, date: o.date, mark: u, my: m, their: f, opp: d === "home" ? o.awayTeamId : o.homeTeamId, conf: h });
517
480
  }
518
481
  }
519
482
  return t;
520
483
  }
521
- function H(a) {
484
+ function U(a) {
522
485
  if (!a || !a.length) return "";
523
486
  const e = a[a.length - 1].mark;
524
487
  let t = 0;
@@ -531,10 +494,10 @@ const te = (a, e, t) => {
531
494
  }, se = (a) => a.toFixed(3).replace("0.", ".");
532
495
  function k(a, e = !1) {
533
496
  if (!a) return "0-0";
534
- const t = e ? a.cw : a.w, s = e ? a.cl : a.l, o = e ? a.ct : a.t;
535
- return `${t}-${s}${o ? `-${o}` : ""}`;
497
+ const t = e ? a.cw : a.w, s = e ? a.cl : a.l, r = e ? a.ct : a.t;
498
+ return `${t}-${s}${r ? `-${r}` : ""}`;
536
499
  }
537
- function de(a, e) {
500
+ function he(a, e) {
538
501
  return a.map((t) => {
539
502
  const s = e[t.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] };
540
503
  return { team: t, rec: s, confPct: te(s.cw, s.cl, s.ct), overallPct: te(s.w, s.l, s.t) };
@@ -548,68 +511,68 @@ function ae(a, e) {
548
511
  return t && t.results.length ? t.results[t.results.length - 1] : null;
549
512
  }
550
513
  function $t(a, e, t, s = "") {
551
- let o = null;
552
- for (const r of a || [])
553
- r.sport === e && (t && r.effectiveDate > t || s && r.gender && r.gender !== s || (!o || r.effectiveDate > o.effectiveDate) && (o = r));
554
- return o;
555
- }
556
- function Q(a, e, t, s, o) {
557
- const r = e[t];
558
- if (!r) return null;
514
+ let r = null;
515
+ for (const o of a || [])
516
+ o.sport === e && (t && o.effectiveDate > t || s && o.gender && o.gender !== s || (!r || o.effectiveDate > r.effectiveDate) && (r = o));
517
+ return r;
518
+ }
519
+ function K(a, e, t, s, r) {
520
+ const o = e[t];
521
+ if (!o) return null;
559
522
  const l = /* @__PURE__ */ new Map();
560
- for (const h of a || []) {
561
- if (h.sport !== s || o && h.effectiveDate > o || h.gender && r.gender !== h.gender && r.gender !== "coed") continue;
562
- const c = h.gender || "", d = l.get(c);
563
- (!d || h.effectiveDate > d.effectiveDate) && l.set(c, h);
523
+ for (const d of a || []) {
524
+ if (d.sport !== s || r && d.effectiveDate > r || d.gender && o.gender !== d.gender && o.gender !== "coed") continue;
525
+ const i = d.gender || "", c = l.get(i);
526
+ (!c || d.effectiveDate > c.effectiveDate) && l.set(i, d);
564
527
  }
565
- let i = null;
566
- for (const h of l.values()) {
567
- const c = (h.teamIds || []).indexOf(t);
568
- c !== -1 && (!i || h.effectiveDate > i.effectiveDate) && (i = { poll: h, rank: c + 1 });
528
+ let h = null;
529
+ for (const d of l.values()) {
530
+ const i = (d.teamIds || []).indexOf(t);
531
+ i !== -1 && (!h || d.effectiveDate > h.effectiveDate) && (h = { poll: d, rank: i + 1 });
569
532
  }
570
- return i ? i.rank : null;
533
+ return h ? h.rank : null;
571
534
  }
572
- function Le(a, e, t) {
535
+ function Me(a, e, t) {
573
536
  if (!a) return { kind: "none", delta: 0 };
574
537
  const s = (a.teamIds || []).indexOf(t) + 1;
575
538
  if (!s) return { kind: "none", delta: 0 };
576
539
  if (!e) return { kind: "same", delta: 0 };
577
- const o = (e.teamIds || []).indexOf(t) + 1;
578
- if (!o) return { kind: "new", delta: 0 };
579
- const r = o - s;
580
- return r > 0 ? { kind: "up", delta: r } : r < 0 ? { kind: "down", delta: -r } : { kind: "same", delta: 0 };
540
+ const r = (e.teamIds || []).indexOf(t) + 1;
541
+ if (!r) return { kind: "new", delta: 0 };
542
+ const o = r - s;
543
+ return o > 0 ? { kind: "up", delta: o } : o < 0 ? { kind: "down", delta: -o } : { kind: "same", delta: 0 };
581
544
  }
582
- function Ge(a) {
545
+ function Le(a) {
583
546
  return /^https?:\/\//i.test(String(a || ""));
584
547
  }
585
- function he(a, { w: e, h: t } = {}) {
586
- if (!Ge(a)) return "";
548
+ function me(a, { w: e, h: t } = {}) {
549
+ if (!Le(a)) return "";
587
550
  const s = [];
588
551
  e && s.push(`w=${Math.max(1, Math.round(e))}`), t && s.push(`h=${Math.max(1, Math.round(t))}`), s.push("f=webp");
589
- const o = a.includes("?") ? "&" : "?";
590
- return `${a}${o}${s.join("&")}`;
552
+ const r = a.includes("?") ? "&" : "?";
553
+ return `${a}${r}${s.join("&")}`;
591
554
  }
592
- function M(a, e) {
555
+ function L(a, e) {
593
556
  const t = e * 2;
594
- return he(a?.logoAssetId, { w: t, h: t });
557
+ return me(a?.logoAssetId, { w: t, h: t });
595
558
  }
596
- function Oe(a, e) {
597
- return he(a?.photoAssetId, { w: e * 2 });
559
+ function Ge(a, e) {
560
+ return me(a?.photoAssetId, { w: e * 2 });
598
561
  }
599
- function U(a, e, { title: t, sub: s, teams: o }) {
600
- const r = ce(), i = !!a.querySelector(':scope > a[slot="nav"]') || De(r, e.hrefs, e.sport) !== null;
562
+ function j(a, e, { title: t, sub: s, teams: r }) {
563
+ const o = de(), h = !!a.querySelector(':scope > a[slot="nav"]') || Ce(o, e.hrefs, e.sport) !== null;
601
564
  return n`
602
565
  <div class="band section">
603
566
  <div class="inner">
604
567
  <h1>${t}</h1>
605
568
  ${s ? n`<p class="sub">${s}</p>` : p}
606
569
  </div>
607
- ${i ? n`
570
+ ${h ? n`
608
571
  <nav class="sectionnav" aria-label="${B(e.sport)} section">
609
572
  <div class="navrow">
610
573
  <slot name="nav">
611
- ${Be(e.sport, o, e.hrefs).map((h) => n`<a href=${h.href}
612
- aria-current=${r && S(h.href) === r ? "page" : p}>${h.label}</a>`)}
574
+ ${De(e.sport, r, e.hrefs).map((d) => n`<a href=${d.href}
575
+ aria-current=${o && S(d.href) === o ? "page" : p}>${d.label}</a>`)}
613
576
  </slot>
614
577
  </div>
615
578
  </nav>` : p}
@@ -619,34 +582,34 @@ function U(a, e, { title: t, sub: s, teams: o }) {
619
582
  const I = (a, e) => {
620
583
  const t = a.teamsById[e];
621
584
  return t ? a.schoolsById[t.schoolId] : null;
622
- }, F = (a, e) => I(a, e)?.name || "TBD", L = (a, e) => I(a, e)?.abbr || "TBD";
585
+ }, F = (a, e) => I(a, e)?.name || "TBD", G = (a, e) => I(a, e)?.abbr || "TBD";
623
586
  function T(a, e = 26) {
624
587
  if (!a) return p;
625
- const t = M(a, e);
588
+ const t = L(a, e);
626
589
  if (t)
627
590
  return n`<img class="swatch logo" aria-hidden="true" alt="" loading="lazy"
628
591
  src=${t} style="width:${e}px;height:${e}px" />`;
629
- const s = a.colorPrimary || "#030711", o = N(s);
592
+ const s = a.colorPrimary || "#030711", r = M(s);
630
593
  return n`<span class="swatch" aria-hidden="true"
631
- style="width:${e}px;height:${e}px;background:${s};color:${o};font-size:${Math.max(8, e * 0.28)}px"
594
+ style="width:${e}px;height:${e}px;background:${s};color:${r};font-size:${Math.max(8, e * 0.28)}px"
632
595
  >${V(a)}</span>`;
633
596
  }
634
- function K(a, e, t) {
635
- const s = Q(a.rankings, a.teamsById, e, a.sport, t);
597
+ function Q(a, e, t) {
598
+ const s = K(a.rankings, a.teamsById, e, a.sport, t);
636
599
  return s ? n`<span class="rankbadge">#${s}</span>` : p;
637
600
  }
638
- function G(a, e, t) {
601
+ function O(a, e, t) {
639
602
  const s = I(a, e);
640
- return s ? n`${K(a, e, t)}<a href=${g(a.hrefs.school, { id: s.id })}>${s.name}</a>` : n`<span class="mut">TBD</span>`;
603
+ return s ? n`${Q(a, e, t)}<a href=${g(a.hrefs.school, { id: s.id })}>${s.name}</a>` : n`<span class="mut">TBD</span>`;
641
604
  }
642
605
  function X(a, e, t = 5) {
643
606
  const s = a.records[e];
644
607
  if (!s || !s.results.length) return n`<span class="mut">·</span>`;
645
- const o = s.results.slice(-1 * t);
646
- return n`<span class="dots" role="img" aria-label="last ${o.length} results">
647
- ${o.map((r) => n`<a class="dot ${r.mark}"
648
- title="${r.mark} ${r.my}-${r.their} vs ${F(a, r.opp)}"
649
- href=${g(a.hrefs.game, { sport: a.sport, id: r.gameId })}>${r.mark}</a>`)}
608
+ const r = s.results.slice(-1 * t);
609
+ return n`<span class="dots" role="img" aria-label="last ${r.length} results">
610
+ ${r.map((o) => n`<a class="dot ${o.mark}"
611
+ title="${o.mark} ${o.my}-${o.their} vs ${F(a, o.opp)}"
612
+ href=${g(a.hrefs.game, { sport: a.sport, id: o.gameId })}>${o.mark}</a>`)}
650
613
  </span>`;
651
614
  }
652
615
  function C(a, e) {
@@ -660,16 +623,16 @@ function D(a) {
660
623
  const e = n`<img src=${a.promoImage} alt=${a.promoAlt || "Sponsor"}>`;
661
624
  return n`<div class="promo">${a.promoHref ? n`<a href=${a.promoHref} target="_blank" rel="sponsored noopener">${e}</a>` : e}</div>`;
662
625
  }
663
- function A(a) {
664
- const e = le(a);
626
+ function E(a) {
627
+ const e = ce(a);
665
628
  return n`<span class="pill ${e.kind}">${e.label}</span>`;
666
629
  }
667
- function me(a, e, t) {
630
+ function pe(a, e, t) {
668
631
  if (!e) return n`<span class="mut">·</span>`;
669
- const s = e.homeTeamId === t ? e.awayTeamId : e.homeTeamId, o = e.homeTeamId === t ? "vs" : "at";
670
- return n`${e.state === "live" ? n`<span class="pill live">Live</span> ` : n`${w(e.date, { month: "numeric", day: "numeric" })} `}${o} ${L(a, s)}`;
632
+ const s = e.homeTeamId === t ? e.awayTeamId : e.homeTeamId, r = e.homeTeamId === t ? "vs" : "at";
633
+ return n`${e.state === "live" ? n`<span class="pill live">Live</span> ` : n`${w(e.date, { month: "numeric", day: "numeric" })} `}${r} ${G(a, s)}`;
671
634
  }
672
- class He extends y {
635
+ class Oe extends y {
673
636
  static styles = P;
674
637
  static properties = {
675
638
  ...y.properties,
@@ -688,44 +651,44 @@ class He extends y {
688
651
  this._datePinned = !!this.date;
689
652
  }
690
653
  async fetchData(e) {
691
- const t = this.season || E(), [s, o, r, l, i] = await Promise.all([
654
+ const t = this.season || _(), [s, r, o, l, h] = await Promise.all([
692
655
  e.listSchools(),
693
656
  e.listTeams({ sport: this.sport }),
694
657
  e.listConferences(),
695
658
  e.listGames({ sport: this.sport, season: t }),
696
659
  e.listRankings({ sport: this.sport })
697
660
  ]);
698
- return this._datePinned || (this.date = Se(l.items.map((h) => h.date)), this._datePinned = !0), {
661
+ return this._datePinned || (this.date = ke(l.items.map((d) => d.date)), this._datePinned = !0), {
699
662
  season: t,
700
663
  schools: s.items,
701
- teams: o.items,
702
- conferences: r.items,
664
+ teams: r.items,
665
+ conferences: o.items,
703
666
  games: l.items,
704
- rankings: i.items
667
+ rankings: h.items
705
668
  };
706
669
  }
707
670
  get ctx() {
708
671
  return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
709
672
  teamsById: b(this.data.teams),
710
673
  schoolsById: b(this.data.schools),
711
- records: _(this.data.games),
674
+ records: N(this.data.games),
712
675
  rankings: this.data.rankings,
713
676
  hrefs: z(this),
714
677
  sport: this.sport
715
678
  }, this._ctxData = this.data), this._ctx;
716
679
  }
717
680
  renderView() {
718
- const e = this.ctx, t = b(this.data.conferences), s = [...new Set(this.data.games.map((c) => c.date).filter(Boolean))].sort(), o = Number.MAX_SAFE_INTEGER, r = (c) => {
719
- const d = [c.awayTeamId, c.homeTeamId].map((m) => Q(e.rankings, e.teamsById, m, this.sport, c.date)).filter(Boolean);
720
- return d.length ? Math.min(...d) : o;
721
- }, l = this.data.games.filter((c) => c.date === this.date), i = new Map(l.map((c) => [c, r(c)]));
722
- l.sort((c, d) => (c.state === "live" ? 0 : 1) - (d.state === "live" ? 0 : 1) || i.get(c) - i.get(d));
723
- const h = /* @__PURE__ */ new Map();
724
- return l.forEach((c) => {
725
- const d = c.gameType === "conference" && c.conferenceId ? t[c.conferenceId]?.name || "Conference" : c.gameType === "playoff" ? "Playoffs" : c.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
726
- h.has(d) || h.set(d, []), h.get(d).push(c);
681
+ const e = this.ctx, t = b(this.data.conferences), s = [...new Set(this.data.games.map((i) => i.date).filter(Boolean))].sort(), r = Number.MAX_SAFE_INTEGER, o = (i) => {
682
+ const c = [i.awayTeamId, i.homeTeamId].map((m) => K(e.rankings, e.teamsById, m, this.sport, i.date)).filter(Boolean);
683
+ return c.length ? Math.min(...c) : r;
684
+ }, l = this.data.games.filter((i) => i.date === this.date), h = new Map(l.map((i) => [i, o(i)]));
685
+ l.sort((i, c) => (i.state === "live" ? 0 : 1) - (c.state === "live" ? 0 : 1) || h.get(i) - h.get(c));
686
+ const d = /* @__PURE__ */ new Map();
687
+ return l.forEach((i) => {
688
+ const c = i.gameType === "conference" && i.conferenceId ? t[i.conferenceId]?.name || "Conference" : i.gameType === "playoff" ? "Playoffs" : i.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
689
+ d.has(c) || d.set(c, []), d.get(c).push(i);
727
690
  }), n`
728
- ${U(this, e, {
691
+ ${j(this, e, {
729
692
  title: n`${B(this.sport)} scores &amp; schedules`,
730
693
  sub: n`${w(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${l.length} games`,
731
694
  teams: this.data.teams
@@ -734,11 +697,11 @@ class He extends y {
734
697
  ${D(this)}
735
698
  <div class="toolbar">
736
699
  <label class="asof" for="datesel">Date</label>
737
- <select id="datesel" @change=${(c) => {
738
- this.date = c.target.value;
700
+ <select id="datesel" @change=${(i) => {
701
+ this.date = i.target.value;
739
702
  }}>
740
- ${(s.includes(this.date) ? s : [...s, this.date].sort()).map((c) => n`<option value=${c} ?selected=${c === this.date}>
741
- ${w(c, { weekday: "short", month: "short", day: "numeric" })}${c === W() ? " · today" : ""}
703
+ ${(s.includes(this.date) ? s : [...s, this.date].sort()).map((i) => n`<option value=${i} ?selected=${i === this.date}>
704
+ ${w(i, { weekday: "short", month: "short", day: "numeric" })}${i === W() ? " · today" : ""}
742
705
  </option>`)}
743
706
  </select>
744
707
  <button class="chip" ?disabled=${s.indexOf(this.date) <= 0}
@@ -750,13 +713,13 @@ class He extends y {
750
713
  this.date = s[s.indexOf(this.date) + 1];
751
714
  }}>Next →</button>
752
715
  <span class="spacer"></span>
753
- <span class="asof">Live games first · report a score to see it update here</span>
716
+ <span class="asof">Live games first · <a href=${le(e.hrefs)}>report a score</a> to see it update here</span>
754
717
  </div>
755
718
  ${l.length ? p : n`<p class="empty">No ${this.sport} games on this date.</p>`}
756
- ${[...h.entries()].map(([c, d]) => n`
757
- <div class="section-title">${c}</div>
719
+ ${[...d.entries()].map(([i, c]) => n`
720
+ <div class="section-title">${i}</div>
758
721
  <div class="card"><ul class="gamelist">
759
- ${d.map((m) => this.renderGame(e, m))}
722
+ ${c.map((m) => this.renderGame(e, m))}
760
723
  </ul></div>
761
724
  `)}
762
725
  `)}
@@ -766,12 +729,12 @@ class He extends y {
766
729
  // a lone score column on the far right read as detached from the teams).
767
730
  // Scheduled games carry their start time on the status pill alone.
768
731
  renderGame(e, t) {
769
- const s = t.state === "final" || t.state === "live", o = (l, i, h = p) => n`<span class="side">${G(e, l, t.date)}${s ? n`<span class="score">${i}</span>` : p}${h}</span>`, r = Me(t);
732
+ const s = t.state === "final" || t.state === "live", r = (l, h, d = p) => n`<span class="side">${O(e, l, t.date)}${s ? n`<span class="score">${h}</span>` : p}${d}</span>`, o = Re(t);
770
733
  return n`
771
734
  <li>
772
- ${A(t)}
773
- <span class="opp matchup">${o(t.awayTeamId, t.awayScore, n`<span class="at">at</span>`)}${o(t.homeTeamId, t.homeScore)}</span>
774
- ${r ? n`<span class="ff">${F(e, r === "home" ? t.homeTeamId : t.awayTeamId)} forfeited</span>` : p}
735
+ ${E(t)}
736
+ <span class="opp matchup">${r(t.awayTeamId, t.awayScore, n`<span class="at">at</span>`)}${r(t.homeTeamId, t.homeScore)}</span>
737
+ ${o ? n`<span class="ff">${F(e, o === "home" ? t.homeTeamId : t.awayTeamId)} forfeited</span>` : p}
775
738
  <span class="where">${t.venue || ""}</span>
776
739
  ${t.broadcast ? n`<span class="pill class">${t.broadcast}</span>` : p}
777
740
  <a class="box" href=${g(e.hrefs.game, { sport: this.sport, id: t.id })}>Box score →</a>
@@ -779,8 +742,8 @@ class He extends y {
779
742
  `;
780
743
  }
781
744
  }
782
- globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", He);
783
- class Ue extends y {
745
+ globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", Oe);
746
+ class He extends y {
784
747
  static styles = P;
785
748
  static properties = {
786
749
  ...y.properties,
@@ -793,7 +756,7 @@ class Ue extends y {
793
756
  super(), this.sport = "football", this.season = "", this.classFilter = "All", this.query = "";
794
757
  }
795
758
  async fetchData(e) {
796
- const t = this.season || E(), [s, o, r, l, i] = await Promise.all([
759
+ const t = this.season || _(), [s, r, o, l, h] = await Promise.all([
797
760
  e.listConferences({ active: !0 }),
798
761
  e.listSchools(),
799
762
  e.listTeams({ sport: this.sport }),
@@ -803,26 +766,26 @@ class Ue extends y {
803
766
  return {
804
767
  season: t,
805
768
  conferences: s.items,
806
- schools: o.items,
807
- teams: r.items,
769
+ schools: r.items,
770
+ teams: o.items,
808
771
  games: l.items,
809
- rankings: i.items
772
+ rankings: h.items
810
773
  };
811
774
  }
812
775
  get ctx() {
813
776
  return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
814
777
  teamsById: b(this.data.teams),
815
778
  schoolsById: b(this.data.schools),
816
- records: _(this.data.games),
779
+ records: N(this.data.games),
817
780
  rankings: this.data.rankings,
818
781
  hrefs: z(this),
819
782
  sport: this.sport
820
783
  }, this._ctxData = this.data), this._ctx;
821
784
  }
822
785
  renderView() {
823
- const e = this.ctx, t = ["All", ...[...new Set(this.data.conferences.flatMap((o) => o.classifications || []))].sort(ee)].slice(0, 9), s = this.data.conferences.filter((o) => o.active !== !1).filter((o) => this.classFilter === "All" || (o.classifications || []).includes(this.classFilter)).sort(Te);
786
+ const e = this.ctx, t = ["All", ...[...new Set(this.data.conferences.flatMap((r) => r.classifications || []))].sort(ee)].slice(0, 9), s = this.data.conferences.filter((r) => r.active !== !1).filter((r) => this.classFilter === "All" || (r.classifications || []).includes(this.classFilter)).sort(Ie);
824
787
  return n`
825
- ${U(this, e, {
788
+ ${j(this, e, {
826
789
  title: n`${B(this.sport)} standings`,
827
790
  sub: n`${this.data.season} season · every conference, computed live from reported results`,
828
791
  teams: this.data.teams
@@ -831,32 +794,32 @@ class Ue extends y {
831
794
  ${D(this)}
832
795
  <div class="toolbar">
833
796
  <div role="group" aria-label="Classification filter">
834
- ${t.map((o) => n`<button class="chip ${this.classFilter === o ? "on" : ""}"
797
+ ${t.map((r) => n`<button class="chip ${this.classFilter === r ? "on" : ""}"
835
798
  @click=${() => {
836
- this.classFilter = o;
837
- }}>${o}</button>`)}
799
+ this.classFilter = r;
800
+ }}>${r}</button>`)}
838
801
  </div>
839
802
  <input type="search" placeholder="Find a school…" aria-label="Find a school"
840
- .value=${this.query} @input=${(o) => {
841
- this.query = o.target.value;
803
+ .value=${this.query} @input=${(r) => {
804
+ this.query = r.target.value;
842
805
  }}>
843
806
  <span class="spacer"></span>
844
807
  <span class="asof">Records through ${w(W(), { month: "long", day: "numeric" })} · conference games count toward both records · scrimmages toward neither</span>
845
808
  </div>
846
- ${s.map((o) => this.renderConference(e, o))}
809
+ ${s.map((r) => this.renderConference(e, r))}
847
810
  `)}
848
811
  `;
849
812
  }
850
813
  renderConference(e, t) {
851
814
  const s = this.data.teams.filter((l) => l.conferenceId === t.id);
852
815
  if (!s.length) return p;
853
- const o = this.query.trim().toLowerCase(), r = de(s, e.records);
816
+ const r = this.query.trim().toLowerCase(), o = he(s, e.records);
854
817
  return n`
855
818
  <div class="card">
856
819
  <div class="card-head">
857
820
  <h2>${t.name}</h2>
858
821
  ${[...t.classifications || []].sort(ee).map((l) => n`<span class="pill class">${l}</span>`)}
859
- <span class="meta">${r.length} teams · membership derives from teams</span>
822
+ <span class="meta">${o.length} teams · membership derives from teams</span>
860
823
  </div>
861
824
  <div class="tablewrap"><table class="data">
862
825
  <thead><tr>
@@ -865,25 +828,25 @@ class Ue extends y {
865
828
  <th>Streak</th><th>Last 5</th><th>Next</th>
866
829
  </tr></thead>
867
830
  <tbody>
868
- ${r.map((l, i) => this.renderRow(e, l, i, o))}
831
+ ${o.map((l, h) => this.renderRow(e, l, h, r))}
869
832
  </tbody>
870
833
  </table></div>
871
834
  </div>
872
835
  `;
873
836
  }
874
- renderRow(e, t, s, o) {
875
- const r = e.schoolsById[t.team.schoolId], l = r?.name || t.team.name || "TBD";
876
- if (o && !l.toLowerCase().includes(o)) return p;
877
- const i = t.rec.pf - t.rec.pa, h = Y(this.data.games, t.team.id), c = () => {
837
+ renderRow(e, t, s, r) {
838
+ const o = e.schoolsById[t.team.schoolId], l = o?.name || t.team.name || "TBD";
839
+ if (r && !l.toLowerCase().includes(r)) return p;
840
+ const h = t.rec.pf - t.rec.pa, d = Y(this.data.games, t.team.id), i = () => {
878
841
  location.href = g(e.hrefs.school, { id: t.team.schoolId });
879
842
  };
880
843
  return n`
881
- <tr class="rowlink" @click=${(d) => {
882
- d.target.closest("a") || c();
844
+ <tr class="rowlink" @click=${(c) => {
845
+ c.target.closest("a") || i();
883
846
  }}>
884
847
  <td class="mut">${s + 1}</td>
885
848
  <td class="teamcell">
886
- ${T(r)}${K(e, t.team.id, null)}
849
+ ${T(o)}${Q(e, t.team.id, null)}
887
850
  <a href=${g(e.hrefs.school, { id: t.team.schoolId })}>${l}</a>
888
851
  </td>
889
852
  <td class="num">${k(t.rec, !0)}</td>
@@ -892,16 +855,16 @@ class Ue extends y {
892
855
  <td class="num">${se(t.overallPct)}</td>
893
856
  <td class="num">${t.rec.pf}</td>
894
857
  <td class="num">${t.rec.pa}</td>
895
- <td class="num" style="color:${i >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${i > 0 ? "+" : ""}${i}</td>
896
- <td>${H(t.rec.results) || "·"}</td>
858
+ <td class="num" style="color:${h >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${h > 0 ? "+" : ""}${h}</td>
859
+ <td>${U(t.rec.results) || "·"}</td>
897
860
  <td>${X(e, t.team.id)}</td>
898
- <td>${me(e, h, t.team.id)}</td>
861
+ <td>${pe(e, d, t.team.id)}</td>
899
862
  </tr>
900
863
  `;
901
864
  }
902
865
  }
903
- globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", Ue);
904
- const je = $`
866
+ globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", He);
867
+ const Ue = $`
905
868
  .hero1 {
906
869
  border-radius: var(--hsot-radius-md); color: var(--hsot-white);
907
870
  padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.2rem;
@@ -918,8 +881,8 @@ const je = $`
918
881
  .delta.new { background: var(--hsot-straw); color: #6b5900; border-radius: var(--hsot-radius-xs); padding: 0.1rem 0.3rem; font-size: 0.7rem; }
919
882
  .sparkline { vertical-align: middle; }
920
883
  `;
921
- class qe extends y {
922
- static styles = [...P, je];
884
+ class je extends y {
885
+ static styles = [...P, Ue];
923
886
  static properties = {
924
887
  ...y.properties,
925
888
  sport: { type: String },
@@ -936,60 +899,60 @@ class qe extends y {
936
899
  e && (this.pollDate = e);
937
900
  }
938
901
  async fetchData(e) {
939
- const t = this.season || E(), [s, o, r, l, i] = await Promise.all([
902
+ const t = this.season || _(), [s, r, o, l, h] = await Promise.all([
940
903
  e.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
941
904
  e.listSchools(),
942
905
  e.listTeams({ sport: this.sport }),
943
906
  e.listConferences(),
944
907
  e.listGames({ sport: this.sport, season: t })
945
- ]), h = s.items.filter((c) => !this.gender || !c.gender || c.gender === this.gender).sort((c, d) => d.effectiveDate.localeCompare(c.effectiveDate));
908
+ ]), d = s.items.filter((i) => !this.gender || !i.gender || i.gender === this.gender).sort((i, c) => c.effectiveDate.localeCompare(i.effectiveDate));
946
909
  return {
947
910
  season: t,
948
- polls: h,
949
- schools: o.items,
950
- teams: r.items,
911
+ polls: d,
912
+ schools: r.items,
913
+ teams: o.items,
951
914
  conferences: l.items,
952
- games: i.items
915
+ games: h.items
953
916
  };
954
917
  }
955
918
  get ctx() {
956
919
  return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
957
920
  teamsById: b(this.data.teams),
958
921
  schoolsById: b(this.data.schools),
959
- records: _(this.data.games),
922
+ records: N(this.data.games),
960
923
  rankings: this.data.polls,
961
924
  hrefs: z(this),
962
925
  sport: this.sport
963
926
  }, this._ctxData = this.data), this._ctx;
964
927
  }
965
928
  sparkline(e, t, s) {
966
- const i = t.map((m, f) => {
929
+ const h = t.map((m, f) => {
967
930
  const u = (m.teamIds || []).indexOf(e);
968
931
  if (u === -1) return null;
969
932
  const v = t.length === 1 ? 96 / 2 : f / (t.length - 1) * 90 + 3, x = 3 + u / 24 * 20;
970
933
  return { x: v, y: x };
971
- }), h = [];
972
- let c = [];
973
- if (i.forEach((m) => {
974
- m ? c.push(m) : c.length && (h.push(c), c = []);
975
- }), c.length && h.push(c), !h.length) return p;
976
- const d = i[s];
934
+ }), d = [];
935
+ let i = [];
936
+ if (h.forEach((m) => {
937
+ m ? i.push(m) : i.length && (d.push(i), i = []);
938
+ }), i.length && d.push(i), !d.length) return p;
939
+ const c = h[s];
977
940
  return n`<svg class="sparkline" width=${96} height=${26} viewBox="0 0 ${96} ${26}" role="img" aria-label="rank history">
978
- ${h.map((m) => J`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
941
+ ${d.map((m) => J`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
979
942
  points=${m.map((f) => `${f.x.toFixed(1)},${f.y.toFixed(1)}`).join(" ")}></polyline>`)}
980
- ${d ? J`<circle cx=${d.x.toFixed(1)} cy=${d.y.toFixed(1)} r="3" fill="var(--hsot-black)"></circle>` : p}
943
+ ${c ? J`<circle cx=${c.x.toFixed(1)} cy=${c.y.toFixed(1)} r="3" fill="var(--hsot-black)"></circle>` : p}
981
944
  </svg>`;
982
945
  }
983
946
  movement(e, t, s) {
984
- const o = Le(e, t, s);
985
- return o.kind === "up" ? n`<span class="delta up">▲ ${o.delta}</span>` : o.kind === "down" ? n`<span class="delta down">▼ ${o.delta}</span>` : o.kind === "new" ? n`<span class="delta new">NEW</span>` : o.kind === "same" ? n`<span class="delta same">—</span>` : n`<span class="delta same">·</span>`;
947
+ const r = Me(e, t, s);
948
+ return r.kind === "up" ? n`<span class="delta up">▲ ${r.delta}</span>` : r.kind === "down" ? n`<span class="delta down">▼ ${r.delta}</span>` : r.kind === "new" ? n`<span class="delta new">NEW</span>` : r.kind === "same" ? n`<span class="delta same">—</span>` : n`<span class="delta same">·</span>`;
986
949
  }
987
950
  renderView() {
988
951
  const e = this.ctx, t = this.data.polls;
989
952
  if (!t.length) return n`<div class="view"><p class="empty">No ${this.sport} polls published yet this season.</p></div>`;
990
- const s = Math.max(0, t.findIndex((m) => m.effectiveDate === this.pollDate)), o = t[s] || t[0], r = t[s + 1] || null, l = t.slice().reverse(), i = l.indexOf(o), h = b(this.data.conferences), c = (o.teamIds || [])[0], d = c ? I(e, c) : null;
953
+ const s = Math.max(0, t.findIndex((m) => m.effectiveDate === this.pollDate)), r = t[s] || t[0], o = t[s + 1] || null, l = t.slice().reverse(), h = l.indexOf(r), d = b(this.data.conferences), i = (r.teamIds || [])[0], c = i ? I(e, i) : null;
991
954
  return n`
992
- ${U(this, e, {
955
+ ${j(this, e, {
993
956
  title: n`${B(this.sport)} Top 25`,
994
957
  sub: n`The HighSchoolOT poll · updated weekly · ${t.length} polls this season`,
995
958
  teams: this.data.teams
@@ -1001,7 +964,7 @@ class qe extends y {
1001
964
  <select id="pollsel" @change=${(m) => {
1002
965
  this.pollDate = m.target.value;
1003
966
  }}>
1004
- ${t.map((m, f) => n`<option value=${m.effectiveDate} ?selected=${m === o}>
967
+ ${t.map((m, f) => n`<option value=${m.effectiveDate} ?selected=${m === r}>
1005
968
  ${w(m.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${f === 0 ? " · current" : ""}
1006
969
  </option>`)}
1007
970
  </select>
@@ -1016,65 +979,65 @@ class qe extends y {
1016
979
  <span class="spacer"></span>
1017
980
  <span class="asof">Movement vs. the previous poll · sparkline = season rank history</span>
1018
981
  </div>
1019
- ${d ? this.renderHero(e, o, r, c, d, h) : p}
982
+ ${c ? this.renderHero(e, r, o, i, c, d) : p}
1020
983
  <div class="card"><div class="tablewrap"><table class="data">
1021
984
  <thead><tr>
1022
985
  <th class="num">Rk</th><th>Mvmt</th><th>Team</th><th class="num">Record</th>
1023
986
  <th>Conference</th><th>Last result</th><th>Next</th><th>Season</th>
1024
987
  </tr></thead>
1025
988
  <tbody>
1026
- ${(o.teamIds || []).map((m, f) => f === 0 || !m ? p : this.renderRow(e, o, r, l, i, h, m, f + 1))}
989
+ ${(r.teamIds || []).map((m, f) => f === 0 || !m ? p : this.renderRow(e, r, o, l, h, d, m, f + 1))}
1027
990
  </tbody>
1028
991
  </table></div></div>
1029
992
  <p class="note">Ranks elsewhere on the site resolve the poll in effect on the game date, so past box scores keep the ranks they were played under.</p>
1030
993
  `)}
1031
994
  `;
1032
995
  }
1033
- renderHero(e, t, s, o, r, l) {
1034
- const i = e.records[o], h = ae(e.records, o), c = l[e.teamsById[o]?.conferenceId], d = `linear-gradient(120deg, ${r.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
996
+ renderHero(e, t, s, r, o, l) {
997
+ const h = e.records[r], d = ae(e.records, r), i = l[e.teamsById[r]?.conferenceId], c = `linear-gradient(120deg, ${o.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
1035
998
  return n`
1036
- <div class="hero1" style="background:${d}">
999
+ <div class="hero1" style="background:${c}">
1037
1000
  <div class="bigrank">#1</div>
1038
- ${T(r, 64)}
1001
+ ${T(o, 64)}
1039
1002
  <div>
1040
- <h2><a href=${g(e.hrefs.school, { id: r.id })}>${r.name} ${r.mascot || ""}</a></h2>
1003
+ <h2><a href=${g(e.hrefs.school, { id: o.id })}>${o.name} ${o.mascot || ""}</a></h2>
1041
1004
  <div class="facts">
1042
- ${k(i)} overall${c ? n` · ${k(i, !0)} ${c.name}` : p}
1043
- · streak ${H(i?.results) || "·"}
1044
- ${h ? n` · last: ${h.mark} ${h.my}-${h.their} vs ${L(e, h.opp)}` : p}
1045
- &nbsp;${this.movement(t, s, o)}
1005
+ ${k(h)} overall${i ? n` · ${k(h, !0)} ${i.name}` : p}
1006
+ · streak ${U(h?.results) || "·"}
1007
+ ${d ? n` · last: ${d.mark} ${d.my}-${d.their} vs ${G(e, d.opp)}` : p}
1008
+ &nbsp;${this.movement(t, s, r)}
1046
1009
  </div>
1047
1010
  </div>
1048
1011
  </div>
1049
1012
  `;
1050
1013
  }
1051
- renderRow(e, t, s, o, r, l, i, h) {
1052
- const c = I(e, i);
1053
- if (!c) return p;
1054
- const d = e.records[i], m = ae(e.records, i), f = Y(this.data.games, i), u = l[e.teamsById[i]?.conferenceId], v = () => {
1055
- location.href = g(e.hrefs.school, { id: c.id });
1014
+ renderRow(e, t, s, r, o, l, h, d) {
1015
+ const i = I(e, h);
1016
+ if (!i) return p;
1017
+ const c = e.records[h], m = ae(e.records, h), f = Y(this.data.games, h), u = l[e.teamsById[h]?.conferenceId], v = () => {
1018
+ location.href = g(e.hrefs.school, { id: i.id });
1056
1019
  };
1057
1020
  return n`
1058
1021
  <tr class="rowlink" @click=${(x) => {
1059
1022
  x.target.closest("a") || v();
1060
1023
  }}>
1061
- <td class="num" style="font-weight:700">${h}</td>
1062
- <td>${this.movement(t, s, i)}</td>
1063
- <td class="teamcell">${T(c)}<a href=${g(e.hrefs.school, { id: c.id })}>${c.name}</a>
1064
- <span class="mut" style="font-size:0.78rem">${c.mascot || ""}</span></td>
1065
- <td class="num">${k(d)}</td>
1024
+ <td class="num" style="font-weight:700">${d}</td>
1025
+ <td>${this.movement(t, s, h)}</td>
1026
+ <td class="teamcell">${T(i)}<a href=${g(e.hrefs.school, { id: i.id })}>${i.name}</a>
1027
+ <span class="mut" style="font-size:0.78rem">${i.mascot || ""}</span></td>
1028
+ <td class="num">${k(c)}</td>
1066
1029
  <td class="mut">${u?.name || "Independent"}</td>
1067
1030
  <td>${m ? n`<a class="box" style="text-decoration:none" href=${g(e.hrefs.game, { sport: this.sport, id: m.gameId })}>
1068
1031
  <b style="color:${m.mark === "W" ? "var(--hsot-win)" : m.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${m.mark}</b>
1069
- ${m.my}-${m.their} vs ${L(e, m.opp)}</a>` : n`<span class="mut">·</span>`}</td>
1070
- <td>${me(e, f, i)}</td>
1071
- <td>${this.sparkline(i, o, r)}</td>
1032
+ ${m.my}-${m.their} vs ${G(e, m.opp)}</a>` : n`<span class="mut">·</span>`}</td>
1033
+ <td>${pe(e, f, h)}</td>
1034
+ <td>${this.sparkline(h, r, o)}</td>
1072
1035
  </tr>
1073
1036
  `;
1074
1037
  }
1075
1038
  }
1076
- globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", qe);
1077
- const We = $`
1039
+ globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", je);
1040
+ const qe = $`
1078
1041
  .schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
1079
1042
  .schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
1080
1043
  .schoolhero .crest {
@@ -1128,8 +1091,8 @@ const We = $`
1128
1091
  table.data.roster .sub { display: block; font-weight: 400; font-size: 0.78rem; color: var(--hsot-gray-5); }
1129
1092
  }
1130
1093
  `;
1131
- class Ve extends y {
1132
- static styles = [...P, We];
1094
+ class We extends y {
1095
+ static styles = [...P, qe];
1133
1096
  static properties = {
1134
1097
  ...y.properties,
1135
1098
  schoolId: { type: String, attribute: "school-id" },
@@ -1146,7 +1109,7 @@ class Ve extends y {
1146
1109
  e && !this.sport && (this.sport = e);
1147
1110
  }
1148
1111
  async fetchData(e) {
1149
- const t = this.season || E(), s = await e.getSchool(this.schoolId), r = (await e.listTeams({ schoolId: this.schoolId })).items, l = r.find((v) => v.sport === (this.sport || "football")) || r[0] || null, [i, h, c, d, m, f, u] = await Promise.all([
1112
+ const t = this.season || _(), s = await e.getSchool(this.schoolId), o = (await e.listTeams({ schoolId: this.schoolId })).items, l = o.find((v) => v.sport === (this.sport || "football")) || o[0] || null, [h, d, i, c, m, f, u] = await Promise.all([
1150
1113
  l ? e.listGames({ sport: l.sport, season: t }) : Promise.resolve({ items: [] }),
1151
1114
  l ? e.listTeams({ sport: l.sport }) : Promise.resolve({ items: [] }),
1152
1115
  e.listSchools(),
@@ -1160,12 +1123,12 @@ class Ve extends y {
1160
1123
  return {
1161
1124
  season: t,
1162
1125
  school: s,
1163
- teams: r,
1126
+ teams: o,
1164
1127
  active: l,
1165
- games: i.items,
1166
- allTeams: h.items,
1167
- schools: c.items,
1168
- conferences: d.items,
1128
+ games: h.items,
1129
+ allTeams: d.items,
1130
+ schools: i.items,
1131
+ conferences: c.items,
1169
1132
  rankings: m.items,
1170
1133
  roster: f.items.find((v) => v.season === t) || null,
1171
1134
  players: u.items
@@ -1175,7 +1138,7 @@ class Ve extends y {
1175
1138
  return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
1176
1139
  teamsById: b(this.data.allTeams.length ? this.data.allTeams : this.data.teams),
1177
1140
  schoolsById: b(this.data.schools),
1178
- records: _(this.data.games),
1141
+ records: N(this.data.games),
1179
1142
  rankings: this.data.rankings,
1180
1143
  hrefs: z(this),
1181
1144
  sport: this.data.active?.sport || "football"
@@ -1185,20 +1148,20 @@ class Ve extends y {
1185
1148
  this.sport = e, this.load();
1186
1149
  }
1187
1150
  renderView() {
1188
- const { school: e, teams: t, active: s, season: o } = this.data;
1151
+ const { school: e, teams: t, active: s, season: r } = this.data;
1189
1152
  if (!e) return n`<div class="view"><p class="empty">School not found.</p></div>`;
1190
- const r = this.ctx, l = N(e.colorPrimary || "#030711"), i = (e.adm || [])[0], h = b(this.data.conferences), c = s ? h[s.conferenceId] : null;
1153
+ const o = this.ctx, l = M(e.colorPrimary || "#030711"), h = (e.adm || [])[0], d = b(this.data.conferences), i = s ? d[s.conferenceId] : null;
1191
1154
  return n`
1192
1155
  <div class="schoolhero" style="background:linear-gradient(115deg, ${e.colorPrimary || "#030711"} 0%, ${e.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${l}">
1193
1156
  <div class="inner">
1194
- ${M(e, 84) ? n`<img class="crest logo" alt="" loading="lazy" src=${M(e, 84)} />` : n`<div class="crest" style="background:${e.colorSecondary || "#7C7C7C"};color:${N(e.colorSecondary || "#7C7C7C")}">${V(e)}</div>`}
1157
+ ${L(e, 84) ? n`<img class="crest logo" alt="" loading="lazy" src=${L(e, 84)} />` : n`<div class="crest" style="background:${e.colorSecondary || "#7C7C7C"};color:${M(e.colorSecondary || "#7C7C7C")}">${V(e)}</div>`}
1195
1158
  <div style="min-width:260px">
1196
1159
  <h1>${e.name} <span class="mascot">${e.mascot || ""}</span></h1>
1197
1160
  <div class="facts">
1198
1161
  ${e.location ? n`<span><b>Location</b>${e.location}${e.county ? n` · ${e.county} County` : p}</span>` : p}
1199
1162
  ${e.association ? n`<span><b>League</b>${e.association}${e.classification ? n` · ${e.classification}` : p}</span>` : p}
1200
- ${c ? n`<span><b>Conference</b>${c.name}</span>` : p}
1201
- ${i ? n`<span><b>Enrollment</b>${i.value.toLocaleString()} (${i.season} ADM)</span>` : p}
1163
+ ${i ? n`<span><b>Conference</b>${i.name}</span>` : p}
1164
+ ${h ? n`<span><b>Enrollment</b>${h.value.toLocaleString()} (${h.season} ADM)</span>` : p}
1202
1165
  ${e.openingYear ? n`<span><b>Opened</b>${e.openingYear}</span>` : p}
1203
1166
  ${e.areaCode ? n`<span><b>Area</b>${e.areaCode}</span>` : p}
1204
1167
  </div>
@@ -1207,29 +1170,29 @@ class Ve extends y {
1207
1170
  </div>
1208
1171
  <div class="band">
1209
1172
  <nav class="tabs" aria-label="Teams">
1210
- ${t.map((d) => d.id === s?.id ? n`<a class="on" href="#" @click=${(m) => m.preventDefault()}>${d.name}</a>` : n`<a href="#" @click=${(m) => {
1211
- m.preventDefault(), this.switchSport(d.sport);
1212
- }}>${d.name}</a>`)}
1173
+ ${t.map((c) => c.id === s?.id ? n`<a class="on" href="#" @click=${(m) => m.preventDefault()}>${c.name}</a>` : n`<a href="#" @click=${(m) => {
1174
+ m.preventDefault(), this.switchSport(c.sport);
1175
+ }}>${c.name}</a>`)}
1213
1176
  </nav>
1214
1177
  </div>
1215
1178
  ${C(this, n`
1216
1179
  ${D(this)}
1217
- ${s ? this.renderTeam(r, s, c, o) : n`<p class="empty">No teams recorded for this school yet.</p>`}
1180
+ ${s ? this.renderTeam(o, s, i, r) : n`<p class="empty">No teams recorded for this school yet.</p>`}
1218
1181
  `)}
1219
1182
  `;
1220
1183
  }
1221
- renderTeam(e, t, s, o) {
1222
- const r = e.records[t.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, l = r.w + r.l + r.t, i = s ? this.data.allTeams.filter((m) => m.conferenceId === s.id) : [], h = s ? de(i, e.records).findIndex((m) => m.team.id === t.id) + 1 : 0, c = Q(e.rankings, e.teamsById, t.id, t.sport, null), d = this.data.games.filter((m) => m.homeTeamId === t.id || m.awayTeamId === t.id).sort((m, f) => String(m.date).localeCompare(String(f.date)));
1184
+ renderTeam(e, t, s, r) {
1185
+ const o = e.records[t.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, l = o.w + o.l + o.t, h = s ? this.data.allTeams.filter((m) => m.conferenceId === s.id) : [], d = s ? he(h, e.records).findIndex((m) => m.team.id === t.id) + 1 : 0, i = K(e.rankings, e.teamsById, t.id, t.sport, null), c = this.data.games.filter((m) => m.homeTeamId === t.id || m.awayTeamId === t.id).sort((m, f) => String(m.date).localeCompare(String(f.date)));
1223
1186
  return n`
1224
1187
  <div class="tiles">
1225
- <div class="tile"><div class="k">Overall</div><div class="v">${k(r)}</div><div class="s">${l} games played</div></div>
1226
- <div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${k(r, !0)}</div>
1227
- <div class="s">${h ? `${Ie(h)} of ${i.length}` : "·"}</div></div>
1228
- <div class="tile"><div class="k">Points</div><div class="v">${l ? (r.pf / l).toFixed(1) : "0.0"}</div>
1229
- <div class="s">scored per game · ${l ? (r.pa / l).toFixed(1) : "0.0"} allowed</div></div>
1230
- <div class="tile"><div class="k">Streak</div><div class="v">${H(r.results) || "·"}</div>
1188
+ <div class="tile"><div class="k">Overall</div><div class="v">${k(o)}</div><div class="s">${l} games played</div></div>
1189
+ <div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${k(o, !0)}</div>
1190
+ <div class="s">${d ? `${Se(d)} of ${h.length}` : "·"}</div></div>
1191
+ <div class="tile"><div class="k">Points</div><div class="v">${l ? (o.pf / l).toFixed(1) : "0.0"}</div>
1192
+ <div class="s">scored per game · ${l ? (o.pa / l).toFixed(1) : "0.0"} allowed</div></div>
1193
+ <div class="tile"><div class="k">Streak</div><div class="v">${U(o.results) || "·"}</div>
1231
1194
  <div class="s">last 5: ${X(e, t.id)}</div></div>
1232
- <div class="tile"><div class="k">HSOT Top 25</div><div class="v">${c ? `#${c}` : "NR"}</div>
1195
+ <div class="tile"><div class="k">HSOT Top 25</div><div class="v">${i ? `#${i}` : "NR"}</div>
1233
1196
  <div class="s"><a href=${g(e.hrefs.section, { sport: t.sport, view: "rankings" })}>full poll</a></div></div>
1234
1197
  </div>
1235
1198
  ${(t.championships || []).length ? n`
@@ -1240,31 +1203,31 @@ class Ve extends y {
1240
1203
  <div>
1241
1204
  <div class="section-title">Schedule &amp; results</div>
1242
1205
  <div class="card">
1243
- ${d.length ? n`<ul class="gamelist">${d.map((m) => this.renderGameRow(e, t, m))}</ul>` : n`<p class="empty">No ${t.sport} games recorded for ${o}.</p>`}
1206
+ ${c.length ? n`<ul class="gamelist">${c.map((m) => this.renderGameRow(e, t, m))}</ul>` : n`<p class="empty">No ${t.sport} games recorded for ${r}.</p>`}
1244
1207
  </div>
1245
1208
  </div>
1246
1209
  <div>
1247
- <div class="section-title">Roster · ${o}</div>
1248
- <div class="card">${this.renderRoster(t, o)}</div>
1210
+ <div class="section-title">Roster · ${r}</div>
1211
+ <div class="card">${this.renderRoster(t, r)}</div>
1249
1212
  </div>
1250
1213
  </div>
1251
1214
  `;
1252
1215
  }
1253
1216
  renderGameRow(e, t, s) {
1254
- const o = s.homeTeamId === t.id, r = o ? s.awayTeamId : s.homeTeamId, l = o ? s.homeScore : s.awayScore, i = o ? s.awayScore : s.homeScore;
1255
- let h = n`<span class="mut">${q(s.time)}</span>`;
1217
+ const r = s.homeTeamId === t.id, o = r ? s.awayTeamId : s.homeTeamId, l = r ? s.homeScore : s.awayScore, h = r ? s.awayScore : s.homeScore;
1218
+ let d = n`<span class="mut">${q(s.time)}</span>`;
1256
1219
  if (s.state === "final") {
1257
- const d = O(s), m = d === "tie" ? "T" : d === (o ? "home" : "away") ? "W" : "L";
1258
- h = n`<span class=${m}>${m}</span> ${l}-${i}${s.finish === "overtime" ? n` <span class="mut">OT</span>` : p}${s.forfeit && s.forfeit !== "none" ? n` <span class="mut">FF</span>` : p}`;
1259
- } else s.state === "live" && (h = n`<span style="color:var(--hsot-red)">${l}-${i}</span>`);
1260
- const c = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
1220
+ const c = H(s), m = c === "tie" ? "T" : c === (r ? "home" : "away") ? "W" : "L";
1221
+ d = n`<span class=${m}>${m}</span> ${l}-${h}${s.finish === "overtime" ? n` <span class="mut">OT</span>` : p}${s.forfeit && s.forfeit !== "none" ? n` <span class="mut">FF</span>` : p}`;
1222
+ } else s.state === "live" && (d = n`<span style="color:var(--hsot-red)">${l}-${h}</span>`);
1223
+ const i = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
1261
1224
  return n`
1262
1225
  <li>
1263
1226
  <span class="d">${w(s.date)}</span>
1264
- ${le(s).kind === "sched" ? p : A(s)}
1265
- <span class="res">${h}</span>
1266
- <span class="opp">${o ? "vs" : "at"} ${G(e, r, s.date)}
1267
- <span class="pill type">${c}</span>
1227
+ ${ce(s).kind === "sched" ? p : E(s)}
1228
+ <span class="res">${d}</span>
1229
+ <span class="opp">${r ? "vs" : "at"} ${O(e, o, s.date)}
1230
+ <span class="pill type">${i}</span>
1268
1231
  ${s.broadcast ? n`<span class="pill class">${s.broadcast}</span>` : p}
1269
1232
  </span>
1270
1233
  <span class="where">${s.venue || ""}</span>
@@ -1276,25 +1239,25 @@ class Ve extends y {
1276
1239
  const s = this.data.roster;
1277
1240
  if (!s)
1278
1241
  return n`<p class="empty">Roster not published for ${t}.</p>`;
1279
- const o = Oe(s, 560), r = this.data.school?.name || "", l = b(this.data.players), i = s.entries.slice().sort((c, d) => (c.number || 0) - (d.number || 0)), h = i.some((c) => l[c.playerId]?.college);
1242
+ const r = Ge(s, 560), o = this.data.school?.name || "", l = b(this.data.players), h = s.entries.slice().sort((i, c) => (i.number || 0) - (c.number || 0)), d = h.some((i) => l[i.playerId]?.college);
1280
1243
  return n`
1281
- ${o ? n`<img class="rosterphoto" src=${o} loading="lazy" decoding="async"
1282
- alt="${r} ${e.name} ${t} team photo" />` : p}
1244
+ ${r ? n`<img class="rosterphoto" src=${r} loading="lazy" decoding="async"
1245
+ alt="${o} ${e.name} ${t} team photo" />` : p}
1283
1246
  <div class="tablewrap"><table class="data roster">
1284
- <thead><tr><th class="num">No.</th><th>Player</th><th class="pos">Pos</th><th class="cls">Class</th><th class="num">Ht</th><th class="num">Wt</th>${h ? n`<th>College</th>` : p}</tr></thead>
1247
+ <thead><tr><th class="num">No.</th><th>Player</th><th class="pos">Pos</th><th class="cls">Class</th><th class="num">Ht</th><th class="num">Wt</th>${d ? n`<th>College</th>` : p}</tr></thead>
1285
1248
  <tbody>
1286
- ${i.map((c) => {
1287
- const d = l[c.playerId];
1288
- if (!d) return p;
1289
- const m = ke(c), f = [m, d.classOf].filter(Boolean).join(" · ") || "·";
1249
+ ${h.map((i) => {
1250
+ const c = l[i.playerId];
1251
+ if (!c) return p;
1252
+ const m = xe(i), f = [m, c.classOf].filter(Boolean).join(" · ") || "·";
1290
1253
  return n`<tr>
1291
- <td class="num mut">${c.number ?? "·"}</td>
1292
- <td class="player" style="font-weight:500">${d.firstName} ${d.lastName}<span class="sub">${f}</span></td>
1254
+ <td class="num mut">${i.number ?? "·"}</td>
1255
+ <td class="player" style="font-weight:500">${c.firstName} ${c.lastName}<span class="sub">${f}</span></td>
1293
1256
  <td class="pos">${m || "·"}</td>
1294
- <td class="cls mut">${d.classOf || "·"}</td>
1295
- <td class="num">${xe(d.heightIn)}</td>
1296
- <td class="num">${d.weightLb || "·"}</td>
1297
- ${h ? n`<td class="college">${d.college || "·"}</td>` : p}
1257
+ <td class="cls mut">${c.classOf || "·"}</td>
1258
+ <td class="num">${we(c.heightIn)}</td>
1259
+ <td class="num">${c.weightLb || "·"}</td>
1260
+ ${d ? n`<td class="college">${c.college || "·"}</td>` : p}
1298
1261
  </tr>`;
1299
1262
  })}
1300
1263
  </tbody>
@@ -1302,8 +1265,8 @@ class Ve extends y {
1302
1265
  `;
1303
1266
  }
1304
1267
  }
1305
- globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", Ve);
1306
- const pe = {
1268
+ globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", We);
1269
+ const fe = {
1307
1270
  football: ["quarters", 4],
1308
1271
  flag_football: ["quarters", 4],
1309
1272
  basketball: ["quarters", 4],
@@ -1314,22 +1277,22 @@ const pe = {
1314
1277
  softball: ["innings", 7],
1315
1278
  volleyball: ["sets", 3]
1316
1279
  };
1317
- function fe(a) {
1318
- return (pe[a] || ["quarters", 4])[0];
1280
+ function ue(a) {
1281
+ return (fe[a] || ["quarters", 4])[0];
1319
1282
  }
1320
1283
  function Z(a) {
1321
- return (pe[a] || ["quarters", 4])[1];
1284
+ return (fe[a] || ["quarters", 4])[1];
1322
1285
  }
1323
- function Ye(a, e) {
1324
- const t = fe(a), s = Z(a);
1286
+ function Ve(a, e) {
1287
+ const t = ue(a), s = Z(a);
1325
1288
  if (e <= s || t === "innings" || t === "sets") return String(e);
1326
- const o = e - s;
1327
- return `OT${o > 1 ? o : ""}`;
1289
+ const r = e - s;
1290
+ return `OT${r > 1 ? r : ""}`;
1328
1291
  }
1329
- function Qe(a, e) {
1292
+ function Ye(a, e) {
1330
1293
  const t = String(a ?? "").trim();
1331
1294
  let s;
1332
- return (s = /^(\d+)Q$/i.exec(t)) || (s = /^(\d+)H$/i.exec(t)) ? Number(s[1]) : /^half$/i.test(t) ? fe(e) === "halves" ? 1 : 2 : (s = /^(\d*)OT(\d*)$/i.exec(t)) ? Z(e) + Number(s[1] || s[2] || 1) : (s = /^[TB](\d+)$/i.exec(t)) || (s = /^(\d+)(?:st|nd|rd|th)\s*set$/i.exec(t)) || (s = /^set\s*(\d+)$/i.exec(t)) ? Number(s[1]) : null;
1295
+ return (s = /^(\d+)Q$/i.exec(t)) || (s = /^(\d+)H$/i.exec(t)) ? Number(s[1]) : /^half$/i.test(t) ? ue(e) === "halves" ? 1 : 2 : (s = /^(\d*)OT(\d*)$/i.exec(t)) ? Z(e) + Number(s[1] || s[2] || 1) : (s = /^[TB](\d+)$/i.exec(t)) || (s = /^(\d+)(?:st|nd|rd|th)\s*set$/i.exec(t)) || (s = /^set\s*(\d+)$/i.exec(t)) ? Number(s[1]) : null;
1333
1296
  }
1334
1297
  const R = (a) => Number.isInteger(a) && a >= 0 ? a : null;
1335
1298
  function Ke(a) {
@@ -1337,34 +1300,34 @@ function Ke(a) {
1337
1300
  if (!e.length) return null;
1338
1301
  const t = a.sport, s = /* @__PURE__ */ new Map();
1339
1302
  for (const m of e) {
1340
- const f = Qe(m?.period, t), u = R(m?.homeScore), v = R(m?.awayScore);
1303
+ const f = Ye(m?.period, t), u = R(m?.homeScore), v = R(m?.awayScore);
1341
1304
  if (!f || u === null || v === null) return null;
1342
1305
  const x = s.get(f) || { home: 0, away: 0 };
1343
1306
  x.home = Math.max(x.home, u), x.away = Math.max(x.away, v), s.set(f, x);
1344
1307
  }
1345
- const o = Math.max(...s.keys()), r = [];
1346
- let l = !0, i = { home: 0, away: 0 };
1347
- for (let m = 1; m <= o; m += 1) {
1348
- const f = s.get(m) || i, u = f.home - i.home, v = f.away - i.away;
1349
- (u < 0 || v < 0) && (l = !1), r.push({ period: m, home: Math.max(u, 0), away: Math.max(v, 0) }), i = { home: Math.max(f.home, i.home), away: Math.max(f.away, i.away) };
1308
+ const r = Math.max(...s.keys()), o = [];
1309
+ let l = !0, h = { home: 0, away: 0 };
1310
+ for (let m = 1; m <= r; m += 1) {
1311
+ const f = s.get(m) || h, u = f.home - h.home, v = f.away - h.away;
1312
+ (u < 0 || v < 0) && (l = !1), o.push({ period: m, home: Math.max(u, 0), away: Math.max(v, 0) }), h = { home: Math.max(f.home, h.home), away: Math.max(f.away, h.away) };
1350
1313
  }
1351
- const h = R(a.homeScore) ?? 0, c = R(a.awayScore) ?? 0, d = l && i.home === h && i.away === c;
1352
- return l = l && i.home <= h && i.away <= c, { periods: r, reconciled: d, consistent: l };
1314
+ const d = R(a.homeScore) ?? 0, i = R(a.awayScore) ?? 0, c = l && h.home === d && h.away === i;
1315
+ return l = l && h.home <= d && h.away <= i, { periods: o, reconciled: c, consistent: l };
1353
1316
  }
1354
- function Xe(a) {
1317
+ function Qe(a) {
1355
1318
  if (Array.isArray(a?.periodScores) && a.periodScores.length) return a.periodScores;
1356
1319
  const e = Ke(a);
1357
1320
  return e ? a.state === "final" ? e.reconciled ? e.periods : null : e.consistent ? e.periods : null : null;
1358
1321
  }
1359
- const Ze = "https://api.wral.com/search";
1360
- function Je(a) {
1322
+ const Xe = "https://api.wral.com/search";
1323
+ function Ze(a) {
1361
1324
  return a.map((e) => `uri:"${e}"`).join(" OR ");
1362
1325
  }
1363
- function et(a, e) {
1364
- const t = String(a || Ze).replace(/\/+$/, ""), s = new URLSearchParams({ query: Je(e), sort: "score", lang: "en" });
1326
+ function Je(a, e) {
1327
+ const t = String(a || Xe).replace(/\/+$/, ""), s = new URLSearchParams({ query: Ze(e), sort: "score", lang: "en" });
1365
1328
  return `${t}/v1/query?${s}`;
1366
1329
  }
1367
- function ue(a) {
1330
+ function ge(a) {
1368
1331
  try {
1369
1332
  const e = new URL(a);
1370
1333
  if (/(^|\.)smugmug\.com$/i.test(e.hostname)) {
@@ -1379,13 +1342,13 @@ function ue(a) {
1379
1342
  }
1380
1343
  return { uri: a, title: a };
1381
1344
  }
1382
- async function tt(a, e, t) {
1383
- const o = await ((...i) => fetch(...i))(et(a, e));
1384
- if (!o.ok) throw new Error(`search answered ${o.status}`);
1385
- const r = await o.json(), l = new Map((r.items || []).map((i) => [i.uri, i]));
1386
- return e.map((i) => l.get(i) || ue(i));
1345
+ async function et(a, e, t) {
1346
+ const r = await ((...h) => fetch(...h))(Je(a, e));
1347
+ if (!r.ok) throw new Error(`search answered ${r.status}`);
1348
+ const o = await r.json(), l = new Map((o.items || []).map((h) => [h.uri, h]));
1349
+ return e.map((h) => l.get(h) || ge(h));
1387
1350
  }
1388
- const st = $`
1351
+ const tt = $`
1389
1352
  .breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
1390
1353
  .breadcrumbs a { text-decoration: none; }
1391
1354
  .scorehead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 1.4rem 1rem; }
@@ -1428,6 +1391,9 @@ const st = $`
1428
1391
  table.plays-table td.play { white-space: normal; min-width: 12rem; }
1429
1392
  /* Game notes are typed with line breaks the desk means to keep. */
1430
1393
  .gamenote { padding: 0 1rem 0.9rem; text-align: center; white-space: pre-line; }
1394
+ /* The embed's way out to everything it drops (Coverage, season context,
1395
+ head to head) — the data page still renders all of it. */
1396
+ .fullbox { margin: 0.9rem 0 0; text-align: center; font-size: 0.875rem; }
1431
1397
  .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
1432
1398
  .ctxcard { padding: 0.85rem 1rem; }
1433
1399
  .ctxcard .who { font-family: var(--hsot-heading-font); font-weight: 700; margin-bottom: 0.4rem; }
@@ -1438,8 +1404,8 @@ const st = $`
1438
1404
  .cols { grid-template-columns: 1fr; }
1439
1405
  }
1440
1406
  `;
1441
- class at extends y {
1442
- static styles = [...P, st];
1407
+ class st extends y {
1408
+ static styles = [...P, tt];
1443
1409
  static properties = {
1444
1410
  ...y.properties,
1445
1411
  gameId: { type: String, attribute: "game-id" },
@@ -1447,13 +1413,19 @@ class at extends y {
1447
1413
  // (DEV-1236). Shared cross-stage by design — see the studio host's
1448
1414
  // registry — so the prod default is right everywhere; the attribute
1449
1415
  // exists for the same reason the href templates do.
1450
- searchApi: { type: String, attribute: "search-api" }
1416
+ searchApi: { type: String, attribute: "search-api" },
1417
+ // Story pages embed the box score in the article column, where the page
1418
+ // chrome (breadcrumbs, the report-a-score line) and the cross-links
1419
+ // (Coverage, Season context, head-to-head) belong to the data page, not
1420
+ // the recap. `embed` keeps the score head, line score and scoring plays,
1421
+ // and links out to the full box score for the rest.
1422
+ embed: { type: Boolean }
1451
1423
  };
1452
1424
  constructor() {
1453
- super(), this.gameId = "", this.searchApi = "";
1425
+ super(), this.gameId = "", this.searchApi = "", this.embed = !1;
1454
1426
  }
1455
1427
  async fetchData(e) {
1456
- const t = await e.getGame(this.gameId), s = Array.isArray(t.coverageUrls) ? t.coverageUrls : [], [o, r, l, i, h, c] = await Promise.all([
1428
+ const t = await e.getGame(this.gameId), s = Array.isArray(t.coverageUrls) ? t.coverageUrls : [], [r, o, l, h, d, i] = await Promise.all([
1457
1429
  e.listSchools(),
1458
1430
  e.listTeams({ sport: t.sport }),
1459
1431
  e.listConferences(),
@@ -1461,23 +1433,25 @@ class at extends y {
1461
1433
  e.listGames({ sport: t.sport, season: t.season }),
1462
1434
  // A search outage must not blank the box score — degrade to bare
1463
1435
  // links (fetchCoverage already degrades per-URL index misses).
1464
- s.length ? tt(this.searchApi, s).catch(() => s.map(ue)) : Promise.resolve([])
1436
+ // The embed drops the Coverage grid, so it skips the search
1437
+ // round-trip entirely rather than fetching cards it will not render.
1438
+ s.length && !this.embed ? et(this.searchApi, s).catch(() => s.map(ge)) : Promise.resolve([])
1465
1439
  ]);
1466
1440
  return {
1467
1441
  game: t,
1468
- schools: o.items,
1469
- teams: r.items,
1442
+ schools: r.items,
1443
+ teams: o.items,
1470
1444
  conferences: l.items,
1471
- rankings: i.items,
1472
- games: h.items,
1473
- coverage: c
1445
+ rankings: h.items,
1446
+ games: d.items,
1447
+ coverage: i
1474
1448
  };
1475
1449
  }
1476
1450
  get ctx() {
1477
1451
  return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
1478
1452
  teamsById: b(this.data.teams),
1479
1453
  schoolsById: b(this.data.schools),
1480
- records: _(this.data.games),
1454
+ records: N(this.data.games),
1481
1455
  rankings: this.data.rankings,
1482
1456
  hrefs: z(this),
1483
1457
  sport: this.data.game.sport
@@ -1486,50 +1460,59 @@ class at extends y {
1486
1460
  renderView() {
1487
1461
  const e = this.data.game;
1488
1462
  if (!e) return n`<div class="view"><p class="empty">Game not found.</p></div>`;
1489
- const t = this.ctx, s = b(this.data.conferences), o = t.teamsById[e.awayTeamId] ? t.schoolsById[t.teamsById[e.awayTeamId].schoolId] : null, r = t.teamsById[e.homeTeamId] ? t.schoolsById[t.teamsById[e.homeTeamId].schoolId] : null, l = O(e), i = (d) => e.state === "final" && l !== d && l !== "tie" ? "opacity:0.45" : "", h = e.conferenceId ? s[e.conferenceId] : null, c = this.data.games.filter((d) => d.id !== e.id && d.state === "final" && d.gameType !== "scrimmage" && (d.homeTeamId === e.homeTeamId && d.awayTeamId === e.awayTeamId || d.homeTeamId === e.awayTeamId && d.awayTeamId === e.homeTeamId));
1463
+ const t = this.ctx, s = b(this.data.conferences), r = t.teamsById[e.awayTeamId] ? t.schoolsById[t.teamsById[e.awayTeamId].schoolId] : null, o = t.teamsById[e.homeTeamId] ? t.schoolsById[t.teamsById[e.homeTeamId].schoolId] : null, l = H(e), h = (c) => e.state === "final" && l !== c && l !== "tie" ? "opacity:0.45" : "", d = e.conferenceId ? s[e.conferenceId] : null, i = this.data.games.filter((c) => c.id !== e.id && c.state === "final" && c.gameType !== "scrimmage" && (c.homeTeamId === e.homeTeamId && c.awayTeamId === e.awayTeamId || c.homeTeamId === e.awayTeamId && c.awayTeamId === e.homeTeamId));
1490
1464
  return n`
1491
1465
  ${C(this, n`
1492
1466
  ${D(this)}
1493
- <p class="breadcrumbs">
1494
- <a href=${g(t.hrefs.section, { sport: e.sport, view: "scores" })}>${B(e.sport)}</a> /
1495
- <a href=${g(t.hrefs.section, { sport: e.sport, view: "scores" })}>Scores/Schedules</a> /
1496
- ${F(t, e.awayTeamId)} at ${F(t, e.homeTeamId)}
1497
- </p>
1467
+ ${this.embed ? p : n`
1468
+ <p class="breadcrumbs">
1469
+ <a href=${g(t.hrefs.section, { sport: e.sport, view: "scores" })}>${B(e.sport)}</a> /
1470
+ <a href=${g(t.hrefs.section, { sport: e.sport, view: "scores" })}>Scores/Schedules</a> /
1471
+ ${F(t, e.awayTeamId)} at ${F(t, e.homeTeamId)}
1472
+ </p>`}
1498
1473
  <div class="card">
1499
1474
  <div class="scorehead">
1500
- ${this.teamBlock(t, e, e.awayTeamId, o, !1)}
1475
+ ${this.teamBlock(t, e, e.awayTeamId, r, !1)}
1501
1476
  <div class="mid">
1502
1477
  <div class="bigscore">
1503
- <span style=${i("away")}>${e.awayScore}</span>
1478
+ <span style=${h("away")}>${e.awayScore}</span>
1504
1479
  <span class="mut" style="font-size:1.6rem">–</span>
1505
- <span style=${i("home")}>${e.homeScore}</span>
1480
+ <span style=${h("home")}>${e.homeScore}</span>
1506
1481
  </div>
1507
- <div class="status">${A(e)}</div>
1482
+ <div class="status">${E(e)}</div>
1508
1483
  <div class="status">${w(e.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${e.state === "scheduled" && e.time ? n` · ${q(e.time)}` : p} · ${e.venue || "Venue TBD"}
1509
1484
  ${e.broadcast ? n` · <span class="pill class">${e.broadcast}</span>` : p}</div>
1510
1485
  <div class="status">
1511
- <span class="pill type">${e.gameType === "conference" ? `${h?.name || "Conference"} game` : e.gameType}</span>
1486
+ <span class="pill type">${e.gameType === "conference" ? `${d?.name || "Conference"} game` : e.gameType}</span>
1512
1487
  ${e.label ? n`<span class="pill type">Bracket ${e.label}</span>` : p}
1513
- ${(e.tags || []).map((d) => n`<span class="pill type">${d}</span>`)}
1488
+ ${(e.tags || []).map((c) => n`<span class="pill type">${c}</span>`)}
1514
1489
  </div>
1490
+ ${this.embed ? p : n`
1491
+ <div class="status">
1492
+ <a href=${le(t.hrefs, e.id)}>Report a score for this game</a>
1493
+ </div>`}
1515
1494
  </div>
1516
- ${this.teamBlock(t, e, e.homeTeamId, r, !0)}
1495
+ ${this.teamBlock(t, e, e.homeTeamId, o, !0)}
1517
1496
  </div>
1518
- ${this.renderLineScore(e, o, r)}
1519
- ${this.renderScoringPlays(e, o, r)}
1497
+ ${this.renderLineScore(e, r, o)}
1498
+ ${this.renderScoringPlays(e, r, o)}
1520
1499
  ${e.notes ? n`<p class="note gamenote">${e.notes}</p>` : p}
1521
1500
  </div>
1501
+ ${this.embed ? n`
1502
+ <p class="fullbox">
1503
+ <a href=${g(t.hrefs.game, { sport: e.sport, id: e.id })}>Full box score &rarr;</a>
1504
+ </p>` : n`
1522
1505
  ${(this.data.coverage || []).length ? n`
1523
1506
  <div class="section-title">Coverage</div>
1524
1507
  <div class="covgrid">
1525
- ${this.data.coverage.map((d) => n`
1526
- <a class="card covcard" href=${d.uri}>
1527
- ${d.image ? n`<img class="covimg" src=${d.image} alt="" loading="lazy" />` : p}
1508
+ ${this.data.coverage.map((c) => n`
1509
+ <a class="card covcard" href=${c.uri}>
1510
+ ${c.image ? n`<img class="covimg" src=${c.image} alt="" loading="lazy" />` : p}
1528
1511
  <div class="covbody">
1529
- <div class="covtitle">${d.videoDuration ? n`<span class="pill live" style="animation:none">Video</span> ` : p}${d.photos ? n`<span class="pill live" style="animation:none">Photos</span> ` : p}${d.title || d.uri}</div>
1530
- ${d.description ? n`<p class="covdesc">${d.description}</p>` : p}
1531
- ${d.author || d.publishedTime ? n`
1532
- <div class="covmeta">${[d.author, d.publishedTime ? new Date(d.publishedTime).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : ""].filter(Boolean).join(" · ")}</div>
1512
+ <div class="covtitle">${c.videoDuration ? n`<span class="pill live" style="animation:none">Video</span> ` : p}${c.photos ? n`<span class="pill live" style="animation:none">Photos</span> ` : p}${c.title || c.uri}</div>
1513
+ ${c.description ? n`<p class="covdesc">${c.description}</p>` : p}
1514
+ ${c.author || c.publishedTime ? n`
1515
+ <div class="covmeta">${[c.author, c.publishedTime ? new Date(c.publishedTime).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : ""].filter(Boolean).join(" · ")}</div>
1533
1516
  ` : p}
1534
1517
  </div>
1535
1518
  </a>
@@ -1537,62 +1520,62 @@ class at extends y {
1537
1520
  </div>` : p}
1538
1521
  <div class="section-title">Season context</div>
1539
1522
  <div class="cols">
1540
- ${[[e.awayTeamId, o], [e.homeTeamId, r]].map(([d, m]) => this.renderContext(t, d, m))}
1523
+ ${[[e.awayTeamId, r], [e.homeTeamId, o]].map(([c, m]) => this.renderContext(t, c, m))}
1541
1524
  </div>
1542
- ${c.length ? n`
1525
+ ${i.length ? n`
1543
1526
  <div class="section-title">Head to head this season</div>
1544
1527
  <div class="card"><ul class="gamelist">
1545
- ${c.map((d) => n`<li>
1546
- <span class="d">${w(d.date)}</span>${A(d)}
1547
- <span class="opp">${F(t, d.awayTeamId)} ${d.awayScore}, ${F(t, d.homeTeamId)} ${d.homeScore}</span>
1548
- <a class="box" href=${g(t.hrefs.game, { sport: e.sport, id: d.id })}>Box score →</a>
1528
+ ${i.map((c) => n`<li>
1529
+ <span class="d">${w(c.date)}</span>${E(c)}
1530
+ <span class="opp">${F(t, c.awayTeamId)} ${c.awayScore}, ${F(t, c.homeTeamId)} ${c.homeScore}</span>
1531
+ <a class="box" href=${g(t.hrefs.game, { sport: e.sport, id: c.id })}>Box score →</a>
1549
1532
  </li>`)}
1550
- </ul></div>` : p}
1533
+ </ul></div>` : p}`}
1551
1534
  `)}
1552
1535
  `;
1553
1536
  }
1554
- teamBlock(e, t, s, o, r) {
1555
- if (!o) return n`<div class="teamblock ${r ? "right" : ""}"><div class="tname">TBD</div></div>`;
1556
- const l = e.teamsById[s], i = e.records[s], h = M(o, 58);
1537
+ teamBlock(e, t, s, r, o) {
1538
+ if (!r) return n`<div class="teamblock ${o ? "right" : ""}"><div class="tname">TBD</div></div>`;
1539
+ const l = e.teamsById[s], h = e.records[s], d = L(r, 58);
1557
1540
  return n`
1558
- <div class="teamblock ${r ? "right" : ""}">
1559
- ${h ? n`<img class="crest logo" alt="" loading="lazy" src=${h} />` : n`<span class="crest" style="background:${o.colorPrimary || "#030711"};color:${N(o.colorPrimary || "#030711")}">${V(o)}</span>`}
1541
+ <div class="teamblock ${o ? "right" : ""}">
1542
+ ${d ? n`<img class="crest logo" alt="" loading="lazy" src=${d} />` : n`<span class="crest" style="background:${r.colorPrimary || "#030711"};color:${M(r.colorPrimary || "#030711")}">${V(r)}</span>`}
1560
1543
  <div>
1561
- <div class="tname">${K(e, s, t.date)}<a href=${g(e.hrefs.school, { id: o.id })}>${o.name}</a></div>
1562
- <div class="trec">${o.mascot || ""} · ${k(i)}${l?.conferenceId ? n` · ${k(i, !0)} conf` : p}</div>
1544
+ <div class="tname">${Q(e, s, t.date)}<a href=${g(e.hrefs.school, { id: r.id })}>${r.name}</a></div>
1545
+ <div class="trec">${r.mascot || ""} · ${k(h)}${l?.conferenceId ? n` · ${k(h, !0)} conf` : p}</div>
1563
1546
  </div>
1564
1547
  </div>
1565
1548
  `;
1566
1549
  }
1567
1550
  renderLineScore(e, t, s) {
1568
- const o = Xe(e);
1569
- if (!o)
1551
+ const r = Qe(e);
1552
+ if (!r)
1570
1553
  return e.state === "scheduled" ? n`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>` : p;
1571
- const r = Math.max(Z(e.sport), ...o.map((c) => c.period)), l = (c) => Ye(e.sport, c), i = (c, d) => {
1572
- const m = o.find((f) => f.period === d);
1573
- return m ? m[c] : e.state === "final" ? 0 : "·";
1574
- }, h = (c, d, m) => n`
1554
+ const o = Math.max(Z(e.sport), ...r.map((i) => i.period)), l = (i) => Ve(e.sport, i), h = (i, c) => {
1555
+ const m = r.find((f) => f.period === c);
1556
+ return m ? m[i] : e.state === "final" ? 0 : "·";
1557
+ }, d = (i, c, m) => n`
1575
1558
  <tr>
1576
- <td class="teamcell">${T(c, 20)}${c?.abbr || "TBD"}</td>
1577
- ${Array.from({ length: r }, (f, u) => n`<td class="num">${i(d, u + 1)}</td>`)}
1559
+ <td class="teamcell">${T(i, 20)}${i?.abbr || "TBD"}</td>
1560
+ ${Array.from({ length: o }, (f, u) => n`<td class="num">${h(c, u + 1)}</td>`)}
1578
1561
  <td class="num" style="font-weight:700">${m}</td>
1579
1562
  </tr>`;
1580
1563
  return n`
1581
1564
  <div class="tablewrap" style="border-top:1px solid var(--hsot-gray-2)">
1582
1565
  <table class="data" style="max-width:560px;margin:0.6rem auto 0.9rem">
1583
- <thead><tr><th>Team</th>${Array.from({ length: r }, (c, d) => n`<th class="num">${l(d + 1)}</th>`)}<th class="num">T</th></tr></thead>
1566
+ <thead><tr><th>Team</th>${Array.from({ length: o }, (i, c) => n`<th class="num">${l(c + 1)}</th>`)}<th class="num">T</th></tr></thead>
1584
1567
  <tbody>
1585
- ${h(t, "away", e.awayScore)}
1586
- ${h(s, "home", e.homeScore)}
1568
+ ${d(t, "away", e.awayScore)}
1569
+ ${d(s, "home", e.homeScore)}
1587
1570
  </tbody>
1588
1571
  </table>
1589
1572
  </div>
1590
1573
  `;
1591
1574
  }
1592
1575
  renderScoringPlays(e, t, s) {
1593
- const o = Array.isArray(e.scoringPlays) ? e.scoringPlays : [];
1594
- if (!o.length) return p;
1595
- const r = (l) => [l.period, l.clock].filter(Boolean).join(" ");
1576
+ const r = Array.isArray(e.scoringPlays) ? e.scoringPlays : [];
1577
+ if (!r.length) return p;
1578
+ const o = (l) => [l.period, l.clock].filter(Boolean).join(" ");
1596
1579
  return n`
1597
1580
  <div class="plays">
1598
1581
  <div class="plays-title">Scoring plays</div>
@@ -1603,8 +1586,8 @@ class at extends y {
1603
1586
  <th class="num">${t?.abbr || "Away"}</th><th class="num">${s?.abbr || "Home"}</th>
1604
1587
  </tr></thead>
1605
1588
  <tbody>
1606
- ${o.map((l) => n`<tr>
1607
- <td class="when">${r(l) || "·"}</td>
1589
+ ${r.map((l) => n`<tr>
1590
+ <td class="when">${o(l) || "·"}</td>
1608
1591
  <td class="play">${l.description || "·"}</td>
1609
1592
  <td class="num">${l.awayScore}</td>
1610
1593
  <td class="num">${l.homeScore}</td>
@@ -1617,24 +1600,24 @@ class at extends y {
1617
1600
  }
1618
1601
  renderContext(e, t, s) {
1619
1602
  if (!s) return p;
1620
- const o = e.records[t], r = Y(this.data.games, t);
1603
+ const r = e.records[t], o = Y(this.data.games, t);
1621
1604
  return n`
1622
1605
  <div class="card ctxcard">
1623
1606
  <div class="who">${T(s)}${s.name}</div>
1624
1607
  <div class="row">
1625
1608
  <span>Last 5: ${X(e, t)}</span>
1626
- <span>Streak: <b>${o ? H(o.results) : "·"}</b></span>
1627
- <span>PF/PA: <b>${o ? `${o.pf} / ${o.pa}` : "·"}</b></span>
1628
- <span>Next: ${r ? n`${w(r.date, { month: "numeric", day: "numeric" })}
1629
- ${r.homeTeamId === t ? "vs" : "at"} ${L(e, r.homeTeamId === t ? r.awayTeamId : r.homeTeamId)}` : "·"}</span>
1609
+ <span>Streak: <b>${r ? U(r.results) : "·"}</b></span>
1610
+ <span>PF/PA: <b>${r ? `${r.pf} / ${r.pa}` : "·"}</b></span>
1611
+ <span>Next: ${o ? n`${w(o.date, { month: "numeric", day: "numeric" })}
1612
+ ${o.homeTeamId === t ? "vs" : "at"} ${G(e, o.homeTeamId === t ? o.awayTeamId : o.homeTeamId)}` : "·"}</span>
1630
1613
  </div>
1631
1614
  </div>
1632
1615
  `;
1633
1616
  }
1634
1617
  }
1635
- globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", at);
1636
- const ot = 250, rt = 2;
1637
- class nt extends ie {
1618
+ globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", st);
1619
+ const at = 250, rt = 2;
1620
+ class ot extends ie {
1638
1621
  static properties = {
1639
1622
  api: { type: String },
1640
1623
  schoolHref: { type: String, attribute: "school-href" },
@@ -1718,7 +1701,7 @@ class nt extends ie {
1718
1701
  this.abortController?.abort(), this.results = [], this.open = !1, this.searched = !1;
1719
1702
  return;
1720
1703
  }
1721
- this.debounceTimer = setTimeout(() => this.search(t), ot);
1704
+ this.debounceTimer = setTimeout(() => this.search(t), at);
1722
1705
  }
1723
1706
  async search(e) {
1724
1707
  this.abortController?.abort(), this.abortController = new AbortController();
@@ -1728,8 +1711,8 @@ class nt extends ie {
1728
1711
  });
1729
1712
  if (!s.ok)
1730
1713
  return;
1731
- const o = await s.json();
1732
- this.results = o.items || [], this.activeIndex = -1, this.searched = !0, this.open = !0;
1714
+ const r = await s.json();
1715
+ this.results = r.items || [], this.activeIndex = -1, this.searched = !0, this.open = !0;
1733
1716
  } catch (t) {
1734
1717
  t.name !== "AbortError" && console.warn("school search failed", t);
1735
1718
  }
@@ -1763,15 +1746,15 @@ class nt extends ie {
1763
1746
  return [e.location, e.county && `${e.county} County`].filter(Boolean).join(" — ");
1764
1747
  }
1765
1748
  renderOption(e, t) {
1766
- const s = this.where(e), o = (r) => {
1767
- r.preventDefault(), this.go(e);
1749
+ const s = this.where(e), r = (o) => {
1750
+ o.preventDefault(), this.go(e);
1768
1751
  };
1769
1752
  return n`
1770
1753
  <li
1771
1754
  id="school-option-${t}"
1772
1755
  role="option"
1773
1756
  aria-selected="${t === this.activeIndex ? "true" : "false"}"
1774
- @pointerdown="${o}"
1757
+ @pointerdown="${r}"
1775
1758
  @mousemove="${() => {
1776
1759
  this.activeIndex = t;
1777
1760
  }}"
@@ -1785,7 +1768,7 @@ class nt extends ie {
1785
1768
  const e = this.searched && !this.results.length, t = n`<li class="empty">No schools found</li>`;
1786
1769
  return n`
1787
1770
  <ul id="school-search-listbox" role="listbox" aria-label="Schools">
1788
- ${this.results.map((s, o) => this.renderOption(s, o))}
1771
+ ${this.results.map((s, r) => this.renderOption(s, r))}
1789
1772
  ${e ? t : p}
1790
1773
  </ul>
1791
1774
  `;
@@ -1811,111 +1794,111 @@ class nt extends ie {
1811
1794
  `;
1812
1795
  }
1813
1796
  }
1814
- globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search", nt);
1815
- function ge(a, e) {
1816
- const t = new Map(a.map((h) => [h.id, h])), s = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
1817
- for (const h of e || [])
1818
- h.outcome === "winner" && (s.has(h.targetGameId) || s.set(h.targetGameId, []), s.get(h.targetGameId).push(h), o.has(h.sourceGameId) || o.set(h.sourceGameId, []), o.get(h.sourceGameId).push(h));
1819
- const r = a.filter((h) => !o.has(h.id)), l = (h) => h.targetSlot === "home" ? 0 : 1;
1820
- function i(h) {
1821
- const c = t.get(h);
1822
- if (!c) return null;
1823
- const m = [...s.get(h) || []].sort((f, u) => l(f) - l(u)).map((f) => i(f.sourceGameId)).filter(Boolean);
1824
- return { game: c, children: m, bracketGroup: c.bracketGroup };
1797
+ globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search", ot);
1798
+ function ve(a, e) {
1799
+ const t = new Map(a.map((d) => [d.id, d])), s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
1800
+ for (const d of e || [])
1801
+ d.outcome === "winner" && (s.has(d.targetGameId) || s.set(d.targetGameId, []), s.get(d.targetGameId).push(d), r.has(d.sourceGameId) || r.set(d.sourceGameId, []), r.get(d.sourceGameId).push(d));
1802
+ const o = a.filter((d) => !r.has(d.id)), l = (d) => d.targetSlot === "home" ? 0 : 1;
1803
+ function h(d) {
1804
+ const i = t.get(d);
1805
+ if (!i) return null;
1806
+ const m = [...s.get(d) || []].sort((f, u) => l(f) - l(u)).map((f) => h(f.sourceGameId)).filter(Boolean);
1807
+ return { game: i, children: m, bracketGroup: i.bracketGroup };
1825
1808
  }
1826
- return r.length === 1 ? i(r[0].id) : r.map((h) => i(h.id));
1809
+ return o.length === 1 ? h(o[0].id) : o.map((d) => h(d.id));
1827
1810
  }
1828
- function ve(a, e = [], t = 0) {
1811
+ function be(a, e = [], t = 0) {
1829
1812
  if (!a) return e;
1830
1813
  e[t] || (e[t] = []), e[t].push(a.game);
1831
- for (const s of a.children || []) ve(s, e, t + 1);
1814
+ for (const s of a.children || []) be(s, e, t + 1);
1832
1815
  return e;
1833
1816
  }
1834
- const it = (a) => Math.max(1, Math.round(Math.log2(a || 2)));
1835
- function lt({ round: a, perGroup: e, groupCount: t = 1 }) {
1836
- const s = it(e), r = (t === 4 ? s + 2 : t === 2 ? s + 1 : s) - a;
1837
- return r === 0 ? t > 1 ? "Championship" : "Final" : r === 1 ? "Semifinal" : `Round ${a}`;
1817
+ const nt = (a) => Math.max(1, Math.round(Math.log2(a || 2)));
1818
+ function it({ round: a, perGroup: e, groupCount: t = 1 }) {
1819
+ const s = nt(e), o = (t === 4 ? s + 2 : t === 2 ? s + 1 : s) - a;
1820
+ return o === 0 ? t > 1 ? "Championship" : "Final" : o === 1 ? "Semifinal" : `Round ${a}`;
1838
1821
  }
1839
- function ct(a) {
1822
+ function lt(a) {
1840
1823
  if (!a || !a.length) return "setup";
1841
1824
  const e = Math.max(...a.map((s) => s.round ?? 0)), t = a.filter((s) => (s.round ?? 0) === e);
1842
1825
  return t.length && t.every((s) => s.state === "final") ? "complete" : a.some((s) => s.state !== "scheduled" || s.homeScore || s.awayScore || s.round === 1 && (s.homeTeamId || s.awayTeamId)) ? "active" : "setup";
1843
1826
  }
1844
- function dt(a, e) {
1827
+ function ct(a, e) {
1845
1828
  const t = a?.groupNames || [];
1846
1829
  if (t.length >= 2) {
1847
- const o = t.map((r) => ({ key: r, name: r }));
1848
- return (e || []).some((r) => r.bracketGroup === "Championship") && o.push({ key: "Championship", name: "Championship" }), o;
1830
+ const r = t.map((o) => ({ key: o, name: o }));
1831
+ return (e || []).some((o) => o.bracketGroup === "Championship") && r.push({ key: "Championship", name: "Championship" }), r;
1849
1832
  }
1850
- const s = [...new Set((e || []).map((o) => o.bracketGroup).filter(Boolean))];
1833
+ const s = [...new Set((e || []).map((r) => r.bracketGroup).filter(Boolean))];
1851
1834
  return [{ key: null, name: s.length === 1 ? s[0] : "Bracket" }];
1852
1835
  }
1853
- const ht = (a, e) => e?.key == null ? [...a || []] : (a || []).filter((t) => t.bracketGroup === e.key), oe = (a) => {
1836
+ const dt = (a, e) => e?.key == null ? [...a || []] : (a || []).filter((t) => t.bracketGroup === e.key), re = (a) => {
1854
1837
  const e = /(\d+)\s*$/.exec(a.label || "");
1855
1838
  return e ? Number(e[1]) : 1 / 0;
1856
- }, re = (a, e) => oe(a) - oe(e) || String(a.id).localeCompare(String(e.id));
1857
- function mt(a, e) {
1858
- if (a.every((o) => Number.isInteger(o.round))) return (o) => o.round;
1859
- const t = ge(a, e), s = /* @__PURE__ */ new Map();
1860
- for (const o of Array.isArray(t) ? t : [t]) {
1861
- const r = ve(o), l = r.length - 1;
1862
- r.forEach((i, h) => i.forEach((c) => s.set(c.id, l - h + 1)));
1863
- }
1864
- return (o) => Number.isInteger(o.round) ? o.round : s.get(o.id) || 1;
1865
- }
1866
- function pt(a, e, t) {
1867
- const s = ht(a, t);
1839
+ }, oe = (a, e) => re(a) - re(e) || String(a.id).localeCompare(String(e.id));
1840
+ function ht(a, e) {
1841
+ if (a.every((r) => Number.isInteger(r.round))) return (r) => r.round;
1842
+ const t = ve(a, e), s = /* @__PURE__ */ new Map();
1843
+ for (const r of Array.isArray(t) ? t : [t]) {
1844
+ const o = be(r), l = o.length - 1;
1845
+ o.forEach((h, d) => h.forEach((i) => s.set(i.id, l - d + 1)));
1846
+ }
1847
+ return (r) => Number.isInteger(r.round) ? r.round : s.get(r.id) || 1;
1848
+ }
1849
+ function mt(a, e, t) {
1850
+ const s = dt(a, t);
1868
1851
  if (!s.length) return [];
1869
- const o = mt(a || [], e || []), r = /* @__PURE__ */ new Map();
1870
- for (const c of s) {
1871
- const d = o(c);
1872
- r.has(d) || r.set(d, []), r.get(d).push(c);
1852
+ const r = ht(a || [], e || []), o = /* @__PURE__ */ new Map();
1853
+ for (const i of s) {
1854
+ const c = r(i);
1855
+ o.has(c) || o.set(c, []), o.get(c).push(i);
1873
1856
  }
1874
1857
  const l = /* @__PURE__ */ new Map();
1875
- for (const c of e || [])
1876
- c.outcome === "winner" && (l.has(c.targetGameId) || l.set(c.targetGameId, []), l.get(c.targetGameId).push(c.sourceGameId));
1877
- const i = [];
1878
- let h = null;
1879
- for (const c of [...r.keys()].sort((d, m) => d - m)) {
1880
- let d = [...r.get(c)];
1881
- if (h) {
1858
+ for (const i of e || [])
1859
+ i.outcome === "winner" && (l.has(i.targetGameId) || l.set(i.targetGameId, []), l.get(i.targetGameId).push(i.sourceGameId));
1860
+ const h = [];
1861
+ let d = null;
1862
+ for (const i of [...o.keys()].sort((c, m) => c - m)) {
1863
+ let c = [...o.get(i)];
1864
+ if (d) {
1882
1865
  const m = (f) => {
1883
- const u = (l.get(f.id) || []).map((v) => h.get(v)).filter((v) => v !== void 0);
1866
+ const u = (l.get(f.id) || []).map((v) => d.get(v)).filter((v) => v !== void 0);
1884
1867
  return u.length ? Math.min(...u) : 1 / 0;
1885
1868
  };
1886
- d.sort((f, u) => m(f) - m(u) || re(f, u));
1869
+ c.sort((f, u) => m(f) - m(u) || oe(f, u));
1887
1870
  } else
1888
- d.sort(re);
1889
- h = new Map(d.map((m, f) => [m.id, f])), i.push({ round: c, games: d });
1871
+ c.sort(oe);
1872
+ d = new Map(c.map((m, f) => [m.id, f])), h.push({ round: i, games: c });
1890
1873
  }
1891
- return i;
1874
+ return h;
1892
1875
  }
1893
- function ft(a, e, t) {
1894
- const s = a[`${e}TeamId`] || null, o = (t || []).find((l) => l.gameId === a.id && l.slot === e), r = a[`${e}Seed`] ?? o?.seed ?? null;
1895
- return { teamId: s, seed: r, bye: !s && !!o?.isBye };
1876
+ function pt(a, e, t) {
1877
+ const s = a[`${e}TeamId`] || null, r = (t || []).find((l) => l.gameId === a.id && l.slot === e), o = a[`${e}Seed`] ?? r?.seed ?? null;
1878
+ return { teamId: s, seed: o, bye: !s && !!r?.isBye };
1896
1879
  }
1897
- function be(a) {
1898
- const e = O(a);
1880
+ function ye(a) {
1881
+ const e = H(a);
1899
1882
  return e === "home" || e === "away" ? e : null;
1900
1883
  }
1901
- function ut(a, e) {
1902
- const t = ge(a || [], e || []);
1884
+ function ft(a, e) {
1885
+ const t = ve(a || [], e || []);
1903
1886
  if (!t || Array.isArray(t)) return null;
1904
- const s = be(t.game);
1887
+ const s = ye(t.game);
1905
1888
  return s && t.game[`${s}TeamId`] || null;
1906
1889
  }
1907
1890
  const ne = { active: 0, setup: 1, complete: 2 };
1908
- function gt(a, { id: e, param: t } = {}) {
1891
+ function ut(a, { id: e, param: t } = {}) {
1909
1892
  const s = a || [];
1910
1893
  if (!s.length) return null;
1911
- for (const o of [e, t]) {
1912
- if (!o) continue;
1913
- const r = s.find((l) => l.id === o);
1914
- if (r) return r;
1894
+ for (const r of [e, t]) {
1895
+ if (!r) continue;
1896
+ const o = s.find((l) => l.id === r);
1897
+ if (o) return o;
1915
1898
  }
1916
- return [...s].sort((o, r) => (ne[o.status] ?? 3) - (ne[r.status] ?? 3) || String(o.name || "").localeCompare(String(r.name || "")))[0];
1899
+ return [...s].sort((r, o) => (ne[r.status] ?? 3) - (ne[o.status] ?? 3) || String(r.name || "").localeCompare(String(o.name || "")))[0];
1917
1900
  }
1918
- const vt = $`
1901
+ const gt = $`
1919
1902
  .bracket { display: flex; gap: 1rem; align-items: stretch; overflow-x: auto; padding-bottom: 0.5rem; }
1920
1903
  .round { flex: 0 0 250px; display: flex; flex-direction: column; min-width: 0; }
1921
1904
  .roundhead {
@@ -1961,8 +1944,8 @@ const vt = $`
1961
1944
  .champ .tname a { color: inherit; text-decoration: none; font-weight: 700; }
1962
1945
  @media (max-width: 720px) { .round { flex-basis: 215px; } }
1963
1946
  `;
1964
- class bt extends y {
1965
- static styles = [P, vt];
1947
+ class vt extends y {
1948
+ static styles = [P, gt];
1966
1949
  static properties = {
1967
1950
  ...y.properties,
1968
1951
  sport: { type: String },
@@ -1975,24 +1958,24 @@ class bt extends y {
1975
1958
  super(), this.sport = "football", this.season = "", this.tournamentId = "", this.picked = "", this.group = null;
1976
1959
  }
1977
1960
  async fetchData(e) {
1978
- const t = this.season || E(), s = (await e.listTournaments({ sport: this.sport, season: t })).items, o = new URLSearchParams(globalThis.location?.search || "").get("tournament"), r = gt(s, { id: this.picked || this.tournamentId, param: o });
1979
- if (!r) return { season: t, tournaments: s, tournament: null };
1980
- const [l, i, h, c, d] = await Promise.all([
1981
- e.listSeedings(r.id),
1982
- e.listEdges(r.id),
1983
- e.listGames({ tournamentId: r.id }),
1961
+ const t = this.season || _(), s = (await e.listTournaments({ sport: this.sport, season: t })).items, r = new URLSearchParams(globalThis.location?.search || "").get("tournament"), o = ut(s, { id: this.picked || this.tournamentId, param: r });
1962
+ if (!o) return { season: t, tournaments: s, tournament: null };
1963
+ const [l, h, d, i, c] = await Promise.all([
1964
+ e.listSeedings(o.id),
1965
+ e.listEdges(o.id),
1966
+ e.listGames({ tournamentId: o.id }),
1984
1967
  e.listSchools(),
1985
1968
  e.listTeams({ sport: this.sport })
1986
1969
  ]);
1987
1970
  return {
1988
1971
  season: t,
1989
1972
  tournaments: s,
1990
- tournament: r,
1973
+ tournament: o,
1991
1974
  seedings: l.items,
1992
- edges: i.items,
1993
- games: h.items,
1994
- schools: c.items,
1995
- teams: d.items
1975
+ edges: h.items,
1976
+ games: d.items,
1977
+ schools: i.items,
1978
+ teams: c.items
1996
1979
  };
1997
1980
  }
1998
1981
  get ctx() {
@@ -2018,7 +2001,7 @@ class bt extends y {
2018
2001
  }
2019
2002
  }
2020
2003
  renderView() {
2021
- const e = this.data, t = this.ctx, s = U(this, t, {
2004
+ const e = this.data, t = this.ctx, s = j(this, t, {
2022
2005
  title: n`${B(this.sport)} playoff brackets`,
2023
2006
  sub: e.tournament ? n`${e.tournament.name} · ${e.season} season` : n`${e.season} season`,
2024
2007
  teams: e.teams
@@ -2028,7 +2011,7 @@ class bt extends y {
2028
2011
  ${D(this)}
2029
2012
  <div class="card"><div class="empty">No ${this.sport} brackets have been published for the ${e.season} season yet.</div></div>
2030
2013
  `)}`;
2031
- const o = dt(e.tournament, e.games), r = o.find((m) => m.key === this.group) || o[0], l = (e.tournament.groupNames || []).length >= 2 ? e.tournament.groupNames.length : 1, i = (Number(e.tournament.size) || 0) / l, h = pt(e.games, e.edges, r), c = ct(e.games), d = ut(e.games, e.edges);
2014
+ const r = ct(e.tournament, e.games), o = r.find((m) => m.key === this.group) || r[0], l = (e.tournament.groupNames || []).length >= 2 ? e.tournament.groupNames.length : 1, h = (Number(e.tournament.size) || 0) / l, d = mt(e.games, e.edges, o), i = lt(e.games), c = ft(e.games, e.edges);
2032
2015
  return n`
2033
2016
  ${s}
2034
2017
  ${C(this, n`
@@ -2039,25 +2022,25 @@ class bt extends y {
2039
2022
  ${e.tournaments.map((m) => n`<button class="chip ${m.id === e.tournament.id ? "on" : ""}"
2040
2023
  @click=${() => this.pick(m.id)}>${m.name}</button>`)}
2041
2024
  </div>` : p}
2042
- ${o.length > 1 ? n`
2025
+ ${r.length > 1 ? n`
2043
2026
  <div role="tablist" aria-label="Bracket group">
2044
- ${o.map((m) => n`<button class="chip ${m.key === r.key ? "on" : ""}" role="tab"
2045
- aria-selected=${m.key === r.key ? "true" : "false"}
2027
+ ${r.map((m) => n`<button class="chip ${m.key === o.key ? "on" : ""}" role="tab"
2028
+ aria-selected=${m.key === o.key ? "true" : "false"}
2046
2029
  @click=${() => {
2047
2030
  this.group = m.key;
2048
2031
  }}>${m.name}</button>`)}
2049
2032
  </div>` : p}
2050
2033
  <span class="spacer"></span>
2051
- <span class="pill ${c === "complete" ? "final" : c === "active" ? "class" : "type"}">${c === "complete" ? "Complete" : c === "active" ? "In progress" : "Bracket set"}</span>
2034
+ <span class="pill ${i === "complete" ? "final" : i === "active" ? "class" : "type"}">${i === "complete" ? "Complete" : i === "active" ? "In progress" : "Bracket set"}</span>
2052
2035
  <span class="asof">${e.tournament.size}-team ${String(e.tournament.format || "").replace(/_/g, " ")}</span>
2053
2036
  </div>
2054
- ${d ? n`<div class="champ"><span class="pill champ">Champion</span>
2055
- ${T(I(t, d), 26)}<span class="tname">${G(t, d)}</span></div>` : p}
2056
- ${h.length ? n`
2057
- <div class="bracket" role="region" aria-label="${r.name} bracket">
2058
- ${h.map((m) => n`
2037
+ ${c ? n`<div class="champ"><span class="pill champ">Champion</span>
2038
+ ${T(I(t, c), 26)}<span class="tname">${O(t, c)}</span></div>` : p}
2039
+ ${d.length ? n`
2040
+ <div class="bracket" role="region" aria-label="${o.name} bracket">
2041
+ ${d.map((m) => n`
2059
2042
  <section class="round">
2060
- <h3 class="roundhead">${lt({ round: m.round, perGroup: i, groupCount: l })}</h3>
2043
+ <h3 class="roundhead">${it({ round: m.round, perGroup: h, groupCount: l })}</h3>
2061
2044
  <div class="games">${m.games.map((f) => this.renderMatchup(t, f))}</div>
2062
2045
  </section>`)}
2063
2046
  </div>` : n`<div class="card"><div class="empty">This bracket has no games yet.</div></div>`}
@@ -2071,7 +2054,7 @@ class bt extends y {
2071
2054
  ${this.renderSlot(e, t, "home")}
2072
2055
  ${this.renderSlot(e, t, "away")}
2073
2056
  <footer class="mfoot">
2074
- ${A(t)}
2057
+ ${E(t)}
2075
2058
  ${t.label ? n`<span class="label">${t.label}</span>` : p}
2076
2059
  <span class="spacer"></span>
2077
2060
  ${s ? n`<a class="box" href=${g(e.hrefs.game, { sport: this.sport, id: t.id })}>Box score</a>` : p}
@@ -2080,41 +2063,40 @@ class bt extends y {
2080
2063
  `;
2081
2064
  }
2082
2065
  renderSlot(e, t, s) {
2083
- const { teamId: o, seed: r, bye: l } = ft(t, s, this.data.seedings), i = be(t), h = t.state === "live" || t.state === "final";
2066
+ const { teamId: r, seed: o, bye: l } = pt(t, s, this.data.seedings), h = ye(t), d = t.state === "live" || t.state === "final";
2084
2067
  return n`
2085
- <div class="slot ${i ? i === s ? "winner" : "loser" : ""}">
2086
- <span class="seed">${r ?? ""}</span>
2087
- ${o ? n`${T(I(e, o), 22)}<span class="tname">${G(e, o, t.date)}</span>` : l ? n`<span class="tname bye">Bye</span>` : n`<span class="tname mut">TBD</span>`}
2088
- ${h ? n`<span class="score">${t[`${s}Score`] ?? 0}</span>` : p}
2068
+ <div class="slot ${h ? h === s ? "winner" : "loser" : ""}">
2069
+ <span class="seed">${o ?? ""}</span>
2070
+ ${r ? n`${T(I(e, r), 22)}<span class="tname">${O(e, r, t.date)}</span>` : l ? n`<span class="tname bye">Bye</span>` : n`<span class="tname mut">TBD</span>`}
2071
+ ${d ? n`<span class="score">${t[`${s}Score`] ?? 0}</span>` : p}
2089
2072
  </div>
2090
2073
  `;
2091
2074
  }
2092
2075
  }
2093
- globalThis?.customElements && !globalThis.customElements.get("hsot-brackets") && globalThis.customElements.define("hsot-brackets", bt);
2076
+ globalThis?.customElements && !globalThis.customElements.get("hsot-brackets") && globalThis.customElements.define("hsot-brackets", vt);
2094
2077
  export {
2095
- j as D,
2096
- at as H,
2097
- bt as a,
2098
- qe as b,
2099
- Ve as c,
2100
- nt as d,
2101
- He as e,
2102
- Ue as f,
2103
- dt as g,
2104
- ge as h,
2105
- ut as i,
2106
- _ as j,
2107
- ct as k,
2108
- we as l,
2109
- g as m,
2110
- O as n,
2111
- $t as o,
2112
- Le as p,
2113
- lt as q,
2078
+ A as D,
2079
+ st as H,
2080
+ vt as a,
2081
+ je as b,
2082
+ We as c,
2083
+ ot as d,
2084
+ Oe as e,
2085
+ He as f,
2086
+ ct as g,
2087
+ ve as h,
2088
+ ft as i,
2089
+ N as j,
2090
+ lt as k,
2091
+ g as l,
2092
+ H as m,
2093
+ $t as n,
2094
+ it as o,
2095
+ Me as p,
2096
+ mt as q,
2114
2097
  k as r,
2115
- pt as s,
2116
- de as t,
2117
- H as u,
2118
- Q as v,
2119
- ve as w
2098
+ he as s,
2099
+ U as t,
2100
+ K as u,
2101
+ be as v
2120
2102
  };