@wral/hsot-data 0.1.15 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -2
- package/dist/client.mjs +49 -0
- package/dist/define.mjs +11 -10
- package/dist/define.standalone.js +884 -575
- package/dist/{hsot-school-search-CPsDpIgS.js → hsot-brackets-Cc0zj07F.js} +676 -406
- package/dist/index.mjs +24 -15
- package/package.json +2 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
1
|
+
const J = globalThis, dt = J.ShadowRoot && (J.ShadyCSS === void 0 || J.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, pt = /* @__PURE__ */ Symbol(), St = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let Gt = class {
|
|
3
3
|
constructor(t, e, s) {
|
|
4
|
-
if (this._$cssResult$ = !0, s !==
|
|
4
|
+
if (this._$cssResult$ = !0, s !== pt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
5
|
this.cssText = t, this.t = e;
|
|
6
6
|
}
|
|
7
7
|
get styleSheet() {
|
|
8
8
|
let t = this.o;
|
|
9
9
|
const e = this.t;
|
|
10
|
-
if (
|
|
10
|
+
if (dt && t === void 0) {
|
|
11
11
|
const s = e !== void 0 && e.length === 1;
|
|
12
|
-
s && (t =
|
|
12
|
+
s && (t = St.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && St.set(e, t));
|
|
13
13
|
}
|
|
14
14
|
return t;
|
|
15
15
|
}
|
|
@@ -17,28 +17,28 @@ let Ot = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
21
|
-
const e = a.length === 1 ? a[0] : t.reduce((s, r, o) => s + ((
|
|
22
|
-
if (
|
|
23
|
-
if (typeof
|
|
24
|
-
throw Error("Value passed to 'css' function must be a 'css' function result: " +
|
|
20
|
+
const fe = (a) => new Gt(typeof a == "string" ? a : a + "", void 0, pt), y = (a, ...t) => {
|
|
21
|
+
const e = a.length === 1 ? a[0] : t.reduce((s, r, o) => s + ((n) => {
|
|
22
|
+
if (n._$cssResult$ === !0) return n.cssText;
|
|
23
|
+
if (typeof n == "number") return n;
|
|
24
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
25
|
})(r) + a[o + 1], a[0]);
|
|
26
|
-
return new
|
|
27
|
-
},
|
|
28
|
-
if (
|
|
26
|
+
return new Gt(e, a, pt);
|
|
27
|
+
}, ge = (a, t) => {
|
|
28
|
+
if (dt) a.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 =
|
|
30
|
+
const s = document.createElement("style"), r = J.litNonce;
|
|
31
31
|
r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, a.appendChild(s);
|
|
32
32
|
}
|
|
33
|
-
},
|
|
33
|
+
}, _t = dt ? (a) => a : (a) => a instanceof CSSStyleSheet ? ((t) => {
|
|
34
34
|
let e = "";
|
|
35
35
|
for (const s of t.cssRules) e += s.cssText;
|
|
36
|
-
return
|
|
36
|
+
return fe(e);
|
|
37
37
|
})(a) : a;
|
|
38
|
-
const { is:
|
|
38
|
+
const { is: ve, defineProperty: $e, getOwnPropertyDescriptor: be, getOwnPropertyNames: ye, getOwnPropertySymbols: we, getPrototypeOf: xe } = Object, rt = globalThis, At = rt.trustedTypes, ke = At ? At.emptyScript : "", Se = rt.reactiveElementPolyfillSupport, G = (a, t) => a, ht = { toAttribute(a, t) {
|
|
39
39
|
switch (t) {
|
|
40
40
|
case Boolean:
|
|
41
|
-
a = a ?
|
|
41
|
+
a = a ? ke : null;
|
|
42
42
|
break;
|
|
43
43
|
case Object:
|
|
44
44
|
case Array:
|
|
@@ -63,44 +63,44 @@ const { is: ce, defineProperty: he, getOwnPropertyDescriptor: de, getOwnProperty
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return e;
|
|
66
|
-
} },
|
|
67
|
-
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"),
|
|
68
|
-
let
|
|
66
|
+
} }, jt = (a, t) => !ve(a, t), Tt = { attribute: !0, type: String, converter: ht, reflect: !1, useDefault: !1, hasChanged: jt };
|
|
67
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), rt.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
|
+
let z = 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 =
|
|
75
|
+
static createProperty(t, e = Tt) {
|
|
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
77
|
const s = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(t, s, e);
|
|
78
|
-
r !== void 0 &&
|
|
78
|
+
r !== void 0 && $e(this.prototype, t, r);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
static getPropertyDescriptor(t, e, s) {
|
|
82
|
-
const { get: r, set: o } =
|
|
82
|
+
const { get: r, set: o } = be(this.prototype, t) ?? { get() {
|
|
83
83
|
return this[e];
|
|
84
|
-
}, set(
|
|
85
|
-
this[e] =
|
|
84
|
+
}, set(n) {
|
|
85
|
+
this[e] = n;
|
|
86
86
|
} };
|
|
87
|
-
return { get: r, set(
|
|
88
|
-
const
|
|
89
|
-
o?.call(this,
|
|
87
|
+
return { get: r, set(n) {
|
|
88
|
+
const i = r?.call(this);
|
|
89
|
+
o?.call(this, n), this.requestUpdate(t, i, s);
|
|
90
90
|
}, configurable: !0, enumerable: !0 };
|
|
91
91
|
}
|
|
92
92
|
static getPropertyOptions(t) {
|
|
93
|
-
return this.elementProperties.get(t) ??
|
|
93
|
+
return this.elementProperties.get(t) ?? Tt;
|
|
94
94
|
}
|
|
95
95
|
static _$Ei() {
|
|
96
|
-
if (this.hasOwnProperty(
|
|
97
|
-
const t =
|
|
96
|
+
if (this.hasOwnProperty(G("elementProperties"))) return;
|
|
97
|
+
const t = xe(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(
|
|
102
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
103
|
-
const e = this.properties, s = [...
|
|
101
|
+
if (this.hasOwnProperty(G("finalized"))) return;
|
|
102
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(G("properties"))) {
|
|
103
|
+
const e = this.properties, s = [...ye(e), ...we(e)];
|
|
104
104
|
for (const r of s) this.createProperty(r, e[r]);
|
|
105
105
|
}
|
|
106
106
|
const t = this[Symbol.metadata];
|
|
@@ -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(
|
|
123
|
-
} else t !== void 0 && e.push(
|
|
122
|
+
for (const r of s) e.unshift(_t(r));
|
|
123
|
+
} else t !== void 0 && e.push(_t(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
|
|
149
|
+
return ge(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?.());
|
|
@@ -162,29 +162,29 @@ let C = class extends HTMLElement {
|
|
|
162
162
|
_$ET(t, e) {
|
|
163
163
|
const s = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, s);
|
|
164
164
|
if (r !== void 0 && s.reflect === !0) {
|
|
165
|
-
const o = (s.converter?.toAttribute !== void 0 ? s.converter :
|
|
165
|
+
const o = (s.converter?.toAttribute !== void 0 ? s.converter : ht).toAttribute(e, s.type);
|
|
166
166
|
this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
_$AK(t, e) {
|
|
170
170
|
const s = this.constructor, r = s._$Eh.get(t);
|
|
171
171
|
if (r !== void 0 && this._$Em !== r) {
|
|
172
|
-
const o = s.getPropertyOptions(r),
|
|
172
|
+
const o = s.getPropertyOptions(r), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : ht;
|
|
173
173
|
this._$Em = r;
|
|
174
|
-
const
|
|
175
|
-
this[r] =
|
|
174
|
+
const i = n.fromAttribute(e, o.type);
|
|
175
|
+
this[r] = i ?? this._$Ej?.get(r) ?? i, this._$Em = null;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
requestUpdate(t, e, s, r = !1, o) {
|
|
179
179
|
if (t !== void 0) {
|
|
180
|
-
const
|
|
181
|
-
if (r === !1 && (o = this[t]), s ??=
|
|
180
|
+
const n = this.constructor;
|
|
181
|
+
if (r === !1 && (o = this[t]), s ??= n.getPropertyOptions(t), !((s.hasChanged ?? jt)(o, e) || s.useDefault && s.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(n._$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 },
|
|
187
|
-
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t,
|
|
186
|
+
C(t, e, { useDefault: s, reflect: r, wrapped: o }, n) {
|
|
187
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), o !== !0 || n !== 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));
|
|
188
188
|
}
|
|
189
189
|
async _$EP() {
|
|
190
190
|
this.isUpdatePending = !0;
|
|
@@ -208,8 +208,8 @@ let C = class extends HTMLElement {
|
|
|
208
208
|
}
|
|
209
209
|
const s = this.constructor.elementProperties;
|
|
210
210
|
if (s.size > 0) for (const [r, o] of s) {
|
|
211
|
-
const { wrapped:
|
|
212
|
-
|
|
211
|
+
const { wrapped: n } = o, i = this[r];
|
|
212
|
+
n !== !0 || this._$AL.has(r) || i === void 0 || this.C(r, void 0, o, i);
|
|
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
|
-
|
|
250
|
-
const
|
|
251
|
-
\f\r]`,
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
253
|
-
function
|
|
254
|
-
if (!
|
|
255
|
-
return
|
|
256
|
-
}
|
|
257
|
-
const
|
|
249
|
+
z.elementStyles = [], z.shadowRootOptions = { mode: "open" }, z[G("elementProperties")] = /* @__PURE__ */ new Map(), z[G("finalized")] = /* @__PURE__ */ new Map(), Se?.({ ReactiveElement: z }), (rt.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
+
const mt = globalThis, It = (a) => a, X = mt.trustedTypes, Ct = X ? X.createPolicy("lit-html", { createHTML: (a) => a }) : void 0, qt = "$lit$", S = `lit$${Math.random().toFixed(9).slice(2)}$`, Wt = "?" + S, _e = `<${Wt}>`, I = document, j = () => I.createComment(""), q = (a) => a === null || typeof a != "object" && typeof a != "function", ut = Array.isArray, Ae = (a) => ut(a) || typeof a?.[Symbol.iterator] == "function", ct = `[
|
|
251
|
+
\f\r]`, H = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Et = /-->/g, Pt = />/g, A = RegExp(`>|${ct}(?:([^\\s"'>=/]+)(${ct}*=${ct}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Bt = /'/g, Dt = /"/g, Vt = /^(?:script|style|textarea|title)$/i, Yt = (a) => (t, ...e) => ({ _$litType$: a, strings: t, values: e }), l = Yt(1), zt = Yt(2), M = /* @__PURE__ */ Symbol.for("lit-noChange"), m = /* @__PURE__ */ Symbol.for("lit-nothing"), Rt = /* @__PURE__ */ new WeakMap(), T = I.createTreeWalker(I, 129);
|
|
253
|
+
function Kt(a, t) {
|
|
254
|
+
if (!ut(a) || !a.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
|
+
return Ct !== void 0 ? Ct.createHTML(t) : t;
|
|
256
|
+
}
|
|
257
|
+
const Te = (a, t) => {
|
|
258
258
|
const e = a.length - 1, s = [];
|
|
259
|
-
let r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "",
|
|
260
|
-
for (let
|
|
261
|
-
const
|
|
262
|
-
let
|
|
263
|
-
for (; u <
|
|
264
|
-
const f =
|
|
265
|
-
o +=
|
|
266
|
-
}
|
|
267
|
-
return [
|
|
259
|
+
let r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = H;
|
|
260
|
+
for (let i = 0; i < e; i++) {
|
|
261
|
+
const c = a[i];
|
|
262
|
+
let h, d, p = -1, u = 0;
|
|
263
|
+
for (; u < c.length && (n.lastIndex = u, d = n.exec(c), d !== null); ) u = n.lastIndex, n === H ? d[1] === "!--" ? n = Et : d[1] !== void 0 ? n = Pt : d[2] !== void 0 ? (Vt.test(d[2]) && (r = RegExp("</" + d[2], "g")), n = A) : d[3] !== void 0 && (n = A) : n === A ? d[0] === ">" ? (n = r ?? H, p = -1) : d[1] === void 0 ? p = -2 : (p = n.lastIndex - d[2].length, h = d[1], n = d[3] === void 0 ? A : d[3] === '"' ? Dt : Bt) : n === Dt || n === Bt ? n = A : n === Et || n === Pt ? n = H : (n = A, r = void 0);
|
|
264
|
+
const f = n === A && a[i + 1].startsWith("/>") ? " " : "";
|
|
265
|
+
o += n === H ? c + _e : p >= 0 ? (s.push(h), c.slice(0, p) + qt + c.slice(p) + S + f) : c + S + (p === -2 ? i : f);
|
|
266
|
+
}
|
|
267
|
+
return [Kt(a, o + (a[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
268
268
|
};
|
|
269
|
-
class
|
|
269
|
+
class W {
|
|
270
270
|
constructor({ strings: t, _$litType$: e }, s) {
|
|
271
271
|
let r;
|
|
272
272
|
this.parts = [];
|
|
273
|
-
let o = 0,
|
|
274
|
-
const
|
|
275
|
-
if (this.el =
|
|
273
|
+
let o = 0, n = 0;
|
|
274
|
+
const i = t.length - 1, c = this.parts, [h, d] = Te(t, e);
|
|
275
|
+
if (this.el = W.createElement(h, s), T.currentNode = this.el.content, e === 2 || e === 3) {
|
|
276
276
|
const p = this.el.content.firstChild;
|
|
277
277
|
p.replaceWith(...p.childNodes);
|
|
278
278
|
}
|
|
279
|
-
for (; (r = T.nextNode()) !== null &&
|
|
279
|
+
for (; (r = T.nextNode()) !== null && c.length < i; ) {
|
|
280
280
|
if (r.nodeType === 1) {
|
|
281
|
-
if (r.hasAttributes()) for (const p of r.getAttributeNames()) if (p.endsWith(
|
|
282
|
-
const u =
|
|
283
|
-
|
|
284
|
-
} else p.startsWith(S) && (
|
|
285
|
-
if (
|
|
281
|
+
if (r.hasAttributes()) for (const p of r.getAttributeNames()) if (p.endsWith(qt)) {
|
|
282
|
+
const u = d[n++], f = r.getAttribute(p).split(S), g = /([.?@])?(.*)/.exec(u);
|
|
283
|
+
c.push({ type: 1, index: o, name: g[2], strings: f, ctor: g[1] === "." ? Ce : g[1] === "?" ? Ee : g[1] === "@" ? Pe : ot }), r.removeAttribute(p);
|
|
284
|
+
} else p.startsWith(S) && (c.push({ type: 6, index: o }), r.removeAttribute(p));
|
|
285
|
+
if (Vt.test(r.tagName)) {
|
|
286
286
|
const p = r.textContent.split(S), u = p.length - 1;
|
|
287
287
|
if (u > 0) {
|
|
288
|
-
r.textContent =
|
|
289
|
-
for (let f = 0; f < u; f++) r.append(p[f],
|
|
290
|
-
r.append(p[u],
|
|
288
|
+
r.textContent = X ? X.emptyScript : "";
|
|
289
|
+
for (let f = 0; f < u; f++) r.append(p[f], j()), T.nextNode(), c.push({ type: 2, index: ++o });
|
|
290
|
+
r.append(p[u], j());
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
} else if (r.nodeType === 8) if (r.data ===
|
|
293
|
+
} else if (r.nodeType === 8) if (r.data === Wt) c.push({ type: 2, index: o });
|
|
294
294
|
else {
|
|
295
295
|
let p = -1;
|
|
296
|
-
for (; (p = r.data.indexOf(S, p + 1)) !== -1; )
|
|
296
|
+
for (; (p = r.data.indexOf(S, p + 1)) !== -1; ) c.push({ type: 7, index: o }), p += S.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
|
|
307
|
-
if (t ===
|
|
306
|
+
function F(a, t, e = a, s) {
|
|
307
|
+
if (t === M) return t;
|
|
308
308
|
let r = s !== void 0 ? e._$Co?.[s] : e._$Cl;
|
|
309
|
-
const o =
|
|
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 =
|
|
309
|
+
const o = q(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 = F(a, r._$AS(a, t.values), r, s)), t;
|
|
311
311
|
}
|
|
312
|
-
class
|
|
312
|
+
class Ie {
|
|
313
313
|
constructor(t, e) {
|
|
314
314
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
315
315
|
}
|
|
@@ -322,13 +322,13 @@ class ye {
|
|
|
322
322
|
u(t) {
|
|
323
323
|
const { el: { content: e }, parts: s } = this._$AD, r = (t?.creationScope ?? I).importNode(e, !0);
|
|
324
324
|
T.currentNode = r;
|
|
325
|
-
let o = T.nextNode(),
|
|
326
|
-
for (;
|
|
327
|
-
if (
|
|
328
|
-
let
|
|
329
|
-
|
|
325
|
+
let o = T.nextNode(), n = 0, i = 0, c = s[0];
|
|
326
|
+
for (; c !== void 0; ) {
|
|
327
|
+
if (n === c.index) {
|
|
328
|
+
let h;
|
|
329
|
+
c.type === 2 ? h = new Y(o, o.nextSibling, this, t) : c.type === 1 ? h = new c.ctor(o, c.name, c.strings, this, t) : c.type === 6 && (h = new Be(o, this, t)), this._$AV.push(h), c = s[++i];
|
|
330
330
|
}
|
|
331
|
-
|
|
331
|
+
n !== c?.index && (o = T.nextNode(), n++);
|
|
332
332
|
}
|
|
333
333
|
return T.currentNode = I, r;
|
|
334
334
|
}
|
|
@@ -337,7 +337,7 @@ class ye {
|
|
|
337
337
|
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
class
|
|
340
|
+
class Y {
|
|
341
341
|
get _$AU() {
|
|
342
342
|
return this._$AM?._$AU ?? this._$Cv;
|
|
343
343
|
}
|
|
@@ -356,7 +356,7 @@ class L {
|
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
358
|
_$AI(t, e = this) {
|
|
359
|
-
t =
|
|
359
|
+
t = F(this, t, e), q(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== M && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Ae(t) ? this.k(t) : this._(t);
|
|
360
360
|
}
|
|
361
361
|
O(t) {
|
|
362
362
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -365,38 +365,38 @@ class L {
|
|
|
365
365
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
366
366
|
}
|
|
367
367
|
_(t) {
|
|
368
|
-
this._$AH !== m &&
|
|
368
|
+
this._$AH !== m && q(this._$AH) ? this._$AA.nextSibling.data = t : this.T(I.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 =
|
|
371
|
+
const { values: e, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = W.createElement(Kt(s.h, s.h[0]), this.options)), s);
|
|
372
372
|
if (this._$AH?._$AD === r) this._$AH.p(e);
|
|
373
373
|
else {
|
|
374
|
-
const o = new
|
|
375
|
-
o.p(e), this.T(
|
|
374
|
+
const o = new Ie(r, this), n = o.u(this.options);
|
|
375
|
+
o.p(e), this.T(n), this._$AH = o;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
_$AC(t) {
|
|
379
|
-
let e =
|
|
380
|
-
return e === void 0 &&
|
|
379
|
+
let e = Rt.get(t.strings);
|
|
380
|
+
return e === void 0 && Rt.set(t.strings, e = new W(t)), e;
|
|
381
381
|
}
|
|
382
382
|
k(t) {
|
|
383
|
-
|
|
383
|
+
ut(this._$AH) || (this._$AH = [], this._$AR());
|
|
384
384
|
const e = this._$AH;
|
|
385
385
|
let s, r = 0;
|
|
386
|
-
for (const o of t) r === e.length ? e.push(s = new
|
|
386
|
+
for (const o of t) r === e.length ? e.push(s = new Y(this.O(j()), this.O(j()), this, this.options)) : s = e[r], s._$AI(o), r++;
|
|
387
387
|
r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
|
|
388
388
|
}
|
|
389
389
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
390
390
|
for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
|
|
391
|
-
const s =
|
|
392
|
-
|
|
391
|
+
const s = It(t).nextSibling;
|
|
392
|
+
It(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
|
|
399
|
+
class ot {
|
|
400
400
|
get tagName() {
|
|
401
401
|
return this.element.tagName;
|
|
402
402
|
}
|
|
@@ -408,20 +408,20 @@ class st {
|
|
|
408
408
|
}
|
|
409
409
|
_$AI(t, e = this, s, r) {
|
|
410
410
|
const o = this.strings;
|
|
411
|
-
let
|
|
412
|
-
if (o === void 0) t =
|
|
411
|
+
let n = !1;
|
|
412
|
+
if (o === void 0) t = F(this, t, e, 0), n = !q(t) || t !== this._$AH && t !== M, n && (this._$AH = t);
|
|
413
413
|
else {
|
|
414
|
-
const
|
|
415
|
-
let
|
|
416
|
-
for (t = o[0],
|
|
414
|
+
const i = t;
|
|
415
|
+
let c, h;
|
|
416
|
+
for (t = o[0], c = 0; c < o.length - 1; c++) h = F(this, i[s + c], e, c), h === M && (h = this._$AH[c]), n ||= !q(h) || h !== this._$AH[c], h === m ? t = m : t !== m && (t += (h ?? "") + o[c + 1]), this._$AH[c] = h;
|
|
417
417
|
}
|
|
418
|
-
|
|
418
|
+
n && !r && 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
|
|
424
|
+
class Ce extends ot {
|
|
425
425
|
constructor() {
|
|
426
426
|
super(...arguments), this.type = 3;
|
|
427
427
|
}
|
|
@@ -429,7 +429,7 @@ class we extends st {
|
|
|
429
429
|
this.element[this.name] = t === m ? void 0 : t;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class Ee extends ot {
|
|
433
433
|
constructor() {
|
|
434
434
|
super(...arguments), this.type = 4;
|
|
435
435
|
}
|
|
@@ -437,12 +437,12 @@ class xe extends st {
|
|
|
437
437
|
this.element.toggleAttribute(this.name, !!t && t !== m);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
class
|
|
440
|
+
class Pe extends ot {
|
|
441
441
|
constructor(t, e, s, r, o) {
|
|
442
442
|
super(t, e, s, r, o), this.type = 5;
|
|
443
443
|
}
|
|
444
444
|
_$AI(t, e = this) {
|
|
445
|
-
if ((t =
|
|
445
|
+
if ((t = F(this, t, e, 0) ?? m) === M) return;
|
|
446
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
447
|
r && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
448
448
|
}
|
|
@@ -450,7 +450,7 @@ class ke extends st {
|
|
|
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
|
|
453
|
+
class Be {
|
|
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 Se {
|
|
|
458
458
|
return this._$AM._$AU;
|
|
459
459
|
}
|
|
460
460
|
_$AI(t) {
|
|
461
|
-
|
|
461
|
+
F(this, t);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
const
|
|
464
|
+
const De = mt.litHtmlPolyfillSupport;
|
|
465
|
+
De?.(W, Y), (mt.litHtmlVersions ??= []).push("3.3.3");
|
|
466
|
+
const ze = (a, t, e) => {
|
|
467
467
|
const s = e?.renderBefore ?? t;
|
|
468
468
|
let r = s._$litPart$;
|
|
469
469
|
if (r === void 0) {
|
|
470
470
|
const o = e?.renderBefore ?? null;
|
|
471
|
-
s._$litPart$ = r = new
|
|
471
|
+
s._$litPart$ = r = new Y(t.insertBefore(j(), o), o, void 0, e ?? {});
|
|
472
472
|
}
|
|
473
473
|
return r._$AI(a), r;
|
|
474
474
|
};
|
|
475
|
-
const
|
|
476
|
-
class
|
|
475
|
+
const ft = globalThis;
|
|
476
|
+
class N extends z {
|
|
477
477
|
constructor() {
|
|
478
478
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
479
479
|
}
|
|
@@ -483,7 +483,7 @@ class P 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 =
|
|
486
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = ze(e, this.renderRoot, this.renderOptions);
|
|
487
487
|
}
|
|
488
488
|
connectedCallback() {
|
|
489
489
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -492,130 +492,139 @@ class P extends C {
|
|
|
492
492
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
493
493
|
}
|
|
494
494
|
render() {
|
|
495
|
-
return
|
|
495
|
+
return M;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
(
|
|
502
|
-
const
|
|
503
|
-
function
|
|
498
|
+
N._$litElement$ = !0, N.finalized = !0, ft.litElementHydrateSupport?.({ LitElement: N });
|
|
499
|
+
const Re = ft.litElementPolyfillSupport;
|
|
500
|
+
Re?.({ LitElement: N });
|
|
501
|
+
(ft.litElementVersions ??= []).push("4.2.2");
|
|
502
|
+
const Ne = 50;
|
|
503
|
+
function Me(a = {}) {
|
|
504
504
|
const t = Object.entries(a).filter(([, s]) => s != null && s !== "");
|
|
505
505
|
if (!t.length) return "";
|
|
506
506
|
const e = new URLSearchParams();
|
|
507
507
|
return t.forEach(([s, r]) => e.set(s, String(r))), `?${e.toString()}`;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function Fe({ baseUrl: a, token: t = "", fetchFn: e } = {}) {
|
|
510
510
|
if (!a) throw new Error("createClient requires a baseUrl");
|
|
511
|
-
const s = a.replace(/\/+$/, ""), r = e || ((...
|
|
512
|
-
async function o(
|
|
513
|
-
const
|
|
514
|
-
t && (
|
|
515
|
-
const
|
|
516
|
-
if (!
|
|
517
|
-
const
|
|
518
|
-
throw
|
|
511
|
+
const s = a.replace(/\/+$/, ""), r = e || ((...i) => fetch(...i));
|
|
512
|
+
async function o(i) {
|
|
513
|
+
const c = { Accept: "application/json" };
|
|
514
|
+
t && (c.Authorization = `Bearer ${t}`);
|
|
515
|
+
const h = await r(`${s}${i}`, { headers: c });
|
|
516
|
+
if (!h.ok) {
|
|
517
|
+
const d = new Error(`api-hsot ${h.status} on ${i}`);
|
|
518
|
+
throw d.status = h.status, d;
|
|
519
519
|
}
|
|
520
|
-
return
|
|
521
|
-
}
|
|
522
|
-
async function i
|
|
523
|
-
const
|
|
524
|
-
let
|
|
525
|
-
for (let p = 0; p <
|
|
526
|
-
const u =
|
|
527
|
-
if (
|
|
520
|
+
return h.json();
|
|
521
|
+
}
|
|
522
|
+
async function n(i, c = {}) {
|
|
523
|
+
const h = [];
|
|
524
|
+
let d = null;
|
|
525
|
+
for (let p = 0; p < Ne; p += 1) {
|
|
526
|
+
const u = Me(d ? { ...c, cursor: d } : c), f = await o(`${i}${u}`);
|
|
527
|
+
if (h.push(...f.items || []), d = f.nextCursor || null, !d) break;
|
|
528
528
|
}
|
|
529
|
-
return { items:
|
|
529
|
+
return { items: h, total: h.length, nextCursor: null };
|
|
530
530
|
}
|
|
531
531
|
return {
|
|
532
|
-
listSchools: (
|
|
533
|
-
getSchool: (
|
|
534
|
-
listTeams: (
|
|
535
|
-
getTeam: (
|
|
536
|
-
listConferences: (
|
|
537
|
-
listPlayers: (
|
|
538
|
-
listRosters: (
|
|
539
|
-
listGames: (
|
|
540
|
-
getGame: (
|
|
541
|
-
listTournaments: (
|
|
542
|
-
listSeedings: (
|
|
543
|
-
|
|
532
|
+
listSchools: (i) => n("/schools", i),
|
|
533
|
+
getSchool: (i) => o(`/schools/${i}`),
|
|
534
|
+
listTeams: (i) => n("/teams", i),
|
|
535
|
+
getTeam: (i) => o(`/teams/${i}`),
|
|
536
|
+
listConferences: (i) => n("/conferences", i),
|
|
537
|
+
listPlayers: (i) => n("/players", i),
|
|
538
|
+
listRosters: (i) => n("/rosters", i),
|
|
539
|
+
listGames: (i) => n("/games", i),
|
|
540
|
+
getGame: (i) => o(`/games/${i}`),
|
|
541
|
+
listTournaments: (i) => n("/tournaments", i),
|
|
542
|
+
listSeedings: (i, c) => n(`/tournaments/${i}/seedings`, c),
|
|
543
|
+
listEdges: (i, c) => n(`/tournaments/${i}/edges`, c),
|
|
544
|
+
listRankings: (i) => n("/rankings", i),
|
|
544
545
|
listSports: () => o("/sports")
|
|
545
546
|
};
|
|
546
547
|
}
|
|
547
|
-
const
|
|
548
|
+
const L = {
|
|
548
549
|
game: "/{sport}/game/{id}/",
|
|
549
550
|
school: "/school/{id}/",
|
|
550
|
-
section: "/{sport}/{view}/"
|
|
551
|
+
section: "/{sport}/{view}/",
|
|
552
|
+
// The "Report a Score" page; {id} is the game being reported on, and
|
|
553
|
+
// reportHref() drops the parameter when there is none.
|
|
554
|
+
report: "/report-a-score/?game={id}"
|
|
551
555
|
};
|
|
552
|
-
function
|
|
556
|
+
function v(a, t) {
|
|
553
557
|
return String(a).replace(/\{(\w+)\}/g, (e, s) => t[s] !== void 0 && t[s] !== null ? String(t[s]) : e);
|
|
554
558
|
}
|
|
555
|
-
function
|
|
559
|
+
function O(a) {
|
|
556
560
|
return {
|
|
557
|
-
game: a.getAttribute("game-href") ||
|
|
558
|
-
school: a.getAttribute("school-href") ||
|
|
559
|
-
section: a.getAttribute("section-href") ||
|
|
561
|
+
game: a.getAttribute("game-href") || L.game,
|
|
562
|
+
school: a.getAttribute("school-href") || L.school,
|
|
563
|
+
section: a.getAttribute("section-href") || L.section,
|
|
564
|
+
report: a.getAttribute("report-href") || L.report
|
|
560
565
|
};
|
|
561
566
|
}
|
|
562
|
-
|
|
563
|
-
|
|
567
|
+
function Qt(a, t = "") {
|
|
568
|
+
const e = v(a.report || L.report, { id: t || "" });
|
|
569
|
+
return t ? e : e.replace(/([?&])game=(?=&|$)/, "$1").replace(/[?&]$/, "").replace(/\?&/, "?");
|
|
570
|
+
}
|
|
571
|
+
const D = (a) => a ? a.charAt(0).toUpperCase() + a.slice(1) : "";
|
|
572
|
+
function w(a, t) {
|
|
564
573
|
if (!a) return "TBD";
|
|
565
574
|
const [e, s, r] = String(a).split("-").map(Number);
|
|
566
575
|
return !e || !s || !r ? "TBD" : new Date(e, s - 1, r).toLocaleDateString("en-US", t || { weekday: "short", month: "short", day: "numeric" });
|
|
567
576
|
}
|
|
568
|
-
function
|
|
577
|
+
function gt(a) {
|
|
569
578
|
if (!a) return "";
|
|
570
579
|
const [t, e] = String(a).split(":").map(Number);
|
|
571
580
|
if (Number.isNaN(t)) return "";
|
|
572
581
|
const s = t >= 12 ? "PM" : "AM";
|
|
573
582
|
return `${(t + 11) % 12 + 1}:${String(e || 0).padStart(2, "0")} ${s}`;
|
|
574
583
|
}
|
|
575
|
-
function
|
|
584
|
+
function Oe(a) {
|
|
576
585
|
return a ? `${Math.floor(a / 12)}-${a % 12}` : "·";
|
|
577
586
|
}
|
|
578
|
-
function
|
|
587
|
+
function Ue(a) {
|
|
579
588
|
return (Array.isArray(a?.positions) ? a.positions : String(a?.position ?? "").split(/[/,]/)).map((e) => String(e ?? "").trim()).filter(Boolean).join("/");
|
|
580
589
|
}
|
|
581
|
-
function
|
|
590
|
+
function K(a = /* @__PURE__ */ new Date()) {
|
|
582
591
|
const t = a.getFullYear();
|
|
583
592
|
return a.getMonth() >= 6 ? `${t}-${t + 1}` : `${t - 1}-${t}`;
|
|
584
593
|
}
|
|
585
|
-
function
|
|
594
|
+
function vt(a = /* @__PURE__ */ new Date()) {
|
|
586
595
|
const t = (e) => String(e).padStart(2, "0");
|
|
587
596
|
return `${a.getFullYear()}-${t(a.getMonth() + 1)}-${t(a.getDate())}`;
|
|
588
597
|
}
|
|
589
|
-
function
|
|
598
|
+
function He(a, t = vt()) {
|
|
590
599
|
const e = [...new Set((a || []).filter(Boolean))].sort();
|
|
591
600
|
if (!e.length || e.includes(t)) return t;
|
|
592
601
|
const s = e.filter((r) => r < t);
|
|
593
602
|
return s.length ? s[s.length - 1] : e[0];
|
|
594
603
|
}
|
|
595
|
-
function
|
|
604
|
+
function $t(a) {
|
|
596
605
|
return a ? (a.abbr || a.name || "?").slice(0, 4).toUpperCase() : "?";
|
|
597
606
|
}
|
|
598
|
-
function
|
|
607
|
+
function tt(a) {
|
|
599
608
|
if (!a || !/^#[0-9a-fA-F]{6}$/.test(a)) return "#FFFFFF";
|
|
600
609
|
const t = parseInt(a.slice(1), 16), e = t >> 16 & 255, s = t >> 8 & 255, r = t & 255;
|
|
601
610
|
return 0.299 * e + 0.587 * s + 0.114 * r > 150 ? "#0F1B33" : "#FFFFFF";
|
|
602
611
|
}
|
|
603
|
-
const
|
|
612
|
+
const Le = (a) => {
|
|
604
613
|
const t = ["th", "st", "nd", "rd"], e = a % 100;
|
|
605
614
|
return a + (t[(e - 20) % 10] || t[e] || t[0]);
|
|
606
615
|
};
|
|
607
|
-
function
|
|
616
|
+
function Nt(a, t) {
|
|
608
617
|
const e = (o) => {
|
|
609
|
-
const
|
|
610
|
-
return
|
|
618
|
+
const n = /^\d+/.exec(String(o ?? ""));
|
|
619
|
+
return n ? Number(n[0]) : null;
|
|
611
620
|
}, s = e(a), r = e(t);
|
|
612
621
|
return s !== null && r !== null && s !== r ? r - s : s !== null && r === null ? -1 : s === null && r !== null ? 1 : String(a ?? "").localeCompare(String(t ?? ""), "en", { sensitivity: "base" });
|
|
613
622
|
}
|
|
614
|
-
function
|
|
623
|
+
function Ge(a, t) {
|
|
615
624
|
const e = (s) => String(s?.name ?? s ?? "");
|
|
616
625
|
return e(a).localeCompare(e(t), "en", { numeric: !0, sensitivity: "base" });
|
|
617
626
|
}
|
|
618
|
-
function
|
|
627
|
+
function Zt(a) {
|
|
619
628
|
if (a.state === "live") {
|
|
620
629
|
const t = [a.period, a.clock].filter(Boolean).join(" ");
|
|
621
630
|
return { kind: "live", label: t ? `Live · ${t}` : "Live" };
|
|
@@ -624,9 +633,9 @@ function Gt(a) {
|
|
|
624
633
|
const t = [];
|
|
625
634
|
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(" · ")}` : ""}` };
|
|
626
635
|
}
|
|
627
|
-
return a.state === "postponed" ? { kind: "warn", label: "Postponed" } : a.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${
|
|
636
|
+
return a.state === "postponed" ? { kind: "warn", label: "Postponed" } : a.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${w(a.date, { month: "short", day: "numeric" })} · ${gt(a.time)}`.replace(/ · $/, "") };
|
|
628
637
|
}
|
|
629
|
-
const
|
|
638
|
+
const je = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
|
|
630
639
|
function _(a) {
|
|
631
640
|
let t = String(a || "").replace(/^[a-z][a-z0-9+.-]*:\/\/[^/#?]*/i, "");
|
|
632
641
|
const e = t.indexOf("#");
|
|
@@ -635,43 +644,43 @@ function _(a) {
|
|
|
635
644
|
let r = t.split("?")[0] + s;
|
|
636
645
|
return r = r.replace(/([^:])\/{2,}/g, "$1/").replace(/^\/{2,}/, "/"), r = r.replace(/^\/(?=#)/, ""), r.length > 1 && (r = r.replace(/\/+$/, "")), r.toLowerCase();
|
|
637
646
|
}
|
|
638
|
-
function
|
|
647
|
+
function Jt() {
|
|
639
648
|
const a = globalThis.location;
|
|
640
649
|
if (!a) return "";
|
|
641
650
|
const t = (a.hash || "").startsWith("#/") ? a.hash : "";
|
|
642
651
|
return _((a.pathname || "") + t);
|
|
643
652
|
}
|
|
644
|
-
function
|
|
653
|
+
function qe(a, t, e) {
|
|
645
654
|
if (!e) return null;
|
|
646
655
|
const s = _(a);
|
|
647
656
|
if (!s) return null;
|
|
648
|
-
const r = _(
|
|
657
|
+
const r = _(v(t.game, { sport: e, id: "" })), o = _(v(t.school, { id: "" }));
|
|
649
658
|
if (s === r || s.startsWith(`${r}/`) || s === o || s.startsWith(`${o}/`)) return null;
|
|
650
|
-
const
|
|
651
|
-
if (s ===
|
|
652
|
-
if (!s.startsWith(`${
|
|
653
|
-
const
|
|
654
|
-
return
|
|
655
|
-
}
|
|
656
|
-
function
|
|
657
|
-
const s = (
|
|
659
|
+
const n = _(v(t.section, { sport: e, view: "" }));
|
|
660
|
+
if (s === n) return "";
|
|
661
|
+
if (!s.startsWith(`${n}/`)) return null;
|
|
662
|
+
const i = s.slice(n.length + 1), c = i.split("/");
|
|
663
|
+
return c.length > 2 || c.some((h) => !/^[a-z][a-z-]*$/.test(h)) || je.has(c[0]) ? null : i;
|
|
664
|
+
}
|
|
665
|
+
function We(a, t, e) {
|
|
666
|
+
const s = (n) => v(e.section, { sport: a, view: n }).replace(/([^:])\/{2,}/g, "$1/"), o = new Set((t || []).map((n) => n && n.gender).filter((n) => n === "boys" || n === "girls")).size === 2 ? [
|
|
658
667
|
{ label: "Boys Standings", href: s("boys/standings") },
|
|
659
668
|
{ label: "Girls Standings", href: s("girls/standings") }
|
|
660
669
|
] : [{ label: "Standings", href: s("standings") }];
|
|
661
670
|
return [
|
|
662
|
-
{ label: `${
|
|
671
|
+
{ label: `${D(a)} Home`, href: s("") },
|
|
663
672
|
{ label: "Scores/Schedule", href: s("scores") },
|
|
664
673
|
{ label: "Playoff Brackets", href: s("brackets") },
|
|
665
674
|
...o,
|
|
666
675
|
{ label: "Polls & Rankings", href: s("rankings") }
|
|
667
676
|
];
|
|
668
677
|
}
|
|
669
|
-
function
|
|
678
|
+
function Ve(a, t = Jt()) {
|
|
670
679
|
const e = _(t);
|
|
671
680
|
for (const s of a.querySelectorAll(':scope > a[slot="nav"]'))
|
|
672
681
|
e && _(s.getAttribute("href")) === e ? s.setAttribute("aria-current", "page") : s.removeAttribute("aria-current");
|
|
673
682
|
}
|
|
674
|
-
class
|
|
683
|
+
class b extends N {
|
|
675
684
|
static properties = {
|
|
676
685
|
api: { type: String },
|
|
677
686
|
refreshInterval: { type: Number, attribute: "refresh-interval" },
|
|
@@ -690,7 +699,7 @@ class w extends P {
|
|
|
690
699
|
this._client = t, this.isConnected && this.load();
|
|
691
700
|
}
|
|
692
701
|
get client() {
|
|
693
|
-
return this._client ? this._client : this.api ?
|
|
702
|
+
return this._client ? this._client : this.api ? Fe({ baseUrl: this.api }) : null;
|
|
694
703
|
}
|
|
695
704
|
connectedCallback() {
|
|
696
705
|
super.connectedCallback(), this._setupInterval();
|
|
@@ -702,7 +711,7 @@ class w extends P {
|
|
|
702
711
|
this.load();
|
|
703
712
|
}
|
|
704
713
|
updated(t) {
|
|
705
|
-
t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval(),
|
|
714
|
+
t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval(), Ve(this);
|
|
706
715
|
}
|
|
707
716
|
async load() {
|
|
708
717
|
const t = this.client;
|
|
@@ -737,7 +746,7 @@ class w extends P {
|
|
|
737
746
|
return l``;
|
|
738
747
|
}
|
|
739
748
|
}
|
|
740
|
-
const $ = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])),
|
|
749
|
+
const $ = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ye = y`
|
|
741
750
|
:host {
|
|
742
751
|
--hsot-red: var(--color-red, #D1232A);
|
|
743
752
|
--hsot-red-deep: var(--color-red-dark, #951C21);
|
|
@@ -775,7 +784,7 @@ const $ = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ue = b`
|
|
|
775
784
|
outline-offset: 1px;
|
|
776
785
|
}
|
|
777
786
|
.mut { color: var(--hsot-gray-5); }
|
|
778
|
-
`,
|
|
787
|
+
`, Ke = y`
|
|
779
788
|
.band { background: var(--hsot-white); color: var(--hsot-black); }
|
|
780
789
|
.band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
|
|
781
790
|
.band h1, .band h2.bandtitle {
|
|
@@ -824,7 +833,7 @@ const $ = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ue = b`
|
|
|
824
833
|
@media (max-width: 720px) {
|
|
825
834
|
.band h1, .band h2.bandtitle, .band.section h1, .band.section h2.bandtitle { font-size: 1.8rem; }
|
|
826
835
|
}
|
|
827
|
-
`,
|
|
836
|
+
`, Qe = y`
|
|
828
837
|
.view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
|
|
829
838
|
/* Optional right rail (slot="rail" light-DOM children): a divided 300px
|
|
830
839
|
column on desktop, stacked under the view content on smaller screens. */
|
|
@@ -888,7 +897,7 @@ const $ = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ue = b`
|
|
|
888
897
|
.error { padding: 1.2rem 1rem; color: var(--hsot-red-deep); font-size: 0.9rem; }
|
|
889
898
|
.note { font-size: 0.8125rem; color: var(--hsot-gray-5); margin: 0.6rem 0 0; }
|
|
890
899
|
.loading { padding: 1.2rem; color: var(--hsot-gray-5); font-family: var(--hsot-heading-font); }
|
|
891
|
-
`,
|
|
900
|
+
`, Ze = y`
|
|
892
901
|
.pill {
|
|
893
902
|
display: inline-block; font-family: var(--hsot-heading-font); font-weight: 700;
|
|
894
903
|
font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
|
|
@@ -903,7 +912,7 @@ const $ = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ue = b`
|
|
|
903
912
|
.pill.champ { background: var(--hsot-straw); color: #6b5900; }
|
|
904
913
|
@keyframes hsot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
|
|
905
914
|
@media (prefers-reduced-motion: reduce) { .pill.live { animation: none; } }
|
|
906
|
-
`,
|
|
915
|
+
`, Je = y`
|
|
907
916
|
.tablewrap { overflow-x: auto; }
|
|
908
917
|
table.data { font-family: var(--hsot-heading-font); font-size: 14px; border-collapse: collapse; width: 100%; }
|
|
909
918
|
table.data th {
|
|
@@ -921,7 +930,7 @@ const $ = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ue = b`
|
|
|
921
930
|
table.data tbody tr.rowlink:hover { background: var(--hsot-gray-1); }
|
|
922
931
|
table.data td.teamcell a { color: inherit; text-decoration: none; font-weight: 500; }
|
|
923
932
|
table.data td.teamcell a:hover { text-decoration: underline; }
|
|
924
|
-
`,
|
|
933
|
+
`, Xe = y`
|
|
925
934
|
.swatch {
|
|
926
935
|
display: inline-flex; align-items: center; justify-content: center;
|
|
927
936
|
width: 26px; height: 26px; border-radius: 50%;
|
|
@@ -945,7 +954,7 @@ const $ = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ue = b`
|
|
|
945
954
|
.dot.W { background: var(--hsot-win); }
|
|
946
955
|
.dot.L { background: var(--hsot-loss); }
|
|
947
956
|
.dot.T { background: var(--hsot-tie); }
|
|
948
|
-
`,
|
|
957
|
+
`, ts = y`
|
|
949
958
|
ul.gamelist { list-style: none; margin: 0; padding: 0; }
|
|
950
959
|
.gamelist li {
|
|
951
960
|
display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 1rem;
|
|
@@ -995,36 +1004,36 @@ const $ = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ue = b`
|
|
|
995
1004
|
.gamelist .ff { color: var(--hsot-gray-5); font-size: 0.78rem; font-style: italic; }
|
|
996
1005
|
.gamelist .where { color: var(--hsot-gray-5); font-size: 0.78rem; }
|
|
997
1006
|
.gamelist a.box { font-size: 0.78rem; }
|
|
998
|
-
`,
|
|
999
|
-
function
|
|
1007
|
+
`, U = [Ye, Ke, Qe, Ze, Je, Xe, ts];
|
|
1008
|
+
function nt(a) {
|
|
1000
1009
|
return a.state !== "final" ? null : a.forfeit === "home" ? "away" : a.forfeit === "away" || a.homeScore > a.awayScore ? "home" : a.awayScore > a.homeScore ? "away" : a.tiebreakWinner && a.tiebreakWinner !== "none" ? a.tiebreakWinner : "tie";
|
|
1001
1010
|
}
|
|
1002
|
-
function
|
|
1011
|
+
function es(a) {
|
|
1003
1012
|
return a && (a.forfeit === "home" || a.forfeit === "away") ? a.forfeit : null;
|
|
1004
1013
|
}
|
|
1005
|
-
function
|
|
1006
|
-
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,
|
|
1014
|
+
function Q(a, t) {
|
|
1015
|
+
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, n) => String(o.date).localeCompare(String(n.date)));
|
|
1007
1016
|
for (const o of r) {
|
|
1008
|
-
const
|
|
1009
|
-
for (const
|
|
1010
|
-
const
|
|
1011
|
-
if (!
|
|
1012
|
-
const
|
|
1013
|
-
|
|
1017
|
+
const n = nt(o), i = o.gameType === "conference";
|
|
1018
|
+
for (const c of ["home", "away"]) {
|
|
1019
|
+
const h = c === "home" ? o.homeTeamId : o.awayTeamId;
|
|
1020
|
+
if (!h) continue;
|
|
1021
|
+
const d = s(h), p = c === "home" ? o.homeScore : o.awayScore, u = c === "home" ? o.awayScore : o.homeScore;
|
|
1022
|
+
d.pf += p, d.pa += u;
|
|
1014
1023
|
let f = "T";
|
|
1015
|
-
|
|
1024
|
+
n === "tie" ? (d.t += 1, i && (d.ct += 1)) : n === c ? (d.w += 1, i && (d.cw += 1), f = "W") : (d.l += 1, i && (d.cl += 1), f = "L"), d.results.push({ gameId: o.id, date: o.date, mark: f, my: p, their: u, opp: c === "home" ? o.awayTeamId : o.homeTeamId, conf: i });
|
|
1016
1025
|
}
|
|
1017
1026
|
}
|
|
1018
1027
|
return e;
|
|
1019
1028
|
}
|
|
1020
|
-
function
|
|
1029
|
+
function it(a) {
|
|
1021
1030
|
if (!a || !a.length) return "";
|
|
1022
1031
|
const t = a[a.length - 1].mark;
|
|
1023
1032
|
let e = 0;
|
|
1024
1033
|
for (let s = a.length - 1; s >= 0 && a[s].mark === t; s -= 1) e += 1;
|
|
1025
1034
|
return t + e;
|
|
1026
1035
|
}
|
|
1027
|
-
const
|
|
1036
|
+
const Mt = (a, t, e) => {
|
|
1028
1037
|
const s = a + t + e;
|
|
1029
1038
|
return s ? (a + e / 2) / s : 0;
|
|
1030
1039
|
}, Ft = (a) => a.toFixed(3).replace("0.", ".");
|
|
@@ -1033,36 +1042,36 @@ function k(a, t = !1) {
|
|
|
1033
1042
|
const e = t ? a.cw : a.w, s = t ? a.cl : a.l, r = t ? a.ct : a.t;
|
|
1034
1043
|
return `${e}-${s}${r ? `-${r}` : ""}`;
|
|
1035
1044
|
}
|
|
1036
|
-
function
|
|
1045
|
+
function Xt(a, t) {
|
|
1037
1046
|
return a.map((e) => {
|
|
1038
1047
|
const s = t[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] };
|
|
1039
|
-
return { team: e, rec: s, confPct:
|
|
1048
|
+
return { team: e, rec: s, confPct: Mt(s.cw, s.cl, s.ct), overallPct: Mt(s.w, s.l, s.t) };
|
|
1040
1049
|
}).sort((e, s) => s.confPct - e.confPct || s.overallPct - e.overallPct || s.rec.pf - s.rec.pa - (e.rec.pf - e.rec.pa));
|
|
1041
1050
|
}
|
|
1042
|
-
function
|
|
1051
|
+
function bt(a, t) {
|
|
1043
1052
|
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;
|
|
1044
1053
|
}
|
|
1045
|
-
function
|
|
1054
|
+
function Ot(a, t) {
|
|
1046
1055
|
const e = a[t];
|
|
1047
1056
|
return e && e.results.length ? e.results[e.results.length - 1] : null;
|
|
1048
1057
|
}
|
|
1049
|
-
function
|
|
1058
|
+
function yt(a, t, e, s, r) {
|
|
1050
1059
|
const o = t[e];
|
|
1051
1060
|
if (!o) return null;
|
|
1052
|
-
const
|
|
1053
|
-
for (const
|
|
1054
|
-
if (
|
|
1055
|
-
const
|
|
1056
|
-
(!
|
|
1061
|
+
const n = /* @__PURE__ */ new Map();
|
|
1062
|
+
for (const c of a || []) {
|
|
1063
|
+
if (c.sport !== s || r && c.effectiveDate > r || c.gender && o.gender !== c.gender && o.gender !== "coed") continue;
|
|
1064
|
+
const h = c.gender || "", d = n.get(h);
|
|
1065
|
+
(!d || c.effectiveDate > d.effectiveDate) && n.set(h, c);
|
|
1057
1066
|
}
|
|
1058
|
-
let
|
|
1059
|
-
for (const
|
|
1060
|
-
const
|
|
1061
|
-
|
|
1067
|
+
let i = null;
|
|
1068
|
+
for (const c of n.values()) {
|
|
1069
|
+
const h = (c.teamIds || []).indexOf(e);
|
|
1070
|
+
h !== -1 && (!i || c.effectiveDate > i.effectiveDate) && (i = { poll: c, rank: h + 1 });
|
|
1062
1071
|
}
|
|
1063
|
-
return
|
|
1072
|
+
return i ? i.rank : null;
|
|
1064
1073
|
}
|
|
1065
|
-
function
|
|
1074
|
+
function ss(a, t, e) {
|
|
1066
1075
|
if (!a) return { kind: "none", delta: 0 };
|
|
1067
1076
|
const s = (a.teamIds || []).indexOf(e) + 1;
|
|
1068
1077
|
if (!s) return { kind: "none", delta: 0 };
|
|
@@ -1072,100 +1081,100 @@ function Ye(a, t, e) {
|
|
|
1072
1081
|
const o = r - s;
|
|
1073
1082
|
return o > 0 ? { kind: "up", delta: o } : o < 0 ? { kind: "down", delta: -o } : { kind: "same", delta: 0 };
|
|
1074
1083
|
}
|
|
1075
|
-
function
|
|
1084
|
+
function as(a) {
|
|
1076
1085
|
return /^https?:\/\//i.test(String(a || ""));
|
|
1077
1086
|
}
|
|
1078
|
-
function
|
|
1079
|
-
if (!
|
|
1087
|
+
function te(a, { w: t, h: e } = {}) {
|
|
1088
|
+
if (!as(a)) return "";
|
|
1080
1089
|
const s = [];
|
|
1081
1090
|
t && s.push(`w=${Math.max(1, Math.round(t))}`), e && s.push(`h=${Math.max(1, Math.round(e))}`), s.push("f=webp");
|
|
1082
1091
|
const r = a.includes("?") ? "&" : "?";
|
|
1083
1092
|
return `${a}${r}${s.join("&")}`;
|
|
1084
1093
|
}
|
|
1085
|
-
function
|
|
1094
|
+
function et(a, t) {
|
|
1086
1095
|
const e = t * 2;
|
|
1087
|
-
return
|
|
1096
|
+
return te(a?.logoAssetId, { w: e, h: e });
|
|
1088
1097
|
}
|
|
1089
|
-
function
|
|
1090
|
-
return
|
|
1098
|
+
function rs(a, t) {
|
|
1099
|
+
return te(a?.photoAssetId, { w: t * 2 });
|
|
1091
1100
|
}
|
|
1092
|
-
function
|
|
1093
|
-
const o =
|
|
1101
|
+
function lt(a, t, { title: e, sub: s, teams: r }) {
|
|
1102
|
+
const o = Jt(), i = !!a.querySelector(':scope > a[slot="nav"]') || qe(o, t.hrefs, t.sport) !== null;
|
|
1094
1103
|
return l`
|
|
1095
1104
|
<div class="band section">
|
|
1096
1105
|
<div class="inner">
|
|
1097
1106
|
<h1>${e}</h1>
|
|
1098
1107
|
${s ? l`<p class="sub">${s}</p>` : m}
|
|
1099
1108
|
</div>
|
|
1100
|
-
${
|
|
1101
|
-
<nav class="sectionnav" aria-label="${
|
|
1109
|
+
${i ? l`
|
|
1110
|
+
<nav class="sectionnav" aria-label="${D(t.sport)} section">
|
|
1102
1111
|
<div class="navrow">
|
|
1103
1112
|
<slot name="nav">
|
|
1104
|
-
${
|
|
1105
|
-
aria-current=${o && _(
|
|
1113
|
+
${We(t.sport, r, t.hrefs).map((c) => l`<a href=${c.href}
|
|
1114
|
+
aria-current=${o && _(c.href) === o ? "page" : m}>${c.label}</a>`)}
|
|
1106
1115
|
</slot>
|
|
1107
1116
|
</div>
|
|
1108
1117
|
</nav>` : m}
|
|
1109
1118
|
</div>
|
|
1110
1119
|
`;
|
|
1111
1120
|
}
|
|
1112
|
-
const
|
|
1121
|
+
const C = (a, t) => {
|
|
1113
1122
|
const e = a.teamsById[t];
|
|
1114
1123
|
return e ? a.schoolsById[e.schoolId] : null;
|
|
1115
|
-
},
|
|
1116
|
-
function
|
|
1124
|
+
}, R = (a, t) => C(a, t)?.name || "TBD", st = (a, t) => C(a, t)?.abbr || "TBD";
|
|
1125
|
+
function E(a, t = 26) {
|
|
1117
1126
|
if (!a) return m;
|
|
1118
|
-
const e =
|
|
1127
|
+
const e = et(a, t);
|
|
1119
1128
|
if (e)
|
|
1120
1129
|
return l`<img class="swatch logo" aria-hidden="true" alt="" loading="lazy"
|
|
1121
1130
|
src=${e} style="width:${t}px;height:${t}px" />`;
|
|
1122
|
-
const s = a.colorPrimary || "#030711", r =
|
|
1131
|
+
const s = a.colorPrimary || "#030711", r = tt(s);
|
|
1123
1132
|
return l`<span class="swatch" aria-hidden="true"
|
|
1124
1133
|
style="width:${t}px;height:${t}px;background:${s};color:${r};font-size:${Math.max(8, t * 0.28)}px"
|
|
1125
|
-
>${
|
|
1134
|
+
>${$t(a)}</span>`;
|
|
1126
1135
|
}
|
|
1127
|
-
function
|
|
1128
|
-
const s =
|
|
1136
|
+
function wt(a, t, e) {
|
|
1137
|
+
const s = yt(a.rankings, a.teamsById, t, a.sport, e);
|
|
1129
1138
|
return s ? l`<span class="rankbadge">#${s}</span>` : m;
|
|
1130
1139
|
}
|
|
1131
|
-
function
|
|
1132
|
-
const s =
|
|
1133
|
-
return s ? l`${
|
|
1140
|
+
function at(a, t, e) {
|
|
1141
|
+
const s = C(a, t);
|
|
1142
|
+
return s ? l`${wt(a, t, e)}<a href=${v(a.hrefs.school, { id: s.id })}>${s.name}</a>` : l`<span class="mut">TBD</span>`;
|
|
1134
1143
|
}
|
|
1135
|
-
function
|
|
1144
|
+
function xt(a, t, e = 5) {
|
|
1136
1145
|
const s = a.records[t];
|
|
1137
1146
|
if (!s || !s.results.length) return l`<span class="mut">·</span>`;
|
|
1138
1147
|
const r = s.results.slice(-1 * e);
|
|
1139
1148
|
return l`<span class="dots" role="img" aria-label="last ${r.length} results">
|
|
1140
1149
|
${r.map((o) => l`<a class="dot ${o.mark}"
|
|
1141
|
-
title="${o.mark} ${o.my}-${o.their} vs ${
|
|
1142
|
-
href=${
|
|
1150
|
+
title="${o.mark} ${o.my}-${o.their} vs ${R(a, o.opp)}"
|
|
1151
|
+
href=${v(a.hrefs.game, { sport: a.sport, id: o.gameId })}>${o.mark}</a>`)}
|
|
1143
1152
|
</span>`;
|
|
1144
1153
|
}
|
|
1145
|
-
function
|
|
1154
|
+
function P(a, t) {
|
|
1146
1155
|
return a.querySelector(':scope > [slot="rail"]') ? l`<div class="view withrail">
|
|
1147
1156
|
<div class="viewmain">${t}</div>
|
|
1148
1157
|
<aside class="viewrail"><slot name="rail"></slot></aside>
|
|
1149
1158
|
</div>` : l`<div class="view">${t}</div>`;
|
|
1150
1159
|
}
|
|
1151
|
-
function
|
|
1160
|
+
function B(a) {
|
|
1152
1161
|
if (!a.promoImage) return m;
|
|
1153
1162
|
const t = l`<img src=${a.promoImage} alt=${a.promoAlt || "Sponsor"}>`;
|
|
1154
1163
|
return l`<div class="promo">${a.promoHref ? l`<a href=${a.promoHref} target="_blank" rel="sponsored noopener">${t}</a>` : t}</div>`;
|
|
1155
1164
|
}
|
|
1156
|
-
function
|
|
1157
|
-
const t =
|
|
1165
|
+
function V(a) {
|
|
1166
|
+
const t = Zt(a);
|
|
1158
1167
|
return l`<span class="pill ${t.kind}">${t.label}</span>`;
|
|
1159
1168
|
}
|
|
1160
|
-
function
|
|
1169
|
+
function ee(a, t, e) {
|
|
1161
1170
|
if (!t) return l`<span class="mut">·</span>`;
|
|
1162
1171
|
const s = t.homeTeamId === e ? t.awayTeamId : t.homeTeamId, r = t.homeTeamId === e ? "vs" : "at";
|
|
1163
|
-
return l`${t.state === "live" ? l`<span class="pill live">Live</span> ` : l`${
|
|
1172
|
+
return l`${t.state === "live" ? l`<span class="pill live">Live</span> ` : l`${w(t.date, { month: "numeric", day: "numeric" })} `}${r} ${st(a, s)}`;
|
|
1164
1173
|
}
|
|
1165
|
-
class
|
|
1166
|
-
static styles =
|
|
1174
|
+
class se extends b {
|
|
1175
|
+
static styles = U;
|
|
1167
1176
|
static properties = {
|
|
1168
|
-
...
|
|
1177
|
+
...b.properties,
|
|
1169
1178
|
sport: { type: String },
|
|
1170
1179
|
season: { type: String },
|
|
1171
1180
|
date: { type: String }
|
|
@@ -1181,57 +1190,57 @@ class Jt extends w {
|
|
|
1181
1190
|
this._datePinned = !!this.date;
|
|
1182
1191
|
}
|
|
1183
1192
|
async fetchData(t) {
|
|
1184
|
-
const e = this.season ||
|
|
1193
|
+
const e = this.season || K(), [s, r, o, n, i] = await Promise.all([
|
|
1185
1194
|
t.listSchools(),
|
|
1186
1195
|
t.listTeams({ sport: this.sport }),
|
|
1187
1196
|
t.listConferences(),
|
|
1188
1197
|
t.listGames({ sport: this.sport, season: e }),
|
|
1189
1198
|
t.listRankings({ sport: this.sport })
|
|
1190
1199
|
]);
|
|
1191
|
-
return this._datePinned || (this.date =
|
|
1200
|
+
return this._datePinned || (this.date = He(n.items.map((c) => c.date)), this._datePinned = !0), {
|
|
1192
1201
|
season: e,
|
|
1193
1202
|
schools: s.items,
|
|
1194
1203
|
teams: r.items,
|
|
1195
1204
|
conferences: o.items,
|
|
1196
|
-
games:
|
|
1197
|
-
rankings:
|
|
1205
|
+
games: n.items,
|
|
1206
|
+
rankings: i.items
|
|
1198
1207
|
};
|
|
1199
1208
|
}
|
|
1200
1209
|
get ctx() {
|
|
1201
1210
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
1202
1211
|
teamsById: $(this.data.teams),
|
|
1203
1212
|
schoolsById: $(this.data.schools),
|
|
1204
|
-
records:
|
|
1213
|
+
records: Q(this.data.games),
|
|
1205
1214
|
rankings: this.data.rankings,
|
|
1206
|
-
hrefs:
|
|
1215
|
+
hrefs: O(this),
|
|
1207
1216
|
sport: this.sport
|
|
1208
1217
|
}, this._ctxData = this.data), this._ctx;
|
|
1209
1218
|
}
|
|
1210
1219
|
renderView() {
|
|
1211
|
-
const t = this.ctx, e = $(this.data.conferences), s = [...new Set(this.data.games.map((
|
|
1212
|
-
const
|
|
1213
|
-
return
|
|
1214
|
-
},
|
|
1215
|
-
|
|
1216
|
-
const
|
|
1217
|
-
return
|
|
1218
|
-
const
|
|
1219
|
-
|
|
1220
|
+
const t = this.ctx, e = $(this.data.conferences), s = [...new Set(this.data.games.map((h) => h.date).filter(Boolean))].sort(), r = Number.MAX_SAFE_INTEGER, o = (h) => {
|
|
1221
|
+
const d = [h.awayTeamId, h.homeTeamId].map((p) => yt(t.rankings, t.teamsById, p, this.sport, h.date)).filter(Boolean);
|
|
1222
|
+
return d.length ? Math.min(...d) : r;
|
|
1223
|
+
}, n = this.data.games.filter((h) => h.date === this.date), i = new Map(n.map((h) => [h, o(h)]));
|
|
1224
|
+
n.sort((h, d) => (h.state === "live" ? 0 : 1) - (d.state === "live" ? 0 : 1) || i.get(h) - i.get(d));
|
|
1225
|
+
const c = /* @__PURE__ */ new Map();
|
|
1226
|
+
return n.forEach((h) => {
|
|
1227
|
+
const d = h.gameType === "conference" && h.conferenceId ? e[h.conferenceId]?.name || "Conference" : h.gameType === "playoff" ? "Playoffs" : h.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
|
|
1228
|
+
c.has(d) || c.set(d, []), c.get(d).push(h);
|
|
1220
1229
|
}), l`
|
|
1221
|
-
${
|
|
1222
|
-
title: l`${
|
|
1223
|
-
sub: l`${
|
|
1230
|
+
${lt(this, t, {
|
|
1231
|
+
title: l`${D(this.sport)} scores & schedules`,
|
|
1232
|
+
sub: l`${w(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${n.length} games`,
|
|
1224
1233
|
teams: this.data.teams
|
|
1225
1234
|
})}
|
|
1226
|
-
${
|
|
1227
|
-
${
|
|
1235
|
+
${P(this, l`
|
|
1236
|
+
${B(this)}
|
|
1228
1237
|
<div class="toolbar">
|
|
1229
1238
|
<label class="asof" for="datesel">Date</label>
|
|
1230
|
-
<select id="datesel" @change=${(
|
|
1231
|
-
this.date =
|
|
1239
|
+
<select id="datesel" @change=${(h) => {
|
|
1240
|
+
this.date = h.target.value;
|
|
1232
1241
|
}}>
|
|
1233
|
-
${(s.includes(this.date) ? s : [...s, this.date].sort()).map((
|
|
1234
|
-
${
|
|
1242
|
+
${(s.includes(this.date) ? s : [...s, this.date].sort()).map((h) => l`<option value=${h} ?selected=${h === this.date}>
|
|
1243
|
+
${w(h, { weekday: "short", month: "short", day: "numeric" })}${h === vt() ? " · today" : ""}
|
|
1235
1244
|
</option>`)}
|
|
1236
1245
|
</select>
|
|
1237
1246
|
<button class="chip" ?disabled=${s.indexOf(this.date) <= 0}
|
|
@@ -1243,13 +1252,13 @@ class Jt extends w {
|
|
|
1243
1252
|
this.date = s[s.indexOf(this.date) + 1];
|
|
1244
1253
|
}}>Next →</button>
|
|
1245
1254
|
<span class="spacer"></span>
|
|
1246
|
-
<span class="asof">Live games first · report a score to see it update here</span>
|
|
1255
|
+
<span class="asof">Live games first · <a href=${Qt(t.hrefs)}>report a score</a> to see it update here</span>
|
|
1247
1256
|
</div>
|
|
1248
|
-
${
|
|
1249
|
-
${[...
|
|
1250
|
-
<div class="section-title">${
|
|
1257
|
+
${n.length ? m : l`<p class="empty">No ${this.sport} games on this date.</p>`}
|
|
1258
|
+
${[...c.entries()].map(([h, d]) => l`
|
|
1259
|
+
<div class="section-title">${h}</div>
|
|
1251
1260
|
<div class="card"><ul class="gamelist">
|
|
1252
|
-
${
|
|
1261
|
+
${d.map((p) => this.renderGame(t, p))}
|
|
1253
1262
|
</ul></div>
|
|
1254
1263
|
`)}
|
|
1255
1264
|
`)}
|
|
@@ -1259,24 +1268,24 @@ class Jt extends w {
|
|
|
1259
1268
|
// a lone score column on the far right read as detached from the teams).
|
|
1260
1269
|
// Scheduled games carry their start time on the status pill alone.
|
|
1261
1270
|
renderGame(t, e) {
|
|
1262
|
-
const s = e.state === "final" || e.state === "live", r = (
|
|
1271
|
+
const s = e.state === "final" || e.state === "live", r = (n, i, c = m) => l`<span class="side">${at(t, n, e.date)}${s ? l`<span class="score">${i}</span>` : m}${c}</span>`, o = es(e);
|
|
1263
1272
|
return l`
|
|
1264
1273
|
<li>
|
|
1265
|
-
${
|
|
1274
|
+
${V(e)}
|
|
1266
1275
|
<span class="opp matchup">${r(e.awayTeamId, e.awayScore, l`<span class="at">at</span>`)}${r(e.homeTeamId, e.homeScore)}</span>
|
|
1267
|
-
${o ? l`<span class="ff">${
|
|
1276
|
+
${o ? l`<span class="ff">${R(t, o === "home" ? e.homeTeamId : e.awayTeamId)} forfeited</span>` : m}
|
|
1268
1277
|
<span class="where">${e.venue || ""}</span>
|
|
1269
1278
|
${e.broadcast ? l`<span class="pill class">${e.broadcast}</span>` : m}
|
|
1270
|
-
<a class="box" href=${
|
|
1279
|
+
<a class="box" href=${v(t.hrefs.game, { sport: this.sport, id: e.id })}>Box score →</a>
|
|
1271
1280
|
</li>
|
|
1272
1281
|
`;
|
|
1273
1282
|
}
|
|
1274
1283
|
}
|
|
1275
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores",
|
|
1276
|
-
class
|
|
1277
|
-
static styles =
|
|
1284
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", se);
|
|
1285
|
+
class ae extends b {
|
|
1286
|
+
static styles = U;
|
|
1278
1287
|
static properties = {
|
|
1279
|
-
...
|
|
1288
|
+
...b.properties,
|
|
1280
1289
|
sport: { type: String },
|
|
1281
1290
|
season: { type: String },
|
|
1282
1291
|
classFilter: { state: !0 },
|
|
@@ -1286,7 +1295,7 @@ class Xt extends w {
|
|
|
1286
1295
|
super(), this.sport = "football", this.season = "", this.classFilter = "All", this.query = "";
|
|
1287
1296
|
}
|
|
1288
1297
|
async fetchData(t) {
|
|
1289
|
-
const e = this.season ||
|
|
1298
|
+
const e = this.season || K(), [s, r, o, n, i] = await Promise.all([
|
|
1290
1299
|
t.listConferences({ active: !0 }),
|
|
1291
1300
|
t.listSchools(),
|
|
1292
1301
|
t.listTeams({ sport: this.sport }),
|
|
@@ -1298,30 +1307,30 @@ class Xt extends w {
|
|
|
1298
1307
|
conferences: s.items,
|
|
1299
1308
|
schools: r.items,
|
|
1300
1309
|
teams: o.items,
|
|
1301
|
-
games:
|
|
1302
|
-
rankings:
|
|
1310
|
+
games: n.items,
|
|
1311
|
+
rankings: i.items
|
|
1303
1312
|
};
|
|
1304
1313
|
}
|
|
1305
1314
|
get ctx() {
|
|
1306
1315
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
1307
1316
|
teamsById: $(this.data.teams),
|
|
1308
1317
|
schoolsById: $(this.data.schools),
|
|
1309
|
-
records:
|
|
1318
|
+
records: Q(this.data.games),
|
|
1310
1319
|
rankings: this.data.rankings,
|
|
1311
|
-
hrefs:
|
|
1320
|
+
hrefs: O(this),
|
|
1312
1321
|
sport: this.sport
|
|
1313
1322
|
}, this._ctxData = this.data), this._ctx;
|
|
1314
1323
|
}
|
|
1315
1324
|
renderView() {
|
|
1316
|
-
const t = this.ctx, e = ["All", ...[...new Set(this.data.conferences.flatMap((r) => r.classifications || []))].sort(
|
|
1325
|
+
const t = this.ctx, e = ["All", ...[...new Set(this.data.conferences.flatMap((r) => r.classifications || []))].sort(Nt)].slice(0, 9), s = this.data.conferences.filter((r) => r.active !== !1).filter((r) => this.classFilter === "All" || (r.classifications || []).includes(this.classFilter)).sort(Ge);
|
|
1317
1326
|
return l`
|
|
1318
|
-
${
|
|
1319
|
-
title: l`${
|
|
1327
|
+
${lt(this, t, {
|
|
1328
|
+
title: l`${D(this.sport)} standings`,
|
|
1320
1329
|
sub: l`${this.data.season} season · every conference, computed live from reported results`,
|
|
1321
1330
|
teams: this.data.teams
|
|
1322
1331
|
})}
|
|
1323
|
-
${
|
|
1324
|
-
${
|
|
1332
|
+
${P(this, l`
|
|
1333
|
+
${B(this)}
|
|
1325
1334
|
<div class="toolbar">
|
|
1326
1335
|
<div role="group" aria-label="Classification filter">
|
|
1327
1336
|
${e.map((r) => l`<button class="chip ${this.classFilter === r ? "on" : ""}"
|
|
@@ -1334,21 +1343,21 @@ class Xt extends w {
|
|
|
1334
1343
|
this.query = r.target.value;
|
|
1335
1344
|
}}>
|
|
1336
1345
|
<span class="spacer"></span>
|
|
1337
|
-
<span class="asof">Records through ${
|
|
1346
|
+
<span class="asof">Records through ${w(vt(), { month: "long", day: "numeric" })} · conference games count toward both records · scrimmages toward neither</span>
|
|
1338
1347
|
</div>
|
|
1339
1348
|
${s.map((r) => this.renderConference(t, r))}
|
|
1340
1349
|
`)}
|
|
1341
1350
|
`;
|
|
1342
1351
|
}
|
|
1343
1352
|
renderConference(t, e) {
|
|
1344
|
-
const s = this.data.teams.filter((
|
|
1353
|
+
const s = this.data.teams.filter((n) => n.conferenceId === e.id);
|
|
1345
1354
|
if (!s.length) return m;
|
|
1346
|
-
const r = this.query.trim().toLowerCase(), o =
|
|
1355
|
+
const r = this.query.trim().toLowerCase(), o = Xt(s, t.records);
|
|
1347
1356
|
return l`
|
|
1348
1357
|
<div class="card">
|
|
1349
1358
|
<div class="card-head">
|
|
1350
1359
|
<h2>${e.name}</h2>
|
|
1351
|
-
${[...e.classifications || []].sort(
|
|
1360
|
+
${[...e.classifications || []].sort(Nt).map((n) => l`<span class="pill class">${n}</span>`)}
|
|
1352
1361
|
<span class="meta">${o.length} teams · membership derives from teams</span>
|
|
1353
1362
|
</div>
|
|
1354
1363
|
<div class="tablewrap"><table class="data">
|
|
@@ -1358,26 +1367,26 @@ class Xt extends w {
|
|
|
1358
1367
|
<th>Streak</th><th>Last 5</th><th>Next</th>
|
|
1359
1368
|
</tr></thead>
|
|
1360
1369
|
<tbody>
|
|
1361
|
-
${o.map((
|
|
1370
|
+
${o.map((n, i) => this.renderRow(t, n, i, r))}
|
|
1362
1371
|
</tbody>
|
|
1363
1372
|
</table></div>
|
|
1364
1373
|
</div>
|
|
1365
1374
|
`;
|
|
1366
1375
|
}
|
|
1367
1376
|
renderRow(t, e, s, r) {
|
|
1368
|
-
const o = t.schoolsById[e.team.schoolId],
|
|
1369
|
-
if (r && !
|
|
1370
|
-
const
|
|
1371
|
-
location.href =
|
|
1377
|
+
const o = t.schoolsById[e.team.schoolId], n = o?.name || e.team.name || "TBD";
|
|
1378
|
+
if (r && !n.toLowerCase().includes(r)) return m;
|
|
1379
|
+
const i = e.rec.pf - e.rec.pa, c = bt(this.data.games, e.team.id), h = () => {
|
|
1380
|
+
location.href = v(t.hrefs.school, { id: e.team.schoolId });
|
|
1372
1381
|
};
|
|
1373
1382
|
return l`
|
|
1374
|
-
<tr class="rowlink" @click=${(
|
|
1375
|
-
|
|
1383
|
+
<tr class="rowlink" @click=${(d) => {
|
|
1384
|
+
d.target.closest("a") || h();
|
|
1376
1385
|
}}>
|
|
1377
1386
|
<td class="mut">${s + 1}</td>
|
|
1378
1387
|
<td class="teamcell">
|
|
1379
|
-
${
|
|
1380
|
-
<a href=${
|
|
1388
|
+
${E(o)}${wt(t, e.team.id, null)}
|
|
1389
|
+
<a href=${v(t.hrefs.school, { id: e.team.schoolId })}>${n}</a>
|
|
1381
1390
|
</td>
|
|
1382
1391
|
<td class="num">${k(e.rec, !0)}</td>
|
|
1383
1392
|
<td class="num">${Ft(e.confPct)}</td>
|
|
@@ -1385,16 +1394,16 @@ class Xt extends w {
|
|
|
1385
1394
|
<td class="num">${Ft(e.overallPct)}</td>
|
|
1386
1395
|
<td class="num">${e.rec.pf}</td>
|
|
1387
1396
|
<td class="num">${e.rec.pa}</td>
|
|
1388
|
-
<td class="num" style="color:${
|
|
1389
|
-
<td>${
|
|
1390
|
-
<td>${
|
|
1391
|
-
<td>${
|
|
1397
|
+
<td class="num" style="color:${i >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${i > 0 ? "+" : ""}${i}</td>
|
|
1398
|
+
<td>${it(e.rec.results) || "·"}</td>
|
|
1399
|
+
<td>${xt(t, e.team.id)}</td>
|
|
1400
|
+
<td>${ee(t, c, e.team.id)}</td>
|
|
1392
1401
|
</tr>
|
|
1393
1402
|
`;
|
|
1394
1403
|
}
|
|
1395
1404
|
}
|
|
1396
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings",
|
|
1397
|
-
const
|
|
1405
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", ae);
|
|
1406
|
+
const os = y`
|
|
1398
1407
|
.hero1 {
|
|
1399
1408
|
border-radius: var(--hsot-radius-md); color: var(--hsot-white);
|
|
1400
1409
|
padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.2rem;
|
|
@@ -1411,10 +1420,10 @@ const Ze = b`
|
|
|
1411
1420
|
.delta.new { background: var(--hsot-straw); color: #6b5900; border-radius: var(--hsot-radius-xs); padding: 0.1rem 0.3rem; font-size: 0.7rem; }
|
|
1412
1421
|
.sparkline { vertical-align: middle; }
|
|
1413
1422
|
`;
|
|
1414
|
-
class
|
|
1415
|
-
static styles = [...
|
|
1423
|
+
class re extends b {
|
|
1424
|
+
static styles = [...U, os];
|
|
1416
1425
|
static properties = {
|
|
1417
|
-
...
|
|
1426
|
+
...b.properties,
|
|
1418
1427
|
sport: { type: String },
|
|
1419
1428
|
gender: { type: String },
|
|
1420
1429
|
season: { type: String },
|
|
@@ -1429,73 +1438,73 @@ class te extends w {
|
|
|
1429
1438
|
t && (this.pollDate = t);
|
|
1430
1439
|
}
|
|
1431
1440
|
async fetchData(t) {
|
|
1432
|
-
const e = this.season ||
|
|
1441
|
+
const e = this.season || K(), [s, r, o, n, i] = await Promise.all([
|
|
1433
1442
|
t.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
|
|
1434
1443
|
t.listSchools(),
|
|
1435
1444
|
t.listTeams({ sport: this.sport }),
|
|
1436
1445
|
t.listConferences(),
|
|
1437
1446
|
t.listGames({ sport: this.sport, season: e })
|
|
1438
|
-
]),
|
|
1447
|
+
]), c = s.items.filter((h) => !this.gender || !h.gender || h.gender === this.gender).sort((h, d) => d.effectiveDate.localeCompare(h.effectiveDate));
|
|
1439
1448
|
return {
|
|
1440
1449
|
season: e,
|
|
1441
|
-
polls:
|
|
1450
|
+
polls: c,
|
|
1442
1451
|
schools: r.items,
|
|
1443
1452
|
teams: o.items,
|
|
1444
|
-
conferences:
|
|
1445
|
-
games:
|
|
1453
|
+
conferences: n.items,
|
|
1454
|
+
games: i.items
|
|
1446
1455
|
};
|
|
1447
1456
|
}
|
|
1448
1457
|
get ctx() {
|
|
1449
1458
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
1450
1459
|
teamsById: $(this.data.teams),
|
|
1451
1460
|
schoolsById: $(this.data.schools),
|
|
1452
|
-
records:
|
|
1461
|
+
records: Q(this.data.games),
|
|
1453
1462
|
rankings: this.data.polls,
|
|
1454
|
-
hrefs:
|
|
1463
|
+
hrefs: O(this),
|
|
1455
1464
|
sport: this.sport
|
|
1456
1465
|
}, this._ctxData = this.data), this._ctx;
|
|
1457
1466
|
}
|
|
1458
1467
|
sparkline(t, e, s) {
|
|
1459
|
-
const
|
|
1468
|
+
const i = e.map((p, u) => {
|
|
1460
1469
|
const f = (p.teamIds || []).indexOf(t);
|
|
1461
1470
|
if (f === -1) return null;
|
|
1462
|
-
const
|
|
1463
|
-
return { x:
|
|
1464
|
-
}),
|
|
1465
|
-
let
|
|
1466
|
-
if (
|
|
1467
|
-
p ?
|
|
1468
|
-
}),
|
|
1469
|
-
const
|
|
1471
|
+
const g = e.length === 1 ? 96 / 2 : u / (e.length - 1) * 90 + 3, x = 3 + f / 24 * 20;
|
|
1472
|
+
return { x: g, y: x };
|
|
1473
|
+
}), c = [];
|
|
1474
|
+
let h = [];
|
|
1475
|
+
if (i.forEach((p) => {
|
|
1476
|
+
p ? h.push(p) : h.length && (c.push(h), h = []);
|
|
1477
|
+
}), h.length && c.push(h), !c.length) return m;
|
|
1478
|
+
const d = i[s];
|
|
1470
1479
|
return l`<svg class="sparkline" width=${96} height=${26} viewBox="0 0 ${96} ${26}" role="img" aria-label="rank history">
|
|
1471
|
-
${
|
|
1480
|
+
${c.map((p) => zt`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
|
|
1472
1481
|
points=${p.map((u) => `${u.x.toFixed(1)},${u.y.toFixed(1)}`).join(" ")}></polyline>`)}
|
|
1473
|
-
${
|
|
1482
|
+
${d ? zt`<circle cx=${d.x.toFixed(1)} cy=${d.y.toFixed(1)} r="3" fill="var(--hsot-black)"></circle>` : m}
|
|
1474
1483
|
</svg>`;
|
|
1475
1484
|
}
|
|
1476
1485
|
movement(t, e, s) {
|
|
1477
|
-
const r =
|
|
1486
|
+
const r = ss(t, e, s);
|
|
1478
1487
|
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>`;
|
|
1479
1488
|
}
|
|
1480
1489
|
renderView() {
|
|
1481
1490
|
const t = this.ctx, e = this.data.polls;
|
|
1482
1491
|
if (!e.length) return l`<div class="view"><p class="empty">No ${this.sport} polls published yet this season.</p></div>`;
|
|
1483
|
-
const s = Math.max(0, e.findIndex((p) => p.effectiveDate === this.pollDate)), r = e[s] || e[0], o = e[s + 1] || null,
|
|
1492
|
+
const s = Math.max(0, e.findIndex((p) => p.effectiveDate === this.pollDate)), r = e[s] || e[0], o = e[s + 1] || null, n = e.slice().reverse(), i = n.indexOf(r), c = $(this.data.conferences), h = (r.teamIds || [])[0], d = h ? C(t, h) : null;
|
|
1484
1493
|
return l`
|
|
1485
|
-
${
|
|
1486
|
-
title: l`${
|
|
1494
|
+
${lt(this, t, {
|
|
1495
|
+
title: l`${D(this.sport)} Top 25`,
|
|
1487
1496
|
sub: l`The HighSchoolOT poll · updated weekly · ${e.length} polls this season`,
|
|
1488
1497
|
teams: this.data.teams
|
|
1489
1498
|
})}
|
|
1490
|
-
${
|
|
1491
|
-
${
|
|
1499
|
+
${P(this, l`
|
|
1500
|
+
${B(this)}
|
|
1492
1501
|
<div class="toolbar">
|
|
1493
1502
|
<label class="asof" for="pollsel">Poll of</label>
|
|
1494
1503
|
<select id="pollsel" @change=${(p) => {
|
|
1495
1504
|
this.pollDate = p.target.value;
|
|
1496
1505
|
}}>
|
|
1497
1506
|
${e.map((p, u) => l`<option value=${p.effectiveDate} ?selected=${p === r}>
|
|
1498
|
-
${
|
|
1507
|
+
${w(p.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${u === 0 ? " · current" : ""}
|
|
1499
1508
|
</option>`)}
|
|
1500
1509
|
</select>
|
|
1501
1510
|
<button class="chip" ?disabled=${s >= e.length - 1}
|
|
@@ -1509,65 +1518,65 @@ class te extends w {
|
|
|
1509
1518
|
<span class="spacer"></span>
|
|
1510
1519
|
<span class="asof">Movement vs. the previous poll · sparkline = season rank history</span>
|
|
1511
1520
|
</div>
|
|
1512
|
-
${
|
|
1521
|
+
${d ? this.renderHero(t, r, o, h, d, c) : m}
|
|
1513
1522
|
<div class="card"><div class="tablewrap"><table class="data">
|
|
1514
1523
|
<thead><tr>
|
|
1515
1524
|
<th class="num">Rk</th><th>Mvmt</th><th>Team</th><th class="num">Record</th>
|
|
1516
1525
|
<th>Conference</th><th>Last result</th><th>Next</th><th>Season</th>
|
|
1517
1526
|
</tr></thead>
|
|
1518
1527
|
<tbody>
|
|
1519
|
-
${(r.teamIds || []).map((p, u) => u === 0 || !p ? m : this.renderRow(t, r, o,
|
|
1528
|
+
${(r.teamIds || []).map((p, u) => u === 0 || !p ? m : this.renderRow(t, r, o, n, i, c, p, u + 1))}
|
|
1520
1529
|
</tbody>
|
|
1521
1530
|
</table></div></div>
|
|
1522
1531
|
<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>
|
|
1523
1532
|
`)}
|
|
1524
1533
|
`;
|
|
1525
1534
|
}
|
|
1526
|
-
renderHero(t, e, s, r, o,
|
|
1527
|
-
const
|
|
1535
|
+
renderHero(t, e, s, r, o, n) {
|
|
1536
|
+
const i = t.records[r], c = Ot(t.records, r), h = n[t.teamsById[r]?.conferenceId], d = `linear-gradient(120deg, ${o.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
|
|
1528
1537
|
return l`
|
|
1529
|
-
<div class="hero1" style="background:${
|
|
1538
|
+
<div class="hero1" style="background:${d}">
|
|
1530
1539
|
<div class="bigrank">#1</div>
|
|
1531
|
-
${
|
|
1540
|
+
${E(o, 64)}
|
|
1532
1541
|
<div>
|
|
1533
|
-
<h2><a href=${
|
|
1542
|
+
<h2><a href=${v(t.hrefs.school, { id: o.id })}>${o.name} ${o.mascot || ""}</a></h2>
|
|
1534
1543
|
<div class="facts">
|
|
1535
|
-
${k(
|
|
1536
|
-
· streak ${
|
|
1537
|
-
${
|
|
1544
|
+
${k(i)} overall${h ? l` · ${k(i, !0)} ${h.name}` : m}
|
|
1545
|
+
· streak ${it(i?.results) || "·"}
|
|
1546
|
+
${c ? l` · last: ${c.mark} ${c.my}-${c.their} vs ${st(t, c.opp)}` : m}
|
|
1538
1547
|
${this.movement(e, s, r)}
|
|
1539
1548
|
</div>
|
|
1540
1549
|
</div>
|
|
1541
1550
|
</div>
|
|
1542
1551
|
`;
|
|
1543
1552
|
}
|
|
1544
|
-
renderRow(t, e, s, r, o,
|
|
1545
|
-
const
|
|
1546
|
-
if (!
|
|
1547
|
-
const
|
|
1548
|
-
location.href =
|
|
1553
|
+
renderRow(t, e, s, r, o, n, i, c) {
|
|
1554
|
+
const h = C(t, i);
|
|
1555
|
+
if (!h) return m;
|
|
1556
|
+
const d = t.records[i], p = Ot(t.records, i), u = bt(this.data.games, i), f = n[t.teamsById[i]?.conferenceId], g = () => {
|
|
1557
|
+
location.href = v(t.hrefs.school, { id: h.id });
|
|
1549
1558
|
};
|
|
1550
1559
|
return l`
|
|
1551
1560
|
<tr class="rowlink" @click=${(x) => {
|
|
1552
|
-
x.target.closest("a") ||
|
|
1561
|
+
x.target.closest("a") || g();
|
|
1553
1562
|
}}>
|
|
1554
|
-
<td class="num" style="font-weight:700">${
|
|
1555
|
-
<td>${this.movement(e, s,
|
|
1556
|
-
<td class="teamcell">${
|
|
1557
|
-
<span class="mut" style="font-size:0.78rem">${
|
|
1558
|
-
<td class="num">${k(
|
|
1563
|
+
<td class="num" style="font-weight:700">${c}</td>
|
|
1564
|
+
<td>${this.movement(e, s, i)}</td>
|
|
1565
|
+
<td class="teamcell">${E(h)}<a href=${v(t.hrefs.school, { id: h.id })}>${h.name}</a>
|
|
1566
|
+
<span class="mut" style="font-size:0.78rem">${h.mascot || ""}</span></td>
|
|
1567
|
+
<td class="num">${k(d)}</td>
|
|
1559
1568
|
<td class="mut">${f?.name || "Independent"}</td>
|
|
1560
|
-
<td>${p ? l`<a class="box" style="text-decoration:none" href=${
|
|
1569
|
+
<td>${p ? l`<a class="box" style="text-decoration:none" href=${v(t.hrefs.game, { sport: this.sport, id: p.gameId })}>
|
|
1561
1570
|
<b style="color:${p.mark === "W" ? "var(--hsot-win)" : p.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${p.mark}</b>
|
|
1562
|
-
${p.my}-${p.their} vs ${
|
|
1563
|
-
<td>${
|
|
1564
|
-
<td>${this.sparkline(
|
|
1571
|
+
${p.my}-${p.their} vs ${st(t, p.opp)}</a>` : l`<span class="mut">·</span>`}</td>
|
|
1572
|
+
<td>${ee(t, u, i)}</td>
|
|
1573
|
+
<td>${this.sparkline(i, r, o)}</td>
|
|
1565
1574
|
</tr>
|
|
1566
1575
|
`;
|
|
1567
1576
|
}
|
|
1568
1577
|
}
|
|
1569
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings",
|
|
1570
|
-
const
|
|
1578
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", re);
|
|
1579
|
+
const ns = y`
|
|
1571
1580
|
.schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
|
|
1572
1581
|
.schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
|
|
1573
1582
|
.schoolhero .crest {
|
|
@@ -1621,10 +1630,10 @@ const Je = b`
|
|
|
1621
1630
|
table.data.roster .sub { display: block; font-weight: 400; font-size: 0.78rem; color: var(--hsot-gray-5); }
|
|
1622
1631
|
}
|
|
1623
1632
|
`;
|
|
1624
|
-
class
|
|
1625
|
-
static styles = [...
|
|
1633
|
+
class oe extends b {
|
|
1634
|
+
static styles = [...U, ns];
|
|
1626
1635
|
static properties = {
|
|
1627
|
-
...
|
|
1636
|
+
...b.properties,
|
|
1628
1637
|
schoolId: { type: String, attribute: "school-id" },
|
|
1629
1638
|
sport: { type: String },
|
|
1630
1639
|
season: { type: String },
|
|
@@ -1639,28 +1648,28 @@ class ee extends w {
|
|
|
1639
1648
|
t && !this.sport && (this.sport = t);
|
|
1640
1649
|
}
|
|
1641
1650
|
async fetchData(t) {
|
|
1642
|
-
const e = this.season ||
|
|
1643
|
-
|
|
1644
|
-
|
|
1651
|
+
const e = this.season || K(), s = await t.getSchool(this.schoolId), o = (await t.listTeams({ schoolId: this.schoolId })).items, n = o.find((g) => g.sport === (this.sport || "football")) || o[0] || null, [i, c, h, d, p, u, f] = await Promise.all([
|
|
1652
|
+
n ? t.listGames({ sport: n.sport, season: e }) : Promise.resolve({ items: [] }),
|
|
1653
|
+
n ? t.listTeams({ sport: n.sport }) : Promise.resolve({ items: [] }),
|
|
1645
1654
|
t.listSchools(),
|
|
1646
1655
|
t.listConferences(),
|
|
1647
|
-
|
|
1648
|
-
|
|
1656
|
+
n ? t.listRankings({ sport: n.sport }) : Promise.resolve({ items: [] }),
|
|
1657
|
+
n ? t.listRosters({ teamId: n.id }) : Promise.resolve({ items: [] }),
|
|
1649
1658
|
// teamId is the public surface's one players filter (roster
|
|
1650
1659
|
// membership) — never fetch the whole collection.
|
|
1651
|
-
|
|
1660
|
+
n ? t.listPlayers({ teamId: n.id }) : Promise.resolve({ items: [] })
|
|
1652
1661
|
]);
|
|
1653
1662
|
return {
|
|
1654
1663
|
season: e,
|
|
1655
1664
|
school: s,
|
|
1656
1665
|
teams: o,
|
|
1657
|
-
active:
|
|
1658
|
-
games:
|
|
1659
|
-
allTeams:
|
|
1660
|
-
schools:
|
|
1661
|
-
conferences:
|
|
1666
|
+
active: n,
|
|
1667
|
+
games: i.items,
|
|
1668
|
+
allTeams: c.items,
|
|
1669
|
+
schools: h.items,
|
|
1670
|
+
conferences: d.items,
|
|
1662
1671
|
rankings: p.items,
|
|
1663
|
-
roster: u.items.find((
|
|
1672
|
+
roster: u.items.find((g) => g.season === e) || null,
|
|
1664
1673
|
players: f.items
|
|
1665
1674
|
};
|
|
1666
1675
|
}
|
|
@@ -1668,9 +1677,9 @@ class ee extends w {
|
|
|
1668
1677
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
1669
1678
|
teamsById: $(this.data.allTeams.length ? this.data.allTeams : this.data.teams),
|
|
1670
1679
|
schoolsById: $(this.data.schools),
|
|
1671
|
-
records:
|
|
1680
|
+
records: Q(this.data.games),
|
|
1672
1681
|
rankings: this.data.rankings,
|
|
1673
|
-
hrefs:
|
|
1682
|
+
hrefs: O(this),
|
|
1674
1683
|
sport: this.data.active?.sport || "football"
|
|
1675
1684
|
}, this._ctxData = this.data), this._ctx;
|
|
1676
1685
|
}
|
|
@@ -1680,18 +1689,18 @@ class ee extends w {
|
|
|
1680
1689
|
renderView() {
|
|
1681
1690
|
const { school: t, teams: e, active: s, season: r } = this.data;
|
|
1682
1691
|
if (!t) return l`<div class="view"><p class="empty">School not found.</p></div>`;
|
|
1683
|
-
const o = this.ctx,
|
|
1692
|
+
const o = this.ctx, n = tt(t.colorPrimary || "#030711"), i = (t.adm || [])[0], c = $(this.data.conferences), h = s ? c[s.conferenceId] : null;
|
|
1684
1693
|
return l`
|
|
1685
|
-
<div class="schoolhero" style="background:linear-gradient(115deg, ${t.colorPrimary || "#030711"} 0%, ${t.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${
|
|
1694
|
+
<div class="schoolhero" style="background:linear-gradient(115deg, ${t.colorPrimary || "#030711"} 0%, ${t.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${n}">
|
|
1686
1695
|
<div class="inner">
|
|
1687
|
-
${
|
|
1696
|
+
${et(t, 84) ? l`<img class="crest logo" alt="" loading="lazy" src=${et(t, 84)} />` : l`<div class="crest" style="background:${t.colorSecondary || "#7C7C7C"};color:${tt(t.colorSecondary || "#7C7C7C")}">${$t(t)}</div>`}
|
|
1688
1697
|
<div style="min-width:260px">
|
|
1689
1698
|
<h1>${t.name} <span class="mascot">${t.mascot || ""}</span></h1>
|
|
1690
1699
|
<div class="facts">
|
|
1691
1700
|
${t.location ? l`<span><b>Location</b>${t.location}${t.county ? l` · ${t.county} County` : m}</span>` : m}
|
|
1692
1701
|
${t.association ? l`<span><b>League</b>${t.association}${t.classification ? l` · ${t.classification}` : m}</span>` : m}
|
|
1693
|
-
${
|
|
1694
|
-
${
|
|
1702
|
+
${h ? l`<span><b>Conference</b>${h.name}</span>` : m}
|
|
1703
|
+
${i ? l`<span><b>Enrollment</b>${i.value.toLocaleString()} (${i.season} ADM)</span>` : m}
|
|
1695
1704
|
${t.openingYear ? l`<span><b>Opened</b>${t.openingYear}</span>` : m}
|
|
1696
1705
|
${t.areaCode ? l`<span><b>Area</b>${t.areaCode}</span>` : m}
|
|
1697
1706
|
</div>
|
|
@@ -1700,30 +1709,30 @@ class ee extends w {
|
|
|
1700
1709
|
</div>
|
|
1701
1710
|
<div class="band">
|
|
1702
1711
|
<nav class="tabs" aria-label="Teams">
|
|
1703
|
-
${e.map((
|
|
1704
|
-
p.preventDefault(), this.switchSport(
|
|
1705
|
-
}}>${
|
|
1712
|
+
${e.map((d) => d.id === s?.id ? l`<a class="on" href="#" @click=${(p) => p.preventDefault()}>${d.name}</a>` : l`<a href="#" @click=${(p) => {
|
|
1713
|
+
p.preventDefault(), this.switchSport(d.sport);
|
|
1714
|
+
}}>${d.name}</a>`)}
|
|
1706
1715
|
</nav>
|
|
1707
1716
|
</div>
|
|
1708
|
-
${
|
|
1709
|
-
${
|
|
1710
|
-
${s ? this.renderTeam(o, s,
|
|
1717
|
+
${P(this, l`
|
|
1718
|
+
${B(this)}
|
|
1719
|
+
${s ? this.renderTeam(o, s, h, r) : l`<p class="empty">No teams recorded for this school yet.</p>`}
|
|
1711
1720
|
`)}
|
|
1712
1721
|
`;
|
|
1713
1722
|
}
|
|
1714
1723
|
renderTeam(t, e, s, r) {
|
|
1715
|
-
const o = t.records[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] },
|
|
1724
|
+
const o = t.records[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, n = o.w + o.l + o.t, i = s ? this.data.allTeams.filter((p) => p.conferenceId === s.id) : [], c = s ? Xt(i, t.records).findIndex((p) => p.team.id === e.id) + 1 : 0, h = yt(t.rankings, t.teamsById, e.id, e.sport, null), d = this.data.games.filter((p) => p.homeTeamId === e.id || p.awayTeamId === e.id).sort((p, u) => String(p.date).localeCompare(String(u.date)));
|
|
1716
1725
|
return l`
|
|
1717
1726
|
<div class="tiles">
|
|
1718
|
-
<div class="tile"><div class="k">Overall</div><div class="v">${k(o)}</div><div class="s">${
|
|
1727
|
+
<div class="tile"><div class="k">Overall</div><div class="v">${k(o)}</div><div class="s">${n} games played</div></div>
|
|
1719
1728
|
<div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${k(o, !0)}</div>
|
|
1720
|
-
<div class="s">${
|
|
1721
|
-
<div class="tile"><div class="k">Points</div><div class="v">${
|
|
1722
|
-
<div class="s">scored per game · ${
|
|
1723
|
-
<div class="tile"><div class="k">Streak</div><div class="v">${
|
|
1724
|
-
<div class="s">last 5: ${
|
|
1725
|
-
<div class="tile"><div class="k">HSOT Top 25</div><div class="v">${
|
|
1726
|
-
<div class="s"><a href=${
|
|
1729
|
+
<div class="s">${c ? `${Le(c)} of ${i.length}` : "·"}</div></div>
|
|
1730
|
+
<div class="tile"><div class="k">Points</div><div class="v">${n ? (o.pf / n).toFixed(1) : "0.0"}</div>
|
|
1731
|
+
<div class="s">scored per game · ${n ? (o.pa / n).toFixed(1) : "0.0"} allowed</div></div>
|
|
1732
|
+
<div class="tile"><div class="k">Streak</div><div class="v">${it(o.results) || "·"}</div>
|
|
1733
|
+
<div class="s">last 5: ${xt(t, e.id)}</div></div>
|
|
1734
|
+
<div class="tile"><div class="k">HSOT Top 25</div><div class="v">${h ? `#${h}` : "NR"}</div>
|
|
1735
|
+
<div class="s"><a href=${v(t.hrefs.section, { sport: e.sport, view: "rankings" })}>full poll</a></div></div>
|
|
1727
1736
|
</div>
|
|
1728
1737
|
${(e.championships || []).length ? l`
|
|
1729
1738
|
<div style="margin:-0.2rem 0 1rem;display:flex;gap:0.4rem;flex-wrap:wrap">
|
|
@@ -1733,7 +1742,7 @@ class ee extends w {
|
|
|
1733
1742
|
<div>
|
|
1734
1743
|
<div class="section-title">Schedule & results</div>
|
|
1735
1744
|
<div class="card">
|
|
1736
|
-
${
|
|
1745
|
+
${d.length ? l`<ul class="gamelist">${d.map((p) => this.renderGameRow(t, e, p))}</ul>` : l`<p class="empty">No ${e.sport} games recorded for ${r}.</p>`}
|
|
1737
1746
|
</div>
|
|
1738
1747
|
</div>
|
|
1739
1748
|
<div>
|
|
@@ -1744,24 +1753,24 @@ class ee extends w {
|
|
|
1744
1753
|
`;
|
|
1745
1754
|
}
|
|
1746
1755
|
renderGameRow(t, e, s) {
|
|
1747
|
-
const r = s.homeTeamId === e.id, o = r ? s.awayTeamId : s.homeTeamId,
|
|
1748
|
-
let
|
|
1756
|
+
const r = s.homeTeamId === e.id, o = r ? s.awayTeamId : s.homeTeamId, n = r ? s.homeScore : s.awayScore, i = r ? s.awayScore : s.homeScore;
|
|
1757
|
+
let c = l`<span class="mut">${gt(s.time)}</span>`;
|
|
1749
1758
|
if (s.state === "final") {
|
|
1750
|
-
const
|
|
1751
|
-
|
|
1752
|
-
} else s.state === "live" && (
|
|
1753
|
-
const
|
|
1759
|
+
const d = nt(s), p = d === "tie" ? "T" : d === (r ? "home" : "away") ? "W" : "L";
|
|
1760
|
+
c = l`<span class=${p}>${p}</span> ${n}-${i}${s.finish === "overtime" ? l` <span class="mut">OT</span>` : m}${s.forfeit && s.forfeit !== "none" ? l` <span class="mut">FF</span>` : m}`;
|
|
1761
|
+
} else s.state === "live" && (c = l`<span style="color:var(--hsot-red)">${n}-${i}</span>`);
|
|
1762
|
+
const h = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
|
|
1754
1763
|
return l`
|
|
1755
1764
|
<li>
|
|
1756
|
-
<span class="d">${
|
|
1757
|
-
${
|
|
1758
|
-
<span class="res">${
|
|
1759
|
-
<span class="opp">${r ? "vs" : "at"} ${
|
|
1760
|
-
<span class="pill type">${
|
|
1765
|
+
<span class="d">${w(s.date)}</span>
|
|
1766
|
+
${Zt(s).kind === "sched" ? m : V(s)}
|
|
1767
|
+
<span class="res">${c}</span>
|
|
1768
|
+
<span class="opp">${r ? "vs" : "at"} ${at(t, o, s.date)}
|
|
1769
|
+
<span class="pill type">${h}</span>
|
|
1761
1770
|
${s.broadcast ? l`<span class="pill class">${s.broadcast}</span>` : m}
|
|
1762
1771
|
</span>
|
|
1763
1772
|
<span class="where">${s.venue || ""}</span>
|
|
1764
|
-
<a class="box" href=${
|
|
1773
|
+
<a class="box" href=${v(t.hrefs.game, { sport: e.sport, id: s.id })}>Box score →</a>
|
|
1765
1774
|
</li>
|
|
1766
1775
|
`;
|
|
1767
1776
|
}
|
|
@@ -1769,25 +1778,25 @@ class ee extends w {
|
|
|
1769
1778
|
const s = this.data.roster;
|
|
1770
1779
|
if (!s)
|
|
1771
1780
|
return l`<p class="empty">Roster not published for ${e}.</p>`;
|
|
1772
|
-
const r =
|
|
1781
|
+
const r = rs(s, 560), o = this.data.school?.name || "", n = $(this.data.players), i = s.entries.slice().sort((h, d) => (h.number || 0) - (d.number || 0)), c = i.some((h) => n[h.playerId]?.college);
|
|
1773
1782
|
return l`
|
|
1774
1783
|
${r ? l`<img class="rosterphoto" src=${r} loading="lazy" decoding="async"
|
|
1775
1784
|
alt="${o} ${t.name} ${e} team photo" />` : m}
|
|
1776
1785
|
<div class="tablewrap"><table class="data roster">
|
|
1777
|
-
<thead><tr><th class="num">No.</th><th>Player</th><th class="pos">Pos</th><th class="cls">Class</th><th class="num">Ht</th><th class="num">Wt</th>${
|
|
1786
|
+
<thead><tr><th class="num">No.</th><th>Player</th><th class="pos">Pos</th><th class="cls">Class</th><th class="num">Ht</th><th class="num">Wt</th>${c ? l`<th>College</th>` : m}</tr></thead>
|
|
1778
1787
|
<tbody>
|
|
1779
|
-
${
|
|
1780
|
-
const
|
|
1781
|
-
if (!
|
|
1782
|
-
const p =
|
|
1788
|
+
${i.map((h) => {
|
|
1789
|
+
const d = n[h.playerId];
|
|
1790
|
+
if (!d) return m;
|
|
1791
|
+
const p = Ue(h), u = [p, d.classOf].filter(Boolean).join(" · ") || "·";
|
|
1783
1792
|
return l`<tr>
|
|
1784
|
-
<td class="num mut">${
|
|
1785
|
-
<td class="player" style="font-weight:500">${
|
|
1793
|
+
<td class="num mut">${h.number ?? "·"}</td>
|
|
1794
|
+
<td class="player" style="font-weight:500">${d.firstName} ${d.lastName}<span class="sub">${u}</span></td>
|
|
1786
1795
|
<td class="pos">${p || "·"}</td>
|
|
1787
|
-
<td class="cls mut">${
|
|
1788
|
-
<td class="num">${
|
|
1789
|
-
<td class="num">${
|
|
1790
|
-
${
|
|
1796
|
+
<td class="cls mut">${d.classOf || "·"}</td>
|
|
1797
|
+
<td class="num">${Oe(d.heightIn)}</td>
|
|
1798
|
+
<td class="num">${d.weightLb || "·"}</td>
|
|
1799
|
+
${c ? l`<td class="college">${d.college || "·"}</td>` : m}
|
|
1791
1800
|
</tr>`;
|
|
1792
1801
|
})}
|
|
1793
1802
|
</tbody>
|
|
@@ -1795,8 +1804,8 @@ class ee extends w {
|
|
|
1795
1804
|
`;
|
|
1796
1805
|
}
|
|
1797
1806
|
}
|
|
1798
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school",
|
|
1799
|
-
const
|
|
1807
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", oe);
|
|
1808
|
+
const ne = {
|
|
1800
1809
|
football: ["quarters", 4],
|
|
1801
1810
|
flag_football: ["quarters", 4],
|
|
1802
1811
|
basketball: ["quarters", 4],
|
|
@@ -1807,57 +1816,57 @@ const se = {
|
|
|
1807
1816
|
softball: ["innings", 7],
|
|
1808
1817
|
volleyball: ["sets", 3]
|
|
1809
1818
|
};
|
|
1810
|
-
function
|
|
1811
|
-
return (
|
|
1819
|
+
function ie(a) {
|
|
1820
|
+
return (ne[a] || ["quarters", 4])[0];
|
|
1812
1821
|
}
|
|
1813
|
-
function
|
|
1814
|
-
return (
|
|
1822
|
+
function kt(a) {
|
|
1823
|
+
return (ne[a] || ["quarters", 4])[1];
|
|
1815
1824
|
}
|
|
1816
|
-
function
|
|
1817
|
-
const e =
|
|
1825
|
+
function is(a, t) {
|
|
1826
|
+
const e = ie(a), s = kt(a);
|
|
1818
1827
|
if (t <= s || e === "innings" || e === "sets") return String(t);
|
|
1819
1828
|
const r = t - s;
|
|
1820
1829
|
return `OT${r > 1 ? r : ""}`;
|
|
1821
1830
|
}
|
|
1822
|
-
function
|
|
1831
|
+
function ls(a, t) {
|
|
1823
1832
|
const e = String(a ?? "").trim();
|
|
1824
1833
|
let s;
|
|
1825
|
-
return (s = /^(\d+)Q$/i.exec(e)) || (s = /^(\d+)H$/i.exec(e)) ? Number(s[1]) : /^half$/i.test(e) ?
|
|
1834
|
+
return (s = /^(\d+)Q$/i.exec(e)) || (s = /^(\d+)H$/i.exec(e)) ? Number(s[1]) : /^half$/i.test(e) ? ie(t) === "halves" ? 1 : 2 : (s = /^(\d*)OT(\d*)$/i.exec(e)) ? kt(t) + Number(s[1] || s[2] || 1) : (s = /^[TB](\d+)$/i.exec(e)) || (s = /^(\d+)(?:st|nd|rd|th)\s*set$/i.exec(e)) || (s = /^set\s*(\d+)$/i.exec(e)) ? Number(s[1]) : null;
|
|
1826
1835
|
}
|
|
1827
|
-
const
|
|
1828
|
-
function
|
|
1836
|
+
const Z = (a) => Number.isInteger(a) && a >= 0 ? a : null;
|
|
1837
|
+
function cs(a) {
|
|
1829
1838
|
const t = Array.isArray(a?.scoringPlays) ? a.scoringPlays : [];
|
|
1830
1839
|
if (!t.length) return null;
|
|
1831
1840
|
const e = a.sport, s = /* @__PURE__ */ new Map();
|
|
1832
1841
|
for (const p of t) {
|
|
1833
|
-
const u =
|
|
1834
|
-
if (!u || f === null ||
|
|
1842
|
+
const u = ls(p?.period, e), f = Z(p?.homeScore), g = Z(p?.awayScore);
|
|
1843
|
+
if (!u || f === null || g === null) return null;
|
|
1835
1844
|
const x = s.get(u) || { home: 0, away: 0 };
|
|
1836
|
-
x.home = Math.max(x.home, f), x.away = Math.max(x.away,
|
|
1845
|
+
x.home = Math.max(x.home, f), x.away = Math.max(x.away, g), s.set(u, x);
|
|
1837
1846
|
}
|
|
1838
1847
|
const r = Math.max(...s.keys()), o = [];
|
|
1839
|
-
let
|
|
1848
|
+
let n = !0, i = { home: 0, away: 0 };
|
|
1840
1849
|
for (let p = 1; p <= r; p += 1) {
|
|
1841
|
-
const u = s.get(p) ||
|
|
1842
|
-
(f < 0 ||
|
|
1850
|
+
const u = s.get(p) || i, f = u.home - i.home, g = u.away - i.away;
|
|
1851
|
+
(f < 0 || g < 0) && (n = !1), o.push({ period: p, home: Math.max(f, 0), away: Math.max(g, 0) }), i = { home: Math.max(u.home, i.home), away: Math.max(u.away, i.away) };
|
|
1843
1852
|
}
|
|
1844
|
-
const
|
|
1845
|
-
return
|
|
1853
|
+
const c = Z(a.homeScore) ?? 0, h = Z(a.awayScore) ?? 0, d = n && i.home === c && i.away === h;
|
|
1854
|
+
return n = n && i.home <= c && i.away <= h, { periods: o, reconciled: d, consistent: n };
|
|
1846
1855
|
}
|
|
1847
|
-
function
|
|
1856
|
+
function hs(a) {
|
|
1848
1857
|
if (Array.isArray(a?.periodScores) && a.periodScores.length) return a.periodScores;
|
|
1849
|
-
const t =
|
|
1858
|
+
const t = cs(a);
|
|
1850
1859
|
return t ? a.state === "final" ? t.reconciled ? t.periods : null : t.consistent ? t.periods : null : null;
|
|
1851
1860
|
}
|
|
1852
|
-
const
|
|
1853
|
-
function
|
|
1861
|
+
const ds = "https://api.wral.com/search";
|
|
1862
|
+
function ps(a) {
|
|
1854
1863
|
return a.map((t) => `uri:"${t}"`).join(" OR ");
|
|
1855
1864
|
}
|
|
1856
|
-
function
|
|
1857
|
-
const e = String(a ||
|
|
1865
|
+
function ms(a, t) {
|
|
1866
|
+
const e = String(a || ds).replace(/\/+$/, ""), s = new URLSearchParams({ query: ps(t), sort: "score", lang: "en" });
|
|
1858
1867
|
return `${e}/v1/query?${s}`;
|
|
1859
1868
|
}
|
|
1860
|
-
function
|
|
1869
|
+
function le(a) {
|
|
1861
1870
|
try {
|
|
1862
1871
|
const t = new URL(a);
|
|
1863
1872
|
if (/(^|\.)smugmug\.com$/i.test(t.hostname)) {
|
|
@@ -1872,13 +1881,13 @@ function re(a) {
|
|
|
1872
1881
|
}
|
|
1873
1882
|
return { uri: a, title: a };
|
|
1874
1883
|
}
|
|
1875
|
-
async function
|
|
1876
|
-
const r = await ((...
|
|
1884
|
+
async function us(a, t, e) {
|
|
1885
|
+
const r = await ((...i) => fetch(...i))(ms(a, t));
|
|
1877
1886
|
if (!r.ok) throw new Error(`search answered ${r.status}`);
|
|
1878
|
-
const o = await r.json(),
|
|
1879
|
-
return t.map((
|
|
1887
|
+
const o = await r.json(), n = new Map((o.items || []).map((i) => [i.uri, i]));
|
|
1888
|
+
return t.map((i) => n.get(i) || le(i));
|
|
1880
1889
|
}
|
|
1881
|
-
const
|
|
1890
|
+
const fs = y`
|
|
1882
1891
|
.breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
|
|
1883
1892
|
.breadcrumbs a { text-decoration: none; }
|
|
1884
1893
|
.scorehead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 1.4rem 1rem; }
|
|
@@ -1921,6 +1930,9 @@ const ns = b`
|
|
|
1921
1930
|
table.plays-table td.play { white-space: normal; min-width: 12rem; }
|
|
1922
1931
|
/* Game notes are typed with line breaks the desk means to keep. */
|
|
1923
1932
|
.gamenote { padding: 0 1rem 0.9rem; text-align: center; white-space: pre-line; }
|
|
1933
|
+
/* The embed's way out to everything it drops (Coverage, season context,
|
|
1934
|
+
head to head) — the data page still renders all of it. */
|
|
1935
|
+
.fullbox { margin: 0.9rem 0 0; text-align: center; font-size: 0.875rem; }
|
|
1924
1936
|
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
|
|
1925
1937
|
.ctxcard { padding: 0.85rem 1rem; }
|
|
1926
1938
|
.ctxcard .who { font-family: var(--hsot-heading-font); font-weight: 700; margin-bottom: 0.4rem; }
|
|
@@ -1931,22 +1943,28 @@ const ns = b`
|
|
|
1931
1943
|
.cols { grid-template-columns: 1fr; }
|
|
1932
1944
|
}
|
|
1933
1945
|
`;
|
|
1934
|
-
class
|
|
1935
|
-
static styles = [...
|
|
1946
|
+
class ce extends b {
|
|
1947
|
+
static styles = [...U, fs];
|
|
1936
1948
|
static properties = {
|
|
1937
|
-
...
|
|
1949
|
+
...b.properties,
|
|
1938
1950
|
gameId: { type: String, attribute: "game-id" },
|
|
1939
1951
|
// The public site search that resolves Game.coverageUrls into cards
|
|
1940
1952
|
// (DEV-1236). Shared cross-stage by design — see the studio host's
|
|
1941
1953
|
// registry — so the prod default is right everywhere; the attribute
|
|
1942
1954
|
// exists for the same reason the href templates do.
|
|
1943
|
-
searchApi: { type: String, attribute: "search-api" }
|
|
1955
|
+
searchApi: { type: String, attribute: "search-api" },
|
|
1956
|
+
// Story pages embed the box score in the article column, where the page
|
|
1957
|
+
// chrome (breadcrumbs, the report-a-score line) and the cross-links
|
|
1958
|
+
// (Coverage, Season context, head-to-head) belong to the data page, not
|
|
1959
|
+
// the recap. `embed` keeps the score head, line score and scoring plays,
|
|
1960
|
+
// and links out to the full box score for the rest.
|
|
1961
|
+
embed: { type: Boolean }
|
|
1944
1962
|
};
|
|
1945
1963
|
constructor() {
|
|
1946
|
-
super(), this.gameId = "", this.searchApi = "";
|
|
1964
|
+
super(), this.gameId = "", this.searchApi = "", this.embed = !1;
|
|
1947
1965
|
}
|
|
1948
1966
|
async fetchData(t) {
|
|
1949
|
-
const e = await t.getGame(this.gameId), s = Array.isArray(e.coverageUrls) ? e.coverageUrls : [], [r, o,
|
|
1967
|
+
const e = await t.getGame(this.gameId), s = Array.isArray(e.coverageUrls) ? e.coverageUrls : [], [r, o, n, i, c, h] = await Promise.all([
|
|
1950
1968
|
t.listSchools(),
|
|
1951
1969
|
t.listTeams({ sport: e.sport }),
|
|
1952
1970
|
t.listConferences(),
|
|
@@ -1954,57 +1972,64 @@ class oe extends w {
|
|
|
1954
1972
|
t.listGames({ sport: e.sport, season: e.season }),
|
|
1955
1973
|
// A search outage must not blank the box score — degrade to bare
|
|
1956
1974
|
// links (fetchCoverage already degrades per-URL index misses).
|
|
1957
|
-
|
|
1975
|
+
// The embed drops the Coverage grid, so it skips the search
|
|
1976
|
+
// round-trip entirely rather than fetching cards it will not render.
|
|
1977
|
+
s.length && !this.embed ? us(this.searchApi, s).catch(() => s.map(le)) : Promise.resolve([])
|
|
1958
1978
|
]);
|
|
1959
1979
|
return {
|
|
1960
1980
|
game: e,
|
|
1961
1981
|
schools: r.items,
|
|
1962
1982
|
teams: o.items,
|
|
1963
|
-
conferences:
|
|
1964
|
-
rankings:
|
|
1965
|
-
games:
|
|
1966
|
-
coverage:
|
|
1983
|
+
conferences: n.items,
|
|
1984
|
+
rankings: i.items,
|
|
1985
|
+
games: c.items,
|
|
1986
|
+
coverage: h
|
|
1967
1987
|
};
|
|
1968
1988
|
}
|
|
1969
1989
|
get ctx() {
|
|
1970
1990
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
1971
1991
|
teamsById: $(this.data.teams),
|
|
1972
1992
|
schoolsById: $(this.data.schools),
|
|
1973
|
-
records:
|
|
1993
|
+
records: Q(this.data.games),
|
|
1974
1994
|
rankings: this.data.rankings,
|
|
1975
|
-
hrefs:
|
|
1995
|
+
hrefs: O(this),
|
|
1976
1996
|
sport: this.data.game.sport
|
|
1977
1997
|
}, this._ctxData = this.data), this._ctx;
|
|
1978
1998
|
}
|
|
1979
1999
|
renderView() {
|
|
1980
2000
|
const t = this.data.game;
|
|
1981
2001
|
if (!t) return l`<div class="view"><p class="empty">Game not found.</p></div>`;
|
|
1982
|
-
const e = this.ctx, s = $(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,
|
|
2002
|
+
const e = this.ctx, s = $(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, n = nt(t), i = (d) => t.state === "final" && n !== d && n !== "tie" ? "opacity:0.45" : "", c = t.conferenceId ? s[t.conferenceId] : null, h = 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));
|
|
1983
2003
|
return l`
|
|
1984
|
-
${
|
|
1985
|
-
${
|
|
1986
|
-
|
|
1987
|
-
<
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
2004
|
+
${P(this, l`
|
|
2005
|
+
${B(this)}
|
|
2006
|
+
${this.embed ? m : l`
|
|
2007
|
+
<p class="breadcrumbs">
|
|
2008
|
+
<a href=${v(e.hrefs.section, { sport: t.sport, view: "scores" })}>${D(t.sport)}</a> /
|
|
2009
|
+
<a href=${v(e.hrefs.section, { sport: t.sport, view: "scores" })}>Scores/Schedules</a> /
|
|
2010
|
+
${R(e, t.awayTeamId)} at ${R(e, t.homeTeamId)}
|
|
2011
|
+
</p>`}
|
|
1991
2012
|
<div class="card">
|
|
1992
2013
|
<div class="scorehead">
|
|
1993
2014
|
${this.teamBlock(e, t, t.awayTeamId, r, !1)}
|
|
1994
2015
|
<div class="mid">
|
|
1995
2016
|
<div class="bigscore">
|
|
1996
|
-
<span style=${
|
|
2017
|
+
<span style=${i("away")}>${t.awayScore}</span>
|
|
1997
2018
|
<span class="mut" style="font-size:1.6rem">–</span>
|
|
1998
|
-
<span style=${
|
|
2019
|
+
<span style=${i("home")}>${t.homeScore}</span>
|
|
1999
2020
|
</div>
|
|
2000
|
-
<div class="status">${
|
|
2001
|
-
<div class="status">${
|
|
2021
|
+
<div class="status">${V(t)}</div>
|
|
2022
|
+
<div class="status">${w(t.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${t.state === "scheduled" && t.time ? l` · ${gt(t.time)}` : m} · ${t.venue || "Venue TBD"}
|
|
2002
2023
|
${t.broadcast ? l` · <span class="pill class">${t.broadcast}</span>` : m}</div>
|
|
2003
2024
|
<div class="status">
|
|
2004
|
-
<span class="pill type">${t.gameType === "conference" ? `${
|
|
2025
|
+
<span class="pill type">${t.gameType === "conference" ? `${c?.name || "Conference"} game` : t.gameType}</span>
|
|
2005
2026
|
${t.label ? l`<span class="pill type">Bracket ${t.label}</span>` : m}
|
|
2006
|
-
${(t.tags || []).map((
|
|
2027
|
+
${(t.tags || []).map((d) => l`<span class="pill type">${d}</span>`)}
|
|
2007
2028
|
</div>
|
|
2029
|
+
${this.embed ? m : l`
|
|
2030
|
+
<div class="status">
|
|
2031
|
+
<a href=${Qt(e.hrefs, t.id)}>Report a score for this game</a>
|
|
2032
|
+
</div>`}
|
|
2008
2033
|
</div>
|
|
2009
2034
|
${this.teamBlock(e, t, t.homeTeamId, o, !0)}
|
|
2010
2035
|
</div>
|
|
@@ -2012,17 +2037,21 @@ class oe extends w {
|
|
|
2012
2037
|
${this.renderScoringPlays(t, r, o)}
|
|
2013
2038
|
${t.notes ? l`<p class="note gamenote">${t.notes}</p>` : m}
|
|
2014
2039
|
</div>
|
|
2040
|
+
${this.embed ? l`
|
|
2041
|
+
<p class="fullbox">
|
|
2042
|
+
<a href=${v(e.hrefs.game, { sport: t.sport, id: t.id })}>Full box score →</a>
|
|
2043
|
+
</p>` : l`
|
|
2015
2044
|
${(this.data.coverage || []).length ? l`
|
|
2016
2045
|
<div class="section-title">Coverage</div>
|
|
2017
2046
|
<div class="covgrid">
|
|
2018
|
-
${this.data.coverage.map((
|
|
2019
|
-
<a class="card covcard" href=${
|
|
2020
|
-
${
|
|
2047
|
+
${this.data.coverage.map((d) => l`
|
|
2048
|
+
<a class="card covcard" href=${d.uri}>
|
|
2049
|
+
${d.image ? l`<img class="covimg" src=${d.image} alt="" loading="lazy" />` : m}
|
|
2021
2050
|
<div class="covbody">
|
|
2022
|
-
<div class="covtitle">${
|
|
2023
|
-
${
|
|
2024
|
-
${
|
|
2025
|
-
<div class="covmeta">${[
|
|
2051
|
+
<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>
|
|
2052
|
+
${d.description ? l`<p class="covdesc">${d.description}</p>` : m}
|
|
2053
|
+
${d.author || d.publishedTime ? l`
|
|
2054
|
+
<div class="covmeta">${[d.author, d.publishedTime ? new Date(d.publishedTime).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : ""].filter(Boolean).join(" · ")}</div>
|
|
2026
2055
|
` : m}
|
|
2027
2056
|
</div>
|
|
2028
2057
|
</a>
|
|
@@ -2030,53 +2059,53 @@ class oe extends w {
|
|
|
2030
2059
|
</div>` : m}
|
|
2031
2060
|
<div class="section-title">Season context</div>
|
|
2032
2061
|
<div class="cols">
|
|
2033
|
-
${[[t.awayTeamId, r], [t.homeTeamId, o]].map(([
|
|
2062
|
+
${[[t.awayTeamId, r], [t.homeTeamId, o]].map(([d, p]) => this.renderContext(e, d, p))}
|
|
2034
2063
|
</div>
|
|
2035
|
-
${
|
|
2064
|
+
${h.length ? l`
|
|
2036
2065
|
<div class="section-title">Head to head this season</div>
|
|
2037
2066
|
<div class="card"><ul class="gamelist">
|
|
2038
|
-
${
|
|
2039
|
-
<span class="d">${
|
|
2040
|
-
<span class="opp">${
|
|
2041
|
-
<a class="box" href=${
|
|
2067
|
+
${h.map((d) => l`<li>
|
|
2068
|
+
<span class="d">${w(d.date)}</span>${V(d)}
|
|
2069
|
+
<span class="opp">${R(e, d.awayTeamId)} ${d.awayScore}, ${R(e, d.homeTeamId)} ${d.homeScore}</span>
|
|
2070
|
+
<a class="box" href=${v(e.hrefs.game, { sport: t.sport, id: d.id })}>Box score →</a>
|
|
2042
2071
|
</li>`)}
|
|
2043
|
-
</ul></div>` : m}
|
|
2072
|
+
</ul></div>` : m}`}
|
|
2044
2073
|
`)}
|
|
2045
2074
|
`;
|
|
2046
2075
|
}
|
|
2047
2076
|
teamBlock(t, e, s, r, o) {
|
|
2048
2077
|
if (!r) return l`<div class="teamblock ${o ? "right" : ""}"><div class="tname">TBD</div></div>`;
|
|
2049
|
-
const
|
|
2078
|
+
const n = t.teamsById[s], i = t.records[s], c = et(r, 58);
|
|
2050
2079
|
return l`
|
|
2051
2080
|
<div class="teamblock ${o ? "right" : ""}">
|
|
2052
|
-
${
|
|
2081
|
+
${c ? l`<img class="crest logo" alt="" loading="lazy" src=${c} />` : l`<span class="crest" style="background:${r.colorPrimary || "#030711"};color:${tt(r.colorPrimary || "#030711")}">${$t(r)}</span>`}
|
|
2053
2082
|
<div>
|
|
2054
|
-
<div class="tname">${
|
|
2055
|
-
<div class="trec">${r.mascot || ""} · ${k(
|
|
2083
|
+
<div class="tname">${wt(t, s, e.date)}<a href=${v(t.hrefs.school, { id: r.id })}>${r.name}</a></div>
|
|
2084
|
+
<div class="trec">${r.mascot || ""} · ${k(i)}${n?.conferenceId ? l` · ${k(i, !0)} conf` : m}</div>
|
|
2056
2085
|
</div>
|
|
2057
2086
|
</div>
|
|
2058
2087
|
`;
|
|
2059
2088
|
}
|
|
2060
2089
|
renderLineScore(t, e, s) {
|
|
2061
|
-
const r =
|
|
2090
|
+
const r = hs(t);
|
|
2062
2091
|
if (!r)
|
|
2063
2092
|
return t.state === "scheduled" ? l`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>` : m;
|
|
2064
|
-
const o = Math.max(
|
|
2065
|
-
const p = r.find((u) => u.period ===
|
|
2066
|
-
return p ? p[
|
|
2067
|
-
},
|
|
2093
|
+
const o = Math.max(kt(t.sport), ...r.map((h) => h.period)), n = (h) => is(t.sport, h), i = (h, d) => {
|
|
2094
|
+
const p = r.find((u) => u.period === d);
|
|
2095
|
+
return p ? p[h] : t.state === "final" ? 0 : "·";
|
|
2096
|
+
}, c = (h, d, p) => l`
|
|
2068
2097
|
<tr>
|
|
2069
|
-
<td class="teamcell">${
|
|
2070
|
-
${Array.from({ length: o }, (u, f) => l`<td class="num">${
|
|
2098
|
+
<td class="teamcell">${E(h, 20)}${h?.abbr || "TBD"}</td>
|
|
2099
|
+
${Array.from({ length: o }, (u, f) => l`<td class="num">${i(d, f + 1)}</td>`)}
|
|
2071
2100
|
<td class="num" style="font-weight:700">${p}</td>
|
|
2072
2101
|
</tr>`;
|
|
2073
2102
|
return l`
|
|
2074
2103
|
<div class="tablewrap" style="border-top:1px solid var(--hsot-gray-2)">
|
|
2075
2104
|
<table class="data" style="max-width:560px;margin:0.6rem auto 0.9rem">
|
|
2076
|
-
<thead><tr><th>Team</th>${Array.from({ length: o }, (
|
|
2105
|
+
<thead><tr><th>Team</th>${Array.from({ length: o }, (h, d) => l`<th class="num">${n(d + 1)}</th>`)}<th class="num">T</th></tr></thead>
|
|
2077
2106
|
<tbody>
|
|
2078
|
-
${
|
|
2079
|
-
${
|
|
2107
|
+
${c(e, "away", t.awayScore)}
|
|
2108
|
+
${c(s, "home", t.homeScore)}
|
|
2080
2109
|
</tbody>
|
|
2081
2110
|
</table>
|
|
2082
2111
|
</div>
|
|
@@ -2085,7 +2114,7 @@ class oe extends w {
|
|
|
2085
2114
|
renderScoringPlays(t, e, s) {
|
|
2086
2115
|
const r = Array.isArray(t.scoringPlays) ? t.scoringPlays : [];
|
|
2087
2116
|
if (!r.length) return m;
|
|
2088
|
-
const o = (
|
|
2117
|
+
const o = (n) => [n.period, n.clock].filter(Boolean).join(" ");
|
|
2089
2118
|
return l`
|
|
2090
2119
|
<div class="plays">
|
|
2091
2120
|
<div class="plays-title">Scoring plays</div>
|
|
@@ -2096,11 +2125,11 @@ class oe extends w {
|
|
|
2096
2125
|
<th class="num">${e?.abbr || "Away"}</th><th class="num">${s?.abbr || "Home"}</th>
|
|
2097
2126
|
</tr></thead>
|
|
2098
2127
|
<tbody>
|
|
2099
|
-
${r.map((
|
|
2100
|
-
<td class="when">${o(
|
|
2101
|
-
<td class="play">${
|
|
2102
|
-
<td class="num">${
|
|
2103
|
-
<td class="num">${
|
|
2128
|
+
${r.map((n) => l`<tr>
|
|
2129
|
+
<td class="when">${o(n) || "·"}</td>
|
|
2130
|
+
<td class="play">${n.description || "·"}</td>
|
|
2131
|
+
<td class="num">${n.awayScore}</td>
|
|
2132
|
+
<td class="num">${n.homeScore}</td>
|
|
2104
2133
|
</tr>`)}
|
|
2105
2134
|
</tbody>
|
|
2106
2135
|
</table>
|
|
@@ -2110,24 +2139,24 @@ class oe extends w {
|
|
|
2110
2139
|
}
|
|
2111
2140
|
renderContext(t, e, s) {
|
|
2112
2141
|
if (!s) return m;
|
|
2113
|
-
const r = t.records[e], o =
|
|
2142
|
+
const r = t.records[e], o = bt(this.data.games, e);
|
|
2114
2143
|
return l`
|
|
2115
2144
|
<div class="card ctxcard">
|
|
2116
|
-
<div class="who">${
|
|
2145
|
+
<div class="who">${E(s)}${s.name}</div>
|
|
2117
2146
|
<div class="row">
|
|
2118
|
-
<span>Last 5: ${
|
|
2119
|
-
<span>Streak: <b>${r ?
|
|
2147
|
+
<span>Last 5: ${xt(t, e)}</span>
|
|
2148
|
+
<span>Streak: <b>${r ? it(r.results) : "·"}</b></span>
|
|
2120
2149
|
<span>PF/PA: <b>${r ? `${r.pf} / ${r.pa}` : "·"}</b></span>
|
|
2121
|
-
<span>Next: ${o ? l`${
|
|
2122
|
-
${o.homeTeamId === e ? "vs" : "at"} ${
|
|
2150
|
+
<span>Next: ${o ? l`${w(o.date, { month: "numeric", day: "numeric" })}
|
|
2151
|
+
${o.homeTeamId === e ? "vs" : "at"} ${st(t, o.homeTeamId === e ? o.awayTeamId : o.homeTeamId)}` : "·"}</span>
|
|
2123
2152
|
</div>
|
|
2124
2153
|
</div>
|
|
2125
2154
|
`;
|
|
2126
2155
|
}
|
|
2127
2156
|
}
|
|
2128
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore",
|
|
2129
|
-
const
|
|
2130
|
-
class
|
|
2157
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", ce);
|
|
2158
|
+
const gs = 250, vs = 2;
|
|
2159
|
+
class he extends N {
|
|
2131
2160
|
static properties = {
|
|
2132
2161
|
api: { type: String },
|
|
2133
2162
|
schoolHref: { type: String, attribute: "school-href" },
|
|
@@ -2138,7 +2167,7 @@ class ie extends P {
|
|
|
2138
2167
|
activeIndex: { state: !0 },
|
|
2139
2168
|
searched: { state: !0 }
|
|
2140
2169
|
};
|
|
2141
|
-
static styles =
|
|
2170
|
+
static styles = y`
|
|
2142
2171
|
:host {
|
|
2143
2172
|
display: block;
|
|
2144
2173
|
position: relative;
|
|
@@ -2207,11 +2236,11 @@ class ie extends P {
|
|
|
2207
2236
|
}
|
|
2208
2237
|
onInput(t) {
|
|
2209
2238
|
const e = t.target.value.trim();
|
|
2210
|
-
if (clearTimeout(this.debounceTimer), e.length <
|
|
2239
|
+
if (clearTimeout(this.debounceTimer), e.length < vs) {
|
|
2211
2240
|
this.abortController?.abort(), this.results = [], this.open = !1, this.searched = !1;
|
|
2212
2241
|
return;
|
|
2213
2242
|
}
|
|
2214
|
-
this.debounceTimer = setTimeout(() => this.search(e),
|
|
2243
|
+
this.debounceTimer = setTimeout(() => this.search(e), gs);
|
|
2215
2244
|
}
|
|
2216
2245
|
async search(t) {
|
|
2217
2246
|
this.abortController?.abort(), this.abortController = new AbortController();
|
|
@@ -2304,22 +2333,302 @@ class ie extends P {
|
|
|
2304
2333
|
`;
|
|
2305
2334
|
}
|
|
2306
2335
|
}
|
|
2307
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search",
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
"
|
|
2313
|
-
|
|
2314
|
-
|
|
2336
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search", he);
|
|
2337
|
+
function de(a, t) {
|
|
2338
|
+
const e = new Map(a.map((c) => [c.id, c])), s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
2339
|
+
for (const c of t || [])
|
|
2340
|
+
c.outcome === "winner" && (s.has(c.targetGameId) || s.set(c.targetGameId, []), s.get(c.targetGameId).push(c), r.has(c.sourceGameId) || r.set(c.sourceGameId, []), r.get(c.sourceGameId).push(c));
|
|
2341
|
+
const o = a.filter((c) => !r.has(c.id)), n = (c) => c.targetSlot === "home" ? 0 : 1;
|
|
2342
|
+
function i(c) {
|
|
2343
|
+
const h = e.get(c);
|
|
2344
|
+
if (!h) return null;
|
|
2345
|
+
const p = [...s.get(c) || []].sort((u, f) => n(u) - n(f)).map((u) => i(u.sourceGameId)).filter(Boolean);
|
|
2346
|
+
return { game: h, children: p, bracketGroup: h.bracketGroup };
|
|
2347
|
+
}
|
|
2348
|
+
return o.length === 1 ? i(o[0].id) : o.map((c) => i(c.id));
|
|
2349
|
+
}
|
|
2350
|
+
function pe(a, t = [], e = 0) {
|
|
2351
|
+
if (!a) return t;
|
|
2352
|
+
t[e] || (t[e] = []), t[e].push(a.game);
|
|
2353
|
+
for (const s of a.children || []) pe(s, t, e + 1);
|
|
2354
|
+
return t;
|
|
2355
|
+
}
|
|
2356
|
+
const $s = (a) => Math.max(1, Math.round(Math.log2(a || 2)));
|
|
2357
|
+
function bs({ round: a, perGroup: t, groupCount: e = 1 }) {
|
|
2358
|
+
const s = $s(t), o = (e === 4 ? s + 2 : e === 2 ? s + 1 : s) - a;
|
|
2359
|
+
return o === 0 ? e > 1 ? "Championship" : "Final" : o === 1 ? "Semifinal" : `Round ${a}`;
|
|
2360
|
+
}
|
|
2361
|
+
function ys(a) {
|
|
2362
|
+
if (!a || !a.length) return "setup";
|
|
2363
|
+
const t = Math.max(...a.map((s) => s.round ?? 0)), e = a.filter((s) => (s.round ?? 0) === t);
|
|
2364
|
+
return e.length && e.every((s) => s.state === "final") ? "complete" : a.some((s) => s.state !== "scheduled" || s.homeScore || s.awayScore || s.round === 1 && (s.homeTeamId || s.awayTeamId)) ? "active" : "setup";
|
|
2365
|
+
}
|
|
2366
|
+
function ws(a, t) {
|
|
2367
|
+
const e = a?.groupNames || [];
|
|
2368
|
+
if (e.length >= 2) {
|
|
2369
|
+
const r = e.map((o) => ({ key: o, name: o }));
|
|
2370
|
+
return (t || []).some((o) => o.bracketGroup === "Championship") && r.push({ key: "Championship", name: "Championship" }), r;
|
|
2371
|
+
}
|
|
2372
|
+
const s = [...new Set((t || []).map((r) => r.bracketGroup).filter(Boolean))];
|
|
2373
|
+
return [{ key: null, name: s.length === 1 ? s[0] : "Bracket" }];
|
|
2374
|
+
}
|
|
2375
|
+
const xs = (a, t) => t?.key == null ? [...a || []] : (a || []).filter((e) => e.bracketGroup === t.key), Ut = (a) => {
|
|
2376
|
+
const t = /(\d+)\s*$/.exec(a.label || "");
|
|
2377
|
+
return t ? Number(t[1]) : 1 / 0;
|
|
2378
|
+
}, Ht = (a, t) => Ut(a) - Ut(t) || String(a.id).localeCompare(String(t.id));
|
|
2379
|
+
function ks(a, t) {
|
|
2380
|
+
if (a.every((r) => Number.isInteger(r.round))) return (r) => r.round;
|
|
2381
|
+
const e = de(a, t), s = /* @__PURE__ */ new Map();
|
|
2382
|
+
for (const r of Array.isArray(e) ? e : [e]) {
|
|
2383
|
+
const o = pe(r), n = o.length - 1;
|
|
2384
|
+
o.forEach((i, c) => i.forEach((h) => s.set(h.id, n - c + 1)));
|
|
2385
|
+
}
|
|
2386
|
+
return (r) => Number.isInteger(r.round) ? r.round : s.get(r.id) || 1;
|
|
2387
|
+
}
|
|
2388
|
+
function Ss(a, t, e) {
|
|
2389
|
+
const s = xs(a, e);
|
|
2390
|
+
if (!s.length) return [];
|
|
2391
|
+
const r = ks(a || [], t || []), o = /* @__PURE__ */ new Map();
|
|
2392
|
+
for (const h of s) {
|
|
2393
|
+
const d = r(h);
|
|
2394
|
+
o.has(d) || o.set(d, []), o.get(d).push(h);
|
|
2395
|
+
}
|
|
2396
|
+
const n = /* @__PURE__ */ new Map();
|
|
2397
|
+
for (const h of t || [])
|
|
2398
|
+
h.outcome === "winner" && (n.has(h.targetGameId) || n.set(h.targetGameId, []), n.get(h.targetGameId).push(h.sourceGameId));
|
|
2399
|
+
const i = [];
|
|
2400
|
+
let c = null;
|
|
2401
|
+
for (const h of [...o.keys()].sort((d, p) => d - p)) {
|
|
2402
|
+
let d = [...o.get(h)];
|
|
2403
|
+
if (c) {
|
|
2404
|
+
const p = (u) => {
|
|
2405
|
+
const f = (n.get(u.id) || []).map((g) => c.get(g)).filter((g) => g !== void 0);
|
|
2406
|
+
return f.length ? Math.min(...f) : 1 / 0;
|
|
2407
|
+
};
|
|
2408
|
+
d.sort((u, f) => p(u) - p(f) || Ht(u, f));
|
|
2409
|
+
} else
|
|
2410
|
+
d.sort(Ht);
|
|
2411
|
+
c = new Map(d.map((p, u) => [p.id, u])), i.push({ round: h, games: d });
|
|
2412
|
+
}
|
|
2413
|
+
return i;
|
|
2414
|
+
}
|
|
2415
|
+
function _s(a, t, e) {
|
|
2416
|
+
const s = a[`${t}TeamId`] || null, r = (e || []).find((n) => n.gameId === a.id && n.slot === t), o = a[`${t}Seed`] ?? r?.seed ?? null;
|
|
2417
|
+
return { teamId: s, seed: o, bye: !s && !!r?.isBye };
|
|
2418
|
+
}
|
|
2419
|
+
function me(a) {
|
|
2420
|
+
const t = nt(a);
|
|
2421
|
+
return t === "home" || t === "away" ? t : null;
|
|
2422
|
+
}
|
|
2423
|
+
function As(a, t) {
|
|
2424
|
+
const e = de(a || [], t || []);
|
|
2425
|
+
if (!e || Array.isArray(e)) return null;
|
|
2426
|
+
const s = me(e.game);
|
|
2427
|
+
return s && e.game[`${s}TeamId`] || null;
|
|
2428
|
+
}
|
|
2429
|
+
const Lt = { active: 0, setup: 1, complete: 2 };
|
|
2430
|
+
function Ts(a, { id: t, param: e } = {}) {
|
|
2431
|
+
const s = a || [];
|
|
2432
|
+
if (!s.length) return null;
|
|
2433
|
+
for (const r of [t, e]) {
|
|
2434
|
+
if (!r) continue;
|
|
2435
|
+
const o = s.find((n) => n.id === r);
|
|
2436
|
+
if (o) return o;
|
|
2437
|
+
}
|
|
2438
|
+
return [...s].sort((r, o) => (Lt[r.status] ?? 3) - (Lt[o.status] ?? 3) || String(r.name || "").localeCompare(String(o.name || "")))[0];
|
|
2439
|
+
}
|
|
2440
|
+
const Is = y`
|
|
2441
|
+
.bracket { display: flex; gap: 1rem; align-items: stretch; overflow-x: auto; padding-bottom: 0.5rem; }
|
|
2442
|
+
.round { flex: 0 0 250px; display: flex; flex-direction: column; min-width: 0; }
|
|
2443
|
+
.roundhead {
|
|
2444
|
+
margin: 0 0 0.6rem; padding-bottom: 0.35rem; border-bottom: 3px solid var(--hsot-gray-2);
|
|
2445
|
+
font-family: var(--hsot-heading-font); font-weight: 700; font-size: 0.8rem;
|
|
2446
|
+
text-transform: uppercase; letter-spacing: 0.04em; color: var(--hsot-gray-6);
|
|
2447
|
+
}
|
|
2448
|
+
/* Equal-flex bands center each matchup between the two that feed it. */
|
|
2449
|
+
.games { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 0.6rem; }
|
|
2450
|
+
.matchup {
|
|
2451
|
+
background: var(--hsot-white); border: 1px solid var(--hsot-gray-2);
|
|
2452
|
+
border-radius: var(--hsot-radius-md); overflow: hidden;
|
|
2453
|
+
}
|
|
2454
|
+
.matchup.live { border-color: var(--hsot-red); }
|
|
2455
|
+
.slot { display: flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.6rem; font-size: 0.9rem; min-height: 2.1rem; box-sizing: border-box; }
|
|
2456
|
+
.slot + .slot { border-top: 1px solid var(--hsot-gray-2); }
|
|
2457
|
+
.slot .seed {
|
|
2458
|
+
flex: none; width: 1.3rem; text-align: right; font-family: var(--hsot-heading-font);
|
|
2459
|
+
font-size: 0.75rem; color: var(--hsot-gray-5); font-variant-numeric: tabular-nums;
|
|
2460
|
+
}
|
|
2461
|
+
.slot .swatch { margin-right: 0; }
|
|
2462
|
+
.slot .tname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2463
|
+
.slot .tname a { color: inherit; text-decoration: none; font-weight: 500; }
|
|
2464
|
+
.slot .tname a:hover { text-decoration: underline; }
|
|
2465
|
+
.slot .tname.bye { font-style: italic; color: var(--hsot-gray-5); }
|
|
2466
|
+
.slot .score {
|
|
2467
|
+
flex: none; min-width: 1.6rem; text-align: right; font-family: var(--hsot-heading-font);
|
|
2468
|
+
font-weight: 700; font-variant-numeric: tabular-nums;
|
|
2469
|
+
}
|
|
2470
|
+
.slot.winner .tname a, .slot.winner .tname { font-weight: 700; }
|
|
2471
|
+
.slot.winner .score { color: var(--hsot-red-deep); }
|
|
2472
|
+
.slot.loser { color: var(--hsot-gray-5); }
|
|
2473
|
+
.mfoot {
|
|
2474
|
+
display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.6rem;
|
|
2475
|
+
background: var(--hsot-gray-1); border-top: 1px solid var(--hsot-gray-2); font-size: 0.75rem;
|
|
2476
|
+
}
|
|
2477
|
+
.mfoot .spacer { flex: 1; }
|
|
2478
|
+
.mfoot .label { color: var(--hsot-gray-5); font-family: var(--hsot-heading-font); }
|
|
2479
|
+
.champ {
|
|
2480
|
+
display: flex; align-items: center; gap: 0.5rem; margin: 0 0 1rem;
|
|
2481
|
+
font-family: var(--hsot-heading-font); font-size: 1.05rem;
|
|
2482
|
+
}
|
|
2483
|
+
.champ .tname a { color: inherit; text-decoration: none; font-weight: 700; }
|
|
2484
|
+
@media (max-width: 720px) { .round { flex-basis: 215px; } }
|
|
2485
|
+
`;
|
|
2486
|
+
class ue extends b {
|
|
2487
|
+
static styles = [U, Is];
|
|
2488
|
+
static properties = {
|
|
2489
|
+
...b.properties,
|
|
2490
|
+
sport: { type: String },
|
|
2491
|
+
season: { type: String },
|
|
2492
|
+
tournamentId: { type: String, attribute: "tournament-id" },
|
|
2493
|
+
picked: { state: !0 },
|
|
2494
|
+
group: { state: !0 }
|
|
2495
|
+
};
|
|
2496
|
+
constructor() {
|
|
2497
|
+
super(), this.sport = "football", this.season = "", this.tournamentId = "", this.picked = "", this.group = null;
|
|
2498
|
+
}
|
|
2499
|
+
async fetchData(t) {
|
|
2500
|
+
const e = this.season || K(), s = (await t.listTournaments({ sport: this.sport, season: e })).items, r = new URLSearchParams(globalThis.location?.search || "").get("tournament"), o = Ts(s, { id: this.picked || this.tournamentId, param: r });
|
|
2501
|
+
if (!o) return { season: e, tournaments: s, tournament: null };
|
|
2502
|
+
const [n, i, c, h, d] = await Promise.all([
|
|
2503
|
+
t.listSeedings(o.id),
|
|
2504
|
+
t.listEdges(o.id),
|
|
2505
|
+
t.listGames({ tournamentId: o.id }),
|
|
2506
|
+
t.listSchools(),
|
|
2507
|
+
t.listTeams({ sport: this.sport })
|
|
2508
|
+
]);
|
|
2509
|
+
return {
|
|
2510
|
+
season: e,
|
|
2511
|
+
tournaments: s,
|
|
2512
|
+
tournament: o,
|
|
2513
|
+
seedings: n.items,
|
|
2514
|
+
edges: i.items,
|
|
2515
|
+
games: c.items,
|
|
2516
|
+
schools: h.items,
|
|
2517
|
+
teams: d.items
|
|
2518
|
+
};
|
|
2519
|
+
}
|
|
2520
|
+
get ctx() {
|
|
2521
|
+
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
2522
|
+
teamsById: $(this.data.teams),
|
|
2523
|
+
schoolsById: $(this.data.schools),
|
|
2524
|
+
records: {},
|
|
2525
|
+
rankings: [],
|
|
2526
|
+
hrefs: O(this),
|
|
2527
|
+
sport: this.sport
|
|
2528
|
+
}, this._ctxData = this.data), this._ctx;
|
|
2529
|
+
}
|
|
2530
|
+
/** Switch tournaments: remember the pick, deep-link it, reload the scoped data. */
|
|
2531
|
+
pick(t) {
|
|
2532
|
+
if (t !== this.data?.tournament?.id) {
|
|
2533
|
+
this.picked = t, this.group = null;
|
|
2534
|
+
try {
|
|
2535
|
+
const e = new URL(globalThis.location.href);
|
|
2536
|
+
e.searchParams.set("tournament", t), globalThis.history?.replaceState(null, "", e);
|
|
2537
|
+
} catch {
|
|
2538
|
+
}
|
|
2539
|
+
this.load();
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
renderView() {
|
|
2543
|
+
const t = this.data, e = this.ctx, s = lt(this, e, {
|
|
2544
|
+
title: l`${D(this.sport)} playoff brackets`,
|
|
2545
|
+
sub: t.tournament ? l`${t.tournament.name} · ${t.season} season` : l`${t.season} season`,
|
|
2546
|
+
teams: t.teams
|
|
2547
|
+
});
|
|
2548
|
+
if (!t.tournament)
|
|
2549
|
+
return l`${s}${P(this, l`
|
|
2550
|
+
${B(this)}
|
|
2551
|
+
<div class="card"><div class="empty">No ${this.sport} brackets have been published for the ${t.season} season yet.</div></div>
|
|
2552
|
+
`)}`;
|
|
2553
|
+
const r = ws(t.tournament, t.games), o = r.find((p) => p.key === this.group) || r[0], n = (t.tournament.groupNames || []).length >= 2 ? t.tournament.groupNames.length : 1, i = (Number(t.tournament.size) || 0) / n, c = Ss(t.games, t.edges, o), h = ys(t.games), d = As(t.games, t.edges);
|
|
2554
|
+
return l`
|
|
2555
|
+
${s}
|
|
2556
|
+
${P(this, l`
|
|
2557
|
+
${B(this)}
|
|
2558
|
+
<div class="toolbar">
|
|
2559
|
+
${t.tournaments.length > 1 ? l`
|
|
2560
|
+
<div role="group" aria-label="Tournament">
|
|
2561
|
+
${t.tournaments.map((p) => l`<button class="chip ${p.id === t.tournament.id ? "on" : ""}"
|
|
2562
|
+
@click=${() => this.pick(p.id)}>${p.name}</button>`)}
|
|
2563
|
+
</div>` : m}
|
|
2564
|
+
${r.length > 1 ? l`
|
|
2565
|
+
<div role="tablist" aria-label="Bracket group">
|
|
2566
|
+
${r.map((p) => l`<button class="chip ${p.key === o.key ? "on" : ""}" role="tab"
|
|
2567
|
+
aria-selected=${p.key === o.key ? "true" : "false"}
|
|
2568
|
+
@click=${() => {
|
|
2569
|
+
this.group = p.key;
|
|
2570
|
+
}}>${p.name}</button>`)}
|
|
2571
|
+
</div>` : m}
|
|
2572
|
+
<span class="spacer"></span>
|
|
2573
|
+
<span class="pill ${h === "complete" ? "final" : h === "active" ? "class" : "type"}">${h === "complete" ? "Complete" : h === "active" ? "In progress" : "Bracket set"}</span>
|
|
2574
|
+
<span class="asof">${t.tournament.size}-team ${String(t.tournament.format || "").replace(/_/g, " ")}</span>
|
|
2575
|
+
</div>
|
|
2576
|
+
${d ? l`<div class="champ"><span class="pill champ">Champion</span>
|
|
2577
|
+
${E(C(e, d), 26)}<span class="tname">${at(e, d)}</span></div>` : m}
|
|
2578
|
+
${c.length ? l`
|
|
2579
|
+
<div class="bracket" role="region" aria-label="${o.name} bracket">
|
|
2580
|
+
${c.map((p) => l`
|
|
2581
|
+
<section class="round">
|
|
2582
|
+
<h3 class="roundhead">${bs({ round: p.round, perGroup: i, groupCount: n })}</h3>
|
|
2583
|
+
<div class="games">${p.games.map((u) => this.renderMatchup(e, u))}</div>
|
|
2584
|
+
</section>`)}
|
|
2585
|
+
</div>` : l`<div class="card"><div class="empty">This bracket has no games yet.</div></div>`}
|
|
2586
|
+
`)}
|
|
2587
|
+
`;
|
|
2588
|
+
}
|
|
2589
|
+
renderMatchup(t, e) {
|
|
2590
|
+
const s = e.homeTeamId && e.awayTeamId || e.state === "final" || e.state === "live";
|
|
2591
|
+
return l`
|
|
2592
|
+
<article class="matchup ${e.state}" aria-label="${e.label || "Matchup"}">
|
|
2593
|
+
${this.renderSlot(t, e, "home")}
|
|
2594
|
+
${this.renderSlot(t, e, "away")}
|
|
2595
|
+
<footer class="mfoot">
|
|
2596
|
+
${V(e)}
|
|
2597
|
+
${e.label ? l`<span class="label">${e.label}</span>` : m}
|
|
2598
|
+
<span class="spacer"></span>
|
|
2599
|
+
${s ? l`<a class="box" href=${v(t.hrefs.game, { sport: this.sport, id: e.id })}>Box score</a>` : m}
|
|
2600
|
+
</footer>
|
|
2601
|
+
</article>
|
|
2602
|
+
`;
|
|
2603
|
+
}
|
|
2604
|
+
renderSlot(t, e, s) {
|
|
2605
|
+
const { teamId: r, seed: o, bye: n } = _s(e, s, this.data.seedings), i = me(e), c = e.state === "live" || e.state === "final";
|
|
2606
|
+
return l`
|
|
2607
|
+
<div class="slot ${i ? i === s ? "winner" : "loser" : ""}">
|
|
2608
|
+
<span class="seed">${o ?? ""}</span>
|
|
2609
|
+
${r ? l`${E(C(t, r), 22)}<span class="tname">${at(t, r, e.date)}</span>` : n ? l`<span class="tname bye">Bye</span>` : l`<span class="tname mut">TBD</span>`}
|
|
2610
|
+
${c ? l`<span class="score">${e[`${s}Score`] ?? 0}</span>` : m}
|
|
2611
|
+
</div>
|
|
2612
|
+
`;
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-brackets") && globalThis.customElements.define("hsot-brackets", ue);
|
|
2616
|
+
const Cs = {
|
|
2617
|
+
"hsot-scores": se,
|
|
2618
|
+
"hsot-standings": ae,
|
|
2619
|
+
"hsot-rankings": re,
|
|
2620
|
+
"hsot-school": oe,
|
|
2621
|
+
"hsot-boxscore": ce,
|
|
2622
|
+
"hsot-school-search": he,
|
|
2623
|
+
"hsot-brackets": ue
|
|
2315
2624
|
};
|
|
2316
|
-
function
|
|
2625
|
+
function Es() {
|
|
2317
2626
|
const a = globalThis?.customElements;
|
|
2318
2627
|
if (a)
|
|
2319
|
-
for (const [t, e] of Object.entries(
|
|
2628
|
+
for (const [t, e] of Object.entries(Cs))
|
|
2320
2629
|
a.get(t) || a.define(t, e);
|
|
2321
2630
|
}
|
|
2322
|
-
typeof window < "u" && globalThis.customElements &&
|
|
2631
|
+
typeof window < "u" && globalThis.customElements && Es();
|
|
2323
2632
|
export {
|
|
2324
|
-
|
|
2633
|
+
Es as defineAll
|
|
2325
2634
|
};
|