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