@validol4ik/uikit 0.15.1 → 0.15.3

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