@wral/hsot-data 0.1.5 → 0.1.7

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,5 +1,5 @@
1
- const G = globalThis, lt = G.ShadowRoot && (G.ShadyCSS === void 0 || G.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ct = /* @__PURE__ */ Symbol(), yt = /* @__PURE__ */ new WeakMap();
2
- let Rt = class {
1
+ const V = globalThis, lt = V.ShadowRoot && (V.ShadyCSS === void 0 || V.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ct = /* @__PURE__ */ Symbol(), xt = /* @__PURE__ */ new WeakMap();
2
+ let Nt = class {
3
3
  constructor(t, e, s) {
4
4
  if (this._$cssResult$ = !0, s !== ct) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
5
5
  this.cssText = t, this.t = e;
@@ -9,7 +9,7 @@ let Rt = class {
9
9
  const e = this.t;
10
10
  if (lt && t === void 0) {
11
11
  const s = e !== void 0 && e.length === 1;
12
- s && (t = yt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && yt.set(e, t));
12
+ s && (t = xt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && xt.set(e, t));
13
13
  }
14
14
  return t;
15
15
  }
@@ -17,101 +17,101 @@ let Rt = class {
17
17
  return this.cssText;
18
18
  }
19
19
  };
20
- const Qt = (a) => new Rt(typeof a == "string" ? a : a + "", void 0, ct), w = (a, ...t) => {
21
- const e = a.length === 1 ? a[0] : t.reduce((s, r, o) => s + ((i) => {
20
+ const ee = (r) => new Nt(typeof r == "string" ? r : r + "", void 0, ct), b = (r, ...t) => {
21
+ const e = r.length === 1 ? r[0] : t.reduce((s, a, o) => s + ((i) => {
22
22
  if (i._$cssResult$ === !0) return i.cssText;
23
23
  if (typeof i == "number") return i;
24
24
  throw Error("Value passed to 'css' function must be a 'css' function result: " + i + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
25
- })(r) + a[o + 1], a[0]);
26
- return new Rt(e, a, ct);
27
- }, Jt = (a, t) => {
28
- if (lt) a.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
25
+ })(a) + r[o + 1], r[0]);
26
+ return new Nt(e, r, ct);
27
+ }, se = (r, t) => {
28
+ if (lt) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
29
29
  else for (const e of t) {
30
- const s = document.createElement("style"), r = G.litNonce;
31
- r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, a.appendChild(s);
30
+ const s = document.createElement("style"), a = V.litNonce;
31
+ a !== void 0 && s.setAttribute("nonce", a), s.textContent = e.cssText, r.appendChild(s);
32
32
  }
33
- }, bt = lt ? (a) => a : (a) => a instanceof CSSStyleSheet ? ((t) => {
33
+ }, kt = lt ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
34
34
  let e = "";
35
35
  for (const s of t.cssRules) e += s.cssText;
36
- return Qt(e);
37
- })(a) : a;
38
- const { is: Xt, defineProperty: te, getOwnPropertyDescriptor: ee, getOwnPropertyNames: se, getOwnPropertySymbols: ae, getPrototypeOf: re } = Object, Q = globalThis, wt = Q.trustedTypes, oe = wt ? wt.emptyScript : "", ie = Q.reactiveElementPolyfillSupport, R = (a, t) => a, ot = { toAttribute(a, t) {
36
+ return ee(e);
37
+ })(r) : r;
38
+ const { is: re, defineProperty: ae, getOwnPropertyDescriptor: oe, getOwnPropertyNames: ie, getOwnPropertySymbols: ne, getPrototypeOf: le } = Object, X = globalThis, _t = X.trustedTypes, ce = _t ? _t.emptyScript : "", he = X.reactiveElementPolyfillSupport, B = (r, t) => r, it = { toAttribute(r, t) {
39
39
  switch (t) {
40
40
  case Boolean:
41
- a = a ? oe : null;
41
+ r = r ? ce : null;
42
42
  break;
43
43
  case Object:
44
44
  case Array:
45
- a = a == null ? a : JSON.stringify(a);
45
+ r = r == null ? r : JSON.stringify(r);
46
46
  }
47
- return a;
48
- }, fromAttribute(a, t) {
49
- let e = a;
47
+ return r;
48
+ }, fromAttribute(r, t) {
49
+ let e = r;
50
50
  switch (t) {
51
51
  case Boolean:
52
- e = a !== null;
52
+ e = r !== null;
53
53
  break;
54
54
  case Number:
55
- e = a === null ? null : Number(a);
55
+ e = r === null ? null : Number(r);
56
56
  break;
57
57
  case Object:
58
58
  case Array:
59
59
  try {
60
- e = JSON.parse(a);
60
+ e = JSON.parse(r);
61
61
  } catch {
62
62
  e = null;
63
63
  }
64
64
  }
65
65
  return e;
66
- } }, Bt = (a, t) => !Xt(a, t), xt = { attribute: !0, type: String, converter: ot, reflect: !1, useDefault: !1, hasChanged: Bt };
67
- Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), Q.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
68
- let C = class extends HTMLElement {
66
+ } }, Ot = (r, t) => !re(r, t), St = { attribute: !0, type: String, converter: it, reflect: !1, useDefault: !1, hasChanged: Ot };
67
+ Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), X.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
68
+ let I = class extends HTMLElement {
69
69
  static addInitializer(t) {
70
70
  this._$Ei(), (this.l ??= []).push(t);
71
71
  }
72
72
  static get observedAttributes() {
73
73
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
74
74
  }
75
- static createProperty(t, e = xt) {
75
+ static createProperty(t, e = St) {
76
76
  if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
77
- const s = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(t, s, e);
78
- r !== void 0 && te(this.prototype, t, r);
77
+ const s = /* @__PURE__ */ Symbol(), a = this.getPropertyDescriptor(t, s, e);
78
+ a !== void 0 && ae(this.prototype, t, a);
79
79
  }
80
80
  }
81
81
  static getPropertyDescriptor(t, e, s) {
82
- const { get: r, set: o } = ee(this.prototype, t) ?? { get() {
82
+ const { get: a, set: o } = oe(this.prototype, t) ?? { get() {
83
83
  return this[e];
84
84
  }, set(i) {
85
85
  this[e] = i;
86
86
  } };
87
- return { get: r, set(i) {
88
- const n = r?.call(this);
87
+ return { get: a, set(i) {
88
+ const n = a?.call(this);
89
89
  o?.call(this, i), this.requestUpdate(t, n, s);
90
90
  }, configurable: !0, enumerable: !0 };
91
91
  }
92
92
  static getPropertyOptions(t) {
93
- return this.elementProperties.get(t) ?? xt;
93
+ return this.elementProperties.get(t) ?? St;
94
94
  }
95
95
  static _$Ei() {
96
- if (this.hasOwnProperty(R("elementProperties"))) return;
97
- const t = re(this);
96
+ if (this.hasOwnProperty(B("elementProperties"))) return;
97
+ const t = le(this);
98
98
  t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
99
99
  }
100
100
  static finalize() {
101
- if (this.hasOwnProperty(R("finalized"))) return;
102
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(R("properties"))) {
103
- const e = this.properties, s = [...se(e), ...ae(e)];
104
- for (const r of s) this.createProperty(r, e[r]);
101
+ if (this.hasOwnProperty(B("finalized"))) return;
102
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(B("properties"))) {
103
+ const e = this.properties, s = [...ie(e), ...ne(e)];
104
+ for (const a of s) this.createProperty(a, e[a]);
105
105
  }
106
106
  const t = this[Symbol.metadata];
107
107
  if (t !== null) {
108
108
  const e = litPropertyMetadata.get(t);
109
- if (e !== void 0) for (const [s, r] of e) this.elementProperties.set(s, r);
109
+ if (e !== void 0) for (const [s, a] of e) this.elementProperties.set(s, a);
110
110
  }
111
111
  this._$Eh = /* @__PURE__ */ new Map();
112
112
  for (const [e, s] of this.elementProperties) {
113
- const r = this._$Eu(e, s);
114
- r !== void 0 && this._$Eh.set(r, e);
113
+ const a = this._$Eu(e, s);
114
+ a !== void 0 && this._$Eh.set(a, e);
115
115
  }
116
116
  this.elementStyles = this.finalizeStyles(this.styles);
117
117
  }
@@ -119,8 +119,8 @@ let C = class extends HTMLElement {
119
119
  const e = [];
120
120
  if (Array.isArray(t)) {
121
121
  const s = new Set(t.flat(1 / 0).reverse());
122
- for (const r of s) e.unshift(bt(r));
123
- } else t !== void 0 && e.push(bt(t));
122
+ for (const a of s) e.unshift(kt(a));
123
+ } else t !== void 0 && e.push(kt(t));
124
124
  return e;
125
125
  }
126
126
  static _$Eu(t, e) {
@@ -146,7 +146,7 @@ let C = class extends HTMLElement {
146
146
  }
147
147
  createRenderRoot() {
148
148
  const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
149
- return Jt(t, this.constructor.elementStyles), t;
149
+ return se(t, this.constructor.elementStyles), t;
150
150
  }
151
151
  connectedCallback() {
152
152
  this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.());
@@ -160,31 +160,31 @@ let C = class extends HTMLElement {
160
160
  this._$AK(t, s);
161
161
  }
162
162
  _$ET(t, e) {
163
- const s = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, s);
164
- if (r !== void 0 && s.reflect === !0) {
165
- const o = (s.converter?.toAttribute !== void 0 ? s.converter : ot).toAttribute(e, s.type);
166
- this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
163
+ const s = this.constructor.elementProperties.get(t), a = this.constructor._$Eu(t, s);
164
+ if (a !== void 0 && s.reflect === !0) {
165
+ const o = (s.converter?.toAttribute !== void 0 ? s.converter : it).toAttribute(e, s.type);
166
+ this._$Em = t, o == null ? this.removeAttribute(a) : this.setAttribute(a, o), this._$Em = null;
167
167
  }
168
168
  }
169
169
  _$AK(t, e) {
170
- const s = this.constructor, r = s._$Eh.get(t);
171
- if (r !== void 0 && this._$Em !== r) {
172
- const o = s.getPropertyOptions(r), i = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : ot;
173
- this._$Em = r;
170
+ const s = this.constructor, a = s._$Eh.get(t);
171
+ if (a !== void 0 && this._$Em !== a) {
172
+ const o = s.getPropertyOptions(a), i = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : it;
173
+ this._$Em = a;
174
174
  const n = i.fromAttribute(e, o.type);
175
- this[r] = n ?? this._$Ej?.get(r) ?? n, this._$Em = null;
175
+ this[a] = n ?? this._$Ej?.get(a) ?? n, this._$Em = null;
176
176
  }
177
177
  }
178
- requestUpdate(t, e, s, r = !1, o) {
178
+ requestUpdate(t, e, s, a = !1, o) {
179
179
  if (t !== void 0) {
180
180
  const i = this.constructor;
181
- if (r === !1 && (o = this[t]), s ??= i.getPropertyOptions(t), !((s.hasChanged ?? Bt)(o, e) || s.useDefault && s.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, s)))) return;
181
+ if (a === !1 && (o = this[t]), s ??= i.getPropertyOptions(t), !((s.hasChanged ?? Ot)(o, e) || s.useDefault && s.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, s)))) return;
182
182
  this.C(t, e, s);
183
183
  }
184
184
  this.isUpdatePending === !1 && (this._$ES = this._$EP());
185
185
  }
186
- C(t, e, { useDefault: s, reflect: r, wrapped: o }, i) {
187
- s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, i ?? e ?? this[t]), o !== !0 || i !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
186
+ C(t, e, { useDefault: s, reflect: a, wrapped: o }, i) {
187
+ s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, i ?? e ?? this[t]), o !== !0 || i !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), a === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
188
188
  }
189
189
  async _$EP() {
190
190
  this.isUpdatePending = !0;
@@ -203,13 +203,13 @@ let C = class extends HTMLElement {
203
203
  if (!this.isUpdatePending) return;
204
204
  if (!this.hasUpdated) {
205
205
  if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
206
- for (const [r, o] of this._$Ep) this[r] = o;
206
+ for (const [a, o] of this._$Ep) this[a] = o;
207
207
  this._$Ep = void 0;
208
208
  }
209
209
  const s = this.constructor.elementProperties;
210
- if (s.size > 0) for (const [r, o] of s) {
211
- const { wrapped: i } = o, n = this[r];
212
- i !== !0 || this._$AL.has(r) || n === void 0 || this.C(r, void 0, o, n);
210
+ if (s.size > 0) for (const [a, o] of s) {
211
+ const { wrapped: i } = o, n = this[a];
212
+ i !== !0 || this._$AL.has(a) || n === void 0 || this.C(a, void 0, o, n);
213
213
  }
214
214
  }
215
215
  let t = !1;
@@ -246,54 +246,54 @@ let C = class extends HTMLElement {
246
246
  firstUpdated(t) {
247
247
  }
248
248
  };
249
- C.elementStyles = [], C.shadowRootOptions = { mode: "open" }, C[R("elementProperties")] = /* @__PURE__ */ new Map(), C[R("finalized")] = /* @__PURE__ */ new Map(), ie?.({ ReactiveElement: C }), (Q.reactiveElementVersions ??= []).push("2.1.2");
250
- const dt = globalThis, kt = (a) => a, V = dt.trustedTypes, _t = V ? V.createPolicy("lit-html", { createHTML: (a) => a }) : void 0, Ft = "$lit$", k = `lit$${Math.random().toFixed(9).slice(2)}$`, Ut = "?" + k, ne = `<${Ut}>`, T = document, F = () => T.createComment(""), U = (a) => a === null || typeof a != "object" && typeof a != "function", ht = Array.isArray, le = (a) => ht(a) || typeof a?.[Symbol.iterator] == "function", at = `[
251
- \f\r]`, D = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, St = /-->/g, At = />/g, S = RegExp(`>|${at}(?:([^\\s"'>=/]+)(${at}*=${at}*(?:[^
252
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Tt = /'/g, Ct = /"/g, Ot = /^(?:script|style|textarea|title)$/i, Nt = (a) => (t, ...e) => ({ _$litType$: a, strings: t, values: e }), l = Nt(1), It = Nt(2), I = /* @__PURE__ */ Symbol.for("lit-noChange"), m = /* @__PURE__ */ Symbol.for("lit-nothing"), Et = /* @__PURE__ */ new WeakMap(), A = T.createTreeWalker(T, 129);
253
- function Ht(a, t) {
254
- if (!ht(a) || !a.hasOwnProperty("raw")) throw Error("invalid template strings array");
255
- return _t !== void 0 ? _t.createHTML(t) : t;
249
+ I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[B("elementProperties")] = /* @__PURE__ */ new Map(), I[B("finalized")] = /* @__PURE__ */ new Map(), he?.({ ReactiveElement: I }), (X.reactiveElementVersions ??= []).push("2.1.2");
250
+ const ht = globalThis, At = (r) => r, Y = ht.trustedTypes, Tt = Y ? Y.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Ut = "$lit$", k = `lit$${Math.random().toFixed(9).slice(2)}$`, Ht = "?" + k, de = `<${Ht}>`, T = document, F = () => T.createComment(""), N = (r) => r === null || typeof r != "object" && typeof r != "function", dt = Array.isArray, pe = (r) => dt(r) || typeof r?.[Symbol.iterator] == "function", at = `[
251
+ \f\r]`, z = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, It = /-->/g, Et = />/g, S = RegExp(`>|${at}(?:([^\\s"'>=/]+)(${at}*=${at}*(?:[^
252
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), Ct = /'/g, Pt = /"/g, Mt = /^(?:script|style|textarea|title)$/i, Lt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), l = Lt(1), Dt = Lt(2), C = /* @__PURE__ */ Symbol.for("lit-noChange"), m = /* @__PURE__ */ Symbol.for("lit-nothing"), zt = /* @__PURE__ */ new WeakMap(), A = T.createTreeWalker(T, 129);
253
+ function jt(r, t) {
254
+ if (!dt(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
255
+ return Tt !== void 0 ? Tt.createHTML(t) : t;
256
256
  }
257
- const ce = (a, t) => {
258
- const e = a.length - 1, s = [];
259
- let r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", i = D;
257
+ const me = (r, t) => {
258
+ const e = r.length - 1, s = [];
259
+ let a, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", i = z;
260
260
  for (let n = 0; n < e; n++) {
261
- const c = a[n];
262
- let p, d, h = -1, f = 0;
263
- for (; f < c.length && (i.lastIndex = f, d = i.exec(c), d !== null); ) f = i.lastIndex, i === D ? d[1] === "!--" ? i = St : d[1] !== void 0 ? i = At : d[2] !== void 0 ? (Ot.test(d[2]) && (r = RegExp("</" + d[2], "g")), i = S) : d[3] !== void 0 && (i = S) : i === S ? d[0] === ">" ? (i = r ?? D, h = -1) : d[1] === void 0 ? h = -2 : (h = i.lastIndex - d[2].length, p = d[1], i = d[3] === void 0 ? S : d[3] === '"' ? Ct : Tt) : i === Ct || i === Tt ? i = S : i === St || i === At ? i = D : (i = S, r = void 0);
264
- const u = i === S && a[n + 1].startsWith("/>") ? " " : "";
265
- o += i === D ? c + ne : h >= 0 ? (s.push(p), c.slice(0, h) + Ft + c.slice(h) + k + u) : c + k + (h === -2 ? n : u);
261
+ const d = r[n];
262
+ let c, h, p = -1, f = 0;
263
+ for (; f < d.length && (i.lastIndex = f, h = i.exec(d), h !== null); ) f = i.lastIndex, i === z ? h[1] === "!--" ? i = It : h[1] !== void 0 ? i = Et : h[2] !== void 0 ? (Mt.test(h[2]) && (a = RegExp("</" + h[2], "g")), i = S) : h[3] !== void 0 && (i = S) : i === S ? h[0] === ">" ? (i = a ?? z, p = -1) : h[1] === void 0 ? p = -2 : (p = i.lastIndex - h[2].length, c = h[1], i = h[3] === void 0 ? S : h[3] === '"' ? Pt : Ct) : i === Pt || i === Ct ? i = S : i === It || i === Et ? i = z : (i = S, a = void 0);
264
+ const u = i === S && r[n + 1].startsWith("/>") ? " " : "";
265
+ o += i === z ? d + de : p >= 0 ? (s.push(c), d.slice(0, p) + Ut + d.slice(p) + k + u) : d + k + (p === -2 ? n : u);
266
266
  }
267
- return [Ht(a, o + (a[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
267
+ return [jt(r, o + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
268
268
  };
269
269
  class O {
270
270
  constructor({ strings: t, _$litType$: e }, s) {
271
- let r;
271
+ let a;
272
272
  this.parts = [];
273
273
  let o = 0, i = 0;
274
- const n = t.length - 1, c = this.parts, [p, d] = ce(t, e);
275
- if (this.el = O.createElement(p, s), A.currentNode = this.el.content, e === 2 || e === 3) {
276
- const h = this.el.content.firstChild;
277
- h.replaceWith(...h.childNodes);
274
+ const n = t.length - 1, d = this.parts, [c, h] = me(t, e);
275
+ if (this.el = O.createElement(c, s), A.currentNode = this.el.content, e === 2 || e === 3) {
276
+ const p = this.el.content.firstChild;
277
+ p.replaceWith(...p.childNodes);
278
278
  }
279
- for (; (r = A.nextNode()) !== null && c.length < n; ) {
280
- if (r.nodeType === 1) {
281
- if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(Ft)) {
282
- const f = d[i++], u = r.getAttribute(h).split(k), $ = /([.?@])?(.*)/.exec(f);
283
- c.push({ type: 1, index: o, name: $[2], strings: u, ctor: $[1] === "." ? he : $[1] === "?" ? pe : $[1] === "@" ? me : J }), r.removeAttribute(h);
284
- } else h.startsWith(k) && (c.push({ type: 6, index: o }), r.removeAttribute(h));
285
- if (Ot.test(r.tagName)) {
286
- const h = r.textContent.split(k), f = h.length - 1;
279
+ for (; (a = A.nextNode()) !== null && d.length < n; ) {
280
+ if (a.nodeType === 1) {
281
+ if (a.hasAttributes()) for (const p of a.getAttributeNames()) if (p.endsWith(Ut)) {
282
+ const f = h[i++], u = a.getAttribute(p).split(k), $ = /([.?@])?(.*)/.exec(f);
283
+ d.push({ type: 1, index: o, name: $[2], strings: u, ctor: $[1] === "." ? ue : $[1] === "?" ? ge : $[1] === "@" ? ve : tt }), a.removeAttribute(p);
284
+ } else p.startsWith(k) && (d.push({ type: 6, index: o }), a.removeAttribute(p));
285
+ if (Mt.test(a.tagName)) {
286
+ const p = a.textContent.split(k), f = p.length - 1;
287
287
  if (f > 0) {
288
- r.textContent = V ? V.emptyScript : "";
289
- for (let u = 0; u < f; u++) r.append(h[u], F()), A.nextNode(), c.push({ type: 2, index: ++o });
290
- r.append(h[f], F());
288
+ a.textContent = Y ? Y.emptyScript : "";
289
+ for (let u = 0; u < f; u++) a.append(p[u], F()), A.nextNode(), d.push({ type: 2, index: ++o });
290
+ a.append(p[f], F());
291
291
  }
292
292
  }
293
- } else if (r.nodeType === 8) if (r.data === Ut) c.push({ type: 2, index: o });
293
+ } else if (a.nodeType === 8) if (a.data === Ht) d.push({ type: 2, index: o });
294
294
  else {
295
- let h = -1;
296
- for (; (h = r.data.indexOf(k, h + 1)) !== -1; ) c.push({ type: 7, index: o }), h += k.length - 1;
295
+ let p = -1;
296
+ for (; (p = a.data.indexOf(k, p + 1)) !== -1; ) d.push({ type: 7, index: o }), p += k.length - 1;
297
297
  }
298
298
  o++;
299
299
  }
@@ -303,13 +303,13 @@ class O {
303
303
  return s.innerHTML = t, s;
304
304
  }
305
305
  }
306
- function E(a, t, e = a, s) {
307
- if (t === I) return t;
308
- let r = s !== void 0 ? e._$Co?.[s] : e._$Cl;
309
- const o = U(t) ? void 0 : t._$litDirective$;
310
- return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(a), r._$AT(a, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = r : e._$Cl = r), r !== void 0 && (t = E(a, r._$AS(a, t.values), r, s)), t;
306
+ function P(r, t, e = r, s) {
307
+ if (t === C) return t;
308
+ let a = s !== void 0 ? e._$Co?.[s] : e._$Cl;
309
+ const o = N(t) ? void 0 : t._$litDirective$;
310
+ return a?.constructor !== o && (a?._$AO?.(!1), o === void 0 ? a = void 0 : (a = new o(r), a._$AT(r, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = a : e._$Cl = a), a !== void 0 && (t = P(r, a._$AS(r, t.values), a, s)), t;
311
311
  }
312
- class de {
312
+ class fe {
313
313
  constructor(t, e) {
314
314
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
315
315
  }
@@ -320,17 +320,17 @@ class de {
320
320
  return this._$AM._$AU;
321
321
  }
322
322
  u(t) {
323
- const { el: { content: e }, parts: s } = this._$AD, r = (t?.creationScope ?? T).importNode(e, !0);
324
- A.currentNode = r;
325
- let o = A.nextNode(), i = 0, n = 0, c = s[0];
326
- for (; c !== void 0; ) {
327
- if (i === c.index) {
328
- let p;
329
- c.type === 2 ? p = new M(o, o.nextSibling, this, t) : c.type === 1 ? p = new c.ctor(o, c.name, c.strings, this, t) : c.type === 6 && (p = new fe(o, this, t)), this._$AV.push(p), c = s[++n];
323
+ const { el: { content: e }, parts: s } = this._$AD, a = (t?.creationScope ?? T).importNode(e, !0);
324
+ A.currentNode = a;
325
+ let o = A.nextNode(), i = 0, n = 0, d = s[0];
326
+ for (; d !== void 0; ) {
327
+ if (i === d.index) {
328
+ let c;
329
+ d.type === 2 ? c = new M(o, o.nextSibling, this, t) : d.type === 1 ? c = new d.ctor(o, d.name, d.strings, this, t) : d.type === 6 && (c = new $e(o, this, t)), this._$AV.push(c), d = s[++n];
330
330
  }
331
- i !== c?.index && (o = A.nextNode(), i++);
331
+ i !== d?.index && (o = A.nextNode(), i++);
332
332
  }
333
- return A.currentNode = T, r;
333
+ return A.currentNode = T, a;
334
334
  }
335
335
  p(t) {
336
336
  let e = 0;
@@ -341,8 +341,8 @@ class M {
341
341
  get _$AU() {
342
342
  return this._$AM?._$AU ?? this._$Cv;
343
343
  }
344
- constructor(t, e, s, r) {
345
- this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = r, this._$Cv = r?.isConnected ?? !0;
344
+ constructor(t, e, s, a) {
345
+ this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = a, this._$Cv = a?.isConnected ?? !0;
346
346
  }
347
347
  get parentNode() {
348
348
  let t = this._$AA.parentNode;
@@ -356,7 +356,7 @@ class M {
356
356
  return this._$AB;
357
357
  }
358
358
  _$AI(t, e = this) {
359
- t = E(this, t, e), U(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== I && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : le(t) ? this.k(t) : this._(t);
359
+ t = P(this, t, e), N(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== C && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : pe(t) ? this.k(t) : this._(t);
360
360
  }
361
361
  O(t) {
362
362
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -365,63 +365,63 @@ class M {
365
365
  this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
366
366
  }
367
367
  _(t) {
368
- this._$AH !== m && U(this._$AH) ? this._$AA.nextSibling.data = t : this.T(T.createTextNode(t)), this._$AH = t;
368
+ this._$AH !== m && N(this._$AH) ? this._$AA.nextSibling.data = t : this.T(T.createTextNode(t)), this._$AH = t;
369
369
  }
370
370
  $(t) {
371
- const { values: e, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = O.createElement(Ht(s.h, s.h[0]), this.options)), s);
372
- if (this._$AH?._$AD === r) this._$AH.p(e);
371
+ const { values: e, _$litType$: s } = t, a = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = O.createElement(jt(s.h, s.h[0]), this.options)), s);
372
+ if (this._$AH?._$AD === a) this._$AH.p(e);
373
373
  else {
374
- const o = new de(r, this), i = o.u(this.options);
374
+ const o = new fe(a, this), i = o.u(this.options);
375
375
  o.p(e), this.T(i), this._$AH = o;
376
376
  }
377
377
  }
378
378
  _$AC(t) {
379
- let e = Et.get(t.strings);
380
- return e === void 0 && Et.set(t.strings, e = new O(t)), e;
379
+ let e = zt.get(t.strings);
380
+ return e === void 0 && zt.set(t.strings, e = new O(t)), e;
381
381
  }
382
382
  k(t) {
383
- ht(this._$AH) || (this._$AH = [], this._$AR());
383
+ dt(this._$AH) || (this._$AH = [], this._$AR());
384
384
  const e = this._$AH;
385
- let s, r = 0;
386
- for (const o of t) r === e.length ? e.push(s = new M(this.O(F()), this.O(F()), this, this.options)) : s = e[r], s._$AI(o), r++;
387
- r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
385
+ let s, a = 0;
386
+ for (const o of t) a === e.length ? e.push(s = new M(this.O(F()), this.O(F()), this, this.options)) : s = e[a], s._$AI(o), a++;
387
+ a < e.length && (this._$AR(s && s._$AB.nextSibling, a), e.length = a);
388
388
  }
389
389
  _$AR(t = this._$AA.nextSibling, e) {
390
390
  for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
391
- const s = kt(t).nextSibling;
392
- kt(t).remove(), t = s;
391
+ const s = At(t).nextSibling;
392
+ At(t).remove(), t = s;
393
393
  }
394
394
  }
395
395
  setConnected(t) {
396
396
  this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
397
397
  }
398
398
  }
399
- class J {
399
+ class tt {
400
400
  get tagName() {
401
401
  return this.element.tagName;
402
402
  }
403
403
  get _$AU() {
404
404
  return this._$AM._$AU;
405
405
  }
406
- constructor(t, e, s, r, o) {
407
- this.type = 1, this._$AH = m, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = m;
406
+ constructor(t, e, s, a, o) {
407
+ this.type = 1, this._$AH = m, this._$AN = void 0, this.element = t, this.name = e, this._$AM = a, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = m;
408
408
  }
409
- _$AI(t, e = this, s, r) {
409
+ _$AI(t, e = this, s, a) {
410
410
  const o = this.strings;
411
411
  let i = !1;
412
- if (o === void 0) t = E(this, t, e, 0), i = !U(t) || t !== this._$AH && t !== I, i && (this._$AH = t);
412
+ if (o === void 0) t = P(this, t, e, 0), i = !N(t) || t !== this._$AH && t !== C, i && (this._$AH = t);
413
413
  else {
414
414
  const n = t;
415
- let c, p;
416
- for (t = o[0], c = 0; c < o.length - 1; c++) p = E(this, n[s + c], e, c), p === I && (p = this._$AH[c]), i ||= !U(p) || p !== this._$AH[c], p === m ? t = m : t !== m && (t += (p ?? "") + o[c + 1]), this._$AH[c] = p;
415
+ let d, c;
416
+ for (t = o[0], d = 0; d < o.length - 1; d++) c = P(this, n[s + d], e, d), c === C && (c = this._$AH[d]), i ||= !N(c) || c !== this._$AH[d], c === m ? t = m : t !== m && (t += (c ?? "") + o[d + 1]), this._$AH[d] = c;
417
417
  }
418
- i && !r && this.j(t);
418
+ i && !a && this.j(t);
419
419
  }
420
420
  j(t) {
421
421
  t === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
422
422
  }
423
423
  }
424
- class he extends J {
424
+ class ue extends tt {
425
425
  constructor() {
426
426
  super(...arguments), this.type = 3;
427
427
  }
@@ -429,7 +429,7 @@ class he extends J {
429
429
  this.element[this.name] = t === m ? void 0 : t;
430
430
  }
431
431
  }
432
- class pe extends J {
432
+ class ge extends tt {
433
433
  constructor() {
434
434
  super(...arguments), this.type = 4;
435
435
  }
@@ -437,20 +437,20 @@ class pe extends J {
437
437
  this.element.toggleAttribute(this.name, !!t && t !== m);
438
438
  }
439
439
  }
440
- class me extends J {
441
- constructor(t, e, s, r, o) {
442
- super(t, e, s, r, o), this.type = 5;
440
+ class ve extends tt {
441
+ constructor(t, e, s, a, o) {
442
+ super(t, e, s, a, o), this.type = 5;
443
443
  }
444
444
  _$AI(t, e = this) {
445
- if ((t = E(this, t, e, 0) ?? m) === I) return;
446
- const s = this._$AH, r = t === m && s !== m || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== m && (s === m || r);
447
- r && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
445
+ if ((t = P(this, t, e, 0) ?? m) === C) return;
446
+ const s = this._$AH, a = t === m && s !== m || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== m && (s === m || a);
447
+ a && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
448
448
  }
449
449
  handleEvent(t) {
450
450
  typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
451
451
  }
452
452
  }
453
- class fe {
453
+ class $e {
454
454
  constructor(t, e, s) {
455
455
  this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
456
456
  }
@@ -458,22 +458,22 @@ class fe {
458
458
  return this._$AM._$AU;
459
459
  }
460
460
  _$AI(t) {
461
- E(this, t);
461
+ P(this, t);
462
462
  }
463
463
  }
464
- const ue = dt.litHtmlPolyfillSupport;
465
- ue?.(O, M), (dt.litHtmlVersions ??= []).push("3.3.3");
466
- const ge = (a, t, e) => {
464
+ const be = ht.litHtmlPolyfillSupport;
465
+ be?.(O, M), (ht.litHtmlVersions ??= []).push("3.3.3");
466
+ const ye = (r, t, e) => {
467
467
  const s = e?.renderBefore ?? t;
468
- let r = s._$litPart$;
469
- if (r === void 0) {
468
+ let a = s._$litPart$;
469
+ if (a === void 0) {
470
470
  const o = e?.renderBefore ?? null;
471
- s._$litPart$ = r = new M(t.insertBefore(F(), o), o, void 0, e ?? {});
471
+ s._$litPart$ = a = new M(t.insertBefore(F(), o), o, void 0, e ?? {});
472
472
  }
473
- return r._$AI(a), r;
473
+ return a._$AI(r), a;
474
474
  };
475
475
  const pt = globalThis;
476
- class B extends C {
476
+ class E extends I {
477
477
  constructor() {
478
478
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
479
479
  }
@@ -483,7 +483,7 @@ class B extends C {
483
483
  }
484
484
  update(t) {
485
485
  const e = this.render();
486
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = ge(e, this.renderRoot, this.renderOptions);
486
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = ye(e, this.renderRoot, this.renderOptions);
487
487
  }
488
488
  connectedCallback() {
489
489
  super.connectedCallback(), this._$Do?.setConnected(!0);
@@ -492,41 +492,41 @@ class B extends C {
492
492
  super.disconnectedCallback(), this._$Do?.setConnected(!1);
493
493
  }
494
494
  render() {
495
- return I;
495
+ return C;
496
496
  }
497
497
  }
498
- B._$litElement$ = !0, B.finalized = !0, pt.litElementHydrateSupport?.({ LitElement: B });
499
- const ve = pt.litElementPolyfillSupport;
500
- ve?.({ LitElement: B });
498
+ E._$litElement$ = !0, E.finalized = !0, pt.litElementHydrateSupport?.({ LitElement: E });
499
+ const we = pt.litElementPolyfillSupport;
500
+ we?.({ LitElement: E });
501
501
  (pt.litElementVersions ??= []).push("4.2.2");
502
- const $e = 50;
503
- function ye(a = {}) {
504
- const t = Object.entries(a).filter(([, s]) => s != null && s !== "");
502
+ const xe = 50;
503
+ function ke(r = {}) {
504
+ const t = Object.entries(r).filter(([, s]) => s != null && s !== "");
505
505
  if (!t.length) return "";
506
506
  const e = new URLSearchParams();
507
- return t.forEach(([s, r]) => e.set(s, String(r))), `?${e.toString()}`;
507
+ return t.forEach(([s, a]) => e.set(s, String(a))), `?${e.toString()}`;
508
508
  }
509
- function be({ baseUrl: a, token: t = "", fetchFn: e } = {}) {
510
- if (!a) throw new Error("createClient requires a baseUrl");
511
- const s = a.replace(/\/+$/, ""), r = e || ((...n) => fetch(...n));
509
+ function _e({ baseUrl: r, token: t = "", fetchFn: e } = {}) {
510
+ if (!r) throw new Error("createClient requires a baseUrl");
511
+ const s = r.replace(/\/+$/, ""), a = e || ((...n) => fetch(...n));
512
512
  async function o(n) {
513
- const c = { Accept: "application/json" };
514
- t && (c.Authorization = `Bearer ${t}`);
515
- const p = await r(`${s}${n}`, { headers: c });
516
- if (!p.ok) {
517
- const d = new Error(`api-hsot ${p.status} on ${n}`);
518
- throw d.status = p.status, d;
513
+ const d = { Accept: "application/json" };
514
+ t && (d.Authorization = `Bearer ${t}`);
515
+ const c = await a(`${s}${n}`, { headers: d });
516
+ if (!c.ok) {
517
+ const h = new Error(`api-hsot ${c.status} on ${n}`);
518
+ throw h.status = c.status, h;
519
519
  }
520
- return p.json();
521
- }
522
- async function i(n, c = {}) {
523
- const p = [];
524
- let d = null;
525
- for (let h = 0; h < $e; h += 1) {
526
- const f = ye(d ? { ...c, cursor: d } : c), u = await o(`${n}${f}`);
527
- if (p.push(...u.items || []), d = u.nextCursor || null, !d) break;
520
+ return c.json();
521
+ }
522
+ async function i(n, d = {}) {
523
+ const c = [];
524
+ let h = null;
525
+ for (let p = 0; p < xe; p += 1) {
526
+ const f = ke(h ? { ...d, cursor: h } : d), u = await o(`${n}${f}`);
527
+ if (c.push(...u.items || []), h = u.nextCursor || null, !h) break;
528
528
  }
529
- return { items: p, total: p.length, nextCursor: null };
529
+ return { items: c, total: c.length, nextCursor: null };
530
530
  }
531
531
  return {
532
532
  listSchools: (n) => i("/schools", n),
@@ -539,132 +539,141 @@ function be({ baseUrl: a, token: t = "", fetchFn: e } = {}) {
539
539
  listGames: (n) => i("/games", n),
540
540
  getGame: (n) => o(`/games/${n}`),
541
541
  listTournaments: (n) => i("/tournaments", n),
542
- listSeedings: (n, c) => i(`/tournaments/${n}/seedings`, c),
542
+ listSeedings: (n, d) => i(`/tournaments/${n}/seedings`, d),
543
543
  listRankings: (n) => i("/rankings", n),
544
544
  listSports: () => o("/sports")
545
545
  };
546
546
  }
547
- const rt = {
547
+ const ot = {
548
548
  game: "/{sport}/game/{id}/",
549
549
  school: "/school/{id}/",
550
550
  section: "/{sport}/{view}/"
551
551
  };
552
- function g(a, t) {
553
- return String(a).replace(/\{(\w+)\}/g, (e, s) => t[s] !== void 0 && t[s] !== null ? String(t[s]) : e);
552
+ function g(r, t) {
553
+ return String(r).replace(/\{(\w+)\}/g, (e, s) => t[s] !== void 0 && t[s] !== null ? String(t[s]) : e);
554
554
  }
555
- function L(a) {
555
+ function L(r) {
556
556
  return {
557
- game: a.getAttribute("game-href") || rt.game,
558
- school: a.getAttribute("school-href") || rt.school,
559
- section: a.getAttribute("section-href") || rt.section
557
+ game: r.getAttribute("game-href") || ot.game,
558
+ school: r.getAttribute("school-href") || ot.school,
559
+ section: r.getAttribute("section-href") || ot.section
560
560
  };
561
561
  }
562
- const P = (a) => a ? a.charAt(0).toUpperCase() + a.slice(1) : "";
563
- function y(a, t) {
564
- if (!a) return "TBD";
565
- const [e, s, r] = String(a).split("-").map(Number);
566
- return !e || !s || !r ? "TBD" : new Date(e, s - 1, r).toLocaleDateString("en-US", t || { weekday: "short", month: "short", day: "numeric" });
562
+ const D = (r) => r ? r.charAt(0).toUpperCase() + r.slice(1) : "";
563
+ function y(r, t) {
564
+ if (!r) return "TBD";
565
+ const [e, s, a] = String(r).split("-").map(Number);
566
+ return !e || !s || !a ? "TBD" : new Date(e, s - 1, a).toLocaleDateString("en-US", t || { weekday: "short", month: "short", day: "numeric" });
567
567
  }
568
- function X(a) {
569
- if (!a) return "";
570
- const [t, e] = String(a).split(":").map(Number);
568
+ function mt(r) {
569
+ if (!r) return "";
570
+ const [t, e] = String(r).split(":").map(Number);
571
571
  if (Number.isNaN(t)) return "";
572
572
  const s = t >= 12 ? "PM" : "AM";
573
573
  return `${(t + 11) % 12 + 1}:${String(e || 0).padStart(2, "0")} ${s}`;
574
574
  }
575
- function we(a) {
576
- return a ? `${Math.floor(a / 12)}-${a % 12}` : "·";
575
+ function Se(r) {
576
+ return r ? `${Math.floor(r / 12)}-${r % 12}` : "·";
577
577
  }
578
- function tt(a = /* @__PURE__ */ new Date()) {
579
- const t = a.getFullYear();
580
- return a.getMonth() >= 6 ? `${t}-${t + 1}` : `${t - 1}-${t}`;
578
+ function et(r = /* @__PURE__ */ new Date()) {
579
+ const t = r.getFullYear();
580
+ return r.getMonth() >= 6 ? `${t}-${t + 1}` : `${t - 1}-${t}`;
581
581
  }
582
- function it(a = /* @__PURE__ */ new Date()) {
582
+ function ft(r = /* @__PURE__ */ new Date()) {
583
583
  const t = (e) => String(e).padStart(2, "0");
584
- return `${a.getFullYear()}-${t(a.getMonth() + 1)}-${t(a.getDate())}`;
584
+ return `${r.getFullYear()}-${t(r.getMonth() + 1)}-${t(r.getDate())}`;
585
+ }
586
+ function Ae(r, t = ft()) {
587
+ const e = [...new Set((r || []).filter(Boolean))].sort();
588
+ if (!e.length || e.includes(t)) return t;
589
+ const s = e.filter((a) => a < t);
590
+ return s.length ? s[s.length - 1] : e[0];
585
591
  }
586
- function mt(a) {
587
- return a ? (a.abbr || a.name || "?").slice(0, 4).toUpperCase() : "?";
592
+ function ut(r) {
593
+ return r ? (r.abbr || r.name || "?").slice(0, 4).toUpperCase() : "?";
588
594
  }
589
- function q(a) {
590
- if (!a || !/^#[0-9a-fA-F]{6}$/.test(a)) return "#FFFFFF";
591
- const t = parseInt(a.slice(1), 16), e = t >> 16 & 255, s = t >> 8 & 255, r = t & 255;
592
- return 0.299 * e + 0.587 * s + 0.114 * r > 150 ? "#0F1B33" : "#FFFFFF";
595
+ function K(r) {
596
+ if (!r || !/^#[0-9a-fA-F]{6}$/.test(r)) return "#FFFFFF";
597
+ const t = parseInt(r.slice(1), 16), e = t >> 16 & 255, s = t >> 8 & 255, a = t & 255;
598
+ return 0.299 * e + 0.587 * s + 0.114 * a > 150 ? "#0F1B33" : "#FFFFFF";
593
599
  }
594
- const xe = (a) => {
595
- const t = ["th", "st", "nd", "rd"], e = a % 100;
596
- return a + (t[(e - 20) % 10] || t[e] || t[0]);
600
+ const Te = (r) => {
601
+ const t = ["th", "st", "nd", "rd"], e = r % 100;
602
+ return r + (t[(e - 20) % 10] || t[e] || t[0]);
597
603
  };
598
- function ke(a) {
599
- if (a.state === "live") return { kind: "live", label: `Live · ${a.period || ""}`.replace(/ · $/, "") };
600
- if (a.state === "final") {
604
+ function Wt(r) {
605
+ if (r.state === "live") return { kind: "live", label: `Live · ${r.period || ""}`.replace(/ · $/, "") };
606
+ if (r.state === "final") {
601
607
  const t = [];
602
- return a.finish === "overtime" && t.push("OT"), a.finish === "shootout" && t.push("PK-SO"), a.forfeit && a.forfeit !== "none" && t.push("Forfeit"), { kind: "final", label: `Final${t.length ? ` · ${t.join(" · ")}` : ""}` };
608
+ return r.finish === "overtime" && t.push("OT"), r.finish === "shootout" && t.push("PK-SO"), r.forfeit && r.forfeit !== "none" && t.push("Forfeit"), { kind: "final", label: `Final${t.length ? ` · ${t.join(" · ")}` : ""}` };
603
609
  }
604
- 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" })} · ${X(a.time)}`.replace(/ · $/, "") };
610
+ return r.state === "postponed" ? { kind: "warn", label: "Postponed" } : r.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${y(r.date, { month: "short", day: "numeric" })} · ${mt(r.time)}`.replace(/ · $/, "") };
605
611
  }
606
- const _e = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
607
- function _(a) {
608
- let t = String(a || "").replace(/^[a-z][a-z0-9+.-]*:\/\/[^/#?]*/i, "");
612
+ const Ie = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
613
+ function _(r) {
614
+ let t = String(r || "").replace(/^[a-z][a-z0-9+.-]*:\/\/[^/#?]*/i, "");
609
615
  const e = t.indexOf("#");
610
616
  let s = "";
611
617
  e !== -1 && (s = t.slice(e).split("?")[0], t = t.slice(0, e));
612
- let r = t.split("?")[0] + s;
613
- return r = r.replace(/([^:])\/{2,}/g, "$1/").replace(/^\/{2,}/, "/"), r = r.replace(/^\/(?=#)/, ""), r.length > 1 && (r = r.replace(/\/+$/, "")), r.toLowerCase();
618
+ let a = t.split("?")[0] + s;
619
+ return a = a.replace(/([^:])\/{2,}/g, "$1/").replace(/^\/{2,}/, "/"), a = a.replace(/^\/(?=#)/, ""), a.length > 1 && (a = a.replace(/\/+$/, "")), a.toLowerCase();
614
620
  }
615
- function Mt() {
616
- const a = globalThis.location;
617
- if (!a) return "";
618
- const t = (a.hash || "").startsWith("#/") ? a.hash : "";
619
- return _((a.pathname || "") + t);
621
+ function qt() {
622
+ const r = globalThis.location;
623
+ if (!r) return "";
624
+ const t = (r.hash || "").startsWith("#/") ? r.hash : "";
625
+ return _((r.pathname || "") + t);
620
626
  }
621
- function Se(a, t, e) {
627
+ function Ee(r, t, e) {
622
628
  if (!e) return null;
623
- const s = _(a);
629
+ const s = _(r);
624
630
  if (!s) return null;
625
- const r = _(g(t.game, { sport: e, id: "" })), o = _(g(t.school, { id: "" }));
626
- if (s === r || s.startsWith(`${r}/`) || s === o || s.startsWith(`${o}/`)) return null;
631
+ const a = _(g(t.game, { sport: e, id: "" })), o = _(g(t.school, { id: "" }));
632
+ if (s === a || s.startsWith(`${a}/`) || s === o || s.startsWith(`${o}/`)) return null;
627
633
  const i = _(g(t.section, { sport: e, view: "" }));
628
634
  if (s === i) return "";
629
635
  if (!s.startsWith(`${i}/`)) return null;
630
- const n = s.slice(i.length + 1), c = n.split("/");
631
- return c.length > 2 || c.some((p) => !/^[a-z][a-z-]*$/.test(p)) || _e.has(c[0]) ? null : n;
636
+ const n = s.slice(i.length + 1), d = n.split("/");
637
+ return d.length > 2 || d.some((c) => !/^[a-z][a-z-]*$/.test(c)) || Ie.has(d[0]) ? null : n;
632
638
  }
633
- function Ae(a, t, e) {
634
- const s = (i) => g(e.section, { sport: a, view: i }).replace(/([^:])\/{2,}/g, "$1/"), o = new Set((t || []).map((i) => i && i.gender).filter((i) => i === "boys" || i === "girls")).size === 2 ? [
639
+ function Ce(r, t, e) {
640
+ const s = (i) => g(e.section, { sport: r, view: i }).replace(/([^:])\/{2,}/g, "$1/"), o = new Set((t || []).map((i) => i && i.gender).filter((i) => i === "boys" || i === "girls")).size === 2 ? [
635
641
  { label: "Boys Standings", href: s("boys/standings") },
636
642
  { label: "Girls Standings", href: s("girls/standings") }
637
643
  ] : [{ label: "Standings", href: s("standings") }];
638
644
  return [
639
- { label: `${P(a)} Home`, href: s("") },
645
+ { label: `${D(r)} Home`, href: s("") },
640
646
  { label: "Scores/Schedule", href: s("scores") },
641
647
  { label: "Playoff Brackets", href: s("brackets") },
642
648
  ...o,
643
649
  { label: "Polls & Rankings", href: s("rankings") }
644
650
  ];
645
651
  }
646
- function Te(a, t = Mt()) {
652
+ function Pe(r, t = qt()) {
647
653
  const e = _(t);
648
- for (const s of a.querySelectorAll(':scope > a[slot="nav"]'))
654
+ for (const s of r.querySelectorAll(':scope > a[slot="nav"]'))
649
655
  e && _(s.getAttribute("href")) === e ? s.setAttribute("aria-current", "page") : s.removeAttribute("aria-current");
650
656
  }
651
- class b extends B {
657
+ class w extends E {
652
658
  static properties = {
653
659
  api: { type: String },
654
660
  refreshInterval: { type: Number, attribute: "refresh-interval" },
661
+ promoHref: { type: String, attribute: "promo-href" },
662
+ promoImage: { type: String, attribute: "promo-image" },
663
+ promoAlt: { type: String, attribute: "promo-alt" },
655
664
  data: { state: !0 },
656
665
  loading: { state: !0 },
657
666
  error: { state: !0 }
658
667
  };
659
668
  constructor() {
660
- super(), this.api = "", this.refreshInterval = 0, this.data = null, this.loading = !1, this.error = "", this._client = null, this._refreshId = null;
669
+ super(), this.api = "", this.refreshInterval = 0, this.promoHref = "", this.promoImage = "", this.promoAlt = "", this.data = null, this.loading = !1, this.error = "", this._client = null, this._refreshId = null;
661
670
  }
662
671
  /** Injected client wins; otherwise build a fetch client from the api attribute. */
663
672
  set client(t) {
664
673
  this._client = t, this.isConnected && this.load();
665
674
  }
666
675
  get client() {
667
- return this._client ? this._client : this.api ? be({ baseUrl: this.api }) : null;
676
+ return this._client ? this._client : this.api ? _e({ baseUrl: this.api }) : null;
668
677
  }
669
678
  connectedCallback() {
670
679
  super.connectedCallback(), this._setupInterval();
@@ -676,7 +685,7 @@ class b extends B {
676
685
  this.load();
677
686
  }
678
687
  updated(t) {
679
- t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval(), Te(this);
688
+ t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval(), Pe(this);
680
689
  }
681
690
  async load() {
682
691
  const t = this.client;
@@ -711,7 +720,7 @@ class b extends B {
711
720
  return l``;
712
721
  }
713
722
  }
714
- const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ce = w`
723
+ const v = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), De = b`
715
724
  :host {
716
725
  --hsot-red: var(--color-red, #D1232A);
717
726
  --hsot-red-deep: var(--color-red-dark, #951C21);
@@ -749,7 +758,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ce = w`
749
758
  outline-offset: 1px;
750
759
  }
751
760
  .mut { color: var(--hsot-gray-5); }
752
- `, Ie = w`
761
+ `, ze = b`
753
762
  .band { background: var(--hsot-white); color: var(--hsot-black); }
754
763
  .band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
755
764
  .band h1, .band h2.bandtitle {
@@ -798,8 +807,29 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ce = w`
798
807
  @media (max-width: 720px) {
799
808
  .band h1, .band h2.bandtitle, .band.section h1, .band.section h2.bandtitle { font-size: 1.8rem; }
800
809
  }
801
- `, Ee = w`
810
+ `, Re = b`
802
811
  .view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
812
+ /* Optional right rail (slot="rail" light-DOM children): a divided 300px
813
+ column on desktop, stacked under the view content on smaller screens. */
814
+ .viewmain, .viewrail { min-width: 0; }
815
+ .view.withrail .viewrail {
816
+ margin-top: 2rem; padding-top: 2rem;
817
+ border-top: 1px solid var(--hsot-gray-2, #E5E3E1);
818
+ }
819
+ @media (min-width: 1200px) {
820
+ .view.withrail {
821
+ /* 332px = 300px rail content + the 2rem divider padding. */
822
+ display: grid; grid-template-columns: minmax(0, 1fr) 332px;
823
+ gap: 2rem; align-items: stretch;
824
+ }
825
+ .view.withrail .viewrail {
826
+ margin-top: 0; padding-top: 0; border-top: none;
827
+ padding-left: 2rem;
828
+ border-left: 1px solid var(--hsot-gray-2, #E5E3E1);
829
+ }
830
+ }
831
+ .promo { text-align: center; margin: 0 0 1.1rem; }
832
+ .promo img { max-width: 100%; height: auto; display: inline-block; }
803
833
  .toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0 0 1.1rem; }
804
834
  .toolbar .spacer { flex: 1; }
805
835
  .asof { font-size: 0.8125rem; color: var(--hsot-gray-5); }
@@ -841,7 +871,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ce = w`
841
871
  .error { padding: 1.2rem 1rem; color: var(--hsot-red-deep); font-size: 0.9rem; }
842
872
  .note { font-size: 0.8125rem; color: var(--hsot-gray-5); margin: 0.6rem 0 0; }
843
873
  .loading { padding: 1.2rem; color: var(--hsot-gray-5); font-family: var(--hsot-heading-font); }
844
- `, Pe = w`
874
+ `, Be = b`
845
875
  .pill {
846
876
  display: inline-block; font-family: var(--hsot-heading-font); font-weight: 700;
847
877
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
@@ -856,7 +886,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ce = w`
856
886
  .pill.champ { background: var(--hsot-straw); color: #6b5900; }
857
887
  @keyframes hsot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
858
888
  @media (prefers-reduced-motion: reduce) { .pill.live { animation: none; } }
859
- `, De = w`
889
+ `, Fe = b`
860
890
  .tablewrap { overflow-x: auto; }
861
891
  table.data { font-family: var(--hsot-heading-font); font-size: 14px; border-collapse: collapse; width: 100%; }
862
892
  table.data th {
@@ -874,7 +904,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ce = w`
874
904
  table.data tbody tr.rowlink:hover { background: var(--hsot-gray-1); }
875
905
  table.data td.teamcell a { color: inherit; text-decoration: none; font-weight: 500; }
876
906
  table.data td.teamcell a:hover { text-decoration: underline; }
877
- `, ze = w`
907
+ `, Ne = b`
878
908
  .swatch {
879
909
  display: inline-flex; align-items: center; justify-content: center;
880
910
  width: 26px; height: 26px; border-radius: 50%;
@@ -898,7 +928,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ce = w`
898
928
  .dot.W { background: var(--hsot-win); }
899
929
  .dot.L { background: var(--hsot-loss); }
900
930
  .dot.T { background: var(--hsot-tie); }
901
- `, Re = w`
931
+ `, Oe = b`
902
932
  ul.gamelist { list-style: none; margin: 0; padding: 0; }
903
933
  .gamelist li {
904
934
  display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 1rem;
@@ -907,6 +937,14 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ce = w`
907
937
  .gamelist li:last-child { border-bottom: none; }
908
938
  .gamelist .d { width: 84px; flex: none; color: var(--hsot-gray-5); font-size: 0.8rem; }
909
939
  .gamelist .res { width: 86px; flex: none; font-family: var(--hsot-heading-font); font-weight: 700; }
940
+ /* Per-team score block on the scoreboard, in the status pills' bubble shape. */
941
+ .gamelist .score {
942
+ display: inline-block; min-width: 1.15em; text-align: center;
943
+ background: var(--hsot-red); color: var(--hsot-white);
944
+ font-family: var(--hsot-heading-font); font-weight: 700; font-size: 0.8125rem;
945
+ line-height: 1.2; border-radius: var(--hsot-radius-md); padding: 0.14rem 0.4rem;
946
+ margin-left: 0.45rem; vertical-align: middle; font-variant-numeric: tabular-nums;
947
+ }
910
948
  .gamelist .res .W { color: var(--hsot-win); }
911
949
  .gamelist .res .L { color: var(--hsot-loss); }
912
950
  .gamelist .res .T { color: var(--hsot-tie); }
@@ -915,91 +953,91 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ce = w`
915
953
  .gamelist .opp a:hover { text-decoration: underline; }
916
954
  .gamelist .where { color: var(--hsot-gray-5); font-size: 0.78rem; }
917
955
  .gamelist a.box { font-size: 0.78rem; }
918
- `, j = [Ce, Ie, Ee, Pe, De, ze, Re];
919
- function ft(a) {
920
- return a.state !== "final" ? null : a.forfeit && a.forfeit !== "none" ? a.forfeit : a.homeScore > a.awayScore ? "home" : a.awayScore > a.homeScore ? "away" : a.tiebreakWinner && a.tiebreakWinner !== "none" ? a.tiebreakWinner : "tie";
956
+ `, j = [De, ze, Re, Be, Fe, Ne, Oe];
957
+ function gt(r) {
958
+ return r.state !== "final" ? null : r.forfeit && r.forfeit !== "none" ? r.forfeit : r.homeScore > r.awayScore ? "home" : r.awayScore > r.homeScore ? "away" : r.tiebreakWinner && r.tiebreakWinner !== "none" ? r.tiebreakWinner : "tie";
921
959
  }
922
- function W(a, t) {
923
- const e = {}, s = (o) => (e[o] = e[o] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, e[o]), r = a.filter((o) => o.state === "final" && o.gameType !== "scrimmage" && !0).sort((o, i) => String(o.date).localeCompare(String(i.date)));
924
- for (const o of r) {
925
- const i = ft(o), n = o.gameType === "conference";
926
- for (const c of ["home", "away"]) {
927
- const p = c === "home" ? o.homeTeamId : o.awayTeamId;
928
- if (!p) continue;
929
- const d = s(p), h = c === "home" ? o.homeScore : o.awayScore, f = c === "home" ? o.awayScore : o.homeScore;
930
- d.pf += h, d.pa += f;
960
+ function W(r, t) {
961
+ const e = {}, s = (o) => (e[o] = e[o] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, e[o]), a = r.filter((o) => o.state === "final" && o.gameType !== "scrimmage" && !0).sort((o, i) => String(o.date).localeCompare(String(i.date)));
962
+ for (const o of a) {
963
+ const i = gt(o), n = o.gameType === "conference";
964
+ for (const d of ["home", "away"]) {
965
+ const c = d === "home" ? o.homeTeamId : o.awayTeamId;
966
+ if (!c) continue;
967
+ const h = s(c), p = d === "home" ? o.homeScore : o.awayScore, f = d === "home" ? o.awayScore : o.homeScore;
968
+ h.pf += p, h.pa += f;
931
969
  let u = "T";
932
- i === "tie" ? (d.t += 1, n && (d.ct += 1)) : i === c ? (d.w += 1, n && (d.cw += 1), u = "W") : (d.l += 1, n && (d.cl += 1), u = "L"), d.results.push({ gameId: o.id, date: o.date, mark: u, my: h, their: f, opp: c === "home" ? o.awayTeamId : o.homeTeamId, conf: n });
970
+ i === "tie" ? (h.t += 1, n && (h.ct += 1)) : i === d ? (h.w += 1, n && (h.cw += 1), u = "W") : (h.l += 1, n && (h.cl += 1), u = "L"), h.results.push({ gameId: o.id, date: o.date, mark: u, my: p, their: f, opp: d === "home" ? o.awayTeamId : o.homeTeamId, conf: n });
933
971
  }
934
972
  }
935
973
  return e;
936
974
  }
937
- function et(a) {
938
- if (!a || !a.length) return "";
939
- const t = a[a.length - 1].mark;
975
+ function st(r) {
976
+ if (!r || !r.length) return "";
977
+ const t = r[r.length - 1].mark;
940
978
  let e = 0;
941
- for (let s = a.length - 1; s >= 0 && a[s].mark === t; s -= 1) e += 1;
979
+ for (let s = r.length - 1; s >= 0 && r[s].mark === t; s -= 1) e += 1;
942
980
  return t + e;
943
981
  }
944
- const Pt = (a, t, e) => {
945
- const s = a + t + e;
946
- return s ? (a + e / 2) / s : 0;
947
- }, Dt = (a) => a.toFixed(3).replace("0.", ".");
948
- function x(a, t = !1) {
949
- if (!a) return "0-0";
950
- const e = t ? a.cw : a.w, s = t ? a.cl : a.l, r = t ? a.ct : a.t;
951
- return `${e}-${s}${r ? `-${r}` : ""}`;
982
+ const Rt = (r, t, e) => {
983
+ const s = r + t + e;
984
+ return s ? (r + e / 2) / s : 0;
985
+ }, Bt = (r) => r.toFixed(3).replace("0.", ".");
986
+ function x(r, t = !1) {
987
+ if (!r) return "0-0";
988
+ const e = t ? r.cw : r.w, s = t ? r.cl : r.l, a = t ? r.ct : r.t;
989
+ return `${e}-${s}${a ? `-${a}` : ""}`;
952
990
  }
953
- function Lt(a, t) {
954
- return a.map((e) => {
991
+ function Gt(r, t) {
992
+ return r.map((e) => {
955
993
  const s = t[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] };
956
- return { team: e, rec: s, confPct: Pt(s.cw, s.cl, s.ct), overallPct: Pt(s.w, s.l, s.t) };
994
+ return { team: e, rec: s, confPct: Rt(s.cw, s.cl, s.ct), overallPct: Rt(s.w, s.l, s.t) };
957
995
  }).sort((e, s) => s.confPct - e.confPct || s.overallPct - e.overallPct || s.rec.pf - s.rec.pa - (e.rec.pf - e.rec.pa));
958
996
  }
959
- function ut(a, t) {
960
- return a.filter((e) => (e.homeTeamId === t || e.awayTeamId === t) && (e.state === "scheduled" || e.state === "live") && e.gameType !== "scrimmage").sort((e, s) => String(e.date).localeCompare(String(s.date)))[0] || null;
997
+ function vt(r, t) {
998
+ return r.filter((e) => (e.homeTeamId === t || e.awayTeamId === t) && (e.state === "scheduled" || e.state === "live") && e.gameType !== "scrimmage").sort((e, s) => String(e.date).localeCompare(String(s.date)))[0] || null;
961
999
  }
962
- function zt(a, t) {
963
- const e = a[t];
1000
+ function Ft(r, t) {
1001
+ const e = r[t];
964
1002
  return e && e.results.length ? e.results[e.results.length - 1] : null;
965
1003
  }
966
- function jt(a, t, e, s, r) {
1004
+ function $t(r, t, e, s, a) {
967
1005
  const o = t[e];
968
1006
  if (!o) return null;
969
1007
  const i = /* @__PURE__ */ new Map();
970
- for (const c of a || []) {
971
- if (c.sport !== s || r && c.effectiveDate > r || c.gender && o.gender !== c.gender && o.gender !== "coed") continue;
972
- const p = c.gender || "", d = i.get(p);
973
- (!d || c.effectiveDate > d.effectiveDate) && i.set(p, c);
1008
+ for (const d of r || []) {
1009
+ if (d.sport !== s || a && d.effectiveDate > a || d.gender && o.gender !== d.gender && o.gender !== "coed") continue;
1010
+ const c = d.gender || "", h = i.get(c);
1011
+ (!h || d.effectiveDate > h.effectiveDate) && i.set(c, d);
974
1012
  }
975
1013
  let n = null;
976
- for (const c of i.values()) {
977
- const p = (c.teamIds || []).indexOf(e);
978
- p !== -1 && (!n || c.effectiveDate > n.effectiveDate) && (n = { poll: c, rank: p + 1 });
1014
+ for (const d of i.values()) {
1015
+ const c = (d.teamIds || []).indexOf(e);
1016
+ c !== -1 && (!n || d.effectiveDate > n.effectiveDate) && (n = { poll: d, rank: c + 1 });
979
1017
  }
980
1018
  return n ? n.rank : null;
981
1019
  }
982
- function Be(a, t, e) {
983
- if (!a) return { kind: "none", delta: 0 };
984
- const s = (a.teamIds || []).indexOf(e) + 1;
1020
+ function Ue(r, t, e) {
1021
+ if (!r) return { kind: "none", delta: 0 };
1022
+ const s = (r.teamIds || []).indexOf(e) + 1;
985
1023
  if (!s) return { kind: "none", delta: 0 };
986
1024
  if (!t) return { kind: "same", delta: 0 };
987
- const r = (t.teamIds || []).indexOf(e) + 1;
988
- if (!r) return { kind: "new", delta: 0 };
989
- const o = r - s;
1025
+ const a = (t.teamIds || []).indexOf(e) + 1;
1026
+ if (!a) return { kind: "new", delta: 0 };
1027
+ const o = a - s;
990
1028
  return o > 0 ? { kind: "up", delta: o } : o < 0 ? { kind: "down", delta: -o } : { kind: "same", delta: 0 };
991
1029
  }
992
- function Fe(a) {
993
- return /^https?:\/\//i.test(String(a || ""));
1030
+ function He(r) {
1031
+ return /^https?:\/\//i.test(String(r || ""));
994
1032
  }
995
- function Y(a, t) {
996
- const e = a?.logoAssetId;
997
- if (!Fe(e)) return "";
998
- const s = Math.max(1, Math.round(t * 2)), r = e.includes("?") ? "&" : "?";
999
- return `${e}${r}w=${s}&h=${s}&f=webp`;
1033
+ function Q(r, t) {
1034
+ const e = r?.logoAssetId;
1035
+ if (!He(e)) return "";
1036
+ const s = Math.max(1, Math.round(t * 2)), a = e.includes("?") ? "&" : "?";
1037
+ return `${e}${a}w=${s}&h=${s}&f=webp`;
1000
1038
  }
1001
- function gt(a, t, { title: e, sub: s, teams: r }) {
1002
- const o = Mt(), n = !!a.querySelector(':scope > a[slot="nav"]') || Se(o, t.hrefs, t.sport) !== null;
1039
+ function bt(r, t, { title: e, sub: s, teams: a }) {
1040
+ const o = qt(), n = !!r.querySelector(':scope > a[slot="nav"]') || Ee(o, t.hrefs, t.sport) !== null;
1003
1041
  return l`
1004
1042
  <div class="band section">
1005
1043
  <div class="inner">
@@ -1007,88 +1045,100 @@ function gt(a, t, { title: e, sub: s, teams: r }) {
1007
1045
  ${s ? l`<p class="sub">${s}</p>` : m}
1008
1046
  </div>
1009
1047
  ${n ? l`
1010
- <nav class="sectionnav" aria-label="${P(t.sport)} section">
1048
+ <nav class="sectionnav" aria-label="${D(t.sport)} section">
1011
1049
  <div class="navrow">
1012
1050
  <slot name="nav">
1013
- ${Ae(t.sport, r, t.hrefs).map((c) => l`<a href=${c.href}
1014
- aria-current=${o && _(c.href) === o ? "page" : m}>${c.label}</a>`)}
1051
+ ${Ce(t.sport, a, t.hrefs).map((d) => l`<a href=${d.href}
1052
+ aria-current=${o && _(d.href) === o ? "page" : m}>${d.label}</a>`)}
1015
1053
  </slot>
1016
1054
  </div>
1017
1055
  </nav>` : m}
1018
1056
  </div>
1019
1057
  `;
1020
1058
  }
1021
- const N = (a, t) => {
1022
- const e = a.teamsById[t];
1023
- return e ? a.schoolsById[e.schoolId] : null;
1024
- }, z = (a, t) => N(a, t)?.name || "TBD", Z = (a, t) => N(a, t)?.abbr || "TBD";
1025
- function H(a, t = 26) {
1026
- if (!a) return m;
1027
- const e = Y(a, t);
1059
+ const U = (r, t) => {
1060
+ const e = r.teamsById[t];
1061
+ return e ? r.schoolsById[e.schoolId] : null;
1062
+ }, R = (r, t) => U(r, t)?.name || "TBD", Z = (r, t) => U(r, t)?.abbr || "TBD";
1063
+ function H(r, t = 26) {
1064
+ if (!r) return m;
1065
+ const e = Q(r, t);
1028
1066
  if (e)
1029
1067
  return l`<img class="swatch logo" aria-hidden="true" alt="" loading="lazy"
1030
1068
  src=${e} style="width:${t}px;height:${t}px" />`;
1031
- const s = a.colorPrimary || "#030711", r = q(s);
1069
+ const s = r.colorPrimary || "#030711", a = K(s);
1032
1070
  return l`<span class="swatch" aria-hidden="true"
1033
- style="width:${t}px;height:${t}px;background:${s};color:${r};font-size:${Math.max(8, t * 0.28)}px"
1034
- >${mt(a)}</span>`;
1071
+ style="width:${t}px;height:${t}px;background:${s};color:${a};font-size:${Math.max(8, t * 0.28)}px"
1072
+ >${ut(r)}</span>`;
1035
1073
  }
1036
- function vt(a, t, e) {
1037
- const s = jt(a.rankings, a.teamsById, t, a.sport, e);
1074
+ function yt(r, t, e) {
1075
+ const s = $t(r.rankings, r.teamsById, t, r.sport, e);
1038
1076
  return s ? l`<span class="rankbadge">#${s}</span>` : m;
1039
1077
  }
1040
- function nt(a, t, e) {
1041
- const s = N(a, t);
1042
- return s ? l`${vt(a, t, e)}<a href=${g(a.hrefs.school, { id: s.id })}>${s.name}</a>` : l`<span class="mut">TBD</span>`;
1078
+ function nt(r, t, e) {
1079
+ const s = U(r, t);
1080
+ return s ? l`${yt(r, t, e)}<a href=${g(r.hrefs.school, { id: s.id })}>${s.name}</a>` : l`<span class="mut">TBD</span>`;
1043
1081
  }
1044
- function $t(a, t, e = 5) {
1045
- const s = a.records[t];
1082
+ function wt(r, t, e = 5) {
1083
+ const s = r.records[t];
1046
1084
  if (!s || !s.results.length) return l`<span class="mut">·</span>`;
1047
- const r = s.results.slice(-1 * e);
1048
- return l`<span class="dots" role="img" aria-label="last ${r.length} results">
1049
- ${r.map((o) => l`<a class="dot ${o.mark}"
1050
- title="${o.mark} ${o.my}-${o.their} vs ${z(a, o.opp)}"
1051
- href=${g(a.hrefs.game, { sport: a.sport, id: o.gameId })}>${o.mark}</a>`)}
1085
+ const a = s.results.slice(-1 * e);
1086
+ return l`<span class="dots" role="img" aria-label="last ${a.length} results">
1087
+ ${a.map((o) => l`<a class="dot ${o.mark}"
1088
+ title="${o.mark} ${o.my}-${o.their} vs ${R(r, o.opp)}"
1089
+ href=${g(r.hrefs.game, { sport: r.sport, id: o.gameId })}>${o.mark}</a>`)}
1052
1090
  </span>`;
1053
1091
  }
1054
- function K(a) {
1055
- const t = ke(a);
1092
+ function q(r, t) {
1093
+ return r.querySelector(':scope > [slot="rail"]') ? l`<div class="view withrail">
1094
+ <div class="viewmain">${t}</div>
1095
+ <aside class="viewrail"><slot name="rail"></slot></aside>
1096
+ </div>` : l`<div class="view">${t}</div>`;
1097
+ }
1098
+ function G(r) {
1099
+ if (!r.promoImage) return m;
1100
+ const t = l`<img src=${r.promoImage} alt=${r.promoAlt || "Sponsor"}>`;
1101
+ return l`<div class="promo">${r.promoHref ? l`<a href=${r.promoHref} target="_blank" rel="sponsored noopener">${t}</a>` : t}</div>`;
1102
+ }
1103
+ function J(r) {
1104
+ const t = Wt(r);
1056
1105
  return l`<span class="pill ${t.kind}">${t.label}</span>`;
1057
1106
  }
1058
- function Wt(a, t, e) {
1107
+ function Vt(r, t, e) {
1059
1108
  if (!t) return l`<span class="mut">·</span>`;
1060
- const s = t.homeTeamId === e ? t.awayTeamId : t.homeTeamId, r = t.homeTeamId === e ? "vs" : "at";
1061
- return l`${t.state === "live" ? l`<span class="pill live">Live</span> ` : l`${y(t.date, { month: "numeric", day: "numeric" })} `}${r} ${Z(a, s)}`;
1109
+ const s = t.homeTeamId === e ? t.awayTeamId : t.homeTeamId, a = t.homeTeamId === e ? "vs" : "at";
1110
+ return l`${t.state === "live" ? l`<span class="pill live">Live</span> ` : l`${y(t.date, { month: "numeric", day: "numeric" })} `}${a} ${Z(r, s)}`;
1062
1111
  }
1063
- class Gt extends b {
1112
+ class Yt extends w {
1064
1113
  static styles = j;
1065
1114
  static properties = {
1066
- ...b.properties,
1115
+ ...w.properties,
1067
1116
  sport: { type: String },
1068
1117
  season: { type: String },
1069
1118
  date: { type: String }
1070
1119
  };
1071
1120
  constructor() {
1072
- super(), this.sport = "football", this.season = "", this.date = "";
1121
+ super(), this.sport = "football", this.season = "", this.date = "", this._datePinned = !1;
1073
1122
  }
1074
1123
  connectedCallback() {
1075
1124
  if (super.connectedCallback(), !this.date) {
1076
1125
  const t = new URLSearchParams(globalThis.location?.search || "").get("date");
1077
- this.date = t || it();
1126
+ t && (this.date = t);
1078
1127
  }
1128
+ this._datePinned = !!this.date;
1079
1129
  }
1080
1130
  async fetchData(t) {
1081
- const e = this.season || tt(), [s, r, o, i, n] = await Promise.all([
1131
+ const e = this.season || et(), [s, a, o, i, n] = await Promise.all([
1082
1132
  t.listSchools(),
1083
1133
  t.listTeams({ sport: this.sport }),
1084
1134
  t.listConferences(),
1085
1135
  t.listGames({ sport: this.sport, season: e }),
1086
1136
  t.listRankings({ sport: this.sport })
1087
1137
  ]);
1088
- return {
1138
+ return this._datePinned || (this.date = Ae(i.items.map((d) => d.date)), this._datePinned = !0), {
1089
1139
  season: e,
1090
1140
  schools: s.items,
1091
- teams: r.items,
1141
+ teams: a.items,
1092
1142
  conferences: o.items,
1093
1143
  games: i.items,
1094
1144
  rankings: n.items
@@ -1105,24 +1155,30 @@ class Gt extends b {
1105
1155
  }, this._ctxData = this.data), this._ctx;
1106
1156
  }
1107
1157
  renderView() {
1108
- const t = this.ctx, e = v(this.data.conferences), s = [...new Set(this.data.games.map((i) => i.date).filter(Boolean))].sort(), r = this.data.games.filter((i) => i.date === this.date).sort((i, n) => (i.state === "live" ? -1 : 1) - (n.state === "live" ? -1 : 1)), o = /* @__PURE__ */ new Map();
1109
- return r.forEach((i) => {
1110
- const n = i.gameType === "conference" && i.conferenceId ? e[i.conferenceId]?.name || "Conference" : i.gameType === "playoff" ? "Playoffs" : i.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
1111
- o.has(n) || o.set(n, []), o.get(n).push(i);
1158
+ const t = this.ctx, e = v(this.data.conferences), s = [...new Set(this.data.games.map((c) => c.date).filter(Boolean))].sort(), a = Number.MAX_SAFE_INTEGER, o = (c) => {
1159
+ const h = [c.awayTeamId, c.homeTeamId].map((p) => $t(t.rankings, t.teamsById, p, this.sport, c.date)).filter(Boolean);
1160
+ return h.length ? Math.min(...h) : a;
1161
+ }, i = this.data.games.filter((c) => c.date === this.date), n = new Map(i.map((c) => [c, o(c)]));
1162
+ i.sort((c, h) => (c.state === "live" ? 0 : 1) - (h.state === "live" ? 0 : 1) || n.get(c) - n.get(h));
1163
+ const d = /* @__PURE__ */ new Map();
1164
+ return i.forEach((c) => {
1165
+ const h = c.gameType === "conference" && c.conferenceId ? e[c.conferenceId]?.name || "Conference" : c.gameType === "playoff" ? "Playoffs" : c.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
1166
+ d.has(h) || d.set(h, []), d.get(h).push(c);
1112
1167
  }), l`
1113
- ${gt(this, t, {
1114
- title: l`${P(this.sport)} scores &amp; schedules`,
1115
- sub: l`${y(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${r.length} games`,
1168
+ ${bt(this, t, {
1169
+ title: l`${D(this.sport)} scores &amp; schedules`,
1170
+ sub: l`${y(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${i.length} games`,
1116
1171
  teams: this.data.teams
1117
1172
  })}
1118
- <div class="view">
1173
+ ${q(this, l`
1174
+ ${G(this)}
1119
1175
  <div class="toolbar">
1120
1176
  <label class="asof" for="datesel">Date</label>
1121
- <select id="datesel" @change=${(i) => {
1122
- this.date = i.target.value;
1177
+ <select id="datesel" @change=${(c) => {
1178
+ this.date = c.target.value;
1123
1179
  }}>
1124
- ${s.map((i) => l`<option value=${i} ?selected=${i === this.date}>
1125
- ${y(i, { weekday: "short", month: "short", day: "numeric" })}${i === it() ? " · today" : ""}
1180
+ ${(s.includes(this.date) ? s : [...s, this.date].sort()).map((c) => l`<option value=${c} ?selected=${c === this.date}>
1181
+ ${y(c, { weekday: "short", month: "short", day: "numeric" })}${c === ft() ? " · today" : ""}
1126
1182
  </option>`)}
1127
1183
  </select>
1128
1184
  <button class="chip" ?disabled=${s.indexOf(this.date) <= 0}
@@ -1136,23 +1192,26 @@ class Gt extends b {
1136
1192
  <span class="spacer"></span>
1137
1193
  <span class="asof">Live games first · report a score to see it update here</span>
1138
1194
  </div>
1139
- ${r.length ? m : l`<p class="empty">No ${this.sport} games on this date.</p>`}
1140
- ${[...o.entries()].map(([i, n]) => l`
1141
- <div class="section-title">${i}</div>
1195
+ ${i.length ? m : l`<p class="empty">No ${this.sport} games on this date.</p>`}
1196
+ ${[...d.entries()].map(([c, h]) => l`
1197
+ <div class="section-title">${c}</div>
1142
1198
  <div class="card"><ul class="gamelist">
1143
- ${n.map((c) => this.renderGame(t, c))}
1199
+ ${h.map((p) => this.renderGame(t, p))}
1144
1200
  </ul></div>
1145
1201
  `)}
1146
- </div>
1202
+ `)}
1147
1203
  `;
1148
1204
  }
1205
+ // Each team's score rides in a block beside its name (reader feedback:
1206
+ // a lone score column on the far right read as detached from the teams).
1207
+ // Scheduled games carry their start time on the status pill alone.
1149
1208
  renderGame(t, e) {
1150
- const s = e.state === "final" || e.state === "live" ? `${e.awayScore}-${e.homeScore}` : X(e.time);
1209
+ const s = e.state === "final" || e.state === "live";
1151
1210
  return l`
1152
1211
  <li>
1153
- ${K(e)}
1154
- <span class="opp">${nt(t, e.awayTeamId, e.date)} at ${nt(t, e.homeTeamId, e.date)}</span>
1155
- <span class="res" style="width:auto">${s}</span>
1212
+ ${J(e)}
1213
+ <span class="opp">${nt(t, e.awayTeamId, e.date)}${s ? l`<span class="score">${e.awayScore}</span>` : m}
1214
+ at ${nt(t, e.homeTeamId, e.date)}${s ? l`<span class="score">${e.homeScore}</span>` : m}</span>
1156
1215
  <span class="where">${e.venue || ""}</span>
1157
1216
  ${e.broadcast ? l`<span class="pill class">${e.broadcast}</span>` : m}
1158
1217
  <a class="box" href=${g(t.hrefs.game, { sport: this.sport, id: e.id })}>Box score →</a>
@@ -1160,11 +1219,11 @@ class Gt extends b {
1160
1219
  `;
1161
1220
  }
1162
1221
  }
1163
- globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", Gt);
1164
- class Vt extends b {
1222
+ globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", Yt);
1223
+ class Kt extends w {
1165
1224
  static styles = j;
1166
1225
  static properties = {
1167
- ...b.properties,
1226
+ ...w.properties,
1168
1227
  sport: { type: String },
1169
1228
  season: { type: String },
1170
1229
  classFilter: { state: !0 },
@@ -1174,7 +1233,7 @@ class Vt extends b {
1174
1233
  super(), this.sport = "football", this.season = "", this.classFilter = "All", this.query = "";
1175
1234
  }
1176
1235
  async fetchData(t) {
1177
- const e = this.season || tt(), [s, r, o, i, n] = await Promise.all([
1236
+ const e = this.season || et(), [s, a, o, i, n] = await Promise.all([
1178
1237
  t.listConferences({ active: !0 }),
1179
1238
  t.listSchools(),
1180
1239
  t.listTeams({ sport: this.sport }),
@@ -1184,7 +1243,7 @@ class Vt extends b {
1184
1243
  return {
1185
1244
  season: e,
1186
1245
  conferences: s.items,
1187
- schools: r.items,
1246
+ schools: a.items,
1188
1247
  teams: o.items,
1189
1248
  games: i.items,
1190
1249
  rankings: n.items
@@ -1201,36 +1260,37 @@ class Vt extends b {
1201
1260
  }, this._ctxData = this.data), this._ctx;
1202
1261
  }
1203
1262
  renderView() {
1204
- const t = this.ctx, e = ["All", ...new Set(this.data.conferences.flatMap((r) => r.classifications || []))].slice(0, 9), s = this.data.conferences.filter((r) => r.active !== !1).filter((r) => this.classFilter === "All" || (r.classifications || []).includes(this.classFilter));
1263
+ const t = this.ctx, e = ["All", ...new Set(this.data.conferences.flatMap((a) => a.classifications || []))].slice(0, 9), s = this.data.conferences.filter((a) => a.active !== !1).filter((a) => this.classFilter === "All" || (a.classifications || []).includes(this.classFilter));
1205
1264
  return l`
1206
- ${gt(this, t, {
1207
- title: l`${P(this.sport)} standings`,
1265
+ ${bt(this, t, {
1266
+ title: l`${D(this.sport)} standings`,
1208
1267
  sub: l`${this.data.season} season · every conference, computed live from reported results`,
1209
1268
  teams: this.data.teams
1210
1269
  })}
1211
- <div class="view">
1270
+ ${q(this, l`
1271
+ ${G(this)}
1212
1272
  <div class="toolbar">
1213
1273
  <div role="group" aria-label="Classification filter">
1214
- ${e.map((r) => l`<button class="chip ${this.classFilter === r ? "on" : ""}"
1274
+ ${e.map((a) => l`<button class="chip ${this.classFilter === a ? "on" : ""}"
1215
1275
  @click=${() => {
1216
- this.classFilter = r;
1217
- }}>${r}</button>`)}
1276
+ this.classFilter = a;
1277
+ }}>${a}</button>`)}
1218
1278
  </div>
1219
1279
  <input type="search" placeholder="Find a school…" aria-label="Find a school"
1220
- .value=${this.query} @input=${(r) => {
1221
- this.query = r.target.value;
1280
+ .value=${this.query} @input=${(a) => {
1281
+ this.query = a.target.value;
1222
1282
  }}>
1223
1283
  <span class="spacer"></span>
1224
- <span class="asof">Records through ${y(it(), { month: "long", day: "numeric" })} · conference games count toward both records · scrimmages toward neither</span>
1284
+ <span class="asof">Records through ${y(ft(), { month: "long", day: "numeric" })} · conference games count toward both records · scrimmages toward neither</span>
1225
1285
  </div>
1226
- ${s.map((r) => this.renderConference(t, r))}
1227
- </div>
1286
+ ${s.map((a) => this.renderConference(t, a))}
1287
+ `)}
1228
1288
  `;
1229
1289
  }
1230
1290
  renderConference(t, e) {
1231
1291
  const s = this.data.teams.filter((i) => i.conferenceId === e.id);
1232
1292
  if (!s.length) return m;
1233
- const r = this.query.trim().toLowerCase(), o = Lt(s, t.records);
1293
+ const a = this.query.trim().toLowerCase(), o = Gt(s, t.records);
1234
1294
  return l`
1235
1295
  <div class="card">
1236
1296
  <div class="card-head">
@@ -1245,44 +1305,44 @@ class Vt extends b {
1245
1305
  <th>Streak</th><th>Last 5</th><th>Next</th>
1246
1306
  </tr></thead>
1247
1307
  <tbody>
1248
- ${o.map((i, n) => this.renderRow(t, i, n, r))}
1308
+ ${o.map((i, n) => this.renderRow(t, i, n, a))}
1249
1309
  </tbody>
1250
1310
  </table></div>
1251
1311
  </div>
1252
1312
  `;
1253
1313
  }
1254
- renderRow(t, e, s, r) {
1314
+ renderRow(t, e, s, a) {
1255
1315
  const o = t.schoolsById[e.team.schoolId], i = o?.name || e.team.name || "TBD";
1256
- if (r && !i.toLowerCase().includes(r)) return m;
1257
- const n = e.rec.pf - e.rec.pa, c = ut(this.data.games, e.team.id), p = (e.team.championships || []).map((h) => l`
1258
- <span class="pill champ" title="${h.season} ${h.title} champion">★ ${h.season} ${h.title}</span>`), d = () => {
1316
+ if (a && !i.toLowerCase().includes(a)) return m;
1317
+ const n = e.rec.pf - e.rec.pa, d = vt(this.data.games, e.team.id), c = (e.team.championships || []).map((p) => l`
1318
+ <span class="pill champ" title="${p.season} ${p.title} champion">★ ${p.season} ${p.title}</span>`), h = () => {
1259
1319
  location.href = g(t.hrefs.school, { id: e.team.schoolId });
1260
1320
  };
1261
1321
  return l`
1262
- <tr class="rowlink" @click=${(h) => {
1263
- h.target.closest("a") || d();
1322
+ <tr class="rowlink" @click=${(p) => {
1323
+ p.target.closest("a") || h();
1264
1324
  }}>
1265
1325
  <td class="mut">${s + 1}</td>
1266
1326
  <td class="teamcell">
1267
- ${H(o)}${vt(t, e.team.id, null)}
1268
- <a href=${g(t.hrefs.school, { id: e.team.schoolId })}>${i}</a> ${p}
1327
+ ${H(o)}${yt(t, e.team.id, null)}
1328
+ <a href=${g(t.hrefs.school, { id: e.team.schoolId })}>${i}</a> ${c}
1269
1329
  </td>
1270
1330
  <td class="num">${x(e.rec, !0)}</td>
1271
- <td class="num">${Dt(e.confPct)}</td>
1331
+ <td class="num">${Bt(e.confPct)}</td>
1272
1332
  <td class="num">${x(e.rec)}</td>
1273
- <td class="num">${Dt(e.overallPct)}</td>
1333
+ <td class="num">${Bt(e.overallPct)}</td>
1274
1334
  <td class="num">${e.rec.pf}</td>
1275
1335
  <td class="num">${e.rec.pa}</td>
1276
1336
  <td class="num" style="color:${n >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${n > 0 ? "+" : ""}${n}</td>
1277
- <td>${et(e.rec.results) || "·"}</td>
1278
- <td>${$t(t, e.team.id)}</td>
1279
- <td>${Wt(t, c, e.team.id)}</td>
1337
+ <td>${st(e.rec.results) || "·"}</td>
1338
+ <td>${wt(t, e.team.id)}</td>
1339
+ <td>${Vt(t, d, e.team.id)}</td>
1280
1340
  </tr>
1281
1341
  `;
1282
1342
  }
1283
1343
  }
1284
- globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", Vt);
1285
- const Ue = w`
1344
+ globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", Kt);
1345
+ const Me = b`
1286
1346
  .hero1 {
1287
1347
  border-radius: var(--hsot-radius-md); color: var(--hsot-white);
1288
1348
  padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.2rem;
@@ -1299,10 +1359,10 @@ const Ue = w`
1299
1359
  .delta.new { background: var(--hsot-straw); color: #6b5900; border-radius: var(--hsot-radius-xs); padding: 0.1rem 0.3rem; font-size: 0.7rem; }
1300
1360
  .sparkline { vertical-align: middle; }
1301
1361
  `;
1302
- class qt extends b {
1303
- static styles = [...j, Ue];
1362
+ class Qt extends w {
1363
+ static styles = [...j, Me];
1304
1364
  static properties = {
1305
- ...b.properties,
1365
+ ...w.properties,
1306
1366
  sport: { type: String },
1307
1367
  gender: { type: String },
1308
1368
  season: { type: String },
@@ -1317,17 +1377,17 @@ class qt extends b {
1317
1377
  t && (this.pollDate = t);
1318
1378
  }
1319
1379
  async fetchData(t) {
1320
- const e = this.season || tt(), [s, r, o, i, n] = await Promise.all([
1380
+ const e = this.season || et(), [s, a, o, i, n] = await Promise.all([
1321
1381
  t.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
1322
1382
  t.listSchools(),
1323
1383
  t.listTeams({ sport: this.sport }),
1324
1384
  t.listConferences(),
1325
1385
  t.listGames({ sport: this.sport, season: e })
1326
- ]), c = s.items.filter((p) => !this.gender || !p.gender || p.gender === this.gender).sort((p, d) => d.effectiveDate.localeCompare(p.effectiveDate));
1386
+ ]), d = s.items.filter((c) => !this.gender || !c.gender || c.gender === this.gender).sort((c, h) => h.effectiveDate.localeCompare(c.effectiveDate));
1327
1387
  return {
1328
1388
  season: e,
1329
- polls: c,
1330
- schools: r.items,
1389
+ polls: d,
1390
+ schools: a.items,
1331
1391
  teams: o.items,
1332
1392
  conferences: i.items,
1333
1393
  games: n.items
@@ -1344,45 +1404,46 @@ class qt extends b {
1344
1404
  }, this._ctxData = this.data), this._ctx;
1345
1405
  }
1346
1406
  sparkline(t, e, s) {
1347
- const n = e.map((h, f) => {
1348
- const u = (h.teamIds || []).indexOf(t);
1407
+ const n = e.map((p, f) => {
1408
+ const u = (p.teamIds || []).indexOf(t);
1349
1409
  if (u === -1) return null;
1350
- const $ = e.length === 1 ? 96 / 2 : f / (e.length - 1) * 90 + 3, st = 3 + u / 24 * 20;
1351
- return { x: $, y: st };
1352
- }), c = [];
1353
- let p = [];
1354
- if (n.forEach((h) => {
1355
- h ? p.push(h) : p.length && (c.push(p), p = []);
1356
- }), p.length && c.push(p), !c.length) return m;
1357
- const d = n[s];
1410
+ const $ = e.length === 1 ? 96 / 2 : f / (e.length - 1) * 90 + 3, rt = 3 + u / 24 * 20;
1411
+ return { x: $, y: rt };
1412
+ }), d = [];
1413
+ let c = [];
1414
+ if (n.forEach((p) => {
1415
+ p ? c.push(p) : c.length && (d.push(c), c = []);
1416
+ }), c.length && d.push(c), !d.length) return m;
1417
+ const h = n[s];
1358
1418
  return l`<svg class="sparkline" width=${96} height=${26} viewBox="0 0 ${96} ${26}" role="img" aria-label="rank history">
1359
- ${c.map((h) => It`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
1360
- points=${h.map((f) => `${f.x.toFixed(1)},${f.y.toFixed(1)}`).join(" ")}></polyline>`)}
1361
- ${d ? It`<circle cx=${d.x.toFixed(1)} cy=${d.y.toFixed(1)} r="3" fill="var(--hsot-black)"></circle>` : m}
1419
+ ${d.map((p) => Dt`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
1420
+ points=${p.map((f) => `${f.x.toFixed(1)},${f.y.toFixed(1)}`).join(" ")}></polyline>`)}
1421
+ ${h ? Dt`<circle cx=${h.x.toFixed(1)} cy=${h.y.toFixed(1)} r="3" fill="var(--hsot-black)"></circle>` : m}
1362
1422
  </svg>`;
1363
1423
  }
1364
1424
  movement(t, e, s) {
1365
- const r = Be(t, e, s);
1366
- return r.kind === "up" ? l`<span class="delta up">▲ ${r.delta}</span>` : r.kind === "down" ? l`<span class="delta down">▼ ${r.delta}</span>` : r.kind === "new" ? l`<span class="delta new">NEW</span>` : r.kind === "same" ? l`<span class="delta same">—</span>` : l`<span class="delta same">·</span>`;
1425
+ const a = Ue(t, e, s);
1426
+ return a.kind === "up" ? l`<span class="delta up">▲ ${a.delta}</span>` : a.kind === "down" ? l`<span class="delta down">▼ ${a.delta}</span>` : a.kind === "new" ? l`<span class="delta new">NEW</span>` : a.kind === "same" ? l`<span class="delta same">—</span>` : l`<span class="delta same">·</span>`;
1367
1427
  }
1368
1428
  renderView() {
1369
1429
  const t = this.ctx, e = this.data.polls;
1370
1430
  if (!e.length) return l`<div class="view"><p class="empty">No ${this.sport} polls published yet this season.</p></div>`;
1371
- const s = Math.max(0, e.findIndex((h) => h.effectiveDate === this.pollDate)), r = e[s] || e[0], o = e[s + 1] || null, i = e.slice().reverse(), n = i.indexOf(r), c = v(this.data.conferences), p = (r.teamIds || [])[0], d = p ? N(t, p) : null;
1431
+ const s = Math.max(0, e.findIndex((p) => p.effectiveDate === this.pollDate)), a = e[s] || e[0], o = e[s + 1] || null, i = e.slice().reverse(), n = i.indexOf(a), d = v(this.data.conferences), c = (a.teamIds || [])[0], h = c ? U(t, c) : null;
1372
1432
  return l`
1373
- ${gt(this, t, {
1374
- title: l`${P(this.sport)} Top 25`,
1433
+ ${bt(this, t, {
1434
+ title: l`${D(this.sport)} Top 25`,
1375
1435
  sub: l`The HighSchoolOT poll · updated weekly · ${e.length} polls this season`,
1376
1436
  teams: this.data.teams
1377
1437
  })}
1378
- <div class="view">
1438
+ ${q(this, l`
1439
+ ${G(this)}
1379
1440
  <div class="toolbar">
1380
1441
  <label class="asof" for="pollsel">Poll of</label>
1381
- <select id="pollsel" @change=${(h) => {
1382
- this.pollDate = h.target.value;
1442
+ <select id="pollsel" @change=${(p) => {
1443
+ this.pollDate = p.target.value;
1383
1444
  }}>
1384
- ${e.map((h, f) => l`<option value=${h.effectiveDate} ?selected=${h === r}>
1385
- ${y(h.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${f === 0 ? " · current" : ""}
1445
+ ${e.map((p, f) => l`<option value=${p.effectiveDate} ?selected=${p === a}>
1446
+ ${y(p.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${f === 0 ? " · current" : ""}
1386
1447
  </option>`)}
1387
1448
  </select>
1388
1449
  <button class="chip" ?disabled=${s >= e.length - 1}
@@ -1396,65 +1457,65 @@ class qt extends b {
1396
1457
  <span class="spacer"></span>
1397
1458
  <span class="asof">Movement vs. the previous poll · sparkline = season rank history</span>
1398
1459
  </div>
1399
- ${d ? this.renderHero(t, r, o, p, d, c) : m}
1460
+ ${h ? this.renderHero(t, a, o, c, h, d) : m}
1400
1461
  <div class="card"><div class="tablewrap"><table class="data">
1401
1462
  <thead><tr>
1402
1463
  <th class="num">Rk</th><th>Mvmt</th><th>Team</th><th class="num">Record</th>
1403
1464
  <th>Conference</th><th>Last result</th><th>Next</th><th>Season</th>
1404
1465
  </tr></thead>
1405
1466
  <tbody>
1406
- ${(r.teamIds || []).map((h, f) => f === 0 || !h ? m : this.renderRow(t, r, o, i, n, c, h, f + 1))}
1467
+ ${(a.teamIds || []).map((p, f) => f === 0 || !p ? m : this.renderRow(t, a, o, i, n, d, p, f + 1))}
1407
1468
  </tbody>
1408
1469
  </table></div></div>
1409
1470
  <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>
1410
- </div>
1471
+ `)}
1411
1472
  `;
1412
1473
  }
1413
- renderHero(t, e, s, r, o, i) {
1414
- const n = t.records[r], c = zt(t.records, r), p = i[t.teamsById[r]?.conferenceId], d = `linear-gradient(120deg, ${o.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
1474
+ renderHero(t, e, s, a, o, i) {
1475
+ const n = t.records[a], d = Ft(t.records, a), c = i[t.teamsById[a]?.conferenceId], h = `linear-gradient(120deg, ${o.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
1415
1476
  return l`
1416
- <div class="hero1" style="background:${d}">
1477
+ <div class="hero1" style="background:${h}">
1417
1478
  <div class="bigrank">#1</div>
1418
1479
  ${H(o, 64)}
1419
1480
  <div>
1420
1481
  <h2><a href=${g(t.hrefs.school, { id: o.id })}>${o.name} ${o.mascot || ""}</a></h2>
1421
1482
  <div class="facts">
1422
- ${x(n)} overall${p ? l` · ${x(n, !0)} ${p.name}` : m}
1423
- · streak ${et(n?.results) || "·"}
1424
- ${c ? l` · last: ${c.mark} ${c.my}-${c.their} vs ${Z(t, c.opp)}` : m}
1425
- &nbsp;${this.movement(e, s, r)}
1483
+ ${x(n)} overall${c ? l` · ${x(n, !0)} ${c.name}` : m}
1484
+ · streak ${st(n?.results) || "·"}
1485
+ ${d ? l` · last: ${d.mark} ${d.my}-${d.their} vs ${Z(t, d.opp)}` : m}
1486
+ &nbsp;${this.movement(e, s, a)}
1426
1487
  </div>
1427
1488
  </div>
1428
1489
  </div>
1429
1490
  `;
1430
1491
  }
1431
- renderRow(t, e, s, r, o, i, n, c) {
1432
- const p = N(t, n);
1433
- if (!p) return m;
1434
- const d = t.records[n], h = zt(t.records, n), f = ut(this.data.games, n), u = i[t.teamsById[n]?.conferenceId], $ = () => {
1435
- location.href = g(t.hrefs.school, { id: p.id });
1492
+ renderRow(t, e, s, a, o, i, n, d) {
1493
+ const c = U(t, n);
1494
+ if (!c) return m;
1495
+ const h = t.records[n], p = Ft(t.records, n), f = vt(this.data.games, n), u = i[t.teamsById[n]?.conferenceId], $ = () => {
1496
+ location.href = g(t.hrefs.school, { id: c.id });
1436
1497
  };
1437
1498
  return l`
1438
- <tr class="rowlink" @click=${(st) => {
1439
- st.target.closest("a") || $();
1499
+ <tr class="rowlink" @click=${(rt) => {
1500
+ rt.target.closest("a") || $();
1440
1501
  }}>
1441
- <td class="num" style="font-weight:700">${c}</td>
1502
+ <td class="num" style="font-weight:700">${d}</td>
1442
1503
  <td>${this.movement(e, s, n)}</td>
1443
- <td class="teamcell">${H(p)}<a href=${g(t.hrefs.school, { id: p.id })}>${p.name}</a>
1444
- <span class="mut" style="font-size:0.78rem">${p.mascot || ""}</span></td>
1445
- <td class="num">${x(d)}</td>
1504
+ <td class="teamcell">${H(c)}<a href=${g(t.hrefs.school, { id: c.id })}>${c.name}</a>
1505
+ <span class="mut" style="font-size:0.78rem">${c.mascot || ""}</span></td>
1506
+ <td class="num">${x(h)}</td>
1446
1507
  <td class="mut">${u?.name || "Independent"}</td>
1447
- <td>${h ? l`<a class="box" style="text-decoration:none" href=${g(t.hrefs.game, { sport: this.sport, id: h.gameId })}>
1448
- <b style="color:${h.mark === "W" ? "var(--hsot-win)" : h.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${h.mark}</b>
1449
- ${h.my}-${h.their} vs ${Z(t, h.opp)}</a>` : l`<span class="mut">·</span>`}</td>
1450
- <td>${Wt(t, f, n)}</td>
1451
- <td>${this.sparkline(n, r, o)}</td>
1508
+ <td>${p ? l`<a class="box" style="text-decoration:none" href=${g(t.hrefs.game, { sport: this.sport, id: p.gameId })}>
1509
+ <b style="color:${p.mark === "W" ? "var(--hsot-win)" : p.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${p.mark}</b>
1510
+ ${p.my}-${p.their} vs ${Z(t, p.opp)}</a>` : l`<span class="mut">·</span>`}</td>
1511
+ <td>${Vt(t, f, n)}</td>
1512
+ <td>${this.sparkline(n, a, o)}</td>
1452
1513
  </tr>
1453
1514
  `;
1454
1515
  }
1455
1516
  }
1456
- globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", qt);
1457
- const Oe = w`
1517
+ globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", Qt);
1518
+ const Le = b`
1458
1519
  .schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
1459
1520
  .schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
1460
1521
  .schoolhero .crest {
@@ -1479,10 +1540,10 @@ const Oe = w`
1479
1540
  .cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 1.25rem; }
1480
1541
  @media (max-width: 900px) { .cols { grid-template-columns: 1fr; } .schoolhero h1 { font-size: 1.9rem; } }
1481
1542
  `;
1482
- class Yt extends b {
1483
- static styles = [...j, Oe];
1543
+ class Zt extends w {
1544
+ static styles = [...j, Le];
1484
1545
  static properties = {
1485
- ...b.properties,
1546
+ ...w.properties,
1486
1547
  schoolId: { type: String, attribute: "school-id" },
1487
1548
  sport: { type: String },
1488
1549
  season: { type: String },
@@ -1497,7 +1558,7 @@ class Yt extends b {
1497
1558
  t && !this.sport && (this.sport = t);
1498
1559
  }
1499
1560
  async fetchData(t) {
1500
- const e = this.season || tt(), s = await t.getSchool(this.schoolId), o = (await t.listTeams({ schoolId: this.schoolId })).items, i = o.find(($) => $.sport === (this.sport || "football")) || o[0] || null, [n, c, p, d, h, f, u] = await Promise.all([
1561
+ const e = this.season || et(), s = await t.getSchool(this.schoolId), o = (await t.listTeams({ schoolId: this.schoolId })).items, i = o.find(($) => $.sport === (this.sport || "football")) || o[0] || null, [n, d, c, h, p, f, u] = await Promise.all([
1501
1562
  i ? t.listGames({ sport: i.sport, season: e }) : Promise.resolve({ items: [] }),
1502
1563
  i ? t.listTeams({ sport: i.sport }) : Promise.resolve({ items: [] }),
1503
1564
  t.listSchools(),
@@ -1514,10 +1575,10 @@ class Yt extends b {
1514
1575
  teams: o,
1515
1576
  active: i,
1516
1577
  games: n.items,
1517
- allTeams: c.items,
1518
- schools: p.items,
1519
- conferences: d.items,
1520
- rankings: h.items,
1578
+ allTeams: d.items,
1579
+ schools: c.items,
1580
+ conferences: h.items,
1581
+ rankings: p.items,
1521
1582
  roster: f.items.find(($) => $.season === e) || null,
1522
1583
  players: u.items
1523
1584
  };
@@ -1536,86 +1597,86 @@ class Yt extends b {
1536
1597
  this.sport = t, this.load();
1537
1598
  }
1538
1599
  renderView() {
1539
- const { school: t, teams: e, active: s, season: r } = this.data;
1600
+ const { school: t, teams: e, active: s, season: a } = this.data;
1540
1601
  if (!t) return l`<div class="view"><p class="empty">School not found.</p></div>`;
1541
- const o = this.ctx, i = q(t.colorPrimary || "#030711"), n = (t.adm || [])[0], c = v(this.data.conferences), p = s ? c[s.conferenceId] : null;
1602
+ const o = this.ctx, i = K(t.colorPrimary || "#030711"), n = (t.adm || [])[0], d = v(this.data.conferences), c = s ? d[s.conferenceId] : null;
1542
1603
  return l`
1543
1604
  <div class="schoolhero" style="background:linear-gradient(115deg, ${t.colorPrimary || "#030711"} 0%, ${t.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${i}">
1544
1605
  <div class="inner">
1545
- ${Y(t, 84) ? l`<img class="crest logo" alt="" loading="lazy" src=${Y(t, 84)} />` : l`<div class="crest" style="background:${t.colorSecondary || "#7C7C7C"};color:${q(t.colorSecondary || "#7C7C7C")}">${mt(t)}</div>`}
1606
+ ${Q(t, 84) ? l`<img class="crest logo" alt="" loading="lazy" src=${Q(t, 84)} />` : l`<div class="crest" style="background:${t.colorSecondary || "#7C7C7C"};color:${K(t.colorSecondary || "#7C7C7C")}">${ut(t)}</div>`}
1546
1607
  <div style="min-width:260px">
1547
1608
  <h1>${t.name} <span class="mascot">${t.mascot || ""}</span></h1>
1548
1609
  <div class="facts">
1549
1610
  ${t.location ? l`<span><b>Location</b>${t.location}${t.county ? l` · ${t.county} County` : m}</span>` : m}
1550
1611
  ${t.association ? l`<span><b>League</b>${t.association}${t.classification ? l` · ${t.classification}` : m}</span>` : m}
1551
- ${p ? l`<span><b>Conference</b>${p.name}</span>` : m}
1612
+ ${c ? l`<span><b>Conference</b>${c.name}</span>` : m}
1552
1613
  ${n ? l`<span><b>Enrollment</b>${n.value.toLocaleString()} (${n.season} ADM)</span>` : m}
1553
1614
  ${t.openingYear ? l`<span><b>Opened</b>${t.openingYear}</span>` : m}
1554
1615
  ${t.areaCode ? l`<span><b>Area</b>${t.areaCode}</span>` : m}
1555
- ${t.tagSlug ? l`<span><b>Tag</b>#${t.tagSlug}</span>` : m}
1556
1616
  </div>
1557
1617
  </div>
1558
1618
  </div>
1559
1619
  </div>
1560
1620
  <div class="band">
1561
1621
  <nav class="tabs" aria-label="Teams">
1562
- ${e.map((d) => d.id === s?.id ? l`<a class="on" href="#" @click=${(h) => h.preventDefault()}>${d.name}</a>` : l`<a href="#" @click=${(h) => {
1563
- h.preventDefault(), this.switchSport(d.sport);
1564
- }}>${d.name}</a>`)}
1622
+ ${e.map((h) => h.id === s?.id ? l`<a class="on" href="#" @click=${(p) => p.preventDefault()}>${h.name}</a>` : l`<a href="#" @click=${(p) => {
1623
+ p.preventDefault(), this.switchSport(h.sport);
1624
+ }}>${h.name}</a>`)}
1565
1625
  </nav>
1566
1626
  </div>
1567
- <div class="view">
1568
- ${s ? this.renderTeam(o, s, p, r) : l`<p class="empty">No teams recorded for this school yet.</p>`}
1569
- </div>
1627
+ ${q(this, l`
1628
+ ${G(this)}
1629
+ ${s ? this.renderTeam(o, s, c, a) : l`<p class="empty">No teams recorded for this school yet.</p>`}
1630
+ `)}
1570
1631
  `;
1571
1632
  }
1572
- renderTeam(t, e, s, r) {
1573
- const o = t.records[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, i = o.w + o.l + o.t, n = s ? this.data.allTeams.filter((h) => h.conferenceId === s.id) : [], c = s ? Lt(n, t.records).findIndex((h) => h.team.id === e.id) + 1 : 0, p = jt(t.rankings, t.teamsById, e.id, e.sport, null), d = this.data.games.filter((h) => h.homeTeamId === e.id || h.awayTeamId === e.id).sort((h, f) => String(h.date).localeCompare(String(f.date)));
1633
+ renderTeam(t, e, s, a) {
1634
+ const o = t.records[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, i = o.w + o.l + o.t, n = s ? this.data.allTeams.filter((p) => p.conferenceId === s.id) : [], d = s ? Gt(n, t.records).findIndex((p) => p.team.id === e.id) + 1 : 0, c = $t(t.rankings, t.teamsById, e.id, e.sport, null), h = this.data.games.filter((p) => p.homeTeamId === e.id || p.awayTeamId === e.id).sort((p, f) => String(p.date).localeCompare(String(f.date)));
1574
1635
  return l`
1575
1636
  <div class="tiles">
1576
1637
  <div class="tile"><div class="k">Overall</div><div class="v">${x(o)}</div><div class="s">${i} games played</div></div>
1577
1638
  <div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${x(o, !0)}</div>
1578
- <div class="s">${c ? `${xe(c)} of ${n.length}` : "·"}</div></div>
1639
+ <div class="s">${d ? `${Te(d)} of ${n.length}` : "·"}</div></div>
1579
1640
  <div class="tile"><div class="k">Points</div><div class="v">${i ? (o.pf / i).toFixed(1) : "0.0"}</div>
1580
1641
  <div class="s">scored per game · ${i ? (o.pa / i).toFixed(1) : "0.0"} allowed</div></div>
1581
- <div class="tile"><div class="k">Streak</div><div class="v">${et(o.results) || "·"}</div>
1582
- <div class="s">last 5: ${$t(t, e.id)}</div></div>
1583
- <div class="tile"><div class="k">HSOT Top 25</div><div class="v">${p ? `#${p}` : "NR"}</div>
1642
+ <div class="tile"><div class="k">Streak</div><div class="v">${st(o.results) || "·"}</div>
1643
+ <div class="s">last 5: ${wt(t, e.id)}</div></div>
1644
+ <div class="tile"><div class="k">HSOT Top 25</div><div class="v">${c ? `#${c}` : "NR"}</div>
1584
1645
  <div class="s"><a href=${g(t.hrefs.section, { sport: e.sport, view: "rankings" })}>full poll</a></div></div>
1585
1646
  </div>
1586
1647
  ${(e.championships || []).length ? l`
1587
1648
  <div style="margin:-0.2rem 0 1rem;display:flex;gap:0.4rem;flex-wrap:wrap">
1588
- ${e.championships.map((h) => l`<span class="pill champ">★ ${h.season} ${h.title} champion${h.classification ? ` · ${h.classification}` : ""}${h.region ? ` · ${h.region}` : ""}</span>`)}
1649
+ ${e.championships.map((p) => l`<span class="pill champ">★ ${p.season} ${p.title} champion${p.classification ? ` · ${p.classification}` : ""}${p.region ? ` · ${p.region}` : ""}</span>`)}
1589
1650
  </div>` : m}
1590
1651
  <div class="cols">
1591
1652
  <div>
1592
1653
  <div class="section-title">Schedule &amp; results</div>
1593
1654
  <div class="card">
1594
- ${d.length ? l`<ul class="gamelist">${d.map((h) => this.renderGameRow(t, e, h))}</ul>` : l`<p class="empty">No ${e.sport} games recorded for ${r}.</p>`}
1655
+ ${h.length ? l`<ul class="gamelist">${h.map((p) => this.renderGameRow(t, e, p))}</ul>` : l`<p class="empty">No ${e.sport} games recorded for ${a}.</p>`}
1595
1656
  </div>
1596
1657
  </div>
1597
1658
  <div>
1598
- <div class="section-title">Roster · ${r}</div>
1599
- <div class="card">${this.renderRoster(r)}</div>
1659
+ <div class="section-title">Roster · ${a}</div>
1660
+ <div class="card">${this.renderRoster(a)}</div>
1600
1661
  </div>
1601
1662
  </div>
1602
1663
  `;
1603
1664
  }
1604
1665
  renderGameRow(t, e, s) {
1605
- const r = s.homeTeamId === e.id, o = r ? s.awayTeamId : s.homeTeamId, i = r ? s.homeScore : s.awayScore, n = r ? s.awayScore : s.homeScore;
1606
- let c = l`<span class="mut">${X(s.time)}</span>`;
1666
+ const a = s.homeTeamId === e.id, o = a ? s.awayTeamId : s.homeTeamId, i = a ? s.homeScore : s.awayScore, n = a ? s.awayScore : s.homeScore;
1667
+ let d = l`<span class="mut">${mt(s.time)}</span>`;
1607
1668
  if (s.state === "final") {
1608
- const d = ft(s), h = d === "tie" ? "T" : d === (r ? "home" : "away") ? "W" : "L";
1609
- c = l`<span class=${h}>${h}</span> ${i}-${n}${s.finish === "overtime" ? l` <span class="mut">OT</span>` : m}${s.forfeit && s.forfeit !== "none" ? l` <span class="mut">FF</span>` : m}`;
1610
- } else s.state === "live" && (c = l`<span style="color:var(--hsot-red)">${i}-${n}</span>`);
1611
- const p = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
1669
+ const h = gt(s), p = h === "tie" ? "T" : h === (a ? "home" : "away") ? "W" : "L";
1670
+ d = l`<span class=${p}>${p}</span> ${i}-${n}${s.finish === "overtime" ? l` <span class="mut">OT</span>` : m}${s.forfeit && s.forfeit !== "none" ? l` <span class="mut">FF</span>` : m}`;
1671
+ } else s.state === "live" && (d = l`<span style="color:var(--hsot-red)">${i}-${n}</span>`);
1672
+ const c = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
1612
1673
  return l`
1613
1674
  <li>
1614
1675
  <span class="d">${y(s.date)}</span>
1615
- ${K(s)}
1616
- <span class="res">${c}</span>
1617
- <span class="opp">${r ? "vs" : "at"} ${nt(t, o, s.date)}
1618
- <span class="pill type">${p}</span>
1676
+ ${Wt(s).kind === "sched" ? m : J(s)}
1677
+ <span class="res">${d}</span>
1678
+ <span class="opp">${a ? "vs" : "at"} ${nt(t, o, s.date)}
1679
+ <span class="pill type">${c}</span>
1619
1680
  ${s.broadcast ? l`<span class="pill class">${s.broadcast}</span>` : m}
1620
1681
  </span>
1621
1682
  <span class="where">${s.venue || ""}</span>
@@ -1627,19 +1688,19 @@ class Yt extends b {
1627
1688
  const e = this.data.roster;
1628
1689
  if (!e)
1629
1690
  return l`<p class="empty">Roster not published for ${t}.</p>`;
1630
- const s = v(this.data.players), r = e.entries.slice().sort((o, i) => (o.number || 0) - (i.number || 0));
1691
+ const s = v(this.data.players), a = e.entries.slice().sort((o, i) => (o.number || 0) - (i.number || 0));
1631
1692
  return l`
1632
1693
  <div class="tablewrap"><table class="data">
1633
1694
  <thead><tr><th class="num">No.</th><th>Player</th><th>Pos</th><th>Class</th><th class="num">Ht</th><th class="num">Wt</th></tr></thead>
1634
1695
  <tbody>
1635
- ${r.map((o) => {
1696
+ ${a.map((o) => {
1636
1697
  const i = s[o.playerId];
1637
1698
  return i ? l`<tr>
1638
1699
  <td class="num mut">${o.number ?? "·"}</td>
1639
1700
  <td style="font-weight:500">${i.firstName} ${i.lastName}</td>
1640
1701
  <td>${o.position || "·"}</td>
1641
1702
  <td class="mut">${i.classOf || "·"}</td>
1642
- <td class="num">${we(i.heightIn)}</td>
1703
+ <td class="num">${Se(i.heightIn)}</td>
1643
1704
  <td class="num">${i.weightLb || "·"}</td>
1644
1705
  </tr>` : m;
1645
1706
  })}
@@ -1648,37 +1709,37 @@ class Yt extends b {
1648
1709
  `;
1649
1710
  }
1650
1711
  }
1651
- globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", Yt);
1652
- const Ne = "https://api.wral.com/search";
1653
- function He(a) {
1654
- return a.map((t) => `uri:"${t}"`).join(" OR ");
1712
+ globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", Zt);
1713
+ const je = "https://api.wral.com/search";
1714
+ function We(r) {
1715
+ return r.map((t) => `uri:"${t}"`).join(" OR ");
1655
1716
  }
1656
- function Me(a, t) {
1657
- const e = String(a || Ne).replace(/\/+$/, ""), s = new URLSearchParams({ query: He(t), sort: "score", lang: "en" });
1717
+ function qe(r, t) {
1718
+ const e = String(r || je).replace(/\/+$/, ""), s = new URLSearchParams({ query: We(t), sort: "score", lang: "en" });
1658
1719
  return `${e}/v1/query?${s}`;
1659
1720
  }
1660
- function Zt(a) {
1721
+ function Jt(r) {
1661
1722
  try {
1662
- const t = new URL(a);
1723
+ const t = new URL(r);
1663
1724
  if (/(^|\.)smugmug\.com$/i.test(t.hostname)) {
1664
1725
  const e = t.pathname.split("/").filter(Boolean).pop() || "", s = !e || /^[ni]-[A-Za-z0-9]+$/.test(e);
1665
1726
  return {
1666
- uri: a,
1667
- title: s ? a : decodeURIComponent(e).replace(/-/g, " "),
1727
+ uri: r,
1728
+ title: s ? r : decodeURIComponent(e).replace(/-/g, " "),
1668
1729
  photos: !0
1669
1730
  };
1670
1731
  }
1671
1732
  } catch {
1672
1733
  }
1673
- return { uri: a, title: a };
1734
+ return { uri: r, title: r };
1674
1735
  }
1675
- async function Le(a, t, e) {
1676
- const r = await ((...n) => fetch(...n))(Me(a, t));
1677
- if (!r.ok) throw new Error(`search answered ${r.status}`);
1678
- const o = await r.json(), i = new Map((o.items || []).map((n) => [n.uri, n]));
1679
- return t.map((n) => i.get(n) || Zt(n));
1736
+ async function Ge(r, t, e) {
1737
+ const a = await ((...n) => fetch(...n))(qe(r, t));
1738
+ if (!a.ok) throw new Error(`search answered ${a.status}`);
1739
+ const o = await a.json(), i = new Map((o.items || []).map((n) => [n.uri, n]));
1740
+ return t.map((n) => i.get(n) || Jt(n));
1680
1741
  }
1681
- const je = w`
1742
+ const Ve = b`
1682
1743
  .breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
1683
1744
  .breadcrumbs a { text-decoration: none; }
1684
1745
  .scorehead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 1.4rem 1rem; }
@@ -1717,10 +1778,10 @@ const je = w`
1717
1778
  .cols { grid-template-columns: 1fr; }
1718
1779
  }
1719
1780
  `;
1720
- class Kt extends b {
1721
- static styles = [...j, je];
1781
+ class Xt extends w {
1782
+ static styles = [...j, Ve];
1722
1783
  static properties = {
1723
- ...b.properties,
1784
+ ...w.properties,
1724
1785
  gameId: { type: String, attribute: "game-id" },
1725
1786
  // The public site search that resolves Game.coverageUrls into cards
1726
1787
  // (DEV-1236). Shared cross-stage by design — see the studio host's
@@ -1732,7 +1793,7 @@ class Kt extends b {
1732
1793
  super(), this.gameId = "", this.searchApi = "";
1733
1794
  }
1734
1795
  async fetchData(t) {
1735
- const e = await t.getGame(this.gameId), s = Array.isArray(e.coverageUrls) ? e.coverageUrls : [], [r, o, i, n, c, p] = await Promise.all([
1796
+ const e = await t.getGame(this.gameId), s = Array.isArray(e.coverageUrls) ? e.coverageUrls : [], [a, o, i, n, d, c] = await Promise.all([
1736
1797
  t.listSchools(),
1737
1798
  t.listTeams({ sport: e.sport }),
1738
1799
  t.listConferences(),
@@ -1740,16 +1801,16 @@ class Kt extends b {
1740
1801
  t.listGames({ sport: e.sport, season: e.season }),
1741
1802
  // A search outage must not blank the box score — degrade to bare
1742
1803
  // links (fetchCoverage already degrades per-URL index misses).
1743
- s.length ? Le(this.searchApi, s).catch(() => s.map(Zt)) : Promise.resolve([])
1804
+ s.length ? Ge(this.searchApi, s).catch(() => s.map(Jt)) : Promise.resolve([])
1744
1805
  ]);
1745
1806
  return {
1746
1807
  game: e,
1747
- schools: r.items,
1808
+ schools: a.items,
1748
1809
  teams: o.items,
1749
1810
  conferences: i.items,
1750
1811
  rankings: n.items,
1751
- games: c.items,
1752
- coverage: p
1812
+ games: d.items,
1813
+ coverage: c
1753
1814
  };
1754
1815
  }
1755
1816
  get ctx() {
@@ -1765,48 +1826,49 @@ class Kt extends b {
1765
1826
  renderView() {
1766
1827
  const t = this.data.game;
1767
1828
  if (!t) return l`<div class="view"><p class="empty">Game not found.</p></div>`;
1768
- const e = this.ctx, s = v(this.data.conferences), r = e.teamsById[t.awayTeamId] ? e.schoolsById[e.teamsById[t.awayTeamId].schoolId] : null, o = e.teamsById[t.homeTeamId] ? e.schoolsById[e.teamsById[t.homeTeamId].schoolId] : null, i = ft(t), n = (d) => t.state === "final" && i !== d && i !== "tie" ? "opacity:0.45" : "", c = t.conferenceId ? s[t.conferenceId] : null, p = this.data.games.filter((d) => d.id !== t.id && d.state === "final" && d.gameType !== "scrimmage" && (d.homeTeamId === t.homeTeamId && d.awayTeamId === t.awayTeamId || d.homeTeamId === t.awayTeamId && d.awayTeamId === t.homeTeamId));
1829
+ const e = this.ctx, s = v(this.data.conferences), a = e.teamsById[t.awayTeamId] ? e.schoolsById[e.teamsById[t.awayTeamId].schoolId] : null, o = e.teamsById[t.homeTeamId] ? e.schoolsById[e.teamsById[t.homeTeamId].schoolId] : null, i = gt(t), n = (h) => t.state === "final" && i !== h && i !== "tie" ? "opacity:0.45" : "", d = t.conferenceId ? s[t.conferenceId] : null, c = this.data.games.filter((h) => h.id !== t.id && h.state === "final" && h.gameType !== "scrimmage" && (h.homeTeamId === t.homeTeamId && h.awayTeamId === t.awayTeamId || h.homeTeamId === t.awayTeamId && h.awayTeamId === t.homeTeamId));
1769
1830
  return l`
1770
- <div class="view">
1831
+ ${q(this, l`
1832
+ ${G(this)}
1771
1833
  <p class="breadcrumbs">
1772
- <a href=${g(e.hrefs.section, { sport: t.sport, view: "scores" })}>${P(t.sport)}</a> /
1834
+ <a href=${g(e.hrefs.section, { sport: t.sport, view: "scores" })}>${D(t.sport)}</a> /
1773
1835
  <a href=${g(e.hrefs.section, { sport: t.sport, view: "scores" })}>Scores/Schedules</a> /
1774
- ${z(e, t.awayTeamId)} at ${z(e, t.homeTeamId)}
1836
+ ${R(e, t.awayTeamId)} at ${R(e, t.homeTeamId)}
1775
1837
  </p>
1776
1838
  <div class="card">
1777
1839
  <div class="scorehead">
1778
- ${this.teamBlock(e, t, t.awayTeamId, r, !1)}
1840
+ ${this.teamBlock(e, t, t.awayTeamId, a, !1)}
1779
1841
  <div class="mid">
1780
1842
  <div class="bigscore">
1781
1843
  <span style=${n("away")}>${t.awayScore}</span>
1782
1844
  <span class="mut" style="font-size:1.6rem">–</span>
1783
1845
  <span style=${n("home")}>${t.homeScore}</span>
1784
1846
  </div>
1785
- <div class="status">${K(t)}</div>
1786
- <div class="status">${y(t.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${t.state === "scheduled" && t.time ? l` · ${X(t.time)}` : m} · ${t.venue || "Venue TBD"}
1847
+ <div class="status">${J(t)}</div>
1848
+ <div class="status">${y(t.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${t.state === "scheduled" && t.time ? l` · ${mt(t.time)}` : m} · ${t.venue || "Venue TBD"}
1787
1849
  ${t.broadcast ? l` · <span class="pill class">${t.broadcast}</span>` : m}</div>
1788
1850
  <div class="status">
1789
- <span class="pill type">${t.gameType === "conference" ? `${c?.name || "Conference"} game` : t.gameType}</span>
1851
+ <span class="pill type">${t.gameType === "conference" ? `${d?.name || "Conference"} game` : t.gameType}</span>
1790
1852
  ${t.label ? l`<span class="pill type">Bracket ${t.label}</span>` : m}
1791
- ${(t.tags || []).map((d) => l`<span class="pill type">${d}</span>`)}
1853
+ ${(t.tags || []).map((h) => l`<span class="pill type">${h}</span>`)}
1792
1854
  </div>
1793
1855
  </div>
1794
1856
  ${this.teamBlock(e, t, t.homeTeamId, o, !0)}
1795
1857
  </div>
1796
- ${this.renderLineScore(t, r, o)}
1858
+ ${this.renderLineScore(t, a, o)}
1797
1859
  ${t.notes ? l`<p class="note" style="padding:0 1rem 0.9rem;text-align:center">${t.notes}</p>` : m}
1798
1860
  </div>
1799
1861
  ${(this.data.coverage || []).length ? l`
1800
1862
  <div class="section-title">Coverage</div>
1801
1863
  <div class="covgrid">
1802
- ${this.data.coverage.map((d) => l`
1803
- <a class="card covcard" href=${d.uri}>
1804
- ${d.image ? l`<img class="covimg" src=${d.image} alt="" loading="lazy" />` : m}
1864
+ ${this.data.coverage.map((h) => l`
1865
+ <a class="card covcard" href=${h.uri}>
1866
+ ${h.image ? l`<img class="covimg" src=${h.image} alt="" loading="lazy" />` : m}
1805
1867
  <div class="covbody">
1806
- <div class="covtitle">${d.videoDuration ? l`<span class="pill live" style="animation:none">Video</span> ` : m}${d.photos ? l`<span class="pill live" style="animation:none">Photos</span> ` : m}${d.title || d.uri}</div>
1807
- ${d.description ? l`<p class="covdesc">${d.description}</p>` : m}
1808
- ${d.author || d.publishedTime ? l`
1809
- <div class="covmeta">${[d.author, d.publishedTime ? new Date(d.publishedTime).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : ""].filter(Boolean).join(" · ")}</div>
1868
+ <div class="covtitle">${h.videoDuration ? l`<span class="pill live" style="animation:none">Video</span> ` : m}${h.photos ? l`<span class="pill live" style="animation:none">Photos</span> ` : m}${h.title || h.uri}</div>
1869
+ ${h.description ? l`<p class="covdesc">${h.description}</p>` : m}
1870
+ ${h.author || h.publishedTime ? l`
1871
+ <div class="covmeta">${[h.author, h.publishedTime ? new Date(h.publishedTime).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : ""].filter(Boolean).join(" · ")}</div>
1810
1872
  ` : m}
1811
1873
  </div>
1812
1874
  </a>
@@ -1814,53 +1876,53 @@ class Kt extends b {
1814
1876
  </div>` : m}
1815
1877
  <div class="section-title">Season context</div>
1816
1878
  <div class="cols">
1817
- ${[[t.awayTeamId, r], [t.homeTeamId, o]].map(([d, h]) => this.renderContext(e, d, h))}
1879
+ ${[[t.awayTeamId, a], [t.homeTeamId, o]].map(([h, p]) => this.renderContext(e, h, p))}
1818
1880
  </div>
1819
- ${p.length ? l`
1881
+ ${c.length ? l`
1820
1882
  <div class="section-title">Head to head this season</div>
1821
1883
  <div class="card"><ul class="gamelist">
1822
- ${p.map((d) => l`<li>
1823
- <span class="d">${y(d.date)}</span>${K(d)}
1824
- <span class="opp">${z(e, d.awayTeamId)} ${d.awayScore}, ${z(e, d.homeTeamId)} ${d.homeScore}</span>
1825
- <a class="box" href=${g(e.hrefs.game, { sport: t.sport, id: d.id })}>Box score →</a>
1884
+ ${c.map((h) => l`<li>
1885
+ <span class="d">${y(h.date)}</span>${J(h)}
1886
+ <span class="opp">${R(e, h.awayTeamId)} ${h.awayScore}, ${R(e, h.homeTeamId)} ${h.homeScore}</span>
1887
+ <a class="box" href=${g(e.hrefs.game, { sport: t.sport, id: h.id })}>Box score →</a>
1826
1888
  </li>`)}
1827
1889
  </ul></div>` : m}
1828
- </div>
1890
+ `)}
1829
1891
  `;
1830
1892
  }
1831
- teamBlock(t, e, s, r, o) {
1832
- if (!r) return l`<div class="teamblock ${o ? "right" : ""}"><div class="tname">TBD</div></div>`;
1833
- const i = t.teamsById[s], n = t.records[s], c = Y(r, 58);
1893
+ teamBlock(t, e, s, a, o) {
1894
+ if (!a) return l`<div class="teamblock ${o ? "right" : ""}"><div class="tname">TBD</div></div>`;
1895
+ const i = t.teamsById[s], n = t.records[s], d = Q(a, 58);
1834
1896
  return l`
1835
1897
  <div class="teamblock ${o ? "right" : ""}">
1836
- ${c ? l`<img class="crest logo" alt="" loading="lazy" src=${c} />` : l`<span class="crest" style="background:${r.colorPrimary || "#030711"};color:${q(r.colorPrimary || "#030711")}">${mt(r)}</span>`}
1898
+ ${d ? l`<img class="crest logo" alt="" loading="lazy" src=${d} />` : l`<span class="crest" style="background:${a.colorPrimary || "#030711"};color:${K(a.colorPrimary || "#030711")}">${ut(a)}</span>`}
1837
1899
  <div>
1838
- <div class="tname">${vt(t, s, e.date)}<a href=${g(t.hrefs.school, { id: r.id })}>${r.name}</a></div>
1839
- <div class="trec">${r.mascot || ""} · ${x(n)}${i?.conferenceId ? l` · ${x(n, !0)} conf` : m}</div>
1900
+ <div class="tname">${yt(t, s, e.date)}<a href=${g(t.hrefs.school, { id: a.id })}>${a.name}</a></div>
1901
+ <div class="trec">${a.mascot || ""} · ${x(n)}${i?.conferenceId ? l` · ${x(n, !0)} conf` : m}</div>
1840
1902
  </div>
1841
1903
  </div>
1842
1904
  `;
1843
1905
  }
1844
1906
  renderLineScore(t, e, s) {
1845
- const r = t.periodScores || [];
1846
- if (!r.length)
1907
+ const a = t.periodScores || [];
1908
+ if (!a.length)
1847
1909
  return l`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>`;
1848
- const o = Math.max(4, ...r.map((p) => p.period)), i = (p) => p <= 4 ? String(p) : `OT${p > 5 ? p - 4 : ""}`, n = (p, d) => {
1849
- const h = r.find((f) => f.period === d);
1850
- return h ? h[p] : t.state === "final" ? 0 : "·";
1851
- }, c = (p, d, h) => l`
1910
+ const o = Math.max(4, ...a.map((c) => c.period)), i = (c) => c <= 4 ? String(c) : `OT${c > 5 ? c - 4 : ""}`, n = (c, h) => {
1911
+ const p = a.find((f) => f.period === h);
1912
+ return p ? p[c] : t.state === "final" ? 0 : "·";
1913
+ }, d = (c, h, p) => l`
1852
1914
  <tr>
1853
- <td class="teamcell">${H(p, 20)}${p?.abbr || "TBD"}</td>
1854
- ${Array.from({ length: o }, (f, u) => l`<td class="num">${n(d, u + 1)}</td>`)}
1855
- <td class="num" style="font-weight:700">${h}</td>
1915
+ <td class="teamcell">${H(c, 20)}${c?.abbr || "TBD"}</td>
1916
+ ${Array.from({ length: o }, (f, u) => l`<td class="num">${n(h, u + 1)}</td>`)}
1917
+ <td class="num" style="font-weight:700">${p}</td>
1856
1918
  </tr>`;
1857
1919
  return l`
1858
1920
  <div class="tablewrap" style="border-top:1px solid var(--hsot-gray-2)">
1859
1921
  <table class="data" style="max-width:560px;margin:0.6rem auto 0.9rem">
1860
- <thead><tr><th>Team</th>${Array.from({ length: o }, (p, d) => l`<th class="num">${i(d + 1)}</th>`)}<th class="num">T</th></tr></thead>
1922
+ <thead><tr><th>Team</th>${Array.from({ length: o }, (c, h) => l`<th class="num">${i(h + 1)}</th>`)}<th class="num">T</th></tr></thead>
1861
1923
  <tbody>
1862
- ${c(e, "away", t.awayScore)}
1863
- ${c(s, "home", t.homeScore)}
1924
+ ${d(e, "away", t.awayScore)}
1925
+ ${d(s, "home", t.homeScore)}
1864
1926
  </tbody>
1865
1927
  </table>
1866
1928
  </div>
@@ -1868,14 +1930,14 @@ class Kt extends b {
1868
1930
  }
1869
1931
  renderContext(t, e, s) {
1870
1932
  if (!s) return m;
1871
- const r = t.records[e], o = ut(this.data.games, e);
1933
+ const a = t.records[e], o = vt(this.data.games, e);
1872
1934
  return l`
1873
1935
  <div class="card ctxcard">
1874
1936
  <div class="who">${H(s)}${s.name}</div>
1875
1937
  <div class="row">
1876
- <span>Last 5: ${$t(t, e)}</span>
1877
- <span>Streak: <b>${r ? et(r.results) : "·"}</b></span>
1878
- <span>PF/PA: <b>${r ? `${r.pf} / ${r.pa}` : "·"}</b></span>
1938
+ <span>Last 5: ${wt(t, e)}</span>
1939
+ <span>Streak: <b>${a ? st(a.results) : "·"}</b></span>
1940
+ <span>PF/PA: <b>${a ? `${a.pf} / ${a.pa}` : "·"}</b></span>
1879
1941
  <span>Next: ${o ? l`${y(o.date, { month: "numeric", day: "numeric" })}
1880
1942
  ${o.homeTeamId === e ? "vs" : "at"} ${Z(t, o.homeTeamId === e ? o.awayTeamId : o.homeTeamId)}` : "·"}</span>
1881
1943
  </div>
@@ -1883,21 +1945,201 @@ class Kt extends b {
1883
1945
  `;
1884
1946
  }
1885
1947
  }
1886
- globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", Kt);
1887
- const We = {
1888
- "hsot-scores": Gt,
1889
- "hsot-standings": Vt,
1890
- "hsot-rankings": qt,
1891
- "hsot-school": Yt,
1892
- "hsot-boxscore": Kt
1948
+ globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", Xt);
1949
+ const Ye = 250, Ke = 2;
1950
+ class te extends E {
1951
+ static properties = {
1952
+ api: { type: String },
1953
+ schoolHref: { type: String, attribute: "school-href" },
1954
+ limit: { type: Number },
1955
+ placeholder: { type: String },
1956
+ results: { state: !0 },
1957
+ open: { state: !0 },
1958
+ activeIndex: { state: !0 },
1959
+ searched: { state: !0 }
1960
+ };
1961
+ static styles = b`
1962
+ :host {
1963
+ display: block;
1964
+ position: relative;
1965
+ font-family: var(--font-family, sans-serif);
1966
+ }
1967
+ input {
1968
+ width: 100%;
1969
+ box-sizing: border-box;
1970
+ padding: 0.625rem 0.75rem;
1971
+ font-size: 1rem;
1972
+ font-family: inherit;
1973
+ color: var(--color-black, #000);
1974
+ background: var(--color-white, #fff);
1975
+ border: 1px solid var(--color-gray-4, #ccc);
1976
+ border-bottom: 3px solid var(--color-red, #b90100);
1977
+ border-radius: 2px;
1978
+ }
1979
+ input:focus {
1980
+ outline: 2px solid var(--color-red, #b90100);
1981
+ outline-offset: -1px;
1982
+ }
1983
+ ul {
1984
+ position: absolute;
1985
+ z-index: 10;
1986
+ left: 0;
1987
+ right: 0;
1988
+ margin: 0;
1989
+ padding: 0;
1990
+ list-style: none;
1991
+ max-height: 20rem;
1992
+ overflow-y: auto;
1993
+ background: var(--color-white, #fff);
1994
+ border: 1px solid var(--color-gray-4, #ccc);
1995
+ border-top: none;
1996
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
1997
+ }
1998
+ li {
1999
+ padding: 0.5rem 0.75rem;
2000
+ cursor: pointer;
2001
+ }
2002
+ li[aria-selected="true"], li:hover {
2003
+ background: var(--color-gray-1, #f9f9f9);
2004
+ }
2005
+ li .name {
2006
+ font-weight: 700;
2007
+ color: var(--color-black, #000);
2008
+ }
2009
+ li .where {
2010
+ display: block;
2011
+ font-size: 0.8rem;
2012
+ color: var(--color-gray-5, #666);
2013
+ }
2014
+ li.empty {
2015
+ cursor: default;
2016
+ color: var(--color-gray-5, #666);
2017
+ }
2018
+ li.empty:hover {
2019
+ background: none;
2020
+ }
2021
+ `;
2022
+ constructor() {
2023
+ super(), this.api = "https://api.highschoolot.com/hsot/v1/public", this.schoolHref = "/school/{id}/", this.limit = 10, this.placeholder = "Find Your School", this.results = [], this.open = !1, this.activeIndex = -1, this.searched = !1;
2024
+ }
2025
+ disconnectedCallback() {
2026
+ super.disconnectedCallback(), clearTimeout(this.debounceTimer), this.abortController?.abort();
2027
+ }
2028
+ onInput(t) {
2029
+ const e = t.target.value.trim();
2030
+ if (clearTimeout(this.debounceTimer), e.length < Ke) {
2031
+ this.abortController?.abort(), this.results = [], this.open = !1, this.searched = !1;
2032
+ return;
2033
+ }
2034
+ this.debounceTimer = setTimeout(() => this.search(e), Ye);
2035
+ }
2036
+ async search(t) {
2037
+ this.abortController?.abort(), this.abortController = new AbortController();
2038
+ try {
2039
+ const e = `${this.api}/schools?q=${encodeURIComponent(t)}&limit=${this.limit}`, s = await fetch(e, {
2040
+ signal: this.abortController.signal
2041
+ });
2042
+ if (!s.ok)
2043
+ return;
2044
+ const a = await s.json();
2045
+ this.results = a.items || [], this.activeIndex = -1, this.searched = !0, this.open = !0;
2046
+ } catch (e) {
2047
+ e.name !== "AbortError" && console.warn("school search failed", e);
2048
+ }
2049
+ }
2050
+ onKeyDown(t) {
2051
+ if (t.key === "Escape") {
2052
+ this.open = !1;
2053
+ return;
2054
+ }
2055
+ if (!(!this.open || !this.results.length))
2056
+ if (t.key === "ArrowDown")
2057
+ t.preventDefault(), this.activeIndex = (this.activeIndex + 1) % this.results.length;
2058
+ else if (t.key === "ArrowUp") {
2059
+ t.preventDefault();
2060
+ const e = this.results.length;
2061
+ this.activeIndex = (this.activeIndex - 1 + e) % e;
2062
+ } else t.key === "Enter" && (t.preventDefault(), this.go(this.results[this.activeIndex] || this.results[0]));
2063
+ }
2064
+ onBlur() {
2065
+ setTimeout(() => {
2066
+ this.open = !1;
2067
+ }, 150);
2068
+ }
2069
+ onFocus() {
2070
+ this.results.length && (this.open = !0);
2071
+ }
2072
+ go(t) {
2073
+ t && (globalThis.location.href = this.schoolHref.replace("{id}", t.id));
2074
+ }
2075
+ where(t) {
2076
+ return [t.location, t.county && `${t.county} County`].filter(Boolean).join(" — ");
2077
+ }
2078
+ renderOption(t, e) {
2079
+ const s = this.where(t), a = (o) => {
2080
+ o.preventDefault(), this.go(t);
2081
+ };
2082
+ return l`
2083
+ <li
2084
+ id="school-option-${e}"
2085
+ role="option"
2086
+ aria-selected="${e === this.activeIndex ? "true" : "false"}"
2087
+ @pointerdown="${a}"
2088
+ @mousemove="${() => {
2089
+ this.activeIndex = e;
2090
+ }}"
2091
+ >
2092
+ <span class="name">${t.name}</span>
2093
+ ${s ? l`<span class="where">${s}</span>` : m}
2094
+ </li>
2095
+ `;
2096
+ }
2097
+ renderListbox() {
2098
+ const t = this.searched && !this.results.length, e = l`<li class="empty">No schools found</li>`;
2099
+ return l`
2100
+ <ul id="school-search-listbox" role="listbox" aria-label="Schools">
2101
+ ${this.results.map((s, a) => this.renderOption(s, a))}
2102
+ ${t ? e : m}
2103
+ </ul>
2104
+ `;
2105
+ }
2106
+ render() {
2107
+ const t = this.activeIndex >= 0 ? `school-option-${this.activeIndex}` : "";
2108
+ return l`
2109
+ <input
2110
+ type="text"
2111
+ role="combobox"
2112
+ aria-label="Find your school"
2113
+ aria-expanded="${this.open ? "true" : "false"}"
2114
+ aria-controls="school-search-listbox"
2115
+ aria-activedescendant="${t}"
2116
+ autocomplete="off"
2117
+ placeholder="${this.placeholder}"
2118
+ @input="${this.onInput}"
2119
+ @keydown="${this.onKeyDown}"
2120
+ @blur="${this.onBlur}"
2121
+ @focus="${this.onFocus}"
2122
+ >
2123
+ ${this.open ? this.renderListbox() : m}
2124
+ `;
2125
+ }
2126
+ }
2127
+ globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search", te);
2128
+ const Qe = {
2129
+ "hsot-scores": Yt,
2130
+ "hsot-standings": Kt,
2131
+ "hsot-rankings": Qt,
2132
+ "hsot-school": Zt,
2133
+ "hsot-boxscore": Xt,
2134
+ "hsot-school-search": te
1893
2135
  };
1894
- function Ge() {
1895
- const a = globalThis?.customElements;
1896
- if (a)
1897
- for (const [t, e] of Object.entries(We))
1898
- a.get(t) || a.define(t, e);
2136
+ function Ze() {
2137
+ const r = globalThis?.customElements;
2138
+ if (r)
2139
+ for (const [t, e] of Object.entries(Qe))
2140
+ r.get(t) || r.define(t, e);
1899
2141
  }
1900
- typeof window < "u" && globalThis.customElements && Ge();
2142
+ typeof window < "u" && globalThis.customElements && Ze();
1901
2143
  export {
1902
- Ge as defineAll
2144
+ Ze as defineAll
1903
2145
  };