@wral/hsot-data 0.1.14 → 0.1.15

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,69 +1,69 @@
1
- import { LitElement as te, html as i, css as b, nothing as p, svg as Q } from "lit";
2
- const ce = 50;
3
- function de(a = {}) {
1
+ import { LitElement as ae, html as n, css as y, nothing as p, svg as Z } from "lit";
2
+ const pe = 50;
3
+ function fe(a = {}) {
4
4
  const e = Object.entries(a).filter(([, s]) => s != null && s !== "");
5
5
  if (!e.length) return "";
6
6
  const t = new URLSearchParams();
7
- return e.forEach(([s, o]) => t.set(s, String(o))), `?${t.toString()}`;
7
+ return e.forEach(([s, r]) => t.set(s, String(r))), `?${t.toString()}`;
8
8
  }
9
- function he({ baseUrl: a, token: e = "", fetchFn: t } = {}) {
9
+ function ue({ baseUrl: a, token: e = "", fetchFn: t } = {}) {
10
10
  if (!a) throw new Error("createClient requires a baseUrl");
11
- const s = a.replace(/\/+$/, ""), o = t || ((...n) => fetch(...n));
12
- async function r(n) {
11
+ const s = a.replace(/\/+$/, ""), r = t || ((...i) => fetch(...i));
12
+ async function o(i) {
13
13
  const h = { Accept: "application/json" };
14
14
  e && (h.Authorization = `Bearer ${e}`);
15
- const l = await o(`${s}${n}`, { headers: h });
16
- if (!l.ok) {
17
- const c = new Error(`api-hsot ${l.status} on ${n}`);
18
- throw c.status = l.status, c;
15
+ const d = await r(`${s}${i}`, { headers: h });
16
+ if (!d.ok) {
17
+ const c = new Error(`api-hsot ${d.status} on ${i}`);
18
+ throw c.status = d.status, c;
19
19
  }
20
- return l.json();
20
+ return d.json();
21
21
  }
22
- async function d(n, h = {}) {
23
- const l = [];
22
+ async function l(i, h = {}) {
23
+ const d = [];
24
24
  let c = null;
25
- for (let m = 0; m < ce; m += 1) {
26
- const f = de(c ? { ...h, cursor: c } : h), g = await r(`${n}${f}`);
27
- if (l.push(...g.items || []), c = g.nextCursor || null, !c) break;
25
+ for (let m = 0; m < pe; m += 1) {
26
+ const f = fe(c ? { ...h, cursor: c } : h), u = await o(`${i}${f}`);
27
+ if (d.push(...u.items || []), c = u.nextCursor || null, !c) break;
28
28
  }
29
- return { items: l, total: l.length, nextCursor: null };
29
+ return { items: d, total: d.length, nextCursor: null };
30
30
  }
31
31
  return {
32
- listSchools: (n) => d("/schools", n),
33
- getSchool: (n) => r(`/schools/${n}`),
34
- listTeams: (n) => d("/teams", n),
35
- getTeam: (n) => r(`/teams/${n}`),
36
- listConferences: (n) => d("/conferences", n),
37
- listPlayers: (n) => d("/players", n),
38
- listRosters: (n) => d("/rosters", n),
39
- listGames: (n) => d("/games", n),
40
- getGame: (n) => r(`/games/${n}`),
41
- listTournaments: (n) => d("/tournaments", n),
42
- listSeedings: (n, h) => d(`/tournaments/${n}/seedings`, h),
43
- listRankings: (n) => d("/rankings", n),
44
- listSports: () => r("/sports")
32
+ listSchools: (i) => l("/schools", i),
33
+ getSchool: (i) => o(`/schools/${i}`),
34
+ listTeams: (i) => l("/teams", i),
35
+ getTeam: (i) => o(`/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) => o(`/games/${i}`),
41
+ listTournaments: (i) => l("/tournaments", i),
42
+ listSeedings: (i, h) => l(`/tournaments/${i}/seedings`, h),
43
+ listRankings: (i) => l("/rankings", i),
44
+ listSports: () => o("/sports")
45
45
  };
46
46
  }
47
- const H = {
47
+ const O = {
48
48
  game: "/{sport}/game/{id}/",
49
49
  school: "/school/{id}/",
50
50
  section: "/{sport}/{view}/"
51
51
  };
52
- function u(a, e) {
52
+ function g(a, e) {
53
53
  return String(a).replace(/\{(\w+)\}/g, (t, s) => e[s] !== void 0 && e[s] !== null ? String(e[s]) : t);
54
54
  }
55
- function D(a) {
55
+ function F(a) {
56
56
  return {
57
- game: a.getAttribute("game-href") || H.game,
58
- school: a.getAttribute("school-href") || H.school,
59
- section: a.getAttribute("section-href") || H.section
57
+ game: a.getAttribute("game-href") || O.game,
58
+ school: a.getAttribute("school-href") || O.school,
59
+ section: a.getAttribute("section-href") || O.section
60
60
  };
61
61
  }
62
- const T = (a) => a ? a.charAt(0).toUpperCase() + a.slice(1) : "";
63
- function y(a, e) {
62
+ const I = (a) => a ? a.charAt(0).toUpperCase() + a.slice(1) : "";
63
+ function $(a, e) {
64
64
  if (!a) return "TBD";
65
- const [t, s, o] = String(a).split("-").map(Number);
66
- return !t || !s || !o ? "TBD" : new Date(t, s - 1, o).toLocaleDateString("en-US", e || { weekday: "short", month: "short", day: "numeric" });
65
+ const [t, s, r] = String(a).split("-").map(Number);
66
+ return !t || !s || !r ? "TBD" : new Date(t, s - 1, r).toLocaleDateString("en-US", e || { weekday: "short", month: "short", day: "numeric" });
67
67
  }
68
68
  function U(a) {
69
69
  if (!a) return "";
@@ -72,50 +72,50 @@ function U(a) {
72
72
  const s = e >= 12 ? "PM" : "AM";
73
73
  return `${(e + 11) % 12 + 1}:${String(t || 0).padStart(2, "0")} ${s}`;
74
74
  }
75
- function me(a) {
75
+ function ge(a) {
76
76
  return a ? `${Math.floor(a / 12)}-${a % 12}` : "·";
77
77
  }
78
- function pe(a) {
78
+ function ve(a) {
79
79
  return (Array.isArray(a?.positions) ? a.positions : String(a?.position ?? "").split(/[/,]/)).map((t) => String(t ?? "").trim()).filter(Boolean).join("/");
80
80
  }
81
- function N(a = /* @__PURE__ */ new Date()) {
81
+ function M(a = /* @__PURE__ */ new Date()) {
82
82
  const e = a.getFullYear();
83
83
  return a.getMonth() >= 6 ? `${e}-${e + 1}` : `${e - 1}-${e}`;
84
84
  }
85
- function M(a = /* @__PURE__ */ new Date()) {
85
+ function j(a = /* @__PURE__ */ new Date()) {
86
86
  const e = (t) => String(t).padStart(2, "0");
87
87
  return `${a.getFullYear()}-${e(a.getMonth() + 1)}-${e(a.getDate())}`;
88
88
  }
89
- function fe(a, e = M()) {
89
+ function be(a, e = j()) {
90
90
  const t = [...new Set((a || []).filter(Boolean))].sort();
91
91
  if (!t.length || t.includes(e)) return e;
92
- const s = t.filter((o) => o < e);
92
+ const s = t.filter((r) => r < e);
93
93
  return s.length ? s[s.length - 1] : t[0];
94
94
  }
95
- function j(a) {
95
+ function q(a) {
96
96
  return a ? (a.abbr || a.name || "?").slice(0, 4).toUpperCase() : "?";
97
97
  }
98
- function A(a) {
98
+ function _(a) {
99
99
  if (!a || !/^#[0-9a-fA-F]{6}$/.test(a)) return "#FFFFFF";
100
- const e = parseInt(a.slice(1), 16), t = e >> 16 & 255, s = e >> 8 & 255, o = e & 255;
101
- return 0.299 * t + 0.587 * s + 0.114 * o > 150 ? "#0F1B33" : "#FFFFFF";
100
+ const e = parseInt(a.slice(1), 16), t = e >> 16 & 255, s = e >> 8 & 255, r = e & 255;
101
+ return 0.299 * t + 0.587 * s + 0.114 * r > 150 ? "#0F1B33" : "#FFFFFF";
102
102
  }
103
- const ue = (a) => {
103
+ const ye = (a) => {
104
104
  const e = ["th", "st", "nd", "rd"], t = a % 100;
105
105
  return a + (e[(t - 20) % 10] || e[t] || e[0]);
106
106
  };
107
- function X(a, e) {
108
- const t = (r) => {
109
- const d = /^\d+/.exec(String(r ?? ""));
110
- return d ? Number(d[0]) : null;
111
- }, s = t(a), o = t(e);
112
- 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" });
107
+ function J(a, e) {
108
+ const t = (o) => {
109
+ const l = /^\d+/.exec(String(o ?? ""));
110
+ return l ? Number(l[0]) : null;
111
+ }, s = t(a), r = t(e);
112
+ 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" });
113
113
  }
114
- function ge(a, e) {
114
+ function $e(a, e) {
115
115
  const t = (s) => String(s?.name ?? s ?? "");
116
116
  return t(a).localeCompare(t(e), "en", { numeric: !0, sensitivity: "base" });
117
117
  }
118
- function se(a) {
118
+ function re(a) {
119
119
  if (a.state === "live") {
120
120
  const e = [a.period, a.clock].filter(Boolean).join(" ");
121
121
  return { kind: "live", label: e ? `Live · ${e}` : "Live" };
@@ -124,54 +124,54 @@ function se(a) {
124
124
  const e = [];
125
125
  return a.finish === "overtime" && e.push("OT"), a.finish === "shootout" && e.push("PK-SO"), a.forfeit && a.forfeit !== "none" && e.push("Forfeit"), { kind: "final", label: `Final${e.length ? ` · ${e.join(" · ")}` : ""}` };
126
126
  }
127
- return a.state === "postponed" ? { kind: "warn", label: "Postponed" } : a.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${y(a.date, { month: "short", day: "numeric" })} · ${U(a.time)}`.replace(/ · $/, "") };
127
+ return a.state === "postponed" ? { kind: "warn", label: "Postponed" } : a.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${$(a.date, { month: "short", day: "numeric" })} · ${U(a.time)}`.replace(/ · $/, "") };
128
128
  }
129
- const ve = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
130
- function x(a) {
129
+ const we = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
130
+ function S(a) {
131
131
  let e = String(a || "").replace(/^[a-z][a-z0-9+.-]*:\/\/[^/#?]*/i, "");
132
132
  const t = e.indexOf("#");
133
133
  let s = "";
134
134
  t !== -1 && (s = e.slice(t).split("?")[0], e = e.slice(0, t));
135
- let o = e.split("?")[0] + s;
136
- return o = o.replace(/([^:])\/{2,}/g, "$1/").replace(/^\/{2,}/, "/"), o = o.replace(/^\/(?=#)/, ""), o.length > 1 && (o = o.replace(/\/+$/, "")), o.toLowerCase();
135
+ let r = e.split("?")[0] + s;
136
+ return r = r.replace(/([^:])\/{2,}/g, "$1/").replace(/^\/{2,}/, "/"), r = r.replace(/^\/(?=#)/, ""), r.length > 1 && (r = r.replace(/\/+$/, "")), r.toLowerCase();
137
137
  }
138
- function ae() {
138
+ function oe() {
139
139
  const a = globalThis.location;
140
140
  if (!a) return "";
141
141
  const e = (a.hash || "").startsWith("#/") ? a.hash : "";
142
- return x((a.pathname || "") + e);
142
+ return S((a.pathname || "") + e);
143
143
  }
144
- function be(a, e, t) {
144
+ function xe(a, e, t) {
145
145
  if (!t) return null;
146
- const s = x(a);
146
+ const s = S(a);
147
147
  if (!s) return null;
148
- const o = x(u(e.game, { sport: t, id: "" })), r = x(u(e.school, { id: "" }));
149
- if (s === o || s.startsWith(`${o}/`) || s === r || s.startsWith(`${r}/`)) return null;
150
- const d = x(u(e.section, { sport: t, view: "" }));
151
- if (s === d) return "";
152
- if (!s.startsWith(`${d}/`)) return null;
153
- const n = s.slice(d.length + 1), h = n.split("/");
154
- return h.length > 2 || h.some((l) => !/^[a-z][a-z-]*$/.test(l)) || ve.has(h[0]) ? null : n;
148
+ const r = S(g(e.game, { sport: t, id: "" })), o = S(g(e.school, { id: "" }));
149
+ if (s === r || s.startsWith(`${r}/`) || s === o || s.startsWith(`${o}/`)) return null;
150
+ const l = S(g(e.section, { sport: t, view: "" }));
151
+ if (s === l) return "";
152
+ if (!s.startsWith(`${l}/`)) return null;
153
+ const i = s.slice(l.length + 1), h = i.split("/");
154
+ return h.length > 2 || h.some((d) => !/^[a-z][a-z-]*$/.test(d)) || we.has(h[0]) ? null : i;
155
155
  }
156
- function ye(a, e, t) {
157
- const s = (d) => u(t.section, { sport: a, view: d }).replace(/([^:])\/{2,}/g, "$1/"), r = new Set((e || []).map((d) => d && d.gender).filter((d) => d === "boys" || d === "girls")).size === 2 ? [
156
+ function ke(a, e, t) {
157
+ 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 ? [
158
158
  { label: "Boys Standings", href: s("boys/standings") },
159
159
  { label: "Girls Standings", href: s("girls/standings") }
160
160
  ] : [{ label: "Standings", href: s("standings") }];
161
161
  return [
162
- { label: `${T(a)} Home`, href: s("") },
162
+ { label: `${I(a)} Home`, href: s("") },
163
163
  { label: "Scores/Schedule", href: s("scores") },
164
164
  { label: "Playoff Brackets", href: s("brackets") },
165
- ...r,
165
+ ...o,
166
166
  { label: "Polls & Rankings", href: s("rankings") }
167
167
  ];
168
168
  }
169
- function $e(a, e = ae()) {
170
- const t = x(e);
169
+ function Se(a, e = oe()) {
170
+ const t = S(e);
171
171
  for (const s of a.querySelectorAll(':scope > a[slot="nav"]'))
172
- t && x(s.getAttribute("href")) === t ? s.setAttribute("aria-current", "page") : s.removeAttribute("aria-current");
172
+ t && S(s.getAttribute("href")) === t ? s.setAttribute("aria-current", "page") : s.removeAttribute("aria-current");
173
173
  }
174
- class $ extends te {
174
+ class w extends ae {
175
175
  static properties = {
176
176
  api: { type: String },
177
177
  refreshInterval: { type: Number, attribute: "refresh-interval" },
@@ -190,7 +190,7 @@ class $ extends te {
190
190
  this._client = e, this.isConnected && this.load();
191
191
  }
192
192
  get client() {
193
- return this._client ? this._client : this.api ? he({ baseUrl: this.api }) : null;
193
+ return this._client ? this._client : this.api ? ue({ baseUrl: this.api }) : null;
194
194
  }
195
195
  connectedCallback() {
196
196
  super.connectedCallback(), this._setupInterval();
@@ -202,7 +202,7 @@ class $ extends te {
202
202
  this.load();
203
203
  }
204
204
  updated(e) {
205
- e.has("api") && e.get("api") !== void 0 && e.get("api") !== this.api && this.load(), e.has("refreshInterval") && this._setupInterval(), $e(this);
205
+ e.has("api") && e.get("api") !== void 0 && e.get("api") !== this.api && this.load(), e.has("refreshInterval") && this._setupInterval(), Se(this);
206
206
  }
207
207
  async load() {
208
208
  const e = this.client;
@@ -231,13 +231,13 @@ class $ extends te {
231
231
  this._refreshId && (clearInterval(this._refreshId), this._refreshId = null);
232
232
  }
233
233
  render() {
234
- return this.error === "not-configured" ? i`<div class="error">This component needs an <code>api</code> attribute (the api-hsot public read-surface base URL) or an injected client.</div>` : this.error ? i`<div class="error">Unable to load right now. <button class="chip" @click=${() => this.load()}>Retry</button></div>` : this.data ? this.renderView() : i`<div class="loading" role="status">Loading…</div>`;
234
+ return this.error === "not-configured" ? n`<div class="error">This component needs an <code>api</code> attribute (the api-hsot public read-surface base URL) or an injected client.</div>` : this.error ? n`<div class="error">Unable to load right now. <button class="chip" @click=${() => this.load()}>Retry</button></div>` : this.data ? this.renderView() : n`<div class="loading" role="status">Loading…</div>`;
235
235
  }
236
236
  renderView() {
237
- return i``;
237
+ return n``;
238
238
  }
239
239
  }
240
- const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), we = b`
240
+ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), Te = y`
241
241
  :host {
242
242
  --hsot-red: var(--color-red, #D1232A);
243
243
  --hsot-red-deep: var(--color-red-dark, #951C21);
@@ -275,7 +275,7 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), we = b`
275
275
  outline-offset: 1px;
276
276
  }
277
277
  .mut { color: var(--hsot-gray-5); }
278
- `, xe = b`
278
+ `, Ie = y`
279
279
  .band { background: var(--hsot-white); color: var(--hsot-black); }
280
280
  .band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
281
281
  .band h1, .band h2.bandtitle {
@@ -324,7 +324,7 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), we = b`
324
324
  @media (max-width: 720px) {
325
325
  .band h1, .band h2.bandtitle, .band.section h1, .band.section h2.bandtitle { font-size: 1.8rem; }
326
326
  }
327
- `, ke = b`
327
+ `, Ce = y`
328
328
  .view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
329
329
  /* Optional right rail (slot="rail" light-DOM children): a divided 300px
330
330
  column on desktop, stacked under the view content on smaller screens. */
@@ -388,7 +388,7 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), we = b`
388
388
  .error { padding: 1.2rem 1rem; color: var(--hsot-red-deep); font-size: 0.9rem; }
389
389
  .note { font-size: 0.8125rem; color: var(--hsot-gray-5); margin: 0.6rem 0 0; }
390
390
  .loading { padding: 1.2rem; color: var(--hsot-gray-5); font-family: var(--hsot-heading-font); }
391
- `, Se = b`
391
+ `, De = y`
392
392
  .pill {
393
393
  display: inline-block; font-family: var(--hsot-heading-font); font-weight: 700;
394
394
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
@@ -403,7 +403,7 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), we = b`
403
403
  .pill.champ { background: var(--hsot-straw); color: #6b5900; }
404
404
  @keyframes hsot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
405
405
  @media (prefers-reduced-motion: reduce) { .pill.live { animation: none; } }
406
- `, Te = b`
406
+ `, Fe = y`
407
407
  .tablewrap { overflow-x: auto; }
408
408
  table.data { font-family: var(--hsot-heading-font); font-size: 14px; border-collapse: collapse; width: 100%; }
409
409
  table.data th {
@@ -421,7 +421,7 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), we = b`
421
421
  table.data tbody tr.rowlink:hover { background: var(--hsot-gray-1); }
422
422
  table.data td.teamcell a { color: inherit; text-decoration: none; font-weight: 500; }
423
423
  table.data td.teamcell a:hover { text-decoration: underline; }
424
- `, Ie = b`
424
+ `, ze = y`
425
425
  .swatch {
426
426
  display: inline-flex; align-items: center; justify-content: center;
427
427
  width: 26px; height: 26px; border-radius: 50%;
@@ -445,7 +445,7 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), we = b`
445
445
  .dot.W { background: var(--hsot-win); }
446
446
  .dot.L { background: var(--hsot-loss); }
447
447
  .dot.T { background: var(--hsot-tie); }
448
- `, Ce = b`
448
+ `, Pe = y`
449
449
  ul.gamelist { list-style: none; margin: 0; padding: 0; }
450
450
  .gamelist li {
451
451
  display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 1rem;
@@ -495,183 +495,183 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), we = b`
495
495
  .gamelist .ff { color: var(--hsot-gray-5); font-size: 0.78rem; font-style: italic; }
496
496
  .gamelist .where { color: var(--hsot-gray-5); font-size: 0.78rem; }
497
497
  .gamelist a.box { font-size: 0.78rem; }
498
- `, F = [we, xe, ke, Se, Te, Ie, Ce];
498
+ `, z = [Te, Ie, Ce, De, Fe, ze, Pe];
499
499
  function G(a) {
500
500
  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";
501
501
  }
502
- function De(a) {
502
+ function Be(a) {
503
503
  return a && (a.forfeit === "home" || a.forfeit === "away") ? a.forfeit : null;
504
504
  }
505
- function z(a, e) {
506
- 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, d) => String(r.date).localeCompare(String(d.date)));
507
- for (const r of o) {
508
- const d = G(r), n = r.gameType === "conference";
505
+ function P(a, e) {
506
+ 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)));
507
+ for (const o of r) {
508
+ const l = G(o), i = o.gameType === "conference";
509
509
  for (const h of ["home", "away"]) {
510
- const l = h === "home" ? r.homeTeamId : r.awayTeamId;
511
- if (!l) continue;
512
- const c = s(l), m = h === "home" ? r.homeScore : r.awayScore, f = h === "home" ? r.awayScore : r.homeScore;
510
+ const d = h === "home" ? o.homeTeamId : o.awayTeamId;
511
+ if (!d) continue;
512
+ const c = s(d), m = h === "home" ? o.homeScore : o.awayScore, f = h === "home" ? o.awayScore : o.homeScore;
513
513
  c.pf += m, c.pa += f;
514
- let g = "T";
515
- d === "tie" ? (c.t += 1, n && (c.ct += 1)) : d === h ? (c.w += 1, n && (c.cw += 1), g = "W") : (c.l += 1, n && (c.cl += 1), g = "L"), c.results.push({ gameId: r.id, date: r.date, mark: g, my: m, their: f, opp: h === "home" ? r.awayTeamId : r.homeTeamId, conf: n });
514
+ let u = "T";
515
+ l === "tie" ? (c.t += 1, i && (c.ct += 1)) : l === h ? (c.w += 1, i && (c.cw += 1), u = "W") : (c.l += 1, i && (c.cl += 1), u = "L"), c.results.push({ gameId: o.id, date: o.date, mark: u, my: m, their: f, opp: h === "home" ? o.awayTeamId : o.homeTeamId, conf: i });
516
516
  }
517
517
  }
518
518
  return t;
519
519
  }
520
- function L(a) {
520
+ function H(a) {
521
521
  if (!a || !a.length) return "";
522
522
  const e = a[a.length - 1].mark;
523
523
  let t = 0;
524
524
  for (let s = a.length - 1; s >= 0 && a[s].mark === e; s -= 1) t += 1;
525
525
  return e + t;
526
526
  }
527
- const Z = (a, e, t) => {
527
+ const ee = (a, e, t) => {
528
528
  const s = a + e + t;
529
529
  return s ? (a + t / 2) / s : 0;
530
- }, J = (a) => a.toFixed(3).replace("0.", ".");
531
- function w(a, e = !1) {
530
+ }, te = (a) => a.toFixed(3).replace("0.", ".");
531
+ function k(a, e = !1) {
532
532
  if (!a) return "0-0";
533
- const t = e ? a.cw : a.w, s = e ? a.cl : a.l, o = e ? a.ct : a.t;
534
- return `${t}-${s}${o ? `-${o}` : ""}`;
533
+ const t = e ? a.cw : a.w, s = e ? a.cl : a.l, r = e ? a.ct : a.t;
534
+ return `${t}-${s}${r ? `-${r}` : ""}`;
535
535
  }
536
- function oe(a, e) {
536
+ function ne(a, e) {
537
537
  return a.map((t) => {
538
538
  const s = e[t.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] };
539
- return { team: t, rec: s, confPct: Z(s.cw, s.cl, s.ct), overallPct: Z(s.w, s.l, s.t) };
539
+ return { team: t, rec: s, confPct: ee(s.cw, s.cl, s.ct), overallPct: ee(s.w, s.l, s.t) };
540
540
  }).sort((t, s) => s.confPct - t.confPct || s.overallPct - t.overallPct || s.rec.pf - s.rec.pa - (t.rec.pf - t.rec.pa));
541
541
  }
542
- function q(a, e) {
542
+ function W(a, e) {
543
543
  return a.filter((t) => (t.homeTeamId === e || t.awayTeamId === e) && (t.state === "scheduled" || t.state === "live") && t.gameType !== "scrimmage").sort((t, s) => String(t.date).localeCompare(String(s.date)))[0] || null;
544
544
  }
545
- function ee(a, e) {
545
+ function se(a, e) {
546
546
  const t = a[e];
547
547
  return t && t.results.length ? t.results[t.results.length - 1] : null;
548
548
  }
549
- function Ye(a, e, t, s = "") {
550
- let o = null;
551
- for (const r of a || [])
552
- r.sport === e && (t && r.effectiveDate > t || s && r.gender && r.gender !== s || (!o || r.effectiveDate > o.effectiveDate) && (o = r));
553
- return o;
549
+ function st(a, e, t, s = "") {
550
+ let r = null;
551
+ for (const o of a || [])
552
+ o.sport === e && (t && o.effectiveDate > t || s && o.gender && o.gender !== s || (!r || o.effectiveDate > r.effectiveDate) && (r = o));
553
+ return r;
554
554
  }
555
- function W(a, e, t, s, o) {
556
- const r = e[t];
557
- if (!r) return null;
558
- const d = /* @__PURE__ */ new Map();
555
+ function V(a, e, t, s, r) {
556
+ const o = e[t];
557
+ if (!o) return null;
558
+ const l = /* @__PURE__ */ new Map();
559
559
  for (const h of a || []) {
560
- if (h.sport !== s || o && h.effectiveDate > o || h.gender && r.gender !== h.gender && r.gender !== "coed") continue;
561
- const l = h.gender || "", c = d.get(l);
562
- (!c || h.effectiveDate > c.effectiveDate) && d.set(l, h);
560
+ if (h.sport !== s || r && h.effectiveDate > r || h.gender && o.gender !== h.gender && o.gender !== "coed") continue;
561
+ const d = h.gender || "", c = l.get(d);
562
+ (!c || h.effectiveDate > c.effectiveDate) && l.set(d, h);
563
563
  }
564
- let n = null;
565
- for (const h of d.values()) {
566
- const l = (h.teamIds || []).indexOf(t);
567
- l !== -1 && (!n || h.effectiveDate > n.effectiveDate) && (n = { poll: h, rank: l + 1 });
564
+ let i = null;
565
+ for (const h of l.values()) {
566
+ const d = (h.teamIds || []).indexOf(t);
567
+ d !== -1 && (!i || h.effectiveDate > i.effectiveDate) && (i = { poll: h, rank: d + 1 });
568
568
  }
569
- return n ? n.rank : null;
569
+ return i ? i.rank : null;
570
570
  }
571
- function Fe(a, e, t) {
571
+ function Ae(a, e, t) {
572
572
  if (!a) return { kind: "none", delta: 0 };
573
573
  const s = (a.teamIds || []).indexOf(t) + 1;
574
574
  if (!s) return { kind: "none", delta: 0 };
575
575
  if (!e) return { kind: "same", delta: 0 };
576
- const o = (e.teamIds || []).indexOf(t) + 1;
577
- if (!o) return { kind: "new", delta: 0 };
578
- const r = o - s;
579
- return r > 0 ? { kind: "up", delta: r } : r < 0 ? { kind: "down", delta: -r } : { kind: "same", delta: 0 };
576
+ const r = (e.teamIds || []).indexOf(t) + 1;
577
+ if (!r) return { kind: "new", delta: 0 };
578
+ const o = r - s;
579
+ return o > 0 ? { kind: "up", delta: o } : o < 0 ? { kind: "down", delta: -o } : { kind: "same", delta: 0 };
580
580
  }
581
- function ze(a) {
581
+ function Ee(a) {
582
582
  return /^https?:\/\//i.test(String(a || ""));
583
583
  }
584
- function re(a, { w: e, h: t } = {}) {
585
- if (!ze(a)) return "";
584
+ function ie(a, { w: e, h: t } = {}) {
585
+ if (!Ee(a)) return "";
586
586
  const s = [];
587
587
  e && s.push(`w=${Math.max(1, Math.round(e))}`), t && s.push(`h=${Math.max(1, Math.round(t))}`), s.push("f=webp");
588
- const o = a.includes("?") ? "&" : "?";
589
- return `${a}${o}${s.join("&")}`;
588
+ const r = a.includes("?") ? "&" : "?";
589
+ return `${a}${r}${s.join("&")}`;
590
590
  }
591
- function E(a, e) {
591
+ function R(a, e) {
592
592
  const t = e * 2;
593
- return re(a?.logoAssetId, { w: t, h: t });
593
+ return ie(a?.logoAssetId, { w: t, h: t });
594
594
  }
595
- function Be(a, e) {
596
- return re(a?.photoAssetId, { w: e * 2 });
595
+ function _e(a, e) {
596
+ return ie(a?.photoAssetId, { w: e * 2 });
597
597
  }
598
- function V(a, e, { title: t, sub: s, teams: o }) {
599
- const r = ae(), n = !!a.querySelector(':scope > a[slot="nav"]') || be(r, e.hrefs, e.sport) !== null;
600
- return i`
598
+ function Y(a, e, { title: t, sub: s, teams: r }) {
599
+ const o = oe(), i = !!a.querySelector(':scope > a[slot="nav"]') || xe(o, e.hrefs, e.sport) !== null;
600
+ return n`
601
601
  <div class="band section">
602
602
  <div class="inner">
603
603
  <h1>${t}</h1>
604
- ${s ? i`<p class="sub">${s}</p>` : p}
604
+ ${s ? n`<p class="sub">${s}</p>` : p}
605
605
  </div>
606
- ${n ? i`
607
- <nav class="sectionnav" aria-label="${T(e.sport)} section">
606
+ ${i ? n`
607
+ <nav class="sectionnav" aria-label="${I(e.sport)} section">
608
608
  <div class="navrow">
609
609
  <slot name="nav">
610
- ${ye(e.sport, o, e.hrefs).map((h) => i`<a href=${h.href}
611
- aria-current=${r && x(h.href) === r ? "page" : p}>${h.label}</a>`)}
610
+ ${ke(e.sport, r, e.hrefs).map((h) => n`<a href=${h.href}
611
+ aria-current=${o && S(h.href) === o ? "page" : p}>${h.label}</a>`)}
612
612
  </slot>
613
613
  </div>
614
614
  </nav>` : p}
615
615
  </div>
616
616
  `;
617
617
  }
618
- const I = (a, e) => {
618
+ const C = (a, e) => {
619
619
  const t = a.teamsById[e];
620
620
  return t ? a.schoolsById[t.schoolId] : null;
621
- }, S = (a, e) => I(a, e)?.name || "TBD", _ = (a, e) => I(a, e)?.abbr || "TBD";
622
- function C(a, e = 26) {
621
+ }, T = (a, e) => C(a, e)?.name || "TBD", N = (a, e) => C(a, e)?.abbr || "TBD";
622
+ function D(a, e = 26) {
623
623
  if (!a) return p;
624
- const t = E(a, e);
624
+ const t = R(a, e);
625
625
  if (t)
626
- return i`<img class="swatch logo" aria-hidden="true" alt="" loading="lazy"
626
+ return n`<img class="swatch logo" aria-hidden="true" alt="" loading="lazy"
627
627
  src=${t} style="width:${e}px;height:${e}px" />`;
628
- const s = a.colorPrimary || "#030711", o = A(s);
629
- return i`<span class="swatch" aria-hidden="true"
630
- style="width:${e}px;height:${e}px;background:${s};color:${o};font-size:${Math.max(8, e * 0.28)}px"
631
- >${j(a)}</span>`;
628
+ const s = a.colorPrimary || "#030711", r = _(s);
629
+ return n`<span class="swatch" aria-hidden="true"
630
+ style="width:${e}px;height:${e}px;background:${s};color:${r};font-size:${Math.max(8, e * 0.28)}px"
631
+ >${q(a)}</span>`;
632
632
  }
633
- function Y(a, e, t) {
634
- const s = W(a.rankings, a.teamsById, e, a.sport, t);
635
- return s ? i`<span class="rankbadge">#${s}</span>` : p;
633
+ function Q(a, e, t) {
634
+ const s = V(a.rankings, a.teamsById, e, a.sport, t);
635
+ return s ? n`<span class="rankbadge">#${s}</span>` : p;
636
636
  }
637
- function ie(a, e, t) {
638
- const s = I(a, e);
639
- return s ? i`${Y(a, e, t)}<a href=${u(a.hrefs.school, { id: s.id })}>${s.name}</a>` : i`<span class="mut">TBD</span>`;
637
+ function le(a, e, t) {
638
+ const s = C(a, e);
639
+ 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>`;
640
640
  }
641
641
  function K(a, e, t = 5) {
642
642
  const s = a.records[e];
643
- if (!s || !s.results.length) return i`<span class="mut">·</span>`;
644
- const o = s.results.slice(-1 * t);
645
- return i`<span class="dots" role="img" aria-label="last ${o.length} results">
646
- ${o.map((r) => i`<a class="dot ${r.mark}"
647
- title="${r.mark} ${r.my}-${r.their} vs ${S(a, r.opp)}"
648
- href=${u(a.hrefs.game, { sport: a.sport, id: r.gameId })}>${r.mark}</a>`)}
643
+ if (!s || !s.results.length) return n`<span class="mut">·</span>`;
644
+ const r = s.results.slice(-1 * t);
645
+ return n`<span class="dots" role="img" aria-label="last ${r.length} results">
646
+ ${r.map((o) => n`<a class="dot ${o.mark}"
647
+ title="${o.mark} ${o.my}-${o.their} vs ${T(a, o.opp)}"
648
+ href=${g(a.hrefs.game, { sport: a.sport, id: o.gameId })}>${o.mark}</a>`)}
649
649
  </span>`;
650
650
  }
651
651
  function B(a, e) {
652
- return a.querySelector(':scope > [slot="rail"]') ? i`<div class="view withrail">
652
+ return a.querySelector(':scope > [slot="rail"]') ? n`<div class="view withrail">
653
653
  <div class="viewmain">${e}</div>
654
654
  <aside class="viewrail"><slot name="rail"></slot></aside>
655
- </div>` : i`<div class="view">${e}</div>`;
655
+ </div>` : n`<div class="view">${e}</div>`;
656
656
  }
657
- function P(a) {
657
+ function A(a) {
658
658
  if (!a.promoImage) return p;
659
- const e = i`<img src=${a.promoImage} alt=${a.promoAlt || "Sponsor"}>`;
660
- return i`<div class="promo">${a.promoHref ? i`<a href=${a.promoHref} target="_blank" rel="sponsored noopener">${e}</a>` : e}</div>`;
659
+ const e = n`<img src=${a.promoImage} alt=${a.promoAlt || "Sponsor"}>`;
660
+ return n`<div class="promo">${a.promoHref ? n`<a href=${a.promoHref} target="_blank" rel="sponsored noopener">${e}</a>` : e}</div>`;
661
661
  }
662
- function R(a) {
663
- const e = se(a);
664
- return i`<span class="pill ${e.kind}">${e.label}</span>`;
662
+ function L(a) {
663
+ const e = re(a);
664
+ return n`<span class="pill ${e.kind}">${e.label}</span>`;
665
665
  }
666
- function ne(a, e, t) {
667
- if (!e) return i`<span class="mut">·</span>`;
668
- const s = e.homeTeamId === t ? e.awayTeamId : e.homeTeamId, o = e.homeTeamId === t ? "vs" : "at";
669
- return i`${e.state === "live" ? i`<span class="pill live">Live</span> ` : i`${y(e.date, { month: "numeric", day: "numeric" })} `}${o} ${_(a, s)}`;
666
+ function ce(a, e, t) {
667
+ if (!e) return n`<span class="mut">·</span>`;
668
+ const s = e.homeTeamId === t ? e.awayTeamId : e.homeTeamId, r = e.homeTeamId === t ? "vs" : "at";
669
+ return n`${e.state === "live" ? n`<span class="pill live">Live</span> ` : n`${$(e.date, { month: "numeric", day: "numeric" })} `}${r} ${N(a, s)}`;
670
670
  }
671
- class Pe extends $ {
672
- static styles = F;
671
+ class Re extends w {
672
+ static styles = z;
673
673
  static properties = {
674
- ...$.properties,
674
+ ...w.properties,
675
675
  sport: { type: String },
676
676
  season: { type: String },
677
677
  date: { type: String }
@@ -687,57 +687,57 @@ class Pe extends $ {
687
687
  this._datePinned = !!this.date;
688
688
  }
689
689
  async fetchData(e) {
690
- const t = this.season || N(), [s, o, r, d, n] = await Promise.all([
690
+ const t = this.season || M(), [s, r, o, l, i] = await Promise.all([
691
691
  e.listSchools(),
692
692
  e.listTeams({ sport: this.sport }),
693
693
  e.listConferences(),
694
694
  e.listGames({ sport: this.sport, season: t }),
695
695
  e.listRankings({ sport: this.sport })
696
696
  ]);
697
- return this._datePinned || (this.date = fe(d.items.map((h) => h.date)), this._datePinned = !0), {
697
+ return this._datePinned || (this.date = be(l.items.map((h) => h.date)), this._datePinned = !0), {
698
698
  season: t,
699
699
  schools: s.items,
700
- teams: o.items,
701
- conferences: r.items,
702
- games: d.items,
703
- rankings: n.items
700
+ teams: r.items,
701
+ conferences: o.items,
702
+ games: l.items,
703
+ rankings: i.items
704
704
  };
705
705
  }
706
706
  get ctx() {
707
707
  return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
708
708
  teamsById: v(this.data.teams),
709
709
  schoolsById: v(this.data.schools),
710
- records: z(this.data.games),
710
+ records: P(this.data.games),
711
711
  rankings: this.data.rankings,
712
- hrefs: D(this),
712
+ hrefs: F(this),
713
713
  sport: this.sport
714
714
  }, this._ctxData = this.data), this._ctx;
715
715
  }
716
716
  renderView() {
717
- const e = this.ctx, t = v(this.data.conferences), s = [...new Set(this.data.games.map((l) => l.date).filter(Boolean))].sort(), o = Number.MAX_SAFE_INTEGER, r = (l) => {
718
- const c = [l.awayTeamId, l.homeTeamId].map((m) => W(e.rankings, e.teamsById, m, this.sport, l.date)).filter(Boolean);
719
- return c.length ? Math.min(...c) : o;
720
- }, d = this.data.games.filter((l) => l.date === this.date), n = new Map(d.map((l) => [l, r(l)]));
721
- d.sort((l, c) => (l.state === "live" ? 0 : 1) - (c.state === "live" ? 0 : 1) || n.get(l) - n.get(c));
717
+ const e = this.ctx, t = v(this.data.conferences), s = [...new Set(this.data.games.map((d) => d.date).filter(Boolean))].sort(), r = Number.MAX_SAFE_INTEGER, o = (d) => {
718
+ const c = [d.awayTeamId, d.homeTeamId].map((m) => V(e.rankings, e.teamsById, m, this.sport, d.date)).filter(Boolean);
719
+ return c.length ? Math.min(...c) : r;
720
+ }, l = this.data.games.filter((d) => d.date === this.date), i = new Map(l.map((d) => [d, o(d)]));
721
+ l.sort((d, c) => (d.state === "live" ? 0 : 1) - (c.state === "live" ? 0 : 1) || i.get(d) - i.get(c));
722
722
  const h = /* @__PURE__ */ new Map();
723
- return d.forEach((l) => {
724
- const c = l.gameType === "conference" && l.conferenceId ? t[l.conferenceId]?.name || "Conference" : l.gameType === "playoff" ? "Playoffs" : l.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
725
- h.has(c) || h.set(c, []), h.get(c).push(l);
726
- }), i`
727
- ${V(this, e, {
728
- title: i`${T(this.sport)} scores &amp; schedules`,
729
- sub: i`${y(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${d.length} games`,
723
+ return l.forEach((d) => {
724
+ const c = d.gameType === "conference" && d.conferenceId ? t[d.conferenceId]?.name || "Conference" : d.gameType === "playoff" ? "Playoffs" : d.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
725
+ h.has(c) || h.set(c, []), h.get(c).push(d);
726
+ }), n`
727
+ ${Y(this, e, {
728
+ title: n`${I(this.sport)} scores &amp; schedules`,
729
+ sub: n`${$(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${l.length} games`,
730
730
  teams: this.data.teams
731
731
  })}
732
- ${B(this, i`
733
- ${P(this)}
732
+ ${B(this, n`
733
+ ${A(this)}
734
734
  <div class="toolbar">
735
735
  <label class="asof" for="datesel">Date</label>
736
- <select id="datesel" @change=${(l) => {
737
- this.date = l.target.value;
736
+ <select id="datesel" @change=${(d) => {
737
+ this.date = d.target.value;
738
738
  }}>
739
- ${(s.includes(this.date) ? s : [...s, this.date].sort()).map((l) => i`<option value=${l} ?selected=${l === this.date}>
740
- ${y(l, { weekday: "short", month: "short", day: "numeric" })}${l === M() ? " · today" : ""}
739
+ ${(s.includes(this.date) ? s : [...s, this.date].sort()).map((d) => n`<option value=${d} ?selected=${d === this.date}>
740
+ ${$(d, { weekday: "short", month: "short", day: "numeric" })}${d === j() ? " · today" : ""}
741
741
  </option>`)}
742
742
  </select>
743
743
  <button class="chip" ?disabled=${s.indexOf(this.date) <= 0}
@@ -751,9 +751,9 @@ class Pe extends $ {
751
751
  <span class="spacer"></span>
752
752
  <span class="asof">Live games first · report a score to see it update here</span>
753
753
  </div>
754
- ${d.length ? p : i`<p class="empty">No ${this.sport} games on this date.</p>`}
755
- ${[...h.entries()].map(([l, c]) => i`
756
- <div class="section-title">${l}</div>
754
+ ${l.length ? p : n`<p class="empty">No ${this.sport} games on this date.</p>`}
755
+ ${[...h.entries()].map(([d, c]) => n`
756
+ <div class="section-title">${d}</div>
757
757
  <div class="card"><ul class="gamelist">
758
758
  ${c.map((m) => this.renderGame(e, m))}
759
759
  </ul></div>
@@ -765,24 +765,24 @@ class Pe extends $ {
765
765
  // a lone score column on the far right read as detached from the teams).
766
766
  // Scheduled games carry their start time on the status pill alone.
767
767
  renderGame(e, t) {
768
- const s = t.state === "final" || t.state === "live", o = (d, n, h = p) => i`<span class="side">${ie(e, d, t.date)}${s ? i`<span class="score">${n}</span>` : p}${h}</span>`, r = De(t);
769
- return i`
768
+ const s = t.state === "final" || t.state === "live", r = (l, i, h = p) => n`<span class="side">${le(e, l, t.date)}${s ? n`<span class="score">${i}</span>` : p}${h}</span>`, o = Be(t);
769
+ return n`
770
770
  <li>
771
- ${R(t)}
772
- <span class="opp matchup">${o(t.awayTeamId, t.awayScore, i`<span class="at">at</span>`)}${o(t.homeTeamId, t.homeScore)}</span>
773
- ${r ? i`<span class="ff">${S(e, r === "home" ? t.homeTeamId : t.awayTeamId)} forfeited</span>` : p}
771
+ ${L(t)}
772
+ <span class="opp matchup">${r(t.awayTeamId, t.awayScore, n`<span class="at">at</span>`)}${r(t.homeTeamId, t.homeScore)}</span>
773
+ ${o ? n`<span class="ff">${T(e, o === "home" ? t.homeTeamId : t.awayTeamId)} forfeited</span>` : p}
774
774
  <span class="where">${t.venue || ""}</span>
775
- ${t.broadcast ? i`<span class="pill class">${t.broadcast}</span>` : p}
776
- <a class="box" href=${u(e.hrefs.game, { sport: this.sport, id: t.id })}>Box score →</a>
775
+ ${t.broadcast ? n`<span class="pill class">${t.broadcast}</span>` : p}
776
+ <a class="box" href=${g(e.hrefs.game, { sport: this.sport, id: t.id })}>Box score →</a>
777
777
  </li>
778
778
  `;
779
779
  }
780
780
  }
781
- globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", Pe);
782
- class Ae extends $ {
783
- static styles = F;
781
+ globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", Re);
782
+ class Ne extends w {
783
+ static styles = z;
784
784
  static properties = {
785
- ...$.properties,
785
+ ...w.properties,
786
786
  sport: { type: String },
787
787
  season: { type: String },
788
788
  classFilter: { state: !0 },
@@ -792,7 +792,7 @@ class Ae extends $ {
792
792
  super(), this.sport = "football", this.season = "", this.classFilter = "All", this.query = "";
793
793
  }
794
794
  async fetchData(e) {
795
- const t = this.season || N(), [s, o, r, d, n] = await Promise.all([
795
+ const t = this.season || M(), [s, r, o, l, i] = await Promise.all([
796
796
  e.listConferences({ active: !0 }),
797
797
  e.listSchools(),
798
798
  e.listTeams({ sport: this.sport }),
@@ -802,60 +802,60 @@ class Ae extends $ {
802
802
  return {
803
803
  season: t,
804
804
  conferences: s.items,
805
- schools: o.items,
806
- teams: r.items,
807
- games: d.items,
808
- rankings: n.items
805
+ schools: r.items,
806
+ teams: o.items,
807
+ games: l.items,
808
+ rankings: i.items
809
809
  };
810
810
  }
811
811
  get ctx() {
812
812
  return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
813
813
  teamsById: v(this.data.teams),
814
814
  schoolsById: v(this.data.schools),
815
- records: z(this.data.games),
815
+ records: P(this.data.games),
816
816
  rankings: this.data.rankings,
817
- hrefs: D(this),
817
+ hrefs: F(this),
818
818
  sport: this.sport
819
819
  }, this._ctxData = this.data), this._ctx;
820
820
  }
821
821
  renderView() {
822
- const e = this.ctx, t = ["All", ...[...new Set(this.data.conferences.flatMap((o) => o.classifications || []))].sort(X)].slice(0, 9), s = this.data.conferences.filter((o) => o.active !== !1).filter((o) => this.classFilter === "All" || (o.classifications || []).includes(this.classFilter)).sort(ge);
823
- return i`
824
- ${V(this, e, {
825
- title: i`${T(this.sport)} standings`,
826
- sub: i`${this.data.season} season · every conference, computed live from reported results`,
822
+ const e = this.ctx, t = ["All", ...[...new Set(this.data.conferences.flatMap((r) => r.classifications || []))].sort(J)].slice(0, 9), s = this.data.conferences.filter((r) => r.active !== !1).filter((r) => this.classFilter === "All" || (r.classifications || []).includes(this.classFilter)).sort($e);
823
+ return n`
824
+ ${Y(this, e, {
825
+ title: n`${I(this.sport)} standings`,
826
+ sub: n`${this.data.season} season · every conference, computed live from reported results`,
827
827
  teams: this.data.teams
828
828
  })}
829
- ${B(this, i`
830
- ${P(this)}
829
+ ${B(this, n`
830
+ ${A(this)}
831
831
  <div class="toolbar">
832
832
  <div role="group" aria-label="Classification filter">
833
- ${t.map((o) => i`<button class="chip ${this.classFilter === o ? "on" : ""}"
833
+ ${t.map((r) => n`<button class="chip ${this.classFilter === r ? "on" : ""}"
834
834
  @click=${() => {
835
- this.classFilter = o;
836
- }}>${o}</button>`)}
835
+ this.classFilter = r;
836
+ }}>${r}</button>`)}
837
837
  </div>
838
838
  <input type="search" placeholder="Find a school…" aria-label="Find a school"
839
- .value=${this.query} @input=${(o) => {
840
- this.query = o.target.value;
839
+ .value=${this.query} @input=${(r) => {
840
+ this.query = r.target.value;
841
841
  }}>
842
842
  <span class="spacer"></span>
843
- <span class="asof">Records through ${y(M(), { month: "long", day: "numeric" })} · conference games count toward both records · scrimmages toward neither</span>
843
+ <span class="asof">Records through ${$(j(), { month: "long", day: "numeric" })} · conference games count toward both records · scrimmages toward neither</span>
844
844
  </div>
845
- ${s.map((o) => this.renderConference(e, o))}
845
+ ${s.map((r) => this.renderConference(e, r))}
846
846
  `)}
847
847
  `;
848
848
  }
849
849
  renderConference(e, t) {
850
- const s = this.data.teams.filter((d) => d.conferenceId === t.id);
850
+ const s = this.data.teams.filter((l) => l.conferenceId === t.id);
851
851
  if (!s.length) return p;
852
- const o = this.query.trim().toLowerCase(), r = oe(s, e.records);
853
- return i`
852
+ const r = this.query.trim().toLowerCase(), o = ne(s, e.records);
853
+ return n`
854
854
  <div class="card">
855
855
  <div class="card-head">
856
856
  <h2>${t.name}</h2>
857
- ${[...t.classifications || []].sort(X).map((d) => i`<span class="pill class">${d}</span>`)}
858
- <span class="meta">${r.length} teams · membership derives from teams</span>
857
+ ${[...t.classifications || []].sort(J).map((l) => n`<span class="pill class">${l}</span>`)}
858
+ <span class="meta">${o.length} teams · membership derives from teams</span>
859
859
  </div>
860
860
  <div class="tablewrap"><table class="data">
861
861
  <thead><tr>
@@ -864,43 +864,43 @@ class Ae extends $ {
864
864
  <th>Streak</th><th>Last 5</th><th>Next</th>
865
865
  </tr></thead>
866
866
  <tbody>
867
- ${r.map((d, n) => this.renderRow(e, d, n, o))}
867
+ ${o.map((l, i) => this.renderRow(e, l, i, r))}
868
868
  </tbody>
869
869
  </table></div>
870
870
  </div>
871
871
  `;
872
872
  }
873
- renderRow(e, t, s, o) {
874
- const r = e.schoolsById[t.team.schoolId], d = r?.name || t.team.name || "TBD";
875
- if (o && !d.toLowerCase().includes(o)) return p;
876
- const n = t.rec.pf - t.rec.pa, h = q(this.data.games, t.team.id), l = () => {
877
- location.href = u(e.hrefs.school, { id: t.team.schoolId });
873
+ renderRow(e, t, s, r) {
874
+ const o = e.schoolsById[t.team.schoolId], l = o?.name || t.team.name || "TBD";
875
+ if (r && !l.toLowerCase().includes(r)) return p;
876
+ const i = t.rec.pf - t.rec.pa, h = W(this.data.games, t.team.id), d = () => {
877
+ location.href = g(e.hrefs.school, { id: t.team.schoolId });
878
878
  };
879
- return i`
879
+ return n`
880
880
  <tr class="rowlink" @click=${(c) => {
881
- c.target.closest("a") || l();
881
+ c.target.closest("a") || d();
882
882
  }}>
883
883
  <td class="mut">${s + 1}</td>
884
884
  <td class="teamcell">
885
- ${C(r)}${Y(e, t.team.id, null)}
886
- <a href=${u(e.hrefs.school, { id: t.team.schoolId })}>${d}</a>
885
+ ${D(o)}${Q(e, t.team.id, null)}
886
+ <a href=${g(e.hrefs.school, { id: t.team.schoolId })}>${l}</a>
887
887
  </td>
888
- <td class="num">${w(t.rec, !0)}</td>
889
- <td class="num">${J(t.confPct)}</td>
890
- <td class="num">${w(t.rec)}</td>
891
- <td class="num">${J(t.overallPct)}</td>
888
+ <td class="num">${k(t.rec, !0)}</td>
889
+ <td class="num">${te(t.confPct)}</td>
890
+ <td class="num">${k(t.rec)}</td>
891
+ <td class="num">${te(t.overallPct)}</td>
892
892
  <td class="num">${t.rec.pf}</td>
893
893
  <td class="num">${t.rec.pa}</td>
894
- <td class="num" style="color:${n >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${n > 0 ? "+" : ""}${n}</td>
895
- <td>${L(t.rec.results) || "·"}</td>
894
+ <td class="num" style="color:${i >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${i > 0 ? "+" : ""}${i}</td>
895
+ <td>${H(t.rec.results) || "·"}</td>
896
896
  <td>${K(e, t.team.id)}</td>
897
- <td>${ne(e, h, t.team.id)}</td>
897
+ <td>${ce(e, h, t.team.id)}</td>
898
898
  </tr>
899
899
  `;
900
900
  }
901
901
  }
902
- globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", Ae);
903
- const Ee = b`
902
+ globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", Ne);
903
+ const Le = y`
904
904
  .hero1 {
905
905
  border-radius: var(--hsot-radius-md); color: var(--hsot-white);
906
906
  padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.2rem;
@@ -917,10 +917,10 @@ const Ee = b`
917
917
  .delta.new { background: var(--hsot-straw); color: #6b5900; border-radius: var(--hsot-radius-xs); padding: 0.1rem 0.3rem; font-size: 0.7rem; }
918
918
  .sparkline { vertical-align: middle; }
919
919
  `;
920
- class _e extends $ {
921
- static styles = [...F, Ee];
920
+ class Me extends w {
921
+ static styles = [...z, Le];
922
922
  static properties = {
923
- ...$.properties,
923
+ ...w.properties,
924
924
  sport: { type: String },
925
925
  gender: { type: String },
926
926
  season: { type: String },
@@ -935,73 +935,73 @@ class _e extends $ {
935
935
  e && (this.pollDate = e);
936
936
  }
937
937
  async fetchData(e) {
938
- const t = this.season || N(), [s, o, r, d, n] = await Promise.all([
938
+ const t = this.season || M(), [s, r, o, l, i] = await Promise.all([
939
939
  e.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
940
940
  e.listSchools(),
941
941
  e.listTeams({ sport: this.sport }),
942
942
  e.listConferences(),
943
943
  e.listGames({ sport: this.sport, season: t })
944
- ]), h = s.items.filter((l) => !this.gender || !l.gender || l.gender === this.gender).sort((l, c) => c.effectiveDate.localeCompare(l.effectiveDate));
944
+ ]), h = s.items.filter((d) => !this.gender || !d.gender || d.gender === this.gender).sort((d, c) => c.effectiveDate.localeCompare(d.effectiveDate));
945
945
  return {
946
946
  season: t,
947
947
  polls: h,
948
- schools: o.items,
949
- teams: r.items,
950
- conferences: d.items,
951
- games: n.items
948
+ schools: r.items,
949
+ teams: o.items,
950
+ conferences: l.items,
951
+ games: i.items
952
952
  };
953
953
  }
954
954
  get ctx() {
955
955
  return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
956
956
  teamsById: v(this.data.teams),
957
957
  schoolsById: v(this.data.schools),
958
- records: z(this.data.games),
958
+ records: P(this.data.games),
959
959
  rankings: this.data.polls,
960
- hrefs: D(this),
960
+ hrefs: F(this),
961
961
  sport: this.sport
962
962
  }, this._ctxData = this.data), this._ctx;
963
963
  }
964
964
  sparkline(e, t, s) {
965
- const n = t.map((m, f) => {
966
- const g = (m.teamIds || []).indexOf(e);
967
- if (g === -1) return null;
968
- const k = t.length === 1 ? 96 / 2 : f / (t.length - 1) * 90 + 3, O = 3 + g / 24 * 20;
969
- return { x: k, y: O };
965
+ const i = t.map((m, f) => {
966
+ const u = (m.teamIds || []).indexOf(e);
967
+ if (u === -1) return null;
968
+ const b = t.length === 1 ? 96 / 2 : f / (t.length - 1) * 90 + 3, x = 3 + u / 24 * 20;
969
+ return { x: b, y: x };
970
970
  }), h = [];
971
- let l = [];
972
- if (n.forEach((m) => {
973
- m ? l.push(m) : l.length && (h.push(l), l = []);
974
- }), l.length && h.push(l), !h.length) return p;
975
- const c = n[s];
976
- return i`<svg class="sparkline" width=${96} height=${26} viewBox="0 0 ${96} ${26}" role="img" aria-label="rank history">
977
- ${h.map((m) => Q`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
971
+ let d = [];
972
+ if (i.forEach((m) => {
973
+ m ? d.push(m) : d.length && (h.push(d), d = []);
974
+ }), d.length && h.push(d), !h.length) return p;
975
+ const c = i[s];
976
+ return n`<svg class="sparkline" width=${96} height=${26} viewBox="0 0 ${96} ${26}" role="img" aria-label="rank history">
977
+ ${h.map((m) => Z`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
978
978
  points=${m.map((f) => `${f.x.toFixed(1)},${f.y.toFixed(1)}`).join(" ")}></polyline>`)}
979
- ${c ? Q`<circle cx=${c.x.toFixed(1)} cy=${c.y.toFixed(1)} r="3" fill="var(--hsot-black)"></circle>` : p}
979
+ ${c ? Z`<circle cx=${c.x.toFixed(1)} cy=${c.y.toFixed(1)} r="3" fill="var(--hsot-black)"></circle>` : p}
980
980
  </svg>`;
981
981
  }
982
982
  movement(e, t, s) {
983
- const o = Fe(e, t, s);
984
- return o.kind === "up" ? i`<span class="delta up">▲ ${o.delta}</span>` : o.kind === "down" ? i`<span class="delta down">▼ ${o.delta}</span>` : o.kind === "new" ? i`<span class="delta new">NEW</span>` : o.kind === "same" ? i`<span class="delta same">—</span>` : i`<span class="delta same">·</span>`;
983
+ const r = Ae(e, t, s);
984
+ 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>`;
985
985
  }
986
986
  renderView() {
987
987
  const e = this.ctx, t = this.data.polls;
988
- if (!t.length) return i`<div class="view"><p class="empty">No ${this.sport} polls published yet this season.</p></div>`;
989
- const s = Math.max(0, t.findIndex((m) => m.effectiveDate === this.pollDate)), o = t[s] || t[0], r = t[s + 1] || null, d = t.slice().reverse(), n = d.indexOf(o), h = v(this.data.conferences), l = (o.teamIds || [])[0], c = l ? I(e, l) : null;
990
- return i`
991
- ${V(this, e, {
992
- title: i`${T(this.sport)} Top 25`,
993
- sub: i`The HighSchoolOT poll · updated weekly · ${t.length} polls this season`,
988
+ if (!t.length) return n`<div class="view"><p class="empty">No ${this.sport} polls published yet this season.</p></div>`;
989
+ 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(), i = l.indexOf(r), h = v(this.data.conferences), d = (r.teamIds || [])[0], c = d ? C(e, d) : null;
990
+ return n`
991
+ ${Y(this, e, {
992
+ title: n`${I(this.sport)} Top 25`,
993
+ sub: n`The HighSchoolOT poll · updated weekly · ${t.length} polls this season`,
994
994
  teams: this.data.teams
995
995
  })}
996
- ${B(this, i`
997
- ${P(this)}
996
+ ${B(this, n`
997
+ ${A(this)}
998
998
  <div class="toolbar">
999
999
  <label class="asof" for="pollsel">Poll of</label>
1000
1000
  <select id="pollsel" @change=${(m) => {
1001
1001
  this.pollDate = m.target.value;
1002
1002
  }}>
1003
- ${t.map((m, f) => i`<option value=${m.effectiveDate} ?selected=${m === o}>
1004
- ${y(m.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${f === 0 ? " · current" : ""}
1003
+ ${t.map((m, f) => n`<option value=${m.effectiveDate} ?selected=${m === r}>
1004
+ ${$(m.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${f === 0 ? " · current" : ""}
1005
1005
  </option>`)}
1006
1006
  </select>
1007
1007
  <button class="chip" ?disabled=${s >= t.length - 1}
@@ -1015,65 +1015,65 @@ class _e extends $ {
1015
1015
  <span class="spacer"></span>
1016
1016
  <span class="asof">Movement vs. the previous poll · sparkline = season rank history</span>
1017
1017
  </div>
1018
- ${c ? this.renderHero(e, o, r, l, c, h) : p}
1018
+ ${c ? this.renderHero(e, r, o, d, c, h) : p}
1019
1019
  <div class="card"><div class="tablewrap"><table class="data">
1020
1020
  <thead><tr>
1021
1021
  <th class="num">Rk</th><th>Mvmt</th><th>Team</th><th class="num">Record</th>
1022
1022
  <th>Conference</th><th>Last result</th><th>Next</th><th>Season</th>
1023
1023
  </tr></thead>
1024
1024
  <tbody>
1025
- ${(o.teamIds || []).map((m, f) => f === 0 || !m ? p : this.renderRow(e, o, r, d, n, h, m, f + 1))}
1025
+ ${(r.teamIds || []).map((m, f) => f === 0 || !m ? p : this.renderRow(e, r, o, l, i, h, m, f + 1))}
1026
1026
  </tbody>
1027
1027
  </table></div></div>
1028
1028
  <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>
1029
1029
  `)}
1030
1030
  `;
1031
1031
  }
1032
- renderHero(e, t, s, o, r, d) {
1033
- const n = e.records[o], h = ee(e.records, o), l = d[e.teamsById[o]?.conferenceId], c = `linear-gradient(120deg, ${r.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
1034
- return i`
1032
+ renderHero(e, t, s, r, o, l) {
1033
+ const i = e.records[r], h = se(e.records, r), d = l[e.teamsById[r]?.conferenceId], c = `linear-gradient(120deg, ${o.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
1034
+ return n`
1035
1035
  <div class="hero1" style="background:${c}">
1036
1036
  <div class="bigrank">#1</div>
1037
- ${C(r, 64)}
1037
+ ${D(o, 64)}
1038
1038
  <div>
1039
- <h2><a href=${u(e.hrefs.school, { id: r.id })}>${r.name} ${r.mascot || ""}</a></h2>
1039
+ <h2><a href=${g(e.hrefs.school, { id: o.id })}>${o.name} ${o.mascot || ""}</a></h2>
1040
1040
  <div class="facts">
1041
- ${w(n)} overall${l ? i` · ${w(n, !0)} ${l.name}` : p}
1042
- · streak ${L(n?.results) || "·"}
1043
- ${h ? i` · last: ${h.mark} ${h.my}-${h.their} vs ${_(e, h.opp)}` : p}
1044
- &nbsp;${this.movement(t, s, o)}
1041
+ ${k(i)} overall${d ? n` · ${k(i, !0)} ${d.name}` : p}
1042
+ · streak ${H(i?.results) || "·"}
1043
+ ${h ? n` · last: ${h.mark} ${h.my}-${h.their} vs ${N(e, h.opp)}` : p}
1044
+ &nbsp;${this.movement(t, s, r)}
1045
1045
  </div>
1046
1046
  </div>
1047
1047
  </div>
1048
1048
  `;
1049
1049
  }
1050
- renderRow(e, t, s, o, r, d, n, h) {
1051
- const l = I(e, n);
1052
- if (!l) return p;
1053
- const c = e.records[n], m = ee(e.records, n), f = q(this.data.games, n), g = d[e.teamsById[n]?.conferenceId], k = () => {
1054
- location.href = u(e.hrefs.school, { id: l.id });
1050
+ renderRow(e, t, s, r, o, l, i, h) {
1051
+ const d = C(e, i);
1052
+ if (!d) return p;
1053
+ const c = e.records[i], m = se(e.records, i), f = W(this.data.games, i), u = l[e.teamsById[i]?.conferenceId], b = () => {
1054
+ location.href = g(e.hrefs.school, { id: d.id });
1055
1055
  };
1056
- return i`
1057
- <tr class="rowlink" @click=${(O) => {
1058
- O.target.closest("a") || k();
1056
+ return n`
1057
+ <tr class="rowlink" @click=${(x) => {
1058
+ x.target.closest("a") || b();
1059
1059
  }}>
1060
1060
  <td class="num" style="font-weight:700">${h}</td>
1061
- <td>${this.movement(t, s, n)}</td>
1062
- <td class="teamcell">${C(l)}<a href=${u(e.hrefs.school, { id: l.id })}>${l.name}</a>
1063
- <span class="mut" style="font-size:0.78rem">${l.mascot || ""}</span></td>
1064
- <td class="num">${w(c)}</td>
1065
- <td class="mut">${g?.name || "Independent"}</td>
1066
- <td>${m ? i`<a class="box" style="text-decoration:none" href=${u(e.hrefs.game, { sport: this.sport, id: m.gameId })}>
1061
+ <td>${this.movement(t, s, i)}</td>
1062
+ <td class="teamcell">${D(d)}<a href=${g(e.hrefs.school, { id: d.id })}>${d.name}</a>
1063
+ <span class="mut" style="font-size:0.78rem">${d.mascot || ""}</span></td>
1064
+ <td class="num">${k(c)}</td>
1065
+ <td class="mut">${u?.name || "Independent"}</td>
1066
+ <td>${m ? n`<a class="box" style="text-decoration:none" href=${g(e.hrefs.game, { sport: this.sport, id: m.gameId })}>
1067
1067
  <b style="color:${m.mark === "W" ? "var(--hsot-win)" : m.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${m.mark}</b>
1068
- ${m.my}-${m.their} vs ${_(e, m.opp)}</a>` : i`<span class="mut">·</span>`}</td>
1069
- <td>${ne(e, f, n)}</td>
1070
- <td>${this.sparkline(n, o, r)}</td>
1068
+ ${m.my}-${m.their} vs ${N(e, m.opp)}</a>` : n`<span class="mut">·</span>`}</td>
1069
+ <td>${ce(e, f, i)}</td>
1070
+ <td>${this.sparkline(i, r, o)}</td>
1071
1071
  </tr>
1072
1072
  `;
1073
1073
  }
1074
1074
  }
1075
- globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", _e);
1076
- const Re = b`
1075
+ globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", Me);
1076
+ const He = y`
1077
1077
  .schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
1078
1078
  .schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
1079
1079
  .schoolhero .crest {
@@ -1127,10 +1127,10 @@ const Re = b`
1127
1127
  table.data.roster .sub { display: block; font-weight: 400; font-size: 0.78rem; color: var(--hsot-gray-5); }
1128
1128
  }
1129
1129
  `;
1130
- class Ne extends $ {
1131
- static styles = [...F, Re];
1130
+ class Oe extends w {
1131
+ static styles = [...z, He];
1132
1132
  static properties = {
1133
- ...$.properties,
1133
+ ...w.properties,
1134
1134
  schoolId: { type: String, attribute: "school-id" },
1135
1135
  sport: { type: String },
1136
1136
  season: { type: String },
@@ -1145,38 +1145,38 @@ class Ne extends $ {
1145
1145
  e && !this.sport && (this.sport = e);
1146
1146
  }
1147
1147
  async fetchData(e) {
1148
- const t = this.season || N(), s = await e.getSchool(this.schoolId), r = (await e.listTeams({ schoolId: this.schoolId })).items, d = r.find((k) => k.sport === (this.sport || "football")) || r[0] || null, [n, h, l, c, m, f, g] = await Promise.all([
1149
- d ? e.listGames({ sport: d.sport, season: t }) : Promise.resolve({ items: [] }),
1150
- d ? e.listTeams({ sport: d.sport }) : Promise.resolve({ items: [] }),
1148
+ const t = this.season || M(), s = await e.getSchool(this.schoolId), o = (await e.listTeams({ schoolId: this.schoolId })).items, l = o.find((b) => b.sport === (this.sport || "football")) || o[0] || null, [i, h, d, c, m, f, u] = await Promise.all([
1149
+ l ? e.listGames({ sport: l.sport, season: t }) : Promise.resolve({ items: [] }),
1150
+ l ? e.listTeams({ sport: l.sport }) : Promise.resolve({ items: [] }),
1151
1151
  e.listSchools(),
1152
1152
  e.listConferences(),
1153
- d ? e.listRankings({ sport: d.sport }) : Promise.resolve({ items: [] }),
1154
- d ? e.listRosters({ teamId: d.id }) : Promise.resolve({ items: [] }),
1153
+ l ? e.listRankings({ sport: l.sport }) : Promise.resolve({ items: [] }),
1154
+ l ? e.listRosters({ teamId: l.id }) : Promise.resolve({ items: [] }),
1155
1155
  // teamId is the public surface's one players filter (roster
1156
1156
  // membership) — never fetch the whole collection.
1157
- d ? e.listPlayers({ teamId: d.id }) : Promise.resolve({ items: [] })
1157
+ l ? e.listPlayers({ teamId: l.id }) : Promise.resolve({ items: [] })
1158
1158
  ]);
1159
1159
  return {
1160
1160
  season: t,
1161
1161
  school: s,
1162
- teams: r,
1163
- active: d,
1164
- games: n.items,
1162
+ teams: o,
1163
+ active: l,
1164
+ games: i.items,
1165
1165
  allTeams: h.items,
1166
- schools: l.items,
1166
+ schools: d.items,
1167
1167
  conferences: c.items,
1168
1168
  rankings: m.items,
1169
- roster: f.items.find((k) => k.season === t) || null,
1170
- players: g.items
1169
+ roster: f.items.find((b) => b.season === t) || null,
1170
+ players: u.items
1171
1171
  };
1172
1172
  }
1173
1173
  get ctx() {
1174
1174
  return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
1175
1175
  teamsById: v(this.data.allTeams.length ? this.data.allTeams : this.data.teams),
1176
1176
  schoolsById: v(this.data.schools),
1177
- records: z(this.data.games),
1177
+ records: P(this.data.games),
1178
1178
  rankings: this.data.rankings,
1179
- hrefs: D(this),
1179
+ hrefs: F(this),
1180
1180
  sport: this.data.active?.sport || "football"
1181
1181
  }, this._ctxData = this.data), this._ctx;
1182
1182
  }
@@ -1184,116 +1184,116 @@ class Ne extends $ {
1184
1184
  this.sport = e, this.load();
1185
1185
  }
1186
1186
  renderView() {
1187
- const { school: e, teams: t, active: s, season: o } = this.data;
1188
- if (!e) return i`<div class="view"><p class="empty">School not found.</p></div>`;
1189
- const r = this.ctx, d = A(e.colorPrimary || "#030711"), n = (e.adm || [])[0], h = v(this.data.conferences), l = s ? h[s.conferenceId] : null;
1190
- return i`
1191
- <div class="schoolhero" style="background:linear-gradient(115deg, ${e.colorPrimary || "#030711"} 0%, ${e.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${d}">
1187
+ const { school: e, teams: t, active: s, season: r } = this.data;
1188
+ if (!e) return n`<div class="view"><p class="empty">School not found.</p></div>`;
1189
+ const o = this.ctx, l = _(e.colorPrimary || "#030711"), i = (e.adm || [])[0], h = v(this.data.conferences), d = s ? h[s.conferenceId] : null;
1190
+ return n`
1191
+ <div class="schoolhero" style="background:linear-gradient(115deg, ${e.colorPrimary || "#030711"} 0%, ${e.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${l}">
1192
1192
  <div class="inner">
1193
- ${E(e, 84) ? i`<img class="crest logo" alt="" loading="lazy" src=${E(e, 84)} />` : i`<div class="crest" style="background:${e.colorSecondary || "#7C7C7C"};color:${A(e.colorSecondary || "#7C7C7C")}">${j(e)}</div>`}
1193
+ ${R(e, 84) ? n`<img class="crest logo" alt="" loading="lazy" src=${R(e, 84)} />` : n`<div class="crest" style="background:${e.colorSecondary || "#7C7C7C"};color:${_(e.colorSecondary || "#7C7C7C")}">${q(e)}</div>`}
1194
1194
  <div style="min-width:260px">
1195
1195
  <h1>${e.name} <span class="mascot">${e.mascot || ""}</span></h1>
1196
1196
  <div class="facts">
1197
- ${e.location ? i`<span><b>Location</b>${e.location}${e.county ? i` · ${e.county} County` : p}</span>` : p}
1198
- ${e.association ? i`<span><b>League</b>${e.association}${e.classification ? i` · ${e.classification}` : p}</span>` : p}
1199
- ${l ? i`<span><b>Conference</b>${l.name}</span>` : p}
1200
- ${n ? i`<span><b>Enrollment</b>${n.value.toLocaleString()} (${n.season} ADM)</span>` : p}
1201
- ${e.openingYear ? i`<span><b>Opened</b>${e.openingYear}</span>` : p}
1202
- ${e.areaCode ? i`<span><b>Area</b>${e.areaCode}</span>` : p}
1197
+ ${e.location ? n`<span><b>Location</b>${e.location}${e.county ? n` · ${e.county} County` : p}</span>` : p}
1198
+ ${e.association ? n`<span><b>League</b>${e.association}${e.classification ? n` · ${e.classification}` : p}</span>` : p}
1199
+ ${d ? n`<span><b>Conference</b>${d.name}</span>` : p}
1200
+ ${i ? n`<span><b>Enrollment</b>${i.value.toLocaleString()} (${i.season} ADM)</span>` : p}
1201
+ ${e.openingYear ? n`<span><b>Opened</b>${e.openingYear}</span>` : p}
1202
+ ${e.areaCode ? n`<span><b>Area</b>${e.areaCode}</span>` : p}
1203
1203
  </div>
1204
1204
  </div>
1205
1205
  </div>
1206
1206
  </div>
1207
1207
  <div class="band">
1208
1208
  <nav class="tabs" aria-label="Teams">
1209
- ${t.map((c) => c.id === s?.id ? i`<a class="on" href="#" @click=${(m) => m.preventDefault()}>${c.name}</a>` : i`<a href="#" @click=${(m) => {
1209
+ ${t.map((c) => c.id === s?.id ? n`<a class="on" href="#" @click=${(m) => m.preventDefault()}>${c.name}</a>` : n`<a href="#" @click=${(m) => {
1210
1210
  m.preventDefault(), this.switchSport(c.sport);
1211
1211
  }}>${c.name}</a>`)}
1212
1212
  </nav>
1213
1213
  </div>
1214
- ${B(this, i`
1215
- ${P(this)}
1216
- ${s ? this.renderTeam(r, s, l, o) : i`<p class="empty">No teams recorded for this school yet.</p>`}
1214
+ ${B(this, n`
1215
+ ${A(this)}
1216
+ ${s ? this.renderTeam(o, s, d, r) : n`<p class="empty">No teams recorded for this school yet.</p>`}
1217
1217
  `)}
1218
1218
  `;
1219
1219
  }
1220
- renderTeam(e, t, s, o) {
1221
- const r = e.records[t.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, d = r.w + r.l + r.t, n = s ? this.data.allTeams.filter((m) => m.conferenceId === s.id) : [], h = s ? oe(n, e.records).findIndex((m) => m.team.id === t.id) + 1 : 0, l = W(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)));
1222
- return i`
1220
+ renderTeam(e, t, s, r) {
1221
+ 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, i = s ? this.data.allTeams.filter((m) => m.conferenceId === s.id) : [], h = s ? ne(i, e.records).findIndex((m) => m.team.id === t.id) + 1 : 0, d = V(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)));
1222
+ return n`
1223
1223
  <div class="tiles">
1224
- <div class="tile"><div class="k">Overall</div><div class="v">${w(r)}</div><div class="s">${d} games played</div></div>
1225
- <div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${w(r, !0)}</div>
1226
- <div class="s">${h ? `${ue(h)} of ${n.length}` : "·"}</div></div>
1227
- <div class="tile"><div class="k">Points</div><div class="v">${d ? (r.pf / d).toFixed(1) : "0.0"}</div>
1228
- <div class="s">scored per game · ${d ? (r.pa / d).toFixed(1) : "0.0"} allowed</div></div>
1229
- <div class="tile"><div class="k">Streak</div><div class="v">${L(r.results) || "·"}</div>
1224
+ <div class="tile"><div class="k">Overall</div><div class="v">${k(o)}</div><div class="s">${l} games played</div></div>
1225
+ <div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${k(o, !0)}</div>
1226
+ <div class="s">${h ? `${ye(h)} of ${i.length}` : "·"}</div></div>
1227
+ <div class="tile"><div class="k">Points</div><div class="v">${l ? (o.pf / l).toFixed(1) : "0.0"}</div>
1228
+ <div class="s">scored per game · ${l ? (o.pa / l).toFixed(1) : "0.0"} allowed</div></div>
1229
+ <div class="tile"><div class="k">Streak</div><div class="v">${H(o.results) || "·"}</div>
1230
1230
  <div class="s">last 5: ${K(e, t.id)}</div></div>
1231
- <div class="tile"><div class="k">HSOT Top 25</div><div class="v">${l ? `#${l}` : "NR"}</div>
1232
- <div class="s"><a href=${u(e.hrefs.section, { sport: t.sport, view: "rankings" })}>full poll</a></div></div>
1231
+ <div class="tile"><div class="k">HSOT Top 25</div><div class="v">${d ? `#${d}` : "NR"}</div>
1232
+ <div class="s"><a href=${g(e.hrefs.section, { sport: t.sport, view: "rankings" })}>full poll</a></div></div>
1233
1233
  </div>
1234
- ${(t.championships || []).length ? i`
1234
+ ${(t.championships || []).length ? n`
1235
1235
  <div style="margin:-0.2rem 0 1rem;display:flex;gap:0.4rem;flex-wrap:wrap">
1236
- ${t.championships.map((m) => i`<span class="pill champ">★ ${m.season} ${m.title} champion${m.classification ? ` · ${m.classification}` : ""}${m.region ? ` · ${m.region}` : ""}</span>`)}
1236
+ ${t.championships.map((m) => n`<span class="pill champ">★ ${m.season} ${m.title} champion${m.classification ? ` · ${m.classification}` : ""}${m.region ? ` · ${m.region}` : ""}</span>`)}
1237
1237
  </div>` : p}
1238
1238
  <div class="cols">
1239
1239
  <div>
1240
1240
  <div class="section-title">Schedule &amp; results</div>
1241
1241
  <div class="card">
1242
- ${c.length ? i`<ul class="gamelist">${c.map((m) => this.renderGameRow(e, t, m))}</ul>` : i`<p class="empty">No ${t.sport} games recorded for ${o}.</p>`}
1242
+ ${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>`}
1243
1243
  </div>
1244
1244
  </div>
1245
1245
  <div>
1246
- <div class="section-title">Roster · ${o}</div>
1247
- <div class="card">${this.renderRoster(t, o)}</div>
1246
+ <div class="section-title">Roster · ${r}</div>
1247
+ <div class="card">${this.renderRoster(t, r)}</div>
1248
1248
  </div>
1249
1249
  </div>
1250
1250
  `;
1251
1251
  }
1252
1252
  renderGameRow(e, t, s) {
1253
- const o = s.homeTeamId === t.id, r = o ? s.awayTeamId : s.homeTeamId, d = o ? s.homeScore : s.awayScore, n = o ? s.awayScore : s.homeScore;
1254
- let h = i`<span class="mut">${U(s.time)}</span>`;
1253
+ const r = s.homeTeamId === t.id, o = r ? s.awayTeamId : s.homeTeamId, l = r ? s.homeScore : s.awayScore, i = r ? s.awayScore : s.homeScore;
1254
+ let h = n`<span class="mut">${U(s.time)}</span>`;
1255
1255
  if (s.state === "final") {
1256
- const c = G(s), m = c === "tie" ? "T" : c === (o ? "home" : "away") ? "W" : "L";
1257
- h = i`<span class=${m}>${m}</span> ${d}-${n}${s.finish === "overtime" ? i` <span class="mut">OT</span>` : p}${s.forfeit && s.forfeit !== "none" ? i` <span class="mut">FF</span>` : p}`;
1258
- } else s.state === "live" && (h = i`<span style="color:var(--hsot-red)">${d}-${n}</span>`);
1259
- const l = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
1260
- return i`
1256
+ const c = G(s), m = c === "tie" ? "T" : c === (r ? "home" : "away") ? "W" : "L";
1257
+ 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}`;
1258
+ } else s.state === "live" && (h = n`<span style="color:var(--hsot-red)">${l}-${i}</span>`);
1259
+ const d = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
1260
+ return n`
1261
1261
  <li>
1262
- <span class="d">${y(s.date)}</span>
1263
- ${se(s).kind === "sched" ? p : R(s)}
1262
+ <span class="d">${$(s.date)}</span>
1263
+ ${re(s).kind === "sched" ? p : L(s)}
1264
1264
  <span class="res">${h}</span>
1265
- <span class="opp">${o ? "vs" : "at"} ${ie(e, r, s.date)}
1266
- <span class="pill type">${l}</span>
1267
- ${s.broadcast ? i`<span class="pill class">${s.broadcast}</span>` : p}
1265
+ <span class="opp">${r ? "vs" : "at"} ${le(e, o, s.date)}
1266
+ <span class="pill type">${d}</span>
1267
+ ${s.broadcast ? n`<span class="pill class">${s.broadcast}</span>` : p}
1268
1268
  </span>
1269
1269
  <span class="where">${s.venue || ""}</span>
1270
- <a class="box" href=${u(e.hrefs.game, { sport: t.sport, id: s.id })}>Box score →</a>
1270
+ <a class="box" href=${g(e.hrefs.game, { sport: t.sport, id: s.id })}>Box score →</a>
1271
1271
  </li>
1272
1272
  `;
1273
1273
  }
1274
1274
  renderRoster(e, t) {
1275
1275
  const s = this.data.roster;
1276
1276
  if (!s)
1277
- return i`<p class="empty">Roster not published for ${t}.</p>`;
1278
- const o = Be(s, 560), r = this.data.school?.name || "", d = v(this.data.players), n = s.entries.slice().sort((l, c) => (l.number || 0) - (c.number || 0)), h = n.some((l) => d[l.playerId]?.college);
1279
- return i`
1280
- ${o ? i`<img class="rosterphoto" src=${o} loading="lazy" decoding="async"
1281
- alt="${r} ${e.name} ${t} team photo" />` : p}
1277
+ return n`<p class="empty">Roster not published for ${t}.</p>`;
1278
+ const r = _e(s, 560), o = this.data.school?.name || "", l = v(this.data.players), i = s.entries.slice().sort((d, c) => (d.number || 0) - (c.number || 0)), h = i.some((d) => l[d.playerId]?.college);
1279
+ return n`
1280
+ ${r ? n`<img class="rosterphoto" src=${r} loading="lazy" decoding="async"
1281
+ alt="${o} ${e.name} ${t} team photo" />` : p}
1282
1282
  <div class="tablewrap"><table class="data roster">
1283
- <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 ? i`<th>College</th>` : p}</tr></thead>
1283
+ <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>
1284
1284
  <tbody>
1285
- ${n.map((l) => {
1286
- const c = d[l.playerId];
1285
+ ${i.map((d) => {
1286
+ const c = l[d.playerId];
1287
1287
  if (!c) return p;
1288
- const m = pe(l), f = [m, c.classOf].filter(Boolean).join(" · ") || "·";
1289
- return i`<tr>
1290
- <td class="num mut">${l.number ?? "·"}</td>
1288
+ const m = ve(d), f = [m, c.classOf].filter(Boolean).join(" · ") || "·";
1289
+ return n`<tr>
1290
+ <td class="num mut">${d.number ?? "·"}</td>
1291
1291
  <td class="player" style="font-weight:500">${c.firstName} ${c.lastName}<span class="sub">${f}</span></td>
1292
1292
  <td class="pos">${m || "·"}</td>
1293
1293
  <td class="cls mut">${c.classOf || "·"}</td>
1294
- <td class="num">${me(c.heightIn)}</td>
1294
+ <td class="num">${ge(c.heightIn)}</td>
1295
1295
  <td class="num">${c.weightLb || "·"}</td>
1296
- ${h ? i`<td class="college">${c.college || "·"}</td>` : p}
1296
+ ${h ? n`<td class="college">${c.college || "·"}</td>` : p}
1297
1297
  </tr>`;
1298
1298
  })}
1299
1299
  </tbody>
@@ -1301,16 +1301,69 @@ class Ne extends $ {
1301
1301
  `;
1302
1302
  }
1303
1303
  }
1304
- globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", Ne);
1305
- const Le = "https://api.wral.com/search";
1306
- function Oe(a) {
1304
+ globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", Oe);
1305
+ const de = {
1306
+ football: ["quarters", 4],
1307
+ flag_football: ["quarters", 4],
1308
+ basketball: ["quarters", 4],
1309
+ lacrosse: ["quarters", 4],
1310
+ field_hockey: ["quarters", 4],
1311
+ soccer: ["halves", 2],
1312
+ baseball: ["innings", 7],
1313
+ softball: ["innings", 7],
1314
+ volleyball: ["sets", 3]
1315
+ };
1316
+ function he(a) {
1317
+ return (de[a] || ["quarters", 4])[0];
1318
+ }
1319
+ function X(a) {
1320
+ return (de[a] || ["quarters", 4])[1];
1321
+ }
1322
+ function Ue(a, e) {
1323
+ const t = he(a), s = X(a);
1324
+ if (e <= s || t === "innings" || t === "sets") return String(e);
1325
+ const r = e - s;
1326
+ return `OT${r > 1 ? r : ""}`;
1327
+ }
1328
+ function je(a, e) {
1329
+ const t = String(a ?? "").trim();
1330
+ let s;
1331
+ return (s = /^(\d+)Q$/i.exec(t)) || (s = /^(\d+)H$/i.exec(t)) ? Number(s[1]) : /^half$/i.test(t) ? he(e) === "halves" ? 1 : 2 : (s = /^(\d*)OT(\d*)$/i.exec(t)) ? X(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;
1332
+ }
1333
+ const E = (a) => Number.isInteger(a) && a >= 0 ? a : null;
1334
+ function qe(a) {
1335
+ const e = Array.isArray(a?.scoringPlays) ? a.scoringPlays : [];
1336
+ if (!e.length) return null;
1337
+ const t = a.sport, s = /* @__PURE__ */ new Map();
1338
+ for (const m of e) {
1339
+ const f = je(m?.period, t), u = E(m?.homeScore), b = E(m?.awayScore);
1340
+ if (!f || u === null || b === null) return null;
1341
+ const x = s.get(f) || { home: 0, away: 0 };
1342
+ x.home = Math.max(x.home, u), x.away = Math.max(x.away, b), s.set(f, x);
1343
+ }
1344
+ const r = Math.max(...s.keys()), o = [];
1345
+ let l = !0, i = { home: 0, away: 0 };
1346
+ for (let m = 1; m <= r; m += 1) {
1347
+ const f = s.get(m) || i, u = f.home - i.home, b = f.away - i.away;
1348
+ (u < 0 || b < 0) && (l = !1), o.push({ period: m, home: Math.max(u, 0), away: Math.max(b, 0) }), i = { home: Math.max(f.home, i.home), away: Math.max(f.away, i.away) };
1349
+ }
1350
+ const h = E(a.homeScore) ?? 0, d = E(a.awayScore) ?? 0, c = l && i.home === h && i.away === d;
1351
+ return l = l && i.home <= h && i.away <= d, { periods: o, reconciled: c, consistent: l };
1352
+ }
1353
+ function Ge(a) {
1354
+ if (Array.isArray(a?.periodScores) && a.periodScores.length) return a.periodScores;
1355
+ const e = qe(a);
1356
+ return e ? a.state === "final" ? e.reconciled ? e.periods : null : e.consistent ? e.periods : null : null;
1357
+ }
1358
+ const We = "https://api.wral.com/search";
1359
+ function Ve(a) {
1307
1360
  return a.map((e) => `uri:"${e}"`).join(" OR ");
1308
1361
  }
1309
- function He(a, e) {
1310
- const t = String(a || Le).replace(/\/+$/, ""), s = new URLSearchParams({ query: Oe(e), sort: "score", lang: "en" });
1362
+ function Ye(a, e) {
1363
+ const t = String(a || We).replace(/\/+$/, ""), s = new URLSearchParams({ query: Ve(e), sort: "score", lang: "en" });
1311
1364
  return `${t}/v1/query?${s}`;
1312
1365
  }
1313
- function le(a) {
1366
+ function me(a) {
1314
1367
  try {
1315
1368
  const e = new URL(a);
1316
1369
  if (/(^|\.)smugmug\.com$/i.test(e.hostname)) {
@@ -1325,13 +1378,13 @@ function le(a) {
1325
1378
  }
1326
1379
  return { uri: a, title: a };
1327
1380
  }
1328
- async function Ue(a, e, t) {
1329
- const o = await ((...n) => fetch(...n))(He(a, e));
1330
- if (!o.ok) throw new Error(`search answered ${o.status}`);
1331
- const r = await o.json(), d = new Map((r.items || []).map((n) => [n.uri, n]));
1332
- return e.map((n) => d.get(n) || le(n));
1381
+ async function Qe(a, e, t) {
1382
+ const r = await ((...i) => fetch(...i))(Ye(a, e));
1383
+ if (!r.ok) throw new Error(`search answered ${r.status}`);
1384
+ const o = await r.json(), l = new Map((o.items || []).map((i) => [i.uri, i]));
1385
+ return e.map((i) => l.get(i) || me(i));
1333
1386
  }
1334
- const Me = b`
1387
+ const Ke = y`
1335
1388
  .breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
1336
1389
  .breadcrumbs a { text-decoration: none; }
1337
1390
  .scorehead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 1.4rem 1rem; }
@@ -1384,10 +1437,10 @@ const Me = b`
1384
1437
  .cols { grid-template-columns: 1fr; }
1385
1438
  }
1386
1439
  `;
1387
- class je extends $ {
1388
- static styles = [...F, Me];
1440
+ class Xe extends w {
1441
+ static styles = [...z, Ke];
1389
1442
  static properties = {
1390
- ...$.properties,
1443
+ ...w.properties,
1391
1444
  gameId: { type: String, attribute: "game-id" },
1392
1445
  // The public site search that resolves Game.coverageUrls into cards
1393
1446
  // (DEV-1236). Shared cross-stage by design — see the studio host's
@@ -1399,7 +1452,7 @@ class je extends $ {
1399
1452
  super(), this.gameId = "", this.searchApi = "";
1400
1453
  }
1401
1454
  async fetchData(e) {
1402
- const t = await e.getGame(this.gameId), s = Array.isArray(t.coverageUrls) ? t.coverageUrls : [], [o, r, d, n, h, l] = await Promise.all([
1455
+ const t = await e.getGame(this.gameId), s = Array.isArray(t.coverageUrls) ? t.coverageUrls : [], [r, o, l, i, h, d] = await Promise.all([
1403
1456
  e.listSchools(),
1404
1457
  e.listTeams({ sport: t.sport }),
1405
1458
  e.listConferences(),
@@ -1407,74 +1460,74 @@ class je extends $ {
1407
1460
  e.listGames({ sport: t.sport, season: t.season }),
1408
1461
  // A search outage must not blank the box score — degrade to bare
1409
1462
  // links (fetchCoverage already degrades per-URL index misses).
1410
- s.length ? Ue(this.searchApi, s).catch(() => s.map(le)) : Promise.resolve([])
1463
+ s.length ? Qe(this.searchApi, s).catch(() => s.map(me)) : Promise.resolve([])
1411
1464
  ]);
1412
1465
  return {
1413
1466
  game: t,
1414
- schools: o.items,
1415
- teams: r.items,
1416
- conferences: d.items,
1417
- rankings: n.items,
1467
+ schools: r.items,
1468
+ teams: o.items,
1469
+ conferences: l.items,
1470
+ rankings: i.items,
1418
1471
  games: h.items,
1419
- coverage: l
1472
+ coverage: d
1420
1473
  };
1421
1474
  }
1422
1475
  get ctx() {
1423
1476
  return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
1424
1477
  teamsById: v(this.data.teams),
1425
1478
  schoolsById: v(this.data.schools),
1426
- records: z(this.data.games),
1479
+ records: P(this.data.games),
1427
1480
  rankings: this.data.rankings,
1428
- hrefs: D(this),
1481
+ hrefs: F(this),
1429
1482
  sport: this.data.game.sport
1430
1483
  }, this._ctxData = this.data), this._ctx;
1431
1484
  }
1432
1485
  renderView() {
1433
1486
  const e = this.data.game;
1434
- if (!e) return i`<div class="view"><p class="empty">Game not found.</p></div>`;
1435
- const t = this.ctx, s = v(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, d = G(e), n = (c) => e.state === "final" && d !== c && d !== "tie" ? "opacity:0.45" : "", h = e.conferenceId ? s[e.conferenceId] : null, l = 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));
1436
- return i`
1437
- ${B(this, i`
1438
- ${P(this)}
1487
+ if (!e) return n`<div class="view"><p class="empty">Game not found.</p></div>`;
1488
+ const t = this.ctx, s = v(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 = G(e), i = (c) => e.state === "final" && l !== c && l !== "tie" ? "opacity:0.45" : "", h = e.conferenceId ? s[e.conferenceId] : null, d = 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));
1489
+ return n`
1490
+ ${B(this, n`
1491
+ ${A(this)}
1439
1492
  <p class="breadcrumbs">
1440
- <a href=${u(t.hrefs.section, { sport: e.sport, view: "scores" })}>${T(e.sport)}</a> /
1441
- <a href=${u(t.hrefs.section, { sport: e.sport, view: "scores" })}>Scores/Schedules</a> /
1442
- ${S(t, e.awayTeamId)} at ${S(t, e.homeTeamId)}
1493
+ <a href=${g(t.hrefs.section, { sport: e.sport, view: "scores" })}>${I(e.sport)}</a> /
1494
+ <a href=${g(t.hrefs.section, { sport: e.sport, view: "scores" })}>Scores/Schedules</a> /
1495
+ ${T(t, e.awayTeamId)} at ${T(t, e.homeTeamId)}
1443
1496
  </p>
1444
1497
  <div class="card">
1445
1498
  <div class="scorehead">
1446
- ${this.teamBlock(t, e, e.awayTeamId, o, !1)}
1499
+ ${this.teamBlock(t, e, e.awayTeamId, r, !1)}
1447
1500
  <div class="mid">
1448
1501
  <div class="bigscore">
1449
- <span style=${n("away")}>${e.awayScore}</span>
1502
+ <span style=${i("away")}>${e.awayScore}</span>
1450
1503
  <span class="mut" style="font-size:1.6rem">–</span>
1451
- <span style=${n("home")}>${e.homeScore}</span>
1504
+ <span style=${i("home")}>${e.homeScore}</span>
1452
1505
  </div>
1453
- <div class="status">${R(e)}</div>
1454
- <div class="status">${y(e.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${e.state === "scheduled" && e.time ? i` · ${U(e.time)}` : p} · ${e.venue || "Venue TBD"}
1455
- ${e.broadcast ? i` · <span class="pill class">${e.broadcast}</span>` : p}</div>
1506
+ <div class="status">${L(e)}</div>
1507
+ <div class="status">${$(e.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${e.state === "scheduled" && e.time ? n` · ${U(e.time)}` : p} · ${e.venue || "Venue TBD"}
1508
+ ${e.broadcast ? n` · <span class="pill class">${e.broadcast}</span>` : p}</div>
1456
1509
  <div class="status">
1457
1510
  <span class="pill type">${e.gameType === "conference" ? `${h?.name || "Conference"} game` : e.gameType}</span>
1458
- ${e.label ? i`<span class="pill type">Bracket ${e.label}</span>` : p}
1459
- ${(e.tags || []).map((c) => i`<span class="pill type">${c}</span>`)}
1511
+ ${e.label ? n`<span class="pill type">Bracket ${e.label}</span>` : p}
1512
+ ${(e.tags || []).map((c) => n`<span class="pill type">${c}</span>`)}
1460
1513
  </div>
1461
1514
  </div>
1462
- ${this.teamBlock(t, e, e.homeTeamId, r, !0)}
1515
+ ${this.teamBlock(t, e, e.homeTeamId, o, !0)}
1463
1516
  </div>
1464
- ${this.renderLineScore(e, o, r)}
1465
- ${this.renderScoringPlays(e, o, r)}
1466
- ${e.notes ? i`<p class="note gamenote">${e.notes}</p>` : p}
1517
+ ${this.renderLineScore(e, r, o)}
1518
+ ${this.renderScoringPlays(e, r, o)}
1519
+ ${e.notes ? n`<p class="note gamenote">${e.notes}</p>` : p}
1467
1520
  </div>
1468
- ${(this.data.coverage || []).length ? i`
1521
+ ${(this.data.coverage || []).length ? n`
1469
1522
  <div class="section-title">Coverage</div>
1470
1523
  <div class="covgrid">
1471
- ${this.data.coverage.map((c) => i`
1524
+ ${this.data.coverage.map((c) => n`
1472
1525
  <a class="card covcard" href=${c.uri}>
1473
- ${c.image ? i`<img class="covimg" src=${c.image} alt="" loading="lazy" />` : p}
1526
+ ${c.image ? n`<img class="covimg" src=${c.image} alt="" loading="lazy" />` : p}
1474
1527
  <div class="covbody">
1475
- <div class="covtitle">${c.videoDuration ? i`<span class="pill live" style="animation:none">Video</span> ` : p}${c.photos ? i`<span class="pill live" style="animation:none">Photos</span> ` : p}${c.title || c.uri}</div>
1476
- ${c.description ? i`<p class="covdesc">${c.description}</p>` : p}
1477
- ${c.author || c.publishedTime ? i`
1528
+ <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>
1529
+ ${c.description ? n`<p class="covdesc">${c.description}</p>` : p}
1530
+ ${c.author || c.publishedTime ? n`
1478
1531
  <div class="covmeta">${[c.author, c.publishedTime ? new Date(c.publishedTime).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : ""].filter(Boolean).join(" · ")}</div>
1479
1532
  ` : p}
1480
1533
  </div>
@@ -1483,50 +1536,50 @@ class je extends $ {
1483
1536
  </div>` : p}
1484
1537
  <div class="section-title">Season context</div>
1485
1538
  <div class="cols">
1486
- ${[[e.awayTeamId, o], [e.homeTeamId, r]].map(([c, m]) => this.renderContext(t, c, m))}
1539
+ ${[[e.awayTeamId, r], [e.homeTeamId, o]].map(([c, m]) => this.renderContext(t, c, m))}
1487
1540
  </div>
1488
- ${l.length ? i`
1541
+ ${d.length ? n`
1489
1542
  <div class="section-title">Head to head this season</div>
1490
1543
  <div class="card"><ul class="gamelist">
1491
- ${l.map((c) => i`<li>
1492
- <span class="d">${y(c.date)}</span>${R(c)}
1493
- <span class="opp">${S(t, c.awayTeamId)} ${c.awayScore}, ${S(t, c.homeTeamId)} ${c.homeScore}</span>
1494
- <a class="box" href=${u(t.hrefs.game, { sport: e.sport, id: c.id })}>Box score →</a>
1544
+ ${d.map((c) => n`<li>
1545
+ <span class="d">${$(c.date)}</span>${L(c)}
1546
+ <span class="opp">${T(t, c.awayTeamId)} ${c.awayScore}, ${T(t, c.homeTeamId)} ${c.homeScore}</span>
1547
+ <a class="box" href=${g(t.hrefs.game, { sport: e.sport, id: c.id })}>Box score →</a>
1495
1548
  </li>`)}
1496
1549
  </ul></div>` : p}
1497
1550
  `)}
1498
1551
  `;
1499
1552
  }
1500
- teamBlock(e, t, s, o, r) {
1501
- if (!o) return i`<div class="teamblock ${r ? "right" : ""}"><div class="tname">TBD</div></div>`;
1502
- const d = e.teamsById[s], n = e.records[s], h = E(o, 58);
1503
- return i`
1504
- <div class="teamblock ${r ? "right" : ""}">
1505
- ${h ? i`<img class="crest logo" alt="" loading="lazy" src=${h} />` : i`<span class="crest" style="background:${o.colorPrimary || "#030711"};color:${A(o.colorPrimary || "#030711")}">${j(o)}</span>`}
1553
+ teamBlock(e, t, s, r, o) {
1554
+ if (!r) return n`<div class="teamblock ${o ? "right" : ""}"><div class="tname">TBD</div></div>`;
1555
+ const l = e.teamsById[s], i = e.records[s], h = R(r, 58);
1556
+ return n`
1557
+ <div class="teamblock ${o ? "right" : ""}">
1558
+ ${h ? n`<img class="crest logo" alt="" loading="lazy" src=${h} />` : n`<span class="crest" style="background:${r.colorPrimary || "#030711"};color:${_(r.colorPrimary || "#030711")}">${q(r)}</span>`}
1506
1559
  <div>
1507
- <div class="tname">${Y(e, s, t.date)}<a href=${u(e.hrefs.school, { id: o.id })}>${o.name}</a></div>
1508
- <div class="trec">${o.mascot || ""} · ${w(n)}${d?.conferenceId ? i` · ${w(n, !0)} conf` : p}</div>
1560
+ <div class="tname">${Q(e, s, t.date)}<a href=${g(e.hrefs.school, { id: r.id })}>${r.name}</a></div>
1561
+ <div class="trec">${r.mascot || ""} · ${k(i)}${l?.conferenceId ? n` · ${k(i, !0)} conf` : p}</div>
1509
1562
  </div>
1510
1563
  </div>
1511
1564
  `;
1512
1565
  }
1513
1566
  renderLineScore(e, t, s) {
1514
- const o = e.periodScores || [];
1515
- if (!o.length)
1516
- return i`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>`;
1517
- const r = Math.max(4, ...o.map((l) => l.period)), d = (l) => l <= 4 ? String(l) : `OT${l > 5 ? l - 4 : ""}`, n = (l, c) => {
1518
- const m = o.find((f) => f.period === c);
1519
- return m ? m[l] : e.state === "final" ? 0 : "·";
1520
- }, h = (l, c, m) => i`
1567
+ const r = Ge(e);
1568
+ if (!r)
1569
+ return e.state === "scheduled" ? n`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>` : p;
1570
+ const o = Math.max(X(e.sport), ...r.map((d) => d.period)), l = (d) => Ue(e.sport, d), i = (d, c) => {
1571
+ const m = r.find((f) => f.period === c);
1572
+ return m ? m[d] : e.state === "final" ? 0 : "·";
1573
+ }, h = (d, c, m) => n`
1521
1574
  <tr>
1522
- <td class="teamcell">${C(l, 20)}${l?.abbr || "TBD"}</td>
1523
- ${Array.from({ length: r }, (f, g) => i`<td class="num">${n(c, g + 1)}</td>`)}
1575
+ <td class="teamcell">${D(d, 20)}${d?.abbr || "TBD"}</td>
1576
+ ${Array.from({ length: o }, (f, u) => n`<td class="num">${i(c, u + 1)}</td>`)}
1524
1577
  <td class="num" style="font-weight:700">${m}</td>
1525
1578
  </tr>`;
1526
- return i`
1579
+ return n`
1527
1580
  <div class="tablewrap" style="border-top:1px solid var(--hsot-gray-2)">
1528
1581
  <table class="data" style="max-width:560px;margin:0.6rem auto 0.9rem">
1529
- <thead><tr><th>Team</th>${Array.from({ length: r }, (l, c) => i`<th class="num">${d(c + 1)}</th>`)}<th class="num">T</th></tr></thead>
1582
+ <thead><tr><th>Team</th>${Array.from({ length: o }, (d, c) => n`<th class="num">${l(c + 1)}</th>`)}<th class="num">T</th></tr></thead>
1530
1583
  <tbody>
1531
1584
  ${h(t, "away", e.awayScore)}
1532
1585
  ${h(s, "home", e.homeScore)}
@@ -1536,10 +1589,10 @@ class je extends $ {
1536
1589
  `;
1537
1590
  }
1538
1591
  renderScoringPlays(e, t, s) {
1539
- const o = Array.isArray(e.scoringPlays) ? e.scoringPlays : [];
1540
- if (!o.length) return p;
1541
- const r = (d) => [d.period, d.clock].filter(Boolean).join(" ");
1542
- return i`
1592
+ const r = Array.isArray(e.scoringPlays) ? e.scoringPlays : [];
1593
+ if (!r.length) return p;
1594
+ const o = (l) => [l.period, l.clock].filter(Boolean).join(" ");
1595
+ return n`
1543
1596
  <div class="plays">
1544
1597
  <div class="plays-title">Scoring plays</div>
1545
1598
  <div class="tablewrap">
@@ -1549,11 +1602,11 @@ class je extends $ {
1549
1602
  <th class="num">${t?.abbr || "Away"}</th><th class="num">${s?.abbr || "Home"}</th>
1550
1603
  </tr></thead>
1551
1604
  <tbody>
1552
- ${o.map((d) => i`<tr>
1553
- <td class="when">${r(d) || "·"}</td>
1554
- <td class="play">${d.description || "·"}</td>
1555
- <td class="num">${d.awayScore}</td>
1556
- <td class="num">${d.homeScore}</td>
1605
+ ${r.map((l) => n`<tr>
1606
+ <td class="when">${o(l) || "·"}</td>
1607
+ <td class="play">${l.description || "·"}</td>
1608
+ <td class="num">${l.awayScore}</td>
1609
+ <td class="num">${l.homeScore}</td>
1557
1610
  </tr>`)}
1558
1611
  </tbody>
1559
1612
  </table>
@@ -1563,24 +1616,24 @@ class je extends $ {
1563
1616
  }
1564
1617
  renderContext(e, t, s) {
1565
1618
  if (!s) return p;
1566
- const o = e.records[t], r = q(this.data.games, t);
1567
- return i`
1619
+ const r = e.records[t], o = W(this.data.games, t);
1620
+ return n`
1568
1621
  <div class="card ctxcard">
1569
- <div class="who">${C(s)}${s.name}</div>
1622
+ <div class="who">${D(s)}${s.name}</div>
1570
1623
  <div class="row">
1571
1624
  <span>Last 5: ${K(e, t)}</span>
1572
- <span>Streak: <b>${o ? L(o.results) : "·"}</b></span>
1573
- <span>PF/PA: <b>${o ? `${o.pf} / ${o.pa}` : "·"}</b></span>
1574
- <span>Next: ${r ? i`${y(r.date, { month: "numeric", day: "numeric" })}
1575
- ${r.homeTeamId === t ? "vs" : "at"} ${_(e, r.homeTeamId === t ? r.awayTeamId : r.homeTeamId)}` : "·"}</span>
1625
+ <span>Streak: <b>${r ? H(r.results) : "·"}</b></span>
1626
+ <span>PF/PA: <b>${r ? `${r.pf} / ${r.pa}` : "·"}</b></span>
1627
+ <span>Next: ${o ? n`${$(o.date, { month: "numeric", day: "numeric" })}
1628
+ ${o.homeTeamId === t ? "vs" : "at"} ${N(e, o.homeTeamId === t ? o.awayTeamId : o.homeTeamId)}` : "·"}</span>
1576
1629
  </div>
1577
1630
  </div>
1578
1631
  `;
1579
1632
  }
1580
1633
  }
1581
- globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", je);
1582
- const Ge = 250, qe = 2;
1583
- class We extends te {
1634
+ globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", Xe);
1635
+ const Ze = 250, Je = 2;
1636
+ class et extends ae {
1584
1637
  static properties = {
1585
1638
  api: { type: String },
1586
1639
  schoolHref: { type: String, attribute: "school-href" },
@@ -1591,7 +1644,7 @@ class We extends te {
1591
1644
  activeIndex: { state: !0 },
1592
1645
  searched: { state: !0 }
1593
1646
  };
1594
- static styles = b`
1647
+ static styles = y`
1595
1648
  :host {
1596
1649
  display: block;
1597
1650
  position: relative;
@@ -1660,11 +1713,11 @@ class We extends te {
1660
1713
  }
1661
1714
  onInput(e) {
1662
1715
  const t = e.target.value.trim();
1663
- if (clearTimeout(this.debounceTimer), t.length < qe) {
1716
+ if (clearTimeout(this.debounceTimer), t.length < Je) {
1664
1717
  this.abortController?.abort(), this.results = [], this.open = !1, this.searched = !1;
1665
1718
  return;
1666
1719
  }
1667
- this.debounceTimer = setTimeout(() => this.search(t), Ge);
1720
+ this.debounceTimer = setTimeout(() => this.search(t), Ze);
1668
1721
  }
1669
1722
  async search(e) {
1670
1723
  this.abortController?.abort(), this.abortController = new AbortController();
@@ -1674,8 +1727,8 @@ class We extends te {
1674
1727
  });
1675
1728
  if (!s.ok)
1676
1729
  return;
1677
- const o = await s.json();
1678
- this.results = o.items || [], this.activeIndex = -1, this.searched = !0, this.open = !0;
1730
+ const r = await s.json();
1731
+ this.results = r.items || [], this.activeIndex = -1, this.searched = !0, this.open = !0;
1679
1732
  } catch (t) {
1680
1733
  t.name !== "AbortError" && console.warn("school search failed", t);
1681
1734
  }
@@ -1709,36 +1762,36 @@ class We extends te {
1709
1762
  return [e.location, e.county && `${e.county} County`].filter(Boolean).join(" — ");
1710
1763
  }
1711
1764
  renderOption(e, t) {
1712
- const s = this.where(e), o = (r) => {
1713
- r.preventDefault(), this.go(e);
1765
+ const s = this.where(e), r = (o) => {
1766
+ o.preventDefault(), this.go(e);
1714
1767
  };
1715
- return i`
1768
+ return n`
1716
1769
  <li
1717
1770
  id="school-option-${t}"
1718
1771
  role="option"
1719
1772
  aria-selected="${t === this.activeIndex ? "true" : "false"}"
1720
- @pointerdown="${o}"
1773
+ @pointerdown="${r}"
1721
1774
  @mousemove="${() => {
1722
1775
  this.activeIndex = t;
1723
1776
  }}"
1724
1777
  >
1725
1778
  <span class="name">${e.name}</span>
1726
- ${s ? i`<span class="where">${s}</span>` : p}
1779
+ ${s ? n`<span class="where">${s}</span>` : p}
1727
1780
  </li>
1728
1781
  `;
1729
1782
  }
1730
1783
  renderListbox() {
1731
- const e = this.searched && !this.results.length, t = i`<li class="empty">No schools found</li>`;
1732
- return i`
1784
+ const e = this.searched && !this.results.length, t = n`<li class="empty">No schools found</li>`;
1785
+ return n`
1733
1786
  <ul id="school-search-listbox" role="listbox" aria-label="Schools">
1734
- ${this.results.map((s, o) => this.renderOption(s, o))}
1787
+ ${this.results.map((s, r) => this.renderOption(s, r))}
1735
1788
  ${e ? t : p}
1736
1789
  </ul>
1737
1790
  `;
1738
1791
  }
1739
1792
  render() {
1740
1793
  const e = this.activeIndex >= 0 ? `school-option-${this.activeIndex}` : "";
1741
- return i`
1794
+ return n`
1742
1795
  <input
1743
1796
  type="text"
1744
1797
  role="combobox"
@@ -1757,23 +1810,23 @@ class We extends te {
1757
1810
  `;
1758
1811
  }
1759
1812
  }
1760
- globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search", We);
1813
+ globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search", et);
1761
1814
  export {
1762
- H as D,
1763
- je as H,
1764
- _e as a,
1765
- Ne as b,
1766
- We as c,
1767
- Pe as d,
1768
- Ae as e,
1769
- z as f,
1770
- he as g,
1771
- u as h,
1815
+ O as D,
1816
+ Xe as H,
1817
+ Me as a,
1818
+ Oe as b,
1819
+ et as c,
1820
+ Re as d,
1821
+ Ne as e,
1822
+ P as f,
1823
+ ue as g,
1824
+ g as h,
1772
1825
  G as i,
1773
- Ye as j,
1774
- L as k,
1775
- Fe as p,
1776
- w as r,
1777
- oe as s,
1778
- W as t
1826
+ st as j,
1827
+ H as k,
1828
+ Ae as p,
1829
+ k as r,
1830
+ ne as s,
1831
+ V as t
1779
1832
  };