@wral/hsot-data 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/define.mjs +1 -1
- package/dist/define.standalone.js +175 -145
- package/dist/{hsot-brackets-ClfXvdcH.js → hsot-brackets-CfP_Djqm.js} +149 -119
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const J = globalThis, me = J.ShadowRoot && (J.ShadyCSS === void 0 || J.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ue = /* @__PURE__ */ Symbol(),
|
|
1
|
+
const J = globalThis, me = J.ShadowRoot && (J.ShadyCSS === void 0 || J.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ue = /* @__PURE__ */ Symbol(), Ae = /* @__PURE__ */ new WeakMap();
|
|
2
2
|
let qe = class {
|
|
3
3
|
constructor(e, t, s) {
|
|
4
4
|
if (this._$cssResult$ = !0, s !== ue) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
@@ -9,7 +9,7 @@ let qe = class {
|
|
|
9
9
|
const t = this.t;
|
|
10
10
|
if (me && e === void 0) {
|
|
11
11
|
const s = t !== void 0 && t.length === 1;
|
|
12
|
-
s && (e =
|
|
12
|
+
s && (e = Ae.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), s && Ae.set(t, e));
|
|
13
13
|
}
|
|
14
14
|
return e;
|
|
15
15
|
}
|
|
@@ -30,12 +30,12 @@ const kt = (a) => new qe(typeof a == "string" ? a : a + "", void 0, ue), y = (a,
|
|
|
30
30
|
const s = document.createElement("style"), r = J.litNonce;
|
|
31
31
|
r !== void 0 && s.setAttribute("nonce", r), s.textContent = t.cssText, a.appendChild(s);
|
|
32
32
|
}
|
|
33
|
-
},
|
|
33
|
+
}, Te = me ? (a) => a : (a) => a instanceof CSSStyleSheet ? ((e) => {
|
|
34
34
|
let t = "";
|
|
35
35
|
for (const s of e.cssRules) t += s.cssText;
|
|
36
36
|
return kt(t);
|
|
37
37
|
})(a) : a;
|
|
38
|
-
const { is: _t, defineProperty:
|
|
38
|
+
const { is: _t, defineProperty: At, getOwnPropertyDescriptor: Tt, getOwnPropertyNames: It, getOwnPropertySymbols: Ct, getPrototypeOf: Et } = Object, re = globalThis, Ie = re.trustedTypes, Pt = Ie ? Ie.emptyScript : "", Bt = re.reactiveElementPolyfillSupport, G = (a, e) => a, he = { toAttribute(a, e) {
|
|
39
39
|
switch (e) {
|
|
40
40
|
case Boolean:
|
|
41
41
|
a = a ? Pt : null;
|
|
@@ -75,11 +75,11 @@ let R = class extends HTMLElement {
|
|
|
75
75
|
static createProperty(e, t = Ce) {
|
|
76
76
|
if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
77
77
|
const s = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(e, s, t);
|
|
78
|
-
r !== void 0 &&
|
|
78
|
+
r !== void 0 && At(this.prototype, e, r);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
static getPropertyDescriptor(e, t, s) {
|
|
82
|
-
const { get: r, set: o } =
|
|
82
|
+
const { get: r, set: o } = Tt(this.prototype, e) ?? { get() {
|
|
83
83
|
return this[t];
|
|
84
84
|
}, set(n) {
|
|
85
85
|
this[t] = n;
|
|
@@ -119,8 +119,8 @@ let R = class extends HTMLElement {
|
|
|
119
119
|
const t = [];
|
|
120
120
|
if (Array.isArray(e)) {
|
|
121
121
|
const s = new Set(e.flat(1 / 0).reverse());
|
|
122
|
-
for (const r of s) t.unshift(
|
|
123
|
-
} else e !== void 0 && t.push(
|
|
122
|
+
for (const r of s) t.unshift(Te(r));
|
|
123
|
+
} else e !== void 0 && t.push(Te(e));
|
|
124
124
|
return t;
|
|
125
125
|
}
|
|
126
126
|
static _$Eu(e, t) {
|
|
@@ -247,9 +247,9 @@ let R = class extends HTMLElement {
|
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
249
|
R.elementStyles = [], R.shadowRootOptions = { mode: "open" }, R[G("elementProperties")] = /* @__PURE__ */ new Map(), R[G("finalized")] = /* @__PURE__ */ new Map(), Bt?.({ ReactiveElement: R }), (re.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
-
const fe = globalThis, Ee = (a) => a, X = fe.trustedTypes, Pe = X ? X.createPolicy("lit-html", { createHTML: (a) => a }) : void 0, Ve = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`,
|
|
251
|
-
\f\r]`, H = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Be = /-->/g, De = />/g,
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), Re = /'/g, ze = /"/g,
|
|
250
|
+
const fe = globalThis, Ee = (a) => a, X = fe.trustedTypes, Pe = X ? X.createPolicy("lit-html", { createHTML: (a) => a }) : void 0, Ve = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, Ke = "?" + _, Dt = `<${Ke}>`, C = document, j = () => C.createComment(""), q = (a) => a === null || typeof a != "object" && typeof a != "function", ge = Array.isArray, Rt = (a) => ge(a) || typeof a?.[Symbol.iterator] == "function", ce = `[
|
|
251
|
+
\f\r]`, H = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Be = /-->/g, De = />/g, T = RegExp(`>|${ce}(?:([^\\s"'>=/]+)(${ce}*=${ce}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Re = /'/g, ze = /"/g, Ye = /^(?:script|style|textarea|title)$/i, Qe = (a) => (e, ...t) => ({ _$litType$: a, strings: e, values: t }), l = Qe(1), Ne = Qe(2), F = /* @__PURE__ */ Symbol.for("lit-noChange"), m = /* @__PURE__ */ Symbol.for("lit-nothing"), Fe = /* @__PURE__ */ new WeakMap(), I = C.createTreeWalker(C, 129);
|
|
253
253
|
function Ze(a, e) {
|
|
254
254
|
if (!ge(a) || !a.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
255
|
return Pe !== void 0 ? Pe.createHTML(e) : e;
|
|
@@ -260,8 +260,8 @@ const zt = (a, e) => {
|
|
|
260
260
|
for (let i = 0; i < t; i++) {
|
|
261
261
|
const c = a[i];
|
|
262
262
|
let p, d, h = -1, u = 0;
|
|
263
|
-
for (; u < c.length && (n.lastIndex = u, d = n.exec(c), d !== null); ) u = n.lastIndex, n === H ? d[1] === "!--" ? n = Be : d[1] !== void 0 ? n = De : d[2] !== void 0 ? (
|
|
264
|
-
const f = n ===
|
|
263
|
+
for (; u < c.length && (n.lastIndex = u, d = n.exec(c), d !== null); ) u = n.lastIndex, n === H ? d[1] === "!--" ? n = Be : d[1] !== void 0 ? n = De : d[2] !== void 0 ? (Ye.test(d[2]) && (r = RegExp("</" + d[2], "g")), n = T) : d[3] !== void 0 && (n = T) : n === T ? d[0] === ">" ? (n = r ?? H, h = -1) : d[1] === void 0 ? h = -2 : (h = n.lastIndex - d[2].length, p = d[1], n = d[3] === void 0 ? T : d[3] === '"' ? ze : Re) : n === ze || n === Re ? n = T : n === Be || n === De ? n = H : (n = T, r = void 0);
|
|
264
|
+
const f = n === T && a[i + 1].startsWith("/>") ? " " : "";
|
|
265
265
|
o += n === H ? c + Dt : h >= 0 ? (s.push(p), c.slice(0, h) + Ve + c.slice(h) + _ + f) : c + _ + (h === -2 ? i : f);
|
|
266
266
|
}
|
|
267
267
|
return [Ze(a, o + (a[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), s];
|
|
@@ -282,7 +282,7 @@ class W {
|
|
|
282
282
|
const u = d[n++], f = r.getAttribute(h).split(_), g = /([.?@])?(.*)/.exec(u);
|
|
283
283
|
c.push({ type: 1, index: o, name: g[2], strings: f, ctor: g[1] === "." ? Ft : g[1] === "?" ? Mt : g[1] === "@" ? Ot : oe }), r.removeAttribute(h);
|
|
284
284
|
} else h.startsWith(_) && (c.push({ type: 6, index: o }), r.removeAttribute(h));
|
|
285
|
-
if (
|
|
285
|
+
if (Ye.test(r.tagName)) {
|
|
286
286
|
const h = r.textContent.split(_), u = h.length - 1;
|
|
287
287
|
if (u > 0) {
|
|
288
288
|
r.textContent = X ? X.emptyScript : "";
|
|
@@ -290,7 +290,7 @@ class W {
|
|
|
290
290
|
r.append(h[u], j());
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
} else if (r.nodeType === 8) if (r.data ===
|
|
293
|
+
} else if (r.nodeType === 8) if (r.data === Ke) c.push({ type: 2, index: o });
|
|
294
294
|
else {
|
|
295
295
|
let h = -1;
|
|
296
296
|
for (; (h = r.data.indexOf(_, h + 1)) !== -1; ) c.push({ type: 7, index: o }), h += _.length - 1;
|
|
@@ -326,7 +326,7 @@ class Nt {
|
|
|
326
326
|
for (; c !== void 0; ) {
|
|
327
327
|
if (n === c.index) {
|
|
328
328
|
let p;
|
|
329
|
-
c.type === 2 ? p = new
|
|
329
|
+
c.type === 2 ? p = new K(o, o.nextSibling, this, e) : c.type === 1 ? p = new c.ctor(o, c.name, c.strings, this, e) : c.type === 6 && (p = new Ut(o, this, e)), this._$AV.push(p), c = s[++i];
|
|
330
330
|
}
|
|
331
331
|
n !== c?.index && (o = I.nextNode(), n++);
|
|
332
332
|
}
|
|
@@ -337,7 +337,7 @@ class Nt {
|
|
|
337
337
|
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(e, s, t), t += s.strings.length - 2) : s._$AI(e[t])), t++;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
class
|
|
340
|
+
class K {
|
|
341
341
|
get _$AU() {
|
|
342
342
|
return this._$AM?._$AU ?? this._$Cv;
|
|
343
343
|
}
|
|
@@ -383,7 +383,7 @@ class Y {
|
|
|
383
383
|
ge(this._$AH) || (this._$AH = [], this._$AR());
|
|
384
384
|
const t = this._$AH;
|
|
385
385
|
let s, r = 0;
|
|
386
|
-
for (const o of e) r === t.length ? t.push(s = new
|
|
386
|
+
for (const o of e) r === t.length ? t.push(s = new K(this.O(j()), this.O(j()), this, this.options)) : s = t[r], s._$AI(o), r++;
|
|
387
387
|
r < t.length && (this._$AR(s && s._$AB.nextSibling, r), t.length = r);
|
|
388
388
|
}
|
|
389
389
|
_$AR(e = this._$AA.nextSibling, t) {
|
|
@@ -462,13 +462,13 @@ class Ut {
|
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
464
|
const Ht = fe.litHtmlPolyfillSupport;
|
|
465
|
-
Ht?.(W,
|
|
465
|
+
Ht?.(W, K), (fe.litHtmlVersions ??= []).push("3.3.3");
|
|
466
466
|
const Lt = (a, e, t) => {
|
|
467
467
|
const s = t?.renderBefore ?? e;
|
|
468
468
|
let r = s._$litPart$;
|
|
469
469
|
if (r === void 0) {
|
|
470
470
|
const o = t?.renderBefore ?? null;
|
|
471
|
-
s._$litPart$ = r = new
|
|
471
|
+
s._$litPart$ = r = new K(e.insertBefore(j(), o), o, void 0, t ?? {});
|
|
472
472
|
}
|
|
473
473
|
return r._$AI(a), r;
|
|
474
474
|
};
|
|
@@ -584,10 +584,10 @@ function $e(a) {
|
|
|
584
584
|
function Vt(a) {
|
|
585
585
|
return a ? `${Math.floor(a / 12)}-${a % 12}` : "·";
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function Kt(a) {
|
|
588
588
|
return (Array.isArray(a?.positions) ? a.positions : String(a?.position ?? "").split(/[/,]/)).map((t) => String(t ?? "").trim()).filter(Boolean).join("/");
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function Y(a = /* @__PURE__ */ new Date()) {
|
|
591
591
|
const e = a.getFullYear();
|
|
592
592
|
return a.getMonth() >= 6 ? `${e}-${e + 1}` : `${e - 1}-${e}`;
|
|
593
593
|
}
|
|
@@ -595,7 +595,7 @@ function be(a = /* @__PURE__ */ new Date()) {
|
|
|
595
595
|
const e = (t) => String(t).padStart(2, "0");
|
|
596
596
|
return `${a.getFullYear()}-${e(a.getMonth() + 1)}-${e(a.getDate())}`;
|
|
597
597
|
}
|
|
598
|
-
function
|
|
598
|
+
function Yt(a, e = be()) {
|
|
599
599
|
const t = [...new Set((a || []).filter(Boolean))].sort();
|
|
600
600
|
if (!t.length || t.includes(e)) return e;
|
|
601
601
|
const s = t.filter((r) => r < e);
|
|
@@ -647,7 +647,7 @@ function pe(a) {
|
|
|
647
647
|
return Zt.filter((t) => e.has(t));
|
|
648
648
|
}
|
|
649
649
|
const Jt = (a) => pe(a).length === 2, Xt = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
|
|
650
|
-
function
|
|
650
|
+
function A(a) {
|
|
651
651
|
let e = String(a || "").replace(/^[a-z][a-z0-9+.-]*:\/\/[^/#?]*/i, "");
|
|
652
652
|
const t = e.indexOf("#");
|
|
653
653
|
let s = "";
|
|
@@ -659,15 +659,15 @@ function at() {
|
|
|
659
659
|
const a = globalThis.location;
|
|
660
660
|
if (!a) return "";
|
|
661
661
|
const e = (a.hash || "").startsWith("#/") ? a.hash : "";
|
|
662
|
-
return
|
|
662
|
+
return A((a.pathname || "") + e);
|
|
663
663
|
}
|
|
664
664
|
function es(a, e, t) {
|
|
665
665
|
if (!t) return null;
|
|
666
|
-
const s =
|
|
666
|
+
const s = A(a);
|
|
667
667
|
if (!s) return null;
|
|
668
|
-
const r =
|
|
668
|
+
const r = A(v(e.game, { sport: t, id: "" })), o = A(v(e.school, { id: "" }));
|
|
669
669
|
if (s === r || s.startsWith(`${r}/`) || s === o || s.startsWith(`${o}/`)) return null;
|
|
670
|
-
const n =
|
|
670
|
+
const n = A(v(e.section, { sport: t, view: "" }));
|
|
671
671
|
if (s === n) return "";
|
|
672
672
|
if (!s.startsWith(`${n}/`)) return null;
|
|
673
673
|
const i = s.slice(n.length + 1), c = i.split("/");
|
|
@@ -687,9 +687,9 @@ function ts(a, e, t) {
|
|
|
687
687
|
];
|
|
688
688
|
}
|
|
689
689
|
function ss(a, e = at()) {
|
|
690
|
-
const t =
|
|
690
|
+
const t = A(e);
|
|
691
691
|
for (const s of a.querySelectorAll(':scope > a[slot="nav"]'))
|
|
692
|
-
t &&
|
|
692
|
+
t && A(s.getAttribute("href")) === t ? s.setAttribute("aria-current", "page") : s.removeAttribute("aria-current");
|
|
693
693
|
}
|
|
694
694
|
class w extends N {
|
|
695
695
|
static properties = {
|
|
@@ -1122,7 +1122,7 @@ function le(a, e, { title: t, sub: s, teams: r }) {
|
|
|
1122
1122
|
<div class="navrow">
|
|
1123
1123
|
<slot name="nav">
|
|
1124
1124
|
${ts(e.sport, r, e.hrefs).map((c) => l`<a href=${c.href}
|
|
1125
|
-
aria-current=${o &&
|
|
1125
|
+
aria-current=${o && A(c.href) === o ? "page" : m}>${c.label}</a>`)}
|
|
1126
1126
|
</slot>
|
|
1127
1127
|
</div>
|
|
1128
1128
|
</nav>` : m}
|
|
@@ -1182,20 +1182,67 @@ function nt(a, e, t) {
|
|
|
1182
1182
|
const s = e.homeTeamId === t ? e.awayTeamId : e.homeTeamId, r = e.homeTeamId === t ? "vs" : "at";
|
|
1183
1183
|
return l`${e.state === "live" ? l`<span class="pill live">Live</span> ` : l`${x(e.date, { month: "numeric", day: "numeric" })} `}${r} ${se(a, s)}`;
|
|
1184
1184
|
}
|
|
1185
|
-
const us =
|
|
1185
|
+
const us = "https://api.wral.com/search";
|
|
1186
|
+
function fs(a) {
|
|
1187
|
+
return a.map((e) => `uri:"${e}"`).join(" OR ");
|
|
1188
|
+
}
|
|
1189
|
+
function gs(a, e) {
|
|
1190
|
+
const t = String(a || us).replace(/\/+$/, ""), s = new URLSearchParams({ query: fs(e), sort: "score", lang: "en" });
|
|
1191
|
+
return `${t}/v1/query?${s}`;
|
|
1192
|
+
}
|
|
1193
|
+
function it(a) {
|
|
1194
|
+
try {
|
|
1195
|
+
const e = new URL(a);
|
|
1196
|
+
if (/(^|\.)smugmug\.com$/i.test(e.hostname)) {
|
|
1197
|
+
const t = e.pathname.split("/").filter(Boolean).pop() || "", s = !t || /^[ni]-[A-Za-z0-9]+$/.test(t);
|
|
1198
|
+
return {
|
|
1199
|
+
uri: a,
|
|
1200
|
+
title: s ? a : decodeURIComponent(t).replace(/-/g, " "),
|
|
1201
|
+
photos: !0
|
|
1202
|
+
};
|
|
1203
|
+
}
|
|
1204
|
+
} catch {
|
|
1205
|
+
}
|
|
1206
|
+
return { uri: a, title: a };
|
|
1207
|
+
}
|
|
1208
|
+
async function vs(a, e, t) {
|
|
1209
|
+
const r = await ((...i) => fetch(...i))(gs(a, e));
|
|
1210
|
+
if (!r.ok) throw new Error(`search answered ${r.status}`);
|
|
1211
|
+
const o = await r.json(), n = new Map((o.items || []).map((i) => [i.uri, i]));
|
|
1212
|
+
return e.map((i) => n.get(i) || it(i));
|
|
1213
|
+
}
|
|
1214
|
+
function $s(a) {
|
|
1215
|
+
try {
|
|
1216
|
+
const e = new URL(a);
|
|
1217
|
+
if (/(^|\.)smugmug\.com$/i.test(e.hostname)) return "Photos";
|
|
1218
|
+
const t = e.pathname.split("/").filter(Boolean)[0] || "";
|
|
1219
|
+
if (t === "video") return "Video";
|
|
1220
|
+
if (t === "news" || t === "story") return "Story";
|
|
1221
|
+
} catch {
|
|
1222
|
+
}
|
|
1223
|
+
return "Coverage";
|
|
1224
|
+
}
|
|
1225
|
+
function bs(a) {
|
|
1226
|
+
const e = /* @__PURE__ */ new Map();
|
|
1227
|
+
return (Array.isArray(a) ? a : []).filter((t) => /^https?:\/\//i.test(String(t || ""))).map((t) => {
|
|
1228
|
+
const s = $s(t), r = (e.get(s) || 0) + 1;
|
|
1229
|
+
return e.set(s, r), { href: t, label: r > 1 ? `${s} ${r}` : s };
|
|
1230
|
+
});
|
|
1231
|
+
}
|
|
1232
|
+
const ys = ["all", "conferences"], lt = "all", He = (a) => ys.includes(a) ? a : lt, ct = Number.MAX_SAFE_INTEGER, ht = (a, e, t) => {
|
|
1186
1233
|
const s = a[t];
|
|
1187
1234
|
return s && e[s.schoolId] || null;
|
|
1188
1235
|
};
|
|
1189
|
-
function
|
|
1236
|
+
function ws(a, e) {
|
|
1190
1237
|
const t = (a || []).map((s) => e[s.schoolId]?.areaCode).filter(Boolean);
|
|
1191
1238
|
return [...new Set(t)].sort();
|
|
1192
1239
|
}
|
|
1193
|
-
function
|
|
1194
|
-
return e ? [a.awayTeamId, a.homeTeamId].some((r) =>
|
|
1240
|
+
function xs(a, e, t, s) {
|
|
1241
|
+
return e ? [a.awayTeamId, a.homeTeamId].some((r) => ht(t, s, r)?.areaCode === e) : !0;
|
|
1195
1242
|
}
|
|
1196
|
-
function
|
|
1197
|
-
const r = (i) =>
|
|
1198
|
-
rank: e(i) ||
|
|
1243
|
+
function ks(a, e, t, s) {
|
|
1244
|
+
const r = (i) => ht(t, s, i)?.name || "", o = (i, c) => !i - !c || Xe(i, c), n = new Map((a || []).map((i) => [i, {
|
|
1245
|
+
rank: e(i) || ct,
|
|
1199
1246
|
away: r(i.awayTeamId),
|
|
1200
1247
|
home: r(i.homeTeamId)
|
|
1201
1248
|
}]));
|
|
@@ -1204,25 +1251,25 @@ function vs(a, e, t, s) {
|
|
|
1204
1251
|
return p.rank - d.rank || o(p.away, d.away) || o(p.home, d.home) || String(i.time || "").localeCompare(String(c.time || ""));
|
|
1205
1252
|
});
|
|
1206
1253
|
}
|
|
1207
|
-
function
|
|
1208
|
-
const t = new Map((a || []).map((r) => [r, e(r) ||
|
|
1254
|
+
function Ss(a, e) {
|
|
1255
|
+
const t = new Map((a || []).map((r) => [r, e(r) || ct])), s = (r) => r.state === "live" ? 0 : 1;
|
|
1209
1256
|
return [...t.keys()].sort((r, o) => s(r) - s(o) || t.get(r) - t.get(o));
|
|
1210
1257
|
}
|
|
1211
|
-
function
|
|
1258
|
+
function _s(a, e) {
|
|
1212
1259
|
if (a.gameType === "conference" && a.conferenceId) {
|
|
1213
1260
|
const t = e[a.conferenceId] || null;
|
|
1214
1261
|
return { name: t?.name || "Conference", conference: t };
|
|
1215
1262
|
}
|
|
1216
1263
|
return a.gameType === "playoff" ? { name: "Playoffs", conference: null } : a.gameType === "scrimmage" ? { name: "Scrimmages", conference: null } : { name: "Nonconference", conference: null };
|
|
1217
1264
|
}
|
|
1218
|
-
function
|
|
1265
|
+
function As(a, e) {
|
|
1219
1266
|
const t = /* @__PURE__ */ new Map();
|
|
1220
1267
|
return (a || []).forEach((s) => {
|
|
1221
|
-
const { name: r, conference: o } =
|
|
1268
|
+
const { name: r, conference: o } = _s(s, e);
|
|
1222
1269
|
t.has(r) || t.set(r, { name: r, conference: o, games: [] }), t.get(r).games.push(s);
|
|
1223
1270
|
}), [...t.values()];
|
|
1224
1271
|
}
|
|
1225
|
-
const
|
|
1272
|
+
const Ts = y`
|
|
1226
1273
|
.toolbar.filters { gap: 0.5rem 1.1rem; }
|
|
1227
1274
|
.filters [role="group"] { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
|
|
1228
1275
|
.filters .asof { margin-right: 0.1rem; }
|
|
@@ -1231,9 +1278,14 @@ const ws = y`
|
|
|
1231
1278
|
@media (max-width: 480px) { .filters .asof { flex-basis: 100%; } }
|
|
1232
1279
|
/* Conference headings carry the standings cards' classification pills. */
|
|
1233
1280
|
.section-title .pill { margin-left: 0.3rem; vertical-align: 0.1em; }
|
|
1281
|
+
/* The desk's coverage links ride in one group with the box-score link, in
|
|
1282
|
+
its style, so a narrow row wraps them together instead of leaving a
|
|
1283
|
+
lone "Story" beside the matchup and "Box score" on the next line. */
|
|
1284
|
+
.gamelist .links { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.6rem; }
|
|
1285
|
+
.gamelist .links a { font-size: 0.78rem; }
|
|
1234
1286
|
`;
|
|
1235
|
-
class
|
|
1236
|
-
static styles = [...U,
|
|
1287
|
+
class dt extends w {
|
|
1288
|
+
static styles = [...U, Ts];
|
|
1237
1289
|
static properties = {
|
|
1238
1290
|
...w.properties,
|
|
1239
1291
|
sport: { type: String },
|
|
@@ -1251,14 +1303,14 @@ class ht extends w {
|
|
|
1251
1303
|
!this.date && e.get("date") && (this.date = e.get("date")), !this.view && e.get("view") && (this.view = e.get("view")), !this.areaCode && e.get("area") && (this.areaCode = e.get("area")), this._datePinned = !!this.date;
|
|
1252
1304
|
}
|
|
1253
1305
|
async fetchData(e) {
|
|
1254
|
-
const t = this.season ||
|
|
1306
|
+
const t = this.season || Y(), [s, r, o, n, i] = await Promise.all([
|
|
1255
1307
|
e.listSchools(),
|
|
1256
1308
|
e.listTeams({ sport: this.sport }),
|
|
1257
1309
|
e.listConferences(),
|
|
1258
1310
|
e.listGames({ sport: this.sport, season: t }),
|
|
1259
1311
|
e.listRankings({ sport: this.sport })
|
|
1260
1312
|
]);
|
|
1261
|
-
return this._datePinned || (this.date =
|
|
1313
|
+
return this._datePinned || (this.date = Yt(n.items.map((c) => c.date)), this._datePinned = !0), {
|
|
1262
1314
|
season: t,
|
|
1263
1315
|
schools: s.items,
|
|
1264
1316
|
teams: r.items,
|
|
@@ -1282,18 +1334,18 @@ class ht extends w {
|
|
|
1282
1334
|
e !== null && (this.view = e), t !== null && (this.areaCode = t);
|
|
1283
1335
|
try {
|
|
1284
1336
|
const s = new URL(globalThis.location.href), r = (o, n, i) => n && n !== i ? s.searchParams.set(o, n) : s.searchParams.delete(o);
|
|
1285
|
-
r("view", He(this.view),
|
|
1337
|
+
r("view", He(this.view), lt), r("area", this.areaCode, ""), globalThis.history?.replaceState(null, "", s);
|
|
1286
1338
|
} catch {
|
|
1287
1339
|
}
|
|
1288
1340
|
}
|
|
1289
1341
|
renderView() {
|
|
1290
|
-
const e = this.ctx, t = b(this.data.conferences), s = [...new Set(this.data.games.map((h) => h.date).filter(Boolean))].sort(), r = He(this.view), o =
|
|
1342
|
+
const e = this.ctx, t = b(this.data.conferences), s = [...new Set(this.data.games.map((h) => h.date).filter(Boolean))].sort(), r = He(this.view), o = ws(this.data.teams, e.schoolsById), n = o.includes(this.areaCode) ? this.areaCode : "", i = (h) => {
|
|
1291
1343
|
const u = [h.awayTeamId, h.homeTeamId].map((f) => xe(e.rankings, e.teamsById, f, this.sport, h.date)).filter(Boolean);
|
|
1292
1344
|
return u.length ? Math.min(...u) : null;
|
|
1293
|
-
}, c = this.data.games.filter((h) => h.date === this.date), p = c.filter((h) =>
|
|
1345
|
+
}, c = this.data.games.filter((h) => h.date === this.date), p = c.filter((h) => xs(h, n, e.teamsById, e.schoolsById)), d = r === "conferences" ? As(Ss(p, i), t) : p.length ? [{
|
|
1294
1346
|
name: n ? `All games · ${n}` : "All games",
|
|
1295
1347
|
conference: null,
|
|
1296
|
-
games:
|
|
1348
|
+
games: ks(p, i, e.teamsById, e.schoolsById)
|
|
1297
1349
|
}] : [];
|
|
1298
1350
|
return l`
|
|
1299
1351
|
${le(this, e, {
|
|
@@ -1353,6 +1405,10 @@ class ht extends w {
|
|
|
1353
1405
|
// Each team's score rides in a block beside its name (reader feedback:
|
|
1354
1406
|
// a lone score column on the far right read as detached from the teams).
|
|
1355
1407
|
// Scheduled games carry their start time on the status pill alone.
|
|
1408
|
+
// The desk's coverage links (Game.coverageUrls, already on the games
|
|
1409
|
+
// list, so they cost no request) sit before the box score link, labelled
|
|
1410
|
+
// from each URL's shape (lib/search.mjs) rather than the site search the
|
|
1411
|
+
// box score's coverage cards query.
|
|
1356
1412
|
renderGame(e, t) {
|
|
1357
1413
|
const s = t.state === "final" || t.state === "live", r = (n, i, c = m) => l`<span class="side">${ae(e, n, t.date)}${s ? l`<span class="score">${i}</span>` : m}${c}</span>`, o = hs(t);
|
|
1358
1414
|
return l`
|
|
@@ -1362,13 +1418,16 @@ class ht extends w {
|
|
|
1362
1418
|
${o ? l`<span class="ff">${z(e, o === "home" ? t.homeTeamId : t.awayTeamId)} forfeited</span>` : m}
|
|
1363
1419
|
<span class="where">${t.venue || ""}</span>
|
|
1364
1420
|
${t.broadcast ? l`<span class="pill class">${t.broadcast}</span>` : m}
|
|
1365
|
-
<
|
|
1421
|
+
<span class="links">
|
|
1422
|
+
${bs(t.coverageUrls).map((n) => l`<a href=${n.href}>${n.label}</a>`)}
|
|
1423
|
+
<a class="box" href=${v(e.hrefs.game, { sport: this.sport, id: t.id })}>Box score →</a>
|
|
1424
|
+
</span>
|
|
1366
1425
|
</li>
|
|
1367
1426
|
`;
|
|
1368
1427
|
}
|
|
1369
1428
|
}
|
|
1370
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores",
|
|
1371
|
-
class
|
|
1429
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", dt);
|
|
1430
|
+
class pt extends w {
|
|
1372
1431
|
static styles = U;
|
|
1373
1432
|
static properties = {
|
|
1374
1433
|
...w.properties,
|
|
@@ -1393,7 +1452,7 @@ class dt extends w {
|
|
|
1393
1452
|
return e.length < 2 ? "" : e.includes(this.pickedGender) ? this.pickedGender : e[0];
|
|
1394
1453
|
}
|
|
1395
1454
|
async fetchData(e) {
|
|
1396
|
-
const t = this.season ||
|
|
1455
|
+
const t = this.season || Y(), [s, r, o, n, i] = await Promise.all([
|
|
1397
1456
|
e.listConferences({ active: !0 }),
|
|
1398
1457
|
e.listSchools(),
|
|
1399
1458
|
// Deliberately NOT gender-filtered: the sub-nav decides whether to
|
|
@@ -1520,8 +1579,8 @@ class dt extends w {
|
|
|
1520
1579
|
`;
|
|
1521
1580
|
}
|
|
1522
1581
|
}
|
|
1523
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings",
|
|
1524
|
-
const
|
|
1582
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", pt);
|
|
1583
|
+
const Is = y`
|
|
1525
1584
|
.hero1 {
|
|
1526
1585
|
border-radius: var(--hsot-radius-md); color: var(--hsot-white);
|
|
1527
1586
|
padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.2rem;
|
|
@@ -1538,8 +1597,8 @@ const xs = y`
|
|
|
1538
1597
|
.delta.new { background: var(--hsot-straw); color: #6b5900; border-radius: var(--hsot-radius-xs); padding: 0.1rem 0.3rem; font-size: 0.7rem; }
|
|
1539
1598
|
.sparkline { vertical-align: middle; }
|
|
1540
1599
|
`;
|
|
1541
|
-
class
|
|
1542
|
-
static styles = [...U,
|
|
1600
|
+
class mt extends w {
|
|
1601
|
+
static styles = [...U, Is];
|
|
1543
1602
|
static properties = {
|
|
1544
1603
|
...w.properties,
|
|
1545
1604
|
sport: { type: String },
|
|
@@ -1556,7 +1615,7 @@ class pt extends w {
|
|
|
1556
1615
|
e && (this.pollDate = e);
|
|
1557
1616
|
}
|
|
1558
1617
|
async fetchData(e) {
|
|
1559
|
-
const t = this.season ||
|
|
1618
|
+
const t = this.season || Y(), [s, r, o, n, i] = await Promise.all([
|
|
1560
1619
|
e.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
|
|
1561
1620
|
e.listSchools(),
|
|
1562
1621
|
e.listTeams({ sport: this.sport }),
|
|
@@ -1693,8 +1752,8 @@ class pt extends w {
|
|
|
1693
1752
|
`;
|
|
1694
1753
|
}
|
|
1695
1754
|
}
|
|
1696
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings",
|
|
1697
|
-
const
|
|
1755
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", mt);
|
|
1756
|
+
const Cs = y`
|
|
1698
1757
|
.schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
|
|
1699
1758
|
.schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
|
|
1700
1759
|
.schoolhero .crest {
|
|
@@ -1748,8 +1807,8 @@ const ks = y`
|
|
|
1748
1807
|
table.data.roster .sub { display: block; font-weight: 400; font-size: 0.78rem; color: var(--hsot-gray-5); }
|
|
1749
1808
|
}
|
|
1750
1809
|
`;
|
|
1751
|
-
class
|
|
1752
|
-
static styles = [...U,
|
|
1810
|
+
class ut extends w {
|
|
1811
|
+
static styles = [...U, Cs];
|
|
1753
1812
|
static properties = {
|
|
1754
1813
|
...w.properties,
|
|
1755
1814
|
schoolId: { type: String, attribute: "school-id" },
|
|
@@ -1767,7 +1826,7 @@ class mt extends w {
|
|
|
1767
1826
|
t && !this.sport && (this.sport = t), s && !this.gender && (this.gender = s);
|
|
1768
1827
|
}
|
|
1769
1828
|
async fetchData(e) {
|
|
1770
|
-
const t = this.season ||
|
|
1829
|
+
const t = this.season || Y(), s = await e.getSchool(this.schoolId), o = (await e.listTeams({ schoolId: this.schoolId })).items, n = this.sport || "football", i = o.find(($) => $.id === this.activeTeamId) || o.find(($) => $.sport === n && tt($, this.gender)) || o.find(($) => $.sport === n) || o[0] || null, [c, p, d, h, u, f, g] = await Promise.all([
|
|
1771
1830
|
i ? e.listGames({ sport: i.sport, season: t }) : Promise.resolve({ items: [] }),
|
|
1772
1831
|
i ? e.listTeams({ sport: i.sport }) : Promise.resolve({ items: [] }),
|
|
1773
1832
|
e.listSchools(),
|
|
@@ -1912,7 +1971,7 @@ class mt extends w {
|
|
|
1912
1971
|
${i.map((p) => {
|
|
1913
1972
|
const d = n[p.playerId];
|
|
1914
1973
|
if (!d) return m;
|
|
1915
|
-
const h =
|
|
1974
|
+
const h = Kt(p), u = [h, d.classOf].filter(Boolean).join(" · ") || "·";
|
|
1916
1975
|
return l`<tr>
|
|
1917
1976
|
<td class="num mut">${p.number ?? "·"}</td>
|
|
1918
1977
|
<td class="player" style="font-weight:500">${d.firstName} ${d.lastName}<span class="sub">${u}</span></td>
|
|
@@ -1928,8 +1987,8 @@ class mt extends w {
|
|
|
1928
1987
|
`;
|
|
1929
1988
|
}
|
|
1930
1989
|
}
|
|
1931
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school",
|
|
1932
|
-
const
|
|
1990
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", ut);
|
|
1991
|
+
const ft = {
|
|
1933
1992
|
football: ["quarters", 4],
|
|
1934
1993
|
flag_football: ["quarters", 4],
|
|
1935
1994
|
basketball: ["quarters", 4],
|
|
@@ -1940,30 +1999,30 @@ const ut = {
|
|
|
1940
1999
|
softball: ["innings", 7],
|
|
1941
2000
|
volleyball: ["sets", 3]
|
|
1942
2001
|
};
|
|
1943
|
-
function
|
|
1944
|
-
return (
|
|
2002
|
+
function gt(a) {
|
|
2003
|
+
return (ft[a] || ["quarters", 4])[0];
|
|
1945
2004
|
}
|
|
1946
2005
|
function _e(a) {
|
|
1947
|
-
return (
|
|
2006
|
+
return (ft[a] || ["quarters", 4])[1];
|
|
1948
2007
|
}
|
|
1949
|
-
function
|
|
1950
|
-
const t =
|
|
2008
|
+
function Es(a, e) {
|
|
2009
|
+
const t = gt(a), s = _e(a);
|
|
1951
2010
|
if (e <= s || t === "innings" || t === "sets") return String(e);
|
|
1952
2011
|
const r = e - s;
|
|
1953
2012
|
return `OT${r > 1 ? r : ""}`;
|
|
1954
2013
|
}
|
|
1955
|
-
function
|
|
2014
|
+
function Ps(a, e) {
|
|
1956
2015
|
const t = String(a ?? "").trim();
|
|
1957
2016
|
let s;
|
|
1958
|
-
return (s = /^(\d+)Q$/i.exec(t)) || (s = /^(\d+)H$/i.exec(t)) ? Number(s[1]) : /^half$/i.test(t) ?
|
|
2017
|
+
return (s = /^(\d+)Q$/i.exec(t)) || (s = /^(\d+)H$/i.exec(t)) ? Number(s[1]) : /^half$/i.test(t) ? gt(e) === "halves" ? 1 : 2 : (s = /^(\d*)OT(\d*)$/i.exec(t)) ? _e(e) + Number(s[1] || s[2] || 1) : (s = /^[TB](\d+)$/i.exec(t)) || (s = /^(\d+)(?:st|nd|rd|th)\s*set$/i.exec(t)) || (s = /^set\s*(\d+)$/i.exec(t)) ? Number(s[1]) : null;
|
|
1959
2018
|
}
|
|
1960
2019
|
const Z = (a) => Number.isInteger(a) && a >= 0 ? a : null;
|
|
1961
|
-
function
|
|
2020
|
+
function Bs(a) {
|
|
1962
2021
|
const e = Array.isArray(a?.scoringPlays) ? a.scoringPlays : [];
|
|
1963
2022
|
if (!e.length) return null;
|
|
1964
2023
|
const t = a.sport, s = /* @__PURE__ */ new Map();
|
|
1965
2024
|
for (const h of e) {
|
|
1966
|
-
const u =
|
|
2025
|
+
const u = Ps(h?.period, t), f = Z(h?.homeScore), g = Z(h?.awayScore);
|
|
1967
2026
|
if (!u || f === null || g === null) return null;
|
|
1968
2027
|
const $ = s.get(u) || { home: 0, away: 0 };
|
|
1969
2028
|
$.home = Math.max($.home, f), $.away = Math.max($.away, g), s.set(u, $);
|
|
@@ -1977,41 +2036,12 @@ function Ts(a) {
|
|
|
1977
2036
|
const c = Z(a.homeScore) ?? 0, p = Z(a.awayScore) ?? 0, d = n && i.home === c && i.away === p;
|
|
1978
2037
|
return n = n && i.home <= c && i.away <= p, { periods: o, reconciled: d, consistent: n };
|
|
1979
2038
|
}
|
|
1980
|
-
function
|
|
2039
|
+
function Ds(a) {
|
|
1981
2040
|
if (Array.isArray(a?.periodScores) && a.periodScores.length) return a.periodScores;
|
|
1982
|
-
const e =
|
|
2041
|
+
const e = Bs(a);
|
|
1983
2042
|
return e ? a.state === "final" ? e.reconciled ? e.periods : null : e.consistent ? e.periods : null : null;
|
|
1984
2043
|
}
|
|
1985
|
-
const
|
|
1986
|
-
function Cs(a) {
|
|
1987
|
-
return a.map((e) => `uri:"${e}"`).join(" OR ");
|
|
1988
|
-
}
|
|
1989
|
-
function Es(a, e) {
|
|
1990
|
-
const t = String(a || Is).replace(/\/+$/, ""), s = new URLSearchParams({ query: Cs(e), sort: "score", lang: "en" });
|
|
1991
|
-
return `${t}/v1/query?${s}`;
|
|
1992
|
-
}
|
|
1993
|
-
function gt(a) {
|
|
1994
|
-
try {
|
|
1995
|
-
const e = new URL(a);
|
|
1996
|
-
if (/(^|\.)smugmug\.com$/i.test(e.hostname)) {
|
|
1997
|
-
const t = e.pathname.split("/").filter(Boolean).pop() || "", s = !t || /^[ni]-[A-Za-z0-9]+$/.test(t);
|
|
1998
|
-
return {
|
|
1999
|
-
uri: a,
|
|
2000
|
-
title: s ? a : decodeURIComponent(t).replace(/-/g, " "),
|
|
2001
|
-
photos: !0
|
|
2002
|
-
};
|
|
2003
|
-
}
|
|
2004
|
-
} catch {
|
|
2005
|
-
}
|
|
2006
|
-
return { uri: a, title: a };
|
|
2007
|
-
}
|
|
2008
|
-
async function Ps(a, e, t) {
|
|
2009
|
-
const r = await ((...i) => fetch(...i))(Es(a, e));
|
|
2010
|
-
if (!r.ok) throw new Error(`search answered ${r.status}`);
|
|
2011
|
-
const o = await r.json(), n = new Map((o.items || []).map((i) => [i.uri, i]));
|
|
2012
|
-
return e.map((i) => n.get(i) || gt(i));
|
|
2013
|
-
}
|
|
2014
|
-
const Bs = y`
|
|
2044
|
+
const Rs = y`
|
|
2015
2045
|
.breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
|
|
2016
2046
|
.breadcrumbs a { text-decoration: none; }
|
|
2017
2047
|
.scorehead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 1.4rem 1rem; }
|
|
@@ -2068,7 +2098,7 @@ const Bs = y`
|
|
|
2068
2098
|
}
|
|
2069
2099
|
`;
|
|
2070
2100
|
class vt extends w {
|
|
2071
|
-
static styles = [...U,
|
|
2101
|
+
static styles = [...U, Rs];
|
|
2072
2102
|
static properties = {
|
|
2073
2103
|
...w.properties,
|
|
2074
2104
|
gameId: { type: String, attribute: "game-id" },
|
|
@@ -2098,7 +2128,7 @@ class vt extends w {
|
|
|
2098
2128
|
// links (fetchCoverage already degrades per-URL index misses).
|
|
2099
2129
|
// The embed drops the Coverage grid, so it skips the search
|
|
2100
2130
|
// round-trip entirely rather than fetching cards it will not render.
|
|
2101
|
-
s.length && !this.embed ?
|
|
2131
|
+
s.length && !this.embed ? vs(this.searchApi, s).catch(() => s.map(it)) : Promise.resolve([])
|
|
2102
2132
|
]);
|
|
2103
2133
|
return {
|
|
2104
2134
|
game: t,
|
|
@@ -2211,10 +2241,10 @@ class vt extends w {
|
|
|
2211
2241
|
`;
|
|
2212
2242
|
}
|
|
2213
2243
|
renderLineScore(e, t, s) {
|
|
2214
|
-
const r =
|
|
2244
|
+
const r = Ds(e);
|
|
2215
2245
|
if (!r)
|
|
2216
2246
|
return e.state === "scheduled" ? l`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>` : m;
|
|
2217
|
-
const o = Math.max(_e(e.sport), ...r.map((p) => p.period)), n = (p) =>
|
|
2247
|
+
const o = Math.max(_e(e.sport), ...r.map((p) => p.period)), n = (p) => Es(e.sport, p), i = (p, d) => {
|
|
2218
2248
|
const h = r.find((u) => u.period === d);
|
|
2219
2249
|
return h ? h[p] : e.state === "final" ? 0 : "·";
|
|
2220
2250
|
}, c = (p, d, h) => l`
|
|
@@ -2279,7 +2309,7 @@ class vt extends w {
|
|
|
2279
2309
|
}
|
|
2280
2310
|
}
|
|
2281
2311
|
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", vt);
|
|
2282
|
-
const
|
|
2312
|
+
const zs = 250, Ns = 2;
|
|
2283
2313
|
class $t extends N {
|
|
2284
2314
|
static properties = {
|
|
2285
2315
|
api: { type: String },
|
|
@@ -2360,11 +2390,11 @@ class $t extends N {
|
|
|
2360
2390
|
}
|
|
2361
2391
|
onInput(e) {
|
|
2362
2392
|
const t = e.target.value.trim();
|
|
2363
|
-
if (clearTimeout(this.debounceTimer), t.length <
|
|
2393
|
+
if (clearTimeout(this.debounceTimer), t.length < Ns) {
|
|
2364
2394
|
this.abortController?.abort(), this.results = [], this.open = !1, this.searched = !1;
|
|
2365
2395
|
return;
|
|
2366
2396
|
}
|
|
2367
|
-
this.debounceTimer = setTimeout(() => this.search(t),
|
|
2397
|
+
this.debounceTimer = setTimeout(() => this.search(t), zs);
|
|
2368
2398
|
}
|
|
2369
2399
|
async search(e) {
|
|
2370
2400
|
this.abortController?.abort(), this.abortController = new AbortController();
|
|
@@ -2477,17 +2507,17 @@ function yt(a, e = [], t = 0) {
|
|
|
2477
2507
|
for (const s of a.children || []) yt(s, e, t + 1);
|
|
2478
2508
|
return e;
|
|
2479
2509
|
}
|
|
2480
|
-
const
|
|
2481
|
-
function
|
|
2482
|
-
const s =
|
|
2510
|
+
const Fs = (a) => Math.max(1, Math.round(Math.log2(a || 2)));
|
|
2511
|
+
function Ms({ round: a, perGroup: e, groupCount: t = 1 }) {
|
|
2512
|
+
const s = Fs(e), o = (t === 4 ? s + 2 : t === 2 ? s + 1 : s) - a;
|
|
2483
2513
|
return o === 0 ? t > 1 ? "Championship" : "Final" : o === 1 ? "Semifinal" : `Round ${a}`;
|
|
2484
2514
|
}
|
|
2485
|
-
function
|
|
2515
|
+
function Os(a) {
|
|
2486
2516
|
if (!a || !a.length) return "setup";
|
|
2487
2517
|
const e = Math.max(...a.map((s) => s.round ?? 0)), t = a.filter((s) => (s.round ?? 0) === e);
|
|
2488
2518
|
return t.length && t.every((s) => s.state === "final") ? "complete" : a.some((s) => s.state !== "scheduled" || s.homeScore || s.awayScore || s.round === 1 && (s.homeTeamId || s.awayTeamId)) ? "active" : "setup";
|
|
2489
2519
|
}
|
|
2490
|
-
function
|
|
2520
|
+
function Us(a, e) {
|
|
2491
2521
|
const t = a?.groupNames || [];
|
|
2492
2522
|
if (t.length >= 2) {
|
|
2493
2523
|
const r = t.map((o) => ({ key: o, name: o }));
|
|
@@ -2496,11 +2526,11 @@ function Ms(a, e) {
|
|
|
2496
2526
|
const s = [...new Set((e || []).map((r) => r.bracketGroup).filter(Boolean))];
|
|
2497
2527
|
return [{ key: null, name: s.length === 1 ? s[0] : "Bracket" }];
|
|
2498
2528
|
}
|
|
2499
|
-
const
|
|
2529
|
+
const Hs = (a, e) => e?.key == null ? [...a || []] : (a || []).filter((t) => t.bracketGroup === e.key), Le = (a) => {
|
|
2500
2530
|
const e = /(\d+)\s*$/.exec(a.label || "");
|
|
2501
2531
|
return e ? Number(e[1]) : 1 / 0;
|
|
2502
2532
|
}, Ge = (a, e) => Le(a) - Le(e) || String(a.id).localeCompare(String(e.id));
|
|
2503
|
-
function
|
|
2533
|
+
function Ls(a, e) {
|
|
2504
2534
|
if (a.every((r) => Number.isInteger(r.round))) return (r) => r.round;
|
|
2505
2535
|
const t = bt(a, e), s = /* @__PURE__ */ new Map();
|
|
2506
2536
|
for (const r of Array.isArray(t) ? t : [t]) {
|
|
@@ -2509,10 +2539,10 @@ function Us(a, e) {
|
|
|
2509
2539
|
}
|
|
2510
2540
|
return (r) => Number.isInteger(r.round) ? r.round : s.get(r.id) || 1;
|
|
2511
2541
|
}
|
|
2512
|
-
function
|
|
2513
|
-
const s =
|
|
2542
|
+
function Gs(a, e, t) {
|
|
2543
|
+
const s = Hs(a, t);
|
|
2514
2544
|
if (!s.length) return [];
|
|
2515
|
-
const r =
|
|
2545
|
+
const r = Ls(a || [], e || []), o = /* @__PURE__ */ new Map();
|
|
2516
2546
|
for (const p of s) {
|
|
2517
2547
|
const d = r(p);
|
|
2518
2548
|
o.has(d) || o.set(d, []), o.get(d).push(p);
|
|
@@ -2536,7 +2566,7 @@ function Hs(a, e, t) {
|
|
|
2536
2566
|
}
|
|
2537
2567
|
return i;
|
|
2538
2568
|
}
|
|
2539
|
-
function
|
|
2569
|
+
function js(a, e, t) {
|
|
2540
2570
|
const s = a[`${e}TeamId`] || null, r = (t || []).find((n) => n.gameId === a.id && n.slot === e), o = a[`${e}Seed`] ?? r?.seed ?? null;
|
|
2541
2571
|
return { teamId: s, seed: o, bye: !s && !!r?.isBye };
|
|
2542
2572
|
}
|
|
@@ -2544,14 +2574,14 @@ function wt(a) {
|
|
|
2544
2574
|
const e = ne(a);
|
|
2545
2575
|
return e === "home" || e === "away" ? e : null;
|
|
2546
2576
|
}
|
|
2547
|
-
function
|
|
2577
|
+
function qs(a, e) {
|
|
2548
2578
|
const t = bt(a || [], e || []);
|
|
2549
2579
|
if (!t || Array.isArray(t)) return null;
|
|
2550
2580
|
const s = wt(t.game);
|
|
2551
2581
|
return s && t.game[`${s}TeamId`] || null;
|
|
2552
2582
|
}
|
|
2553
2583
|
const je = { active: 0, setup: 1, complete: 2 };
|
|
2554
|
-
function
|
|
2584
|
+
function Ws(a, { id: e, param: t } = {}) {
|
|
2555
2585
|
const s = a || [];
|
|
2556
2586
|
if (!s.length) return null;
|
|
2557
2587
|
for (const r of [e, t]) {
|
|
@@ -2561,7 +2591,7 @@ function js(a, { id: e, param: t } = {}) {
|
|
|
2561
2591
|
}
|
|
2562
2592
|
return [...s].sort((r, o) => (je[r.status] ?? 3) - (je[o.status] ?? 3) || String(r.name || "").localeCompare(String(o.name || "")))[0];
|
|
2563
2593
|
}
|
|
2564
|
-
const
|
|
2594
|
+
const Vs = y`
|
|
2565
2595
|
.bracket { display: flex; gap: 1rem; align-items: stretch; overflow-x: auto; padding-bottom: 0.5rem; }
|
|
2566
2596
|
.round { flex: 0 0 250px; display: flex; flex-direction: column; min-width: 0; }
|
|
2567
2597
|
.roundhead {
|
|
@@ -2608,7 +2638,7 @@ const qs = y`
|
|
|
2608
2638
|
@media (max-width: 720px) { .round { flex-basis: 215px; } }
|
|
2609
2639
|
`;
|
|
2610
2640
|
class xt extends w {
|
|
2611
|
-
static styles = [U,
|
|
2641
|
+
static styles = [U, Vs];
|
|
2612
2642
|
static properties = {
|
|
2613
2643
|
...w.properties,
|
|
2614
2644
|
sport: { type: String },
|
|
@@ -2621,7 +2651,7 @@ class xt extends w {
|
|
|
2621
2651
|
super(), this.sport = "football", this.season = "", this.tournamentId = "", this.picked = "", this.group = null;
|
|
2622
2652
|
}
|
|
2623
2653
|
async fetchData(e) {
|
|
2624
|
-
const t = this.season ||
|
|
2654
|
+
const t = this.season || Y(), s = (await e.listTournaments({ sport: this.sport, season: t })).items, r = new URLSearchParams(globalThis.location?.search || "").get("tournament"), o = Ws(s, { id: this.picked || this.tournamentId, param: r });
|
|
2625
2655
|
if (!o) return { season: t, tournaments: s, tournament: null };
|
|
2626
2656
|
const [n, i, c, p, d] = await Promise.all([
|
|
2627
2657
|
e.listSeedings(o.id),
|
|
@@ -2674,7 +2704,7 @@ class xt extends w {
|
|
|
2674
2704
|
${D(this)}
|
|
2675
2705
|
<div class="card"><div class="empty">No ${this.sport} brackets have been published for the ${e.season} season yet.</div></div>
|
|
2676
2706
|
`)}`;
|
|
2677
|
-
const r =
|
|
2707
|
+
const r = Us(e.tournament, e.games), o = r.find((h) => h.key === this.group) || r[0], n = (e.tournament.groupNames || []).length >= 2 ? e.tournament.groupNames.length : 1, i = (Number(e.tournament.size) || 0) / n, c = Gs(e.games, e.edges, o), p = Os(e.games), d = qs(e.games, e.edges);
|
|
2678
2708
|
return l`
|
|
2679
2709
|
${s}
|
|
2680
2710
|
${B(this, l`
|
|
@@ -2703,7 +2733,7 @@ class xt extends w {
|
|
|
2703
2733
|
<div class="bracket" role="region" aria-label="${o.name} bracket">
|
|
2704
2734
|
${c.map((h) => l`
|
|
2705
2735
|
<section class="round">
|
|
2706
|
-
<h3 class="roundhead">${
|
|
2736
|
+
<h3 class="roundhead">${Ms({ round: h.round, perGroup: i, groupCount: n })}</h3>
|
|
2707
2737
|
<div class="games">${h.games.map((u) => this.renderMatchup(t, u))}</div>
|
|
2708
2738
|
</section>`)}
|
|
2709
2739
|
</div>` : l`<div class="card"><div class="empty">This bracket has no games yet.</div></div>`}
|
|
@@ -2726,7 +2756,7 @@ class xt extends w {
|
|
|
2726
2756
|
`;
|
|
2727
2757
|
}
|
|
2728
2758
|
renderSlot(e, t, s) {
|
|
2729
|
-
const { teamId: r, seed: o, bye: n } =
|
|
2759
|
+
const { teamId: r, seed: o, bye: n } = js(t, s, this.data.seedings), i = wt(t), c = t.state === "live" || t.state === "final";
|
|
2730
2760
|
return l`
|
|
2731
2761
|
<div class="slot ${i ? i === s ? "winner" : "loser" : ""}">
|
|
2732
2762
|
<span class="seed">${o ?? ""}</span>
|
|
@@ -2737,22 +2767,22 @@ class xt extends w {
|
|
|
2737
2767
|
}
|
|
2738
2768
|
}
|
|
2739
2769
|
globalThis?.customElements && !globalThis.customElements.get("hsot-brackets") && globalThis.customElements.define("hsot-brackets", xt);
|
|
2740
|
-
const
|
|
2741
|
-
"hsot-scores":
|
|
2742
|
-
"hsot-standings":
|
|
2743
|
-
"hsot-rankings":
|
|
2744
|
-
"hsot-school":
|
|
2770
|
+
const Ks = {
|
|
2771
|
+
"hsot-scores": dt,
|
|
2772
|
+
"hsot-standings": pt,
|
|
2773
|
+
"hsot-rankings": mt,
|
|
2774
|
+
"hsot-school": ut,
|
|
2745
2775
|
"hsot-boxscore": vt,
|
|
2746
2776
|
"hsot-school-search": $t,
|
|
2747
2777
|
"hsot-brackets": xt
|
|
2748
2778
|
};
|
|
2749
|
-
function
|
|
2779
|
+
function Ys() {
|
|
2750
2780
|
const a = globalThis?.customElements;
|
|
2751
2781
|
if (a)
|
|
2752
|
-
for (const [e, t] of Object.entries(
|
|
2782
|
+
for (const [e, t] of Object.entries(Ks))
|
|
2753
2783
|
a.get(e) || a.define(e, t);
|
|
2754
2784
|
}
|
|
2755
|
-
typeof window < "u" && globalThis.customElements &&
|
|
2785
|
+
typeof window < "u" && globalThis.customElements && Ys();
|
|
2756
2786
|
export {
|
|
2757
|
-
|
|
2787
|
+
Ys as defineAll
|
|
2758
2788
|
};
|