@wral/hsot-data 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const V = globalThis, nt = V.ShadowRoot && (V.ShadyCSS === void 0 || V.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, lt = /* @__PURE__ */ Symbol(), wt = /* @__PURE__ */ new WeakMap();
|
|
2
|
-
let
|
|
2
|
+
let Nt = class {
|
|
3
3
|
constructor(t, e, s) {
|
|
4
4
|
if (this._$cssResult$ = !0, s !== lt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
5
|
this.cssText = t, this.t = e;
|
|
@@ -17,53 +17,53 @@ let Ft = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
21
|
-
const e =
|
|
20
|
+
const re = (r) => new Nt(typeof r == "string" ? r : r + "", void 0, lt), 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
|
-
}, ae = (
|
|
28
|
-
if (nt)
|
|
25
|
+
})(a) + r[o + 1], r[0]);
|
|
26
|
+
return new Nt(e, r, lt);
|
|
27
|
+
}, ae = (r, t) => {
|
|
28
|
+
if (nt) 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
|
-
}, xt = nt ? (
|
|
33
|
+
}, xt = nt ? (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 re(e);
|
|
37
|
+
})(r) : r;
|
|
38
|
+
const { is: oe, defineProperty: ie, getOwnPropertyDescriptor: ne, getOwnPropertyNames: le, getOwnPropertySymbols: ce, getPrototypeOf: he } = Object, X = globalThis, kt = X.trustedTypes, de = kt ? kt.emptyScript : "", pe = X.reactiveElementPolyfillSupport, B = (r, t) => r, it = { toAttribute(r, t) {
|
|
39
39
|
switch (t) {
|
|
40
40
|
case Boolean:
|
|
41
|
-
|
|
41
|
+
r = r ? de : 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
|
-
} },
|
|
66
|
+
} }, Ut = (r, t) => !oe(r, t), _t = { attribute: !0, type: String, converter: it, reflect: !1, useDefault: !1, hasChanged: Ut };
|
|
67
67
|
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), X.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
68
|
let I = class extends HTMLElement {
|
|
69
69
|
static addInitializer(t) {
|
|
@@ -74,18 +74,18 @@ let I = class extends HTMLElement {
|
|
|
74
74
|
}
|
|
75
75
|
static createProperty(t, e = _t) {
|
|
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 && ie(this.prototype, t, a);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
static getPropertyDescriptor(t, e, s) {
|
|
82
|
-
const { get:
|
|
82
|
+
const { get: a, set: o } = ne(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
|
}
|
|
@@ -94,24 +94,24 @@ let I = class extends HTMLElement {
|
|
|
94
94
|
}
|
|
95
95
|
static _$Ei() {
|
|
96
96
|
if (this.hasOwnProperty(B("elementProperties"))) return;
|
|
97
|
-
const t =
|
|
97
|
+
const t = he(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
101
|
if (this.hasOwnProperty(B("finalized"))) return;
|
|
102
102
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(B("properties"))) {
|
|
103
|
-
const e = this.properties, s = [...
|
|
104
|
-
for (const
|
|
103
|
+
const e = this.properties, s = [...le(e), ...ce(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,7 +119,7 @@ let I = 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
|
|
122
|
+
for (const a of s) e.unshift(xt(a));
|
|
123
123
|
} else t !== void 0 && e.push(xt(t));
|
|
124
124
|
return e;
|
|
125
125
|
}
|
|
@@ -160,31 +160,31 @@ let I = 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 (
|
|
163
|
+
const s = this.constructor.elementProperties.get(t), a = this.constructor._$Eu(t, s);
|
|
164
|
+
if (a !== void 0 && s.reflect === !0) {
|
|
165
165
|
const o = (s.converter?.toAttribute !== void 0 ? s.converter : it).toAttribute(e, s.type);
|
|
166
|
-
this._$Em = t, o == null ? this.removeAttribute(
|
|
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 : it;
|
|
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 ?? Ut)(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 I = 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,54 +246,54 @@ let I = class extends HTMLElement {
|
|
|
246
246
|
firstUpdated(t) {
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[B("elementProperties")] = /* @__PURE__ */ new Map(), I[B("finalized")] = /* @__PURE__ */ new Map(),
|
|
250
|
-
const ct = globalThis, St = (
|
|
251
|
-
\f\r]`, R = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Tt = /-->/g, It = />/g, S = RegExp(`>|${
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ct = /'/g, Et = /"/g,
|
|
253
|
-
function
|
|
254
|
-
if (!ht(
|
|
249
|
+
I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[B("elementProperties")] = /* @__PURE__ */ new Map(), I[B("finalized")] = /* @__PURE__ */ new Map(), pe?.({ ReactiveElement: I }), (X.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
+
const ct = globalThis, St = (r) => r, Y = ct.trustedTypes, At = Y ? Y.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Ot = "$lit$", k = `lit$${Math.random().toFixed(9).slice(2)}$`, Ht = "?" + k, me = `<${Ht}>`, T = document, F = () => T.createComment(""), N = (r) => r === null || typeof r != "object" && typeof r != "function", ht = Array.isArray, fe = (r) => ht(r) || typeof r?.[Symbol.iterator] == "function", at = `[
|
|
251
|
+
\f\r]`, R = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Tt = /-->/g, It = />/g, S = RegExp(`>|${at}(?:([^\\s"'>=/]+)(${at}*=${at}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ct = /'/g, Et = /"/g, Mt = /^(?:script|style|textarea|title)$/i, Lt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), c = Lt(1), Pt = Lt(2), P = /* @__PURE__ */ Symbol.for("lit-noChange"), m = /* @__PURE__ */ Symbol.for("lit-nothing"), Dt = /* @__PURE__ */ new WeakMap(), A = T.createTreeWalker(T, 129);
|
|
253
|
+
function jt(r, t) {
|
|
254
|
+
if (!ht(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
255
|
return At !== void 0 ? At.createHTML(t) : t;
|
|
256
256
|
}
|
|
257
|
-
const
|
|
258
|
-
const e =
|
|
259
|
-
let
|
|
257
|
+
const ue = (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 d =
|
|
261
|
+
const d = r[n];
|
|
262
262
|
let l, 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 = Tt : h[1] !== void 0 ? i = It : h[2] !== void 0 ? (
|
|
264
|
-
const u = i === S &&
|
|
265
|
-
o += i === R ? d +
|
|
263
|
+
for (; f < d.length && (i.lastIndex = f, h = i.exec(d), h !== null); ) f = i.lastIndex, i === R ? h[1] === "!--" ? i = Tt : h[1] !== void 0 ? i = It : 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, l = h[1], i = h[3] === void 0 ? S : h[3] === '"' ? Et : Ct) : i === Et || i === Ct ? i = S : i === Tt || i === It ? i = R : (i = S, a = void 0);
|
|
264
|
+
const u = i === S && r[n + 1].startsWith("/>") ? " " : "";
|
|
265
|
+
o += i === R ? d + me : p >= 0 ? (s.push(l), d.slice(0, p) + Ot + 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
269
|
class U {
|
|
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, d = this.parts, [l, h] =
|
|
274
|
+
const n = t.length - 1, d = this.parts, [l, h] = ue(t, e);
|
|
275
275
|
if (this.el = U.createElement(l, s), A.currentNode = this.el.content, e === 2 || e === 3) {
|
|
276
276
|
const p = this.el.content.firstChild;
|
|
277
277
|
p.replaceWith(...p.childNodes);
|
|
278
278
|
}
|
|
279
|
-
for (; (
|
|
280
|
-
if (
|
|
281
|
-
if (
|
|
282
|
-
const f = h[i++], u =
|
|
283
|
-
d.push({ type: 1, index: o, name: $[2], strings: u, ctor: $[1] === "." ?
|
|
284
|
-
} else p.startsWith(k) && (d.push({ type: 6, index: o }),
|
|
285
|
-
if (
|
|
286
|
-
const p =
|
|
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(Ot)) {
|
|
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] === "." ? ve : $[1] === "?" ? $e : $[1] === "@" ? be : 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
295
|
let p = -1;
|
|
296
|
-
for (; (p =
|
|
296
|
+
for (; (p = a.data.indexOf(k, p + 1)) !== -1; ) d.push({ type: 7, index: o }), p += k.length - 1;
|
|
297
297
|
}
|
|
298
298
|
o++;
|
|
299
299
|
}
|
|
@@ -303,13 +303,13 @@ class U {
|
|
|
303
303
|
return s.innerHTML = t, s;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
function D(
|
|
306
|
+
function D(r, t, e = r, s) {
|
|
307
307
|
if (t === P) return t;
|
|
308
|
-
let
|
|
308
|
+
let a = s !== void 0 ? e._$Co?.[s] : e._$Cl;
|
|
309
309
|
const o = N(t) ? void 0 : t._$litDirective$;
|
|
310
|
-
return
|
|
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 = D(r, a._$AS(r, t.values), a, s)), t;
|
|
311
311
|
}
|
|
312
|
-
class
|
|
312
|
+
class ge {
|
|
313
313
|
constructor(t, e) {
|
|
314
314
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
315
315
|
}
|
|
@@ -320,17 +320,17 @@ class ue {
|
|
|
320
320
|
return this._$AM._$AU;
|
|
321
321
|
}
|
|
322
322
|
u(t) {
|
|
323
|
-
const { el: { content: e }, parts: s } = this._$AD,
|
|
324
|
-
A.currentNode =
|
|
323
|
+
const { el: { content: e }, parts: s } = this._$AD, a = (t?.creationScope ?? T).importNode(e, !0);
|
|
324
|
+
A.currentNode = a;
|
|
325
325
|
let o = A.nextNode(), i = 0, n = 0, d = s[0];
|
|
326
326
|
for (; d !== void 0; ) {
|
|
327
327
|
if (i === d.index) {
|
|
328
328
|
let l;
|
|
329
|
-
d.type === 2 ? l = new M(o, o.nextSibling, this, t) : d.type === 1 ? l = new d.ctor(o, d.name, d.strings, this, t) : d.type === 6 && (l = new
|
|
329
|
+
d.type === 2 ? l = new M(o, o.nextSibling, this, t) : d.type === 1 ? l = new d.ctor(o, d.name, d.strings, this, t) : d.type === 6 && (l = new ye(o, this, t)), this._$AV.push(l), d = s[++n];
|
|
330
330
|
}
|
|
331
331
|
i !== d?.index && (o = A.nextNode(), i++);
|
|
332
332
|
}
|
|
333
|
-
return A.currentNode = T,
|
|
333
|
+
return A.currentNode = T, a;
|
|
334
334
|
}
|
|
335
335
|
p(t) {
|
|
336
336
|
let e = 0;
|
|
@@ -341,8 +341,8 @@ class M {
|
|
|
341
341
|
get _$AU() {
|
|
342
342
|
return this._$AM?._$AU ?? this._$Cv;
|
|
343
343
|
}
|
|
344
|
-
constructor(t, e, s,
|
|
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 M {
|
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
358
|
_$AI(t, e = this) {
|
|
359
|
-
t = D(this, t, e), N(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== P && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) :
|
|
359
|
+
t = D(this, t, e), N(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== P && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : fe(t) ? this.k(t) : this._(t);
|
|
360
360
|
}
|
|
361
361
|
O(t) {
|
|
362
362
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -368,10 +368,10 @@ class M {
|
|
|
368
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 = U.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 ge(a, this), i = o.u(this.options);
|
|
375
375
|
o.p(e), this.T(i), this._$AH = o;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
@@ -382,9 +382,9 @@ class M {
|
|
|
382
382
|
k(t) {
|
|
383
383
|
ht(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; ) {
|
|
@@ -403,10 +403,10 @@ class tt {
|
|
|
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
412
|
if (o === void 0) t = D(this, t, e, 0), i = !N(t) || t !== this._$AH && t !== P, i && (this._$AH = t);
|
|
@@ -415,13 +415,13 @@ class tt {
|
|
|
415
415
|
let d, l;
|
|
416
416
|
for (t = o[0], d = 0; d < o.length - 1; d++) l = D(this, n[s + d], e, d), l === P && (l = this._$AH[d]), i ||= !N(l) || l !== this._$AH[d], l === m ? t = m : t !== m && (t += (l ?? "") + o[d + 1]), this._$AH[d] = l;
|
|
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 ve extends tt {
|
|
425
425
|
constructor() {
|
|
426
426
|
super(...arguments), this.type = 3;
|
|
427
427
|
}
|
|
@@ -429,7 +429,7 @@ class ge extends tt {
|
|
|
429
429
|
this.element[this.name] = t === m ? void 0 : t;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class $e extends tt {
|
|
433
433
|
constructor() {
|
|
434
434
|
super(...arguments), this.type = 4;
|
|
435
435
|
}
|
|
@@ -437,20 +437,20 @@ class ve extends tt {
|
|
|
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 be 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
445
|
if ((t = D(this, t, e, 0) ?? m) === P) return;
|
|
446
|
-
const s = this._$AH,
|
|
447
|
-
|
|
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 ye {
|
|
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
|
}
|
|
@@ -461,16 +461,16 @@ class be {
|
|
|
461
461
|
D(this, t);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
const
|
|
464
|
+
const we = ct.litHtmlPolyfillSupport;
|
|
465
|
+
we?.(U, M), (ct.litHtmlVersions ??= []).push("3.3.3");
|
|
466
|
+
const xe = (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
475
|
const dt = globalThis;
|
|
476
476
|
class E extends I {
|
|
@@ -483,7 +483,7 @@ class E extends I {
|
|
|
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 = xe(e, this.renderRoot, this.renderOptions);
|
|
487
487
|
}
|
|
488
488
|
connectedCallback() {
|
|
489
489
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -496,23 +496,23 @@ class E extends I {
|
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
E._$litElement$ = !0, E.finalized = !0, dt.litElementHydrateSupport?.({ LitElement: E });
|
|
499
|
-
const
|
|
500
|
-
|
|
499
|
+
const ke = dt.litElementPolyfillSupport;
|
|
500
|
+
ke?.({ LitElement: E });
|
|
501
501
|
(dt.litElementVersions ??= []).push("4.2.2");
|
|
502
|
-
const
|
|
503
|
-
function
|
|
504
|
-
const t = Object.entries(
|
|
502
|
+
const _e = 50;
|
|
503
|
+
function Se(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 Ae({ 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
513
|
const d = { Accept: "application/json" };
|
|
514
514
|
t && (d.Authorization = `Bearer ${t}`);
|
|
515
|
-
const l = await
|
|
515
|
+
const l = await a(`${s}${n}`, { headers: d });
|
|
516
516
|
if (!l.ok) {
|
|
517
517
|
const h = new Error(`api-hsot ${l.status} on ${n}`);
|
|
518
518
|
throw h.status = l.status, h;
|
|
@@ -522,8 +522,8 @@ function Se({ baseUrl: a, token: t = "", fetchFn: e } = {}) {
|
|
|
522
522
|
async function i(n, d = {}) {
|
|
523
523
|
const l = [];
|
|
524
524
|
let h = null;
|
|
525
|
-
for (let p = 0; p <
|
|
526
|
-
const f =
|
|
525
|
+
for (let p = 0; p < _e; p += 1) {
|
|
526
|
+
const f = Se(h ? { ...d, cursor: h } : d), u = await o(`${n}${f}`);
|
|
527
527
|
if (l.push(...u.items || []), h = u.nextCursor || null, !h) break;
|
|
528
528
|
}
|
|
529
529
|
return { items: l, total: l.length, nextCursor: null };
|
|
@@ -549,109 +549,120 @@ const ot = {
|
|
|
549
549
|
school: "/school/{id}/",
|
|
550
550
|
section: "/{sport}/{view}/"
|
|
551
551
|
};
|
|
552
|
-
function g(
|
|
553
|
-
return String(
|
|
552
|
+
function g(r, t) {
|
|
553
|
+
return String(r).replace(/\{(\w+)\}/g, (e, s) => t[s] !== void 0 && t[s] !== null ? String(t[s]) : e);
|
|
554
554
|
}
|
|
555
|
-
function L(
|
|
555
|
+
function L(r) {
|
|
556
556
|
return {
|
|
557
|
-
game:
|
|
558
|
-
school:
|
|
559
|
-
section:
|
|
557
|
+
game: r.getAttribute("game-href") || ot.game,
|
|
558
|
+
school: r.getAttribute("school-href") || ot.school,
|
|
559
|
+
section: r.getAttribute("section-href") || ot.section
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
|
-
const z = (
|
|
563
|
-
function y(
|
|
564
|
-
if (!
|
|
565
|
-
const [e, s,
|
|
566
|
-
return !e || !s || !
|
|
562
|
+
const z = (r) => r ? r.charAt(0).toUpperCase() + r.slice(1) : "";
|
|
563
|
+
function y(r, t) {
|
|
564
|
+
if (!r) return "TBD";
|
|
565
|
+
const [e, s, a] = String(r).split("-").map(Number);
|
|
566
|
+
return !e || !s || !a ? "TBD" : new Date(e, s - 1, a).toLocaleDateString("en-US", t || { weekday: "short", month: "short", day: "numeric" });
|
|
567
567
|
}
|
|
568
|
-
function pt(
|
|
569
|
-
if (!
|
|
570
|
-
const [t, e] = String(
|
|
568
|
+
function pt(r) {
|
|
569
|
+
if (!r) return "";
|
|
570
|
+
const [t, e] = String(r).split(":").map(Number);
|
|
571
571
|
if (Number.isNaN(t)) return "";
|
|
572
572
|
const s = t >= 12 ? "PM" : "AM";
|
|
573
573
|
return `${(t + 11) % 12 + 1}:${String(e || 0).padStart(2, "0")} ${s}`;
|
|
574
574
|
}
|
|
575
|
-
function
|
|
576
|
-
return
|
|
575
|
+
function Te(r) {
|
|
576
|
+
return r ? `${Math.floor(r / 12)}-${r % 12}` : "·";
|
|
577
577
|
}
|
|
578
|
-
function et(
|
|
579
|
-
const t =
|
|
580
|
-
return
|
|
578
|
+
function et(r = /* @__PURE__ */ new Date()) {
|
|
579
|
+
const t = r.getFullYear();
|
|
580
|
+
return r.getMonth() >= 6 ? `${t}-${t + 1}` : `${t - 1}-${t}`;
|
|
581
581
|
}
|
|
582
|
-
function mt(
|
|
582
|
+
function mt(r = /* @__PURE__ */ new Date()) {
|
|
583
583
|
const t = (e) => String(e).padStart(2, "0");
|
|
584
|
-
return `${
|
|
584
|
+
return `${r.getFullYear()}-${t(r.getMonth() + 1)}-${t(r.getDate())}`;
|
|
585
585
|
}
|
|
586
|
-
function
|
|
587
|
-
const e = [...new Set((
|
|
586
|
+
function Ie(r, t = mt()) {
|
|
587
|
+
const e = [...new Set((r || []).filter(Boolean))].sort();
|
|
588
588
|
if (!e.length || e.includes(t)) return t;
|
|
589
|
-
const s = e.filter((
|
|
589
|
+
const s = e.filter((a) => a < t);
|
|
590
590
|
return s.length ? s[s.length - 1] : e[0];
|
|
591
591
|
}
|
|
592
|
-
function ft(
|
|
593
|
-
return
|
|
592
|
+
function ft(r) {
|
|
593
|
+
return r ? (r.abbr || r.name || "?").slice(0, 4).toUpperCase() : "?";
|
|
594
594
|
}
|
|
595
|
-
function K(
|
|
596
|
-
if (!
|
|
597
|
-
const t = parseInt(
|
|
598
|
-
return 0.299 * e + 0.587 * s + 0.114 *
|
|
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
599
|
}
|
|
600
|
-
const
|
|
601
|
-
const t = ["th", "st", "nd", "rd"], e =
|
|
602
|
-
return
|
|
600
|
+
const Ce = (r) => {
|
|
601
|
+
const t = ["th", "st", "nd", "rd"], e = r % 100;
|
|
602
|
+
return r + (t[(e - 20) % 10] || t[e] || t[0]);
|
|
603
603
|
};
|
|
604
|
-
function
|
|
605
|
-
|
|
606
|
-
|
|
604
|
+
function zt(r, t) {
|
|
605
|
+
const e = (o) => {
|
|
606
|
+
const i = /^\d+/.exec(String(o ?? ""));
|
|
607
|
+
return i ? Number(i[0]) : null;
|
|
608
|
+
}, s = e(r), a = e(t);
|
|
609
|
+
return s !== null && a !== null && s !== a ? a - s : s !== null && a === null ? -1 : s === null && a !== null ? 1 : String(r ?? "").localeCompare(String(t ?? ""), "en", { sensitivity: "base" });
|
|
610
|
+
}
|
|
611
|
+
function Ee(r, t) {
|
|
612
|
+
const e = (s) => String(s?.name ?? s ?? "");
|
|
613
|
+
return e(r).localeCompare(e(t), "en", { numeric: !0, sensitivity: "base" });
|
|
614
|
+
}
|
|
615
|
+
function Wt(r) {
|
|
616
|
+
if (r.state === "live") return { kind: "live", label: `Live · ${r.period || ""}`.replace(/ · $/, "") };
|
|
617
|
+
if (r.state === "final") {
|
|
607
618
|
const t = [];
|
|
608
|
-
return
|
|
619
|
+
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
620
|
}
|
|
610
|
-
return
|
|
621
|
+
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" })} · ${pt(r.time)}`.replace(/ · $/, "") };
|
|
611
622
|
}
|
|
612
|
-
const
|
|
613
|
-
function _(
|
|
614
|
-
let t = String(
|
|
623
|
+
const Pe = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
|
|
624
|
+
function _(r) {
|
|
625
|
+
let t = String(r || "").replace(/^[a-z][a-z0-9+.-]*:\/\/[^/#?]*/i, "");
|
|
615
626
|
const e = t.indexOf("#");
|
|
616
627
|
let s = "";
|
|
617
628
|
e !== -1 && (s = t.slice(e).split("?")[0], t = t.slice(0, e));
|
|
618
|
-
let
|
|
619
|
-
return
|
|
629
|
+
let a = t.split("?")[0] + s;
|
|
630
|
+
return a = a.replace(/([^:])\/{2,}/g, "$1/").replace(/^\/{2,}/, "/"), a = a.replace(/^\/(?=#)/, ""), a.length > 1 && (a = a.replace(/\/+$/, "")), a.toLowerCase();
|
|
620
631
|
}
|
|
621
|
-
function
|
|
622
|
-
const
|
|
623
|
-
if (!
|
|
624
|
-
const t = (
|
|
625
|
-
return _((
|
|
632
|
+
function qt() {
|
|
633
|
+
const r = globalThis.location;
|
|
634
|
+
if (!r) return "";
|
|
635
|
+
const t = (r.hash || "").startsWith("#/") ? r.hash : "";
|
|
636
|
+
return _((r.pathname || "") + t);
|
|
626
637
|
}
|
|
627
|
-
function
|
|
638
|
+
function De(r, t, e) {
|
|
628
639
|
if (!e) return null;
|
|
629
|
-
const s = _(
|
|
640
|
+
const s = _(r);
|
|
630
641
|
if (!s) return null;
|
|
631
|
-
const
|
|
632
|
-
if (s ===
|
|
642
|
+
const a = _(g(t.game, { sport: e, id: "" })), o = _(g(t.school, { id: "" }));
|
|
643
|
+
if (s === a || s.startsWith(`${a}/`) || s === o || s.startsWith(`${o}/`)) return null;
|
|
633
644
|
const i = _(g(t.section, { sport: e, view: "" }));
|
|
634
645
|
if (s === i) return "";
|
|
635
646
|
if (!s.startsWith(`${i}/`)) return null;
|
|
636
647
|
const n = s.slice(i.length + 1), d = n.split("/");
|
|
637
|
-
return d.length > 2 || d.some((l) => !/^[a-z][a-z-]*$/.test(l)) ||
|
|
648
|
+
return d.length > 2 || d.some((l) => !/^[a-z][a-z-]*$/.test(l)) || Pe.has(d[0]) ? null : n;
|
|
638
649
|
}
|
|
639
|
-
function
|
|
640
|
-
const s = (i) => g(e.section, { sport:
|
|
650
|
+
function ze(r, t, e) {
|
|
651
|
+
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
652
|
{ label: "Boys Standings", href: s("boys/standings") },
|
|
642
653
|
{ label: "Girls Standings", href: s("girls/standings") }
|
|
643
654
|
] : [{ label: "Standings", href: s("standings") }];
|
|
644
655
|
return [
|
|
645
|
-
{ label: `${z(
|
|
656
|
+
{ label: `${z(r)} Home`, href: s("") },
|
|
646
657
|
{ label: "Scores/Schedule", href: s("scores") },
|
|
647
658
|
{ label: "Playoff Brackets", href: s("brackets") },
|
|
648
659
|
...o,
|
|
649
660
|
{ label: "Polls & Rankings", href: s("rankings") }
|
|
650
661
|
];
|
|
651
662
|
}
|
|
652
|
-
function
|
|
663
|
+
function Re(r, t = qt()) {
|
|
653
664
|
const e = _(t);
|
|
654
|
-
for (const s of
|
|
665
|
+
for (const s of r.querySelectorAll(':scope > a[slot="nav"]'))
|
|
655
666
|
e && _(s.getAttribute("href")) === e ? s.setAttribute("aria-current", "page") : s.removeAttribute("aria-current");
|
|
656
667
|
}
|
|
657
668
|
class w extends E {
|
|
@@ -673,7 +684,7 @@ class w extends E {
|
|
|
673
684
|
this._client = t, this.isConnected && this.load();
|
|
674
685
|
}
|
|
675
686
|
get client() {
|
|
676
|
-
return this._client ? this._client : this.api ?
|
|
687
|
+
return this._client ? this._client : this.api ? Ae({ baseUrl: this.api }) : null;
|
|
677
688
|
}
|
|
678
689
|
connectedCallback() {
|
|
679
690
|
super.connectedCallback(), this._setupInterval();
|
|
@@ -685,7 +696,7 @@ class w extends E {
|
|
|
685
696
|
this.load();
|
|
686
697
|
}
|
|
687
698
|
updated(t) {
|
|
688
|
-
t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval(),
|
|
699
|
+
t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval(), Re(this);
|
|
689
700
|
}
|
|
690
701
|
async load() {
|
|
691
702
|
const t = this.client;
|
|
@@ -720,7 +731,7 @@ class w extends E {
|
|
|
720
731
|
return c``;
|
|
721
732
|
}
|
|
722
733
|
}
|
|
723
|
-
const v = (
|
|
734
|
+
const v = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), Be = b`
|
|
724
735
|
:host {
|
|
725
736
|
--hsot-red: var(--color-red, #D1232A);
|
|
726
737
|
--hsot-red-deep: var(--color-red-dark, #951C21);
|
|
@@ -758,7 +769,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), ze = b`
|
|
|
758
769
|
outline-offset: 1px;
|
|
759
770
|
}
|
|
760
771
|
.mut { color: var(--hsot-gray-5); }
|
|
761
|
-
`,
|
|
772
|
+
`, Fe = b`
|
|
762
773
|
.band { background: var(--hsot-white); color: var(--hsot-black); }
|
|
763
774
|
.band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
|
|
764
775
|
.band h1, .band h2.bandtitle {
|
|
@@ -807,7 +818,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), ze = b`
|
|
|
807
818
|
@media (max-width: 720px) {
|
|
808
819
|
.band h1, .band h2.bandtitle, .band.section h1, .band.section h2.bandtitle { font-size: 1.8rem; }
|
|
809
820
|
}
|
|
810
|
-
`,
|
|
821
|
+
`, Ne = b`
|
|
811
822
|
.view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
|
|
812
823
|
/* Optional right rail (slot="rail" light-DOM children): a divided 300px
|
|
813
824
|
column on desktop, stacked under the view content on smaller screens. */
|
|
@@ -871,7 +882,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), ze = b`
|
|
|
871
882
|
.error { padding: 1.2rem 1rem; color: var(--hsot-red-deep); font-size: 0.9rem; }
|
|
872
883
|
.note { font-size: 0.8125rem; color: var(--hsot-gray-5); margin: 0.6rem 0 0; }
|
|
873
884
|
.loading { padding: 1.2rem; color: var(--hsot-gray-5); font-family: var(--hsot-heading-font); }
|
|
874
|
-
`,
|
|
885
|
+
`, Ue = b`
|
|
875
886
|
.pill {
|
|
876
887
|
display: inline-block; font-family: var(--hsot-heading-font); font-weight: 700;
|
|
877
888
|
font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
|
|
@@ -886,7 +897,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), ze = b`
|
|
|
886
897
|
.pill.champ { background: var(--hsot-straw); color: #6b5900; }
|
|
887
898
|
@keyframes hsot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
|
|
888
899
|
@media (prefers-reduced-motion: reduce) { .pill.live { animation: none; } }
|
|
889
|
-
`,
|
|
900
|
+
`, Oe = b`
|
|
890
901
|
.tablewrap { overflow-x: auto; }
|
|
891
902
|
table.data { font-family: var(--hsot-heading-font); font-size: 14px; border-collapse: collapse; width: 100%; }
|
|
892
903
|
table.data th {
|
|
@@ -904,7 +915,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), ze = b`
|
|
|
904
915
|
table.data tbody tr.rowlink:hover { background: var(--hsot-gray-1); }
|
|
905
916
|
table.data td.teamcell a { color: inherit; text-decoration: none; font-weight: 500; }
|
|
906
917
|
table.data td.teamcell a:hover { text-decoration: underline; }
|
|
907
|
-
`,
|
|
918
|
+
`, He = b`
|
|
908
919
|
.swatch {
|
|
909
920
|
display: inline-flex; align-items: center; justify-content: center;
|
|
910
921
|
width: 26px; height: 26px; border-radius: 50%;
|
|
@@ -928,7 +939,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), ze = b`
|
|
|
928
939
|
.dot.W { background: var(--hsot-win); }
|
|
929
940
|
.dot.L { background: var(--hsot-loss); }
|
|
930
941
|
.dot.T { background: var(--hsot-tie); }
|
|
931
|
-
`,
|
|
942
|
+
`, Me = b`
|
|
932
943
|
ul.gamelist { list-style: none; margin: 0; padding: 0; }
|
|
933
944
|
.gamelist li {
|
|
934
945
|
display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 1rem;
|
|
@@ -978,16 +989,16 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), ze = b`
|
|
|
978
989
|
.gamelist .ff { color: var(--hsot-gray-5); font-size: 0.78rem; font-style: italic; }
|
|
979
990
|
.gamelist .where { color: var(--hsot-gray-5); font-size: 0.78rem; }
|
|
980
991
|
.gamelist a.box { font-size: 0.78rem; }
|
|
981
|
-
`, j = [
|
|
982
|
-
function ut(
|
|
983
|
-
return
|
|
992
|
+
`, j = [Be, Fe, Ne, Ue, Oe, He, Me];
|
|
993
|
+
function ut(r) {
|
|
994
|
+
return r.state !== "final" ? null : r.forfeit === "home" ? "away" : r.forfeit === "away" || r.homeScore > r.awayScore ? "home" : r.awayScore > r.homeScore ? "away" : r.tiebreakWinner && r.tiebreakWinner !== "none" ? r.tiebreakWinner : "tie";
|
|
984
995
|
}
|
|
985
|
-
function
|
|
986
|
-
return
|
|
996
|
+
function Le(r) {
|
|
997
|
+
return r && (r.forfeit === "home" || r.forfeit === "away") ? r.forfeit : null;
|
|
987
998
|
}
|
|
988
|
-
function W(
|
|
989
|
-
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]),
|
|
990
|
-
for (const o of
|
|
999
|
+
function W(r, t) {
|
|
1000
|
+
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)));
|
|
1001
|
+
for (const o of a) {
|
|
991
1002
|
const i = ut(o), n = o.gameType === "conference";
|
|
992
1003
|
for (const d of ["home", "away"]) {
|
|
993
1004
|
const l = d === "home" ? o.homeTeamId : o.awayTeamId;
|
|
@@ -1000,41 +1011,41 @@ function W(a, t) {
|
|
|
1000
1011
|
}
|
|
1001
1012
|
return e;
|
|
1002
1013
|
}
|
|
1003
|
-
function st(
|
|
1004
|
-
if (!
|
|
1005
|
-
const t =
|
|
1014
|
+
function st(r) {
|
|
1015
|
+
if (!r || !r.length) return "";
|
|
1016
|
+
const t = r[r.length - 1].mark;
|
|
1006
1017
|
let e = 0;
|
|
1007
|
-
for (let s =
|
|
1018
|
+
for (let s = r.length - 1; s >= 0 && r[s].mark === t; s -= 1) e += 1;
|
|
1008
1019
|
return t + e;
|
|
1009
1020
|
}
|
|
1010
|
-
const
|
|
1011
|
-
const s =
|
|
1012
|
-
return s ? (
|
|
1013
|
-
},
|
|
1014
|
-
function x(
|
|
1015
|
-
if (!
|
|
1016
|
-
const e = t ?
|
|
1017
|
-
return `${e}-${s}${
|
|
1018
|
-
}
|
|
1019
|
-
function
|
|
1020
|
-
return
|
|
1021
|
+
const Rt = (r, t, e) => {
|
|
1022
|
+
const s = r + t + e;
|
|
1023
|
+
return s ? (r + e / 2) / s : 0;
|
|
1024
|
+
}, Bt = (r) => r.toFixed(3).replace("0.", ".");
|
|
1025
|
+
function x(r, t = !1) {
|
|
1026
|
+
if (!r) return "0-0";
|
|
1027
|
+
const e = t ? r.cw : r.w, s = t ? r.cl : r.l, a = t ? r.ct : r.t;
|
|
1028
|
+
return `${e}-${s}${a ? `-${a}` : ""}`;
|
|
1029
|
+
}
|
|
1030
|
+
function Gt(r, t) {
|
|
1031
|
+
return r.map((e) => {
|
|
1021
1032
|
const s = t[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] };
|
|
1022
|
-
return { team: e, rec: s, confPct:
|
|
1033
|
+
return { team: e, rec: s, confPct: Rt(s.cw, s.cl, s.ct), overallPct: Rt(s.w, s.l, s.t) };
|
|
1023
1034
|
}).sort((e, s) => s.confPct - e.confPct || s.overallPct - e.overallPct || s.rec.pf - s.rec.pa - (e.rec.pf - e.rec.pa));
|
|
1024
1035
|
}
|
|
1025
|
-
function gt(
|
|
1026
|
-
return
|
|
1036
|
+
function gt(r, t) {
|
|
1037
|
+
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;
|
|
1027
1038
|
}
|
|
1028
|
-
function
|
|
1029
|
-
const e =
|
|
1039
|
+
function Ft(r, t) {
|
|
1040
|
+
const e = r[t];
|
|
1030
1041
|
return e && e.results.length ? e.results[e.results.length - 1] : null;
|
|
1031
1042
|
}
|
|
1032
|
-
function vt(
|
|
1043
|
+
function vt(r, t, e, s, a) {
|
|
1033
1044
|
const o = t[e];
|
|
1034
1045
|
if (!o) return null;
|
|
1035
1046
|
const i = /* @__PURE__ */ new Map();
|
|
1036
|
-
for (const d of
|
|
1037
|
-
if (d.sport !== s ||
|
|
1047
|
+
for (const d of r || []) {
|
|
1048
|
+
if (d.sport !== s || a && d.effectiveDate > a || d.gender && o.gender !== d.gender && o.gender !== "coed") continue;
|
|
1038
1049
|
const l = d.gender || "", h = i.get(l);
|
|
1039
1050
|
(!h || d.effectiveDate > h.effectiveDate) && i.set(l, d);
|
|
1040
1051
|
}
|
|
@@ -1045,35 +1056,35 @@ function vt(a, t, e, s, r) {
|
|
|
1045
1056
|
}
|
|
1046
1057
|
return n ? n.rank : null;
|
|
1047
1058
|
}
|
|
1048
|
-
function
|
|
1049
|
-
if (!
|
|
1050
|
-
const s = (
|
|
1059
|
+
function je(r, t, e) {
|
|
1060
|
+
if (!r) return { kind: "none", delta: 0 };
|
|
1061
|
+
const s = (r.teamIds || []).indexOf(e) + 1;
|
|
1051
1062
|
if (!s) return { kind: "none", delta: 0 };
|
|
1052
1063
|
if (!t) return { kind: "same", delta: 0 };
|
|
1053
|
-
const
|
|
1054
|
-
if (!
|
|
1055
|
-
const o =
|
|
1064
|
+
const a = (t.teamIds || []).indexOf(e) + 1;
|
|
1065
|
+
if (!a) return { kind: "new", delta: 0 };
|
|
1066
|
+
const o = a - s;
|
|
1056
1067
|
return o > 0 ? { kind: "up", delta: o } : o < 0 ? { kind: "down", delta: -o } : { kind: "same", delta: 0 };
|
|
1057
1068
|
}
|
|
1058
|
-
function
|
|
1059
|
-
return /^https?:\/\//i.test(String(
|
|
1069
|
+
function We(r) {
|
|
1070
|
+
return /^https?:\/\//i.test(String(r || ""));
|
|
1060
1071
|
}
|
|
1061
|
-
function
|
|
1062
|
-
if (!
|
|
1072
|
+
function Vt(r, { w: t, h: e } = {}) {
|
|
1073
|
+
if (!We(r)) return "";
|
|
1063
1074
|
const s = [];
|
|
1064
1075
|
t && s.push(`w=${Math.max(1, Math.round(t))}`), e && s.push(`h=${Math.max(1, Math.round(e))}`), s.push("f=webp");
|
|
1065
|
-
const
|
|
1066
|
-
return `${
|
|
1076
|
+
const a = r.includes("?") ? "&" : "?";
|
|
1077
|
+
return `${r}${a}${s.join("&")}`;
|
|
1067
1078
|
}
|
|
1068
|
-
function Q(
|
|
1079
|
+
function Q(r, t) {
|
|
1069
1080
|
const e = t * 2;
|
|
1070
|
-
return
|
|
1081
|
+
return Vt(r?.logoAssetId, { w: e, h: e });
|
|
1071
1082
|
}
|
|
1072
|
-
function
|
|
1073
|
-
return
|
|
1083
|
+
function qe(r, t) {
|
|
1084
|
+
return Vt(r?.photoAssetId, { w: t * 2 });
|
|
1074
1085
|
}
|
|
1075
|
-
function $t(
|
|
1076
|
-
const o =
|
|
1086
|
+
function $t(r, t, { title: e, sub: s, teams: a }) {
|
|
1087
|
+
const o = qt(), n = !!r.querySelector(':scope > a[slot="nav"]') || De(o, t.hrefs, t.sport) !== null;
|
|
1077
1088
|
return c`
|
|
1078
1089
|
<div class="band section">
|
|
1079
1090
|
<div class="inner">
|
|
@@ -1084,7 +1095,7 @@ function $t(a, t, { title: e, sub: s, teams: r }) {
|
|
|
1084
1095
|
<nav class="sectionnav" aria-label="${z(t.sport)} section">
|
|
1085
1096
|
<div class="navrow">
|
|
1086
1097
|
<slot name="nav">
|
|
1087
|
-
${
|
|
1098
|
+
${ze(t.sport, a, t.hrefs).map((d) => c`<a href=${d.href}
|
|
1088
1099
|
aria-current=${o && _(d.href) === o ? "page" : m}>${d.label}</a>`)}
|
|
1089
1100
|
</slot>
|
|
1090
1101
|
</div>
|
|
@@ -1092,60 +1103,60 @@ function $t(a, t, { title: e, sub: s, teams: r }) {
|
|
|
1092
1103
|
</div>
|
|
1093
1104
|
`;
|
|
1094
1105
|
}
|
|
1095
|
-
const O = (
|
|
1096
|
-
const e =
|
|
1097
|
-
return e ?
|
|
1098
|
-
}, C = (
|
|
1099
|
-
function H(
|
|
1100
|
-
if (!
|
|
1101
|
-
const e = Q(
|
|
1106
|
+
const O = (r, t) => {
|
|
1107
|
+
const e = r.teamsById[t];
|
|
1108
|
+
return e ? r.schoolsById[e.schoolId] : null;
|
|
1109
|
+
}, C = (r, t) => O(r, t)?.name || "TBD", Z = (r, t) => O(r, t)?.abbr || "TBD";
|
|
1110
|
+
function H(r, t = 26) {
|
|
1111
|
+
if (!r) return m;
|
|
1112
|
+
const e = Q(r, t);
|
|
1102
1113
|
if (e)
|
|
1103
1114
|
return c`<img class="swatch logo" aria-hidden="true" alt="" loading="lazy"
|
|
1104
1115
|
src=${e} style="width:${t}px;height:${t}px" />`;
|
|
1105
|
-
const s =
|
|
1116
|
+
const s = r.colorPrimary || "#030711", a = K(s);
|
|
1106
1117
|
return c`<span class="swatch" aria-hidden="true"
|
|
1107
|
-
style="width:${t}px;height:${t}px;background:${s};color:${
|
|
1108
|
-
>${ft(
|
|
1118
|
+
style="width:${t}px;height:${t}px;background:${s};color:${a};font-size:${Math.max(8, t * 0.28)}px"
|
|
1119
|
+
>${ft(r)}</span>`;
|
|
1109
1120
|
}
|
|
1110
|
-
function bt(
|
|
1111
|
-
const s = vt(
|
|
1121
|
+
function bt(r, t, e) {
|
|
1122
|
+
const s = vt(r.rankings, r.teamsById, t, r.sport, e);
|
|
1112
1123
|
return s ? c`<span class="rankbadge">#${s}</span>` : m;
|
|
1113
1124
|
}
|
|
1114
|
-
function
|
|
1115
|
-
const s = O(
|
|
1116
|
-
return s ? c`${bt(
|
|
1125
|
+
function Yt(r, t, e) {
|
|
1126
|
+
const s = O(r, t);
|
|
1127
|
+
return s ? c`${bt(r, t, e)}<a href=${g(r.hrefs.school, { id: s.id })}>${s.name}</a>` : c`<span class="mut">TBD</span>`;
|
|
1117
1128
|
}
|
|
1118
|
-
function yt(
|
|
1119
|
-
const s =
|
|
1129
|
+
function yt(r, t, e = 5) {
|
|
1130
|
+
const s = r.records[t];
|
|
1120
1131
|
if (!s || !s.results.length) return c`<span class="mut">·</span>`;
|
|
1121
|
-
const
|
|
1122
|
-
return c`<span class="dots" role="img" aria-label="last ${
|
|
1123
|
-
${
|
|
1124
|
-
title="${o.mark} ${o.my}-${o.their} vs ${C(
|
|
1125
|
-
href=${g(
|
|
1132
|
+
const a = s.results.slice(-1 * e);
|
|
1133
|
+
return c`<span class="dots" role="img" aria-label="last ${a.length} results">
|
|
1134
|
+
${a.map((o) => c`<a class="dot ${o.mark}"
|
|
1135
|
+
title="${o.mark} ${o.my}-${o.their} vs ${C(r, o.opp)}"
|
|
1136
|
+
href=${g(r.hrefs.game, { sport: r.sport, id: o.gameId })}>${o.mark}</a>`)}
|
|
1126
1137
|
</span>`;
|
|
1127
1138
|
}
|
|
1128
|
-
function q(
|
|
1129
|
-
return
|
|
1139
|
+
function q(r, t) {
|
|
1140
|
+
return r.querySelector(':scope > [slot="rail"]') ? c`<div class="view withrail">
|
|
1130
1141
|
<div class="viewmain">${t}</div>
|
|
1131
1142
|
<aside class="viewrail"><slot name="rail"></slot></aside>
|
|
1132
1143
|
</div>` : c`<div class="view">${t}</div>`;
|
|
1133
1144
|
}
|
|
1134
|
-
function G(
|
|
1135
|
-
if (!
|
|
1136
|
-
const t = c`<img src=${
|
|
1137
|
-
return c`<div class="promo">${
|
|
1145
|
+
function G(r) {
|
|
1146
|
+
if (!r.promoImage) return m;
|
|
1147
|
+
const t = c`<img src=${r.promoImage} alt=${r.promoAlt || "Sponsor"}>`;
|
|
1148
|
+
return c`<div class="promo">${r.promoHref ? c`<a href=${r.promoHref} target="_blank" rel="sponsored noopener">${t}</a>` : t}</div>`;
|
|
1138
1149
|
}
|
|
1139
|
-
function J(
|
|
1140
|
-
const t =
|
|
1150
|
+
function J(r) {
|
|
1151
|
+
const t = Wt(r);
|
|
1141
1152
|
return c`<span class="pill ${t.kind}">${t.label}</span>`;
|
|
1142
1153
|
}
|
|
1143
|
-
function
|
|
1154
|
+
function Kt(r, t, e) {
|
|
1144
1155
|
if (!t) return c`<span class="mut">·</span>`;
|
|
1145
|
-
const s = t.homeTeamId === e ? t.awayTeamId : t.homeTeamId,
|
|
1146
|
-
return c`${t.state === "live" ? c`<span class="pill live">Live</span> ` : c`${y(t.date, { month: "numeric", day: "numeric" })} `}${
|
|
1156
|
+
const s = t.homeTeamId === e ? t.awayTeamId : t.homeTeamId, a = t.homeTeamId === e ? "vs" : "at";
|
|
1157
|
+
return c`${t.state === "live" ? c`<span class="pill live">Live</span> ` : c`${y(t.date, { month: "numeric", day: "numeric" })} `}${a} ${Z(r, s)}`;
|
|
1147
1158
|
}
|
|
1148
|
-
class
|
|
1159
|
+
class Qt extends w {
|
|
1149
1160
|
static styles = j;
|
|
1150
1161
|
static properties = {
|
|
1151
1162
|
...w.properties,
|
|
@@ -1164,17 +1175,17 @@ class Kt extends w {
|
|
|
1164
1175
|
this._datePinned = !!this.date;
|
|
1165
1176
|
}
|
|
1166
1177
|
async fetchData(t) {
|
|
1167
|
-
const e = this.season || et(), [s,
|
|
1178
|
+
const e = this.season || et(), [s, a, o, i, n] = await Promise.all([
|
|
1168
1179
|
t.listSchools(),
|
|
1169
1180
|
t.listTeams({ sport: this.sport }),
|
|
1170
1181
|
t.listConferences(),
|
|
1171
1182
|
t.listGames({ sport: this.sport, season: e }),
|
|
1172
1183
|
t.listRankings({ sport: this.sport })
|
|
1173
1184
|
]);
|
|
1174
|
-
return this._datePinned || (this.date =
|
|
1185
|
+
return this._datePinned || (this.date = Ie(i.items.map((d) => d.date)), this._datePinned = !0), {
|
|
1175
1186
|
season: e,
|
|
1176
1187
|
schools: s.items,
|
|
1177
|
-
teams:
|
|
1188
|
+
teams: a.items,
|
|
1178
1189
|
conferences: o.items,
|
|
1179
1190
|
games: i.items,
|
|
1180
1191
|
rankings: n.items
|
|
@@ -1191,9 +1202,9 @@ class Kt extends w {
|
|
|
1191
1202
|
}, this._ctxData = this.data), this._ctx;
|
|
1192
1203
|
}
|
|
1193
1204
|
renderView() {
|
|
1194
|
-
const t = this.ctx, e = v(this.data.conferences), s = [...new Set(this.data.games.map((l) => l.date).filter(Boolean))].sort(),
|
|
1205
|
+
const t = this.ctx, e = v(this.data.conferences), s = [...new Set(this.data.games.map((l) => l.date).filter(Boolean))].sort(), a = Number.MAX_SAFE_INTEGER, o = (l) => {
|
|
1195
1206
|
const h = [l.awayTeamId, l.homeTeamId].map((p) => vt(t.rankings, t.teamsById, p, this.sport, l.date)).filter(Boolean);
|
|
1196
|
-
return h.length ? Math.min(...h) :
|
|
1207
|
+
return h.length ? Math.min(...h) : a;
|
|
1197
1208
|
}, i = this.data.games.filter((l) => l.date === this.date), n = new Map(i.map((l) => [l, o(l)]));
|
|
1198
1209
|
i.sort((l, h) => (l.state === "live" ? 0 : 1) - (h.state === "live" ? 0 : 1) || n.get(l) - n.get(h));
|
|
1199
1210
|
const d = /* @__PURE__ */ new Map();
|
|
@@ -1242,11 +1253,11 @@ class Kt extends w {
|
|
|
1242
1253
|
// a lone score column on the far right read as detached from the teams).
|
|
1243
1254
|
// Scheduled games carry their start time on the status pill alone.
|
|
1244
1255
|
renderGame(t, e) {
|
|
1245
|
-
const s = e.state === "final" || e.state === "live",
|
|
1256
|
+
const s = e.state === "final" || e.state === "live", a = (i, n, d = m) => c`<span class="side">${Yt(t, i, e.date)}${s ? c`<span class="score">${n}</span>` : m}${d}</span>`, o = Le(e);
|
|
1246
1257
|
return c`
|
|
1247
1258
|
<li>
|
|
1248
1259
|
${J(e)}
|
|
1249
|
-
<span class="opp matchup">${
|
|
1260
|
+
<span class="opp matchup">${a(e.awayTeamId, e.awayScore, c`<span class="at">at</span>`)}${a(e.homeTeamId, e.homeScore)}</span>
|
|
1250
1261
|
${o ? c`<span class="ff">${C(t, o === "home" ? e.homeTeamId : e.awayTeamId)} forfeited</span>` : m}
|
|
1251
1262
|
<span class="where">${e.venue || ""}</span>
|
|
1252
1263
|
${e.broadcast ? c`<span class="pill class">${e.broadcast}</span>` : m}
|
|
@@ -1255,8 +1266,8 @@ class Kt extends w {
|
|
|
1255
1266
|
`;
|
|
1256
1267
|
}
|
|
1257
1268
|
}
|
|
1258
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores",
|
|
1259
|
-
class
|
|
1269
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", Qt);
|
|
1270
|
+
class Zt extends w {
|
|
1260
1271
|
static styles = j;
|
|
1261
1272
|
static properties = {
|
|
1262
1273
|
...w.properties,
|
|
@@ -1269,7 +1280,7 @@ class Qt extends w {
|
|
|
1269
1280
|
super(), this.sport = "football", this.season = "", this.classFilter = "All", this.query = "";
|
|
1270
1281
|
}
|
|
1271
1282
|
async fetchData(t) {
|
|
1272
|
-
const e = this.season || et(), [s,
|
|
1283
|
+
const e = this.season || et(), [s, a, o, i, n] = await Promise.all([
|
|
1273
1284
|
t.listConferences({ active: !0 }),
|
|
1274
1285
|
t.listSchools(),
|
|
1275
1286
|
t.listTeams({ sport: this.sport }),
|
|
@@ -1279,7 +1290,7 @@ class Qt extends w {
|
|
|
1279
1290
|
return {
|
|
1280
1291
|
season: e,
|
|
1281
1292
|
conferences: s.items,
|
|
1282
|
-
schools:
|
|
1293
|
+
schools: a.items,
|
|
1283
1294
|
teams: o.items,
|
|
1284
1295
|
games: i.items,
|
|
1285
1296
|
rankings: n.items
|
|
@@ -1296,7 +1307,7 @@ class Qt extends w {
|
|
|
1296
1307
|
}, this._ctxData = this.data), this._ctx;
|
|
1297
1308
|
}
|
|
1298
1309
|
renderView() {
|
|
1299
|
-
const t = this.ctx, e = ["All", ...new Set(this.data.conferences.flatMap((
|
|
1310
|
+
const t = this.ctx, e = ["All", ...[...new Set(this.data.conferences.flatMap((a) => a.classifications || []))].sort(zt)].slice(0, 9), s = this.data.conferences.filter((a) => a.active !== !1).filter((a) => this.classFilter === "All" || (a.classifications || []).includes(this.classFilter)).sort(Ee);
|
|
1300
1311
|
return c`
|
|
1301
1312
|
${$t(this, t, {
|
|
1302
1313
|
title: c`${z(this.sport)} standings`,
|
|
@@ -1307,31 +1318,31 @@ class Qt extends w {
|
|
|
1307
1318
|
${G(this)}
|
|
1308
1319
|
<div class="toolbar">
|
|
1309
1320
|
<div role="group" aria-label="Classification filter">
|
|
1310
|
-
${e.map((
|
|
1321
|
+
${e.map((a) => c`<button class="chip ${this.classFilter === a ? "on" : ""}"
|
|
1311
1322
|
@click=${() => {
|
|
1312
|
-
this.classFilter =
|
|
1313
|
-
}}>${
|
|
1323
|
+
this.classFilter = a;
|
|
1324
|
+
}}>${a}</button>`)}
|
|
1314
1325
|
</div>
|
|
1315
1326
|
<input type="search" placeholder="Find a school…" aria-label="Find a school"
|
|
1316
|
-
.value=${this.query} @input=${(
|
|
1317
|
-
this.query =
|
|
1327
|
+
.value=${this.query} @input=${(a) => {
|
|
1328
|
+
this.query = a.target.value;
|
|
1318
1329
|
}}>
|
|
1319
1330
|
<span class="spacer"></span>
|
|
1320
1331
|
<span class="asof">Records through ${y(mt(), { month: "long", day: "numeric" })} · conference games count toward both records · scrimmages toward neither</span>
|
|
1321
1332
|
</div>
|
|
1322
|
-
${s.map((
|
|
1333
|
+
${s.map((a) => this.renderConference(t, a))}
|
|
1323
1334
|
`)}
|
|
1324
1335
|
`;
|
|
1325
1336
|
}
|
|
1326
1337
|
renderConference(t, e) {
|
|
1327
1338
|
const s = this.data.teams.filter((i) => i.conferenceId === e.id);
|
|
1328
1339
|
if (!s.length) return m;
|
|
1329
|
-
const
|
|
1340
|
+
const a = this.query.trim().toLowerCase(), o = Gt(s, t.records);
|
|
1330
1341
|
return c`
|
|
1331
1342
|
<div class="card">
|
|
1332
1343
|
<div class="card-head">
|
|
1333
1344
|
<h2>${e.name}</h2>
|
|
1334
|
-
${
|
|
1345
|
+
${[...e.classifications || []].sort(zt).map((i) => c`<span class="pill class">${i}</span>`)}
|
|
1335
1346
|
<span class="meta">${o.length} teams · membership derives from teams</span>
|
|
1336
1347
|
</div>
|
|
1337
1348
|
<div class="tablewrap"><table class="data">
|
|
@@ -1341,15 +1352,15 @@ class Qt extends w {
|
|
|
1341
1352
|
<th>Streak</th><th>Last 5</th><th>Next</th>
|
|
1342
1353
|
</tr></thead>
|
|
1343
1354
|
<tbody>
|
|
1344
|
-
${o.map((i, n) => this.renderRow(t, i, n,
|
|
1355
|
+
${o.map((i, n) => this.renderRow(t, i, n, a))}
|
|
1345
1356
|
</tbody>
|
|
1346
1357
|
</table></div>
|
|
1347
1358
|
</div>
|
|
1348
1359
|
`;
|
|
1349
1360
|
}
|
|
1350
|
-
renderRow(t, e, s,
|
|
1361
|
+
renderRow(t, e, s, a) {
|
|
1351
1362
|
const o = t.schoolsById[e.team.schoolId], i = o?.name || e.team.name || "TBD";
|
|
1352
|
-
if (
|
|
1363
|
+
if (a && !i.toLowerCase().includes(a)) return m;
|
|
1353
1364
|
const n = e.rec.pf - e.rec.pa, d = gt(this.data.games, e.team.id), l = () => {
|
|
1354
1365
|
location.href = g(t.hrefs.school, { id: e.team.schoolId });
|
|
1355
1366
|
};
|
|
@@ -1363,21 +1374,21 @@ class Qt extends w {
|
|
|
1363
1374
|
<a href=${g(t.hrefs.school, { id: e.team.schoolId })}>${i}</a>
|
|
1364
1375
|
</td>
|
|
1365
1376
|
<td class="num">${x(e.rec, !0)}</td>
|
|
1366
|
-
<td class="num">${
|
|
1377
|
+
<td class="num">${Bt(e.confPct)}</td>
|
|
1367
1378
|
<td class="num">${x(e.rec)}</td>
|
|
1368
|
-
<td class="num">${
|
|
1379
|
+
<td class="num">${Bt(e.overallPct)}</td>
|
|
1369
1380
|
<td class="num">${e.rec.pf}</td>
|
|
1370
1381
|
<td class="num">${e.rec.pa}</td>
|
|
1371
1382
|
<td class="num" style="color:${n >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${n > 0 ? "+" : ""}${n}</td>
|
|
1372
1383
|
<td>${st(e.rec.results) || "·"}</td>
|
|
1373
1384
|
<td>${yt(t, e.team.id)}</td>
|
|
1374
|
-
<td>${
|
|
1385
|
+
<td>${Kt(t, d, e.team.id)}</td>
|
|
1375
1386
|
</tr>
|
|
1376
1387
|
`;
|
|
1377
1388
|
}
|
|
1378
1389
|
}
|
|
1379
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings",
|
|
1380
|
-
const
|
|
1390
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", Zt);
|
|
1391
|
+
const Ge = b`
|
|
1381
1392
|
.hero1 {
|
|
1382
1393
|
border-radius: var(--hsot-radius-md); color: var(--hsot-white);
|
|
1383
1394
|
padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.2rem;
|
|
@@ -1394,8 +1405,8 @@ const We = b`
|
|
|
1394
1405
|
.delta.new { background: var(--hsot-straw); color: #6b5900; border-radius: var(--hsot-radius-xs); padding: 0.1rem 0.3rem; font-size: 0.7rem; }
|
|
1395
1406
|
.sparkline { vertical-align: middle; }
|
|
1396
1407
|
`;
|
|
1397
|
-
class
|
|
1398
|
-
static styles = [...j,
|
|
1408
|
+
class Jt extends w {
|
|
1409
|
+
static styles = [...j, Ge];
|
|
1399
1410
|
static properties = {
|
|
1400
1411
|
...w.properties,
|
|
1401
1412
|
sport: { type: String },
|
|
@@ -1412,7 +1423,7 @@ class Zt extends w {
|
|
|
1412
1423
|
t && (this.pollDate = t);
|
|
1413
1424
|
}
|
|
1414
1425
|
async fetchData(t) {
|
|
1415
|
-
const e = this.season || et(), [s,
|
|
1426
|
+
const e = this.season || et(), [s, a, o, i, n] = await Promise.all([
|
|
1416
1427
|
t.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
|
|
1417
1428
|
t.listSchools(),
|
|
1418
1429
|
t.listTeams({ sport: this.sport }),
|
|
@@ -1422,7 +1433,7 @@ class Zt extends w {
|
|
|
1422
1433
|
return {
|
|
1423
1434
|
season: e,
|
|
1424
1435
|
polls: d,
|
|
1425
|
-
schools:
|
|
1436
|
+
schools: a.items,
|
|
1426
1437
|
teams: o.items,
|
|
1427
1438
|
conferences: i.items,
|
|
1428
1439
|
games: n.items
|
|
@@ -1442,8 +1453,8 @@ class Zt extends w {
|
|
|
1442
1453
|
const n = e.map((p, f) => {
|
|
1443
1454
|
const u = (p.teamIds || []).indexOf(t);
|
|
1444
1455
|
if (u === -1) return null;
|
|
1445
|
-
const $ = e.length === 1 ? 96 / 2 : f / (e.length - 1) * 90 + 3,
|
|
1446
|
-
return { x: $, y:
|
|
1456
|
+
const $ = e.length === 1 ? 96 / 2 : f / (e.length - 1) * 90 + 3, rt = 3 + u / 24 * 20;
|
|
1457
|
+
return { x: $, y: rt };
|
|
1447
1458
|
}), d = [];
|
|
1448
1459
|
let l = [];
|
|
1449
1460
|
if (n.forEach((p) => {
|
|
@@ -1457,13 +1468,13 @@ class Zt extends w {
|
|
|
1457
1468
|
</svg>`;
|
|
1458
1469
|
}
|
|
1459
1470
|
movement(t, e, s) {
|
|
1460
|
-
const
|
|
1461
|
-
return
|
|
1471
|
+
const a = je(t, e, s);
|
|
1472
|
+
return a.kind === "up" ? c`<span class="delta up">▲ ${a.delta}</span>` : a.kind === "down" ? c`<span class="delta down">▼ ${a.delta}</span>` : a.kind === "new" ? c`<span class="delta new">NEW</span>` : a.kind === "same" ? c`<span class="delta same">—</span>` : c`<span class="delta same">·</span>`;
|
|
1462
1473
|
}
|
|
1463
1474
|
renderView() {
|
|
1464
1475
|
const t = this.ctx, e = this.data.polls;
|
|
1465
1476
|
if (!e.length) return c`<div class="view"><p class="empty">No ${this.sport} polls published yet this season.</p></div>`;
|
|
1466
|
-
const s = Math.max(0, e.findIndex((p) => p.effectiveDate === this.pollDate)),
|
|
1477
|
+
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), l = (a.teamIds || [])[0], h = l ? O(t, l) : null;
|
|
1467
1478
|
return c`
|
|
1468
1479
|
${$t(this, t, {
|
|
1469
1480
|
title: c`${z(this.sport)} Top 25`,
|
|
@@ -1477,7 +1488,7 @@ class Zt extends w {
|
|
|
1477
1488
|
<select id="pollsel" @change=${(p) => {
|
|
1478
1489
|
this.pollDate = p.target.value;
|
|
1479
1490
|
}}>
|
|
1480
|
-
${e.map((p, f) => c`<option value=${p.effectiveDate} ?selected=${p ===
|
|
1491
|
+
${e.map((p, f) => c`<option value=${p.effectiveDate} ?selected=${p === a}>
|
|
1481
1492
|
${y(p.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${f === 0 ? " · current" : ""}
|
|
1482
1493
|
</option>`)}
|
|
1483
1494
|
</select>
|
|
@@ -1492,22 +1503,22 @@ class Zt extends w {
|
|
|
1492
1503
|
<span class="spacer"></span>
|
|
1493
1504
|
<span class="asof">Movement vs. the previous poll · sparkline = season rank history</span>
|
|
1494
1505
|
</div>
|
|
1495
|
-
${h ? this.renderHero(t,
|
|
1506
|
+
${h ? this.renderHero(t, a, o, l, h, d) : m}
|
|
1496
1507
|
<div class="card"><div class="tablewrap"><table class="data">
|
|
1497
1508
|
<thead><tr>
|
|
1498
1509
|
<th class="num">Rk</th><th>Mvmt</th><th>Team</th><th class="num">Record</th>
|
|
1499
1510
|
<th>Conference</th><th>Last result</th><th>Next</th><th>Season</th>
|
|
1500
1511
|
</tr></thead>
|
|
1501
1512
|
<tbody>
|
|
1502
|
-
${(
|
|
1513
|
+
${(a.teamIds || []).map((p, f) => f === 0 || !p ? m : this.renderRow(t, a, o, i, n, d, p, f + 1))}
|
|
1503
1514
|
</tbody>
|
|
1504
1515
|
</table></div></div>
|
|
1505
1516
|
<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>
|
|
1506
1517
|
`)}
|
|
1507
1518
|
`;
|
|
1508
1519
|
}
|
|
1509
|
-
renderHero(t, e, s,
|
|
1510
|
-
const n = t.records[
|
|
1520
|
+
renderHero(t, e, s, a, o, i) {
|
|
1521
|
+
const n = t.records[a], d = Ft(t.records, a), l = i[t.teamsById[a]?.conferenceId], h = `linear-gradient(120deg, ${o.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
|
|
1511
1522
|
return c`
|
|
1512
1523
|
<div class="hero1" style="background:${h}">
|
|
1513
1524
|
<div class="bigrank">#1</div>
|
|
@@ -1518,21 +1529,21 @@ class Zt extends w {
|
|
|
1518
1529
|
${x(n)} overall${l ? c` · ${x(n, !0)} ${l.name}` : m}
|
|
1519
1530
|
· streak ${st(n?.results) || "·"}
|
|
1520
1531
|
${d ? c` · last: ${d.mark} ${d.my}-${d.their} vs ${Z(t, d.opp)}` : m}
|
|
1521
|
-
${this.movement(e, s,
|
|
1532
|
+
${this.movement(e, s, a)}
|
|
1522
1533
|
</div>
|
|
1523
1534
|
</div>
|
|
1524
1535
|
</div>
|
|
1525
1536
|
`;
|
|
1526
1537
|
}
|
|
1527
|
-
renderRow(t, e, s,
|
|
1538
|
+
renderRow(t, e, s, a, o, i, n, d) {
|
|
1528
1539
|
const l = O(t, n);
|
|
1529
1540
|
if (!l) return m;
|
|
1530
|
-
const h = t.records[n], p =
|
|
1541
|
+
const h = t.records[n], p = Ft(t.records, n), f = gt(this.data.games, n), u = i[t.teamsById[n]?.conferenceId], $ = () => {
|
|
1531
1542
|
location.href = g(t.hrefs.school, { id: l.id });
|
|
1532
1543
|
};
|
|
1533
1544
|
return c`
|
|
1534
|
-
<tr class="rowlink" @click=${(
|
|
1535
|
-
|
|
1545
|
+
<tr class="rowlink" @click=${(rt) => {
|
|
1546
|
+
rt.target.closest("a") || $();
|
|
1536
1547
|
}}>
|
|
1537
1548
|
<td class="num" style="font-weight:700">${d}</td>
|
|
1538
1549
|
<td>${this.movement(e, s, n)}</td>
|
|
@@ -1543,14 +1554,14 @@ class Zt extends w {
|
|
|
1543
1554
|
<td>${p ? c`<a class="box" style="text-decoration:none" href=${g(t.hrefs.game, { sport: this.sport, id: p.gameId })}>
|
|
1544
1555
|
<b style="color:${p.mark === "W" ? "var(--hsot-win)" : p.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${p.mark}</b>
|
|
1545
1556
|
${p.my}-${p.their} vs ${Z(t, p.opp)}</a>` : c`<span class="mut">·</span>`}</td>
|
|
1546
|
-
<td>${
|
|
1547
|
-
<td>${this.sparkline(n,
|
|
1557
|
+
<td>${Kt(t, f, n)}</td>
|
|
1558
|
+
<td>${this.sparkline(n, a, o)}</td>
|
|
1548
1559
|
</tr>
|
|
1549
1560
|
`;
|
|
1550
1561
|
}
|
|
1551
1562
|
}
|
|
1552
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings",
|
|
1553
|
-
const
|
|
1563
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", Jt);
|
|
1564
|
+
const Ve = b`
|
|
1554
1565
|
.schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
|
|
1555
1566
|
.schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
|
|
1556
1567
|
.schoolhero .crest {
|
|
@@ -1579,8 +1590,8 @@ const qe = b`
|
|
|
1579
1590
|
.rosterphoto { display: block; width: 100%; height: auto; background: var(--hsot-gray-1); border-bottom: 1px solid var(--hsot-gray-2); }
|
|
1580
1591
|
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } .schoolhero h1 { font-size: 1.9rem; } }
|
|
1581
1592
|
`;
|
|
1582
|
-
class
|
|
1583
|
-
static styles = [...j,
|
|
1593
|
+
class Xt extends w {
|
|
1594
|
+
static styles = [...j, Ve];
|
|
1584
1595
|
static properties = {
|
|
1585
1596
|
...w.properties,
|
|
1586
1597
|
schoolId: { type: String, attribute: "school-id" },
|
|
@@ -1636,7 +1647,7 @@ class Jt extends w {
|
|
|
1636
1647
|
this.sport = t, this.load();
|
|
1637
1648
|
}
|
|
1638
1649
|
renderView() {
|
|
1639
|
-
const { school: t, teams: e, active: s, season:
|
|
1650
|
+
const { school: t, teams: e, active: s, season: a } = this.data;
|
|
1640
1651
|
if (!t) return c`<div class="view"><p class="empty">School not found.</p></div>`;
|
|
1641
1652
|
const o = this.ctx, i = K(t.colorPrimary || "#030711"), n = (t.adm || [])[0], d = v(this.data.conferences), l = s ? d[s.conferenceId] : null;
|
|
1642
1653
|
return c`
|
|
@@ -1665,17 +1676,17 @@ class Jt extends w {
|
|
|
1665
1676
|
</div>
|
|
1666
1677
|
${q(this, c`
|
|
1667
1678
|
${G(this)}
|
|
1668
|
-
${s ? this.renderTeam(o, s, l,
|
|
1679
|
+
${s ? this.renderTeam(o, s, l, a) : c`<p class="empty">No teams recorded for this school yet.</p>`}
|
|
1669
1680
|
`)}
|
|
1670
1681
|
`;
|
|
1671
1682
|
}
|
|
1672
|
-
renderTeam(t, e, s,
|
|
1673
|
-
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 ?
|
|
1683
|
+
renderTeam(t, e, s, a) {
|
|
1684
|
+
const o = t.records[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, i = o.w + o.l + o.t, n = s ? this.data.allTeams.filter((p) => p.conferenceId === s.id) : [], d = s ? Gt(n, t.records).findIndex((p) => p.team.id === e.id) + 1 : 0, l = vt(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)));
|
|
1674
1685
|
return c`
|
|
1675
1686
|
<div class="tiles">
|
|
1676
1687
|
<div class="tile"><div class="k">Overall</div><div class="v">${x(o)}</div><div class="s">${i} games played</div></div>
|
|
1677
1688
|
<div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${x(o, !0)}</div>
|
|
1678
|
-
<div class="s">${d ? `${
|
|
1689
|
+
<div class="s">${d ? `${Ce(d)} of ${n.length}` : "·"}</div></div>
|
|
1679
1690
|
<div class="tile"><div class="k">Points</div><div class="v">${i ? (o.pf / i).toFixed(1) : "0.0"}</div>
|
|
1680
1691
|
<div class="s">scored per game · ${i ? (o.pa / i).toFixed(1) : "0.0"} allowed</div></div>
|
|
1681
1692
|
<div class="tile"><div class="k">Streak</div><div class="v">${st(o.results) || "·"}</div>
|
|
@@ -1691,30 +1702,30 @@ class Jt extends w {
|
|
|
1691
1702
|
<div>
|
|
1692
1703
|
<div class="section-title">Schedule & results</div>
|
|
1693
1704
|
<div class="card">
|
|
1694
|
-
${h.length ? c`<ul class="gamelist">${h.map((p) => this.renderGameRow(t, e, p))}</ul>` : c`<p class="empty">No ${e.sport} games recorded for ${
|
|
1705
|
+
${h.length ? c`<ul class="gamelist">${h.map((p) => this.renderGameRow(t, e, p))}</ul>` : c`<p class="empty">No ${e.sport} games recorded for ${a}.</p>`}
|
|
1695
1706
|
</div>
|
|
1696
1707
|
</div>
|
|
1697
1708
|
<div>
|
|
1698
|
-
<div class="section-title">Roster · ${
|
|
1699
|
-
<div class="card">${this.renderRoster(e,
|
|
1709
|
+
<div class="section-title">Roster · ${a}</div>
|
|
1710
|
+
<div class="card">${this.renderRoster(e, a)}</div>
|
|
1700
1711
|
</div>
|
|
1701
1712
|
</div>
|
|
1702
1713
|
`;
|
|
1703
1714
|
}
|
|
1704
1715
|
renderGameRow(t, e, s) {
|
|
1705
|
-
const
|
|
1716
|
+
const a = s.homeTeamId === e.id, o = a ? s.awayTeamId : s.homeTeamId, i = a ? s.homeScore : s.awayScore, n = a ? s.awayScore : s.homeScore;
|
|
1706
1717
|
let d = c`<span class="mut">${pt(s.time)}</span>`;
|
|
1707
1718
|
if (s.state === "final") {
|
|
1708
|
-
const h = ut(s), p = h === "tie" ? "T" : h === (
|
|
1719
|
+
const h = ut(s), p = h === "tie" ? "T" : h === (a ? "home" : "away") ? "W" : "L";
|
|
1709
1720
|
d = c`<span class=${p}>${p}</span> ${i}-${n}${s.finish === "overtime" ? c` <span class="mut">OT</span>` : m}${s.forfeit && s.forfeit !== "none" ? c` <span class="mut">FF</span>` : m}`;
|
|
1710
1721
|
} else s.state === "live" && (d = c`<span style="color:var(--hsot-red)">${i}-${n}</span>`);
|
|
1711
1722
|
const l = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
|
|
1712
1723
|
return c`
|
|
1713
1724
|
<li>
|
|
1714
1725
|
<span class="d">${y(s.date)}</span>
|
|
1715
|
-
${
|
|
1726
|
+
${Wt(s).kind === "sched" ? m : J(s)}
|
|
1716
1727
|
<span class="res">${d}</span>
|
|
1717
|
-
<span class="opp">${
|
|
1728
|
+
<span class="opp">${a ? "vs" : "at"} ${Yt(t, o, s.date)}
|
|
1718
1729
|
<span class="pill type">${l}</span>
|
|
1719
1730
|
${s.broadcast ? c`<span class="pill class">${s.broadcast}</span>` : m}
|
|
1720
1731
|
</span>
|
|
@@ -1727,9 +1738,9 @@ class Jt extends w {
|
|
|
1727
1738
|
const s = this.data.roster;
|
|
1728
1739
|
if (!s)
|
|
1729
1740
|
return c`<p class="empty">Roster not published for ${e}.</p>`;
|
|
1730
|
-
const
|
|
1741
|
+
const a = qe(s, 560), o = this.data.school?.name || "", i = v(this.data.players), n = s.entries.slice().sort((l, h) => (l.number || 0) - (h.number || 0)), d = n.some((l) => i[l.playerId]?.college);
|
|
1731
1742
|
return c`
|
|
1732
|
-
${
|
|
1743
|
+
${a ? c`<img class="rosterphoto" src=${a} loading="lazy" decoding="async"
|
|
1733
1744
|
alt="${o} ${t.name} ${e} team photo" />` : m}
|
|
1734
1745
|
<div class="tablewrap"><table class="data">
|
|
1735
1746
|
<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>${d ? c`<th>College</th>` : m}</tr></thead>
|
|
@@ -1741,7 +1752,7 @@ class Jt extends w {
|
|
|
1741
1752
|
<td style="font-weight:500">${h.firstName} ${h.lastName}</td>
|
|
1742
1753
|
<td>${l.position || "·"}</td>
|
|
1743
1754
|
<td class="mut">${h.classOf || "·"}</td>
|
|
1744
|
-
<td class="num">${
|
|
1755
|
+
<td class="num">${Te(h.heightIn)}</td>
|
|
1745
1756
|
<td class="num">${h.weightLb || "·"}</td>
|
|
1746
1757
|
${d ? c`<td>${h.college || "·"}</td>` : m}
|
|
1747
1758
|
</tr>` : m;
|
|
@@ -1751,37 +1762,37 @@ class Jt extends w {
|
|
|
1751
1762
|
`;
|
|
1752
1763
|
}
|
|
1753
1764
|
}
|
|
1754
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school",
|
|
1755
|
-
const
|
|
1756
|
-
function
|
|
1757
|
-
return
|
|
1765
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", Xt);
|
|
1766
|
+
const Ye = "https://api.wral.com/search";
|
|
1767
|
+
function Ke(r) {
|
|
1768
|
+
return r.map((t) => `uri:"${t}"`).join(" OR ");
|
|
1758
1769
|
}
|
|
1759
|
-
function
|
|
1760
|
-
const e = String(
|
|
1770
|
+
function Qe(r, t) {
|
|
1771
|
+
const e = String(r || Ye).replace(/\/+$/, ""), s = new URLSearchParams({ query: Ke(t), sort: "score", lang: "en" });
|
|
1761
1772
|
return `${e}/v1/query?${s}`;
|
|
1762
1773
|
}
|
|
1763
|
-
function
|
|
1774
|
+
function te(r) {
|
|
1764
1775
|
try {
|
|
1765
|
-
const t = new URL(
|
|
1776
|
+
const t = new URL(r);
|
|
1766
1777
|
if (/(^|\.)smugmug\.com$/i.test(t.hostname)) {
|
|
1767
1778
|
const e = t.pathname.split("/").filter(Boolean).pop() || "", s = !e || /^[ni]-[A-Za-z0-9]+$/.test(e);
|
|
1768
1779
|
return {
|
|
1769
|
-
uri:
|
|
1770
|
-
title: s ?
|
|
1780
|
+
uri: r,
|
|
1781
|
+
title: s ? r : decodeURIComponent(e).replace(/-/g, " "),
|
|
1771
1782
|
photos: !0
|
|
1772
1783
|
};
|
|
1773
1784
|
}
|
|
1774
1785
|
} catch {
|
|
1775
1786
|
}
|
|
1776
|
-
return { uri:
|
|
1787
|
+
return { uri: r, title: r };
|
|
1777
1788
|
}
|
|
1778
|
-
async function
|
|
1779
|
-
const
|
|
1780
|
-
if (!
|
|
1781
|
-
const o = await
|
|
1782
|
-
return t.map((n) => i.get(n) ||
|
|
1789
|
+
async function Ze(r, t, e) {
|
|
1790
|
+
const a = await ((...n) => fetch(...n))(Qe(r, t));
|
|
1791
|
+
if (!a.ok) throw new Error(`search answered ${a.status}`);
|
|
1792
|
+
const o = await a.json(), i = new Map((o.items || []).map((n) => [n.uri, n]));
|
|
1793
|
+
return t.map((n) => i.get(n) || te(n));
|
|
1783
1794
|
}
|
|
1784
|
-
const
|
|
1795
|
+
const Je = b`
|
|
1785
1796
|
.breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
|
|
1786
1797
|
.breadcrumbs a { text-decoration: none; }
|
|
1787
1798
|
.scorehead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 1.4rem 1rem; }
|
|
@@ -1820,8 +1831,8 @@ const Qe = b`
|
|
|
1820
1831
|
.cols { grid-template-columns: 1fr; }
|
|
1821
1832
|
}
|
|
1822
1833
|
`;
|
|
1823
|
-
class
|
|
1824
|
-
static styles = [...j,
|
|
1834
|
+
class ee extends w {
|
|
1835
|
+
static styles = [...j, Je];
|
|
1825
1836
|
static properties = {
|
|
1826
1837
|
...w.properties,
|
|
1827
1838
|
gameId: { type: String, attribute: "game-id" },
|
|
@@ -1835,7 +1846,7 @@ class te extends w {
|
|
|
1835
1846
|
super(), this.gameId = "", this.searchApi = "";
|
|
1836
1847
|
}
|
|
1837
1848
|
async fetchData(t) {
|
|
1838
|
-
const e = await t.getGame(this.gameId), s = Array.isArray(e.coverageUrls) ? e.coverageUrls : [], [
|
|
1849
|
+
const e = await t.getGame(this.gameId), s = Array.isArray(e.coverageUrls) ? e.coverageUrls : [], [a, o, i, n, d, l] = await Promise.all([
|
|
1839
1850
|
t.listSchools(),
|
|
1840
1851
|
t.listTeams({ sport: e.sport }),
|
|
1841
1852
|
t.listConferences(),
|
|
@@ -1843,11 +1854,11 @@ class te extends w {
|
|
|
1843
1854
|
t.listGames({ sport: e.sport, season: e.season }),
|
|
1844
1855
|
// A search outage must not blank the box score — degrade to bare
|
|
1845
1856
|
// links (fetchCoverage already degrades per-URL index misses).
|
|
1846
|
-
s.length ?
|
|
1857
|
+
s.length ? Ze(this.searchApi, s).catch(() => s.map(te)) : Promise.resolve([])
|
|
1847
1858
|
]);
|
|
1848
1859
|
return {
|
|
1849
1860
|
game: e,
|
|
1850
|
-
schools:
|
|
1861
|
+
schools: a.items,
|
|
1851
1862
|
teams: o.items,
|
|
1852
1863
|
conferences: i.items,
|
|
1853
1864
|
rankings: n.items,
|
|
@@ -1868,7 +1879,7 @@ class te extends w {
|
|
|
1868
1879
|
renderView() {
|
|
1869
1880
|
const t = this.data.game;
|
|
1870
1881
|
if (!t) return c`<div class="view"><p class="empty">Game not found.</p></div>`;
|
|
1871
|
-
const e = this.ctx, s = v(this.data.conferences),
|
|
1882
|
+
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 = ut(t), n = (h) => t.state === "final" && i !== h && i !== "tie" ? "opacity:0.45" : "", d = t.conferenceId ? s[t.conferenceId] : null, l = 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));
|
|
1872
1883
|
return c`
|
|
1873
1884
|
${q(this, c`
|
|
1874
1885
|
${G(this)}
|
|
@@ -1879,7 +1890,7 @@ class te extends w {
|
|
|
1879
1890
|
</p>
|
|
1880
1891
|
<div class="card">
|
|
1881
1892
|
<div class="scorehead">
|
|
1882
|
-
${this.teamBlock(e, t, t.awayTeamId,
|
|
1893
|
+
${this.teamBlock(e, t, t.awayTeamId, a, !1)}
|
|
1883
1894
|
<div class="mid">
|
|
1884
1895
|
<div class="bigscore">
|
|
1885
1896
|
<span style=${n("away")}>${t.awayScore}</span>
|
|
@@ -1897,7 +1908,7 @@ class te extends w {
|
|
|
1897
1908
|
</div>
|
|
1898
1909
|
${this.teamBlock(e, t, t.homeTeamId, o, !0)}
|
|
1899
1910
|
</div>
|
|
1900
|
-
${this.renderLineScore(t,
|
|
1911
|
+
${this.renderLineScore(t, a, o)}
|
|
1901
1912
|
${t.notes ? c`<p class="note" style="padding:0 1rem 0.9rem;text-align:center">${t.notes}</p>` : m}
|
|
1902
1913
|
</div>
|
|
1903
1914
|
${(this.data.coverage || []).length ? c`
|
|
@@ -1918,7 +1929,7 @@ class te extends w {
|
|
|
1918
1929
|
</div>` : m}
|
|
1919
1930
|
<div class="section-title">Season context</div>
|
|
1920
1931
|
<div class="cols">
|
|
1921
|
-
${[[t.awayTeamId,
|
|
1932
|
+
${[[t.awayTeamId, a], [t.homeTeamId, o]].map(([h, p]) => this.renderContext(e, h, p))}
|
|
1922
1933
|
</div>
|
|
1923
1934
|
${l.length ? c`
|
|
1924
1935
|
<div class="section-title">Head to head this season</div>
|
|
@@ -1932,25 +1943,25 @@ class te extends w {
|
|
|
1932
1943
|
`)}
|
|
1933
1944
|
`;
|
|
1934
1945
|
}
|
|
1935
|
-
teamBlock(t, e, s,
|
|
1936
|
-
if (!
|
|
1937
|
-
const i = t.teamsById[s], n = t.records[s], d = Q(
|
|
1946
|
+
teamBlock(t, e, s, a, o) {
|
|
1947
|
+
if (!a) return c`<div class="teamblock ${o ? "right" : ""}"><div class="tname">TBD</div></div>`;
|
|
1948
|
+
const i = t.teamsById[s], n = t.records[s], d = Q(a, 58);
|
|
1938
1949
|
return c`
|
|
1939
1950
|
<div class="teamblock ${o ? "right" : ""}">
|
|
1940
|
-
${d ? c`<img class="crest logo" alt="" loading="lazy" src=${d} />` : c`<span class="crest" style="background:${
|
|
1951
|
+
${d ? c`<img class="crest logo" alt="" loading="lazy" src=${d} />` : c`<span class="crest" style="background:${a.colorPrimary || "#030711"};color:${K(a.colorPrimary || "#030711")}">${ft(a)}</span>`}
|
|
1941
1952
|
<div>
|
|
1942
|
-
<div class="tname">${bt(t, s, e.date)}<a href=${g(t.hrefs.school, { id:
|
|
1943
|
-
<div class="trec">${
|
|
1953
|
+
<div class="tname">${bt(t, s, e.date)}<a href=${g(t.hrefs.school, { id: a.id })}>${a.name}</a></div>
|
|
1954
|
+
<div class="trec">${a.mascot || ""} · ${x(n)}${i?.conferenceId ? c` · ${x(n, !0)} conf` : m}</div>
|
|
1944
1955
|
</div>
|
|
1945
1956
|
</div>
|
|
1946
1957
|
`;
|
|
1947
1958
|
}
|
|
1948
1959
|
renderLineScore(t, e, s) {
|
|
1949
|
-
const
|
|
1950
|
-
if (!
|
|
1960
|
+
const a = t.periodScores || [];
|
|
1961
|
+
if (!a.length)
|
|
1951
1962
|
return c`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>`;
|
|
1952
|
-
const o = Math.max(4, ...
|
|
1953
|
-
const p =
|
|
1963
|
+
const o = Math.max(4, ...a.map((l) => l.period)), i = (l) => l <= 4 ? String(l) : `OT${l > 5 ? l - 4 : ""}`, n = (l, h) => {
|
|
1964
|
+
const p = a.find((f) => f.period === h);
|
|
1954
1965
|
return p ? p[l] : t.state === "final" ? 0 : "·";
|
|
1955
1966
|
}, d = (l, h, p) => c`
|
|
1956
1967
|
<tr>
|
|
@@ -1972,14 +1983,14 @@ class te extends w {
|
|
|
1972
1983
|
}
|
|
1973
1984
|
renderContext(t, e, s) {
|
|
1974
1985
|
if (!s) return m;
|
|
1975
|
-
const
|
|
1986
|
+
const a = t.records[e], o = gt(this.data.games, e);
|
|
1976
1987
|
return c`
|
|
1977
1988
|
<div class="card ctxcard">
|
|
1978
1989
|
<div class="who">${H(s)}${s.name}</div>
|
|
1979
1990
|
<div class="row">
|
|
1980
1991
|
<span>Last 5: ${yt(t, e)}</span>
|
|
1981
|
-
<span>Streak: <b>${
|
|
1982
|
-
<span>PF/PA: <b>${
|
|
1992
|
+
<span>Streak: <b>${a ? st(a.results) : "·"}</b></span>
|
|
1993
|
+
<span>PF/PA: <b>${a ? `${a.pf} / ${a.pa}` : "·"}</b></span>
|
|
1983
1994
|
<span>Next: ${o ? c`${y(o.date, { month: "numeric", day: "numeric" })}
|
|
1984
1995
|
${o.homeTeamId === e ? "vs" : "at"} ${Z(t, o.homeTeamId === e ? o.awayTeamId : o.homeTeamId)}` : "·"}</span>
|
|
1985
1996
|
</div>
|
|
@@ -1987,9 +1998,9 @@ class te extends w {
|
|
|
1987
1998
|
`;
|
|
1988
1999
|
}
|
|
1989
2000
|
}
|
|
1990
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore",
|
|
1991
|
-
const
|
|
1992
|
-
class
|
|
2001
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", ee);
|
|
2002
|
+
const Xe = 250, ts = 2;
|
|
2003
|
+
class se extends E {
|
|
1993
2004
|
static properties = {
|
|
1994
2005
|
api: { type: String },
|
|
1995
2006
|
schoolHref: { type: String, attribute: "school-href" },
|
|
@@ -2069,11 +2080,11 @@ class ee extends E {
|
|
|
2069
2080
|
}
|
|
2070
2081
|
onInput(t) {
|
|
2071
2082
|
const e = t.target.value.trim();
|
|
2072
|
-
if (clearTimeout(this.debounceTimer), e.length <
|
|
2083
|
+
if (clearTimeout(this.debounceTimer), e.length < ts) {
|
|
2073
2084
|
this.abortController?.abort(), this.results = [], this.open = !1, this.searched = !1;
|
|
2074
2085
|
return;
|
|
2075
2086
|
}
|
|
2076
|
-
this.debounceTimer = setTimeout(() => this.search(e),
|
|
2087
|
+
this.debounceTimer = setTimeout(() => this.search(e), Xe);
|
|
2077
2088
|
}
|
|
2078
2089
|
async search(t) {
|
|
2079
2090
|
this.abortController?.abort(), this.abortController = new AbortController();
|
|
@@ -2083,8 +2094,8 @@ class ee extends E {
|
|
|
2083
2094
|
});
|
|
2084
2095
|
if (!s.ok)
|
|
2085
2096
|
return;
|
|
2086
|
-
const
|
|
2087
|
-
this.results =
|
|
2097
|
+
const a = await s.json();
|
|
2098
|
+
this.results = a.items || [], this.activeIndex = -1, this.searched = !0, this.open = !0;
|
|
2088
2099
|
} catch (e) {
|
|
2089
2100
|
e.name !== "AbortError" && console.warn("school search failed", e);
|
|
2090
2101
|
}
|
|
@@ -2118,7 +2129,7 @@ class ee extends E {
|
|
|
2118
2129
|
return [t.location, t.county && `${t.county} County`].filter(Boolean).join(" — ");
|
|
2119
2130
|
}
|
|
2120
2131
|
renderOption(t, e) {
|
|
2121
|
-
const s = this.where(t),
|
|
2132
|
+
const s = this.where(t), a = (o) => {
|
|
2122
2133
|
o.preventDefault(), this.go(t);
|
|
2123
2134
|
};
|
|
2124
2135
|
return c`
|
|
@@ -2126,7 +2137,7 @@ class ee extends E {
|
|
|
2126
2137
|
id="school-option-${e}"
|
|
2127
2138
|
role="option"
|
|
2128
2139
|
aria-selected="${e === this.activeIndex ? "true" : "false"}"
|
|
2129
|
-
@pointerdown="${
|
|
2140
|
+
@pointerdown="${a}"
|
|
2130
2141
|
@mousemove="${() => {
|
|
2131
2142
|
this.activeIndex = e;
|
|
2132
2143
|
}}"
|
|
@@ -2140,7 +2151,7 @@ class ee extends E {
|
|
|
2140
2151
|
const t = this.searched && !this.results.length, e = c`<li class="empty">No schools found</li>`;
|
|
2141
2152
|
return c`
|
|
2142
2153
|
<ul id="school-search-listbox" role="listbox" aria-label="Schools">
|
|
2143
|
-
${this.results.map((s,
|
|
2154
|
+
${this.results.map((s, a) => this.renderOption(s, a))}
|
|
2144
2155
|
${t ? e : m}
|
|
2145
2156
|
</ul>
|
|
2146
2157
|
`;
|
|
@@ -2166,22 +2177,22 @@ class ee extends E {
|
|
|
2166
2177
|
`;
|
|
2167
2178
|
}
|
|
2168
2179
|
}
|
|
2169
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search",
|
|
2170
|
-
const
|
|
2171
|
-
"hsot-scores":
|
|
2172
|
-
"hsot-standings":
|
|
2173
|
-
"hsot-rankings":
|
|
2174
|
-
"hsot-school":
|
|
2175
|
-
"hsot-boxscore":
|
|
2176
|
-
"hsot-school-search":
|
|
2180
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search", se);
|
|
2181
|
+
const es = {
|
|
2182
|
+
"hsot-scores": Qt,
|
|
2183
|
+
"hsot-standings": Zt,
|
|
2184
|
+
"hsot-rankings": Jt,
|
|
2185
|
+
"hsot-school": Xt,
|
|
2186
|
+
"hsot-boxscore": ee,
|
|
2187
|
+
"hsot-school-search": se
|
|
2177
2188
|
};
|
|
2178
|
-
function
|
|
2179
|
-
const
|
|
2180
|
-
if (
|
|
2181
|
-
for (const [t, e] of Object.entries(
|
|
2182
|
-
|
|
2189
|
+
function ss() {
|
|
2190
|
+
const r = globalThis?.customElements;
|
|
2191
|
+
if (r)
|
|
2192
|
+
for (const [t, e] of Object.entries(es))
|
|
2193
|
+
r.get(t) || r.define(t, e);
|
|
2183
2194
|
}
|
|
2184
|
-
typeof window < "u" && globalThis.customElements &&
|
|
2195
|
+
typeof window < "u" && globalThis.customElements && ss();
|
|
2185
2196
|
export {
|
|
2186
|
-
|
|
2197
|
+
ss as defineAll
|
|
2187
2198
|
};
|