@wral/hsot-data 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const V = globalThis,
|
|
1
|
+
const V = globalThis, lt = V.ShadowRoot && (V.ShadyCSS === void 0 || V.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ct = /* @__PURE__ */ Symbol(), xt = /* @__PURE__ */ new WeakMap();
|
|
2
2
|
let Nt = class {
|
|
3
3
|
constructor(t, e, s) {
|
|
4
|
-
if (this._$cssResult$ = !0, s !==
|
|
4
|
+
if (this._$cssResult$ = !0, s !== ct) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
5
|
this.cssText = t, this.t = e;
|
|
6
6
|
}
|
|
7
7
|
get styleSheet() {
|
|
8
8
|
let t = this.o;
|
|
9
9
|
const e = this.t;
|
|
10
|
-
if (
|
|
10
|
+
if (lt && t === void 0) {
|
|
11
11
|
const s = e !== void 0 && e.length === 1;
|
|
12
12
|
s && (t = xt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && xt.set(e, t));
|
|
13
13
|
}
|
|
@@ -17,28 +17,28 @@ let Nt = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
20
|
+
const ee = (r) => new Nt(typeof r == "string" ? r : r + "", void 0, ct), b = (r, ...t) => {
|
|
21
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
25
|
})(a) + r[o + 1], r[0]);
|
|
26
|
-
return new Nt(e, r,
|
|
27
|
-
},
|
|
28
|
-
if (
|
|
26
|
+
return new Nt(e, r, ct);
|
|
27
|
+
}, se = (r, t) => {
|
|
28
|
+
if (lt) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
29
29
|
else for (const e of t) {
|
|
30
30
|
const s = document.createElement("style"), a = V.litNonce;
|
|
31
31
|
a !== void 0 && s.setAttribute("nonce", a), s.textContent = e.cssText, r.appendChild(s);
|
|
32
32
|
}
|
|
33
|
-
}, kt =
|
|
33
|
+
}, kt = lt ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
|
34
34
|
let e = "";
|
|
35
35
|
for (const s of t.cssRules) e += s.cssText;
|
|
36
|
-
return
|
|
36
|
+
return ee(e);
|
|
37
37
|
})(r) : r;
|
|
38
|
-
const { is:
|
|
38
|
+
const { is: re, defineProperty: ae, getOwnPropertyDescriptor: oe, getOwnPropertyNames: ie, getOwnPropertySymbols: ne, getPrototypeOf: le } = Object, X = globalThis, _t = X.trustedTypes, ce = _t ? _t.emptyScript : "", he = X.reactiveElementPolyfillSupport, B = (r, t) => r, it = { toAttribute(r, t) {
|
|
39
39
|
switch (t) {
|
|
40
40
|
case Boolean:
|
|
41
|
-
r = r ?
|
|
41
|
+
r = r ? ce : null;
|
|
42
42
|
break;
|
|
43
43
|
case Object:
|
|
44
44
|
case Array:
|
|
@@ -63,7 +63,7 @@ const { is: se, defineProperty: re, getOwnPropertyDescriptor: ae, getOwnProperty
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return e;
|
|
66
|
-
} }, Ot = (r, t) => !
|
|
66
|
+
} }, Ot = (r, t) => !re(r, t), St = { attribute: !0, type: String, converter: it, reflect: !1, useDefault: !1, hasChanged: Ot };
|
|
67
67
|
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), X.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
68
|
let I = class extends HTMLElement {
|
|
69
69
|
static addInitializer(t) {
|
|
@@ -75,11 +75,11 @@ let I = class extends HTMLElement {
|
|
|
75
75
|
static createProperty(t, e = St) {
|
|
76
76
|
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
77
77
|
const s = /* @__PURE__ */ Symbol(), a = this.getPropertyDescriptor(t, s, e);
|
|
78
|
-
a !== void 0 &&
|
|
78
|
+
a !== void 0 && ae(this.prototype, t, a);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
static getPropertyDescriptor(t, e, s) {
|
|
82
|
-
const { get: a, set: o } =
|
|
82
|
+
const { get: a, set: o } = oe(this.prototype, t) ?? { get() {
|
|
83
83
|
return this[e];
|
|
84
84
|
}, set(i) {
|
|
85
85
|
this[e] = i;
|
|
@@ -94,13 +94,13 @@ 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 = le(this);
|
|
98
98
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
99
99
|
}
|
|
100
100
|
static finalize() {
|
|
101
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 = [...
|
|
103
|
+
const e = this.properties, s = [...ie(e), ...ne(e)];
|
|
104
104
|
for (const a of s) this.createProperty(a, e[a]);
|
|
105
105
|
}
|
|
106
106
|
const t = this[Symbol.metadata];
|
|
@@ -146,7 +146,7 @@ let I = class extends HTMLElement {
|
|
|
146
146
|
}
|
|
147
147
|
createRenderRoot() {
|
|
148
148
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
149
|
-
return
|
|
149
|
+
return se(t, this.constructor.elementStyles), t;
|
|
150
150
|
}
|
|
151
151
|
connectedCallback() {
|
|
152
152
|
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.());
|
|
@@ -162,14 +162,14 @@ let I = class extends HTMLElement {
|
|
|
162
162
|
_$ET(t, e) {
|
|
163
163
|
const s = this.constructor.elementProperties.get(t), a = this.constructor._$Eu(t, s);
|
|
164
164
|
if (a !== void 0 && s.reflect === !0) {
|
|
165
|
-
const o = (s.converter?.toAttribute !== void 0 ? s.converter :
|
|
165
|
+
const o = (s.converter?.toAttribute !== void 0 ? s.converter : it).toAttribute(e, s.type);
|
|
166
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
170
|
const s = this.constructor, a = s._$Eh.get(t);
|
|
171
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 :
|
|
172
|
+
const o = s.getPropertyOptions(a), i = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : it;
|
|
173
173
|
this._$Em = a;
|
|
174
174
|
const n = i.fromAttribute(e, o.type);
|
|
175
175
|
this[a] = n ?? this._$Ej?.get(a) ?? n, this._$Em = null;
|
|
@@ -246,23 +246,23 @@ 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
|
|
251
|
-
\f\r]`,
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ct = /'/g, Pt = /"/g, Mt = /^(?:script|style|textarea|title)$/i, Lt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), l = Lt(1), Dt = Lt(2), C = /* @__PURE__ */ Symbol.for("lit-noChange"), m = /* @__PURE__ */ Symbol.for("lit-nothing"),
|
|
249
|
+
I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[B("elementProperties")] = /* @__PURE__ */ new Map(), I[B("finalized")] = /* @__PURE__ */ new Map(), he?.({ ReactiveElement: I }), (X.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
+
const ht = globalThis, At = (r) => r, Y = ht.trustedTypes, Tt = Y ? Y.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Ut = "$lit$", k = `lit$${Math.random().toFixed(9).slice(2)}$`, Ht = "?" + k, de = `<${Ht}>`, T = document, F = () => T.createComment(""), N = (r) => r === null || typeof r != "object" && typeof r != "function", dt = Array.isArray, pe = (r) => dt(r) || typeof r?.[Symbol.iterator] == "function", at = `[
|
|
251
|
+
\f\r]`, z = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, It = /-->/g, Et = />/g, S = RegExp(`>|${at}(?:([^\\s"'>=/]+)(${at}*=${at}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ct = /'/g, Pt = /"/g, Mt = /^(?:script|style|textarea|title)$/i, Lt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), l = Lt(1), Dt = Lt(2), C = /* @__PURE__ */ Symbol.for("lit-noChange"), m = /* @__PURE__ */ Symbol.for("lit-nothing"), zt = /* @__PURE__ */ new WeakMap(), A = T.createTreeWalker(T, 129);
|
|
253
253
|
function jt(r, t) {
|
|
254
|
-
if (!
|
|
254
|
+
if (!dt(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
255
|
return Tt !== void 0 ? Tt.createHTML(t) : t;
|
|
256
256
|
}
|
|
257
|
-
const
|
|
257
|
+
const me = (r, t) => {
|
|
258
258
|
const e = r.length - 1, s = [];
|
|
259
|
-
let a, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", i =
|
|
259
|
+
let a, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", i = z;
|
|
260
260
|
for (let n = 0; n < e; n++) {
|
|
261
261
|
const d = r[n];
|
|
262
262
|
let c, h, p = -1, f = 0;
|
|
263
|
-
for (; f < d.length && (i.lastIndex = f, h = i.exec(d), h !== null); ) f = i.lastIndex, i ===
|
|
263
|
+
for (; f < d.length && (i.lastIndex = f, h = i.exec(d), h !== null); ) f = i.lastIndex, i === z ? h[1] === "!--" ? i = It : h[1] !== void 0 ? i = Et : h[2] !== void 0 ? (Mt.test(h[2]) && (a = RegExp("</" + h[2], "g")), i = S) : h[3] !== void 0 && (i = S) : i === S ? h[0] === ">" ? (i = a ?? z, p = -1) : h[1] === void 0 ? p = -2 : (p = i.lastIndex - h[2].length, c = h[1], i = h[3] === void 0 ? S : h[3] === '"' ? Pt : Ct) : i === Pt || i === Ct ? i = S : i === It || i === Et ? i = z : (i = S, a = void 0);
|
|
264
264
|
const u = i === S && r[n + 1].startsWith("/>") ? " " : "";
|
|
265
|
-
o += i ===
|
|
265
|
+
o += i === z ? d + de : p >= 0 ? (s.push(c), d.slice(0, p) + Ut + d.slice(p) + k + u) : d + k + (p === -2 ? n : u);
|
|
266
266
|
}
|
|
267
267
|
return [jt(r, o + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
268
268
|
};
|
|
@@ -271,7 +271,7 @@ class O {
|
|
|
271
271
|
let a;
|
|
272
272
|
this.parts = [];
|
|
273
273
|
let o = 0, i = 0;
|
|
274
|
-
const n = t.length - 1, d = this.parts, [c, h] =
|
|
274
|
+
const n = t.length - 1, d = this.parts, [c, h] = me(t, e);
|
|
275
275
|
if (this.el = O.createElement(c, s), A.currentNode = this.el.content, e === 2 || e === 3) {
|
|
276
276
|
const p = this.el.content.firstChild;
|
|
277
277
|
p.replaceWith(...p.childNodes);
|
|
@@ -280,7 +280,7 @@ class O {
|
|
|
280
280
|
if (a.nodeType === 1) {
|
|
281
281
|
if (a.hasAttributes()) for (const p of a.getAttributeNames()) if (p.endsWith(Ut)) {
|
|
282
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] === "." ?
|
|
283
|
+
d.push({ type: 1, index: o, name: $[2], strings: u, ctor: $[1] === "." ? ue : $[1] === "?" ? ge : $[1] === "@" ? ve : tt }), a.removeAttribute(p);
|
|
284
284
|
} else p.startsWith(k) && (d.push({ type: 6, index: o }), a.removeAttribute(p));
|
|
285
285
|
if (Mt.test(a.tagName)) {
|
|
286
286
|
const p = a.textContent.split(k), f = p.length - 1;
|
|
@@ -309,7 +309,7 @@ function P(r, t, e = r, s) {
|
|
|
309
309
|
const o = N(t) ? void 0 : t._$litDirective$;
|
|
310
310
|
return a?.constructor !== o && (a?._$AO?.(!1), o === void 0 ? a = void 0 : (a = new o(r), a._$AT(r, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = a : e._$Cl = a), a !== void 0 && (t = P(r, a._$AS(r, t.values), a, s)), t;
|
|
311
311
|
}
|
|
312
|
-
class
|
|
312
|
+
class fe {
|
|
313
313
|
constructor(t, e) {
|
|
314
314
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
315
315
|
}
|
|
@@ -326,7 +326,7 @@ class me {
|
|
|
326
326
|
for (; d !== void 0; ) {
|
|
327
327
|
if (i === d.index) {
|
|
328
328
|
let c;
|
|
329
|
-
d.type === 2 ? c = new M(o, o.nextSibling, this, t) : d.type === 1 ? c = new d.ctor(o, d.name, d.strings, this, t) : d.type === 6 && (c = new
|
|
329
|
+
d.type === 2 ? c = new M(o, o.nextSibling, this, t) : d.type === 1 ? c = new d.ctor(o, d.name, d.strings, this, t) : d.type === 6 && (c = new $e(o, this, t)), this._$AV.push(c), d = s[++n];
|
|
330
330
|
}
|
|
331
331
|
i !== d?.index && (o = A.nextNode(), i++);
|
|
332
332
|
}
|
|
@@ -356,7 +356,7 @@ class M {
|
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
358
|
_$AI(t, e = this) {
|
|
359
|
-
t = P(this, t, e), N(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== C && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) :
|
|
359
|
+
t = P(this, t, e), N(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== C && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : pe(t) ? this.k(t) : this._(t);
|
|
360
360
|
}
|
|
361
361
|
O(t) {
|
|
362
362
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -371,16 +371,16 @@ class M {
|
|
|
371
371
|
const { values: e, _$litType$: s } = t, a = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = O.createElement(jt(s.h, s.h[0]), this.options)), s);
|
|
372
372
|
if (this._$AH?._$AD === a) this._$AH.p(e);
|
|
373
373
|
else {
|
|
374
|
-
const o = new
|
|
374
|
+
const o = new fe(a, this), i = o.u(this.options);
|
|
375
375
|
o.p(e), this.T(i), this._$AH = o;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
_$AC(t) {
|
|
379
|
-
let e =
|
|
380
|
-
return e === void 0 &&
|
|
379
|
+
let e = zt.get(t.strings);
|
|
380
|
+
return e === void 0 && zt.set(t.strings, e = new O(t)), e;
|
|
381
381
|
}
|
|
382
382
|
k(t) {
|
|
383
|
-
|
|
383
|
+
dt(this._$AH) || (this._$AH = [], this._$AR());
|
|
384
384
|
const e = this._$AH;
|
|
385
385
|
let s, a = 0;
|
|
386
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++;
|
|
@@ -421,7 +421,7 @@ class tt {
|
|
|
421
421
|
t === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
class
|
|
424
|
+
class ue extends tt {
|
|
425
425
|
constructor() {
|
|
426
426
|
super(...arguments), this.type = 3;
|
|
427
427
|
}
|
|
@@ -429,7 +429,7 @@ class fe extends tt {
|
|
|
429
429
|
this.element[this.name] = t === m ? void 0 : t;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class ge extends tt {
|
|
433
433
|
constructor() {
|
|
434
434
|
super(...arguments), this.type = 4;
|
|
435
435
|
}
|
|
@@ -437,7 +437,7 @@ class ue extends tt {
|
|
|
437
437
|
this.element.toggleAttribute(this.name, !!t && t !== m);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
class
|
|
440
|
+
class ve extends tt {
|
|
441
441
|
constructor(t, e, s, a, o) {
|
|
442
442
|
super(t, e, s, a, o), this.type = 5;
|
|
443
443
|
}
|
|
@@ -450,7 +450,7 @@ class ge extends tt {
|
|
|
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 $e {
|
|
454
454
|
constructor(t, e, s) {
|
|
455
455
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
456
456
|
}
|
|
@@ -461,9 +461,9 @@ class ve {
|
|
|
461
461
|
P(this, t);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
const
|
|
464
|
+
const be = ht.litHtmlPolyfillSupport;
|
|
465
|
+
be?.(O, M), (ht.litHtmlVersions ??= []).push("3.3.3");
|
|
466
|
+
const ye = (r, t, e) => {
|
|
467
467
|
const s = e?.renderBefore ?? t;
|
|
468
468
|
let a = s._$litPart$;
|
|
469
469
|
if (a === void 0) {
|
|
@@ -472,7 +472,7 @@ const be = (r, t, e) => {
|
|
|
472
472
|
}
|
|
473
473
|
return a._$AI(r), a;
|
|
474
474
|
};
|
|
475
|
-
const
|
|
475
|
+
const pt = globalThis;
|
|
476
476
|
class E extends I {
|
|
477
477
|
constructor() {
|
|
478
478
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
@@ -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 = ye(e, this.renderRoot, this.renderOptions);
|
|
487
487
|
}
|
|
488
488
|
connectedCallback() {
|
|
489
489
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -495,18 +495,18 @@ class E extends I {
|
|
|
495
495
|
return C;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
E._$litElement$ = !0, E.finalized = !0,
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
(
|
|
502
|
-
const
|
|
503
|
-
function
|
|
498
|
+
E._$litElement$ = !0, E.finalized = !0, pt.litElementHydrateSupport?.({ LitElement: E });
|
|
499
|
+
const we = pt.litElementPolyfillSupport;
|
|
500
|
+
we?.({ LitElement: E });
|
|
501
|
+
(pt.litElementVersions ??= []).push("4.2.2");
|
|
502
|
+
const xe = 50;
|
|
503
|
+
function ke(r = {}) {
|
|
504
504
|
const t = Object.entries(r).filter(([, s]) => s != null && s !== "");
|
|
505
505
|
if (!t.length) return "";
|
|
506
506
|
const e = new URLSearchParams();
|
|
507
507
|
return t.forEach(([s, a]) => e.set(s, String(a))), `?${e.toString()}`;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function _e({ baseUrl: r, token: t = "", fetchFn: e } = {}) {
|
|
510
510
|
if (!r) throw new Error("createClient requires a baseUrl");
|
|
511
511
|
const s = r.replace(/\/+$/, ""), a = e || ((...n) => fetch(...n));
|
|
512
512
|
async function o(n) {
|
|
@@ -522,8 +522,8 @@ function ke({ baseUrl: r, token: t = "", fetchFn: e } = {}) {
|
|
|
522
522
|
async function i(n, d = {}) {
|
|
523
523
|
const c = [];
|
|
524
524
|
let h = null;
|
|
525
|
-
for (let p = 0; p <
|
|
526
|
-
const f =
|
|
525
|
+
for (let p = 0; p < xe; p += 1) {
|
|
526
|
+
const f = ke(h ? { ...d, cursor: h } : d), u = await o(`${n}${f}`);
|
|
527
527
|
if (c.push(...u.items || []), h = u.nextCursor || null, !h) break;
|
|
528
528
|
}
|
|
529
529
|
return { items: c, total: c.length, nextCursor: null };
|
|
@@ -544,7 +544,7 @@ function ke({ baseUrl: r, token: t = "", fetchFn: e } = {}) {
|
|
|
544
544
|
listSports: () => o("/sports")
|
|
545
545
|
};
|
|
546
546
|
}
|
|
547
|
-
const
|
|
547
|
+
const ot = {
|
|
548
548
|
game: "/{sport}/game/{id}/",
|
|
549
549
|
school: "/school/{id}/",
|
|
550
550
|
section: "/{sport}/{view}/"
|
|
@@ -554,9 +554,9 @@ function g(r, t) {
|
|
|
554
554
|
}
|
|
555
555
|
function L(r) {
|
|
556
556
|
return {
|
|
557
|
-
game: r.getAttribute("game-href") ||
|
|
558
|
-
school: r.getAttribute("school-href") ||
|
|
559
|
-
section: r.getAttribute("section-href") ||
|
|
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
562
|
const D = (r) => r ? r.charAt(0).toUpperCase() + r.slice(1) : "";
|
|
@@ -565,17 +565,17 @@ function y(r, t) {
|
|
|
565
565
|
const [e, s, a] = String(r).split("-").map(Number);
|
|
566
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
|
|
568
|
+
function mt(r) {
|
|
569
569
|
if (!r) return "";
|
|
570
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
|
|
575
|
+
function Se(r) {
|
|
576
576
|
return r ? `${Math.floor(r / 12)}-${r % 12}` : "·";
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function et(r = /* @__PURE__ */ new Date()) {
|
|
579
579
|
const t = r.getFullYear();
|
|
580
580
|
return r.getMonth() >= 6 ? `${t}-${t + 1}` : `${t - 1}-${t}`;
|
|
581
581
|
}
|
|
@@ -583,7 +583,7 @@ function ft(r = /* @__PURE__ */ new Date()) {
|
|
|
583
583
|
const t = (e) => String(e).padStart(2, "0");
|
|
584
584
|
return `${r.getFullYear()}-${t(r.getMonth() + 1)}-${t(r.getDate())}`;
|
|
585
585
|
}
|
|
586
|
-
function
|
|
586
|
+
function Ae(r, t = ft()) {
|
|
587
587
|
const e = [...new Set((r || []).filter(Boolean))].sort();
|
|
588
588
|
if (!e.length || e.includes(t)) return t;
|
|
589
589
|
const s = e.filter((a) => a < t);
|
|
@@ -597,17 +597,17 @@ function K(r) {
|
|
|
597
597
|
const t = parseInt(r.slice(1), 16), e = t >> 16 & 255, s = t >> 8 & 255, a = t & 255;
|
|
598
598
|
return 0.299 * e + 0.587 * s + 0.114 * a > 150 ? "#0F1B33" : "#FFFFFF";
|
|
599
599
|
}
|
|
600
|
-
const
|
|
600
|
+
const Te = (r) => {
|
|
601
601
|
const t = ["th", "st", "nd", "rd"], e = r % 100;
|
|
602
602
|
return r + (t[(e - 20) % 10] || t[e] || t[0]);
|
|
603
603
|
};
|
|
604
|
-
function
|
|
604
|
+
function Wt(r) {
|
|
605
605
|
if (r.state === "live") return { kind: "live", label: `Live · ${r.period || ""}`.replace(/ · $/, "") };
|
|
606
606
|
if (r.state === "final") {
|
|
607
607
|
const t = [];
|
|
608
608
|
return r.finish === "overtime" && t.push("OT"), r.finish === "shootout" && t.push("PK-SO"), r.forfeit && r.forfeit !== "none" && t.push("Forfeit"), { kind: "final", label: `Final${t.length ? ` · ${t.join(" · ")}` : ""}` };
|
|
609
609
|
}
|
|
610
|
-
return r.state === "postponed" ? { kind: "warn", label: "Postponed" } : r.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${y(r.date, { month: "short", day: "numeric" })} · ${
|
|
610
|
+
return r.state === "postponed" ? { kind: "warn", label: "Postponed" } : r.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${y(r.date, { month: "short", day: "numeric" })} · ${mt(r.time)}`.replace(/ · $/, "") };
|
|
611
611
|
}
|
|
612
612
|
const Ie = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
|
|
613
613
|
function _(r) {
|
|
@@ -618,7 +618,7 @@ function _(r) {
|
|
|
618
618
|
let a = t.split("?")[0] + s;
|
|
619
619
|
return a = a.replace(/([^:])\/{2,}/g, "$1/").replace(/^\/{2,}/, "/"), a = a.replace(/^\/(?=#)/, ""), a.length > 1 && (a = a.replace(/\/+$/, "")), a.toLowerCase();
|
|
620
620
|
}
|
|
621
|
-
function
|
|
621
|
+
function qt() {
|
|
622
622
|
const r = globalThis.location;
|
|
623
623
|
if (!r) return "";
|
|
624
624
|
const t = (r.hash || "").startsWith("#/") ? r.hash : "";
|
|
@@ -649,7 +649,7 @@ function Ce(r, t, e) {
|
|
|
649
649
|
{ label: "Polls & Rankings", href: s("rankings") }
|
|
650
650
|
];
|
|
651
651
|
}
|
|
652
|
-
function Pe(r, t =
|
|
652
|
+
function Pe(r, t = qt()) {
|
|
653
653
|
const e = _(t);
|
|
654
654
|
for (const s of r.querySelectorAll(':scope > a[slot="nav"]'))
|
|
655
655
|
e && _(s.getAttribute("href")) === e ? s.setAttribute("aria-current", "page") : s.removeAttribute("aria-current");
|
|
@@ -673,7 +673,7 @@ class w extends E {
|
|
|
673
673
|
this._client = t, this.isConnected && this.load();
|
|
674
674
|
}
|
|
675
675
|
get client() {
|
|
676
|
-
return this._client ? this._client : this.api ?
|
|
676
|
+
return this._client ? this._client : this.api ? _e({ baseUrl: this.api }) : null;
|
|
677
677
|
}
|
|
678
678
|
connectedCallback() {
|
|
679
679
|
super.connectedCallback(), this._setupInterval();
|
|
@@ -758,7 +758,7 @@ const v = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), De = b`
|
|
|
758
758
|
outline-offset: 1px;
|
|
759
759
|
}
|
|
760
760
|
.mut { color: var(--hsot-gray-5); }
|
|
761
|
-
`,
|
|
761
|
+
`, ze = b`
|
|
762
762
|
.band { background: var(--hsot-white); color: var(--hsot-black); }
|
|
763
763
|
.band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
|
|
764
764
|
.band h1, .band h2.bandtitle {
|
|
@@ -807,7 +807,7 @@ const v = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), De = b`
|
|
|
807
807
|
@media (max-width: 720px) {
|
|
808
808
|
.band h1, .band h2.bandtitle, .band.section h1, .band.section h2.bandtitle { font-size: 1.8rem; }
|
|
809
809
|
}
|
|
810
|
-
`,
|
|
810
|
+
`, Re = b`
|
|
811
811
|
.view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
|
|
812
812
|
/* Optional right rail (slot="rail" light-DOM children): a divided 300px
|
|
813
813
|
column on desktop, stacked under the view content on smaller screens. */
|
|
@@ -937,6 +937,14 @@ const v = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), De = b`
|
|
|
937
937
|
.gamelist li:last-child { border-bottom: none; }
|
|
938
938
|
.gamelist .d { width: 84px; flex: none; color: var(--hsot-gray-5); font-size: 0.8rem; }
|
|
939
939
|
.gamelist .res { width: 86px; flex: none; font-family: var(--hsot-heading-font); font-weight: 700; }
|
|
940
|
+
/* Per-team score block on the scoreboard, in the status pills' bubble shape. */
|
|
941
|
+
.gamelist .score {
|
|
942
|
+
display: inline-block; min-width: 1.15em; text-align: center;
|
|
943
|
+
background: var(--hsot-red); color: var(--hsot-white);
|
|
944
|
+
font-family: var(--hsot-heading-font); font-weight: 700; font-size: 0.8125rem;
|
|
945
|
+
line-height: 1.2; border-radius: var(--hsot-radius-md); padding: 0.14rem 0.4rem;
|
|
946
|
+
margin-left: 0.45rem; vertical-align: middle; font-variant-numeric: tabular-nums;
|
|
947
|
+
}
|
|
940
948
|
.gamelist .res .W { color: var(--hsot-win); }
|
|
941
949
|
.gamelist .res .L { color: var(--hsot-loss); }
|
|
942
950
|
.gamelist .res .T { color: var(--hsot-tie); }
|
|
@@ -945,7 +953,7 @@ const v = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), De = b`
|
|
|
945
953
|
.gamelist .opp a:hover { text-decoration: underline; }
|
|
946
954
|
.gamelist .where { color: var(--hsot-gray-5); font-size: 0.78rem; }
|
|
947
955
|
.gamelist a.box { font-size: 0.78rem; }
|
|
948
|
-
`, j = [De,
|
|
956
|
+
`, j = [De, ze, Re, Be, Fe, Ne, Oe];
|
|
949
957
|
function gt(r) {
|
|
950
958
|
return r.state !== "final" ? null : r.forfeit && r.forfeit !== "none" ? r.forfeit : r.homeScore > r.awayScore ? "home" : r.awayScore > r.homeScore ? "away" : r.tiebreakWinner && r.tiebreakWinner !== "none" ? r.tiebreakWinner : "tie";
|
|
951
959
|
}
|
|
@@ -964,14 +972,14 @@ function W(r, t) {
|
|
|
964
972
|
}
|
|
965
973
|
return e;
|
|
966
974
|
}
|
|
967
|
-
function
|
|
975
|
+
function st(r) {
|
|
968
976
|
if (!r || !r.length) return "";
|
|
969
977
|
const t = r[r.length - 1].mark;
|
|
970
978
|
let e = 0;
|
|
971
979
|
for (let s = r.length - 1; s >= 0 && r[s].mark === t; s -= 1) e += 1;
|
|
972
980
|
return t + e;
|
|
973
981
|
}
|
|
974
|
-
const
|
|
982
|
+
const Rt = (r, t, e) => {
|
|
975
983
|
const s = r + t + e;
|
|
976
984
|
return s ? (r + e / 2) / s : 0;
|
|
977
985
|
}, Bt = (r) => r.toFixed(3).replace("0.", ".");
|
|
@@ -980,10 +988,10 @@ function x(r, t = !1) {
|
|
|
980
988
|
const e = t ? r.cw : r.w, s = t ? r.cl : r.l, a = t ? r.ct : r.t;
|
|
981
989
|
return `${e}-${s}${a ? `-${a}` : ""}`;
|
|
982
990
|
}
|
|
983
|
-
function
|
|
991
|
+
function Gt(r, t) {
|
|
984
992
|
return r.map((e) => {
|
|
985
993
|
const s = t[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] };
|
|
986
|
-
return { team: e, rec: s, confPct:
|
|
994
|
+
return { team: e, rec: s, confPct: Rt(s.cw, s.cl, s.ct), overallPct: Rt(s.w, s.l, s.t) };
|
|
987
995
|
}).sort((e, s) => s.confPct - e.confPct || s.overallPct - e.overallPct || s.rec.pf - s.rec.pa - (e.rec.pf - e.rec.pa));
|
|
988
996
|
}
|
|
989
997
|
function vt(r, t) {
|
|
@@ -1029,7 +1037,7 @@ function Q(r, t) {
|
|
|
1029
1037
|
return `${e}${a}w=${s}&h=${s}&f=webp`;
|
|
1030
1038
|
}
|
|
1031
1039
|
function bt(r, t, { title: e, sub: s, teams: a }) {
|
|
1032
|
-
const o =
|
|
1040
|
+
const o = qt(), n = !!r.querySelector(':scope > a[slot="nav"]') || Ee(o, t.hrefs, t.sport) !== null;
|
|
1033
1041
|
return l`
|
|
1034
1042
|
<div class="band section">
|
|
1035
1043
|
<div class="inner">
|
|
@@ -1051,7 +1059,7 @@ function bt(r, t, { title: e, sub: s, teams: a }) {
|
|
|
1051
1059
|
const U = (r, t) => {
|
|
1052
1060
|
const e = r.teamsById[t];
|
|
1053
1061
|
return e ? r.schoolsById[e.schoolId] : null;
|
|
1054
|
-
},
|
|
1062
|
+
}, R = (r, t) => U(r, t)?.name || "TBD", Z = (r, t) => U(r, t)?.abbr || "TBD";
|
|
1055
1063
|
function H(r, t = 26) {
|
|
1056
1064
|
if (!r) return m;
|
|
1057
1065
|
const e = Q(r, t);
|
|
@@ -1067,7 +1075,7 @@ function yt(r, t, e) {
|
|
|
1067
1075
|
const s = $t(r.rankings, r.teamsById, t, r.sport, e);
|
|
1068
1076
|
return s ? l`<span class="rankbadge">#${s}</span>` : m;
|
|
1069
1077
|
}
|
|
1070
|
-
function
|
|
1078
|
+
function nt(r, t, e) {
|
|
1071
1079
|
const s = U(r, t);
|
|
1072
1080
|
return s ? l`${yt(r, t, e)}<a href=${g(r.hrefs.school, { id: s.id })}>${s.name}</a>` : l`<span class="mut">TBD</span>`;
|
|
1073
1081
|
}
|
|
@@ -1077,7 +1085,7 @@ function wt(r, t, e = 5) {
|
|
|
1077
1085
|
const a = s.results.slice(-1 * e);
|
|
1078
1086
|
return l`<span class="dots" role="img" aria-label="last ${a.length} results">
|
|
1079
1087
|
${a.map((o) => l`<a class="dot ${o.mark}"
|
|
1080
|
-
title="${o.mark} ${o.my}-${o.their} vs ${
|
|
1088
|
+
title="${o.mark} ${o.my}-${o.their} vs ${R(r, o.opp)}"
|
|
1081
1089
|
href=${g(r.hrefs.game, { sport: r.sport, id: o.gameId })}>${o.mark}</a>`)}
|
|
1082
1090
|
</span>`;
|
|
1083
1091
|
}
|
|
@@ -1093,15 +1101,15 @@ function G(r) {
|
|
|
1093
1101
|
return l`<div class="promo">${r.promoHref ? l`<a href=${r.promoHref} target="_blank" rel="sponsored noopener">${t}</a>` : t}</div>`;
|
|
1094
1102
|
}
|
|
1095
1103
|
function J(r) {
|
|
1096
|
-
const t =
|
|
1104
|
+
const t = Wt(r);
|
|
1097
1105
|
return l`<span class="pill ${t.kind}">${t.label}</span>`;
|
|
1098
1106
|
}
|
|
1099
|
-
function
|
|
1107
|
+
function Vt(r, t, e) {
|
|
1100
1108
|
if (!t) return l`<span class="mut">·</span>`;
|
|
1101
1109
|
const s = t.homeTeamId === e ? t.awayTeamId : t.homeTeamId, a = t.homeTeamId === e ? "vs" : "at";
|
|
1102
1110
|
return l`${t.state === "live" ? l`<span class="pill live">Live</span> ` : l`${y(t.date, { month: "numeric", day: "numeric" })} `}${a} ${Z(r, s)}`;
|
|
1103
1111
|
}
|
|
1104
|
-
class
|
|
1112
|
+
class Yt extends w {
|
|
1105
1113
|
static styles = j;
|
|
1106
1114
|
static properties = {
|
|
1107
1115
|
...w.properties,
|
|
@@ -1120,14 +1128,14 @@ class Vt extends w {
|
|
|
1120
1128
|
this._datePinned = !!this.date;
|
|
1121
1129
|
}
|
|
1122
1130
|
async fetchData(t) {
|
|
1123
|
-
const e = this.season ||
|
|
1131
|
+
const e = this.season || et(), [s, a, o, i, n] = await Promise.all([
|
|
1124
1132
|
t.listSchools(),
|
|
1125
1133
|
t.listTeams({ sport: this.sport }),
|
|
1126
1134
|
t.listConferences(),
|
|
1127
1135
|
t.listGames({ sport: this.sport, season: e }),
|
|
1128
1136
|
t.listRankings({ sport: this.sport })
|
|
1129
1137
|
]);
|
|
1130
|
-
return this._datePinned || (this.date =
|
|
1138
|
+
return this._datePinned || (this.date = Ae(i.items.map((d) => d.date)), this._datePinned = !0), {
|
|
1131
1139
|
season: e,
|
|
1132
1140
|
schools: s.items,
|
|
1133
1141
|
teams: a.items,
|
|
@@ -1194,13 +1202,16 @@ class Vt extends w {
|
|
|
1194
1202
|
`)}
|
|
1195
1203
|
`;
|
|
1196
1204
|
}
|
|
1205
|
+
// Each team's score rides in a block beside its name (reader feedback:
|
|
1206
|
+
// a lone score column on the far right read as detached from the teams).
|
|
1207
|
+
// Scheduled games carry their start time on the status pill alone.
|
|
1197
1208
|
renderGame(t, e) {
|
|
1198
|
-
const s = e.state === "final" || e.state === "live"
|
|
1209
|
+
const s = e.state === "final" || e.state === "live";
|
|
1199
1210
|
return l`
|
|
1200
1211
|
<li>
|
|
1201
1212
|
${J(e)}
|
|
1202
|
-
<span class="opp">${
|
|
1203
|
-
|
|
1213
|
+
<span class="opp">${nt(t, e.awayTeamId, e.date)}${s ? l`<span class="score">${e.awayScore}</span>` : m}
|
|
1214
|
+
at ${nt(t, e.homeTeamId, e.date)}${s ? l`<span class="score">${e.homeScore}</span>` : m}</span>
|
|
1204
1215
|
<span class="where">${e.venue || ""}</span>
|
|
1205
1216
|
${e.broadcast ? l`<span class="pill class">${e.broadcast}</span>` : m}
|
|
1206
1217
|
<a class="box" href=${g(t.hrefs.game, { sport: this.sport, id: e.id })}>Box score →</a>
|
|
@@ -1208,8 +1219,8 @@ class Vt extends w {
|
|
|
1208
1219
|
`;
|
|
1209
1220
|
}
|
|
1210
1221
|
}
|
|
1211
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores",
|
|
1212
|
-
class
|
|
1222
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", Yt);
|
|
1223
|
+
class Kt extends w {
|
|
1213
1224
|
static styles = j;
|
|
1214
1225
|
static properties = {
|
|
1215
1226
|
...w.properties,
|
|
@@ -1222,7 +1233,7 @@ class Yt extends w {
|
|
|
1222
1233
|
super(), this.sport = "football", this.season = "", this.classFilter = "All", this.query = "";
|
|
1223
1234
|
}
|
|
1224
1235
|
async fetchData(t) {
|
|
1225
|
-
const e = this.season ||
|
|
1236
|
+
const e = this.season || et(), [s, a, o, i, n] = await Promise.all([
|
|
1226
1237
|
t.listConferences({ active: !0 }),
|
|
1227
1238
|
t.listSchools(),
|
|
1228
1239
|
t.listTeams({ sport: this.sport }),
|
|
@@ -1279,7 +1290,7 @@ class Yt extends w {
|
|
|
1279
1290
|
renderConference(t, e) {
|
|
1280
1291
|
const s = this.data.teams.filter((i) => i.conferenceId === e.id);
|
|
1281
1292
|
if (!s.length) return m;
|
|
1282
|
-
const a = this.query.trim().toLowerCase(), o =
|
|
1293
|
+
const a = this.query.trim().toLowerCase(), o = Gt(s, t.records);
|
|
1283
1294
|
return l`
|
|
1284
1295
|
<div class="card">
|
|
1285
1296
|
<div class="card-head">
|
|
@@ -1323,14 +1334,14 @@ class Yt extends w {
|
|
|
1323
1334
|
<td class="num">${e.rec.pf}</td>
|
|
1324
1335
|
<td class="num">${e.rec.pa}</td>
|
|
1325
1336
|
<td class="num" style="color:${n >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${n > 0 ? "+" : ""}${n}</td>
|
|
1326
|
-
<td>${
|
|
1337
|
+
<td>${st(e.rec.results) || "·"}</td>
|
|
1327
1338
|
<td>${wt(t, e.team.id)}</td>
|
|
1328
|
-
<td>${
|
|
1339
|
+
<td>${Vt(t, d, e.team.id)}</td>
|
|
1329
1340
|
</tr>
|
|
1330
1341
|
`;
|
|
1331
1342
|
}
|
|
1332
1343
|
}
|
|
1333
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings",
|
|
1344
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", Kt);
|
|
1334
1345
|
const Me = b`
|
|
1335
1346
|
.hero1 {
|
|
1336
1347
|
border-radius: var(--hsot-radius-md); color: var(--hsot-white);
|
|
@@ -1348,7 +1359,7 @@ const Me = b`
|
|
|
1348
1359
|
.delta.new { background: var(--hsot-straw); color: #6b5900; border-radius: var(--hsot-radius-xs); padding: 0.1rem 0.3rem; font-size: 0.7rem; }
|
|
1349
1360
|
.sparkline { vertical-align: middle; }
|
|
1350
1361
|
`;
|
|
1351
|
-
class
|
|
1362
|
+
class Qt extends w {
|
|
1352
1363
|
static styles = [...j, Me];
|
|
1353
1364
|
static properties = {
|
|
1354
1365
|
...w.properties,
|
|
@@ -1366,7 +1377,7 @@ class Kt extends w {
|
|
|
1366
1377
|
t && (this.pollDate = t);
|
|
1367
1378
|
}
|
|
1368
1379
|
async fetchData(t) {
|
|
1369
|
-
const e = this.season ||
|
|
1380
|
+
const e = this.season || et(), [s, a, o, i, n] = await Promise.all([
|
|
1370
1381
|
t.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
|
|
1371
1382
|
t.listSchools(),
|
|
1372
1383
|
t.listTeams({ sport: this.sport }),
|
|
@@ -1396,8 +1407,8 @@ class Kt extends w {
|
|
|
1396
1407
|
const n = e.map((p, f) => {
|
|
1397
1408
|
const u = (p.teamIds || []).indexOf(t);
|
|
1398
1409
|
if (u === -1) return null;
|
|
1399
|
-
const $ = e.length === 1 ? 96 / 2 : f / (e.length - 1) * 90 + 3,
|
|
1400
|
-
return { x: $, y:
|
|
1410
|
+
const $ = e.length === 1 ? 96 / 2 : f / (e.length - 1) * 90 + 3, rt = 3 + u / 24 * 20;
|
|
1411
|
+
return { x: $, y: rt };
|
|
1401
1412
|
}), d = [];
|
|
1402
1413
|
let c = [];
|
|
1403
1414
|
if (n.forEach((p) => {
|
|
@@ -1470,7 +1481,7 @@ class Kt extends w {
|
|
|
1470
1481
|
<h2><a href=${g(t.hrefs.school, { id: o.id })}>${o.name} ${o.mascot || ""}</a></h2>
|
|
1471
1482
|
<div class="facts">
|
|
1472
1483
|
${x(n)} overall${c ? l` · ${x(n, !0)} ${c.name}` : m}
|
|
1473
|
-
· streak ${
|
|
1484
|
+
· streak ${st(n?.results) || "·"}
|
|
1474
1485
|
${d ? l` · last: ${d.mark} ${d.my}-${d.their} vs ${Z(t, d.opp)}` : m}
|
|
1475
1486
|
${this.movement(e, s, a)}
|
|
1476
1487
|
</div>
|
|
@@ -1485,8 +1496,8 @@ class Kt extends w {
|
|
|
1485
1496
|
location.href = g(t.hrefs.school, { id: c.id });
|
|
1486
1497
|
};
|
|
1487
1498
|
return l`
|
|
1488
|
-
<tr class="rowlink" @click=${(
|
|
1489
|
-
|
|
1499
|
+
<tr class="rowlink" @click=${(rt) => {
|
|
1500
|
+
rt.target.closest("a") || $();
|
|
1490
1501
|
}}>
|
|
1491
1502
|
<td class="num" style="font-weight:700">${d}</td>
|
|
1492
1503
|
<td>${this.movement(e, s, n)}</td>
|
|
@@ -1497,13 +1508,13 @@ class Kt extends w {
|
|
|
1497
1508
|
<td>${p ? l`<a class="box" style="text-decoration:none" href=${g(t.hrefs.game, { sport: this.sport, id: p.gameId })}>
|
|
1498
1509
|
<b style="color:${p.mark === "W" ? "var(--hsot-win)" : p.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${p.mark}</b>
|
|
1499
1510
|
${p.my}-${p.their} vs ${Z(t, p.opp)}</a>` : l`<span class="mut">·</span>`}</td>
|
|
1500
|
-
<td>${
|
|
1511
|
+
<td>${Vt(t, f, n)}</td>
|
|
1501
1512
|
<td>${this.sparkline(n, a, o)}</td>
|
|
1502
1513
|
</tr>
|
|
1503
1514
|
`;
|
|
1504
1515
|
}
|
|
1505
1516
|
}
|
|
1506
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings",
|
|
1517
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", Qt);
|
|
1507
1518
|
const Le = b`
|
|
1508
1519
|
.schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
|
|
1509
1520
|
.schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
|
|
@@ -1529,7 +1540,7 @@ const Le = b`
|
|
|
1529
1540
|
.cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 1.25rem; }
|
|
1530
1541
|
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } .schoolhero h1 { font-size: 1.9rem; } }
|
|
1531
1542
|
`;
|
|
1532
|
-
class
|
|
1543
|
+
class Zt extends w {
|
|
1533
1544
|
static styles = [...j, Le];
|
|
1534
1545
|
static properties = {
|
|
1535
1546
|
...w.properties,
|
|
@@ -1547,7 +1558,7 @@ class Qt extends w {
|
|
|
1547
1558
|
t && !this.sport && (this.sport = t);
|
|
1548
1559
|
}
|
|
1549
1560
|
async fetchData(t) {
|
|
1550
|
-
const e = this.season ||
|
|
1561
|
+
const e = this.season || et(), s = await t.getSchool(this.schoolId), o = (await t.listTeams({ schoolId: this.schoolId })).items, i = o.find(($) => $.sport === (this.sport || "football")) || o[0] || null, [n, d, c, h, p, f, u] = await Promise.all([
|
|
1551
1562
|
i ? t.listGames({ sport: i.sport, season: e }) : Promise.resolve({ items: [] }),
|
|
1552
1563
|
i ? t.listTeams({ sport: i.sport }) : Promise.resolve({ items: [] }),
|
|
1553
1564
|
t.listSchools(),
|
|
@@ -1602,7 +1613,6 @@ class Qt extends w {
|
|
|
1602
1613
|
${n ? l`<span><b>Enrollment</b>${n.value.toLocaleString()} (${n.season} ADM)</span>` : m}
|
|
1603
1614
|
${t.openingYear ? l`<span><b>Opened</b>${t.openingYear}</span>` : m}
|
|
1604
1615
|
${t.areaCode ? l`<span><b>Area</b>${t.areaCode}</span>` : m}
|
|
1605
|
-
${t.tagSlug ? l`<span><b>Tag</b>#${t.tagSlug}</span>` : m}
|
|
1606
1616
|
</div>
|
|
1607
1617
|
</div>
|
|
1608
1618
|
</div>
|
|
@@ -1621,15 +1631,15 @@ class Qt extends w {
|
|
|
1621
1631
|
`;
|
|
1622
1632
|
}
|
|
1623
1633
|
renderTeam(t, e, s, a) {
|
|
1624
|
-
const o = t.records[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, i = o.w + o.l + o.t, n = s ? this.data.allTeams.filter((p) => p.conferenceId === s.id) : [], d = s ?
|
|
1634
|
+
const o = t.records[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, i = o.w + o.l + o.t, n = s ? this.data.allTeams.filter((p) => p.conferenceId === s.id) : [], d = s ? Gt(n, t.records).findIndex((p) => p.team.id === e.id) + 1 : 0, c = $t(t.rankings, t.teamsById, e.id, e.sport, null), h = this.data.games.filter((p) => p.homeTeamId === e.id || p.awayTeamId === e.id).sort((p, f) => String(p.date).localeCompare(String(f.date)));
|
|
1625
1635
|
return l`
|
|
1626
1636
|
<div class="tiles">
|
|
1627
1637
|
<div class="tile"><div class="k">Overall</div><div class="v">${x(o)}</div><div class="s">${i} games played</div></div>
|
|
1628
1638
|
<div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${x(o, !0)}</div>
|
|
1629
|
-
<div class="s">${d ? `${
|
|
1639
|
+
<div class="s">${d ? `${Te(d)} of ${n.length}` : "·"}</div></div>
|
|
1630
1640
|
<div class="tile"><div class="k">Points</div><div class="v">${i ? (o.pf / i).toFixed(1) : "0.0"}</div>
|
|
1631
1641
|
<div class="s">scored per game · ${i ? (o.pa / i).toFixed(1) : "0.0"} allowed</div></div>
|
|
1632
|
-
<div class="tile"><div class="k">Streak</div><div class="v">${
|
|
1642
|
+
<div class="tile"><div class="k">Streak</div><div class="v">${st(o.results) || "·"}</div>
|
|
1633
1643
|
<div class="s">last 5: ${wt(t, e.id)}</div></div>
|
|
1634
1644
|
<div class="tile"><div class="k">HSOT Top 25</div><div class="v">${c ? `#${c}` : "NR"}</div>
|
|
1635
1645
|
<div class="s"><a href=${g(t.hrefs.section, { sport: e.sport, view: "rankings" })}>full poll</a></div></div>
|
|
@@ -1654,7 +1664,7 @@ class Qt extends w {
|
|
|
1654
1664
|
}
|
|
1655
1665
|
renderGameRow(t, e, s) {
|
|
1656
1666
|
const a = s.homeTeamId === e.id, o = a ? s.awayTeamId : s.homeTeamId, i = a ? s.homeScore : s.awayScore, n = a ? s.awayScore : s.homeScore;
|
|
1657
|
-
let d = l`<span class="mut">${
|
|
1667
|
+
let d = l`<span class="mut">${mt(s.time)}</span>`;
|
|
1658
1668
|
if (s.state === "final") {
|
|
1659
1669
|
const h = gt(s), p = h === "tie" ? "T" : h === (a ? "home" : "away") ? "W" : "L";
|
|
1660
1670
|
d = l`<span class=${p}>${p}</span> ${i}-${n}${s.finish === "overtime" ? l` <span class="mut">OT</span>` : m}${s.forfeit && s.forfeit !== "none" ? l` <span class="mut">FF</span>` : m}`;
|
|
@@ -1663,9 +1673,9 @@ class Qt extends w {
|
|
|
1663
1673
|
return l`
|
|
1664
1674
|
<li>
|
|
1665
1675
|
<span class="d">${y(s.date)}</span>
|
|
1666
|
-
${J(s)}
|
|
1676
|
+
${Wt(s).kind === "sched" ? m : J(s)}
|
|
1667
1677
|
<span class="res">${d}</span>
|
|
1668
|
-
<span class="opp">${a ? "vs" : "at"} ${
|
|
1678
|
+
<span class="opp">${a ? "vs" : "at"} ${nt(t, o, s.date)}
|
|
1669
1679
|
<span class="pill type">${c}</span>
|
|
1670
1680
|
${s.broadcast ? l`<span class="pill class">${s.broadcast}</span>` : m}
|
|
1671
1681
|
</span>
|
|
@@ -1690,7 +1700,7 @@ class Qt extends w {
|
|
|
1690
1700
|
<td style="font-weight:500">${i.firstName} ${i.lastName}</td>
|
|
1691
1701
|
<td>${o.position || "·"}</td>
|
|
1692
1702
|
<td class="mut">${i.classOf || "·"}</td>
|
|
1693
|
-
<td class="num">${
|
|
1703
|
+
<td class="num">${Se(i.heightIn)}</td>
|
|
1694
1704
|
<td class="num">${i.weightLb || "·"}</td>
|
|
1695
1705
|
</tr>` : m;
|
|
1696
1706
|
})}
|
|
@@ -1699,7 +1709,7 @@ class Qt extends w {
|
|
|
1699
1709
|
`;
|
|
1700
1710
|
}
|
|
1701
1711
|
}
|
|
1702
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school",
|
|
1712
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", Zt);
|
|
1703
1713
|
const je = "https://api.wral.com/search";
|
|
1704
1714
|
function We(r) {
|
|
1705
1715
|
return r.map((t) => `uri:"${t}"`).join(" OR ");
|
|
@@ -1708,7 +1718,7 @@ function qe(r, t) {
|
|
|
1708
1718
|
const e = String(r || je).replace(/\/+$/, ""), s = new URLSearchParams({ query: We(t), sort: "score", lang: "en" });
|
|
1709
1719
|
return `${e}/v1/query?${s}`;
|
|
1710
1720
|
}
|
|
1711
|
-
function
|
|
1721
|
+
function Jt(r) {
|
|
1712
1722
|
try {
|
|
1713
1723
|
const t = new URL(r);
|
|
1714
1724
|
if (/(^|\.)smugmug\.com$/i.test(t.hostname)) {
|
|
@@ -1727,7 +1737,7 @@ async function Ge(r, t, e) {
|
|
|
1727
1737
|
const a = await ((...n) => fetch(...n))(qe(r, t));
|
|
1728
1738
|
if (!a.ok) throw new Error(`search answered ${a.status}`);
|
|
1729
1739
|
const o = await a.json(), i = new Map((o.items || []).map((n) => [n.uri, n]));
|
|
1730
|
-
return t.map((n) => i.get(n) ||
|
|
1740
|
+
return t.map((n) => i.get(n) || Jt(n));
|
|
1731
1741
|
}
|
|
1732
1742
|
const Ve = b`
|
|
1733
1743
|
.breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
|
|
@@ -1768,7 +1778,7 @@ const Ve = b`
|
|
|
1768
1778
|
.cols { grid-template-columns: 1fr; }
|
|
1769
1779
|
}
|
|
1770
1780
|
`;
|
|
1771
|
-
class
|
|
1781
|
+
class Xt extends w {
|
|
1772
1782
|
static styles = [...j, Ve];
|
|
1773
1783
|
static properties = {
|
|
1774
1784
|
...w.properties,
|
|
@@ -1791,7 +1801,7 @@ class Jt extends w {
|
|
|
1791
1801
|
t.listGames({ sport: e.sport, season: e.season }),
|
|
1792
1802
|
// A search outage must not blank the box score — degrade to bare
|
|
1793
1803
|
// links (fetchCoverage already degrades per-URL index misses).
|
|
1794
|
-
s.length ? Ge(this.searchApi, s).catch(() => s.map(
|
|
1804
|
+
s.length ? Ge(this.searchApi, s).catch(() => s.map(Jt)) : Promise.resolve([])
|
|
1795
1805
|
]);
|
|
1796
1806
|
return {
|
|
1797
1807
|
game: e,
|
|
@@ -1823,7 +1833,7 @@ class Jt extends w {
|
|
|
1823
1833
|
<p class="breadcrumbs">
|
|
1824
1834
|
<a href=${g(e.hrefs.section, { sport: t.sport, view: "scores" })}>${D(t.sport)}</a> /
|
|
1825
1835
|
<a href=${g(e.hrefs.section, { sport: t.sport, view: "scores" })}>Scores/Schedules</a> /
|
|
1826
|
-
${
|
|
1836
|
+
${R(e, t.awayTeamId)} at ${R(e, t.homeTeamId)}
|
|
1827
1837
|
</p>
|
|
1828
1838
|
<div class="card">
|
|
1829
1839
|
<div class="scorehead">
|
|
@@ -1835,7 +1845,7 @@ class Jt extends w {
|
|
|
1835
1845
|
<span style=${n("home")}>${t.homeScore}</span>
|
|
1836
1846
|
</div>
|
|
1837
1847
|
<div class="status">${J(t)}</div>
|
|
1838
|
-
<div class="status">${y(t.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${t.state === "scheduled" && t.time ? l` · ${
|
|
1848
|
+
<div class="status">${y(t.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${t.state === "scheduled" && t.time ? l` · ${mt(t.time)}` : m} · ${t.venue || "Venue TBD"}
|
|
1839
1849
|
${t.broadcast ? l` · <span class="pill class">${t.broadcast}</span>` : m}</div>
|
|
1840
1850
|
<div class="status">
|
|
1841
1851
|
<span class="pill type">${t.gameType === "conference" ? `${d?.name || "Conference"} game` : t.gameType}</span>
|
|
@@ -1873,7 +1883,7 @@ class Jt extends w {
|
|
|
1873
1883
|
<div class="card"><ul class="gamelist">
|
|
1874
1884
|
${c.map((h) => l`<li>
|
|
1875
1885
|
<span class="d">${y(h.date)}</span>${J(h)}
|
|
1876
|
-
<span class="opp">${
|
|
1886
|
+
<span class="opp">${R(e, h.awayTeamId)} ${h.awayScore}, ${R(e, h.homeTeamId)} ${h.homeScore}</span>
|
|
1877
1887
|
<a class="box" href=${g(e.hrefs.game, { sport: t.sport, id: h.id })}>Box score →</a>
|
|
1878
1888
|
</li>`)}
|
|
1879
1889
|
</ul></div>` : m}
|
|
@@ -1926,7 +1936,7 @@ class Jt extends w {
|
|
|
1926
1936
|
<div class="who">${H(s)}${s.name}</div>
|
|
1927
1937
|
<div class="row">
|
|
1928
1938
|
<span>Last 5: ${wt(t, e)}</span>
|
|
1929
|
-
<span>Streak: <b>${a ?
|
|
1939
|
+
<span>Streak: <b>${a ? st(a.results) : "·"}</b></span>
|
|
1930
1940
|
<span>PF/PA: <b>${a ? `${a.pf} / ${a.pa}` : "·"}</b></span>
|
|
1931
1941
|
<span>Next: ${o ? l`${y(o.date, { month: "numeric", day: "numeric" })}
|
|
1932
1942
|
${o.homeTeamId === e ? "vs" : "at"} ${Z(t, o.homeTeamId === e ? o.awayTeamId : o.homeTeamId)}` : "·"}</span>
|
|
@@ -1935,9 +1945,9 @@ class Jt extends w {
|
|
|
1935
1945
|
`;
|
|
1936
1946
|
}
|
|
1937
1947
|
}
|
|
1938
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore",
|
|
1948
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", Xt);
|
|
1939
1949
|
const Ye = 250, Ke = 2;
|
|
1940
|
-
class
|
|
1950
|
+
class te extends E {
|
|
1941
1951
|
static properties = {
|
|
1942
1952
|
api: { type: String },
|
|
1943
1953
|
schoolHref: { type: String, attribute: "school-href" },
|
|
@@ -2114,14 +2124,14 @@ class Xt extends E {
|
|
|
2114
2124
|
`;
|
|
2115
2125
|
}
|
|
2116
2126
|
}
|
|
2117
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search",
|
|
2127
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search", te);
|
|
2118
2128
|
const Qe = {
|
|
2119
|
-
"hsot-scores":
|
|
2120
|
-
"hsot-standings":
|
|
2121
|
-
"hsot-rankings":
|
|
2122
|
-
"hsot-school":
|
|
2123
|
-
"hsot-boxscore":
|
|
2124
|
-
"hsot-school-search":
|
|
2129
|
+
"hsot-scores": Yt,
|
|
2130
|
+
"hsot-standings": Kt,
|
|
2131
|
+
"hsot-rankings": Qt,
|
|
2132
|
+
"hsot-school": Zt,
|
|
2133
|
+
"hsot-boxscore": Xt,
|
|
2134
|
+
"hsot-school-search": te
|
|
2125
2135
|
};
|
|
2126
2136
|
function Ze() {
|
|
2127
2137
|
const r = globalThis?.customElements;
|