@validol4ik/uikit 0.14.7 → 0.14.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,66 +1,65 @@
1
- var $ = (t) => {
1
+ var te = (t) => {
2
2
  throw TypeError(t);
3
3
  };
4
- var H = (t, r, e) => r.has(t) || $("Cannot " + e);
5
- var R = (t, r, e) => (H(t, r, "read from private field"), e ? e.call(t) : r.get(t)), A = (t, r, e) => r.has(t) ? $("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, e), z = (t, r, e, s) => (H(t, r, "write to private field"), s ? s.call(t, e) : r.set(t, e), e), ee = (t, r, e) => (H(t, r, "access private method"), e);
6
- import { ref as k, onBeforeUnmount as oe, defineComponent as he, watch as te, onMounted as ye, createElementBlock as D, openBlock as O, unref as T, createCommentVNode as re, createElementVNode as F, normalizeClass as se, toDisplayString as ge, nextTick as Re } from "vue";
7
- import ae from "quasar/src/plugins/storage/LocalStorage.js";
8
- import { V as _, D as Se, S as _e, a as ne, b as we, E as Te, c as be, d as Le, B as ke, e as Pe, P as Ae, R as De, W as Oe, f as Ce } from "../types-BzvY-lmh.js";
9
- import { _ as Ie } from "../_plugin-vue_export-helper-CHgC5LLL.js";
10
- const ze = (t, r, e) => {
11
- var a;
12
- const s = (u) => !e.includes(u);
13
- return t.hlsSrc && r.hls && s(_.Hls) ? _.Hls : t.dashSrc && r.dash && s(_.Dash) ? _.Dash : (a = t.sources) != null && a.length && s(_.Progressive) ? _.Progressive : null;
14
- }, Ve = () => {
15
- var s, a;
4
+ var U = (t, r, e) => r.has(t) || te("Cannot " + e);
5
+ var g = (t, r, e) => (U(t, r, "read from private field"), e ? e.call(t) : r.get(t)), I = (t, r, e) => r.has(t) ? te("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, e), K = (t, r, e, a) => (U(t, r, "write to private field"), a ? a.call(t, e) : r.set(t, e), e), re = (t, r, e) => (U(t, r, "access private method"), e);
6
+ import { ref as D, onBeforeUnmount as ie, defineComponent as ye, computed as Ee, watch as se, onMounted as Se, createElementBlock as k, openBlock as b, unref as w, createCommentVNode as A, createElementVNode as G, normalizeClass as ae, toDisplayString as ge, nextTick as ke } from "vue";
7
+ import { V as _, D as be, S as Re, a as ne, b as we, E as _e, c as Te, d as Pe, B as Le, e as oe, P as Ae, f as De, r as Oe, g as Ce, t as Ie, W as ze, h as Ve } from "../playback-DK9szhgq.js";
8
+ import { _ as Ke } from "../_plugin-vue_export-helper-CHgC5LLL.js";
9
+ const Me = (t, r, e) => {
10
+ var o;
11
+ const a = (l) => !e.includes(l);
12
+ return t.hlsSrc && r.hls && a(_.Hls) ? _.Hls : t.dashSrc && r.dash && a(_.Dash) ? _.Dash : (o = t.sources) != null && o.length && a(_.Progressive) ? _.Progressive : null;
13
+ }, Ne = () => {
14
+ var a, o;
16
15
  const { ManagedMediaSource: t, MediaSource: r, WebKitMediaSource: e } = window;
17
- return !!((a = (s = t ?? r ?? e) == null ? void 0 : s.isTypeSupported) != null && a.call(s, Se));
18
- }, Me = (t) => _e.filter((r) => t.includes(r)), Ke = (t) => {
19
- const r = Me(t.map(({ size: s }) => s)), e = r.includes(ne) ? ne : r[0];
20
- return t.find((s) => s.size === e) ?? t[0] ?? null;
21
- }, Ne = () => /iPhone|iPod/.test(navigator.userAgent), xe = () => Ne() || /iPad/.test(navigator.userAgent) || /Macintosh/.test(navigator.userAgent) && navigator.maxTouchPoints > 1;
22
- var M, C, K, P, L, V, ie;
23
- class Be extends EventTarget {
24
- constructor(e, s, a) {
16
+ return !!((o = (a = t ?? r ?? e) == null ? void 0 : a.isTypeSupported) != null && o.call(a, be));
17
+ }, Be = (t) => Re.filter((r) => t.includes(r)), He = (t) => {
18
+ const r = Be(t.map(({ size: a }) => a)), e = r.includes(ne) ? ne : r[0];
19
+ return t.find((a) => a.size === e) ?? t[0] ?? null;
20
+ }, Ye = () => /iPhone|iPod/.test(navigator.userAgent), Fe = () => Ye() || /iPad/.test(navigator.userAgent) || /Macintosh/.test(navigator.userAgent) && navigator.maxTouchPoints > 1;
21
+ var N, z, B, C, P, M, le;
22
+ class We extends EventTarget {
23
+ constructor(e, a, o) {
25
24
  super();
26
- A(this, L);
27
- A(this, M);
28
- A(this, C);
29
- A(this, K);
30
- A(this, P, -1);
31
- z(this, M, e), z(this, C, [...s].sort((u, i) => i.size - u.size)), z(this, K, a);
25
+ I(this, P);
26
+ I(this, N);
27
+ I(this, z);
28
+ I(this, B);
29
+ I(this, C, -1);
30
+ K(this, N, e), K(this, z, [...a].sort((l, i) => i.size - l.size)), K(this, B, o);
32
31
  }
33
32
  get selectedIndex() {
34
- return R(this, P);
33
+ return g(this, C);
35
34
  }
36
35
  set selectedIndex(e) {
37
- const s = R(this, L, V);
38
- z(this, P, e), R(this, L, V) !== s && ee(this, L, ie).call(this), this.dispatchEvent(new Event("change"));
36
+ const a = g(this, P, M);
37
+ K(this, C, e), g(this, P, M) !== a && re(this, P, le).call(this), this.dispatchEvent(new Event("change"));
39
38
  }
40
39
  *[Symbol.iterator]() {
41
- for (const [e, s] of R(this, C).entries())
40
+ for (const [e, a] of g(this, z).entries())
42
41
  yield {
43
- id: String(s.size),
44
- height: s.size,
45
- selected: e === R(this, P),
46
- active: s === R(this, L, V)
42
+ id: String(a.size),
43
+ height: a.size,
44
+ selected: e === g(this, C),
45
+ active: a === g(this, P, M)
47
46
  };
48
47
  }
49
48
  }
50
- M = new WeakMap(), C = new WeakMap(), K = new WeakMap(), P = new WeakMap(), L = new WeakSet(), V = function() {
51
- return R(this, C)[R(this, P)] ?? R(this, K);
49
+ N = new WeakMap(), z = new WeakMap(), B = new WeakMap(), C = new WeakMap(), P = new WeakSet(), M = function() {
50
+ return g(this, z)[g(this, C)] ?? g(this, B);
52
51
  }, // Loading a new src resets the position and speed
53
- ie = function() {
54
- const e = R(this, M), s = e.currentTime, a = e.playbackRate, u = !e.paused;
52
+ le = function() {
53
+ const e = g(this, N), a = e.currentTime, o = e.playbackRate, l = !e.paused;
55
54
  e.addEventListener(
56
55
  "loadedmetadata",
57
56
  () => {
58
- s && (e.currentTime = s), e.playbackRate = a, u && e.play();
57
+ a && (e.currentTime = a), e.playbackRate = o, l && e.play();
59
58
  },
60
59
  { once: !0 }
61
- ), s && (e.preload = "metadata"), e.src = R(this, L, V).src;
60
+ ), a && (e.preload = "metadata"), e.src = g(this, P, M).src;
62
61
  };
63
- const He = (t, r) => {
62
+ const Ue = (t, r) => {
64
63
  t.preload = "metadata", t.addEventListener(
65
64
  "loadedmetadata",
66
65
  () => {
@@ -69,60 +68,60 @@ const He = (t, r) => {
69
68
  },
70
69
  { once: !0 }
71
70
  );
72
- }, le = () => {
71
+ }, ce = () => {
73
72
  let t = 0, r = 0;
74
73
  return (e) => {
75
- const s = Date.now();
76
- if (s - r > Le && (t = 0), r = s, t >= Te) return !1;
77
- const a = t++;
78
- return setTimeout(() => e(a), be * 2 ** a), !0;
74
+ const a = Date.now();
75
+ if (a - r > Pe && (t = 0), r = a, t >= _e) return !1;
76
+ const o = t++;
77
+ return setTimeout(() => e(o), Te * 2 ** o), !0;
79
78
  };
80
79
  }, ue = (t, r) => {
81
- const { currentTime: e, playbackRate: s, paused: a } = t;
80
+ const { currentTime: e, playbackRate: a, paused: o } = t;
82
81
  return () => {
83
82
  t.addEventListener(
84
83
  "loadedmetadata",
85
84
  () => {
86
- t.currentTime = e, t.playbackRate = s, a || t.play().catch(() => {
85
+ t.currentTime = e, t.playbackRate = a, o || t.play().catch(() => {
87
86
  });
88
87
  },
89
88
  { once: !0 }
90
89
  ), r(e);
91
90
  };
92
- }, Fe = (t, r, e) => {
93
- let s = null;
94
- const a = le();
91
+ }, Ge = (t, r, e) => {
92
+ let a = null;
93
+ const o = ce();
95
94
  t.addEventListener("loadstart", () => {
96
- if (!t.engine || t.engine === s) return;
95
+ if (!t.engine || t.engine === a) return;
97
96
  const i = t.engine;
98
- s = i;
99
- const c = () => t.engine === i;
100
- i.on(r.Events.ERROR, async (p, d) => {
101
- var n;
97
+ a = i;
98
+ const p = () => t.engine === i;
99
+ i.on(r.Events.ERROR, async (u, d) => {
100
+ var T;
102
101
  if (!d.fatal) return;
103
- const m = (E) => {
104
- var h, y;
102
+ const m = (n) => {
103
+ var f, y;
105
104
  return e.report({
106
105
  type: d.type,
107
106
  details: d.details,
108
- status: (h = d.response) == null ? void 0 : h.code,
107
+ status: (f = d.response) == null ? void 0 : f.code,
109
108
  url: ((y = d.frag) == null ? void 0 : y.url) ?? d.url,
110
- recovering: E
109
+ recovering: n
111
110
  });
112
111
  }, S = () => {
113
112
  m(!0), e.dismissError();
114
113
  };
115
114
  if (d.type === r.ErrorTypes.NETWORK_ERROR) {
116
- if (((n = d.response) == null ? void 0 : n.code) === 401 && await e.reauthorize()) {
115
+ if (((T = d.response) == null ? void 0 : T.code) === 401 && await e.reauthorize()) {
117
116
  S(), i.startLoad(t.currentTime);
118
117
  return;
119
118
  }
120
- if (e.hasLoaded() && a(() => c() && i.startLoad(t.currentTime))) {
119
+ if (e.hasLoaded() && o(() => p() && i.startLoad(t.currentTime))) {
121
120
  S();
122
121
  return;
123
122
  }
124
- } else if (d.type === r.ErrorTypes.MEDIA_ERROR && e.hasLoaded() && a((E) => {
125
- c() && (E > 0 && i.swapAudioCodec(), i.recoverMediaError());
123
+ } else if (d.type === r.ErrorTypes.MEDIA_ERROR && e.hasLoaded() && o((n) => {
124
+ p() && (n > 0 && i.swapAudioCodec(), i.recoverMediaError());
126
125
  })) {
127
126
  S();
128
127
  return;
@@ -131,7 +130,7 @@ const He = (t, r) => {
131
130
  }), i.on(r.Events.FRAG_LOADED, e.loaded);
132
131
  }), t.addEventListener("error", async () => {
133
132
  if (t.engine) return;
134
- const i = ue(t, () => t.load()), c = (d) => {
133
+ const i = ue(t, () => t.load()), p = (d) => {
135
134
  var m;
136
135
  return e.report({
137
136
  type: "nativeError",
@@ -139,46 +138,46 @@ const He = (t, r) => {
139
138
  recovering: d
140
139
  });
141
140
  };
142
- if ((await e.reauthorize() || e.hasLoaded()) && a(() => t.isConnected && i())) {
143
- c(!0), e.dismissError();
141
+ if ((await e.reauthorize() || e.hasLoaded()) && o(() => t.isConnected && i())) {
142
+ p(!0), e.dismissError();
144
143
  return;
145
144
  }
146
- c(!1), e.fail();
145
+ p(!1), e.fail();
147
146
  }), t.addEventListener("loadeddata", e.loaded);
148
- const u = xe();
149
- e.withCredentials && !u && (t.crossOrigin = "use-credentials"), t.source = {
147
+ const l = Fe();
148
+ e.withCredentials && !l && (t.crossOrigin = "use-credentials"), t.source = {
150
149
  src: e.src,
151
- preferPlayback: u ? "native" : "mse"
150
+ preferPlayback: l ? "native" : "mse"
152
151
  };
153
- }, We = (t, r) => {
152
+ }, je = (t, r) => {
154
153
  const e = t.engine;
155
154
  e.setXHRWithCredentialsForType("default", r.withCredentials);
156
- const s = le(), a = () => ue(
155
+ const a = ce(), o = () => ue(
157
156
  t,
158
- (u) => e.attachSource(r.src, u)
157
+ (l) => e.attachSource(r.src, l)
159
158
  );
160
- e.on("error", async (u) => {
159
+ e.on("error", async (l) => {
161
160
  var d, m;
162
- const i = u.error, c = (m = (d = i.data) == null ? void 0 : d.response) == null ? void 0 : m.status, p = (S) => r.report({
161
+ const i = l.error, p = (m = (d = i.data) == null ? void 0 : d.response) == null ? void 0 : m.status, u = (S) => r.report({
163
162
  type: "dashError",
164
163
  details: String(i.code ?? ""),
165
- status: c,
164
+ status: p,
166
165
  recovering: S
167
166
  });
168
- if (c === 401) {
167
+ if (p === 401) {
169
168
  if (await r.reauthorize()) {
170
- p(!0), a()();
169
+ u(!0), o()();
171
170
  return;
172
171
  }
173
172
  } else if (!we.includes(i.code ?? -1))
174
173
  return;
175
- p(!1), r.fail();
174
+ u(!1), r.fail();
176
175
  }), e.on("fragmentLoadingCompleted", r.loaded), t.addEventListener("error", () => {
177
- var c;
178
- const u = a(), i = r.hasLoaded() && s(() => t.isConnected && u());
176
+ var p;
177
+ const l = o(), i = r.hasLoaded() && a(() => t.isConnected && l());
179
178
  r.report({
180
179
  type: "mediaError",
181
- details: String(((c = t.error) == null ? void 0 : c.code) ?? ""),
180
+ details: String(((p = t.error) == null ? void 0 : p.code) ?? ""),
182
181
  recovering: i
183
182
  }), i ? r.dismissError() : r.fail();
184
183
  }), t.source = {
@@ -193,95 +192,104 @@ const He = (t, r) => {
193
192
  }
194
193
  }
195
194
  };
196
- }, Ye = (t, r) => {
197
- const e = Ke(r);
195
+ }, qe = (t, r) => {
196
+ const e = He(r);
198
197
  e && (Object.assign(t, {
199
- videoRenditions: new Be(t, r, e)
198
+ videoRenditions: new We(t, r, e)
200
199
  }), t.src = e.src);
201
- }, Ue = "media-controls-content, .media-popup, media-error-dialog", Ge = (t) => t instanceof Element && t.matches(Ue), qe = (t) => {
202
- const r = k(!1);
203
- let e, s = 1, a = null;
204
- const u = () => {
200
+ }, Je = "media-controls-content, .media-popup, media-error-dialog", Qe = (t) => t instanceof Element && t.matches(Je), Xe = (t) => {
201
+ const r = D(!1);
202
+ let e, a = 1, o = !1, l = null;
203
+ const i = () => {
205
204
  var n;
206
205
  return (n = t.value) == null ? void 0 : n.store;
207
- }, i = () => {
208
- const n = u();
209
- !n || n.paused || (s = n.playbackRate, n.setPlaybackRate(Pe), r.value = !0);
210
- }, c = () => {
211
- var n;
212
- return clearTimeout(e), a == null || a(), a = null, r.value ? (r.value = !1, (n = u()) == null || n.setPlaybackRate(s), !0) : !1;
213
- }, p = (n, E, h) => {
214
- c(), E && (e = setTimeout(i, ke));
215
- const y = (f) => {
216
- if (f instanceof KeyboardEvent) {
217
- if (f.key !== " ") return;
218
- f.preventDefault(), f.stopPropagation();
206
+ }, p = () => {
207
+ o = !0;
208
+ const n = i();
209
+ !n || n.paused || n.playbackRate >= oe || (a = n.playbackRate, n.setPlaybackRate(oe), r.value = !0);
210
+ }, u = () => {
211
+ var f;
212
+ clearTimeout(e), l == null || l(), l = null;
213
+ const n = o;
214
+ return o = !1, r.value && (r.value = !1, (f = i()) == null || f.setPlaybackRate(a)), n;
215
+ }, d = (n, f, y) => {
216
+ u(), f && (e = setTimeout(p, Le));
217
+ const R = (h) => {
218
+ if (h instanceof KeyboardEvent) {
219
+ if (h.key !== " ") return;
220
+ h.preventDefault(), h.stopPropagation();
219
221
  }
220
- const w = c();
221
- h == null || h(w);
222
+ const L = u();
223
+ y == null || y(L);
222
224
  };
223
- n.forEach((f) => window.addEventListener(f, y, !0)), window.addEventListener("blur", c), a = () => {
225
+ n.forEach((h) => window.addEventListener(h, R, !0)), window.addEventListener("blur", u), l = () => {
224
226
  n.forEach(
225
- (f) => window.removeEventListener(f, y, !0)
226
- ), window.removeEventListener("blur", c);
227
+ (h) => window.removeEventListener(h, R, !0)
228
+ ), window.removeEventListener("blur", u);
227
229
  };
228
- }, d = (n) => {
229
- var f;
230
+ }, m = (n) => {
231
+ var h;
230
232
  if (n.key !== " " || n.altKey || n.ctrlKey || n.metaKey)
231
233
  return;
232
234
  if (n.repeat) {
233
- a && (n.preventDefault(), n.stopPropagation());
235
+ l && (n.preventDefault(), n.stopPropagation());
234
236
  return;
235
237
  }
236
- const E = u(), h = document.activeElement;
237
- if (!E || !h || !((f = t.value) != null && f.contains(h))) return;
238
+ const f = i(), y = document.activeElement;
239
+ if (!f || !y || !((h = t.value) != null && h.contains(y))) return;
238
240
  n.preventDefault(), n.stopPropagation();
239
- const y = E.paused;
240
- y && E.play(), p(["keyup"], !y, (w) => {
241
- !y && !w && E.pause();
241
+ const R = f.paused;
242
+ R && f.play(), d(["keyup"], !R, (L) => {
243
+ !R && !L && f.pause();
242
244
  });
243
- }, m = (n) => {
244
- const E = u();
245
- !E || E.paused || n.button !== 0 || n.composedPath().some(Ge) || p(["pointerup", "pointercancel"], !0);
246
245
  }, S = (n) => {
246
+ const f = i();
247
+ !f || f.paused || n.button !== 0 || n.composedPath().some(Qe) || d(["pointerup", "pointercancel"], !0);
248
+ }, T = (n) => {
247
249
  r.value && n.preventDefault();
248
250
  };
249
- return oe(c), { boosted: r, release: c, onKeyDown: d, onPointerDown: m, onContextMenu: S };
250
- }, W = "app-video-player", je = "linear-gradient(to top, rgb(0 0 0 / 0.15), rgb(0 0 0 / 0.05), rgb(0 0 0 / 0.02))", Je = async () => {
251
- if (customElements.get(W)) return;
251
+ return ie(u), { boosted: r, release: u, onKeyDown: m, onPointerDown: S, onContextMenu: T };
252
+ }, j = "app-video-player", Ze = `linear-gradient(to top,
253
+ color-mix(in oklab, var(--media-backdrop) 40%, transparent),
254
+ color-mix(in oklab, var(--media-backdrop) 12%, transparent) 50%,
255
+ color-mix(in oklab, var(--media-backdrop) 2%, transparent) 75%,
256
+ transparent)`, $e = async () => {
257
+ if (customElements.get(j)) return;
252
258
  const [{ createPlayer: t, definePlayerFeature: r }, { videoFeatures: e }] = await Promise.all([
253
259
  import("@videojs/html"),
254
260
  import("@videojs/html/video")
255
- ]), s = r({
261
+ ]), a = r({
256
262
  name: "idleControls",
257
263
  // the fields belong to the playback and controls features, this one only reads and sets them
258
264
  state: () => ({}),
259
- attach({ target: u, signal: i, store: c, get: p, set: d }) {
260
- var n;
261
- (n = u.container) == null || n.style.setProperty(
265
+ attach({ target: l, signal: i, store: p, get: u, set: d }) {
266
+ var T;
267
+ (T = l.container) == null || T.style.setProperty(
262
268
  "--media-controls-gradient",
263
- je
269
+ Ze
264
270
  );
265
271
  const m = () => {
266
- const { paused: E, started: h, ended: y, userActive: f, controlsVisible: w } = p();
267
- return E && h && !y && !f && w;
268
- }, S = c.subscribe(() => {
272
+ const { paused: n, started: f, ended: y, userActive: R, controlsVisible: h } = u();
273
+ return n && f && !y && !R && h;
274
+ }, S = p.subscribe(() => {
269
275
  m() && queueMicrotask(() => {
270
276
  !i.aborted && m() && d({ controlsVisible: !1 });
271
277
  });
272
278
  });
273
279
  i.addEventListener("abort", S, { once: !0 });
274
280
  }
275
- }), { PlayerElement: a } = t({
276
- features: [...e, s]
281
+ }), { PlayerElement: o } = t({
282
+ features: [...e, a]
277
283
  });
278
- customElements.get(W) || customElements.define(W, a);
279
- }, Qe = ["lang"], Xe = ["poster"], Ze = { class: "app-video__skin" }, $e = /* @__PURE__ */ he({
284
+ customElements.get(j) || customElements.define(j, o);
285
+ }, xe = ["lang"], et = ["poster", "default-playback-rates"], tt = { class: "app-video__skin" }, rt = ["crossorigin"], st = ["src"], at = ["src"], nt = ["crossorigin"], ot = ["src"], it = ["src"], lt = ["crossorigin"], ct = ["src"], ut = ["src"], dt = /* @__PURE__ */ ye({
280
286
  __name: "AppVideo",
281
287
  props: {
282
288
  hlsSrc: {},
283
289
  dashSrc: {},
284
290
  sources: {},
291
+ chaptersSrc: {},
292
+ thumbnailsSrc: {},
285
293
  poster: {},
286
294
  withCredentials: { type: Boolean, default: !0 },
287
295
  authorize: {},
@@ -289,174 +297,212 @@ const He = (t, r) => {
289
297
  watermark: {},
290
298
  color: {}
291
299
  },
292
- emits: ["error"],
300
+ emits: ["error", "progress", "ended"],
293
301
  setup(t, { emit: r }) {
294
- const e = t, s = r, a = k(null), u = k(null), i = k(null), c = k([]), p = k(null), d = k(!0), m = k(!1), { boosted: S, release: n, onKeyDown: E, onPointerDown: h, onContextMenu: y } = qe(a);
295
- let f = null, w = !1, N = !1, I, Y, U, x = 0, g = null;
296
- const ce = (o) => {
297
- var l;
298
- if (p.value !== o) return;
299
- const v = N ? u.value : null;
300
- g = {
301
- time: v ? v.currentTime : (g == null ? void 0 : g.time) ?? 0,
302
- rate: v ? v.playbackRate : (g == null ? void 0 : g.rate) ?? 1,
303
- playing: !!(g != null && g.playing) || ((l = a.value) == null ? void 0 : l.store.paused) === !1
304
- }, c.value = [...c.value, o];
305
- }, G = async () => {
302
+ const e = t, a = r, o = D(null), l = D(null), i = D(null), p = D([]), u = D(null), d = D(!0), m = D(!1), S = Ee(() => {
303
+ if (!(!e.chaptersSrc && !e.thumbnailsSrc))
304
+ return e.withCredentials ? "use-credentials" : "anonymous";
305
+ }), { boosted: T, release: n, onKeyDown: f, onPointerDown: y, onContextMenu: R } = Xe(o);
306
+ let h = null, L = !1, H = !1, V, q, J, F = 0, E = null;
307
+ const de = (s) => {
308
+ var c;
309
+ if (u.value !== s) return;
310
+ const v = H ? l.value : null;
311
+ E = {
312
+ time: v ? v.currentTime : (E == null ? void 0 : E.time) ?? 0,
313
+ rate: v ? v.playbackRate : (E == null ? void 0 : E.rate) ?? 1,
314
+ playing: !!(E != null && E.playing) || ((c = o.value) == null ? void 0 : c.store.paused) === !1
315
+ }, p.value = [...p.value, s];
316
+ }, Q = async () => {
306
317
  if (!e.authorize) return !0;
307
318
  try {
308
319
  return await e.authorize(), !0;
309
- } catch (o) {
310
- return console.error("Video authorization failed", o), !1;
320
+ } catch (s) {
321
+ return console.error("Video authorization failed", s), !1;
311
322
  }
312
- }, q = (o, v) => ({
313
- src: o ?? "",
323
+ }, X = (s, v) => ({
324
+ src: s ?? "",
314
325
  withCredentials: e.withCredentials,
315
- reauthorize: async () => w ? !1 : (w = !0, G()),
326
+ reauthorize: async () => L ? !1 : (L = !0, Q()),
316
327
  loaded: () => {
317
- w = !1, N = !0;
328
+ L = !1, H = !0;
318
329
  },
319
- hasLoaded: () => N,
320
- fail: () => ce(v),
321
- report: (l) => {
322
- var b;
323
- return s("error", {
324
- ...l,
330
+ hasLoaded: () => H,
331
+ fail: () => de(v),
332
+ report: (c) => {
333
+ var O;
334
+ return a("error", {
335
+ ...c,
325
336
  mode: v,
326
- time: ((b = u.value) == null ? void 0 : b.currentTime) ?? 0
337
+ time: ((O = l.value) == null ? void 0 : O.currentTime) ?? 0
327
338
  });
328
339
  },
329
340
  dismissError: () => queueMicrotask(() => {
330
- var l;
331
- return (l = a.value) == null ? void 0 : l.store.dismissError();
341
+ var c;
342
+ return (c = o.value) == null ? void 0 : c.store.dismissError();
332
343
  })
333
- }), de = (o) => {
334
- if (!e.resumeKey) return;
335
- const v = e.resumeKey;
336
- let l = Number(ae.getItem(v)) || 0;
337
- if (l) {
338
- const b = l;
339
- o.addEventListener(
340
- "loadedmetadata",
341
- () => o.currentTime = b,
342
- { once: !0 }
343
- );
344
- }
345
- o.addEventListener("timeupdate", () => {
346
- Math.abs(o.currentTime - l) >= De && (l = o.currentTime, ae.setItem(v, l));
347
- });
348
- }, pe = () => {
349
- e.watermark && (Y = setInterval(() => {
350
- var o;
351
- (((o = a.value) == null ? void 0 : o.store.paused) ?? !0) || (m.value = !0, U = setTimeout(() => {
344
+ }), pe = () => {
345
+ e.watermark && (q = setInterval(() => {
346
+ var s;
347
+ (((s = o.value) == null ? void 0 : s.store.paused) ?? !0) || (m.value = !0, J = setTimeout(() => {
352
348
  m.value = !1;
353
- }, Oe));
354
- }, Ce));
355
- }, fe = async (o) => {
356
- var Q;
357
- const v = ++x;
358
- await Re();
359
- const l = u.value, b = (Q = a.value) == null ? void 0 : Q.store;
360
- if (!(!l || !b) && (w = !1, N = !1, o !== _.Progressive && await G(), v === x)) {
361
- if (de(l), g) {
362
- const { time: X, rate: me, playing: Ee } = g, Z = () => {
363
- g = null, X && (l.currentTime = X), l.playbackRate = me;
349
+ }, ze));
350
+ }, Ve));
351
+ }, fe = async (s) => {
352
+ var x;
353
+ const v = ++F;
354
+ await ke();
355
+ const c = l.value, O = (x = o.value) == null ? void 0 : x.store;
356
+ if (!(!c || !O) && (L = !1, H = !1, s !== _.Progressive && await Q(), v === F)) {
357
+ if (e.resumeKey && Oe(c, e.resumeKey), Ce(c, () => T.value), Ie(
358
+ c,
359
+ (Y) => a("progress", Y),
360
+ () => a("ended")
361
+ ), E) {
362
+ const { time: Y, rate: me, playing: ve } = E, ee = () => {
363
+ E = null, Y && (c.currentTime = Y), c.playbackRate = me;
364
364
  };
365
- Ee ? He(l, Z) : l.addEventListener("loadedmetadata", Z, { once: !0 });
365
+ ve ? Ue(c, ee) : c.addEventListener("loadedmetadata", ee, { once: !0 });
366
366
  }
367
- o === _.Hls && f ? Fe(
368
- l,
369
- f,
370
- q(e.hlsSrc, o)
371
- ) : o === _.Dash ? We(
372
- l,
373
- q(e.dashSrc, o)
374
- ) : Ye(l, e.sources ?? []), d.value = b.controlsVisible, I = b.subscribe(() => {
375
- d.value = b.controlsVisible;
367
+ s === _.Hls && h ? Ge(
368
+ c,
369
+ h,
370
+ X(e.hlsSrc, s)
371
+ ) : s === _.Dash ? je(
372
+ c,
373
+ X(e.dashSrc, s)
374
+ ) : qe(c, e.sources ?? []), d.value = O.controlsVisible, V = O.subscribe(() => {
375
+ d.value = O.controlsVisible;
376
376
  }), pe();
377
377
  }
378
- }, B = () => {
379
- x++, n(), I == null || I(), I = void 0, clearInterval(Y), clearTimeout(U), m.value = !1;
380
- }, j = () => {
378
+ }, W = () => {
379
+ F++, n(), V == null || V(), V = void 0, clearInterval(q), clearTimeout(J), m.value = !1;
380
+ }, Z = () => {
381
381
  if (!i.value) return;
382
- const o = ze(e, i.value, c.value);
383
- o !== p.value && (!o && p.value || (B(), p.value = o, o && fe(o)));
384
- }, ve = async () => {
385
- const [o] = await Promise.all([
382
+ const s = Me(e, i.value, p.value);
383
+ s !== u.value && (!s && u.value || (W(), u.value = s, s && fe(s)));
384
+ }, he = async () => {
385
+ const [s] = await Promise.all([
386
386
  e.hlsSrc ? import("@videojs/hlsjs-video") : null,
387
387
  e.hlsSrc ? import("@videojs/html/media/hlsjs-video") : null,
388
388
  e.dashSrc ? import("@videojs/html/media/dash-video") : null,
389
389
  import("@videojs/html/i18n"),
390
390
  import("@videojs/html/i18n/locales/uk/register"),
391
- Je(),
391
+ $e(),
392
392
  import("@videojs/html/video/skin")
393
393
  ]);
394
- return f = (o == null ? void 0 : o.Hls) ?? null, {
395
- hls: !!f && (f.isSupported() || !!document.createElement("video").canPlayType("application/vnd.apple.mpegurl")),
396
- dash: !!e.dashSrc && Ve()
394
+ return h = (s == null ? void 0 : s.Hls) ?? null, {
395
+ hls: !!h && (h.isSupported() || !!document.createElement("video").canPlayType("application/vnd.apple.mpegurl")),
396
+ dash: !!e.dashSrc && Ne()
397
397
  };
398
- }, J = async () => {
399
- i.value = await ve(), j();
398
+ }, $ = async () => {
399
+ i.value = await he(), Z();
400
400
  };
401
- return te(c, j), te(
401
+ return se(p, Z), se(
402
402
  () => JSON.stringify([e.hlsSrc, e.dashSrc, e.sources]),
403
403
  () => {
404
- B(), g = null, p.value = null, i.value = null, c.value = [], J();
404
+ W(), E = null, u.value = null, i.value = null, p.value = [], $();
405
405
  }
406
- ), ye(J), oe(B), (o, v) => (O(), D("div", {
406
+ ), Se($), ie(W), (s, v) => (b(), k("div", {
407
407
  class: "app-video",
408
408
  onKeydownCapture: v[0] || (v[0] = //@ts-ignore
409
- (...l) => T(E) && T(E)(...l)),
409
+ (...c) => w(f) && w(f)(...c)),
410
410
  onPointerdownCapture: v[1] || (v[1] = //@ts-ignore
411
- (...l) => T(h) && T(h)(...l)),
411
+ (...c) => w(y) && w(y)(...c)),
412
412
  onContextmenuCapture: v[2] || (v[2] = //@ts-ignore
413
- (...l) => T(y) && T(y)(...l))
413
+ (...c) => w(R) && w(R)(...c))
414
414
  }, [
415
- p.value ? (O(), D("media-i18n", {
416
- key: p.value,
417
- lang: T(Ae)
415
+ u.value ? (b(), k("media-i18n", {
416
+ key: u.value,
417
+ lang: w(Ae)
418
418
  }, [
419
- F("app-video-player", {
419
+ G("app-video-player", {
420
420
  ref_key: "playerEl",
421
- ref: a,
422
- poster: o.poster
421
+ ref: o,
422
+ poster: s.poster,
423
+ "default-playback-rates": w(De).join(" ")
423
424
  }, [
424
- F("video-skin", Ze, [
425
- p.value === T(_).Hls ? (O(), D("hlsjs-video", {
425
+ G("video-skin", tt, [
426
+ u.value === w(_).Hls ? (b(), k("hlsjs-video", {
426
427
  key: 0,
427
428
  ref_key: "mediaEl",
428
- ref: u,
429
+ ref: l,
430
+ crossorigin: S.value,
429
431
  preload: "none",
430
432
  playsinline: ""
431
- }, null, 512)) : p.value === T(_).Dash ? (O(), D("dash-video", {
433
+ }, [
434
+ s.chaptersSrc ? (b(), k("track", {
435
+ key: s.chaptersSrc,
436
+ kind: "chapters",
437
+ default: "",
438
+ src: s.chaptersSrc
439
+ }, null, 8, st)) : A("", !0),
440
+ s.thumbnailsSrc ? (b(), k("track", {
441
+ key: s.thumbnailsSrc,
442
+ kind: "metadata",
443
+ label: "thumbnails",
444
+ default: "",
445
+ src: s.thumbnailsSrc
446
+ }, null, 8, at)) : A("", !0)
447
+ ], 8, rt)) : u.value === w(_).Dash ? (b(), k("dash-video", {
432
448
  key: 1,
433
449
  ref_key: "mediaEl",
434
- ref: u,
450
+ ref: l,
451
+ crossorigin: S.value,
435
452
  preload: "none",
436
453
  playsinline: ""
437
- }, null, 512)) : (O(), D("video", {
454
+ }, [
455
+ s.chaptersSrc ? (b(), k("track", {
456
+ key: s.chaptersSrc,
457
+ kind: "chapters",
458
+ default: "",
459
+ src: s.chaptersSrc
460
+ }, null, 8, ot)) : A("", !0),
461
+ s.thumbnailsSrc ? (b(), k("track", {
462
+ key: s.thumbnailsSrc,
463
+ kind: "metadata",
464
+ label: "thumbnails",
465
+ default: "",
466
+ src: s.thumbnailsSrc
467
+ }, null, 8, it)) : A("", !0)
468
+ ], 8, nt)) : (b(), k("video", {
438
469
  key: 2,
439
470
  ref_key: "mediaEl",
440
- ref: u,
471
+ ref: l,
472
+ crossorigin: S.value,
441
473
  preload: "none",
442
474
  playsinline: ""
443
- }, null, 512)),
444
- o.watermark ? (O(), D("div", {
475
+ }, [
476
+ s.chaptersSrc ? (b(), k("track", {
477
+ key: s.chaptersSrc,
478
+ kind: "chapters",
479
+ default: "",
480
+ src: s.chaptersSrc
481
+ }, null, 8, ct)) : A("", !0),
482
+ s.thumbnailsSrc ? (b(), k("track", {
483
+ key: s.thumbnailsSrc,
484
+ kind: "metadata",
485
+ label: "thumbnails",
486
+ default: "",
487
+ src: s.thumbnailsSrc
488
+ }, null, 8, ut)) : A("", !0)
489
+ ], 8, lt)),
490
+ s.watermark ? (b(), k("div", {
445
491
  key: 3,
446
- class: se(["app-video__watermark", {
492
+ class: ae(["app-video__watermark", {
447
493
  "app-video__watermark_visible": m.value,
448
494
  "app-video__watermark_raised": d.value
449
495
  }])
450
- }, ge(o.watermark), 3)) : re("", !0),
451
- F("div", {
452
- class: se(["app-video__boost", { "app-video__boost_visible": T(S) }])
496
+ }, ge(s.watermark), 3)) : A("", !0),
497
+ G("div", {
498
+ class: ae(["app-video__boost", { "app-video__boost_visible": w(T) }])
453
499
  }, " 2× ", 2)
454
500
  ])
455
- ], 8, Xe)
456
- ], 8, Qe)) : re("", !0)
501
+ ], 8, et)
502
+ ], 8, xe)) : A("", !0)
457
503
  ], 32));
458
504
  }
459
- }), nt = /* @__PURE__ */ Ie($e, [["__scopeId", "data-v-e7b77478"]]);
505
+ }), vt = /* @__PURE__ */ Ke(dt, [["__scopeId", "data-v-7fa00f90"]]);
460
506
  export {
461
- nt as AppVideo
507
+ vt as AppVideo
462
508
  };