@topsort/banners
Advanced tools
@@ -52,2 +52,11 @@ import { LitElement } from 'lit'; | ||
| export declare class HlsVideo extends LitElement { | ||
| src: string; | ||
| width: string; | ||
| height: string; | ||
| private get videoId(); | ||
| render(): TemplateResult<1>; | ||
| firstUpdated(): void; | ||
| } | ||
| /** | ||
@@ -54,0 +63,0 @@ * A banner web component that runs an auction and renders the winning banner. |
+358
-318
@@ -6,3 +6,3 @@ /** | ||
| */ | ||
| let at = class extends Event { | ||
| let lt = class extends Event { | ||
| constructor(t, e, s) { | ||
@@ -22,9 +22,9 @@ super("context-request", { bubbles: !0, composed: !0 }), this.context = t, this.callback = e, this.subscribe = s ?? !1; | ||
| */ | ||
| let F = class { | ||
| let Z = class { | ||
| constructor(t, e, s, i) { | ||
| if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (n, o) => { | ||
| this.unsubscribe && (this.unsubscribe !== o && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = n, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(n, o)), this.unsubscribe = o; | ||
| if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (o, n) => { | ||
| this.unsubscribe && (this.unsubscribe !== n && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = o, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(o, n)), this.unsubscribe = n; | ||
| }, this.host = t, e.context !== void 0) { | ||
| const n = e; | ||
| this.context = n.context, this.callback = n.callback, this.subscribe = n.subscribe ?? !1; | ||
| const o = e; | ||
| this.context = o.context, this.callback = o.callback, this.subscribe = o.subscribe ?? !1; | ||
| } else | ||
@@ -41,3 +41,3 @@ this.context = e, this.callback = s, this.subscribe = i ?? !1; | ||
| dispatchRequest() { | ||
| this.host.dispatchEvent(new at(this.context, this.t, this.subscribe)); | ||
| this.host.dispatchEvent(new lt(this.context, this.t, this.subscribe)); | ||
| } | ||
@@ -50,3 +50,3 @@ }; | ||
| */ | ||
| let vt = class { | ||
| let At = class { | ||
| get value() { | ||
@@ -86,21 +86,21 @@ return this.o; | ||
| */ | ||
| let At = class extends Event { | ||
| let wt = class extends Event { | ||
| constructor(t) { | ||
| super("context-provider", { bubbles: !0, composed: !0 }), this.context = t; | ||
| } | ||
| }, X = class extends vt { | ||
| }, G = class extends At { | ||
| constructor(t, e, s) { | ||
| var i, n; | ||
| super(e.context !== void 0 ? e.initialValue : s), this.onContextRequest = (o) => { | ||
| const a = o.composedPath()[0]; | ||
| o.context === this.context && a !== this.host && (o.stopPropagation(), this.addCallback(o.callback, a, o.subscribe)); | ||
| }, this.onProviderRequest = (o) => { | ||
| const a = o.composedPath()[0]; | ||
| if (o.context !== this.context || a === this.host) | ||
| var i, o; | ||
| super(e.context !== void 0 ? e.initialValue : s), this.onContextRequest = (n) => { | ||
| const a = n.composedPath()[0]; | ||
| n.context === this.context && a !== this.host && (n.stopPropagation(), this.addCallback(n.callback, a, n.subscribe)); | ||
| }, this.onProviderRequest = (n) => { | ||
| const a = n.composedPath()[0]; | ||
| if (n.context !== this.context || a === this.host) | ||
| return; | ||
| const h = /* @__PURE__ */ new Set(); | ||
| for (const [c, { consumerHost: u }] of this.subscriptions) | ||
| h.has(c) || (h.add(c), u.dispatchEvent(new at(this.context, c, !0))); | ||
| o.stopPropagation(); | ||
| }, this.host = t, e.context !== void 0 ? this.context = e.context : this.context = e, this.attachListeners(), (n = (i = this.host).addController) == null || n.call(i, this); | ||
| for (const [c, { consumerHost: d }] of this.subscriptions) | ||
| h.has(c) || (h.add(c), d.dispatchEvent(new lt(this.context, c, !0))); | ||
| n.stopPropagation(); | ||
| }, this.host = t, e.context !== void 0 ? this.context = e.context : this.context = e, this.attachListeners(), (o = (i = this.host).addController) == null || o.call(i, this); | ||
| } | ||
@@ -111,3 +111,3 @@ attachListeners() { | ||
| hostConnected() { | ||
| this.host.dispatchEvent(new At(this.context)); | ||
| this.host.dispatchEvent(new wt(this.context)); | ||
| } | ||
@@ -120,3 +120,3 @@ }; | ||
| */ | ||
| function wt({ context: r }) { | ||
| function Et({ context: r }) { | ||
| return (t, e) => { | ||
@@ -126,32 +126,32 @@ const s = /* @__PURE__ */ new WeakMap(); | ||
| return e.addInitializer(function() { | ||
| s.set(this, new X(this, { context: r })); | ||
| s.set(this, new G(this, { context: r })); | ||
| }), { get() { | ||
| return t.get.call(this); | ||
| }, set(i) { | ||
| var n; | ||
| return (n = s.get(this)) == null || n.setValue(i), t.set.call(this, i); | ||
| var o; | ||
| return (o = s.get(this)) == null || o.setValue(i), t.set.call(this, i); | ||
| }, init(i) { | ||
| var n; | ||
| return (n = s.get(this)) == null || n.setValue(i), i; | ||
| var o; | ||
| return (o = s.get(this)) == null || o.setValue(i), i; | ||
| } }; | ||
| { | ||
| t.constructor.addInitializer((o) => { | ||
| s.set(o, new X(o, { context: r })); | ||
| t.constructor.addInitializer((n) => { | ||
| s.set(n, new G(n, { context: r })); | ||
| }); | ||
| const i = Object.getOwnPropertyDescriptor(t, e); | ||
| let n; | ||
| let o; | ||
| if (i === void 0) { | ||
| const o = /* @__PURE__ */ new WeakMap(); | ||
| n = { get() { | ||
| return o.get(this); | ||
| const n = /* @__PURE__ */ new WeakMap(); | ||
| o = { get() { | ||
| return n.get(this); | ||
| }, set(a) { | ||
| s.get(this).setValue(a), o.set(this, a); | ||
| s.get(this).setValue(a), n.set(this, a); | ||
| }, configurable: !0, enumerable: !0 }; | ||
| } else { | ||
| const o = i.set; | ||
| n = { ...i, set(a) { | ||
| s.get(this).setValue(a), o == null || o.call(this, a); | ||
| const n = i.set; | ||
| o = { ...i, set(a) { | ||
| s.get(this).setValue(a), n == null || n.call(this, a); | ||
| } }; | ||
| } | ||
| return void Object.defineProperty(t, e, n); | ||
| return void Object.defineProperty(t, e, o); | ||
| } | ||
@@ -165,11 +165,11 @@ }; | ||
| */ | ||
| function Et({ context: r, subscribe: t }) { | ||
| function St({ context: r, subscribe: t }) { | ||
| return (e, s) => { | ||
| typeof s == "object" ? s.addInitializer(function() { | ||
| new F(this, { context: r, callback: (i) => { | ||
| new Z(this, { context: r, callback: (i) => { | ||
| e.set.call(this, i); | ||
| }, subscribe: t }); | ||
| }) : e.constructor.addInitializer((i) => { | ||
| new F(i, { context: r, callback: (n) => { | ||
| i[s] = n; | ||
| new Z(i, { context: r, callback: (o) => { | ||
| i[s] = o; | ||
| }, subscribe: t }); | ||
@@ -184,6 +184,6 @@ }); | ||
| */ | ||
| const M = globalThis, J = M.ShadowRoot && (M.ShadyCSS === void 0 || M.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ct = Symbol(), Z = /* @__PURE__ */ new WeakMap(); | ||
| let St = class { | ||
| const j = globalThis, J = j.ShadowRoot && (j.ShadyCSS === void 0 || j.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, dt = Symbol(), Y = /* @__PURE__ */ new WeakMap(); | ||
| let xt = class { | ||
| constructor(t, e, s) { | ||
| if (this._$cssResult$ = !0, s !== ct) | ||
| if (this._$cssResult$ = !0, s !== dt) | ||
| throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); | ||
@@ -197,3 +197,3 @@ this.cssText = t, this.t = e; | ||
| const s = e !== void 0 && e.length === 1; | ||
| s && (t = Z.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && Z.set(e, t)); | ||
| s && (t = Y.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && Y.set(e, t)); | ||
| } | ||
@@ -206,3 +206,3 @@ return t; | ||
| }; | ||
| const xt = (r) => new St(typeof r == "string" ? r : r + "", void 0, ct), Ct = (r, t) => { | ||
| const Ct = (r) => new xt(typeof r == "string" ? r : r + "", void 0, dt), Tt = (r, t) => { | ||
| if (J) | ||
@@ -212,10 +212,10 @@ r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet); | ||
| for (const e of t) { | ||
| const s = document.createElement("style"), i = M.litNonce; | ||
| const s = document.createElement("style"), i = j.litNonce; | ||
| i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s); | ||
| } | ||
| }, G = J ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => { | ||
| }, tt = J ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => { | ||
| let e = ""; | ||
| for (const s of t.cssRules) | ||
| e += s.cssText; | ||
| return xt(e); | ||
| return Ct(e); | ||
| })(r) : r; | ||
@@ -227,6 +227,6 @@ /** | ||
| */ | ||
| const { is: Tt, defineProperty: Pt, getOwnPropertyDescriptor: Nt, getOwnPropertyNames: Rt, getOwnPropertySymbols: Ut, getPrototypeOf: Ot } = Object, m = globalThis, Y = m.trustedTypes, kt = Y ? Y.emptyScript : "", z = m.reactiveElementPolyfillSupport, N = (r, t) => r, H = { toAttribute(r, t) { | ||
| const { is: Pt, defineProperty: Rt, getOwnPropertyDescriptor: Nt, getOwnPropertyNames: Ut, getOwnPropertySymbols: Ot, getPrototypeOf: kt } = Object, v = globalThis, et = v.trustedTypes, It = et ? et.emptyScript : "", W = v.reactiveElementPolyfillSupport, R = (r, t) => r, B = { toAttribute(r, t) { | ||
| switch (t) { | ||
| case Boolean: | ||
| r = r ? kt : null; | ||
| r = r ? It : null; | ||
| break; | ||
@@ -256,5 +256,5 @@ case Object: | ||
| return e; | ||
| } }, L = (r, t) => !Tt(r, t), tt = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: L }; | ||
| Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), m.litPropertyMetadata ?? (m.litPropertyMetadata = /* @__PURE__ */ new WeakMap()); | ||
| class S extends HTMLElement { | ||
| } }, D = (r, t) => !Pt(r, t), st = { attribute: !0, type: String, converter: B, reflect: !1, hasChanged: D }; | ||
| Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), v.litPropertyMetadata ?? (v.litPropertyMetadata = /* @__PURE__ */ new WeakMap()); | ||
| class x extends HTMLElement { | ||
| static addInitializer(t) { | ||
@@ -266,35 +266,35 @@ this._$Ei(), (this.l ?? (this.l = [])).push(t); | ||
| } | ||
| static createProperty(t, e = tt) { | ||
| static createProperty(t, e = st) { | ||
| if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) { | ||
| const s = Symbol(), i = this.getPropertyDescriptor(t, s, e); | ||
| i !== void 0 && Pt(this.prototype, t, i); | ||
| i !== void 0 && Rt(this.prototype, t, i); | ||
| } | ||
| } | ||
| static getPropertyDescriptor(t, e, s) { | ||
| const { get: i, set: n } = Nt(this.prototype, t) ?? { get() { | ||
| const { get: i, set: o } = Nt(this.prototype, t) ?? { get() { | ||
| return this[e]; | ||
| }, set(o) { | ||
| this[e] = o; | ||
| }, set(n) { | ||
| this[e] = n; | ||
| } }; | ||
| return { get() { | ||
| return i == null ? void 0 : i.call(this); | ||
| }, set(o) { | ||
| }, set(n) { | ||
| const a = i == null ? void 0 : i.call(this); | ||
| n.call(this, o), this.requestUpdate(t, a, s); | ||
| o.call(this, n), this.requestUpdate(t, a, s); | ||
| }, configurable: !0, enumerable: !0 }; | ||
| } | ||
| static getPropertyOptions(t) { | ||
| return this.elementProperties.get(t) ?? tt; | ||
| return this.elementProperties.get(t) ?? st; | ||
| } | ||
| static _$Ei() { | ||
| if (this.hasOwnProperty(N("elementProperties"))) | ||
| if (this.hasOwnProperty(R("elementProperties"))) | ||
| return; | ||
| const t = Ot(this); | ||
| const t = kt(this); | ||
| t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties); | ||
| } | ||
| static finalize() { | ||
| if (this.hasOwnProperty(N("finalized"))) | ||
| if (this.hasOwnProperty(R("finalized"))) | ||
| return; | ||
| if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(N("properties"))) { | ||
| const e = this.properties, s = [...Rt(e), ...Ut(e)]; | ||
| if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(R("properties"))) { | ||
| const e = this.properties, s = [...Ut(e), ...Ot(e)]; | ||
| for (const i of s) | ||
@@ -322,5 +322,5 @@ this.createProperty(i, e[i]); | ||
| for (const i of s) | ||
| e.unshift(G(i)); | ||
| e.unshift(tt(i)); | ||
| } else | ||
| t !== void 0 && e.push(G(t)); | ||
| t !== void 0 && e.push(tt(t)); | ||
| return e; | ||
@@ -355,3 +355,3 @@ } | ||
| const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); | ||
| return Ct(t, this.constructor.elementStyles), t; | ||
| return Tt(t, this.constructor.elementStyles), t; | ||
| } | ||
@@ -378,15 +378,15 @@ connectedCallback() { | ||
| _$EC(t, e) { | ||
| var n; | ||
| var o; | ||
| const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s); | ||
| if (i !== void 0 && s.reflect === !0) { | ||
| const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : H).toAttribute(e, s.type); | ||
| this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null; | ||
| const n = (((o = s.converter) == null ? void 0 : o.toAttribute) !== void 0 ? s.converter : B).toAttribute(e, s.type); | ||
| this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null; | ||
| } | ||
| } | ||
| _$AK(t, e) { | ||
| var n; | ||
| var o; | ||
| const s = this.constructor, i = s._$Eh.get(t); | ||
| if (i !== void 0 && this._$Em !== i) { | ||
| const o = s.getPropertyOptions(i), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : H; | ||
| this._$Em = i, this[i] = a.fromAttribute(e, o.type), this._$Em = null; | ||
| const n = s.getPropertyOptions(i), a = typeof n.converter == "function" ? { fromAttribute: n.converter } : ((o = n.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? n.converter : B; | ||
| this._$Em = i, this[i] = a.fromAttribute(e, n.type), this._$Em = null; | ||
| } | ||
@@ -396,3 +396,3 @@ } | ||
| if (t !== void 0) { | ||
| if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? L)(this[t], e)) | ||
| if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? D)(this[t], e)) | ||
| return; | ||
@@ -425,4 +425,4 @@ this.P(t, e, s); | ||
| if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) { | ||
| for (const [n, o] of this._$Ep) | ||
| this[n] = o; | ||
| for (const [o, n] of this._$Ep) | ||
| this[o] = n; | ||
| this._$Ep = void 0; | ||
@@ -432,4 +432,4 @@ } | ||
| if (i.size > 0) | ||
| for (const [n, o] of i) | ||
| o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.P(n, this[n], o); | ||
| for (const [o, n] of i) | ||
| n.wrapped !== !0 || this._$AL.has(o) || this[o] === void 0 || this.P(o, this[o], n); | ||
| } | ||
@@ -440,4 +440,4 @@ let t = !1; | ||
| t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((i) => { | ||
| var n; | ||
| return (n = i.hostUpdate) == null ? void 0 : n.call(i); | ||
| var o; | ||
| return (o = i.hostUpdate) == null ? void 0 : o.call(i); | ||
| }), this.update(e)) : this._$EU(); | ||
@@ -478,3 +478,3 @@ } catch (i) { | ||
| } | ||
| S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[N("elementProperties")] = /* @__PURE__ */ new Map(), S[N("finalized")] = /* @__PURE__ */ new Map(), z == null || z({ ReactiveElement: S }), (m.reactiveElementVersions ?? (m.reactiveElementVersions = [])).push("2.0.4"); | ||
| x.elementStyles = [], x.shadowRootOptions = { mode: "open" }, x[R("elementProperties")] = /* @__PURE__ */ new Map(), x[R("finalized")] = /* @__PURE__ */ new Map(), W == null || W({ ReactiveElement: x }), (v.reactiveElementVersions ?? (v.reactiveElementVersions = [])).push("2.0.4"); | ||
| /** | ||
@@ -485,4 +485,4 @@ * @license | ||
| */ | ||
| const jt = Symbol(); | ||
| let It = class { | ||
| const Ht = Symbol(); | ||
| let Mt = class { | ||
| get taskComplete() { | ||
@@ -494,6 +494,6 @@ return this.t || (this.i === 1 ? this.t = new Promise((t, e) => { | ||
| constructor(t, e, s) { | ||
| var n; | ||
| var o; | ||
| this.p = 0, this.i = 0, (this._ = t).addController(this); | ||
| const i = typeof e == "object" ? e : { task: e, args: s }; | ||
| this.v = i.task, this.j = i.args, this.m = i.argsEqual ?? Mt, this.k = i.onComplete, this.A = i.onError, this.autoRun = i.autoRun ?? !0, "initialValue" in i && (this.u = i.initialValue, this.i = 2, this.O = (n = this.T) == null ? void 0 : n.call(this)); | ||
| this.v = i.task, this.j = i.args, this.m = i.argsEqual ?? jt, this.k = i.onComplete, this.A = i.onError, this.autoRun = i.autoRun ?? !0, "initialValue" in i && (this.u = i.initialValue, this.i = 2, this.O = (o = this.T) == null ? void 0 : o.call(this)); | ||
| } | ||
@@ -519,18 +519,18 @@ hostUpdate() { | ||
| async run(t) { | ||
| var o, a, h, c, u; | ||
| var n, a, h, c, d; | ||
| let e, s; | ||
| t ?? (t = this.T()), this.O = t, this.i === 1 ? (o = this.q) == null || o.abort() : (this.t = void 0, this.o = void 0, this.h = void 0), this.i = 1, this.autoRun === "afterUpdate" ? queueMicrotask(() => this._.requestUpdate()) : this._.requestUpdate(); | ||
| t ?? (t = this.T()), this.O = t, this.i === 1 ? (n = this.q) == null || n.abort() : (this.t = void 0, this.o = void 0, this.h = void 0), this.i = 1, this.autoRun === "afterUpdate" ? queueMicrotask(() => this._.requestUpdate()) : this._.requestUpdate(); | ||
| const i = ++this.p; | ||
| this.q = new AbortController(); | ||
| let n = !1; | ||
| let o = !1; | ||
| try { | ||
| e = await this.v(t, { signal: this.q.signal }); | ||
| } catch (l) { | ||
| n = !0, s = l; | ||
| o = !0, s = l; | ||
| } | ||
| if (this.p === i) { | ||
| if (e === jt) | ||
| if (e === Ht) | ||
| this.i = 0; | ||
| else { | ||
| if (n === !1) { | ||
| if (o === !1) { | ||
| try { | ||
@@ -546,3 +546,3 @@ (a = this.k) == null || a.call(this, e); | ||
| } | ||
| this.i = 3, (u = this.h) == null || u.call(this, s); | ||
| this.i = 3, (d = this.h) == null || d.call(this, s); | ||
| } | ||
@@ -568,3 +568,3 @@ this.u = e, this.l = s; | ||
| render(t) { | ||
| var e, s, i, n; | ||
| var e, s, i, o; | ||
| switch (this.i) { | ||
@@ -578,3 +578,3 @@ case 0: | ||
| case 3: | ||
| return (n = t.error) == null ? void 0 : n.call(t, this.error); | ||
| return (o = t.error) == null ? void 0 : o.call(t, this.error); | ||
| default: | ||
@@ -585,3 +585,3 @@ throw Error("Unexpected status: " + this.i); | ||
| }; | ||
| const Mt = (r, t) => r === t || r.length === t.length && r.every((e, s) => !L(e, t[s])); | ||
| const jt = (r, t) => r === t || r.length === t.length && r.every((e, s) => !D(e, t[s])); | ||
| /** | ||
@@ -592,22 +592,22 @@ * @license | ||
| */ | ||
| const R = globalThis, B = R.trustedTypes, et = B ? B.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, lt = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, ut = "?" + _, Ht = `<${ut}>`, w = document, U = () => w.createComment(""), O = (r) => r === null || typeof r != "object" && typeof r != "function", dt = Array.isArray, Bt = (r) => dt(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", W = `[ | ||
| \f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, st = /-->/g, it = />/g, v = RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ | ||
| \f\r"'\`<>=]|("|')|))|$)`, "g"), rt = /'/g, nt = /"/g, pt = /^(?:script|style|textarea|title)$/i, qt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), p = qt(1), C = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), ot = /* @__PURE__ */ new WeakMap(), A = w.createTreeWalker(w, 129); | ||
| function ft(r, t) { | ||
| const N = globalThis, q = N.trustedTypes, it = q ? q.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, ut = "$lit$", m = `lit$${Math.random().toFixed(9).slice(2)}$`, pt = "?" + m, Bt = `<${pt}>`, S = document, U = () => S.createComment(""), O = (r) => r === null || typeof r != "object" && typeof r != "function", ft = Array.isArray, qt = (r) => ft(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", V = `[ | ||
| \f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, rt = /-->/g, ot = />/g, A = RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^ | ||
| \f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g, ht = /"/g, $t = /^(?:script|style|textarea|title)$/i, Lt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), f = Lt(1), C = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), w = S.createTreeWalker(S, 129); | ||
| function gt(r, t) { | ||
| if (!Array.isArray(r) || !r.hasOwnProperty("raw")) | ||
| throw Error("invalid template strings array"); | ||
| return et !== void 0 ? et.createHTML(t) : t; | ||
| return it !== void 0 ? it.createHTML(t) : t; | ||
| } | ||
| const Lt = (r, t) => { | ||
| const Dt = (r, t) => { | ||
| const e = r.length - 1, s = []; | ||
| let i, n = t === 2 ? "<svg>" : "", o = P; | ||
| let i, o = t === 2 ? "<svg>" : "", n = P; | ||
| for (let a = 0; a < e; a++) { | ||
| const h = r[a]; | ||
| let c, u, l = -1, $ = 0; | ||
| for (; $ < h.length && (o.lastIndex = $, u = o.exec(h), u !== null); ) | ||
| $ = o.lastIndex, o === P ? u[1] === "!--" ? o = st : u[1] !== void 0 ? o = it : u[2] !== void 0 ? (pt.test(u[2]) && (i = RegExp("</" + u[2], "g")), o = v) : u[3] !== void 0 && (o = v) : o === v ? u[0] === ">" ? (o = i ?? P, l = -1) : u[1] === void 0 ? l = -2 : (l = o.lastIndex - u[2].length, c = u[1], o = u[3] === void 0 ? v : u[3] === '"' ? nt : rt) : o === nt || o === rt ? o = v : o === st || o === it ? o = P : (o = v, i = void 0); | ||
| const g = o === v && r[a + 1].startsWith("/>") ? " " : ""; | ||
| n += o === P ? h + Ht : l >= 0 ? (s.push(c), h.slice(0, l) + lt + h.slice(l) + _ + g) : h + _ + (l === -2 ? a : g); | ||
| let c, d, l = -1, $ = 0; | ||
| for (; $ < h.length && (n.lastIndex = $, d = n.exec(h), d !== null); ) | ||
| $ = n.lastIndex, n === P ? d[1] === "!--" ? n = rt : d[1] !== void 0 ? n = ot : d[2] !== void 0 ? ($t.test(d[2]) && (i = RegExp("</" + d[2], "g")), n = A) : d[3] !== void 0 && (n = A) : n === A ? d[0] === ">" ? (n = i ?? P, l = -1) : d[1] === void 0 ? l = -2 : (l = n.lastIndex - d[2].length, c = d[1], n = d[3] === void 0 ? A : d[3] === '"' ? ht : nt) : n === ht || n === nt ? n = A : n === rt || n === ot ? n = P : (n = A, i = void 0); | ||
| const g = n === A && r[a + 1].startsWith("/>") ? " " : ""; | ||
| o += n === P ? h + Bt : l >= 0 ? (s.push(c), h.slice(0, l) + ut + h.slice(l) + m + g) : h + m + (l === -2 ? a : g); | ||
| } | ||
| return [ft(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), s]; | ||
| return [gt(r, o + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), s]; | ||
| }; | ||
@@ -618,23 +618,23 @@ class k { | ||
| this.parts = []; | ||
| let n = 0, o = 0; | ||
| const a = t.length - 1, h = this.parts, [c, u] = Lt(t, e); | ||
| if (this.el = k.createElement(c, s), A.currentNode = this.el.content, e === 2) { | ||
| let o = 0, n = 0; | ||
| const a = t.length - 1, h = this.parts, [c, d] = Dt(t, e); | ||
| if (this.el = k.createElement(c, s), w.currentNode = this.el.content, e === 2) { | ||
| const l = this.el.content.firstChild; | ||
| l.replaceWith(...l.childNodes); | ||
| } | ||
| for (; (i = A.nextNode()) !== null && h.length < a; ) { | ||
| for (; (i = w.nextNode()) !== null && h.length < a; ) { | ||
| if (i.nodeType === 1) { | ||
| if (i.hasAttributes()) | ||
| for (const l of i.getAttributeNames()) | ||
| if (l.endsWith(lt)) { | ||
| const $ = u[o++], g = i.getAttribute(l).split(_), y = /([.?@])?(.*)/.exec($); | ||
| h.push({ type: 1, index: n, name: y[2], strings: g, ctor: y[1] === "." ? zt : y[1] === "?" ? Wt : y[1] === "@" ? Vt : D }), i.removeAttribute(l); | ||
| if (l.endsWith(ut)) { | ||
| const $ = d[n++], g = i.getAttribute(l).split(m), _ = /([.?@])?(.*)/.exec($); | ||
| h.push({ type: 1, index: o, name: _[2], strings: g, ctor: _[1] === "." ? Wt : _[1] === "?" ? Vt : _[1] === "@" ? Kt : z }), i.removeAttribute(l); | ||
| } else | ||
| l.startsWith(_) && (h.push({ type: 6, index: n }), i.removeAttribute(l)); | ||
| if (pt.test(i.tagName)) { | ||
| const l = i.textContent.split(_), $ = l.length - 1; | ||
| l.startsWith(m) && (h.push({ type: 6, index: o }), i.removeAttribute(l)); | ||
| if ($t.test(i.tagName)) { | ||
| const l = i.textContent.split(m), $ = l.length - 1; | ||
| if ($ > 0) { | ||
| i.textContent = B ? B.emptyScript : ""; | ||
| i.textContent = q ? q.emptyScript : ""; | ||
| for (let g = 0; g < $; g++) | ||
| i.append(l[g], U()), A.nextNode(), h.push({ type: 2, index: ++n }); | ||
| i.append(l[g], U()), w.nextNode(), h.push({ type: 2, index: ++o }); | ||
| i.append(l[$], U()); | ||
@@ -644,14 +644,14 @@ } | ||
| } else if (i.nodeType === 8) | ||
| if (i.data === ut) | ||
| h.push({ type: 2, index: n }); | ||
| if (i.data === pt) | ||
| h.push({ type: 2, index: o }); | ||
| else { | ||
| let l = -1; | ||
| for (; (l = i.data.indexOf(_, l + 1)) !== -1; ) | ||
| h.push({ type: 7, index: n }), l += _.length - 1; | ||
| for (; (l = i.data.indexOf(m, l + 1)) !== -1; ) | ||
| h.push({ type: 7, index: o }), l += m.length - 1; | ||
| } | ||
| n++; | ||
| o++; | ||
| } | ||
| } | ||
| static createElement(t, e) { | ||
| const s = w.createElement("template"); | ||
| const s = S.createElement("template"); | ||
| return s.innerHTML = t, s; | ||
@@ -661,10 +661,10 @@ } | ||
| function T(r, t, e = r, s) { | ||
| var o, a; | ||
| var n, a; | ||
| if (t === C) | ||
| return t; | ||
| let i = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl; | ||
| const n = O(t) ? void 0 : t._$litDirective$; | ||
| return (i == null ? void 0 : i.constructor) !== n && ((a = i == null ? void 0 : i._$AO) == null || a.call(i, !1), n === void 0 ? i = void 0 : (i = new n(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = i : e._$Cl = i), i !== void 0 && (t = T(r, i._$AS(r, t.values), i, s)), t; | ||
| let i = s !== void 0 ? (n = e._$Co) == null ? void 0 : n[s] : e._$Cl; | ||
| const o = O(t) ? void 0 : t._$litDirective$; | ||
| return (i == null ? void 0 : i.constructor) !== o && ((a = i == null ? void 0 : i._$AO) == null || a.call(i, !1), o === void 0 ? i = void 0 : (i = new o(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = i : e._$Cl = i), i !== void 0 && (t = T(r, i._$AS(r, t.values), i, s)), t; | ||
| } | ||
| class Dt { | ||
| class zt { | ||
| constructor(t, e) { | ||
@@ -680,13 +680,13 @@ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e; | ||
| u(t) { | ||
| const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? w).importNode(e, !0); | ||
| A.currentNode = i; | ||
| let n = A.nextNode(), o = 0, a = 0, h = s[0]; | ||
| const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? S).importNode(e, !0); | ||
| w.currentNode = i; | ||
| let o = w.nextNode(), n = 0, a = 0, h = s[0]; | ||
| for (; h !== void 0; ) { | ||
| if (o === h.index) { | ||
| if (n === h.index) { | ||
| let c; | ||
| h.type === 2 ? c = new I(n, n.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (c = new Kt(n, this, t)), this._$AV.push(c), h = s[++a]; | ||
| h.type === 2 ? c = new M(o, o.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(o, h.name, h.strings, this, t) : h.type === 6 && (c = new Qt(o, this, t)), this._$AV.push(c), h = s[++a]; | ||
| } | ||
| o !== (h == null ? void 0 : h.index) && (n = A.nextNode(), o++); | ||
| n !== (h == null ? void 0 : h.index) && (o = w.nextNode(), n++); | ||
| } | ||
| return A.currentNode = w, i; | ||
| return w.currentNode = S, i; | ||
| } | ||
@@ -699,3 +699,3 @@ p(t) { | ||
| } | ||
| class I { | ||
| class M { | ||
| get _$AU() { | ||
@@ -706,3 +706,3 @@ var t; | ||
| constructor(t, e, s, i) { | ||
| this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0; | ||
| this.type = 2, this._$AH = u, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0; | ||
| } | ||
@@ -721,3 +721,3 @@ get parentNode() { | ||
| _$AI(t, e = this) { | ||
| t = T(this, t, e), O(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== C && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Bt(t) ? this.k(t) : this._(t); | ||
| t = T(this, t, e), O(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== C && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : qt(t) ? this.k(t) : this._(t); | ||
| } | ||
@@ -731,24 +731,24 @@ S(t) { | ||
| _(t) { | ||
| this._$AH !== d && O(this._$AH) ? this._$AA.nextSibling.data = t : this.T(w.createTextNode(t)), this._$AH = t; | ||
| this._$AH !== u && O(this._$AH) ? this._$AA.nextSibling.data = t : this.T(S.createTextNode(t)), this._$AH = t; | ||
| } | ||
| $(t) { | ||
| var n; | ||
| const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = k.createElement(ft(s.h, s.h[0]), this.options)), s); | ||
| if (((n = this._$AH) == null ? void 0 : n._$AD) === i) | ||
| var o; | ||
| const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = k.createElement(gt(s.h, s.h[0]), this.options)), s); | ||
| if (((o = this._$AH) == null ? void 0 : o._$AD) === i) | ||
| this._$AH.p(e); | ||
| else { | ||
| const o = new Dt(i, this), a = o.u(this.options); | ||
| o.p(e), this.T(a), this._$AH = o; | ||
| const n = new zt(i, this), a = n.u(this.options); | ||
| n.p(e), this.T(a), this._$AH = n; | ||
| } | ||
| } | ||
| _$AC(t) { | ||
| let e = ot.get(t.strings); | ||
| return e === void 0 && ot.set(t.strings, e = new k(t)), e; | ||
| let e = at.get(t.strings); | ||
| return e === void 0 && at.set(t.strings, e = new k(t)), e; | ||
| } | ||
| k(t) { | ||
| dt(this._$AH) || (this._$AH = [], this._$AR()); | ||
| ft(this._$AH) || (this._$AH = [], this._$AR()); | ||
| const e = this._$AH; | ||
| let s, i = 0; | ||
| for (const n of t) | ||
| i === e.length ? e.push(s = new I(this.S(U()), this.S(U()), this, this.options)) : s = e[i], s._$AI(n), i++; | ||
| for (const o of t) | ||
| i === e.length ? e.push(s = new M(this.S(U()), this.S(U()), this, this.options)) : s = e[i], s._$AI(o), i++; | ||
| i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i); | ||
@@ -768,3 +768,3 @@ } | ||
| } | ||
| class D { | ||
| class z { | ||
| get tagName() { | ||
@@ -776,23 +776,23 @@ return this.element.tagName; | ||
| } | ||
| constructor(t, e, s, i, n) { | ||
| this.type = 1, this._$AH = d, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = d; | ||
| constructor(t, e, s, i, o) { | ||
| this.type = 1, this._$AH = u, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = u; | ||
| } | ||
| _$AI(t, e = this, s, i) { | ||
| const n = this.strings; | ||
| let o = !1; | ||
| if (n === void 0) | ||
| t = T(this, t, e, 0), o = !O(t) || t !== this._$AH && t !== C, o && (this._$AH = t); | ||
| const o = this.strings; | ||
| let n = !1; | ||
| if (o === void 0) | ||
| t = T(this, t, e, 0), n = !O(t) || t !== this._$AH && t !== C, n && (this._$AH = t); | ||
| else { | ||
| const a = t; | ||
| let h, c; | ||
| for (t = n[0], h = 0; h < n.length - 1; h++) | ||
| c = T(this, a[s + h], e, h), c === C && (c = this._$AH[h]), o || (o = !O(c) || c !== this._$AH[h]), c === d ? t = d : t !== d && (t += (c ?? "") + n[h + 1]), this._$AH[h] = c; | ||
| for (t = o[0], h = 0; h < o.length - 1; h++) | ||
| c = T(this, a[s + h], e, h), c === C && (c = this._$AH[h]), n || (n = !O(c) || c !== this._$AH[h]), c === u ? t = u : t !== u && (t += (c ?? "") + o[h + 1]), this._$AH[h] = c; | ||
| } | ||
| o && !i && this.j(t); | ||
| n && !i && this.j(t); | ||
| } | ||
| j(t) { | ||
| t === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? ""); | ||
| t === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? ""); | ||
| } | ||
| } | ||
| class zt extends D { | ||
| class Wt extends z { | ||
| constructor() { | ||
@@ -802,6 +802,6 @@ super(...arguments), this.type = 3; | ||
| j(t) { | ||
| this.element[this.name] = t === d ? void 0 : t; | ||
| this.element[this.name] = t === u ? void 0 : t; | ||
| } | ||
| } | ||
| class Wt extends D { | ||
| class Vt extends z { | ||
| constructor() { | ||
@@ -811,14 +811,14 @@ super(...arguments), this.type = 4; | ||
| j(t) { | ||
| this.element.toggleAttribute(this.name, !!t && t !== d); | ||
| this.element.toggleAttribute(this.name, !!t && t !== u); | ||
| } | ||
| } | ||
| class Vt extends D { | ||
| constructor(t, e, s, i, n) { | ||
| super(t, e, s, i, n), this.type = 5; | ||
| class Kt extends z { | ||
| constructor(t, e, s, i, o) { | ||
| super(t, e, s, i, o), this.type = 5; | ||
| } | ||
| _$AI(t, e = this) { | ||
| if ((t = T(this, t, e, 0) ?? d) === C) | ||
| if ((t = T(this, t, e, 0) ?? u) === C) | ||
| return; | ||
| const s = this._$AH, i = t === d && s !== d || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== d && (s === d || i); | ||
| i && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t; | ||
| const s = this._$AH, i = t === u && s !== u || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== u && (s === u || i); | ||
| i && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t; | ||
| } | ||
@@ -830,3 +830,3 @@ handleEvent(t) { | ||
| } | ||
| class Kt { | ||
| class Qt { | ||
| constructor(t, e, s) { | ||
@@ -842,10 +842,10 @@ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s; | ||
| } | ||
| const V = R.litHtmlPolyfillSupport; | ||
| V == null || V(k, I), (R.litHtmlVersions ?? (R.litHtmlVersions = [])).push("3.1.3"); | ||
| const Qt = (r, t, e) => { | ||
| const K = N.litHtmlPolyfillSupport; | ||
| K == null || K(k, M), (N.litHtmlVersions ?? (N.litHtmlVersions = [])).push("3.1.3"); | ||
| const Ft = (r, t, e) => { | ||
| const s = (e == null ? void 0 : e.renderBefore) ?? t; | ||
| let i = s._$litPart$; | ||
| if (i === void 0) { | ||
| const n = (e == null ? void 0 : e.renderBefore) ?? null; | ||
| s._$litPart$ = i = new I(t.insertBefore(U(), n), n, void 0, e ?? {}); | ||
| const o = (e == null ? void 0 : e.renderBefore) ?? null; | ||
| s._$litPart$ = i = new M(t.insertBefore(U(), o), o, void 0, e ?? {}); | ||
| } | ||
@@ -859,3 +859,3 @@ return i._$AI(r), i; | ||
| */ | ||
| class x extends S { | ||
| class E extends x { | ||
| constructor() { | ||
@@ -871,3 +871,3 @@ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0; | ||
| const e = this.render(); | ||
| this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Qt(e, this.renderRoot, this.renderOptions); | ||
| this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Ft(e, this.renderRoot, this.renderOptions); | ||
| } | ||
@@ -886,6 +886,6 @@ connectedCallback() { | ||
| } | ||
| var ht; | ||
| x._$litElement$ = !0, x.finalized = !0, (ht = globalThis.litElementHydrateSupport) == null || ht.call(globalThis, { LitElement: x }); | ||
| const K = globalThis.litElementPolyfillSupport; | ||
| K == null || K({ LitElement: x }); | ||
| var ct; | ||
| E._$litElement$ = !0, E.finalized = !0, (ct = globalThis.litElementHydrateSupport) == null || ct.call(globalThis, { LitElement: E }); | ||
| const Q = globalThis.litElementPolyfillSupport; | ||
| Q == null || Q({ LitElement: E }); | ||
| (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.5"); | ||
@@ -897,3 +897,3 @@ /** | ||
| */ | ||
| const $t = (r) => (t, e) => { | ||
| const X = (r) => (t, e) => { | ||
| e !== void 0 ? e.addInitializer(() => { | ||
@@ -908,19 +908,19 @@ customElements.define(r, t); | ||
| */ | ||
| const Jt = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: L }, Ft = (r = Jt, t, e) => { | ||
| const Jt = { attribute: !0, type: String, converter: B, reflect: !1, hasChanged: D }, Xt = (r = Jt, t, e) => { | ||
| const { kind: s, metadata: i } = e; | ||
| let n = globalThis.litPropertyMetadata.get(i); | ||
| if (n === void 0 && globalThis.litPropertyMetadata.set(i, n = /* @__PURE__ */ new Map()), n.set(e.name, r), s === "accessor") { | ||
| const { name: o } = e; | ||
| let o = globalThis.litPropertyMetadata.get(i); | ||
| if (o === void 0 && globalThis.litPropertyMetadata.set(i, o = /* @__PURE__ */ new Map()), o.set(e.name, r), s === "accessor") { | ||
| const { name: n } = e; | ||
| return { set(a) { | ||
| const h = t.get.call(this); | ||
| t.set.call(this, a), this.requestUpdate(o, h, r); | ||
| t.set.call(this, a), this.requestUpdate(n, h, r); | ||
| }, init(a) { | ||
| return a !== void 0 && this.P(o, void 0, r), a; | ||
| return a !== void 0 && this.P(n, void 0, r), a; | ||
| } }; | ||
| } | ||
| if (s === "setter") { | ||
| const { name: o } = e; | ||
| const { name: n } = e; | ||
| return function(a) { | ||
| const h = this[o]; | ||
| t.call(this, a), this.requestUpdate(o, h, r); | ||
| const h = this[n]; | ||
| t.call(this, a), this.requestUpdate(n, h, r); | ||
| }; | ||
@@ -930,16 +930,8 @@ } | ||
| }; | ||
| function f(r) { | ||
| return (t, e) => typeof e == "object" ? Ft(r, t, e) : ((s, i, n) => { | ||
| const o = i.hasOwnProperty(n); | ||
| return i.constructor.createProperty(n, o ? { ...s, wrapped: !0 } : s), o ? Object.getOwnPropertyDescriptor(i, n) : void 0; | ||
| function p(r) { | ||
| return (t, e) => typeof e == "object" ? Xt(r, t, e) : ((s, i, o) => { | ||
| const n = i.hasOwnProperty(o); | ||
| return i.constructor.createProperty(o, n ? { ...s, wrapped: !0 } : s), n ? Object.getOwnPropertyDescriptor(i, o) : void 0; | ||
| })(r, t, e); | ||
| } | ||
| function Xt(r) { | ||
| try { | ||
| const t = new URL(r ?? ""); | ||
| return `${t.origin}${t.pathname.split("/manifest")[0]}/iframe${t.search}`; | ||
| } catch { | ||
| return null; | ||
| } | ||
| } | ||
| class Zt extends Error { | ||
@@ -962,3 +954,3 @@ constructor(t, e) { | ||
| } | ||
| const gt = () => { | ||
| const bt = () => { | ||
| const r = navigator.userAgent; | ||
@@ -970,3 +962,3 @@ return /(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(r) || /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test( | ||
| async function Yt(r, { signal: t, logError: e }) { | ||
| const s = gt(), i = window.TS.token, n = window.TS.url || "https://api.topsort.com", o = await fetch(new URL(`${n}/v2/auctions`), { | ||
| const s = bt(), i = window.TS.token, o = window.TS.url || "https://api.topsort.com", n = await fetch(new URL(`${o}/v2/auctions`), { | ||
| method: "POST", | ||
@@ -977,3 +969,3 @@ mode: "cors", | ||
| "Content-Type": "application/json", | ||
| "X-UA": `topsort/banners-0.5.1 (${s})` | ||
| "X-UA": `topsort/banners-0.5.2 (${s})` | ||
| }, | ||
@@ -985,9 +977,9 @@ body: JSON.stringify({ | ||
| }); | ||
| if (!o.ok) { | ||
| const c = await o.json(); | ||
| if (!n.ok) { | ||
| const c = await n.json(); | ||
| throw e(c), new Error(c.message); | ||
| } | ||
| const h = (await o.json()).results[0]; | ||
| const h = (await n.json()).results[0]; | ||
| if (!h) | ||
| throw new Zt("No auction results", o.status); | ||
| throw new Zt("No auction results", n.status); | ||
| if (h.error) | ||
@@ -997,5 +989,5 @@ throw e(h.error), new Error(h.error); | ||
| } | ||
| var te = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, b = (r, t, e, s) => { | ||
| for (var i = s > 1 ? void 0 : s ? ee(t, e) : t, n = r.length - 1, o; n >= 0; n--) | ||
| (o = r[n]) && (i = (s ? o(t, e, i) : o(i)) || i); | ||
| var te = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, y = (r, t, e, s) => { | ||
| for (var i = s > 1 ? void 0 : s ? ee(t, e) : t, o = r.length - 1, n; o >= 0; o--) | ||
| (n = r[o]) && (i = (s ? n(t, e, i) : n(i)) || i); | ||
| return s && i && te(t, e, i), i; | ||
@@ -1009,3 +1001,3 @@ }; | ||
| buildAuction(s) { | ||
| const i = gt(), n = { | ||
| const i = bt(), o = { | ||
| type: "banners", | ||
@@ -1016,11 +1008,11 @@ slots: s, | ||
| }; | ||
| return this.categoryId ? n.category = { | ||
| return this.categoryId ? o.category = { | ||
| id: this.categoryId | ||
| } : this.categoryIds ? n.category = { | ||
| ids: this.categoryIds.split(",").map((o) => o.trim()) | ||
| } : this.categoryDisjunctions ? n.category = { | ||
| disjunctions: [this.categoryDisjunctions.split(",").map((o) => o.trim())] | ||
| } : this.searchQuery && (n.searchQuery = this.searchQuery), this.location && (n.geoTargeting = { | ||
| } : this.categoryIds ? o.category = { | ||
| ids: this.categoryIds.split(",").map((n) => n.trim()) | ||
| } : this.categoryDisjunctions ? o.category = { | ||
| disjunctions: [this.categoryDisjunctions.split(",").map((n) => n.trim())] | ||
| } : this.searchQuery && (o.searchQuery = this.searchQuery), this.location && (o.geoTargeting = { | ||
| location: this.location | ||
| }), n; | ||
| }), o; | ||
| } | ||
@@ -1036,68 +1028,68 @@ emitEvent(s) { | ||
| } | ||
| return b([ | ||
| f({ type: Number }) | ||
| ], t.prototype, "width", 2), b([ | ||
| f({ type: Number }) | ||
| ], t.prototype, "height", 2), b([ | ||
| f({ attribute: "id", type: String }) | ||
| ], t.prototype, "slotId", 2), b([ | ||
| f({ attribute: "category-id", type: String }) | ||
| ], t.prototype, "categoryId", 2), b([ | ||
| f({ attribute: "category-ids", type: String }) | ||
| ], t.prototype, "categoryIds", 2), b([ | ||
| f({ attribute: "category-disjunctions", type: String }) | ||
| ], t.prototype, "categoryDisjunctions", 2), b([ | ||
| f({ attribute: "search-query", type: String }) | ||
| ], t.prototype, "searchQuery", 2), b([ | ||
| f({ attribute: "location", type: String }) | ||
| ], t.prototype, "location", 2), b([ | ||
| f({ attribute: "new-tab", type: Boolean }) | ||
| return y([ | ||
| p({ type: Number }) | ||
| ], t.prototype, "width", 2), y([ | ||
| p({ type: Number }) | ||
| ], t.prototype, "height", 2), y([ | ||
| p({ attribute: "id", type: String }) | ||
| ], t.prototype, "slotId", 2), y([ | ||
| p({ attribute: "category-id", type: String }) | ||
| ], t.prototype, "categoryId", 2), y([ | ||
| p({ attribute: "category-ids", type: String }) | ||
| ], t.prototype, "categoryIds", 2), y([ | ||
| p({ attribute: "category-disjunctions", type: String }) | ||
| ], t.prototype, "categoryDisjunctions", 2), y([ | ||
| p({ attribute: "search-query", type: String }) | ||
| ], t.prototype, "searchQuery", 2), y([ | ||
| p({ attribute: "location", type: String }) | ||
| ], t.prototype, "location", 2), y([ | ||
| p({ attribute: "new-tab", type: Boolean }) | ||
| ], t.prototype, "newTab", 2), t; | ||
| }; | ||
| var ie = Object.defineProperty, re = Object.getOwnPropertyDescriptor, E = (r, t, e, s) => { | ||
| for (var i = s > 1 ? void 0 : s ? re(t, e) : t, n = r.length - 1, o; n >= 0; n--) | ||
| (o = r[n]) && (i = (s ? o(t, e, i) : o(i)) || i); | ||
| var ie = Object.defineProperty, re = Object.getOwnPropertyDescriptor, b = (r, t, e, s) => { | ||
| for (var i = s > 1 ? void 0 : s ? re(t, e) : t, o = r.length - 1, n; o >= 0; o--) | ||
| (n = r[o]) && (i = (s ? n(t, e, i) : n(i)) || i); | ||
| return s && i && ie(t, e, i), i; | ||
| }; | ||
| window.TS_BANNERS = window.TS_BANNERS || {}; | ||
| function oe(r) { | ||
| } | ||
| function ne(r) { | ||
| } | ||
| function oe(r) { | ||
| return window.TS_BANNERS.getLink ? window.TS_BANNERS.getLink(r) : r.type === "url" ? r.id : `${r.type}/${r.id}`; | ||
| } | ||
| function bt() { | ||
| function yt() { | ||
| if (window.TS_BANNERS.getLoadingElement) { | ||
| const r = window.TS_BANNERS.getLoadingElement(); | ||
| return p`${r}`; | ||
| return f`${r}`; | ||
| } | ||
| return p``; | ||
| return f``; | ||
| } | ||
| function Q(r) { | ||
| function F(r) { | ||
| if (window.TS_BANNERS.getErrorElement) { | ||
| const t = window.TS_BANNERS.getErrorElement(r); | ||
| return p`${t}`; | ||
| return f`${t}`; | ||
| } | ||
| return p``; | ||
| return f``; | ||
| } | ||
| function yt() { | ||
| function _t() { | ||
| if (window.TS_BANNERS.getNoWinnersElement) { | ||
| const r = window.TS_BANNERS.getNoWinnersElement(); | ||
| return p`${r}`; | ||
| return f`${r}`; | ||
| } | ||
| return p``; | ||
| return f``; | ||
| } | ||
| function _t(r, t, e, s) { | ||
| var c, u; | ||
| function mt(r, t, e, s) { | ||
| var c, d; | ||
| if (window.TS_BANNERS.getBannerElement) { | ||
| const l = window.TS_BANNERS.getBannerElement(r); | ||
| return p`${l}`; | ||
| return f`${l}`; | ||
| } | ||
| if (!((u = (c = r.asset) == null ? void 0 : c[0]) != null && u.url)) | ||
| return p``; | ||
| const i = r.asset[0].url, o = (() => { | ||
| if (!((d = (c = r.asset) == null ? void 0 : c[0]) != null && d.url)) | ||
| return f``; | ||
| const i = r.asset[0].url, n = (() => { | ||
| try { | ||
| const $ = new URL(i).pathname.split("/"), g = $.indexOf("manifest"); | ||
| if (g >= 0) { | ||
| const y = $[g + 1]; | ||
| return (y == null ? void 0 : y.startsWith("video")) ?? !1; | ||
| const _ = $[g + 1]; | ||
| return (_ == null ? void 0 : _.startsWith("video")) ?? !1; | ||
| } | ||
@@ -1108,12 +1100,9 @@ return !1; | ||
| } | ||
| })() ? p` | ||
| <iframe | ||
| src="${Xt(i)}" | ||
| autoplay | ||
| muted | ||
| loop | ||
| playsinline | ||
| style="width:${t}px; height:${e}px; object-fit:cover;" | ||
| ></iframe> | ||
| ` : p` | ||
| })() ? f` | ||
| <hls-video | ||
| src="${i}" | ||
| width="${t}px" | ||
| height="${e}px" | ||
| ></hls-video> | ||
| ` : f` | ||
| <img | ||
@@ -1124,4 +1113,4 @@ src="${i}" | ||
| /> | ||
| `, a = oe(r), h = s ? p`<a href="${a}" target="_blank">${o}</a>` : p`<a href="${a}">${o}</a>`; | ||
| return p` | ||
| `, a = ne(r), h = s ? f`<a href="${a}" target="_blank">${n}</a>` : f`<a href="${a}">${n}</a>`; | ||
| return f` | ||
| <div | ||
@@ -1136,10 +1125,10 @@ data-ts-clickable | ||
| } | ||
| const mt = Symbol("banner-context"), he = (r, t) => { | ||
| const vt = Symbol("banner-context"), he = (r, t) => { | ||
| var e, s; | ||
| return !t && r ? !0 : r == null || t == null ? !1 : r.width !== t.width || r.height !== t.height || r.newTab !== t.newTab || !!r.error != !!t.error || ((e = r.banners) == null ? void 0 : e.length) !== ((s = t.banners) == null ? void 0 : s.length); | ||
| }; | ||
| let j = class extends se(x) { | ||
| let I = class extends se(E) { | ||
| constructor() { | ||
| super(...arguments), this.task = new It(this, { | ||
| task: ([r], t) => Yt(this.buildAuction(r), { ...t, logError: ne }).then((e) => (t.signal.throwIfAborted(), this.isContext && (this.context = { ...this.context, banners: e }), e)).catch((e) => { | ||
| super(...arguments), this.task = new Mt(this, { | ||
| task: ([r], t) => Yt(this.buildAuction(r), { ...t, logError: oe }).then((e) => (t.signal.throwIfAborted(), this.isContext && (this.context = { ...this.context, banners: e }), e)).catch((e) => { | ||
| throw t.signal.throwIfAborted(), this.isContext && (this.context = { ...this.context, error: e }), e; | ||
@@ -1158,6 +1147,6 @@ }), | ||
| render() { | ||
| return !window.TS.token || !this.slotId ? Q(new Gt(window.TS.token, this.slotId)) : this.isContext ? p`` : this.task.render({ | ||
| pending: () => bt(), | ||
| complete: (r) => (this.emitEvent(r.length ? "ready" : "nowinners"), r.length ? _t(r[0], this.height, this.width, this.newTab) : yt()), | ||
| error: (r) => Q(r) | ||
| return !window.TS.token || !this.slotId ? F(new Gt(window.TS.token, this.slotId)) : this.isContext ? f`` : this.task.render({ | ||
| pending: () => yt(), | ||
| complete: (r) => (this.emitEvent(r.length ? "ready" : "nowinners"), r.length ? mt(r[0], this.width, this.height, this.newTab) : _t()), | ||
| error: (r) => F(r) | ||
| }); | ||
@@ -1181,16 +1170,16 @@ } | ||
| }; | ||
| E([ | ||
| wt({ context: mt }), | ||
| f({ attribute: !1, hasChanged: he }) | ||
| ], j.prototype, "context", 2); | ||
| E([ | ||
| f({ type: Boolean, attribute: "context" }) | ||
| ], j.prototype, "isContext", 2); | ||
| E([ | ||
| f({ attribute: !1, state: !0 }) | ||
| ], j.prototype, "slots", 2); | ||
| j = E([ | ||
| $t("topsort-banner") | ||
| ], j); | ||
| let q = class extends x { | ||
| b([ | ||
| Et({ context: vt }), | ||
| p({ attribute: !1, hasChanged: he }) | ||
| ], I.prototype, "context", 2); | ||
| b([ | ||
| p({ type: Boolean, attribute: "context" }) | ||
| ], I.prototype, "isContext", 2); | ||
| b([ | ||
| p({ attribute: !1, state: !0 }) | ||
| ], I.prototype, "slots", 2); | ||
| I = b([ | ||
| X("topsort-banner") | ||
| ], I); | ||
| let L = class extends E { | ||
| constructor() { | ||
@@ -1200,3 +1189,3 @@ super(...arguments), this.rank = 0; | ||
| render() { | ||
| return this.context ? this.context.banners ? this.context.error ? Q(this.context.error) : !this.context.banners.length || this.context.banners.length < this.rank ? yt() : _t( | ||
| return this.context ? this.context.banners ? this.context.error ? F(this.context.error) : !this.context.banners.length || this.context.banners.length < this.rank ? _t() : mt( | ||
| this.context.banners[this.rank - 1], | ||
@@ -1206,3 +1195,3 @@ this.context.width, | ||
| this.context.newTab | ||
| ) : bt() : p``; | ||
| ) : yt() : f``; | ||
| } | ||
@@ -1214,16 +1203,67 @@ // avoid shadow dom since we cannot attach to events via analytics.js | ||
| }; | ||
| E([ | ||
| Et({ context: mt, subscribe: !0 }), | ||
| f({ attribute: !1 }) | ||
| ], q.prototype, "context", 2); | ||
| E([ | ||
| f({ attribute: "rank", type: Number }) | ||
| ], q.prototype, "rank", 2); | ||
| q = E([ | ||
| $t("topsort-banner-slot") | ||
| ], q); | ||
| b([ | ||
| St({ context: vt, subscribe: !0 }), | ||
| p({ attribute: !1 }) | ||
| ], L.prototype, "context", 2); | ||
| b([ | ||
| p({ attribute: "rank", type: Number }) | ||
| ], L.prototype, "rank", 2); | ||
| L = b([ | ||
| X("topsort-banner-slot") | ||
| ], L); | ||
| let H = class extends E { | ||
| constructor() { | ||
| super(...arguments), this.src = "", this.width = "800px", this.height = "400px"; | ||
| } | ||
| get videoId() { | ||
| try { | ||
| return new URL(this.src).pathname.split("/")[1]; | ||
| } catch { | ||
| return "hls-video"; | ||
| } | ||
| } | ||
| render() { | ||
| return f` | ||
| <video | ||
| id="${this.videoId}" | ||
| muted | ||
| autoplay | ||
| loop | ||
| playsinline | ||
| ></video> | ||
| `; | ||
| } | ||
| firstUpdated() { | ||
| const r = this.shadowRoot.getElementById(this.videoId); | ||
| if (!r) | ||
| return; | ||
| r.style.width = this.width, r.style.height = this.height, r.style.objectFit = "cover"; | ||
| const t = window.Hls; | ||
| if (!t) { | ||
| console.error("Hls.js not loaded"); | ||
| return; | ||
| } | ||
| const e = new t(); | ||
| e.loadSource(this.src), e.attachMedia(r), e.on(t.Events.MANIFEST_PARSED, () => { | ||
| r.play().catch((s) => console.warn("Autoplay failed:", s)); | ||
| }); | ||
| } | ||
| }; | ||
| b([ | ||
| p({ type: String }) | ||
| ], H.prototype, "src", 2); | ||
| b([ | ||
| p({ type: String }) | ||
| ], H.prototype, "width", 2); | ||
| b([ | ||
| p({ type: String }) | ||
| ], H.prototype, "height", 2); | ||
| H = b([ | ||
| X("hls-video") | ||
| ], H); | ||
| export { | ||
| j as TopsortBanner, | ||
| q as TopsortBannerSlot | ||
| H as HlsVideo, | ||
| I as TopsortBanner, | ||
| L as TopsortBannerSlot | ||
| }; | ||
| //# sourceMappingURL=banners.mjs.map |
+1
-1
| { | ||
| "$schema": "https://json.schemastore.org/package.json", | ||
| "name": "@topsort/banners", | ||
| "version": "0.5.1", | ||
| "version": "0.5.2", | ||
| "description": "A web component for displaying Topsort banner ads.", | ||
@@ -6,0 +6,0 @@ "type": "module", |
+1
-1
@@ -16,3 +16,3 @@  | ||
| type="module" | ||
| src="https://unpkg.com/@topsort/banners@0.5.1/dist/banners.mjs" | ||
| src="https://unpkg.com/@topsort/banners@0.5.2/dist/banners.mjs" | ||
| ></script> | ||
@@ -19,0 +19,0 @@ <script async type="module" src="https://unpkg.com/@topsort/analytics.js"></script> |
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
133505
1.9%1294
3.85%