@vindral/web-sdk 4.2.0 → 4.2.1-10-ga7cb21ca

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/BFS4Hwu8.js ADDED
@@ -0,0 +1,4362 @@
1
+ import { n as e, t } from "./BsfwXDui.js";
2
+ import { _ as n, a as r, c as i, d as a, f as o, g as s, h as c, i as ee, l, m as te, n as u, o as ne, p as re, r as ie, s as ae, t as oe, u as se, v as ce } from "./Dxs5czI4.js";
3
+ import { M as le } from "./C01DcfYu.js";
4
+ import { a as d, i as f, n as p, r as m, t as h } from "./B7hT-BKr.js";
5
+ import { n as ue, t as de } from "./DeYmk5AL.js";
6
+ import { t as fe } from "./FYiEDBC4.js";
7
+ import { _ as pe, a as me, c as he, d as ge, f as _e, g, h as _, i as v, l as ve, m as ye, n as y, o as b, p as be, r as x, s as xe, t as Se, u as Ce, v as we, y as Te } from "./CrDL5rng.js";
8
+ import { t as Ee } from "./BdFcdkj1.js";
9
+ //#region ../../libs/utils/src/mediaMetadata.ts
10
+ var De = ({ title: e, subTitle: t = "Live stream", poster: n }) => {
11
+ document.title = e, "mediaSession" in navigator && (navigator.mediaSession.metadata = new MediaMetadata({
12
+ title: e,
13
+ artist: t,
14
+ artwork: n ? [{ src: n }] : []
15
+ }));
16
+ }, Oe = (e) => e === "mse" || e === "webcodecs" || e === "wasm";
17
+ function ke(e) {
18
+ if (e === null || e === "auto") return;
19
+ let t = e.split(",").filter(Oe);
20
+ return t.length > 0 ? t : void 0;
21
+ }
22
+ function Ae(e) {
23
+ if (e === "no-preference" || e === "prefer-hardware" || e === "prefer-software") return e;
24
+ }
25
+ //#endregion
26
+ //#region ../../libs/player-next/src/components/VindralMenuButton.ts
27
+ var je = document.createElement("template");
28
+ je.innerHTML = "\n <style>\n :host {\n position: relative;\n }\n\n :host([hidden]) {\n display: none;\n }\n </style>\n";
29
+ var Me = /* @__PURE__ */ new WeakMap(), Ne = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), Pe = /* @__PURE__ */ new WeakMap(), Fe = /* @__PURE__ */ new WeakMap(), Ie = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakSet(), Re = class extends x {
30
+ constructor() {
31
+ var e;
32
+ super(), h(this, Le), d(this, Me, void 0), d(this, Ne, void 0), d(this, S, void 0), d(this, Pe, null), d(this, Fe, (e) => {
33
+ e.composedPath().includes(this) || this.hide();
34
+ }), d(this, Ie, () => {
35
+ this.hide();
36
+ }), (e = this.shadowRoot) == null || e.appendChild(je.content.cloneNode(!0));
37
+ }
38
+ connectedCallback() {
39
+ var e, t, n, r;
40
+ super.connectedCallback(), this.setAttribute("role", "button"), this.setAttribute("aria-haspopup", "listbox");
41
+ let i = (e = this.getAttribute("list-position")) == null ? "top" : e;
42
+ (t = p(Ne, this)) == null || t.setAttribute("list-position", i);
43
+ let a = this.getRootNode(), o = [...(n = (r = this.shadowRoot) == null ? void 0 : r.querySelectorAll(":not(:defined)")) == null ? [] : n].map((e) => customElements.whenDefined(e.localName));
44
+ Promise.all(o).then(() => {
45
+ if (a instanceof Document || a instanceof ShadowRoot) {
46
+ var e;
47
+ m(Pe, this, a.querySelector("vindral-controller")), (e = p(Pe, this)) == null || e.connectListener(this);
48
+ }
49
+ });
50
+ }
51
+ set button(e) {
52
+ m(Me, this, e);
53
+ }
54
+ set listbox(e) {
55
+ m(Ne, this, e);
56
+ }
57
+ set listboxSlot(e) {
58
+ m(S, this, e);
59
+ }
60
+ enable() {
61
+ super.enable(), this.addEventListener("change", p(Ie, this)), document.addEventListener("click", p(Fe, this));
62
+ }
63
+ hide() {
64
+ var e, t;
65
+ !p(S, this) || (e = p(S, this)) != null && e.hidden || (p(S, this).hidden = !0, (t = p(Me, this)) == null || t.setAttribute("aria-expanded", "false"), this.dispatchEvent(new CustomEvent(_.UNLOCK_UI, {
66
+ bubbles: !0,
67
+ composed: !0
68
+ })), this.focus());
69
+ }
70
+ handleClick(e) {
71
+ p(S, this) && !e.composedPath().includes(p(S, this)) && f(Le, this, ze).call(this);
72
+ }
73
+ };
74
+ function ze() {
75
+ var e;
76
+ (e = p(S, this)) != null && e.hidden ? f(Le, this, Be).call(this) : this.hide();
77
+ }
78
+ function Be() {
79
+ var e, t, n;
80
+ (e = p(S, this)) != null && e.hidden && (p(S, this).hidden = !1, (t = p(Me, this)) == null || t.setAttribute("aria-expanded", "true"), (n = p(Ne, this)) == null || n.focus(), this.dispatchEvent(new CustomEvent(_.LOCK_UI, {
81
+ bubbles: !0,
82
+ composed: !0
83
+ })));
84
+ }
85
+ //#endregion
86
+ //#region ../../libs/player-next/src/components/AdvancedRenditionMenu.ts
87
+ var Ve, He = "\n<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon icon-tabler icon-tabler-settings-filled\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"#2c3e50\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <path d=\"M14.647 4.081a.724 .724 0 0 0 1.08 .448c2.439 -1.485 5.23 1.305 3.745 3.744a.724 .724 0 0 0 .447 1.08c2.775 .673 2.775 4.62 0 5.294a.724 .724 0 0 0 -.448 1.08c1.485 2.439 -1.305 5.23 -3.744 3.745a.724 .724 0 0 0 -1.08 .447c-.673 2.775 -4.62 2.775 -5.294 0a.724 .724 0 0 0 -1.08 -.448c-2.439 1.485 -5.23 -1.305 -3.745 -3.744a.724 .724 0 0 0 -.447 -1.08c-2.775 -.673 -2.775 -4.62 0 -5.294a.724 .724 0 0 0 .448 -1.08c-1.485 -2.439 1.305 -5.23 3.744 -3.745a.722 .722 0 0 0 1.08 -.447c.673 -2.775 4.62 -2.775 5.294 0zm-2.647 4.919a3 3 0 1 0 0 6a3 3 0 0 0 0 -6z\" stroke-width=\"0\" fill=\"currentColor\" />\n</svg>\n", Ue = document.createElement("template");
88
+ Ue.innerHTML = `
89
+ <style>
90
+ :host {
91
+ display: var(--rendition-menu-display);
92
+ }
93
+ </style>
94
+
95
+ <slot name="button">${He}</slot>
96
+ <slot name="listbox" hidden>
97
+ <vindral-advanced-rendition-menu-list id="listbox" part="listbox"></vindral-advanced-rendition-menu-list>
98
+ </slot>
99
+ `;
100
+ var We = /* @__PURE__ */ new WeakSet(), Ge = class extends Re {
101
+ constructor() {
102
+ var e, t, n, r;
103
+ super(), h(this, We), (e = this.shadowRoot) == null || e.appendChild(Ue.content.cloneNode(!0)), this.button = (t = this.shadowRoot) == null ? void 0 : t.querySelector("slot[name=button]"), this.listbox = (n = this.shadowRoot) == null ? void 0 : n.querySelector("[part=listbox]"), this.listboxSlot = (r = this.shadowRoot) == null ? void 0 : r.querySelector("slot[name=listbox]");
104
+ }
105
+ connectedCallback() {
106
+ super.connectedCallback(), f(We, this, Ke).call(this), this.setAttribute("aria-label", "Advanced rendition controls");
107
+ }
108
+ attributeChangedCallback(e, t, n) {
109
+ super.attributeChangedCallback(e, t, n), e === g.RENDITION_LEVELS && f(We, this, Ke).call(this);
110
+ }
111
+ };
112
+ Ve = Ge;
113
+ function Ke() {
114
+ let e = this.getAttribute(g.RENDITION_LEVELS);
115
+ !e || e === "[]" ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
116
+ }
117
+ e(Ge, "observedAttributes", [...y(Ve, "observedAttributes", Ve), g.RENDITION_LEVELS]);
118
+ //#endregion
119
+ //#region ../../libs/player-next/src/components/AdvancedRenditionMenuList.ts
120
+ var qe = document.createElement("template");
121
+ qe.innerHTML = "\n <style>\n :host {\n font: inherit;\n cursor: default;\n padding: var(--padding-2) !important;\n padding-top: var(--padding-3) !important;\n border-radius: 0.25em;\n position: absolute;\n min-width: 220px !important;\n background: var(--bg-subtle);\n z-index: 1;\n overflow: auto;\n }\n\n :host([list-position=\"top\"]) {\n bottom: calc(100% + 0.5em);\n transform: translate(-50%);\n }\n\n :host([list-position=\"bottom\"]) {\n top: calc(100% + 0.5em);\n }\n\n :host::-webkit-scrollbar {\n width: 5px;\n padding-right: 5px;\n }\n\n :host::-webkit-scrollbar-thumb {\n background-color: var(--fg-extra-subtle);\n border-radius: 10px;\n border: 0;\n }\n\n :host::-webkit-scrollbar-track {\n border-radius: 10px;\n background-color: transparent;\n }\n\n .mode-toggle {\n display: flex;\n gap: var(--padding-1);\n margin-bottom: var(--padding-2);\n }\n\n .mode-btn {\n flex: 1;\n padding: var(--padding-1) var(--padding-2);\n border: none;\n border-radius: 4px;\n font-size: 11px;\n font-weight: 500;\n cursor: pointer;\n background: var(--bg-component);\n color: var(--fg-default);\n transition: background 0.15s;\n }\n\n .mode-btn:hover {\n background: var(--bg-component-hover);\n }\n\n .mode-btn[data-active=\"true\"] {\n background: var(--accent);\n color: #ffffff;\n }\n\n .setting-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--padding-2);\n margin-bottom: var(--padding-2);\n padding: 0 var(--padding-1);\n }\n\n .setting-label {\n font-size: 10px;\n color: var(--fg-subtle);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n }\n\n .setting-toggle-btn {\n border: none;\n border-radius: 999px;\n background: var(--bg-component);\n color: var(--fg-default);\n font-size: 10px;\n font-weight: 600;\n min-width: 44px;\n padding: 4px 10px;\n cursor: pointer;\n transition: background 0.15s;\n }\n\n .setting-toggle-btn[data-active=\"true\"] {\n background: var(--accent);\n color: #ffffff;\n }\n\n .setting-toggle-btn:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n .quality-status-text {\n font-size: 10px;\n color: var(--fg-subtle);\n margin-bottom: var(--padding-2);\n padding: 0 var(--padding-1);\n font-style: italic;\n }\n\n .menu {\n display: grid;\n gap: var(--padding-1);\n }\n\n .menu-item {\n display: flex;\n align-items: center;\n gap: var(--padding-2);\n padding: var(--padding-2);\n border-radius: 4px;\n cursor: pointer;\n font-size: 13px;\n position: relative;\n }\n\n .menu-item:hover {\n background: var(--bg-component-hover);\n }\n\n .menu-item[data-selected=\"true\"] {\n background: var(--bg-component-active);\n border: 1px solid var(--fg-extra-subtle);\n }\n\n .menu-item[data-capped=\"true\"] {\n opacity: 0.5;\n }\n\n .menu-item:focus-visible {\n box-shadow: inset 0 0 0 2px var(--fg-strong);\n outline: 0;\n }\n\n .menu-item-info {\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n\n .menu-item-title {\n font-weight: 500;\n }\n\n .menu-item-subtitle {\n font-size: 10px;\n opacity: 0.6;\n }\n\n .current-label {\n font-size: 10px;\n font-weight: 600;\n text-transform: uppercase;\n color: var(--accent);\n margin-left: auto;\n display: none;\n }\n\n .menu-item[data-playing=\"true\"] .current-label {\n display: block;\n }\n </style>\n\n <slot>\n <div class=\"mode-toggle\">\n <button class=\"mode-btn\" data-mode=\"auto\">Auto (ABR)</button>\n <button class=\"mode-btn\" data-mode=\"fixed\">Fixed</button>\n </div>\n <div class=\"setting-row\">\n <span class=\"setting-label\">Size cap</span>\n <button id=\"size-cap-toggle\" class=\"setting-toggle-btn\" type=\"button\"></button>\n </div>\n <div class=\"quality-status-text\" id=\"quality-status-text\"></div>\n <div class=\"menu\" role=\"menu\" aria-label=\"Quality options\"></div>\n </slot>\n";
122
+ var Je = /* @__PURE__ */ new WeakMap(), Ye = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), Xe = /* @__PURE__ */ new WeakMap(), Ze = /* @__PURE__ */ new WeakMap(), Qe = /* @__PURE__ */ new WeakMap(), $e = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), nt = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakSet(), rt = class extends HTMLElement {
123
+ constructor() {
124
+ super(), h(this, w), d(this, Je, []), d(this, Ye, 2 ** 53 - 1), d(this, C, !1), d(this, Xe, !0), d(this, Ze, null), d(this, Qe, null), d(this, $e, []), d(this, et, null), d(this, tt, null), d(this, nt, null), e(this, "handleEvent", (e) => {
125
+ switch (e.type) {
126
+ case "keydown":
127
+ f(w, this, ht).call(this, e);
128
+ break;
129
+ }
130
+ }), this.attachShadow({ mode: "open" }).appendChild(qe.content.cloneNode(!0));
131
+ }
132
+ connectedCallback() {
133
+ let e = this.getRootNode();
134
+ if (e instanceof ShadowRoot) {
135
+ var t;
136
+ m(et, this, e.host.closest("vindral-controller")), (t = p(et, this)) == null || t.connectListener(this), f(w, this, lt).call(this), f(w, this, it).call(this), f(w, this, at).call(this), f(w, this, ut).call(this), m(tt, this, e.host), this.addEventListener("keydown", this);
137
+ }
138
+ }
139
+ disconnectedCallback() {
140
+ var e, t;
141
+ (e = p(et, this)) == null || e.disconnectListener(this), (t = p(nt, this)) == null || t.disconnect(), m(nt, this, null), this.removeEventListener("keydown", this);
142
+ }
143
+ attributeChangedCallback(e, t, n) {
144
+ t !== n && (e === g.RENDITION_LEVELS && n && (this.list = JSON.parse(n)), e === g.MAX_VIDEO_BITRATE && (this.maxVideoBitrate = n ? parseInt(n, 10) : 2 ** 53 - 1), e === g.ABR_ENABLED && (m(C, this, b(n, !1)), f(w, this, st).call(this), f(w, this, ft).call(this)), e === g.RENDITION_LEVEL && n && (m(Ze, this, JSON.parse(n)), f(w, this, ft).call(this)), e === g.SIZE_BASED_RESOLUTION_CAP_ENABLED && (m(Xe, this, b(n, !0)), f(w, this, ct).call(this)));
145
+ }
146
+ set list(e) {
147
+ m(Je, this, e), f(w, this, ut).call(this);
148
+ }
149
+ set maxVideoBitrate(e) {
150
+ m(Ye, this, e), f(w, this, ft).call(this);
151
+ }
152
+ get keysUsed() {
153
+ return [
154
+ "Enter",
155
+ "Escape",
156
+ "Tab",
157
+ " ",
158
+ "ArrowDown",
159
+ "ArrowUp",
160
+ "Home",
161
+ "End"
162
+ ];
163
+ }
164
+ focus() {
165
+ var e;
166
+ (e = p(Qe, this)) == null || e.focus();
167
+ }
168
+ };
169
+ function it() {
170
+ var e, t;
171
+ let n = (e = this.shadowRoot) == null ? void 0 : e.querySelector("[data-mode=\"auto\"]"), r = (t = this.shadowRoot) == null ? void 0 : t.querySelector("[data-mode=\"fixed\"]");
172
+ n == null || n.addEventListener("click", () => {
173
+ m(C, this, !0), f(w, this, st).call(this), f(w, this, ft).call(this), this.dispatchEvent(new CustomEvent(_.SET_ABR_MODE, {
174
+ bubbles: !0,
175
+ composed: !0,
176
+ detail: !0
177
+ }));
178
+ }), r == null || r.addEventListener("click", () => {
179
+ let e = f(w, this, ot).call(this);
180
+ e && this.dispatchEvent(new CustomEvent(_.SET_RENDITION, {
181
+ bubbles: !0,
182
+ composed: !0,
183
+ detail: e
184
+ })), m(C, this, !1), f(w, this, st).call(this), f(w, this, ft).call(this), this.dispatchEvent(new CustomEvent(_.SET_ABR_MODE, {
185
+ bubbles: !0,
186
+ composed: !0,
187
+ detail: !1
188
+ }));
189
+ }), f(w, this, st).call(this);
190
+ }
191
+ function at() {
192
+ var e;
193
+ let t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("#size-cap-toggle");
194
+ t == null || t.addEventListener("click", () => {
195
+ let e = !p(Xe, this);
196
+ m(Xe, this, e), f(w, this, ct).call(this), this.dispatchEvent(new CustomEvent(_.SET_SIZE_BASED_RESOLUTION_CAP_MODE, {
197
+ bubbles: !0,
198
+ composed: !0,
199
+ detail: e
200
+ }));
201
+ }), f(w, this, ct).call(this);
202
+ }
203
+ function ot() {
204
+ let e = [...p(Je, this)].sort((e, t) => {
205
+ var n, r;
206
+ return (n = e.video) != null && n.bitRate && (r = t.video) != null && r.bitRate ? t.video.bitRate - e.video.bitRate : 0;
207
+ });
208
+ return e.find((e) => {
209
+ var t;
210
+ return ((t = e.video) == null ? void 0 : t.bitRate) && e.video.bitRate <= p(Ye, this);
211
+ }) || e[e.length - 1] || null;
212
+ }
213
+ function st() {
214
+ var e, t, n;
215
+ let r = (e = this.shadowRoot) == null ? void 0 : e.querySelector("[data-mode=\"auto\"]"), i = (t = this.shadowRoot) == null ? void 0 : t.querySelector("[data-mode=\"fixed\"]"), a = (n = this.shadowRoot) == null ? void 0 : n.querySelector("#quality-status-text");
216
+ r && i && (r.setAttribute("data-active", String(p(C, this))), i.setAttribute("data-active", String(!p(C, this)))), a && (a.textContent = p(C, this) ? "Select maximum allowed quality" : "Select specific quality (may cause buffering)"), f(w, this, ct).call(this);
217
+ }
218
+ function ct() {
219
+ var e;
220
+ let t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("#size-cap-toggle");
221
+ t && (t.textContent = p(Xe, this) ? "On" : "Off", t.setAttribute("aria-pressed", String(p(Xe, this))), t.setAttribute("data-active", String(p(Xe, this))), t.disabled = !p(C, this), t.title = p(C, this) ? "Toggle size-based resolution cap" : "Only available in Auto (ABR) mode");
222
+ }
223
+ function lt() {
224
+ var e;
225
+ (e = p(nt, this)) == null || e.disconnect(), m(nt, this, new IntersectionObserver((e) => {
226
+ e.forEach((e) => {
227
+ if (e.intersectionRatio === 1) {
228
+ this.style.height = "auto";
229
+ return;
230
+ } else if (e.intersectionRatio > 0) {
231
+ let t = e.intersectionRect.height, n = Math.max(0, t - 24);
232
+ this.style.height = `${n}px`;
233
+ } else this.style.height = "auto";
234
+ });
235
+ }, {
236
+ root: p(et, this),
237
+ threshold: 0
238
+ })), p(nt, this).observe(this);
239
+ }
240
+ function ut() {
241
+ var e;
242
+ let t = (e = this.shadowRoot) == null ? void 0 : e.querySelector(".menu");
243
+ t && (m($e, this, []), t.innerHTML = "", p(Je, this).sort((e, t) => {
244
+ var n, r;
245
+ return (n = e.video) != null && n.bitRate && (r = t.video) != null && r.bitRate ? t.video.bitRate - e.video.bitRate : 0;
246
+ }).forEach((e) => {
247
+ var n, r, i, a, o, s, c, ee, l, te;
248
+ let u = document.createElement("div");
249
+ u.setAttribute("role", "menuitem"), u.setAttribute("value", String((n = e.video) == null ? void 0 : n.height)), u.classList.add("menu-item"), u.tabIndex = -1;
250
+ let ne = document.createElement("div");
251
+ ne.className = "menu-item-info";
252
+ let re = document.createElement("span");
253
+ re.className = "menu-item-title", re.textContent = e.video ? Te(e.video) : "";
254
+ let ie = document.createElement("span");
255
+ ie.classList.add("menu-item-subtitle");
256
+ let ae = f(w, this, dt).call(this, (r = e.video) == null ? void 0 : r.frameRate);
257
+ ie.textContent = `${we(((i = (a = e.video) == null ? void 0 : a.bitRate) == null ? 0 : i) + ((o = (s = e.audio) == null ? void 0 : s.bitRate) == null ? 0 : o))}, ${ae}fps`, ne.appendChild(re), ne.appendChild(ie), u.appendChild(ne);
258
+ let oe = document.createElement("span");
259
+ oe.className = "current-label", oe.textContent = "Current", u.appendChild(oe), u.addEventListener("click", () => f(w, this, mt).call(this, e)), p($e, this).push({
260
+ el: u,
261
+ id: (c = (ee = e.video) == null ? void 0 : ee.id) == null ? -1 : c,
262
+ bitrate: (l = (te = e.video) == null ? void 0 : te.bitRate) == null ? 0 : l
263
+ }), t.appendChild(u);
264
+ }), f(w, this, ft).call(this));
265
+ }
266
+ function dt(e) {
267
+ return e ? e[0] % e[1] === 0 ? (e[0] / e[1]).toString() : (e[0] / e[1]).toFixed(2) : "";
268
+ }
269
+ function ft() {
270
+ var e;
271
+ let t = (e = p(Ze, this)) == null || (e = e.video) == null ? void 0 : e.id, n = f(w, this, pt).call(this), r = n == null ? void 0 : n.id;
272
+ m(Qe, this, null), p($e, this).forEach((e) => {
273
+ let n = e.id, i = e.bitrate;
274
+ e.el.setAttribute("data-playing", String(n === t));
275
+ let a = n === r;
276
+ if (e.el.setAttribute("data-selected", String(a)), a ? (e.el.setAttribute("aria-selected", "true"), e.el.tabIndex = 0, m(Qe, this, e.el)) : (e.el.removeAttribute("aria-selected"), e.el.tabIndex = -1), p(C, this)) {
277
+ let t = i > p(Ye, this);
278
+ e.el.setAttribute("data-capped", String(t));
279
+ } else e.el.removeAttribute("data-capped");
280
+ });
281
+ }
282
+ function pt() {
283
+ let e = [...p($e, this)].sort((e, t) => t.bitrate - e.bitrate);
284
+ return e.find((e) => e.bitrate <= p(Ye, this)) || e[e.length - 1];
285
+ }
286
+ function mt(e) {
287
+ this.dispatchEvent(new Event("change", {
288
+ bubbles: !0,
289
+ composed: !0
290
+ })), this.dispatchEvent(new CustomEvent(_.SET_RENDITION, {
291
+ bubbles: !0,
292
+ composed: !0,
293
+ detail: e
294
+ }));
295
+ }
296
+ function ht(e) {
297
+ let { key: t, ctrlKey: n, altKey: r, metaKey: i } = e;
298
+ if (!(n || r || i) && this.keysUsed.includes(t)) if (e.preventDefault(), e.stopPropagation(), t === "Tab" || t === "Escape") {
299
+ var a;
300
+ (a = p(tt, this)) == null || a.hide();
301
+ } else if (t === "Enter" || t === " ") {
302
+ var o;
303
+ (o = f(w, this, _t).call(this)) == null || (o = o.el) == null || o.click();
304
+ } else f(w, this, gt).call(this, e);
305
+ }
306
+ function gt(e) {
307
+ var t;
308
+ let { key: n } = e, r = p($e, this), i = (t = f(w, this, _t).call(this)) == null ? r[0] : t;
309
+ if (!i) return;
310
+ let a = r.indexOf(i), o = Math.max(0, a);
311
+ n === "ArrowDown" ? o++ : n === "ArrowUp" ? o-- : e.key === "Home" ? o = 0 : e.key === "End" && (o = r.length - 1), o < 0 && (o = r.length - 1), o > r.length - 1 && (o = 0);
312
+ let s = r[o];
313
+ s && (f(w, this, vt).call(this, s.id), s.el.focus());
314
+ }
315
+ function _t() {
316
+ return p($e, this).find((e) => e.el.tabIndex === 0);
317
+ }
318
+ function vt(e) {
319
+ for (let t of p($e, this)) t.el.tabIndex = t.id === e ? 0 : -1;
320
+ }
321
+ e(rt, "observedAttributes", [
322
+ g.RENDITION_LEVELS,
323
+ g.MAX_VIDEO_BITRATE,
324
+ g.ABR_ENABLED,
325
+ g.RENDITION_LEVEL,
326
+ g.SIZE_BASED_RESOLUTION_CAP_ENABLED
327
+ ]);
328
+ //#endregion
329
+ //#region ../../libs/player-next/src/components/AirPlayButton.ts
330
+ var yt, bt = document.createElement("template"), xt = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" ><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M18 18a3 3 0 0 0 3 -3v-8a3 3 0 0 0 -3 -3h-12a3 3 0 0 0 -3 3v8a3 3 0 0 0 3 3\" /><path d=\"M9 20h6l-3 -5z\" /></svg>\n";
331
+ bt.innerHTML = `
332
+ <style>
333
+ :host {
334
+ display: var(--airplay-button-display);
335
+ }
336
+
337
+ :host(:not([${g.AIRPLAY_AVAILABLE}])) {
338
+ display: none !important;
339
+ }
340
+
341
+ :host([${g.IS_AIRPLAYING}]) slot[name="exit"] {
342
+ display: none !important;
343
+ }
344
+
345
+ :host(:not([${g.IS_AIRPLAYING}])) slot[name="enter"] {
346
+ display: none !important;
347
+ }
348
+ </style>
349
+
350
+ <slot name="icon">
351
+ <slot name="enter">${xt}</slot>
352
+ <slot name="exit">${xt}</slot>
353
+ </slot>
354
+ `;
355
+ var St = /* @__PURE__ */ new WeakSet(), Ct = class extends x {
356
+ constructor() {
357
+ var e;
358
+ super(), h(this, St), (e = this.shadowRoot) == null || e.appendChild(bt.content.cloneNode(!0));
359
+ }
360
+ connectedCallback() {
361
+ super.connectedCallback(), f(St, this, wt).call(this);
362
+ }
363
+ disconnectedCallback() {
364
+ super.disconnectedCallback();
365
+ }
366
+ attributeChangedCallback(e, t, n) {
367
+ super.attributeChangedCallback(e, t, n), e === g.IS_AIRPLAYING && f(St, this, wt).call(this);
368
+ }
369
+ set isAirPlaying(e) {
370
+ e ? this.setAttribute(g.IS_AIRPLAYING, "") : this.removeAttribute(g.IS_AIRPLAYING);
371
+ }
372
+ get isAirPlaying() {
373
+ return this.hasAttribute(g.IS_AIRPLAYING);
374
+ }
375
+ handleClick(e) {
376
+ this.dispatchEvent(new CustomEvent(_.REQUEST_AIRPLAY, {
377
+ bubbles: !0,
378
+ composed: !0
379
+ }));
380
+ }
381
+ };
382
+ yt = Ct;
383
+ function wt() {
384
+ this.setAttribute("aria-label", this.isAirPlaying ? "Exit airplay" : "Enter airplay");
385
+ }
386
+ e(Ct, "observedAttributes", [
387
+ ...y(yt, "observedAttributes", yt),
388
+ g.AIRPLAY_AVAILABLE,
389
+ g.IS_AIRPLAYING
390
+ ]);
391
+ //#endregion
392
+ //#region ../../libs/player-next/src/components/BufferingIcon.ts
393
+ var Tt = document.createElement("template");
394
+ Tt.innerHTML = `
395
+ <style>
396
+ :host {
397
+ color: var(--fg-strong);
398
+ }
399
+
400
+ slot > svg {
401
+ display: block;
402
+ }
403
+
404
+ :host(:not([${g.BUFFERING}])) {
405
+ visibility: hidden !important;
406
+ }
407
+ </style>
408
+
409
+ <slot name="icon">
410
+ <svg width="24" height="24" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
411
+ <style>
412
+ .spinner-container {
413
+ transform-origin: center;
414
+ animation: rotate 2s linear infinite;
415
+ }
416
+ .spinner-circle {
417
+ stroke-linecap: round;
418
+ animation: dash 1.5s ease-in-out infinite;
419
+ }
420
+ @keyframes rotate {
421
+ 100% {
422
+ transform: rotate(360deg);
423
+ }
424
+ }
425
+ @keyframes dash {
426
+ 0% {
427
+ stroke-dasharray: 0 150;
428
+ stroke-dashoffset: 0;
429
+ }
430
+ 47.5% {
431
+ stroke-dasharray: 42 150;
432
+ stroke-dashoffset: -16;
433
+ }
434
+ 95%, 100% {
435
+ stroke-dasharray: 42 150;
436
+ stroke-dashoffset: -59;
437
+ }
438
+ }
439
+ </style>
440
+ <g class="spinner-container">
441
+ <circle class="spinner-circle" cx="12" cy="12" r="9.5" fill="none" stroke-width="3"></circle>
442
+ </g>
443
+ </svg>
444
+ </slot>
445
+ `;
446
+ var Et = /* @__PURE__ */ new WeakMap(), Dt = class extends HTMLElement {
447
+ constructor() {
448
+ super(), d(this, Et, null), this.attachShadow({ mode: "open" }).appendChild(Tt.content.cloneNode(!0));
449
+ }
450
+ connectedCallback() {
451
+ var e;
452
+ m(Et, this, this.closest("vindral-controller")), (e = p(Et, this)) == null || e.connectListener(this);
453
+ }
454
+ disconnectedCallback() {
455
+ var e;
456
+ (e = p(Et, this)) == null || e.disconnectListener(this);
457
+ }
458
+ };
459
+ e(Dt, "observedAttributes", [g.BUFFERING]);
460
+ //#endregion
461
+ //#region ../../libs/player-next/src/components/BufferingOverlay.ts
462
+ var Ot = document.createElement("template");
463
+ Ot.innerHTML = `
464
+ <style>
465
+ :host {
466
+ display: var(--buffering-overlay-display);
467
+ align-items: center;
468
+ justify-content: center;
469
+ position: absolute;
470
+ top: 0;
471
+ bottom: 0;
472
+ left: 0;
473
+ right: 0;
474
+ background-color: rgba(0, 0, 0, 0.3);
475
+ transition: opacity 250ms;
476
+ transition-delay: 1s;
477
+ opacity: 1;
478
+ pointer-events: none;
479
+ z-index: 1;
480
+ }
481
+
482
+ #buffering-indicator {
483
+ width: 40px;
484
+ height: 40px;
485
+ border-radius: 40px;
486
+ background-color: var(--fg-strong);
487
+ animation: scaleout 1s infinite ease-in-out;
488
+ }
489
+
490
+ @-webkit-keyframes scaleout {
491
+ 0% {
492
+ -webkit-transform: scale(0);
493
+ }
494
+ 100% {
495
+ -webkit-transform: scale(1);
496
+ opacity: 0;
497
+ }
498
+ }
499
+
500
+ @keyframes scaleout {
501
+ 0% {
502
+ -webkit-transform: scale(0);
503
+ transform: scale(0);
504
+ }
505
+ 100% {
506
+ -webkit-transform: scale(1);
507
+ transform: scale(1);
508
+ opacity: 0;
509
+ }
510
+ }
511
+
512
+ :host(:not([${g.BUFFERING}])) {
513
+ transition-delay: 0s;
514
+ opacity: 0 !important;
515
+ }
516
+ </style>
517
+
518
+ <div id="buffering-indicator"></div>
519
+ `;
520
+ var kt = /* @__PURE__ */ new WeakMap(), At = class extends HTMLElement {
521
+ constructor() {
522
+ super(), d(this, kt, null), this.attachShadow({ mode: "open" }).appendChild(Ot.content.cloneNode(!0));
523
+ }
524
+ connectedCallback() {
525
+ var e;
526
+ m(kt, this, this.closest("vindral-controller")), (e = p(kt, this)) == null || e.connectListener(this);
527
+ }
528
+ disconnectedCallback() {
529
+ var e;
530
+ (e = p(kt, this)) == null || e.disconnectListener(this);
531
+ }
532
+ };
533
+ e(At, "observedAttributes", [g.BUFFERING]);
534
+ //#endregion
535
+ //#region ../../libs/player-next/src/components/CastButton.ts
536
+ var jt, Mt = document.createElement("template");
537
+ Mt.innerHTML = `
538
+ <style>
539
+ :host {
540
+ display: var(--cast-button-display);
541
+ }
542
+
543
+ google-cast-launcher {
544
+ display: block;
545
+ width: var(--button-icon-size);
546
+ height: var(--button-icon-size);
547
+ cursor: pointer;
548
+ --connected-color: var(--fg-strong);
549
+ --disconnected-color: var(--fg-strong);
550
+ }
551
+
552
+ :host(:active) google-cast-launcher {
553
+ transform: scale(0.9);
554
+ }
555
+
556
+ :host(:not([${g.CAST_AVAILABLE}])) {
557
+ display: none !important;
558
+ }
559
+ </style>
560
+ `;
561
+ var Nt = /* @__PURE__ */ new WeakSet(), Pt = class extends x {
562
+ constructor() {
563
+ var e;
564
+ super(), h(this, Nt), (e = this.shadowRoot) == null || e.appendChild(Mt.content.cloneNode(!0));
565
+ }
566
+ connectedCallback() {
567
+ super.connectedCallback(), f(Nt, this, Ft).call(this);
568
+ }
569
+ disconnectedCallback() {
570
+ super.disconnectedCallback();
571
+ }
572
+ attributeChangedCallback(e, t, n) {
573
+ super.attributeChangedCallback(e, t, n), e === g.CAST_AVAILABLE && f(Nt, this, It).call(this), e === g.IS_CASTING && f(Nt, this, Ft).call(this);
574
+ }
575
+ set isCasting(e) {
576
+ e ? this.setAttribute(g.IS_CASTING, "") : this.removeAttribute(g.IS_CASTING);
577
+ }
578
+ get isCasting() {
579
+ return this.hasAttribute(g.IS_CASTING);
580
+ }
581
+ handleClick(e) {}
582
+ };
583
+ jt = Pt;
584
+ function Ft() {
585
+ this.setAttribute("aria-label", this.isCasting ? "Exit cast" : "Enter cast");
586
+ }
587
+ function It() {
588
+ var e;
589
+ if (!((e = this.shadowRoot) != null && e.querySelector("google-cast-launcher"))) {
590
+ var t;
591
+ let e = document.createElement("google-cast-launcher");
592
+ (t = this.shadowRoot) == null || t.appendChild(e);
593
+ }
594
+ }
595
+ e(Pt, "observedAttributes", [
596
+ ...y(jt, "observedAttributes", jt),
597
+ g.CAST_AVAILABLE,
598
+ g.IS_CASTING
599
+ ]);
600
+ //#endregion
601
+ //#region ../../libs/player-next/src/components/CastOverlay.ts
602
+ var Lt = document.createElement("template");
603
+ Lt.innerHTML = `
604
+ <style>
605
+ :host {
606
+ position: absolute;
607
+ top: 0;
608
+ left: 0;
609
+ width: 100%;
610
+ font-size: 20px;
611
+ text-align: center;
612
+ padding: 5% 0 !important;
613
+ box-shadow: 0px 0px 20px black;
614
+ background: rgba(0, 0, 0, 0.5);
615
+ color: white;
616
+ pointer-events: none;
617
+ z-index: 1;
618
+ transition: opacity 0.3s ease-in-out;
619
+ }
620
+
621
+ @media only screen and (max-width: 600px) {
622
+ :host {
623
+ font-size: 14px;
624
+ }
625
+ }
626
+
627
+ :host(:not([${g.IS_CASTING}])) {
628
+ display: none;
629
+ }
630
+
631
+ #text {
632
+ margin: 0;
633
+ padding: 0;
634
+ }
635
+ </style>
636
+ <span id="text"></span>
637
+ `;
638
+ var Rt = /* @__PURE__ */ new WeakMap(), zt = /* @__PURE__ */ new WeakMap(), Bt = class extends HTMLElement {
639
+ constructor() {
640
+ super(), d(this, Rt, null), d(this, zt, null), this.attachShadow({ mode: "open" }).appendChild(Lt.content.cloneNode(!0));
641
+ }
642
+ connectedCallback() {
643
+ var e, t;
644
+ m(Rt, this, this.closest("vindral-controller")), (e = p(Rt, this)) == null || e.connectListener(this), m(zt, this, (t = this.shadowRoot) == null ? void 0 : t.querySelector("#text"));
645
+ }
646
+ disconnectedCallback() {
647
+ var e;
648
+ (e = p(Rt, this)) == null || e.disconnectListener(this);
649
+ }
650
+ attributeChangedCallback(e, t, n) {
651
+ t === n || !p(zt, this) || e === "cast-receiver-name" && typeof n == "string" && (p(zt, this).innerText = `Casting to ${n || "device"}`);
652
+ }
653
+ };
654
+ e(Bt, "observedAttributes", [g.IS_CASTING, g.CAST_RECEIVER_NAME]);
655
+ //#endregion
656
+ //#region ../../libs/player-next/src/utils/elementUtils.ts
657
+ function Vt(e = document) {
658
+ let t = e == null ? void 0 : e.activeElement;
659
+ if (!t) return null;
660
+ if (t.shadowRoot) {
661
+ let e = Vt(t.shadowRoot);
662
+ return e == null ? t : e;
663
+ }
664
+ return t;
665
+ }
666
+ //#endregion
667
+ //#region ../../libs/player-next/src/components/ChannelGridItem.ts
668
+ var Ht = document.createElement("template");
669
+ Ht.innerHTML = "\n <style>\n :host {\n position: relative;\n aspect-ratio: 16 / 9;\n object-fit: cover;\n cursor: pointer;\n border-radius: 6px;\n box-sizing: border-box !important;\n\n background-size: cover;\n background-position: center;\n\n transition-property: background-image;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 200ms;\n\n background-color: rgba(0, 0, 0, 0.5);\n background-blend-mode: multiply;\n -webkit-tap-highlight-color: transparent;\n }\n\n :host([aria-selected=\"true\"]) {\n box-shadow: inset 0 0 0 2px var(--fg-strong);\n background-color: rgba(0, 0, 0, 0);\n }\n\n :host(:focus),\n :host(:focus-visible) {\n outline: none;\n }\n\n :host([offline]) {\n display: var(--grid-item-offline-display);\n background-image: repeating-linear-gradient(-45deg, #3d3d3d 0, #3d3d3d 4px, #1c2024 4px, #1c2024 8px) !important;\n pointer-events: none;\n }\n\n :host::before {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(255, 255, 255, 0);\n transition: background 0.2s ease;\n }\n\n :host(:hover)::before {\n background: rgba(255, 255, 255, 0.1);\n }\n\n .channel-title {\n position: absolute;\n bottom: var(--padding-2);\n left: var(--padding-2);\n padding: var(--padding-1) var(--padding-2);\n color: white;\n font-size: 15px;\n font-weight: 500;\n text-overflow: ellipsis;\n border-radius: 4px;\n\n @container (max-width: 480px) {\n font-size: 13px;\n }\n }\n </style>\n <slot></slot>\n";
670
+ var Ut = /* @__PURE__ */ new WeakMap(), Wt = class extends HTMLElement {
671
+ constructor() {
672
+ super(), d(this, Ut, void 0), e(this, "lastThumbnailUpdate", void 0);
673
+ let t = this.attachShadow({ mode: "open" });
674
+ m(Ut, this, document.createElement("span")), p(Ut, this).className = "channel-title", t.appendChild(p(Ut, this)), t.appendChild(Ht.content.cloneNode(!0));
675
+ }
676
+ attributeChangedCallback(e, t, n) {
677
+ if (t !== n) switch (e) {
678
+ case "url":
679
+ this.updateThumbnail();
680
+ break;
681
+ case "title":
682
+ p(Ut, this).textContent = n;
683
+ break;
684
+ }
685
+ }
686
+ updateThumbnail() {
687
+ let e = this.getAttribute("url"), t = this.hasAttribute("offline"), n = this.hasAttribute("visible");
688
+ if (t || !e || !n || this.lastThumbnailUpdate && Date.now() - this.lastThumbnailUpdate < 1e4) return;
689
+ let r = new URL(e), i = new Image(), a = this.getAttribute("authentication-token");
690
+ a && r.searchParams.set("auth.token", a), r.searchParams.set("t", Date.now().toString()), i.src = r.toString(), i.onload = () => this.style.backgroundImage = `url(${r.toString()})`;
691
+ }
692
+ };
693
+ e(Wt, "observedAttributes", [
694
+ "url",
695
+ "title",
696
+ "offline",
697
+ "authentication-token",
698
+ "visible"
699
+ ]);
700
+ //#endregion
701
+ //#region ../../libs/player-next/src/components/ChannelGrid.ts
702
+ var Gt = document.createElement("template");
703
+ Gt.innerHTML = "\n <style>\n :host {\n cursor: default;\n display: flex;\n flex-direction: column;\n box-sizing: border-box !important;\n border-radius: 4px;\n background-color: var(--bg-subtle);\n padding: var(--padding-2) !important;\n\n position: absolute;\n bottom: 0;\n right: 0;\n\n z-index: 5;\n width: 100%;\n max-height: 75%;\n\n @container (width < 768px) {\n padding: var(--padding-1) !important;\n }\n }\n\n :host([hidden]) {\n display: none;\n }\n\n .wrapper {\n overflow: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n height: 100%;\n }\n\n .wrapper::-webkit-scrollbar {\n display: none;\n }\n\n slot#grid {\n display: grid;\n gap: var(--padding-2);\n grid-template-columns: repeat(4, minmax(0, 1fr));\n\n @container (width < 768px) {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: var(--padding-1);\n }\n @container (width < 1024px) and (width >= 768px) {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n }\n @container (width >= 1024px) {\n grid-template-columns: repeat(4, minmax(0, 1fr));\n }\n }\n\n /* Smart TV */\n @media (width < 1024px) and (width >= 768px) and (-webkit-min-device-pixel-ratio: 2) {\n slot#grid {\n grid-template-columns: repeat(4, minmax(0, 1fr)) !important;\n }\n }\n\n :host([mode=\"list\"]) slot#grid {\n grid-template-columns: repeat(1, minmax(0, 1fr));\n }\n </style>\n\n <div class=\"wrapper\">\n <slot name=\"grid\" id=\"grid\"></slot>\n </div>\n";
704
+ var Kt = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap(), Jt = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), Yt = /* @__PURE__ */ new WeakMap(), Xt = /* @__PURE__ */ new WeakMap(), Zt = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakSet(), en = class extends HTMLElement {
705
+ constructor() {
706
+ super(), h(this, D), d(this, Kt, null), d(this, qt, null), d(this, Jt, []), d(this, T, []), d(this, E, void 0), d(this, Yt, void 0), d(this, Xt, void 0), d(this, Zt, void 0), d(this, Qt, void 0), d(this, $t, void 0), e(this, "handleEvent", (e) => {
707
+ switch (e.type) {
708
+ case "keydown":
709
+ f(D, this, mn).call(this, e);
710
+ break;
711
+ }
712
+ }), this.attachShadow({ mode: "open" }).appendChild(Gt.content.cloneNode(!0));
713
+ }
714
+ connectedCallback() {
715
+ var e, t, n;
716
+ m(qt, this, this.closest("vindral-controller")), (e = p(qt, this)) == null || e.connectListener(this), f(D, this, tn).call(this), (t = p(Kt, this)) == null || t.observe((n = this.shadowRoot) == null ? void 0 : n.querySelector(".wrapper")), f(D, this, cn).call(this), m(Xt, this, window.setInterval(() => {
717
+ f(D, this, fn).call(this);
718
+ }, 1e4));
719
+ }
720
+ disconnectedCallback() {
721
+ var e, t;
722
+ clearInterval(p(Xt, this)), f(D, this, bn).call(this), this.removeEventListener("keydown", this), (e = p(Kt, this)) == null || e.disconnect(), (t = p(qt, this)) == null || t.disconnectListener(this);
723
+ }
724
+ attributeChangedCallback(e, t, n) {
725
+ if (t !== n) switch (e) {
726
+ case g.CHANNEL_ID:
727
+ f(D, this, dn).call(this, n);
728
+ break;
729
+ case g.CHANNELS:
730
+ m(Jt, this, JSON.parse(n)), f(D, this, cn).call(this);
731
+ break;
732
+ case "authentication-token":
733
+ m(Yt, this, n);
734
+ break;
735
+ }
736
+ }
737
+ get keysUsed() {
738
+ return [
739
+ "Enter",
740
+ "Escape",
741
+ "Tab",
742
+ " ",
743
+ "ArrowDown",
744
+ "ArrowUp",
745
+ "ArrowLeft",
746
+ "ArrowRight",
747
+ "Home",
748
+ "End"
749
+ ];
750
+ }
751
+ focus() {
752
+ var e;
753
+ let t = Vt();
754
+ t && t !== this && !this.contains(t) && m(Zt, this, t), (e = p(E, this)) == null || e.focus();
755
+ }
756
+ };
757
+ function tn() {
758
+ m(Kt, this, new IntersectionObserver((e) => {
759
+ e.forEach((e) => {
760
+ let { target: t, isIntersecting: n } = e;
761
+ t instanceof Wt ? f(D, this, sn).call(this, t, n) : f(D, this, nn).call(this, n);
762
+ });
763
+ }, { root: p(qt, this) }));
764
+ }
765
+ function nn(e) {
766
+ e ? f(D, this, rn).call(this) : f(D, this, an).call(this);
767
+ }
768
+ function rn() {
769
+ this.dispatchEvent(new CustomEvent(_.CHANNEL_GRID_OPENED, {
770
+ bubbles: !0,
771
+ composed: !0
772
+ })), f(D, this, on).call(this), this.addEventListener("keydown", this), p(E, this) && (p(E, this).tabIndex = 0);
773
+ }
774
+ function an() {
775
+ f(D, this, bn).call(this), p(E, this) && (p(E, this).tabIndex = -1), this.dispatchEvent(new CustomEvent(_.CHANNEL_GRID_CLOSED, {
776
+ bubbles: !0,
777
+ composed: !0
778
+ })), f(D, this, _n).call(this), this.removeEventListener("keydown", this);
779
+ }
780
+ function on() {
781
+ var e;
782
+ f(D, this, bn).call(this), m($t, this, () => {
783
+ clearTimeout(p(Qt, this)), m(Qt, this, window.setTimeout(() => {
784
+ f(D, this, yn).call(this) && this.focus(), f(D, this, bn).call(this);
785
+ }, 100));
786
+ }), (e = this.parentElement) == null || e.addEventListener("scroll", p($t, this));
787
+ }
788
+ function sn(e, t) {
789
+ t ? (e.setAttribute("visible", ""), (!e.lastThumbnailUpdate || Date.now() - e.lastThumbnailUpdate >= 1e4) && (e.updateThumbnail(), e.lastThumbnailUpdate = Date.now())) : e.removeAttribute("visible");
790
+ }
791
+ function cn() {
792
+ var e;
793
+ let t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("slot[name=grid]"), n = new Map(p(T, this).map((e) => [e.id, e])), r = this.getAttribute("channel-id");
794
+ m(T, this, p(Jt, this).map((e) => {
795
+ var i;
796
+ let a = n.get(e.channelId);
797
+ if (a) return f(D, this, ln).call(this, a.element, e), a;
798
+ let o = f(D, this, un).call(this, e, r);
799
+ return (i = p(Kt, this)) == null || i.observe(o.element), t.contains(o.element) || t.appendChild(o.element), o;
800
+ })), n.forEach((e, t) => {
801
+ if (!p(Jt, this).some((e) => e.channelId === t)) {
802
+ var n;
803
+ (n = p(Kt, this)) == null || n.unobserve(e.element), e.element.remove();
804
+ }
805
+ }), p(T, this).sort((e, t) => e.element.hasAttribute("offline") && !t.element.hasAttribute("offline") ? 1 : -1).forEach((e) => {
806
+ t.contains(e.element) || t.appendChild(e.element);
807
+ });
808
+ }
809
+ function ln(e, t) {
810
+ t.isLive ? e.removeAttribute("offline") : e.setAttribute("offline", ""), e.setAttribute("url", t.thumbnailUrls[0] || ""), e.setAttribute("title", t.name);
811
+ }
812
+ function un(e, t) {
813
+ let n = document.createElement("vindral-channel-grid-item");
814
+ return n.setAttribute("url", e.thumbnailUrls[0] || ""), n.setAttribute("title", e.name), p(Yt, this) && n.setAttribute("authentication-token", p(Yt, this)), e.isLive || n.setAttribute("offline", ""), e.channelId === t && (n.setAttribute("aria-selected", "true"), m(E, this, n)), n.tabIndex = -1, n.onclick = () => f(D, this, pn).call(this, e), {
815
+ element: n,
816
+ thumbnail: e.thumbnailUrls[0] || "",
817
+ id: e.channelId
818
+ };
819
+ }
820
+ function dn(e) {
821
+ p(T, this).forEach((t) => {
822
+ t.id === e ? (t.element.setAttribute("aria-selected", "true"), t.element.tabIndex = 0, m(E, this, t.element)) : (t.element.tabIndex = -1, t.element.setAttribute("aria-selected", "false"));
823
+ });
824
+ }
825
+ function fn() {
826
+ this.hasAttribute("hidden") || p(T, this).forEach((e) => e.element.updateThumbnail());
827
+ }
828
+ function pn(e) {
829
+ var t;
830
+ f(D, this, xn).call(this), (t = p(qt, this)) == null || t.setAttribute("channel-id", e.channelId);
831
+ }
832
+ function mn(e) {
833
+ let { key: t, ctrlKey: n, altKey: r, metaKey: i } = e;
834
+ if (!(n || r || i) && this.keysUsed.includes(t)) if (e.preventDefault(), e.stopPropagation(), t === "Tab" || t === "Escape") f(D, this, xn).call(this);
835
+ else if (t === "Enter" || t === " ") {
836
+ var a;
837
+ (a = p(E, this)) == null || a.click();
838
+ } else f(D, this, hn).call(this, e);
839
+ }
840
+ function hn(e) {
841
+ if (!p(E, this)) return;
842
+ let { key: t } = e, n = p(T, this).findIndex((e) => e.element === p(E, this)), r = p(E, this).getBoundingClientRect();
843
+ switch (t) {
844
+ case "ArrowUp":
845
+ if (n = f(D, this, gn).call(this, r, -1, 0), n < 0) {
846
+ f(D, this, xn).call(this);
847
+ return;
848
+ }
849
+ break;
850
+ case "ArrowDown":
851
+ n = f(D, this, gn).call(this, r, 1, 0);
852
+ break;
853
+ case "ArrowLeft":
854
+ n = f(D, this, gn).call(this, r, 0, -1);
855
+ break;
856
+ case "ArrowRight":
857
+ n = f(D, this, gn).call(this, r, 0, 1);
858
+ break;
859
+ case "Home":
860
+ n = 0;
861
+ break;
862
+ case "End":
863
+ n = p(T, this).length - 1;
864
+ break;
865
+ }
866
+ if (n >= 0 && n < p(T, this).length) {
867
+ let e = p(T, this)[n];
868
+ if (!e) return;
869
+ p(E, this).setAttribute("aria-selected", "false"), p(E, this).tabIndex = -1, m(E, this, e.element), p(E, this).setAttribute("aria-selected", "true"), p(E, this).tabIndex = 0, p(E, this).focus();
870
+ }
871
+ }
872
+ function gn(e, t, n) {
873
+ let r = -1, i = Infinity;
874
+ return p(T, this).filter((e) => e.element.getBoundingClientRect().width > 0).forEach((a, o) => {
875
+ let s = a.element.getBoundingClientRect(), c = t === 0 || t < 0 && s.top < e.top || t > 0 && s.top > e.top, ee = n === 0 || n < 0 && s.left < e.left || n > 0 && s.left > e.left;
876
+ if (c && ee) {
877
+ let t = Math.sqrt((s.top - e.top) ** 2 + (s.left - e.left) ** 2);
878
+ t < i && (i = t, r = o);
879
+ }
880
+ }), r;
881
+ }
882
+ function _n() {
883
+ var e, t;
884
+ if ((e = p(Zt, this)) != null && e.isConnected) {
885
+ p(Zt, this).focus({ preventScroll: !0 });
886
+ return;
887
+ }
888
+ (t = p(qt, this)) == null || t.focus({ preventScroll: !0 });
889
+ }
890
+ function vn(e) {
891
+ return (e == null ? void 0 : e.localName) === "vindral-scroll-overlay";
892
+ }
893
+ function yn() {
894
+ let e = this.parentElement;
895
+ return e ? f(D, this, vn).call(this, e) ? e.hasAttribute("open") : !this.hasAttribute("hidden") : !1;
896
+ }
897
+ function bn() {
898
+ if (p(Qt, this) && (clearTimeout(p(Qt, this)), m(Qt, this, void 0)), p($t, this)) {
899
+ var e;
900
+ (e = this.parentElement) == null || e.removeEventListener("scroll", p($t, this)), m($t, this, void 0);
901
+ }
902
+ }
903
+ function xn() {
904
+ let e = this.parentElement;
905
+ if (f(D, this, vn).call(this, e)) {
906
+ e.open = !1;
907
+ return;
908
+ }
909
+ e == null || e.removeAttribute("open");
910
+ }
911
+ e(en, "observedAttributes", [
912
+ g.CHANNELS,
913
+ g.CHANNEL_ID,
914
+ g.AUTHENTICATION_TOKEN,
915
+ "mode",
916
+ "hidden"
917
+ ]);
918
+ //#endregion
919
+ //#region ../../libs/player-next/src/components/ChannelGridButton.ts
920
+ var Sn, Cn = "\n<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon icon-tabler icon-tabler-layout-grid\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" fill=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <path d=\"M4 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z\" />\n <path d=\"M14 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z\" />\n <path d=\"M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z\" />\n <path d=\"M14 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z\" />\n</svg>\n", wn = document.createElement("template");
921
+ wn.innerHTML = `
922
+ <style>
923
+ :host {
924
+ display: var(--grid-button-display);
925
+ cursor: pointer;
926
+ flex-shrink: 0.5;
927
+ color: var(--fg-strong);
928
+ }
929
+
930
+ :host([hidden]) {
931
+ display: none;
932
+ }
933
+ </style>
934
+ <slot name="button">${Cn}</slot>
935
+ `;
936
+ var Tn = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), En = /* @__PURE__ */ new WeakMap(), Dn = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakSet(), On = class extends x {
937
+ constructor() {
938
+ var e, t;
939
+ super(), h(this, k), d(this, Tn, void 0), d(this, O, void 0), d(this, En, void 0), d(this, Dn, (e) => {
940
+ e.composedPath().includes(this) || f(k, this, jn).call(this);
941
+ }), (e = this.shadowRoot) == null || e.appendChild(wn.content.cloneNode(!0)), m(Tn, this, (t = this.shadowRoot) == null ? void 0 : t.querySelector("slot[name=button]"));
942
+ }
943
+ connectedCallback() {
944
+ super.connectedCallback(), this.setAttribute("aria-haspopup", "listbox"), this.enable(), f(k, this, Mn).call(this);
945
+ let e = this.getRootNode();
946
+ if (e instanceof Document || e instanceof ShadowRoot) {
947
+ var t;
948
+ m(O, this, e.querySelector("vindral-channel-grid")), ((t = p(O, this).parentElement) == null ? void 0 : t.localName) === "vindral-scroll-overlay" && (p(O, this).hidden = !1, p(O, this).style.position = "relative", m(En, this, p(O, this).parentElement));
949
+ }
950
+ f(k, this, Nn).call(this);
951
+ }
952
+ disconnectedCallback() {}
953
+ attributeChangedCallback(e, t, n) {
954
+ super.attributeChangedCallback(e, t, n), (e === g.CHANNEL_GROUP_ID || e === g.CHANNELS) && f(k, this, Mn).call(this);
955
+ }
956
+ enable() {
957
+ super.enable(), document.addEventListener("click", p(Dn, this));
958
+ }
959
+ handleClick(e) {
960
+ f(k, this, kn).call(this);
961
+ }
962
+ get isOpen() {
963
+ var e;
964
+ return p(En, this) ? p(En, this).hasAttribute("open") : !((e = p(O, this)) != null && e.hidden);
965
+ }
966
+ };
967
+ Sn = On;
968
+ function kn() {
969
+ if (p(En, this)) p(En, this).hasAttribute("open") ? f(k, this, jn).call(this) : f(k, this, An).call(this);
970
+ else {
971
+ var e;
972
+ (e = p(O, this)) != null && e.hidden ? f(k, this, An).call(this) : f(k, this, jn).call(this);
973
+ }
974
+ f(k, this, Nn).call(this);
975
+ }
976
+ function An() {
977
+ if (p(En, this)) p(En, this).setAttribute("open", "");
978
+ else {
979
+ var e;
980
+ if (!((e = p(O, this)) != null && e.hidden)) return;
981
+ p(O, this).hidden = !1, p(O, this).focus();
982
+ }
983
+ p(Tn, this).setAttribute("aria-expanded", "true");
984
+ }
985
+ function jn() {
986
+ if (p(En, this)) p(En, this).open = !1;
987
+ else {
988
+ if (!p(O, this) || p(O, this).hidden) return;
989
+ p(O, this).hidden = !0;
990
+ }
991
+ p(Tn, this).setAttribute("aria-expanded", "false");
992
+ }
993
+ function Mn() {
994
+ this.getAttribute(g.CHANNEL_GROUP_ID) ? this.removeAttribute("hidden") : this.setAttribute("hidden", ""), this.hasAttribute(g.CHANNELS) ? this.removeAttribute("disabled") : this.setAttribute("disabled", "");
995
+ }
996
+ function Nn() {
997
+ this.setAttribute("aria-label", this.isOpen ? "Exit grid" : "Enter grid");
998
+ }
999
+ e(On, "observedAttributes", [
1000
+ ...y(Sn, "observedAttributes", Sn),
1001
+ g.CHANNEL_GROUP_ID,
1002
+ g.CHANNELS,
1003
+ "hidden"
1004
+ ]);
1005
+ //#endregion
1006
+ //#region ../../libs/player-next/src/components/ControlBar.ts
1007
+ var Pn = document.createElement("template");
1008
+ Pn.innerHTML = "\n <style>\n :host {\n display: flex;\n width: 100%;\n align-items: center;\n }\n\n slot {\n display: flex;\n flex-grow: 1;\n align-items: center;\n }\n\n :host([content-center]) slot {\n justify-content: center;\n }\n\n slot[name=\"right\"] {\n justify-content: flex-end;\n }\n </style>\n\n <slot name=\"bar\">\n <slot></slot>\n <slot name=\"right\"></slot>\n </slot>\n";
1009
+ var Fn = class extends HTMLElement {
1010
+ constructor() {
1011
+ super(), this.attachShadow({ mode: "open" }).appendChild(Pn.content.cloneNode(!0));
1012
+ }
1013
+ connectedCallback() {}
1014
+ disconnectedCallback() {}
1015
+ };
1016
+ e(Fn, "observedAttributes", []);
1017
+ //#endregion
1018
+ //#region ../../libs/airplay-sender/src/AirPlaySender.ts
1019
+ var In = class extends fe {
1020
+ constructor(t) {
1021
+ super(), e(this, "config", void 0), e(this, "hlsUrl", void 0), e(this, "element", void 0), e(this, "connectingTimeout", void 0), e(this, "castingAvailable", !1), e(this, "updateAuthenticationToken", (e) => {
1022
+ this.config.authenticationToken = e, this.hlsUrl = this.getHlsUrl(), this.castingAvailable && (this.element.src = this.hlsUrl);
1023
+ }), e(this, "unload", () => {
1024
+ this.element && (this.element.removeEventListener("webkitplaybacktargetavailabilitychanged", this.onAirPlayAvailable), this.element.removeEventListener("webkitcurrentplaybacktargetiswirelesschanged", this.onAirPlayPlaybackChanged), this.element.remove());
1025
+ }), e(this, "onAirPlayAvailable", (e) => {
1026
+ switch (e.availability) {
1027
+ case "available":
1028
+ this.castingAvailable = !0, this.element.src !== this.hlsUrl && this.checkHlsUrl(this.hlsUrl).then((e) => {
1029
+ e && (this.element.src = this.hlsUrl, this.emit("available"));
1030
+ });
1031
+ break;
1032
+ case "not-available":
1033
+ this.castingAvailable = !1;
1034
+ break;
1035
+ default: break;
1036
+ }
1037
+ }), e(this, "onAirPlayPlaybackChanged", () => {
1038
+ window.clearTimeout(this.connectingTimeout), this.element.webkitCurrentPlaybackTargetIsWireless ? (this.emit("connected"), this.element.style.display = "block", this.element.paused && this.element.play().catch(le)) : (this.emit("disconnected"), this.element.pause(), this.element.src = "", this.element.src = this.hlsUrl, this.element.style.display = "none");
1039
+ }), this.config = t, this.hlsUrl = this.getHlsUrl(), this.element = document.createElement("video"), this.element.style.position = "absolute", this.element.style.top = "0", this.element.style.bottom = "0", this.element.style.left = "0", this.element.style.right = "0", this.element.style.width = "100%", this.element.style.height = "100%", this.element.style.zIndex = "1001", this.element.style.display = "none", this.element.id = "vindral-airplay-element", this.element.slot = "overlay", this.element.playsInline = !0, this.element.controls = !0, this.element.preload = "metadata", this.element.addEventListener("webkitplaybacktargetavailabilitychanged", this.onAirPlayAvailable), this.element.addEventListener("webkitcurrentplaybacktargetiswirelesschanged", this.onAirPlayPlaybackChanged), this.config.container.appendChild(this.element);
1040
+ }
1041
+ get casting() {
1042
+ return this.element.webkitCurrentPlaybackTargetIsWireless;
1043
+ }
1044
+ set channelId(e) {}
1045
+ showPlaybackTargetPicker() {
1046
+ "webkitShowPlaybackTargetPicker" in this.element && this.castingAvailable && (this.element.paused && (this.element.play().catch(le), this.connectingTimeout = window.setTimeout(() => {
1047
+ this.casting || (this.element.pause(), this.element.src = "", this.element.src = this.hlsUrl);
1048
+ }, 3e4)), this.element.webkitShowPlaybackTargetPicker());
1049
+ }
1050
+ static isAirPlaySupported() {
1051
+ return !!window.WebKitPlaybackTargetAvailabilityEvent;
1052
+ }
1053
+ getHlsUrl() {
1054
+ let e = new URL(`/api/hls?channelId=${this.config.channelId}`, this.config.url);
1055
+ return this.config.authenticationToken && e.searchParams.set("authenticationToken", this.config.authenticationToken), e.toString();
1056
+ }
1057
+ checkHlsUrl(e) {
1058
+ return t(function* () {
1059
+ try {
1060
+ return (yield fetch(e, { method: "HEAD" })).ok;
1061
+ } catch (e) {
1062
+ return !1;
1063
+ }
1064
+ })();
1065
+ }
1066
+ }, Ln = class n extends fe {
1067
+ constructor(r) {
1068
+ var a;
1069
+ super(), a = this, e(this, "container", void 0), e(this, "unload", () => {
1070
+ document.removeEventListener("webkitfullscreenchange", this.onChange), document.removeEventListener("mozfullscreenchange", this.onChange), document.removeEventListener("fullscreenchange", this.onChange), this.container.removeEventListener("webkitendfullscreen", this.onChange);
1071
+ }), e(this, "request", t(function* () {
1072
+ try {
1073
+ yield a.requestFn();
1074
+ } catch (e) {
1075
+ throw a.onChange(), e;
1076
+ }
1077
+ })), e(this, "exit", t(function* () {
1078
+ try {
1079
+ yield a.exitFn();
1080
+ } catch (e) {
1081
+ throw a.onChange(), e;
1082
+ }
1083
+ })), e(this, "onChange", () => this.emit("on fullscreen change", this.isFullscreen())), e(this, "isFullscreen", () => i()), e(this, "isSupported", () => n.isFullscreenApiSupported(this.container) || !this.isInIframe()), e(this, "isFullscreenApiSupported", () => n.isFullscreenApiSupported(this.container)), e(this, "isInIframe", () => window.location !== window.parent.location), this.container = r, document.addEventListener("webkitfullscreenchange", this.onChange), document.addEventListener("mozfullscreenchange", this.onChange), document.addEventListener("fullscreenchange", this.onChange), this.container.addEventListener("webkitendfullscreen", this.onChange);
1084
+ }
1085
+ get requestFn() {
1086
+ var e;
1087
+ return (e = r(this.container)) == null ? (() => Promise.resolve()) : e;
1088
+ }
1089
+ get exitFn() {
1090
+ if (n.isFullscreenApiSupported(this.container) && this.isFullscreen()) {
1091
+ var e;
1092
+ return (e = ie(this.container)) == null ? (() => Promise.resolve()) : e;
1093
+ }
1094
+ return () => Promise.resolve();
1095
+ }
1096
+ };
1097
+ e(Ln, "isFullscreenApiSupported", (e) => l(e));
1098
+ //#endregion
1099
+ //#region ../../libs/player-next/src/PictureInPicture.ts
1100
+ var Rn = /* @__PURE__ */ new WeakMap(), zn = /* @__PURE__ */ new WeakMap(), Bn = /* @__PURE__ */ new WeakMap(), Vn = /* @__PURE__ */ new WeakMap(), Hn = /* @__PURE__ */ new WeakMap(), Un = /* @__PURE__ */ new WeakMap(), Wn = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), Kn = /* @__PURE__ */ new WeakMap(), qn = class extends fe {
1101
+ constructor(n) {
1102
+ var r;
1103
+ super(), r = this, e(this, "unload", () => {
1104
+ this.element.removeEventListener("enterpictureinpicture", this.onChange), this.element.removeEventListener("leavepictureinpicture", this.onChange), o(this.element, !1);
1105
+ }), e(this, "request", t(function* () {
1106
+ try {
1107
+ return yield p(Rn, r).call(r);
1108
+ } catch (e) {
1109
+ throw r.onChange(), e;
1110
+ }
1111
+ })), e(this, "exit", t(function* () {
1112
+ try {
1113
+ return yield p(zn, r).call(r);
1114
+ } catch (e) {
1115
+ throw r.onChange(), e;
1116
+ }
1117
+ })), e(this, "onChange", () => {
1118
+ this.emit("on picture in picture change", this.isPictureInPictureActive());
1119
+ }), e(this, "isPictureInPictureActive", () => p(Wn, this).call(this) || p(Un, this).call(this)), e(this, "isSupported", () => p(Kn, this).call(this) || p(Hn, this).call(this)), d(this, Rn, () => p(Hn, this).call(this) ? p(Bn, this).call(this) : p(Kn, this).call(this) ? p(Gn, this).call(this, "picture-in-picture") : Promise.resolve()), d(this, zn, () => this.isPictureInPictureActive() ? p(Hn, this).call(this) ? p(Vn, this).call(this) : p(Kn, this).call(this) ? p(Gn, this).call(this, "inline") : Promise.resolve() : Promise.resolve()), d(this, Bn, t(function* () {
1120
+ let e = ne(r.element);
1121
+ e && (yield e());
1122
+ })), d(this, Vn, t(function* () {
1123
+ let e = ee();
1124
+ e && (yield e());
1125
+ })), d(this, Hn, () => te(this.element)), d(this, Un, () => se()), d(this, Wn, () => ae(this.element) === "picture-in-picture"), d(this, Gn, (e) => (c(this.element) && re(this.element, e), Promise.resolve())), d(this, Kn, () => c(this.element)), this.element = n, this.element.addEventListener("enterpictureinpicture", this.onChange), this.element.addEventListener("leavepictureinpicture", this.onChange), o(this.element, !0);
1126
+ }
1127
+ get videoElement() {
1128
+ return this.element;
1129
+ }
1130
+ }, Jn = (e) => {
1131
+ var t;
1132
+ let n = "observedAttributes" in e.constructor ? e.constructor.observedAttributes : void 0;
1133
+ return !n && (t = e.nodeName) != null && t.includes("-") && (globalThis.customElements.upgrade(e), n = "observedAttributes" in e.constructor ? e.constructor.observedAttributes : void 0), Array.isArray(n) ? n.filter((e) => pe.includes(e)) : [];
1134
+ };
1135
+ //#endregion
1136
+ //#region ../../libs/player-next/src/utils/humanReadableTimeToSeconds.ts
1137
+ function Yn(e) {
1138
+ if (typeof e != "string") return NaN;
1139
+ let t = [...e.matchAll(/(\d+(?:\.\d+)?)([hms])/gi)];
1140
+ return t.length === 0 ? NaN : t.reduce((e, t) => {
1141
+ var n, r;
1142
+ let i = parseFloat((n = t[1]) == null ? "0" : n);
1143
+ switch (((r = t[2]) == null ? "" : r).toLowerCase()) {
1144
+ case "h": return e + i * 3600;
1145
+ case "m": return e + i * 60;
1146
+ case "s": return e + i;
1147
+ default: return e;
1148
+ }
1149
+ }, 0);
1150
+ }
1151
+ //#endregion
1152
+ //#region ../../libs/player-next/src/VolumeLevel.ts
1153
+ var Xn = class extends fe {
1154
+ constructor(t) {
1155
+ if (super(), e(this, "audioContext", void 0), e(this, "audioNode", void 0), e(this, "bufferLength", void 0), e(this, "animationFrameId", null), e(this, "canUseFloatTimeDomainData", void 0), e(this, "byteSampleBuffer", null), e(this, "floatSampleBuffer", null), e(this, "leftAnalyser", void 0), e(this, "rightAnalyser", void 0), e(this, "mediaElementSource", null), e(this, "update", () => {
1156
+ let e = this.getDecibel(this.leftAnalyser, this.floatSampleBuffer || this.byteSampleBuffer), t = this.getDecibel(this.rightAnalyser, this.floatSampleBuffer || this.byteSampleBuffer);
1157
+ this.emit("on decibel change", {
1158
+ left: e,
1159
+ right: t
1160
+ }), this.animationFrameId = requestAnimationFrame(this.update);
1161
+ }), this.source = t, t instanceof HTMLMediaElement) {
1162
+ let e = new AudioContext();
1163
+ this.mediaElementSource = e.createMediaElementSource(t), this.audioNode = e.createChannelSplitter(2), this.mediaElementSource.connect(this.audioNode), this.audioContext = e, this.mediaElementSource.connect(this.audioContext.destination);
1164
+ } else this.audioNode = t, this.audioContext = this.audioNode.context;
1165
+ this.leftAnalyser = this.audioNode.context.createAnalyser(), this.rightAnalyser = this.audioNode.context.createAnalyser(), this.audioNode.connect(this.leftAnalyser, 0), this.audioNode.connect(this.rightAnalyser, 1), this.canUseFloatTimeDomainData = typeof this.leftAnalyser.getFloatTimeDomainData == "function", this.leftAnalyser.fftSize = 1024, this.rightAnalyser.fftSize = 1024, this.bufferLength = this.leftAnalyser.fftSize, this.canUseFloatTimeDomainData ? this.floatSampleBuffer = new Float32Array(this.bufferLength) : this.byteSampleBuffer = new Uint8Array(this.bufferLength);
1166
+ }
1167
+ getDecibel(e, t) {
1168
+ let n = 0;
1169
+ if (t instanceof Float32Array) {
1170
+ e.getFloatTimeDomainData(t);
1171
+ for (let e = 0; e < t.length; e++) {
1172
+ let r = t[e];
1173
+ if (r) {
1174
+ let e = r ** 2;
1175
+ n = Math.max(e, n);
1176
+ }
1177
+ }
1178
+ } else {
1179
+ e.getByteTimeDomainData(t);
1180
+ for (let e = 0; e < t.length; e++) {
1181
+ let r = t[e];
1182
+ if (r) {
1183
+ let e = (r / 128 - 1) ** 2;
1184
+ n = Math.max(e, n);
1185
+ }
1186
+ }
1187
+ }
1188
+ return 10 * Math.log10(n);
1189
+ }
1190
+ start() {
1191
+ this.animationFrameId === null && (this.audioContext instanceof AudioContext && this.audioContext.state === "suspended" ? this.audioContext.resume().then(() => {
1192
+ this.update();
1193
+ }) : this.update());
1194
+ }
1195
+ stop() {
1196
+ this.animationFrameId !== null && (cancelAnimationFrame(this.animationFrameId), this.animationFrameId = null);
1197
+ }
1198
+ unload() {
1199
+ var e;
1200
+ this.stop(), (e = this.mediaElementSource) == null || e.disconnect(), this.leftAnalyser.disconnect(), this.rightAnalyser.disconnect(), this.audioNode.disconnect();
1201
+ }
1202
+ get isMediaElementSource() {
1203
+ return this.source instanceof HTMLMediaElement;
1204
+ }
1205
+ }, A = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), Zn = /* @__PURE__ */ new WeakMap(), Qn = /* @__PURE__ */ new WeakMap(), $n = /* @__PURE__ */ new WeakMap(), er = /* @__PURE__ */ new WeakMap(), tr = /* @__PURE__ */ new WeakMap(), nr = /* @__PURE__ */ new WeakMap(), rr = /* @__PURE__ */ new WeakMap(), ir = /* @__PURE__ */ new WeakMap(), ar = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakSet(), or = /* @__PURE__ */ new WeakMap(), sr = /* @__PURE__ */ new WeakMap(), cr = /* @__PURE__ */ new WeakMap(), lr = /* @__PURE__ */ new WeakMap(), ur = class {
1206
+ constructor(t, n) {
1207
+ h(this, P), d(this, A, void 0), d(this, j, void 0), d(this, M, void 0), d(this, Zn, void 0), d(this, Qn, void 0), e(this, "userPaused", !0), d(this, $n, void 0), d(this, er, void 0), d(this, tr, !1), d(this, nr, !1), d(this, rr, null), d(this, ir, 0), d(this, ar, !1), d(this, N, u.get().createContext("HlsPlayer")), d(this, or, () => f(P, this, Cr).call(this, !0)), d(this, sr, () => f(P, this, Cr).call(this, !1)), d(this, cr, () => {
1208
+ p(A, this).readyState >= HTMLMediaElement.HAVE_CURRENT_DATA && !p(A, this).paused && f(P, this, Cr).call(this, !1);
1209
+ }), d(this, lr, () => {
1210
+ p(A, this).readyState >= HTMLMediaElement.HAVE_FUTURE_DATA && f(P, this, Cr).call(this, !1);
1211
+ }), m(j, this, t), m(er, this, n == null ? void 0 : n.maxVideoBitRate), p(j, this).style.position = "absolute", p(j, this).style.top = "0", p(j, this).style.left = "0", p(j, this).style.width = "100%", p(j, this).style.height = "100%", p(j, this).style.opacity = "0", p(j, this).style.pointerEvents = "none", p(j, this).style.transition = "opacity 0.12s linear";
1212
+ let r = document.createElement("video");
1213
+ m(A, this, r), t.appendChild(p(A, this)), p(A, this).style.width = "100%", p(A, this).style.height = "100%", p(A, this).setAttribute("playsinline", ""), p(A, this).setAttribute("webkit-playsinline", ""), p(A, this).setAttribute("preload", "metadata"), f(P, this, xr).call(this), m(ar, this, p(A, this).muted), (n == null ? void 0 : n.volume) !== void 0 && (this.volume = n.volume), (n == null ? void 0 : n.muted) !== void 0 && (this.muted = n.muted);
1214
+ }
1215
+ hide() {
1216
+ m(tr, this, !0), m(nr, this, !1), p(j, this).classList.remove("active"), p(j, this).style.opacity = "0", p(j, this).style.pointerEvents = "none", m(rr, this, null);
1217
+ }
1218
+ play() {
1219
+ var e = this;
1220
+ return t(function* () {
1221
+ try {
1222
+ return p(M, e) ? (e.userPaused = !1, yield p(A, e).play()) : Promise.reject("HLS not initialized");
1223
+ } catch (t) {
1224
+ p(N, e).error("Failed to play timeshift video:", t);
1225
+ }
1226
+ })();
1227
+ }
1228
+ seek(e) {
1229
+ var n = this;
1230
+ return t(function* () {
1231
+ if (p(N, n).debug("HlsPlayer seek to", e.time), !Number.isFinite(e.time)) {
1232
+ m(rr, n, null);
1233
+ return;
1234
+ }
1235
+ if (m(rr, n, e.time > .1 ? e.time : null), n.isActive() && p(M, n)) f(P, n, hr).call(n, e.time);
1236
+ else return f(P, n, gr).call(n, e);
1237
+ })();
1238
+ }
1239
+ shouldIgnoreTimeupdate() {
1240
+ if (p(rr, this) == null) return !1;
1241
+ let e = p(A, this).currentTime;
1242
+ return !Number.isFinite(e) || e <= .1 ? !0 : (m(rr, this, null), !1);
1243
+ }
1244
+ isPipSupported() {
1245
+ return "pictureInPictureEnabled" in document && !p(A, this).disablePictureInPicture;
1246
+ }
1247
+ requestPictureInPicture() {
1248
+ return p(A, this).requestPictureInPicture();
1249
+ }
1250
+ exitPictureInPicture() {
1251
+ return document.pictureInPictureElement === p(A, this) ? document.exitPictureInPicture() : Promise.resolve();
1252
+ }
1253
+ isActive() {
1254
+ return p(j, this).style.opacity === "1" || p(j, this).classList.contains("active");
1255
+ }
1256
+ cleanup() {
1257
+ f(P, this, Sr).call(this), f(P, this, mr).call(this), p($n, this) && (cancelAnimationFrame(p($n, this)), m($n, this, void 0)), m(rr, this, null), p(A, this).remove();
1258
+ }
1259
+ addEventListener(e, t) {
1260
+ p(A, this).addEventListener(e, t);
1261
+ }
1262
+ removeEventListener(e, t) {
1263
+ p(A, this).removeEventListener(e, t);
1264
+ }
1265
+ dispatchEvent(e) {
1266
+ return p(A, this).dispatchEvent(e);
1267
+ }
1268
+ setTimeshiftUrl(e) {
1269
+ p(Qn, this) !== e && (p(N, this).debug("HLSPlayer Setting timeshift URL to", e), m(Qn, this, e));
1270
+ }
1271
+ get videoElement() {
1272
+ return p(A, this);
1273
+ }
1274
+ pause() {
1275
+ this.userPaused = !0, p(A, this).pause();
1276
+ }
1277
+ get paused() {
1278
+ return p(A, this).paused;
1279
+ }
1280
+ set volume(e) {
1281
+ p(A, this).volume = e;
1282
+ }
1283
+ get volume() {
1284
+ return p(A, this).volume;
1285
+ }
1286
+ set muted(e) {
1287
+ m(ar, this, e), p(A, this).muted = e;
1288
+ }
1289
+ get muted() {
1290
+ return p(ar, this);
1291
+ }
1292
+ set currentTime(e) {
1293
+ p(A, this).currentTime = e;
1294
+ }
1295
+ get currentTime() {
1296
+ return p(A, this).currentTime;
1297
+ }
1298
+ get seeking() {
1299
+ return p(A, this).seeking;
1300
+ }
1301
+ get duration() {
1302
+ return p(A, this).duration;
1303
+ }
1304
+ get maxVideoBitRate() {
1305
+ return p(er, this);
1306
+ }
1307
+ set maxVideoBitRate(e) {
1308
+ m(er, this, e), e !== void 0 && p(M, this) && f(P, this, fr).call(this, e);
1309
+ }
1310
+ };
1311
+ function dr() {
1312
+ var e = this;
1313
+ return t(function* () {
1314
+ let { default: t } = yield import("./Ddby8xU_.js");
1315
+ if (m(Zn, e, t), !t.isSupported()) {
1316
+ p(N, e).warn("HLS not supported");
1317
+ return;
1318
+ }
1319
+ m(M, e, new t({
1320
+ capLevelToPlayerSize: !0,
1321
+ enableWorker: !0,
1322
+ backBufferLength: 30,
1323
+ maxBufferLength: 10,
1324
+ maxMaxBufferLength: 30,
1325
+ maxBufferSize: 3e7,
1326
+ fragLoadingTimeOut: 2e4,
1327
+ manifestLoadingTimeOut: 1e4,
1328
+ fragLoadingRetryDelay: 1e3,
1329
+ manifestLoadingRetryDelay: 1e3,
1330
+ fragLoadingMaxRetry: 3,
1331
+ manifestLoadingMaxRetry: 3,
1332
+ abrEwmaDefaultEstimate: 2e6,
1333
+ abrBandWidthFactor: .95,
1334
+ abrBandWidthUpFactor: .85,
1335
+ startFragPrefetch: !0,
1336
+ testBandwidth: !1,
1337
+ debug: !1
1338
+ })), p(M, e).attachMedia(p(A, e)), p(M, e).on(t.Events.MEDIA_ATTACHED, () => p(N, e).debug("[HLS] media attached")), p(M, e).on(t.Events.MANIFEST_PARSED, () => p(N, e).debug("[HLS] manifest parsed")), p(M, e).on(t.Events.ERROR, (t, n) => {
1339
+ p(N, e).error("[HLS] error:", n), n.fatal && f(P, e, pr).call(e, n);
1340
+ }), p(M, e).on(t.Events.MANIFEST_PARSED, () => {
1341
+ var t;
1342
+ !p(er, e) || ((t = p(M, e)) == null ? void 0 : t.levels.length) === 0 || f(P, e, fr).call(e, p(er, e));
1343
+ }), p(M, e).on(t.Events.LEVEL_SWITCHED, () => {
1344
+ var t, n;
1345
+ p(N, e).debug("Level switched:", (t = p(M, e)) == null ? void 0 : t.currentLevel, "max:", e.maxVideoBitRate, "autoLevelCapping:", (n = p(M, e)) == null ? void 0 : n.autoLevelCapping);
1346
+ });
1347
+ })();
1348
+ }
1349
+ function fr(e) {
1350
+ if (!p(M, this)) {
1351
+ p(N, this).warn("HLS not initialized, cannot set bitrate cap");
1352
+ return;
1353
+ }
1354
+ let t = p(M, this).levels.map((e, t) => ({
1355
+ i: t,
1356
+ bitrate: e.bitrate
1357
+ })).filter((t) => e >= t.bitrate * .8).map((e) => e.i).pop();
1358
+ if (t === void 0) {
1359
+ var n;
1360
+ t = 0, p(N, this).debug("No level fits under bitrate cap: " + e + ", defaulting to lowest level: " + ((n = p(M, this).levels[0]) == null ? void 0 : n.bitrate));
1361
+ }
1362
+ let r = p(M, this).currentLevel;
1363
+ p(M, this).autoLevelCapping = t, r !== t && (p(N, this).debug(`Current level ${r} exceeds cap ${t}, forcing immediate switch`), p(M, this).currentLevel = t);
1364
+ }
1365
+ function pr(e) {
1366
+ if (!p(Zn, this)) {
1367
+ p(N, this).error("Hls class not available for error handling");
1368
+ return;
1369
+ }
1370
+ let t = p(Zn, this);
1371
+ switch (e.type) {
1372
+ case t.ErrorTypes.NETWORK_ERROR:
1373
+ var n;
1374
+ p(N, this).warn("[HLS] network error -> startLoad"), (n = p(M, this)) == null || n.startLoad();
1375
+ break;
1376
+ case t.ErrorTypes.MEDIA_ERROR:
1377
+ var r;
1378
+ p(N, this).warn("[HLS] media error -> recoverMediaError"), (r = p(M, this)) == null || r.recoverMediaError();
1379
+ break;
1380
+ default:
1381
+ p(N, this).error("[HLS] fatal -> destroy"), f(P, this, mr).call(this);
1382
+ break;
1383
+ }
1384
+ }
1385
+ function mr() {
1386
+ p(M, this) && (p(M, this).destroy(), m(M, this, void 0));
1387
+ }
1388
+ function hr(e) {
1389
+ if (!Number.isFinite(e)) {
1390
+ m(rr, this, null);
1391
+ return;
1392
+ }
1393
+ let t = f(P, this, br).call(this, p(A, this), e);
1394
+ m(rr, this, t > .1 ? t : null), p($n, this) && cancelAnimationFrame(p($n, this)), m($n, this, requestAnimationFrame(() => {
1395
+ p(A, this).currentTime = t;
1396
+ }));
1397
+ }
1398
+ function gr(e) {
1399
+ var n = this;
1400
+ return t(function* () {
1401
+ var t;
1402
+ let { time: r, playWhenReady: i = !0 } = e || {}, a = m(ir, n, (t = p(ir, n), ++t));
1403
+ if (!p(Qn, n)) {
1404
+ p(N, n).warn("No timeshift URL");
1405
+ return;
1406
+ }
1407
+ if (!p(M, n) && (yield f(P, n, dr).call(n), !f(P, n, wr).call(n, a))) return;
1408
+ m(tr, n, !1), m(nr, n, !1), p(M, n) && (!p(M, n).url || p(M, n).url !== p(Qn, n)) && (p(N, n).debug("Loading timeshift URL", p(Qn, n)), p(M, n).loadSource(p(Qn, n)));
1409
+ let o = n.muted;
1410
+ p(A, n).muted = !0, yield f(P, n, _r).call(n), f(P, n, wr).call(n, a) && (f(P, n, hr).call(n, r), !(i && (yield n.play(), !f(P, n, wr).call(n, a))) && f(P, n, vr).call(n, o, a));
1411
+ })();
1412
+ }
1413
+ function _r() {
1414
+ return p(A, this).duration && !Number.isNaN(p(A, this).duration) ? Promise.resolve() : new Promise((e) => {
1415
+ p(N, this).debug("Waiting for duration...");
1416
+ let t = () => {
1417
+ p(N, this).debug("Duration loaded:", p(A, this).duration), p(A, this).removeEventListener("loadedmetadata", t), clearTimeout(n), e();
1418
+ }, n = setTimeout(() => {
1419
+ p(N, this).debug("Duration timeout, proceeding anyway"), p(A, this).removeEventListener("loadedmetadata", t), e();
1420
+ }, 2e4);
1421
+ p(A, this).addEventListener("loadedmetadata", t);
1422
+ });
1423
+ }
1424
+ function vr(e, t) {
1425
+ let n = HTMLMediaElement.HAVE_CURRENT_DATA, r = () => p(A, this).readyState >= n && p(A, this).videoWidth > 0 && p(A, this).videoHeight > 0, i = () => {
1426
+ p(tr, this) || p(nr, this) || !f(P, this, wr).call(this, t) || (m(nr, this, !0), p(N, this).debug("Revealing timeshift video"), p(j, this).classList.add("active"), p(j, this).style.opacity = "1", p(j, this).style.pointerEvents = "auto", p(A, this).dispatchEvent(new CustomEvent("timeshiftready", { detail: { activationId: t } })), e || f(P, this, yr).call(this, t));
1427
+ }, a = () => {
1428
+ p(tr, this) || p(nr, this) || !f(P, this, wr).call(this, t) || r() && (s(), i());
1429
+ }, o = !1, s = () => {
1430
+ o || (o = !0, p(A, this).removeEventListener("canplay", a), p(A, this).removeEventListener("canplaythrough", a), p(A, this).removeEventListener("loadeddata", a), clearTimeout(c));
1431
+ };
1432
+ if (r()) {
1433
+ i();
1434
+ return;
1435
+ }
1436
+ p(A, this).addEventListener("canplay", a), p(A, this).addEventListener("canplaythrough", a), p(A, this).addEventListener("loadeddata", a);
1437
+ let c = setTimeout(() => {
1438
+ p(N, this).debug("Timeout reached, forcing reveal"), s(), i();
1439
+ }, 2e3);
1440
+ }
1441
+ function yr(e) {
1442
+ let t = () => {
1443
+ f(P, this, wr).call(this, e) && (p(A, this).muted = !1);
1444
+ };
1445
+ "requestVideoFrameCallback" in p(A, this) ? p(A, this).requestVideoFrameCallback(() => {
1446
+ setTimeout(() => {
1447
+ t();
1448
+ }, 100);
1449
+ }) : setTimeout(() => {
1450
+ t();
1451
+ }, 120);
1452
+ }
1453
+ function br(e, t) {
1454
+ let n = e.seekable;
1455
+ if (!n || n.length === 0) return t;
1456
+ let r = n.start(0), i = n.end(n.length - 1);
1457
+ return p(N, this).debug("Clamped seekable:", Math.max(r, Math.min(t, i))), Math.max(r, Math.min(t, i));
1458
+ }
1459
+ function xr() {
1460
+ for (let e of Tr._) p(A, this).addEventListener(e, p(or, this));
1461
+ for (let e of Er._) p(A, this).addEventListener(e, p(sr, this));
1462
+ p(A, this).addEventListener("timeupdate", p(cr, this)), p(A, this).addEventListener("progress", p(lr, this));
1463
+ }
1464
+ function Sr() {
1465
+ for (let e of Tr._) p(A, this).removeEventListener(e, p(or, this));
1466
+ for (let e of Er._) p(A, this).removeEventListener(e, p(sr, this));
1467
+ p(A, this).removeEventListener("timeupdate", p(cr, this)), p(A, this).removeEventListener("progress", p(lr, this));
1468
+ }
1469
+ function Cr(e) {
1470
+ let t = e && (p(A, this).readyState < HTMLMediaElement.HAVE_FUTURE_DATA || p(A, this).seeking || p(A, this).paused && !this.userPaused);
1471
+ p(A, this).dispatchEvent(new CustomEvent(t ? "hlsbuffering" : "hlsnotbuffering", {
1472
+ bubbles: !0,
1473
+ composed: !0
1474
+ }));
1475
+ }
1476
+ function wr(e) {
1477
+ return p(ir, this) === e;
1478
+ }
1479
+ var Tr = { _: [
1480
+ "waiting",
1481
+ "seeking",
1482
+ "stalled",
1483
+ "loadstart"
1484
+ ] }, Er = { _: [
1485
+ "canplay",
1486
+ "canplaythrough",
1487
+ "seeked",
1488
+ "loadeddata"
1489
+ ] }, Dr = class {
1490
+ constructor(e) {
1491
+ this.vindral = e;
1492
+ }
1493
+ get volume() {
1494
+ return this.vindral.volume;
1495
+ }
1496
+ get muted() {
1497
+ return this.vindral.muted;
1498
+ }
1499
+ play() {
1500
+ var e = this;
1501
+ return t(function* () {
1502
+ var t;
1503
+ return (t = e.vindral) == null || t.play(), Promise.resolve();
1504
+ })();
1505
+ }
1506
+ pause() {
1507
+ this.vindral.pause();
1508
+ }
1509
+ }, Or = document.createElement("template");
1510
+ Or.innerHTML = "\n <style>\n :host {\n --value: 0;\n --range-thickness: var(--vindral-range-thickness, 4px);\n --range-hover-thickness: var(--vindral-range-hover-thickness, var(--range-thickness));\n --range-thumb-size: var(--vindral-range-thumb-size, 12px);\n --range-thumb-hover-size: var(--vindral-range-thumb-hover-size, var(--range-thumb-size));\n --range-fill-color: var(--vindral-range-fill-color, var(--fg-strong));\n --range-thumb-color: var(--vindral-range-thumb-color, var(--fg-strong));\n --_focus-box-shadow: none;\n height: calc(var(--button-icon-size) + 2 * var(--button-padding));\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 !important;\n margin: 0;\n position: relative;\n cursor: pointer;\n touch-action: none;\n box-shadow: var(--_focus-visible-box-shadow, none);\n outline: 0;\n background: transparent;\n }\n\n :host > * {\n transition-timing-function: cubic-bezier(0.4, 0, 1, 1);\n transition-duration: 0.1s;\n }\n\n #range {\n -webkit-appearance: none;\n appearance: none;\n\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n margin: 0;\n padding: 0;\n\n background-color: #00000000;\n outline: none;\n z-index: 1;\n cursor: pointer;\n }\n\n #range-track {\n position: absolute;\n top: calc(50% - calc(var(--range-thickness) / 2));\n left: 1px;\n width: calc(100% - 2px);\n height: var(--range-thickness);\n background-color: rgb(255 255 255 / 0.2);\n overflow: hidden;\n cursor: pointer;\n transition-property: height, top;\n }\n\n @media (hover: hover) and (pointer: fine) {\n :host(:hover) #range-track {\n height: var(--range-hover-thickness);\n top: calc(50% - calc(var(--range-hover-thickness) / 2));\n }\n }\n\n #range-track::before {\n position: absolute;\n content: \"\";\n left: calc(-100%);\n top: 0;\n width: calc(100%);\n height: 100%;\n background: var(--range-fill-color);\n transition: background-color 300ms ease-out;\n transform-origin: 100% 0%;\n transform: translateX(calc(var(--value) * 100%)) scaleX(1.2);\n }\n\n #range::-webkit-slider-runnable-track {\n background: transparent;\n }\n\n #range::-moz-range-track {\n background: transparent;\n }\n\n #range::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: var(--range-thumb-size);\n height: var(--range-thumb-size);\n border-radius: 50%;\n background: var(--range-thumb-color);\n cursor: pointer;\n z-index: 1;\n transition-property: width, height;\n transition-timing-function: cubic-bezier(0.4, 0, 1, 1);\n transition-duration: 0.1s;\n }\n\n #range::-moz-range-thumb {\n -moz-appearance: none;\n appearance: none;\n width: var(--range-thumb-size);\n height: var(--range-thumb-size);\n border-radius: 50%;\n background: var(--range-thumb-color);\n cursor: pointer;\n z-index: 1;\n border: none;\n transition-property: width, height;\n transition-timing-function: cubic-bezier(0.4, 0, 1, 1);\n transition-duration: 0.1s;\n }\n\n :host:has(#range:focus-visible) {\n box-shadow: inset 0 0 0 2px var(--fg-strong);\n }\n\n @media (hover: hover) and (pointer: fine) {\n :host(:hover) #range::-webkit-slider-thumb {\n width: var(--range-thumb-hover-size);\n height: var(--range-thumb-hover-size);\n }\n\n :host(:hover) #range::-moz-range-thumb {\n width: var(--range-thumb-hover-size);\n height: var(--range-thumb-hover-size);\n }\n }\n </style>\n\n <input type=\"range\" id=\"range\" min=\"0\" max=\"1\" step=\"any\" value=\"0\" />\n <div id=\"range-track\"></div>\n";
1511
+ var kr = /* @__PURE__ */ new WeakMap(), Ar = /* @__PURE__ */ new WeakMap(), jr = class extends HTMLElement {
1512
+ constructor() {
1513
+ super(), d(this, kr, null), d(this, Ar, void 0), e(this, "range", void 0), m(Ar, this, this.attachShadow({ mode: "open" })), p(Ar, this).appendChild(Or.content.cloneNode(!0)), this.range = p(Ar, this).getElementById("range");
1514
+ }
1515
+ connectedCallback() {
1516
+ var e;
1517
+ m(kr, this, this.closest("vindral-controller")), (e = p(kr, this)) == null || e.connectListener(this), this.hasAttribute("disabled") || this.enable();
1518
+ }
1519
+ disconnectedCallback() {
1520
+ var e;
1521
+ (e = p(kr, this)) == null || e.disconnectListener(this);
1522
+ }
1523
+ attributeChangedCallback(e, t, n) {
1524
+ t !== n && (e === "disabled" && n ? this.disable() : this.enable(), this.updateBar());
1525
+ }
1526
+ enable() {
1527
+ this.addEventListener("input", this);
1528
+ }
1529
+ disable() {
1530
+ this.range.removeEventListener("input", this);
1531
+ }
1532
+ handleEvent(e) {
1533
+ e.type === "input" && this.updateBar();
1534
+ }
1535
+ updateBar() {
1536
+ this.style.setProperty("--value", this.range.value);
1537
+ }
1538
+ get keysUsed() {
1539
+ return [
1540
+ "ArrowUp",
1541
+ "ArrowRight",
1542
+ "ArrowDown",
1543
+ "ArrowLeft"
1544
+ ];
1545
+ }
1546
+ };
1547
+ e(jr, "observedAttributes", ["disabled"]);
1548
+ //#endregion
1549
+ //#region ../../libs/player-next/src/components/Controller.ts
1550
+ var Mr = document.createElement("template");
1551
+ Mr.innerHTML = `
1552
+ <style>
1553
+ :host {
1554
+ --fg-strong: var(--vindral-fg-strong, #eeeeee);
1555
+ --fg-subtle: var(--vindral-fg-subtle, #b4b4b4);
1556
+ --fg-extra-subtle: var(--vindral-fg-extra-subtle, #7b7b7b);
1557
+ --bg-strong: var(--vindral-bg-strong, #111111);
1558
+ --bg-subtle: var(--vindral-bg-subtle, #191919);
1559
+ --bg-extra-subtle: var(--vindral-bg-extra-subtle, #222222);
1560
+ --bg-component: var(--vindral-bg-component, #222222);
1561
+ --bg-component-hover: var(--vindral-bg-component-hover, #2a2a2a);
1562
+ --bg-component-active: var(--vindral-bg-component-active, #313131);
1563
+ --accent: var(--vindral-accent, oklch(54.6% 0.245 262.881));
1564
+
1565
+ --padding-1: var(--vindral-padding-1, 4px);
1566
+ --padding-2: var(--vindral-padding-2, 8px);
1567
+ --padding-3: var(--vindral-padding-3, 16px);
1568
+ --padding-4: var(--vindral-padding-4, 24px);
1569
+ --padding-5: var(--vindral-padding-5, 32px);
1570
+ --padding-6: var(--vindral-padding-6, 40px);
1571
+ --control-padding: var(--vindral-control-padding, var(--padding-1));
1572
+
1573
+ --ui-font: var(
1574
+ --vindral-ui-font,
1575
+ -apple-system,
1576
+ BlinkMacSystemFont,
1577
+ "Segoe UI",
1578
+ Roboto,
1579
+ "Helvetica Neue",
1580
+ Arial,
1581
+ sans-serif
1582
+ );
1583
+
1584
+ --button-padding: var(--vindral-button-padding, var(--padding-2));
1585
+ --button-icon-size: var(--vindral-button-icon-size, 24px);
1586
+ --play-overlay-icon-size: var(--vindral-play-overlay-icon-size, 72px);
1587
+
1588
+ --ui-display: var(--vindral-ui-display, flex);
1589
+ --play-button-display: var(--vindral-play-button-display, flex);
1590
+ --mute-button-display: var(--vindral-mute-button-display, flex);
1591
+ --airplay-button-display: var(--vindral-airplay-button-display, flex);
1592
+ --pip-button-display: var(--vindral-pip-button-display, flex);
1593
+ --fullscreen-button-display: var(--vindral-fullscreen-button-display, flex);
1594
+ --cast-button-display: var(--vindral-cast-button-display, flex);
1595
+ --grid-button-display: var(--vindral-grid-button-display, flex);
1596
+ --grid-item-offline-display: var(--vindral-grid-item-offline-display, flex);
1597
+ --volume-range-display: var(--vindral-volume-range-display, flex);
1598
+ --volume-meter-display: var(--vindral-volume-meter-display, flex);
1599
+ --rendition-menu-display: var(--vindral-rendition-menu-display, flex);
1600
+ --language-menu-display: var(--vindral-language-menu-display, flex);
1601
+ --play-overlay-display: var(--vindral-play-overlay-display, flex);
1602
+ --buffering-overlay-display: var(--vindral-buffering-overlay-display, flex);
1603
+ --poster-overlay-display: var(--vindral-poster-overlay-display, flex);
1604
+ --live-button-display: var(--vindral-live-button-display, flex);
1605
+ --seek-bar-display: var(--vindral-seek-bar-display, flex);
1606
+ --debug-button-display: var(--vindral-debug-button-display, none);
1607
+
1608
+ position: relative;
1609
+ display: flex;
1610
+ background-color: var(--bg-strong);
1611
+ width: 100%;
1612
+ container-type: inline-size;
1613
+ overflow: hidden;
1614
+ font-family: var(--ui-font);
1615
+ }
1616
+
1617
+ #ui {
1618
+ position: absolute;
1619
+ display: flex;
1620
+ justify-content: space-between;
1621
+ flex-direction: column;
1622
+ top: 0;
1623
+ bottom: 0;
1624
+ left: 0;
1625
+ right: 0;
1626
+ transition: opacity 0.5s;
1627
+ user-select: none;
1628
+ pointer-events: none;
1629
+ }
1630
+
1631
+ #ui > * {
1632
+ display: var(--ui-display);
1633
+ }
1634
+
1635
+ #ui > slot::slotted(*) {
1636
+ pointer-events: auto;
1637
+ z-index: 10;
1638
+ box-sizing: border-box;
1639
+ padding: var(--control-padding);
1640
+ // Ensure the #ui element is above the video element on Safari
1641
+ // and that we can layer things under, between, and above ui and video
1642
+ }
1643
+
1644
+ #video {
1645
+ cursor: none;
1646
+ display: flex;
1647
+ width: 100%;
1648
+ z-index: 0;
1649
+ }
1650
+
1651
+ #video video::-webkit-media-text-track-display {
1652
+ transform: translateY(var(--vindral-subtitle-offset, 0px)) !important;
1653
+ }
1654
+
1655
+ #video video::cue {
1656
+ font-size: 28px;
1657
+ background-color: rgba(0, 0, 0, 0.6);
1658
+ }
1659
+
1660
+ :host([user-interacting]) #video {
1661
+ cursor: auto;
1662
+ }
1663
+
1664
+ #video > canvas {
1665
+ object-fit: contain;
1666
+ }
1667
+
1668
+ slot#middle {
1669
+ align-items: center;
1670
+ justify-content: center;
1671
+ flex-grow: 1;
1672
+ }
1673
+
1674
+ #top-bar::slotted(vindral-control-bar) {
1675
+ background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
1676
+ }
1677
+
1678
+ #bottom-bar::slotted(vindral-control-bar) {
1679
+ background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8));
1680
+ }
1681
+
1682
+ slot#bottom-bar {
1683
+ flex-direction: column;
1684
+ }
1685
+
1686
+ :host(:focus-visible) {
1687
+ outline: none;
1688
+ }
1689
+
1690
+ :host(
1691
+ :not([${g.USER_INTERACTING}]
1692
+ ):not([${g.PAUSED}]:not([${g.HIDE_UI_ON_PAUSE}])
1693
+ ):not([${g.IS_CASTING}]
1694
+ ):not([${g.MEDIA}="audio"])
1695
+ )
1696
+ #ui {
1697
+ opacity: 0;
1698
+ cursor: none;
1699
+ pointer-events: none;
1700
+ }
1701
+
1702
+ :host(
1703
+ :not([${g.USER_INTERACTING}]
1704
+ ):not([${g.PAUSED}]:not([${g.HIDE_UI_ON_PAUSE}])
1705
+ ):not([${g.IS_CASTING}]
1706
+ ):not([${g.MEDIA}="audio"])
1707
+ )
1708
+ #ui > * {
1709
+ pointer-events: none;
1710
+ }
1711
+
1712
+ :host([${g.FULLSCREEN}][${g.FULLSCREEN_FALLBACK}]) {
1713
+ position: fixed !important;
1714
+ inset: 0 !important;
1715
+ margin: 0 !important;
1716
+ box-sizing: border-box !important;
1717
+ min-width: 0 !important;
1718
+ max-width: none !important;
1719
+ min-height: 0 !important;
1720
+ max-height: none !important;
1721
+ width: 100% !important;
1722
+ height: 100% !important;
1723
+ transform: none !important;
1724
+ z-index: 1000 !important;
1725
+ background: black;
1726
+ top: 0;
1727
+ left: 0;
1728
+ right: 0;
1729
+ bottom: 0;
1730
+
1731
+ /* intentionally not !important */
1732
+ object-fit: contain;
1733
+ }
1734
+
1735
+ :host([${g.MEDIA}="audio"]) {
1736
+ min-height: 100px;
1737
+ overflow: visible;
1738
+ }
1739
+ </style>
1740
+
1741
+ <div id="video"></div>
1742
+ <div id="time-shift-video"></div>
1743
+
1744
+ <slot id="overlay" name="overlay"></slot>
1745
+
1746
+ <div id="ui">
1747
+ <slot id="top-bar" name="top-bar"></slot>
1748
+ <slot id="middle" name="middle"></slot>
1749
+ <slot id="bottom-bar"></slot>
1750
+ <slot id="overlay-interactive" name="overlay-interactive"></slot>
1751
+ </div>
1752
+ `;
1753
+ var Nr = [
1754
+ "ArrowDown",
1755
+ "ArrowLeft",
1756
+ "ArrowRight",
1757
+ "Tab",
1758
+ "Enter",
1759
+ " ",
1760
+ "f",
1761
+ "m"
1762
+ ], Pr = /* @__PURE__ */ new WeakMap(), Fr = /* @__PURE__ */ new WeakMap(), Ir = /* @__PURE__ */ new WeakMap(), Lr = /* @__PURE__ */ new WeakMap(), Rr = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), zr = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), Br = /* @__PURE__ */ new WeakMap(), Vr = /* @__PURE__ */ new WeakMap(), Hr = /* @__PURE__ */ new WeakMap(), Ur = /* @__PURE__ */ new WeakMap(), Wr = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), Gr = /* @__PURE__ */ new WeakMap(), Kr = /* @__PURE__ */ new WeakMap(), qr = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), Jr = /* @__PURE__ */ new WeakMap(), Yr = /* @__PURE__ */ new WeakMap(), Xr = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), Zr = /* @__PURE__ */ new WeakMap(), Qr = /* @__PURE__ */ new WeakMap(), $r = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakSet(), ei = /* @__PURE__ */ new WeakMap(), ti = /* @__PURE__ */ new WeakMap(), ni = /* @__PURE__ */ new WeakMap(), ri = /* @__PURE__ */ new WeakMap(), ii = /* @__PURE__ */ new WeakMap(), ai = /* @__PURE__ */ new WeakMap(), oi = /* @__PURE__ */ new WeakMap(), si = /* @__PURE__ */ new WeakMap(), ci = /* @__PURE__ */ new WeakMap(), li = /* @__PURE__ */ new WeakMap(), ui = /* @__PURE__ */ new WeakMap(), di = /* @__PURE__ */ new WeakMap(), fi = /* @__PURE__ */ new WeakMap(), pi = /* @__PURE__ */ new WeakMap(), mi = /* @__PURE__ */ new WeakMap(), hi = /* @__PURE__ */ new WeakMap(), gi = /* @__PURE__ */ new WeakMap(), _i = /* @__PURE__ */ new WeakMap(), vi = /* @__PURE__ */ new WeakMap(), yi = /* @__PURE__ */ new WeakMap(), bi = /* @__PURE__ */ new WeakMap(), xi = /* @__PURE__ */ new WeakMap(), Si = /* @__PURE__ */ new WeakMap(), Ci = /* @__PURE__ */ new WeakMap(), wi = /* @__PURE__ */ new WeakMap(), Ti = /* @__PURE__ */ new WeakMap(), Ei = /* @__PURE__ */ new WeakMap(), Di = /* @__PURE__ */ new WeakMap(), Oi = /* @__PURE__ */ new WeakMap(), ki = /* @__PURE__ */ new WeakMap(), Ai = /* @__PURE__ */ new WeakMap(), ji = /* @__PURE__ */ new WeakMap(), Mi = class extends HTMLElement {
1763
+ constructor() {
1764
+ var t;
1765
+ super(), h(this, V), d(this, Pr, /* @__PURE__ */ new Map()), d(this, Fr, 2e3), d(this, Ir, null), d(this, Lr, null), d(this, Rr, void 0), d(this, F, void 0), d(this, I, void 0), d(this, zr, void 0), d(this, L, void 0), d(this, Br, va._), d(this, Vr, void 0), d(this, Hr, void 0), d(this, Ur, void 0), d(this, Wr, void 0), d(this, R, void 0), d(this, Gr, void 0), d(this, Kr, void 0), d(this, qr, void 0), d(this, z, void 0), d(this, Jr, void 0), d(this, Yr, void 0), d(this, Xr, void 0), d(this, B, void 0), d(this, Zr, null), d(this, Qr, !1), d(this, $r, null), d(this, ei, (e) => {
1766
+ let t = e.filter((e) => {
1767
+ var t;
1768
+ return (t = e.video) == null ? void 0 : t.width;
1769
+ });
1770
+ f(V, this, H).call(this, g.RENDITION_LEVELS, JSON.stringify(t));
1771
+ }), d(this, ti, (e) => {
1772
+ f(V, this, H).call(this, g.RENDITION_LEVEL, JSON.stringify(e));
1773
+ }), d(this, ni, (e) => {
1774
+ switch (e) {
1775
+ case "playing":
1776
+ f(V, this, U).call(this, g.PAUSED), f(V, this, U).call(this, g.BUFFERING);
1777
+ break;
1778
+ case "paused":
1779
+ f(V, this, H).call(this, g.PAUSED, ""), f(V, this, U).call(this, g.BUFFERING);
1780
+ break;
1781
+ case "buffering":
1782
+ f(V, this, U).call(this, g.PAUSED), f(V, this, H).call(this, g.BUFFERING, "");
1783
+ break;
1784
+ default: break;
1785
+ }
1786
+ }), d(this, ri, (e) => {
1787
+ f(V, this, H).call(this, g.VOLUME, e.volume.toString()), e.isMuted ? f(V, this, H).call(this, g.MUTED, "") : f(V, this, U).call(this, g.MUTED);
1788
+ }), d(this, ii, ({ channelId: e }) => {
1789
+ var t;
1790
+ this.setAttribute(g.CHANNEL_ID, e), ((t = p(F, this)) == null ? void 0 : t.playbackState) !== "buffering" && f(V, this, U).call(this, g.BUFFERING);
1791
+ }), d(this, ai, ({ channelId: e }) => {
1792
+ var t;
1793
+ p(Vr, this) !== e && this.setAttribute(g.CHANNEL_ID, e), ((t = p(F, this)) == null ? void 0 : t.playbackState) !== "buffering" && f(V, this, U).call(this, g.BUFFERING);
1794
+ }), d(this, oi, (e) => {
1795
+ m(Oi, this, Date.now()), f(V, this, H).call(this, g.CHANNELS, JSON.stringify(e));
1796
+ }), d(this, si, (e) => {
1797
+ var t;
1798
+ f(V, this, H).call(this, g.LANGUAGES, JSON.stringify(e)), (t = p(F, this)) != null && t.language && f(V, this, H).call(this, g.LANGUAGE, p(F, this).language);
1799
+ }), d(this, ci, (e) => {
1800
+ var t;
1801
+ if (f(V, this, H).call(this, g.TEXT_TRACKS, JSON.stringify(e)), (t = p(F, this)) != null && t.textTrack) {
1802
+ var n, r;
1803
+ f(V, this, H).call(this, g.TEXT_TRACK, (n = (r = p(F, this)) == null ? void 0 : r.textTrack) == null ? "" : n);
1804
+ }
1805
+ }), d(this, li, (e) => {
1806
+ e != null && e.forVideo ? (f(V, this, H).call(this, g.NEEDS_USER_INPUT_VIDEO, ""), f(V, this, U).call(this, g.NEEDS_USER_INPUT_AUDIO)) : e != null && e.forAudio && (f(V, this, H).call(this, g.NEEDS_USER_INPUT_AUDIO, ""), f(V, this, U).call(this, g.NEEDS_USER_INPUT_VIDEO));
1807
+ }), d(this, ui, (e) => {
1808
+ e || f(V, this, U).call(this, g.BUFFERING);
1809
+ }), d(this, di, (e) => {
1810
+ var t;
1811
+ let { urls: n, duration: r } = e;
1812
+ if (!n[0] || !p(L, this)) return;
1813
+ let i = new URL(n[0]);
1814
+ i.searchParams.set("channelId", (t = p(Vr, this)) == null ? "" : t);
1815
+ let a = this.getAttribute("authentication-token");
1816
+ a && i.searchParams.set("authToken", a);
1817
+ let o = Yn(r);
1818
+ if (Number.isNaN(o)) {
1819
+ p(B, this).error(`Invalid duration format: ${r}`);
1820
+ return;
1821
+ }
1822
+ let s = Math.floor(Date.now() / 1e3), c = (/* @__PURE__ */ new Date((s - o) * 1e3)).toISOString();
1823
+ i.searchParams.set("from", c), p(L, this).setTimeshiftUrl(i.toString()), f(V, this, H).call(this, g.DURATION, o.toString());
1824
+ }), d(this, fi, () => {
1825
+ f(V, this, U).call(this, g.PAUSED), f(V, this, U).call(this, g.BUFFERING);
1826
+ }), d(this, pi, () => {
1827
+ f(V, this, H).call(this, g.PAUSED, ""), f(V, this, U).call(this, g.BUFFERING);
1828
+ }), d(this, mi, () => {
1829
+ p(Ti, this).call(this), f(V, this, U).call(this, g.BUFFERING);
1830
+ }), d(this, hi, () => {
1831
+ if (!p(L, this)) return;
1832
+ let e = p(L, this).duration;
1833
+ f(V, this, H).call(this, g.DURATION, Number.isNaN(e) ? "0" : e.toString());
1834
+ }), d(this, gi, () => {
1835
+ var e, t;
1836
+ if (!p(L, this) || p(L, this).seeking || (e = (t = p(L, this)).shouldIgnoreTimeupdate) != null && e.call(t)) return;
1837
+ let n = p(L, this).currentTime;
1838
+ n !== void 0 && f(V, this, H).call(this, g.TIMESHIFT_POSITION, n.toString());
1839
+ }), d(this, _i, () => {
1840
+ p(L, this) && (f(V, this, H).call(this, g.VOLUME, p(L, this).volume.toString()), p(L, this).muted ? f(V, this, H).call(this, g.MUTED, "") : f(V, this, U).call(this, g.MUTED));
1841
+ }), d(this, vi, () => {
1842
+ f(V, this, H).call(this, g.BUFFERING, "");
1843
+ }), d(this, yi, () => {
1844
+ f(V, this, U).call(this, g.BUFFERING);
1845
+ }), d(this, bi, () => {
1846
+ if (p(Qr, this)) {
1847
+ if (p(I, this) !== p(L, this)) {
1848
+ m(Qr, this, !1);
1849
+ return;
1850
+ }
1851
+ m(Qr, this, !1), f(V, this, ca).call(this);
1852
+ }
1853
+ }), d(this, xi, 0), e(this, "handleEvent", (e) => {
1854
+ switch (e.type) {
1855
+ case "pointerdown":
1856
+ m(xi, this, e.timeStamp);
1857
+ break;
1858
+ case "pointermove":
1859
+ f(V, this, Qi).call(this, e);
1860
+ break;
1861
+ case "pointerup":
1862
+ f(V, this, $i).call(this, e);
1863
+ break;
1864
+ case "mouseleave":
1865
+ f(V, this, oa).call(this);
1866
+ break;
1867
+ case "dblclick":
1868
+ f(V, this, ea).call(this, e);
1869
+ break;
1870
+ case "mousemove":
1871
+ f(V, this, ta).call(this, e);
1872
+ break;
1873
+ case "keydown":
1874
+ p(wi, this).call(this, e);
1875
+ break;
1876
+ case "keyup":
1877
+ f(V, this, oa).call(this), p(Ci, this).call(this, e);
1878
+ break;
1879
+ }
1880
+ }), d(this, Si, (e) => {
1881
+ if (p(F, this) && (p(B, this).debug("Vindral event", { type: e.type }), e instanceof CustomEvent)) switch (e.type) {
1882
+ case _.PLAY:
1883
+ this.removeAttribute(g.PAUSED);
1884
+ break;
1885
+ case _.PAUSE:
1886
+ this.setAttribute(g.PAUSED, "");
1887
+ break;
1888
+ case _.MUTE:
1889
+ this.setAttribute(g.MUTED, "");
1890
+ break;
1891
+ case _.UNMUTE:
1892
+ this.removeAttribute(g.MUTED);
1893
+ break;
1894
+ case _.LOCK_UI:
1895
+ this.setAttribute(g.UI_LOCKED, "");
1896
+ break;
1897
+ case _.UNLOCK_UI:
1898
+ this.removeAttribute(g.UI_LOCKED);
1899
+ break;
1900
+ case _.ENTER_FULLSCREEN:
1901
+ this.setAttribute(g.FULLSCREEN, "");
1902
+ break;
1903
+ case _.EXIT_FULLSCREEN:
1904
+ this.removeAttribute(g.FULLSCREEN);
1905
+ break;
1906
+ case _.SET_RENDITION:
1907
+ {
1908
+ let t = e.detail;
1909
+ t.audio && (p(F, this).maxAudioBitRate = t.audio.bitRate), t.video && (p(F, this).maxVideoBitRate = t.video.bitRate, p(F, this).maxSize = t.video, this.setAttribute(g.MAX_VIDEO_BITRATE, String(t.video.bitRate)));
1910
+ }
1911
+ break;
1912
+ case _.SET_ABR_MODE:
1913
+ {
1914
+ let t = e.detail;
1915
+ t ? (p(F, this).abrEnabled = !0, this.setAttribute(g.ABR_ENABLED, "")) : (p(F, this).abrEnabled = !1, this.removeAttribute(g.ABR_ENABLED)), f(V, this, H).call(this, g.ABR_ENABLED, String(t));
1916
+ }
1917
+ break;
1918
+ case _.SET_SIZE_BASED_RESOLUTION_CAP_MODE:
1919
+ {
1920
+ let t = e.detail;
1921
+ this.setAttribute(g.SIZE_BASED_RESOLUTION_CAP_ENABLED, t ? "true" : "false");
1922
+ }
1923
+ break;
1924
+ case _.CHANNEL_GRID_OPENED:
1925
+ p(Zr, this) === null && f(V, this, ra).call(this);
1926
+ break;
1927
+ case _.CHANNEL_GRID_CLOSED:
1928
+ p(Zr, this) !== null && (clearTimeout(p(Zr, this)), m(Zr, this, null));
1929
+ break;
1930
+ case _.ENTER_PIP:
1931
+ this.setAttribute(g.IS_PIP, "");
1932
+ break;
1933
+ case _.EXIT_PIP:
1934
+ this.removeAttribute(g.IS_PIP);
1935
+ break;
1936
+ case _.REQUEST_AIRPLAY:
1937
+ var t;
1938
+ (t = p(qr, this)) == null || t.showPlaybackTargetPicker();
1939
+ break;
1940
+ case _.SET_LANGUAGE:
1941
+ v(e.detail) ? this.setAttribute(g.LANGUAGE, e.detail) : this.removeAttribute(g.LANGUAGE);
1942
+ break;
1943
+ case _.SET_TEXT_TRACK:
1944
+ v(e.detail) ? this.setAttribute(g.TEXT_TRACK, e.detail) : this.removeAttribute(g.TEXT_TRACK);
1945
+ break;
1946
+ case _.REQUEST_USER_INPUT:
1947
+ p(F, this).play(), p(F, this).muted = !1;
1948
+ break;
1949
+ case _.SET_VOLUME:
1950
+ {
1951
+ let t = e.detail;
1952
+ p(F, this).muted && t > 0 ? (p(F, this).muted = !1, p(L, this) && (p(L, this).muted = !1)) : t === 0 && (p(F, this).muted = !0, p(L, this) && (p(L, this).muted = !0)), this.setAttribute(g.VOLUME, t.toString());
1953
+ }
1954
+ break;
1955
+ case _.SEEK:
1956
+ this.handleTimeShiftUpdate(String(e.detail));
1957
+ break;
1958
+ case _.GO_LIVE:
1959
+ p(Ti, this).call(this);
1960
+ break;
1961
+ case _.TOGGLE_DEBUG_PANEL:
1962
+ this.hasAttribute(g.DEBUG_PANEL_OPEN) ? this.removeAttribute(g.DEBUG_PANEL_OPEN) : this.setAttribute(g.DEBUG_PANEL_OPEN, "");
1963
+ break;
1964
+ case _.SET_TARGET_BUFFER_TIME:
1965
+ {
1966
+ let t = Math.max(50, Math.min(Se, e.detail));
1967
+ this.setAttribute("target-buffer-time", String(t));
1968
+ }
1969
+ break;
1970
+ }
1971
+ }), d(this, Ci, (e) => {
1972
+ let { key: t } = e;
1973
+ if (!Nr.includes(t)) {
1974
+ this.removeEventListener("keyup", this);
1975
+ return;
1976
+ }
1977
+ f(V, this, na).call(this, e);
1978
+ }), d(this, wi, (e) => {
1979
+ let { metaKey: t, altKey: n, key: r } = e;
1980
+ t || n || !Nr.includes(r) || this.addEventListener("keyup", this, { once: !0 });
1981
+ }), d(this, Ti, () => {
1982
+ this.removeAttribute(g.TIMESHIFT_POSITION), this.handleTimeShiftUpdate(!1);
1983
+ }), d(this, Ei, (e) => {
1984
+ var t;
1985
+ p(L, this) || f(V, this, Li).call(this), p(I, this) !== p(L, this) && (e && f(V, this, la).call(this), m(I, this, p(L, this)), f(V, this, Fi).call(this), f(V, this, Ii).call(this), f(V, this, Vi).call(this), (t = p(F, this)) == null || t.pause(), m(Qr, this, e));
1986
+ }), d(this, Di, (e) => {
1987
+ var t, n, r, i;
1988
+ e && f(V, this, la).call(this), (t = p(L, this)) == null || t.hide(), m(I, this, p(zr, this)), f(V, this, Vi).call(this), this.hasAttribute(g.PAUSED) ? (n = p(I, this)) == null || n.pause() : (r = p(I, this)) == null || r.play(), f(V, this, zi).call(this), f(V, this, Pi).call(this), (i = p(L, this)) == null || i.pause(), e && (m(Qr, this, !1), setTimeout(() => {
1989
+ f(V, this, ca).call(this);
1990
+ }, 100));
1991
+ }), e(this, "handleTimeShiftUpdate", (e) => {
1992
+ let t = this.hasAttribute(g.IS_PIP);
1993
+ if (e !== !1) {
1994
+ var n;
1995
+ p(Ei, this).call(this, t), (n = p(L, this)) == null || n.seek({
1996
+ time: parseFloat(e),
1997
+ playWhenReady: !this.hasAttribute(g.PAUSED)
1998
+ });
1999
+ return;
2000
+ }
2001
+ p(I, this) !== p(zr, this) && p(Di, this).call(this, t);
2002
+ }), d(this, Oi, null), d(this, ki, () => {
2003
+ var e;
2004
+ let t = (e = p(F, this)) == null ? void 0 : e.currentRenditionLevel;
2005
+ if (!(t != null && t.video)) return;
2006
+ let n = a(t.video.width > t.video.height ? "landscape-primary" : "portrait-primary");
2007
+ n && n.catch(() => {});
2008
+ }), d(this, Ai, () => {
2009
+ s();
2010
+ }), d(this, ji, null), this.attachShadow({ mode: "open" }).appendChild(Mr.content.cloneNode(!0));
2011
+ let n = he(this.getAttribute("log-level"));
2012
+ m(B, this, u.get().createContext("VindralController")), p(B, this).setLevel(n), m(Rr, this, (t = this.shadowRoot) == null ? void 0 : t.querySelector("#time-shift-video"));
2013
+ }
2014
+ connectedCallback() {
2015
+ var e = this;
2016
+ return t(function* () {
2017
+ b(e.getAttribute("auto-instance-enabled"), !0) && (yield f(V, e, Ni).call(e));
2018
+ for (let t of Object.values(_)) e.addEventListener(t, p(Si, e));
2019
+ window.PointerEvent ? (e.addEventListener("pointerdown", e), e.addEventListener("pointermove", e), e.addEventListener("pointerup", e)) : e.addEventListener("mousemove", e), e.addEventListener("mouseleave", e), e.addEventListener("keydown", e), e.addEventListener("resize", e), e.addEventListener("dblclick", e), e.connectListener(e), f(V, e, Xi).call(e), e.tabIndex = 0, e.focus({ preventScroll: !0 });
2020
+ })();
2021
+ }
2022
+ disconnectedCallback() {
2023
+ var e, t, n, r, i;
2024
+ f(V, this, Zi).call(this), f(V, this, ga).call(this), (e = p(F, this)) == null || e.unload(), (t = p(R, this)) == null || t.unload(), (n = p(Gr, this)) == null || n.unload(), (r = p(Kr, this)) == null || r.unload(), (i = p(z, this)) == null || i.unload(), f(V, this, Ri).call(this);
2025
+ for (let e of Object.values(_)) this.removeEventListener(e, p(Si, this));
2026
+ f(V, this, Fi).call(this), p(Ir, this) && (clearTimeout(p(Ir, this)), m(Ir, this, null)), this.disconnectListener(this);
2027
+ }
2028
+ attributeChangedCallback(e, t, n) {
2029
+ if (t !== n) {
2030
+ switch (p(B, this).debug("Attribute changed", {
2031
+ name: e,
2032
+ oldValue: t,
2033
+ newValue: n
2034
+ }), e) {
2035
+ case "channel-id":
2036
+ m(Vr, this, n), p(F, this) && n && (p(F, this).channelId = n, p(F, this).play(), f(V, this, H).call(this, g.BUFFERING, ""), f(V, this, H).call(this, g.CHANNEL_ID, n), f(V, this, H).call(this, g.POSTER_SRC, p(F, this).getThumbnailUrl()));
2037
+ break;
2038
+ case "channel-group-id":
2039
+ m(Hr, this, n);
2040
+ break;
2041
+ case "url":
2042
+ n && m(Br, this, n);
2043
+ break;
2044
+ case "paused":
2045
+ if (v(n)) {
2046
+ var r;
2047
+ (r = p(I, this)) == null || r.pause(), f(V, this, H).call(this, g.PAUSED, "");
2048
+ } else {
2049
+ var i;
2050
+ f(V, this, U).call(this, g.NEEDS_USER_INPUT_VIDEO), f(V, this, U).call(this, g.PAUSED), (i = p(I, this)) == null || i.play();
2051
+ }
2052
+ break;
2053
+ case "target-buffer-time":
2054
+ if (n) {
2055
+ let e = parseInt(n, 10);
2056
+ Number.isNaN(e) || (p(F, this) && (p(F, this).targetBufferTime = e), f(V, this, H).call(this, g.TARGET_BUFFER_TIME, String(e)));
2057
+ }
2058
+ break;
2059
+ case "min-buffer-time":
2060
+ if (p(F, this) && v(n)) {
2061
+ let e = _e(n);
2062
+ e !== void 0 && p(F, this).updateBufferTimeConfig({ minBufferTime: e });
2063
+ }
2064
+ break;
2065
+ case "max-buffer-time":
2066
+ if (p(F, this) && v(n)) {
2067
+ let e = _e(n);
2068
+ e !== void 0 && p(F, this).updateBufferTimeConfig({ maxBufferTime: e });
2069
+ }
2070
+ break;
2071
+ case g.DEBUG_PANEL_OPEN:
2072
+ v(n) ? f(V, this, H).call(this, g.DEBUG_PANEL_OPEN, "") : f(V, this, U).call(this, g.DEBUG_PANEL_OPEN), f(V, this, ma).call(this);
2073
+ break;
2074
+ case "user-interacting":
2075
+ v(n) ? f(V, this, H).call(this, g.USER_INTERACTING, "") : f(V, this, U).call(this, g.USER_INTERACTING);
2076
+ break;
2077
+ case "muted":
2078
+ if (p(F, this)) if (v(n)) {
2079
+ var a;
2080
+ if (p(F, this).muted = !0, p(L, this) && (p(L, this).muted = !0), f(V, this, H).call(this, g.MUTED, ""), (a = p(z, this)) != null && a.isMediaElementSource) {
2081
+ var o;
2082
+ (o = p(z, this)) == null || o.stop(), f(V, this, H).call(this, g.VOLUME_LEVEL, JSON.stringify({
2083
+ left: null,
2084
+ right: null
2085
+ }));
2086
+ }
2087
+ } else {
2088
+ var s;
2089
+ p(F, this).muted = !1, p(L, this) && (p(L, this).muted = !1), f(V, this, U).call(this, g.MUTED), f(V, this, U).call(this, g.NEEDS_USER_INPUT_AUDIO), p(F, this).volume === 0 && (p(F, this).volume = .3), (s = p(z, this)) == null || s.start();
2090
+ }
2091
+ break;
2092
+ case "ui-locked":
2093
+ v(n) ? f(V, this, aa).call(this) : f(V, this, oa).call(this);
2094
+ break;
2095
+ case "is-fullscreen":
2096
+ v(n) ? f(V, this, ua).call(this) : f(V, this, da).call(this);
2097
+ break;
2098
+ case "abr-enabled":
2099
+ {
2100
+ let e = b(n == null ? null : n, !1);
2101
+ p(F, this) && (p(F, this).abrEnabled = e, e && (p(F, this).sizeBasedResolutionCapEnabled = b(this.getAttribute(g.SIZE_BASED_RESOLUTION_CAP_ENABLED), !0))), e ? f(V, this, H).call(this, g.ABR_ENABLED, "") : f(V, this, U).call(this, g.ABR_ENABLED);
2102
+ }
2103
+ break;
2104
+ case "size-based-resolution-cap-enabled":
2105
+ {
2106
+ let e = b(n == null ? null : n, !0);
2107
+ p(F, this) && (p(F, this).sizeBasedResolutionCapEnabled = e), f(V, this, H).call(this, g.SIZE_BASED_RESOLUTION_CAP_ENABLED, e ? "true" : "false");
2108
+ }
2109
+ break;
2110
+ case "max-video-bit-rate":
2111
+ m(Ur, this, n), v(n) ? f(V, this, H).call(this, g.MAX_VIDEO_BITRATE, n) : f(V, this, U).call(this, g.MAX_VIDEO_BITRATE), p(L, this) && (p(L, this).maxVideoBitRate = n ? _e(n) : void 0);
2112
+ break;
2113
+ case "max-initial-bit-rate":
2114
+ m(Wr, this, n), v(n) ? f(V, this, H).call(this, g.MAX_INITIAL_BITRATE, n) : f(V, this, U).call(this, g.MAX_INITIAL_BITRATE);
2115
+ break;
2116
+ case "is-pip":
2117
+ v(n) ? f(V, this, ca).call(this) : f(V, this, la).call(this);
2118
+ break;
2119
+ case "is-airplaying":
2120
+ if (v(n)) {
2121
+ var c, ee;
2122
+ (c = p(F, this)) != null && c.mediaElement && (p(F, this).mediaElement.style.display = "hidden"), (ee = p(F, this)) == null || ee.pause();
2123
+ } else {
2124
+ var l;
2125
+ (l = p(F, this)) != null && l.mediaElement && (p(F, this).mediaElement.style.display = "block");
2126
+ }
2127
+ break;
2128
+ case "is-casting":
2129
+ if (v(n)) {
2130
+ var te, u;
2131
+ (te = p(Gr, this)) != null && te.isFullscreen() && f(V, this, da).call(this), (u = p(F, this)) == null || u.pause();
2132
+ } else if (!document.hidden) {
2133
+ var ne;
2134
+ (ne = p(F, this)) == null || ne.play();
2135
+ }
2136
+ break;
2137
+ case "cast-receiver-id":
2138
+ m(Yr, this, n);
2139
+ break;
2140
+ case "cast-background":
2141
+ m(Xr, this, n);
2142
+ break;
2143
+ case "language":
2144
+ p(F, this) && (p(F, this).language = n, v(n) ? f(V, this, H).call(this, g.LANGUAGE, n) : f(V, this, U).call(this, g.LANGUAGE));
2145
+ break;
2146
+ case "text-track":
2147
+ p(F, this) && (p(F, this).textTrack = n, v(n) ? f(V, this, H).call(this, g.TEXT_TRACK, n) : f(V, this, U).call(this, g.TEXT_TRACK));
2148
+ break;
2149
+ case "log-level":
2150
+ v(n) && p(B, this).setLevel(he(n));
2151
+ break;
2152
+ case "authentication-token":
2153
+ if (v(n)) {
2154
+ var re, ie;
2155
+ (re = p(F, this)) == null || re.updateAuthenticationToken(n), (ie = p(qr, this)) == null || ie.updateAuthenticationToken(n), f(V, this, H).call(this, g.AUTHENTICATION_TOKEN, n);
2156
+ } else f(V, this, U).call(this, g.AUTHENTICATION_TOKEN);
2157
+ break;
2158
+ case "volume":
2159
+ if (v(n)) {
2160
+ let e = parseFloat(n);
2161
+ p(L, this) && (p(L, this).volume = e), p(F, this) && (p(F, this).volume = e);
2162
+ }
2163
+ break;
2164
+ case "timeshift-position":
2165
+ v(n) ? f(V, this, H).call(this, g.TIMESHIFT_POSITION, n) : f(V, this, U).call(this, g.TIMESHIFT_POSITION);
2166
+ break;
2167
+ case "drm-headers":
2168
+ if (v(n)) {
2169
+ let e = ve(n);
2170
+ if (e) {
2171
+ var ae;
2172
+ (ae = p(F, this)) == null || ae.drm.setHeaders(e);
2173
+ } else p(B, this).warn("Invalid DRM headers format:", n);
2174
+ }
2175
+ break;
2176
+ case "drm-queryparams":
2177
+ if (v(n)) {
2178
+ let e = ve(n);
2179
+ if (e) {
2180
+ var oe;
2181
+ (oe = p(F, this)) == null || oe.drm.setQueryParams(e);
2182
+ } else p(B, this).warn("Invalid DRM query parameters format:", n);
2183
+ }
2184
+ break;
2185
+ }
2186
+ [
2187
+ g.USER_INTERACTING,
2188
+ g.PAUSED,
2189
+ g.HIDE_UI_ON_PAUSE
2190
+ ].includes(e) && f(V, this, sa).call(this);
2191
+ }
2192
+ }
2193
+ connectListener(e) {
2194
+ Jn(e).forEach((t) => {
2195
+ let n = p(Pr, this).get(t);
2196
+ switch (n ? n.push(e) : p(Pr, this).set(t, [e]), t) {
2197
+ case g.PAUSED:
2198
+ var r;
2199
+ (((r = p(F, this)) == null ? void 0 : r.playbackState) === "paused" || this.hasAttribute(g.PAUSED)) && e.setAttribute(g.PAUSED, "");
2200
+ break;
2201
+ case g.MUTED:
2202
+ var i;
2203
+ ((i = p(F, this)) != null && i.muted || this.hasAttribute(g.MUTED)) && e.setAttribute(g.MUTED, "");
2204
+ break;
2205
+ case g.MAX_VIDEO_BITRATE:
2206
+ p(Ur, this) && e.setAttribute(g.MAX_VIDEO_BITRATE, p(Ur, this));
2207
+ break;
2208
+ case g.SIZE_BASED_RESOLUTION_CAP_ENABLED:
2209
+ {
2210
+ var a, o;
2211
+ let t = (a = (o = p(F, this)) == null ? void 0 : o.sizeBasedResolutionCapEnabled) == null ? b(this.getAttribute(g.SIZE_BASED_RESOLUTION_CAP_ENABLED), !0) : a;
2212
+ e.setAttribute(g.SIZE_BASED_RESOLUTION_CAP_ENABLED, t ? "true" : "false");
2213
+ }
2214
+ break;
2215
+ case g.CHANNEL_ID:
2216
+ p(Vr, this) && e.setAttribute(g.CHANNEL_ID, p(Vr, this));
2217
+ break;
2218
+ case g.CHANNEL_GROUP_ID:
2219
+ p(Hr, this) && e.setAttribute(g.CHANNEL_GROUP_ID, p(Hr, this));
2220
+ break;
2221
+ case g.AUTHENTICATION_TOKEN: {
2222
+ let t = this.getAttribute("authentication-token");
2223
+ t && e.setAttribute(g.AUTHENTICATION_TOKEN, t);
2224
+ break;
2225
+ }
2226
+ case g.DEBUG_PANEL_OPEN:
2227
+ this.hasAttribute(g.DEBUG_PANEL_OPEN) && e.setAttribute(g.DEBUG_PANEL_OPEN, "");
2228
+ break;
2229
+ case g.TARGET_BUFFER_TIME: {
2230
+ let t = this.getAttribute("target-buffer-time");
2231
+ t && e.setAttribute(g.TARGET_BUFFER_TIME, t);
2232
+ break;
2233
+ }
2234
+ case g.PLAYBACK_LATENCY: {
2235
+ var s;
2236
+ let t = (s = p(F, this)) == null ? void 0 : s.playbackLatency;
2237
+ typeof t == "number" && e.setAttribute(g.PLAYBACK_LATENCY, String(t));
2238
+ break;
2239
+ }
2240
+ case g.CONNECTION_STATE:
2241
+ p(F, this) && e.setAttribute(g.CONNECTION_STATE, p(F, this).connectionState);
2242
+ break;
2243
+ case g.ABR_ENABLED:
2244
+ p(F, this) ? e.setAttribute(g.ABR_ENABLED, String(p(F, this).abrEnabled)) : v(this.getAttribute(g.ABR_ENABLED)) ? e.setAttribute(g.ABR_ENABLED, this.getAttribute(g.ABR_ENABLED) || "") : e.removeAttribute(g.ABR_ENABLED);
2245
+ break;
2246
+ }
2247
+ });
2248
+ }
2249
+ disconnectListener(e) {
2250
+ Jn(e).forEach((t) => {
2251
+ let n = p(Pr, this).get(t);
2252
+ n && p(Pr, this).set(t, n.filter((t) => t !== e));
2253
+ });
2254
+ }
2255
+ get instance() {
2256
+ return p(F, this);
2257
+ }
2258
+ get fullscreen() {
2259
+ return f(V, this, Wi).call(this);
2260
+ }
2261
+ get airPlay() {
2262
+ return p(qr, this);
2263
+ }
2264
+ connect() {
2265
+ f(V, this, Ni).call(this);
2266
+ }
2267
+ };
2268
+ function Ni() {
2269
+ var e = this;
2270
+ return t(function* () {
2271
+ var t, n;
2272
+ if (!p(Vr, e)) return;
2273
+ let r = p(I, e) === p(zr, e);
2274
+ yield (t = p(F, e)) == null ? void 0 : t.unload(), r && m(I, e, void 0);
2275
+ let i = e.hasAttribute(g.PAUSED), a = e.hasAttribute(g.MUTED), o = _e(e.getAttribute(g.VOLUME)), s = typeof o == "number" ? Math.max(0, Math.min(1, o)) : o, c = ge(e.getAttribute(g.MEDIA)), ee = e.getAttribute(g.TEXT_TRACK) || void 0, l = e.getAttribute("edge-url") || void 0, te = e.getAttribute("authentication-token") || void 0, u = _e(e.getAttribute("max-video-bit-rate")), ne = _e(e.getAttribute("max-initial-bit-rate")), re = Ce(e.getAttribute("max-size")), ie = _e(e.getAttribute("min-buffer-time")), ae = _e(e.getAttribute("max-buffer-time")), se = b(e.getAttribute("burst-enabled")), ce = b(e.getAttribute("mse-enabled")), le = b(e.getAttribute("mse-opus-enabled")), d = b(e.getAttribute("ios-background-play-enabled")), h = b(e.getAttribute("ios-wake-lock-enabled")), ue = b(e.getAttribute("stream-to-media-element-enabled")), de = b(e.getAttribute("ios-media-element-enabled")), fe = b(e.getAttribute("abr-enabled"), !0), pe = b(e.getAttribute("size-based-resolution-cap-enabled")), _ = b(e.getAttribute("telemetry-enabled")), y = ye(e.getAttribute("video-codecs")), x = xe(e.getAttribute("poster")), Se = me(e.getAttribute("advanced")), we = he(e.getAttribute("log-level")), Te = {
2276
+ headers: ve(e.getAttribute("drm-headers")),
2277
+ queryParams: ve(e.getAttribute("drm-queryparams")),
2278
+ widevine: {
2279
+ videoRobustness: be(e.getAttribute("drm-widevine-video-robustness")),
2280
+ audioRobustness: be(e.getAttribute("drm-widevine-audio-robustness"))
2281
+ },
2282
+ playready: {
2283
+ videoRobustness: be(e.getAttribute("drm-playready-video-robustness")),
2284
+ audioRobustness: be(e.getAttribute("drm-playready-audio-robustness"))
2285
+ }
2286
+ }, Ee = Ae(e.getAttribute("webcodecs-hardware-acceleration")), De = ke(e.getAttribute("decoders")), Oe = b(e.getAttribute("offscreen-canvas-enabled")), je = b(e.getAttribute("webtransport-enabled")), Me = _e(e.getAttribute("reconnect-retries")), Ne = Me === void 0 ? void 0 : (e) => e.reconnectRetries < Me, S = e.getAttribute("language") || void 0;
2287
+ m(F, e, new oe({
2288
+ url: p(Br, e),
2289
+ channelId: p(Vr, e),
2290
+ channelGroupId: p(Hr, e),
2291
+ edgeUrl: l,
2292
+ authenticationToken: te,
2293
+ muted: a,
2294
+ volume: s,
2295
+ media: c,
2296
+ maxSize: re,
2297
+ maxVideoBitRate: u,
2298
+ maxInitialBitRate: ne,
2299
+ minBufferTime: ie,
2300
+ maxBufferTime: ae,
2301
+ burstEnabled: se,
2302
+ mseEnabled: ce,
2303
+ mseOpusEnabled: le,
2304
+ iosBackgroundPlayEnabled: d,
2305
+ iosWakeLockEnabled: h,
2306
+ streamToMediaElementEnabled: ue,
2307
+ iosMediaElementEnabled: de,
2308
+ abrEnabled: fe,
2309
+ sizeBasedResolutionCapEnabled: pe,
2310
+ telemetryEnabled: _,
2311
+ videoCodecs: y,
2312
+ poster: x,
2313
+ textTrack: ee,
2314
+ advanced: Se,
2315
+ logLevel: we,
2316
+ language: S,
2317
+ drm: Te,
2318
+ webtransportEnabled: je,
2319
+ webcodecsHardwareAcceleration: Ee,
2320
+ decoders: De,
2321
+ offscreenCanvasEnabled: Oe,
2322
+ reconnectHandler: Ne
2323
+ })), m(zr, e, new Dr(p(F, e))), p(I, e) || m(I, e, p(zr, e)), f(V, e, Pi).call(e), m(Lr, e, (n = e.shadowRoot) == null ? void 0 : n.querySelector("#video")), p(Lr, e) && p(F, e).attach(p(Lr, e)), e.setAttribute(g.MEDIA, p(F, e).media), p(F, e).muted && f(V, e, H).call(e, g.MUTED, ""), p(F, e).abrEnabled ? f(V, e, H).call(e, g.ABR_ENABLED, "") : f(V, e, U).call(e, g.ABR_ENABLED), f(V, e, H).call(e, g.SIZE_BASED_RESOLUTION_CAP_ENABLED, p(F, e).sizeBasedResolutionCapEnabled ? "true" : "false"), f(V, e, H).call(e, g.VOLUME, p(F, e).volume.toString()), v(x) || f(V, e, H).call(e, g.POSTER_SRC, p(F, e).getThumbnailUrl());
2324
+ let Pe = b(e.getAttribute(g.AIRPLAY_ENABLED), !1), Fe = b(e.getAttribute(g.CAST_ENABLED), !0), Ie = b(e.getAttribute(g.FULLSCREEN_ENABLED), !0), Le = b(e.getAttribute(g.PIP_ENABLED), !0), Re = b(e.getAttribute(g.VU_METER_ENABLED), !1), ze = b(e.getAttribute(g.TIMESHIFT_ENABLED), !1);
2325
+ Pe && f(V, e, Ji).call(e, p(F, e)), Fe && f(V, e, Gi).call(e, p(F, e)), Ie && f(V, e, Hi).call(e, p(F, e)), Le && f(V, e, Bi).call(e, p(F, e)), i || p(F, e).play(), Re && f(V, e, Yi).call(e, p(F, e)), e.dispatchEvent(new CustomEvent("vindral-instance-ready", {
2326
+ bubbles: !0,
2327
+ composed: !0,
2328
+ detail: p(F, e)
2329
+ })), ze && (f(V, e, Li).call(e), Ie && f(V, e, Ui).call(e));
2330
+ })();
2331
+ }
2332
+ function Pi() {
2333
+ p(F, this) && (p(F, this).on("rendition levels", p(ei, this)), p(F, this).on("rendition level", p(ti, this)), p(F, this).on("playback state", p(ni, this)), p(F, this).on("volume state", p(ri, this)), p(F, this).on("channel switch failed", p(ii, this)), p(F, this).on("channel switch", p(ai, this)), p(F, this).on("channels", p(oi, this)), p(F, this).on("languages", p(si, this)), p(F, this).on("text tracks", p(ci, this)), p(F, this).on("needs user input", p(li, this)), p(F, this).on("is live", p(ui, this)), p(F, this).on("timeshift info", p(di, this)));
2334
+ }
2335
+ function Fi() {
2336
+ p(F, this) && (p(F, this).off("playback state", p(ni, this)), p(F, this).off("volume state", p(ri, this)), p(F, this).off("channel switch failed", p(ii, this)), p(F, this).off("channel switch", p(ai, this)), p(F, this).off("channels", p(oi, this)), p(F, this).off("languages", p(si, this)), p(F, this).off("text tracks", p(ci, this)), p(F, this).off("needs user input", p(li, this)), p(F, this).off("is live", p(ui, this)), p(F, this).off("timeshift info", p(di, this)));
2337
+ }
2338
+ function Ii() {
2339
+ p(L, this) && (p(L, this).addEventListener("playing", p(fi, this)), p(L, this).addEventListener("pause", p(pi, this)), p(L, this).addEventListener("ended", p(mi, this)), p(L, this).addEventListener("timeupdate", p(gi, this)), p(L, this).addEventListener("volumechange", p(_i, this)), p(L, this).addEventListener("hlsbuffering", p(vi, this)), p(L, this).addEventListener("hlsnotbuffering", p(yi, this)), p(L, this).addEventListener("timeshiftready", p(bi, this)));
2340
+ }
2341
+ function Li() {
2342
+ var e, t, n, r;
2343
+ let i = _e(this.getAttribute(g.VOLUME)), a = i === void 0 ? (e = (t = p(I, this)) == null ? void 0 : t.volume) == null ? 1 : e : Math.max(0, Math.min(1, i)), o = b(this.getAttribute(g.MUTED), (n = (r = p(I, this)) == null ? void 0 : r.muted) == null ? !1 : n);
2344
+ f(V, this, Ri).call(this), m(L, this, new ur(p(Rr, this), {
2345
+ volume: a,
2346
+ muted: o,
2347
+ maxVideoBitRate: p(Ur, this) ? parseInt(p(Ur, this), 10) : void 0
2348
+ })), p(L, this).addEventListener("durationchange", p(hi, this));
2349
+ }
2350
+ function Ri() {
2351
+ p(L, this) && (f(V, this, zi).call(this), p(L, this).removeEventListener("durationchange", p(hi, this)), p(L, this).cleanup(), p(I, this) === p(L, this) && m(I, this, void 0), m(L, this, void 0));
2352
+ }
2353
+ function zi() {
2354
+ p(L, this) && (p(L, this).removeEventListener("playing", p(fi, this)), p(L, this).removeEventListener("pause", p(pi, this)), p(L, this).removeEventListener("ended", p(mi, this)), p(L, this).removeEventListener("timeupdate", p(gi, this)), p(L, this).removeEventListener("volumechange", p(_i, this)), p(L, this).removeEventListener("hlsbuffering", p(vi, this)), p(L, this).removeEventListener("hlsnotbuffering", p(yi, this)), p(L, this).removeEventListener("timeshiftready", p(bi, this)));
2355
+ }
2356
+ function Bi(e) {
2357
+ e.mediaElement instanceof HTMLVideoElement && (m(R, this, new qn(e.mediaElement)), p(R, this).isSupported() && (p(B, this).debug("PIP is supported"), f(V, this, H).call(this, g.PIP_AVAILABLE, "")), p(R, this).on("on picture in picture change", (e) => {
2358
+ e ? f(V, this, H).call(this, g.IS_PIP, "") : f(V, this, U).call(this, g.IS_PIP);
2359
+ }));
2360
+ }
2361
+ function Vi() {
2362
+ var e;
2363
+ if (!p(R, this)) return;
2364
+ let t = null;
2365
+ p(I, this) === p(L, this) && p(L, this) ? t = p(L, this).videoElement : ((e = p(F, this)) == null ? void 0 : e.mediaElement) instanceof HTMLVideoElement && (t = p(F, this).mediaElement), t && t !== p(R, this).videoElement && (p(B, this).debug("Updating PIP target to", p(I, this) === p(L, this) ? "HLS" : "Vindral"), p(R, this).unload(), m(R, this, new qn(t)), p(R, this).on("on picture in picture change", (e) => {
2366
+ e ? f(V, this, H).call(this, g.IS_PIP, "") : f(V, this, U).call(this, g.IS_PIP);
2367
+ }));
2368
+ }
2369
+ function Hi(e) {
2370
+ let t = !Ln.isFullscreenApiSupported(this) && Ln.isFullscreenApiSupported(e.mediaElement) ? e.mediaElement : this;
2371
+ m(Gr, this, new Ln(t)), p(Gr, this).on("on fullscreen change", (e) => {
2372
+ e ? f(V, this, H).call(this, g.FULLSCREEN, "") : f(V, this, U).call(this, g.FULLSCREEN);
2373
+ });
2374
+ }
2375
+ function Ui() {
2376
+ var e;
2377
+ p(L, this) && (m(Kr, this, !Ln.isFullscreenApiSupported(this) && Ln.isFullscreenApiSupported((e = p(L, this)) == null ? void 0 : e.videoElement) ? new Ln(p(L, this).videoElement) : new Ln(this)), p(Kr, this).on("on fullscreen change", (e) => {
2378
+ e ? f(V, this, H).call(this, g.FULLSCREEN, "") : f(V, this, U).call(this, g.FULLSCREEN);
2379
+ }));
2380
+ }
2381
+ function Wi() {
2382
+ return this.hasAttribute(g.TIMESHIFT_POSITION) ? p(Kr, this) : p(Gr, this);
2383
+ }
2384
+ function Gi(e) {
2385
+ m(Jr, this, new Ee({
2386
+ background: p(Xr, this),
2387
+ receiverApplicationId: p(Yr, this),
2388
+ options: e.getCastOptions()
2389
+ })), p(Jr, this).init().then(() => {
2390
+ var e, t, n;
2391
+ f(V, this, H).call(this, g.CAST_AVAILABLE, ""), (e = p(Jr, this)) == null || e.on("connected", f(V, this, Ki).bind(this)), (t = p(Jr, this)) == null || t.on("resumed", f(V, this, Ki).bind(this)), (n = p(Jr, this)) == null || n.on("disconnected", f(V, this, qi).bind(this));
2392
+ }).catch((e) => {
2393
+ p(B, this).warn("Failed to initialize CastSender", e);
2394
+ });
2395
+ }
2396
+ function Ki() {
2397
+ var e, t;
2398
+ f(V, this, H).call(this, g.IS_CASTING, "");
2399
+ let n = (e = (t = p(Jr, this)) == null ? void 0 : t.getReceiverName()) == null ? "device" : e;
2400
+ f(V, this, H).call(this, g.CAST_RECEIVER_NAME, n);
2401
+ }
2402
+ function qi() {
2403
+ f(V, this, U).call(this, g.IS_CASTING), f(V, this, U).call(this, g.CAST_RECEIVER_NAME);
2404
+ }
2405
+ function Ji(e) {
2406
+ var t;
2407
+ (t = p(qr, this)) == null || t.unload();
2408
+ let n = e.getCastOptions();
2409
+ m(qr, this, new In({
2410
+ url: n.url,
2411
+ channelId: n.channelId,
2412
+ authenticationToken: n.authenticationToken,
2413
+ container: this
2414
+ })), p(qr, this).once("available", () => {
2415
+ f(V, this, H).call(this, g.AIRPLAY_AVAILABLE, "");
2416
+ }), p(qr, this).on("connected", () => {
2417
+ f(V, this, H).call(this, g.IS_AIRPLAYING, "");
2418
+ }), p(qr, this).on("disconnected", () => {
2419
+ f(V, this, U).call(this, g.IS_AIRPLAYING);
2420
+ });
2421
+ }
2422
+ function Yi(e) {
2423
+ var t;
2424
+ if ((t = p(z, this)) == null || t.unload(), !n()) {
2425
+ if (e.audioNode) m(z, this, new Xn(e.audioNode));
2426
+ else if (e.mediaElement instanceof HTMLMediaElement) m(z, this, new Xn(e.mediaElement));
2427
+ else return;
2428
+ p(z, this).on("on decibel change", (e) => {
2429
+ f(V, this, H).call(this, g.VOLUME_LEVEL, JSON.stringify(e));
2430
+ }), f(V, this, H).call(this, g.VOLUME_LEVEL, JSON.stringify({
2431
+ left: null,
2432
+ right: null
2433
+ })), (!p(z, this).isMediaElementSource || !this.hasAttribute(g.MUTED)) && p(z, this).start();
2434
+ }
2435
+ }
2436
+ function Xi() {
2437
+ let e = () => (customElements.get("vindral-debug-panel") || import("./CYHlcwl-.js").then((e) => e.n).then(({ registerDebugComponents: e }) => e()), this.setAttribute(g.DEBUG_PANEL_OPEN, ""), p(F, this));
2438
+ window._vindralDebug = e, m($r, this, e);
2439
+ }
2440
+ function Zi() {
2441
+ let e = window;
2442
+ p($r, this) && e._vindralDebug === p($r, this) && delete e._vindralDebug, m($r, this, null);
2443
+ }
2444
+ function Qi(e) {
2445
+ e.pointerType !== "mouse" && e.timeStamp - p(xi, this) < 250 || (f(V, this, aa).call(this), p(Ir, this) && clearTimeout(p(Ir, this)), e.target instanceof HTMLElement && ([this, p(Lr, this)].includes(e.target) || e.target.localName === "vindral-scroll-overlay") && f(V, this, oa).call(this));
2446
+ }
2447
+ function $i(e) {
2448
+ let t = this.hasAttribute(g.USER_INTERACTING);
2449
+ e.pointerType === "touch" && e.target instanceof HTMLElement ? [this, p(Lr, this)].includes(e.target) && t ? f(V, this, ia).call(this) : f(V, this, oa).call(this) : e.composedPath().some((e) => e instanceof HTMLElement && ["vindral-play-button"].includes(e == null ? void 0 : e.localName)) && f(V, this, oa).call(this);
2450
+ }
2451
+ function ea(e) {
2452
+ !p(Gr, this) || e.target instanceof x || e.target instanceof Re || e.target instanceof jr || (this.hasAttribute(g.FULLSCREEN) ? this.removeAttribute(g.FULLSCREEN) : this.setAttribute(g.FULLSCREEN, ""));
2453
+ }
2454
+ function ta(e) {
2455
+ this.hasAttribute(g.USER_INTERACTING) || f(V, this, oa).call(this);
2456
+ }
2457
+ function na(e) {
2458
+ var t;
2459
+ let { metaKey: n, altKey: r, key: i } = e;
2460
+ if (n || r || !Nr.includes(i)) return;
2461
+ let a = (t = e.target) == null ? void 0 : t.keysUsed;
2462
+ if (!(Array.isArray(a) && a.includes(i)) && !e.composedPath().some((e) => {
2463
+ let t = e == null ? void 0 : e.keysUsed;
2464
+ return Array.isArray(t) && t.includes(i);
2465
+ })) switch (i) {
2466
+ case "f":
2467
+ this.hasAttribute(g.FULLSCREEN) ? this.removeAttribute(g.FULLSCREEN) : this.setAttribute(g.FULLSCREEN, "");
2468
+ break;
2469
+ case "m":
2470
+ this.hasAttribute(g.MUTED) ? this.removeAttribute(g.MUTED) : this.setAttribute(g.MUTED, "");
2471
+ break;
2472
+ case "ArrowDown":
2473
+ var o;
2474
+ (o = this.querySelector("vindral-scroll-overlay")) == null || o.setAttribute("open", "");
2475
+ break;
2476
+ }
2477
+ }
2478
+ function ra() {
2479
+ var e = this;
2480
+ return t(function* () {
2481
+ if (!p(F, e) || !p(Hr, e)) return;
2482
+ let t = Date.now();
2483
+ if (p(Oi, e) && t - p(Oi, e) < 1e4) p(B, e).debug("Skipping channel update, last update was less than 10 seconds ago.");
2484
+ else {
2485
+ m(Oi, e, t);
2486
+ let n = yield p(F, e).getApiClient().getChannels(p(Hr, e));
2487
+ f(V, e, H).call(e, g.CHANNELS, JSON.stringify(n));
2488
+ }
2489
+ m(Zr, e, window.setTimeout(() => void f(V, e, ra).call(e), 1e4));
2490
+ })();
2491
+ }
2492
+ function ia() {
2493
+ !this.hasAttribute(g.USER_INTERACTING) || this.hasAttribute(g.UI_LOCKED) || (this.dispatchEvent(new CustomEvent("user-interacting", {
2494
+ bubbles: !0,
2495
+ composed: !0,
2496
+ detail: { active: !1 }
2497
+ })), this.removeAttribute(g.USER_INTERACTING));
2498
+ }
2499
+ function aa() {
2500
+ this.hasAttribute(g.USER_INTERACTING) || requestAnimationFrame(() => {
2501
+ this.setAttribute(g.USER_INTERACTING, ""), this.dispatchEvent(new CustomEvent("user-interacting", {
2502
+ bubbles: !0,
2503
+ composed: !0,
2504
+ detail: { active: !0 }
2505
+ }));
2506
+ });
2507
+ }
2508
+ function oa() {
2509
+ f(V, this, aa).call(this), p(Ir, this) && clearTimeout(p(Ir, this)), p(Fr, this) && m(Ir, this, self.setTimeout(() => {
2510
+ f(V, this, ia).call(this);
2511
+ }, p(Fr, this)));
2512
+ }
2513
+ function sa() {
2514
+ var e;
2515
+ let t = getComputedStyle(this).getPropertyValue("--vindral-subtitle-offset") || "0px";
2516
+ (e = p(F, this)) == null || (e = e.mediaElement) == null || e.style.setProperty("--vindral-subtitle-offset", t);
2517
+ }
2518
+ function ca() {
2519
+ var e;
2520
+ f(V, this, Vi).call(this), f(V, this, fa).call(this), (e = p(R, this)) == null || e.request().catch((e) => {
2521
+ p(B, this).warn("Failed to enter picture in picture:", e);
2522
+ });
2523
+ }
2524
+ function la() {
2525
+ var e;
2526
+ (e = p(R, this)) == null || e.exit().catch((e) => {
2527
+ p(B, this).warn("Failed to exit picture in picture:", e);
2528
+ });
2529
+ }
2530
+ function ua() {
2531
+ let e = f(V, this, Wi).call(this);
2532
+ if (!e) {
2533
+ console.warn("No fullscreen target available"), this.setAttribute(g.FULLSCREEN_FALLBACK, ""), f(V, this, H).call(this, g.FULLSCREEN, "");
2534
+ return;
2535
+ }
2536
+ e != null && e.isFullscreenApiSupported() ? (f(V, this, fa).call(this), e == null || e.request().then(() => {
2537
+ p(ki, this).call(this);
2538
+ }).catch((e) => {
2539
+ p(B, this).warn("Failed to enter fullscreen:", e);
2540
+ })) : (this.setAttribute(g.FULLSCREEN_FALLBACK, ""), f(V, this, H).call(this, g.FULLSCREEN, ""));
2541
+ }
2542
+ function da() {
2543
+ let e = f(V, this, Wi).call(this);
2544
+ e != null && e.isFullscreenApiSupported() ? e == null || e.exit().then(() => {
2545
+ p(Ai, this).call(this);
2546
+ }).catch((e) => {
2547
+ p(B, this).warn("Failed to exit fullscreen:", e);
2548
+ }) : (this.removeAttribute(g.FULLSCREEN_FALLBACK), f(V, this, U).call(this, g.FULLSCREEN));
2549
+ }
2550
+ function fa() {
2551
+ p(F, this) && p(F, this).emitter.emit("ios-hack: reset size");
2552
+ }
2553
+ function pa() {
2554
+ return this.hasAttribute(g.DEBUG_PANEL_OPEN);
2555
+ }
2556
+ function ma() {
2557
+ f(V, this, pa).call(this) ? f(V, this, ha).call(this) : f(V, this, ga).call(this);
2558
+ }
2559
+ function ha() {
2560
+ p(ji, this) === null && (f(V, this, _a).call(this), m(ji, this, window.setInterval(() => f(V, this, _a).call(this), 1e3)));
2561
+ }
2562
+ function ga() {
2563
+ p(ji, this) && (clearInterval(p(ji, this)), m(ji, this, null)), this.removeAttribute(g.DRIFT), f(V, this, U).call(this, g.DRIFT), f(V, this, U).call(this, g.PLAYBACK_LATENCY), f(V, this, U).call(this, g.CONNECTION_STATE);
2564
+ }
2565
+ function _a() {
2566
+ if (!p(F, this)) return;
2567
+ try {
2568
+ let e = p(F, this).getStatistics().drift;
2569
+ if (typeof e == "number") {
2570
+ let t = Math.round(e * 10) / 10;
2571
+ f(V, this, H).call(this, g.DRIFT, String(t));
2572
+ }
2573
+ } catch (e) {}
2574
+ let e = p(F, this).targetBufferTime;
2575
+ typeof e == "number" && f(V, this, H).call(this, g.TARGET_BUFFER_TIME, String(e));
2576
+ let t = p(F, this).playbackLatency;
2577
+ typeof t == "number" ? f(V, this, H).call(this, g.PLAYBACK_LATENCY, String(t)) : f(V, this, U).call(this, g.PLAYBACK_LATENCY), f(V, this, H).call(this, g.CONNECTION_STATE, p(F, this).connectionState);
2578
+ }
2579
+ function H(e, t) {
2580
+ var n;
2581
+ (n = p(Pr, this).get(e)) == null || n.forEach((n) => n.setAttribute(e, t));
2582
+ }
2583
+ function U(e) {
2584
+ var t;
2585
+ (t = p(Pr, this).get(e)) == null || t.forEach((t) => t.removeAttribute(e));
2586
+ }
2587
+ e(Mi, "observedAttributes", [
2588
+ ...pe,
2589
+ "url",
2590
+ "edge-url",
2591
+ "target-buffer-time",
2592
+ "cast-receiver-id",
2593
+ "cast-background",
2594
+ "log-level",
2595
+ "max-size",
2596
+ "min-buffer-time",
2597
+ "max-buffer-time",
2598
+ "max-audio-bit-rate",
2599
+ "max-initial-bit-rate",
2600
+ "burst-enabled",
2601
+ "mse-enabled",
2602
+ "mse-opus-enabled",
2603
+ "ios-background-play-enabled",
2604
+ "ios-wake-lock-enabled",
2605
+ "stream-to-media-element-enabled",
2606
+ "ios-media-element-enabled",
2607
+ "abr-enabled",
2608
+ "size-based-resolution-cap-enabled",
2609
+ "telemetry-enabled",
2610
+ "video-codecs",
2611
+ "poster",
2612
+ "advanced",
2613
+ "drm-headers",
2614
+ "drm-queryparams",
2615
+ "drm-widevine-video-robustness",
2616
+ "drm-widevine-audio-robustness",
2617
+ "drm-playready-video-robustness",
2618
+ "drm-playready-audio-robustness",
2619
+ "webtransport-enabled",
2620
+ "webcodecs-hardware-acceleration",
2621
+ "decoders",
2622
+ "offscreen-canvas-enabled",
2623
+ "reconnect-retries",
2624
+ "auto-instance-enabled",
2625
+ "language"
2626
+ ]);
2627
+ var va = { _: "https://lb.cdn.vindral.com" }, ya, ba = document.createElement("template");
2628
+ ba.innerHTML = `
2629
+ <style>
2630
+ :host {
2631
+ display: var(--fullscreen-button-display);
2632
+ }
2633
+
2634
+ :host([${g.FULLSCREEN}]) slot[name="enter"] {
2635
+ display: none !important;
2636
+ }
2637
+
2638
+ :host(:not([${g.FULLSCREEN}])) slot[name="exit"] {
2639
+ display: none !important;
2640
+ }
2641
+ </style>
2642
+
2643
+ <slot name="icon">
2644
+ <slot name="enter">
2645
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-maximize"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 8v-2a2 2 0 0 1 2 -2h2" /><path d="M4 16v2a2 2 0 0 0 2 2h2" /><path d="M16 4h2a2 2 0 0 1 2 2v2" /><path d="M16 20h2a2 2 0 0 0 2 -2v-2" /></svg>
2646
+ </slot>
2647
+ <slot name="exit">
2648
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-minimize"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 19v-2a2 2 0 0 1 2 -2h2" /><path d="M15 5v2a2 2 0 0 0 2 2h2" /><path d="M5 15h2a2 2 0 0 1 2 2v2" /><path d="M5 9h2a2 2 0 0 0 2 -2v-2" /></svg>
2649
+ </slot>
2650
+ </slot>
2651
+ `;
2652
+ var xa = class extends x {
2653
+ constructor() {
2654
+ var e;
2655
+ super(), (e = this.shadowRoot) == null || e.appendChild(ba.content.cloneNode(!0));
2656
+ }
2657
+ connectedCallback() {
2658
+ super.connectedCallback(), this.setAttribute("aria-label", this.isFullscreen ? "Exit fullscreen" : "Enter fullscreen");
2659
+ }
2660
+ disconnectedCallback() {
2661
+ super.disconnectedCallback();
2662
+ }
2663
+ attributeChangedCallback(e, t, n) {
2664
+ super.attributeChangedCallback(e, t, n), e === g.FULLSCREEN && this.setAttribute("aria-label", this.isFullscreen ? "Exit fullscreen" : "Enter fullscreen");
2665
+ }
2666
+ set isFullscreen(e) {
2667
+ e ? this.setAttribute(g.FULLSCREEN, "") : this.removeAttribute(g.FULLSCREEN);
2668
+ }
2669
+ get isFullscreen() {
2670
+ return this.hasAttribute(g.FULLSCREEN);
2671
+ }
2672
+ handleClick(e) {
2673
+ let t = this.isFullscreen ? _.EXIT_FULLSCREEN : _.ENTER_FULLSCREEN;
2674
+ this.dispatchEvent(new CustomEvent(t, {
2675
+ bubbles: !0,
2676
+ composed: !0
2677
+ }));
2678
+ }
2679
+ };
2680
+ ya = xa, e(xa, "observedAttributes", [...y(ya, "observedAttributes", ya), g.FULLSCREEN]);
2681
+ //#endregion
2682
+ //#region ../../libs/player-next/src/components/LanguageMenu.ts
2683
+ var Sa, Ca = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M4 5h7\" /><path d=\"M9 3v2c0 4.418 -2.239 8 -5 8\" /><path d=\"M5 9c0 2.144 2.952 3.908 6.7 4\" /><path d=\"M12 20l4 -9l4 9\" /><path d=\"M19.1 18h-6.2\" /></svg>\n", wa = document.createElement("template");
2684
+ wa.innerHTML = `
2685
+ <style>
2686
+ :host(:not([hidden])) {
2687
+ display: var(--language-menu-display);
2688
+ }
2689
+ </style>
2690
+
2691
+ <slot name="button">${Ca}</slot>
2692
+ <slot name="listbox" hidden>
2693
+ <vindral-language-menu-list id="listbox" part="listbox"></vindral-language-menu-list>
2694
+ </slot>
2695
+ `;
2696
+ var Ta = /* @__PURE__ */ new WeakSet(), Ea = class extends Re {
2697
+ constructor() {
2698
+ var e, t, n, r;
2699
+ super(), h(this, Ta), (e = this.shadowRoot) == null || e.appendChild(wa.content.cloneNode(!0)), this.button = (t = this.shadowRoot) == null ? void 0 : t.querySelector("slot[name=button]"), this.listbox = (n = this.shadowRoot) == null ? void 0 : n.querySelector("[part=listbox]"), this.listboxSlot = (r = this.shadowRoot) == null ? void 0 : r.querySelector("slot[name=listbox]");
2700
+ }
2701
+ connectedCallback() {
2702
+ super.connectedCallback(), f(Ta, this, Da).call(this), this.setAttribute("aria-label", "Languages");
2703
+ }
2704
+ attributeChangedCallback(e, t, n) {
2705
+ super.attributeChangedCallback(e, t, n), (e === g.LANGUAGES || e === g.TEXT_TRACKS) && f(Ta, this, Da).call(this);
2706
+ }
2707
+ };
2708
+ Sa = Ea;
2709
+ function Da() {
2710
+ let e = (e) => (e ? JSON.parse(e) : []).length < 2, t = e(this.getAttribute(g.LANGUAGES)), n = e(this.getAttribute(g.TEXT_TRACKS));
2711
+ t && n ? this.setAttribute("hidden", "") : this.removeAttribute("hidden");
2712
+ }
2713
+ e(Ea, "observedAttributes", [
2714
+ ...y(Sa, "observedAttributes", Sa),
2715
+ g.LANGUAGES,
2716
+ g.TEXT_TRACKS
2717
+ ]);
2718
+ //#endregion
2719
+ //#region ../../libs/player-next/src/components/LanguageMenuList.ts
2720
+ var Oa = document.createElement("template");
2721
+ Oa.innerHTML = `
2722
+ <style>
2723
+ :host {
2724
+ font: inherit;
2725
+ cursor: default;
2726
+ padding: var(--padding-2) !important;
2727
+ padding-top: var(--padding-3) !important;
2728
+ border-radius: 0.25em;
2729
+ position: absolute;
2730
+ min-width: 140px !important;
2731
+ background: var(--bg-subtle);
2732
+ z-index: 1;
2733
+ overflow: auto;
2734
+ display: flex;
2735
+ flex-direction: row;
2736
+ gap: var(--padding-3);
2737
+ }
2738
+
2739
+ :host([list-position="top"]) {
2740
+ bottom: calc(100% + 0.5em);
2741
+ transform: translate(-50%);
2742
+ }
2743
+
2744
+ :host([list-position="bottom"]) {
2745
+ top: calc(100% + 0.5em);
2746
+ }
2747
+
2748
+ :host::-webkit-scrollbar {
2749
+ width: 5px;
2750
+ padding-right: 5px;
2751
+ }
2752
+
2753
+ :host::-webkit-scrollbar-thumb {
2754
+ background-color: var(--fg-extra-subtle);
2755
+ border-radius: 10px;
2756
+ border: 0;
2757
+ }
2758
+
2759
+ :host::-webkit-scrollbar-track {
2760
+ border-radius: 10px;
2761
+ background-color: transparent;
2762
+ }
2763
+
2764
+ .menu {
2765
+ display: grid;
2766
+ gap: var(--padding-1);
2767
+ }
2768
+
2769
+ .menu-container {
2770
+ display: flex;
2771
+ flex-direction: column;
2772
+ flex: 1;
2773
+ }
2774
+
2775
+ [role="menuitem"] {
2776
+ position: relative;
2777
+ cursor: pointer;
2778
+ display: flex;
2779
+ align-items: center;
2780
+ height: 44px;
2781
+ padding: 0 var(--padding-3);
2782
+ padding-left: var(--padding-6);
2783
+ border-radius: 4px;
2784
+ font-size: 14px;
2785
+ }
2786
+
2787
+ [role="menuitem"]:hover {
2788
+ background: var(--bg-component-hover);
2789
+ }
2790
+
2791
+ [role="menuitem"][aria-selected="true"] {
2792
+ background: var(--bg-component-active);
2793
+ }
2794
+
2795
+ [role="menuitem"][aria-selected="true"]::before {
2796
+ content: url("data:image/svg+xml,%0A%20%20%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2078.369%2078.369%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M78.049%2019.015%2029.458%2067.606a1.094%201.094%200%200%201-1.548%200L.32%2040.015a1.094%201.094%200%200%201%200-1.547l6.704-6.704a1.095%201.095%200%200%201%201.548%200l20.113%2020.112%2041.113-41.113a1.095%201.095%200%200%201%201.548%200l6.703%206.704a1.094%201.094%200%200%201%200%201.548z%22%2F%3E%3C%2Fsvg%3E%0A");
2797
+ position: absolute;
2798
+ left: var(--padding-3);
2799
+ top: calc(50% - 8px);
2800
+ }
2801
+
2802
+ [role="menuitem"]:focus-visible {
2803
+ box-shadow: inset 0 0 0 2px var(--fg-strong);
2804
+ outline: 0;
2805
+ }
2806
+
2807
+ .heading {
2808
+ text-transform: uppercase;
2809
+ margin-bottom: var(--padding-2);
2810
+ padding: 0 var(--padding-3);
2811
+ font-size: 11px;
2812
+ font-weight: bold;
2813
+ }
2814
+
2815
+ :host([${g.LANGUAGES}="[]"]) #languages,
2816
+ :host(:not([${g.LANGUAGES}])) #languages {
2817
+ display: none;
2818
+ }
2819
+
2820
+ :host([${g.TEXT_TRACKS}="[]"]) #text-tracks,
2821
+ :host(:not([${g.TEXT_TRACKS}])) #text-tracks {
2822
+ display: none;
2823
+ }
2824
+ </style>
2825
+
2826
+ <div id="languages" class="menu-container">
2827
+ <div class="heading">Language</div>
2828
+ <div class="menu"></div>
2829
+ </div>
2830
+ <div id="text-tracks" class="menu-container">
2831
+ <div class="heading">Subtitles</div>
2832
+ <div class="menu"></div>
2833
+ </div>
2834
+ `;
2835
+ var ka = /* @__PURE__ */ new WeakMap(), Aa = /* @__PURE__ */ new WeakMap(), ja = /* @__PURE__ */ new WeakMap(), Ma = /* @__PURE__ */ new WeakMap(), Na = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), Pa = /* @__PURE__ */ new WeakMap(), Fa = /* @__PURE__ */ new WeakMap(), Ia = /* @__PURE__ */ new WeakMap(), La = /* @__PURE__ */ new WeakMap(), Ra = /* @__PURE__ */ new WeakMap(), za = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakSet(), Ba = class extends HTMLElement {
2836
+ constructor() {
2837
+ super(), h(this, G), d(this, ka, []), d(this, Aa, []), d(this, ja, void 0), d(this, Ma, void 0), d(this, Na, []), d(this, W, []), d(this, Pa, null), d(this, Fa, null), d(this, Ia, null), d(this, La, null), d(this, Ra, null), d(this, za, null), e(this, "handleEvent", (e) => {
2838
+ switch (e.type) {
2839
+ case "keydown":
2840
+ f(G, this, Ya).call(this, e);
2841
+ break;
2842
+ }
2843
+ }), this.attachShadow({ mode: "open" }).appendChild(Oa.content.cloneNode(!0));
2844
+ }
2845
+ connectedCallback() {
2846
+ let e = this.getRootNode();
2847
+ if (e instanceof ShadowRoot) {
2848
+ var t, n, r;
2849
+ m(Ia, this, e.host.closest("vindral-controller")), (t = p(Ia, this)) == null || t.connectListener(this), m(Pa, this, (n = this.shadowRoot) == null ? void 0 : n.querySelector("#languages .menu")), m(Fa, this, (r = this.shadowRoot) == null ? void 0 : r.querySelector("#text-tracks .menu")), f(G, this, Va).call(this), f(G, this, Ha).call(this), m(La, this, e.host), this.addEventListener("keydown", this);
2850
+ }
2851
+ }
2852
+ disconnectedCallback() {
2853
+ this.removeEventListener("keydown", this);
2854
+ }
2855
+ attributeChangedCallback(e, t, n) {
2856
+ t !== n && (e === g.LANGUAGES && n && (this.languages = JSON.parse(n)), e === g.TEXT_TRACKS && n && (this.textTracks = JSON.parse(n)), e === g.LANGUAGE && (this.language = n), e === g.TEXT_TRACK && (this.textTrack = n));
2857
+ }
2858
+ set languages(e) {
2859
+ m(ka, this, e), f(G, this, Wa).call(this), f(G, this, Ka).call(this);
2860
+ }
2861
+ set textTracks(e) {
2862
+ m(Aa, this, e), f(G, this, Ua).call(this), f(G, this, qa).call(this);
2863
+ }
2864
+ set language(e) {
2865
+ m(ja, this, e), f(G, this, Ka).call(this);
2866
+ }
2867
+ set textTrack(e) {
2868
+ m(Ma, this, e), f(G, this, qa).call(this);
2869
+ }
2870
+ get keysUsed() {
2871
+ return [
2872
+ "Enter",
2873
+ "Escape",
2874
+ "Tab",
2875
+ " ",
2876
+ "ArrowDown",
2877
+ "ArrowUp",
2878
+ "ArrowLeft",
2879
+ "ArrowRight",
2880
+ "Home",
2881
+ "End"
2882
+ ];
2883
+ }
2884
+ focus() {
2885
+ p(Ra, this) ? p(Ra, this).focus() : p(za, this) && p(za, this).focus();
2886
+ }
2887
+ };
2888
+ function Va() {
2889
+ new IntersectionObserver((e) => {
2890
+ e.forEach((e) => {
2891
+ if (e.intersectionRatio !== 1) if (e.intersectionRatio > 0) {
2892
+ let t = this.offsetHeight * e.intersectionRatio - 24;
2893
+ this.style.height = `${t}px`;
2894
+ } else this.style.height = "auto";
2895
+ });
2896
+ }, {
2897
+ root: p(Ia, this),
2898
+ threshold: 0
2899
+ }).observe(this);
2900
+ }
2901
+ function Ha() {
2902
+ p(Pa, this) && (f(G, this, Wa).call(this), f(G, this, Ka).call(this)), p(Fa, this) && (f(G, this, Ua).call(this), f(G, this, qa).call(this));
2903
+ }
2904
+ function Ua() {
2905
+ p(Fa, this).innerHTML = "", m(W, this, []);
2906
+ let e = f(G, this, Ga).call(this, "Off", "textTrack", void 0);
2907
+ p(Fa, this).appendChild(e), p(W, this).push({
2908
+ element: e,
2909
+ value: void 0
2910
+ }), p(Aa, this).forEach((e) => {
2911
+ let t = f(G, this, Ga).call(this, e, "textTrack", e);
2912
+ p(Fa, this).appendChild(t), p(W, this).push({
2913
+ element: t,
2914
+ value: e
2915
+ });
2916
+ }), f(G, this, qa).call(this);
2917
+ }
2918
+ function Wa() {
2919
+ p(Pa, this).innerHTML = "", m(Na, this, []), p(ka, this).forEach((e) => {
2920
+ let t = f(G, this, Ga).call(this, e, "language", e);
2921
+ p(Pa, this).appendChild(t), p(Na, this).push({
2922
+ element: t,
2923
+ value: e
2924
+ });
2925
+ }), f(G, this, Ka).call(this);
2926
+ }
2927
+ function Ga(e, t, n) {
2928
+ let r = document.createElement("div");
2929
+ return r.setAttribute("role", "menuitem"), r.textContent = e, r.addEventListener("click", () => f(G, this, Ja).call(this, n, t)), r;
2930
+ }
2931
+ function Ka() {
2932
+ p(Ra, this) && (p(Ra, this).removeAttribute("aria-selected"), p(Ra, this).tabIndex = -1);
2933
+ let e = p(Na, this).find((e) => e.value === p(ja, this));
2934
+ e && (e.element.setAttribute("aria-selected", "true"), e.element.tabIndex = 0, m(Ra, this, e.element));
2935
+ }
2936
+ function qa() {
2937
+ p(za, this) && (p(za, this).removeAttribute("aria-selected"), p(za, this).tabIndex = -1);
2938
+ let e = p(W, this).find((e) => e.value === p(Ma, this));
2939
+ if (e) e.element.setAttribute("aria-selected", "true"), e.element.tabIndex = 0, m(za, this, e.element);
2940
+ else {
2941
+ let e = p(W, this).find((e) => e.value === void 0);
2942
+ e && (e.element.setAttribute("aria-selected", "true"), e.element.tabIndex = 0, m(za, this, e.element));
2943
+ }
2944
+ }
2945
+ function Ja(e, t) {
2946
+ this.dispatchEvent(new Event("change", {
2947
+ bubbles: !0,
2948
+ composed: !0
2949
+ }));
2950
+ let n = t === "language" ? _.SET_LANGUAGE : _.SET_TEXT_TRACK;
2951
+ this.dispatchEvent(new CustomEvent(n, {
2952
+ bubbles: !0,
2953
+ composed: !0,
2954
+ detail: e
2955
+ }));
2956
+ }
2957
+ function Ya(e) {
2958
+ let { key: t, ctrlKey: n, altKey: r, metaKey: i } = e;
2959
+ if (!(n || r || i) && this.keysUsed.includes(t)) if (e.preventDefault(), e.stopPropagation(), t === "Tab" || t === "Escape") {
2960
+ var a;
2961
+ (a = p(La, this)) == null || a.hide();
2962
+ } else if (t === "Enter" || t === " ") {
2963
+ var o;
2964
+ (o = f(G, this, Qa).call(this)) == null || (o = o.element) == null || o.click();
2965
+ } else f(G, this, Xa).call(this, e);
2966
+ }
2967
+ function Xa(e) {
2968
+ var t;
2969
+ let { key: n } = e, r = [...p(Na, this), ...p(W, this)], i = (t = f(G, this, Qa).call(this)) == null ? r[0] : t;
2970
+ if (!i) return;
2971
+ let a = r.indexOf(i), o = Math.max(0, a);
2972
+ n === "ArrowDown" ? o++ : n === "ArrowUp" ? o-- : n === "ArrowLeft" ? o = f(G, this, Za).call(this, a, "left") : n === "ArrowRight" ? o = f(G, this, Za).call(this, a, "right") : e.key === "Home" ? o = 0 : e.key === "End" && (o = r.length - 1), o < 0 && (o = r.length - 1), o > r.length - 1 && (o = 0);
2973
+ let s = r[o];
2974
+ s && (f(G, this, $a).call(this, s.value), s.element.focus());
2975
+ }
2976
+ function Za(e, t) {
2977
+ let n = p(Na, this).length, r = p(W, this).length;
2978
+ return t === "left" ? e < n ? n + r - 1 : e - n - 1 : e >= n ? 0 : e + n;
2979
+ }
2980
+ function Qa() {
2981
+ return [...p(Na, this), ...p(W, this)].find((e) => e.element.tabIndex === 0);
2982
+ }
2983
+ function $a(e) {
2984
+ for (let t of [...p(Na, this), ...p(W, this)]) t.element.tabIndex = t.value === e ? 0 : -1;
2985
+ }
2986
+ e(Ba, "observedAttributes", [
2987
+ g.LANGUAGES,
2988
+ g.TEXT_TRACKS,
2989
+ g.LANGUAGE,
2990
+ g.TEXT_TRACK
2991
+ ]);
2992
+ //#endregion
2993
+ //#region ../../libs/player-next/src/components/LiveButton.ts
2994
+ var eo, to = document.createElement("template");
2995
+ to.innerHTML = "\n <style>\n :host {\n display: var(--live-button-display, flex);\n color: var(--vindral-fg-strong, #eee);\n border: 1px solid transparent !important;\n font-size: 12px;\n font-weight: bold;\n cursor: pointer;\n transition: all 0.2s;\n min-width: 50px !important;\n text-align: center;\n align-items: center;\n justify-content: center;\n }\n\n .live-text {\n display: inline-block;\n vertical-align: middle;\n margin-left: 4px;\n }\n\n slot[name=\"icon\"] svg {\n width: 5px;\n height: 5px;\n flex-shrink: 0;\n }\n\n .live-dot {\n fill: var(--vindral-fg-subtle, #b4b4b4);\n transition: fill 0.2s;\n transform-origin: center;\n }\n\n /* Red pulsing dot when live */\n :host(:not([timeshift-position])) .live-dot {\n fill: #ff0000;\n animation: pulse-dot 2s ease-in-out infinite alternate;\n }\n\n @keyframes pulse-dot {\n 0% {\n opacity: 0.8;\n transform: scale(0.9);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n }\n\n :host([disabled]) {\n cursor: default;\n opacity: 1;\n }\n\n :host([hidden]) {\n display: none !important;\n }\n </style>\n\n <slot name=\"icon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"5\" height=\"5\" viewBox=\"0 0 5 5\" fill=\"currentColor\">\n <circle cx=\"2.5\" cy=\"2.5\" r=\"2.5\" class=\"live-dot\"/>\n </svg>\n</slot>\n <span class=\"live-text\">LIVE</span>\n";
2996
+ var no = class extends x {
2997
+ constructor() {
2998
+ var e;
2999
+ super(), (e = this.shadowRoot) == null || e.appendChild(to.content.cloneNode(!0));
3000
+ }
3001
+ connectedCallback() {
3002
+ super.connectedCallback(), this.updateState();
3003
+ }
3004
+ disconnectedCallback() {
3005
+ super.disconnectedCallback();
3006
+ }
3007
+ attributeChangedCallback(e, t, n) {
3008
+ super.attributeChangedCallback(e, t, n), (e === g.TIMESHIFT_POSITION || e === g.DURATION) && this.updateState();
3009
+ }
3010
+ updateState() {
3011
+ if (!this.hasAttribute(g.DURATION)) {
3012
+ this.setAttribute("hidden", ""), this.removeAttribute("aria-label"), this.removeAttribute("disabled");
3013
+ return;
3014
+ }
3015
+ this.removeAttribute("hidden"), this.isLive ? (this.setAttribute("aria-label", "Currently live"), this.setAttribute("disabled", "")) : (this.setAttribute("aria-label", "Go live"), this.removeAttribute("disabled"));
3016
+ }
3017
+ get isLive() {
3018
+ return !this.hasAttribute(g.TIMESHIFT_POSITION);
3019
+ }
3020
+ set isLive(e) {
3021
+ e ? this.removeAttribute(g.TIMESHIFT_POSITION) : this.setAttribute(g.TIMESHIFT_POSITION, "");
3022
+ }
3023
+ handleClick(e) {
3024
+ this.isLive || this.dispatchEvent(new CustomEvent(_.GO_LIVE, {
3025
+ bubbles: !0,
3026
+ composed: !0
3027
+ }));
3028
+ }
3029
+ };
3030
+ eo = no, e(no, "observedAttributes", [
3031
+ ...y(eo, "observedAttributes", eo),
3032
+ g.TIMESHIFT_POSITION,
3033
+ g.DURATION
3034
+ ]);
3035
+ //#endregion
3036
+ //#region ../../libs/player-next/src/components/MuteButton.ts
3037
+ var ro, io = document.createElement("template");
3038
+ io.innerHTML = `
3039
+ <style>
3040
+ :host {
3041
+ display: var(--mute-button-display);
3042
+ }
3043
+
3044
+ :host([${g.MUTED}]) slot[name="unmute"] {
3045
+ display: none !important;
3046
+ }
3047
+
3048
+ :host(:not([${g.MUTED}])) slot[name="mute"] {
3049
+ display: none !important;
3050
+ }
3051
+ </style>
3052
+
3053
+ <slot name="icon">
3054
+ <slot name="mute">
3055
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" <g fill="none" stroke="currentColor">
3056
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z" clip-rule="evenodd" />
3057
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2" />
3058
+ </g></svg>
3059
+ </slot>
3060
+ <slot name="unmute">
3061
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" <g fill="none" stroke="currentColor">
3062
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z" /></svg>
3063
+ </slot>
3064
+ </slot>
3065
+ `;
3066
+ var ao = class extends x {
3067
+ constructor() {
3068
+ var e;
3069
+ super(), (e = this.shadowRoot) == null || e.appendChild(io.content.cloneNode(!0));
3070
+ }
3071
+ connectedCallback() {
3072
+ super.connectedCallback(), this.setAttribute("aria-label", this.muted ? "UnMute" : "Mute");
3073
+ }
3074
+ disconnectedCallback() {
3075
+ super.disconnectedCallback();
3076
+ }
3077
+ attributeChangedCallback(e, t, n) {
3078
+ super.attributeChangedCallback(e, t, n), e === g.MUTED && this.setAttribute("aria-label", this.muted ? "UnMute" : "Mute");
3079
+ }
3080
+ set muted(e) {
3081
+ e ? this.setAttribute(g.MUTED, "") : this.removeAttribute(g.MUTED);
3082
+ }
3083
+ get muted() {
3084
+ return this.hasAttribute(g.MUTED);
3085
+ }
3086
+ handleClick(e) {
3087
+ let t = this.muted ? _.UNMUTE : _.MUTE;
3088
+ this.dispatchEvent(new CustomEvent(t, {
3089
+ bubbles: !0,
3090
+ composed: !0
3091
+ }));
3092
+ }
3093
+ };
3094
+ ro = ao, e(ao, "observedAttributes", [...y(ro, "observedAttributes", ro), g.MUTED]);
3095
+ //#endregion
3096
+ //#region ../../libs/player-next/src/components/PictureInPictureButton.ts
3097
+ var oo, so = document.createElement("template");
3098
+ so.innerHTML = `
3099
+ <style>
3100
+ :host {
3101
+ display: var(--pip-button-display);
3102
+ }
3103
+
3104
+ :host(:not([${g.PIP_AVAILABLE}])) {
3105
+ display: none !important;
3106
+ }
3107
+ </style>
3108
+ <slot name="icon">
3109
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M19 4a3 3 0 0 1 3 3v4a1 1 0 0 1 -2 0v-4a1 1 0 0 0 -1 -1h-14a1 1 0 0 0 -1 1v10a1 1 0 0 0 1 1h6a1 1 0 0 1 0 2h-6a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3z" /><path d="M20 13a2 2 0 0 1 2 2v3a2 2 0 0 1 -2 2h-5a2 2 0 0 1 -2 -2v-3a2 2 0 0 1 2 -2z" /></svg>
3110
+ </slot>
3111
+ `;
3112
+ var co = class extends x {
3113
+ constructor() {
3114
+ var e;
3115
+ super(), (e = this.shadowRoot) == null || e.appendChild(so.content.cloneNode(!0));
3116
+ }
3117
+ connectedCallback() {
3118
+ super.connectedCallback(), this.setAttribute("aria-label", this.isPictureInPictureActive ? "Exit picture in picture" : "Enter picture in picture");
3119
+ }
3120
+ disconnectedCallback() {
3121
+ super.disconnectedCallback();
3122
+ }
3123
+ attributeChangedCallback(e, t, n) {
3124
+ super.attributeChangedCallback(e, t, n), e === g.IS_PIP && this.setAttribute("aria-label", this.isPictureInPictureActive ? "Exit picture in picture" : "Enter picture in picture");
3125
+ }
3126
+ set isPictureInPictureActive(e) {
3127
+ e ? this.setAttribute(g.IS_PIP, "") : this.removeAttribute(g.IS_PIP);
3128
+ }
3129
+ get isPictureInPictureActive() {
3130
+ return this.hasAttribute(g.IS_PIP);
3131
+ }
3132
+ handleClick(e) {
3133
+ let t = this.isPictureInPictureActive ? _.EXIT_PIP : _.ENTER_PIP;
3134
+ this.dispatchEvent(new CustomEvent(t, {
3135
+ bubbles: !0,
3136
+ composed: !0
3137
+ }));
3138
+ }
3139
+ };
3140
+ oo = co, e(co, "observedAttributes", [
3141
+ ...y(oo, "observedAttributes", oo),
3142
+ g.IS_PIP,
3143
+ g.PIP_AVAILABLE
3144
+ ]);
3145
+ //#endregion
3146
+ //#region ../../libs/player-next/src/components/PlayButton.ts
3147
+ var lo, uo = document.createElement("template");
3148
+ uo.innerHTML = `
3149
+ <style>
3150
+ :host {
3151
+ display: var(--play-button-display);
3152
+ }
3153
+
3154
+ :host([${g.PAUSED}]) slot[name="pause"] {
3155
+ display: none !important;
3156
+ }
3157
+
3158
+ :host(:not([${g.PAUSED}])) slot[name="play"] {
3159
+ display: none !important;
3160
+ }
3161
+ </style>
3162
+
3163
+ <slot name="icon">
3164
+ <slot name="play">
3165
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 4v16a1 1 0 0 0 1.524 .852l13 -8a1 1 0 0 0 0 -1.704l-13 -8a1 1 0 0 0 -1.524 .852z" /></svg>
3166
+ </slot>
3167
+ <slot name="pause">
3168
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 4h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h2a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2z" /><path d="M17 4h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h2a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2z" /></svg>
3169
+ </slot>
3170
+ </slot>
3171
+ `;
3172
+ var fo = class extends x {
3173
+ constructor() {
3174
+ var e;
3175
+ super(), (e = this.shadowRoot) == null || e.appendChild(uo.content.cloneNode(!0));
3176
+ }
3177
+ connectedCallback() {
3178
+ super.connectedCallback(), this.setAttribute("aria-label", this.paused ? "Play" : "Pause");
3179
+ }
3180
+ disconnectedCallback() {
3181
+ super.disconnectedCallback();
3182
+ }
3183
+ attributeChangedCallback(e, t, n) {
3184
+ super.attributeChangedCallback(e, t, n), e === g.PAUSED && this.setAttribute("aria-label", this.paused ? "Play" : "Pause");
3185
+ }
3186
+ set paused(e) {
3187
+ e ? this.setAttribute(g.PAUSED, "") : this.removeAttribute(g.PAUSED);
3188
+ }
3189
+ get paused() {
3190
+ return this.hasAttribute(g.PAUSED);
3191
+ }
3192
+ handleClick(e) {
3193
+ let t = this.paused ? _.PLAY : _.PAUSE;
3194
+ this.dispatchEvent(new CustomEvent(t, {
3195
+ bubbles: !0,
3196
+ composed: !0
3197
+ }));
3198
+ }
3199
+ };
3200
+ lo = fo, e(fo, "observedAttributes", [...y(lo, "observedAttributes", lo), g.PAUSED]);
3201
+ //#endregion
3202
+ //#region ../../libs/player-next/src/PlayerAttributes.ts
3203
+ var K = {
3204
+ TITLE: "title",
3205
+ OFFLINE: "offline",
3206
+ ADVANCED_RENDITION_MENU_ENABLED: "advanced-rendition-menu-enabled",
3207
+ REFRESH_POSTER_ENABLED: "refresh-poster-enabled",
3208
+ STREAM_POLL_ENABLED: "stream-poll-enabled"
3209
+ }, po = Object.values(K), mo = /* @__PURE__ */ new WeakMap(), ho = /* @__PURE__ */ new WeakMap(), go = /* @__PURE__ */ new WeakMap(), _o = /* @__PURE__ */ new WeakMap(), vo = /* @__PURE__ */ new WeakMap(), yo = /* @__PURE__ */ new WeakMap(), bo = /* @__PURE__ */ new WeakMap(), xo = /* @__PURE__ */ new WeakSet(), So = class extends fe {
3210
+ constructor(e) {
3211
+ super(), h(this, xo), d(this, mo, void 0), d(this, ho, void 0), d(this, go, !1), d(this, _o, !1), d(this, vo, !0), d(this, yo, null), d(this, bo, null), m(ho, this, e), m(mo, this, new de({
3212
+ publicEndpoint: e.url,
3213
+ tokenFactory: () => e.authenticationToken
3214
+ }));
3215
+ }
3216
+ start(e = 5e3) {
3217
+ p(bo, this) && clearInterval(p(bo, this)), m(go, this, !1), m(_o, this, !1), f(xo, this, Eo).call(this), f(xo, this, Co).call(this), m(bo, this, window.setInterval(() => {
3218
+ !p(_o, this) && !p(ho, this).infiniteReconnect && !p(yo, this) && p(vo, this) && m(yo, this, window.setTimeout(() => f(xo, this, wo).call(this), 300 * 1e3)), !p(_o, this) && p(vo, this) && f(xo, this, Co).call(this);
3219
+ }, e));
3220
+ }
3221
+ stop() {
3222
+ f(xo, this, To).call(this), p(bo, this) && (window.clearInterval(p(bo, this)), m(bo, this, null));
3223
+ }
3224
+ };
3225
+ function Co() {
3226
+ var e = this;
3227
+ return t(function* () {
3228
+ if (p(go, e)) return;
3229
+ m(go, e, !0);
3230
+ let t = "Stream is offline", n = "Please stand by";
3231
+ try {
3232
+ let t = yield p(mo, e).getChannel(p(ho, e).channelId);
3233
+ if (t.isLive) {
3234
+ m(_o, e, !0), f(xo, e, Eo).call(e), e.emit("live", t), m(go, e, !1);
3235
+ return;
3236
+ }
3237
+ } catch (e) {
3238
+ ue(e) && (e.status === 403 || e.status === 401) && (t = "Forbidden", n = "You do not have permission to view this stream");
3239
+ }
3240
+ p(vo, e) && e.emit("error", {
3241
+ title: t,
3242
+ message: n
3243
+ }), m(go, e, !1);
3244
+ })();
3245
+ }
3246
+ function wo() {
3247
+ this.stop(), m(vo, this, !1), this.emit("timeout");
3248
+ }
3249
+ function To() {
3250
+ p(yo, this) && (window.clearTimeout(p(yo, this)), m(yo, this, null));
3251
+ }
3252
+ function Eo() {
3253
+ f(xo, this, To).call(this), m(vo, this, !0);
3254
+ }
3255
+ //#endregion
3256
+ //#region ../../libs/player-next/src/utils/browser.ts
3257
+ var Do = /\/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune\//i, Oo = navigator.userAgent.toLowerCase(), ko = Do.test(Oo), Ao = (e) => Mi.observedAttributes.includes(e), jo = `
3258
+ <style>
3259
+ :host {
3260
+ container-type: inline-size;
3261
+ position: relative;
3262
+ overflow: hidden;
3263
+ width: 100%;
3264
+ display: flex;
3265
+ justify-content: center;
3266
+
3267
+ --vindral-volume-range-display: ${ko ? "none" : "flex"};
3268
+ --vindral-airplay-button-display: none;
3269
+ --vindral-play-overlay-display: none;
3270
+ --vindral-grid-item-offline-display: none;
3271
+ --vindral-seek-bar-display: none;
3272
+ }
3273
+
3274
+ vindral-control-bar[slot="top-bar"] {
3275
+ display: none;
3276
+ }
3277
+
3278
+ @container (max-width: 320px) {
3279
+ vindral-controller {
3280
+ --vindral-volume-range-display: none;
3281
+ --vindral-control-padding: 0px;
3282
+ --vindral-button-padding: 4px;
3283
+ --vindral-play-overlay-icon-size: 40px;
3284
+ }
3285
+
3286
+ vindral-control-bar[slot="top-bar"] {
3287
+ display: block;
3288
+ }
3289
+
3290
+ vindral-control-bar:not([slot="top-bar"]) vindral-rendition-levels-menu,
3291
+ vindral-control-bar:not([slot="top-bar"]) vindral-advanced-rendition-menu,
3292
+ vindral-control-bar:not([slot="top-bar"]) vindral-cast-button,
3293
+ vindral-control-bar:not([slot="top-bar"]) vindral-airplay-button {
3294
+ display: none;
3295
+ }
3296
+ }
3297
+
3298
+ vindral-scroll-overlay {
3299
+ z-index: 20;
3300
+ // needs to be higher than bottom bar/UI
3301
+ }
3302
+
3303
+ :host([${K.OFFLINE}]) {
3304
+ aspect-ratio: 16 / 9;
3305
+ vindral-controller {
3306
+ --vindral-ui-display: none;
3307
+ --vindral-play-overlay-display: none;
3308
+ }
3309
+ }
3310
+
3311
+ :host([${g.AIRPLAY_ENABLED}="false"]) {
3312
+ --vindral-airplay-button-display: none;
3313
+ }
3314
+
3315
+ :host([${g.CAST_ENABLED}="false"]) {
3316
+ --vindral-cast-button-display: none;
3317
+ }
3318
+
3319
+ :host([${g.FULLSCREEN_ENABLED}="false"]) {
3320
+ --vindral-fullscreen-button-display: none;
3321
+ }
3322
+
3323
+ :host([${g.PIP_ENABLED}="false"]) {
3324
+ --vindral-pip-button-display: none;
3325
+ }
3326
+
3327
+ :host([${g.TIMESHIFT_ENABLED}="false"]) {
3328
+ --vindral-seek-bar-display: none;
3329
+ --vindral-live-button-display: none;
3330
+ }
3331
+
3332
+ :host(:not([${g.CHANNEL_GROUP_ID}])) vindral-scroll-overlay {
3333
+ display: none;
3334
+ }
3335
+
3336
+ :host([${g.MEDIA}="video"]) vindral-mute-button,
3337
+ :host([${g.MEDIA}="video"]) vindral-volume-range {
3338
+ display: none;
3339
+ }
3340
+
3341
+ /* Apply subtitle offset when the UI is visible (e.g. during user interaction
3342
+ or when paused with the UI showing) so subtitles sit above the control bar. */
3343
+ vindral-controller[user-interacting],
3344
+ vindral-controller[paused]:not([hide-ui-on-pause]) {
3345
+ --vindral-subtitle-offset: -48px;
3346
+ }
3347
+ </style>
3348
+ `, Mo = (e) => {
3349
+ let t = e ? "vindral-advanced-rendition-menu" : "vindral-rendition-levels-menu";
3350
+ return `
3351
+ ${jo}
3352
+
3353
+ <vindral-controller>
3354
+ <vindral-control-bar slot="top-bar">
3355
+ <${t} list-position="bottom"></${t}>
3356
+ <vindral-cast-button></vindral-cast-button>
3357
+ <vindral-airplay-button></vindral-airplay-button>
3358
+ </vindral-control-bar>
3359
+ <vindral-seek-bar></vindral-seek-bar>
3360
+ <vindral-control-bar>
3361
+ <vindral-play-button></vindral-play-button>
3362
+ <vindral-mute-button></vindral-mute-button>
3363
+ <vindral-volume-range></vindral-volume-range>
3364
+ <vindral-channel-grid-button slot="right"></vindral-channel-grid-button>
3365
+ <vindral-language-menu slot="right"></vindral-language-menu>
3366
+ <vindral-live-button id="live-button" slot="right"></vindral-live-button>
3367
+ <${t} slot="right"></${t}>
3368
+ <vindral-debug-button slot="right"></vindral-debug-button>
3369
+ <vindral-pip-button slot="right"></vindral-pip-button>
3370
+ <vindral-cast-button slot="right"></vindral-cast-button>
3371
+ <vindral-airplay-button slot="right"></vindral-airplay-button>
3372
+ <vindral-fullscreen-button slot="right"></vindral-fullscreen-button>
3373
+ </vindral-control-bar>
3374
+ <vindral-debug-panel slot="overlay"></vindral-debug-panel>
3375
+ <vindral-scroll-overlay slot="overlay">
3376
+ <vindral-channel-grid id="listbox" part="listbox"></vindral-channel-grid>
3377
+ </vindral-scroll-overlay>
3378
+ <vindral-cast-overlay slot="overlay"></vindral-cast-overlay>
3379
+ <vindral-buffering-overlay slot="overlay"></vindral-buffering-overlay>
3380
+ <vindral-user-input-play-overlay slot="overlay"></vindral-user-input-play-overlay>
3381
+ <vindral-poster-overlay slot="overlay" disabled></vindral-poster-overlay>
3382
+
3383
+ <vindral-play-overlay id="play-overlay" slot="overlay" hidden></vindral-play-overlay>
3384
+ <vindral-message id="vindral-message" slot="overlay" hidden></vindral-message>
3385
+ </vindral-controller>
3386
+ `;
3387
+ }, No = `
3388
+ ${jo}
3389
+
3390
+ <style>
3391
+ #control-bar {
3392
+ display: flex;
3393
+ justify-content: center;
3394
+ align-items: center;
3395
+ gap: var(--padding-3);
3396
+ }
3397
+ </style>
3398
+
3399
+ <vindral-controller>
3400
+ <div id="control-bar" slot="middle">
3401
+ <vindral-play-button></vindral-play-button>
3402
+ <vindral-mute-button></vindral-mute-button>
3403
+ <vindral-volume-range></vindral-volume-range>
3404
+ <vindral-buffering-icon></vindral-buffering-icon>
3405
+ </div>
3406
+
3407
+ <vindral-play-overlay id="play-overlay" slot="overlay" hidden></vindral-play-overlay>
3408
+ <vindral-message id="vindral-message" slot="overlay" hidden></vindral-message>
3409
+ </vindral-controller>
3410
+ `, Po = document.createElement("template"), Fo = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Io = /* @__PURE__ */ new WeakMap(), Lo = /* @__PURE__ */ new WeakMap(), Ro = /* @__PURE__ */ new WeakMap(), zo = /* @__PURE__ */ new WeakMap(), Bo = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakSet(), Vo = /* @__PURE__ */ new WeakMap(), Ho = /* @__PURE__ */ new WeakMap(), Uo = /* @__PURE__ */ new WeakMap(), Wo = class extends HTMLElement {
3411
+ constructor() {
3412
+ super(), h(this, Y), d(this, Fo, void 0), d(this, q, void 0), d(this, J, void 0), d(this, Io, void 0), d(this, Lo, void 0), d(this, Ro, /* @__PURE__ */ new Set()), d(this, zo, () => {
3413
+ Array.from(this.attributes).forEach((e) => {
3414
+ p(Bo, this).call(this, e.name, e.value);
3415
+ });
3416
+ }), d(this, Bo, (e, t) => {
3417
+ Ao(e) && (v(t) ? p(q, this).setAttribute(e, t) : p(q, this).removeAttribute(e));
3418
+ }), d(this, Vo, () => {
3419
+ Array.from(this.children).forEach((e) => {
3420
+ p(Ro, this).add(e);
3421
+ });
3422
+ }), d(this, Ho, () => {
3423
+ let e = p(q, this).instance;
3424
+ e && (e.on("is live", (e) => {
3425
+ e ? (this.removeAttribute(K.OFFLINE), p(J, this).setAttribute("hidden", "")) : (this.setAttribute(K.OFFLINE, ""), p(J, this).removeAttribute("hidden"), f(Y, this, Yo).call(this, "Stream is offline", "Please stand by"));
3426
+ }), e.on("channels", (e) => {
3427
+ let t = p(q, this).getAttribute("channel-id"), n = e.find((e) => e.channelId === t);
3428
+ n && f(Y, this, Jo).call(this, n);
3429
+ }), e.on("channel switch", ({ channelId: t }) => {
3430
+ let n = e.channels.find((e) => e.channelId === t);
3431
+ n && f(Y, this, Jo).call(this, n);
3432
+ }), e.on("error", (e) => {
3433
+ if (e.code() === "connection_failed") {
3434
+ f(Y, this, Yo).call(this, "Stream is offline", "Please stand by");
3435
+ return;
3436
+ }
3437
+ e.isFatal() && (e.code() === "access_forbidden" ? f(Y, this, Yo).call(this, "Forbidden", "You do not have permission to view this stream") : e.code() === "connection_failed_will_not_attempt_again" ? f(Y, this, Yo).call(this, "Stream is offline", "Please stand by") : f(Y, this, Yo).call(this, "An error occurred", e.message), p(Io, this).removeAttribute("hidden"), this.setAttribute(K.OFFLINE, ""), p(q, this).dispatchEvent(new CustomEvent(_.EXIT_FULLSCREEN)), p(q, this).dispatchEvent(new CustomEvent(_.EXIT_PIP)));
3438
+ }));
3439
+ }), d(this, Uo, () => {
3440
+ p(q, this).connect(), p(Io, this).setAttribute("hidden", ""), p(J, this).setAttribute("hidden", ""), p(q, this).focus();
3441
+ }), m(Fo, this, this.attachShadow({ mode: "open" })), f(Y, this, Ko).call(this), m(q, this, p(Fo, this).querySelector("vindral-controller")), m(J, this, p(Fo, this).querySelector("#vindral-message")), m(Io, this, p(Fo, this).querySelector("#play-overlay"));
3442
+ }
3443
+ connectedCallback() {
3444
+ this.setAttribute(K.OFFLINE, ""), p(q, this).addEventListener("vindral-instance-ready", p(Ho, this)), f(Y, this, qo).call(this);
3445
+ }
3446
+ disconnectedCallback() {
3447
+ var e;
3448
+ p(q, this).removeEventListener("vindral-instance-ready", p(Ho, this)), p(Io, this).removeEventListener("click", p(Uo, this)), (e = p(Lo, this)) == null || e.stop();
3449
+ }
3450
+ attributeChangedCallback(e, t, n) {
3451
+ if (t !== n) if (e === g.MEDIA || e === K.ADVANCED_RENDITION_MENU_ENABLED) f(Y, this, Ko).call(this);
3452
+ else if (e === K.REFRESH_POSTER_ENABLED) {
3453
+ let e = p(Fo, this).querySelector("vindral-poster-overlay");
3454
+ e && (e.disabled = b(this.getAttribute(K.REFRESH_POSTER_ENABLED), !1) === !1);
3455
+ } else p(Bo, this).call(this, e, n);
3456
+ }
3457
+ get instance() {
3458
+ return p(q, this).instance;
3459
+ }
3460
+ get airPlay() {
3461
+ return p(q, this).airPlay;
3462
+ }
3463
+ };
3464
+ function Go() {
3465
+ let e = ge(this.getAttribute(g.MEDIA)), t = b(this.getAttribute(K.ADVANCED_RENDITION_MENU_ENABLED), !1);
3466
+ return e === "audio" ? No : Mo(t);
3467
+ }
3468
+ function Ko() {
3469
+ let e = p(Fo, this).hasChildNodes(), t = e ? p(q, this) : void 0, n = e ? p(Io, this) : void 0;
3470
+ this.isConnected && t && t.removeEventListener("vindral-instance-ready", p(Ho, this)), this.isConnected && n && p(Lo, this) && n.removeEventListener("click", p(Uo, this)), Po.innerHTML = f(Y, this, Go).call(this);
3471
+ let r = Po.content.cloneNode(!0);
3472
+ m(q, this, r.querySelector("vindral-controller")), m(J, this, r.querySelector("#vindral-message")), m(Io, this, r.querySelector("#play-overlay")), p(Vo, this).call(this), p(Ro, this).forEach((e) => {
3473
+ p(q, this).appendChild(e);
3474
+ }), p(zo, this).call(this), p(Fo, this).innerHTML = "", p(Fo, this).appendChild(r), this.isConnected && (p(q, this).addEventListener("vindral-instance-ready", p(Ho, this)), p(Lo, this) && p(Io, this).addEventListener("click", p(Uo, this)));
3475
+ }
3476
+ function qo() {
3477
+ var e;
3478
+ if (b(this.getAttribute(K.STREAM_POLL_ENABLED), !0) === !1) return;
3479
+ let t = this.getAttribute("url"), n = this.getAttribute("channel-id"), r = (e = this.getAttribute("authentication-token")) == null ? void 0 : e, i = this.hasAttribute("infinite-reconnect");
3480
+ if (!t || !n) {
3481
+ this.setAttribute(K.OFFLINE, ""), f(Y, this, Yo).call(this, "Invalid options", "Please enter at least a channel id and url to start the stream");
3482
+ return;
3483
+ }
3484
+ m(Lo, this, new So({
3485
+ url: t,
3486
+ channelId: n,
3487
+ authenticationToken: r,
3488
+ infiniteReconnect: i
3489
+ })), p(Lo, this).on("live", (e) => {
3490
+ p(q, this).connect(), this.removeAttribute("offline"), p(J, this).setAttribute("hidden", ""), f(Y, this, Jo).call(this, e);
3491
+ }), p(Lo, this).on("timeout", () => {
3492
+ p(J, this).setAttribute("hidden", ""), p(Io, this).removeAttribute("hidden");
3493
+ }), p(Lo, this).on("error", (e) => {
3494
+ this.setAttribute(K.OFFLINE, ""), f(Y, this, Yo).call(this, e.title, e.message);
3495
+ }), p(Io, this).addEventListener("click", p(Uo, this)), this.hasAttribute("paused") && p(Lo, this).start();
3496
+ }
3497
+ function Jo(e) {
3498
+ let t = xe(this.getAttribute("title"), !1);
3499
+ if (!t) return;
3500
+ let n = this.getAttribute("poster"), r = typeof t == "string" ? t : e.name, i;
3501
+ if (typeof n == "string") i = n;
3502
+ else {
3503
+ var a, o;
3504
+ i = (a = (o = this.instance) == null ? void 0 : o.getThumbnailUrl()) == null ? e.thumbnailUrls.length ? e.thumbnailUrls[0] : void 0 : a;
3505
+ }
3506
+ De({
3507
+ title: r,
3508
+ poster: i
3509
+ });
3510
+ }
3511
+ function Yo(e, t) {
3512
+ p(J, this).setAttribute("title", e), p(J, this).setAttribute("description", t);
3513
+ let n = this.getAttribute("poster");
3514
+ n && p(J, this).setAttribute("background-image", n), p(J, this).removeAttribute("hidden");
3515
+ }
3516
+ e(Wo, "observedAttributes", [...Mi.observedAttributes, ...po]);
3517
+ //#endregion
3518
+ //#region ../../libs/player-next/src/components/PosterOverlay.ts
3519
+ var Xo = document.createElement("template");
3520
+ Xo.innerHTML = `
3521
+ <style>
3522
+ :host {
3523
+ display: var(--poster-overlay-display);
3524
+ position: absolute;
3525
+ top: 0;
3526
+ left: 0;
3527
+ max-width: 100%;
3528
+ max-height: 100%;
3529
+ min-width: 100% !important;
3530
+ min-height: 100% !important;
3531
+ background-repeat: no-repeat;
3532
+ background-position: 50% 50%;
3533
+ background-size: contain;
3534
+ transition-property: background-image;
3535
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
3536
+ transition-duration: 200ms;
3537
+ }
3538
+
3539
+ :host::before {
3540
+ content: "";
3541
+ position: absolute;
3542
+ top: 0;
3543
+ left: 0;
3544
+ right: 0;
3545
+ bottom: 0;
3546
+ background: rgba(255, 255, 255, 0);
3547
+ transition: background 0.2s ease;
3548
+ }
3549
+
3550
+ :host(:not([${g.PAUSED}])) {
3551
+ display: none;
3552
+ }
3553
+ </style>
3554
+ `;
3555
+ var Zo = 6e3, Qo = /* @__PURE__ */ new WeakMap(), $o = /* @__PURE__ */ new WeakMap(), es = /* @__PURE__ */ new WeakMap(), ts = /* @__PURE__ */ new WeakMap(), ns = /* @__PURE__ */ new WeakSet(), rs = /* @__PURE__ */ new WeakMap(), is = class extends HTMLElement {
3556
+ constructor() {
3557
+ super(), h(this, ns), d(this, Qo, null), d(this, $o, null), d(this, es, null), d(this, ts, () => {
3558
+ !document.hidden && this.hasAttribute("intersecting") && this.paused && !this.disabled ? f(ns, this, as).call(this) : f(ns, this, os).call(this);
3559
+ }), d(this, rs, (e) => {
3560
+ e.forEach((e) => {
3561
+ e.isIntersecting ? this.setAttribute("intersecting", "") : this.removeAttribute("intersecting");
3562
+ });
3563
+ }), this.attachShadow({ mode: "open" }).appendChild(Xo.content.cloneNode(!0));
3564
+ }
3565
+ connectedCallback() {
3566
+ var e;
3567
+ m(Qo, this, this.closest("vindral-controller")), (e = p(Qo, this)) == null || e.connectListener(this), document.addEventListener("visibilitychange", p(ts, this)), m(es, this, new IntersectionObserver(p(rs, this))), p(es, this).observe(this);
3568
+ }
3569
+ disconnectedCallback() {
3570
+ var e, t;
3571
+ (e = p(Qo, this)) == null || e.disconnectListener(this), document.removeEventListener("visibilitychange", p(ts, this)), (t = p(es, this)) == null || t.disconnect(), m(es, this, null), f(ns, this, os).call(this);
3572
+ }
3573
+ attributeChangedCallback(e, t, n) {
3574
+ t !== n && (e === g.POSTER_SRC && this.paused && !this.disabled && f(ns, this, ss).call(this), (e === g.PAUSED || e === "disabled" || e === "intersecting") && p(ts, this).call(this));
3575
+ }
3576
+ get disabled() {
3577
+ return this.hasAttribute("disabled");
3578
+ }
3579
+ set disabled(e) {
3580
+ e ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
3581
+ }
3582
+ get posterSrc() {
3583
+ return this.getAttribute(g.POSTER_SRC);
3584
+ }
3585
+ get paused() {
3586
+ return this.hasAttribute(g.PAUSED);
3587
+ }
3588
+ };
3589
+ function as() {
3590
+ p($o, this) === null && (f(ns, this, os).call(this), m($o, this, window.setInterval(() => f(ns, this, ss).call(this), Zo)));
3591
+ }
3592
+ function os() {
3593
+ p($o, this) !== null && (clearInterval(p($o, this)), m($o, this, null)), this.style.backgroundImage = "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAJCAQAAACRI2S5AAAAEElEQVR42mNkIAAYRxWAAQAG9gAKqv6+AwAAAABJRU5ErkJggg==')";
3594
+ }
3595
+ function ss() {
3596
+ if (!this.posterSrc) return;
3597
+ let e = new URL(this.posterSrc), t = new Image();
3598
+ e.searchParams.set("t", Date.now().toString()), t.src = e.toString(), t.onload = () => this.style.backgroundImage = `url(${e.toString()})`;
3599
+ }
3600
+ e(is, "observedAttributes", [
3601
+ g.POSTER_SRC,
3602
+ g.PAUSED,
3603
+ "disabled",
3604
+ "intersecting"
3605
+ ]);
3606
+ //#endregion
3607
+ //#region ../../libs/player-next/src/components/RenditionLevelsMenu.ts
3608
+ var cs, ls = "\n<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon icon-tabler icon-tabler-settings-filled\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"#2c3e50\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <path d=\"M14.647 4.081a.724 .724 0 0 0 1.08 .448c2.439 -1.485 5.23 1.305 3.745 3.744a.724 .724 0 0 0 .447 1.08c2.775 .673 2.775 4.62 0 5.294a.724 .724 0 0 0 -.448 1.08c1.485 2.439 -1.305 5.23 -3.744 3.745a.724 .724 0 0 0 -1.08 .447c-.673 2.775 -4.62 2.775 -5.294 0a.724 .724 0 0 0 -1.08 -.448c-2.439 1.485 -5.23 -1.305 -3.745 -3.744a.724 .724 0 0 0 -.447 -1.08c-2.775 -.673 -2.775 -4.62 0 -5.294a.724 .724 0 0 0 .448 -1.08c-1.485 -2.439 1.305 -5.23 3.744 -3.745a.722 .722 0 0 0 1.08 -.447c.673 -2.775 4.62 -2.775 5.294 0zm-2.647 4.919a3 3 0 1 0 0 6a3 3 0 0 0 0 -6z\" stroke-width=\"0\" fill=\"currentColor\" />\n</svg>\n", us = document.createElement("template");
3609
+ us.innerHTML = `
3610
+ <style>
3611
+ :host {
3612
+ display: var(--rendition-menu-display);
3613
+ }
3614
+ </style>
3615
+
3616
+ <slot name="button">${ls}</slot>
3617
+ <slot name="listbox" hidden>
3618
+ <vindral-rendition-levels-menu-list id="listbox" part="listbox"></vindral-rendition-levels-menu-list>
3619
+ </slot>
3620
+ `;
3621
+ var ds = /* @__PURE__ */ new WeakSet(), fs = class extends Re {
3622
+ constructor() {
3623
+ var e, t, n, r;
3624
+ super(), h(this, ds), (e = this.shadowRoot) == null || e.appendChild(us.content.cloneNode(!0)), this.button = (t = this.shadowRoot) == null ? void 0 : t.querySelector("slot[name=button]"), this.listbox = (n = this.shadowRoot) == null ? void 0 : n.querySelector("[part=listbox]"), this.listboxSlot = (r = this.shadowRoot) == null ? void 0 : r.querySelector("slot[name=listbox]");
3625
+ }
3626
+ connectedCallback() {
3627
+ super.connectedCallback(), f(ds, this, ps).call(this), this.setAttribute("aria-label", "Rendition levels");
3628
+ }
3629
+ attributeChangedCallback(e, t, n) {
3630
+ super.attributeChangedCallback(e, t, n), e === g.RENDITION_LEVELS && f(ds, this, ps).call(this);
3631
+ }
3632
+ };
3633
+ cs = fs;
3634
+ function ps() {
3635
+ let e = this.getAttribute(g.RENDITION_LEVELS);
3636
+ !e || e === "[]" ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
3637
+ }
3638
+ e(fs, "observedAttributes", [...y(cs, "observedAttributes", cs), g.RENDITION_LEVELS]);
3639
+ //#endregion
3640
+ //#region ../../libs/player-next/src/components/RenditionLevelsMenuList.ts
3641
+ var ms = document.createElement("template");
3642
+ ms.innerHTML = "\n <style>\n :host {\n font: inherit;\n cursor: default;\n padding: var(--padding-2) !important;\n padding-top: var(--padding-3) !important;\n border-radius: 0.25em;\n position: absolute;\n min-width: 140px !important;\n background: var(--bg-subtle);\n z-index: 1;\n overflow: auto;\n }\n\n :host([list-position=\"top\"]) {\n bottom: calc(100% + 0.5em);\n transform: translate(-50%);\n }\n\n :host([list-position=\"bottom\"]) {\n top: calc(100% + 0.5em);\n }\n\n :host::-webkit-scrollbar {\n width: 5px;\n padding-right: 5px;\n }\n\n :host::-webkit-scrollbar-thumb {\n background-color: var(--fg-extra-subtle);\n border-radius: 10px;\n border: 0;\n }\n\n :host::-webkit-scrollbar-track {\n border-radius: 10px;\n background-color: transparent;\n }\n\n .menu {\n display: grid;\n gap: var(--padding-1);\n }\n\n [role=\"menuitem\"] {\n flex: 1;\n position: relative;\n cursor: pointer;\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 44px;\n padding: 0 var(--padding-5);\n border-radius: 4px;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: normal;\n white-space: nowrap;\n text-align: left;\n }\n\n [role=\"menuitem\"]:hover {\n background: var(--bg-component-hover);\n }\n\n [role=\"menuitem\"][aria-selected=\"true\"] {\n background: var(--bg-component-active);\n }\n\n [role=\"menuitem\"][aria-selected=\"true\"]::before {\n content: url(\"data:image/svg+xml,%0A%20%20%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2078.369%2078.369%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20d%3D%22M78.049%2019.015%2029.458%2067.606a1.094%201.094%200%200%201-1.548%200L.32%2040.015a1.094%201.094%200%200%201%200-1.547l6.704-6.704a1.095%201.095%200%200%201%201.548%200l20.113%2020.112%2041.113-41.113a1.095%201.095%200%200%201%201.548%200l6.703%206.704a1.094%201.094%200%200%201%200%201.548z%22%2F%3E%3C%2Fsvg%3E%0A\");\n position: absolute;\n left: calc(var(--padding-3) - var(--padding-1));\n top: calc(50% - 8px);\n }\n\n [role=\"menuitem\"]:focus-visible {\n box-shadow: inset 0 0 0 2px var(--fg-strong);\n outline: 0;\n }\n\n .menu-item-subtitle {\n font-size: 11px;\n opacity: 0.6;\n }\n\n .heading {\n text-transform: uppercase;\n margin-bottom: var(--padding-2);\n padding: 0 var(--padding-3);\n font-size: 11px;\n font-weight: bold;\n }\n </style>\n\n <slot>\n <div class=\"heading\">Max quality</div>\n <div class=\"menu\"></div>\n </slot>\n";
3643
+ var hs = /* @__PURE__ */ new WeakMap(), gs = /* @__PURE__ */ new WeakMap(), _s = /* @__PURE__ */ new WeakMap(), vs = /* @__PURE__ */ new WeakMap(), ys = /* @__PURE__ */ new WeakMap(), bs = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakSet(), xs = class extends HTMLElement {
3644
+ constructor() {
3645
+ super(), h(this, X), d(this, hs, []), d(this, gs, 2 ** 53 - 1), d(this, _s, null), d(this, vs, []), d(this, ys, null), d(this, bs, null), e(this, "handleEvent", (e) => {
3646
+ switch (e.type) {
3647
+ case "keydown":
3648
+ f(X, this, Ds).call(this, e);
3649
+ break;
3650
+ }
3651
+ }), this.attachShadow({ mode: "open" }).appendChild(ms.content.cloneNode(!0));
3652
+ }
3653
+ connectedCallback() {
3654
+ let e = this.getRootNode();
3655
+ if (e instanceof ShadowRoot) {
3656
+ var t;
3657
+ m(ys, this, e.host.closest("vindral-controller")), (t = p(ys, this)) == null || t.connectListener(this), f(X, this, Ss).call(this), f(X, this, Cs).call(this), m(bs, this, e.host), this.addEventListener("keydown", this);
3658
+ }
3659
+ }
3660
+ disconnectedCallback() {
3661
+ var e;
3662
+ (e = p(ys, this)) == null || e.disconnectListener(this), this.removeEventListener("keydown", this);
3663
+ }
3664
+ attributeChangedCallback(e, t, n) {
3665
+ t !== n && (e === g.RENDITION_LEVELS && n && (this.list = JSON.parse(n)), e === g.MAX_VIDEO_BITRATE && n && (this.maxVideoBitrate = n ? parseInt(n, 10) : 2 ** 53 - 1));
3666
+ }
3667
+ set list(e) {
3668
+ m(hs, this, e), f(X, this, Cs).call(this);
3669
+ }
3670
+ set maxVideoBitrate(e) {
3671
+ m(gs, this, e), f(X, this, Ts).call(this);
3672
+ }
3673
+ get keysUsed() {
3674
+ return [
3675
+ "Enter",
3676
+ "Escape",
3677
+ "Tab",
3678
+ " ",
3679
+ "ArrowDown",
3680
+ "ArrowUp",
3681
+ "Home",
3682
+ "End"
3683
+ ];
3684
+ }
3685
+ focus() {
3686
+ var e;
3687
+ (e = p(_s, this)) == null || e.focus();
3688
+ }
3689
+ };
3690
+ function Ss() {
3691
+ new IntersectionObserver((e) => {
3692
+ e.forEach((e) => {
3693
+ if (e.intersectionRatio !== 1) if (e.intersectionRatio > 0) {
3694
+ let t = this.offsetHeight * e.intersectionRatio - 24;
3695
+ this.style.height = `${t}px`;
3696
+ } else this.style.height = "auto";
3697
+ });
3698
+ }, {
3699
+ root: p(ys, this),
3700
+ threshold: 0
3701
+ }).observe(this);
3702
+ }
3703
+ function Cs() {
3704
+ var e;
3705
+ let t = (e = this.shadowRoot) == null ? void 0 : e.querySelector(".menu");
3706
+ t && (m(vs, this, []), t.innerHTML = "", p(hs, this).sort((e, t) => {
3707
+ var n, r;
3708
+ return (n = e.video) != null && n.bitRate && (r = t.video) != null && r.bitRate ? t.video.bitRate - e.video.bitRate : 0;
3709
+ }).forEach((e) => {
3710
+ var n, r, i, a, o, s, c, ee;
3711
+ let l = document.createElement("div");
3712
+ l.setAttribute("role", "menuitem"), l.setAttribute("value", String((n = e.video) == null ? void 0 : n.height)), l.classList.add("menu-item"), l.tabIndex = -1;
3713
+ let te = f(X, this, ws).call(this, (r = e.video) == null ? void 0 : r.frameRate);
3714
+ l.textContent = e.video ? Te(e.video) : "";
3715
+ let u = document.createElement("span");
3716
+ u.classList.add("menu-item-subtitle"), u.textContent = `${we(((i = (a = e.video) == null ? void 0 : a.bitRate) == null ? 0 : i) + ((o = (s = e.audio) == null ? void 0 : s.bitRate) == null ? 0 : o))}, ${te}p`, l.appendChild(u), l.addEventListener("click", () => f(X, this, Es).call(this, e)), p(vs, this).push({
3717
+ el: l,
3718
+ id: (c = (ee = e.video) == null ? void 0 : ee.id) == null ? -1 : c
3719
+ }), t.appendChild(l);
3720
+ }), f(X, this, Ts).call(this));
3721
+ }
3722
+ function ws(e) {
3723
+ return e ? e[0] % e[1] === 0 ? (e[0] / e[1]).toString() : (e[0] / e[1]).toFixed(2) : "";
3724
+ }
3725
+ function Ts() {
3726
+ p(_s, this) && (p(_s, this).removeAttribute("aria-selected"), p(_s, this).tabIndex = -1);
3727
+ let e = p(hs, this).sort((e, t) => {
3728
+ var n, r;
3729
+ return (n = e.video) != null && n.bitRate && (r = t.video) != null && r.bitRate ? t.video.bitRate - e.video.bitRate : 0;
3730
+ }), t = p(hs, this).filter((e) => {
3731
+ var t;
3732
+ return ((t = e.video) == null ? void 0 : t.bitRate) && e.video.bitRate <= p(gs, this);
3733
+ })[0] || e[e.length - 1];
3734
+ if (t) {
3735
+ let e = p(vs, this).find((e) => {
3736
+ var n;
3737
+ return e.id === ((n = t.video) == null ? void 0 : n.id);
3738
+ });
3739
+ e && (e.el.tabIndex = 0, e.el.setAttribute("aria-selected", "true"), m(_s, this, e.el));
3740
+ }
3741
+ }
3742
+ function Es(e) {
3743
+ this.dispatchEvent(new Event("change", {
3744
+ bubbles: !0,
3745
+ composed: !0
3746
+ })), this.dispatchEvent(new CustomEvent(_.SET_RENDITION, {
3747
+ bubbles: !0,
3748
+ composed: !0,
3749
+ detail: e
3750
+ }));
3751
+ }
3752
+ function Ds(e) {
3753
+ let { key: t, ctrlKey: n, altKey: r, metaKey: i } = e;
3754
+ if (!(n || r || i) && this.keysUsed.includes(t)) if (e.preventDefault(), e.stopPropagation(), t === "Tab" || t === "Escape") {
3755
+ var a;
3756
+ (a = p(bs, this)) == null || a.hide();
3757
+ } else if (t === "Enter" || t === " ") {
3758
+ var o;
3759
+ (o = f(X, this, ks).call(this)) == null || (o = o.el) == null || o.click();
3760
+ } else f(X, this, Os).call(this, e);
3761
+ }
3762
+ function Os(e) {
3763
+ var t;
3764
+ let { key: n } = e, r = p(vs, this), i = (t = f(X, this, ks).call(this)) == null ? r[0] : t;
3765
+ if (!i) return;
3766
+ let a = r.indexOf(i), o = Math.max(0, a);
3767
+ n === "ArrowDown" ? o++ : n === "ArrowUp" ? o-- : e.key === "Home" ? o = 0 : e.key === "End" && (o = r.length - 1), o < 0 && (o = r.length - 1), o > r.length - 1 && (o = 0);
3768
+ let s = r[o];
3769
+ s && (f(X, this, As).call(this, s.id), s.el.focus());
3770
+ }
3771
+ function ks() {
3772
+ return p(vs, this).find((e) => e.el.tabIndex === 0);
3773
+ }
3774
+ function As(e) {
3775
+ for (let t of p(vs, this)) t.el.tabIndex = t.id === e ? 0 : -1;
3776
+ }
3777
+ e(xs, "observedAttributes", [g.RENDITION_LEVELS, g.MAX_VIDEO_BITRATE]);
3778
+ //#endregion
3779
+ //#region ../../libs/player-next/src/components/ScrollOverlay.ts
3780
+ var js = document.createElement("template");
3781
+ js.innerHTML = `
3782
+ <style>
3783
+ :host {
3784
+ --scroll-overlay-offset: var(--vindral-scroll-overlay-offset, 0px);
3785
+
3786
+ position: absolute;
3787
+ top: 0;
3788
+ width: 100%;
3789
+ height: 100%;
3790
+ overflow-y: scroll !important;
3791
+ pointer-events: none !important;
3792
+ display: block;
3793
+ transition: background-color 0.5s ease-in-out;
3794
+ -ms-overflow-style: none;
3795
+ scrollbar-width: none;
3796
+ }
3797
+
3798
+ :host([snap]) {
3799
+ scroll-snap-type: y mandatory;
3800
+ scroll-behavior: smooth;
3801
+ }
3802
+
3803
+ :host([snap-touch]) {
3804
+ scroll-snap-type: y mandatory;
3805
+ scroll-behavior: smooth;
3806
+ pointer-events: auto !important;
3807
+ }
3808
+
3809
+ :host([open]) #scroll-area {
3810
+ width: 100%;
3811
+ cursor: pointer;
3812
+ }
3813
+
3814
+ :host([open]) {
3815
+ background-color: rgba(0, 0, 0, 0.5);
3816
+ }
3817
+
3818
+ :host::-webkit-scrollbar {
3819
+ display: none;
3820
+ }
3821
+
3822
+ #scroll-area {
3823
+ margin: 0 auto;
3824
+ width: 1px;
3825
+ height: calc(100% - var(--scroll-overlay-offset));
3826
+ pointer-events: auto;
3827
+ scroll-snap-align: start;
3828
+ min-height: 1px;
3829
+ -webkit-tap-highlight-color: transparent;
3830
+ }
3831
+
3832
+ slot#content {
3833
+ display: flex;
3834
+ margin: 0 auto;
3835
+ width: 100%;
3836
+ pointer-events: auto;
3837
+ scroll-snap-align: start;
3838
+ flex-direction: column;
3839
+ }
3840
+
3841
+ :host(:not([${g.USER_INTERACTING}])) {
3842
+ overflow: hidden !important;
3843
+ }
3844
+ </style>
3845
+
3846
+ <div id="scroll-area"></div>
3847
+ <slot id="content"></slot>
3848
+ `;
3849
+ var Ms = /* @__PURE__ */ new WeakMap(), Ns = /* @__PURE__ */ new WeakMap(), Ps = /* @__PURE__ */ new WeakMap(), Fs = /* @__PURE__ */ new WeakMap(), Is = /* @__PURE__ */ new WeakMap(), Ls = /* @__PURE__ */ new WeakMap(), Rs = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakSet(), zs = /* @__PURE__ */ new WeakMap(), Bs = class extends HTMLElement {
3850
+ constructor() {
3851
+ super(), h(this, Z), d(this, Ms, null), d(this, Ns, null), d(this, Ps, !1), d(this, Fs, !1), d(this, Is, !1), d(this, Ls, () => {
3852
+ this.open && (this.open = !1);
3853
+ }), d(this, Rs, null), e(this, "handleEvent", (e) => {
3854
+ switch (e.type) {
3855
+ case "touchstart":
3856
+ f(Z, this, Hs).call(this, e);
3857
+ break;
3858
+ case "touchmove":
3859
+ f(Z, this, Us).call(this, e);
3860
+ break;
3861
+ case "touchend":
3862
+ f(Z, this, Ws).call(this, e);
3863
+ break;
3864
+ }
3865
+ }), d(this, zs, () => {
3866
+ let e = p(Is, this);
3867
+ if (this.scrollTop === 0) {
3868
+ f(Z, this, Qs).call(this, e);
3869
+ return;
3870
+ }
3871
+ if (!e && !f(Z, this, Gs).call(this)) {
3872
+ f(Z, this, Xs).call(this), f(Z, this, Qs).call(this);
3873
+ return;
3874
+ }
3875
+ !this.visible && this.scrollTop > 0 && !p(Ps, this) ? f(Z, this, $s).call(this) : !p(Ps, this) && f(Z, this, qs).call(this) && (this.open || (this.open = !0), e && !this.hasAttribute("snap-touch") && this.setAttribute("snap-touch", ""));
3876
+ }), this.attachShadow({ mode: "open" }).appendChild(js.content.cloneNode(!0));
3877
+ }
3878
+ connectedCallback() {
3879
+ let e = this.getRootNode();
3880
+ if (e instanceof Document || e instanceof ShadowRoot) {
3881
+ var t, n, r;
3882
+ m(Ms, this, e.querySelector("vindral-controller")), (t = p(Ms, this)) == null || t.connectListener(this), m(Ns, this, (n = this.shadowRoot) == null ? void 0 : n.querySelector("#scroll-area")), (r = p(Ns, this)) == null || r.addEventListener("click", p(Ls, this));
3883
+ let s = this.hasAttribute("touch-enabled");
3884
+ if (m(Is, this, ce() && s), !p(Is, this)) this.setAttribute("snap", "");
3885
+ else {
3886
+ var i, a, o;
3887
+ (i = p(Ms, this)) == null || i.addEventListener("touchstart", this, { passive: !0 }), (a = p(Ms, this)) == null || a.addEventListener("touchmove", this, { passive: !1 }), (o = p(Ms, this)) == null || o.addEventListener("touchend", this, { passive: !0 });
3888
+ }
3889
+ this.addEventListener("scroll", p(zs, this));
3890
+ }
3891
+ }
3892
+ disconnectedCallback() {
3893
+ var e, t, n, r, i;
3894
+ (e = p(Ns, this)) == null || e.removeEventListener("click", p(Ls, this)), this.removeEventListener("scroll", p(zs, this)), (t = p(Ms, this)) == null || t.removeEventListener("touchstart", this), (n = p(Ms, this)) == null || n.removeEventListener("touchmove", this), (r = p(Ms, this)) == null || r.removeEventListener("touchend", this), (i = p(Ms, this)) == null || i.disconnectListener(this);
3895
+ }
3896
+ attributeChangedCallback(e, t, n) {
3897
+ if (t !== n && (e === g.USER_INTERACTING && n === null && f(Z, this, Ks).call(this) && setTimeout(() => {
3898
+ this.open = !1;
3899
+ }, 300), e === "open")) if (n !== null) {
3900
+ var r;
3901
+ m(Ps, this, !1), this.scrollTop > 0 && f(Z, this, $s).call(this), this.scrollTo({
3902
+ top: (r = p(Ns, this)) == null ? void 0 : r.clientHeight,
3903
+ behavior: "smooth"
3904
+ });
3905
+ } else f(Z, this, Zs).call(this);
3906
+ }
3907
+ set open(e) {
3908
+ if (e) {
3909
+ this.setAttribute("open", "");
3910
+ return;
3911
+ }
3912
+ let t = this.hasAttribute("open"), n = this.visible || f(Z, this, Ks).call(this);
3913
+ t ? this.removeAttribute("open") : n ? f(Z, this, Zs).call(this) : (m(Ps, this, !1), this.removeAttribute("snap-touch"));
3914
+ }
3915
+ get open() {
3916
+ return this.hasAttribute("open");
3917
+ }
3918
+ set visible(e) {
3919
+ e ? this.setAttribute("visible", "") : this.removeAttribute("visible");
3920
+ }
3921
+ get visible() {
3922
+ return this.hasAttribute("visible");
3923
+ }
3924
+ };
3925
+ function Vs() {
3926
+ return f(Z, this, Gs).call(this) || f(Z, this, Ys).call(this) || f(Z, this, Ks).call(this);
3927
+ }
3928
+ function Hs(e) {
3929
+ let t = e.touches[0];
3930
+ t && (m(Fs, this, f(Z, this, Vs).call(this)), p(Fs, this) && (m(Ps, this, !1), m(Rs, this, t.clientY)));
3931
+ }
3932
+ function Us(e) {
3933
+ if (!(!p(Fs, this) || p(Rs, this) === null || this.hasAttribute("snap-touch") && this.open) && (e.preventDefault(), e.touches[0])) {
3934
+ let t = e.touches[0].clientY, n = p(Rs, this) - t;
3935
+ this.scrollTop = Math.max(0, n);
3936
+ }
3937
+ }
3938
+ function Ws(e) {
3939
+ p(Fs, this) && !p(Ps, this) && f(Z, this, Ks).call(this) && (!this.hasAttribute("snap-touch") || !this.open) && (this.open = !0), m(Rs, this, null), m(Fs, this, !1);
3940
+ }
3941
+ function Gs() {
3942
+ return this.hasAttribute(g.USER_INTERACTING);
3943
+ }
3944
+ function Ks() {
3945
+ return this.scrollTop > 0;
3946
+ }
3947
+ function qs() {
3948
+ var e;
3949
+ return Math.round(this.scrollTop) === this.scrollHeight - this.clientHeight || Math.round(this.scrollTop) === ((e = p(Ns, this)) == null ? void 0 : e.clientHeight);
3950
+ }
3951
+ function Js() {
3952
+ var e;
3953
+ let t = (e = p(Ns, this)) == null ? void 0 : e.clientHeight;
3954
+ return !t || this.clientHeight <= 0 ? 0 : Math.max(this.clientHeight - t, 0);
3955
+ }
3956
+ function Ys() {
3957
+ let e = getComputedStyle(this), t = Number.parseFloat(e.getPropertyValue("--vindral-scroll-overlay-offset"));
3958
+ return Number.isNaN(t) ? f(Z, this, Js).call(this) > 0 : t > 0;
3959
+ }
3960
+ function Xs() {
3961
+ let e = this.style.scrollBehavior;
3962
+ this.style.scrollBehavior = "auto", this.scrollTo({
3963
+ top: 0,
3964
+ behavior: "auto"
3965
+ }), this.style.scrollBehavior = e;
3966
+ }
3967
+ function Zs() {
3968
+ m(Ps, this, !0), this.removeAttribute("snap-touch"), f(Z, this, ec).call(this), this.scrollTo({
3969
+ top: 0,
3970
+ behavior: "smooth"
3971
+ });
3972
+ }
3973
+ function Qs(e = !1) {
3974
+ this.open = !1, e && this.removeAttribute("snap-touch"), m(Ps, this, !1), f(Z, this, ec).call(this);
3975
+ }
3976
+ function $s() {
3977
+ this.visible || (this.visible = !0, this.dispatchEvent(new CustomEvent(_.LOCK_UI, {
3978
+ bubbles: !0,
3979
+ composed: !0
3980
+ })));
3981
+ }
3982
+ function ec() {
3983
+ this.visible && (this.visible = !1, this.dispatchEvent(new CustomEvent(_.UNLOCK_UI, {
3984
+ bubbles: !0,
3985
+ composed: !0
3986
+ })));
3987
+ }
3988
+ e(Bs, "observedAttributes", [
3989
+ g.USER_INTERACTING,
3990
+ "open",
3991
+ "touch-enabled"
3992
+ ]);
3993
+ //#endregion
3994
+ //#region ../../libs/player-next/src/components/SeekBar.ts
3995
+ var tc = document.createElement("template");
3996
+ tc.innerHTML = "\n <style>\n :host {\n --buffered: 0;\n --vindral-range-thickness: 3px;\n --vindral-range-hover-thickness: 5px;\n --vindral-range-thumb-size: 10px;\n --vindral-range-thumb-hover-size: 15px;\n --vindral-range-fill-color: linear-gradient(\n 90deg,\n #03a9f4 0%,\n #03a9f4 calc(100% - min(20%, 150px)),\n #b3e5fc 100%\n );\n --vindral-range-thumb-color: #03a9f4;\n display: var(--seek-bar-display);\n position: relative;\n }\n\n :host([data-no-duration]) {\n display: none;\n }\n\n #hover-preview {\n position: absolute;\n background-color: rgba(255, 255, 255, 0.6);\n opacity: 0;\n pointer-events: none;\n z-index: 1;\n }\n\n #time-tooltip {\n position: absolute;\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%) translateY(-8px);\n background: rgba(0, 0, 0, 0.8);\n color: white;\n padding: 4px 8px;\n border-radius: 4px;\n font-size: 12px;\n white-space: nowrap;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s;\n z-index: 10;\n }\n\n @media (hover: none) {\n #time-tooltip {\n display: none;\n }\n }\n </style>\n\n <div id=\"buffered-track\"></div>\n <div id=\"hover-preview\"></div>\n <div id=\"time-tooltip\"></div>\n";
3997
+ var Q = /* @__PURE__ */ new WeakMap(), nc = /* @__PURE__ */ new WeakMap(), rc = /* @__PURE__ */ new WeakMap(), ic = /* @__PURE__ */ new WeakMap(), ac = /* @__PURE__ */ new WeakMap(), oc = /* @__PURE__ */ new WeakMap(), sc = /* @__PURE__ */ new WeakMap(), cc = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakSet(), lc = /* @__PURE__ */ new WeakMap(), uc = /* @__PURE__ */ new WeakMap(), dc = /* @__PURE__ */ new WeakMap(), fc = /* @__PURE__ */ new WeakMap(), pc = /* @__PURE__ */ new WeakMap(), mc = /* @__PURE__ */ new WeakMap(), hc = class extends jr {
3998
+ constructor() {
3999
+ var e, t, n;
4000
+ super(), h(this, $), d(this, Q, void 0), d(this, nc, void 0), d(this, rc, void 0), d(this, ic, !1), d(this, ac, null), d(this, oc, null), d(this, sc, !1), d(this, cc, !1), d(this, lc, (e) => {
4001
+ if (!f($, this, _c).call(this) || f($, this, vc).call(this)) {
4002
+ e.preventDefault();
4003
+ return;
4004
+ }
4005
+ m(ic, this, !0), m(oc, this, e.pointerId);
4006
+ try {
4007
+ this.setPointerCapture(e.pointerId);
4008
+ } catch (e) {}
4009
+ f($, this, xc).call(this, e);
4010
+ }), d(this, uc, (e) => {
4011
+ if (!(!f($, this, _c).call(this) || f($, this, vc).call(this))) {
4012
+ if (p(ac, this) && (cancelAnimationFrame(p(ac, this)), m(ac, this, null)), p(ic, this) && e.pointerId === p(oc, this)) {
4013
+ e.preventDefault(), f($, this, xc).call(this, e);
4014
+ return;
4015
+ }
4016
+ m(ac, this, requestAnimationFrame(() => {
4017
+ if (e.pointerType !== "mouse" || p(ic, this) || !this.duration) {
4018
+ p(rc, this).style.opacity = "0", m(ac, this, null);
4019
+ return;
4020
+ }
4021
+ let t = f($, this, bc).call(this, e.clientX);
4022
+ if (f($, this, Cc).call(this, t, e.clientX), t > this.range.valueAsNumber) {
4023
+ let e = this.range.valueAsNumber * 100, n = (t - this.range.valueAsNumber) * 100;
4024
+ p(rc, this).style.transform = `translateX(${e}%) scaleX(${n / 100})`, p(rc, this).style.opacity = "1";
4025
+ } else p(rc, this).style.opacity = "0";
4026
+ m(ac, this, null);
4027
+ }));
4028
+ }
4029
+ }), d(this, dc, (e) => {
4030
+ if (e.pointerId === p(oc, this)) {
4031
+ try {
4032
+ this.releasePointerCapture(e.pointerId);
4033
+ } catch (e) {}
4034
+ m(ic, this, !1), m(oc, this, null), e.pointerType !== "mouse" && (p(nc, this).style.opacity = "0"), p(cc, this) && f($, this, Ec).call(this) && (m(sc, this, !1), m(cc, this, !1));
4035
+ }
4036
+ }), d(this, fc, () => {
4037
+ this.duration && !f($, this, vc).call(this) && (p(nc, this).style.opacity = "1");
4038
+ }), d(this, pc, () => {
4039
+ p(nc, this).style.opacity = "0", p(rc, this).style.opacity = "0";
4040
+ }), d(this, mc, (e) => {
4041
+ if (f($, this, vc).call(this) || !p(Q, this) || p(Q, this) <= 0 || !Number.isFinite(p(Q, this))) return;
4042
+ let t = f($, this, gc).call(this);
4043
+ if (t <= 0) return;
4044
+ let n = this.range.valueAsNumber * t, r = n;
4045
+ switch (e.preventDefault(), e.key) {
4046
+ case "ArrowLeft":
4047
+ r = Math.max(0, n - 5);
4048
+ break;
4049
+ case "ArrowRight":
4050
+ if (f($, this, Ec).call(this)) return;
4051
+ r = Math.min(t, n + 5);
4052
+ break;
4053
+ case "Home":
4054
+ r = 0;
4055
+ break;
4056
+ case "End":
4057
+ if (f($, this, Ec).call(this)) return;
4058
+ r = t;
4059
+ break;
4060
+ default: return;
4061
+ }
4062
+ let i = Math.min(r / t, 1);
4063
+ f($, this, Sc).call(this, i);
4064
+ }), (e = this.shadowRoot) == null || e.appendChild(tc.content.cloneNode(!0)), m(nc, this, (t = this.shadowRoot) == null ? void 0 : t.getElementById("time-tooltip")), m(rc, this, (n = this.shadowRoot) == null ? void 0 : n.getElementById("hover-preview")), this.addEventListener("pointerdown", p(lc, this)), this.addEventListener("pointermove", p(uc, this)), this.addEventListener("pointerup", p(dc, this)), this.addEventListener("pointercancel", p(dc, this)), this.addEventListener("mouseenter", p(fc, this)), this.addEventListener("mouseleave", p(pc, this));
4065
+ }
4066
+ connectedCallback() {
4067
+ super.connectedCallback(), this.setAttribute("aria-label", "Seek video position"), this.setAttribute("role", "slider"), f($, this, yc).call(this), this.addEventListener("keydown", p(mc, this)), f($, this, Ec).call(this) && (this.range.value = "1", f($, this, yc).call(this));
4068
+ }
4069
+ disconnectedCallback() {
4070
+ super.disconnectedCallback(), this.removeEventListener("pointerdown", p(lc, this)), this.removeEventListener("pointermove", p(uc, this)), this.removeEventListener("pointerup", p(dc, this)), this.removeEventListener("pointercancel", p(dc, this)), this.removeEventListener("mouseenter", p(fc, this)), this.removeEventListener("mouseleave", p(pc, this)), this.removeEventListener("keydown", p(mc, this)), m(oc, this, null);
4071
+ }
4072
+ attributeChangedCallback(e, t, n) {
4073
+ if (super.attributeChangedCallback(e, t, n), t !== n) switch (e) {
4074
+ case g.TIMESHIFT_POSITION:
4075
+ if (f($, this, Ec).call(this)) {
4076
+ p(ic, this) ? m(cc, this, !0) : (m(sc, this, !1), m(cc, this, !1)), this.range.value = "1", f($, this, yc).call(this);
4077
+ return;
4078
+ }
4079
+ if (p(Q, this)) {
4080
+ m(cc, this, !1);
4081
+ let e = Math.max(parseFloat(n) / p(Q, this), 0);
4082
+ this.range.value = e.toString(), f($, this, yc).call(this);
4083
+ }
4084
+ break;
4085
+ case g.DURATION:
4086
+ m(Q, this, parseFloat(n) || 0), f($, this, yc).call(this);
4087
+ break;
4088
+ }
4089
+ }
4090
+ get keysUsed() {
4091
+ return [
4092
+ ...super.keysUsed,
4093
+ "Home",
4094
+ "End"
4095
+ ];
4096
+ }
4097
+ get duration() {
4098
+ return p(Q, this);
4099
+ }
4100
+ set duration(e) {
4101
+ this.setAttribute(g.DURATION, e.toString());
4102
+ }
4103
+ };
4104
+ function gc() {
4105
+ return p(Q, this) ? p(Q, this) : 1;
4106
+ }
4107
+ function _c() {
4108
+ return !!p(Q, this) && p(Q, this) > 0 && Number.isFinite(p(Q, this));
4109
+ }
4110
+ function vc() {
4111
+ return p(sc, this);
4112
+ }
4113
+ function yc() {
4114
+ let e = f($, this, gc).call(this);
4115
+ !p(Q, this) || p(Q, this) <= 0 || !Number.isFinite(p(Q, this)) ? this.setAttribute("data-no-duration", "") : this.removeAttribute("data-no-duration"), p(ic, this) || (this.updateBar(), this.setAttribute("aria-valuetext", `${f($, this, Dc).call(this, this.range.valueAsNumber * e)} of ${f($, this, Dc).call(this, e)}`), !p(ic, this) && !f($, this, vc).call(this) && f($, this, Tc).call(this, this.range.valueAsNumber));
4116
+ }
4117
+ function bc(e) {
4118
+ let t = this.getBoundingClientRect(), n = (e - t.left) / t.width;
4119
+ return Math.max(0, Math.min(1, n));
4120
+ }
4121
+ function xc(e) {
4122
+ let t = f($, this, bc).call(this, e.clientX);
4123
+ f($, this, Cc).call(this, t, e.clientX), p(ic, this) || (p(nc, this).style.opacity = "1"), f($, this, Sc).call(this, t);
4124
+ }
4125
+ function Sc(e) {
4126
+ if (f($, this, vc).call(this) || f($, this, Tc).call(this, e)) return;
4127
+ let t = e * f($, this, gc).call(this);
4128
+ this.range.value = e.toString(), this.updateBar(), f($, this, wc).call(this, t);
4129
+ }
4130
+ function Cc(e, t) {
4131
+ if (!p(Q, this) || !Number.isFinite(p(Q, this))) return;
4132
+ let n = e * p(Q, this), r = p(Q, this) - n;
4133
+ p(nc, this).textContent = `-${f($, this, Dc).call(this, r)}`;
4134
+ let i = this.getBoundingClientRect(), a = (t - i.left) / i.width * 100;
4135
+ p(nc, this).style.left = `${Math.min(Math.max(a, 2), 98)}%`;
4136
+ }
4137
+ function wc(e) {
4138
+ this.dispatchEvent(new CustomEvent("seek", {
4139
+ bubbles: !0,
4140
+ composed: !0,
4141
+ detail: e
4142
+ }));
4143
+ }
4144
+ function Tc(e) {
4145
+ return p(sc, this) || f($, this, Ec).call(this) || e < .999 ? !1 : (m(sc, this, !0), m(cc, this, !1), this.dispatchEvent(new CustomEvent(_.GO_LIVE, {
4146
+ bubbles: !0,
4147
+ composed: !0
4148
+ })), !0);
4149
+ }
4150
+ function Ec() {
4151
+ return !this.hasAttribute(g.TIMESHIFT_POSITION);
4152
+ }
4153
+ function Dc(e) {
4154
+ let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60), r = Math.floor(e % 60);
4155
+ return p(Q, this) && p(Q, this) >= 3600 ? `${t}:${n.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}` : `${n}:${r.toString().padStart(2, "0")}`;
4156
+ }
4157
+ e(hc, "observedAttributes", [
4158
+ ...jr.observedAttributes,
4159
+ g.TIMESHIFT_POSITION,
4160
+ g.DURATION
4161
+ ]);
4162
+ //#endregion
4163
+ //#region ../../libs/player-next/src/components/UserInputPlayOverlay.ts
4164
+ var Oc = document.createElement("template");
4165
+ Oc.innerHTML = `
4166
+ <style>
4167
+ :host {
4168
+ display: var(--play-overlay-display);
4169
+ align-items: center;
4170
+ justify-content: center;
4171
+ position: absolute;
4172
+ top: 0;
4173
+ bottom: 0;
4174
+ left: 0;
4175
+ right: 0;
4176
+ z-index: 1;
4177
+ pointer-events: none;
4178
+ }
4179
+
4180
+ :host([hidden]) {
4181
+ display: none;
4182
+ }
4183
+
4184
+ /* Make icon slots clickable */
4185
+ slot[name="play"],
4186
+ slot[name="unmute"] {
4187
+ color: var(--fg-strong);
4188
+ pointer-events: auto;
4189
+ cursor: pointer;
4190
+ }
4191
+
4192
+ :host(:focus-visible) svg {
4193
+ box-shadow: inset 0 0 0 2px var(--fg-strong);
4194
+ outline: 0;
4195
+ }
4196
+
4197
+ :host(:active) svg {
4198
+ scale: 0.9;
4199
+ }
4200
+
4201
+ slot > svg {
4202
+ width: var(--play-overlay-icon-size);
4203
+ height: var(--play-overlay-icon-size);
4204
+ }
4205
+
4206
+ :host(:not([${g.NEEDS_USER_INPUT_VIDEO}]):not([${g.PAUSED}])) slot[name="play"] {
4207
+ display: none !important;
4208
+ }
4209
+
4210
+ :host([${g.PAUSED}]) slot[name="unmute"],
4211
+ :host(:not([${g.NEEDS_USER_INPUT_AUDIO}])) slot[name="unmute"] {
4212
+ display: none !important;
4213
+ }
4214
+ </style>
4215
+
4216
+ <slot name="icon">
4217
+ <slot name="play">
4218
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 4v16a1 1 0 0 0 1.524 .852l13 -8a1 1 0 0 0 0 -1.704l-13 -8a1 1 0 0 0 -1.524 .852z" /></svg>
4219
+ </slot>
4220
+ <slot name="unmute">
4221
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z" clip-rule="evenodd" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2" /></g></svg>
4222
+ </slot>
4223
+ </slot>
4224
+ `;
4225
+ var kc = /* @__PURE__ */ new WeakMap(), Ac = /* @__PURE__ */ new WeakMap(), jc = /* @__PURE__ */ new WeakMap(), Mc = /* @__PURE__ */ new WeakMap(), Nc = class extends HTMLElement {
4226
+ constructor() {
4227
+ super(), d(this, kc, null), d(this, Ac, () => {
4228
+ this.dispatchEvent(new CustomEvent(_.REQUEST_USER_INPUT, {
4229
+ bubbles: !0,
4230
+ composed: !0
4231
+ }));
4232
+ }), d(this, jc, (e) => {
4233
+ let { key: t } = e;
4234
+ if (!this.keysUsed.includes(t)) {
4235
+ this.removeEventListener("keyup", p(jc, this));
4236
+ return;
4237
+ }
4238
+ this.dispatchEvent(new CustomEvent(_.REQUEST_USER_INPUT, {
4239
+ bubbles: !0,
4240
+ composed: !0
4241
+ }));
4242
+ }), d(this, Mc, (e) => {
4243
+ let { metaKey: t, altKey: n, key: r } = e;
4244
+ if (t || n || !this.keysUsed.includes(r)) {
4245
+ this.removeEventListener("keyup", p(jc, this));
4246
+ return;
4247
+ }
4248
+ this.addEventListener("keyup", p(jc, this), { once: !0 });
4249
+ }), this.attachShadow({ mode: "open" }).appendChild(Oc.content.cloneNode(!0));
4250
+ }
4251
+ get keysUsed() {
4252
+ return ["Enter", " "];
4253
+ }
4254
+ connectedCallback() {
4255
+ var e;
4256
+ m(kc, this, this.closest("vindral-controller")), (e = p(kc, this)) == null || e.connectListener(this), this.setAttribute("aria-label", "Play"), this.setAttribute("role", "button"), this.enable();
4257
+ }
4258
+ enable() {
4259
+ this.addEventListener("click", p(Ac, this)), this.addEventListener("keydown", p(Mc, this)), this.tabIndex = 0;
4260
+ }
4261
+ disable() {
4262
+ this.removeEventListener("click", p(Ac, this)), this.removeEventListener("keydown", p(Mc, this)), this.removeEventListener("keyup", p(jc, this)), this.tabIndex = -1;
4263
+ }
4264
+ disconnectedCallback() {
4265
+ var e;
4266
+ (e = p(kc, this)) == null || e.disconnectListener(this), this.disable();
4267
+ }
4268
+ };
4269
+ e(Nc, "observedAttributes", [
4270
+ "hidden",
4271
+ g.NEEDS_USER_INPUT_VIDEO,
4272
+ g.NEEDS_USER_INPUT_AUDIO,
4273
+ g.PAUSED
4274
+ ]);
4275
+ //#endregion
4276
+ //#region ../../libs/player-next/src/components/VindralMessage.ts
4277
+ var Pc = document.createElement("template");
4278
+ Pc.innerHTML = "\n <style>\n :host,\n #background {\n position: absolute;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n top: 0;\n left: 0;\n background-repeat: no-repeat;\n background-position: 50% 50%;\n background-size: contain;\n font-size: 20px;\n color: var(--fg-strong);\n pointer-events: none;\n transition: opacity 100ms;\n background-color: rgba(0, 0, 0, 0.3);\n }\n\n :host([hidden]) {\n opacity: 0;\n }\n\n #message-container {\n position: absolute;\n left: 50%;\n bottom: calc(50% + var(--play-overlay-icon-size));\n transform: translateX(-50%);\n display: flex;\n flex-direction: column;\n align-items: center;\n width: max-content;\n max-width: 90%;\n pointer-events: none;\n }\n\n #title,\n #description {\n text-align: center;\n text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);\n margin: 0;\n }\n\n #title {\n margin-bottom: var(--padding-2);\n }\n\n @container (max-width: 600px) {\n :host {\n font-size: 15px;\n }\n #message-container {\n bottom: 0;\n top: var(--padding-1);\n }\n }\n\n @container (max-width: 400px) {\n :host {\n font-size: 12px;\n }\n #title {\n margin-bottom: 0;\n }\n }\n\n @container (max-width: 150px) {\n :host {\n font-size: 10px;\n }\n #title,\n #description {\n font-size: 1.2em;\n margin: 0;\n }\n }\n </style>\n\n <div id=\"background\"></div>\n <div id=\"message-container\">\n <h1 id=\"title\"></h1>\n <p id=\"description\"></p>\n </div>\n";
4279
+ var Fc = /* @__PURE__ */ new WeakMap(), Ic = /* @__PURE__ */ new WeakMap(), Lc = /* @__PURE__ */ new WeakMap(), Rc = class extends HTMLElement {
4280
+ constructor() {
4281
+ super(), d(this, Fc, void 0), d(this, Ic, void 0), d(this, Lc, void 0);
4282
+ let e = this.attachShadow({ mode: "open" });
4283
+ e.appendChild(Pc.content.cloneNode(!0)), m(Fc, this, e.querySelector("#title")), m(Ic, this, e.querySelector("#description")), m(Lc, this, e.querySelector("#background"));
4284
+ }
4285
+ connectedCallback() {}
4286
+ disconnectedCallback() {}
4287
+ attributeChangedCallback(e, t, n) {
4288
+ t !== n && (e === "title" ? p(Fc, this).textContent = n : e === "description" ? p(Ic, this).textContent = n : e === "background-image" && (p(Lc, this).style.backgroundImage = `url(${n})`));
4289
+ }
4290
+ };
4291
+ e(Rc, "observedAttributes", [
4292
+ "title",
4293
+ "description",
4294
+ "background-image",
4295
+ "hidden"
4296
+ ]);
4297
+ //#endregion
4298
+ //#region ../../libs/player-next/src/components/VindralPlayOverlay.ts
4299
+ var zc = document.createElement("template");
4300
+ zc.innerHTML = "\n <style>\n :host {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 1;\n pointer-events: none;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n :host(:focus-visible) {\n outline: none;\n outline: 0;\n }\n\n :host(:focus-visible) svg {\n outline: 0;\n }\n\n :host(:where(:focus)) svg {\n box-shadow: none;\n outline: 0;\n }\n\n :host(:active) svg {\n scale: 0.9;\n }\n\n slot#play {\n color: var(--fg-strong);\n pointer-events: auto;\n cursor: pointer;\n }\n\n slot#play > svg {\n width: var(--play-overlay-icon-size);\n height: var(--play-overlay-icon-size);\n }\n </style>\n\n <slot id=\"play\" name=\"icon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M6 4v16a1 1 0 0 0 1.524 .852l13 -8a1 1 0 0 0 0 -1.704l-13 -8a1 1 0 0 0 -1.524 .852z\" /></svg>\n</slot>\n";
4301
+ var Bc = /* @__PURE__ */ new WeakMap(), Vc = class extends HTMLElement {
4302
+ constructor() {
4303
+ super(), d(this, Bc, null), this.attachShadow({ mode: "open" }).appendChild(zc.content.cloneNode(!0));
4304
+ }
4305
+ connectedCallback() {
4306
+ var e;
4307
+ m(Bc, this, this.closest("vindral-controller")), (e = p(Bc, this)) == null || e.connectListener(this), this.setAttribute("aria-label", "Play"), this.setAttribute("role", "button"), this.tabIndex = 0;
4308
+ }
4309
+ disconnectedCallback() {
4310
+ var e;
4311
+ (e = p(Bc, this)) == null || e.disconnectListener(this);
4312
+ }
4313
+ attributeChangedCallback(e, t, n) {
4314
+ t !== n && e === "hidden" && !v(n) && this.focus();
4315
+ }
4316
+ };
4317
+ e(Vc, "observedAttributes", ["hidden"]);
4318
+ //#endregion
4319
+ //#region ../../libs/player-next/src/components/VolumeRange.ts
4320
+ var Hc, Uc = document.createElement("template");
4321
+ Uc.innerHTML = "\n <style>\n :host {\n display: var(--volume-range-display);\n width: 80px;\n }\n\n @media (hover: hover) and (pointer: fine) {\n :host(:hover) {\n background: rgba(255, 255, 255, 0.15);\n }\n }\n\n :host(:active) {\n background: rgba(255, 255, 255, 0.25);\n }\n </style>\n";
4322
+ var Wc = (e) => `${Math.round(e * 100)}%`, Gc = /* @__PURE__ */ new WeakMap(), Kc = class extends jr {
4323
+ constructor() {
4324
+ var e;
4325
+ super(), d(this, Gc, () => {
4326
+ let e = this.range.valueAsNumber;
4327
+ this.dispatchEvent(new CustomEvent(_.SET_VOLUME, {
4328
+ bubbles: !0,
4329
+ composed: !0,
4330
+ detail: e
4331
+ }));
4332
+ }), (e = this.shadowRoot) == null || e.appendChild(Uc.content.cloneNode(!0));
4333
+ }
4334
+ connectedCallback() {
4335
+ super.connectedCallback(), this.range.addEventListener("input", p(Gc, this)), this.range.setAttribute("aria-label", "volume");
4336
+ }
4337
+ disconnectedCallback() {
4338
+ super.disconnectedCallback(), this.range.removeEventListener("input", p(Gc, this));
4339
+ }
4340
+ attributeChangedCallback(e, t, n) {
4341
+ super.attributeChangedCallback(e, t, n), (e === g.MUTED || e === g.VOLUME) && (this.range.valueAsNumber = this.muted ? 0 : parseFloat(this.volume), this.range.setAttribute("aria-valuetext", Wc(this.range.valueAsNumber)), this.updateBar());
4342
+ }
4343
+ get volume() {
4344
+ var e;
4345
+ return (e = this.getAttribute(g.VOLUME)) == null ? "1" : e;
4346
+ }
4347
+ get muted() {
4348
+ return this.hasAttribute(g.MUTED);
4349
+ }
4350
+ };
4351
+ Hc = Kc, e(Kc, "observedAttributes", [
4352
+ ...y(Hc, "observedAttributes", Hc),
4353
+ g.MUTED,
4354
+ g.VOLUME
4355
+ ]);
4356
+ //#endregion
4357
+ //#region ../../libs/player-next/src/registerComponents.ts
4358
+ function qc() {
4359
+ customElements.define("vindral-controller", Mi), customElements.define("vindral-control-bar", Fn), customElements.define("vindral-advanced-rendition-menu", Ge), customElements.define("vindral-advanced-rendition-menu-list", rt), customElements.define("vindral-play-button", fo), customElements.define("vindral-mute-button", ao), customElements.define("vindral-buffering-overlay", At), customElements.define("vindral-scroll-overlay", Bs), customElements.define("vindral-play-overlay", Vc), customElements.define("vindral-user-input-play-overlay", Nc), customElements.define("vindral-fullscreen-button", xa), customElements.define("vindral-rendition-levels-menu", fs), customElements.define("vindral-rendition-levels-menu-list", xs), customElements.define("vindral-channel-grid-button", On), customElements.define("vindral-channel-grid", en), customElements.define("vindral-channel-grid-item", Wt), customElements.define("vindral-pip-button", co), customElements.define("vindral-airplay-button", Ct), customElements.define("vindral-cast-button", Pt), customElements.define("vindral-cast-overlay", Bt), customElements.define("vindral-buffering-icon", Dt), customElements.define("vindral-language-menu", Ea), customElements.define("vindral-language-menu-list", Ba), customElements.define("vindral-message", Rc), customElements.define("vindral-volume-range", Kc), customElements.define("vindral-poster-overlay", is), customElements.define("vindral-player", Wo), customElements.define("vindral-seek-bar", hc), customElements.define("vindral-live-button", no);
4360
+ }
4361
+ //#endregion
4362
+ export { qc as t };