diff --git a/3parties/dash.all.min.js b/3parties/dash.all.min.js index de590e5..3d9ac9e 100644 --- a/3parties/dash.all.min.js +++ b/3parties/dash.all.min.js @@ -1,47515 +1,3 @@ /*! For license information please see dash.all.min.js.LICENSE.txt */ -!function(t, e) { - "object" == typeof exports && "object" == typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? exports.dashjs = e() : t.dashjs = e() -}(self, (function() { - return function() { - var t = { - 7267: function(t, e) { - "use strict"; - e.byteLength = function(t) { - var e = l(t) - , n = e[0] - , a = e[1]; - return 3 * (n + a) / 4 - a - } - , - e.toByteArray = function(t) { - var e, n, i = l(t), o = i[0], s = i[1], u = new r(function(t, e, n) { - return 3 * (e + n) / 4 - n - }(0, o, s)), c = 0, d = s > 0 ? o - 4 : o; - for (n = 0; n < d; n += 4) - e = a[t.charCodeAt(n)] << 18 | a[t.charCodeAt(n + 1)] << 12 | a[t.charCodeAt(n + 2)] << 6 | a[t.charCodeAt(n + 3)], - u[c++] = e >> 16 & 255, - u[c++] = e >> 8 & 255, - u[c++] = 255 & e; - return 2 === s && (e = a[t.charCodeAt(n)] << 2 | a[t.charCodeAt(n + 1)] >> 4, - u[c++] = 255 & e), - 1 === s && (e = a[t.charCodeAt(n)] << 10 | a[t.charCodeAt(n + 1)] << 4 | a[t.charCodeAt(n + 2)] >> 2, - u[c++] = e >> 8 & 255, - u[c++] = 255 & e), - u - } - , - e.fromByteArray = function(t) { - for (var e, a = t.length, r = a % 3, i = [], o = 16383, l = 0, u = a - r; l < u; l += o) - i.push(s(t, l, l + o > u ? u : l + o)); - return 1 === r ? (e = t[a - 1], - i.push(n[e >> 2] + n[e << 4 & 63] + "==")) : 2 === r && (e = (t[a - 2] << 8) + t[a - 1], - i.push(n[e >> 10] + n[e >> 4 & 63] + n[e << 2 & 63] + "=")), - i.join("") - } - ; - for (var n = [], a = [], r = "undefined" != typeof Uint8Array ? Uint8Array : Array, i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", o = 0; o < 64; ++o) - n[o] = i[o], - a[i.charCodeAt(o)] = o; - function l(t) { - var e = t.length; - if (e % 4 > 0) - throw new Error("Invalid string. Length must be a multiple of 4"); - var n = t.indexOf("="); - return -1 === n && (n = e), - [n, n === e ? 0 : 4 - n % 4] - } - function s(t, e, a) { - for (var r, i, o = [], l = e; l < a; l += 3) - r = (t[l] << 16 & 16711680) + (t[l + 1] << 8 & 65280) + (255 & t[l + 2]), - o.push(n[(i = r) >> 18 & 63] + n[i >> 12 & 63] + n[i >> 6 & 63] + n[63 & i]); - return o.join("") - } - a["-".charCodeAt(0)] = 62, - a["_".charCodeAt(0)] = 63 - }, - 44: function(t, e, n) { - "use strict"; - var a = n(7267) - , r = n(7986) - , i = "function" == typeof Symbol && "function" == typeof Symbol.for ? Symbol.for("nodejs.util.inspect.custom") : null; - e.Buffer = s, - e.SlowBuffer = function(t) { - return +t != t && (t = 0), - s.alloc(+t) - } - , - e.INSPECT_MAX_BYTES = 50; - var o = 2147483647; - function l(t) { - if (t > o) - throw new RangeError('The value "' + t + '" is invalid for option "size"'); - var e = new Uint8Array(t); - return Object.setPrototypeOf(e, s.prototype), - e - } - function s(t, e, n) { - if ("number" == typeof t) { - if ("string" == typeof e) - throw new TypeError('The "string" argument must be of type string. Received type number'); - return d(t) - } - return u(t, e, n) - } - function u(t, e, n) { - if ("string" == typeof t) - return function(t, e) { - if ("string" == typeof e && "" !== e || (e = "utf8"), - !s.isEncoding(e)) - throw new TypeError("Unknown encoding: " + e); - var n = 0 | h(t, e) - , a = l(n) - , r = a.write(t, e); - return r !== n && (a = a.slice(0, r)), - a - }(t, e); - if (ArrayBuffer.isView(t)) - return function(t) { - if (B(t, Uint8Array)) { - var e = new Uint8Array(t); - return g(e.buffer, e.byteOffset, e.byteLength) - } - return f(t) - }(t); - if (null == t) - throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof t); - if (B(t, ArrayBuffer) || t && B(t.buffer, ArrayBuffer)) - return g(t, e, n); - if ("undefined" != typeof SharedArrayBuffer && (B(t, SharedArrayBuffer) || t && B(t.buffer, SharedArrayBuffer))) - return g(t, e, n); - if ("number" == typeof t) - throw new TypeError('The "value" argument must not be of type number. Received type number'); - var a = t.valueOf && t.valueOf(); - if (null != a && a !== t) - return s.from(a, e, n); - var r = function(t) { - if (s.isBuffer(t)) { - var e = 0 | m(t.length) - , n = l(e); - return 0 === n.length || t.copy(n, 0, 0, e), - n - } - return void 0 !== t.length ? "number" != typeof t.length || q(t.length) ? l(0) : f(t) : "Buffer" === t.type && Array.isArray(t.data) ? f(t.data) : void 0 - }(t); - if (r) - return r; - if ("undefined" != typeof Symbol && null != Symbol.toPrimitive && "function" == typeof t[Symbol.toPrimitive]) - return s.from(t[Symbol.toPrimitive]("string"), e, n); - throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof t) - } - function c(t) { - if ("number" != typeof t) - throw new TypeError('"size" argument must be of type number'); - if (t < 0) - throw new RangeError('The value "' + t + '" is invalid for option "size"') - } - function d(t) { - return c(t), - l(t < 0 ? 0 : 0 | m(t)) - } - function f(t) { - for (var e = t.length < 0 ? 0 : 0 | m(t.length), n = l(e), a = 0; a < e; a += 1) - n[a] = 255 & t[a]; - return n - } - function g(t, e, n) { - if (e < 0 || t.byteLength < e) - throw new RangeError('"offset" is outside of buffer bounds'); - if (t.byteLength < e + (n || 0)) - throw new RangeError('"length" is outside of buffer bounds'); - var a; - return a = void 0 === e && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,e) : new Uint8Array(t,e,n), - Object.setPrototypeOf(a, s.prototype), - a - } - function m(t) { - if (t >= o) - throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + o.toString(16) + " bytes"); - return 0 | t - } - function h(t, e) { - if (s.isBuffer(t)) - return t.length; - if (ArrayBuffer.isView(t) || B(t, ArrayBuffer)) - return t.byteLength; - if ("string" != typeof t) - throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof t); - var n = t.length - , a = arguments.length > 2 && !0 === arguments[2]; - if (!a && 0 === n) - return 0; - for (var r = !1; ; ) - switch (e) { - case "ascii": - case "latin1": - case "binary": - return n; - case "utf8": - case "utf-8": - return F(t).length; - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return 2 * n; - case "hex": - return n >>> 1; - case "base64": - return U(t).length; - default: - if (r) - return a ? -1 : F(t).length; - e = ("" + e).toLowerCase(), - r = !0 - } - } - function p(t, e, n) { - var a = !1; - if ((void 0 === e || e < 0) && (e = 0), - e > this.length) - return ""; - if ((void 0 === n || n > this.length) && (n = this.length), - n <= 0) - return ""; - if ((n >>>= 0) <= (e >>>= 0)) - return ""; - for (t || (t = "utf8"); ; ) - switch (t) { - case "hex": - return C(this, e, n); - case "utf8": - case "utf-8": - return I(this, e, n); - case "ascii": - return R(this, e, n); - case "latin1": - case "binary": - return N(this, e, n); - case "base64": - return S(this, e, n); - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return D(this, e, n); - default: - if (a) - throw new TypeError("Unknown encoding: " + t); - t = (t + "").toLowerCase(), - a = !0 - } - } - function b(t, e, n) { - var a = t[e]; - t[e] = t[n], - t[n] = a - } - function y(t, e, n, a, r) { - if (0 === t.length) - return -1; - if ("string" == typeof n ? (a = n, - n = 0) : n > 2147483647 ? n = 2147483647 : n < -2147483648 && (n = -2147483648), - q(n = +n) && (n = r ? 0 : t.length - 1), - n < 0 && (n = t.length + n), - n >= t.length) { - if (r) - return -1; - n = t.length - 1 - } else if (n < 0) { - if (!r) - return -1; - n = 0 - } - if ("string" == typeof e && (e = s.from(e, a)), - s.isBuffer(e)) - return 0 === e.length ? -1 : E(t, e, n, a, r); - if ("number" == typeof e) - return e &= 255, - "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(t, e, n) : Uint8Array.prototype.lastIndexOf.call(t, e, n) : E(t, [e], n, a, r); - throw new TypeError("val must be string, number or Buffer") - } - function E(t, e, n, a, r) { - var i, o = 1, l = t.length, s = e.length; - if (void 0 !== a && ("ucs2" === (a = String(a).toLowerCase()) || "ucs-2" === a || "utf16le" === a || "utf-16le" === a)) { - if (t.length < 2 || e.length < 2) - return -1; - o = 2, - l /= 2, - s /= 2, - n /= 2 - } - function u(t, e) { - return 1 === o ? t[e] : t.readUInt16BE(e * o) - } - if (r) { - var c = -1; - for (i = n; i < l; i++) - if (u(t, i) === u(e, -1 === c ? 0 : i - c)) { - if (-1 === c && (c = i), - i - c + 1 === s) - return c * o - } else - -1 !== c && (i -= i - c), - c = -1 - } else - for (n + s > l && (n = l - s), - i = n; i >= 0; i--) { - for (var d = !0, f = 0; f < s; f++) - if (u(t, i + f) !== u(e, f)) { - d = !1; - break - } - if (d) - return i - } - return -1 - } - function _(t, e, n, a) { - n = Number(n) || 0; - var r = t.length - n; - a ? (a = Number(a)) > r && (a = r) : a = r; - var i = e.length; - a > i / 2 && (a = i / 2); - for (var o = 0; o < a; ++o) { - var l = parseInt(e.substr(2 * o, 2), 16); - if (q(l)) - return o; - t[n + o] = l - } - return o - } - function A(t, e, n, a) { - return j(F(e, t.length - n), t, n, a) - } - function T(t, e, n, a) { - return j(function(t) { - for (var e = [], n = 0; n < t.length; ++n) - e.push(255 & t.charCodeAt(n)); - return e - }(e), t, n, a) - } - function v(t, e, n, a) { - return j(U(e), t, n, a) - } - function w(t, e, n, a) { - return j(function(t, e) { - for (var n, a, r, i = [], o = 0; o < t.length && !((e -= 2) < 0); ++o) - a = (n = t.charCodeAt(o)) >> 8, - r = n % 256, - i.push(r), - i.push(a); - return i - }(e, t.length - n), t, n, a) - } - function S(t, e, n) { - return 0 === e && n === t.length ? a.fromByteArray(t) : a.fromByteArray(t.slice(e, n)) - } - function I(t, e, n) { - n = Math.min(t.length, n); - for (var a = [], r = e; r < n; ) { - var i, o, l, s, u = t[r], c = null, d = u > 239 ? 4 : u > 223 ? 3 : u > 191 ? 2 : 1; - if (r + d <= n) - switch (d) { - case 1: - u < 128 && (c = u); - break; - case 2: - 128 == (192 & (i = t[r + 1])) && (s = (31 & u) << 6 | 63 & i) > 127 && (c = s); - break; - case 3: - i = t[r + 1], - o = t[r + 2], - 128 == (192 & i) && 128 == (192 & o) && (s = (15 & u) << 12 | (63 & i) << 6 | 63 & o) > 2047 && (s < 55296 || s > 57343) && (c = s); - break; - case 4: - i = t[r + 1], - o = t[r + 2], - l = t[r + 3], - 128 == (192 & i) && 128 == (192 & o) && 128 == (192 & l) && (s = (15 & u) << 18 | (63 & i) << 12 | (63 & o) << 6 | 63 & l) > 65535 && s < 1114112 && (c = s) - } - null === c ? (c = 65533, - d = 1) : c > 65535 && (c -= 65536, - a.push(c >>> 10 & 1023 | 55296), - c = 56320 | 1023 & c), - a.push(c), - r += d - } - return function(t) { - var e = t.length; - if (e <= k) - return String.fromCharCode.apply(String, t); - for (var n = "", a = 0; a < e; ) - n += String.fromCharCode.apply(String, t.slice(a, a += k)); - return n - }(a) - } - e.kMaxLength = o, - s.TYPED_ARRAY_SUPPORT = function() { - try { - var t = new Uint8Array(1) - , e = { - foo: function() { - return 42 - } - }; - return Object.setPrototypeOf(e, Uint8Array.prototype), - Object.setPrototypeOf(t, e), - 42 === t.foo() - } catch (t) { - return !1 - } - }(), - s.TYPED_ARRAY_SUPPORT || "undefined" == typeof console || "function" != typeof console.error || console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."), - Object.defineProperty(s.prototype, "parent", { - enumerable: !0, - get: function() { - if (s.isBuffer(this)) - return this.buffer - } - }), - Object.defineProperty(s.prototype, "offset", { - enumerable: !0, - get: function() { - if (s.isBuffer(this)) - return this.byteOffset - } - }), - s.poolSize = 8192, - s.from = function(t, e, n) { - return u(t, e, n) - } - , - Object.setPrototypeOf(s.prototype, Uint8Array.prototype), - Object.setPrototypeOf(s, Uint8Array), - s.alloc = function(t, e, n) { - return function(t, e, n) { - return c(t), - t <= 0 ? l(t) : void 0 !== e ? "string" == typeof n ? l(t).fill(e, n) : l(t).fill(e) : l(t) - }(t, e, n) - } - , - s.allocUnsafe = function(t) { - return d(t) - } - , - s.allocUnsafeSlow = function(t) { - return d(t) - } - , - s.isBuffer = function(t) { - return null != t && !0 === t._isBuffer && t !== s.prototype - } - , - s.compare = function(t, e) { - if (B(t, Uint8Array) && (t = s.from(t, t.offset, t.byteLength)), - B(e, Uint8Array) && (e = s.from(e, e.offset, e.byteLength)), - !s.isBuffer(t) || !s.isBuffer(e)) - throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); - if (t === e) - return 0; - for (var n = t.length, a = e.length, r = 0, i = Math.min(n, a); r < i; ++r) - if (t[r] !== e[r]) { - n = t[r], - a = e[r]; - break - } - return n < a ? -1 : a < n ? 1 : 0 - } - , - s.isEncoding = function(t) { - switch (String(t).toLowerCase()) { - case "hex": - case "utf8": - case "utf-8": - case "ascii": - case "latin1": - case "binary": - case "base64": - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return !0; - default: - return !1 - } - } - , - s.concat = function(t, e) { - if (!Array.isArray(t)) - throw new TypeError('"list" argument must be an Array of Buffers'); - if (0 === t.length) - return s.alloc(0); - var n; - if (void 0 === e) - for (e = 0, - n = 0; n < t.length; ++n) - e += t[n].length; - var a = s.allocUnsafe(e) - , r = 0; - for (n = 0; n < t.length; ++n) { - var i = t[n]; - if (B(i, Uint8Array)) - r + i.length > a.length ? s.from(i).copy(a, r) : Uint8Array.prototype.set.call(a, i, r); - else { - if (!s.isBuffer(i)) - throw new TypeError('"list" argument must be an Array of Buffers'); - i.copy(a, r) - } - r += i.length - } - return a - } - , - s.byteLength = h, - s.prototype._isBuffer = !0, - s.prototype.swap16 = function() { - var t = this.length; - if (t % 2 != 0) - throw new RangeError("Buffer size must be a multiple of 16-bits"); - for (var e = 0; e < t; e += 2) - b(this, e, e + 1); - return this - } - , - s.prototype.swap32 = function() { - var t = this.length; - if (t % 4 != 0) - throw new RangeError("Buffer size must be a multiple of 32-bits"); - for (var e = 0; e < t; e += 4) - b(this, e, e + 3), - b(this, e + 1, e + 2); - return this - } - , - s.prototype.swap64 = function() { - var t = this.length; - if (t % 8 != 0) - throw new RangeError("Buffer size must be a multiple of 64-bits"); - for (var e = 0; e < t; e += 8) - b(this, e, e + 7), - b(this, e + 1, e + 6), - b(this, e + 2, e + 5), - b(this, e + 3, e + 4); - return this - } - , - s.prototype.toString = function() { - var t = this.length; - return 0 === t ? "" : 0 === arguments.length ? I(this, 0, t) : p.apply(this, arguments) - } - , - s.prototype.toLocaleString = s.prototype.toString, - s.prototype.equals = function(t) { - if (!s.isBuffer(t)) - throw new TypeError("Argument must be a Buffer"); - return this === t || 0 === s.compare(this, t) - } - , - s.prototype.inspect = function() { - var t = "" - , n = e.INSPECT_MAX_BYTES; - return t = this.toString("hex", 0, n).replace(/(.{2})/g, "$1 ").trim(), - this.length > n && (t += " ... "), - "" - } - , - i && (s.prototype[i] = s.prototype.inspect), - s.prototype.compare = function(t, e, n, a, r) { - if (B(t, Uint8Array) && (t = s.from(t, t.offset, t.byteLength)), - !s.isBuffer(t)) - throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof t); - if (void 0 === e && (e = 0), - void 0 === n && (n = t ? t.length : 0), - void 0 === a && (a = 0), - void 0 === r && (r = this.length), - e < 0 || n > t.length || a < 0 || r > this.length) - throw new RangeError("out of range index"); - if (a >= r && e >= n) - return 0; - if (a >= r) - return -1; - if (e >= n) - return 1; - if (this === t) - return 0; - for (var i = (r >>>= 0) - (a >>>= 0), o = (n >>>= 0) - (e >>>= 0), l = Math.min(i, o), u = this.slice(a, r), c = t.slice(e, n), d = 0; d < l; ++d) - if (u[d] !== c[d]) { - i = u[d], - o = c[d]; - break - } - return i < o ? -1 : o < i ? 1 : 0 - } - , - s.prototype.includes = function(t, e, n) { - return -1 !== this.indexOf(t, e, n) - } - , - s.prototype.indexOf = function(t, e, n) { - return y(this, t, e, n, !0) - } - , - s.prototype.lastIndexOf = function(t, e, n) { - return y(this, t, e, n, !1) - } - , - s.prototype.write = function(t, e, n, a) { - if (void 0 === e) - a = "utf8", - n = this.length, - e = 0; - else if (void 0 === n && "string" == typeof e) - a = e, - n = this.length, - e = 0; - else { - if (!isFinite(e)) - throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); - e >>>= 0, - isFinite(n) ? (n >>>= 0, - void 0 === a && (a = "utf8")) : (a = n, - n = void 0) - } - var r = this.length - e; - if ((void 0 === n || n > r) && (n = r), - t.length > 0 && (n < 0 || e < 0) || e > this.length) - throw new RangeError("Attempt to write outside buffer bounds"); - a || (a = "utf8"); - for (var i = !1; ; ) - switch (a) { - case "hex": - return _(this, t, e, n); - case "utf8": - case "utf-8": - return A(this, t, e, n); - case "ascii": - case "latin1": - case "binary": - return T(this, t, e, n); - case "base64": - return v(this, t, e, n); - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return w(this, t, e, n); - default: - if (i) - throw new TypeError("Unknown encoding: " + a); - a = ("" + a).toLowerCase(), - i = !0 - } - } - , - s.prototype.toJSON = function() { - return { - type: "Buffer", - data: Array.prototype.slice.call(this._arr || this, 0) - } - } - ; - var k = 4096; - function R(t, e, n) { - var a = ""; - n = Math.min(t.length, n); - for (var r = e; r < n; ++r) - a += String.fromCharCode(127 & t[r]); - return a - } - function N(t, e, n) { - var a = ""; - n = Math.min(t.length, n); - for (var r = e; r < n; ++r) - a += String.fromCharCode(t[r]); - return a - } - function C(t, e, n) { - var a = t.length; - (!e || e < 0) && (e = 0), - (!n || n < 0 || n > a) && (n = a); - for (var r = "", i = e; i < n; ++i) - r += G[t[i]]; - return r - } - function D(t, e, n) { - for (var a = t.slice(e, n), r = "", i = 0; i < a.length - 1; i += 2) - r += String.fromCharCode(a[i] + 256 * a[i + 1]); - return r - } - function x(t, e, n) { - if (t % 1 != 0 || t < 0) - throw new RangeError("offset is not uint"); - if (t + e > n) - throw new RangeError("Trying to access beyond buffer length") - } - function M(t, e, n, a, r, i) { - if (!s.isBuffer(t)) - throw new TypeError('"buffer" argument must be a Buffer instance'); - if (e > r || e < i) - throw new RangeError('"value" argument is out of bounds'); - if (n + a > t.length) - throw new RangeError("Index out of range") - } - function z(t, e, n, a, r, i) { - if (n + a > t.length) - throw new RangeError("Index out of range"); - if (n < 0) - throw new RangeError("Index out of range") - } - function O(t, e, n, a, i) { - return e = +e, - n >>>= 0, - i || z(t, 0, n, 4), - r.write(t, e, n, a, 23, 4), - n + 4 - } - function L(t, e, n, a, i) { - return e = +e, - n >>>= 0, - i || z(t, 0, n, 8), - r.write(t, e, n, a, 52, 8), - n + 8 - } - s.prototype.slice = function(t, e) { - var n = this.length; - (t = ~~t) < 0 ? (t += n) < 0 && (t = 0) : t > n && (t = n), - (e = void 0 === e ? n : ~~e) < 0 ? (e += n) < 0 && (e = 0) : e > n && (e = n), - e < t && (e = t); - var a = this.subarray(t, e); - return Object.setPrototypeOf(a, s.prototype), - a - } - , - s.prototype.readUintLE = s.prototype.readUIntLE = function(t, e, n) { - t >>>= 0, - e >>>= 0, - n || x(t, e, this.length); - for (var a = this[t], r = 1, i = 0; ++i < e && (r *= 256); ) - a += this[t + i] * r; - return a - } - , - s.prototype.readUintBE = s.prototype.readUIntBE = function(t, e, n) { - t >>>= 0, - e >>>= 0, - n || x(t, e, this.length); - for (var a = this[t + --e], r = 1; e > 0 && (r *= 256); ) - a += this[t + --e] * r; - return a - } - , - s.prototype.readUint8 = s.prototype.readUInt8 = function(t, e) { - return t >>>= 0, - e || x(t, 1, this.length), - this[t] - } - , - s.prototype.readUint16LE = s.prototype.readUInt16LE = function(t, e) { - return t >>>= 0, - e || x(t, 2, this.length), - this[t] | this[t + 1] << 8 - } - , - s.prototype.readUint16BE = s.prototype.readUInt16BE = function(t, e) { - return t >>>= 0, - e || x(t, 2, this.length), - this[t] << 8 | this[t + 1] - } - , - s.prototype.readUint32LE = s.prototype.readUInt32LE = function(t, e) { - return t >>>= 0, - e || x(t, 4, this.length), - (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + 16777216 * this[t + 3] - } - , - s.prototype.readUint32BE = s.prototype.readUInt32BE = function(t, e) { - return t >>>= 0, - e || x(t, 4, this.length), - 16777216 * this[t] + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]) - } - , - s.prototype.readIntLE = function(t, e, n) { - t >>>= 0, - e >>>= 0, - n || x(t, e, this.length); - for (var a = this[t], r = 1, i = 0; ++i < e && (r *= 256); ) - a += this[t + i] * r; - return a >= (r *= 128) && (a -= Math.pow(2, 8 * e)), - a - } - , - s.prototype.readIntBE = function(t, e, n) { - t >>>= 0, - e >>>= 0, - n || x(t, e, this.length); - for (var a = e, r = 1, i = this[t + --a]; a > 0 && (r *= 256); ) - i += this[t + --a] * r; - return i >= (r *= 128) && (i -= Math.pow(2, 8 * e)), - i - } - , - s.prototype.readInt8 = function(t, e) { - return t >>>= 0, - e || x(t, 1, this.length), - 128 & this[t] ? -1 * (255 - this[t] + 1) : this[t] - } - , - s.prototype.readInt16LE = function(t, e) { - t >>>= 0, - e || x(t, 2, this.length); - var n = this[t] | this[t + 1] << 8; - return 32768 & n ? 4294901760 | n : n - } - , - s.prototype.readInt16BE = function(t, e) { - t >>>= 0, - e || x(t, 2, this.length); - var n = this[t + 1] | this[t] << 8; - return 32768 & n ? 4294901760 | n : n - } - , - s.prototype.readInt32LE = function(t, e) { - return t >>>= 0, - e || x(t, 4, this.length), - this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24 - } - , - s.prototype.readInt32BE = function(t, e) { - return t >>>= 0, - e || x(t, 4, this.length), - this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3] - } - , - s.prototype.readFloatLE = function(t, e) { - return t >>>= 0, - e || x(t, 4, this.length), - r.read(this, t, !0, 23, 4) - } - , - s.prototype.readFloatBE = function(t, e) { - return t >>>= 0, - e || x(t, 4, this.length), - r.read(this, t, !1, 23, 4) - } - , - s.prototype.readDoubleLE = function(t, e) { - return t >>>= 0, - e || x(t, 8, this.length), - r.read(this, t, !0, 52, 8) - } - , - s.prototype.readDoubleBE = function(t, e) { - return t >>>= 0, - e || x(t, 8, this.length), - r.read(this, t, !1, 52, 8) - } - , - s.prototype.writeUintLE = s.prototype.writeUIntLE = function(t, e, n, a) { - t = +t, - e >>>= 0, - n >>>= 0, - a || M(this, t, e, n, Math.pow(2, 8 * n) - 1, 0); - var r = 1 - , i = 0; - for (this[e] = 255 & t; ++i < n && (r *= 256); ) - this[e + i] = t / r & 255; - return e + n - } - , - s.prototype.writeUintBE = s.prototype.writeUIntBE = function(t, e, n, a) { - t = +t, - e >>>= 0, - n >>>= 0, - a || M(this, t, e, n, Math.pow(2, 8 * n) - 1, 0); - var r = n - 1 - , i = 1; - for (this[e + r] = 255 & t; --r >= 0 && (i *= 256); ) - this[e + r] = t / i & 255; - return e + n - } - , - s.prototype.writeUint8 = s.prototype.writeUInt8 = function(t, e, n) { - return t = +t, - e >>>= 0, - n || M(this, t, e, 1, 255, 0), - this[e] = 255 & t, - e + 1 - } - , - s.prototype.writeUint16LE = s.prototype.writeUInt16LE = function(t, e, n) { - return t = +t, - e >>>= 0, - n || M(this, t, e, 2, 65535, 0), - this[e] = 255 & t, - this[e + 1] = t >>> 8, - e + 2 - } - , - s.prototype.writeUint16BE = s.prototype.writeUInt16BE = function(t, e, n) { - return t = +t, - e >>>= 0, - n || M(this, t, e, 2, 65535, 0), - this[e] = t >>> 8, - this[e + 1] = 255 & t, - e + 2 - } - , - s.prototype.writeUint32LE = s.prototype.writeUInt32LE = function(t, e, n) { - return t = +t, - e >>>= 0, - n || M(this, t, e, 4, 4294967295, 0), - this[e + 3] = t >>> 24, - this[e + 2] = t >>> 16, - this[e + 1] = t >>> 8, - this[e] = 255 & t, - e + 4 - } - , - s.prototype.writeUint32BE = s.prototype.writeUInt32BE = function(t, e, n) { - return t = +t, - e >>>= 0, - n || M(this, t, e, 4, 4294967295, 0), - this[e] = t >>> 24, - this[e + 1] = t >>> 16, - this[e + 2] = t >>> 8, - this[e + 3] = 255 & t, - e + 4 - } - , - s.prototype.writeIntLE = function(t, e, n, a) { - if (t = +t, - e >>>= 0, - !a) { - var r = Math.pow(2, 8 * n - 1); - M(this, t, e, n, r - 1, -r) - } - var i = 0 - , o = 1 - , l = 0; - for (this[e] = 255 & t; ++i < n && (o *= 256); ) - t < 0 && 0 === l && 0 !== this[e + i - 1] && (l = 1), - this[e + i] = (t / o | 0) - l & 255; - return e + n - } - , - s.prototype.writeIntBE = function(t, e, n, a) { - if (t = +t, - e >>>= 0, - !a) { - var r = Math.pow(2, 8 * n - 1); - M(this, t, e, n, r - 1, -r) - } - var i = n - 1 - , o = 1 - , l = 0; - for (this[e + i] = 255 & t; --i >= 0 && (o *= 256); ) - t < 0 && 0 === l && 0 !== this[e + i + 1] && (l = 1), - this[e + i] = (t / o | 0) - l & 255; - return e + n - } - , - s.prototype.writeInt8 = function(t, e, n) { - return t = +t, - e >>>= 0, - n || M(this, t, e, 1, 127, -128), - t < 0 && (t = 255 + t + 1), - this[e] = 255 & t, - e + 1 - } - , - s.prototype.writeInt16LE = function(t, e, n) { - return t = +t, - e >>>= 0, - n || M(this, t, e, 2, 32767, -32768), - this[e] = 255 & t, - this[e + 1] = t >>> 8, - e + 2 - } - , - s.prototype.writeInt16BE = function(t, e, n) { - return t = +t, - e >>>= 0, - n || M(this, t, e, 2, 32767, -32768), - this[e] = t >>> 8, - this[e + 1] = 255 & t, - e + 2 - } - , - s.prototype.writeInt32LE = function(t, e, n) { - return t = +t, - e >>>= 0, - n || M(this, t, e, 4, 2147483647, -2147483648), - this[e] = 255 & t, - this[e + 1] = t >>> 8, - this[e + 2] = t >>> 16, - this[e + 3] = t >>> 24, - e + 4 - } - , - s.prototype.writeInt32BE = function(t, e, n) { - return t = +t, - e >>>= 0, - n || M(this, t, e, 4, 2147483647, -2147483648), - t < 0 && (t = 4294967295 + t + 1), - this[e] = t >>> 24, - this[e + 1] = t >>> 16, - this[e + 2] = t >>> 8, - this[e + 3] = 255 & t, - e + 4 - } - , - s.prototype.writeFloatLE = function(t, e, n) { - return O(this, t, e, !0, n) - } - , - s.prototype.writeFloatBE = function(t, e, n) { - return O(this, t, e, !1, n) - } - , - s.prototype.writeDoubleLE = function(t, e, n) { - return L(this, t, e, !0, n) - } - , - s.prototype.writeDoubleBE = function(t, e, n) { - return L(this, t, e, !1, n) - } - , - s.prototype.copy = function(t, e, n, a) { - if (!s.isBuffer(t)) - throw new TypeError("argument should be a Buffer"); - if (n || (n = 0), - a || 0 === a || (a = this.length), - e >= t.length && (e = t.length), - e || (e = 0), - a > 0 && a < n && (a = n), - a === n) - return 0; - if (0 === t.length || 0 === this.length) - return 0; - if (e < 0) - throw new RangeError("targetStart out of bounds"); - if (n < 0 || n >= this.length) - throw new RangeError("Index out of range"); - if (a < 0) - throw new RangeError("sourceEnd out of bounds"); - a > this.length && (a = this.length), - t.length - e < a - n && (a = t.length - e + n); - var r = a - n; - return this === t && "function" == typeof Uint8Array.prototype.copyWithin ? this.copyWithin(e, n, a) : Uint8Array.prototype.set.call(t, this.subarray(n, a), e), - r - } - , - s.prototype.fill = function(t, e, n, a) { - if ("string" == typeof t) { - if ("string" == typeof e ? (a = e, - e = 0, - n = this.length) : "string" == typeof n && (a = n, - n = this.length), - void 0 !== a && "string" != typeof a) - throw new TypeError("encoding must be a string"); - if ("string" == typeof a && !s.isEncoding(a)) - throw new TypeError("Unknown encoding: " + a); - if (1 === t.length) { - var r = t.charCodeAt(0); - ("utf8" === a && r < 128 || "latin1" === a) && (t = r) - } - } else - "number" == typeof t ? t &= 255 : "boolean" == typeof t && (t = Number(t)); - if (e < 0 || this.length < e || this.length < n) - throw new RangeError("Out of range index"); - if (n <= e) - return this; - var i; - if (e >>>= 0, - n = void 0 === n ? this.length : n >>> 0, - t || (t = 0), - "number" == typeof t) - for (i = e; i < n; ++i) - this[i] = t; - else { - var o = s.isBuffer(t) ? t : s.from(t, a) - , l = o.length; - if (0 === l) - throw new TypeError('The value "' + t + '" is invalid for argument "value"'); - for (i = 0; i < n - e; ++i) - this[i + e] = o[i % l] - } - return this - } - ; - var P = /[^+/0-9A-Za-z-_]/g; - function F(t, e) { - var n; - e = e || 1 / 0; - for (var a = t.length, r = null, i = [], o = 0; o < a; ++o) { - if ((n = t.charCodeAt(o)) > 55295 && n < 57344) { - if (!r) { - if (n > 56319) { - (e -= 3) > -1 && i.push(239, 191, 189); - continue - } - if (o + 1 === a) { - (e -= 3) > -1 && i.push(239, 191, 189); - continue - } - r = n; - continue - } - if (n < 56320) { - (e -= 3) > -1 && i.push(239, 191, 189), - r = n; - continue - } - n = 65536 + (r - 55296 << 10 | n - 56320) - } else - r && (e -= 3) > -1 && i.push(239, 191, 189); - if (r = null, - n < 128) { - if ((e -= 1) < 0) - break; - i.push(n) - } else if (n < 2048) { - if ((e -= 2) < 0) - break; - i.push(n >> 6 | 192, 63 & n | 128) - } else if (n < 65536) { - if ((e -= 3) < 0) - break; - i.push(n >> 12 | 224, n >> 6 & 63 | 128, 63 & n | 128) - } else { - if (!(n < 1114112)) - throw new Error("Invalid code point"); - if ((e -= 4) < 0) - break; - i.push(n >> 18 | 240, n >> 12 & 63 | 128, n >> 6 & 63 | 128, 63 & n | 128) - } - } - return i - } - function U(t) { - return a.toByteArray(function(t) { - if ((t = (t = t.split("=")[0]).trim().replace(P, "")).length < 2) - return ""; - for (; t.length % 4 != 0; ) - t += "="; - return t - }(t)) - } - function j(t, e, n, a) { - for (var r = 0; r < a && !(r + n >= e.length || r >= t.length); ++r) - e[r + n] = t[r]; - return r - } - function B(t, e) { - return t instanceof e || null != t && null != t.constructor && null != t.constructor.name && t.constructor.name === e.name - } - function q(t) { - return t != t - } - var G = function() { - for (var t = "0123456789abcdef", e = new Array(256), n = 0; n < 16; ++n) - for (var a = 16 * n, r = 0; r < 16; ++r) - e[a + r] = t[n] + t[r]; - return e - }() - }, - 6877: function(t, e) { - var n = { - parseBuffer: function(t) { - return new a(t).parse() - }, - addBoxProcessor: function(t, e) { - "string" == typeof t && "function" == typeof e && (r.prototype._boxProcessors[t] = e) - }, - createFile: function() { - return new a - }, - createBox: function(t, e, n) { - var a = r.create(t); - return e && e.append(a, n), - a - }, - createFullBox: function(t, e, a) { - var r = n.createBox(t, e, a); - return r.version = 0, - r.flags = 0, - r - }, - Utils: {} - }; - n.Utils.dataViewToString = function(t, e) { - var n = e || "utf-8"; - if ("undefined" != typeof TextDecoder) - return new TextDecoder(n).decode(t); - var a = [] - , r = 0; - if ("utf-8" === n) - for (; r < t.byteLength; ) { - var i = t.getUint8(r++); - i < 128 || (i < 224 ? (i = (31 & i) << 6, - i |= 63 & t.getUint8(r++)) : i < 240 ? (i = (15 & i) << 12, - i |= (63 & t.getUint8(r++)) << 6, - i |= 63 & t.getUint8(r++)) : (i = (7 & i) << 18, - i |= (63 & t.getUint8(r++)) << 12, - i |= (63 & t.getUint8(r++)) << 6, - i |= 63 & t.getUint8(r++))), - a.push(String.fromCharCode(i)) - } - else - for (; r < t.byteLength; ) - a.push(String.fromCharCode(t.getUint8(r++))); - return a.join("") - } - , - n.Utils.utf8ToByteArray = function(t) { - var e, n; - if ("undefined" != typeof TextEncoder) - e = (new TextEncoder).encode(t); - else - for (e = [], - n = 0; n < t.length; ++n) { - var a = t.charCodeAt(n); - a < 128 ? e.push(a) : a < 2048 ? (e.push(192 | a >> 6), - e.push(128 | 63 & a)) : a < 65536 ? (e.push(224 | a >> 12), - e.push(128 | 63 & a >> 6), - e.push(128 | 63 & a)) : (e.push(240 | a >> 18), - e.push(128 | 63 & a >> 12), - e.push(128 | 63 & a >> 6), - e.push(128 | 63 & a)) - } - return e - } - , - n.Utils.appendBox = function(t, e, n) { - if (e._offset = t._cursor.offset, - e._root = t._root ? t._root : t, - e._raw = t._raw, - e._parent = t, - -1 !== n) - if (null != n) { - var a, r = -1; - if ("number" == typeof n) - r = n; - else { - if ("string" == typeof n) - a = n; - else { - if ("object" != typeof n || !n.type) - return void t.boxes.push(e); - a = n.type - } - for (var i = 0; i < t.boxes.length; i++) - if (a === t.boxes[i].type) { - r = i + 1; - break - } - } - t.boxes.splice(r, 0, e) - } else - t.boxes.push(e) - } - , - e.parseBuffer = n.parseBuffer, - e.addBoxProcessor = n.addBoxProcessor, - e.createFile = n.createFile, - e.createBox = n.createBox, - e.createFullBox = n.createFullBox, - e.Utils = n.Utils, - n.Cursor = function(t) { - this.offset = void 0 === t ? 0 : t - } - ; - var a = function(t) { - this._cursor = new n.Cursor, - this.boxes = [], - t && (this._raw = new DataView(t)) - }; - a.prototype.fetch = function(t) { - var e = this.fetchAll(t, !0); - return e.length ? e[0] : null - } - , - a.prototype.fetchAll = function(t, e) { - var n = []; - return a._sweep.call(this, t, n, e), - n - } - , - a.prototype.parse = function() { - for (this._cursor.offset = 0, - this.boxes = []; this._cursor.offset < this._raw.byteLength; ) { - var t = r.parse(this); - if (void 0 === t.type) - break; - this.boxes.push(t) - } - return this - } - , - a._sweep = function(t, e, n) { - for (var r in this.type && this.type == t && e.push(this), - this.boxes) { - if (e.length && n) - return; - a._sweep.call(this.boxes[r], t, e, n) - } - } - , - a.prototype.write = function() { - var t, e = 0; - for (t = 0; t < this.boxes.length; t++) - e += this.boxes[t].getLength(!1); - var n = new Uint8Array(e); - for (this._rawo = new DataView(n.buffer), - this.bytes = n, - this._cursor.offset = 0, - t = 0; t < this.boxes.length; t++) - this.boxes[t].write(); - return n.buffer - } - , - a.prototype.append = function(t, e) { - n.Utils.appendBox(this, t, e) - } - ; - var r = function() { - this._cursor = new n.Cursor - }; - r.parse = function(t) { - var e = new r; - return e._offset = t._cursor.offset, - e._root = t._root ? t._root : t, - e._raw = t._raw, - e._parent = t, - e._parseBox(), - t._cursor.offset = e._raw.byteOffset + e._raw.byteLength, - e - } - , - r.create = function(t) { - var e = new r; - return e.type = t, - e.boxes = [], - e - } - , - r.prototype._boxContainers = ["dinf", "edts", "mdia", "meco", "mfra", "minf", "moof", "moov", "mvex", "stbl", "strk", "traf", "trak", "tref", "udta", "vttc", "sinf", "schi", "encv", "enca", "meta", "grpl", "prsl"], - r.prototype._boxProcessors = {}, - r.prototype._procField = function(t, e, n) { - this._parsing ? this[t] = this._readField(e, n) : this._writeField(e, n, this[t]) - } - , - r.prototype._procFieldArray = function(t, e, n, a) { - var r; - if (this._parsing) - for (this[t] = [], - r = 0; r < e; r++) - this[t][r] = this._readField(n, a); - else - for (r = 0; r < this[t].length; r++) - this._writeField(n, a, this[t][r]) - } - , - r.prototype._procFullBox = function() { - this._procField("version", "uint", 8), - this._procField("flags", "uint", 24) - } - , - r.prototype._procEntries = function(t, e, n) { - var a; - if (this._parsing) - for (this[t] = [], - a = 0; a < e; a++) - this[t].push({}), - n.call(this, this[t][a]); - else - for (a = 0; a < e; a++) - n.call(this, this[t][a]) - } - , - r.prototype._procSubEntries = function(t, e, n, a) { - var r; - if (this._parsing) - for (t[e] = [], - r = 0; r < n; r++) - t[e].push({}), - a.call(this, t[e][r]); - else - for (r = 0; r < n; r++) - a.call(this, t[e][r]) - } - , - r.prototype._procEntryField = function(t, e, n, a) { - this._parsing ? t[e] = this._readField(n, a) : this._writeField(n, a, t[e]) - } - , - r.prototype._procSubBoxes = function(t, e) { - var n; - if (this._parsing) - for (this[t] = [], - n = 0; n < e; n++) - this[t].push(r.parse(this)); - else - for (n = 0; n < e; n++) - this._rawo ? this[t][n].write() : this.size += this[t][n].getLength() - } - , - r.prototype._readField = function(t, e) { - switch (t) { - case "uint": - return this._readUint(e); - case "int": - return this._readInt(e); - case "template": - return this._readTemplate(e); - case "string": - return -1 === e ? this._readTerminatedString() : this._readString(e); - case "data": - return this._readData(e); - case "utf8": - return this._readUTF8String(); - case "utf8string": - return this._readUTF8TerminatedString(); - default: - return -1 - } - } - , - r.prototype._readInt = function(t) { - var e = null - , n = this._cursor.offset - this._raw.byteOffset; - switch (t) { - case 8: - e = this._raw.getInt8(n); - break; - case 16: - e = this._raw.getInt16(n); - break; - case 32: - e = this._raw.getInt32(n); - break; - case 64: - var a = this._raw.getInt32(n) - , r = this._raw.getInt32(n + 4); - e = a * Math.pow(2, 32) + r - } - return this._cursor.offset += t >> 3, - e - } - , - r.prototype._readUint = function(t) { - var e, n, a = null, r = this._cursor.offset - this._raw.byteOffset; - switch (t) { - case 8: - a = this._raw.getUint8(r); - break; - case 16: - a = this._raw.getUint16(r); - break; - case 24: - a = ((e = this._raw.getUint16(r)) << 8) + (n = this._raw.getUint8(r + 2)); - break; - case 32: - a = this._raw.getUint32(r); - break; - case 64: - e = this._raw.getUint32(r), - n = this._raw.getUint32(r + 4), - a = e * Math.pow(2, 32) + n - } - return this._cursor.offset += t >> 3, - a - } - , - r.prototype._readString = function(t) { - for (var e = "", n = 0; n < t; n++) { - var a = this._readUint(8); - e += String.fromCharCode(a) - } - return e - } - , - r.prototype._readTemplate = function(t) { - return this._readUint(t / 2) + this._readUint(t / 2) / Math.pow(2, t / 2) - } - , - r.prototype._readTerminatedString = function() { - for (var t = ""; this._cursor.offset - this._offset < this._raw.byteLength; ) { - var e = this._readUint(8); - if (0 === e) - break; - t += String.fromCharCode(e) - } - return t - } - , - r.prototype._readData = function(t) { - var e = t > 0 ? t : this._raw.byteLength - (this._cursor.offset - this._offset); - if (e > 0) { - var n = new Uint8Array(this._raw.buffer,this._cursor.offset,e); - return this._cursor.offset += e, - n - } - return null - } - , - r.prototype._readUTF8String = function() { - var t = this._raw.byteLength - (this._cursor.offset - this._offset) - , e = null; - return t > 0 && (e = new DataView(this._raw.buffer,this._cursor.offset,t), - this._cursor.offset += t), - e ? n.Utils.dataViewToString(e) : e - } - , - r.prototype._readUTF8TerminatedString = function() { - var t = this._raw.byteLength - (this._cursor.offset - this._offset) - , e = null; - if (t > 0) { - var a; - for (e = new DataView(this._raw.buffer,this._cursor.offset,t), - a = 0; a < t && 0 !== e.getUint8(a); a++) - ; - e = new DataView(this._raw.buffer,this._cursor.offset,a), - this._cursor.offset += Math.min(a + 1, t) - } - return e ? n.Utils.dataViewToString(e) : e - } - , - r.prototype._parseBox = function() { - if (this._parsing = !0, - this._cursor.offset = this._offset, - this._offset + 8 > this._raw.buffer.byteLength) - this._root._incomplete = !0; - else { - switch (this._procField("size", "uint", 32), - this._procField("type", "string", 4), - 1 === this.size && this._procField("largesize", "uint", 64), - "uuid" === this.type && this._procFieldArray("usertype", 16, "uint", 8), - this.size) { - case 0: - this._raw = new DataView(this._raw.buffer,this._offset); - break; - case 1: - this._offset + this.size > this._raw.buffer.byteLength ? (this._incomplete = !0, - this._root._incomplete = !0) : this._raw = new DataView(this._raw.buffer,this._offset,this.largesize); - break; - default: - this._offset + this.size > this._raw.buffer.byteLength ? (this._incomplete = !0, - this._root._incomplete = !0) : this._raw = new DataView(this._raw.buffer,this._offset,this.size) - } - this._incomplete || (this._boxProcessors[this.type] && this._boxProcessors[this.type].call(this), - -1 !== this._boxContainers.indexOf(this.type) ? this._parseContainerBox() : this._data = this._readData()) - } - } - , - r.prototype._parseFullBox = function() { - this.version = this._readUint(8), - this.flags = this._readUint(24) - } - , - r.prototype._parseContainerBox = function() { - for (this.boxes = []; this._cursor.offset - this._raw.byteOffset < this._raw.byteLength; ) - this.boxes.push(r.parse(this)) - } - , - r.prototype.append = function(t, e) { - n.Utils.appendBox(this, t, e) - } - , - r.prototype.getLength = function() { - if (this._parsing = !1, - this._rawo = null, - this.size = 0, - this._procField("size", "uint", 32), - this._procField("type", "string", 4), - 1 === this.size && this._procField("largesize", "uint", 64), - "uuid" === this.type && this._procFieldArray("usertype", 16, "uint", 8), - this._boxProcessors[this.type] && this._boxProcessors[this.type].call(this), - -1 !== this._boxContainers.indexOf(this.type)) - for (var t = 0; t < this.boxes.length; t++) - this.size += this.boxes[t].getLength(); - return this._data && this._writeData(this._data), - this.size - } - , - r.prototype.write = function() { - switch (this._parsing = !1, - this._cursor.offset = this._parent._cursor.offset, - this.size) { - case 0: - this._rawo = new DataView(this._parent._rawo.buffer,this._cursor.offset,this.parent._rawo.byteLength - this._cursor.offset); - break; - case 1: - this._rawo = new DataView(this._parent._rawo.buffer,this._cursor.offset,this.largesize); - break; - default: - this._rawo = new DataView(this._parent._rawo.buffer,this._cursor.offset,this.size) - } - if (this._procField("size", "uint", 32), - this._procField("type", "string", 4), - 1 === this.size && this._procField("largesize", "uint", 64), - "uuid" === this.type && this._procFieldArray("usertype", 16, "uint", 8), - this._boxProcessors[this.type] && this._boxProcessors[this.type].call(this), - -1 !== this._boxContainers.indexOf(this.type)) - for (var t = 0; t < this.boxes.length; t++) - this.boxes[t].write(); - return this._data && this._writeData(this._data), - this._parent._cursor.offset += this.size, - this.size - } - , - r.prototype._writeInt = function(t, e) { - if (this._rawo) { - var n = this._cursor.offset - this._rawo.byteOffset; - switch (t) { - case 8: - this._rawo.setInt8(n, e); - break; - case 16: - this._rawo.setInt16(n, e); - break; - case 32: - this._rawo.setInt32(n, e); - break; - case 64: - var a = Math.floor(e / Math.pow(2, 32)) - , r = e - a * Math.pow(2, 32); - this._rawo.setUint32(n, a), - this._rawo.setUint32(n + 4, r) - } - this._cursor.offset += t >> 3 - } else - this.size += t >> 3 - } - , - r.prototype._writeUint = function(t, e) { - if (this._rawo) { - var n, a, r = this._cursor.offset - this._rawo.byteOffset; - switch (t) { - case 8: - this._rawo.setUint8(r, e); - break; - case 16: - this._rawo.setUint16(r, e); - break; - case 24: - n = (16776960 & e) >> 8, - a = 255 & e, - this._rawo.setUint16(r, n), - this._rawo.setUint8(r + 2, a); - break; - case 32: - this._rawo.setUint32(r, e); - break; - case 64: - a = e - (n = Math.floor(e / Math.pow(2, 32))) * Math.pow(2, 32), - this._rawo.setUint32(r, n), - this._rawo.setUint32(r + 4, a) - } - this._cursor.offset += t >> 3 - } else - this.size += t >> 3 - } - , - r.prototype._writeString = function(t, e) { - for (var n = 0; n < t; n++) - this._writeUint(8, e.charCodeAt(n)) - } - , - r.prototype._writeTerminatedString = function(t) { - if (0 !== t.length) { - for (var e = 0; e < t.length; e++) - this._writeUint(8, t.charCodeAt(e)); - this._writeUint(8, 0) - } - } - , - r.prototype._writeTemplate = function(t, e) { - var n = Math.floor(e) - , a = (e - n) * Math.pow(2, t / 2); - this._writeUint(t / 2, n), - this._writeUint(t / 2, a) - } - , - r.prototype._writeData = function(t) { - if (t) - if (this._rawo) { - if (t instanceof Array) { - for (var e = this._cursor.offset - this._rawo.byteOffset, n = 0; n < t.length; n++) - this._rawo.setInt8(e + n, t[n]); - this._cursor.offset += t.length - } - t instanceof Uint8Array && (this._root.bytes.set(t, this._cursor.offset), - this._cursor.offset += t.length) - } else - this.size += t.length - } - , - r.prototype._writeUTF8String = function(t) { - var e = n.Utils.utf8ToByteArray(t); - if (this._rawo) - for (var a = new DataView(this._rawo.buffer,this._cursor.offset,e.length), r = 0; r < e.length; r++) - a.setUint8(r, e[r]); - else - this.size += e.length - } - , - r.prototype._writeField = function(t, e, n) { - switch (t) { - case "uint": - this._writeUint(e, n); - break; - case "int": - this._writeInt(e, n); - break; - case "template": - this._writeTemplate(e, n); - break; - case "string": - -1 == e ? this._writeTerminatedString(n) : this._writeString(e, n); - break; - case "data": - this._writeData(n); - break; - case "utf8": - this._writeUTF8String(n) - } - } - , - r.prototype._boxProcessors.ardi = function() { - this._procFullBox(), - this._procField("audio_rendering_indication", "uint", 8) - } - , - r.prototype._boxProcessors.avc1 = r.prototype._boxProcessors.avc2 = r.prototype._boxProcessors.avc3 = r.prototype._boxProcessors.avc4 = r.prototype._boxProcessors.hvc1 = r.prototype._boxProcessors.hev1 = r.prototype._boxProcessors.encv = function() { - this._procFieldArray("reserved1", 6, "uint", 8), - this._procField("data_reference_index", "uint", 16), - this._procField("pre_defined1", "uint", 16), - this._procField("reserved2", "uint", 16), - this._procFieldArray("pre_defined2", 3, "uint", 32), - this._procField("width", "uint", 16), - this._procField("height", "uint", 16), - this._procField("horizresolution", "template", 32), - this._procField("vertresolution", "template", 32), - this._procField("reserved3", "uint", 32), - this._procField("frame_count", "uint", 16), - this._procFieldArray("compressorname", 32, "uint", 8), - this._procField("depth", "uint", 16), - this._procField("pre_defined3", "int", 16), - this._procField("config", "data", -1) - } - , - r.prototype._boxProcessors.ctts = function() { - this._procFullBox(), - this._procField("entry_count", "uint", 32), - this._procEntries("entries", this.entry_count, (function(t) { - this._procEntryField(t, "sample_count", "uint", 32), - this._procEntryField(t, "sample_offset", 1 === this.version ? "int" : "uint", 32) - } - )) - } - , - r.prototype._boxProcessors.dref = function() { - this._procFullBox(), - this._procField("entry_count", "uint", 32), - this._procSubBoxes("entries", this.entry_count) - } - , - r.prototype._boxProcessors.elng = function() { - this._procFullBox(), - this._procField("extended_language", "utf8string") - } - , - r.prototype._boxProcessors.elst = function() { - this._procFullBox(), - this._procField("entry_count", "uint", 32), - this._procEntries("entries", this.entry_count, (function(t) { - this._procEntryField(t, "segment_duration", "uint", 1 === this.version ? 64 : 32), - this._procEntryField(t, "media_time", "int", 1 === this.version ? 64 : 32), - this._procEntryField(t, "media_rate_integer", "int", 16), - this._procEntryField(t, "media_rate_fraction", "int", 16) - } - )) - } - , - r.prototype._boxProcessors.emsg = function() { - this._procFullBox(), - 1 == this.version ? (this._procField("timescale", "uint", 32), - this._procField("presentation_time", "uint", 64), - this._procField("event_duration", "uint", 32), - this._procField("id", "uint", 32), - this._procField("scheme_id_uri", "string", -1), - this._procField("value", "string", -1)) : (this._procField("scheme_id_uri", "string", -1), - this._procField("value", "string", -1), - this._procField("timescale", "uint", 32), - this._procField("presentation_time_delta", "uint", 32), - this._procField("event_duration", "uint", 32), - this._procField("id", "uint", 32)), - this._procField("message_data", "data", -1) - } - , - r.prototype._boxProcessors.free = r.prototype._boxProcessors.skip = function() { - this._procField("data", "data", -1) - } - , - r.prototype._boxProcessors.frma = function() { - this._procField("data_format", "uint", 32) - } - , - r.prototype._boxProcessors.ftyp = r.prototype._boxProcessors.styp = function() { - this._procField("major_brand", "string", 4), - this._procField("minor_version", "uint", 32); - var t = -1; - this._parsing && (t = (this._raw.byteLength - (this._cursor.offset - this._raw.byteOffset)) / 4), - this._procFieldArray("compatible_brands", t, "string", 4) - } - , - r.prototype._boxProcessors.hdlr = function() { - this._procFullBox(), - this._procField("pre_defined", "uint", 32), - this._procField("handler_type", "string", 4), - this._procFieldArray("reserved", 3, "uint", 32), - this._procField("name", "string", -1) - } - , - r.prototype._boxProcessors.imda = function() { - this._procField("imda_identifier", "uint", 32), - this._procField("data", "data", -1) - } - , - r.prototype._boxProcessors.kind = function() { - this._procFullBox(), - this._procField("schemeURI", "utf8string"), - this._procField("value", "utf8string") - } - , - r.prototype._boxProcessors.labl = function() { - this._procFullBox(), - this.is_group_label = !!(1 & this.flags), - this._procField("label_id", "uint", 16), - this._procField("language", "utf8string"), - this._procField("label", "utf8string") - } - , - r.prototype._boxProcessors.mdat = function() { - this._procField("data", "data", -1) - } - , - r.prototype._boxProcessors.mdhd = function() { - this._procFullBox(), - this._procField("creation_time", "uint", 1 == this.version ? 64 : 32), - this._procField("modification_time", "uint", 1 == this.version ? 64 : 32), - this._procField("timescale", "uint", 32), - this._procField("duration", "uint", 1 == this.version ? 64 : 32), - this._parsing || "string" != typeof this.language || (this.language = this.language.charCodeAt(0) - 96 << 10 | this.language.charCodeAt(1) - 96 << 5 | this.language.charCodeAt(2) - 96), - this._procField("language", "uint", 16), - this._parsing && (this.language = String.fromCharCode(96 + (this.language >> 10 & 31), 96 + (this.language >> 5 & 31), 96 + (31 & this.language))), - this._procField("pre_defined", "uint", 16) - } - , - r.prototype._boxProcessors.mehd = function() { - this._procFullBox(), - this._procField("fragment_duration", "uint", 1 == this.version ? 64 : 32) - } - , - r.prototype._boxProcessors.meta = function() { - this._procFullBox() - } - , - r.prototype._boxProcessors.mfhd = function() { - this._procFullBox(), - this._procField("sequence_number", "uint", 32) - } - , - r.prototype._boxProcessors.mfro = function() { - this._procFullBox(), - this._procField("mfra_size", "uint", 32) - } - , - r.prototype._boxProcessors.mp4a = r.prototype._boxProcessors.enca = function() { - this._procFieldArray("reserved1", 6, "uint", 8), - this._procField("data_reference_index", "uint", 16), - this._procFieldArray("reserved2", 2, "uint", 32), - this._procField("channelcount", "uint", 16), - this._procField("samplesize", "uint", 16), - this._procField("pre_defined", "uint", 16), - this._procField("reserved3", "uint", 16), - this._procField("samplerate", "template", 32), - this._procField("esds", "data", -1) - } - , - r.prototype._boxProcessors.mvhd = function() { - this._procFullBox(), - this._procField("creation_time", "uint", 1 == this.version ? 64 : 32), - this._procField("modification_time", "uint", 1 == this.version ? 64 : 32), - this._procField("timescale", "uint", 32), - this._procField("duration", "uint", 1 == this.version ? 64 : 32), - this._procField("rate", "template", 32), - this._procField("volume", "template", 16), - this._procField("reserved1", "uint", 16), - this._procFieldArray("reserved2", 2, "uint", 32), - this._procFieldArray("matrix", 9, "template", 32), - this._procFieldArray("pre_defined", 6, "uint", 32), - this._procField("next_track_ID", "uint", 32) - } - , - r.prototype._boxProcessors.payl = function() { - this._procField("cue_text", "utf8") - } - , - r.prototype._boxProcessors.prft = function() { - this._procFullBox(), - this._procField("reference_track_ID", "uint", 32), - this._procField("ntp_timestamp_sec", "uint", 32), - this._procField("ntp_timestamp_frac", "uint", 32), - this._procField("media_time", "uint", 1 == this.version ? 64 : 32) - } - , - r.prototype._boxProcessors.prsl = function() { - this._procFullBox(), - this._procField("group_id", "uint", 32), - this._procField("num_entities_in_group", "uint", 32), - this._procEntries("entities", this.num_entities_in_group, (function(t) { - this._procEntryField(t, "entity_id", "uint", 32) - } - )), - 4096 & this.flags && this._procField("preselection_tag", "utf8string"), - 8192 & this.flags && this._procField("selection_priority", "uint", 8), - 16384 & this.flags && this._procField("interleaving_tag", "utf8string") - } - , - r.prototype._boxProcessors.pssh = function() { - this._procFullBox(), - this._procFieldArray("SystemID", 16, "uint", 8), - this._procField("DataSize", "uint", 32), - this._procFieldArray("Data", this.DataSize, "uint", 8) - } - , - r.prototype._boxProcessors.schm = function() { - this._procFullBox(), - this._procField("scheme_type", "uint", 32), - this._procField("scheme_version", "uint", 32), - 1 & this.flags && this._procField("scheme_uri", "string", -1) - } - , - r.prototype._boxProcessors.sdtp = function() { - this._procFullBox(); - var t = -1; - this._parsing && (t = this._raw.byteLength - (this._cursor.offset - this._raw.byteOffset)), - this._procFieldArray("sample_dependency_table", t, "uint", 8) - } - , - r.prototype._boxProcessors.sidx = function() { - this._procFullBox(), - this._procField("reference_ID", "uint", 32), - this._procField("timescale", "uint", 32), - this._procField("earliest_presentation_time", "uint", 1 == this.version ? 64 : 32), - this._procField("first_offset", "uint", 1 == this.version ? 64 : 32), - this._procField("reserved", "uint", 16), - this._procField("reference_count", "uint", 16), - this._procEntries("references", this.reference_count, (function(t) { - this._parsing || (t.reference = (1 & t.reference_type) << 31, - t.reference |= 2147483647 & t.referenced_size, - t.sap = (1 & t.starts_with_SAP) << 31, - t.sap |= (3 & t.SAP_type) << 28, - t.sap |= 268435455 & t.SAP_delta_time), - this._procEntryField(t, "reference", "uint", 32), - this._procEntryField(t, "subsegment_duration", "uint", 32), - this._procEntryField(t, "sap", "uint", 32), - this._parsing && (t.reference_type = t.reference >> 31 & 1, - t.referenced_size = 2147483647 & t.reference, - t.starts_with_SAP = t.sap >> 31 & 1, - t.SAP_type = t.sap >> 28 & 7, - t.SAP_delta_time = 268435455 & t.sap) - } - )) - } - , - r.prototype._boxProcessors.smhd = function() { - this._procFullBox(), - this._procField("balance", "uint", 16), - this._procField("reserved", "uint", 16) - } - , - r.prototype._boxProcessors.ssix = function() { - this._procFullBox(), - this._procField("subsegment_count", "uint", 32), - this._procEntries("subsegments", this.subsegment_count, (function(t) { - this._procEntryField(t, "ranges_count", "uint", 32), - this._procSubEntries(t, "ranges", t.ranges_count, (function(t) { - this._procEntryField(t, "level", "uint", 8), - this._procEntryField(t, "range_size", "uint", 24) - } - )) - } - )) - } - , - r.prototype._boxProcessors.stsd = function() { - this._procFullBox(), - this._procField("entry_count", "uint", 32), - this._procSubBoxes("entries", this.entry_count) - } - , - r.prototype._boxProcessors.sttg = function() { - this._procField("settings", "utf8") - } - , - r.prototype._boxProcessors.stts = function() { - this._procFullBox(), - this._procField("entry_count", "uint", 32), - this._procEntries("entries", this.entry_count, (function(t) { - this._procEntryField(t, "sample_count", "uint", 32), - this._procEntryField(t, "sample_delta", "uint", 32) - } - )) - } - , - r.prototype._boxProcessors.subs = function() { - this._procFullBox(), - this._procField("entry_count", "uint", 32), - this._procEntries("entries", this.entry_count, (function(t) { - this._procEntryField(t, "sample_delta", "uint", 32), - this._procEntryField(t, "subsample_count", "uint", 16), - this._procSubEntries(t, "subsamples", t.subsample_count, (function(t) { - this._procEntryField(t, "subsample_size", "uint", 1 === this.version ? 32 : 16), - this._procEntryField(t, "subsample_priority", "uint", 8), - this._procEntryField(t, "discardable", "uint", 8), - this._procEntryField(t, "codec_specific_parameters", "uint", 32) - } - )) - } - )) - } - , - r.prototype._boxProcessors.tenc = function() { - this._procFullBox(), - this._procField("default_IsEncrypted", "uint", 24), - this._procField("default_IV_size", "uint", 8), - this._procFieldArray("default_KID", 16, "uint", 8) - } - , - r.prototype._boxProcessors.tfdt = function() { - this._procFullBox(), - this._procField("baseMediaDecodeTime", "uint", 1 == this.version ? 64 : 32) - } - , - r.prototype._boxProcessors.tfhd = function() { - this._procFullBox(), - this._procField("track_ID", "uint", 32), - 1 & this.flags && this._procField("base_data_offset", "uint", 64), - 2 & this.flags && this._procField("sample_description_offset", "uint", 32), - 8 & this.flags && this._procField("default_sample_duration", "uint", 32), - 16 & this.flags && this._procField("default_sample_size", "uint", 32), - 32 & this.flags && this._procField("default_sample_flags", "uint", 32) - } - , - r.prototype._boxProcessors.tfra = function() { - this._procFullBox(), - this._procField("track_ID", "uint", 32), - this._parsing || (this.reserved = 0, - this.reserved |= (48 & this.length_size_of_traf_num) << 4, - this.reserved |= (12 & this.length_size_of_trun_num) << 2, - this.reserved |= 3 & this.length_size_of_sample_num), - this._procField("reserved", "uint", 32), - this._parsing && (this.length_size_of_traf_num = (48 & this.reserved) >> 4, - this.length_size_of_trun_num = (12 & this.reserved) >> 2, - this.length_size_of_sample_num = 3 & this.reserved), - this._procField("number_of_entry", "uint", 32), - this._procEntries("entries", this.number_of_entry, (function(t) { - this._procEntryField(t, "time", "uint", 1 === this.version ? 64 : 32), - this._procEntryField(t, "moof_offset", "uint", 1 === this.version ? 64 : 32), - this._procEntryField(t, "traf_number", "uint", 8 * (this.length_size_of_traf_num + 1)), - this._procEntryField(t, "trun_number", "uint", 8 * (this.length_size_of_trun_num + 1)), - this._procEntryField(t, "sample_number", "uint", 8 * (this.length_size_of_sample_num + 1)) - } - )) - } - , - r.prototype._boxProcessors.tkhd = function() { - this._procFullBox(), - this._procField("creation_time", "uint", 1 == this.version ? 64 : 32), - this._procField("modification_time", "uint", 1 == this.version ? 64 : 32), - this._procField("track_ID", "uint", 32), - this._procField("reserved1", "uint", 32), - this._procField("duration", "uint", 1 == this.version ? 64 : 32), - this._procFieldArray("reserved2", 2, "uint", 32), - this._procField("layer", "uint", 16), - this._procField("alternate_group", "uint", 16), - this._procField("volume", "template", 16), - this._procField("reserved3", "uint", 16), - this._procFieldArray("matrix", 9, "template", 32), - this._procField("width", "template", 32), - this._procField("height", "template", 32) - } - , - r.prototype._boxProcessors.trex = function() { - this._procFullBox(), - this._procField("track_ID", "uint", 32), - this._procField("default_sample_description_index", "uint", 32), - this._procField("default_sample_duration", "uint", 32), - this._procField("default_sample_size", "uint", 32), - this._procField("default_sample_flags", "uint", 32) - } - , - r.prototype._boxProcessors.trun = function() { - this._procFullBox(), - this._procField("sample_count", "uint", 32), - 1 & this.flags && this._procField("data_offset", "int", 32), - 4 & this.flags && this._procField("first_sample_flags", "uint", 32), - this._procEntries("samples", this.sample_count, (function(t) { - 256 & this.flags && this._procEntryField(t, "sample_duration", "uint", 32), - 512 & this.flags && this._procEntryField(t, "sample_size", "uint", 32), - 1024 & this.flags && this._procEntryField(t, "sample_flags", "uint", 32), - 2048 & this.flags && this._procEntryField(t, "sample_composition_time_offset", 1 === this.version ? "int" : "uint", 32) - } - )) - } - , - r.prototype._boxProcessors["url "] = r.prototype._boxProcessors["urn "] = function() { - this._procFullBox(), - "urn " === this.type && this._procField("name", "string", -1), - this._procField("location", "string", -1) - } - , - r.prototype._boxProcessors.vlab = function() { - this._procField("source_label", "utf8") - } - , - r.prototype._boxProcessors.vmhd = function() { - this._procFullBox(), - this._procField("graphicsmode", "uint", 16), - this._procFieldArray("opcolor", 3, "uint", 16) - } - , - r.prototype._boxProcessors.vttC = function() { - this._procField("config", "utf8") - } - , - r.prototype._boxProcessors.vtte = function() {} - }, - 9826: function(t) { - "use strict"; - var e, n = "object" == typeof Reflect ? Reflect : null, a = n && "function" == typeof n.apply ? n.apply : function(t, e, n) { - return Function.prototype.apply.call(t, e, n) - } - ; - e = n && "function" == typeof n.ownKeys ? n.ownKeys : Object.getOwnPropertySymbols ? function(t) { - return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)) - } - : function(t) { - return Object.getOwnPropertyNames(t) - } - ; - var r = Number.isNaN || function(t) { - return t != t - } - ; - function i() { - i.init.call(this) - } - t.exports = i, - t.exports.once = function(t, e) { - return new Promise((function(n, a) { - function r(n) { - t.removeListener(e, i), - a(n) - } - function i() { - "function" == typeof t.removeListener && t.removeListener("error", r), - n([].slice.call(arguments)) - } - h(t, e, i, { - once: !0 - }), - "error" !== e && function(t, e) { - "function" == typeof t.on && h(t, "error", e, { - once: !0 - }) - }(t, r) - } - )) - } - , - i.EventEmitter = i, - i.prototype._events = void 0, - i.prototype._eventsCount = 0, - i.prototype._maxListeners = void 0; - var o = 10; - function l(t) { - if ("function" != typeof t) - throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t) - } - function s(t) { - return void 0 === t._maxListeners ? i.defaultMaxListeners : t._maxListeners - } - function u(t, e, n, a) { - var r, i, o, u; - if (l(n), - void 0 === (i = t._events) ? (i = t._events = Object.create(null), - t._eventsCount = 0) : (void 0 !== i.newListener && (t.emit("newListener", e, n.listener ? n.listener : n), - i = t._events), - o = i[e]), - void 0 === o) - o = i[e] = n, - ++t._eventsCount; - else if ("function" == typeof o ? o = i[e] = a ? [n, o] : [o, n] : a ? o.unshift(n) : o.push(n), - (r = s(t)) > 0 && o.length > r && !o.warned) { - o.warned = !0; - var c = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit"); - c.name = "MaxListenersExceededWarning", - c.emitter = t, - c.type = e, - c.count = o.length, - u = c, - console && console.warn && console.warn(u) - } - return t - } - function c() { - if (!this.fired) - return this.target.removeListener(this.type, this.wrapFn), - this.fired = !0, - 0 === arguments.length ? this.listener.call(this.target) : this.listener.apply(this.target, arguments) - } - function d(t, e, n) { - var a = { - fired: !1, - wrapFn: void 0, - target: t, - type: e, - listener: n - } - , r = c.bind(a); - return r.listener = n, - a.wrapFn = r, - r - } - function f(t, e, n) { - var a = t._events; - if (void 0 === a) - return []; - var r = a[e]; - return void 0 === r ? [] : "function" == typeof r ? n ? [r.listener || r] : [r] : n ? function(t) { - for (var e = new Array(t.length), n = 0; n < e.length; ++n) - e[n] = t[n].listener || t[n]; - return e - }(r) : m(r, r.length) - } - function g(t) { - var e = this._events; - if (void 0 !== e) { - var n = e[t]; - if ("function" == typeof n) - return 1; - if (void 0 !== n) - return n.length - } - return 0 - } - function m(t, e) { - for (var n = new Array(e), a = 0; a < e; ++a) - n[a] = t[a]; - return n - } - function h(t, e, n, a) { - if ("function" == typeof t.on) - a.once ? t.once(e, n) : t.on(e, n); - else { - if ("function" != typeof t.addEventListener) - throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t); - t.addEventListener(e, (function r(i) { - a.once && t.removeEventListener(e, r), - n(i) - } - )) - } - } - Object.defineProperty(i, "defaultMaxListeners", { - enumerable: !0, - get: function() { - return o - }, - set: function(t) { - if ("number" != typeof t || t < 0 || r(t)) - throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + "."); - o = t - } - }), - i.init = function() { - void 0 !== this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = Object.create(null), - this._eventsCount = 0), - this._maxListeners = this._maxListeners || void 0 - } - , - i.prototype.setMaxListeners = function(t) { - if ("number" != typeof t || t < 0 || r(t)) - throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + t + "."); - return this._maxListeners = t, - this - } - , - i.prototype.getMaxListeners = function() { - return s(this) - } - , - i.prototype.emit = function(t) { - for (var e = [], n = 1; n < arguments.length; n++) - e.push(arguments[n]); - var r = "error" === t - , i = this._events; - if (void 0 !== i) - r = r && void 0 === i.error; - else if (!r) - return !1; - if (r) { - var o; - if (e.length > 0 && (o = e[0]), - o instanceof Error) - throw o; - var l = new Error("Unhandled error." + (o ? " (" + o.message + ")" : "")); - throw l.context = o, - l - } - var s = i[t]; - if (void 0 === s) - return !1; - if ("function" == typeof s) - a(s, this, e); - else { - var u = s.length - , c = m(s, u); - for (n = 0; n < u; ++n) - a(c[n], this, e) - } - return !0 - } - , - i.prototype.addListener = function(t, e) { - return u(this, t, e, !1) - } - , - i.prototype.on = i.prototype.addListener, - i.prototype.prependListener = function(t, e) { - return u(this, t, e, !0) - } - , - i.prototype.once = function(t, e) { - return l(e), - this.on(t, d(this, t, e)), - this - } - , - i.prototype.prependOnceListener = function(t, e) { - return l(e), - this.prependListener(t, d(this, t, e)), - this - } - , - i.prototype.removeListener = function(t, e) { - var n, a, r, i, o; - if (l(e), - void 0 === (a = this._events)) - return this; - if (void 0 === (n = a[t])) - return this; - if (n === e || n.listener === e) - 0 == --this._eventsCount ? this._events = Object.create(null) : (delete a[t], - a.removeListener && this.emit("removeListener", t, n.listener || e)); - else if ("function" != typeof n) { - for (r = -1, - i = n.length - 1; i >= 0; i--) - if (n[i] === e || n[i].listener === e) { - o = n[i].listener, - r = i; - break - } - if (r < 0) - return this; - 0 === r ? n.shift() : function(t, e) { - for (; e + 1 < t.length; e++) - t[e] = t[e + 1]; - t.pop() - }(n, r), - 1 === n.length && (a[t] = n[0]), - void 0 !== a.removeListener && this.emit("removeListener", t, o || e) - } - return this - } - , - i.prototype.off = i.prototype.removeListener, - i.prototype.removeAllListeners = function(t) { - var e, n, a; - if (void 0 === (n = this._events)) - return this; - if (void 0 === n.removeListener) - return 0 === arguments.length ? (this._events = Object.create(null), - this._eventsCount = 0) : void 0 !== n[t] && (0 == --this._eventsCount ? this._events = Object.create(null) : delete n[t]), - this; - if (0 === arguments.length) { - var r, i = Object.keys(n); - for (a = 0; a < i.length; ++a) - "removeListener" !== (r = i[a]) && this.removeAllListeners(r); - return this.removeAllListeners("removeListener"), - this._events = Object.create(null), - this._eventsCount = 0, - this - } - if ("function" == typeof (e = n[t])) - this.removeListener(t, e); - else if (void 0 !== e) - for (a = e.length - 1; a >= 0; a--) - this.removeListener(t, e[a]); - return this - } - , - i.prototype.listeners = function(t) { - return f(this, t, !0) - } - , - i.prototype.rawListeners = function(t) { - return f(this, t, !1) - } - , - i.listenerCount = function(t, e) { - return "function" == typeof t.listenerCount ? t.listenerCount(e) : g.call(t, e) - } - , - i.prototype.listenerCount = g, - i.prototype.eventNames = function() { - return this._eventsCount > 0 ? e(this._events) : [] - } - }, - 7316: function(t) { - "use strict"; - t.exports = function t(e, n) { - if (e === n) - return !0; - if (e && n && "object" == typeof e && "object" == typeof n) { - if (e.constructor !== n.constructor) - return !1; - var a, r, i; - if (Array.isArray(e)) { - if ((a = e.length) != n.length) - return !1; - for (r = a; 0 != r--; ) - if (!t(e[r], n[r])) - return !1; - return !0 - } - if (e.constructor === RegExp) - return e.source === n.source && e.flags === n.flags; - if (e.valueOf !== Object.prototype.valueOf) - return e.valueOf() === n.valueOf(); - if (e.toString !== Object.prototype.toString) - return e.toString() === n.toString(); - if ((a = (i = Object.keys(e)).length) !== Object.keys(n).length) - return !1; - for (r = a; 0 != r--; ) - if (!Object.prototype.hasOwnProperty.call(n, i[r])) - return !1; - for (r = a; 0 != r--; ) { - var o = i[r]; - if (!t(e[o], n[o])) - return !1 - } - return !0 - } - return e != e && n != n - } - }, - 7986: function(t, e) { - e.read = function(t, e, n, a, r) { - var i, o, l = 8 * r - a - 1, s = (1 << l) - 1, u = s >> 1, c = -7, d = n ? r - 1 : 0, f = n ? -1 : 1, g = t[e + d]; - for (d += f, - i = g & (1 << -c) - 1, - g >>= -c, - c += l; c > 0; i = 256 * i + t[e + d], - d += f, - c -= 8) - ; - for (o = i & (1 << -c) - 1, - i >>= -c, - c += a; c > 0; o = 256 * o + t[e + d], - d += f, - c -= 8) - ; - if (0 === i) - i = 1 - u; - else { - if (i === s) - return o ? NaN : 1 / 0 * (g ? -1 : 1); - o += Math.pow(2, a), - i -= u - } - return (g ? -1 : 1) * o * Math.pow(2, i - a) - } - , - e.write = function(t, e, n, a, r, i) { - var o, l, s, u = 8 * i - r - 1, c = (1 << u) - 1, d = c >> 1, f = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0, g = a ? 0 : i - 1, m = a ? 1 : -1, h = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0; - for (e = Math.abs(e), - isNaN(e) || e === 1 / 0 ? (l = isNaN(e) ? 1 : 0, - o = c) : (o = Math.floor(Math.log(e) / Math.LN2), - e * (s = Math.pow(2, -o)) < 1 && (o--, - s *= 2), - (e += o + d >= 1 ? f / s : f * Math.pow(2, 1 - d)) * s >= 2 && (o++, - s /= 2), - o + d >= c ? (l = 0, - o = c) : o + d >= 1 ? (l = (e * s - 1) * Math.pow(2, r), - o += d) : (l = e * Math.pow(2, d - 1) * Math.pow(2, r), - o = 0)); r >= 8; t[n + g] = 255 & l, - g += m, - l /= 256, - r -= 8) - ; - for (o = o << r | l, - u += r; u > 0; t[n + g] = 255 & o, - g += m, - o /= 256, - u -= 8) - ; - t[n + g - m] |= 128 * h - } - }, - 5474: function(t, e, n) { - !function(t) { - t.parser = function(t, e) { - return new r(t,e) - } - , - t.SAXParser = r, - t.SAXStream = o, - t.createStream = function(t, e) { - return new o(t,e) - } - , - t.MAX_BUFFER_LENGTH = 65536; - var e, a = ["comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script"]; - function r(e, n) { - if (!(this instanceof r)) - return new r(e,n); - var i = this; - !function(t) { - for (var e = 0, n = a.length; e < n; e++) - t[a[e]] = "" - }(i), - i.q = i.c = "", - i.bufferCheckPosition = t.MAX_BUFFER_LENGTH, - i.opt = n || {}, - i.opt.lowercase = i.opt.lowercase || i.opt.lowercasetags, - i.looseCase = i.opt.lowercase ? "toLowerCase" : "toUpperCase", - i.tags = [], - i.closed = i.closedRoot = i.sawRoot = !1, - i.tag = i.error = null, - i.strict = !!e, - i.noscript = !(!e && !i.opt.noscript), - i.state = k.BEGIN, - i.strictEntities = i.opt.strictEntities, - i.ENTITIES = i.strictEntities ? Object.create(t.XML_ENTITIES) : Object.create(t.ENTITIES), - i.attribList = [], - i.opt.xmlns && (i.ns = Object.create(p)), - i.trackPosition = !1 !== i.opt.position, - i.trackPosition && (i.position = i.line = i.column = 0), - N(i, "onready") - } - t.EVENTS = ["text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "opentagstart", "attribute", "opentag", "closetag", "opencdata", "cdata", "closecdata", "error", "end", "ready", "script", "opennamespace", "closenamespace"], - Object.create || (Object.create = function(t) { - function e() {} - return e.prototype = t, - new e - } - ), - Object.keys || (Object.keys = function(t) { - var e = []; - for (var n in t) - t.hasOwnProperty(n) && e.push(n); - return e - } - ), - r.prototype = { - end: function() { - z(this) - }, - write: function(e) { - var n = this; - if (this.error) - throw this.error; - if (n.closed) - return M(n, "Cannot write after close. Assign an onready handler."); - if (null === e) - return z(n); - "object" == typeof e && (e = e.toString()); - for (var r = 0, i = ""; i = G(e, r++), - n.c = i, - i; ) - switch (n.trackPosition && (n.position++, - "\n" === i ? (n.line++, - n.column = 0) : n.column++), - n.state) { - case k.BEGIN: - if (n.state = k.BEGIN_WHITESPACE, - "\ufeff" === i) - continue; - q(n, i); - continue; - case k.BEGIN_WHITESPACE: - q(n, i); - continue; - case k.TEXT: - if (n.sawRoot && !n.closedRoot) { - for (var o = r - 1; i && "<" !== i && "&" !== i; ) - (i = G(e, r++)) && n.trackPosition && (n.position++, - "\n" === i ? (n.line++, - n.column = 0) : n.column++); - n.textNode += e.substring(o, r - 1) - } - "<" !== i || n.sawRoot && n.closedRoot && !n.strict ? (!v(l, i) || n.sawRoot && !n.closedRoot || O(n, "Text data outside of root node."), - "&" === i ? n.state = k.TEXT_ENTITY : n.textNode += i) : (n.state = k.OPEN_WAKA, - n.startTagPosition = n.position); - continue; - case k.SCRIPT: - "<" === i ? n.state = k.SCRIPT_ENDING : n.script += i; - continue; - case k.SCRIPT_ENDING: - "/" === i ? n.state = k.CLOSE_TAG : (n.script += "<" + i, - n.state = k.SCRIPT); - continue; - case k.OPEN_WAKA: - if ("!" === i) - n.state = k.SGML_DECL, - n.sgmlDecl = ""; - else if (T(l, i)) - ; - else if (T(b, i)) - n.state = k.OPEN_TAG, - n.tagName = i; - else if ("/" === i) - n.state = k.CLOSE_TAG, - n.tagName = ""; - else if ("?" === i) - n.state = k.PROC_INST, - n.procInstName = n.procInstBody = ""; - else { - if (O(n, "Unencoded <"), - n.startTagPosition + 1 < n.position) { - var s = n.position - n.startTagPosition; - i = new Array(s).join(" ") + i - } - n.textNode += "<" + i, - n.state = k.TEXT - } - continue; - case k.SGML_DECL: - (n.sgmlDecl + i).toUpperCase() === f ? (C(n, "onopencdata"), - n.state = k.CDATA, - n.sgmlDecl = "", - n.cdata = "") : n.sgmlDecl + i === "--" ? (n.state = k.COMMENT, - n.comment = "", - n.sgmlDecl = "") : (n.sgmlDecl + i).toUpperCase() === g ? (n.state = k.DOCTYPE, - (n.doctype || n.sawRoot) && O(n, "Inappropriately located doctype declaration"), - n.doctype = "", - n.sgmlDecl = "") : ">" === i ? (C(n, "onsgmldeclaration", n.sgmlDecl), - n.sgmlDecl = "", - n.state = k.TEXT) : T(c, i) ? (n.state = k.SGML_DECL_QUOTED, - n.sgmlDecl += i) : n.sgmlDecl += i; - continue; - case k.SGML_DECL_QUOTED: - i === n.q && (n.state = k.SGML_DECL, - n.q = ""), - n.sgmlDecl += i; - continue; - case k.DOCTYPE: - ">" === i ? (n.state = k.TEXT, - C(n, "ondoctype", n.doctype), - n.doctype = !0) : (n.doctype += i, - "[" === i ? n.state = k.DOCTYPE_DTD : T(c, i) && (n.state = k.DOCTYPE_QUOTED, - n.q = i)); - continue; - case k.DOCTYPE_QUOTED: - n.doctype += i, - i === n.q && (n.q = "", - n.state = k.DOCTYPE); - continue; - case k.DOCTYPE_DTD: - n.doctype += i, - "]" === i ? n.state = k.DOCTYPE : T(c, i) && (n.state = k.DOCTYPE_DTD_QUOTED, - n.q = i); - continue; - case k.DOCTYPE_DTD_QUOTED: - n.doctype += i, - i === n.q && (n.state = k.DOCTYPE_DTD, - n.q = ""); - continue; - case k.COMMENT: - "-" === i ? n.state = k.COMMENT_ENDING : n.comment += i; - continue; - case k.COMMENT_ENDING: - "-" === i ? (n.state = k.COMMENT_ENDED, - n.comment = x(n.opt, n.comment), - n.comment && C(n, "oncomment", n.comment), - n.comment = "") : (n.comment += "-" + i, - n.state = k.COMMENT); - continue; - case k.COMMENT_ENDED: - ">" !== i ? (O(n, "Malformed comment"), - n.comment += "--" + i, - n.state = k.COMMENT) : n.state = k.TEXT; - continue; - case k.CDATA: - "]" === i ? n.state = k.CDATA_ENDING : n.cdata += i; - continue; - case k.CDATA_ENDING: - "]" === i ? n.state = k.CDATA_ENDING_2 : (n.cdata += "]" + i, - n.state = k.CDATA); - continue; - case k.CDATA_ENDING_2: - ">" === i ? (n.cdata && C(n, "oncdata", n.cdata), - C(n, "onclosecdata"), - n.cdata = "", - n.state = k.TEXT) : "]" === i ? n.cdata += "]" : (n.cdata += "]]" + i, - n.state = k.CDATA); - continue; - case k.PROC_INST: - "?" === i ? n.state = k.PROC_INST_ENDING : T(l, i) ? n.state = k.PROC_INST_BODY : n.procInstName += i; - continue; - case k.PROC_INST_BODY: - if (!n.procInstBody && T(l, i)) - continue; - "?" === i ? n.state = k.PROC_INST_ENDING : n.procInstBody += i; - continue; - case k.PROC_INST_ENDING: - ">" === i ? (C(n, "onprocessinginstruction", { - name: n.procInstName, - body: n.procInstBody - }), - n.procInstName = n.procInstBody = "", - n.state = k.TEXT) : (n.procInstBody += "?" + i, - n.state = k.PROC_INST_BODY); - continue; - case k.OPEN_TAG: - T(y, i) ? n.tagName += i : (L(n), - ">" === i ? U(n) : "/" === i ? n.state = k.OPEN_TAG_SLASH : (v(l, i) && O(n, "Invalid character in tag name"), - n.state = k.ATTRIB)); - continue; - case k.OPEN_TAG_SLASH: - ">" === i ? (U(n, !0), - j(n)) : (O(n, "Forward-slash in opening tag not followed by >"), - n.state = k.ATTRIB); - continue; - case k.ATTRIB: - if (T(l, i)) - continue; - ">" === i ? U(n) : "/" === i ? n.state = k.OPEN_TAG_SLASH : T(b, i) ? (n.attribName = i, - n.attribValue = "", - n.state = k.ATTRIB_NAME) : O(n, "Invalid attribute name"); - continue; - case k.ATTRIB_NAME: - "=" === i ? n.state = k.ATTRIB_VALUE : ">" === i ? (O(n, "Attribute without value"), - n.attribValue = n.attribName, - F(n), - U(n)) : T(l, i) ? n.state = k.ATTRIB_NAME_SAW_WHITE : T(y, i) ? n.attribName += i : O(n, "Invalid attribute name"); - continue; - case k.ATTRIB_NAME_SAW_WHITE: - if ("=" === i) - n.state = k.ATTRIB_VALUE; - else { - if (T(l, i)) - continue; - O(n, "Attribute without value"), - n.tag.attributes[n.attribName] = "", - n.attribValue = "", - C(n, "onattribute", { - name: n.attribName, - value: "" - }), - n.attribName = "", - ">" === i ? U(n) : T(b, i) ? (n.attribName = i, - n.state = k.ATTRIB_NAME) : (O(n, "Invalid attribute name"), - n.state = k.ATTRIB) - } - continue; - case k.ATTRIB_VALUE: - if (T(l, i)) - continue; - T(c, i) ? (n.q = i, - n.state = k.ATTRIB_VALUE_QUOTED) : (O(n, "Unquoted attribute value"), - n.state = k.ATTRIB_VALUE_UNQUOTED, - n.attribValue = i); - continue; - case k.ATTRIB_VALUE_QUOTED: - if (i !== n.q) { - "&" === i ? n.state = k.ATTRIB_VALUE_ENTITY_Q : n.attribValue += i; - continue - } - F(n), - n.q = "", - n.state = k.ATTRIB_VALUE_CLOSED; - continue; - case k.ATTRIB_VALUE_CLOSED: - T(l, i) ? n.state = k.ATTRIB : ">" === i ? U(n) : "/" === i ? n.state = k.OPEN_TAG_SLASH : T(b, i) ? (O(n, "No whitespace between attributes"), - n.attribName = i, - n.attribValue = "", - n.state = k.ATTRIB_NAME) : O(n, "Invalid attribute name"); - continue; - case k.ATTRIB_VALUE_UNQUOTED: - if (v(d, i)) { - "&" === i ? n.state = k.ATTRIB_VALUE_ENTITY_U : n.attribValue += i; - continue - } - F(n), - ">" === i ? U(n) : n.state = k.ATTRIB; - continue; - case k.CLOSE_TAG: - if (n.tagName) - ">" === i ? j(n) : T(y, i) ? n.tagName += i : n.script ? (n.script += "" === i ? j(n) : O(n, "Invalid characters in closing tag"); - continue; - case k.TEXT_ENTITY: - case k.ATTRIB_VALUE_ENTITY_Q: - case k.ATTRIB_VALUE_ENTITY_U: - var u, m; - switch (n.state) { - case k.TEXT_ENTITY: - u = k.TEXT, - m = "textNode"; - break; - case k.ATTRIB_VALUE_ENTITY_Q: - u = k.ATTRIB_VALUE_QUOTED, - m = "attribValue"; - break; - case k.ATTRIB_VALUE_ENTITY_U: - u = k.ATTRIB_VALUE_UNQUOTED, - m = "attribValue" - } - ";" === i ? (n[m] += B(n), - n.entity = "", - n.state = u) : T(n.entity.length ? _ : E, i) ? n.entity += i : (O(n, "Invalid character in entity name"), - n[m] += "&" + n.entity + i, - n.entity = "", - n.state = u); - continue; - default: - throw new Error(n,"Unknown state: " + n.state) - } - return n.position >= n.bufferCheckPosition && function(e) { - for (var n = Math.max(t.MAX_BUFFER_LENGTH, 10), r = 0, i = 0, o = a.length; i < o; i++) { - var l = e[a[i]].length; - if (l > n) - switch (a[i]) { - case "textNode": - D(e); - break; - case "cdata": - C(e, "oncdata", e.cdata), - e.cdata = ""; - break; - case "script": - C(e, "onscript", e.script), - e.script = ""; - break; - default: - M(e, "Max buffer length exceeded: " + a[i]) - } - r = Math.max(r, l) - } - var s = t.MAX_BUFFER_LENGTH - r; - e.bufferCheckPosition = s + e.position - }(n), - n - }, - resume: function() { - return this.error = null, - this - }, - close: function() { - return this.write(null) - }, - flush: function() { - var t; - D(t = this), - "" !== t.cdata && (C(t, "oncdata", t.cdata), - t.cdata = ""), - "" !== t.script && (C(t, "onscript", t.script), - t.script = "") - } - }; - try { - e = n(3515).Stream - } catch (t) { - e = function() {} - } - var i = t.EVENTS.filter((function(t) { - return "error" !== t && "end" !== t - } - )); - function o(t, n) { - if (!(this instanceof o)) - return new o(t,n); - e.apply(this), - this._parser = new r(t,n), - this.writable = !0, - this.readable = !0; - var a = this; - this._parser.onend = function() { - a.emit("end") - } - , - this._parser.onerror = function(t) { - a.emit("error", t), - a._parser.error = null - } - , - this._decoder = null, - i.forEach((function(t) { - Object.defineProperty(a, "on" + t, { - get: function() { - return a._parser["on" + t] - }, - set: function(e) { - if (!e) - return a.removeAllListeners(t), - a._parser["on" + t] = e, - e; - a.on(t, e) - }, - enumerable: !0, - configurable: !1 - }) - } - )) - } - o.prototype = Object.create(e.prototype, { - constructor: { - value: o - } - }), - o.prototype.write = function(t) { - if ("function" == typeof Buffer && "function" == typeof Buffer.isBuffer && Buffer.isBuffer(t)) { - if (!this._decoder) { - var e = n(748).I; - this._decoder = new e("utf8") - } - t = this._decoder.write(t) - } - return this._parser.write(t.toString()), - this.emit("data", t), - !0 - } - , - o.prototype.end = function(t) { - return t && t.length && this.write(t), - this._parser.end(), - !0 - } - , - o.prototype.on = function(t, n) { - var a = this; - return a._parser["on" + t] || -1 === i.indexOf(t) || (a._parser["on" + t] = function() { - var e = 1 === arguments.length ? [arguments[0]] : Array.apply(null, arguments); - e.splice(0, 0, t), - a.emit.apply(a, e) - } - ), - e.prototype.on.call(a, t, n) - } - ; - var l = "\r\n\t " - , s = "0124356789" - , u = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - , c = "'\"" - , d = l + ">" - , f = "[CDATA[" - , g = "DOCTYPE" - , m = "http://www.w3.org/XML/1998/namespace" - , h = "http://www.w3.org/2000/xmlns/" - , p = { - xml: m, - xmlns: h - }; - l = A(l), - s = A(s), - u = A(u); - var b = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ - , y = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/ - , E = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ - , _ = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/; - function A(t) { - return t.split("").reduce((function(t, e) { - return t[e] = !0, - t - } - ), {}) - } - function T(t, e) { - return function(t) { - return "[object RegExp]" === Object.prototype.toString.call(t) - }(t) ? !!e.match(t) : t[e] - } - function v(t, e) { - return !T(t, e) - } - c = A(c), - d = A(d); - var w, S, I, k = 0; - for (var R in t.STATE = { - BEGIN: k++, - BEGIN_WHITESPACE: k++, - TEXT: k++, - TEXT_ENTITY: k++, - OPEN_WAKA: k++, - SGML_DECL: k++, - SGML_DECL_QUOTED: k++, - DOCTYPE: k++, - DOCTYPE_QUOTED: k++, - DOCTYPE_DTD: k++, - DOCTYPE_DTD_QUOTED: k++, - COMMENT_STARTING: k++, - COMMENT: k++, - COMMENT_ENDING: k++, - COMMENT_ENDED: k++, - CDATA: k++, - CDATA_ENDING: k++, - CDATA_ENDING_2: k++, - PROC_INST: k++, - PROC_INST_BODY: k++, - PROC_INST_ENDING: k++, - OPEN_TAG: k++, - OPEN_TAG_SLASH: k++, - ATTRIB: k++, - ATTRIB_NAME: k++, - ATTRIB_NAME_SAW_WHITE: k++, - ATTRIB_VALUE: k++, - ATTRIB_VALUE_QUOTED: k++, - ATTRIB_VALUE_CLOSED: k++, - ATTRIB_VALUE_UNQUOTED: k++, - ATTRIB_VALUE_ENTITY_Q: k++, - ATTRIB_VALUE_ENTITY_U: k++, - CLOSE_TAG: k++, - CLOSE_TAG_SAW_WHITE: k++, - SCRIPT: k++, - SCRIPT_ENDING: k++ - }, - t.XML_ENTITIES = { - amp: "&", - gt: ">", - lt: "<", - quot: '"', - apos: "'" - }, - t.ENTITIES = { - amp: "&", - gt: ">", - lt: "<", - quot: '"', - apos: "'", - AElig: 198, - Aacute: 193, - Acirc: 194, - Agrave: 192, - Aring: 197, - Atilde: 195, - Auml: 196, - Ccedil: 199, - ETH: 208, - Eacute: 201, - Ecirc: 202, - Egrave: 200, - Euml: 203, - Iacute: 205, - Icirc: 206, - Igrave: 204, - Iuml: 207, - Ntilde: 209, - Oacute: 211, - Ocirc: 212, - Ograve: 210, - Oslash: 216, - Otilde: 213, - Ouml: 214, - THORN: 222, - Uacute: 218, - Ucirc: 219, - Ugrave: 217, - Uuml: 220, - Yacute: 221, - aacute: 225, - acirc: 226, - aelig: 230, - agrave: 224, - aring: 229, - atilde: 227, - auml: 228, - ccedil: 231, - eacute: 233, - ecirc: 234, - egrave: 232, - eth: 240, - euml: 235, - iacute: 237, - icirc: 238, - igrave: 236, - iuml: 239, - ntilde: 241, - oacute: 243, - ocirc: 244, - ograve: 242, - oslash: 248, - otilde: 245, - ouml: 246, - szlig: 223, - thorn: 254, - uacute: 250, - ucirc: 251, - ugrave: 249, - uuml: 252, - yacute: 253, - yuml: 255, - copy: 169, - reg: 174, - nbsp: 160, - iexcl: 161, - cent: 162, - pound: 163, - curren: 164, - yen: 165, - brvbar: 166, - sect: 167, - uml: 168, - ordf: 170, - laquo: 171, - not: 172, - shy: 173, - macr: 175, - deg: 176, - plusmn: 177, - sup1: 185, - sup2: 178, - sup3: 179, - acute: 180, - micro: 181, - para: 182, - middot: 183, - cedil: 184, - ordm: 186, - raquo: 187, - frac14: 188, - frac12: 189, - frac34: 190, - iquest: 191, - times: 215, - divide: 247, - OElig: 338, - oelig: 339, - Scaron: 352, - scaron: 353, - Yuml: 376, - fnof: 402, - circ: 710, - tilde: 732, - Alpha: 913, - Beta: 914, - Gamma: 915, - Delta: 916, - Epsilon: 917, - Zeta: 918, - Eta: 919, - Theta: 920, - Iota: 921, - Kappa: 922, - Lambda: 923, - Mu: 924, - Nu: 925, - Xi: 926, - Omicron: 927, - Pi: 928, - Rho: 929, - Sigma: 931, - Tau: 932, - Upsilon: 933, - Phi: 934, - Chi: 935, - Psi: 936, - Omega: 937, - alpha: 945, - beta: 946, - gamma: 947, - delta: 948, - epsilon: 949, - zeta: 950, - eta: 951, - theta: 952, - iota: 953, - kappa: 954, - lambda: 955, - mu: 956, - nu: 957, - xi: 958, - omicron: 959, - pi: 960, - rho: 961, - sigmaf: 962, - sigma: 963, - tau: 964, - upsilon: 965, - phi: 966, - chi: 967, - psi: 968, - omega: 969, - thetasym: 977, - upsih: 978, - piv: 982, - ensp: 8194, - emsp: 8195, - thinsp: 8201, - zwnj: 8204, - zwj: 8205, - lrm: 8206, - rlm: 8207, - ndash: 8211, - mdash: 8212, - lsquo: 8216, - rsquo: 8217, - sbquo: 8218, - ldquo: 8220, - rdquo: 8221, - bdquo: 8222, - dagger: 8224, - Dagger: 8225, - bull: 8226, - hellip: 8230, - permil: 8240, - prime: 8242, - Prime: 8243, - lsaquo: 8249, - rsaquo: 8250, - oline: 8254, - frasl: 8260, - euro: 8364, - image: 8465, - weierp: 8472, - real: 8476, - trade: 8482, - alefsym: 8501, - larr: 8592, - uarr: 8593, - rarr: 8594, - darr: 8595, - harr: 8596, - crarr: 8629, - lArr: 8656, - uArr: 8657, - rArr: 8658, - dArr: 8659, - hArr: 8660, - forall: 8704, - part: 8706, - exist: 8707, - empty: 8709, - nabla: 8711, - isin: 8712, - notin: 8713, - ni: 8715, - prod: 8719, - sum: 8721, - minus: 8722, - lowast: 8727, - radic: 8730, - prop: 8733, - infin: 8734, - ang: 8736, - and: 8743, - or: 8744, - cap: 8745, - cup: 8746, - int: 8747, - there4: 8756, - sim: 8764, - cong: 8773, - asymp: 8776, - ne: 8800, - equiv: 8801, - le: 8804, - ge: 8805, - sub: 8834, - sup: 8835, - nsub: 8836, - sube: 8838, - supe: 8839, - oplus: 8853, - otimes: 8855, - perp: 8869, - sdot: 8901, - lceil: 8968, - rceil: 8969, - lfloor: 8970, - rfloor: 8971, - lang: 9001, - rang: 9002, - loz: 9674, - spades: 9824, - clubs: 9827, - hearts: 9829, - diams: 9830 - }, - Object.keys(t.ENTITIES).forEach((function(e) { - var n = t.ENTITIES[e] - , a = "number" == typeof n ? String.fromCharCode(n) : n; - t.ENTITIES[e] = a - } - )), - t.STATE) - t.STATE[t.STATE[R]] = R; - function N(t, e, n) { - t[e] && t[e](n) - } - function C(t, e, n) { - t.textNode && D(t), - N(t, e, n) - } - function D(t) { - t.textNode = x(t.opt, t.textNode), - t.textNode && N(t, "ontext", t.textNode), - t.textNode = "" - } - function x(t, e) { - return t.trim && (e = e.trim()), - t.normalize && (e = e.replace(/\s+/g, " ")), - e - } - function M(t, e) { - return D(t), - t.trackPosition && (e += "\nLine: " + t.line + "\nColumn: " + t.column + "\nChar: " + t.c), - e = new Error(e), - t.error = e, - N(t, "onerror", e), - t - } - function z(t) { - return t.sawRoot && !t.closedRoot && O(t, "Unclosed root tag"), - t.state !== k.BEGIN && t.state !== k.BEGIN_WHITESPACE && t.state !== k.TEXT && M(t, "Unexpected end"), - D(t), - t.c = "", - t.closed = !0, - N(t, "onend"), - r.call(t, t.strict, t.opt), - t - } - function O(t, e) { - if ("object" != typeof t || !(t instanceof r)) - throw new Error("bad call to strictFail"); - t.strict && M(t, e) - } - function L(t) { - t.strict || (t.tagName = t.tagName[t.looseCase]()); - var e = t.tags[t.tags.length - 1] || t - , n = t.tag = { - name: t.tagName, - attributes: {} - }; - t.opt.xmlns && (n.ns = e.ns), - t.attribList.length = 0, - C(t, "onopentagstart", n) - } - function P(t, e) { - var n = t.indexOf(":") < 0 ? ["", t] : t.split(":") - , a = n[0] - , r = n[1]; - return e && "xmlns" === t && (a = "xmlns", - r = ""), - { - prefix: a, - local: r - } - } - function F(t) { - if (t.strict || (t.attribName = t.attribName[t.looseCase]()), - -1 !== t.attribList.indexOf(t.attribName) || t.tag.attributes.hasOwnProperty(t.attribName)) - t.attribName = t.attribValue = ""; - else { - if (t.opt.xmlns) { - var e = P(t.attribName, !0) - , n = e.prefix - , a = e.local; - if ("xmlns" === n) - if ("xml" === a && t.attribValue !== m) - O(t, "xml: prefix must be bound to " + m + "\nActual: " + t.attribValue); - else if ("xmlns" === a && t.attribValue !== h) - O(t, "xmlns: prefix must be bound to " + h + "\nActual: " + t.attribValue); - else { - var r = t.tag - , i = t.tags[t.tags.length - 1] || t; - r.ns === i.ns && (r.ns = Object.create(i.ns)), - r.ns[a] = t.attribValue - } - t.attribList.push([t.attribName, t.attribValue]) - } else - t.tag.attributes[t.attribName] = t.attribValue, - C(t, "onattribute", { - name: t.attribName, - value: t.attribValue - }); - t.attribName = t.attribValue = "" - } - } - function U(t, e) { - if (t.opt.xmlns) { - var n = t.tag - , a = P(t.tagName); - n.prefix = a.prefix, - n.local = a.local, - n.uri = n.ns[a.prefix] || "", - n.prefix && !n.uri && (O(t, "Unbound namespace prefix: " + JSON.stringify(t.tagName)), - n.uri = a.prefix); - var r = t.tags[t.tags.length - 1] || t; - n.ns && r.ns !== n.ns && Object.keys(n.ns).forEach((function(e) { - C(t, "onopennamespace", { - prefix: e, - uri: n.ns[e] - }) - } - )); - for (var i = 0, o = t.attribList.length; i < o; i++) { - var l = t.attribList[i] - , s = l[0] - , u = l[1] - , c = P(s, !0) - , d = c.prefix - , f = c.local - , g = "" === d ? "" : n.ns[d] || "" - , m = { - name: s, - value: u, - prefix: d, - local: f, - uri: g - }; - d && "xmlns" !== d && !g && (O(t, "Unbound namespace prefix: " + JSON.stringify(d)), - m.uri = d), - t.tag.attributes[s] = m, - C(t, "onattribute", m) - } - t.attribList.length = 0 - } - t.tag.isSelfClosing = !!e, - t.sawRoot = !0, - t.tags.push(t.tag), - C(t, "onopentag", t.tag), - e || (t.noscript || "script" !== t.tagName.toLowerCase() ? t.state = k.TEXT : t.state = k.SCRIPT, - t.tag = null, - t.tagName = ""), - t.attribName = t.attribValue = "", - t.attribList.length = 0 - } - function j(t) { - if (!t.tagName) - return O(t, "Weird empty close tag."), - t.textNode += "", - void (t.state = k.TEXT); - if (t.script) { - if ("script" !== t.tagName) - return t.script += "", - t.tagName = "", - void (t.state = k.SCRIPT); - C(t, "onscript", t.script), - t.script = "" - } - var e = t.tags.length - , n = t.tagName; - t.strict || (n = n[t.looseCase]()); - for (var a = n; e-- && t.tags[e].name !== a; ) - O(t, "Unexpected close tag"); - if (e < 0) - return O(t, "Unmatched closing tag: " + t.tagName), - t.textNode += "", - void (t.state = k.TEXT); - t.tagName = n; - for (var r = t.tags.length; r-- > e; ) { - var i = t.tag = t.tags.pop(); - t.tagName = t.tag.name, - C(t, "onclosetag", t.tagName); - var o = {}; - for (var l in i.ns) - o[l] = i.ns[l]; - var s = t.tags[t.tags.length - 1] || t; - t.opt.xmlns && i.ns !== s.ns && Object.keys(i.ns).forEach((function(e) { - var n = i.ns[e]; - C(t, "onclosenamespace", { - prefix: e, - uri: n - }) - } - )) - } - 0 === e && (t.closedRoot = !0), - t.tagName = t.attribValue = t.attribName = "", - t.attribList.length = 0, - t.state = k.TEXT - } - function B(t) { - var e, n = t.entity, a = n.toLowerCase(), r = ""; - return t.ENTITIES[n] ? t.ENTITIES[n] : t.ENTITIES[a] ? t.ENTITIES[a] : ("#" === (n = a).charAt(0) && ("x" === n.charAt(1) ? (n = n.slice(2), - r = (e = parseInt(n, 16)).toString(16)) : (n = n.slice(1), - r = (e = parseInt(n, 10)).toString(10))), - n = n.replace(/^0+/, ""), - r.toLowerCase() !== n ? (O(t, "Invalid character entity"), - "&" + t.entity + ";") : String.fromCodePoint(e)) - } - function q(t, e) { - "<" === e ? (t.state = k.OPEN_WAKA, - t.startTagPosition = t.position) : v(l, e) && (O(t, "Non-whitespace before first tag."), - t.textNode = e, - t.state = k.TEXT) - } - function G(t, e) { - var n = ""; - return e < t.length && (n = t.charAt(e)), - n - } - k = t.STATE, - String.fromCodePoint || (w = String.fromCharCode, - S = Math.floor, - I = function() { - var t, e, n = [], a = -1, r = arguments.length; - if (!r) - return ""; - for (var i = ""; ++a < r; ) { - var o = Number(arguments[a]); - if (!isFinite(o) || o < 0 || o > 1114111 || S(o) !== o) - throw RangeError("Invalid code point: " + o); - o <= 65535 ? n.push(o) : (t = 55296 + ((o -= 65536) >> 10), - e = o % 1024 + 56320, - n.push(t, e)), - (a + 1 === r || n.length > 16384) && (i += w.apply(null, n), - n.length = 0) - } - return i - } - , - Object.defineProperty ? Object.defineProperty(String, "fromCodePoint", { - value: I, - configurable: !0, - writable: !0 - }) : String.fromCodePoint = I) - }(e) - }, - 6739: function(t, e, n) { - !function(t, e, n, a, r) { - function i(t) { - if ("contents"in t) - for (var e = ("styleAttrs"in t ? t.styleAttrs[a.byName.ruby.qname] : null), n = "span" === t.kind && ("container" === e || "textContainer" === e || "baseContainer" === e), r = t.contents.length - 1; r >= 0; r--) - !n || "styleAttrs"in t.contents[r] && a.byName.ruby.qname in t.contents[r].styleAttrs ? i(t.contents[r]) : delete t.contents[r] - } - function o(t, e, n, a) { - var r = a && "seq" === a.timeContainer - , i = 0; - a && (i = r && n ? n.end : a.begin), - e.begin = e.explicit_begin ? e.explicit_begin + i : i; - var l = e.begin - , s = null; - if ("sets"in e) - for (var u = 0; u < e.sets.length; u++) - o(t, e.sets[u], s, e), - l = "seq" === e.timeContainer ? e.sets[u].end : Math.max(l, e.sets[u].end), - s = e.sets[u]; - if ("contents"in e) { - if ("contents"in e) - for (var c = 0; c < e.contents.length; c++) - o(t, e.contents[c], s, e), - l = "seq" === e.timeContainer ? e.contents[c].end : Math.max(l, e.contents[c].end), - s = e.contents[c] - } else - l = r ? e.begin : Number.POSITIVE_INFINITY; - null !== e.explicit_end && null !== e.explicit_dur ? e.end = Math.min(e.begin + e.explicit_dur, i + e.explicit_end) : null === e.explicit_end && null !== e.explicit_dur ? e.end = e.begin + e.explicit_dur : null !== e.explicit_end && null === e.explicit_dur ? e.end = i + e.explicit_end : e.end = l, - delete e.explicit_begin, - delete e.explicit_dur, - delete e.explicit_end, - t._registerEvent(e) - } - function l(t) { - this.node = t - } - function s() { - this.events = [], - this.head = new u, - this.body = null - } - function u() { - this.styling = new c, - this.layout = new g - } - function c() { - this.styles = {}, - this.initials = {} - } - function d() { - this.id = null, - this.styleAttrs = null, - this.styleRefs = null - } - function f() { - this.styleAttrs = null - } - function g() { - this.regions = {} - } - function m(t, e) { - h.call(this, "image"), - this.src = t, - this.type = e - } - function h(t) { - this.kind = t - } - function p(t) { - this.id = t - } - function b(t) { - this.regionID = t - } - function y(t) { - this.styleAttrs = t - } - function E(t) { - this.sets = t - } - function _(t) { - this.contents = t - } - function A(t, e, n) { - this.explicit_begin = t, - this.explicit_end = e, - this.explicit_dur = n - } - function T() { - h.call(this, "body") - } - function v() { - h.call(this, "div") - } - function w() { - h.call(this, "p") - } - function S() { - h.call(this, "span") - } - function I() { - h.call(this, "span") - } - function k() { - h.call(this, "br") - } - function R() {} - function N() {} - function C(t) { - return t && "xml:id"in t.attributes && t.attributes["xml:id"].value || null - } - function D(t) { - return t && "style"in t.attributes ? t.attributes.style.value.split(" ") : [] - } - function x(t, e) { - var n = {}; - if (null !== t) - for (var r in t.attributes) { - var i = t.attributes[r].uri + " " + t.attributes[r].local - , o = a.byQName[i]; - if (void 0 !== o) { - var l = o.parse(t.attributes[r].value); - null !== l ? (n[i] = l, - o === a.byName.zIndex && F(e, "zIndex attribute present but not used by IMSC1 since regions do not overlap")) : U(e, "Cannot parse styling attribute " + i + " --\x3e " + t.attributes[r].value) - } - } - return n - } - function M(t, e, n) { - for (var a in t.attributes) - if (t.attributes[a].uri === e && t.attributes[a].local === n) - return t.attributes[a].value; - return null - } - function z(t, e, n) { - var a, r = null; - return null !== (a = /^(\d+(?:\.\d+)?)f$/.exec(n)) ? null !== e && (r = parseFloat(a[1]) / e) : null !== (a = /^(\d+(?:\.\d+)?)t$/.exec(n)) ? null !== t && (r = parseFloat(a[1]) / t) : null !== (a = /^(\d+(?:\.\d+)?)ms$/.exec(n)) ? r = parseFloat(a[1]) / 1e3 : null !== (a = /^(\d+(?:\.\d+)?)s$/.exec(n)) ? r = parseFloat(a[1]) : null !== (a = /^(\d+(?:\.\d+)?)h$/.exec(n)) ? r = 3600 * parseFloat(a[1]) : null !== (a = /^(\d+(?:\.\d+)?)m$/.exec(n)) ? r = 60 * parseFloat(a[1]) : null !== (a = /^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(n)) ? r = 3600 * parseInt(a[1]) + 60 * parseInt(a[2]) + parseFloat(a[3]) : null !== (a = /^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(n)) && null !== e && (r = 3600 * parseInt(a[1]) + 60 * parseInt(a[2]) + parseInt(a[3]) + (null === a[4] ? 0 : parseInt(a[4]) / e)), - r - } - function O(t, e, n) { - for (; e.styleRefs.length > 0; ) { - var a = e.styleRefs.pop(); - a in t.styles ? (O(t, t.styles[a], n), - P(t.styles[a].styleAttrs, e.styleAttrs)) : U(n, "Non-existant style id referenced") - } - } - function L(t, e, n, a) { - for (var r = e.length - 1; r >= 0; r--) { - var i = e[r]; - i in t.styles ? P(t.styles[i].styleAttrs, n) : U(a, "Non-existant style id referenced") - } - } - function P(t, e) { - for (var n in t) - t.hasOwnProperty(n) && (n in e || (e[n] = t[n])) - } - function F(t, e) { - if (t && t.warn && t.warn(e)) - throw e - } - function U(t, e) { - if (t && t.error && t.error(e)) - throw e - } - function j(t, e) { - throw t && t.fatal && t.fatal(e), - e - } - function B(t, e) { - for (var n, a = 0, r = t.length - 1; a <= r; ) { - var i = t[n = Math.floor((a + r) / 2)]; - if (i < e) - a = n + 1; - else { - if (!(i > e)) - return { - found: !0, - index: n - }; - r = n - 1 - } - } - return { - found: !1, - index: a - } - } - t.fromXML = function(t, r, h) { - var p = e.parser(!0, { - xmlns: !0 - }) - , b = [] - , y = [] - , E = [] - , _ = 0 - , A = null; - p.onclosetag = function(t) { - if (b[0]instanceof R) - null !== A.head && null !== A.head.styling && L(A.head.styling, b[0].styleRefs, b[0].styleAttrs, r), - delete b[0].styleRefs; - else if (b[0]instanceof c) - for (var e in b[0].styles) - b[0].styles.hasOwnProperty(e) && O(b[0], b[0].styles[e], r); - else if (b[0]instanceof w || b[0]instanceof S) { - if (b[0].contents.length > 1) { - var a, i = [b[0].contents[0]]; - for (a = 1; a < b[0].contents.length; a++) - b[0].contents[a]instanceof I && i[i.length - 1]instanceof I ? i[i.length - 1].text += b[0].contents[a].text : i.push(b[0].contents[a]); - b[0].contents = i - } - b[0]instanceof S && 1 === b[0].contents.length && b[0].contents[0]instanceof I && (b[0].text = b[0].contents[0].text, - delete b[0].contents) - } else - b[0]instanceof l && (b[0].node.uri === n.ns_tt && "metadata" === b[0].node.local ? _-- : _ > 0 && h && "onCloseTag"in h && h.onCloseTag()); - E.shift(), - y.shift(), - b.shift() - } - , - p.ontext = function(t) { - if (void 0 === b[0]) - ; - else if (b[0]instanceof S || b[0]instanceof w) { - if (b[0]instanceof S) { - var e = b[0].styleAttrs[a.byName.ruby.qname]; - if ("container" === e || "textContainer" === e || "baseContainer" === e) - return - } - var n = new I; - n.initFromText(A, b[0], t, y[0], E[0], r), - b[0].contents.push(n) - } else - b[0]instanceof l && _ > 0 && h && "onText"in h && h.onText(t) - } - , - p.onopentag = function(t) { - var e = t.attributes["xml:space"]; - e ? E.unshift(e.value) : 0 === E.length ? E.unshift("default") : E.unshift(E[0]); - var i = t.attributes["xml:lang"]; - if (i ? y.unshift(i.value) : 0 === y.length ? y.unshift("") : y.unshift(y[0]), - t.uri === n.ns_tt) - if ("tt" === t.local) - null !== A && j(r, "Two elements at (" + this.line + "," + this.column + ")"), - (A = new s).initFromNode(t, y[0], r), - b.unshift(A); - else if ("head" === t.local) - b[0]instanceof s || j(r, "Parent of element is not at (" + this.line + "," + this.column + ")"), - b.unshift(A.head); - else if ("styling" === t.local) - b[0]instanceof u || j(r, "Parent of element is not at (" + this.line + "," + this.column + ")"), - b.unshift(A.head.styling); - else if ("style" === t.local) { - var o; - b[0]instanceof c ? ((o = new d).initFromNode(t, r), - o.id ? A.head.styling.styles[o.id] = o : U(r, "", n), - a = [t.slice(p, n)], - n += 8) : -1 === T.indexOf(e) ? (n++, - a = y(e, r)) : n++; - else - n++; - return r.__children = a, - r - } - var w, S = null; - if (void 0 !== e.attrValue) - for (e.attrName = e.attrName || "id", - S = []; -1 !== (void 0, - w = new RegExp("\\s" + e.attrName + "\\s*=['\"]" + e.attrValue + "['\"]").exec(t), - n = w ? w.index : -1); ) - -1 !== (n = t.lastIndexOf("<", n)) && S.push(v()), - t = t.substr(n), - n = 0; - else - S = e.parseNode ? v() : y(""); - return e.filter && (S = ti(S, e.filter)), - e.simplify ? Jr(Array.isArray(S) ? S : [S]) : (e.setPos && (S.pos = n), - S) - } - function Jr(t) { - var e = {}; - if (!t.length) - return ""; - if (1 === t.length && "string" == typeof t[0]) - return t[0]; - for (var n in t.forEach((function(t) { - if ("object" == typeof t) { - e[t.tagName] || (e[t.tagName] = []); - var n = Jr(t.children); - e[t.tagName].push(n), - Object.keys(t.attributes).length && "string" != typeof n && (n._attributes = t.attributes) - } - } - )), - e) - 1 == e[n].length && (e[n] = e[n][0]); - return e - } - function ti(t, e) { - let n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0 - , a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : ""; - var r = []; - return t.forEach((function(t, i) { - if ("object" == typeof t && e(t, i, n, a) && r.push(t), - t.children) { - var o = ti(t.children, e, n + 1, (a ? a + "." : "") + i + "." + t.tagName); - r = r.concat(o) - } - } - )), - r - } - const ei = [S.A.PERIOD, S.A.BASE_URL, S.A.ADAPTATION_SET, S.A.REPRESENTATION, S.A.CONTENT_PROTECTION, S.A.ROLE, S.A.ACCESSIBILITY, S.A.AUDIO_CHANNEL_CONFIGURATION, S.A.CONTENT_COMPONENT, S.A.ESSENTIAL_PROPERTY, S.A.LABEL, S.A.S, S.A.SEGMENT_URL, S.A.EVENT, S.A.EVENT_STREAM, S.A.LOCATION, S.A.SERVICE_DESCRIPTION, S.A.SUPPLEMENTAL_PROPERTY, S.A.METRICS, S.A.REPORTING, S.A.PATCH_LOCATION, S.A.REPLACE, S.A.ADD, S.A.REMOVE, S.A.UTC_TIMING, S.A.INBAND_EVENT_STREAM, S.A.PRODUCER_REFERENCE_TIME, S.A.CONTENT_STEERING]; - function ni(t) { - t = t || {}; - const e = this.context - , n = t.debug; - let a, r, i, o; - function l(t) { - try { - let e = Zr(t, { - parseNode: !0, - attrMatchers: i, - nodesAsArray: ei - }) - , n = {}; - if (-1 !== e.tagName.toLowerCase().indexOf("xml")) - for (let t in e) { - if (Array.isArray(e[t])) { - n[t] = e[t][0]; - break - } - if ("object" == typeof e[t]) { - n[t] = e[t]; - break - } - } - else - n[e.tagName] = e, - delete e.tagName; - return n - } catch (t) { - return null - } - } - return a = { - getIron: function() { - return o - }, - parseXml: l, - parse: function(t) { - let e; - const n = window.performance.now(); - if (e = l(t), - !e) - throw new Error("failed to parse the manifest"); - e.Patch ? (e = e.Patch, - e.add && e.add.forEach((t => o.run(t))), - e.replace && e.replace.forEach((t => o.run(t)))) : (e = e.MPD, - o.run(e)); - const a = window.performance.now(); - return r.info("Parsing complete: " + (a - n).toPrecision(3) + "ms"), - e.protocol = "DASH", - e - } - }, - r = n.getLogger(a), - i = [new Ur, new Br, new Hr, new Yr], - o = Lr(e).create({ - adaptationset: new Wr, - period: new $r - }), - a - } - ni.__dashjs_factory_name = "DashParser"; - var ai = N.A.getClassFactory(ni); - function ri(t) { - t = t || {}; - const e = this.context - , n = t.debug - , a = t.settings - , r = (0, - k.A)(e).getInstance() - , i = wt(e).getInstance(); - let o, l, s, u, c, d = t.mssHandler, f = t.errHandler; - function g(t) { - r.trigger(R.A.INTERNAL_MANIFEST_LOADED, { - manifest: t.manifest - }) - } - return o = { - load: function(t) { - let o = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null - , f = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null; - const g = new Date - , m = new Nr(t,z.G.MPD_TYPE); - o && (m.serviceLocation = o), - f && (m.queryParams = f), - m.startDate || (m.startDate = g), - r.trigger(R.A.MANIFEST_LOADING_STARTED, { - request: m - }), - s.load({ - request: m, - success: function(o, s, f) { - if (!u) - return; - let g, m, h; - if (f && f !== t ? (m = i.parseBaseUrl(f), - g = f) : (i.isRelative(t) && (t = i.resolve(t, window.location.href)), - m = i.parseBaseUrl(t)), - "No Content" != s) - if (null === c && (c = function(t) { - let a = null; - return t.indexOf("SmoothStreamingMedia") > -1 ? (d && (a = d.createMssParser(), - d.createMssFragmentProcessor(), - d.registerEvents()), - a) : t.indexOf("MPD") > -1 || t.indexOf("Patch") > -1 ? ai(e).create({ - debug: n - }) : a - }(o)), - null !== c) { - u.setParser(c); - try { - h = c.parse(o) - } catch (e) { - return void r.trigger(R.A.INTERNAL_MANIFEST_LOADED, { - manifest: null, - error: new G.A(V.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,V.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE + `${t}`) - }) - } - if (h) { - if (h.url = g || t, - h.originalUrl || (h.originalUrl = h.url), - a && a.get().streaming.enableManifestDurationMismatchFix && h.mediaPresentationDuration && h.Period.length > 1) { - const t = h.Period.reduce(( (t, e) => t + e.duration), 0); - !isNaN(t) && h.mediaPresentationDuration > t && (l.warn("Media presentation duration greater than duration of all periods. Setting duration to total period duration"), - h.mediaPresentationDuration = t) - } - h.baseUri = m, - h.loadedTime = new Date, - u.resolveManifestOnLoad(h), - r.trigger(R.A.ORIGINAL_MANIFEST_LOADED, { - originalManifest: o - }) - } else - r.trigger(R.A.INTERNAL_MANIFEST_LOADED, { - manifest: null, - error: new G.A(V.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,V.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE + `${t}`) - }) - } else - r.trigger(R.A.INTERNAL_MANIFEST_LOADED, { - manifest: null, - error: new G.A(V.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,V.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE + `${t}`) - }); - else - r.trigger(R.A.INTERNAL_MANIFEST_LOADED, { - manifest: null - }) - }, - error: function(e, n, a) { - r.trigger(R.A.INTERNAL_MANIFEST_LOADED, { - manifest: null, - error: new G.A(V.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,V.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE + `${t}, ${a}`) - }) - } - }) - }, - reset: function() { - r.off(R.A.XLINK_READY, g, o), - d && d.reset(), - u && (u.reset(), - u = null), - s && (s.abort(), - s = null) - } - }, - l = n.getLogger(o), - r.on(R.A.XLINK_READY, g, o), - s = Bn(e).create({ - errHandler: t.errHandler, - dashMetrics: t.dashMetrics, - mediaPlayerModel: t.mediaPlayerModel, - urlUtils: i, - constants: w.A, - dashConstants: S.A, - errors: V, - requestTimeout: t.settings.get().streaming.manifestRequestTimeout - }), - u = zr(e).create({ - errHandler: f, - dashMetrics: t.dashMetrics, - mediaPlayerModel: t.mediaPlayerModel, - settings: t.settings - }), - c = null, - o - } - ri.__dashjs_factory_name = "ManifestLoader"; - var ii = N.A.getClassFactory(ri); - function oi() { - let t; - const e = this.context - , n = (0, - k.A)(e).getInstance(); - return t = { - error: function(t) { - n.trigger(R.A.ERROR, { - error: t - }) - } - }, - t - } - oi.__dashjs_factory_name = "ErrorHandler"; - var li = N.A.getSingletonFactory(oi) - , si = n(559); - function ui() { - const t = this.context - , e = (0, - k.A)(t).getInstance(); - let n, a, r, i, o, l, s; - function u(t, e, n) { - const a = d(t, e, n); - return r.isCodecSupportedBasedOnTestedConfigurations(a, t) - } - function c(t, e, n, a, r) { - const i = d(t, e, n) - , o = JSON.stringify(i); - a.has(o) || (a.add(o), - r.push(i)) - } - function d(t, e, n) { - let r = null; - switch (t) { - case w.A.VIDEO: - r = function(t, e) { - let n = { - codec: e, - width: t.width || null, - height: t.height || null, - framerate: a.getFramerate(t) || null, - bitrate: t.bandwidth || null, - isSupported: !0 - }; - i.get().streaming.capabilities.filterVideoColorimetryEssentialProperties && Object.assign(n, function(t) { - let e = { - colorGamut: null, - transferFunction: null, - isSupported: !0 - }; - for (const n of t.EssentialProperty || []) - n.schemeIdUri === w.A.COLOUR_PRIMARIES_SCHEME_ID_URI && ["1", "5", "6", "7"].includes(n.value.toString()) ? e.colorGamut = w.A.MEDIA_CAPABILITIES_API.COLORGAMUT.SRGB : n.schemeIdUri === w.A.COLOUR_PRIMARIES_SCHEME_ID_URI && ["11", "12"].includes(n.value.toString()) ? e.colorGamut = w.A.MEDIA_CAPABILITIES_API.COLORGAMUT.P3 : n.schemeIdUri === w.A.COLOUR_PRIMARIES_SCHEME_ID_URI && ["9"].includes(n.value.toString()) ? e.colorGamut = w.A.MEDIA_CAPABILITIES_API.COLORGAMUT.REC2020 : n.schemeIdUri === w.A.COLOUR_PRIMARIES_SCHEME_ID_URI && ["2"].includes(n.value.toString()) ? e.colorGamut = null : n.schemeIdUri === w.A.COLOUR_PRIMARIES_SCHEME_ID_URI && (e.isSupported = !1), - n.schemeIdUri === w.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI && ["1", "6", "13", "14", "15"].includes(n.value.toString()) ? e.transferFunction = w.A.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.SRGB : n.schemeIdUri === w.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI && ["16"].includes(n.value.toString()) ? e.transferFunction = w.A.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.PQ : n.schemeIdUri === w.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI && ["18"].includes(n.value.toString()) ? e.transferFunction = w.A.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.HLG : n.schemeIdUri === w.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI && ["2"].includes(n.value.toString()) ? e.transferFunction = null : n.schemeIdUri === w.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI && (e.isSupported = !1); - return e - }(t)); - let r = n.isSupported; - i.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties && Object.assign(n, function(t) { - let e = { - isSupported: !0, - hdrMetadataType: null - }; - for (const n of t.EssentialProperty || []) - n.schemeIdUri === w.A.HDR_METADATA_FORMAT_SCHEME_ID_URI && n.value === w.A.HDR_METADATA_FORMAT_VALUES.ST2094_10 ? e.hdrMetadataType = w.A.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_10 : n.schemeIdUri === w.A.HDR_METADATA_FORMAT_SCHEME_ID_URI && n.value === w.A.HDR_METADATA_FORMAT_VALUES.SL_HDR2 ? e.hdrMetadataType = w.A.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SLHDR2 : n.schemeIdUri === w.A.HDR_METADATA_FORMAT_SCHEME_ID_URI && n.value === w.A.HDR_METADATA_FORMAT_VALUES.ST2094_40 ? e.hdrMetadataType = w.A.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_40 : n.schemeIdUri === w.A.HDR_METADATA_FORMAT_SCHEME_ID_URI && (e.isSupported = !1); - return e - }(t)); - let o = n.isSupported; - return r && o || (n.isSupported = !1), - n - }(e, n); - break; - case w.A.AUDIO: - r = function(t, e) { - const n = t.audioSamplingRate || null; - return { - codec: e, - bitrate: t.bandwidth || null, - samplerate: n, - isSupported: !0 - } - }(e, n); - break; - default: - return r - } - return function(t, e) { - return t && t[S.A.CONTENT_PROTECTION] && t[S.A.CONTENT_PROTECTION].length > 0 && (e.keySystemsMetadata = l.getSupportedKeySystemMetadataFromContentProtection(t[S.A.CONTENT_PROTECTION])), - e - }(e, r) - } - function f(t) { - if (!t || 0 === t.length) - return !0; - let e = 0; - for (; e < t.length; ) { - if (!r.supportsEssentialProperty(t[e])) - return s.debug("[Stream] EssentialProperty not supported: " + t[e].schemeIdUri), - !1; - e += 1 - } - return !0 - } - return n = { - setConfig: function(t) { - t && (t.adapter && (a = t.adapter), - t.capabilities && (r = t.capabilities), - t.settings && (i = t.settings), - t.protectionController && (l = t.protectionController), - t.customParametersModel && (o = t.customParametersModel)) - }, - filterUnsupportedFeatures: function(t) { - return new Promise((n => { - const l = [w.A.VIDEO, w.A.AUDIO] - , d = []; - l.forEach((e => { - const n = function(t, e) { - if (!t || !t.Period || 0 === t.Period.length) - return []; - const n = new Set - , r = []; - return t.Period.forEach((t => { - t.AdaptationSet.forEach((t => { - a.getIsTypeOf(t, e) && t.Representation.forEach(( (i, o) => { - const l = a.getCodec(t, o, !1); - c(e, i, l, n, r); - const s = a.getSupplementalCodecs(i); - s.length > 0 && c(e, i, s[0], n, r) - } - )) - } - )) - } - )), - r - }(t, e); - n.forEach((t => { - d.push(r.runCodecSupportCheck(t, e)) - } - )) - } - )), - Promise.allSettled(d).then(( () => (l.forEach((n => { - !function(t, n) { - n && n.Period && 0 !== n.Period.length && n.Period.forEach((n => { - !function(t, n) { - t && t.AdaptationSet && 0 !== t.AdaptationSet.length && (t.AdaptationSet = t.AdaptationSet.filter((t => { - a.getIsTypeOf(t, n) && function(t, e) { - t.Representation && 0 !== t.Representation.length && (t.Representation = t.Representation.filter(( (n, r) => { - const i = a.getCodec(t, r, !1) - , o = u(e, n, i); - let l = function(t, e) { - let n = !1; - const r = a.getSupplementalCodecs(t); - return r.length > 0 && (r.length > 1 && s.warn("[CapabilitiesFilter] Multiple supplemental codecs not supported; using the first in list"), - n = u(e, t, r[0])), - n - }(n, e); - return l && (s.debug(`[CapabilitiesFilter] Codec supported. Upgrading codecs string of Representation with ID ${n.id}`), - n.codecs = n[S.A.SUPPLEMENTAL_CODECS]), - o || l || s.warn(`[CapabilitiesFilter] Codec ${i} not supported. Removing Representation with ID ${n.id}`), - o || l - } - ))) - }(t, n); - const r = t.Representation && t.Representation.length > 0; - return r || (e.trigger(R.A.ADAPTATION_SET_REMOVED_NO_CAPABILITIES, { - adaptationSet: t - }), - s.warn(`[CapabilitiesFilter] AdaptationSet with ID ${t.id ? t.id : "undefined"} and codec ${t.codecs ? t.codecs : "undefined"} has been removed because of no supported Representation`)), - r - } - ))) - }(n, t) - } - )) - }(n, t) - } - )), - i.get().streaming.capabilities.filterUnsupportedEssentialProperties && function(t) { - t && t.Period && 0 !== t.Period.length && t.Period.forEach((t => { - t.AdaptationSet = t.AdaptationSet.filter((t => !t.Representation || 0 === t.Representation.length || !!f(a.getEssentialPropertiesForAdaptationSet(t)) && (t.Representation = t.Representation.filter((t => f(a.getEssentialPropertiesForRepresentation(t)))), - t.Representation && t.Representation.length > 0))) - } - )) - }(t), - function(t) { - if (!t || !t.Period || 0 === t.Period.length) - return Promise.resolve(); - const e = []; - return t.Period.forEach((t => { - e.push(function(t) { - return new Promise((e => { - if (!t || !t.AdaptationSet || 0 === t.AdaptationSet.length) - return void e(); - const n = []; - t.AdaptationSet.forEach((t => { - n.push(function(t) { - return new Promise((e => { - if (!t.Representation || 0 === t.Representation.length) - return void e(); - const n = []; - t.Representation.forEach((t => { - n.push(function(t) { - const e = [] - , n = o.getCustomCapabilitiesFilters(); - return n && 0 !== n.length ? n.forEach((n => { - e.push(new Promise((e => e(n(t))))) - } - )) : e.push(Promise.resolve(!0)), - Promise.all(e) - }(t)) - } - )), - Promise.all(n).then((n => { - t.Representation = t.Representation.filter(( (t, e) => { - let a = n[e].every((t => t)); - return a || s.debug("[Stream] Representation " + t.id + " has been removed because of unsupported CustomFilter"), - a - } - )), - e() - } - )).catch((t => { - s.warn("[Stream] at least one promise rejected in CustomFilter with error: ", t), - e() - } - )) - } - )) - }(t)) - } - )), - Promise.all(n).then(( () => { - t.AdaptationSet = t.AdaptationSet.filter((t => t.Representation && t.Representation.length > 0)), - e() - } - )).catch(( () => { - e() - } - )) - } - )) - }(t)) - } - )), - Promise.all(e) - }(t)))).then(( () => { - n() - } - )).catch((t => { - s.error(t), - n() - } - )) - } - )) - } - }, - s = (0, - C.A)(t).getInstance().getLogger(n), - n - } - ui.__dashjs_factory_name = "CapabilitiesFilter"; - var ci = N.A.getSingletonFactory(ui) - , di = class { - constructor() { - this.t = null, - this.xywh = null, - this.track = null, - this.id = null, - this.s = null, - this.r = null - } - } - ; - function fi() { - let t, e; - return t = { - initialize: function(t) { - if (e = new di, - !t) - return null; - const n = t.indexOf("#"); - if (-1 !== n) { - const a = t.substr(n + 1).split("&"); - for (let t = 0, n = a.length; t < n; ++t) { - const n = a[t] - , r = n.indexOf("="); - if (-1 !== r) { - const t = n.substring(0, r); - e.hasOwnProperty(t) && (e[t] = n.substr(r + 1)) - } - } - } - }, - getURIFragmentData: function() { - return e - } - }, - t - } - fi.__dashjs_factory_name = "URIFragmentModel"; - var gi = N.A.getSingletonFactory(fi); - function mi() { - let t, e, n = this.context, a = (0, - k.A)(n).getInstance(); - return t = { - getValue: function() { - return e - }, - setValue: function(t) { - e = t, - t && a.trigger(R.A.MANIFEST_LOADED, { - data: t - }) - } - }, - t - } - mi.__dashjs_factory_name = "ManifestModel"; - var hi = N.A.getSingletonFactory(mi); - function pi() { - let t, e, n, a; - const r = this.context - , i = (0, - K.A)(r).getInstance(); - function o(t, n) { - return isNaN(t) ? 0 : t > 0 ? (n && e.warn("Supplied minimum playback rate is a positive value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."), - 0) : t < -.5 ? (n && e.warn("Supplied minimum playback rate is out of range and will be limited to -0.5: -50% playback speed."), - -.5) : t - } - function l(t, n) { - return isNaN(t) ? 0 : t < 0 ? (n && e.warn("Supplied maximum playback rate is a negative value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."), - 0) : t > 1 ? (n && e.warn("Supplied maximum playback rate is out of range and will be limited to 1: 200% playback speed."), - 1) : t - } - function s() { - const t = u() - , e = n.getLiveDelay(); - return !isNaN(e) && e > 0 ? Math.min(t, e) : t - } - function u() { - return i.get().streaming.buffer.bufferTimeDefault > 0 ? i.get().streaming.buffer.bufferTimeDefault : c() ? 20 : 12 - } - function c() { - return null !== i.get().streaming.buffer.fastSwitchEnabled ? i.get().streaming.buffer.fastSwitchEnabled : !n.getLowLatencyModeEnabled() - } - return t = { - getCatchupMaxDrift: function() { - if (!isNaN(i.get().streaming.liveCatchup.maxDrift) && i.get().streaming.liveCatchup.maxDrift >= 0) - return i.get().streaming.liveCatchup.maxDrift; - const t = a.getServiceDescriptionSettings(); - return t && t.liveCatchup && !isNaN(t.liveCatchup.maxDrift) && t.liveCatchup.maxDrift >= 0 ? t.liveCatchup.maxDrift : 12 - }, - getCatchupModeEnabled: function() { - return null !== i.get().streaming.liveCatchup.enabled ? i.get().streaming.liveCatchup.enabled : n.getInitialCatchupModeActivated() - }, - getBufferTimeDefault: s, - getBufferTimeDefaultUnadjusted: u, - getFastSwitchEnabled: c, - getInitialBufferLevel: function() { - const t = i.get().streaming.buffer.initialBufferLevel; - return isNaN(t) || t < 0 ? 0 : Math.min(s(), t) - }, - getRetryAttemptsForType: function(t) { - const e = isNaN(i.get().streaming.retryAttempts.lowLatencyMultiplyFactor) ? 5 : i.get().streaming.retryAttempts.lowLatencyMultiplyFactor; - return n.getLowLatencyModeEnabled() ? i.get().streaming.retryAttempts[t] * e : i.get().streaming.retryAttempts[t] - }, - getRetryIntervalsForType: function(t) { - const e = isNaN(i.get().streaming.retryIntervals.lowLatencyReductionFactor) ? 10 : i.get().streaming.retryIntervals.lowLatencyReductionFactor; - return n.getLowLatencyModeEnabled() ? i.get().streaming.retryIntervals[t] / e : i.get().streaming.retryIntervals[t] - }, - getCatchupPlaybackRates: function(t) { - const e = i.get().streaming.liveCatchup.playbackRate; - if (!isNaN(e.min) || !isNaN(e.max)) - return { - min: o(e.min, t), - max: l(e.max, t) - }; - const n = a.getServiceDescriptionSettings(); - if (n && n.liveCatchup && (!isNaN(n.liveCatchup.playbackRate.min) || !isNaN(n.liveCatchup.playbackRate.max))) { - const e = n.liveCatchup.playbackRate; - return { - min: o(e.min, t), - max: l(e.max, t) - } - } - return { - min: -.5, - max: .5 - } - }, - getAbrBitrateParameter: function(t, e) { - try { - const n = i.get().streaming.abr[t][e]; - if (!isNaN(n) && -1 !== n) - return n; - const r = a.getServiceDescriptionSettings(); - return r && r[t] && !isNaN(r[t][e]) ? r[t][e] : -1 - } catch (t) { - return -1 - } - }, - setConfig: function(t) { - t.playbackController && (n = t.playbackController), - t.serviceDescriptionController && (a = t.serviceDescriptionController) - }, - reset: function() {} - }, - e = (0, - C.A)(r).getInstance().getLogger(t), - t - } - pi.__dashjs_factory_name = "MediaPlayerModel"; - var bi = N.A.getSingletonFactory(pi); - const yi = { - DEFAULT: .5, - STRONG: 1, - WEAK: 0 - }; - function Ei(t, e, n, a) { - let r, i, o, l, s; - return i = void 0 === t ? null : t, - o = function(t) { - let e = yi.DEFAULT; - return t !== yi.DEFAULT && t !== yi.STRONG && t !== yi.WEAK || (e = t), - e - }(n), - l = void 0 === e ? null : e, - s = void 0 === a ? null : a, - r = { - representation: i, - reason: l, - rule: s, - priority: o - }, - r - } - Ei.__dashjs_factory_name = "SwitchRequest"; - const _i = N.A.getClassFactory(Ei); - _i.NO_CHANGE = null, - _i.PRIORITY = yi, - N.A.updateClassFactory(Ei.__dashjs_factory_name, _i); - var Ai = _i; - function Ti(t) { - t = t || {}; - const e = this.context - , n = t.dashMetrics; - let a, r; - return a = { - getSwitchRequest: function(t) { - try { - const a = Ai(e).create(); - a.rule = this.getClassName(); - const r = t.getMediaInfo() - , i = t.getMediaType() - , o = n.getCurrentBufferState(i) - , l = t.getScheduleController() - , s = t.getAbrController() - , u = t.getStreamInfo() - , c = u ? u.id : null - , d = u && u.manifestInfo ? u.manifestInfo.isDynamic : null - , f = t.getThroughputController() - , g = f.getSafeAverageThroughput(i) - , m = f.getAverageLatency(i); - return isNaN(g) || !o || s.getAbandonmentStateFor(c, i) === I.ALLOW_LOAD && (o.state === I.BUFFER_LOADED || d) && (a.representation = s.getOptimalRepresentationForBitrate(r, g, !0), - a.reason = { - throughput: g, - latency: m, - message: `[ThroughputRule]: Switching to Representation with bitrate ${a.representation ? a.representation.bitrateInKbit : "n/a"} kbit/s. Throughput: ${g}` - }, - l.setTimeToLoadDelay(0)), - a - } catch (t) { - return r.error(t), - Ai(e).create() - } - }, - reset: function() {} - }, - r = (0, - C.A)(e).getInstance().getLogger(a), - a - } - Ti.__dashjs_factory_name = "ThroughputRule"; - var vi = N.A.getClassFactory(Ti); - function wi(t) { - t = t || {}; - const e = this.context - , n = (0, - k.A)(e).getInstance() - , a = t.dashMetrics - , r = (0, - K.A)(e).getInstance(); - let i, o, l; - function s() { - const t = r.get().streaming.abr.rules.insufficientBufferRule.parameters.segmentIgnoreCount; - l = {}, - l[w.A.VIDEO] = { - ignoreCount: t - }, - l[w.A.AUDIO] = { - ignoreCount: t - } - } - function u() { - s() - } - function c(t) { - isNaN(t.startTime) || t.mediaType !== w.A.AUDIO && t.mediaType !== w.A.VIDEO || l[t.mediaType].ignoreCount > 0 && l[t.mediaType].ignoreCount-- - } - return i = { - getSwitchRequest: function(t) { - const n = Ai(e).create(); - if (n.rule = this.getClassName(), - !t || !t.hasOwnProperty("getMediaType")) - return n; - const i = t.getMediaType() - , s = a.getCurrentBufferState(i) - , u = t.getRepresentation().fragmentDuration; - if (!function(t, e, n) { - return !t.getLowLatencyModeEnabled() && l[e].ignoreCount <= 0 && n - }(t.getScheduleController().getPlaybackController(), i, u)) - return n; - const c = t.getMediaInfo() - , d = t.getAbrController(); - if (s && s.state === I.BUFFER_EMPTY) - o.debug("[" + i + "] Switch to index 0; buffer is empty."), - n.representation = d.getOptimalRepresentationForBitrate(c, 0, !0), - n.reason = { - message: "[InsufficientBufferRule]: Switching to lowest Representation because buffer is empty" - }; - else { - const e = t.getThroughputController() - , o = a.getCurrentBufferLevel(i) - , l = e.getAverageThroughput(i, null, NaN) * r.get().streaming.abr.rules.insufficientBufferRule.parameters.throughputSafetyFactor * o / u; - if (isNaN(l) || l <= 0) - return n; - n.representation = d.getOptimalRepresentationForBitrate(c, l, !0), - n.reason = { - message: "[InsufficientBufferRule]: Limiting maximum bitrate to avoid a buffer underrun.", - bitrate: l - } - } - return n - }, - reset: function() { - s(), - n.off(D.A.PLAYBACK_SEEKING, u, i), - n.off(R.A.BYTES_APPENDED_END_FRAGMENT, c, i) - } - }, - o = (0, - C.A)(e).getInstance().getLogger(i), - s(), - n.on(D.A.PLAYBACK_SEEKING, u, i), - n.on(R.A.BYTES_APPENDED_END_FRAGMENT, c, i), - i - } - wi.__dashjs_factory_name = "InsufficientBufferRule"; - var Si = N.A.getClassFactory(wi); - function Ii(t) { - const e = (t = t || {}).mediaPlayerModel - , n = t.dashMetrics - , a = this.context - , r = (0, - K.A)(a).getInstance(); - let i, o, l; - function s() { - l = {} - } - return i = { - shouldAbandon: function(t) { - const i = Ai(a).create(); - i.rule = this.getClassName(); - try { - if (!t) - return i; - const a = t.getCurrentRequest(); - if (!isNaN(a.index)) { - if (null === a.firstByteDate || l.hasOwnProperty(a.index)) - return i; - const o = e.getBufferTimeDefault() - , s = t.getMediaType(); - if (n.getCurrentBufferLevel(s) > o) - return i; - const u = Date.now() - a.firstByteDate.getTime(); - if (a.traces.length >= r.get().streaming.abr.rules.abandonRequestsRule.parameters.minThroughputSamplesThreshold && u > r.get().streaming.abr.rules.abandonRequestsRule.parameters.minSegmentDownloadTimeThresholdInMs && a.bytesLoaded < a.bytesTotal) - return function(t, e, n) { - const a = t.getMediaInfo() - , i = t.getMediaType() - , o = e.traces.reduce(( (t, e) => t + e.b[0]), 0) - e.traces[0].b[0] - , s = Math.max(e.traces.reduce(( (t, e) => t + e.d), 0) - e.traces[0].d, 1) - , u = Math.round(8 * o / s) - , c = Number(8 * e.bytesTotal / u / 1e3).toFixed(2) - , d = t.getRepresentation() - , f = t.getAbrController(); - if (c < e.duration * r.get().streaming.abr.rules.abandonRequestsRule.parameters.abandonDurationMultiplier || f.isPlayingAtLowestQuality(d)) - return n; - if (!l.hasOwnProperty(e.index)) { - const r = t.getAbrController() - , o = e.bytesTotal - e.bytesLoaded - , s = r.getOptimalRepresentationForBitrate(a, u, !0) - , c = e.representation; - o > e.bytesTotal * s.bitrateInKbit / c.bitrateInKbit && (n.representation = s, - n.reason = { - throughputInKbit: u, - message: `[AbandonRequestRule][${i} is asking to abandon and switch to quality to ${s.absoluteIndex}. The measured bandwidth was ${u} kbit/s` - }, - l[e.index] = !0) - } - return n - }(t, a, i) - } - return i - } catch (t) { - return o.error(t), - i - } - }, - reset: s - }, - o = (0, - C.A)(a).getInstance().getLogger(i), - s(), - i - } - Ii.__dashjs_factory_name = "AbandonRequestsRule"; - var ki = N.A.getClassFactory(Ii); - function Ri() { - const t = this.context - , e = (0, - K.A)(t).getInstance(); - let n; - return n = { - getSwitchRequest: function(n) { - const a = Ai(t).create(); - if (a.rule = this.getClassName(), - !n || !n.hasOwnProperty("getDroppedFramesHistory")) - return a; - const r = n.getDroppedFramesHistory(); - if (!r) - return a; - const i = n.getStreamInfo().id - , o = n.getMediaInfo() - , l = n.getAbrController() - , s = r.getFrameHistory(i); - if (!s || 0 === Object.keys(s).length) - return a; - let u = 0 - , c = 0; - const d = l.getPossibleVoRepresentationsFilteredBySettings(o, !0); - let f = null; - for (let t = 1; t < d.length; t++) { - const n = d[t]; - if (n && s[n.id] && (u = s[n.id].droppedVideoFrames, - c = s[n.id].totalVideoFrames, - c > e.get().streaming.abr.rules.droppedFramesRule.parameters.minimumSampleSize && u / c > e.get().streaming.abr.rules.droppedFramesRule.parameters.droppedFramesPercentageThreshold)) { - f = d[t - 1]; - break - } - } - return f && (a.representation = f, - a.reason = { - droppedFrames: u, - message: `[DroppedFramesRule]: Switching to index ${f.absoluteIndex}. Dropped Frames: ${u}, Total Frames: ${c}` - }), - a - } - }, - n - } - Ri.__dashjs_factory_name = "DroppedFramesRule"; - var Ni = N.A.getClassFactory(Ri); - function Ci() { - const t = this.context - , e = (0, - K.A)(t).getInstance(); - let n; - return n = { - getSwitchRequest: function(n) { - const a = Ai(t).create(); - if (a.rule = this.getClassName(), - !n) - return a; - const r = n.getStreamInfo().id - , i = n.getMediaType() - , o = n ? n.getSwitchRequestHistory() : null - , l = o ? o.getSwitchRequests(r, i) : {} - , s = n.getAbrController() - , u = n.getMediaInfo() - , c = s.getPossibleVoRepresentationsFilteredBySettings(u, !0); - let d = 0 - , f = 0; - for (let t = 0; t < c.length; t++) { - const n = c[t]; - if (n && l[n.id] && (d += l[n.id].drops, - f += l[n.id].noDrops, - d + f >= e.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize && d / f > e.get().streaming.abr.rules.switchHistoryRule.parameters.switchPercentageThreshold)) { - a.representation = t > 0 && l[n.id].drops > 0 ? c[t - 1] : n, - a.reason = { - drops: d, - noDrops: f, - message: `[SwitchHistoryRule]: Switch to index: ${a.representation.absoluteIndex} samples: ${d + f} drops: ${d}` - }; - break - } - } - return a - } - }, - n - } - Ci.__dashjs_factory_name = "SwitchHistoryRule"; - var Di = N.A.getClassFactory(Ci); - const xi = "BOLA_STATE_ONE_BITRATE" - , Mi = "BOLA_STATE_STARTUP" - , zi = "BOLA_STATE_STEADY" - , Oi = 10; - function Li(t) { - t = t || {}; - const e = this.context - , n = t.dashMetrics - , a = t.mediaPlayerModel - , r = (0, - k.A)(e).getInstance() - , i = co(e).getInstance(); - let o, l, s; - function u(t) { - const e = t.mediaType - , n = t.streamId - , a = e === w.A.AUDIO ? [w.A.AUDIO] : s[n]; - for (const t in a) - s[n] && s[n].hasOwnProperty(t) && s[n][t].state === zi && (s[n][t].placeholderBuffer = 0) - } - function c(t) { - const e = t.streamId; - for (const t in s[e]) - if (s[e].hasOwnProperty(t)) { - const n = s[e][t]; - n.state !== xi && (n.state = Mi, - d(n)) - } - } - function d(t) { - t.placeholderBuffer = 0, - t.mostAdvancedSegmentStart = NaN, - t.lastSegmentWasReplacement = !1, - t.lastSegmentStart = NaN, - t.lastSegmentDurationS = NaN, - t.lastSegmentRequestTimeMs = NaN, - t.lastSegmentFinishTimeMs = NaN - } - function f(t) { - try { - if (t && t.metric === I.HTTP_REQUEST && t.value && t.value.type === z.G.MEDIA_SEGMENT_TYPE && t.value.trace && t.value.trace.length) { - const e = s[t.value._streamId] && s[t.value._streamId][t.mediaType] ? s[t.value._streamId][t.mediaType] : null; - e && e.state !== xi && (e.lastSegmentRequestTimeMs = t.value.trequest.getTime(), - e.lastSegmentFinishTimeMs = t.value._tfinish.getTime(), - g(e, t.mediaType)) - } - } catch (t) { - l.error(t) - } - } - function g(t, e) { - if (!isNaN(t.lastSegmentStart) && !isNaN(t.lastSegmentRequestTimeMs) && !isNaN(t.placeholderBuffer)) { - if (t.placeholderBuffer *= .99, - !isNaN(t.lastSegmentFinishTimeMs)) { - const a = n.getCurrentBufferLevel(e) + .001 * (t.lastSegmentFinishTimeMs - t.lastSegmentRequestTimeMs) - , r = b(t, t.currentRepresentation) - , i = Math.max(0, r - a); - t.placeholderBuffer = Math.min(i, t.placeholderBuffer) - } - t.lastSegmentWasReplacement && !isNaN(t.lastSegmentDurationS) && (t.placeholderBuffer += t.lastSegmentDurationS), - t.lastSegmentStart = NaN, - t.lastSegmentRequestTimeMs = NaN - } - } - function m(t) { - if (t && s[t.streamId] && s[t.streamId][t.mediaType]) { - const e = s[t.streamId][t.mediaType]; - e && e.state !== xi && (e.currentRepresentation = t.newRepresentation) - } - } - function h(t, e, n) { - const a = n.reduce(( (t, e, a) => e > n[t] ? a : t), 0); - if (0 === a) - return null; - const r = Math.max(t, Oi + 2 * e.length) - , i = (n[a] - 1) / (r / Oi - 1); - return { - gp: i, - Vp: Oi / i - } - } - function p(t, e) { - const r = a.getBufferTimeDefault(); - if (t.bufferTimeDefault !== r) { - const a = h(r, t.representations, t.utilities); - if (a.Vp !== t.Vp || a.gp !== t.gp) { - const i = n.getCurrentBufferLevel(e); - let o = i + t.placeholderBuffer; - o -= Oi, - o *= a.Vp / t.Vp, - o += Oi, - t.bufferTimeDefault = r, - t.Vp = a.Vp, - t.gp = a.gp, - t.placeholderBuffer = Math.max(0, o - i) - } - } - } - function b(t, e) { - return t.Vp * (t.utilities[e.absoluteIndex] + t.gp) - } - function y(t) { - if (t && t.chunk && t.chunk.representation.mediaInfo && s[t.streamId]) { - const e = s[t.streamId][t.chunk.representation.mediaInfo.type]; - if (e && e.state !== xi) { - const n = t.chunk.start; - isNaN(e.mostAdvancedSegmentStart) || n > e.mostAdvancedSegmentStart ? (e.mostAdvancedSegmentStart = n, - e.lastSegmentWasReplacement = !1) : e.lastSegmentWasReplacement = !0, - e.lastSegmentStart = n, - e.lastSegmentDurationS = t.chunk.duration, - e.currentRepresentation = t.chunk.representation, - g(e, t.chunk.representation.mediaInfo.type) - } - } - } - function E() { - T() - } - function _(t, e) { - const n = e.absoluteIndex - , a = e.bandwidth - , r = t.utilities[n]; - let i = 0; - for (let e = n - 1; e >= 0; --e) - if (t.utilities[e] < t.utilities[n]) { - const n = t.representations[e].bandwidth - , o = t.utilities[e] - , l = t.Vp * (t.gp + (a * o - n * r) / (a - n)); - i = Math.max(i, l) - } - return i - } - function A(t) { - if (t && s[t.streamId]) { - const e = s[t.streamId][t.mediaType]; - if (e && e.state !== xi) { - const a = n.getCurrentBufferLevel(t.mediaType); - let r; - r = e.currentRepresentation.absoluteIndex > 0 ? _(e, e.currentRepresentation) : Oi; - const i = Math.max(0, r - a); - e.placeholderBuffer = Math.min(e.placeholderBuffer, i) - } - } - } - function T() { - s = {} - } - return o = { - getSwitchRequest: function(t) { - try { - const r = Ai(e).create(); - t.getScheduleController().setTimeToLoadDelay(0), - r.rule = this.getClassName(), - r.reason = r.reason || {}; - const o = function(t) { - const e = t.getMediaType() - , n = t.getStreamInfo().id; - s[n] || (s = {}, - s[n] = {}); - let r = s[n][e]; - return r ? r.state !== xi && p(r, e) : (r = function(t) { - const e = {} - , n = t.getMediaInfo() - , r = i.getPossibleVoRepresentationsFilteredBySettings(n, !0); - let o = r.map((t => t.bandwidth)).map((t => Math.log(t))); - o = o.map((t => t - o[0] + 1)); - const l = a.getBufferTimeDefault() - , s = h(l, r, o); - return s ? (e.state = Mi, - e.representations = r, - e.utilities = o, - e.bufferTimeDefault = l, - e.Vp = s.Vp, - e.gp = s.gp, - e.currentRepresentation = null, - d(e)) : e.state = xi, - e - }(t), - s[n][e] = r), - r - }(t); - switch (r.reason.state = o.state, - o.state) { - case xi: - break; - case Mi: - !function(t, e, a) { - const r = e.getMediaType() - , o = e.getThroughputController().getSafeAverageThroughput(r); - if (isNaN(o)) - return; - const l = e.getMediaInfo() - , s = i.getOptimalRepresentationForBitrate(l, o, !0) - , u = n.getCurrentBufferLevel(r); - t.representation = s, - t.reason.throughput = o, - a.placeholderBuffer = Math.max(0, _(a, s) - u), - a.currentRepresentation = s, - !isNaN(a.lastSegmentDurationS) && u >= a.lastSegmentDurationS && (a.state = zi) - }(r, t, o); - break; - case zi: - !function(t, e, a) { - const r = e.getMediaType() - , o = e.getThroughputController() - , l = e.getMediaInfo() - , s = o.getSafeAverageThroughput(r) - , u = e.getScheduleController(); - !function(t, e) { - const n = Date.now(); - if (isNaN(t.lastSegmentFinishTimeMs)) { - if (!isNaN(t.lastCallTimeMs)) { - const e = .001 * (n - t.lastCallTimeMs); - t.placeholderBuffer += Math.max(0, e) - } - } else { - const e = .001 * (n - t.lastSegmentFinishTimeMs); - t.placeholderBuffer += Math.max(0, e) - } - t.lastCallTimeMs = n, - t.lastSegmentStart = NaN, - t.lastSegmentRequestTimeMs = NaN, - t.lastSegmentFinishTimeMs = NaN, - p(t, e) - }(a, r); - const c = n.getCurrentBufferLevel(r); - let d = function(t, e) { - const n = t.representations.length; - let a = NaN - , r = NaN; - for (let i = 0; i < n; ++i) { - let n = (t.Vp * (t.utilities[i] - 1 + t.gp) - e) / t.representations[i].bandwidth; - (isNaN(r) || n >= r) && (r = n, - a = i) - } - return t.representations[a] - }(a, c + a.placeholderBuffer); - const f = i.getOptimalRepresentationForBitrate(l, s, !0); - d.absoluteIndex > a.currentRepresentation.absoluteIndex && d.absoluteIndex > f.absoluteIndex && (d = f.absoluteIndex > a.currentRepresentation.absoluteIndex ? f : a.currentRepresentation); - let g = Math.max(0, c + a.placeholderBuffer - b(a, d)); - g <= a.placeholderBuffer ? (a.placeholderBuffer -= g, - g = 0) : (g -= a.placeholderBuffer, - a.placeholderBuffer = 0, - i.isPlayingAtTopQuality(d) ? g = 0 : u.setTimeToLoadDelay(1e3 * g)), - t.representation = d, - t.reason.throughput = s, - t.reason.bufferLevel = c, - t.reason.placeholderBuffer = a.placeholderBuffer, - t.reason.delay = g, - a.currentRepresentation = d - }(r, t, o); - break; - default: - !function(t, e, n) { - l.debug("BOLA ABR rule invoked in bad state."); - const a = e.getMediaInfo() - , r = e.getMediaType() - , o = e.getThroughputController().getSafeAverageThroughput(r); - t.representation = i.getOptimalRepresentationForBitrate(a, o, !0), - t.reason.state = n.state, - t.reason.throughput = o, - n.state = Mi, - d(n) - }(r, t, o) - } - return r - } catch (t) { - return l.error(t), - Ai(e).create() - } - }, - handleNewMediaInfo: function(t) { - t && t.streamInfo && t.type && s[t.streamInfo.id] && s[t.streamInfo.id][t.type] && delete s[t.streamInfo.id][t.type] - }, - reset: function() { - T(), - r.off(D.A.BUFFER_EMPTY, u, o), - r.off(D.A.PLAYBACK_SEEKING, c, o), - r.off(D.A.METRIC_ADDED, f, o), - r.off(D.A.QUALITY_CHANGE_REQUESTED, m, o), - r.off(D.A.FRAGMENT_LOADING_ABANDONED, A, o), - r.off(R.A.MEDIA_FRAGMENT_LOADED, y, o), - r.off(R.A.SETTING_UPDATED_MAX_BITRATE, E, o), - r.off(R.A.SETTING_UPDATED_MIN_BITRATE, E, o) - } - }, - l = (0, - C.A)(e).getInstance().getLogger(o), - T(), - r.on(D.A.BUFFER_EMPTY, u, o), - r.on(D.A.PLAYBACK_SEEKING, c, o), - r.on(D.A.METRIC_ADDED, f, o), - r.on(D.A.QUALITY_CHANGE_REQUESTED, m, o), - r.on(D.A.FRAGMENT_LOADING_ABANDONED, A, o), - r.on(R.A.MEDIA_FRAGMENT_LOADED, y, o), - r.on(R.A.SETTING_UPDATED_MAX_BITRATE, E, o), - r.on(R.A.SETTING_UPDATED_MIN_BITRATE, E, o), - o - } - Li.__dashjs_factory_name = "BolaRule"; - var Pi = N.A.getClassFactory(Li); - const Fi = "L2A_STATE_ONE_BITRATE" - , Ui = "L2A_STATE_STARTUP" - , ji = "L2A_STATE_STEADY" - , Bi = Math.pow(4, .99); - function qi(t) { - t = t || {}; - const e = this.context - , n = t.dashMetrics - , a = (0, - k.A)(e).getInstance(); - let r, i, o, l; - function s(t) { - t.placeholderBuffer = 0, - t.mostAdvancedSegmentStart = NaN, - t.lastSegmentWasReplacement = !1, - t.lastSegmentStart = NaN, - t.lastSegmentDurationS = NaN, - t.lastSegmentRequestTimeMs = NaN, - t.lastSegmentFinishTimeMs = NaN, - t.lastSegmentUrl = "" - } - function u() { - for (const t in i) - if (i.hasOwnProperty(t)) { - const e = i[t]; - e.state !== Fi && (e.state = Ui, - s(e)) - } - } - function c(t) { - if (t && t.chunk && t.chunk.representation && t.chunk.representation.mediaInfo) { - const e = i[t.chunk.representation.mediaInfo.type] - , n = o[t.chunk.representation.mediaInfo.type]; - if (e && e.state !== Fi) { - const a = t.chunk.start; - isNaN(e.mostAdvancedSegmentStart) || a > e.mostAdvancedSegmentStart ? (e.mostAdvancedSegmentStart = a, - e.lastSegmentWasReplacement = !1) : e.lastSegmentWasReplacement = !0, - e.lastSegmentStart = a, - e.lastSegmentDurationS = t.chunk.duration, - e.currentRepresentation = t.chunk.representation, - f(e, n) - } - } - } - function d(t) { - if (t && t.metric === I.HTTP_REQUEST && t.value && t.value.type === z.G.MEDIA_SEGMENT_TYPE && t.value.trace && t.value.trace.length) { - const e = i[t.mediaType] - , n = o[t.mediaType]; - e && e.state !== Fi && (e.lastSegmentRequestTimeMs = t.value.trequest.getTime(), - e.lastSegmentFinishTimeMs = t.value._tfinish.getTime(), - f(e, n)) - } - } - function f(t, e) { - isNaN(t.lastSegmentStart) || isNaN(t.lastSegmentRequestTimeMs) || (e.segment_request_start_s = .001 * t.lastSegmentRequestTimeMs, - e.segment_download_finish_s = .001 * t.lastSegmentFinishTimeMs, - t.lastSegmentStart = NaN, - t.lastSegmentRequestTimeMs = NaN) - } - function g(t, e) { - if (t.length !== e.length) - return -1; - let n = 0; - for (let a = 0; a < t.length; a++) - n += t[a] * e[a]; - return n - } - function m() { - i = {}, - o = {} - } - return r = { - getSwitchRequest: function(t) { - try { - const a = Ai(e).create(); - a.rule = this.getClassName(); - const r = t.getMediaType() - , l = t.getScheduleController(); - if (a.reason = a.reason || {}, - r === w.A.AUDIO) - return a; - l.setTimeToLoadDelay(0); - const u = function(t) { - const e = t.getMediaType(); - let n = i[e]; - return n || (n = function(t) { - const e = {} - , n = t.getMediaInfo(); - return e.state = Ui, - e.currentRepresentation = null, - function(t) { - t && t.type && (o[t.type] = {}, - o[t.type].w = [], - o[t.type].prev_w = [], - o[t.type].Q = 0, - o[t.type].segment_request_start_s = 0, - o[t.type].segment_download_finish_s = 0, - o[t.type].B_target = 1.5) - }(n), - s(e), - e - }(t), - i[e] = n), - n - }(t); - if (!o[r]) - return a; - switch (a.reason.state = u.state, - u.state) { - case Fi: - break; - case Ui: - !function(t, e, a) { - const r = t.getMediaInfo() - , i = t.getMediaType() - , l = t.getThroughputController().getSafeAverageThroughput(i); - if (isNaN(l)) - return e; - const s = t.getAbrController() - , u = s.getOptimalRepresentationForBitrate(r, l, !0) - , c = n.getCurrentBufferLevel(i, !0) - , d = o[i] - , f = s.getPossibleVoRepresentationsFilteredBySettings(r, !0); - if (e.representation = u, - e.reason.throughput = l, - a.currentRepresentation = u, - !isNaN(a.lastSegmentDurationS) && c >= d.B_target) { - a.state = ji, - d.Q = Bi; - for (let t = 0; t < f.length; ++t) - f[t].id === a.currentRepresentation.id ? d.prev_w[t] = 1 : d.prev_w[t] = 0 - } - }(t, a, u); - break; - case ji: - !function(t, e, a) { - let r = []; - const i = t.getThroughputController() - , l = t.getMediaType(); - let s = i.getAverageThroughput(l, w.A.THROUGHPUT_CALCULATION_MODES.ARITHMETIC_MEAN, 1) - , u = n.getCurrentHttpRequest(l) - , c = null; - const d = o[l]; - if (s < 1 && (s = 1), - u.url === a.lastSegmentUrl || u.type === z.G.INIT_SEGMENT_TYPE) - c = a.currentRepresentation; - else { - let e = a.lastSegmentDurationS - , n = 1; - const i = t.getAbrController() - , o = t.getMediaInfo() - , l = i.getPossibleVoRepresentationsFilteredBySettings(o, !0); - let f = t.getVideoModel().getPlaybackRate(); - const m = Math.max(Math.pow(4, 1), Bi * Math.sqrt(4)); - for (let t = 0; t < l.length; ++t) { - const a = l[t]; - f * a.bitrateInKbit > s && (n = -1), - d.w[t] = d.prev_w[t] + n * (e / (2 * m)) * ((d.Q + Bi) * (f * a.bitrateInKbit / s)) - } - d.w = function(t) { - const e = t.length; - let n = !1 - , a = []; - for (let n = 0; n < e; ++n) - a[n] = t[n]; - let r = t.sort((function(t, e) { - return e - t - } - )) - , i = 0 - , o = 0 - , l = []; - for (let t = 0; t < e - 1; ++t) - if (i += r[t], - o = (i - 1) / (t + 1), - o >= r[t + 1]) { - n = !0; - break - } - n || (o = (i + r[e - 1] - 1) / e); - for (let t = 0; t < e; ++t) - l[t] = Math.max(a[t] - o, 0); - return l - }(d.w); - for (let t = 0; t < l.length; ++t) - r[t] = d.w[t] - d.prev_w[t], - d.prev_w[t] = d.w[t]; - const h = l.map((t => t.bandwidth)); - d.Q = Math.max(0, d.Q - e + e * f * ((g(h, d.prev_w) + g(h, r)) / s)); - let p = []; - for (let t = 0; t < h.length; ++t) - p[t] = Math.abs(h[t] - g(d.w, h)); - const b = p.indexOf(Math.min(...p)); - c = i.getRepresentationByAbsoluteIndex(b, o, !0), - c.absoluteIndex > a.currentRepresentation.absoluteIndex && h[a.currentRepresentation.absoluteIndex + 1] <= s && (c = i.getRepresentationByAbsoluteIndex(a.currentRepresentation.absoluteIndex + 1, o, !0)), - c.bitrateInKbit >= s && (d.Q = 2 * Math.max(Bi, d.Q)), - a.lastSegmentUrl = u.url - } - e.representation = c, - a.currentRepresentation = e.representation - }(t, a, u); - break; - default: - !function(t, e, n) { - const a = t.getAbrController() - , r = t.getMediaInfo() - , i = t.getMediaType() - , o = t.getThroughputController().getSafeAverageThroughput(i); - e.representation = a.getOptimalRepresentationForBitrate(r, o, !0), - e.reason.throughput = o, - n.state = Ui, - s(n) - }(t, a, u) - } - return a - } catch (t) { - return l.error(t), - Ai(e).create() - } - }, - reset: function() { - m(), - a.off(R.A.PLAYBACK_SEEKING, u, r), - a.off(R.A.MEDIA_FRAGMENT_LOADED, c, r), - a.off(R.A.METRIC_ADDED, d, r) - } - }, - l = (0, - C.A)(e).getInstance().getLogger(r), - m(), - a.on(R.A.PLAYBACK_SEEKING, u, r), - a.on(R.A.MEDIA_FRAGMENT_LOADED, c, r), - a.on(R.A.METRIC_ADDED, d, r), - r - } - qi.__dashjs_factory_name = "L2ARule"; - var Gi = N.A.getClassFactory(qi); - function Hi() { - const t = this.context; - let e, n, a, r, i, o, l, s, u; - function c() { - a = null, - r = 1, - i = 100, - o = 0, - l = null, - s = null, - u = "dynamic_weight_selection" - } - function d() { - let t = 0; - if (a) - for (let e = 0; e < a.length; e++) { - let n = a[e]; - n.state.throughput > t && (t = n.state.throughput) - } - return t - } - function f(t, e, n) { - let a = t.map(( (t, a) => n[a] * Math.pow(t - e[a], 2))).reduce(( (t, e) => t + e)); - return (a < 0 ? -1 : 1) * Math.sqrt(Math.abs(a)) - } - function g(t, e) { - return f([t.state.throughput, t.state.latency, t.state.rebuffer, t.state.switch], [e.state.throughput, e.state.latency, e.state.rebuffer, e.state.switch], [1, 1, 1, 1]) - } - function m(t, e) { - for (let n = 0; n < a.length; n++) { - let r = a[n] - , i = .1; - const o = g(r, t); - h(r, e, Math.exp(-1 * Math.pow(o, 2) / (2 * Math.pow(i, 2)))) - } - } - function h(t, e, n) { - let a = t.state - , r = [.01, .01, .01, .01]; - a.throughput = a.throughput + (e[0] - a.throughput) * r[0] * n, - a.latency = a.latency + (e[1] - a.latency) * r[1] * n, - a.rebuffer = a.rebuffer + (e[2] - a.rebuffer) * r[2] * n, - a.switch = a.switch + (e[3] - a.switch) * r[3] * n - } - return e = { - getNextQuality: function(t, e, c, g, h, p, b, y) { - let E = g - , _ = c; - !function(t, e) { - if (!a) { - a = []; - const n = e.getPossibleVoRepresentationsFilteredBySettings(t, !0) - , i = n.map((t => t.bandwidth)); - o = Math.min(...i), - r = function(t) { - const e = t.map((t => Math.pow(t, 2))).reduce(( (t, e) => t + e)); - return Math.sqrt(e) - }(i), - n.forEach((t => { - let e = { - representation: t, - state: { - throughput: t.bandwidth / r, - latency: 0, - rebuffer: 0, - switch: 0 - } - }; - a.push(e) - } - )), - s = function(t) { - let e = [] - , n = function(t) { - let e = []; - for (let n = 0; n < t; n++) { - let t = [Math.random() * d(), Math.random(), Math.random(), Math.random()]; - e.push(t) - } - return e - }(Math.pow(t.length, 2)); - e.push(n[0]); - let a = [1, 1, 1, 1]; - for (let r = 1; r < t.length; r++) { - let t = null - , r = null; - for (let i = 0; i < n.length; i++) { - let o = n[i] - , l = null; - for (let t = 0; t < e.length; t++) { - let n = f(o, e[t], a); - (null === l || n < l) && (l = n) - } - (null === r || l > r) && (t = o, - r = l) - } - e.push(t) - } - let r = null - , i = null; - for (let t = 0; t < e.length; t++) { - let n = 0; - for (let r = 0; r < e.length; r++) - t !== r && (n += f(e[t], e[r], a)); - (null === r || n > r) && (r = n, - i = t) - } - let o = []; - for (o.push(e[i]), - e.splice(i, 1); e.length > 0; ) { - let t = null - , n = null; - for (let r = 0; r < e.length; r++) { - let i = f(o[0], e[r], a); - (null === t || i < t) && (t = i, - n = r) - } - o.push(e[n]), - e.splice(n, 1) - } - return o - }(a) - } - }(e, t); - let A = c / r; - A > 1 && (A = d()), - g /= i; - let T = a.find((t => t.representation.id === b.id)) - , v = T.representation.bandwidth * y.getSegmentDuration() / _ - , w = Math.max(0, v - h); - if (h - v < y.getMinBuffer()) - return n.debug(`Buffer is low for bitrate= ${T.representation.bandwidth} downloadTime=${v} currentBuffer=${h} rebuffer=${w}`), - function(t, e) { - let n = 0 - , r = t; - if (a) - for (let i = 0; i < a.length; i++) { - let o = a[i]; - o.representation.bandwidth < t.representation.bandwidth && o.representation.bandwidth > n && e > o.representation.bandwidth && (n = o.representation.bandwidth, - r = o) - } - return r - }(T, _).representation; - switch (u) { - case "manual_weight_selection": - l = [.4, .4, .4, .4]; - break; - case "random_weight_selection": - l = function(t) { - let e = [] - , n = Math.sqrt(2 / t); - for (let t = 0; t < 4; t++) - e.push(Math.random() * n); - return l = e, - l - }(a.length); - break; - default: - !function(t, e, n, r, i, o) { - l || (l = s[s.length - 1]); - let u = t.findWeightVector(a, e, n, r, i, o); - null !== u && -1 !== u && (l = u) - }(y, E, h, w, _, p) - } - let S = null - , I = null - , k = null; - for (let t = 0; t < a.length; t++) { - let e = a[t] - , r = e.state - , i = [r.throughput, r.latency, r.rebuffer, r.switch] - , s = l.slice() - , u = y.getNextBufferWithBitrate(e.representation.bandwidth, h, _) - , d = u < y.getMinBuffer(); - d && n.debug(`Buffer is low for bitrate=${e.representation.bandwidth} downloadTime=${v} currentBuffer=${h} nextBuffer=${u}`), - (e.representation.bandwidth > c - 1e4 || d) && e.representation.bandwidth !== o && (s[0] = 100); - let g = f(i, [A, 0, 0, 0], s); - (null === S || g < S) && (S = g, - I = e.representation, - k = e) - } - let R = Math.abs(T.representation.bandwidth - k.representation.bandwidth) / r; - return m(T, [A, g, w, R]), - m(k, [A, 0, 0, R]), - I - }, - reset: function() { - c() - } - }, - n = (0, - C.A)(t).getInstance().getLogger(e), - c(), - e - } - Hi.__dashjs_factory_name = "LearningAbrController"; - var Yi = N.A.getClassFactory(Hi) - , Vi = class { - constructor() { - this.type = null, - this.lastBitrate = null, - this.weights = {}, - this.weights.bitrateReward = null, - this.weights.bitrateSwitchPenalty = null, - this.weights.rebufferPenalty = null, - this.weights.latencyPenalty = null, - this.weights.playbackSpeedPenalty = null, - this.bitrateWSum = 0, - this.bitrateSwitchWSum = 0, - this.rebufferWSum = 0, - this.latencyWSum = 0, - this.playbackSpeedWSum = 0, - this.totalQoe = 0 - } - } - ; - function Ki() { - let t, e, n, a, r; - function i() { - e = null, - n = null, - a = null, - r = null - } - function o(t, e, n, a) { - let r = new Vi; - return r.type = t, - r.weights.bitrateReward = e || 1, - r.weights.bitrateSwitchPenalty = 1, - r.weights.rebufferPenalty = n || 1e3, - r.weights.latencyPenalty = [], - r.weights.latencyPenalty.push({ - threshold: 1.1, - penalty: .05 * a - }), - r.weights.latencyPenalty.push({ - threshold: 1e8, - penalty: .1 * n - }), - r.weights.playbackSpeedPenalty = a || 200, - r - } - function l(t, e, n, a, r) { - r.bitrateWSum += r.weights.bitrateReward * t, - r.lastBitrate && (r.bitrateSwitchWSum += r.weights.bitrateSwitchPenalty * Math.abs(t - r.lastBitrate)), - r.lastBitrate = t, - r.rebufferWSum += r.weights.rebufferPenalty * e; - for (let t = 0; t < r.weights.latencyPenalty.length; t++) { - let e = r.weights.latencyPenalty[t]; - if (n <= e.threshold) { - r.latencyWSum += e.penalty * n; - break - } - } - r.playbackSpeedWSum += r.weights.playbackSpeedPenalty * Math.abs(1 - a), - r.totalQoe = r.bitrateWSum - r.bitrateSwitchWSum - r.rebufferWSum - r.latencyWSum - r.playbackSpeedWSum - } - return t = { - setupPerSegmentQoe: function(t, i, l) { - e = o("segment", t, i, l), - n = t, - a = i, - r = l - }, - logSegmentMetrics: function(t, n, a, r) { - e && l(t, n, a, r, e) - }, - getPerSegmentQoe: function() { - return e - }, - calculateSingleUseQoe: function(t, e, i, s) { - let u = null; - return n && a && r && (u = o("segment", n, a, r)), - u ? (l(t, e, i, s, u), - u.totalQoe) : 0 - }, - reset: function() { - i() - } - }, - i(), - t - } - Ki.__dashjs_factory_name = "LoLpQoeEvaluator"; - var Wi = N.A.getClassFactory(Ki); - function $i(t) { - let e, n, a, r, i, o = t.targetLatency, l = t.bufferMin, s = t.segmentDuration, u = t.qoeEvaluator; - function c() { - return s - } - function d(t, e) { - const n = c(); - let a; - return a = e > n ? t - n : t + n - e, - a - } - return e = { - getMinBuffer: function() { - return l - }, - getSegmentDuration: c, - getNextBufferWithBitrate: function(t, e, n) { - return d(e, t * s / n) - }, - getNextBuffer: d, - findWeightVector: function(t, e, n, a, c, f) { - let g = null - , m = null - , h = null - , p = Math.abs(e - i); - return t.forEach((t => { - r.forEach((a => { - a[0]; - let r, i = a[1], b = a[2], y = (a[3], - t.representation.bandwidth * s / c), E = d(n, y); - r = 0 === b ? 10 : 1 / b; - let _ = r * Math.max(1e-5, y - E); - r = 0 === i ? 10 : 1 / i; - let A = r * t.state.latency - , T = u.calculateSingleUseQoe(t.representation.bandwidth, _, A, f); - (null === g || T > g) && function(t, e, n) { - return !(t > o + n) && e >= l - }(e, E, p) && (g = T, - m = a, - h = t.representation.bandwidth) - } - )) - } - )), - null === m && null === h && (m = -1), - i = e, - m - } - }, - n = [.2, .4, .6, .8, 1], - a = 4, - r = function(t) { - let e = t.map((function(t) { - return [t] - } - )) - , n = function(e, a, r) { - if (r === a) - return e; - let i = e.length; - for (let n = 0; n < i; n++) { - let n = e.shift(); - for (let a = 0; a < t.length; a++) - e.push(n.concat(t[a])) - } - return n(e, a, r + 1) - }; - return n(e, 4, 1) - }(n), - i = 0, - e - } - $i.__dashjs_factory_name = "LoLpWeightSelector"; - var Xi = N.A.getClassFactory($i); - function Qi(t) { - let e, n, a, r, i = (t = t || {}).dashMetrics, o = this.context; - return n = { - getSwitchRequest: function(t) { - try { - let n = Ai(o).create(); - n.rule = this.getClassName(); - let l = t.getMediaInfo().type - , s = t.getAbrController(); - const u = t.getStreamInfo(); - let c = t.getRepresentation(); - const d = t.getMediaInfo() - , f = i.getCurrentBufferState(l) - , g = t.getScheduleController() - , m = i.getCurrentBufferLevel(l, !0) - , h = g.getPlaybackController(); - let p = h.getCurrentLiveLatency(); - if (l === w.A.AUDIO) - return n; - p || (p = 0); - const b = h.getPlaybackRate() - , y = t.getThroughputController().getSafeAverageThroughput(l); - if (e.debug(`Throughput ${Math.round(y)} kbps`), - isNaN(y) || !f) - return n; - if (s.getAbandonmentStateFor(u.id, l) === I.ABANDON_LOAD) - return n; - let E = s.getPossibleVoRepresentationsFilteredBySettings(d, !0).map((t => t.bandwidth)) - , _ = t.getRepresentation().fragmentDuration - , A = Math.min(...E) / 1e3 - , T = Math.max(...E) / 1e3 - , v = c.bandwidth / 1e3 - , S = i.getCurrentHttpRequest(l, !0) - , k = (S.tresponse.getTime() - S.trequest.getTime()) / 1e3 - , R = k > _ ? k - _ : 0; - r.setupPerSegmentQoe(_, T, A), - r.logSegmentMetrics(v, R, p, b); - let N = Xi(o).create({ - targetLatency: 1.5, - bufferMin: .3, - segmentDuration: _, - qoeEvaluator: r - }); - return n.representation = a.getNextQuality(s, d, 1e3 * y, p, m, b, c, N), - n.reason = { - throughput: y, - latency: p - }, - n.priority = Ai.PRIORITY.STRONG, - g.setTimeToLoadDelay(0), - n - } catch (t) { - throw t - } - }, - reset: function() { - a.reset(), - r.reset() - } - }, - e = (0, - C.A)(o).getInstance().getLogger(n), - a = Yi(o).create(), - r = Wi(o).create(), - n - } - Qi.__dashjs_factory_name = "LoLPRule"; - var Zi = N.A.getClassFactory(Qi); - function Ji(t) { - t = t || {}; - const e = this.context - , n = t.mediaPlayerModel - , a = t.customParametersModel - , r = t.dashMetrics - , i = t.settings - , o = (0, - k.A)(e).getInstance(); - let l, s, u, c; - function d() { - Object.values(w.A.QUALITY_SWITCH_RULES).forEach((t => { - s = f(t, s) - } - )), - Object.values(w.A.ABANDON_FRAGMENT_RULES).forEach((t => { - u = f(t, u) - } - )), - a.getAbrCustomRules().forEach((function(t) { - t.type === w.A.RULES_TYPES.QUALITY_SWITCH_RULES && s.push(t.rule(e).create()), - t.type === w.A.RULES_TYPES.ABANDON_FRAGMENT_RULES && u.push(t.rule(e).create()) - } - )), - 0 === s.length && (s.push(Pi(e).create({ - dashMetrics: r, - mediaPlayerModel: n, - settings: i - })), - s.push(vi(e).create({ - dashMetrics: r - }))) - } - function f(t, a) { - const o = t.charAt(0).toLowerCase() + t.slice(1); - return i.get().streaming.abr.rules[o].active && !function(t, e) { - return t.filter((t => t.getClassName() === e)).length > 0 - }(a, t) ? (a.push(function(t) { - switch (t) { - case w.A.QUALITY_SWITCH_RULES.BOLA_RULE: - return Pi(e).create({ - dashMetrics: r, - mediaPlayerModel: n, - settings: i - }); - case w.A.QUALITY_SWITCH_RULES.THROUGHPUT_RULE: - return vi(e).create({ - dashMetrics: r - }); - case w.A.QUALITY_SWITCH_RULES.INSUFFICIENT_BUFFER_RULE: - return Si(e).create({ - dashMetrics: r, - settings: i - }); - case w.A.QUALITY_SWITCH_RULES.SWITCH_HISTORY_RULE: - return Di(e).create(); - case w.A.QUALITY_SWITCH_RULES.DROPPED_FRAMES_RULE: - return Ni(e).create(); - case w.A.QUALITY_SWITCH_RULES.LEARN_TO_ADAPT_RULE: - return Gi(e).create({ - dashMetrics: r, - settings: i - }); - case w.A.QUALITY_SWITCH_RULES.LOL_PLUS_RULE: - return Zi(e).create({ - dashMetrics: r - }); - case w.A.ABANDON_FRAGMENT_RULES.ABANDON_REQUEST_RULE: - return ki(e).create({ - dashMetrics: r, - mediaPlayerModel: n, - settings: i - }) - } - }(t)), - a) : i.get().streaming.abr.rules[o].active ? a : function(t, e) { - return t.filter((t => t.getClassName() !== e)) - }(a, t) - } - function g(t) { - return t.filter((t => t.representation !== Ai.NO_CHANGE)) - } - function m(t) { - const e = {}; - let n, a, r, i = null; - if (0 !== t.length) { - for (e[Ai.PRIORITY.STRONG] = null, - e[Ai.PRIORITY.WEAK] = null, - e[Ai.PRIORITY.DEFAULT] = null, - n = 0, - a = t.length; n < a; n += 1) - r = t[n], - r.representation !== Ai.NO_CHANGE && (null === e[r.priority] || e[r.priority].representation !== Ai.NO_CHANGE && r.representation.bitrateInKbit < e[r.priority].representation.bitrateInKbit) && (e[r.priority] = r); - return e[Ai.PRIORITY.WEAK] && e[Ai.PRIORITY.WEAK].representation !== Ai.NO_CHANGE && (i = e[Ai.PRIORITY.WEAK]), - e[Ai.PRIORITY.DEFAULT] && e[Ai.PRIORITY.DEFAULT].representation !== Ai.NO_CHANGE && (i = e[Ai.PRIORITY.DEFAULT]), - e[Ai.PRIORITY.STRONG] && e[Ai.PRIORITY.STRONG].representation !== Ai.NO_CHANGE && (i = e[Ai.PRIORITY.STRONG]), - i - } - } - function h() { - d() - } - return l = { - clearDataForStream: function(t) { - [s, u].forEach((e => { - e && e.length && e.forEach((e => e.clearDataForStream && "function" == typeof e.clearDataForStream && e.clearDataForStream(t))) - } - )) - }, - getAbandonFragmentRules: function() { - return u - }, - getBestPossibleSwitchRequest: function(t) { - return t && m(g(s.filter((e => { - const n = e.getClassName(); - if (n !== w.A.QUALITY_SWITCH_RULES.BOLA_RULE && n !== w.A.QUALITY_SWITCH_RULES.THROUGHPUT_RULE) - return !0; - const a = t.getMediaType(); - return c[a] && n === w.A.QUALITY_SWITCH_RULES.BOLA_RULE || !c[a] && n === w.A.QUALITY_SWITCH_RULES.THROUGHPUT_RULE - } - )).map((e => e.getSwitchRequest(t))))) || Ai(e).create() - }, - getBolaState: function(t) { - return c[t] - }, - getMinSwitchRequest: m, - getQualitySwitchRules: function() { - return s - }, - handleNewMediaInfo: function(t) { - s.forEach((e => e.handleNewMediaInfo && e.handleNewMediaInfo(t))), - u.forEach((e => e.handleNewMediaInfo && e.handleNewMediaInfo(t))) - }, - initialize: function() { - s = [], - u = [], - c = {}, - d(), - o.on(R.A.SETTING_UPDATED_ABR_ACTIVE_RULES, h, l) - }, - reset: function() { - [s, u].forEach((t => { - t && t.length && t.forEach((t => t.reset && t.reset())) - } - )), - s = [], - u = [], - c = {}, - o.off(R.A.SETTING_UPDATED_ABR_ACTIVE_RULES, h, l) - }, - setBolaState: function(t, e) { - c[t] = e - }, - shouldAbandonFragment: function(t) { - if (!t) - return Ai(e).create(); - const n = m(g(u.map((e => e.shouldAbandon(t))))); - return n && (n.reason.forceAbandon = !0), - n || Ai(e).create() - } - }, - l - } - Ji.__dashjs_factory_name = "ABRRulesCollection"; - const to = N.A.getClassFactory(Ji); - N.A.updateSingletonFactory(Ji.__dashjs_factory_name, to); - var eo = to; - function no(t) { - let e; - const n = (t = t || {}).abrController - , a = t.throughputController - , r = t.switchRequestHistory - , i = t.droppedFramesHistory - , o = t.currentRequest - , l = t.streamProcessor ? t.streamProcessor.getScheduleController() : null - , s = t.streamProcessor ? t.streamProcessor.getRepresentation() : null - , u = t.videoModel ? t.videoModel : null; - function c() { - return s ? s.mediaInfo : null - } - return e = { - getAbrController: function() { - return n - }, - getCurrentRequest: function() { - return o - }, - getDroppedFramesHistory: function() { - return i - }, - getMediaInfo: c, - getMediaType: function() { - const t = c(); - return t ? t.type : null - }, - getRepresentation: function() { - return s - }, - getScheduleController: function() { - return l - }, - getStreamInfo: function() { - const t = c(); - return t ? t.streamInfo : null - }, - getSwitchRequestHistory: function() { - return r - }, - getThroughputController: function() { - return a - }, - getVideoModel: function() { - return u - } - }, - e - } - no.__dashjs_factory_name = "RulesContext"; - var ao = N.A.getClassFactory(no); - function ro() { - let t = {} - , e = {}; - const n = this.context - , a = (0, - K.A)(n).getInstance(); - return { - clearForStream: function(n) { - delete t[n], - delete e[n] - }, - getSwitchRequests: function(e, n) { - return null != e && null != n && t[e] && t[e][n] ? t[e][n] : {} - }, - push: function(n) { - const r = n.currentRepresentation - , i = n.newRepresentation; - if (r.mediaInfo.streamInfo.id !== i.mediaInfo.streamInfo.id || i.mediaInfo.id !== r.mediaInfo.id) - return; - const o = r.mediaInfo.streamInfo.id; - t[o] || function(n) { - t[n] = {}, - e[n] = {} - }(o); - const l = r.mediaInfo.type; - t[o][l] || function(n, a) { - t[n][a] = {}, - e[n][a] = [] - }(o, l); - const s = n.currentRepresentation.id; - t[o][l][s] || function(e, n, a) { - t[e][n][a] = { - noDrops: 0, - drops: 0, - dropSize: 0 - } - }(o, l, s); - let u = n.newRepresentation.absoluteIndex - n.currentRepresentation.absoluteIndex - , c = u < 0 ? 1 : 0 - , d = c ? -u : 0 - , f = c ? 0 : 1; - t[o][l][n.currentRepresentation.id].drops += c, - t[o][l][n.currentRepresentation.id].dropSize += d, - t[o][l][n.currentRepresentation.id].noDrops += f, - e[o][l].push({ - id: n.currentRepresentation.id, - noDrop: f, - drop: c, - dropSize: d - }); - const g = function(t, n) { - return e[t][n].length > a.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize ? e[t][n].shift() : null - }(o, l); - g && function(e, n, a) { - t[e][n][a.id].drops -= a.drop, - t[e][n][a.id].dropSize -= a.dropSize, - t[e][n][a.id].noDrops -= a.noDrop - }(o, l, g) - }, - reset: function() { - t = {}, - e = {} - } - } - } - ro.__dashjs_factory_name = "SwitchRequestHistory"; - var io = N.A.getClassFactory(ro); - function oo() { - let t = {} - , e = {} - , n = {}; - return { - clearForStream: function(a) { - delete t[a], - delete e[a], - delete n[a] - }, - getFrameHistory: function(e) { - return t[e] - }, - push: function(a, r, i) { - if (!r) - return; - t[a] || function(a) { - t[a] = [], - e[a] = 0, - n[a] = 0 - }(a); - let o = i && i.droppedVideoFrames ? i.droppedVideoFrames : 0 - , l = i && i.totalVideoFrames ? i.totalVideoFrames : 0 - , s = o - e[a]; - e[a] = o; - let u = l - n[a]; - n[a] = l; - const c = t[a]; - c[r] ? (c[r].droppedVideoFrames += s, - c[r].totalVideoFrames += u) : c[r] = { - droppedVideoFrames: s, - totalVideoFrames: u - } - }, - reset: function() { - t = {}, - e = {}, - n = {} - } - } - } - oo.__dashjs_factory_name = "DroppedFramesHistory"; - var lo = N.A.getClassFactory(oo); - function so() { - const t = this.context - , e = (0, - C.A)(t).getInstance() - , n = (0, - k.A)(t).getInstance(); - let a, r, i, o, l, s, u, c, d, f, g, m, h, p, b, y, E, _, A, T, v; - function S() { - u = {}, - s = {}, - void 0 === d && (d = !1), - _ && _.reset(), - E && E.reset(), - y = void 0, - _ = void 0, - E = void 0, - clearTimeout(c), - c = null - } - function N(t) { - let e = x(t, !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]); - return e = function(t) { - try { - return function(t) { - try { - if (!v.get().streaming.cmsd.enabled || !v.get().streaming.cmsd.abr.applyMb) - return t; - const e = t.filter((t => { - const e = t.mediaInfo.type; - let n = p.getMaxBitrate(e); - if (e !== w.A.VIDEO || n < 0) - return !0; - const a = t.mediaInfo.streamInfo.id; - return n -= s[a][w.A.AUDIO].getRepresentation().bitrateInKbit || 0, - t.bitrateInKbit <= n - } - )); - return e.length > 0 ? e : t - } catch (e) { - return r.error(e), - t - } - }(t = function(t) { - try { - if (!v.get().streaming.abr.limitBitrateByPortal) - return t; - const {elementWidth: e} = g.getVideoElementSize() - , n = t.filter((t => t.mediaInfo.type !== w.A.VIDEO || t.width <= e)); - return n.length > 0 ? n : t - } catch (e) { - return r.error(e), - t - } - }(t = function(t) { - try { - const e = t.filter((t => { - const e = t.mediaInfo.type - , n = t.bitrateInKbit - , a = m.getAbrBitrateParameter("maxBitrate", e) - , r = m.getAbrBitrateParameter("minBitrate", e); - return !(a > -1 && n > a || r > -1 && n < r) - } - )); - return e.length > 0 ? e : t - } catch (e) { - return r.error(e), - t - } - }(t))) - } catch (e) { - return r.error(e), - t - } - }(e), - e - } - function x(t, e) { - let n = []; - if (!t) - return n; - const a = function(t) { - try { - const e = []; - if (t && e.push(t), - !v.get().streaming.abr.enableSupplementalPropertyAdaptationSetSwitching || !t.adaptationSetSwitchingCompatibleIds || 0 === t.adaptationSetSwitchingCompatibleIds.length) - return e; - const n = s[t.streamInfo.id][t.type].getAllMediaInfos().filter((e => t.adaptationSetSwitchingCompatibleIds.includes(e.id))); - return e.concat(n) - } catch (e) { - return [t] - } - }(t); - return a.forEach((t => { - let e = f.getVoRepresentations(t); - e && e.length > 0 && (n = n.concat(e)) - } - )), - n = function(t) { - return t = function(t) { - let e = null; - return t.filter((t => (e || (e = t.mediaInfo), - !isNaN(t.qualityRanking) && f.areMediaInfosEqual(e, t.mediaInfo)))).length === t.length - }(t) ? function(t) { - return t.sort(( (t, e) => e.qualityRanking - t.qualityRanking)), - t - }(t) : function(t) { - return t.sort(( (t, e) => f.areMediaInfosEqual(t.mediaInfo, e.mediaInfo) ? isNaN(t.pixelsPerSecond) || isNaN(e.pixelsPerSecond) || t.pixelsPerSecond === e.pixelsPerSecond ? t.bandwidth - e.bandwidth : t.pixelsPerSecond - e.pixelsPerSecond : isNaN(t.pixelsPerSecond) || isNaN(e.pixelsPerSecond) || t.pixelsPerSecond === e.pixelsPerSecond ? isNaN(t.bitsPerPixel) || isNaN(e.bitsPerPixel) ? t.bandwidth - e.bandwidth : e.bitsPerPixel - t.bitsPerPixel : t.pixelsPerSecond - e.pixelsPerSecond)), - t - }(t) - }(n), - n.forEach(( (t, e) => { - t.absoluteIndex = e - } - )), - n = n.filter((n => { - const a = !!e || f.areMediaInfosEqual(n.mediaInfo, t) - , r = !n || !n.mediaInfo || l.areKeyIdsUsable(n.mediaInfo); - return a && r - } - )), - n - } - function M(e) { - const n = e.request.mediaType - , r = e.streamId; - if (!(n && r && s[r] && v.get().streaming.abr.autoSwitchBitrate[n])) - return; - const l = s[r][n]; - if (!l) - return; - const d = ao(t).create({ - abrController: a, - streamProcessor: l, - currentRequest: e.request, - throughputController: A, - adapter: f, - videoModel: g - }) - , m = i.shouldAbandonFragment(d); - m && m.representation !== Ai.NO_CHANGE && function(t, e, n, a, r) { - if (a.getFragmentModel().getRequests({ - state: q.FRAGMENT_MODEL_LOADING, - index: t.request.index - })[0]) { - const t = function(t, e) { - return u[t] && u[t][e] ? u[t][e] : null - }(e, n); - t && (t.state = I.ABANDON_LOAD), - E.reset(), - L(n, o.getActiveStreamInfo(), r.representation, r.reason), - clearTimeout(c), - c = setTimeout(( () => { - t && (u[e][n].state = I.ALLOW_LOAD), - c = null - } - ), v.get().streaming.abandonLoadTimeout) - } - }(e, r, n, l, m) - } - function z(t) { - t.mediaType === w.A.VIDEO && (void 0 !== y && _.push(t.streamId, y, g.getPlaybackQuality()), - y = t.newRepresentation.id) - } - function O(t) { - !F() || t.metric !== I.BUFFER_LEVEL || t.mediaType !== w.A.AUDIO && t.mediaType !== w.A.VIDEO || function(t, e) { - try { - const n = m.getBufferTimeDefault() - , a = n - , o = .5 * n - , l = i.getBolaState(t) - , s = e >= (l ? o : a); - i.setBolaState(t, s), - s !== l && (s ? r.info("[" + t + "] switching from throughput to buffer occupancy ABR rule (buffer: " + e.toFixed(3) + ").") : r.info("[" + t + "] switching from buffer occupancy to throughput ABR rule (buffer: " + e.toFixed(3) + ").")) - } catch (t) { - r.error(t) - } - }(t.mediaType, .001 * t.value.level) - } - function L(t, e, n) { - let a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}; - if (!(e && e.id && t && s && s[e.id] && s[e.id][t] && n)) - return; - const r = s[e.id][t].getRepresentation(); - r && n.id === r.id || P(r, n, a) - } - function P(t, e, a) { - const i = e.mediaInfo.streamInfo.id - , o = e.mediaInfo.type; - if (o && s[i] && s[i][o]) { - const l = s[i][o].getStreamInfo() - , u = T.getCurrentBufferLevel(o) - , c = null !== t && !f.areMediaInfosEqual(t.mediaInfo, e.mediaInfo) - , d = t ? t.bitrateInKbit : 0; - r.info(`[AbrController]: Switching quality in period ${i} for media type ${o}. Switch from bitrate ${d} to bitrate ${e.bitrateInKbit}. Current buffer level: ${u}. Reason:` + (a ? JSON.stringify(a) : "/")), - n.trigger(R.A.QUALITY_CHANGE_REQUESTED, { - oldRepresentation: t, - newRepresentation: e, - reason: a, - streamInfo: l, - mediaType: o, - isAdaptationSetSwitch: c - }, { - streamId: l.id, - mediaType: o - }); - const g = A.getAverageThroughput(o); - isNaN(g) || b.setSavedBitrateSettings(o, g) - } - } - function F() { - return v.get().streaming.abr.rules.bolaRule.active && v.get().streaming.abr.rules.throughputRule.active - } - return a = { - checkPlaybackQuality: function(e, n) { - try { - if (!(e && s && s[n] && s[n][e])) - return !1; - if (_) { - const t = g.getPlaybackQuality(); - t && _.push(n, y, t) - } - if (!v.get().streaming.abr.autoSwitchBitrate[e]) - return !1; - const r = s[n][e] - , o = r.getRepresentation() - , l = ao(t).create({ - abrController: a, - throughputController: A, - switchRequestHistory: E, - droppedFramesHistory: _, - streamProcessor: r, - adapter: f, - videoModel: g - }) - , c = i.getBestPossibleSwitchRequest(l); - if (!c || !c.representation) - return !1; - let d = c.representation; - return E.push({ - currentRepresentation: o, - newRepresentation: d - }), - d.id !== o.id && (u[n][e].state === I.ALLOW_LOAD || d.absoluteIndex < o.absoluteIndex) && (P(o, d, c.reason), - !0) - } catch (t) { - return r.error(t), - !1 - } - }, - clearDataForStream: function(t) { - _ && _.clearForStream(t), - s[t] && delete s[t], - E && E.clearForStream(t), - u[t] && delete u[t], - i.clearDataForStream(t) - }, - getAbandonmentStateFor: function(t, e) { - return u[t] && u[t][e] ? u[t][e].state : null - }, - getInitialBitrateFor: function(t) { - if (t === w.A.TEXT) - return NaN; - let e = m.getAbrBitrateParameter("initialBitrate", t); - if (e > 0) - return e; - let n = NaN; - if (b && b.hasOwnProperty("getSavedBitrateSettings") && (n = b.getSavedBitrateSettings(t)), - !isNaN(n)) - return n; - const a = A.getAverageThroughput(t); - return !isNaN(a) && a > 0 ? a : t === w.A.VIDEO ? 1e3 : 100 - }, - getOptimalRepresentationForBitrate: function(t, e) { - const n = N(t, !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2]); - if (!n || 0 === n.length) - return null; - const a = n.reduce(( (t, e) => t.bandwidth < e.bandwidth ? t : e)); - if (e <= 0) - return a; - const r = n.filter((t => t.bitrateInKbit <= e)); - return r && 0 !== r.length ? r.reduce(( (t, e) => e.absoluteIndex > t.absoluteIndex ? e : t)) : a - }, - getPossibleVoRepresentations: function(t) { - return x(t, !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]) - }, - getPossibleVoRepresentationsFilteredBySettings: N, - getRepresentationByAbsoluteIndex: function(t, e) { - let n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2]; - return isNaN(t) || t < 0 ? null : N(e, n).find((e => e.absoluteIndex === t)) - }, - handleNewMediaInfo: function(t) { - i.handleNewMediaInfo(t) - }, - initialize: function() { - _ = lo(t).create(), - E = io(t).create(), - i = eo(t).create({ - dashMetrics: T, - customParametersModel: h, - mediaPlayerModel: m, - settings: v - }), - i.initialize(), - n.on(D.A.QUALITY_CHANGE_RENDERED, z, a), - n.on(D.A.METRIC_ADDED, O, a), - n.on(R.A.LOADING_PROGRESS, M, a) - }, - isPlayingAtLowestQuality: function(t) { - return N(t.mediaInfo, !0)[0].id === t.id - }, - isPlayingAtTopQuality: function(t) { - if (!t) - return !0; - const e = N(t.mediaInfo, !0); - return e[e.length - 1].id === t.id - }, - registerStreamType: function(t, e) { - const n = e.getStreamInfo().id; - s[n] || (s[n] = {}), - s[n][t] = e, - u[n] || (u[n] = {}), - u[n][t] = {}, - u[n][t].state = I.ALLOW_LOAD, - void 0 === i.getBolaState(t) && i.setBolaState(t, v.get().streaming.abr.rules.bolaRule.active && !F()) - }, - reset: function() { - S(), - n.off(D.A.QUALITY_CHANGE_RENDERED, z, a), - n.off(D.A.METRIC_ADDED, O, a), - n.off(R.A.LOADING_PROGRESS, M, a), - i && i.reset() - }, - setConfig: function(t) { - t && (t.streamController && (o = t.streamController), - t.throughputController && (A = t.throughputController), - t.domStorage && (b = t.domStorage), - t.mediaPlayerModel && (m = t.mediaPlayerModel), - t.customParametersModel && (h = t.customParametersModel), - t.cmsdModel && (p = t.cmsdModel), - t.dashMetrics && (T = t.dashMetrics), - t.adapter && (f = t.adapter), - t.videoModel && (g = t.videoModel), - t.settings && (v = t.settings), - t.capabilities && (l = t.capabilities)) - }, - setPlaybackQuality: L, - setWindowResizeEventCalled: function(t) { - d = t - }, - unRegisterStreamType: function(t, e) { - try { - s[t] && s[t][e] && delete s[t][e], - u[t] && u[t][e] && delete u[t][e] - } catch (t) {} - } - }, - r = e.getLogger(a), - S(), - a - } - so.__dashjs_factory_name = "AbrController"; - const uo = N.A.getSingletonFactory(so); - N.A.updateSingletonFactory(so.__dashjs_factory_name, uo); - var co = uo; - const fo = new Map([[w.A.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA, "loadedmetadata"], [w.A.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA, "loadeddata"], [w.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA, "canplay"], [w.A.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA, "canplaythrough"]]); - function go() { - let t, e, n, a, r, i, o, l, s, u, c; - const d = this.context - , f = (0, - k.A)(d).getInstance() - , g = []; - function m(t) { - a && (arguments.length > 1 && void 0 !== arguments[1] && arguments[1] ? a.playbackRate = t : I(w.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA, ( () => { - a.playbackRate = t - } - ))) - } - function h() { - return g.length > 0 - } - function p(t) { - let e = g.indexOf(t); - if (null !== t && (-1 !== e && g.splice(e, 1), - n.get().streaming.buffer.syntheticStallEvents.enabled && a && !h())) { - const t = () => { - if (m(u || 1, n.get().streaming.buffer.syntheticStallEvents.ignoreReadyState), - !a.paused) { - const t = document.createEvent("Event"); - t.initEvent("playing", !0, !1), - a.dispatchEvent(t) - } - } - ; - n.get().streaming.buffer.syntheticStallEvents.ignoreReadyState ? t() : (o && o.func && o.event && E(o.event, o.func), - o = I(w.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA, t)) - } - } - function b() { - if (a && h() && 0 === a.playbackRate) { - const t = document.createEvent("Event"); - t.initEvent("waiting", !0, !1), - a.dispatchEvent(t) - } - } - function y(t, e) { - a && a.addEventListener(t, e) - } - function E(t, e) { - a && a.removeEventListener(t, e) - } - function _() { - return a ? a.readyState : NaN - } - function A() { - return a ? a.buffered : null - } - function T() { - return a ? a.clientWidth : NaN - } - function v() { - return a ? a.clientHeight : NaN - } - function S(t, e, n, r, i) { - if (a) - for (let o = 0; o < a.textTracks.length; o++) - if (a.textTracks[o].kind === t && (!e || a.textTracks[o].label == e) && a.textTracks[o].language === n && a.textTracks[o].isTTML === r && a.textTracks[o].isEmbedded === i) - return a.textTracks[o]; - return null - } - function I(t, e) { - return t === w.A.VIDEO_ELEMENT_READY_STATES.HAVE_NOTHING || _() >= t ? (e(), - null) : function(t, e) { - const n = () => { - E(t, n), - e(t) - } - ; - return y(t, n), - { - func: n, - event: t - } - }(fo.get(t), e) - } - return t = { - addEventListener: y, - addTextTrack: function(t, e, n, r, i) { - if (!a) - return null; - let o = S(t, e, n, r, i); - return o || (o = a.addTextTrack(t, e, n), - o.isEmbedded = i, - o.isTTML = r), - o - }, - appendChild: function(t) { - a && (a.appendChild(t), - void 0 !== t.isTTML && (a.textTracks[a.textTracks.length - 1].isTTML = t.isTTML, - a.textTracks[a.textTracks.length - 1].isEmbedded = t.isEmbedded)) - }, - getBufferRange: A, - getClientHeight: v, - getClientWidth: T, - getElement: function() { - return a - }, - getEnded: function() { - return a ? a.ended : null - }, - getPlaybackQuality: function() { - if (!a) - return null; - let t = "webkitDroppedFrameCount"in a && "webkitDecodedFrameCount"in a - , e = null; - return "getVideoPlaybackQuality"in a ? e = a.getVideoPlaybackQuality() : t && (e = { - droppedVideoFrames: a.webkitDroppedFrameCount, - totalVideoFrames: a.webkitDroppedFrameCount + a.webkitDecodedFrameCount, - creationTime: new Date - }), - e - }, - getPlaybackRate: function() { - return a ? a.playbackRate : null - }, - getPlayedRanges: function() { - return a ? a.played : null - }, - getReadyState: _, - getSource: function() { - return a ? a.src : null - }, - getTTMLRenderingDiv: function() { - return l - }, - getTextTrack: S, - getTextTracks: function() { - return a ? a.textTracks : [] - }, - getTime: function() { - return a ? isNaN(r) ? a.currentTime : r : null - }, - getVideoElementSize: function() { - const t = n.get().streaming.abr.usePixelRatioInLimitBitrateByPortal && window.hasOwnProperty("devicePixelRatio") ? window.devicePixelRatio : 1; - return { - elementWidth: T() * t, - elementHeight: v() * t - } - }, - getVideoHeight: function() { - return a ? a.videoHeight : NaN - }, - getVideoRelativeOffsetLeft: function() { - if (a) { - const t = a.parentNode.host || a.parentNode; - return t ? a.getBoundingClientRect().left - t.getBoundingClientRect().left : NaN - } - return NaN - }, - getVideoRelativeOffsetTop: function() { - if (a) { - const t = a.parentNode.host || a.parentNode; - return t ? a.getBoundingClientRect().top - t.getBoundingClientRect().top : NaN - } - return NaN - }, - getVideoWidth: function() { - return a ? a.videoWidth : NaN - }, - getVttRenderingDiv: function() { - return s - }, - initialize: function() { - f.on(R.A.PLAYBACK_PLAYING, b, this) - }, - isPaused: function() { - return a ? a.paused : null - }, - isSeeking: function() { - return a ? a.seeking || !isNaN(r) : null - }, - isStalled: h, - pause: function() { - a && (a.pause(), - a.autoplay = !1) - }, - play: function() { - if (a) { - a.autoplay = !0; - const t = a.play(); - t && t.catch && "undefined" != typeof Promise && t.catch((t => { - "NotAllowedError" === t.name && f.trigger(R.A.PLAYBACK_NOT_ALLOWED), - e.warn(`Caught pending play exception - continuing (${t})`) - } - )) - } - }, - removeChild: function(t) { - a && a.removeChild(t) - }, - removeEventListener: E, - reset: function() { - clearTimeout(c), - f.off(R.A.PLAYBACK_PLAYING, b, this), - g.length = 0 - }, - setConfig: function(t) { - t && t.settings && (n = t.settings) - }, - setCurrentTime: function(t, e) { - a && (i && i.func && i.event && E(i.event, i.func), - r = t, - i = I(w.A.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA, ( () => { - if (a) - if (a.currentTime !== r) - try { - r = e ? function(t) { - const e = A(); - let n = t - , a = 9999999999; - if (e) - for (let r = 0; r < e.length; r++) { - const i = e.start(r) - , o = e.end(r) - , l = Math.abs(i - t) - , s = Math.abs(o - t); - if (t >= i && t <= o) - return t; - l < a && (a = l, - n = i), - s < a && (a = s, - n = o) - } - return n - }(r) : r, - isNaN(r) || (a.currentTime = r), - r = NaN - } catch (t) { - 0 === a.readyState && t.code === t.INVALID_STATE_ERR && (c = setTimeout((function() { - a.currentTime = r, - r = NaN - } - ), 400)) - } - else - r = NaN - } - ))) - }, - setDisableRemotePlayback: function(t) { - a && (a.disableRemotePlayback = t) - }, - setElement: function(t) { - if (!(null == t || t && /^(VIDEO|AUDIO)$/i.test(t.nodeName))) - throw "element is not video or audio DOM type!"; - a = t, - a && (a.preload = "auto") - }, - setPlaybackRate: m, - setSource: function(t) { - a && (t ? a.src = t : (a.removeAttribute("src"), - a.load())) - }, - setStallState: function(t, e) { - !function(t, e) { - e ? function(t) { - if (null !== t && a && !a.seeking && -1 === g.indexOf(t) && (g.push(t), - n.get().streaming.buffer.syntheticStallEvents.enabled && a && 1 === g.length && (n.get().streaming.buffer.syntheticStallEvents.ignoreReadyState || _() >= w.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA))) { - u = a.playbackRate, - m(0, !0); - const t = document.createEvent("Event"); - t.initEvent("waiting", !0, !1), - a.dispatchEvent(t) - } - }(t) : p(t) - }(t, e) - }, - setTTMLRenderingDiv: function(t) { - l = t, - l.style.position = "absolute", - l.style.display = "flex", - l.style.overflow = "hidden", - l.style.pointerEvents = "none", - l.style.top = 0, - l.style.left = 0 - }, - setVttRenderingDiv: function(t) { - s = t - }, - waitForReadyState: I - }, - e = (0, - C.A)(d).getInstance().getLogger(t), - n = (0, - K.A)(d).getInstance(), - r = NaN, - t - } - go.__dashjs_factory_name = "VideoModel"; - var mo = N.A.getSingletonFactory(go); - const ho = [{ - oldKey: "dashjs_vbitrate", - newKey: "dashjs_video_bitrate" - }, { - oldKey: "dashjs_abitrate", - newKey: "dashjs_audio_bitrate" - }, { - oldKey: "dashjs_vsettings", - newKey: "dashjs_video_settings" - }, { - oldKey: "dashjs_asettings", - newKey: "dashjs_audio_settings" - }] - , po = "dashjs_?_bitrate" - , bo = "dashjs_?_settings" - , yo = "localStorage" - , Eo = "lastBitrate" - , _o = "lastMediaSettings"; - function Ao(t) { - t = t || {}; - const e = this.context - , n = t.settings; - let a, r, i; - function o(t) { - if (void 0 !== i) - return i; - let e; - i = !1; - try { - "undefined" != typeof window && (e = window[t]) - } catch (t) { - return r.warn("DOMStorage access denied: " + t.message), - i - } - if (!e || t !== yo && "sessionStorage" !== t) - return i; - try { - e.setItem("1", "1"), - e.removeItem("1"), - i = !0 - } catch (t) { - r.warn("DOMStorage is supported, but cannot be used: " + t.message) - } - return i - } - function l() { - const t = 6e5; - return Math.round((new Date).getTime() / t) * t - } - function s(t, e) { - return o(t) && n.get().streaming[e + "CachingInfo"].enabled - } - function u() { - if (!n) - throw new Error(w.A.MISSING_CONFIG_ERROR) - } - return a = { - getSavedBitrateSettings: function(t) { - if (u(), - !n.get().streaming.lastBitrateCachingInfo.enabled) - return NaN; - let e = NaN; - if (s(yo, Eo)) { - const a = po.replace(/\?/, t); - try { - const i = JSON.parse(localStorage.getItem(a)) || {} - , o = (new Date).getTime() - parseInt(i.timestamp, 10) >= n.get().streaming.lastBitrateCachingInfo.ttl || !1 - , l = parseFloat(i.bitrate); - isNaN(l) || o ? o && localStorage.removeItem(a) : (e = l, - r.debug("Last saved bitrate for " + t + " was " + l)) - } catch (t) { - return null - } - } - return e - }, - setSavedBitrateSettings: function(t, e) { - if (s(yo, Eo) && e) { - const n = po.replace(/\?/, t); - try { - localStorage.setItem(n, JSON.stringify({ - bitrate: e.toFixed(3), - timestamp: l() - })) - } catch (t) { - r.error(t.message) - } - } - }, - getSavedMediaSettings: function(t) { - if (u(), - !n.get().streaming.lastMediaSettingsCachingInfo.enabled) - return null; - let e = null; - if (s(yo, _o)) { - const a = bo.replace(/\?/, t); - try { - const t = JSON.parse(localStorage.getItem(a)) || {} - , r = (new Date).getTime() - parseInt(t.timestamp, 10) >= n.get().streaming.lastMediaSettingsCachingInfo.ttl || !1; - e = t.settings, - r && (localStorage.removeItem(a), - e = null) - } catch (t) { - return null - } - } - return e - }, - setSavedMediaSettings: function(t, e) { - if (s(yo, _o)) { - const n = bo.replace(/\?/, t); - try { - localStorage.setItem(n, JSON.stringify({ - settings: e, - timestamp: l() - })) - } catch (t) { - r.error(t.message) - } - } - } - }, - r = (0, - C.A)(e).getInstance().getLogger(a), - o(yo) && ho.forEach((t => { - const e = localStorage.getItem(t.oldKey); - if (e) { - localStorage.removeItem(t.oldKey); - try { - localStorage.setItem(t.newKey, e) - } catch (t) { - r.error(t.message) - } - } - } - )), - a - } - Ao.__dashjs_factory_name = "DOMStorage"; - var To = N.A.getSingletonFactory(Ao) - , vo = n(8986); - function wo() { - const t = this.context; - let e, n, a, r, i, o, l, s, u, c, d, f; - function g(t, e, a, i) { - let o = null; - const s = t ? f.resolve(t.path) : null - , u = i || { - init: !0, - url: s ? s.url : void 0, - range: { - start: 0, - end: 1500 - }, - searching: !1, - bytesLoaded: 0, - bytesToLoad: 1500, - mediaType: e, - representation: t - }; - n.debug("Start searching for initialization."); - const c = p(u); - l.load({ - request: c, - success: function(n) { - if (u.bytesLoaded = u.range.end, - o = r.findInitRange(n), - !o) - return u.range.end = u.bytesLoaded + u.bytesToLoad, - g(t, e, a, u); - t.range = o, - a(t) - }, - error: function() { - a(t) - } - }), - n.debug("Perform init search: " + u.url) - } - function m(t, e, a, i, o, s) { - if (a && (void 0 === a.start || void 0 === a.end)) { - const t = a ? a.toString().split("-") : null; - a = t ? { - start: parseFloat(t[0]), - end: parseFloat(t[1]) - } : null - } - o = o || h; - let u = null - , c = null; - const d = !!a - , g = t ? f.resolve(t.path) : null - , b = { - init: !1, - url: g ? g.url : void 0, - range: d ? a : { - start: 0, - end: 1500 - }, - searching: !d, - bytesLoaded: s ? s.bytesLoaded : 0, - bytesToLoad: 1500, - mediaType: e, - representation: t - } - , y = p(b); - l.load({ - request: y, - success: function(a) { - const l = b.bytesToLoad - , s = a.byteLength; - if (b.bytesLoaded = b.range.end - b.range.start, - u = r.parse(a), - c = u.getBox("sidx"), - c && c.isComplete) { - const a = c.references; - let r, l; - if (null != a && a.length > 0 && (r = 1 === a[0].reference_type), - r) { - let r, l, s, u, d; - n.debug("Initiate multiple SIDX load."), - b.range.end = b.range.start + c.size; - let f = [] - , g = 0 - , h = (c.offset || b.range.start) + c.size; - const p = function(e) { - e ? (f = f.concat(e), - g++, - g >= l && (f.sort((function(t, e) { - return t.startTime - e.startTime < 0 ? -1 : 0 - } - )), - o(f, t, i))) : o(null, t, i) - }; - for (r = 0, - l = a.length; r < l; r++) - s = h, - u = h + a[r].referenced_size - 1, - h += a[r].referenced_size, - d = { - start: s, - end: u - }, - m(t, e, d, i, p, b) - } else - n.debug("Parsing segments from SIDX. representation " + e + " - id: " + t.id + " for range : " + b.range.start + " - " + b.range.end), - l = function(t, e) { - const n = t.references - , a = n.length - , r = t.timescale; - let i = t.earliest_presentation_time - , o = e.range.start + t.offset + t.first_offset + t.size; - const l = []; - let s, u, c, d; - for (let t = 0; t < a; t++) - c = n[t].subsegment_duration, - d = n[t].referenced_size, - s = new ct, - s.duration = c, - s.startTime = i, - s.timescale = r, - u = o + d - 1, - s.mediaRange = o + "-" + u, - l.push(s), - i += c, - o += d; - return l - }(c, b), - o(l, t, i) - } else { - if (c) - b.range.start = c.offset || b.range.start, - b.range.end = b.range.start + (c.size || l); - else { - if (s < b.bytesLoaded) - return void o(null, t, i); - { - const t = u.getLastBox(); - t && t.size ? (b.range.start = t.offset + t.size, - b.range.end = b.range.start + l) : b.range.end += l - } - } - m(t, e, b.range, i, null, b) - } - }, - error: function() { - o(null, t, i) - } - }), - n.debug(`Perform SIDX load for type ${e} : ${b.url} with range ${b.range.start} - ${b.range.end}`) - } - function h(t, e, n) { - n({ - segments: t, - representation: e, - error: t ? void 0 : new G.A(s.SEGMENT_BASE_LOADER_ERROR_CODE,s.SEGMENT_BASE_LOADER_ERROR_MESSAGE) - }) - } - function p(t) { - if (!t.url) - return; - const e = new L; - return e.setInfo(t), - e - } - return e = { - setConfig: function(t) { - t.baseURLController && (f = t.baseURLController), - t.dashMetrics && (i = t.dashMetrics), - t.mediaPlayerModel && (o = t.mediaPlayerModel), - t.errHandler && (a = t.errHandler), - t.boxParser && (r = t.boxParser), - t.debug && (n = t.debug.getLogger(e)), - t.errors && (s = t.errors), - t.urlUtils && (d = t.urlUtils), - t.constants && (u = t.constants), - t.dashConstants && (c = t.dashConstants) - }, - initialize: function() { - l = Bn(t).create({ - errHandler: a, - dashMetrics: i, - mediaPlayerModel: o, - boxParser: r, - errors: s, - urlUtils: d, - constants: u, - dashConstants: c - }) - }, - loadInitialization: function(t, e) { - return new Promise((n => { - g(t, e, n) - } - )) - }, - loadSegments: function(t, e, n) { - return new Promise((a => { - m(t, e, n, a) - } - )) - }, - reset: function() { - l && (l.abort(), - l = null) - } - }, - e - } - wo.__dashjs_factory_name = "SegmentBaseLoader"; - var So = N.A.getSingletonFactory(wo); - function Io(t) { - let e; - t = t || {}; - let n = new DataView(t.data) - , a = 0; - function r(t, e) { - let r, i, o = !0, l = 0; - if (void 0 === e && (e = !1), - t.tag > 16777215 ? (n.getUint32(a) !== t.tag && (o = !1), - l = 4) : t.tag > 65535 ? (r = n.getUint16(a), - i = n.getUint8(a + 2), - 256 * r + i !== t.tag && (o = !1), - l = 3) : t.tag > 255 ? (n.getUint16(a) !== t.tag && (o = !1), - l = 2) : (n.getUint8(a) !== t.tag && (o = !1), - l = 1), - !o && t.required && !e) - throw new Error("required tag not found"); - return o && (a += l), - o - } - function i(t) { - let e = 1 - , r = 128 - , i = -1 - , o = 0 - , l = n.getUint8(a) - , s = 0; - for (s = 0; s < 8; s += 1) { - if ((l & r) === r) { - o = void 0 === t ? l & ~r : l, - i = s; - break - } - r >>= 1 - } - for (s = 0; s < i; s += 1, - e += 1) - o = o << 8 | 255 & n.getUint8(a + e); - return a += e, - o - } - return e = { - getPos: function() { - return a - }, - setPos: function(t) { - a = t - }, - consumeTag: r, - consumeTagAndSize: function(t, e) { - let n = r(t, e); - return n && i(), - n - }, - parseTag: function(t) { - let n; - return r(t), - n = i(), - e[t.parse](n) - }, - skipOverElement: function(t, e) { - let n, o = r(t, e); - return o && (n = i(), - a += n), - o - }, - getMatroskaCodedNum: i, - getMatroskaFloat: function(t) { - let e; - switch (t) { - case 4: - e = n.getFloat32(a), - a += 4; - break; - case 8: - e = n.getFloat64(a), - a += 8 - } - return e - }, - getMatroskaUint: function(t) { - if (t > 4) - return function(t) { - const e = Math.floor(Number.MAX_SAFE_INTEGER / 256); - let r = 0; - for (let i = 0; i < t; i += 1) { - if (r > e) - throw new Error("Value exceeds safe integer limit"); - r *= 256; - const t = n.getUint8(a + i); - if (r > Number.MAX_SAFE_INTEGER - t) - throw new Error("Value exceeds safe integer limit"); - r += t - } - return a += t, - r - }(t); - let e = 0; - for (let r = 0; r < t; r += 1) - e <<= 8, - e |= 255 & n.getUint8(a + r); - return a += t, - e >>> 0 - }, - moreData: function() { - return a < n.byteLength - } - }, - e - } - Io.__dashjs_factory_name = "EBMLParser"; - var ko = N.A.getClassFactory(Io); - function Ro() { - const t = this.context; - let e, n, a, r, i, o, l, s, u; - function c(t) { - const e = new L; - return e.setInfo(t), - e - } - return e = { - setConfig: function(t) { - if (!(t.baseURLController && t.dashMetrics && t.mediaPlayerModel && t.errHandler)) - throw new Error(w.A.MISSING_CONFIG_ERROR); - u = t.baseURLController, - i = t.dashMetrics, - o = t.mediaPlayerModel, - r = t.errHandler, - s = t.errors, - n = t.debug.getLogger(e) - }, - initialize: function() { - l = Bn(t).create({ - errHandler: r, - dashMetrics: i, - mediaPlayerModel: o, - errors: s - }) - }, - loadInitialization: function(t, e) { - return new Promise((a => { - let r = null - , i = t ? u.resolve(t.path) : null - , o = t ? t.range.split("-") : null - , s = { - range: { - start: o ? parseFloat(o[0]) : null, - end: o ? parseFloat(o[1]) : null - }, - request: r, - url: i ? i.url : void 0, - init: !0, - mediaType: e - }; - n.info("Start loading initialization."), - r = c(s), - l.load({ - request: r, - success: function() { - a(t) - }, - error: function() { - a(t) - } - }), - n.debug("Perform init load: " + s.url) - } - )) - }, - loadSegments: function(e, r, i) { - return new Promise((o => { - let d = null - , f = e ? u.resolve(e.path) : null - , g = f ? f.url : void 0; - d = c({ - bytesLoaded: 0, - bytesToLoad: 8192, - range: { - start: 0, - end: 8192 - }, - request: d, - url: g, - init: !1, - mediaType: r, - representation: e - }), - n.debug("Parsing ebml header"), - l.load({ - request: d, - success: function(r) { - !function(e, r, i, o) { - if (!e || 0 === e.byteLength) - return void o(null); - let s, u, d, f, g = ko(t).create({ - data: e - }), m = i ? i.split("-") : null, h = null, p = { - url: r, - range: { - start: m ? parseFloat(m[0]) : null, - end: m ? parseFloat(m[1]) : null - }, - request: h - }; - for (n.debug("Parse EBML header: " + p.url), - g.skipOverElement(a.EBML), - g.consumeTag(a.Segment), - d = g.getMatroskaCodedNum(), - d += g.getPos(), - f = g.getPos(); g.moreData() && !g.consumeTagAndSize(a.Segment.Info, !0); ) - if (!(g.skipOverElement(a.Segment.SeekHead, !0) || g.skipOverElement(a.Segment.Tracks, !0) || g.skipOverElement(a.Segment.Cues, !0) || g.skipOverElement(a.Void, !0))) - throw new Error("no valid top level element found"); - for (; void 0 === s; ) { - let t = g.getMatroskaCodedNum(!0) - , e = g.getMatroskaCodedNum(); - t === a.Segment.Info.Duration.tag ? s = g[a.Segment.Info.Duration.parse](e) : g.setPos(g.getPos() + e) - } - h = c(p), - l.load({ - request: h, - success: function(e) { - u = function(e, r, i, o) { - let l, s, u, c, d, f, g, m; - for (s = function(e) { - let n, r, i = [], o = ko(t).create({ - data: e - }); - for (o.consumeTagAndSize(a.Segment.Cues); o.moreData() && o.consumeTagAndSize(a.Segment.Cues.CuePoint, !0); ) { - for (n = {}, - n.CueTime = o.parseTag(a.Segment.Cues.CuePoint.CueTime), - n.CueTracks = []; o.moreData() && o.consumeTag(a.Segment.Cues.CuePoint.CueTrackPositions, !0); ) { - const t = o.getMatroskaCodedNum() - , e = o.getPos(); - if (r = {}, - r.Track = o.parseTag(a.Segment.Cues.CuePoint.CueTrackPositions.CueTrack), - 0 === r.Track) - throw new Error("Cue track cannot be 0"); - r.ClusterPosition = o.parseTag(a.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition), - n.CueTracks.push(r), - o.setPos(e + t) - } - if (0 === n.CueTracks.length) - throw new Error("Mandatory cuetrack not found"); - i.push(n) - } - if (0 === i.length) - throw new Error("mandatory cuepoint not found"); - return i - }(e), - u = [], - d = 0, - f = s.length; d < f; d += 1) - c = new ct, - l = 0, - l = d < s.length - 1 ? s[d + 1].CueTime - s[d].CueTime : o - s[d].CueTime, - c.duration = l, - c.startTime = s[d].CueTime, - c.timescale = 1e3, - g = s[d].CueTracks[0].ClusterPosition + r, - m = d < s.length - 1 ? s[d + 1].CueTracks[0].ClusterPosition + r - 1 : i - 1, - c.mediaRange = g + "-" + m, - u.push(c); - return n.debug("Parsed cues: " + u.length + " cues."), - u - }(e, f, d, s), - o(u) - }, - error: function() { - n.error("Download Error: Cues " + p.url), - o(null) - } - }), - n.debug("Perform cues load: " + p.url + " bytes=" + p.range.start + "-" + p.range.end) - }(r, g, i, (function(t) { - o({ - segments: t, - representation: e, - error: t ? void 0 : new G.A(s.SEGMENT_BASE_LOADER_ERROR_CODE,s.SEGMENT_BASE_LOADER_ERROR_MESSAGE) - }) - } - )) - }, - error: function() { - o({ - representation: e, - error: new G.A(s.SEGMENT_BASE_LOADER_ERROR_CODE,s.SEGMENT_BASE_LOADER_ERROR_MESSAGE) - }) - } - }) - } - )) - }, - reset: function() { - l && (l.abort(), - l = null) - } - }, - a = { - EBML: { - tag: 440786851, - required: !0 - }, - Segment: { - tag: 408125543, - required: !0, - SeekHead: { - tag: 290298740, - required: !0 - }, - Info: { - tag: 357149030, - required: !0, - TimecodeScale: { - tag: 2807729, - required: !0, - parse: "getMatroskaUint" - }, - Duration: { - tag: 17545, - required: !0, - parse: "getMatroskaFloat" - } - }, - Tracks: { - tag: 374648427, - required: !0 - }, - Cues: { - tag: 475249515, - required: !0, - CuePoint: { - tag: 187, - required: !0, - CueTime: { - tag: 179, - required: !0, - parse: "getMatroskaUint" - }, - CueTrackPositions: { - tag: 183, - required: !0, - CueTrack: { - tag: 247, - required: !0, - parse: "getMatroskaUint" - }, - CueClusterPosition: { - tag: 241, - required: !0, - parse: "getMatroskaUint" - } - } - } - } - }, - Void: { - tag: 236, - required: !0 - } - }, - e - } - Ro.__dashjs_factory_name = "WebmSegmentBaseLoader"; - var No = N.A.getSingletonFactory(Ro); - function Co(t) { - t = t || {}; - const e = this.context - , n = t.eventBus - , a = t.events - , r = t.dashMetrics - , i = t.mediaPlayerModel - , o = t.errHandler - , l = t.baseURLController - , s = t.debug - , u = t.boxParser - , c = t.errors; - let d, f, g; - function m(t) { - return "webm" === (t ? t.split("/")[1] : "").toLowerCase() - } - return d = { - initialize: function() { - f.initialize(), - g.initialize() - }, - getSegmentBaseInitSegment: function(t) { - return m(t.representation.mimeType) ? g.loadInitialization(t.representation, t.mediaType) : f.loadInitialization(t.representation, t.mediaType) - }, - getSegmentList: function(t) { - return m(t.mimeType) ? g.loadSegments(t.representation, t.mediaType, t.representation ? t.representation.indexRange : null) : f.loadSegments(t.representation, t.mediaType, t.representation ? t.representation.indexRange : null) - }, - reset: function() { - f.reset(), - g.reset() - } - }, - f = So(e).getInstance(), - g = No(e).getInstance(), - f.setConfig({ - baseURLController: l, - dashMetrics: r, - mediaPlayerModel: i, - errHandler: o, - eventBus: n, - events: a, - errors: c, - debug: s, - boxParser: u - }), - g.setConfig({ - baseURLController: l, - dashMetrics: r, - mediaPlayerModel: i, - errHandler: o, - eventBus: n, - events: a, - errors: c, - debug: s - }), - d - } - Co.__dashjs_factory_name = "SegmentBaseController"; - var Do = N.A.getSingletonFactory(Co) - , xo = class { - constructor() { - this.accessibility = null, - this.adaptationSetSwitchingCompatibleIds = [], - this.audioChannelConfiguration = null, - this.bitrateList = null, - this.codec = null, - this.contentProtection = null, - this.essentialProperties = [], - this.id = null, - this.index = null, - this.isEmbedded = null, - this.isFragmented = null, - this.isText = !1, - this.labels = null, - this.lang = null, - this.mimeType = null, - this.normalizedKeyIds = new Set, - this.representationCount = 0, - this.roles = null, - this.segmentAlignment = !1, - this.selectionPriority = 1, - this.streamInfo = null, - this.subSegmentAlignment = !1, - this.supplementalProperties = [], - this.type = null, - this.viewpoint = null - } - } - , Mo = class { - constructor() { - this.id = null, - this.index = null, - this.start = NaN, - this.duration = NaN, - this.manifestInfo = null, - this.isLast = !0, - this.isEncrypted = !1 - } - } - , zo = class { - constructor() { - this.dvrWindowSize = NaN, - this.loadedTime = null, - this.availableFrom = null, - this.minBufferTime = NaN, - this.duration = NaN, - this.isDynamic = !1, - this.maxFragmentDuration = null, - this.serviceDescriptions = [], - this.protocol = null - } - } - , Oo = class { - constructor(t) { - this.valid = "/" == t[0], - this.path = t.split("/").filter((t => 0 !== t.length)).map((t => { - let e = { - name: t - } - , n = t.indexOf("["); - if (-1 != n) { - e.name = t.substring(0, n); - let a = t.substring(n + 1, t.length - 1); - this.valid = this.valid && -1 == a.indexOf("["); - let r = a.indexOf("="); - -1 != r ? (e.attribute = { - name: a.substring(1, r), - value: a.substring(r + 1) - }, - -1 != ["'", '"'].indexOf(e.attribute.value[0]) && (e.attribute.value = e.attribute.value.substring(1, e.attribute.value.length - 1))) : e.position = parseInt(a, 10) - 1 - } - return e - } - )) - } - isValid() { - return this.valid - } - findsElement() { - return !this.findsAttribute() - } - findsAttribute() { - return this.path[this.path.length - 1].name.startsWith("@") - } - findsTextReplace() { - return "text()" === this.path[this.path.length - 1].name - } - getMpdTarget(t, e) { - let n = null - , a = t - , r = 1 - , i = "MPD"; - for (; r < this.path.length && null !== a; ) { - n = a; - let t = this.path[r]; - if (i = t.name, - r !== this.path.length - 1 || !i.startsWith("@") && "text()" !== i) { - let e = n[i] || []; - if (0 === e.length && n[i] && e.push(n[i]), - t.position) - a = e[t.position] || null; - else if (t.attribute) { - let n = t.attribute; - a = e.filter((t => t[n.name] == n.value))[0] || null - } else - a = Array.isArray(e) ? e[0] : e - } - r++ - } - return null === a ? null : i.startsWith("@") ? { - name: i.substring(1), - leaf: a, - target: a - } : "text()" === i ? { - name: "__text", - leaf: a, - target: a - } : { - name: i, - leaf: a, - target: e ? n : a - } - } - } - , Lo = class { - constructor(t, e, n) { - this.action = t, - this.xpath = e, - this.value = n, - this.position = null - } - getMpdTarget(t) { - let e = "remove" === this.action || "replace" === this.action || "before" === this.position || "after" === this.position; - return this.xpath.getMpdTarget(t, e) - } - } - ; - function Po() { - let t, e; - const n = this.context; - return t = { - getIsPatch: function(t) { - return t && t.hasOwnProperty(S.A.ORIGINAL_MPD_ID) || !1 - }, - getMpdId: function(t) { - return t && t[S.A.ORIGINAL_MPD_ID] || null - }, - getOriginalPublishTime: function(t) { - return t && t.hasOwnProperty(S.A.ORIGINAL_PUBLISH_TIME) ? new Date(t[S.A.ORIGINAL_PUBLISH_TIME]) : null - }, - getPatchOperations: function(t) { - return t ? (t.__children || []).map((t => { - const n = t.tagName; - if ("add" !== n && "remove" !== n && "replace" !== n) - return e.warn(`Ignoring node of invalid action: ${n}`), - null; - let a = t.sel; - if ("add" === n && t.type) { - if (!t.type.startsWith("@")) - return e.warn(`Ignoring add action for prefixed namespace declaration: ${t.type}=${t.__text}`), - null; - a = `${a}/${t.type}` - } - let r = new Oo(a); - if (!r.isValid()) - return e.warn(`Ignoring action with invalid selector: ${n} - ${a}`), - null; - let i = null; - r.findsAttribute() || r.findsTextReplace() ? i = t.__text || "" : "remove" !== n && (i = t.__children.reduce(( (t, e) => { - let n = e.tagName; - return "#text" !== n && (t[n] = t[n] || [], - t[n].push(e)), - t - } - ), {})); - let o = new Lo(n,r,i); - return "add" === n && (o.position = t.pos), - o - } - )).filter((t => !!t)) : [] - }, - getPublishTime: function(t) { - return t && t.hasOwnProperty(S.A.PUBLISH_TIME) ? new Date(t[S.A.PUBLISH_TIME]) : null - } - }, - e = (0, - C.A)(n).getInstance().getLogger(t), - t - } - Po.__dashjs_factory_name = "PatchManifestModel"; - var Fo = N.A.getSingletonFactory(Po); - function Uo(t) { - let e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; - if ("undefined" != typeof TextDecoder) { - const n = new TextDecoder("utf-8").decode(t); - if (e) { - const t = n.indexOf("\0"); - return -1 !== t ? n.substring(0, t) : n - } - return n.replace(/\0/g, "") - } - const n = t.length; - let a, r, i, o = "", l = 0; - for (; l < n; ) { - if (a = t[l++], - 0 === a && e) - return o; - if (0 !== a && 3 !== a) - switch (a >> 4) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - o += String.fromCharCode(a); - break; - case 12: - case 13: - r = t[l++], - o += String.fromCharCode((31 & a) << 6 | 63 & r); - break; - case 14: - r = t[l++], - i = t[l++], - o += String.fromCharCode((15 & a) << 12 | (63 & r) << 6 | 63 & i) - } - } - return o - } - function jo(t) { - return function(t, e, n, a) { - const r = (i = t)instanceof ArrayBuffer ? i : i.buffer; - var i; - let o = 1; - "BYTES_PER_ELEMENT"in a && (o = a.BYTES_PER_ELEMENT); - const l = (d = t) && d.buffer instanceof ArrayBuffer && void 0 !== d.byteLength && void 0 !== d.byteOffset ? t.byteOffset : 0 - , s = (l + t.byteLength) / o - , u = (l + e) / o - , c = Math.floor(Math.max(0, Math.min(u, s))); - var d; - return new a(r,c,Math.floor(Math.min(c + Math.max(n, 0), s)) - c) - }(t, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1 / 0, Uint8Array) - } - function Bo(t) { - return "PRIV" === t.type ? function(t) { - if (t.size < 2) - return; - const e = Uo(t.data, !0) - , n = new Uint8Array(t.data.subarray(e.length + 1)); - return { - key: t.type, - info: e, - data: n.buffer - } - }(t) : "W" === t.type[0] ? function(t) { - if ("WXXX" === t.type) { - if (t.size < 2) - return; - let e = 1; - const n = Uo(t.data.subarray(e), !0); - e += n.length + 1; - const a = Uo(t.data.subarray(e)); - return { - key: t.type, - info: n, - data: a - } - } - const e = Uo(t.data); - return { - key: t.type, - info: "", - data: e - } - }(t) : "APIC" === t.type ? function(t) { - const e = { - key: t.type, - description: "", - data: "", - mimeType: null, - pictureType: null - }; - if (t.size < 2) - return; - if (3 !== t.data[0]) - return void console.log("Ignore frame with unrecognized character encoding"); - const n = t.data.subarray(1).indexOf(0); - if (-1 === n) - return; - const a = Uo(jo(t.data, 1, n)) - , r = t.data[2 + n] - , i = t.data.subarray(3 + n).indexOf(0); - if (-1 === i) - return; - const o = Uo(jo(t.data, 3 + n, i)); - let l; - return l = "--\x3e" === a ? Uo(jo(t.data, 4 + n + i)) : (s = t.data.subarray(4 + n + i))instanceof ArrayBuffer ? s : 0 == s.byteOffset && s.byteLength == s.buffer.byteLength ? s.buffer : new Uint8Array(s).buffer, - e.mimeType = a, - e.pictureType = r, - e.description = o, - e.data = l, - e; - var s - }(t) : function(t) { - if (t.size < 2) - return; - if ("TXXX" === t.type) { - let e = 1; - const n = Uo(t.data.subarray(e), !0); - e += n.length + 1; - const a = Uo(t.data.subarray(e)); - return { - key: t.type, - info: n, - data: a - } - } - const e = Uo(t.data.subarray(1)); - return { - key: t.type, - info: "", - data: e - } - }(t) - } - function qo(t, e) { - let n = 0; - return n = (127 & t[e]) << 21, - n |= (127 & t[e + 1]) << 14, - n |= (127 & t[e + 2]) << 7, - n |= 127 & t[e + 3], - n - } - function Go(t) { - const e = String.fromCharCode(t[0], t[1], t[2], t[3]) - , n = qo(t, 4); - return { - type: e, - size: n, - data: t.subarray(10, 10 + n) - } - } - function Ho(t, e) { - return e + 10 <= t.length && 51 === t[e] && 68 === t[e + 1] && 73 === t[e + 2] && t[e + 3] < 255 && t[e + 4] < 255 && t[e + 6] < 128 && t[e + 7] < 128 && t[e + 8] < 128 && t[e + 9] < 128 - } - function Yo(t, e) { - return e + 10 <= t.length && 73 === t[e] && 68 === t[e + 1] && 51 === t[e + 2] && t[e + 3] < 255 && t[e + 4] < 255 && t[e + 6] < 128 && t[e + 7] < 128 && t[e + 8] < 128 && t[e + 9] < 128 - } - function Vo() { - let t, e, n, a, r, i; - const o = this.context; - function l(t, n) { - const r = n ? n.index : 0 - , i = e.getAdaptationsForType(a[r].mpd.manifest, r, t); - if (!i || 0 === i.length) - return null; - if (i.length > 1 && n) - for (let t = 0, n = i.length; t < n; t++) - if (o = i[t], - e.getRolesForAdaptation(o).filter((function(t) { - return t.schemeIdUri === w.A.DASH_ROLE_SCHEME_ID && t.value === S.A.MAIN - } - ))[0]) - return i[t]; - var o; - return i[0] - } - function s(t, n, a, i, o, l) { - let s, u, c, d, f, g, m = []; - if (!i || 0 === i.length) - return []; - const b = e.getAdaptationsForPeriod(n); - for (d = 0, - g = i.length; d < g; d++) - if (s = i[d], - c = e.getIndexForAdaptation(s, t, a.index), - u = h(b[c]), - l) { - let t = u.accessibility.length; - for (f = 0; f < t; f++) { - if (!u) - continue; - let t = u.accessibility[f]; - if (t.schemeIdUri === r.ACCESSIBILITY_CEA608_SCHEME) - if (t.value && "" !== t.value) { - let e = t.value.split(";"); - if ("CC" === e[0].substring(0, 2)) - for (f = 0; f < e.length; f++) - u || (u = h.call(this, b[c])), - p(u, e[f].substring(0, 3), e[f].substring(4)), - m.push(u), - u = null; - else - for (f = 0; f < e.length; f++) - u || (u = h.call(this, b[c])), - p(u, "CC" + (f + 1), e[f]), - m.push(u), - u = null - } else - p(u, r.CC1, "eng"), - m.push(u), - u = null - } - } else - o === r.IMAGE ? (u.type = r.IMAGE, - m.push(u), - u = null) : u && m.push(u); - return m - } - function u(t) { - const n = c(t); - return e.getRegularPeriods(n) - } - function c(t) { - const n = f(t); - return e.getMpd(n) - } - function d() { - a = [] - } - function f(t) { - return t || (a.length > 0 ? a[0].mpd.manifest : null) - } - function g(t) { - try { - const n = m(t.streamInfo, a) - , r = e.getAdaptationsForPeriod(n); - return t && t.streamInfo && void 0 !== t.streamInfo.id && r ? r[t.index] : null - } catch (t) { - return null - } - } - function m(t, e) { - const n = e.length; - for (let a = 0; a < n; a++) { - let n = e[a]; - if (t && t.id === n.id) - return n - } - return null - } - function h(t) { - if (!t) - return null; - let n = new xo; - const a = t.period.mpd.manifest.Period[t.period.index].AdaptationSet[t.index]; - return n.id = t.id, - n.index = t.index, - n.type = t.type, - n.streamInfo = b(t.period), - n.representationCount = e.getRepresentationCount(a), - n.labels = e.getLabelsForAdaptation(a), - n.lang = e.getLanguageForAdaptation(a), - n.segmentAlignment = e.getSegmentAlignment(a), - n.subSegmentAlignment = e.getSubSegmentAlignment(a), - n.viewpoint = e.getViewpointForAdaptation(a), - n.accessibility = e.getAccessibilityForAdaptation(a), - n.accessibility.filter((function(t) { - if (t.schemeIdUri && t.schemeIdUri.search("cea-608") >= 0 && void 0 !== i) - return !0 - } - ))[0] && (n.embeddedCaptions = !0), - n.audioChannelConfiguration = e.getAudioChannelConfigurationForAdaptation(a), - 0 === n.audioChannelConfiguration.length && a.Representation && a.Representation.length > 0 && (n.audioChannelConfiguration = e.getAudioChannelConfigurationForRepresentation(a.Representation[0])), - n.roles = e.getRolesForAdaptation(a), - n.codec = e.getCodec(a), - n.mimeType = e.getMimeType(a), - n.contentProtection = e.getContentProtectionByAdaptation(a), - n.bitrateList = e.getBitrateListForAdaptation(a), - n.selectionPriority = e.getSelectionPriority(a), - n.contentProtection && n.contentProtection.length > 0 && (n.contentProtection = function(t, n) { - if (!t || !t.length || !n) - return t; - const a = e.getContentProtectionByManifest(n); - if (!a || !a.length) - return t; - const r = a.reduce(( (t, e) => (e.refId && t.set(e.refId, e), - t)), new Map); - return t.map((t => { - if (t.ref) { - const e = r.get(t.ref); - e && t.mergeAttributesFromReference(e) - } - return t - } - )) - }(n.contentProtection, t.period.mpd.manifest), - n.contentProtection = function(t) { - const e = t.map((t => t.cencDefaultKid)).filter((t => null !== t)); - if (e.length) { - const n = e[0]; - t.forEach((t => { - t.keyId = n - } - )) - } - return t - }(n.contentProtection), - n.normalizedKeyIds = function(t) { - const e = new Set; - return t.forEach((t => { - t.cencDefaultKid && "string" == typeof t.cencDefaultKid && e.add(t.cencDefaultKid.replace(/-/g, "").toLowerCase()) - } - )), - e - }(n.contentProtection)), - n.isText = e.getIsText(a), - n.essentialProperties = e.getCombinedEssentialPropertiesForAdaptationSet(a), - n.supplementalProperties = e.getCombinedSupplementalPropertiesForAdaptationSet(a), - n.isFragmented = e.getIsFragmented(a), - n.isEmbedded = !1, - n.adaptationSetSwitchingCompatibleIds = function(t) { - if (!t || !t.supplementalProperties) - return []; - let e = []; - const n = t.supplementalProperties.filter((t => t.schemeIdUri === S.A.ADAPTATION_SET_SWITCHING_SCHEME_ID_URI)); - return n && n.length > 0 && (e = n[0].value.toString().split(",").map((t => t))), - e - }(n), - n - } - function p(t, e, n) { - t.id = e, - t.index = 100 + parseInt(e.substring(2, 3)), - t.type = r.TEXT, - t.codec = "cea-608-in-SEI", - t.isEmbedded = !0, - t.isFragmented = !1, - t.lang = rr(n), - t.roles = [{ - schemeIdUri: "urn:mpeg:dash:role:2011", - value: "caption" - }] - } - function b(t) { - let n = new Mo; - return n.id = t.id, - n.index = t.index, - n.start = t.start, - n.duration = t.duration, - n.manifestInfo = function(t) { - let n = new zo; - return n.dvrWindowSize = t.timeShiftBufferDepth, - n.loadedTime = t.manifest.loadedTime, - n.availableFrom = t.availabilityStartTime, - n.minBufferTime = t.manifest.minBufferTime, - n.maxFragmentDuration = t.maxSegmentDuration, - n.duration = e.getDuration(t.manifest), - n.isDynamic = e.getIsDynamic(t.manifest), - n.serviceDescriptions = e.getServiceDescriptions(t.manifest), - n.protocol = t.manifest.protocol, - n - }(t.mpd), - n.isLast = 1 === t.mpd.manifest.Period.length || Math.abs(n.start + n.duration - n.manifestInfo.duration) < 1, - n.isEncrypted = t.isEncrypted, - n - } - function y() { - if (!r) - throw new Error("setConfig function has to be called previously") - } - function E(t) { - return a.length > 0 ? a[0].mpd.manifest.Period[t] : null - } - function _(t, e, n) { - let a, r, i, o, l, s; - if (t) - for (r = t.AdaptationSet, - l = 0; l < r.length; l += 1) - for (a = r[l], - o = a.Representation, - s = 0; s < o.length; s += 1) - if (i = o[s], - e === i.id) - return n ? s : i; - return null - } - return t = { - applyPatchToManifest: function(t, e) { - n.getPatchOperations(e).forEach((e => { - let n = e.getMpdTarget(t); - if (null === n) - return; - let {name: a, target: r, leaf: i} = n; - if (e.xpath.findsAttribute() || "__text" === a) { - switch (e.action) { - case "add": - case "replace": - r[a] = e.value; - break; - case "remove": - delete r[a] - } - return - } - let o = (r[a] || []).indexOf(i) - , l = "prepend" === e.position || "before" === e.position; - if ("remove" === e.action || "replace" === e.action) - if (Array.isArray(r[a])) { - if (-1 != o) { - let t = r[a]; - t.splice(o, 1), - t.length > 0 ? r[a] = t : delete r[a] - } - } else - delete r[a]; - "add" !== e.action && "replace" !== e.action || Object.keys(e.value).forEach((t => { - let n = e.value[t] - , i = r[t] || []; - if (0 === i.length && r[t] && i.push(r[t]), - 0 === i.length) - i = n; - else { - let r = i.length; - r = t == a && -1 != o ? o + (l ? 0 : 1) + ("replace" === e.action ? -1 : 0) : l ? 0 : i.length, - i.splice.apply(i, [r, 0].concat(n)) - } - r[t] = i - } - )) - } - )) - }, - areMediaInfosEqual: function(t, e) { - if (!t || !e) - return !1; - const n = t.id === e.id - , a = t.codec === e.codec - , r = JSON.stringify(t.viewpoint) === JSON.stringify(e.viewpoint) - , i = t.lang === e.lang - , o = JSON.stringify(t.roles) === JSON.stringify(e.roles) - , l = JSON.stringify(t.accessibility) === JSON.stringify(e.accessibility) - , s = JSON.stringify(t.audioChannelConfiguration) === JSON.stringify(e.audioChannelConfiguration); - return n && a && r && i && o && l && s - }, - getAllMediaInfoForType: function(t, n, i) { - let o = a - , l = i - , c = []; - if (l) - y(), - o = u(l); - else { - if (!(a.length > 0)) - return c; - l = a[0].mpd.manifest - } - const d = m(t, o); - let f = e.getAdaptationsForType(l, t ? t.index : null, n); - return c = s(l, d, t, f, n), - n === r.TEXT && (f = e.getAdaptationsForType(l, t ? t.index : null, r.VIDEO), - c = c.concat(s(l, d, t, f, n, !0))), - c - }, - getAvailabilityStartTime: function(t) { - const n = c(t); - return e.getAvailabilityStartTime(n) - }, - getBandwidthForRepresentation: function(t, e) { - let n; - return n = _(E(e), t), - n ? n.bandwidth : null - }, - getBaseURLsFromElement: function(t) { - return e.getBaseURLsFromElement(t) - }, - getCodec: function(t, n, a) { - return e.getCodec(t, n, a) - }, - getContentSteering: function(t) { - return e.getContentSteering(t) - }, - getDuration: function(t) { - const n = f(t); - return e.getDuration(n) - }, - getEssentialPropertiesForAdaptationSet: function(t) { - try { - return e.getEssentialPropertiesForRepresentation(t) - } catch (t) { - return [] - } - }, - getEssentialPropertiesForRepresentation: function(t) { - try { - return e.getEssentialPropertiesForRepresentation(t) - } catch (t) { - return [] - } - }, - getEvent: function(t, e, n, a) { - try { - if (!t || !e || isNaN(n) || !a) - return null; - const r = t.scheme_id_uri - , i = t.value; - if (!e[r + "/" + i]) - return null; - const o = new ae - , l = t.timescale || 1 - , s = a.adaptation.period.start - , u = e[r + "/" + i] - , c = isNaN(a.presentationTimeOffset) ? isNaN(u.presentationTimeOffset) ? 0 : u.presentationTimeOffset : a.presentationTimeOffset; - let d, f = t.presentation_time_delta / l; - d = 0 === t.version ? s + n - c + f : s - c + f; - const g = t.event_duration / l - , m = t.id - , h = t.message_data; - return o.eventStream = u, - o.eventStream.value = i, - o.eventStream.timescale = l, - o.duration = g, - o.id = m, - o.calculatedPresentationTime = d, - o.messageData = h, - o.presentationTimeDelta = f, - o.parsedMessageData = r === w.A.ID3_SCHEME_ID_URI ? function(t) { - let e = 0; - const n = []; - for (; Yo(t, e); ) { - const a = qo(t, e + 6); - t[e + 5] >> 6 & 1 && (e += 10), - e += 10; - const r = e + a; - for (; e + 10 < r; ) { - const a = Go(t.subarray(e)) - , r = Bo(a); - r && n.push(r), - e += a.size + 10 - } - Ho(t, e) && (e += 10) - } - return n - }(h) : null, - o - } catch (t) { - return null - } - }, - getEventsFor: function(t, n, r) { - let i = []; - if (a.length > 0) { - const o = a[0].mpd.manifest; - if (t instanceof Mo) { - const n = m(t, a); - i = e.getEventsForPeriod(n) - } else if (t instanceof xo) { - const n = m(r, a); - i = e.getEventStreamForAdaptationSet(o, g(t), n) - } else if (t instanceof fe) { - const t = m(r, a); - i = e.getEventStreamForRepresentation(o, n, t) - } - } - return i - }, - getFramerate: function(t) { - return e.getFramerate(t) - }, - getIndexForRepresentation: function(t, e) { - return function(t, e) { - const n = _(t, e, !0); - return null !== n ? n : -1 - }(E(e), t) - }, - getIsDVB: function(t) { - return e.hasProfile(t, "urn:dvb:dash:profile:dvb-dash:2014") - }, - getIsDynamic: function(t) { - const n = f(t); - return e.getIsDynamic(n) - }, - getIsPatch: function(t) { - return n.getIsPatch(t) - }, - getIsTextTrack: function(t) { - return e.getIsText(t) - }, - getIsTypeOf: function(t, n) { - return e.getIsTypeOf(t, n) - }, - getLocation: function(t) { - return e.getLocation(t) - }, - getMainAdaptationForType: l, - getManifestUpdatePeriod: function(t) { - let n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; - return e.getManifestUpdatePeriod(t, n) - }, - getMediaInfoForType: function(t, n) { - if (0 === a.length || !t) - return null; - let r = m(t, a); - if (!r) - return null; - const i = e.getAdaptationsForPeriod(r); - let o = l(n, t); - return o ? h(i[e.getIndexForAdaptation(o, a[0].mpd.manifest, t.index)]) : null - }, - getMpd: c, - getPatchLocation: function(t) { - const n = e.getPatchLocation(t) - , a = e.getPublishTime(t); - return n && 0 !== n.length && a ? n.filter((t => isNaN(t.ttl) || a.getTime() + t.ttl > (new Date).getTime())) : [] - }, - getPeriodById: function(t) { - if (!t || 0 === a.length) - return null; - const e = a.filter((e => e.id === t)); - return e && e.length > 0 ? e[0] : null - }, - getProducerReferenceTimes: function(t, n) { - let r, i; - const o = m(t, a); - return r = n ? n.id : null, - a.length > 0 && o && (i = r ? e.getAdaptationForId(r, a[0].mpd.manifest, o.index) : e.getAdaptationForIndex(n ? n.index : null, a[0].mpd.manifest, o.index)), - i ? e.getProducerReferenceTimesForAdaptation(i) : [] - }, - getPublishTime: function(t) { - return e.getPublishTime(t) - }, - getRealAdaptation: function(t, n) { - let r, i; - const o = m(t, a); - return r = n ? n.id : null, - a.length > 0 && o && (i = r ? e.getAdaptationForId(r, a[0].mpd.manifest, o.index) : e.getAdaptationForIndex(n ? n.index : null, a[0].mpd.manifest, o.index)), - i - }, - getRealPeriodByIndex: function(t) { - return e.getRealPeriodForIndex(t, a[0].mpd.manifest) - }, - getRegularPeriods: u, - getRepresentationSortFunction: function() { - return e.getRepresentationSortFunction() - }, - getStreamsInfo: function(t, e) { - const n = []; - let r = a; - if (t && (y(), - r = u(t)), - r.length > 0) { - (!e || e > r.length) && (e = r.length); - for (let t = 0; t < e; t++) - n.push(b(r[t])) - } - return n - }, - getSuggestedPresentationDelay: function() { - const t = a.length > 0 ? a[0].mpd : null; - return e.getSuggestedPresentationDelay(t) - }, - getSupplementalCodecs: function(t) { - const e = t[S.A.SUPPLEMENTAL_CODECS]; - return e ? e.split(" ").map((e => t.mimeType + ';codecs="' + e + '"')) : [] - }, - getUTCTimingSources: function() { - const t = f(); - return e.getUTCTimingSources(t) - }, - getVoRepresentations: function(t) { - let n; - const a = g(t); - return n = e.getRepresentationsForAdaptation(a, t), - n - }, - isPatchValid: function(t, a) { - let r = e.getId(t) - , i = n.getMpdId(a) - , o = e.getPublishTime(t) - , l = n.getPublishTime(a) - , s = n.getOriginalPublishTime(a); - return !!(r && i && r == i && o && s && o.getTime() == s.getTime() && l && o.getTime() < l.getTime()) - }, - reset: d, - setConfig: function(t) { - t && (t.constants && (r = t.constants), - t.cea608parser && (i = t.cea608parser), - t.errHandler && e.setConfig({ - errHandler: t.errHandler - }), - t.BASE64 && e.setConfig({ - BASE64: t.BASE64 - })) - }, - updatePeriods: function(t) { - if (!t) - return null; - y(), - a = u(t) - } - }, - e = he(o).getInstance(), - n = Fo(o).getInstance(), - d(), - t - } - Vo.__dashjs_factory_name = "DashAdapter"; - var Ko = N.A.getSingletonFactory(Vo); - class Wo { - static round10(t, e) { - return function(t, e, n) { - return void 0 === n || 0 == +n ? Math[t](e) : (n = +n, - null === (e = +e) || isNaN(e) || "number" != typeof n || n % 1 != 0 ? NaN : (e = e.toString().split("e"), - +((e = (e = Math[t](+(e[0] + "e" + (e[1] ? +e[1] - n : -n)))).toString().split("e"))[0] + "e" + (e[1] ? +e[1] + n : n)))) - }("round", t, e) - } - } - var $o = class { - constructor() { - this.TcpList = [], - this.HttpList = [], - this.RepSwitchList = [], - this.BufferLevel = [], - this.BufferState = [], - this.PlayList = [], - this.DroppedFrames = [], - this.SchedulingInfo = [], - this.DVRInfo = [], - this.ManifestUpdate = [], - this.RequestsQueue = null, - this.DVBErrors = [] - } - } - , Xo = class { - constructor() { - this.t = null, - this.mt = null, - this.to = null, - this.lto = null - } - } - , Qo = class { - constructor() { - this.t = null, - this.level = null - } - } - , Zo = class { - constructor() { - this.target = null, - this.state = I.BUFFER_EMPTY - } - } - , Jo = class { - constructor() { - this.time = null, - this.range = null, - this.manifestInfo = null - } - } - , tl = class { - constructor() { - this.time = null, - this.droppedFrames = null - } - } - ; - class el { - constructor() { - this.mediaType = null, - this.type = null, - this.requestTime = null, - this.fetchTime = null, - this.availabilityStartTime = null, - this.presentationStartTime = 0, - this.clientTimeOffset = 0, - this.currentTime = null, - this.buffered = null, - this.latency = 0, - this.streamInfo = [], - this.representationInfo = [] - } - } - class nl { - constructor() { - this.id = null, - this.index = null, - this.start = null, - this.duration = null - } - } - class al { - constructor() { - this.id = null, - this.index = null, - this.mediaType = null, - this.presentationTimeOffset = null, - this.startNumber = null - } - } - var rl = class { - constructor() { - this.mediaType = null, - this.t = null, - this.type = null, - this.startTime = null, - this.availabilityStartTime = null, - this.duration = null, - this.bandwidth = null, - this.range = null, - this.state = null - } - } - , il = class { - constructor() { - this.loadingRequests = [], - this.executedRequests = [] - } - } - ; - function ol(t) { - const e = (t = t || {}).settings; - let n, a, r = this.context, i = (0, - k.A)(r).getInstance(); - function o() { - i.trigger(R.A.METRICS_CHANGED) - } - function l(t) { - i.trigger(R.A.METRIC_CHANGED, { - mediaType: t - }), - o() - } - function s(t, e, n) { - i.trigger(R.A.METRIC_UPDATED, { - mediaType: t, - metric: e, - value: n - }), - l(t) - } - function u(t, e, n) { - i.trigger(R.A.METRIC_ADDED, { - mediaType: t, - metric: e, - value: n - }), - l(t) - } - function c(t, e) { - let n = null; - return t ? (a.hasOwnProperty(t) ? n = a[t] : e || (n = new $o, - a[t] = n), - n) : n - } - function d(t, n, a) { - let r = c(t); - null !== r && (r[n].push(a), - r[n].length > e.get().streaming.metrics.maxListDepth && r[n].shift()) - } - function f(t, e, n) { - d(t, e, n), - u(t, e, n) - } - return n = { - addBufferLevel: function(t, e, n) { - let a = new Qo; - a.t = e, - a.level = n, - f(t, I.BUFFER_LEVEL, a) - }, - addBufferState: function(t, e, n) { - let a = new Zo; - a.target = n, - a.state = e, - f(t, I.BUFFER_STATE, a) - }, - addDVBErrors: function(t) { - f(w.A.STREAM, I.DVB_ERRORS, t) - }, - addDVRInfo: function(t, e, n, a) { - let r = new Jo; - r.time = e, - r.range = a, - r.manifestInfo = n, - f(t, I.DVR_INFO, r) - }, - addDroppedFrames: function(t, e) { - let n = new tl - , a = c(t).DroppedFrames; - e && (n.time = e.creationTime, - n.droppedFrames = e.droppedVideoFrames, - a.length > 0 && a[a.length - 1] == n || f(t, I.DROPPED_FRAMES, n)) - }, - addHttpRequest: function t(e, n, a, r) { - let i = new z.G; - n.url && n.url !== e.url && (t({ - mediaType: e.mediaType, - type: e.type, - url: e.url, - serviceLocation: null, - range: e.range, - startDate: e.startDate, - firstByteDate: null, - endDate: null, - duration: e.duration, - fileLoaderType: e.fileLoaderType, - resourceTimingValues: e.resourceTimingValues - }, { - url: null, - status: null, - headers: null - }, null, r), - i.actualurl = n.url), - i.tcpid = null, - i.type = e.type, - i.url = e.url, - i.range = e.range || null, - i.trequest = e.startDate, - i.tresponse = e.firstByteDate, - i.responsecode = n.status, - i.cmsd = r, - i._tfinish = e.endDate, - i._stream = e.mediaType, - i._mediaduration = e.duration, - i._responseHeaders = ""; - for (const t in n.headers) - i._responseHeaders += t + ": " + n.headers[t] + "\r\n"; - i._serviceLocation = e.serviceLocation || null, - i._fileLoaderType = e.fileLoaderType, - i._resourceTimingValues = e.resourceTimingValues, - i._streamId = e && e.representation && e.representation.mediaInfo && e.representation.mediaInfo.streamInfo ? e.representation.mediaInfo.streamInfo.id : null, - a ? a.forEach((t => { - !function(t, e, n, a) { - let r = new z.N; - r.s = e, - r.d = n, - r.b = a, - t.trace.push(r), - t.interval || (t.interval = 0), - t.interval += n - }(i, t.s, t.d, t.b, t.t) - } - )) : (delete i.interval, - delete i.trace), - f(e.mediaType, I.HTTP_REQUEST, i) - }, - addManifestUpdate: function(t, e, n, a) { - let r = new el; - r.mediaType = t, - r.type = e, - r.requestTime = n, - r.fetchTime = a, - d(w.A.STREAM, I.MANIFEST_UPDATE, r), - u(t, I.MANIFEST_UPDATE, r) - }, - addManifestUpdateRepresentationInfo: function(t, e, n) { - if (t && t.representationInfo) { - const a = new al; - a.id = e ? e.id : null, - a.index = e ? e.index : null, - a.mediaType = n, - a.startNumber = e ? e.startNumber : null, - a.presentationTimeOffset = e ? e.presentationTimeOffset : null, - t.representationInfo.push(a), - s(t.mediaType, I.MANIFEST_UPDATE_TRACK_INFO, t) - } - }, - addManifestUpdateStreamInfo: function(t, e, n, a, r) { - if (t) { - let i = new nl; - i.id = e, - i.index = n, - i.start = a, - i.duration = r, - t.streamInfo.push(i), - s(t.mediaType, I.MANIFEST_UPDATE_STREAM_INFO, t) - } - }, - addPlayList: function(t) { - t.trace && Array.isArray(t.trace) ? t.trace.forEach((t => { - t.hasOwnProperty("subreplevel") && !t.subreplevel && delete t.subreplevel - } - )) : delete t.trace, - f(w.A.STREAM, I.PLAY_LIST, t) - }, - addRepresentationSwitch: function(t, e, n, a, r) { - let i = new Xo; - i.t = e, - i.mt = n, - i.to = a, - r ? i.lto = r : delete i.lto, - f(t, I.TRACK_SWITCH, i) - }, - addRequestsQueue: function(t, e, n) { - let a = new il; - a.loadingRequests = e, - a.executedRequests = n, - c(t).RequestsQueue = a, - u(t, I.REQUESTS_QUEUE, a) - }, - addSchedulingInfo: function(t, e, n, a, r, i, o, l, s) { - let u = new rl; - u.mediaType = t, - u.t = e, - u.type = n, - u.startTime = a, - u.availabilityStartTime = r, - u.duration = i, - u.bandwidth = o, - u.range = l, - u.state = s, - f(t, I.SCHEDULING_INFO, u) - }, - clearAllCurrentMetrics: function() { - a = {}, - o() - }, - clearCurrentMetricsForType: function(t) { - delete a[t], - l(t) - }, - getMetricsFor: c, - updateManifestUpdateInfo: function(t, e) { - if (t) { - for (let n in e) - t[n] = e[n]; - s(t.mediaType, I.MANIFEST_UPDATE, t) - } - } - }, - a = {}, - n - } - ol.__dashjs_factory_name = "MetricsModel"; - var ll = N.A.getSingletonFactory(ol); - function sl(t) { - t = t || {}; - const e = this.context; - let n, a, r, i, o = t.metricsModel; - function l(t) { - const e = o.getMetricsFor(t, !0); - if (!e) - return null; - const n = e.HttpList; - let a, r = null; - if (!n || n.length <= 0) - return null; - for (a = n.length - 1; a >= 0; ) { - if (n[a].responsecode) { - r = n[a]; - break - } - a-- - } - return r - } - function s(t) { - const e = o.getMetricsFor(t, !0); - return e && e.HttpList ? e.HttpList : [] - } - function u(t, e) { - if (!t) - return null; - const n = t[e]; - return n && 0 !== n.length ? n[n.length - 1] : null - } - return n = { - getCurrentRepresentationSwitch: function(t) { - return u(o.getMetricsFor(t, !0), I.TRACK_SWITCH) - }, - getCurrentBufferState: function(t) { - return u(o.getMetricsFor(t, !0), I.BUFFER_STATE) - }, - getCurrentBufferLevel: function(t) { - const e = u(o.getMetricsFor(t, !0), I.BUFFER_LEVEL); - return e ? Wo.round10(e.level / 1e3, -3) : 0 - }, - getCurrentHttpRequest: l, - getHttpRequests: s, - getCurrentDroppedFrames: function() { - return u(o.getMetricsFor(w.A.VIDEO, !0), I.DROPPED_FRAMES) - }, - getCurrentSchedulingInfo: function(t) { - return u(o.getMetricsFor(t, !0), I.SCHEDULING_INFO) - }, - getCurrentDVRInfo: function(t) { - return u(t ? o.getMetricsFor(t, !0) : o.getMetricsFor(w.A.VIDEO, !0) || o.getMetricsFor(w.A.AUDIO, !0), I.DVR_INFO) - }, - getCurrentManifestUpdate: function() { - return u(o.getMetricsFor(w.A.STREAM), I.MANIFEST_UPDATE) - }, - getLatestFragmentRequestHeaderValueByID: function(t, e) { - if (!e) - return null; - let n = {} - , a = l(t); - a && (n = Gt.A.parseHttpHeaders(a._responseHeaders)); - const r = n[e.toLowerCase()]; - return void 0 === r ? null : r - }, - getLatestMPDRequestHeaderValueByID: function(t) { - if (!t) - return null; - let e, n, a, r = {}; - for (e = s(w.A.STREAM), - a = e.length - 1; a >= 0; a--) - if (n = e[a], - n.type === z.G.MPD_TYPE) { - r = Gt.A.parseHttpHeaders(n._responseHeaders); - break - } - const i = r[t.toLowerCase()]; - return void 0 === i ? null : i - }, - addRepresentationSwitch: function(t, e, n, a, r) { - o.addRepresentationSwitch(t, e, n, a, r) - }, - addDVRInfo: function(t, e, n, a) { - o.addDVRInfo(t, e, n, a) - }, - updateManifestUpdateInfo: function(t) { - const e = this.getCurrentManifestUpdate(); - o.updateManifestUpdateInfo(e, t) - }, - addManifestUpdateStreamInfo: function(t) { - if (t) { - const e = this.getCurrentManifestUpdate(); - o.addManifestUpdateStreamInfo(e, t.id, t.index, t.start, t.duration) - } - }, - addManifestUpdateRepresentationInfo: function(t, e) { - if (t) { - const n = this.getCurrentManifestUpdate(); - o.addManifestUpdateRepresentationInfo(n, t, e) - } - }, - addManifestUpdate: function(t) { - o.addManifestUpdate(w.A.STREAM, t.type, t.startDate, t.endDate) - }, - addHttpRequest: function(t, e, n, a, r, i) { - const l = { - status: n, - headers: a, - url: e - }; - o.addHttpRequest(t, l, r, i) - }, - addSchedulingInfo: function(t, e) { - o.addSchedulingInfo(t.mediaType, new Date, t.type, t.startTime, t.availabilityStartTime, t.duration, t.bandwidth, t.range, e) - }, - addRequestsQueue: function(t, e, n) { - o.addRequestsQueue(t, e, n) - }, - addBufferLevel: function(t, e, n) { - o.addBufferLevel(t, e, n) - }, - addBufferState: function(t, e, n) { - o.addBufferState(t, e, n) - }, - addDroppedFrames: function(t) { - o.addDroppedFrames(w.A.VIDEO, t) - }, - addPlayList: function() { - i && (o.addPlayList(i), - i = null) - }, - addDVBErrors: function(t) { - o.addDVBErrors(t) - }, - createPlaylistMetrics: function(t, e) { - i = new St, - i.start = new Date, - i.mstart = t, - i.starttype = e - }, - createPlaylistTraceMetrics: function(t, e, n) { - !0 === a && (a = !1, - r = new It, - r.representationid = t, - r.start = new Date, - r.mstart = e, - r.playbackspeed = null !== n ? n.toString() : null) - }, - updatePlayListTraceMetrics: function(t) { - if (r) - for (let e in r) - r[e] = t[e] - }, - pushPlayListTraceMetrics: function(t, e) { - if (!1 === a && i && r && r.start) { - const n = r.start; - r.duration = t.getTime() - n.getTime(), - r.stopreason = e, - i.trace.push(r), - a = !0 - } - }, - clearAllCurrentMetrics: function() { - o.clearAllCurrentMetrics() - } - }, - o = o || ll(e).getInstance({ - settings: t.settings - }), - a = !0, - r = null, - i = null, - n - } - sl.__dashjs_factory_name = "DashMetrics"; - var ul = N.A.getSingletonFactory(sl); - function cl() { - const t = this.context - , e = (0, - k.A)(t).getInstance() - , n = (0, - K.A)(t).getInstance(); - let a, r, i, o; - function l(t) { - o = t - } - function s(t, e, n, a) { - let r, i = e.adaptation.period.mpd; - const o = i.availabilityStartTime; - if (a) - r = n && i.timeShiftBufferDepth !== Number.POSITIVE_INFINITY ? new Date(o.getTime() + 1e3 * (t + i.timeShiftBufferDepth)) : i.availabilityEndTime; - else if (n) { - const n = e.availabilityTimeOffset; - r = new Date(o.getTime() + 1e3 * (t - n)) - } else - r = o; - return r - } - function u(t, e) { - return (t.getTime() - e.mpd.availabilityStartTime.getTime() + 1e3 * o) / 1e3 - } - function c(t, e) { - return t + (e.adaptation.period.start - e.presentationTimeOffset) - } - function d(t) { - const e = { - start: NaN, - end: NaN - } - , n = t[0].getAdapter().getRegularPeriods()[0] - , a = u(new Date, n); - if (!t || 0 === t.length) - return { - range: e, - now: a - }; - t.forEach((t => { - let n = t.getCurrentRepresentationForType(w.A.VIDEO); - if (n || (n = t.getCurrentRepresentationForType(w.A.AUDIO)), - !n) { - const e = t.getAdapter() - , a = e.getMediaInfoForType(t.getStreamInfo(), w.A.VIDEO) || e.getMediaInfoForType(t.getStreamInfo(), w.A.AUDIO); - n = e.getVoRepresentations(a)[0] - } - let i = { - start: NaN, - end: NaN - }; - if (n) - if (n.segmentInfoType === S.A.SEGMENT_TIMELINE) - i = function(t) { - const e = t.adaptation.period.mpd.manifest.Period[t.adaptation.period.index].AdaptationSet[t.adaptation.index] - , n = r.getRepresentationFor(t.index, e) - , a = n.SegmentTemplate || n.SegmentList - , i = a.SegmentTimeline - , o = a.timescale - , l = i.S - , s = { - start: 0, - end: 0 - } - , u = l[0].t - , d = !isNaN(u) - , f = d ? u : 0; - let g, m, h, p, b = 0; - for (d && (s.start = c(f / o, t)), - h = 0, - p = l.length; h < p; h++) - g = l[h], - m = 0, - g.hasOwnProperty("r") && (m = g.r), - b += g.d * (1 + m); - return s.end = c((f + b) / o, t), - s - }(n); - else { - const t = n.adaptation.period; - i.start = t.start, - i.end = Math.max(a, t.start + t.duration) - } - !isNaN(i.start) && (isNaN(e.start) || e.start > i.start) && (e.start = i.start), - !isNaN(i.end) && (isNaN(e.end) || e.end < i.end) && (e.end = i.end) - } - )), - e.end = Math.min(a, e.end); - const i = g(t, e.end, !0); - return e.end = isNaN(i) ? e.end : i, - e.start = n && n.mpd && n.mpd.timeShiftBufferDepth && !isNaN(n.mpd.timeShiftBufferDepth) && !isNaN(e.end) ? Math.max(e.end - n.mpd.timeShiftBufferDepth, e.start) : e.start, - e.start = g(t, e.start), - { - range: e, - now: a - } - } - function f(t, e) { - i = t - e.end - } - function g(t, e) { - let n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; - try { - let a = 0 - , r = !1 - , i = NaN; - for (; !r && a < t.length; ) { - const o = t[a].getStreamInfo(); - o.start <= e && (!isFinite(o.duration) || o.start + o.duration >= e) ? (i = e, - r = !0) : !n && o.start > e && (isNaN(i) || o.start < i) ? i = o.start : n && o.start + o.duration < e && (isNaN(i) || o.start + o.duration > i) && (i = o.start + o.duration), - a += 1 - } - return i - } catch (t) { - return e - } - } - function m(t) { - void 0 === t.offset || isNaN(t.offset) || l(t.offset / 1e3) - } - function h() { - o = 0, - i = 0 - } - function p() { - e.off(R.A.UPDATE_TIME_SYNC_OFFSET, m, this), - h() - } - return a = { - initialize: function() { - h(), - e.on(R.A.UPDATE_TIME_SYNC_OFFSET, m, this) - }, - getClientTimeOffset: function() { - return o - }, - setClientTimeOffset: l, - getClientReferenceTime: function() { - return Date.now() - 1e3 * i + 1e3 * o - }, - calcAvailabilityStartTimeFromPresentationTime: function(t, e, n) { - return s(t, e, n) - }, - calcAvailabilityEndTimeFromPresentationTime: function(t, e, n) { - return s(t, e, n, !0) - }, - calcPresentationTimeFromWallTime: u, - calcPresentationTimeFromMediaTime: c, - calcPeriodRelativeTimeFromMpdRelativeTime: function(t, e) { - return e - t.adaptation.period.start - }, - calcMediaTimeFromPresentationTime: function(t, e) { - return t - e.adaptation.period.start + e.presentationTimeOffset - }, - calcWallTimeForSegment: function(t, e) { - let n, a, r; - return e && (n = t.representation.adaptation.period.mpd.suggestedPresentationDelay, - a = t.presentationStartTime + n, - r = new Date(t.availabilityStartTime.getTime() + 1e3 * a)), - r - }, - calcTimeShiftBufferWindow: function(t, a) { - if (!a) - return function(t) { - const e = { - start: NaN, - end: NaN - }; - let n = 0 - , a = NaN; - return t.forEach((t => { - const e = t.getStreamInfo(); - n += e.duration, - (isNaN(a) || e.start < a) && (a = e.start) - } - )), - e.start = a, - e.end = a + n, - e - }(t); - if (n.get().streaming.timeShiftBuffer.calcFromSegmentTimeline) { - const e = d(t); - return f(e.now, e.range), - e.range - } - return function(t) { - const a = { - start: NaN, - end: NaN - }; - if (!t || 0 === t.length) - return a; - const r = t[0].getAdapter().getRegularPeriods()[0] - , i = u(new Date, r) - , o = r.mpd.timeShiftBufferDepth - , l = isNaN(o) ? 0 : i - o; - if (a.start = g(t, l), - a.end = !isNaN(a.start) && i < a.start ? i : g(t, i, !0), - !isNaN(o) && a.end < i - o && (a.end = NaN), - n.get().streaming.timeShiftBuffer.fallbackToSegmentTimeline) { - const n = d(t); - if (n.range.end < a.start) - return e.trigger(D.A.CONFORMANCE_VIOLATION, { - level: ka.LEVELS.WARNING, - event: ka.EVENTS.INVALID_DVR_WINDOW - }), - f(n.now, n.range), - n.range - } - return a - }(t) - }, - reset: p - }, - r = he(t).getInstance(), - p(), - a - } - cl.__dashjs_factory_name = "TimelineConverter"; - var dl, fl, gl, ml, hl, pl = N.A.getSingletonFactory(cl), bl = function(t) { - for (var e = [], n = 0; n < t.length; ++n) { - var a = t.charCodeAt(n); - a < 128 ? e.push(a) : a < 2048 ? (e.push(192 | a >> 6), - e.push(128 | 63 & a)) : a < 65536 ? (e.push(224 | a >> 12), - e.push(128 | 63 & a >> 6), - e.push(128 | 63 & a)) : (e.push(240 | a >> 18), - e.push(128 | 63 & a >> 12), - e.push(128 | 63 & a >> 6), - e.push(128 | 63 & a)) - } - return e - }, yl = function(t) { - for (var e = [], n = 0; n < t.length; ) { - var a = t[n++]; - a < 128 || (a < 224 ? (a = (31 & a) << 6, - a |= 63 & t[n++]) : a < 240 ? (a = (15 & a) << 12, - a |= (63 & t[n++]) << 6, - a |= 63 & t[n++]) : (a = (7 & a) << 18, - a |= (63 & t[n++]) << 12, - a |= (63 & t[n++]) << 6, - a |= 63 & t[n++])), - e.push(String.fromCharCode(a)) - } - return e.join("") - }, El = {}; - dl = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", - fl = function(t) { - for (var e = 0, n = [], a = 0 | t.length / 3; 0 < a--; ) { - var r = (t[e] << 16) + (t[e + 1] << 8) + t[e + 2]; - e += 3, - n.push(dl.charAt(63 & r >> 18)), - n.push(dl.charAt(63 & r >> 12)), - n.push(dl.charAt(63 & r >> 6)), - n.push(dl.charAt(63 & r)) - } - return 2 == t.length - e ? (r = (t[e] << 16) + (t[e + 1] << 8), - n.push(dl.charAt(63 & r >> 18)), - n.push(dl.charAt(63 & r >> 12)), - n.push(dl.charAt(63 & r >> 6)), - n.push("=")) : 1 == t.length - e && (r = t[e] << 16, - n.push(dl.charAt(63 & r >> 18)), - n.push(dl.charAt(63 & r >> 12)), - n.push("==")), - n.join("") - } - , - gl = function() { - for (var t = [], e = 0; e < 64; ++e) - t[dl.charCodeAt(e)] = e; - return t["=".charCodeAt(0)] = 0, - t - }(), - ml = function(t) { - for (var e = 0, n = [], a = 0 | t.length / 4; 0 < a--; ) { - var r = (gl[t.charCodeAt(e)] << 18) + (gl[t.charCodeAt(e + 1)] << 12) + (gl[t.charCodeAt(e + 2)] << 6) + gl[t.charCodeAt(e + 3)]; - n.push(255 & r >> 16), - n.push(255 & r >> 8), - n.push(255 & r), - e += 4 - } - return n && ("=" == t.charAt(e - 2) ? (n.pop(), - n.pop()) : "=" == t.charAt(e - 1) && n.pop()), - n - } - , - hl = { - encode: function(t) { - for (var e = [], n = 0; n < t.length; ++n) - e.push(t.charCodeAt(n)); - return e - }, - decode: function(t) { - for (var e = 0; e < s.length; ++e) - a[e] = String.fromCharCode(a[e]); - return a.join("") - } - }, - El.decodeArray = function(t) { - var e = ml(t); - return new Uint8Array(e) - } - , - El.encodeASCII = function(t) { - var e = hl.encode(t); - return fl(e) - } - , - El.decodeASCII = function(t) { - var e = ml(t); - return hl.decode(e) - } - , - El.encode = function(t) { - var e = bl(t); - return fl(e) - } - , - El.decode = function(t) { - var e = ml(t); - return yl(e) - } - , - "undefined" != typeof exports && (exports.decode = El.decode, - exports.decodeArray = El.decodeArray, - exports.encode = El.encode, - exports.encodeASCII = El.encodeASCII); - var _l = El - , Al = class extends xo { - constructor() { - super(), - this.captionData = null, - this.label = null, - this.defaultTrack = !1, - this.kind = null, - this.isFragmented = !1, - this.isEmbedded = !1, - this.isTTML = null - } - } - , Tl = n(7377); - function vl() { - let t, e = 0; - function n(t) { - let e = ""; - for (let n = 0; n < t.length; ++n) - e += t[n].uchar; - return e.length - e.replace(/^\s+/, "").length - } - function a(t) { - return "left: " + 3.125 * t.x + "%; top: " + 6.66 * t.y1 + "%; width: " + (100 - 3.125 * t.x) + "%; height: " + 6.66 * Math.max(t.y2 - 1 - t.y1, 1) + "%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;" - } - function r(t) { - return "red" === t ? "rgb(255, 0, 0)" : "green" === t ? "rgb(0, 255, 0)" : "blue" === t ? "rgb(0, 0, 255)" : "cyan" === t ? "rgb(0, 255, 255)" : "magenta" === t ? "rgb(255, 0, 255)" : "yellow" === t ? "rgb(255, 255, 0)" : "white" === t ? "rgb(255, 255, 255)" : "black" === t ? "rgb(0, 0, 0)" : t - } - function i(t, e) { - const n = t.videoHeight / 15; - return e ? "font-size: " + n + "px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: " + (e.foreground ? r(e.foreground) : "rgb(255, 255, 255)") + "; font-style: " + (e.italics ? "italic" : "normal") + "; text-decoration: " + (e.underline ? "underline" : "none") + "; white-space: pre; background-color: " + (e.background ? r(e.background) : "transparent") + ";" : "font-size: " + n + "px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; justify-content: flex-start; text-align: left; color: rgb(255, 255, 255); font-style: normal; white-space: pre; line-height: normal; font-weight: normal; text-decoration: none; width: 100%; display: flex;" - } - function o(t) { - return t.replace(/^\s+/g, "") - } - function l(t) { - return t.replace(/\s+$/g, "") - } - return t = { - createHTMLCaptionsFromScreen: function(t, r, s, u) { - let c = null - , d = null - , f = !1 - , g = -1 - , m = { - start: r, - end: s, - spans: [] - } - , h = "style_cea608_white_black"; - const p = {} - , b = {} - , y = []; - let E, _; - for (E = 0; E < 15; ++E) { - const t = u.rows[E]; - let e = "" - , a = null; - if (!1 === t.isEmpty()) { - const i = n(t.chars); - null === c && (c = { - x: i, - y1: E, - y2: E + 1, - p: [] - }), - i !== g && f && (c.p.push(m), - m = { - start: r, - end: s, - spans: [] - }, - c.y2 = E, - c.name = "region_" + c.x + "_" + c.y1 + "_" + c.y2, - !1 === p.hasOwnProperty(c.name) ? (y.push(c), - p[c.name] = c) : (d = p[c.name], - d.p.contat(c.p)), - c = { - x: i, - y1: E, - y2: E + 1, - p: [] - }); - for (let n = 0; n < t.chars.length; ++n) { - const r = t.chars[n] - , i = r.penState; - if (null === a || !i.equals(a)) { - e.trim().length > 0 && (m.spans.push({ - name: h, - line: e, - row: E - }), - e = ""); - let t = "style_cea608_" + i.foreground + "_" + i.background; - i.underline && (t += "_underline"), - i.italics && (t += "_italics"), - b.hasOwnProperty(t) || (b[t] = JSON.parse(JSON.stringify(i))), - a = i, - h = t - } - e += r.uchar - } - e.trim().length > 0 && m.spans.push({ - name: h, - line: e, - row: E - }), - f = !0, - g = i - } else - f = !1, - g = -1, - c && (c.p.push(m), - m = { - start: r, - end: s, - spans: [] - }, - c.y2 = E, - c.name = "region_" + c.x + "_" + c.y1 + "_" + c.y2, - !1 === p.hasOwnProperty(c.name) ? (y.push(c), - p[c.name] = c) : (d = p[c.name], - d.p.contat(c.p)), - c = null) - } - c && (c.p.push(m), - c.y2 = E + 1, - c.name = "region_" + c.x + "_" + c.y1 + "_" + c.y2, - !1 === p.hasOwnProperty(c.name) ? (y.push(c), - p[c.name] = c) : (d = p[c.name], - d.p.contat(c.p)), - c = null); - const A = []; - for (E = 0; E < y.length; ++E) { - const n = y[E] - , u = "sub_cea608_" + e++ - , c = document.createElement("div"); - c.id = u; - const d = a(n); - c.style.cssText = "position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;" + d; - const f = document.createElement("div"); - f.className = "paragraph bodyStyle", - f.style.cssText = i(t); - const g = document.createElement("div"); - g.className = "cueUniWrapper", - g.style.cssText = "unicode-bidi: normal; direction: ltr;"; - for (let e = 0; e < n.p.length; ++e) { - const a = n.p[e]; - let r = 0; - for (_ = 0; _ < a.spans.length; ++_) { - let e = a.spans[_]; - if (e.line.length > 0) { - if (0 !== _ && r != e.row) { - const t = document.createElement("br"); - t.className = "lineBreak", - g.appendChild(t) - } - let n = !1; - r === e.row && (n = !0), - r = e.row; - const s = b[e.name] - , u = document.createElement("span"); - u.className = "spanPadding " + e.name + " customSpanColor", - u.style.cssText = i(t, s), - 0 !== _ && n ? _ === a.spans.length - 1 ? u.textContent = l(e.line) : u.textContent = e.line : a.spans.length > 1 && _ < a.spans.length - 1 && e.row === a.spans[_ + 1].row ? u.textContent = o(e.line) : u.textContent = e.line.trim(), - g.appendChild(u) - } - } - } - f.appendChild(g), - c.appendChild(f); - const m = { - bodyStyle: ["%", 90] - }; - for (const t in b) - b.hasOwnProperty(t) && (m[t] = ["%", 90]); - A.push({ - type: "html", - start: r, - end: s, - cueHTMLElement: c, - cueID: u, - cellResolution: [32, 15], - isFromCEA608: !0, - fontSize: m, - lineHeight: {}, - linePadding: {} - }) - } - return A - } - }, - t - } - vl.__dashjs_factory_name = "EmbeddedTextHtmlRender"; - var wl = N.A.getSingletonFactory(vl); - function Sl(t, e, n) { - const a = []; - for (let r = e; r < n; r++) - r + 2 < n && 0 === t.getUint8(r) && 0 === t.getUint8(r + 1) && 3 === t.getUint8(r + 2) ? (a.push(0), - a.push(0), - r += 2) : a.push(t.getUint8(r)); - return new DataView(new Uint8Array(a).buffer) - } - function Il(t, e, n, a) { - return !(4 !== t || e < 8) && (181 === n.getUint8(a) && (49 === n.getUint16(a + 1) && (1195456820 === n.getUint32(a + 3) && 3 === n.getUint8(a + 7)))) - } - function kl(t, e) { - return (127 & t) > 0 || (127 & e) > 0 - } - function Rl(t, e) { - let n = 0; - for (; n < t.byteLength; ) { - let r, i = 0, o = 0; - do { - i += r = t.getUint8(n++) - } while (255 === r); - do { - o += r = t.getUint8(n++) - } while (255 === r); - if (Il(i, o, t, n)) { - const r = n + 10 - , i = r + 3 * (31 & t.getUint8(r - 2)); - for (let n = r; n < i; n += 3) { - const r = t.getUint8(n); - if (4 & r) { - const i = 3 & r; - if (0 === (a = i) || 1 === a) { - const a = t.getUint8(n + 1) - , r = t.getUint8(n + 2); - kl(a, r) && e[i].push(a, r) - } - } - } - } - n += o - } - var a - } - function Nl(t, e, n) { - let a = 0 - , r = 0; - const i = [[], []]; - for (let o = e; o < e + n - 5 && (a = t.getUint32(o), - r = 31 & t.getUint8(o + 4), - !(o + 5 + a > e + n)); o++) - 6 === r && o + 5 + a <= t.byteLength && Rl(Sl(t, o + 5, o + 5 + a), i), - o += a + 3; - return i - } - function Cl(t) { - const e = t.errHandler - , n = t.manifestModel - , a = t.mediaController - , r = t.videoModel - , i = t.textTracks - , o = t.vttParser - , l = t.vttCustomRenderingParser - , s = t.ttmlParser - , u = t.streamInfo - , c = t.settings - , d = this.context - , f = (0, - k.A)(d).getInstance(); - let g, m, h, p, b, y, E, _, A, T, I, N, D, x, M, O, L, P = !1; - function F() { - y = null, - _ = NaN, - A = [], - T = null, - E = !1, - b = [], - p = null - } - function U(t) { - const e = {}; - e[S.A.SUBTITLE] = "subtitles", - e[S.A.CAPTION] = "captions", - e[S.A.FORCED_SUBTITLE] = "subtitles"; - const n = new Al; - for (let e in t) - n[e] = t[e]; - n.defaultTrack = function(t) { - let e = !1; - return N.length > 1 && t.isEmbedded ? e = t.id && t.id === w.A.CC1 : 1 === N.length ? t.id && "string" == typeof t.id && "CC" === t.id.substring(0, 2) && (e = !0) : 0 === N.length && (e = t.index === b[0].index), - e - }(t), - n.isTTML = function(t) { - return t.codec && t.codec.search(w.A.STPP) >= 0 || t.mimeType && t.mimeType.search(w.A.TTML) >= 0 - }(t), - n.kind = function(t, e) { - let n = t.roles && t.roles.length > 0 ? e[t.roles[0].value] : e.caption; - return n = Object.values(e).includes(n) ? n : e.caption, - n - }(t, e), - i.addTextTrackInfo(n) - } - function j(t) { - const e = t.chunk; - e.representation.mediaInfo.embeddedCaptions && q(e.bytes, e) - } - function B(t) { - I = t - } - function q(t, a) { - const r = a.representation.mediaInfo - , l = r.type - , s = r.mimeType - , u = r.codec || s; - u ? -1 !== r.codec.indexOf("application/mp4") ? function(t, e, a) { - let r, l; - if ("InitializationSegment" === e.segmentType) - E = !0, - _ = h.getMediaTimescaleFromMoov(t); - else { - if (!E) - return; - l = h.getSamplesInfo(t), - r = l.sampleList, - r.length > 0 && (T = r[0].cts - e.start * _), - a.search(w.A.STPP) >= 0 ? function(t, e, a) { - let r, o; - for (p = null !== p ? p : K(a), - r = 0; r < e.length; r++) { - const a = e[r] - , l = a.cts - , s = Y() - , u = s + l / _ - , c = u + a.duration / _; - g.buffered.add(u, c); - const d = new DataView(t,a.offset,a.subSizes[0]); - let f = Jn.Utils.dataViewToString(d, w.A.UTF8); - const h = []; - let b = a.offset + a.subSizes[0]; - for (o = 1; o < a.subSizes.length; o++) { - const e = new Uint8Array(t,b,a.subSizes[o]) - , n = String.fromCharCode.apply(null, e); - h.push(n), - b += a.subSizes[o] - } - try { - const t = n.getValue().ttmlTimeIsRelative ? l / _ : 0 - , e = p.parse(f, t, l / _, (l + a.duration) / _, h); - i.addCaptions(I, s, e) - } catch (t) { - y.removeExecutedRequestsBeforeTime(), - W(), - m.error("TTML parser error: " + t) - } - } - }(t, r, a) : function(t, e) { - let n, a, r; - const l = []; - for (n = 0; n < e.length; n++) { - const i = e[n]; - i.cts -= T; - const s = Y() + i.cts / _ - , u = s + i.duration / _; - g.buffered.add(s, u); - const c = t.slice(i.offset, i.offset + i.size) - , d = Jn.parseBuffer(c); - for (a = 0; a < d.boxes.length; a++) { - const t = d.boxes[a]; - if (m.debug("VTT box1: " + t.type), - "vtte" !== t.type && "vttc" === t.type) { - m.debug("VTT vttc boxes.length = " + t.boxes.length); - let e = { - styles: {} - }; - for (r = 0; r < t.boxes.length; r++) { - const n = t.boxes[r]; - if (m.debug("VTT box2: " + n.type), - "payl" === n.type) - e.start = i.cts / _, - e.end = (i.cts + i.duration) / _, - e.data = n.cue_text; - else if ("sttg" === n.type && n.settings && "" !== n.settings) - try { - const t = n.settings.split(" "); - e.styles = o.getCaptionStyles(t) - } catch (t) {} - } - e && e.data && (l.push(e), - m.debug(`VTT ${e.start} - ${e.end} : ${e.data}`)) - } - } - } - l.length > 0 && i.addCaptions(I, 0, l) - }(t, r) - } - }(t, a, u) : l === w.A.VIDEO ? function(t, e) { - let n, a; - if (e.segmentType === z.G.INIT_SEGMENT_TYPE) - 0 === D && (D = h.getMediaTimescaleFromMoov(t)); - else if (e.segmentType === z.G.MEDIA_SEGMENT_TYPE) { - if (0 === D) - return void m.warn("CEA-608: No timescale for embeddedTextTrack yet"); - a = h.getSamplesInfo(t); - const r = a.lastSequenceNumber - , o = Math.trunc(e.start) - , l = Math.trunc(e.end); - if (O[0] || O[1] || function() { - let t; - for (let e = 0; e < N.length; e++) { - if (t = i.getTrackIdxForId(N[e].id), - -1 === t) - return void m.warn("CEA-608: data before track is ready."); - const n = H(t); - O[e] = new v(e + 1,{ - newCue: n - },null) - } - }(), - D) { - if (function(t, e, n, a, r) { - return null !== t && null !== e && null !== a && null !== r && (e === t ? a !== r : e !== t + n) - }(x, r, a.numSequences, M, o)) - for (n = 0; n < O.length; n++) - O[n] && O[n].reset(); - const e = function(t, e) { - if (0 === e.length) - return null; - const n = { - splits: [], - fields: [[], []] - } - , a = new DataView(t); - for (let t = 0; t < e.length; t++) { - const r = e[t] - , i = Nl(a, r.offset, r.size); - let o = null - , l = 0; - for (let t = 0; t < 2; t++) - if (i[t].length > 0) { - r.cts !== o ? l = 0 : l += 1; - const e = Y(); - n.fields[t].push([r.cts + e * D, i[t], l]), - o = r.cts - } - } - return n.fields.forEach((function(t) { - t.sort((function(t, e) { - return t[0] === e[0] ? t[2] - e[2] : t[0] - e[0] - } - )) - } - )), - n - }(t, a.sampleList); - for (let t = 0; t < O.length; t++) { - const a = e.fields[t] - , r = O[t]; - if (r) - for (n = 0; n < a.length; n++) - r.addData(a[n][0] / D, a[n][1]) - } - x = r, - M = l - } - } - }(t, a) : function(t, n, a) { - let r, o; - const l = new DataView(t,0,t.byteLength); - o = Jn.Utils.dataViewToString(l, w.A.UTF8); - try { - r = K(a).parse(o, 0), - i.addCaptions(i.getCurrentTrackIdx(), 0, r), - g.buffered && g.buffered.add(n.start, n.end) - } catch (t) { - e.error(new G.A(V.TIMED_TEXT_ERROR_ID_PARSE_CODE,V.TIMED_TEXT_ERROR_MESSAGE_PARSE + t.message,o)) - } - }(t, a, u) : m.error("No text type defined") - } - function H(t) { - return function(e, n, a) { - let o; - o = r.getTTMLRenderingDiv() ? L.createHTMLCaptionsFromScreen(r.getElement(), e, n, a) : [{ - start: e, - end: n, - data: a.getDisplayText(), - styles: {} - }], - o && i.addCaptions(t, 0, o) - } - } - function Y() { - return isNaN(g.timestampOffset) ? 0 : g.timestampOffset - } - function K(t) { - let e; - return t.search(w.A.VTT) >= 0 ? e = c.get().streaming.text.webvtt.customRenderingEnabled && l ? l : o : (t.search(w.A.TTML) >= 0 || t.search(w.A.STPP) >= 0) && (e = s), - e - } - function W(t, e) { - void 0 === t && t === e && (t = g.buffered.start(0), - e = g.buffered.end(g.buffered.length - 1)), - g.buffered.remove(t, e), - i.deleteCuesFromTrackIdx(I, t, e) - } - function $(t) { - N.forEach((function(e) { - const n = i.getTrackIdxForId(e.id); - n >= 0 && i.deleteCuesFromTrackIdx(n, t.from, t.to) - } - )) - } - return g = { - initialize: function() { - P || (N = [], - I = null, - D = 0, - O = [], - x = null, - M = null, - P = !0, - L = wl(d).getInstance(), - f.on(R.A.VIDEO_CHUNK_RECEIVED, j, g), - f.on(R.A.BUFFER_CLEARED, $, g)) - }, - addMediaInfos: function(t, e, n) { - if (b = b.concat(e), - t === w.A.TEXT && e[0].isFragmented && !e[0].isEmbedded) { - y = n, - g.buffered = (0, - Tl.A)(d).create(), - A = a.getTracksFor(w.A.TEXT, u.id).filter((t => t.isFragmented)); - const t = a.getCurrentTrackFor(w.A.TEXT, u.id); - for (let e = 0; e < A.length; e++) - if (A[e] === t) { - B(e); - break - } - } - for (let t = 0; t < e.length; t++) - U(e[t]) - }, - resetMediaInfos: function() { - b = [] - }, - getStreamId: function() { - return u.id - }, - append: q, - abort: function() {}, - addEmbeddedTrack: function(t) { - if (P && t) - if (t.id === w.A.CC1 || t.id === w.A.CC3) { - for (let e = 0; e < N.length; e++) - if (N[e].id === t.id) - return; - N.push(t) - } else - m.warn("Embedded track " + t.id + " not supported!") - }, - resetEmbedded: function() { - f.off(R.A.VIDEO_CHUNK_RECEIVED, j, g), - f.off(R.A.BUFFER_CLEARED, $, g), - i && i.deleteAllTextTracks(), - P = !1, - N = [], - O = [null, null], - x = null, - M = null - }, - getConfig: function() { - return { - fragmentModel: y, - fragmentedTracks: A, - videoModel: r - } - }, - setCurrentFragmentedTrackIdx: B, - remove: W, - reset: function() { - F(), - b = [], - h = null - } - }, - m = (0, - C.A)(d).getInstance().getLogger(g), - h = na(d).getInstance(), - F(), - g - } - Cl.__dashjs_factory_name = "TextSourceBuffer"; - var Dl = N.A.getClassFactory(Cl); - class xl { - constructor(t) { - if (this.cues = new Map, - t) - for (const e of t) - this.addCue(e) - } - hasCue(t) { - const e = this.cues.get(t.startTime); - return e && e.some((e => { - return a = t, - (n = e).startTime === a.startTime && n.endTime === a.endTime && n instanceof VTTCue && a instanceof VTTCue && n.text === a.text; - var n, a - } - )) - } - addCue(t) { - const e = this.cues.get(t.startTime); - e ? this.hasCue(t) || e.push(t) : this.cues.set(t.startTime, [t]) - } - } - var Ml = n(7640); - const zl = ["text", "align", "fontSize", "id", "isd", "line", "lineAlign", "lineHeight", "linePadding", "position", "positionAlign", "region", "size", "snapToLines", "vertical"]; - function Ol(t) { - const e = this.context - , n = (0, - k.A)(e).getInstance() - , a = t.videoModel - , r = t.streamInfo - , i = t.settings; - let o, l, s, u, c, d, f, g, m, h, p, b, y, E, _, A, T, v, S, I; - function N(t) { - const e = t.kind - , n = void 0 !== t.id ? t.id : t.lang - , r = t.lang - , i = t.isTTML - , o = t.isEmbedded; - return a.addTextTrack(e, n, r, i, o) - } - function x(t, e, n, a, r, i) { - let o = 0 - , l = 0; - t / e > n / a ? (l = e, - o = l / a * n) : (o = t, - l = o / n * a); - let s = 0 - , u = 0 - , c = 0 - , d = 0; - return o / l > r ? (d = l, - c = l * r) : (c = o, - d = o / r), - s = (t - c) / 2, - u = (e - d) / 2, - i ? { - x: s + .1 * c, - y: u + .1 * d, - w: .8 * c, - h: .8 * d - } : { - x: s, - y: u, - w: c, - h: d - } - } - function M(t, e) { - const r = a.getClientWidth() - , i = a.getClientHeight() - , o = a.getVideoWidth() - , l = a.getVideoHeight() - , s = a.getVideoRelativeOffsetTop() - , u = a.getVideoRelativeOffsetLeft(); - if (0 !== o && 0 !== l) { - let a = o / l - , c = !1; - t.isFromCEA608 && (a = 3.5 / 3, - c = !0); - const d = x.call(this, r, i, o, l, a, c) - , b = d.w - , y = d.h - , A = d.x - , v = d.y; - if (b != m || y != h || A != f || v != g || e) { - if (f = A + u, - g = v + s, - m = b, - h = y, - p) { - const t = p.style; - t && (t.left = f + "px", - t.top = g + "px", - t.width = m + "px", - t.height = h + "px", - t.zIndex = E && document[E] || _ ? T : null, - n.trigger(D.A.CAPTION_CONTAINER_RESIZE)) - } - const e = t.activeCues; - if (e) { - const t = e.length; - for (let n = 0; n < t; ++n) { - const t = e[n]; - t.scaleCue(t) - } - } - } - } - } - function z(t) { - const e = m - , n = h; - let a, r, i, o, l; - if (t.cellResolution) { - const s = [e / t.cellResolution[0], n / t.cellResolution[1]]; - if (t.linePadding) - for (a in t.linePadding) - if (t.linePadding.hasOwnProperty(a)) { - r = (t.linePadding[a] * s[0]).toString(); - const e = document.getElementsByClassName("spanPadding"); - for (let t = 0; t < e.length; t++) - e[t].style.cssText = e[t].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi, "$1" + r), - e[t].style.cssText = e[t].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi, "$1" + r) - } - if (t.fontSize) { - for (a in t.fontSize) - if (t.fontSize.hasOwnProperty(a)) { - "%" === t.fontSize[a][0] ? i = t.fontSize[a][1] / 100 : "c" === t.fontSize[a][0] && (i = t.fontSize[a][1]), - r = (i * s[1]).toString(), - l = "defaultFontSize" !== a ? document.getElementsByClassName(a) : document.getElementsByClassName("paragraph"); - for (let t = 0; t < l.length; t++) - l[t].style.cssText = l[t].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi, "$1" + r) - } - if (t.lineHeight) - for (a in t.lineHeight) - if (t.lineHeight.hasOwnProperty(a)) { - "%" === t.lineHeight[a][0] ? o = t.lineHeight[a][1] / 100 : "c" === t.fontSize[a][0] && (o = t.lineHeight[a][1]), - r = (o * s[1]).toString(), - l = document.getElementsByClassName(a); - for (let t = 0; t < l.length; t++) - l[t].style.cssText = l[t].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi, "$1" + r) - } - } - } - if (t.isd) { - let e = document.getElementById(t.cueID); - e && p.removeChild(e), - L(t) - } - } - function O(t, e) { - const n = /^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/ - , a = /^#(.*)$/; - if (n.test(e)) { - const a = n.exec(e) - , r = parseInt(a[4], 10) - 1; - return "data:image/png;base64," + btoa(t.images[r]) - } - if (a.test(e)) { - const n = a.exec(e)[1]; - return "data:image/png;base64," + t.embeddedImages[n] - } - return e - } - function L(t) { - if (p) { - it.call(this); - const e = document.createElement("div"); - p.appendChild(e), - A = (0, - Ml.renderHTML)(t.isd, e, (function(e) { - return O(t, e) - } - ), p.clientHeight, p.clientWidth, i.get().streaming.text.imsc.displayForcedOnlyMode, (function(t) { - l.info("renderCaption :", t) - } - ), A, i.get().streaming.text.imsc.enableRollUp), - e.id = t.cueID, - n.trigger(D.A.CAPTION_RENDERED, { - captionDiv: e, - currentTrackIdx: d - }) - } - } - function P(t, e) { - return !!e && e.endTime >= t.startTime - } - function F(t, e) { - return !!i.get().streaming.text.extendSegmentedCues && !!function(t, e, n) { - for (let a = 0; a < n.length; a++) { - const r = n[a]; - if (JSON.stringify(t[r]) !== JSON.stringify(e[r])) - return !1 - } - return !0 - }(e, t, zl) && (e.endTime = Math.max(e.endTime, t.endTime), - !0) - } - function U(t, e) { - e && e.forEach((e => { - e.kind && "image" === e.kind && (e.src = O(t, e.src)), - U(t, e.contents) - } - )) - } - function j(t, e, n) { - const r = X(t) - , o = i.get().streaming.text.dispatchForManualRendering; - if (!r) - return; - if (!Array.isArray(n) || 0 === n.length) - return; - const s = new xl(r.cues); - for (let t = 0; t < n.length; t++) { - let u = null; - const c = n[t]; - r.cellResolution = c.cellResolution, - r.isFromCEA608 = c.isFromCEA608, - isNaN(c.start) || isNaN(c.end) || (o ? u = B(c, e) : V(c) && p ? u = H(c, e, r) : c.data && (u = Y(c, e, r))); - try { - if (u) { - if (!s.hasCue(u)) - if (s.addCue(u), - i.get().streaming.text.webvtt.customRenderingEnabled) - r.manualCueList || (r.manualCueList = []), - r.manualCueList.push(u); - else { - let t; - r.cues && 0 !== r.cues.length && (t = r.cues[r.cues.length - 1]), - P(u, t) ? F(u, t) || (t.isd && (t.onexit = function() {} - ), - r.mode !== w.A.TEXT_DISABLED && r.addCue(u)) : r.mode !== w.A.TEXT_DISABLED && r.addCue(u) - } - const t = i.get().streaming.buffer.bufferToKeep; - tt(r, 0, a.getTime() - t) - } else - l.error("Impossible to display subtitles. You might have missed setting a TTML rendering div via player.attachTTMLRenderingDiv(TTMLRenderingDiv)") - } catch (t) { - throw et(r), - r.addCue(u), - t - } - } - } - function B(t, e) { - let n = K(t, e); - return n.onenter = function() { - V(t) && I && I.cueID !== n.cueID && G(I), - delete n.type, - I = n, - q(n) - } - , - n.onexit = function() { - G(n), - I = null - } - , - n - } - function q(t) { - n.trigger(D.A.CUE_ENTER, t) - } - function G(t) { - n.trigger(D.A.CUE_EXIT, { - cueID: t.cueID - }) - } - function H(t, e, a) { - const r = this; - let i = K(t, e); - return p.style.left = f + "px", - p.style.top = g + "px", - p.style.width = m + "px", - p.style.height = h + "px", - i.onenter = function() { - a.mode === w.A.TEXT_SHOWING && (this.isd ? (S ? requestAnimationFrame(( () => L(this))) : L(this), - l.debug("Cue enter id:" + this.cueID)) : (p.appendChild(this.cueHTMLElement), - z.call(r, this), - n.trigger(D.A.CAPTION_RENDERED, { - captionDiv: this.cueHTMLElement, - currentTrackIdx: d - }))) - } - , - i.onexit = function() { - if (p) { - const t = p.childNodes; - for (let e = 0; e < t.length; ++e) - t[e].id === this.cueID && (l.debug("Cue exit id:" + t[e].id), - p.removeChild(t[e]), - --e) - } - } - , - i - } - function Y(t, e, a) { - let r = K(t, e); - if (r.isActive = !1, - t.styles) - try { - void 0 !== t.styles.align && "align"in r && (r.align = t.styles.align), - void 0 !== t.styles.line && "line"in r && (r.line = t.styles.line), - void 0 !== t.styles.lineAlign && (r.lineAlign = t.styles.lineAlign), - void 0 !== t.styles.snapToLines && "snapToLines"in r && (r.snapToLines = t.styles.snapToLines), - void 0 !== t.styles.position && "position"in r && (r.position = t.styles.position), - void 0 !== t.styles.positionAlign && (r.positionAlign = t.styles.positionAlign), - void 0 !== t.styles.size && "size"in r && (r.size = t.styles.size) - } catch (t) { - l.error(t) - } - return r.onenter = function() { - a.mode === w.A.TEXT_SHOWING && n.trigger(D.A.CAPTION_RENDERED, { - currentTrackIdx: d - }) - } - , - r - } - function V(t) { - return "html" === t.type - } - function K(t, e) { - return V(t) ? function(t, e) { - let n = new s(t.start + e,t.end + e,""); - return n.cueHTMLElement = t.cueHTMLElement, - n.isd = t.isd, - n.images = t.images, - n.embeddedImages = t.embeddedImages, - n.cueID = t.cueID, - n.scaleCue = z.bind(self), - n.cellResolution = t.cellResolution, - n.lineHeight = t.lineHeight, - n.linePadding = t.linePadding, - n.fontSize = t.fontSize, - n.isd && U(n, n.isd.contents), - n - }(t, e) : function(t, e) { - let n = new s(t.start - e,t.end - e,t.data); - return n.cueID = Gt.A.generateUuid(), - n - }(t, e) - } - function W(t) { - if (b) { - const e = b.childNodes; - for (let n = 0; n < e.length; ++n) - e[n].id === t.cueID && (b.removeChild(e[n]), - --n) - } - } - function $() { - const t = a.getTextTracks() - , e = []; - for (const n of t) - n.manualMode === w.A.TEXT_SHOWING && e.push(n); - return e - } - function X(t) { - return t >= 0 && u[t] ? a.getTextTrack(u[t].kind, u[t].id, u[t].lang, u[t].isTTML, u[t].isEmbedded) : null - } - function Q(t) { - if (t === d) - return; - d = t; - const e = X(d); - Z.call(this, e), - y && (clearInterval(y), - y = null), - e && "html" === e.renderingType && (M.call(this, e, !0), - window.ResizeObserver ? (v = new window.ResizeObserver(( () => { - M.call(this, e, !0) - } - )), - v.observe(a.getElement())) : y = setInterval(M.bind(this, e), 500)) - } - function Z(t) { - it.call(this), - t && "html" === t.renderingType ? at.call(this) : rt.call(this) - } - function J(t, e, n) { - let a = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3]; - return !!t && (isNaN(e) || (a ? t.startTime : t.endTime) >= e) && (isNaN(n) || (a ? t.endTime : t.startTime) <= n) - } - function tt(t, e, n) { - if (!(n < e) && t && (t.cues || t.manualCueList)) { - const a = t.cues && t.cues.length > 0 ? "native" : "custom" - , r = "native" === a ? t.cues : t.manualCueList; - if (!r || 0 === r.length) - return; - for (let i = r.length - 1; i >= 0; i--) - J(r[i], e, n, !0) && !nt(r[i]) && ("native" === a ? t.removeCue(r[i]) : (W(r[i]), - delete t.manualCueList[i])) - } - } - function et(t, e, n) { - let a = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3]; - if (t && (t.cues || t.manualCueList)) { - const r = t.cues && t.cues.length > 0 ? "native" : "custom" - , i = "native" === r ? t.cues : t.manualCueList; - if (!i || 0 === i.length) - return; - for (let o = i.length - 1; o >= 0; o--) - J(i[o], e, n, a) && ("native" === r ? (i[o].onexit && i[o].onexit(), - t.removeCue(i[o])) : (W(i[o]), - delete t.manualCueList[o])) - } - } - function nt(t) { - const e = a.getTime(); - return e >= t.startTime && e <= t.endTime - } - function at() { - let t = document.getElementById("native-cue-style"); - if (t) - return; - t = document.createElement("style"), - t.id = "native-cue-style", - document.head.appendChild(t); - const e = t.sheet - , n = a.getElement(); - try { - n && (n.id ? e.insertRule("#" + n.id + "::cue {background: transparent}", 0) : 0 !== n.classList.length ? e.insertRule("." + n.className + "::cue {background: transparent}", 0) : e.insertRule("video::cue {background: transparent}", 0)) - } catch (t) { - l.info("" + t.message) - } - } - function rt() { - const t = document.getElementById("native-cue-style"); - t && document.head.removeChild(t) - } - function it() { - if (p) - for (; p.firstChild; ) - p.removeChild(p.firstChild) - } - return o = { - addCaptions: j, - addTextTrackInfo: function(t) { - u.push(t) - }, - createTracks: function() { - u.sort((function(t, e) { - return t.index - e.index - } - )), - p = a.getTTMLRenderingDiv(), - b = a.getVttRenderingDiv(); - let t = -1; - for (let e = 0; e < u.length; e++) { - const a = N(u[e]); - c.push(a), - u[e].defaultTrack && (a.default = !0, - t = e); - const r = X(e); - r && (r.mode = w.A.TEXT_SHOWING, - p && (u[e].isTTML || u[e].isEmbedded) ? r.renderingType = "html" : r.renderingType = "default"), - j(e, 0, u[e].captionData), - n.trigger(D.A.TEXT_TRACK_ADDED) - } - if (Q.call(this, t), - t >= 0) { - let e = function() { - const a = X(t); - a && "html" === a.renderingType && M.call(this, a, !0), - n.off(D.A.PLAYBACK_METADATA_LOADED, e, this) - }; - n.on(D.A.PLAYBACK_METADATA_LOADED, e, this); - for (let e = 0; e < u.length; e++) { - const n = X(e); - if (n) { - const a = i.get().streaming.text.dispatchForManualRendering; - n.mode = e !== t || a ? w.A.TEXT_HIDDEN : w.A.TEXT_SHOWING, - n.manualMode = e === t ? w.A.TEXT_SHOWING : w.A.TEXT_HIDDEN - } - } - } - n.trigger(R.A.TEXT_TRACKS_QUEUE_INITIALIZED, { - index: d, - tracks: u, - streamId: r.id - }) - }, - deleteAllTextTracks: function() { - const t = c ? c.length : 0; - for (let e = 0; e < t; e++) { - const t = X(e); - t && et.call(this, t, r.start, r.start + r.duration, !1) - } - c = [], - u = [], - y && (clearInterval(y), - y = null), - v && a && (v.unobserve(a.getElement()), - v = null), - d = -1, - it.call(this) - }, - deleteCuesFromTrackIdx: function(t, e, n) { - const a = X(t); - a && et(a, e, n) - }, - disableManualTracks: function() { - const t = $(); - if (t && t.length > 0) { - const e = t[0].manualCueList; - e && e.length > 0 && e.forEach((t => { - if (t.isActive) - if (t.isActive = !1, - i.get().streaming.text.dispatchForManualRendering) - G(t); - else if (b) { - const e = b.childNodes; - for (let n = 0; n < e.length; ++n) - e[n].id === t.cueID && (b.removeChild(e[n]), - --n) - } - } - )) - } - }, - getCurrentTrackIdx: function() { - return d - }, - getCurrentTextTrackInfo: function() { - return u[d] - }, - getStreamId: function() { - return r.id - }, - getTextTrackInfos: function() { - return u - }, - getTrackIdxForId: function(t) { - let e = -1; - for (let n = 0; n < u.length; n++) - if (u[n].id === t) { - e = n; - break - } - return e - }, - initialize: function() { - "undefined" != typeof window && "undefined" != typeof navigator && (s = window.VTTCue || window.TextTrackCue, - u = [], - c = [], - d = -1, - f = 0, - g = 0, - m = 0, - h = 0, - p = null, - b = null, - y = null, - _ = !1, - T = 2147483647, - A = null, - S = "requestAnimationFrame"in window, - void 0 !== document.fullscreenElement ? E = "fullscreenElement" : void 0 !== document.webkitIsFullScreen ? E = "webkitIsFullScreen" : document.msFullscreenElement ? E = "msFullscreenElement" : document.mozFullScreen && (E = "mozFullScreen")) - }, - manualCueProcessing: function(t) { - const e = $(); - if (e && e.length > 0) { - const n = e[0].manualCueList; - n && n.length > 0 && n.forEach((e => { - e.startTime <= t && e.endTime >= t && !e.isActive ? (e.isActive = !0, - i.get().streaming.text.dispatchForManualRendering ? q(e) : WebVTT.processCues(window, [e], b, e.cueID)) : e.isActive && (e.startTime > t || e.endTime < t) && (e.isActive = !1, - i.get().streaming.text.dispatchForManualRendering ? G(e) : W(e)) - } - )) - } - }, - setCurrentTrackIdx: Q, - setModeForTrackIdx: function(t, e) { - const n = X(t); - n && n.mode !== e && (n.mode = e), - n && n.manualMode !== e && (n.manualMode = e) - } - }, - l = (0, - C.A)(e).getInstance().getLogger(o), - o - } - Ol.__dashjs_factory_name = "TextTracks"; - var Ll = N.A.getClassFactory(Ol); - function Pl() { - const t = this.context; - let e, n, a, r, i, o; - function l(t) { - const e = t.split(":") - , n = e.length - 1; - return t = 60 * parseInt(e[n - 1], 10) + parseFloat(e[n]), - 2 === n && (t += 3600 * parseInt(e[0], 10)), - t - } - function s(t) { - const e = t.split(r) - , n = e[1].split(o); - return n.shift(), - e[1] = n[0], - n.shift(), - { - cuePoints: e, - styles: u(n) - } - } - function u(t) { - const e = {}; - return t.forEach((function(t) { - const n = t.split(":"); - if (n.length > 1) { - const [t,a] = n; - switch (t) { - case "align": - case "A": - e.align = a; - break; - case "line": - case "L": - const [t,n] = a.split(",") - , r = t.endsWith("%"); - e.line = "auto" === t ? t : parseInt(t, 10), - r && (e.snapToLines = !1), - n && (e.lineAlign = n); - break; - case "position": - case "P": - const [i,o] = a.split(","); - e.position = parseInt(i, 10), - o && (e.positionAlign = o); - break; - case "size": - case "S": - e.size = parseInt(a, 10) - } - } - } - )), - e - } - function c(t, e) { - let n, a = e, i = "", o = ""; - for (; "" !== t[a] && a < t.length; ) - a++; - if (n = a - e, - n > 1) - for (let a = 0; a < n; a++) { - if (o = t[e + a], - o.match(r)) { - i = ""; - break - } - i += o, - a !== n - 1 && (i += "\n") - } - else - o = t[e], - o.match(r) || (i = o); - return i - } - return e = { - parse: function(t) { - const e = []; - let o, u; - if (!t) - return e; - o = (t = t.split(a)).length, - u = -1; - for (let a = 0; a < o; a++) { - let o = t[a]; - if (o.length > 0 && "WEBVTT" !== o && o.match(r)) { - const r = s(o) - , d = r.cuePoints - , f = r.styles - , g = c(t, a + 1) - , m = l(d[0].replace(i, "")) - , h = l(d[1].replace(i, "")); - !isNaN(m) && !isNaN(h) && m >= u && h > m ? "" !== g ? (u = m, - e.push({ - start: m, - end: h, - data: g, - styles: f - })) : n.error("Skipping cue due to empty/malformed cue text") : n.error("Skipping cue due to incorrect cue timing") - } - } - return e - }, - getCaptionStyles: u - }, - n = (0, - C.A)(t).getInstance().getLogger(e), - a = /(?:\r\n|\r|\n)/gm, - r = /-->/, - i = /(^[\s]+|[\s]+$)/g, - o = /\s\b/g, - e - } - Pl.__dashjs_factory_name = "VTTParser"; - var Fl = N.A.getSingletonFactory(Pl); - function Ul() { - let t, e; - return t = { - parse: function(t) { - let n = []; - return e.oncue = function(t) { - t.start = t.startTime, - t.end = t.endTime, - t.data = t.text, - t.styles = { - align: t.align, - line: t.line, - position: t.position, - size: t.size - }, - n.push(t) - } - , - e.parse(t), - n - } - }, - function() { - try { - window && window.WebVTT && window.WebVTT.Parser && (e = new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder())) - } catch (t) {} - }(), - t - } - Ul.__dashjs_factory_name = "VttCustomRenderingParser"; - var jl = N.A.getSingletonFactory(Ul); - function Bl() { - const t = this.context - , e = (0, - k.A)(t).getInstance(); - let n, a, r = 0; - function i() { - const t = "cue_TTML_" + r; - return r++, - t - } - return n = { - parse: function(t, n, r, o, l) { - let s = ""; - const u = []; - let c, d, f; - const g = {} - , m = {}; - let h = "" - , p = "" - , b = { - onOpenTag: function(t, n, r) { - if (r[" imagetype"] && !r[" imageType"] && (e.trigger(D.A.CONFORMANCE_VIOLATION, { - level: ka.LEVELS.ERROR, - event: ka.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE - }), - r[" imageType"] = r[" imagetype"]), - "image" === n && ("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt" === t || "http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt" === t)) { - if (!r[" imageType"] || "PNG" !== r[" imageType"].value) - return void a.warn("smpte-tt imageType != PNG. Discarded"); - h = r["http://www.w3.org/XML/1998/namespace id"].value - } - }, - onCloseTag: function() { - h && (m[h] = p.trim()), - p = "", - h = "" - }, - onText: function(t) { - h && (p += t) - } - }; - if (!t) - throw s = "no ttml data to parse", - new Error(s); - g.data = t, - e.trigger(R.A.TTML_TO_PARSE, g); - let y = (0, - Ml.fromXML)(g.data, (function(t) { - s = t - } - ), b); - e.trigger(R.A.TTML_PARSED, { - ttmlString: g.data, - ttmlDoc: y - }); - const E = y.getMediaTimeEvents(); - for (f = 0; f < E.length; f++) { - let t = (0, - Ml.generateISD)(y, E[f], (function(t) { - s = t - } - )); - t.contents.some((t => t.contents.length)) && (c = E[f] + n, - d = E[f + 1] + n, - c < d && u.push({ - start: c, - end: d, - type: "html", - cueID: i(), - isd: t, - images: l, - embeddedImages: m - })) - } - if ("" !== s) - throw a.error(s), - new Error(s); - return u - } - }, - a = (0, - C.A)(t).getInstance().getLogger(n), - n - } - Bl.__dashjs_factory_name = "TTMLParser"; - var ql = N.A.getSingletonFactory(Bl); - function Gl(t) { - let e = this.context; - const n = (0, - k.A)(e).getInstance() - , a = wt(e).getInstance() - , r = t.adapter - , i = t.baseURLController - , o = "error" - , l = "loaded" - , s = "unloaded"; - let u, c, d; - function f(t, e) { - let n, o, l = !1; - if (i.resolve()) { - const e = r.getVoRepresentations(t); - e && e.length > 0 && (n = i.resolve(e[0].path).url) - } - const u = t.essentialProperties.filter((t => t.schemeIdUri && t.schemeIdUri === w.A.FONT_DOWNLOAD_DVB_SCHEME)) - , c = t.supplementalProperties.filter((t => t.schemeIdUri && t.schemeIdUri === w.A.FONT_DOWNLOAD_DVB_SCHEME)); - u.length > 0 ? (l = !0, - o = u) : o = c, - o.forEach((r => { - if (function(t) { - return !(!(t.value && 1 === parseInt(t.value) && t.dvbUrl && t.dvbUrl.length > 0 && t.dvbFontFamily && t.dvbFontFamily.length > 0 && t.dvbMimeType) || t.dvbMimeType !== w.A.OFF_MIMETYPE && t.dvbMimeType !== w.A.WOFF_MIMETYPE) - }(r)) { - let u = (i = r.dvbUrl, - o = n, - a.isPathAbsolute(i) ? i : a.isRelative(i) ? o ? a.resolve(i, o) : a.resolve(i) : i); - d.push({ - fontFamily: r.dvbFontFamily, - url: u, - mimeType: r.dvbMimeType, - trackId: t.id, - streamId: e, - isEssential: l, - status: s, - fontFace: new FontFace(r.dvbFontFamily,`url(${u})`,{ - display: "swap" - }) - }) - } - var i, o - } - )) - } - function g(t, e) { - const n = d[t]; - d[t] = { - ...n, - status: e - } - } - function m() { - d = [] - } - return u = { - addFontsFromTracks: function(t, e) { - if (t && Array.isArray(t) && e) - for (let n = 0; n < t.length; n++) - f(t[n], e) - }, - downloadFonts: function() { - for (let t = 0; t < d.length; t++) { - let e = d[t]; - document.fonts.add(e.fontFace), - n.trigger(D.A.DVB_FONT_DOWNLOAD_ADDED, e), - e.fontFace.load().then(( () => { - g(t, l), - n.trigger(D.A.DVB_FONT_DOWNLOAD_COMPLETE, e) - } - ), (a => { - g(t, o), - c.debug("Font download error: ", a), - n.trigger(D.A.DVB_FONT_DOWNLOAD_FAILED, e) - } - )) - } - }, - getFonts: function() { - return d - }, - getFontsForTrackId: function(t) { - return d.filter((e => e.trackId && e.trackId === t)) - }, - reset: function() { - !function() { - for (const t of d) { - let e = document.fonts.delete(t.fontFace); - c.debug(`Removal of fontFamily: ${t.fontFamily} was ${e ? "successful" : "unsuccessful"}`) - } - }(), - m() - } - }, - c = (0, - C.A)(e).getInstance().getLogger(u), - m(), - u - } - Gl.__dashjs_factory_name = "DVBFonts"; - var Hl = N.A.getClassFactory(Gl); - function Yl(t) { - let e = this.context; - const n = t.adapter - , a = t.errHandler - , r = t.manifestModel - , i = t.mediaController - , o = t.baseURLController - , l = t.videoModel - , s = t.settings; - let u, c, d, f, g, m, h, p, b, y, E, _, A, T; - function v(t) { - if (T.error(`Could not download ${t.isEssential ? "an essential" : "a"} font - fontFamily: ${t.fontFamily}, url: ${t.url}`), - t.isEssential) { - let e = f[t.streamId].getTrackIdxForId(t.trackId); - f[t.streamId].setModeForTrackIdx(e, w.A.TEXT_DISABLED) - } - } - function I(t) { - if (T.debug(`Successfully downloaded ${t.isEssential ? "an essential" : "a"} font - fontFamily: ${t.fontFamily}, url: ${t.url}`), - t.isEssential) { - let e = f[t.streamId].getTrackIdxForId(t.trackId); - e === f[t.streamId].getCurrentTrackIdx() ? f[t.streamId].setModeForTrackIdx(e, w.A.TEXT_SHOWING) : f[t.streamId].setModeForTrackIdx(e, w.A.TEXT_HIDDEN) - } - } - function N(t) { - let e = t.tracks - , n = t.index; - const a = t.streamId; - if (!1 === s.get().streaming.text.defaultEnabled && !O() || _) - L(a, -1); - else { - const t = i.getCurrentTrackFor(w.A.TEXT, a); - if (t) { - const r = { - lang: t.lang, - role: t.roles[0], - index: t.index, - codec: t.codec, - accessibility: t.accessibility[0] - }; - e.some(( (t, e) => { - if (i.matchSettings(r, t)) - return L(a, e), - n = e, - !0 - } - )) - } - b = !1 - } - c[a].lastEnabledIndex = n, - p.trigger(D.A.TEXT_TRACKS_ADDED, { - enabled: O(), - index: n, - tracks: e, - streamId: a - }), - E = !0, - A.addFontsFromTracks(e, a), - A.getFonts().forEach((t => { - if (t.isEssential) { - let e = f[t.streamId].getTrackIdxForId(t.trackId); - f[t.streamId].setModeForTrackIdx(e, w.A.TEXT_DISABLED) - } - } - )), - A.downloadFonts() - } - function x(t) { - try { - const e = t.streamId; - if (!f[e] || isNaN(t.time)) - return; - f[e].manualCueProcessing(t.time) - } catch (t) {} - } - function M(t) { - try { - const e = t.streamId; - if (!f[e]) - return; - f[e].disableManualTracks() - } catch (t) {} - } - function z(t) { - try { - if (!t || !t.mediaType || t.mediaType !== w.A.AUDIO || !t.currentMediaInfo) - return; - const e = f[t.streamId].getCurrentTextTrackInfo(); - let n = NaN; - b ? n = P(t.streamId) : F(e) && t.currentMediaInfo.lang && t.currentMediaInfo.lang !== e.lang && (n = P(t.streamId), - isNaN(n) && (n = -1)), - isNaN(n) || L(t.streamId, n) - } catch (t) { - T.error(t) - } - } - function O() { - let t = !0; - return b && !y && (t = !1), - t - } - function L(t, e) { - b = -1 === e, - b && i && i.saveTextSettingsDisabled(); - let n = U(t); - if (n === e || !f[t]) - return; - f[t].disableManualTracks(); - let a = f[t].getCurrentTextTrackInfo() - , r = a ? l.getTextTrack(a.kind, a.id, a.lang, a.isTTML, a.isEmbedded) : null; - r && r.mode !== w.A.TEXT_DISABLED && f[t].setModeForTrackIdx(n, w.A.TEXT_HIDDEN), - f[t].setCurrentTrackIdx(e), - a = f[t].getCurrentTextTrackInfo(); - const o = s.get().streaming.text.dispatchForManualRendering; - if (a && !o && a.mode !== w.A.TEXT_DISABLED && f[t].setModeForTrackIdx(e, w.A.TEXT_SHOWING), - a && a.isFragmented && !a.isEmbedded) - !function(t, e, n) { - if (!d[t]) - return; - let a = d[t].getConfig().fragmentedTracks; - for (let r = 0; r < a.length; r++) { - let o = a[r]; - if (e.lang === o.lang && (o.id ? e.id === o.id : e.index === o.index)) { - let e = i.getCurrentTrackFor(w.A.TEXT, t); - (o.id ? e.id !== o.id : e.index !== o.index) ? (f[t].deleteCuesFromTrackIdx(n), - d[t].setCurrentFragmentedTrackIdx(r)) : -1 === n && p.trigger(R.A.SET_FRAGMENTED_TEXT_AFTER_DISABLED, {}, { - streamId: t, - mediaType: w.A.TEXT - }) - } - } - }(t, a, n); - else if (a && !a.isFragmented) - !function(t, e) { - p.trigger(R.A.SET_NON_FRAGMENTED_TEXT, { - currentTrackInfo: e - }, { - streamId: t, - mediaType: w.A.TEXT - }) - }(t, a); - else if (!a && b) { - const e = P(t); - return void (isNaN(e) || L(t, e)) - } - i.setTrack(a) - } - function P(t) { - const e = function(t) { - return f[t].getTextTrackInfos().filter(( (t, e) => (t._indexToSelect = e, - !!(t && t.roles && t.roles.length > 0) && F(t)))) - }(t); - if (!e || e.length <= 0) - return NaN; - const n = i.getCurrentTrackFor(w.A.AUDIO, t); - if (!n) - return NaN; - const a = e.find((t => n.lang === t.lang)); - return a ? a._indexToSelect : NaN - } - function F(t) { - return !(!t || !t.roles || 0 === t.roles.length) && t.roles.some((t => t.schemeIdUri === w.A.DASH_ROLE_SCHEME_ID && t.value === S.A.FORCED_SUBTITLE)) - } - function U(t) { - return f[t].getCurrentTrackIdx() - } - function j() { - d = {}, - f = {}, - c = {}, - b = !0, - E = !1, - _ = !1 - } - return u = { - addEmbeddedTrack: function(t, e) { - const n = t.id; - d[n] && d[n].addEmbeddedTrack(e) - }, - addMediaInfosToBuffer: function(t, e, n) { - let a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null; - const r = t.id; - d[r] && d[r].addMediaInfos(e, n, a) - }, - createTracks: function(t) { - const e = t.id; - f[e] && f[e].createTracks() - }, - deactivateStream: function(t) { - if (!t) - return; - const e = t.id; - d[e] && d[e].resetMediaInfos(), - f[e] && f[e].deleteAllTextTracks() - }, - enableForcedTextStreaming: function(t) { - return (0, - yt.sq)(t, "boolean"), - y = t, - !0 - }, - enableText: function(t, e) { - return (0, - yt.sq)(e, "boolean"), - O() !== e && (e && L(t, c[t].lastEnabledIndex), - e || (c[t].lastEnabledIndex = U(t), - E ? L(t, -1) : _ = !0)), - !0 - }, - getAllTracksAreDisabled: function() { - return b - }, - getCurrentTrackIdx: U, - getTextSourceBuffer: function(t) { - const e = t.id; - if (d && d[e]) - return d[e] - }, - initialize: function() { - A = Hl(e).create({ - adapter: n, - baseURLController: o - }), - p.on(R.A.TEXT_TRACKS_QUEUE_INITIALIZED, N, u), - p.on(R.A.DVB_FONT_DOWNLOAD_FAILED, v, u), - p.on(R.A.DVB_FONT_DOWNLOAD_COMPLETE, I, u), - p.on(R.A.MEDIAINFO_UPDATED, z, u), - s.get().streaming.text.webvtt.customRenderingEnabled && (p.on(R.A.PLAYBACK_TIME_UPDATED, x, u), - p.on(R.A.PLAYBACK_SEEKING, M, u)) - }, - initializeForStream: function(t) { - const o = t.id - , u = Ll(e).create({ - videoModel: l, - settings: s, - streamInfo: t - }); - u.initialize(), - f[o] = u; - const p = Dl(e).create({ - errHandler: a, - adapter: n, - dvbFonts: A, - manifestModel: r, - mediaController: i, - videoModel: l, - textTracks: u, - vttParser: g, - vttCustomRenderingParser: m, - ttmlParser: h, - streamInfo: t, - settings: s - }); - p.initialize(), - d[o] = p, - c[o] = {}, - c[o].lastEnabledIndex = -1 - }, - isTextEnabled: O, - reset: function() { - Object.keys(d).forEach((t => { - d[t].resetEmbedded(), - d[t].reset() - } - )), - A.reset(), - j(), - p.off(R.A.TEXT_TRACKS_QUEUE_INITIALIZED, N, u), - p.off(R.A.DVB_FONT_DOWNLOAD_FAILED, v, u), - p.off(R.A.DVB_FONT_DOWNLOAD_COMPLETE, I, u), - p.off(R.A.MEDIAINFO_UPDATED, z, u), - s.get().streaming.text.webvtt.customRenderingEnabled && (p.off(R.A.PLAYBACK_TIME_UPDATED, x, u), - p.off(R.A.PLAYBACK_SEEKING, M, u)) - }, - setTextTrack: L, - clearDataForStream: function(t) { - d[t] && (d[t].resetEmbedded(), - d[t].reset(), - delete d[t]), - f[t] && (f[t].deleteAllTextTracks(), - delete f[t]), - c[t] && delete c[t] - } - }, - y = !1, - E = !1, - _ = !1, - g = Fl(e).getInstance(), - m = jl(e).getInstance(), - h = ql(e).getInstance(), - p = (0, - k.A)(e).getInstance(), - T = (0, - C.A)(e).getInstance().getLogger(u), - j(), - u - } - Yl.__dashjs_factory_name = "TextController"; - var Vl = N.A.getClassFactory(Yl); - function Kl(t) { - t = t || {}; - const e = this.context - , n = (0, - C.A)(e).getInstance() - , a = t.settings - , r = (0, - k.A)(e).getInstance(); - let i, o, l, s, u, c; - function d() { - return navigator && navigator.connection && !isNaN(navigator.connection.downlink) && navigator.connection.downlink > 0 ? 1e3 * navigator.connection.downlink : NaN - } - function f(t, e, n, a) { - const r = Math.pow(.5, n / a.fast); - t.fastEstimate = (1 - r) * e + r * t.fastEstimate; - const i = Math.pow(.5, n / a.slow); - t.slowEstimate = (1 - i) * e + i * t.slowEstimate, - t.totalWeight += n - } - function g() { - i = {}, - o = {}, - l = {}, - s = {} - } - const m = { - addEntry: function(t, e) { - try { - if (!(t && e && e.trace && e.trace.length)) - return; - !function(t) { - i[t] = i[t] || [], - o[t] = o[t] || [], - l[t] = l[t] || { - fastEstimate: 0, - slowEstimate: 0, - totalWeight: 0 - }, - s[t] = s[t] || { - fastEstimate: 0, - slowEstimate: 0, - totalWeight: 0 - } - }(t); - const n = e.tresponse.getTime() - e.trequest.getTime() || 1; - let g = function(t, e) { - return t._fileLoaderType && t._fileLoaderType === w.A.FILE_LOADER_TYPES.FETCH ? function(t) { - const e = t.trace.reduce(( (t, e) => t + e.b[0]), 0) - , n = t.trace.reduce(( (t, e) => t + e.d), 0); - let r = NaN; - return a.get().streaming.abr.throughput.useNetworkInformationApi.fetch && (r = d()), - isNaN(r) && (r = Math.round(8 * e / n)), - { - downloadedBytes: e, - value: r, - downloadTimeInMs: n - } - }(t) : function(t, e) { - let n = NaN - , r = NaN - , i = !1; - if (a.get().streaming.abr.throughput.useResourceTimingApi && t._resourceTimingValues) - n = t._resourceTimingValues.transferSize, - r = t._resourceTimingValues.responseEnd - t._resourceTimingValues.responseStart, - i = !0; - else { - if (t.trace.length <= 1) - return { - throughput: NaN, - downloadTimeInMs: NaN - }; - n = t.trace.reduce(( (t, e) => t + e.b[0]), 0) - t.trace[0].b[0], - r = Math.max(t.trace.reduce(( (t, e) => t + e.d), 0) - t.trace[0].d, 1) - } - let o = NaN; - if (!i && a.get().streaming.abr.throughput.useNetworkInformationApi.xhr && (o = d()), - isNaN(o)) { - const t = a.get().streaming.abr.throughput.useDeadTimeLatency ? r : r + e; - o = Math.round(8 * n / t) - } - return { - downloadedBytes: n, - value: o, - downloadTimeInMs: r - } - }(t, e) - }(e, n); - if (g.latencyInMs = n, - isNaN(g.value) || !isFinite(g.value)) - return; - if (e.cmsd) { - const t = e.cmsd.dynamic && e.cmsd.dynamic.etp ? e.cmsd.dynamic.etp : null; - if (t) { - const e = a.get().streaming.cmsd.abr.etpWeightRatio; - e > 0 && e <= 1 && (g.value = g.value * (1 - e) + t * e) - } - } - if (function(t, e, n) { - return a.get().streaming.abr.throughput.useResourceTimingApi && n._resourceTimingValues ? 0 === n._resourceTimingValues.transferSize && n._resourceTimingValues.decodedBodySize > 0 : !isNaN(e) && (t === w.A.VIDEO ? e < a.get().streaming.cacheLoadThresholds[w.A.VIDEO] : t === w.A.AUDIO ? e < a.get().streaming.cacheLoadThresholds[w.A.AUDIO] : void 0) - }(t, e._tfinish.getTime() - e.trequest.getTime(), e)) - return void c.debug(`${t} Assuming segment ${e.url} came from cache, ignoring it for throughput calculation`); - c.debug(`Added throughput entry for ${t}: ${g.value} kbit/s`), - g.serviceLocation = e._serviceLocation, - i[t].push(g), - o[t].push({ - value: n - }), - function(t) { - i[t].length > a.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep && i[t].shift(), - o[t].length > a.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep && o[t].shift() - }(t), - r.trigger(D.A.THROUGHPUT_MEASUREMENT_STORED, { - throughputValues: g - }), - e.type !== z.G.MPD_TYPE && (f(l[t], g.value, a.get().streaming.abr.throughput.ewma.weightDownloadTimeMultiplicationFactor * g.downloadTimeInMs, u.bandwidthHalfLife), - f(s[t], n, 1, u.latencyHalfLife)) - } catch (t) { - c.error(t) - } - }, - getThroughputDict: function(t) { - return t ? i[t] : i - }, - getEwmaThroughputDict: function(t) { - return t ? l[t] : l - }, - getEwmaLatencyDict: function(t) { - return t ? s[t] : s - }, - getEwmaHalfLife: function() { - return u - }, - getLatencyDict: function(t) { - return t ? o[t] : o - }, - reset: g - }; - return c = n.getLogger(m), - u = { - bandwidthHalfLife: { - fast: a.get().streaming.abr.throughput.ewma.throughputFastHalfLifeSeconds, - slow: a.get().streaming.abr.throughput.ewma.throughputSlowHalfLifeSeconds - }, - latencyHalfLife: { - fast: a.get().streaming.abr.throughput.ewma.latencyFastHalfLifeCount, - slow: a.get().streaming.abr.throughput.ewma.latencySlowHalfLifeCount - } - }, - g(), - m - } - Kl.__dashjs_factory_name = "ThroughputModel"; - var Wl = N.A.getClassFactory(Kl); - function $l() { - const t = this.context - , e = (0, - k.A)(t).getInstance(); - let n, a, r; - function i() { - performance.clearResourceTimings() - } - function o(t) { - t.metric !== I.HTTP_REQUEST || !t.value || t.value.type !== z.G.MPD_TYPE && (t.value.type !== z.G.MEDIA_SEGMENT_TYPE || t.mediaType !== w.A.AUDIO && t.mediaType !== w.A.VIDEO) || n.addEntry(t.mediaType, t.value) - } - function l(t, e) { - let i, o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, l = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : NaN, b = null, y = n.getEwmaHalfLife(), E = null, _ = !0; - switch (o || (o = r.get().streaming.abr.throughput.averageCalculationMode), - t) { - case w.A.THROUGHPUT_TYPES.BANDWIDTH: - b = o === w.A.THROUGHPUT_CALCULATION_MODES.EWMA ? n.getEwmaThroughputDict(e) : n.getThroughputDict(e), - E = y.bandwidthHalfLife, - _ = !0, - l = isNaN(l) ? a.getIsDynamic() ? r.get().streaming.abr.throughput.sampleSettings.live : r.get().streaming.abr.throughput.sampleSettings.vod : l; - break; - case w.A.THROUGHPUT_TYPES.LATENCY: - b = o === w.A.THROUGHPUT_CALCULATION_MODES.EWMA ? n.getEwmaLatencyDict(e) : n.getLatencyDict(e), - E = y.latencyHalfLife, - _ = !1, - l = isNaN(l) ? r.get().streaming.abr.throughput.sampleSettings.averageLatencySampleAmount : l - } - if (!b || 0 === b.length) - return NaN; - switch (o) { - case w.A.THROUGHPUT_CALCULATION_MODES.ARITHMETIC_MEAN: - return i = s(b, l, t), - u(b, i); - case w.A.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_ARITHMETIC_MEAN: - return i = s(b, l, t), - c(b, i); - case w.A.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_ARITHMETIC_MEAN: - return i = s(b, l, t), - d(b, i); - case w.A.THROUGHPUT_CALCULATION_MODES.HARMONIC_MEAN: - return i = s(b, l, t), - f(b, i); - case w.A.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_HARMONIC_MEAN: - return i = s(b, l, t), - g(b, i); - case w.A.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_HARMONIC_MEAN: - return i = s(b, l, t), - m(b, i); - case w.A.THROUGHPUT_CALCULATION_MODES.EWMA: - return h(b, E, _); - case w.A.THROUGHPUT_CALCULATION_MODES.ZLEMA: - return i = s(b, l, t), - p(b, i) - } - } - function s(t, e, n) { - if (t) { - if (e >= t.length) - e = t.length; - else if (n === w.A.THROUGHPUT_TYPES.BANDWIDTH && r.get().streaming.abr.throughput.sampleSettings.enableSampleSizeAdjustment) - for (let n = 1; n < e; ++n) { - const a = t[t.length - n].value / t[t.length - n - 1].value; - if ((a >= r.get().streaming.abr.throughput.sampleSettings.increaseScale || a <= r.get().streaming.abr.throughput.sampleSettings.decreaseScale) && (e += 1) === t.length) - break - } - } else - e = 0; - return e - } - function u(t, e) { - let n = t; - return 0 !== e && n && 0 !== n.length ? (n = n.slice(-e), - n.reduce(( (t, e) => t + e.value), 0) / n.length) : NaN - } - function c(t, e) { - let n = t; - if (0 === e || !n || 0 === n.length) - return NaN; - n = n.slice(-e); - let a = 0; - return n.reduce(( (t, e) => { - let n = Math.sqrt(e.downloadedBytes); - return a += n, - t + e.value * n - } - ), 0) / a - } - function d(t, e) { - let n = t; - if (0 === e || !n || 0 === n.length) - return NaN; - n = n.slice(-e); - let a = 0; - return n.reduce(( (t, e, n) => { - let r = n + 1; - return a += r, - t + e.value * r - } - ), 0) / a - } - function f(t, e) { - let n = t; - if (0 === e || !n || 0 === n.length) - return NaN; - n = n.slice(-e); - const a = n.reduce(( (t, e) => t + 1 / e.value), 0); - return n.length / a - } - function g(t, e) { - let n = t; - if (0 === e || !n || 0 === n.length) - return NaN; - n = n.slice(-e); - let a = 0; - const r = n.reduce(( (t, e) => { - let n = Math.sqrt(e.downloadedBytes); - return a += n, - t + 1 / e.value * n - } - ), 0); - return a / r - } - function m(t, e) { - let n = t; - if (0 === e || !n || 0 === n.length) - return NaN; - n = n.slice(-e); - let a = 0; - const r = n.reduce(( (t, e, n) => { - let r = n + 1; - return a += r, - t + 1 / e.value * r - } - ), 0); - return a / r - } - function h(t, e) { - let n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2]; - if (!t || t.totalWeight <= 0) - return NaN; - const a = t.fastEstimate / (1 - Math.pow(.5, t.totalWeight / e.fast)) - , r = t.slowEstimate / (1 - Math.pow(.5, t.totalWeight / e.slow)); - return n ? Math.min(a, r) : Math.max(a, r) - } - function p(t, e) { - if (0 === e || !t || 0 === t.length) - return NaN; - let n = t.slice(-e).map((t => t.value)) - , a = 2 / (n.length + 1) - , r = n[n.length - 1] - , i = n[n.length - 1]; - for (let t = 0; t < n.length; t++) - r = a * n[t] + (1 - a) * r, - i = a * r + (1 - a) * i; - return i - } - function b(t) { - let e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null - , n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : NaN; - const a = l(w.A.THROUGHPUT_TYPES.BANDWIDTH, t, e, n); - return Math.round(a) - } - const y = { - getArithmeticMean: u, - getAverageLatency: function(t) { - let e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null - , n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : NaN; - const a = l(w.A.THROUGHPUT_TYPES.LATENCY, t, e, n); - return Math.round(a) - }, - getAverageThroughput: b, - getByteSizeWeightedArithmeticMean: c, - getByteSizeWeightedHarmonicMean: g, - getDateWeightedArithmeticMean: d, - getDateWeightedHarmonicMean: m, - getEwma: h, - getHarmonicMean: f, - getRawThroughputData: function(t) { - return t ? n.getThroughputDict(t) : [] - }, - getSafeAverageThroughput: function(t) { - let e = b(t, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : NaN); - return isNaN(e) || (e *= r.get().streaming.abr.throughput.bandwidthSafetyFactor), - e - }, - getZlema: p, - initialize: function() { - n = Wl(t).create({ - settings: r - }), - e.on(D.A.METRIC_ADDED, o, y), - performance && performance.addEventListener("resourcetimingbufferfull", i) - }, - reset: function() { - n.reset(), - e.off(D.A.METRIC_ADDED, o, y), - performance && performance.removeEventListener("resourcetimingbufferfull", i) - }, - setConfig: function(t) { - t.settings && (r = t.settings), - t.playbackController && (a = t.playbackController) - } - }; - return y - } - $l.__dashjs_factory_name = "ThroughputController"; - var Xl = N.A.getSingletonFactory($l); - function Ql() { - const t = "You must first call initialize() and set a source before calling this method" - , e = "You must first call initialize() and set a valid source and view before calling this method" - , n = "You must first call attachView() to set the video element before calling this method" - , a = "You must first call attachSource() with a valid source before calling this method" - , r = "MediaPlayer not initialized!" - , i = this.context - , o = (0, - k.A)(i).getInstance(); - let l = (0, - K.A)(i).getInstance(); - const s = (0, - C.A)(i).getInstance({ - settings: l - }); - let u, c, d, f, g, m, h, p, b, y, E, _, A, T, x, O, L, P, F, U, j, B, q, H, Y, W, $, X, Q, Z, J, tt, et, nt, at, rt, it, ot, lt, st, ut; - function ct() { - It(null), - vt(null), - f = null, - x && (x.reset(), - x = null), - O && (O.reset(), - O = null), - j && j.reset(), - l.reset(), - P && (P.reset(), - P = null) - } - function dt() { - return !!d && !!it.getElement() - } - function ft() { - return (0, - vo.i)() - } - function gt() { - if (!h) - throw e; - return Q.isPaused() - } - function mt() { - if (!h) - throw e; - return Q.getIsDynamic() - } - function ht(t) { - const e = W && W.hasVideoTrack() ? w.A.VIDEO : w.A.AUDIO; - let n = et.getCurrentDVRInfo(e); - return n ? pt(n.range.start + t, n) : 0 - } - function pt(t, e) { - let n = Q.getOriginalLiveDelay(); - return t > e.range.end - n && (t = e.range.end - n), - t - } - function bt() { - let t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ""; - if (!h) - throw e; - let n = Tt().currentTime; - return "" !== t && (n = W.getTimeRelativeToStreamId(n, t)), - n - } - function Et(t) { - (0, - yt.sq)(t, "boolean"), - p = t - } - function _t() { - j.restoreDefaultUTCTimingSources() - } - function At() { - return et - } - function Tt() { - if (!it.getElement()) - throw n; - return it.getElement() - } - function vt(t) { - if (!g) - throw r; - it.setElement(t), - t && (Ct(), - function() { - if (O || "undefined" == typeof dashjs) - return; - let t = dashjs.MetricsReporting; - if ("function" == typeof t) { - let e = t(i).create(); - O = e.createMetricsReporting({ - debug: s, - eventBus: o, - mediaElement: Tt(), - adapter: F, - dashMetrics: et, - mediaPlayerModel: U, - events: R.A, - constants: w.A, - metricsConstants: I - }) - } - }(), - function() { - if (L || "undefined" == typeof dashjs) - return; - let t = dashjs.MssHandler; - "function" == typeof t && (V.extend(t.errors), - L = t(i).create({ - eventBus: o, - mediaPlayerModel: U, - dashMetrics: et, - manifestModel: nt, - playbackController: Q, - streamController: W, - protectionController: x, - baseURLController: q, - errHandler: B, - events: R.A, - constants: w.A, - debug: s, - initSegmentType: z.G.INIT_SEGMENT_TYPE, - BASE64: _l, - ISOBoxer: Jn, - settings: l - })) - }(), - W && W.switchToVideoElement(b)), - h && Rt(), - xt(b) - } - function St(e) { - if (!m) - throw t; - let n = W.getActiveStreamInfo(); - return n ? T.getTracksFor(e, n.id).filter((t => !x || x.areKeyIdsUsable(t.normalizedKeyIds))) : [] - } - function It(t) { - let e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : NaN; - if (!g) - throw r; - "string" == typeof t && ot.initialize(t), - null == e && (e = NaN), - isNaN(e) || (e = Math.max(0, e)), - b = e, - d = t, - (m || h) && Rt(), - dt() && xt(b) - } - function kt() { - if (!m) - throw t; - let e = W.getActiveStreamInfo(); - return e ? W.getStreamById(e.id) : null - } - function Rt() { - h = !1, - m = !1, - F.reset(), - W.reset(), - X.reset(), - tt.reset(), - Q.reset(), - Z.reset(), - J.reset(), - y.reset(), - E.reset(), - T.reset(), - st.reset(), - x && (l.get().streaming.protection.keepProtectionMediaKeys ? x.stop() : (x.reset(), - x = null, - Ct())), - $.reset(), - at.reset(), - rt.reset() - } - function Nt() { - return ii(i).create({ - debug: s, - errHandler: B, - dashMetrics: et, - mediaPlayerModel: U, - mssHandler: L, - settings: l - }) - } - function Ct() { - if (x) - return x; - if ("undefined" == typeof dashjs) - return null; - let t = dashjs.Protection; - if ("function" == typeof t) { - let e = t(i).create(); - return R.A.extend(t.events), - D.A.extend(t.events, { - publicOnly: !0 - }), - V.extend(t.errors), - x = e.createProtectionSystem({ - debug: s, - errHandler: B, - videoModel: it, - customParametersModel: j, - capabilities: H, - eventBus: o, - events: R.A, - BASE64: _l, - constants: w.A, - cmcdModel: at, - settings: l - }), - H || (H = (0, - si.A)(i).getInstance()), - H.setProtectionController(x), - x - } - return null - } - function Dt() { - if (!g) - throw r; - if (P) - return P; - if ("undefined" == typeof dashjs) - return null; - let t = dashjs.OfflineController; - if ("function" == typeof t) { - R.A.extend(t.events), - D.A.extend(t.events, { - publicOnly: !0 - }), - V.extend(t.errors); - const e = Nt() - , n = Ea(i).create(); - return n.setConfig({ - manifestModel: nt, - adapter: F, - manifestLoader: e, - errHandler: B, - contentSteeringController: J - }), - P = t(i).create({ - debug: s, - manifestUpdater: n, - baseURLController: q, - manifestLoader: e, - manifestModel: nt, - mediaPlayerModel: U, - abrController: y, - playbackController: Q, - adapter: F, - errHandler: B, - dashMetrics: et, - timelineConverter: A, - segmentBaseController: st, - schemeLoaderFactory: _, - eventBus: o, - events: R.A, - errors: V, - constants: w.A, - settings: l, - dashConstants: S.A, - urlUtils: wt(i).getInstance() - }), - P - } - return null - } - function xt() { - let t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : NaN; - P && P.resetRecords(), - !m && d && (m = !0, - c.info("Streaming Initialized"), - function() { - const t = Nt(); - W || (W = Da(i).getInstance()), - $ || ($ = Vl(i).create({ - errHandler: B, - manifestModel: nt, - adapter: F, - mediaController: T, - baseURLController: q, - videoModel: it, - settings: l - })), - Y.setConfig({ - capabilities: H, - customParametersModel: j, - adapter: F, - settings: l, - protectionController: x, - manifestModel: nt, - errHandler: B - }), - W.setConfig({ - capabilities: H, - capabilitiesFilter: Y, - manifestLoader: t, - manifestModel: nt, - mediaPlayerModel: U, - customParametersModel: j, - protectionController: x, - textController: $, - adapter: F, - dashMetrics: et, - errHandler: B, - timelineConverter: A, - videoModel: it, - playbackController: Q, - serviceDescriptionController: Z, - contentSteeringController: J, - abrController: y, - throughputController: E, - mediaController: T, - settings: l, - baseURLController: q, - uriFragmentModel: ot, - segmentBaseController: st - }), - X.setConfig({ - settings: l, - playbackController: Q, - streamController: W, - videoModel: it, - timelineConverter: A, - adapter: F - }), - Q.setConfig({ - streamController: W, - serviceDescriptionController: Z, - dashMetrics: et, - adapter: F, - videoModel: it, - timelineConverter: A, - settings: l - }), - tt.setConfig({ - streamController: W, - playbackController: Q, - mediaPlayerModel: U, - videoModel: it, - settings: l - }), - E.setConfig({ - settings: l, - playbackController: Q - }), - y.setConfig({ - streamController: W, - capabilities: H, - domStorage: lt, - mediaPlayerModel: U, - customParametersModel: j, - throughputController: E, - cmsdModel: rt, - dashMetrics: et, - adapter: F, - videoModel: it, - settings: l - }), - at.setConfig({ - abrController: y, - dashMetrics: et, - playbackController: Q, - serviceDescriptionController: Z, - throughputController: E - }), - ut.setConfig({ - serviceDescriptionController: Z - }), - rt.setConfig({}), - T.initialize(), - E.initialize(), - y.initialize(), - W.initialize(p, f), - $.initialize(), - X.initialize(), - tt.initialize(), - at.initialize(p), - rt.initialize(), - J.initialize(), - st.initialize() - }(), - "string" == typeof d ? W.load(d, t) : W.loadWithManifest(d, t)), - !h && dt() && (h = !0, - o.trigger(D.A.PLAYBACK_INITIALIZED), - c.info("Playback Initialized")) - } - return u = { - addABRCustomRule: function(t, e, n) { - j.addAbrCustomRule(t, e, n) - }, - addRequestInterceptor: function(t) { - j.addRequestInterceptor(t) - }, - addResponseInterceptor: function(t) { - j.addResponseInterceptor(t) - }, - addUTCTimingSource: function(t, e) { - j.addUTCTimingSource(t, e) - }, - attachProtectionController: function(t) { - x = t - }, - attachSource: It, - attachTTMLRenderingDiv: function(t) { - if (!it.getElement()) - throw n; - it.setTTMLRenderingDiv(t) - }, - attachView: vt, - attachVttRenderingDiv: function(t) { - if (!it.getElement()) - throw n; - it.setVttRenderingDiv(t) - }, - clearDefaultUTCTimingSources: function() { - j.clearDefaultUTCTimingSources() - }, - convertToTimeCode: function(t) { - t = Math.max(t, 0); - let e = Math.floor(t / 3600) - , n = Math.floor(t % 3600 / 60) - , a = Math.floor(t % 3600 % 60); - return (0 === e ? "" : e < 10 ? "0" + e.toString() + ":" : e.toString() + ":") + (n < 10 ? "0" + n.toString() : n.toString()) + ":" + (a < 10 ? "0" + a.toString() : a.toString()) - }, - destroy: function() { - ct(), - N.A.deleteSingletonInstances(i) - }, - duration: function() { - if (!h) - throw e; - let t = Tt().duration; - if (Q.getIsDynamic()) { - const e = W && W.hasVideoTrack() ? w.A.VIDEO : w.A.AUDIO; - let n = et.getCurrentDVRInfo(e); - t = n ? n.range.end - n.range.start : 0 - } - return t - }, - enableForcedTextStreaming: function(t) { - return !(!W.getActiveStreamInfo() || !$) && $.enableForcedTextStreaming(t) - }, - enableText: function(t) { - const e = W.getActiveStreamInfo(); - return !(!e || !$) && $.enableText(e.id, t) - }, - extend: function(t, e, n) { - N.A.extend(t, e, n, i) - }, - formatUTC: function(t, e, n) { - let a = arguments.length > 3 && void 0 !== arguments[3] && arguments[3]; - const r = new Date(1e3 * t) - , i = r.toLocaleDateString(e) - , o = r.toLocaleTimeString(e, { - hour12: n - }); - return a ? o + " " + i : o - }, - getABRCustomRules: function() { - return j.getAbrCustomRules() - }, - getActiveStream: kt, - getAutoPlay: function() { - return p - }, - getAvailableBaseUrls: function() { - const t = nt.getValue(); - return t ? q.getBaseUrls(t) : [] - }, - getAvailableLocations: function() { - const t = nt.getValue(); - if (!t) - return []; - const e = F.getLocation(t) - , n = J.getSynthesizedLocationElements(e); - return e.concat(n) - }, - getAverageLatency: function() { - let t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : w.A.VIDEO - , e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null - , n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : NaN; - return E ? E.getAverageLatency(t, e, n) : 0 - }, - getAverageThroughput: function() { - let t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : w.A.VIDEO - , e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null - , n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : NaN; - return E ? E.getAverageThroughput(t, e, n) : 0 - }, - getBufferLength: function(t) { - const e = [w.A.VIDEO, w.A.AUDIO, w.A.TEXT]; - if (t) { - if (-1 !== e.indexOf(t)) { - return At().getCurrentBufferLevel(t) || NaN - } - return c.warn("getBufferLength requested for invalid type"), - NaN - } - { - const t = e.map((t => St(t).length > 0 ? At().getCurrentBufferLevel(t) : Number.MAX_VALUE)).reduce(( (t, e) => Math.min(t, e))); - return t === Number.MAX_VALUE ? NaN : t - } - }, - getCurrentLiveLatency: function() { - if (!g) - throw r; - return h ? Q.getCurrentLiveLatency() : NaN - }, - getCurrentRepresentationForType: function(e) { - if (!m) - throw t; - if (e !== w.A.IMAGE && e !== w.A.VIDEO && e !== w.A.AUDIO) - return null; - const n = kt(); - if (!n) - return null; - if (e === w.A.IMAGE) { - const t = n.getThumbnailController(); - return t ? t.getCurrentTrack() : -1 - } - return n.getCurrentRepresentationForType(e) - }, - getCurrentSteeringResponseData: function() { - if (J) - return J.getCurrentSteeringResponseData() - }, - getCurrentTextTrackIndex: function() { - let t = NaN; - const e = W.getActiveStreamInfo(); - if (e && $) - return t = $.getCurrentTrackIdx(e.id), - t - }, - getCurrentTrackFor: function(e) { - if (!m) - throw t; - let n = W.getActiveStreamInfo(); - return n ? T.getCurrentTrackFor(e, n.id) : null - }, - getDashAdapter: function() { - return F - }, - getDashMetrics: At, - getDebug: function() { - return s - }, - getDvrSeekOffset: ht, - getDvrWindow: function() { - if (!h) - throw e; - const t = W && W.hasVideoTrack() ? w.A.VIDEO : w.A.AUDIO; - let n = et.getCurrentDVRInfo(t); - if (!n) - return {}; - let a = 0; - const r = Q.getIsDynamic(); - return r && (a = n.manifestInfo.availableFrom.getTime() / 1e3), - { - start: n.range.start, - end: n.range.end, - startAsUtc: r ? a + n.range.start : NaN, - endAsUtc: r ? a + n.range.end : NaN, - size: n.range.end - n.range.start - } - }, - getInitialMediaSettingsFor: function(t) { - if (!g) - throw r; - return T.getInitialSettings(t) - }, - getLowLatencyModeEnabled: function() { - if (!h) - throw e; - return Q.getLowLatencyModeEnabled() - }, - getManifest: function() { - return nt.getValue() - }, - getOfflineController: function() { - return Dt() - }, - getPlaybackRate: function() { - return Tt().playbackRate - }, - getProtectionController: function() { - return Ct() - }, - getRawThroughputData: function() { - let t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : w.A.VIDEO; - return E ? E.getRawThroughputData(t) : [] - }, - getRepresentationsByType: function(e) { - let n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null; - if (!m) - throw t; - let a = n ? W.getStreamById(n) : kt(); - return a ? a.getRepresentationsByType(e) : [] - }, - getSafeAverageThroughput: function() { - let t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : w.A.VIDEO - , e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null - , n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : NaN; - return E ? E.getSafeAverageThroughput(t, e, n) : 0 - }, - getSettings: function() { - return l.get() - }, - getSource: function() { - if (!d) - throw a; - return d - }, - getStreamsFromManifest: function(e) { - if (!m) - throw t; - return F.getStreamsInfo(e) - }, - getTTMLRenderingDiv: function() { - return it ? it.getTTMLRenderingDiv() : null - }, - getTargetLiveDelay: function() { - if (!h) - throw e; - return Q.getOriginalLiveDelay() - }, - getTracksFor: St, - getTracksForTypeFromManifest: function(e, n, a) { - if (!m) - throw t; - return (a = a || F.getStreamsInfo(n, 1)[0]) ? F.getAllMediaInfoForType(a, e, n) : [] - }, - getVersion: ft, - getVideoElement: Tt, - getVolume: function() { - return Tt().volume - }, - getXHRWithCredentialsForType: function(t) { - return j.getXHRWithCredentialsForType(t) - }, - initialize: function(t, e, n) { - let a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : NaN; - H || (H = (0, - si.A)(i).getInstance(), - H.setConfig({ - settings: l, - protectionController: x - })), - B || (B = li(i).getInstance()), - H.supportsMediaSource() ? (g || (g = !0, - A = pl(i).getInstance(), - E || (E = Xl(i).getInstance()), - y || (y = co(i).getInstance()), - _ || (_ = Un(i).getInstance()), - Q || (Q = M(i).getInstance()), - T || (T = mr(i).getInstance()), - W || (W = Da(i).getInstance()), - X || (X = Ma(i).getInstance()), - tt || (tt = Oa(i).getInstance()), - Z || (Z = ja(i).getInstance()), - J || (J = ha(i).getInstance()), - Y || (Y = ci(i).getInstance()), - F = Ko(i).getInstance(), - nt = hi(i).getInstance(), - at = an(i).getInstance(), - rt = In(i).getInstance(), - ut = Dn(i).getInstance(), - et = ul(i).getInstance({ - settings: l - }), - lt = To(i).getInstance({ - settings: l - }), - F.setConfig({ - constants: w.A, - cea608parser: new v, - errHandler: B, - BASE64: _l - }), - q || (q = Rr(i).create()), - q.setConfig({ - adapter: F, - contentSteeringController: J - }), - Z.setConfig({ - adapter: F - }), - st || (st = Do(i).getInstance({ - dashMetrics: et, - mediaPlayerModel: U, - errHandler: B, - baseURLController: q, - events: R.A, - eventBus: o, - debug: s, - boxParser: na(i).getInstance(), - errors: V - })), - T.setConfig({ - domStorage: lt, - settings: l, - mediaPlayerModel: U, - customParametersModel: j, - videoModel: it - }), - U.setConfig({ - playbackController: Q, - serviceDescriptionController: Z - }), - J.setConfig({ - adapter: F, - errHandler: B, - dashMetrics: et, - mediaPlayerModel: U, - manifestModel: nt, - serviceDescriptionController: Z, - throughputController: E, - eventBus: o - }), - _t(), - Et(void 0 === n || n), - Dt()), - t && vt(t), - e && It(e, a), - c.info("[dash.js " + ft() + "] MediaPlayer has been initialized")) : B.error(new G.A(V.CAPABILITY_MEDIASOURCE_ERROR_CODE,V.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE)) - }, - isDynamic: mt, - isMuted: function() { - return Tt().muted - }, - isPaused: gt, - isReady: dt, - isSeeking: function() { - if (!h) - throw e; - return Q.isSeeking() - }, - isTextEnabled: function() { - const t = W.getActiveStreamInfo(); - return !(!t || !$) && $.isTextEnabled(t) - }, - off: function(t, e, n) { - o.off(t, e, n) - }, - on: function(t, e, n, a) { - o.on(t, e, n, a) - }, - pause: function() { - if (!h) - throw e; - Q.pause() - }, - play: function() { - if (!h) - throw e; - (!p || gt() && h) && Q.play(!0) - }, - preload: function() { - if (!it.getElement() && !m) { - if (!d) - throw a; - xt(b) - } - }, - provideThumbnail: function(t, e) { - if ("function" != typeof e) - return; - if (t < 0) - return void e(null); - const n = Q.getIsDynamic() ? ht(t) : t - , a = W.getStreamForTime(n); - if (null === a) - return void e(null); - const r = a.getThumbnailController(); - if (r) - return r.provide(n, e); - e(null) - }, - refreshManifest: function(t) { - if (!g) - throw r; - if (!dt()) - return t(null, a); - let e = this; - if ("function" == typeof t) { - const n = function(a) { - o.off(R.A.INTERNAL_MANIFEST_LOADED, n, e), - a.error ? t(null, a.error) : t(a.manifest) - }; - o.on(R.A.INTERNAL_MANIFEST_LOADED, n, e) - } - W.refreshManifest() - }, - registerCustomCapabilitiesFilter: function(t) { - j.registerCustomCapabilitiesFilter(t) - }, - registerLicenseRequestFilter: function(t) { - j.registerLicenseRequestFilter(t) - }, - registerLicenseResponseFilter: function(t) { - j.registerLicenseResponseFilter(t) - }, - removeABRCustomRule: function(t) { - j.removeAbrCustomRule(t) - }, - removeAllABRCustomRule: function() { - j.removeAllAbrCustomRule() - }, - removeRequestInterceptor: function(t) { - j.removeRequestInterceptor(t) - }, - removeResponseInterceptor: function(t) { - j.removeResponseInterceptor(t) - }, - removeUTCTimingSource: function(t, e) { - j.removeUTCTimingSource(t, e) - }, - reset: ct, - resetCustomInitialTrackSelectionFunction: function() { - j.resetCustomInitialTrackSelectionFunction(null) - }, - resetSettings: function() { - l.reset() - }, - restoreDefaultUTCTimingSources: _t, - retrieveManifest: function(t, e) { - let n = Nt() - , a = this; - const r = function(t) { - t.error ? e(null, t.error) : e(t.manifest), - o.off(R.A.INTERNAL_MANIFEST_LOADED, r, a), - n.reset() - }; - o.on(R.A.INTERNAL_MANIFEST_LOADED, r, a), - ot.initialize(t), - n.load(t) - }, - seek: function(t) { - if (!h) - throw e; - if ((0, - yt.sq)(t, "number"), - isNaN(t)) - throw w.A.BAD_ARGUMENT_ERROR; - t < 0 && (t = 0); - let n = Q.getIsDynamic() ? ht(t) : t; - const a = Tt(); - !Q.getIsDynamic() && a.duration && (n = Math.min(a.duration, n)), - Q.seek(n, !1, !1, !0) - }, - seekToOriginalLive: function() { - h && mt() && Q.seekToOriginalLive() - }, - seekToPresentationTime: function(t) { - if (!h) - throw e; - if ((0, - yt.sq)(t, "number"), - isNaN(t)) - throw w.A.BAD_ARGUMENT_ERROR; - t < 0 && (t = 0); - const n = Tt(); - if (!Q.getIsDynamic() && n.duration && (t = Math.min(n.duration, t)), - Q.getIsDynamic()) { - const e = W && W.hasVideoTrack() ? w.A.VIDEO : w.A.AUDIO; - let n = et.getCurrentDVRInfo(e); - if (!n) - return; - (t = pt(t, n)) < n.range.start && (t = n.range.start) - } - Q.seek(t, !1, !1, !0) - }, - setAutoPlay: Et, - setConfig: function(t) { - t && (t.capabilities && (H = t.capabilities), - t.capabilitiesFilter && (Y = t.capabilitiesFilter), - t.streamController && (W = t.streamController), - t.textController && ($ = t.textController), - t.gapController && (X = t.gapController), - t.throughputController && (E = t.throughputController), - t.playbackController && (Q = t.playbackController), - t.serviceDescriptionController && (Z = t.serviceDescriptionController), - t.contentSteeringController && (J = t.contentSteeringController), - t.clientDataReportingController && (ut = t.clientDataReportingController), - t.catchupController && (tt = t.catchupController), - t.mediaPlayerModel && (U = t.mediaPlayerModel), - t.customParametersModel && (j = t.customParametersModel), - t.abrController && (y = t.abrController), - t.schemeLoaderFactory && (_ = t.schemeLoaderFactory), - t.mediaController && (T = t.mediaController), - t.settings && (l = t.settings), - t.dashMetrics && (et = t.dashMetrics)) - }, - setCurrentTrack: function(e) { - let n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; - if (!m) - throw t; - !x || x.areKeyIdsUsable(e.normalizedKeyIds) ? T.setTrack(e, { - noSettingsSave: n - }) : c.error(`Can not switch to track with index ${e.index} because key is not usable`) - }, - setCustomInitialTrackSelectionFunction: function(t) { - j.setCustomInitialTrackSelectionFunction(t) - }, - setInitialMediaSettingsFor: function(t, e) { - if (!g) - throw r; - let n = function(t) { - const e = l.get().streaming.defaultSchemeIdUri; - let n = {}; - function a(t, e, n) { - let a = {}; - if (e) { - if (e instanceof Array) - throw "Array type not supported for settings!"; - return e instanceof Object ? (a.schemeIdUri = e.schemeIdUri ? e.schemeIdUri : "", - a.value = e.value ? e.value : "") : (a.schemeIdUri = n, - a.value = e, - c.warn("No schemeIdUri provided for " + t + ', using default "' + n + '"')), - a - } - return null - } - return void 0 !== t.id && (n.id = t.id), - void 0 !== t.lang && (n.lang = t.lang), - isNaN(t.index) || (n.index = t.index), - void 0 !== t.viewpoint && (n.viewpoint = a("viewpoint", t.viewpoint, e.viewpoint)), - void 0 !== t.audioChannelConfiguration && (n.audioChannelConfiguration = a("audioChannelConfiguration", t.audioChannelConfiguration, e.audioChannelConfiguration)), - void 0 !== t.role && (n.role = a("role", t.role, e.role), - n.role.schemeIdUri === w.A.DASH_ROLE_SCHEME_ID && "Main" === n.role.value && (n.role.value = S.A.MAIN)), - void 0 !== t.accessibility && (n.accessibility = a("accessibility", t.accessibility, e.accessibility)), - n - }(e); - T.setInitialSettings(t, n) - }, - setMute: function(t) { - (0, - yt.sq)(t, "boolean"), - Tt().muted = t - }, - setPlaybackRate: function(t) { - Tt().playbackRate = t - }, - setProtectionData: function(t) { - f = t, - W && W.setProtectionData(f) - }, - setRepresentationForTypeById: function(e, n) { - let a = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; - if (e !== w.A.IMAGE && e !== w.A.VIDEO && e !== w.A.AUDIO) - return; - if (!m) - throw t; - const r = kt(); - if (r) - if (e === w.A.IMAGE) { - const t = r.getThumbnailController(); - t && t.setTrackById(n) - } else { - const t = r.getRepresentationForTypeById(e, n); - t && y.setPlaybackQuality(e, W.getActiveStreamInfo(), t, { - forceReplace: a - }) - } - }, - setRepresentationForTypeByIndex: function(e, n) { - let a = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; - if (e !== w.A.IMAGE && e !== w.A.VIDEO && e !== w.A.AUDIO) - return; - if (!m) - throw t; - const r = kt(); - if (r) - if (e === w.A.IMAGE) { - const t = r.getThumbnailController(); - t && t.setTrackByIndex(n) - } else { - const t = r.getRepresentationForTypeByIndex(e, n); - t && y.setPlaybackQuality(e, W.getActiveStreamInfo(), t, { - forceReplace: a - }) - } - }, - setTextTrack: function(t) { - if (!h) - throw e; - const n = W.getActiveStreamInfo(); - n && $ && $.setTextTrack(n.id, t) - }, - setVolume: function(t) { - if ("number" != typeof t || isNaN(t) || t < 0 || t > 1) - throw w.A.BAD_ARGUMENT_ERROR; - Tt().volume = t - }, - setXHRWithCredentialsForType: function(t, e) { - j.setXHRWithCredentialsForType(t, e) - }, - time: bt, - timeAsUTC: function() { - if (!h) - throw e; - if (!Q.getIsDynamic() || bt() < 0) - return NaN; - const t = W && W.hasVideoTrack() ? w.A.VIDEO : w.A.AUDIO; - let n, a, r = et.getCurrentDVRInfo(t); - return r ? (n = r.manifestInfo.availableFrom.getTime() / 1e3, - a = n + bt(), - a) : 0 - }, - timeInDvrWindow: function() { - if (!h) - throw e; - if (!Q.getIsDynamic()) - return bt(); - let t = Tt().currentTime; - const n = W && W.hasVideoTrack() ? w.A.VIDEO : w.A.AUDIO; - let a = et.getCurrentDVRInfo(n); - return t = null === a || 0 === t ? 0 : Math.max(0, t - a.range.start), - t - }, - trigger: function(t, e, n) { - o.trigger(t, e, n) - }, - triggerSteeringRequest: function() { - if (J) - return J.loadSteeringData() - }, - unregisterCustomCapabilitiesFilter: function(t) { - j.unregisterCustomCapabilitiesFilter(t) - }, - unregisterLicenseRequestFilter: function(t) { - j.unregisterLicenseRequestFilter(t) - }, - unregisterLicenseResponseFilter: function(t) { - j.unregisterLicenseResponseFilter(t) - }, - updateSettings: function(t) { - l.update(t) - }, - updateSource: function(t) { - d = t, - W.load(d) - } - }, - c = s.getLogger(u), - g = !1, - h = !1, - m = !1, - p = !0, - b = NaN, - x = null, - P = null, - f = null, - F = null, - st = null, - R.A.extend(D.A), - U = bi(i).getInstance(), - j = (0, - kn.A)(i).getInstance(), - it = mo(i).getInstance(), - ot = gi(i).getInstance(), - u - } - Ql.__dashjs_factory_name = "MediaPlayer"; - const Zl = N.A.getClassFactory(Ql); - Zl.events = D.A, - Zl.errors = V, - N.A.updateClassFactory(Ql.__dashjs_factory_name, Zl); - var Jl = Zl - }, - 1191: function(t, e, n) { - "use strict"; - var a = n(7252); - class r extends a.A { - constructor() { - super(), - this.AST_IN_FUTURE = "astInFuture", - this.BASE_URLS_UPDATED = "baseUrlsUpdated", - this.BUFFER_EMPTY = "bufferStalled", - this.BUFFER_LOADED = "bufferLoaded", - this.BUFFER_LEVEL_STATE_CHANGED = "bufferStateChanged", - this.BUFFER_LEVEL_UPDATED = "bufferLevelUpdated", - this.DVB_FONT_DOWNLOAD_ADDED = "dvbFontDownloadAdded", - this.DVB_FONT_DOWNLOAD_COMPLETE = "dvbFontDownloadComplete", - this.DVB_FONT_DOWNLOAD_FAILED = "dvbFontDownloadFailed", - this.DYNAMIC_TO_STATIC = "dynamicToStatic", - this.ERROR = "error", - this.FRAGMENT_LOADING_COMPLETED = "fragmentLoadingCompleted", - this.FRAGMENT_LOADING_PROGRESS = "fragmentLoadingProgress", - this.FRAGMENT_LOADING_STARTED = "fragmentLoadingStarted", - this.FRAGMENT_LOADING_ABANDONED = "fragmentLoadingAbandoned", - this.LOG = "log", - this.MANIFEST_LOADING_STARTED = "manifestLoadingStarted", - this.MANIFEST_LOADING_FINISHED = "manifestLoadingFinished", - this.MANIFEST_LOADED = "manifestLoaded", - this.METRICS_CHANGED = "metricsChanged", - this.METRIC_CHANGED = "metricChanged", - this.METRIC_ADDED = "metricAdded", - this.METRIC_UPDATED = "metricUpdated", - this.PERIOD_SWITCH_STARTED = "periodSwitchStarted", - this.PERIOD_SWITCH_COMPLETED = "periodSwitchCompleted", - this.QUALITY_CHANGE_REQUESTED = "qualityChangeRequested", - this.QUALITY_CHANGE_RENDERED = "qualityChangeRendered", - this.NEW_TRACK_SELECTED = "newTrackSelected", - this.TRACK_CHANGE_RENDERED = "trackChangeRendered", - this.STREAM_INITIALIZING = "streamInitializing", - this.STREAM_UPDATED = "streamUpdated", - this.STREAM_ACTIVATED = "streamActivated", - this.STREAM_DEACTIVATED = "streamDeactivated", - this.STREAM_INITIALIZED = "streamInitialized", - this.STREAM_TEARDOWN_COMPLETE = "streamTeardownComplete", - this.TEXT_TRACKS_ADDED = "allTextTracksAdded", - this.TEXT_TRACK_ADDED = "textTrackAdded", - this.CUE_ENTER = "cueEnter", - this.CUE_EXIT = "cueExit", - this.THROUGHPUT_MEASUREMENT_STORED = "throughputMeasurementStored", - this.TTML_PARSED = "ttmlParsed", - this.TTML_TO_PARSE = "ttmlToParse", - this.CAPTION_RENDERED = "captionRendered", - this.CAPTION_CONTAINER_RESIZE = "captionContainerResize", - this.CAN_PLAY = "canPlay", - this.CAN_PLAY_THROUGH = "canPlayThrough", - this.PLAYBACK_ENDED = "playbackEnded", - this.PLAYBACK_ERROR = "playbackError", - this.PLAYBACK_INITIALIZED = "playbackInitialized", - this.PLAYBACK_NOT_ALLOWED = "playbackNotAllowed", - this.PLAYBACK_METADATA_LOADED = "playbackMetaDataLoaded", - this.PLAYBACK_LOADED_DATA = "playbackLoadedData", - this.PLAYBACK_PAUSED = "playbackPaused", - this.PLAYBACK_PLAYING = "playbackPlaying", - this.PLAYBACK_PROGRESS = "playbackProgress", - this.PLAYBACK_RATE_CHANGED = "playbackRateChanged", - this.PLAYBACK_SEEKED = "playbackSeeked", - this.PLAYBACK_SEEKING = "playbackSeeking", - this.PLAYBACK_STALLED = "playbackStalled", - this.PLAYBACK_STARTED = "playbackStarted", - this.PLAYBACK_TIME_UPDATED = "playbackTimeUpdated", - this.PLAYBACK_VOLUME_CHANGED = "playbackVolumeChanged", - this.PLAYBACK_WAITING = "playbackWaiting", - this.MANIFEST_VALIDITY_CHANGED = "manifestValidityChanged", - this.EVENT_MODE_ON_START = "eventModeOnStart", - this.EVENT_MODE_ON_RECEIVE = "eventModeOnReceive", - this.CONFORMANCE_VIOLATION = "conformanceViolation", - this.REPRESENTATION_SWITCH = "representationSwitch", - this.ADAPTATION_SET_REMOVED_NO_CAPABILITIES = "adaptationSetRemovedNoCapabilities", - this.CONTENT_STEERING_REQUEST_COMPLETED = "contentSteeringRequestCompleted", - this.INBAND_PRFT = "inbandPrft", - this.MANAGED_MEDIA_SOURCE_START_STREAMING = "managedMediaSourceStartStreaming", - this.MANAGED_MEDIA_SOURCE_END_STREAMING = "managedMediaSourceEndStreaming" - } - } - let i = new r; - e.A = i - }, - 5212: function(t, e) { - "use strict"; - e.A = { - STREAM: "stream", - VIDEO: "video", - AUDIO: "audio", - TEXT: "text", - MUXED: "muxed", - IMAGE: "image", - STPP: "stpp", - TTML: "ttml", - VTT: "vtt", - WVTT: "wvtt", - CONTENT_STEERING: "contentSteering", - LIVE_CATCHUP_MODE_DEFAULT: "liveCatchupModeDefault", - LIVE_CATCHUP_MODE_LOLP: "liveCatchupModeLoLP", - MOVING_AVERAGE_SLIDING_WINDOW: "slidingWindow", - MOVING_AVERAGE_EWMA: "ewma", - BAD_ARGUMENT_ERROR: "Invalid Arguments", - MISSING_CONFIG_ERROR: "Missing config parameter(s)", - TRACK_SWITCH_MODE_ALWAYS_REPLACE: "alwaysReplace", - TRACK_SWITCH_MODE_NEVER_REPLACE: "neverReplace", - TRACK_SELECTION_MODE_FIRST_TRACK: "firstTrack", - TRACK_SELECTION_MODE_HIGHEST_BITRATE: "highestBitrate", - TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY: "highestEfficiency", - TRACK_SELECTION_MODE_WIDEST_RANGE: "widestRange", - CMCD_QUERY_KEY: "CMCD", - CMCD_MODE_QUERY: "query", - CMCD_MODE_HEADER: "header", - CMCD_AVAILABLE_KEYS: ["br", "d", "ot", "tb", "bl", "dl", "mtp", "nor", "nrr", "su", "bs", "rtp", "cid", "pr", "sf", "sid", "st", "v"], - CMCD_V2_AVAILABLE_KEYS: ["msd", "ltc"], - CMCD_AVAILABLE_REQUESTS: ["segment", "mpd", "xlink", "steering", "other"], - INITIALIZE: "initialize", - TEXT_SHOWING: "showing", - TEXT_HIDDEN: "hidden", - TEXT_DISABLED: "disabled", - ACCESSIBILITY_CEA608_SCHEME: "urn:scte:dash:cc:cea-608:2015", - CC1: "CC1", - CC3: "CC3", - UTF8: "utf-8", - SCHEME_ID_URI: "schemeIdUri", - START_TIME: "starttime", - SERVICE_DESCRIPTION_DVB_LL_SCHEME: "urn:dvb:dash:lowlatency:scope:2019", - SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME: "urn:dvb:dash:lowlatency:critical:2019", - CTA_5004_2023_SCHEME: "urn:mpeg:dash:cta-5004:2023", - THUMBNAILS_SCHEME_ID_URIS: ["http://dashif.org/thumbnail_tile", "http://dashif.org/guidelines/thumbnail_tile"], - FONT_DOWNLOAD_DVB_SCHEME: "urn:dvb:dash:fontdownload:2014", - COLOUR_PRIMARIES_SCHEME_ID_URI: "urn:mpeg:mpegB:cicp:ColourPrimaries", - URL_QUERY_INFO_SCHEME: "urn:mpeg:dash:urlparam:2014", - EXT_URL_QUERY_INFO_SCHEME: "urn:mpeg:dash:urlparam:2016", - MATRIX_COEFFICIENTS_SCHEME_ID_URI: "urn:mpeg:mpegB:cicp:MatrixCoefficients", - TRANSFER_CHARACTERISTICS_SCHEME_ID_URI: "urn:mpeg:mpegB:cicp:TransferCharacteristics", - HDR_METADATA_FORMAT_SCHEME_ID_URI: "urn:dvb:dash:hdr-dmi", - HDR_METADATA_FORMAT_VALUES: { - ST2094_10: "ST2094-10", - SL_HDR2: "SL-HDR2", - ST2094_40: "ST2094-40" - }, - MEDIA_CAPABILITIES_API: { - COLORGAMUT: { - SRGB: "srgb", - P3: "p3", - REC2020: "rec2020" - }, - TRANSFERFUNCTION: { - SRGB: "srgb", - PQ: "pq", - HLG: "hlg" - }, - HDR_METADATATYPE: { - SMPTE_ST_2094_10: "smpteSt2094-10", - SLHDR2: "slhdr2", - SMPTE_ST_2094_40: "smpteSt2094-40" - } - }, - XML: "XML", - ARRAY_BUFFER: "ArrayBuffer", - DVB_REPORTING_URL: "dvb:reportingUrl", - DVB_PROBABILITY: "dvb:probability", - OFF_MIMETYPE: "application/font-sfnt", - WOFF_MIMETYPE: "application/font-woff", - VIDEO_ELEMENT_READY_STATES: { - HAVE_NOTHING: 0, - HAVE_METADATA: 1, - HAVE_CURRENT_DATA: 2, - HAVE_FUTURE_DATA: 3, - HAVE_ENOUGH_DATA: 4 - }, - FILE_LOADER_TYPES: { - FETCH: "fetch_loader", - XHR: "xhr_loader" - }, - THROUGHPUT_TYPES: { - LATENCY: "throughput_type_latency", - BANDWIDTH: "throughput_type_bandwidth" - }, - THROUGHPUT_CALCULATION_MODES: { - EWMA: "throughputCalculationModeEwma", - ZLEMA: "throughputCalculationModeZlema", - ARITHMETIC_MEAN: "throughputCalculationModeArithmeticMean", - BYTE_SIZE_WEIGHTED_ARITHMETIC_MEAN: "throughputCalculationModeByteSizeWeightedArithmeticMean", - DATE_WEIGHTED_ARITHMETIC_MEAN: "throughputCalculationModeDateWeightedArithmeticMean", - HARMONIC_MEAN: "throughputCalculationModeHarmonicMean", - BYTE_SIZE_WEIGHTED_HARMONIC_MEAN: "throughputCalculationModeByteSizeWeightedHarmonicMean", - DATE_WEIGHTED_HARMONIC_MEAN: "throughputCalculationModeDateWeightedHarmonicMean" - }, - LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE: { - MOOF_PARSING: "lowLatencyDownloadTimeCalculationModeMoofParsing", - DOWNLOADED_DATA: "lowLatencyDownloadTimeCalculationModeDownloadedData", - AAST: "lowLatencyDownloadTimeCalculationModeAast" - }, - RULES_TYPES: { - QUALITY_SWITCH_RULES: "qualitySwitchRules", - ABANDON_FRAGMENT_RULES: "abandonFragmentRules" - }, - QUALITY_SWITCH_RULES: { - BOLA_RULE: "BolaRule", - THROUGHPUT_RULE: "ThroughputRule", - INSUFFICIENT_BUFFER_RULE: "InsufficientBufferRule", - SWITCH_HISTORY_RULE: "SwitchHistoryRule", - DROPPED_FRAMES_RULE: "DroppedFramesRule", - LEARN_TO_ADAPT_RULE: "L2ARule", - LOL_PLUS_RULE: "LoLPRule" - }, - ABANDON_FRAGMENT_RULES: { - ABANDON_REQUEST_RULE: "AbandonRequestsRule" - }, - ID3_SCHEME_ID_URI: "https://aomedia.org/emsg/ID3", - COMMON_ACCESS_TOKEN_HEADER: "common-access-token", - DASH_ROLE_SCHEME_ID: "urn:mpeg:dash:role:2011", - CODEC_FAMILIES: { - MP3: "mp3", - AAC: "aac", - AC3: "ac3", - EC3: "ec3", - DTSX: "dtsx", - DTSC: "dtsc", - AVC: "avc", - HEVC: "hevc" - } - } - }, - 2861: function(t, e) { - "use strict"; - e.A = { - CLEARKEY_KEYSTEM_STRING: "org.w3.clearkey", - WIDEVINE_KEYSTEM_STRING: "com.widevine.alpha", - PLAYREADY_KEYSTEM_STRING: "com.microsoft.playready", - PLAYREADY_RECOMMENDATION_KEYSTEM_STRING: "com.microsoft.playready.recommendation", - WIDEVINE_UUID: "edef8ba9-79d6-4ace-a3c8-27dcd51d21ed", - PLAYREADY_UUID: "9a04f079-9840-4286-ab92-e65be0885f95", - CLEARKEY_UUID: "e2719d58-a985-b3c9-781a-b030af78d30e", - W3C_CLEARKEY_UUID: "1077efec-c0b2-4d02-ace3-3c1e52e2fb4b", - INITIALIZATION_DATA_TYPE_CENC: "cenc", - INITIALIZATION_DATA_TYPE_KEYIDS: "keyids", - INITIALIZATION_DATA_TYPE_WEBM: "webm", - ENCRYPTION_SCHEME_CENC: "cenc", - ENCRYPTION_SCHEME_CBCS: "cbcs", - MEDIA_KEY_MESSAGE_TYPES: { - LICENSE_REQUEST: "license-request", - LICENSE_RENEWAL: "license-renewal", - LICENSE_RELEASE: "license-release", - INDIVIDUALIZATION_REQUEST: "individualization-request" - }, - ROBUSTNESS_STRINGS: { - WIDEVINE: { - SW_SECURE_CRYPTO: "SW_SECURE_CRYPTO", - SW_SECURE_DECODE: "SW_SECURE_DECODE", - HW_SECURE_CRYPTO: "HW_SECURE_CRYPTO", - HW_SECURE_DECODE: "HW_SECURE_DECODE", - HW_SECURE_ALL: "HW_SECURE_ALL" - } - }, - MEDIA_KEY_STATUSES: { - USABLE: "usable", - EXPIRED: "expired", - RELEASED: "released", - OUTPUT_RESTRICTED: "output-restricted", - OUTPUT_DOWNSCALED: "output-downscaled", - STATUS_PENDING: "status-pending", - INTERNAL_ERROR: "internal-error" - } - } - }, - 4469: function(t, e, n) { - "use strict"; - n.d(e, { - default: function() { - return K - } - }); - class a { - constructor() { - this.mpdurl = null, - this.errorcode = null, - this.terror = null, - this.url = null, - this.ipaddress = null, - this.servicelocation = null - } - } - a.SSL_CONNECTION_FAILED_PREFIX = "SSL", - a.DNS_RESOLUTION_FAILED = "C00", - a.HOST_UNREACHABLE = "C01", - a.CONNECTION_REFUSED = "C02", - a.CONNECTION_ERROR = "C03", - a.CORRUPT_MEDIA_ISOBMFF = "M00", - a.CORRUPT_MEDIA_OTHER = "M01", - a.BASE_URL_CHANGED = "F00", - a.BECAME_REPORTER = "S00"; - var r = a - , i = n(913) - , o = n(138); - function l(t) { - let e, n; - const a = (t = t || {}).eventBus - , o = t.dashMetrics - , l = t.metricsConstants - , s = t.events; - function u(t) { - let e = new r; - if (n) { - for (const n in t) - t.hasOwnProperty(n) && (e[n] = t[n]); - e.mpdurl || (e.mpdurl = n.originalUrl || n.url), - e.terror || (e.terror = new Date), - o.addDVBErrors(e) - } - } - function c(t) { - t.error || (n = t.manifest) - } - function d(t) { - u({ - errorcode: r.BASE_URL_CHANGED, - servicelocation: t.entry - }) - } - function f() { - u({ - errorcode: r.BECAME_REPORTER - }) - } - function g(t) { - var e; - t.metric === l.HTTP_REQUEST && (0 === (e = t.value).responsecode || null == e.responsecode || e.responsecode >= 400 || e.responsecode < 100 || e.responsecode >= 600) && u({ - errorcode: e.responsecode || r.CONNECTION_ERROR, - url: e.url, - terror: e.tresponse, - servicelocation: e._serviceLocation - }) - } - function m(t) { - let e; - switch (t.error ? t.error.code : 0) { - case MediaError.MEDIA_ERR_NETWORK: - e = r.CONNECTION_ERROR; - break; - case MediaError.MEDIA_ERR_DECODE: - e = r.CORRUPT_MEDIA_OTHER; - break; - default: - return - } - u({ - errorcode: e - }) - } - return e = { - initialize: function() { - a.on(s.MANIFEST_UPDATED, c, e), - a.on(s.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED, d, e), - a.on(s.METRIC_ADDED, g, e), - a.on(s.METRIC_UPDATED, g, e), - a.on(s.PLAYBACK_ERROR, m, e), - a.on(i.A.BECAME_REPORTING_PLAYER, f, e) - }, - reset: function() { - a.off(s.MANIFEST_UPDATED, c, e), - a.off(s.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED, d, e), - a.off(s.METRIC_ADDED, g, e), - a.off(s.METRIC_UPDATED, g, e), - a.off(s.PLAYBACK_ERROR, m, e), - a.off(i.A.BECAME_REPORTING_PLAYER, f, e) - } - }, - e - } - l.__dashjs_factory_name = "DVBErrorsTranslator"; - var s = o.A.getSingletonFactory(l) - , u = n(7377); - function c(t) { - t = t || {}; - let e, n, a = !1, r = this.context, i = t.mediaElement; - return e = { - initialize: function(t) { - t && t.length && (t.forEach((t => { - let e = t.starttime - , a = e + t.duration; - n.add(e, a) - } - )), - a = !!t[0]._useWallClockTime) - }, - reset: function() { - n.clear() - }, - isEnabled: function() { - let t, e = n.length; - if (!e) - return !0; - t = a ? (new Date).getTime() / 1e3 : i.currentTime; - for (let a = 0; a < e; a += 1) { - let e = n.start(a) - , r = n.end(a); - if (e <= t && t < r) - return !0 - } - return !1 - } - }, - n = (0, - u.A)(r).create(), - e - } - c.__dashjs_factory_name = "RangeController"; - var d = o.A.getClassFactory(c); - function f() { - return { - serialise: function t(e) { - let n, a, r = [], i = []; - for (n in e) - if (e.hasOwnProperty(n) && 0 !== n.indexOf("_")) { - if (a = e[n], - null == a && (a = ""), - Array.isArray(a)) { - if (!a.length) - continue; - i = [], - a.forEach((function(e) { - let n = "Object" !== Object.prototype.toString.call(e).slice(8, -1); - i.push(n ? e : t(e)) - } - )), - a = i.map(encodeURIComponent).join(",") - } else - "string" == typeof a ? a = encodeURIComponent(a) : a instanceof Date ? a = a.toISOString() : "number" == typeof a && (a = Math.round(a)); - r.push(n + "=" + a) - } - return r.join("&") - } - } - } - f.__dashjs_factory_name = "MetricSerialiser"; - var g = o.A.getSingletonFactory(f); - function m() { - let t, e, n, a = window.crypto || window.msCrypto, r = Uint32Array, i = Math.pow(2, 8 * r.BYTES_PER_ELEMENT) - 1; - function o() { - a && (t || (t = new r(10)), - a.getRandomValues(t), - e = 0) - } - return n = { - random: function(n, r) { - let l; - return n || (n = 0), - r || (r = 1), - a ? (e === t.length && o(), - l = t[e] / i, - e += 1) : l = Math.random(), - l * (r - n) + n - } - }, - o(), - n - } - m.__dashjs_factory_name = "RNG"; - var h = o.A.getSingletonFactory(m) - , p = n(1926); - function b(t) { - let e; - t = t || {}; - let n, a, r, i, o, l, s, u = this.context, c = []; - const d = t.metricsConstants; - function f() { - i = !1, - o = !1, - l = null, - s = null - } - return e = { - report: function(t, e) { - Array.isArray(e) || (e = [e]), - o && s.isEnabled() && e.forEach((function(e) { - let r = n.serialise(e); - t !== d.DVB_ERRORS && (r = `metricname=${t}&${r}`), - r = `${l}?${r}`, - function(t, e, n) { - let r = new XMLHttpRequest; - r.withCredentials = a.getXHRWithCredentialsForType(d.HTTP_REQUEST_DVB_REPORTING_TYPE); - const i = function() { - let t = c.indexOf(r); - -1 !== t && (c.splice(t, 1), - !(r.status >= 200 && r.status < 300) && (n && n())) - }; - c.push(r); - try { - r.open("GET", t), - r.onloadend = i, - r.onerror = i, - r.send() - } catch (t) { - r.onerror() - } - }(r, 0, (function() { - o = !1 - } - )) - } - )) - }, - initialize: function(t, e) { - let n; - if (s = e, - l = t.dvbReportingUrl, - !l) - throw new Error("required parameter missing (dvb:reportingUrl)"); - i || (n = t.dvbProbability, - n && (1e3 === n || n / 1e3 >= r.random()) && (o = !0), - i = !0) - }, - reset: function() { - f() - } - }, - n = g(u).getInstance(), - r = h(u).getInstance(), - a = (0, - p.A)(u).getInstance(), - f(), - e - } - b.__dashjs_factory_name = "DVBReporting"; - var y = o.A.getClassFactory(b); - function E(t) { - t = t || {}; - const e = { - "urn:dvb:dash:reporting:2014": y - } - , n = this.context; - let a; - const r = t.debug ? t.debug.getLogger(a) : {} - , i = t.metricsConstants - , o = t.mediaPlayerModel || {}; - return a = { - create: function(t, a) { - let l; - try { - l = e[t.schemeIdUri](n).create({ - metricsConstants: i, - mediaPlayerModel: o - }), - l.initialize(t, a) - } catch (e) { - l = null, - r.error(`ReportingFactory: could not create Reporting with schemeIdUri ${t.schemeIdUri} (${e.message})`) - } - return l - }, - register: function(t, n) { - e[t] = n - }, - unregister: function(t) { - delete e[t] - } - }, - a - } - E.__dashjs_factory_name = "ReportingFactory"; - var _ = o.A.getSingletonFactory(E); - function A(t) { - let e, n = []; - const a = _(this.context).getInstance(t); - return e = { - initialize: function(t, e) { - t.some((t => { - let r = a.create(t, e); - if (r) - return n.push(r), - !0 - } - )) - }, - reset: function() { - n.forEach((t => t.reset())), - n = [] - }, - report: function(t, e) { - n.forEach((n => n.report(t, e))) - } - }, - e - } - A.__dashjs_factory_name = "ReportingController"; - var T = o.A.getClassFactory(A); - function v() { - return { - reconstructFullMetricName: function(t, e, n) { - let a = t; - return e && (a += "(" + e, - n && n.length && (a += "," + n), - a += ")"), - a - }, - validateN: function(t) { - if (!t) - throw new Error("missing n"); - if (isNaN(t)) - throw new Error("n is NaN"); - if (t < 0) - throw new Error("n must be positive"); - return t - } - } - } - v.__dashjs_factory_name = "HandlerHelpers"; - var w = o.A.getSingletonFactory(v); - function S(t) { - let e, n, a, r, i, o; - t = t || {}; - let l = this.context - , s = w(l).getInstance() - , u = []; - const c = t.metricsConstants; - function d() { - let t = function() { - try { - return Object.keys(u).map((t => u[t])).reduce(( (t, e) => t.level < e.level ? t : e)) - } catch (t) { - return - } - }(); - t && o !== t.t && (o = t.t, - n.report(r, t)) - } - return e = { - initialize: function(t, e, o) { - e && (a = s.validateN(o), - n = e, - r = s.reconstructFullMetricName(t, o), - i = setInterval(d, a)) - }, - reset: function() { - clearInterval(i), - i = null, - a = 0, - n = null, - o = null - }, - handleNewMetric: function(t, e, n) { - t === c.BUFFER_LEVEL && (u[n] = e) - } - }, - e - } - S.__dashjs_factory_name = "BufferLevelHandler"; - var I = o.A.getClassFactory(S) - , k = o.A.getClassFactory((function(t) { - let e, n, a = (t = t || {}).eventBus; - const r = t.metricsConstants; - function o() { - a.off(i.A.METRICS_INITIALISATION_COMPLETE, o, this), - a.trigger(i.A.BECAME_REPORTING_PLAYER) - } - return e = { - initialize: function(t, e) { - e && (n = e, - a.on(i.A.METRICS_INITIALISATION_COMPLETE, o, this)) - }, - reset: function() { - n = null - }, - handleNewMetric: function(t, e) { - t === r.DVB_ERRORS && n && n.report(t, e) - } - }, - e - } - )); - function R(t) { - let e, n, a, r, i, o; - t = t || {}; - let l = [] - , s = w(this.context).getInstance(); - const u = t.metricsConstants; - function c() { - var t = l; - t.length && n && n.report(i, t), - l = [] - } - return e = { - initialize: function(t, e, l, u) { - e && (a = s.validateN(l), - n = e, - u && u.length && (r = u), - i = s.reconstructFullMetricName(t, l, u), - o = setInterval(c, a)) - }, - reset: function() { - clearInterval(o), - o = null, - a = null, - r = null, - l = [], - n = null - }, - handleNewMetric: function(t, e) { - t === u.HTTP_REQUEST && (r && r !== e.type || l.push(e)) - } - }, - e - } - R.__dashjs_factory_name = "HttpListHandler"; - var N = o.A.getClassFactory(R); - function C() { - let t, e, n; - return t = { - initialize: function(t, a) { - e = t, - n = a - }, - reset: function() { - n = null, - e = void 0 - }, - handleNewMetric: function(t, a) { - t === e && n && n.report(e, a) - } - }, - t - } - C.__dashjs_factory_name = "GenericMetricHandler"; - var D = o.A.getClassFactory(C); - function x(t) { - let e; - const n = (t = t || {}).debug ? t.debug.getLogger(e) : {}; - let a = /([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/; - const r = this.context; - let i = { - BufferLevel: I, - DVBErrors: k, - HttpList: N, - PlayList: D, - RepSwitchList: D, - TcpList: D - }; - return e = { - create: function(e, o) { - var l, s = e.match(a); - if (s) { - try { - (l = i[s[1]](r).create({ - eventBus: t.eventBus, - metricsConstants: t.metricsConstants - })).initialize(s[1], o, s[3], s[5]) - } catch (t) { - l = null, - n.error(`MetricsHandlerFactory: Could not create handler for type ${s[1]} with args ${s[3]}, ${s[5]} (${t.message})`) - } - return l - } - }, - register: function(t, e) { - i[t] = e - }, - unregister: function(t) { - delete i[t] - } - }, - e - } - x.__dashjs_factory_name = "MetricsHandlerFactory"; - var M = o.A.getSingletonFactory(x); - function z(t) { - t = t || {}; - let e, n = []; - const a = this.context - , r = t.eventBus - , i = t.events; - let o = M(a).getInstance({ - debug: t.debug, - eventBus: t.eventBus, - metricsConstants: t.metricsConstants - }); - function l(t) { - n.forEach((e => { - e.handleNewMetric(t.metric, t.value, t.mediaType) - } - )) - } - return e = { - initialize: function(t, a) { - t.split(",").forEach(( (t, e, r) => { - let i; - if (-1 !== t.indexOf("(") && -1 === t.indexOf(")")) { - let n = r[e + 1]; - n && -1 === n.indexOf("(") && -1 !== n.indexOf(")") && (t += "," + n, - delete r[e + 1]) - } - i = o.create(t, a), - i && n.push(i) - } - )), - r.on(i.METRIC_ADDED, l, e), - r.on(i.METRIC_UPDATED, l, e) - }, - reset: function() { - r.off(i.METRIC_ADDED, l, e), - r.off(i.METRIC_UPDATED, l, e), - n.forEach((t => t.reset())), - n = [] - } - }, - e - } - z.__dashjs_factory_name = "MetricsHandlersController"; - var O = o.A.getClassFactory(z); - function L(t) { - let e, n, a, r; - t = t || {}; - let i = this.context; - function o() { - e && e.reset(), - n && n.reset(), - a && a.reset() - } - return r = { - initialize: function(r) { - try { - a = d(i).create({ - mediaElement: t.mediaElement - }), - a.initialize(r.Range), - n = T(i).create({ - debug: t.debug, - metricsConstants: t.metricsConstants, - mediaPlayerModel: t.mediaPlayerModel - }), - n.initialize(r.Reporting, a), - e = O(i).create({ - debug: t.debug, - eventBus: t.eventBus, - metricsConstants: t.metricsConstants, - events: t.events - }), - e.initialize(r.metrics, n) - } catch (t) { - throw o(), - t - } - }, - reset: o - }, - r - } - L.__dashjs_factory_name = "MetricsController"; - var P = o.A.getClassFactory(L) - , F = class { - constructor() { - this.metrics = "", - this.Range = [], - this.Reporting = [] - } - } - , U = class { - constructor() { - this.starttime = 0, - this.duration = 1 / 0, - this._useWallClockTime = !1 - } - } - , j = class { - constructor() { - this.schemeIdUri = "", - this.value = "", - this.dvbReportingUrl = "", - this.dvbProbability = 1e3 - } - } - ; - function B(t) { - let e, n = (t = t || {}).adapter; - const a = t.constants; - return e = { - getMetrics: function(t) { - let e = []; - return t && t.Metrics && t.Metrics.forEach((r => { - var i = new F - , o = n.getIsDynamic(t); - r.hasOwnProperty("metrics") && (i.metrics = r.metrics, - r.Range && r.Range.forEach((e => { - var r = new U; - r.starttime = function(t, e, r) { - let i, o, l = 0; - return e ? l = n.getAvailabilityStartTime(t) / 1e3 : (i = n.getRegularPeriods(t), - i.length && (l = i[0].start)), - o = l, - r && r.hasOwnProperty(a.START_TIME) && (o += r.starttime), - o - }(t, o, e), - e.hasOwnProperty("duration") ? r.duration = e.duration : r.duration = n.getDuration(t), - r._useWallClockTime = o, - i.Range.push(r) - } - )), - r.Reporting && (r.Reporting.forEach((t => { - var e = new j; - t.hasOwnProperty(a.SCHEME_ID_URI) && (e.schemeIdUri = t.schemeIdUri, - t.hasOwnProperty("value") && (e.value = t.value), - t.hasOwnProperty(a.DVB_REPORTING_URL) && (e.dvbReportingUrl = t[a.DVB_REPORTING_URL]), - t.hasOwnProperty(a.DVB_PROBABILITY) && (e.dvbProbability = t[a.DVB_PROBABILITY]), - i.Reporting.push(e)) - } - )), - e.push(i))) - } - )), - e - } - }, - e - } - B.__dashjs_factory_name = "ManifestParsing"; - var q = o.A.getSingletonFactory(B); - function G(t) { - let e; - t = t || {}; - let n = {} - , a = this.context - , r = t.eventBus; - const o = t.events; - function l(e) { - if (e.error) - return; - let o = Object.keys(n); - q(a).getInstance({ - adapter: t.adapter, - constants: t.constants - }).getMetrics(e.manifest).forEach((e => { - const r = JSON.stringify(e); - if (n.hasOwnProperty(r)) - o.splice(r, 1); - else - try { - let i = P(a).create(t); - i.initialize(e), - n[r] = i - } catch (t) {} - } - )), - o.forEach((t => { - n[t].reset(), - delete n[t] - } - )), - r.trigger(i.A.METRICS_INITIALISATION_COMPLETE) - } - function s() { - Object.keys(n).forEach((t => { - n[t].reset() - } - )), - n = {} - } - return e = { - reset: function() { - r.off(o.MANIFEST_UPDATED, l, e), - r.off(o.STREAM_TEARDOWN_COMPLETE, s, e) - } - }, - r.on(o.MANIFEST_UPDATED, l, e), - r.on(o.STREAM_TEARDOWN_COMPLETE, s, e), - e - } - G.__dashjs_factory_name = "MetricsCollectionController"; - var H = o.A.getClassFactory(G); - function Y() { - let t, e, n = this.context; - return t = { - createMetricsReporting: function(t) { - return e = s(n).getInstance({ - eventBus: t.eventBus, - dashMetrics: t.dashMetrics, - metricsConstants: t.metricsConstants, - events: t.events - }), - e.initialize(), - H(n).create(t) - }, - getReportingFactory: function() { - return _(n).getInstance() - }, - getMetricsHandlerFactory: function() { - return M(n).getInstance() - } - }, - t - } - Y.__dashjs_factory_name = "MetricsReporting"; - const V = dashjs.FactoryMaker.getClassFactory(Y); - V.events = i.A, - dashjs.FactoryMaker.updateClassFactory(Y.__dashjs_factory_name, V); - var K = V - }, - 913: function(t, e, n) { - "use strict"; - var a = n(7252); - class r extends a.A { - constructor() { - super(), - this.METRICS_INITIALISATION_COMPLETE = "internal_metricsReportingInitialized", - this.BECAME_REPORTING_PLAYER = "internal_becameReportingPlayer", - this.CMCD_DATA_GENERATED = "cmcdDataGenerated" - } - } - let i = new r; - e.A = i - }, - 1926: function(t, e, n) { - "use strict"; - var a = n(5717) - , r = n(138) - , i = n(8261) - , o = n(656) - , l = n(5212); - function s() { - let t, e, n, r, s, u, c, d, f, g; - const m = this.context - , h = (0, - i.A)(m).getInstance(); - function p() { - r = [], - s = [], - u = [], - c = [], - d = [], - g = [], - f = null, - e = [] - } - function b(t, e) { - let n = -1; - t.some(( (t, a) => { - if (t === e) - return n = a, - !0 - } - )), - n < 0 || t.splice(n, 1) - } - function y(t) { - let e; - for (e = 0; e < g.length; e++) - if (g[e].rulename === t) - return e; - return -1 - } - function E(t, n) { - _(t, n); - let r = new a.A; - r.schemeIdUri = t, - r.value = n, - e.push(r) - } - function _(t, n) { - (0, - o.sq)(t, "string"), - (0, - o.sq)(n, "string"), - e.forEach((function(a, r) { - a.schemeIdUri === t && a.value === n && e.splice(r, 1) - } - )) - } - return t = { - addAbrCustomRule: function(t, e, n) { - if ("string" != typeof t || t !== l.A.RULES_TYPES.ABANDON_FRAGMENT_RULES && t !== l.A.RULES_TYPES.QUALITY_SWITCH_RULES || "string" != typeof e) - throw l.A.BAD_ARGUMENT_ERROR; - let a = y(e); - -1 === a ? g.push({ - type: t, - rulename: e, - rule: n - }) : (g[a].type = t, - g[a].rule = n) - }, - addRequestInterceptor: function(t) { - r.push(t) - }, - addResponseInterceptor: function(t) { - s.push(t) - }, - addUTCTimingSource: E, - clearDefaultUTCTimingSources: function() { - e = [] - }, - getAbrCustomRules: function() { - return g - }, - getCustomCapabilitiesFilters: function() { - return d - }, - getCustomInitialTrackSelectionFunction: function() { - return f - }, - getLicenseRequestFilters: function() { - return u - }, - getLicenseResponseFilters: function() { - return c - }, - getRequestInterceptors: function() { - return r - }, - getResponseInterceptors: function() { - return s - }, - getUTCTimingSources: function() { - return e - }, - getXHRWithCredentialsForType: function(t) { - const e = n[t]; - return void 0 === e ? n.default : e - }, - registerCustomCapabilitiesFilter: function(t) { - d.push(t) - }, - registerLicenseRequestFilter: function(t) { - u.push(t) - }, - registerLicenseResponseFilter: function(t) { - c.push(t) - }, - removeAbrCustomRule: function(t) { - if (t) { - let e = y(t); - -1 !== e && g.splice(e, 1) - } else - g = [] - }, - removeAllAbrCustomRule: function() { - g = [] - }, - removeRequestInterceptor: function(t) { - b(r, t) - }, - removeResponseInterceptor: function(t) { - b(s, t) - }, - removeUTCTimingSource: _, - reset: function() { - p() - }, - resetCustomInitialTrackSelectionFunction: function() { - f = null - }, - restoreDefaultUTCTimingSources: function() { - let t = h.get().streaming.utcSynchronization.defaultTimingSource; - E(t.scheme, t.value) - }, - setConfig: function() {}, - setCustomInitialTrackSelectionFunction: function(t) { - f = t - }, - setXHRWithCredentialsForType: function t(e, a) { - e ? n[e] = !!a : Object.keys(n).forEach((e => { - t(e, a) - } - )) - }, - unregisterCustomCapabilitiesFilter: function(t) { - b(d, t) - }, - unregisterLicenseRequestFilter: function(t) { - b(u, t) - }, - unregisterLicenseResponseFilter: function(t) { - b(c, t) - } - }, - n = { - default: !1 - }, - p(), - t - } - s.__dashjs_factory_name = "CustomParametersModel", - e.A = r.A.getSingletonFactory(s) - }, - 3888: function(t, e, n) { - "use strict"; - n.d(e, { - default: function() { - return mt - } - }); - var a = n(8854) - , r = n(2861); - const i = { - prefixes: ["clearkey", "dashif", "ck"] - }; - class o { - static findMp4ProtectionElement(t) { - let e = null; - for (let n = 0; n < t.length; ++n) { - let i = t[n]; - i.schemeIdUri && i.schemeIdUri.toLowerCase() === a.A.MP4_PROTECTION_SCHEME && i.value && (i.value.toLowerCase() === r.A.ENCRYPTION_SCHEME_CENC || i.value.toLowerCase() === r.A.ENCRYPTION_SCHEME_CBCS) && (e = i) - } - return e - } - static getPSSHData(t) { - let e = 8 - , n = new DataView(t) - , a = n.getUint8(e); - return e += 20, - a > 0 && (e += 4 + 16 * n.getUint32(e)), - e += 4, - t.slice(e) - } - static getPSSHForKeySystem(t, e) { - let n = o.parsePSSHList(e); - return t && n.hasOwnProperty(t.uuid.toLowerCase()) ? n[t.uuid.toLowerCase()] : null - } - static parseInitDataFromContentProtection(t, e) { - return "pssh"in t && t.pssh ? (t.pssh.__text = t.pssh.__text.replace(/\r?\n|\r/g, "").replace(/\s+/g, ""), - e.decodeArray(t.pssh.__text).buffer) : null - } - static parsePSSHList(t) { - if (null == t) - return []; - let e = new DataView(t.buffer || t) - , n = {} - , a = 0; - for (; ; ) { - let t, r, i, o, l, s, u = a; - if (a >= e.buffer.byteLength) - break; - if (t = e.getUint32(a), - r = a + t, - a += 4, - 1886614376 === e.getUint32(a)) - if (a += 4, - i = e.getUint8(a), - 0 === i || 1 === i) { - for (a++, - a += 3, - o = "", - l = 0; l < 4; l++) - s = e.getUint8(a + l).toString(16), - o += 1 === s.length ? "0" + s : s; - for (a += 4, - o += "-", - l = 0; l < 2; l++) - s = e.getUint8(a + l).toString(16), - o += 1 === s.length ? "0" + s : s; - for (a += 2, - o += "-", - l = 0; l < 2; l++) - s = e.getUint8(a + l).toString(16), - o += 1 === s.length ? "0" + s : s; - for (a += 2, - o += "-", - l = 0; l < 2; l++) - s = e.getUint8(a + l).toString(16), - o += 1 === s.length ? "0" + s : s; - for (a += 2, - o += "-", - l = 0; l < 6; l++) - s = e.getUint8(a + l).toString(16), - o += 1 === s.length ? "0" + s : s; - a += 6, - o = o.toLowerCase(), - a += 4, - n[o] = e.buffer.slice(u, r), - a = r - } else - a = r; - else - a = r - } - return n - } - static getLicenseServerUrlFromMediaInfo(t, e) { - try { - if (!t || 0 === t.length) - return null; - let n = 0 - , a = null; - for (; n < t.length && !a; ) { - const r = t[n]; - if (r && r.contentProtection && r.contentProtection.length > 0) { - const t = r.contentProtection.filter((t => t.schemeIdUri && t.schemeIdUri === e)); - if (t && t.length > 0) { - let e = 0; - for (; e < t.length && !a; ) { - const n = t[e]; - n.laUrl && n.laUrl.__prefix && i.prefixes.includes(n.laUrl.__prefix) && n.laUrl.__text && (a = n.laUrl.__text), - e += 1 - } - } - } - n += 1 - } - return a - } catch (t) { - return null - } - } - static hexKidToBufferSource(t) { - const e = t.replace(/-/g, ""); - return new Uint8Array(e.match(/[\da-f]{2}/gi).map((function(t) { - return parseInt(t, 16) - } - ))).buffer - } - } - var l = o - , s = class { - constructor(t, e) { - this.contentType = t, - this.robustness = e - } - } - , u = class { - constructor(t, e, n, a, i, o) { - this.initDataTypes = o && o.length > 0 ? o : [r.A.INITIALIZATION_DATA_TYPE_CENC], - t && t.length && (this.audioCapabilities = t), - e && e.length && (this.videoCapabilities = e), - this.distinctiveIdentifier = n, - this.persistentState = a, - this.sessionTypes = i - } - } - , c = n(1923) - , d = n(1944) - , f = class { - constructor(t, e, n, a, r, i, o, l) { - this.url = t, - this.method = e, - this.responseType = n, - this.headers = a, - this.withCredentials = r, - this.messageType = i, - this.sessionId = o, - this.data = l - } - } - , g = class { - constructor(t, e, n) { - this.url = t, - this.headers = e, - this.data = n - } - } - , m = n(7568) - , h = n(7263) - , p = n(5212) - , b = n(138); - function y(t) { - const e = (t = t || {}).BASE64 - , n = t.cmcdModel - , a = t.constants - , i = t.customParametersModel - , o = t.debug - , b = t.eventBus - , y = t.events - , E = t.protectionKeyController - , _ = t.settings; - let A, T, v, w, S, I, k, R, N, C, D, x, M = t.protectionModel, z = []; - function O() { - if (!(b && b.hasOwnProperty("on") && E && E.hasOwnProperty("getSupportedKeySystemMetadataFromContentProtection"))) - throw new Error("Missing config parameter(s)") - } - function L(t, n) { - D || w ? D && P() : function(t, n) { - if (w) - return; - var a; - w = !0; - const r = function(t) { - const e = []; - for (let n = 0; n < t.length; n++) { - const a = F(t[n]); - e.push({ - ks: t[n].ks, - configs: [a], - protData: t[n].protData - }) - } - return e - }(t = (a = t).sort(( (t, e) => (A && A[t.ks.systemString] && A[t.ks.systemString].priority >= 0 ? A[t.ks.systemString].priority : a.length) - (A && A[e.ks.systemString] && A[e.ks.systemString].priority >= 0 ? A[e.ks.systemString].priority : a.length)))); - let i; - M.requestKeySystemAccess(r).then((t => (i = t.data, - function(t) { - let e = t && t.selectedSystemString ? t.selectedSystemString : t.keySystem.systemString; - return k.info("DRM: KeySystem Access Granted for system string (" + e + ")! Selecting key system..."), - M.selectKeySystem(t) - }(i)))).then((t => { - !function(t, n) { - D = t, - w = !1, - b.trigger(y.KEY_SYSTEM_SELECTED, { - data: n - }); - const a = B(D); - a && a.serverCertificate && a.serverCertificate.length > 0 && M.setServerCertificate(e.decodeArray(a.serverCertificate).buffer), - P() - }(t, i) - } - )).catch((t => { - !function(t, e) { - D = null, - w = !1, - e || b.trigger(y.KEY_SYSTEM_SELECTED, { - data: null, - error: new d.A(c.A.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,c.A.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE + "Error selecting key system! -- " + t.error) - }) - }(t, n) - } - )) - }(t, n) - } - function P() { - let t; - for (let n = 0; n < N.length; n++) - for (t = 0; t < N[n].length; t++) - if (D === N[n][t].ks) { - e = N[n][t], - E.isClearKey(D) && function(t) { - if (t.protData && t.protData.hasOwnProperty("clearkeys") && 0 !== Object.keys(t.protData.clearkeys).length) { - const e = { - kids: Object.keys(t.protData.clearkeys) - }; - t.initData = (new TextEncoder).encode(JSON.stringify(e)) - } - }(e), - e.sessionId ? U(e) : null !== e.initData && j(e); - break - } - var e; - N = [] - } - function F(t) { - const e = t.protData - , n = [] - , i = [] - , o = e && e.initDataTypes && e.initDataTypes.length > 0 ? e.initDataTypes : [r.A.INITIALIZATION_DATA_TYPE_CENC] - , l = e && e.audioRobustness && e.audioRobustness.length > 0 ? e.audioRobustness : C - , c = e && e.videoRobustness && e.videoRobustness.length > 0 ? e.videoRobustness : C - , d = t.sessionType - , f = e && e.distinctiveIdentifier ? e.distinctiveIdentifier : "optional" - , g = e && e.persistentState ? e.persistentState : "temporary" === d ? "optional" : "required"; - return R.forEach((t => { - t.type === a.AUDIO ? n.push(new s(t.codec,l)) : t.type === a.VIDEO && i.push(new s(t.codec,c)) - } - )), - new u(n,i,f,g,[d],o) - } - function U(t) { - O(), - M.loadKeySession(t) - } - function j(t) { - if (t && function(t) { - if (!t) - return !1; - try { - const e = M.getSessionTokens(); - for (let n = 0; n < e.length; n++) - if (e[n].getKeyId() === t) - return !0; - return !1 - } catch (t) { - return !1 - } - }(t.keyId)) - return; - const e = l.getPSSHForKeySystem(D, t ? t.initData : null); - if (e) { - if (q(e)) - return; - try { - t.initData = e, - M.createKeySession(t) - } catch (t) { - b.trigger(y.KEY_SESSION_CREATED, { - data: null, - error: new d.A(c.A.KEY_SESSION_CREATED_ERROR_CODE,c.A.KEY_SESSION_CREATED_ERROR_MESSAGE + t.message) - }) - } - } else - t && t.initData ? M.createKeySession(t) : b.trigger(y.KEY_SESSION_CREATED, { - data: null, - error: new d.A(c.A.KEY_SESSION_CREATED_ERROR_CODE,c.A.KEY_SESSION_CREATED_ERROR_MESSAGE + "Selected key system is " + (D ? D.systemString : null) + ". needkey/encrypted event contains no initData corresponding to that key system!") - }) - } - function B(t) { - if (t) { - const e = t.systemString; - if (A) - return e in A ? A[e] : null - } - return null - } - function q(t) { - if (!t) - return !1; - try { - const e = M.getAllInitData(); - for (let n = 0; n < e.length; n++) - if (E.initDataEquals(t, e[n])) - return k.debug("DRM: Ignoring initData because we have already seen it!"), - !0; - return !1 - } catch (t) { - return !1 - } - } - function G(t) { - O(), - t ? (M.setMediaElement(t), - b.on(y.NEED_KEY, Q, T)) : null === t && (M.setMediaElement(t), - b.off(y.NEED_KEY, Q, T)) - } - function H(t) { - k.debug("DRM: onKeyMessage"); - const e = t.data; - b.trigger(y.KEY_MESSAGE, { - data: e - }); - const n = e.messageType ? e.messageType : r.A.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST - , a = e.message - , o = e.sessionToken - , s = B(D) - , u = E.getLicenseServerModelInstance(D, s, n) - , p = { - sessionToken: o, - messageType: n - }; - if (a && 0 !== a.byteLength) { - if (!u) - return k.debug("DRM: License server request not required for this message (type = " + t.data.messageType + "). Session ID = " + o.getSessionId()), - void Y(p); - if (E.isClearKey(D)) { - const t = E.processClearKeyLicenseRequest(D, s, a); - if (t && t.keyPairs && t.keyPairs.length > 0) - return k.debug("DRM: ClearKey license request handled by application!"), - Y(p), - void M.updateKeySession(o, t) - } - !function(t, e, n) { - const a = t.sessionToken - , o = t.messageType ? t.messageType : r.A.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST - , s = { - sessionToken: a, - messageType: o - } - , u = D ? D.systemString : null; - let p = function(t, e, n, a, r) { - let i = null; - const o = a.message; - if (t && t.serverURL) { - const n = t.serverURL; - "string" == typeof n && "" !== n ? i = n : "object" == typeof n && n.hasOwnProperty(e) && (i = n[e]) - } else if (t && t.laURL && "" !== t.laURL) - i = t.laURL; - else if (i = l.getLicenseServerUrlFromMediaInfo(R, D.schemeIdURI), - !i && !E.isClearKey(D)) { - const t = l.getPSSHData(n.initData); - i = D.getLicenseServerURLFromInitData(t), - i || (i = a.laURL) - } - return i = r.getServerURLFromMessage(i, o, e), - i - }(n, o, a, t, e); - if (!p) - return void Y(s, new d.A(c.A.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,c.A.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE)); - const b = {}; - let y = !1; - n && W(b, n.httpRequestHeaders); - const A = t.message; - W(b, D.getRequestHeadersFromMessage(A)), - Object.keys(b).forEach((t => { - "authorization" === t.toLowerCase() && (y = !0) - } - )), - n && "boolean" == typeof n.withCredentials && (y = n.withCredentials); - const T = function(t) { - if (M) - if (t.status >= 200 && t.status <= 299) { - const n = h.A.parseHttpHeaders(t.getAllResponseHeaders ? t.getAllResponseHeaders() : null); - let r = new g(t.responseURL,n,t.response); - X(i.getLicenseResponseFilters(), r).then(( () => { - const n = e.getLicenseMessage(r.data, u, o); - null !== n ? (Y(s), - M.updateKeySession(a, n)) : $(t, s, u, o, e) - } - )) - } else - $(t, s, u, o, e) - } - , v = function(t) { - Y(s, new d.A(c.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,c.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE + u + ' update, XHR aborted. status is "' + t.statusText + '" (' + t.status + "), readyState is " + t.readyState)) - } - , w = function(t) { - Y(s, new d.A(c.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,c.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE + u + ' update, XHR error. status is "' + t.statusText + '" (' + t.status + "), readyState is " + t.readyState)) - } - , S = D.getLicenseRequestFromMessage(A) - , I = e.getHTTPMethod(o) - , k = e.getResponseType(u, o) - , N = n && !isNaN(n.httpTimeout) ? n.httpTimeout : 8e3 - , C = a.getSessionId() || null; - let x = new f(p,I,k,b,y,o,C,S); - const z = isNaN(_.get().streaming.retryAttempts[m.G.LICENSE]) ? 3 : _.get().streaming.retryAttempts[m.G.LICENSE]; - X(i.getLicenseRequestFilters(), x).then(( () => { - V(x, z, N, T, v, w) - } - )) - }(e, u, s) - } else - Y(p, new d.A(c.A.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,c.A.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE)) - } - function Y(t) { - let e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null; - b.trigger(y.LICENSE_REQUEST_COMPLETE, { - data: t, - error: e - }) - } - function V(t, e, a, r, i, o) { - const l = new XMLHttpRequest - , s = n.getCmcdParametersFromManifest(); - if (n.isCmcdEnabled() && (s.mode ? s.mode : _.get().streaming.cmcd.mode) === p.A.CMCD_MODE_QUERY) { - const e = n.getQueryParameter({ - url: t.url, - type: m.G.LICENSE - }); - e && (t.url = h.A.addAdditionalQueryParameterToUrl(t.url, [e])) - } - l.open(t.method, t.url, !0), - l.responseType = t.responseType, - l.withCredentials = t.withCredentials, - a > 0 && (l.timeout = a); - for (const e in t.headers) - l.setRequestHeader(e, t.headers[e]); - if (n.isCmcdEnabled() && (s.mode ? s.mode : _.get().streaming.cmcd.mode) === p.A.CMCD_MODE_HEADER) { - const e = n.getHeaderParameters({ - url: t.url, - type: m.G.LICENSE - }); - if (e) - for (const t in e) { - let n = e[t]; - n && l.setRequestHeader(t, n) - } - } - const u = function() { - e--; - const n = isNaN(_.get().streaming.retryIntervals[m.G.LICENSE]) ? 1e3 : _.get().streaming.retryIntervals[m.G.LICENSE]; - S = setTimeout((function() { - V(t, e, a, r, i, o) - } - ), n) - }; - l.onload = function() { - I = null, - this.status >= 200 && this.status <= 299 || e <= 0 ? r(this) : (k.warn("License request failed (" + this.status + "). Retrying it... Pending retries: " + e), - u()) - } - , - l.ontimeout = l.onerror = function() { - I = null, - e <= 0 ? o(this) : (k.warn("License request network request failed . Retrying it... Pending retries: " + e), - u()) - } - , - l.onabort = function() { - i(this) - } - , - b.trigger(y.LICENSE_REQUEST_SENDING, { - url: t.url, - headers: t.headers, - payload: t.data, - sessionId: t.sessionId - }), - I = l, - l.send(t.data) - } - function K() { - I && (I.onloadend = I.onerror = I.onprogress = void 0, - I.abort(), - I = null), - S && (clearTimeout(S), - S = null) - } - function W(t, e) { - if (e) - for (const n in e) - t[n] = e[n] - } - function $(t, e, n, a, r) { - let i = "NONE" - , o = null; - t.response && (i = r.getErrorResponse(t.response, n, a), - o = { - serverResponse: t.response || null, - responseCode: t.status || null, - responseText: t.statusText || null - }), - Y(e, new d.A(c.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,c.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE + n + ' update, XHR complete. status is "' + t.statusText + '" (' + t.status + "), readyState is " + t.readyState + ". Response is " + i,o)) - } - function X(t, e) { - return t ? t.reduce(( (t, n) => t.then(( () => n(e)))), Promise.resolve()) : Promise.resolve() - } - function Q(t, e) { - if (_.get().streaming.protection.ignoreEmeEncryptedEvent) - return; - if (k.debug("DRM: onNeedKey"), - t.key.initDataType !== r.A.INITIALIZATION_DATA_TYPE_CENC) - return void k.warn("DRM: Only 'cenc' initData is supported! Ignoring initData of type: " + t.key.initDataType); - if (0 === R.length && (k.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"), - (e = void 0 === e ? 1 : e + 1) < 5)) - return void z.push(setTimeout(( () => { - Q(t, e) - } - ), 500)); - let n = t.key.initData; - if (ArrayBuffer.isView(n) && (n = n.buffer), - D) { - const t = l.getPSSHForKeySystem(D, n); - if (t && q(t)) - return - } - k.debug("DRM: initData:", String.fromCharCode.apply(null, new Uint8Array(n))); - const a = E.getSupportedKeySystemMetadataFromSegmentPssh(n, A, x); - 0 !== a.length ? function(t) { - N.push(t), - L(t, !1) - }(a) : k.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!") - } - function Z(t, e) { - if (t.size <= 0) - return !1; - if (e.size > 0 && [...t].every((t => { - const n = e.get(t); - return void 0 !== n && "" !== n - } - ))) - return !0; - const n = M.getSessionTokens(); - if (n && n.length > 0) { - const e = n.filter((e => [...t].includes(e.normalizedKeyId))); - if (e.some((t => !t.hasTriggeredKeyStatusMapUpdate)) || 0 === e.length) - return !1 - } - return !_.get().streaming.protection.ignoreKeyStatuses && t && t.size > 0 && e && e.size > 0 - } - return T = { - areKeyIdsExpired: function(t) { - try { - return !!Z(t, v) && [...t].every((t => v.get(t) === r.A.MEDIA_KEY_STATUSES.EXPIRED)) - } catch (t) { - return k.error(t), - !1 - } - }, - areKeyIdsUsable: function(t) { - try { - return !Z(t, v) || [...t].some((t => { - const e = v.get(t); - return e && e !== r.A.MEDIA_KEY_STATUSES.INTERNAL_ERROR && e !== r.A.MEDIA_KEY_STATUSES.OUTPUT_RESTRICTED - } - )) - } catch (t) { - return k.error(t), - !0 - } - }, - clearMediaInfoArray: function() { - R = [] - }, - closeKeySession: function(t) { - O(), - M.closeKeySession(t) - }, - createKeySession: j, - getKeySystems: function() { - return E ? E.getKeySystems() : [] - }, - getSupportedKeySystemMetadataFromContentProtection: function(t) { - return O(), - E.getSupportedKeySystemMetadataFromContentProtection(t, A, x) - }, - handleKeySystemFromManifest: function() { - if (!R || 0 === R.length) - return; - let t = []; - R.forEach((e => { - const n = E.getSupportedKeySystemMetadataFromContentProtection(e.contentProtection, A, x); - n.length > 0 && (0 === t.length && (t = n), - N.push(n)) - } - )), - t && t.length > 0 && L(t, !0) - }, - initializeForMedia: function(t) { - if (!t) - throw new Error("mediaInfo can not be null or undefined"); - O(), - R.push(t) - }, - loadKeySession: U, - removeKeySession: function(t) { - O(), - M.removeKeySession(t) - }, - reset: function() { - b.off(y.INTERNAL_KEY_MESSAGE, H, T), - O(), - K(), - G(null), - D = null, - w = !1, - v = new Map, - M && (M.reset(), - M = null), - z.forEach((t => clearTimeout(t))), - z = [], - R = [], - N = [] - }, - setKeySystems: function(t) { - E && E.setKeySystems(t) - }, - setMediaElement: G, - setProtectionData: function(t) { - A = t, - E.setProtectionData(t) - }, - setRobustnessLevel: function(t) { - C = t - }, - setServerCertificate: function(t) { - O(), - M.setServerCertificate(t) - }, - setSessionType: function(t) { - x = t - }, - stop: function() { - K(), - M && M.stop() - }, - updateKeyStatusesMap: function(t) { - try { - if (!t || !t.sessionToken || !t.parsedKeyStatuses) - return; - t.sessionToken.hasTriggeredKeyStatusMapUpdate = !0; - const e = t.parsedKeyStatuses - , n = h.A.parseUserAgent() - , a = n && n.browser && n.browser.name && "edge" === n.browser.name.toLowerCase(); - e.forEach((t => { - a && D.uuid === r.A.PLAYREADY_UUID && t.keyId && 16 === t.keyId.byteLength && function(t) { - const e = h.A.bufferSourceToDataView(t) - , n = e.getUint32(0, !0) - , a = e.getUint16(4, !0) - , r = e.getUint16(6, !0); - e.setUint32(0, n, !1), - e.setUint16(4, a, !1), - e.setUint16(6, r, !1) - }(t.keyId); - const e = h.A.bufferSourceToHex(t.keyId).slice(0, 32); - e && "" !== e && v.set(e, t.status) - } - )), - b.trigger(y.KEY_STATUSES_MAP_UPDATED, { - keyStatusMap: v - }) - } catch (t) { - k.error(t) - } - } - }, - k = o.getLogger(T), - N = [], - R = [], - x = "temporary", - C = "", - I = null, - S = null, - v = new Map, - b.on(y.INTERNAL_KEY_MESSAGE, H, T), - T - } - y.__dashjs_factory_name = "ProtectionController"; - var E = b.A.getClassFactory(y) - , _ = class { - constructor(t, e) { - this.keyID = t, - this.key = e - } - } - , A = class { - constructor(t, e) { - if (e && "persistent" !== e && "temporary" !== e) - throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'"); - this.keyPairs = t, - this.type = e - } - toJWK() { - let t, e = this.keyPairs.length, n = { - keys: [] - }; - for (t = 0; t < e; t++) { - let e = { - kty: "oct", - alg: "A128KW", - kid: this.keyPairs[t].keyID, - k: this.keyPairs[t].key - }; - n.keys.push(e) - } - this.type && (n.type = this.type); - let a = JSON.stringify(n); - const r = a.length; - let i = new ArrayBuffer(r) - , o = new Uint8Array(i); - for (t = 0; t < r; t++) - o[t] = a.charCodeAt(t); - return i - } - } - ; - const T = r.A.CLEARKEY_UUID - , v = r.A.CLEARKEY_KEYSTEM_STRING - , w = "urn:uuid:" + T; - function S(t) { - let e; - const n = (t = t || {}).BASE64; - return e = { - uuid: T, - schemeIdURI: w, - systemString: v, - getInitData: function(t, e) { - try { - let a = l.parseInitDataFromContentProtection(t, n); - if (!a && e) { - const t = { - kids: [function(t) { - try { - let e = t.replace(/-/g, ""); - return e = btoa(e.match(/\w{2}/g).map((t => String.fromCharCode(parseInt(t, 16)))).join("")), - e.replace(/=/g, "").replace(/\//g, "_").replace(/\+/g, "-") - } catch (t) { - return null - } - }(e.cencDefaultKid)] - }; - a = (new TextEncoder).encode(JSON.stringify(t)) - } - return a - } catch (t) { - return null - } - }, - getRequestHeadersFromMessage: function() { - return { - "Content-Type": "application/json" - } - }, - getLicenseRequestFromMessage: function(t) { - return JSON.stringify(JSON.parse(String.fromCharCode.apply(null, new Uint8Array(t)))) - }, - getLicenseServerURLFromInitData: function() { - return null - }, - getCDMData: function() { - return null - }, - getClearKeysFromProtectionData: function(t, e) { - let n = null; - if (t) { - const a = JSON.parse(String.fromCharCode.apply(null, new Uint8Array(e))) - , r = []; - for (let e = 0; e < a.kids.length; e++) { - const n = a.kids[e] - , i = t.clearkeys && t.clearkeys.hasOwnProperty(n) ? t.clearkeys[n] : null; - if (!i) - throw new Error("DRM: ClearKey keyID (" + n + ") is not known!"); - r.push(new _(n,i)) - } - n = new A(r) - } - return n - } - }, - e - } - S.__dashjs_factory_name = "KeySystemClearKey"; - var I = b.A.getSingletonFactory(S); - const k = r.A.W3C_CLEARKEY_UUID - , R = r.A.CLEARKEY_KEYSTEM_STRING - , N = "urn:uuid:" + k; - function C(t) { - let e; - const n = t.BASE64 - , a = t.debug.getLogger(e); - return e = { - uuid: k, - schemeIdURI: N, - systemString: R, - getInitData: function(t) { - return l.parseInitDataFromContentProtection(t, n) - }, - getRequestHeadersFromMessage: function() { - return null - }, - getLicenseRequestFromMessage: function(t) { - return new Uint8Array(t) - }, - getLicenseServerURLFromInitData: function() { - return null - }, - getCDMData: function() { - return null - }, - getClearKeysFromProtectionData: function(t, e) { - let n = null; - if (t) { - const r = JSON.parse(String.fromCharCode.apply(null, new Uint8Array(e))) - , i = []; - for (let e = 0; e < r.kids.length; e++) { - const n = r.kids[e] - , a = t.clearkeys && t.clearkeys.hasOwnProperty(n) ? t.clearkeys[n] : null; - if (!a) - throw new Error("DRM: ClearKey keyID (" + n + ") is not known!"); - i.push(new _(n,a)) - } - n = new A(i), - a.warn("ClearKey schemeIdURI is using W3C Common PSSH systemID (1077efec-c0b2-4d02-ace3-3c1e52e2fb4b) in Content Protection. See DASH-IF IOP v4.1 section 7.6.2.4") - } - return n - } - }, - e - } - C.__dashjs_factory_name = "KeySystemW3CClearKey"; - var D = b.A.getSingletonFactory(C); - const x = r.A.WIDEVINE_UUID - , M = r.A.WIDEVINE_KEYSTEM_STRING - , z = "urn:uuid:" + x; - function O(t) { - let e; - const n = (t = t || {}).BASE64; - return e = { - uuid: x, - schemeIdURI: z, - systemString: M, - getInitData: function(t) { - return l.parseInitDataFromContentProtection(t, n) - }, - getRequestHeadersFromMessage: function() { - return null - }, - getLicenseRequestFromMessage: function(t) { - return new Uint8Array(t) - }, - getLicenseServerURLFromInitData: function() { - return null - }, - getCDMData: function() { - return null - } - }, - e - } - O.__dashjs_factory_name = "KeySystemWidevine"; - var L = b.A.getSingletonFactory(O); - const P = r.A.PLAYREADY_UUID - , F = r.A.PLAYREADY_KEYSTEM_STRING - , U = "urn:uuid:" + P; - function j(t) { - let e, n = "utf-16"; - const a = (t = t || {}).BASE64 - , r = t.settings; - function i() { - if (!a || !a.hasOwnProperty("decodeArray") || !a.hasOwnProperty("decodeArray")) - throw new Error("Missing config parameter(s)") - } - return e = { - uuid: P, - schemeIdURI: U, - systemString: F, - getInitData: function(t) { - const e = new Uint8Array([112, 115, 115, 104, 0, 0, 0, 0]) - , n = new Uint8Array([154, 4, 240, 121, 152, 64, 66, 134, 171, 146, 230, 91, 224, 136, 95, 149]); - let r, o, s, u, c, d = 0, f = null; - if (i(), - !t) - return null; - if ("pssh"in t && t.pssh) - return l.parseInitDataFromContentProtection(t, a); - if ("pro"in t && t.pro) - f = a.decodeArray(t.pro.__text); - else { - if (!("prheader"in t) || !t.prheader) - return null; - f = a.decodeArray(t.prheader.__text) - } - return r = f.length, - o = 4 + e.length + n.length + 4 + r, - s = new ArrayBuffer(o), - u = new Uint8Array(s), - c = new DataView(s), - c.setUint32(d, o), - d += 4, - u.set(e, d), - d += e.length, - u.set(n, d), - d += n.length, - c.setUint32(d, r), - d += 4, - u.set(f, d), - d += r, - u.buffer - }, - getRequestHeadersFromMessage: function(t) { - let e, a; - const i = {} - , o = new DOMParser; - if (r && r.get().streaming.protection.detectPlayreadyMessageFormat && "utf-16" === n && t && t.byteLength % 2 == 1) - return i["Content-Type"] = "text/xml; charset=utf-8", - i; - const l = "utf-16" === n ? new Uint16Array(t) : new Uint8Array(t); - e = String.fromCharCode.apply(null, l), - a = o.parseFromString(e, "application/xml"); - const s = a.getElementsByTagName("name") - , u = a.getElementsByTagName("value"); - for (let t = 0; t < s.length; t++) - i[s[t].childNodes[0].nodeValue] = u[t].childNodes[0].nodeValue; - return i.hasOwnProperty("Content") && (i["Content-Type"] = i.Content, - delete i.Content), - i.hasOwnProperty("Content-Type") || (i["Content-Type"] = "text/xml; charset=utf-8"), - i - }, - getLicenseRequestFromMessage: function(t) { - let e = null; - const o = new DOMParser; - if (r && r.get().streaming.protection.detectPlayreadyMessageFormat && "utf-16" === n && t && t.byteLength % 2 == 1) - return t; - const l = "utf-16" === n ? new Uint16Array(t) : new Uint8Array(t); - i(); - const s = String.fromCharCode.apply(null, l) - , u = o.parseFromString(s, "application/xml"); - if (!u.getElementsByTagName("PlayReadyKeyMessage")[0]) - return t; - { - const t = u.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue; - t && (e = a.decode(t)) - } - return e - }, - getLicenseServerURLFromInitData: function(t) { - if (t) { - const e = new DataView(t) - , n = e.getUint16(4, !0); - let a = 6; - const r = new DOMParser; - for (let i = 0; i < n; i++) { - const n = e.getUint16(a, !0); - a += 2; - const i = e.getUint16(a, !0); - if (a += 2, - 1 !== n) { - a += i; - continue - } - const o = t.slice(a, a + i) - , l = String.fromCharCode.apply(null, new Uint16Array(o)) - , s = r.parseFromString(l, "application/xml"); - if (s.getElementsByTagName("LA_URL")[0]) { - const t = s.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue; - if (t) - return t - } - if (s.getElementsByTagName("LUI_URL")[0]) { - const t = s.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue; - if (t) - return t - } - } - } - return null - }, - getCDMData: function(t) { - let e, n, r, o; - if (i(), - !t) - return null; - for (e = [], - o = 0; o < t.length; ++o) - e.push(t.charCodeAt(o)), - e.push(0); - for (e = String.fromCharCode.apply(null, e), - e = a.encode(e), - n = '%CUSTOMDATA%'.replace("%CUSTOMDATA%", e), - r = [], - o = 0; o < n.length; ++o) - r.push(n.charCodeAt(o)), - r.push(0); - return new Uint8Array(r).buffer - }, - setPlayReadyMessageFormat: function(t) { - if ("utf-8" !== t && "utf-16" !== t) - throw new Error('Specified message format is not one of "utf-8" or "utf-16"'); - n = t - } - }, - e - } - j.__dashjs_factory_name = "KeySystemPlayReady"; - var B = b.A.getSingletonFactory(j); - function q(t) { - const e = (t = t || {}).BASE64 - , n = {}; - let a; - return n[r.A.WIDEVINE_KEYSTEM_STRING] = { - responseType: "json", - getLicenseMessage: function(t) { - return e.decodeArray(t.license) - }, - getErrorResponse: function(t) { - return t - } - }, - n[r.A.PLAYREADY_KEYSTEM_STRING] = { - responseType: "arraybuffer", - getLicenseMessage: function(t) { - return t - }, - getErrorResponse: function(t) { - return String.fromCharCode.apply(null, new Uint8Array(t)) - } - }, - a = { - getServerURLFromMessage: function(t) { - return t - }, - getHTTPMethod: function() { - return "POST" - }, - getResponseType: function(t) { - return n[t].responseType - }, - getLicenseMessage: function(t, a) { - return function() { - if (!e || !e.hasOwnProperty("decodeArray")) - throw new Error("Missing config parameter(s)") - }(), - n[a].getLicenseMessage(t) - }, - getErrorResponse: function(t, e) { - return n[e].getErrorResponse(t) - } - }, - a - } - q.__dashjs_factory_name = "DRMToday"; - var G = b.A.getSingletonFactory(q); - function H() { - let t; - const e = "http://schemas.xmlsoap.org/soap/envelope/"; - function n(t) { - const e = String.fromCharCode.apply(null, new Uint8Array(t)); - return decodeURIComponent(escape(e)) - } - function a(t) { - if (window.DOMParser) { - const a = n(t) - , r = (new window.DOMParser).parseFromString(a, "text/xml") - , i = r ? r.getElementsByTagNameNS(e, "Envelope")[0] : null - , o = i ? i.getElementsByTagNameNS(e, "Body")[0] : null; - if (o && o.getElementsByTagNameNS(e, "Fault")[0]) - return null - } - return t - } - function r(t) { - let a = "" - , r = "" - , i = "" - , o = -1 - , l = -1; - if (window.DOMParser) { - const s = n(t) - , u = (new window.DOMParser).parseFromString(s, "text/xml") - , c = u ? u.getElementsByTagNameNS(e, "Envelope")[0] : null - , d = c ? c.getElementsByTagNameNS(e, "Body")[0] : null - , f = d ? d.getElementsByTagNameNS(e, "Fault")[0] : null - , g = f ? f.getElementsByTagName("detail")[0] : null - , m = g ? g.getElementsByTagName("Exception")[0] : null; - let h = null; - if (null === f) - return s; - h = f.getElementsByTagName("faultstring")[0].firstChild, - a = h ? h.nodeValue : null, - null !== m && (h = m.getElementsByTagName("StatusCode")[0], - r = h ? h.firstChild.nodeValue : null, - h = m.getElementsByTagName("Message")[0], - i = h ? h.firstChild.nodeValue : null, - o = i ? i.lastIndexOf("[") + 1 : -1, - l = i ? i.indexOf("]") : -1, - i = i ? i.substring(o, l) : "") - } - let s = `code: ${r}, name: ${a}`; - return i && (s += `, message: ${i}`), - s - } - return t = { - getServerURLFromMessage: function(t) { - return t - }, - getHTTPMethod: function() { - return "POST" - }, - getResponseType: function() { - return "arraybuffer" - }, - getLicenseMessage: function(t) { - return a.call(this, t) - }, - getErrorResponse: function(t) { - return r.call(this, t) - } - }, - t - } - H.__dashjs_factory_name = "PlayReady"; - var Y = b.A.getSingletonFactory(H); - function V() { - let t; - return t = { - getServerURLFromMessage: function(t) { - return t - }, - getHTTPMethod: function() { - return "POST" - }, - getResponseType: function() { - return "arraybuffer" - }, - getLicenseMessage: function(t) { - return t - }, - getErrorResponse: function(t) { - return String.fromCharCode.apply(null, new Uint8Array(t)) - } - }, - t - } - V.__dashjs_factory_name = "Widevine"; - var K = b.A.getSingletonFactory(V); - function W() { - let t; - return t = { - getServerURLFromMessage: function(t) { - return t - }, - getHTTPMethod: function() { - return "POST" - }, - getResponseType: function() { - return "json" - }, - getLicenseMessage: function(t) { - if (!t.hasOwnProperty("keys")) - return null; - let e = []; - for (let n = 0; n < t.keys.length; n++) { - let a = t.keys[n] - , r = a.kid.replace(/=/g, "") - , i = a.k.replace(/=/g, ""); - e.push(new _(r,i)) - } - return new A(e) - }, - getErrorResponse: function(t) { - return String.fromCharCode.apply(null, new Uint8Array(t)) - } - }, - t - } - W.__dashjs_factory_name = "ClearKey"; - var $ = b.A.getSingletonFactory(W) - , X = class { - constructor(t) { - this.ks = t.ks, - this.keyId = t.keyId, - this.initData = t.initData, - this.protData = t.protData, - this.cdmData = t.cdmData, - this.sessionId = t.sessionId, - this.sessionType = t.sessionType - } - } - ; - function Q() { - let t, e, n, a, i, o, s, u, c = this.context; - function d(t, e) { - return e && t in e ? e[t] : null - } - function f(t, e) { - return t && t.sessionId ? t.sessionId : e && e.sessionId ? e.sessionId : null - } - function g(t, e) { - return t && t.sessionType ? t.sessionType : e - } - return t = { - getKeySystemBySystemString: function(t) { - for (let e = 0; e < a.length; e++) - if (a[e].systemString === t) - return a[e]; - return null - }, - getKeySystems: function() { - return a - }, - getLicenseServerModelInstance: function(t, e, n) { - if (n === r.A.MEDIA_KEY_MESSAGE_TYPES.LICENSE_RELEASE || n === r.A.MEDIA_KEY_MESSAGE_TYPES.INDIVIDUALIZATION_REQUEST) - return null; - let a = null; - return e && e.hasOwnProperty("drmtoday") ? a = G(c).getInstance({ - BASE64: i - }) : t.systemString === r.A.WIDEVINE_KEYSTEM_STRING ? a = K(c).getInstance() : t.systemString === r.A.PLAYREADY_KEYSTEM_STRING ? a = Y(c).getInstance() : t.systemString === r.A.CLEARKEY_KEYSTEM_STRING && (a = $(c).getInstance()), - a - }, - getSupportedKeySystemMetadataFromContentProtection: function(t, e, n) { - let r, i, o, s, u = []; - if (!t || !t.length) - return u; - const c = l.findMp4ProtectionElement(t); - for (o = 0; o < a.length; o++) { - i = a[o]; - const l = d(i.systemString, e); - for (s = 0; s < t.length; s++) - if (r = t[s], - r.schemeIdUri.toLowerCase() === i.schemeIdURI) { - let t = i.getInitData(r, c); - const e = new X({ - ks: a[o], - keyId: r.keyId, - initData: t, - protData: l, - cdmData: i.getCDMData(l ? l.cdmData : null), - sessionId: f(l, r), - sessionType: g(l, n) - }); - l ? u.unshift(e) : u.push(e) - } - } - return u - }, - getSupportedKeySystemMetadataFromSegmentPssh: function(t, e, n) { - let r, i, o = [], s = l.parsePSSHList(t); - for (let t = 0; t < a.length; ++t) { - r = a[t], - i = r.systemString; - const l = d(i, e); - r.uuid in s && o.push({ - ks: r, - initData: s[r.uuid], - protData: l, - cdmData: r.getCDMData(l ? l.cdmData : null), - sessionId: f(l), - sessionType: g(l, n) - }) - } - return o - }, - initDataEquals: function(t, e) { - if (t.byteLength === e.byteLength) { - let n = new Uint8Array(t) - , a = new Uint8Array(e); - for (let t = 0; t < n.length; t++) - if (n[t] !== a[t]) - return !1; - return !0 - } - return !1 - }, - initialize: function() { - let t; - a = [], - t = B(c).getInstance({ - BASE64: i, - settings: o - }), - a.push(t), - t = L(c).getInstance({ - BASE64: i - }), - a.push(t), - t = I(c).getInstance({ - BASE64: i - }), - a.push(t), - s = t, - t = D(c).getInstance({ - BASE64: i, - debug: e - }), - a.push(t), - u = t - }, - isClearKey: function(t) { - return t === s || t === u - }, - processClearKeyLicenseRequest: function(t, e, a) { - try { - return t.getClearKeysFromProtectionData(e, a) - } catch (t) { - return n.error("Failed to retrieve clearkeys from ProtectionData"), - null - } - }, - setConfig: function(a) { - a && (a.debug && (e = a.debug, - n = e.getLogger(t)), - a.BASE64 && (i = a.BASE64), - a.settings && (o = a.settings)) - }, - setKeySystems: function(t) { - a = t - }, - setProtectionData: function(t) { - for (var e, n, r = 0; r < a.length; r++) { - var i = a[r]; - i.hasOwnProperty("init") && i.init((e = i.systemString, - n = void 0, - n = null, - t && (n = e in t ? t[e] : null), - n)) - } - } - }, - t - } - Q.__dashjs_factory_name = "ProtectionKeyController"; - var Z = b.A.getSingletonFactory(Q) - , J = n(445) - , tt = class { - constructor(t, e) { - this.initData = t, - this.initDataType = e - } - } - , et = class { - constructor(t, e, n, a) { - this.sessionToken = t, - this.message = e, - this.defaultURL = n, - this.messageType = a || r.A.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST - } - } - , nt = class { - constructor(t, e) { - this.keySystem = t, - this.ksConfiguration = e, - this.nativeMediaKeySystemAccessObject = null, - this.selectedSystemString = null - } - } - ; - const at = {}; - function rt(t) { - t = t || {}; - const e = this.context - , n = t.eventBus - , a = t.events - , i = t.debug; - let o, l, s, u, f, g, m, h; - function p(t, e, r, i) { - if (void 0 === navigator.requestMediaKeySystemAccess || "function" != typeof navigator.requestMediaKeySystemAccess) { - const t = "Insecure origins are not allowed"; - return n.trigger(a.KEY_SYSTEM_ACCESS_COMPLETE, { - error: t - }), - void i({ - error: t - }) - } - const o = t[e].protData && t[e].protData.systemStringPriority ? t[e].protData.systemStringPriority : null - , l = t[e].configs - , s = t[e].ks; - let u = s.systemString; - (function(t, e) { - return new Promise(( (n, a) => { - b(t, e, 0, n, a) - } - )) - } - )(o || (at[u] ? at[u] : [u]), l).then((t => { - const e = t && t.nativeMediaKeySystemAccessObject && "function" == typeof t.nativeMediaKeySystemAccessObject.getConfiguration ? t.nativeMediaKeySystemAccessObject.getConfiguration() : null - , i = new nt(s,e); - i.selectedSystemString = t.selectedSystemString, - i.nativeMediaKeySystemAccessObject = t.nativeMediaKeySystemAccessObject, - n.trigger(a.KEY_SYSTEM_ACCESS_COMPLETE, { - data: i - }), - r({ - data: i - }) - } - )).catch((o => { - if (e + 1 < t.length) - p(t, e + 1, r, i); - else { - const t = "Key system access denied! "; - n.trigger(a.KEY_SYSTEM_ACCESS_COMPLETE, { - error: t + o.message - }), - i({ - error: t + o.message - }) - } - } - )) - } - function b(t, e, n, a, r) { - const i = t[n]; - l.debug(`Requesting key system access for system string ${i}`), - navigator.requestMediaKeySystemAccess(i, e).then((t => { - a({ - nativeMediaKeySystemAccessObject: t, - selectedSystemString: i - }) - } - )).catch((i => { - n + 1 < t.length ? b(t, e, n + 1, a, r) : r(i) - } - )) - } - function y(t) { - if (!t || !t.session) - return Promise.resolve; - const e = t.session; - return e.removeEventListener("keystatuseschange", t), - e.removeEventListener("message", t), - e.close() - } - function E(t) { - for (let e = 0; e < g.length; e++) - if (g[e] === t) { - g.splice(e, 1); - break - } - } - function _(t, e) { - const i = { - session: t, - keyId: e.keyId, - normalizedKeyId: e && e.keyId && "string" == typeof e.keyId ? e.keyId.replace(/-/g, "").toLowerCase() : "", - initData: e.initData, - sessionId: e.sessionId, - sessionType: e.sessionType, - hasTriggeredKeyStatusMapUpdate: !1, - handleEvent: function(t) { - switch (t.type) { - case "keystatuseschange": - this._onKeyStatusesChange(t); - break; - case "message": - this._onKeyMessage(t) - } - }, - _onKeyStatusesChange: function(t) { - n.trigger(a.KEY_STATUSES_CHANGED, { - data: this - }); - const e = []; - t.target.keyStatuses.forEach((function() { - e.push(A(arguments)) - } - )), - n.trigger(a.INTERNAL_KEY_STATUSES_CHANGED, { - parsedKeyStatuses: e, - sessionToken: i - }) - }, - _onKeyMessage: function(t) { - let e = ArrayBuffer.isView(t.message) ? t.message.buffer : t.message; - n.trigger(a.INTERNAL_KEY_MESSAGE, { - data: new et(this,e,void 0,t.messageType) - }) - }, - getKeyId: function() { - return this.keyId - }, - getSessionId: function() { - return t.sessionId - }, - getSessionType: function() { - return this.sessionType - }, - getExpirationTime: function() { - return t.expiration - }, - getKeyStatuses: function() { - return t.keyStatuses - }, - getUsable: function() { - let e = !1; - return t.keyStatuses.forEach((function() { - A(arguments).status === r.A.MEDIA_KEY_STATUSES.USABLE && (e = !0) - } - )), - e - } - }; - return t.addEventListener("keystatuseschange", i), - t.addEventListener("message", i), - t.closed.then(( () => { - E(i), - l.debug("DRM: Session closed. SessionID = " + i.getSessionId()), - n.trigger(a.KEY_SESSION_CLOSED, { - data: i.getSessionId() - }) - } - )), - g.push(i), - i - } - function A(t) { - let e, n; - return t && t.length > 0 && (t[0] && ("string" == typeof t[0] ? e = t[0] : n = t[0]), - t[1] && ("string" == typeof t[1] ? e = t[1] : n = t[1])), - { - status: e, - keyId: n - } - } - return o = { - closeKeySession: function(t) { - y(t).catch((function(e) { - E(t), - n.trigger(a.KEY_SESSION_CLOSED, { - data: null, - error: "Error closing session (" + t.getSessionId() + ") " + e.name - }) - } - )) - }, - createKeySession: function(t) { - if (!s || !f) - throw new Error("Can not create sessions until you have selected a key system"); - const e = f.createSession(t.sessionType) - , i = _(e, t) - , o = s.systemString === r.A.CLEARKEY_KEYSTEM_STRING && (t.initData || t.protData && t.protData.clearkeys) ? r.A.INITIALIZATION_DATA_TYPE_KEYIDS : r.A.INITIALIZATION_DATA_TYPE_CENC; - e.generateRequest(o, t.initData).then((function() { - l.debug("DRM: Session created. SessionID = " + i.getSessionId()), - n.trigger(a.KEY_SESSION_CREATED, { - data: i - }) - } - )).catch((function(t) { - E(i), - n.trigger(a.KEY_SESSION_CREATED, { - data: null, - error: new d.A(c.A.KEY_SESSION_CREATED_ERROR_CODE,c.A.KEY_SESSION_CREATED_ERROR_MESSAGE + "Error generating key request -- " + t.name) - }) - } - )) - }, - getAllInitData: function() { - const t = []; - for (let e = 0; e < g.length; e++) - g[e].initData && t.push(g[e].initData); - return t - }, - getSessionTokens: function() { - return g - }, - loadKeySession: function(t) { - if (!s || !f) - throw new Error("Can not load sessions until you have selected a key system"); - const e = t.sessionId; - for (let t = 0; t < g.length; t++) - if (e === g[t].sessionId) - return void l.warn("DRM: Ignoring session ID because we have already seen it!"); - const r = f.createSession(t.sessionType) - , i = _(r, t); - i.hasTriggeredKeyStatusMapUpdate = !0, - r.load(e).then((function(t) { - t ? (l.debug("DRM: Session loaded. SessionID = " + i.getSessionId()), - n.trigger(a.KEY_SESSION_CREATED, { - data: i - })) : (E(i), - n.trigger(a.KEY_SESSION_CREATED, { - data: null, - error: new d.A(c.A.KEY_SESSION_CREATED_ERROR_CODE,c.A.KEY_SESSION_CREATED_ERROR_MESSAGE + "Could not load session! Invalid Session ID (" + e + ")") - })) - } - )).catch((function(t) { - E(i), - n.trigger(a.KEY_SESSION_CREATED, { - data: null, - error: new d.A(c.A.KEY_SESSION_CREATED_ERROR_CODE,c.A.KEY_SESSION_CREATED_ERROR_MESSAGE + "Could not load session (" + e + ")! " + t.name) - }) - } - )) - }, - removeKeySession: function(t) { - t.session.remove().then((function() { - l.debug("DRM: Session removed. SessionID = " + t.getSessionId()), - n.trigger(a.KEY_SESSION_REMOVED, { - data: t.getSessionId() - }) - } - ), (function(e) { - n.trigger(a.KEY_SESSION_REMOVED, { - data: null, - error: "Error removing session (" + t.getSessionId() + "). " + e.name - }) - } - )) - }, - requestKeySystemAccess: function(t) { - return new Promise(( (e, n) => { - p(t, 0, e, n) - } - )) - }, - reset: function() { - const t = g.length; - let e; - if (0 !== t) { - const r = function(t) { - E(t), - 0 === g.length && (u ? (u.removeEventListener("encrypted", m), - u.setMediaKeys(null).then((function() { - n.trigger(a.TEARDOWN_COMPLETE) - } - ))) : n.trigger(a.TEARDOWN_COMPLETE)) - }; - for (let n = 0; n < t; n++) - e = g[n], - function(t) { - y(e), - r(t) - }(e) - } else - n.trigger(a.TEARDOWN_COMPLETE) - }, - selectKeySystem: function(t) { - return new Promise(( (e, n) => { - t.nativeMediaKeySystemAccessObject.createMediaKeys().then((e => (s = t.keySystem, - f = e, - u ? u.setMediaKeys(f) : Promise.resolve()))).then(( () => { - e(s) - } - )).catch((function() { - n({ - error: "Error selecting keys system (" + t.keySystem.systemString + ")! Could not create MediaKeys -- TODO" - }) - } - )) - } - )) - }, - setMediaElement: function(t) { - u !== t && (u && (u.removeEventListener("encrypted", m), - u.setMediaKeys && u.setMediaKeys(null)), - u = t, - u && (u.addEventListener("encrypted", m), - u.setMediaKeys && f && u.setMediaKeys(f))) - }, - setServerCertificate: function(t) { - return new Promise(( (e, r) => { - f.setServerCertificate(t).then((function() { - l.info("DRM: License server certificate successfully updated."), - n.trigger(a.SERVER_CERTIFICATE_UPDATED), - e() - } - )).catch((t => { - r(t), - n.trigger(a.SERVER_CERTIFICATE_UPDATED, { - error: new d.A(c.A.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,c.A.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE + t.name) - }) - } - )) - } - )) - }, - stop: function() { - let t; - for (let e = 0; e < g.length; e++) - t = g[e], - t.getUsable() || (y(t), - E(t)) - }, - updateKeySession: function(t, e) { - const r = t.session; - h.isClearKey(s) && (e = e.toJWK()), - r.update(e).then(( () => { - n.trigger(a.KEY_SESSION_UPDATED) - } - )).catch((function(e) { - n.trigger(a.KEY_ERROR, { - error: new d.A(c.A.MEDIA_KEYERR_CODE,"Error sending update() message! " + e.name,t) - }) - } - )) - } - }, - l = i.getLogger(o), - s = null, - u = null, - f = null, - g = [], - h = Z(e).getInstance(), - m = { - handleEvent: function(t) { - if ("encrypted" === t.type && t.initData) { - let e = ArrayBuffer.isView(t.initData) ? t.initData.buffer : t.initData; - n.trigger(a.NEED_KEY, { - key: new tt(e,t.initDataType) - }) - } - } - }, - o - } - at[r.A.PLAYREADY_KEYSTEM_STRING] = [r.A.PLAYREADY_KEYSTEM_STRING, r.A.PLAYREADY_RECOMMENDATION_KEYSTEM_STRING], - at[r.A.WIDEVINE_KEYSTEM_STRING] = [r.A.WIDEVINE_KEYSTEM_STRING], - at[r.A.CLEARKEY_KEYSTEM_STRING] = [r.A.CLEARKEY_KEYSTEM_STRING], - rt.__dashjs_factory_name = "DefaultProtectionModel"; - var it = b.A.getClassFactory(rt); - function ot(t) { - t = t || {}; - const e = this.context - , n = t.eventBus - , a = t.events - , i = t.debug - , o = t.api; - let l, s, f, g, m, h, p, b, y; - function E() { - try { - for (let t = 0; t < p.length; t++) - _(p[t]); - f && f.removeEventListener(o.needkey, b), - n.trigger(a.TEARDOWN_COMPLETE) - } catch (t) { - n.trigger(a.TEARDOWN_COMPLETE, { - error: "Error tearing down key sessions and MediaKeys! -- " + t.message - }) - } - } - function _(t) { - const e = t.session; - e.removeEventListener(o.error, t), - e.removeEventListener(o.message, t), - e.removeEventListener(o.ready, t), - e.removeEventListener(o.close, t); - for (let e = 0; e < p.length; e++) - if (p[e] === t) { - p.splice(e, 1); - break - } - e[o.release]() - } - function A() { - let t = null; - const e = function() { - f.removeEventListener("loadedmetadata", t), - f[o.setMediaKeys](m), - n.trigger(a.VIDEO_ELEMENT_SELECTED) - }; - f.readyState >= 1 ? e() : (t = e.bind(this), - f.addEventListener("loadedmetadata", t)) - } - return l = { - getAllInitData: function() { - const t = []; - for (let e = 0; e < p.length; e++) - t.push(p[e].initData); - return t - }, - getSessionTokens: function() { - return p - }, - requestKeySystemAccess: function(t) { - return new Promise(( (e, r) => { - let i = !1; - for (let r = 0; r < t.length; r++) { - const l = t[r].ks.systemString - , s = t[r].configs; - let c = null - , d = null; - for (let t = 0; t < s.length; t++) { - const r = s[t].audioCapabilities - , f = s[t].videoCapabilities; - if (r && 0 !== r.length) { - c = []; - for (let t = 0; t < r.length; t++) - window[o.MediaKeys].isTypeSupported(l, r[t].contentType) && c.push(r[t]) - } - if (f && 0 !== f.length) { - d = []; - for (let t = 0; t < f.length; t++) - window[o.MediaKeys].isTypeSupported(l, f[t].contentType) && d.push(f[t]) - } - if (!c && !d || c && 0 === c.length || d && 0 === d.length) - continue; - i = !0; - const g = new u(c,d) - , m = y.getKeySystemBySystemString(l) - , h = new nt(m,g); - n.trigger(a.KEY_SYSTEM_ACCESS_COMPLETE, { - data: h - }), - e({ - data: h - }); - break - } - } - if (!i) { - const t = "Key system access denied! -- No valid audio/video content configurations detected!"; - n.trigger(a.KEY_SYSTEM_ACCESS_COMPLETE, { - error: t - }), - r({ - error: t - }) - } - } - )) - }, - selectKeySystem: function(t) { - return new Promise(( (e, n) => { - try { - m = t.mediaKeys = new window[o.MediaKeys](t.keySystem.systemString), - g = t.keySystem, - h = t, - f && A(), - e(g) - } catch (t) { - n({ - error: "Error selecting keys system (" + g.systemString + ")! Could not create MediaKeys -- TODO" - }) - } - } - )) - }, - setMediaElement: function(t) { - f !== t && (f && f.removeEventListener(o.needkey, b), - f = t, - f && (f.addEventListener(o.needkey, b), - m && A())) - }, - createKeySession: function(t) { - if (!g || !m || !h) - throw new Error("Can not create sessions until you have selected a key system"); - let e = null; - if (h.ksConfiguration.videoCapabilities && h.ksConfiguration.videoCapabilities.length > 0 && (e = h.ksConfiguration.videoCapabilities[0]), - null === e && h.ksConfiguration.audioCapabilities && h.ksConfiguration.audioCapabilities.length > 0 && (e = h.ksConfiguration.audioCapabilities[0]), - null === e) - throw new Error("Can not create sessions for unknown content types."); - const r = e.contentType - , i = m.createSession(r, new Uint8Array(t.initData), t.cdmData ? new Uint8Array(t.cdmData) : null) - , l = function(t, e) { - return { - session: t, - keyId: e.keyId, - normalizedKeyId: e && e.keyId && "string" == typeof e.keyId ? e.keyId.replace(/-/g, "").toLowerCase() : "", - initData: e.initData, - hasTriggeredKeyStatusMapUpdate: !1, - getKeyId: function() { - return this.keyId - }, - getSessionId: function() { - return this.session.sessionId - }, - getExpirationTime: function() { - return NaN - }, - getSessionType: function() { - return "temporary" - }, - getKeyStatuses: function() { - return { - size: 0, - has: () => !1, - get: () => {} - } - }, - handleEvent: function(t) { - switch (t.type) { - case o.error: - let e = "KeyError"; - n.trigger(a.KEY_ERROR, { - error: new d.A(c.A.MEDIA_KEYERR_CODE,e,this) - }); - break; - case o.message: - let r = ArrayBuffer.isView(t.message) ? t.message.buffer : t.message; - n.trigger(a.INTERNAL_KEY_MESSAGE, { - data: new et(this,r,t.destinationURL) - }); - break; - case o.ready: - s.debug("DRM: Key added."), - n.trigger(a.KEY_ADDED); - break; - case o.close: - s.debug("DRM: Session closed. SessionID = " + this.getSessionId()), - n.trigger(a.KEY_SESSION_CLOSED, { - data: this.getSessionId() - }) - } - } - } - }(i, t); - i.addEventListener(o.error, l), - i.addEventListener(o.message, l), - i.addEventListener(o.ready, l), - i.addEventListener(o.close, l), - p.push(l), - s.debug("DRM: Session created. SessionID = " + l.getSessionId()), - n.trigger(a.KEY_SESSION_CREATED, { - data: l - }) - }, - updateKeySession: function(t, e) { - const r = t.session; - y.isClearKey(g) ? r.update(new Uint8Array(e.toJWK())) : r.update(new Uint8Array(e)), - n.trigger(a.KEY_SESSION_UPDATED) - }, - closeKeySession: _, - setServerCertificate: function() {}, - loadKeySession: function() {}, - removeKeySession: function() {}, - stop: E, - reset: E - }, - s = i.getLogger(l), - f = null, - g = null, - m = null, - h = null, - p = [], - y = Z(e).getInstance(), - b = { - handleEvent: function(t) { - if (t.type === o.needkey && t.initData) { - const e = ArrayBuffer.isView(t.initData) ? t.initData.buffer : t.initData; - n.trigger(a.NEED_KEY, { - key: new tt(e,r.A.INITIALIZATION_DATA_TYPE_CENC) - }) - } - } - }, - l - } - ot.__dashjs_factory_name = "ProtectionModel_3Feb2014"; - var lt = b.A.getClassFactory(ot); - function st(t) { - t = t || {}; - const e = this.context - , n = t.eventBus - , a = t.events - , i = t.debug - , o = t.api - , l = t.errHandler; - let s, f, g, m, h, p, b, y, E; - function _() { - g && v(); - for (let t = 0; t < b.length; t++) - A(b[t]); - n.trigger(a.TEARDOWN_COMPLETE) - } - function A(t) { - try { - g[o.cancelKeyRequest](m.systemString, t.sessionId) - } catch (e) { - n.trigger(a.KEY_SESSION_CLOSED, { - data: null, - error: "Error closing session (" + t.sessionId + ") " + e.message - }) - } - } - function T(t, e) { - if (e && t) { - const n = t.length; - for (let a = 0; a < n; a++) - if (t[a].sessionId == e) - return t[a]; - return null - } - return null - } - function v() { - g.removeEventListener(o.keyerror, E), - g.removeEventListener(o.needkey, E), - g.removeEventListener(o.keymessage, E), - g.removeEventListener(o.keyadded, E) - } - return s = { - getAllInitData: function() { - const t = []; - for (let e = 0; e < p.length; e++) - t.push(p[e].initData); - for (let e = 0; e < b.length; e++) - t.push(b[e].initData); - return t - }, - getSessionTokens: function() { - return b.concat(p) - }, - requestKeySystemAccess: function(t) { - return new Promise(( (e, r) => { - let i = g; - i || (i = document.createElement("video")); - let o = !1; - for (let r = 0; r < t.length; r++) { - const l = t[r].ks.systemString - , s = t[r].configs; - let c = null - , d = null; - for (let t = 0; t < s.length; t++) { - const r = s[t].videoCapabilities; - if (r && 0 !== r.length) { - d = []; - for (let t = 0; t < r.length; t++) - "" !== i.canPlayType(r[t].contentType, l) && d.push(r[t]) - } - if (!c && !d || c && 0 === c.length || d && 0 === d.length) - continue; - o = !0; - const f = new u(c,d) - , g = h.getKeySystemBySystemString(l) - , m = new nt(g,f); - n.trigger(a.KEY_SYSTEM_ACCESS_COMPLETE, { - data: m - }), - e({ - data: m - }); - break - } - } - if (!o) { - const t = "Key system access denied! -- No valid audio/video content configurations detected!"; - n.trigger(a.KEY_SYSTEM_ACCESS_COMPLETE, { - error: t - }), - r({ - error: t - }) - } - } - )) - }, - selectKeySystem: function(t) { - return m = t.keySystem, - Promise.resolve(m) - }, - setMediaElement: function(t) { - if (g !== t) { - if (g) { - v(); - for (var e = 0; e < b.length; e++) - A(b[e]); - b = [] - } - g = t, - g && (g.addEventListener(o.keyerror, E), - g.addEventListener(o.needkey, E), - g.addEventListener(o.keymessage, E), - g.addEventListener(o.keyadded, E), - n.trigger(a.VIDEO_ELEMENT_SELECTED)) - } - }, - createKeySession: function(t) { - if (!m) - throw new Error("Can not create sessions until you have selected a key system"); - if (y || 0 === b.length) { - const e = { - sessionId: null, - keyId: t.keyId, - normalizedKeyId: t && t.keyId && "string" == typeof t.keyId ? t.keyId.replace(/-/g, "").toLowerCase() : "", - initData: t.initData, - hasTriggeredKeyStatusMapUpdate: !1, - getKeyId: function() { - return this.keyId - }, - getSessionId: function() { - return this.sessionId - }, - getExpirationTime: function() { - return NaN - }, - getSessionType: function() { - return "temporary" - }, - getKeyStatuses: function() { - return { - size: 0, - has: () => !1, - get: () => {} - } - } - }; - return p.push(e), - g[o.generateKeyRequest](m.systemString, new Uint8Array(t.initData)), - e - } - throw new Error("Multiple sessions not allowed!") - }, - updateKeySession: function(t, e) { - const r = t.sessionId; - if (h.isClearKey(m)) - for (let t = 0; t < e.keyPairs.length; t++) - g[o.addKey](m.systemString, e.keyPairs[t].key, e.keyPairs[t].keyID, r); - else - g[o.addKey](m.systemString, new Uint8Array(e), new Uint8Array(t.initData), r); - n.trigger(a.KEY_SESSION_UPDATED) - }, - closeKeySession: A, - setServerCertificate: function() {}, - loadKeySession: function() {}, - removeKeySession: function() {}, - stop: _, - reset: _ - }, - f = i.getLogger(s), - g = null, - m = null, - p = [], - b = [], - h = Z(e).getInstance(), - E = { - handleEvent: function(t) { - let e = null; - switch (t.type) { - case o.needkey: - let i = ArrayBuffer.isView(t.initData) ? t.initData.buffer : t.initData; - n.trigger(a.NEED_KEY, { - key: new tt(i,r.A.INITIALIZATION_DATA_TYPE_CENC) - }); - break; - case o.keyerror: - if (e = T(b, t.sessionId), - e || (e = T(p, t.sessionId)), - e) { - let r = c.A.MEDIA_KEYERR_CODE - , i = ""; - switch (t.errorCode.code) { - case 1: - r = c.A.MEDIA_KEYERR_UNKNOWN_CODE, - i += "MEDIA_KEYERR_UNKNOWN - " + c.A.MEDIA_KEYERR_UNKNOWN_MESSAGE; - break; - case 2: - r = c.A.MEDIA_KEYERR_CLIENT_CODE, - i += "MEDIA_KEYERR_CLIENT - " + c.A.MEDIA_KEYERR_CLIENT_MESSAGE; - break; - case 3: - r = c.A.MEDIA_KEYERR_SERVICE_CODE, - i += "MEDIA_KEYERR_SERVICE - " + c.A.MEDIA_KEYERR_SERVICE_MESSAGE; - break; - case 4: - r = c.A.MEDIA_KEYERR_OUTPUT_CODE, - i += "MEDIA_KEYERR_OUTPUT - " + c.A.MEDIA_KEYERR_OUTPUT_MESSAGE; - break; - case 5: - r = c.A.MEDIA_KEYERR_HARDWARECHANGE_CODE, - i += "MEDIA_KEYERR_HARDWARECHANGE - " + c.A.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE; - break; - case 6: - r = c.A.MEDIA_KEYERR_DOMAIN_CODE, - i += "MEDIA_KEYERR_DOMAIN - " + c.A.MEDIA_KEYERR_DOMAIN_MESSAGE - } - i += " System Code = " + t.systemCode, - n.trigger(a.KEY_ERROR, { - error: new d.A(r,i,e) - }) - } else - f.error("No session token found for key error"); - break; - case o.keyadded: - e = T(b, t.sessionId), - e || (e = T(p, t.sessionId)), - e ? (f.debug("DRM: Key added."), - n.trigger(a.KEY_ADDED, { - data: e - })) : f.debug("No session token found for key added"); - break; - case o.keymessage: - if (y = null !== t.sessionId && void 0 !== t.sessionId, - y ? (e = T(b, t.sessionId), - !e && p.length > 0 && (e = p.shift(), - b.push(e), - e.sessionId = t.sessionId, - n.trigger(a.KEY_SESSION_CREATED, { - data: e - }))) : p.length > 0 && (e = p.shift(), - b.push(e), - 0 !== p.length && l.error(new d.A(c.A.MEDIA_KEY_MESSAGE_ERROR_CODE,c.A.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))), - e) { - let r = ArrayBuffer.isView(t.message) ? t.message.buffer : t.message; - e.keyMessage = r, - n.trigger(a.INTERNAL_KEY_MESSAGE, { - data: new et(e,r,t.defaultURL) - }) - } else - f.warn("No session token found for key message") - } - } - }, - s - } - st.__dashjs_factory_name = "ProtectionModel_01b"; - var ut = b.A.getClassFactory(st); - const ct = [{ - generateKeyRequest: "generateKeyRequest", - addKey: "addKey", - cancelKeyRequest: "cancelKeyRequest", - needkey: "needkey", - keyerror: "keyerror", - keyadded: "keyadded", - keymessage: "keymessage" - }, { - generateKeyRequest: "webkitGenerateKeyRequest", - addKey: "webkitAddKey", - cancelKeyRequest: "webkitCancelKeyRequest", - needkey: "webkitneedkey", - keyerror: "webkitkeyerror", - keyadded: "webkitkeyadded", - keymessage: "webkitkeymessage" - }] - , dt = [{ - setMediaKeys: "setMediaKeys", - MediaKeys: "MediaKeys", - release: "close", - needkey: "needkey", - error: "keyerror", - message: "keymessage", - ready: "keyadded", - close: "keyclose" - }, { - setMediaKeys: "msSetMediaKeys", - MediaKeys: "MSMediaKeys", - release: "close", - needkey: "msneedkey", - error: "mskeyerror", - message: "mskeymessage", - ready: "mskeyadded", - close: "mskeyclose" - }]; - function ft() { - let t; - const e = this.context; - function n(t, e) { - for (let n = 0; n < e.length; n++) { - const a = e[n]; - if ("function" == typeof t[a[Object.keys(a)[0]]]) - return a - } - return null - } - return t = { - createProtectionSystem: function(a) { - let r = null; - const i = Z(e).getInstance(); - i.setConfig({ - debug: a.debug, - BASE64: a.BASE64, - settings: a.settings - }), - i.initialize(); - let o = function(a) { - const r = a.debug - , i = r.getLogger(t) - , o = a.eventBus - , l = a.errHandler - , s = a.videoModel ? a.videoModel.getElement() : null; - return s && void 0 === s.onencrypted || s && void 0 === s.mediaKeys ? n(s, dt) ? (i.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"), - lt(e).create({ - debug: r, - eventBus: o, - events: a.events, - api: n(s, dt) - })) : n(s, ct) ? (i.info("EME detected on this user agent! (ProtectionModel_01b)"), - ut(e).create({ - debug: r, - eventBus: o, - errHandler: l, - events: a.events, - api: n(s, ct) - })) : (i.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"), - null) : (i.info("EME detected on this user agent! (DefaultProtectionModel"), - it(e).create({ - debug: r, - eventBus: o, - events: a.events - })) - }(a); - return o && (r = E(e).create({ - BASE64: a.BASE64, - cmcdModel: a.cmcdModel, - constants: a.constants, - customParametersModel: a.customParametersModel, - debug: a.debug, - eventBus: a.eventBus, - events: a.events, - protectionKeyController: i, - protectionModel: o, - settings: a.settings - }), - a.capabilities.setEncryptedMediaSupported(!0)), - r - } - }, - t - } - ft.__dashjs_factory_name = "Protection"; - const gt = dashjs.FactoryMaker.getClassFactory(ft); - gt.events = J.A, - gt.errors = c.A, - dashjs.FactoryMaker.updateClassFactory(ft.__dashjs_factory_name, gt); - var mt = gt - }, - 445: function(t, e, n) { - "use strict"; - var a = n(7252); - class r extends a.A { - constructor() { - super(), - this.INTERNAL_KEY_MESSAGE = "internalKeyMessage", - this.INTERNAL_KEY_STATUSES_CHANGED = "internalkeyStatusesChanged", - this.KEY_ADDED = "public_keyAdded", - this.KEY_ERROR = "public_keyError", - this.KEY_MESSAGE = "public_keyMessage", - this.KEY_SESSION_CLOSED = "public_keySessionClosed", - this.KEY_SESSION_CREATED = "public_keySessionCreated", - this.KEY_SESSION_REMOVED = "public_keySessionRemoved", - this.KEY_STATUSES_CHANGED = "public_keyStatusesChanged", - this.KEY_STATUSES_MAP_UPDATED = "keyStatusesMapUpdated", - this.KEY_SYSTEM_ACCESS_COMPLETE = "public_keySystemAccessComplete", - this.KEY_SYSTEM_SELECTED = "public_keySystemSelected", - this.LICENSE_REQUEST_COMPLETE = "public_licenseRequestComplete", - this.LICENSE_REQUEST_SENDING = "public_licenseRequestSending", - this.NEED_KEY = "needkey", - this.PROTECTION_CREATED = "public_protectioncreated", - this.PROTECTION_DESTROYED = "public_protectiondestroyed", - this.SERVER_CERTIFICATE_UPDATED = "serverCertificateUpdated", - this.TEARDOWN_COMPLETE = "protectionTeardownComplete", - this.VIDEO_ELEMENT_SELECTED = "videoElementSelected", - this.KEY_SESSION_UPDATED = "public_keySessionUpdated" - } - } - let i = new r; - e.A = i - }, - 1923: function(t, e, n) { - "use strict"; - var a = n(8748); - class r extends a.A { - constructor() { - super(), - this.MEDIA_KEYERR_CODE = 100, - this.MEDIA_KEYERR_UNKNOWN_CODE = 101, - this.MEDIA_KEYERR_CLIENT_CODE = 102, - this.MEDIA_KEYERR_SERVICE_CODE = 103, - this.MEDIA_KEYERR_OUTPUT_CODE = 104, - this.MEDIA_KEYERR_HARDWARECHANGE_CODE = 105, - this.MEDIA_KEYERR_DOMAIN_CODE = 106, - this.MEDIA_KEY_MESSAGE_ERROR_CODE = 107, - this.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE = 108, - this.SERVER_CERTIFICATE_UPDATED_ERROR_CODE = 109, - this.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE = 110, - this.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE = 111, - this.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE = 112, - this.KEY_SESSION_CREATED_ERROR_CODE = 113, - this.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE = 114, - this.MEDIA_KEYERR_UNKNOWN_MESSAGE = "An unspecified error occurred. This value is used for errors that don't match any of the other codes.", - this.MEDIA_KEYERR_CLIENT_MESSAGE = "The Key System could not be installed or updated.", - this.MEDIA_KEYERR_SERVICE_MESSAGE = "The message passed into update indicated an error from the license service.", - this.MEDIA_KEYERR_OUTPUT_MESSAGE = "There is no available output device with the required characteristics for the content protection system.", - this.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE = "A hardware configuration change caused a content protection error.", - this.MEDIA_KEYERR_DOMAIN_MESSAGE = "An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain.", - this.MEDIA_KEY_MESSAGE_ERROR_MESSAGE = "Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!", - this.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE = "DRM: Empty key message from CDM", - this.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE = "Error updating server certificate -- ", - this.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE = "DRM: KeyStatusChange error! -- License has expired", - this.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE = "DRM: No license server URL specified!", - this.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE = "DRM: KeySystem Access Denied! -- ", - this.KEY_SESSION_CREATED_ERROR_MESSAGE = "DRM: unable to create session! --", - this.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE = "DRM: licenser error! --" - } - } - let i = new r; - e.A = i - }, - 559: function(t, e, n) { - "use strict"; - n.d(e, { - a: function() { - return s - } - }); - var a = n(138) - , r = n(5212) - , i = n(2861) - , o = n(7393) - , l = n(649); - function s() { - let t = "ManagedMediaSource"in window - , e = "WebKitMediaSource"in window - , n = "MediaSource"in window; - return t || e || n - } - function u() { - let t, e, n, a, u, c; - const d = this.context - , f = (0, - o.A)(d).getInstance(); - function g(t, e) { - let n; - e === r.A.VIDEO ? n = function(t) { - const e = { - video: {} - }; - return t ? (t.width && (e.video.width = t.width), - t.height && (e.video.height = t.height), - t.framerate && (e.video.framerate = parseFloat(t.framerate)), - t.hdrMetadataType && (e.video.hdrMetadataType = t.hdrMetadataType), - t.colorGamut && (e.video.colorGamut = t.colorGamut), - t.transferFunction && (e.video.transferFunction = t.transferFunction), - e) : e - }(t) : e === r.A.AUDIO && (n = function(t) { - const e = { - audio: {} - }; - return t.samplerate && (e.audio.samplerate = t.samplerate), - e - }(t)), - n[e].contentType = t.codec, - n[e].bitrate = parseInt(t.bitrate), - n.type = "media-source"; - let a = t.codec; - return t.width && t.height && (a += ';width="' + t.width + '";height="' + t.height + '"'), - n.mediaSourceCodecString = a, - function(t, e, n) { - return e && e.keySystemsMetadata && 0 !== e.keySystemsMetadata.length ? e.keySystemsMetadata.map((e => { - const a = { - ...t - }; - if (e.ks) { - a.keySystemConfiguration = {}, - e.ks.systemString && (a.keySystemConfiguration.keySystem = e.ks.systemString); - let t = ""; - e.ks.systemString === i.A.WIDEVINE_KEYSTEM_STRING && (t = i.A.ROBUSTNESS_STRINGS.WIDEVINE.SW_SECURE_CRYPTO); - const o = e.protData - , l = o && o.audioRobustness && o.audioRobustness.length > 0 ? o.audioRobustness : t - , s = o && o.videoRobustness && o.videoRobustness.length > 0 ? o.videoRobustness : t; - n === r.A.AUDIO ? a.keySystemConfiguration[n] = { - robustness: l - } : n === r.A.VIDEO && (a.keySystemConfiguration[n] = { - robustness: s - }) - } - return a - } - )) : [t] - }(n, t, e) - } - function m(t) { - if (a && 0 !== a.length && t) - return a.find((e => { - const n = h(t, e, r.A.AUDIO) - , a = h(t, e, r.A.VIDEO) - , i = h(t, e, "keySystemConfiguration"); - return n && a && i - } - )) - } - function h(t, e, n) { - return !t[n] && !e[n] || !(!t[n] || !e[n]) && f.areEqual(t[n], e[n]) - } - function p(t, e) { - return (t = t.filter((t => !(t.schemeIdUri && e.some((e => e.schemeIdUri === t.schemeIdUri)))))).push(...e), - t - } - return t = { - areKeyIdsExpired: function(t) { - return !!(n && t && t.normalizedKeyIds && 0 !== t.normalizedKeyIds.size) && n.areKeyIdsExpired(t.normalizedKeyIds) - }, - areKeyIdsUsable: function(t) { - return !(n && t && t.normalizedKeyIds && 0 !== t.normalizedKeyIds.size) || n.areKeyIdsUsable(t.normalizedKeyIds) - }, - isCodecSupportedBasedOnTestedConfigurations: function(t, e) { - if (!t || !t.codec || !1 === t.isSupported) - return !1; - const n = g(t, e).map((t => m(t))).filter((t => null != t)); - return !(n && n.length > 0) || function(t) { - return t.some((t => t && t.decodingInfo && t.decodingInfo.supported)) - }(n) - }, - isProtectionCompatible: function(t, e) { - return !e || !(!t.isEncrypted && e.isEncrypted) - }, - runCodecSupportCheck: function(t, n) { - if (n !== r.A.AUDIO && n !== r.A.VIDEO) - return Promise.resolve(); - const i = g(t, n); - return function(t, n) { - return e.get().streaming.capabilities.useMediaCapabilitiesApi && navigator.mediaCapabilities && navigator.mediaCapabilities.decodingInfo && (t.codec && n === r.A.AUDIO || n === r.A.VIDEO && t.codec && t.width && t.height && t.bitrate && t.framerate) - }(t, n) ? function(t) { - return new Promise((e => { - if (!t || 0 === t.length) - return void e(); - const n = t.map((t => function(t) { - return new Promise((e => { - m(t) ? e() : navigator.mediaCapabilities.decodingInfo(t).then((n => { - t.decodingInfo = n, - a.push(t), - e() - } - )).catch((n => { - t.decodingInfo = { - supported: !1 - }, - a.push(t), - c.error(n), - e() - } - )) - } - )) - }(t))); - Promise.allSettled(n).then(( () => { - e() - } - )).catch((t => { - c.error(t), - e() - } - )) - } - )) - }(i) : (function(t) { - if (!t || !t.length) - return; - const e = t[0]; - if (m(e)) - return; - let n = { - supported: !1 - }; - ("ManagedMediaSource"in window && ManagedMediaSource.isTypeSupported(e.mediaSourceCodecString) || "MediaSource"in window && MediaSource.isTypeSupported(e.mediaSourceCodecString) || "WebKitMediaSource"in window && WebKitMediaSource.isTypeSupported(e.mediaSourceCodecString)) && (n.supported = !0), - e.decodingInfo = n, - a.push(e) - }(i), - Promise.resolve()) - }, - setConfig: function(t) { - t && (t.settings && (e = t.settings), - t.protectionController && (n = t.protectionController)) - }, - setEncryptedMediaSupported: function(t) { - u = t - }, - setProtectionController: function(t) { - n = t - }, - supportsChangeType: function() { - return !!window.SourceBuffer && !!SourceBuffer.prototype && !!SourceBuffer.prototype.changeType - }, - supportsEncryptedMedia: function() { - return u - }, - supportsEssentialProperty: function(t) { - let n = e.get().streaming.capabilities.supportedEssentialProperties; - e.get().streaming.capabilities.useMediaCapabilitiesApi && e.get().streaming.capabilities.filterVideoColorimetryEssentialProperties && (n = p(n, [{ - schemeIdUri: r.A.COLOUR_PRIMARIES_SCHEME_ID_URI - }, { - schemeIdUri: r.A.MATRIX_COEFFICIENTS_SCHEME_ID_URI - }, { - schemeIdUri: r.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI - }])), - e.get().streaming.capabilities.useMediaCapabilitiesApi && e.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties && (n = p(n, [{ - schemeIdUri: r.A.HDR_METADATA_FORMAT_SCHEME_ID_URI - }])); - try { - return t.inArray(n) - } catch (t) { - return !0 - } - }, - supportsMediaSource: s - }, - u = !1, - a = [], - c = (0, - l.A)(d).getInstance().getLogger(t), - t - } - u.__dashjs_factory_name = "Capabilities", - e.A = a.A.getSingletonFactory(u) - }, - 7377: function(t, e, n) { - "use strict"; - var a = n(138) - , r = n(656); - function i() { - return { - customTimeRangeArray: [], - length: 0, - add: function(t, e) { - let n; - for (n = 0; n < this.customTimeRangeArray.length && t > this.customTimeRangeArray[n].start; n++) - ; - for (this.customTimeRangeArray.splice(n, 0, { - start: t, - end: e - }), - n = 0; n < this.customTimeRangeArray.length - 1; n++) - this.mergeRanges(n, n + 1) && n--; - this.length = this.customTimeRangeArray.length - }, - clear: function() { - this.customTimeRangeArray = [], - this.length = 0 - }, - remove: function(t, e) { - for (let n = 0; n < this.customTimeRangeArray.length; n++) - if (t <= this.customTimeRangeArray[n].start && e >= this.customTimeRangeArray[n].end) - this.customTimeRangeArray.splice(n, 1), - n--; - else { - if (t > this.customTimeRangeArray[n].start && e < this.customTimeRangeArray[n].end) { - this.customTimeRangeArray.splice(n + 1, 0, { - start: e, - end: this.customTimeRangeArray[n].end - }), - this.customTimeRangeArray[n].end = t; - break - } - t > this.customTimeRangeArray[n].start && t < this.customTimeRangeArray[n].end ? this.customTimeRangeArray[n].end = t : e > this.customTimeRangeArray[n].start && e < this.customTimeRangeArray[n].end && (this.customTimeRangeArray[n].start = e) - } - this.length = this.customTimeRangeArray.length - }, - mergeRanges: function(t, e) { - let n = this.customTimeRangeArray[t] - , a = this.customTimeRangeArray[e]; - return n.start <= a.start && a.start <= n.end && n.end <= a.end ? (n.end = a.end, - this.customTimeRangeArray.splice(e, 1), - !0) : a.start <= n.start && n.start <= a.end && a.end <= n.end ? (n.start = a.start, - this.customTimeRangeArray.splice(e, 1), - !0) : a.start <= n.start && n.start <= a.end && n.end <= a.end ? (this.customTimeRangeArray.splice(t, 1), - !0) : n.start <= a.start && a.start <= n.end && a.end <= n.end && (this.customTimeRangeArray.splice(e, 1), - !0) - }, - start: function(t) { - return (0, - r.zQ)(t), - t >= this.customTimeRangeArray.length || t < 0 ? NaN : this.customTimeRangeArray[t].start - }, - end: function(t) { - return (0, - r.zQ)(t), - t >= this.customTimeRangeArray.length || t < 0 ? NaN : this.customTimeRangeArray[t].end - } - } - } - i.__dashjs_factory_name = "CustomTimeRanges", - e.A = a.A.getClassFactory(i) - }, - 7393: function(t, e, n) { - "use strict"; - var a = n(138) - , r = n(7316); - function i() { - let t; - return t = { - areEqual: function(t, e) { - return r(t, e) - } - }, - t - } - i.__dashjs_factory_name = "ObjectUtils", - e.A = a.A.getSingletonFactory(i) - }, - 656: function(t, e, n) { - "use strict"; - n.d(e, { - sq: function() { - return r - }, - zQ: function() { - return i - } - }); - var a = n(5212); - function r(t, e) { - if (typeof t !== e) - throw a.A.BAD_ARGUMENT_ERROR - } - function i(t) { - if (null === t || isNaN(t) || t % 1 != 0) - throw a.A.BAD_ARGUMENT_ERROR + " : argument is not an integer" - } - }, - 1944: function(t, e) { - "use strict"; - e.A = class { - constructor(t, e, n) { - this.code = t || null, - this.message = e || null, - this.data = n || null - } - } - }, - 7568: function(t, e, n) { - "use strict"; - n.d(e, { - G: function() { - return a - }, - N: function() { - return r - } - }); - class a { - constructor() { - this.tcpid = null, - this.type = null, - this.url = null, - this.actualurl = null, - this.range = null, - this.trequest = null, - this.tresponse = null, - this.responsecode = null, - this.interval = null, - this.trace = [], - this.cmsd = null, - this._stream = null, - this._tfinish = null, - this._mediaduration = null, - this._responseHeaders = null, - this._serviceLocation = null, - this._fileLoaderType = null, - this._resourceTimingValues = null - } - } - class r { - constructor() { - this.s = null, - this.d = null, - this.b = [] - } - } - a.GET = "GET", - a.HEAD = "HEAD", - a.MPD_TYPE = "MPD", - a.XLINK_EXPANSION_TYPE = "XLinkExpansion", - a.INIT_SEGMENT_TYPE = "InitializationSegment", - a.INDEX_SEGMENT_TYPE = "IndexSegment", - a.MEDIA_SEGMENT_TYPE = "MediaSegment", - a.BITSTREAM_SWITCHING_SEGMENT_TYPE = "BitstreamSwitchingSegment", - a.MSS_FRAGMENT_INFO_SEGMENT_TYPE = "FragmentInfoSegment", - a.DVB_REPORTING_TYPE = "DVBReporting", - a.LICENSE = "license", - a.CONTENT_STEERING_TYPE = "ContentSteering", - a.OTHER_TYPE = "other" - } - } - , e = {}; - function n(a) { - var r = e[a]; - if (void 0 !== r) - return r.exports; - var i = e[a] = { - exports: {} - }; - return t[a].call(i.exports, i, i.exports, n), - i.exports - } - n.amdO = {}, - n.d = function(t, e) { - for (var a in e) - n.o(e, a) && !n.o(t, a) && Object.defineProperty(t, a, { - enumerable: !0, - get: e[a] - }) - } - , - n.g = function() { - if ("object" == typeof globalThis) - return globalThis; - try { - return this || new Function("return this")() - } catch (t) { - if ("object" == typeof window) - return window - } - }(), - n.o = function(t, e) { - return Object.prototype.hasOwnProperty.call(t, e) - } - ; - var r = {}; - return function() { - "use strict"; - n.d(r, { - default: function() { - return d - } - }), - n(5393); - var t = n(4469) - , e = n(3888) - , a = n(255); - let i, o = function() { - const t = "application/dash+xml"; - let e; - function n(n, r, i) { - if (!n || !/^VIDEO$/i.test(n.nodeName)) - return null; - if (n._dashjs_player) - return n._dashjs_player; - let o, l = n.id || n.name || "video element"; - if (!(r = r || [].slice.call(n.querySelectorAll("source")).filter((function(e) { - return e.type == t - } - ))[0]) && n.src) - (r = document.createElement("source")).src = n.src; - else if (!r && !n.src) - return null; - return i = i || {}, - o = (0, - a.A)(i).create(), - o.initialize(n, r.src, n.autoplay), - e || (e = o.getDebug().getLogger()), - e.debug("Converted " + l + " to dash.js player and added content: " + r.src), - n._dashjs_player = o, - o - } - function r(t) { - return /^VIDEO$/i.test(t.nodeName) ? t : r(t.parentNode) - } - return { - create: n, - createAll: function(e, a) { - let i = []; - e = e || "[data-dashjs-player]"; - let o = (a = a || document).querySelectorAll(e); - for (let t = 0; t < o.length; t++) { - let e = n(o[t], null); - i.push(e) - } - let l = a.querySelectorAll('source[type="' + t + '"]'); - for (let t = 0; t < l.length; t++) { - let e = n(r(l[t]), null); - i.push(e) - } - return i - } - } - }(); - !("undefined" != typeof window && window && window.dashjs && window.dashjs.skipAutoCreate) && "undefined" != typeof window && window && window.addEventListener && ("complete" === window.document.readyState ? window.dashjs ? o.createAll() : i = window.setInterval((function() { - window.dashjs && (window.clearInterval(i), - o.createAll()) - } - ), 500) : window.addEventListener("load", (function t() { - window.removeEventListener("load", t), - o.createAll() - } - ))); - var l = o - , s = n(649) - , u = n(5212) - , c = n(559); - dashjs.Protection = e.default, - dashjs.MetricsReporting = t.default, - dashjs.MediaPlayerFactory = l, - dashjs.Debug = s.A, - dashjs.supportsMediaSource = c.a, - dashjs.Constants = u.A; - var d = dashjs - }(), - r.default - }() -} -)); -//# sourceMappingURL=dash.all.min.js.map - +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.dashjs=e():t.dashjs=e()}(self,(function(){return function(){var t={7267:function(t,e){"use strict";e.byteLength=function(t){var e=l(t),n=e[0],a=e[1];return 3*(n+a)/4-a},e.toByteArray=function(t){var e,n,i=l(t),o=i[0],s=i[1],u=new r(function(t,e,n){return 3*(e+n)/4-n}(0,o,s)),c=0,d=s>0?o-4:o;for(n=0;n>16&255,u[c++]=e>>8&255,u[c++]=255&e;return 2===s&&(e=a[t.charCodeAt(n)]<<2|a[t.charCodeAt(n+1)]>>4,u[c++]=255&e),1===s&&(e=a[t.charCodeAt(n)]<<10|a[t.charCodeAt(n+1)]<<4|a[t.charCodeAt(n+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e),u},e.fromByteArray=function(t){for(var e,a=t.length,r=a%3,i=[],o=16383,l=0,u=a-r;lu?u:l+o));return 1===r?(e=t[a-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===r&&(e=(t[a-2]<<8)+t[a-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),i.join("")};for(var n=[],a=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)n[o]=i[o],a[i.charCodeAt(o)]=o;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function s(t,e,a){for(var r,i,o=[],l=e;l>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},44:function(t,e,n){"use strict";var a=n(7267),r=n(7986),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},e.INSPECT_MAX_BYTES=50;var o=2147483647;function l(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return d(t)}return u(t,e,n)}function u(t,e,n){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=0|h(t,e),a=l(n),r=a.write(t,e);return r!==n&&(a=a.slice(0,r)),a}(t,e);if(ArrayBuffer.isView(t))return function(t){if(B(t,Uint8Array)){var e=new Uint8Array(t);return g(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(B(t,ArrayBuffer)||t&&B(t.buffer,ArrayBuffer))return g(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(B(t,SharedArrayBuffer)||t&&B(t.buffer,SharedArrayBuffer)))return g(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var a=t.valueOf&&t.valueOf();if(null!=a&&a!==t)return s.from(a,e,n);var r=function(t){if(s.isBuffer(t)){var e=0|m(t.length),n=l(e);return 0===n.length||t.copy(n,0,0,e),n}return void 0!==t.length?"number"!=typeof t.length||q(t.length)?l(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function d(t){return c(t),l(t<0?0:0|m(t))}function f(t){for(var e=t.length<0?0:0|m(t.length),n=l(e),a=0;a=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function h(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(t).length;default:if(r)return a?-1:F(t).length;e=(""+e).toLowerCase(),r=!0}}function p(t,e,n){var a=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,n);case"utf8":case"utf-8":return I(this,e,n);case"ascii":return R(this,e,n);case"latin1":case"binary":return N(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,e,n);default:if(a)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),a=!0}}function b(t,e,n){var a=t[e];t[e]=t[n],t[n]=a}function y(t,e,n,a,r){if(0===t.length)return-1;if("string"==typeof n?(a=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),q(n=+n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=s.from(e,a)),s.isBuffer(e))return 0===e.length?-1:E(t,e,n,a,r);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):E(t,[e],n,a,r);throw new TypeError("val must be string, number or Buffer")}function E(t,e,n,a,r){var i,o=1,l=t.length,s=e.length;if(void 0!==a&&("ucs2"===(a=String(a).toLowerCase())||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(t.length<2||e.length<2)return-1;o=2,l/=2,s/=2,n/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(r){var c=-1;for(i=n;il&&(n=l-s),i=n;i>=0;i--){for(var d=!0,f=0;fr&&(a=r):a=r;var i=e.length;a>i/2&&(a=i/2);for(var o=0;o>8,r=n%256,i.push(r),i.push(a);return i}(e,t.length-n),t,n,a)}function S(t,e,n){return 0===e&&n===t.length?a.fromByteArray(t):a.fromByteArray(t.slice(e,n))}function I(t,e,n){n=Math.min(t.length,n);for(var a=[],r=e;r239?4:u>223?3:u>191?2:1;if(r+d<=n)switch(d){case 1:u<128&&(c=u);break;case 2:128==(192&(i=t[r+1]))&&(s=(31&u)<<6|63&i)>127&&(c=s);break;case 3:i=t[r+1],o=t[r+2],128==(192&i)&&128==(192&o)&&(s=(15&u)<<12|(63&i)<<6|63&o)>2047&&(s<55296||s>57343)&&(c=s);break;case 4:i=t[r+1],o=t[r+2],l=t[r+3],128==(192&i)&&128==(192&o)&&128==(192&l)&&(s=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&l)>65535&&s<1114112&&(c=s)}null===c?(c=65533,d=1):c>65535&&(c-=65536,a.push(c>>>10&1023|55296),c=56320|1023&c),a.push(c),r+=d}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);for(var n="",a=0;aa.length?s.from(i).copy(a,r):Uint8Array.prototype.set.call(a,i,r);else{if(!s.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(a,r)}r+=i.length}return a},s.byteLength=h,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;en&&(t+=" ... "),""},i&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(t,e,n,a,r){if(B(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===a&&(a=0),void 0===r&&(r=this.length),e<0||n>t.length||a<0||r>this.length)throw new RangeError("out of range index");if(a>=r&&e>=n)return 0;if(a>=r)return-1;if(e>=n)return 1;if(this===t)return 0;for(var i=(r>>>=0)-(a>>>=0),o=(n>>>=0)-(e>>>=0),l=Math.min(i,o),u=this.slice(a,r),c=t.slice(e,n),d=0;d>>=0,isFinite(n)?(n>>>=0,void 0===a&&(a="utf8")):(a=n,n=void 0)}var r=this.length-e;if((void 0===n||n>r)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var i=!1;;)switch(a){case"hex":return _(this,t,e,n);case"utf8":case"utf-8":return A(this,t,e,n);case"ascii":case"latin1":case"binary":return T(this,t,e,n);case"base64":return v(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function R(t,e,n){var a="";n=Math.min(t.length,n);for(var r=e;ra)&&(n=a);for(var r="",i=e;in)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,n,a,r,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||et.length)throw new RangeError("Index out of range")}function z(t,e,n,a,r,i){if(n+a>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function O(t,e,n,a,i){return e=+e,n>>>=0,i||z(t,0,n,4),r.write(t,e,n,a,23,4),n+4}function L(t,e,n,a,i){return e=+e,n>>>=0,i||z(t,0,n,8),r.write(t,e,n,a,52,8),n+8}s.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e>>=0,e>>>=0,n||x(t,e,this.length);for(var a=this[t],r=1,i=0;++i>>=0,e>>>=0,n||x(t,e,this.length);for(var a=this[t+--e],r=1;e>0&&(r*=256);)a+=this[t+--e]*r;return a},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||x(t,e,this.length);for(var a=this[t],r=1,i=0;++i=(r*=128)&&(a-=Math.pow(2,8*e)),a},s.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||x(t,e,this.length);for(var a=e,r=1,i=this[t+--a];a>0&&(r*=256);)i+=this[t+--a]*r;return i>=(r*=128)&&(i-=Math.pow(2,8*e)),i},s.prototype.readInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||x(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(t,e){t>>>=0,e||x(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||x(t,4,this.length),r.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),r.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),r.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(t,8,this.length),r.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,n,a){t=+t,e>>>=0,n>>>=0,a||M(this,t,e,n,Math.pow(2,8*n)-1,0);var r=1,i=0;for(this[e]=255&t;++i>>=0,n>>>=0,a||M(this,t,e,n,Math.pow(2,8*n)-1,0);var r=n-1,i=1;for(this[e+r]=255&t;--r>=0&&(i*=256);)this[e+r]=t/i&255;return e+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,n,a){if(t=+t,e>>>=0,!a){var r=Math.pow(2,8*n-1);M(this,t,e,n,r-1,-r)}var i=0,o=1,l=0;for(this[e]=255&t;++i>>=0,!a){var r=Math.pow(2,8*n-1);M(this,t,e,n,r-1,-r)}var i=n-1,o=1,l=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===l&&0!==this[e+i+1]&&(l=1),this[e+i]=(t/o|0)-l&255;return e+n},s.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,n){return O(this,t,e,!0,n)},s.prototype.writeFloatBE=function(t,e,n){return O(this,t,e,!1,n)},s.prototype.writeDoubleLE=function(t,e,n){return L(this,t,e,!0,n)},s.prototype.writeDoubleBE=function(t,e,n){return L(this,t,e,!1,n)},s.prototype.copy=function(t,e,n,a){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),a||0===a||(a=this.length),e>=t.length&&(e=t.length),e||(e=0),a>0&&a=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),t.length-e>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(o+1===a){(e-=3)>-1&&i.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(e-=3)>-1&&i.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function U(t){return a.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function j(t,e,n,a){for(var r=0;r=e.length||r>=t.length);++r)e[r+n]=t[r];return r}function B(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function q(t){return t!=t}var G=function(){for(var t="0123456789abcdef",e=new Array(256),n=0;n<16;++n)for(var a=16*n,r=0;r<16;++r)e[a+r]=t[n]+t[r];return e}()},6877:function(t,e){var n={parseBuffer:function(t){return new a(t).parse()},addBoxProcessor:function(t,e){"string"==typeof t&&"function"==typeof e&&(r.prototype._boxProcessors[t]=e)},createFile:function(){return new a},createBox:function(t,e,n){var a=r.create(t);return e&&e.append(a,n),a},createFullBox:function(t,e,a){var r=n.createBox(t,e,a);return r.version=0,r.flags=0,r},Utils:{}};n.Utils.dataViewToString=function(t,e){var n=e||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(n).decode(t);var a=[],r=0;if("utf-8"===n)for(;r>6),e.push(128|63&a)):a<65536?(e.push(224|a>>12),e.push(128|63&a>>6),e.push(128|63&a)):(e.push(240|a>>18),e.push(128|63&a>>12),e.push(128|63&a>>6),e.push(128|63&a))}return e},n.Utils.appendBox=function(t,e,n){if(e._offset=t._cursor.offset,e._root=t._root?t._root:t,e._raw=t._raw,e._parent=t,-1!==n)if(null!=n){var a,r=-1;if("number"==typeof n)r=n;else{if("string"==typeof n)a=n;else{if("object"!=typeof n||!n.type)return void t.boxes.push(e);a=n.type}for(var i=0;i>3,e},r.prototype._readUint=function(t){var e,n,a=null,r=this._cursor.offset-this._raw.byteOffset;switch(t){case 8:a=this._raw.getUint8(r);break;case 16:a=this._raw.getUint16(r);break;case 24:a=((e=this._raw.getUint16(r))<<8)+(n=this._raw.getUint8(r+2));break;case 32:a=this._raw.getUint32(r);break;case 64:e=this._raw.getUint32(r),n=this._raw.getUint32(r+4),a=e*Math.pow(2,32)+n}return this._cursor.offset+=t>>3,a},r.prototype._readString=function(t){for(var e="",n=0;n0?t:this._raw.byteLength-(this._cursor.offset-this._offset);if(e>0){var n=new Uint8Array(this._raw.buffer,this._cursor.offset,e);return this._cursor.offset+=e,n}return null},r.prototype._readUTF8String=function(){var t=this._raw.byteLength-(this._cursor.offset-this._offset),e=null;return t>0&&(e=new DataView(this._raw.buffer,this._cursor.offset,t),this._cursor.offset+=t),e?n.Utils.dataViewToString(e):e},r.prototype._readUTF8TerminatedString=function(){var t=this._raw.byteLength-(this._cursor.offset-this._offset),e=null;if(t>0){var a;for(e=new DataView(this._raw.buffer,this._cursor.offset,t),a=0;athis._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():this._data=this._readData())}},r.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},r.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset>3}else this.size+=t>>3},r.prototype._writeUint=function(t,e){if(this._rawo){var n,a,r=this._cursor.offset-this._rawo.byteOffset;switch(t){case 8:this._rawo.setUint8(r,e);break;case 16:this._rawo.setUint16(r,e);break;case 24:n=(16776960&e)>>8,a=255&e,this._rawo.setUint16(r,n),this._rawo.setUint8(r+2,a);break;case 32:this._rawo.setUint32(r,e);break;case 64:a=e-(n=Math.floor(e/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(r,n),this._rawo.setUint32(r+4,a)}this._cursor.offset+=t>>3}else this.size+=t>>3},r.prototype._writeString=function(t,e){for(var n=0;n>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},r.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},r.prototype._boxProcessors.meta=function(){this._procFullBox()},r.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},r.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},r.prototype._boxProcessors.mp4a=r.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},r.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},r.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},r.prototype._boxProcessors.prft=function(){this._procFullBox(),this._procField("reference_track_ID","uint",32),this._procField("ntp_timestamp_sec","uint",32),this._procField("ntp_timestamp_frac","uint",32),this._procField("media_time","uint",1==this.version?64:32)},r.prototype._boxProcessors.prsl=function(){this._procFullBox(),this._procField("group_id","uint",32),this._procField("num_entities_in_group","uint",32),this._procEntries("entities",this.num_entities_in_group,(function(t){this._procEntryField(t,"entity_id","uint",32)})),4096&this.flags&&this._procField("preselection_tag","utf8string"),8192&this.flags&&this._procField("selection_priority","uint",8),16384&this.flags&&this._procField("interleaving_tag","utf8string")},r.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},r.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},r.prototype._boxProcessors.sdtp=function(){this._procFullBox();var t=-1;this._parsing&&(t=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",t,"uint",8)},r.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",1==this.version?64:32),this._procField("first_offset","uint",1==this.version?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,(function(t){this._parsing||(t.reference=(1&t.reference_type)<<31,t.reference|=2147483647&t.referenced_size,t.sap=(1&t.starts_with_SAP)<<31,t.sap|=(3&t.SAP_type)<<28,t.sap|=268435455&t.SAP_delta_time),this._procEntryField(t,"reference","uint",32),this._procEntryField(t,"subsegment_duration","uint",32),this._procEntryField(t,"sap","uint",32),this._parsing&&(t.reference_type=t.reference>>31&1,t.referenced_size=2147483647&t.reference,t.starts_with_SAP=t.sap>>31&1,t.SAP_type=t.sap>>28&7,t.SAP_delta_time=268435455&t.sap)}))},r.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},r.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,(function(t){this._procEntryField(t,"ranges_count","uint",32),this._procSubEntries(t,"ranges",t.ranges_count,(function(t){this._procEntryField(t,"level","uint",8),this._procEntryField(t,"range_size","uint",24)}))}))},r.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},r.prototype._boxProcessors.sttg=function(){this._procField("settings","utf8")},r.prototype._boxProcessors.stts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(t){this._procEntryField(t,"sample_count","uint",32),this._procEntryField(t,"sample_delta","uint",32)}))},r.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(t){this._procEntryField(t,"sample_delta","uint",32),this._procEntryField(t,"subsample_count","uint",16),this._procSubEntries(t,"subsamples",t.subsample_count,(function(t){this._procEntryField(t,"subsample_size","uint",1===this.version?32:16),this._procEntryField(t,"subsample_priority","uint",8),this._procEntryField(t,"discardable","uint",8),this._procEntryField(t,"codec_specific_parameters","uint",32)}))}))},r.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},r.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},r.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},r.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,(function(t){this._procEntryField(t,"time","uint",1===this.version?64:32),this._procEntryField(t,"moof_offset","uint",1===this.version?64:32),this._procEntryField(t,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(t,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(t,"sample_number","uint",8*(this.length_size_of_sample_num+1))}))},r.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},r.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},r.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,(function(t){256&this.flags&&this._procEntryField(t,"sample_duration","uint",32),512&this.flags&&this._procEntryField(t,"sample_size","uint",32),1024&this.flags&&this._procEntryField(t,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(t,"sample_composition_time_offset",1===this.version?"int":"uint",32)}))},r.prototype._boxProcessors["url "]=r.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},r.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},r.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},r.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},r.prototype._boxProcessors.vtte=function(){}},9826:function(t){"use strict";var e,n="object"==typeof Reflect?Reflect:null,a=n&&"function"==typeof n.apply?n.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};e=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var r=Number.isNaN||function(t){return t!=t};function i(){i.init.call(this)}t.exports=i,t.exports.once=function(t,e){return new Promise((function(n,a){function r(n){t.removeListener(e,i),a(n)}function i(){"function"==typeof t.removeListener&&t.removeListener("error",r),n([].slice.call(arguments))}h(t,e,i,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&h(t,"error",e,{once:!0})}(t,r)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var o=10;function l(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function s(t){return void 0===t._maxListeners?i.defaultMaxListeners:t._maxListeners}function u(t,e,n,a){var r,i,o,u;if(l(n),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),i=t._events),o=i[e]),void 0===o)o=i[e]=n,++t._eventsCount;else if("function"==typeof o?o=i[e]=a?[n,o]:[o,n]:a?o.unshift(n):o.push(n),(r=s(t))>0&&o.length>r&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=o.length,u=c,console&&console.warn&&console.warn(u)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,n){var a={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=c.bind(a);return r.listener=n,a.wrapFn=r,r}function f(t,e,n){var a=t._events;if(void 0===a)return[];var r=a[e];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(o=e[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var s=i[t];if(void 0===s)return!1;if("function"==typeof s)a(s,this,e);else{var u=s.length,c=m(s,u);for(n=0;n=0;i--)if(n[i]===e||n[i].listener===e){o=n[i].listener,r=i;break}if(r<0)return this;0===r?n.shift():function(t,e){for(;e+1=0;a--)this.removeListener(t,e[a]);return this},i.prototype.listeners=function(t){return f(this,t,!0)},i.prototype.rawListeners=function(t){return f(this,t,!1)},i.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},i.prototype.listenerCount=g,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},7316:function(t){"use strict";t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var a,r,i;if(Array.isArray(e)){if((a=e.length)!=n.length)return!1;for(r=a;0!=r--;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((a=(i=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(r=a;0!=r--;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=a;0!=r--;){var o=i[r];if(!t(e[o],n[o]))return!1}return!0}return e!=e&&n!=n}},7986:function(t,e){e.read=function(t,e,n,a,r){var i,o,l=8*r-a-1,s=(1<>1,c=-7,d=n?r-1:0,f=n?-1:1,g=t[e+d];for(d+=f,i=g&(1<<-c)-1,g>>=-c,c+=l;c>0;i=256*i+t[e+d],d+=f,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=a;c>0;o=256*o+t[e+d],d+=f,c-=8);if(0===i)i=1-u;else{if(i===s)return o?NaN:1/0*(g?-1:1);o+=Math.pow(2,a),i-=u}return(g?-1:1)*o*Math.pow(2,i-a)},e.write=function(t,e,n,a,r,i){var o,l,s,u=8*i-r-1,c=(1<>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,g=a?0:i-1,m=a?1:-1,h=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-o))<1&&(o--,s*=2),(e+=o+d>=1?f/s:f*Math.pow(2,1-d))*s>=2&&(o++,s/=2),o+d>=c?(l=0,o=c):o+d>=1?(l=(e*s-1)*Math.pow(2,r),o+=d):(l=e*Math.pow(2,d-1)*Math.pow(2,r),o=0));r>=8;t[n+g]=255&l,g+=m,l/=256,r-=8);for(o=o<0;t[n+g]=255&o,g+=m,o/=256,u-=8);t[n+g-m]|=128*h}},5474:function(t,e,n){!function(t){t.parser=function(t,e){return new r(t,e)},t.SAXParser=r,t.SAXStream=o,t.createStream=function(t,e){return new o(t,e)},t.MAX_BUFFER_LENGTH=65536;var e,a=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function r(e,n){if(!(this instanceof r))return new r(e,n);var i=this;!function(t){for(var e=0,n=a.length;e"===i?(C(n,"onsgmldeclaration",n.sgmlDecl),n.sgmlDecl="",n.state=k.TEXT):T(c,i)?(n.state=k.SGML_DECL_QUOTED,n.sgmlDecl+=i):n.sgmlDecl+=i;continue;case k.SGML_DECL_QUOTED:i===n.q&&(n.state=k.SGML_DECL,n.q=""),n.sgmlDecl+=i;continue;case k.DOCTYPE:">"===i?(n.state=k.TEXT,C(n,"ondoctype",n.doctype),n.doctype=!0):(n.doctype+=i,"["===i?n.state=k.DOCTYPE_DTD:T(c,i)&&(n.state=k.DOCTYPE_QUOTED,n.q=i));continue;case k.DOCTYPE_QUOTED:n.doctype+=i,i===n.q&&(n.q="",n.state=k.DOCTYPE);continue;case k.DOCTYPE_DTD:n.doctype+=i,"]"===i?n.state=k.DOCTYPE:T(c,i)&&(n.state=k.DOCTYPE_DTD_QUOTED,n.q=i);continue;case k.DOCTYPE_DTD_QUOTED:n.doctype+=i,i===n.q&&(n.state=k.DOCTYPE_DTD,n.q="");continue;case k.COMMENT:"-"===i?n.state=k.COMMENT_ENDING:n.comment+=i;continue;case k.COMMENT_ENDING:"-"===i?(n.state=k.COMMENT_ENDED,n.comment=x(n.opt,n.comment),n.comment&&C(n,"oncomment",n.comment),n.comment=""):(n.comment+="-"+i,n.state=k.COMMENT);continue;case k.COMMENT_ENDED:">"!==i?(O(n,"Malformed comment"),n.comment+="--"+i,n.state=k.COMMENT):n.state=k.TEXT;continue;case k.CDATA:"]"===i?n.state=k.CDATA_ENDING:n.cdata+=i;continue;case k.CDATA_ENDING:"]"===i?n.state=k.CDATA_ENDING_2:(n.cdata+="]"+i,n.state=k.CDATA);continue;case k.CDATA_ENDING_2:">"===i?(n.cdata&&C(n,"oncdata",n.cdata),C(n,"onclosecdata"),n.cdata="",n.state=k.TEXT):"]"===i?n.cdata+="]":(n.cdata+="]]"+i,n.state=k.CDATA);continue;case k.PROC_INST:"?"===i?n.state=k.PROC_INST_ENDING:T(l,i)?n.state=k.PROC_INST_BODY:n.procInstName+=i;continue;case k.PROC_INST_BODY:if(!n.procInstBody&&T(l,i))continue;"?"===i?n.state=k.PROC_INST_ENDING:n.procInstBody+=i;continue;case k.PROC_INST_ENDING:">"===i?(C(n,"onprocessinginstruction",{name:n.procInstName,body:n.procInstBody}),n.procInstName=n.procInstBody="",n.state=k.TEXT):(n.procInstBody+="?"+i,n.state=k.PROC_INST_BODY);continue;case k.OPEN_TAG:T(y,i)?n.tagName+=i:(L(n),">"===i?U(n):"/"===i?n.state=k.OPEN_TAG_SLASH:(v(l,i)&&O(n,"Invalid character in tag name"),n.state=k.ATTRIB));continue;case k.OPEN_TAG_SLASH:">"===i?(U(n,!0),j(n)):(O(n,"Forward-slash in opening tag not followed by >"),n.state=k.ATTRIB);continue;case k.ATTRIB:if(T(l,i))continue;">"===i?U(n):"/"===i?n.state=k.OPEN_TAG_SLASH:T(b,i)?(n.attribName=i,n.attribValue="",n.state=k.ATTRIB_NAME):O(n,"Invalid attribute name");continue;case k.ATTRIB_NAME:"="===i?n.state=k.ATTRIB_VALUE:">"===i?(O(n,"Attribute without value"),n.attribValue=n.attribName,F(n),U(n)):T(l,i)?n.state=k.ATTRIB_NAME_SAW_WHITE:T(y,i)?n.attribName+=i:O(n,"Invalid attribute name");continue;case k.ATTRIB_NAME_SAW_WHITE:if("="===i)n.state=k.ATTRIB_VALUE;else{if(T(l,i))continue;O(n,"Attribute without value"),n.tag.attributes[n.attribName]="",n.attribValue="",C(n,"onattribute",{name:n.attribName,value:""}),n.attribName="",">"===i?U(n):T(b,i)?(n.attribName=i,n.state=k.ATTRIB_NAME):(O(n,"Invalid attribute name"),n.state=k.ATTRIB)}continue;case k.ATTRIB_VALUE:if(T(l,i))continue;T(c,i)?(n.q=i,n.state=k.ATTRIB_VALUE_QUOTED):(O(n,"Unquoted attribute value"),n.state=k.ATTRIB_VALUE_UNQUOTED,n.attribValue=i);continue;case k.ATTRIB_VALUE_QUOTED:if(i!==n.q){"&"===i?n.state=k.ATTRIB_VALUE_ENTITY_Q:n.attribValue+=i;continue}F(n),n.q="",n.state=k.ATTRIB_VALUE_CLOSED;continue;case k.ATTRIB_VALUE_CLOSED:T(l,i)?n.state=k.ATTRIB:">"===i?U(n):"/"===i?n.state=k.OPEN_TAG_SLASH:T(b,i)?(O(n,"No whitespace between attributes"),n.attribName=i,n.attribValue="",n.state=k.ATTRIB_NAME):O(n,"Invalid attribute name");continue;case k.ATTRIB_VALUE_UNQUOTED:if(v(d,i)){"&"===i?n.state=k.ATTRIB_VALUE_ENTITY_U:n.attribValue+=i;continue}F(n),">"===i?U(n):n.state=k.ATTRIB;continue;case k.CLOSE_TAG:if(n.tagName)">"===i?j(n):T(y,i)?n.tagName+=i:n.script?(n.script+=""===i?j(n):O(n,"Invalid characters in closing tag");continue;case k.TEXT_ENTITY:case k.ATTRIB_VALUE_ENTITY_Q:case k.ATTRIB_VALUE_ENTITY_U:var u,m;switch(n.state){case k.TEXT_ENTITY:u=k.TEXT,m="textNode";break;case k.ATTRIB_VALUE_ENTITY_Q:u=k.ATTRIB_VALUE_QUOTED,m="attribValue";break;case k.ATTRIB_VALUE_ENTITY_U:u=k.ATTRIB_VALUE_UNQUOTED,m="attribValue"}";"===i?(n[m]+=B(n),n.entity="",n.state=u):T(n.entity.length?_:E,i)?n.entity+=i:(O(n,"Invalid character in entity name"),n[m]+="&"+n.entity+i,n.entity="",n.state=u);continue;default:throw new Error(n,"Unknown state: "+n.state)}return n.position>=n.bufferCheckPosition&&function(e){for(var n=Math.max(t.MAX_BUFFER_LENGTH,10),r=0,i=0,o=a.length;in)switch(a[i]){case"textNode":D(e);break;case"cdata":C(e,"oncdata",e.cdata),e.cdata="";break;case"script":C(e,"onscript",e.script),e.script="";break;default:M(e,"Max buffer length exceeded: "+a[i])}r=Math.max(r,l)}var s=t.MAX_BUFFER_LENGTH-r;e.bufferCheckPosition=s+e.position}(n),n},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var t;D(t=this),""!==t.cdata&&(C(t,"oncdata",t.cdata),t.cdata=""),""!==t.script&&(C(t,"onscript",t.script),t.script="")}};try{e=n(3515).Stream}catch(t){e=function(){}}var i=t.EVENTS.filter((function(t){return"error"!==t&&"end"!==t}));function o(t,n){if(!(this instanceof o))return new o(t,n);e.apply(this),this._parser=new r(t,n),this.writable=!0,this.readable=!0;var a=this;this._parser.onend=function(){a.emit("end")},this._parser.onerror=function(t){a.emit("error",t),a._parser.error=null},this._decoder=null,i.forEach((function(t){Object.defineProperty(a,"on"+t,{get:function(){return a._parser["on"+t]},set:function(e){if(!e)return a.removeAllListeners(t),a._parser["on"+t]=e,e;a.on(t,e)},enumerable:!0,configurable:!1})}))}o.prototype=Object.create(e.prototype,{constructor:{value:o}}),o.prototype.write=function(t){if("function"==typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(t)){if(!this._decoder){var e=n(748).I;this._decoder=new e("utf8")}t=this._decoder.write(t)}return this._parser.write(t.toString()),this.emit("data",t),!0},o.prototype.end=function(t){return t&&t.length&&this.write(t),this._parser.end(),!0},o.prototype.on=function(t,n){var a=this;return a._parser["on"+t]||-1===i.indexOf(t)||(a._parser["on"+t]=function(){var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);e.splice(0,0,t),a.emit.apply(a,e)}),e.prototype.on.call(a,t,n)};var l="\r\n\t ",s="0124356789",u="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",c="'\"",d=l+">",f="[CDATA[",g="DOCTYPE",m="http://www.w3.org/XML/1998/namespace",h="http://www.w3.org/2000/xmlns/",p={xml:m,xmlns:h};l=A(l),s=A(s),u=A(u);var b=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,E=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,_=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;function A(t){return t.split("").reduce((function(t,e){return t[e]=!0,t}),{})}function T(t,e){return function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}(t)?!!e.match(t):t[e]}function v(t,e){return!T(t,e)}c=A(c),d=A(d);var w,S,I,k=0;for(var R in t.STATE={BEGIN:k++,BEGIN_WHITESPACE:k++,TEXT:k++,TEXT_ENTITY:k++,OPEN_WAKA:k++,SGML_DECL:k++,SGML_DECL_QUOTED:k++,DOCTYPE:k++,DOCTYPE_QUOTED:k++,DOCTYPE_DTD:k++,DOCTYPE_DTD_QUOTED:k++,COMMENT_STARTING:k++,COMMENT:k++,COMMENT_ENDING:k++,COMMENT_ENDED:k++,CDATA:k++,CDATA_ENDING:k++,CDATA_ENDING_2:k++,PROC_INST:k++,PROC_INST_BODY:k++,PROC_INST_ENDING:k++,OPEN_TAG:k++,OPEN_TAG_SLASH:k++,ATTRIB:k++,ATTRIB_NAME:k++,ATTRIB_NAME_SAW_WHITE:k++,ATTRIB_VALUE:k++,ATTRIB_VALUE_QUOTED:k++,ATTRIB_VALUE_CLOSED:k++,ATTRIB_VALUE_UNQUOTED:k++,ATTRIB_VALUE_ENTITY_Q:k++,ATTRIB_VALUE_ENTITY_U:k++,CLOSE_TAG:k++,CLOSE_TAG_SAW_WHITE:k++,SCRIPT:k++,SCRIPT_ENDING:k++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach((function(e){var n=t.ENTITIES[e],a="number"==typeof n?String.fromCharCode(n):n;t.ENTITIES[e]=a})),t.STATE)t.STATE[t.STATE[R]]=R;function N(t,e,n){t[e]&&t[e](n)}function C(t,e,n){t.textNode&&D(t),N(t,e,n)}function D(t){t.textNode=x(t.opt,t.textNode),t.textNode&&N(t,"ontext",t.textNode),t.textNode=""}function x(t,e){return t.trim&&(e=e.trim()),t.normalize&&(e=e.replace(/\s+/g," ")),e}function M(t,e){return D(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,N(t,"onerror",e),t}function z(t){return t.sawRoot&&!t.closedRoot&&O(t,"Unclosed root tag"),t.state!==k.BEGIN&&t.state!==k.BEGIN_WHITESPACE&&t.state!==k.TEXT&&M(t,"Unexpected end"),D(t),t.c="",t.closed=!0,N(t,"onend"),r.call(t,t.strict,t.opt),t}function O(t,e){if("object"!=typeof t||!(t instanceof r))throw new Error("bad call to strictFail");t.strict&&M(t,e)}function L(t){t.strict||(t.tagName=t.tagName[t.looseCase]());var e=t.tags[t.tags.length-1]||t,n=t.tag={name:t.tagName,attributes:{}};t.opt.xmlns&&(n.ns=e.ns),t.attribList.length=0,C(t,"onopentagstart",n)}function P(t,e){var n=t.indexOf(":")<0?["",t]:t.split(":"),a=n[0],r=n[1];return e&&"xmlns"===t&&(a="xmlns",r=""),{prefix:a,local:r}}function F(t){if(t.strict||(t.attribName=t.attribName[t.looseCase]()),-1!==t.attribList.indexOf(t.attribName)||t.tag.attributes.hasOwnProperty(t.attribName))t.attribName=t.attribValue="";else{if(t.opt.xmlns){var e=P(t.attribName,!0),n=e.prefix,a=e.local;if("xmlns"===n)if("xml"===a&&t.attribValue!==m)O(t,"xml: prefix must be bound to "+m+"\nActual: "+t.attribValue);else if("xmlns"===a&&t.attribValue!==h)O(t,"xmlns: prefix must be bound to "+h+"\nActual: "+t.attribValue);else{var r=t.tag,i=t.tags[t.tags.length-1]||t;r.ns===i.ns&&(r.ns=Object.create(i.ns)),r.ns[a]=t.attribValue}t.attribList.push([t.attribName,t.attribValue])}else t.tag.attributes[t.attribName]=t.attribValue,C(t,"onattribute",{name:t.attribName,value:t.attribValue});t.attribName=t.attribValue=""}}function U(t,e){if(t.opt.xmlns){var n=t.tag,a=P(t.tagName);n.prefix=a.prefix,n.local=a.local,n.uri=n.ns[a.prefix]||"",n.prefix&&!n.uri&&(O(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName)),n.uri=a.prefix);var r=t.tags[t.tags.length-1]||t;n.ns&&r.ns!==n.ns&&Object.keys(n.ns).forEach((function(e){C(t,"onopennamespace",{prefix:e,uri:n.ns[e]})}));for(var i=0,o=t.attribList.length;i",t.tagName="",void(t.state=k.SCRIPT);C(t,"onscript",t.script),t.script=""}var e=t.tags.length,n=t.tagName;t.strict||(n=n[t.looseCase]());for(var a=n;e--&&t.tags[e].name!==a;)O(t,"Unexpected close tag");if(e<0)return O(t,"Unmatched closing tag: "+t.tagName),t.textNode+="",void(t.state=k.TEXT);t.tagName=n;for(var r=t.tags.length;r-- >e;){var i=t.tag=t.tags.pop();t.tagName=t.tag.name,C(t,"onclosetag",t.tagName);var o={};for(var l in i.ns)o[l]=i.ns[l];var s=t.tags[t.tags.length-1]||t;t.opt.xmlns&&i.ns!==s.ns&&Object.keys(i.ns).forEach((function(e){var n=i.ns[e];C(t,"onclosenamespace",{prefix:e,uri:n})}))}0===e&&(t.closedRoot=!0),t.tagName=t.attribValue=t.attribName="",t.attribList.length=0,t.state=k.TEXT}function B(t){var e,n=t.entity,a=n.toLowerCase(),r="";return t.ENTITIES[n]?t.ENTITIES[n]:t.ENTITIES[a]?t.ENTITIES[a]:("#"===(n=a).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),r=(e=parseInt(n,16)).toString(16)):(n=n.slice(1),r=(e=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),r.toLowerCase()!==n?(O(t,"Invalid character entity"),"&"+t.entity+";"):String.fromCodePoint(e))}function q(t,e){"<"===e?(t.state=k.OPEN_WAKA,t.startTagPosition=t.position):v(l,e)&&(O(t,"Non-whitespace before first tag."),t.textNode=e,t.state=k.TEXT)}function G(t,e){var n="";return e1114111||S(o)!==o)throw RangeError("Invalid code point: "+o);o<=65535?n.push(o):(t=55296+((o-=65536)>>10),e=o%1024+56320,n.push(t,e)),(a+1===r||n.length>16384)&&(i+=w.apply(null,n),n.length=0)}return i},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:I,configurable:!0,writable:!0}):String.fromCodePoint=I)}(e)},6739:function(t,e,n){!function(t,e,n,a,r){function i(t){if("contents"in t)for(var e=("styleAttrs"in t?t.styleAttrs[a.byName.ruby.qname]:null),n="span"===t.kind&&("container"===e||"textContainer"===e||"baseContainer"===e),r=t.contents.length-1;r>=0;r--)!n||"styleAttrs"in t.contents[r]&&a.byName.ruby.qname in t.contents[r].styleAttrs?i(t.contents[r]):delete t.contents[r]}function o(t,e,n,a){var r=a&&"seq"===a.timeContainer,i=0;a&&(i=r&&n?n.end:a.begin),e.begin=e.explicit_begin?e.explicit_begin+i:i;var l=e.begin,s=null;if("sets"in e)for(var u=0;u0;){var a=e.styleRefs.pop();a in t.styles?(O(t,t.styles[a],n),P(t.styles[a].styleAttrs,e.styleAttrs)):U(n,"Non-existant style id referenced")}}function L(t,e,n,a){for(var r=e.length-1;r>=0;r--){var i=e[r];i in t.styles?P(t.styles[i].styleAttrs,n):U(a,"Non-existant style id referenced")}}function P(t,e){for(var n in t)t.hasOwnProperty(n)&&(n in e||(e[n]=t[n]))}function F(t,e){if(t&&t.warn&&t.warn(e))throw e}function U(t,e){if(t&&t.error&&t.error(e))throw e}function j(t,e){throw t&&t.fatal&&t.fatal(e),e}function B(t,e){for(var n,a=0,r=t.length-1;a<=r;){var i=t[n=Math.floor((a+r)/2)];if(ie))return{found:!0,index:n};r=n-1}}return{found:!1,index:a}}t.fromXML=function(t,r,h){var p=e.parser(!0,{xmlns:!0}),b=[],y=[],E=[],_=0,A=null;p.onclosetag=function(t){if(b[0]instanceof R)null!==A.head&&null!==A.head.styling&&L(A.head.styling,b[0].styleRefs,b[0].styleAttrs,r),delete b[0].styleRefs;else if(b[0]instanceof c)for(var e in b[0].styles)b[0].styles.hasOwnProperty(e)&&O(b[0],b[0].styles[e],r);else if(b[0]instanceof w||b[0]instanceof S){if(b[0].contents.length>1){var a,i=[b[0].contents[0]];for(a=1;a0&&h&&"onCloseTag"in h&&h.onCloseTag());E.shift(),y.shift(),b.shift()},p.ontext=function(t){if(void 0===b[0]);else if(b[0]instanceof S||b[0]instanceof w){if(b[0]instanceof S){var e=b[0].styleAttrs[a.byName.ruby.qname];if("container"===e||"textContainer"===e||"baseContainer"===e)return}var n=new I;n.initFromText(A,b[0],t,y[0],E[0],r),b[0].contents.push(n)}else b[0]instanceof l&&_>0&&h&&"onText"in h&&h.onText(t)},p.onopentag=function(t){var e=t.attributes["xml:space"];e?E.unshift(e.value):0===E.length?E.unshift("default"):E.unshift(E[0]);var i=t.attributes["xml:lang"];if(i?y.unshift(i.value):0===y.length?y.unshift(""):y.unshift(y[0]),t.uri===n.ns_tt)if("tt"===t.local)null!==A&&j(r,"Two elements at ("+this.line+","+this.column+")"),(A=new s).initFromNode(t,y[0],r),b.unshift(A);else if("head"===t.local)b[0]instanceof s||j(r,"Parent of element is not at ("+this.line+","+this.column+")"),b.unshift(A.head);else if("styling"===t.local)b[0]instanceof u||j(r,"Parent of element is not at ("+this.line+","+this.column+")"),b.unshift(A.head.styling);else if("style"===t.local){var o;b[0]instanceof c?((o=new d).initFromNode(t,r),o.id?A.head.styling.styles[o.id]=o:U(r,"",n),a=[t.slice(p,n)],n+=8):-1===T.indexOf(e)?(n++,a=y(e,r)):n++;else n++;return r.__children=a,r}var w,S=null;if(void 0!==e.attrValue)for(e.attrName=e.attrName||"id",S=[];-1!==(void 0,w=new RegExp("\\s"+e.attrName+"\\s*=['\"]"+e.attrValue+"['\"]").exec(t),n=w?w.index:-1);)-1!==(n=t.lastIndexOf("<",n))&&S.push(v()),t=t.substr(n),n=0;else S=e.parseNode?v():y("");return e.filter&&(S=ti(S,e.filter)),e.simplify?Jr(Array.isArray(S)?S:[S]):(e.setPos&&(S.pos=n),S)}function Jr(t){var e={};if(!t.length)return"";if(1===t.length&&"string"==typeof t[0])return t[0];for(var n in t.forEach((function(t){if("object"==typeof t){e[t.tagName]||(e[t.tagName]=[]);var n=Jr(t.children);e[t.tagName].push(n),Object.keys(t.attributes).length&&"string"!=typeof n&&(n._attributes=t.attributes)}})),e)1==e[n].length&&(e[n]=e[n][0]);return e}function ti(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";var r=[];return t.forEach((function(t,i){if("object"==typeof t&&e(t,i,n,a)&&r.push(t),t.children){var o=ti(t.children,e,n+1,(a?a+".":"")+i+"."+t.tagName);r=r.concat(o)}})),r}const ei=[S.A.PERIOD,S.A.BASE_URL,S.A.ADAPTATION_SET,S.A.REPRESENTATION,S.A.CONTENT_PROTECTION,S.A.ROLE,S.A.ACCESSIBILITY,S.A.AUDIO_CHANNEL_CONFIGURATION,S.A.CONTENT_COMPONENT,S.A.ESSENTIAL_PROPERTY,S.A.LABEL,S.A.S,S.A.SEGMENT_URL,S.A.EVENT,S.A.EVENT_STREAM,S.A.LOCATION,S.A.SERVICE_DESCRIPTION,S.A.SUPPLEMENTAL_PROPERTY,S.A.METRICS,S.A.REPORTING,S.A.PATCH_LOCATION,S.A.REPLACE,S.A.ADD,S.A.REMOVE,S.A.UTC_TIMING,S.A.INBAND_EVENT_STREAM,S.A.PRODUCER_REFERENCE_TIME,S.A.CONTENT_STEERING];function ni(t){t=t||{};const e=this.context,n=t.debug;let a,r,i,o;function l(t){try{let e=Zr(t,{parseNode:!0,attrMatchers:i,nodesAsArray:ei}),n={};if(-1!==e.tagName.toLowerCase().indexOf("xml"))for(let t in e){if(Array.isArray(e[t])){n[t]=e[t][0];break}if("object"==typeof e[t]){n[t]=e[t];break}}else n[e.tagName]=e,delete e.tagName;return n}catch(t){return null}}return a={getIron:function(){return o},parseXml:l,parse:function(t){let e;const n=window.performance.now();if(e=l(t),!e)throw new Error("failed to parse the manifest");e.Patch?(e=e.Patch,e.add&&e.add.forEach((t=>o.run(t))),e.replace&&e.replace.forEach((t=>o.run(t)))):(e=e.MPD,o.run(e));const a=window.performance.now();return r.info("Parsing complete: "+(a-n).toPrecision(3)+"ms"),e.protocol="DASH",e}},r=n.getLogger(a),i=[new Ur,new Br,new Hr,new Yr],o=Lr(e).create({adaptationset:new Wr,period:new $r}),a}ni.__dashjs_factory_name="DashParser";var ai=N.A.getClassFactory(ni);function ri(t){t=t||{};const e=this.context,n=t.debug,a=t.settings,r=(0,k.A)(e).getInstance(),i=wt(e).getInstance();let o,l,s,u,c,d=t.mssHandler,f=t.errHandler;function g(t){r.trigger(R.A.INTERNAL_MANIFEST_LOADED,{manifest:t.manifest})}return o={load:function(t){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,f=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const g=new Date,m=new Nr(t,z.G.MPD_TYPE);o&&(m.serviceLocation=o),f&&(m.queryParams=f),m.startDate||(m.startDate=g),r.trigger(R.A.MANIFEST_LOADING_STARTED,{request:m}),s.load({request:m,success:function(o,s,f){if(!u)return;let g,m,h;if(f&&f!==t?(m=i.parseBaseUrl(f),g=f):(i.isRelative(t)&&(t=i.resolve(t,window.location.href)),m=i.parseBaseUrl(t)),"No Content"!=s)if(null===c&&(c=function(t){let a=null;return t.indexOf("SmoothStreamingMedia")>-1?(d&&(a=d.createMssParser(),d.createMssFragmentProcessor(),d.registerEvents()),a):t.indexOf("MPD")>-1||t.indexOf("Patch")>-1?ai(e).create({debug:n}):a}(o)),null!==c){u.setParser(c);try{h=c.parse(o)}catch(e){return void r.trigger(R.A.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new G.A(V.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,V.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${t}`)})}if(h){if(h.url=g||t,h.originalUrl||(h.originalUrl=h.url),a&&a.get().streaming.enableManifestDurationMismatchFix&&h.mediaPresentationDuration&&h.Period.length>1){const t=h.Period.reduce(((t,e)=>t+e.duration),0);!isNaN(t)&&h.mediaPresentationDuration>t&&(l.warn("Media presentation duration greater than duration of all periods. Setting duration to total period duration"),h.mediaPresentationDuration=t)}h.baseUri=m,h.loadedTime=new Date,u.resolveManifestOnLoad(h),r.trigger(R.A.ORIGINAL_MANIFEST_LOADED,{originalManifest:o})}else r.trigger(R.A.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new G.A(V.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,V.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${t}`)})}else r.trigger(R.A.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new G.A(V.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,V.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${t}`)});else r.trigger(R.A.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(e,n,a){r.trigger(R.A.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new G.A(V.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,V.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+`${t}, ${a}`)})}})},reset:function(){r.off(R.A.XLINK_READY,g,o),d&&d.reset(),u&&(u.reset(),u=null),s&&(s.abort(),s=null)}},l=n.getLogger(o),r.on(R.A.XLINK_READY,g,o),s=Bn(e).create({errHandler:t.errHandler,dashMetrics:t.dashMetrics,mediaPlayerModel:t.mediaPlayerModel,urlUtils:i,constants:w.A,dashConstants:S.A,errors:V,requestTimeout:t.settings.get().streaming.manifestRequestTimeout}),u=zr(e).create({errHandler:f,dashMetrics:t.dashMetrics,mediaPlayerModel:t.mediaPlayerModel,settings:t.settings}),c=null,o}ri.__dashjs_factory_name="ManifestLoader";var ii=N.A.getClassFactory(ri);function oi(){let t;const e=this.context,n=(0,k.A)(e).getInstance();return t={error:function(t){n.trigger(R.A.ERROR,{error:t})}},t}oi.__dashjs_factory_name="ErrorHandler";var li=N.A.getSingletonFactory(oi),si=n(559);function ui(){const t=this.context,e=(0,k.A)(t).getInstance();let n,a,r,i,o,l,s;function u(t,e,n){const a=d(t,e,n);return r.isCodecSupportedBasedOnTestedConfigurations(a,t)}function c(t,e,n,a,r){const i=d(t,e,n),o=JSON.stringify(i);a.has(o)||(a.add(o),r.push(i))}function d(t,e,n){let r=null;switch(t){case w.A.VIDEO:r=function(t,e){let n={codec:e,width:t.width||null,height:t.height||null,framerate:a.getFramerate(t)||null,bitrate:t.bandwidth||null,isSupported:!0};i.get().streaming.capabilities.filterVideoColorimetryEssentialProperties&&Object.assign(n,function(t){let e={colorGamut:null,transferFunction:null,isSupported:!0};for(const n of t.EssentialProperty||[])n.schemeIdUri===w.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&["1","5","6","7"].includes(n.value.toString())?e.colorGamut=w.A.MEDIA_CAPABILITIES_API.COLORGAMUT.SRGB:n.schemeIdUri===w.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&["11","12"].includes(n.value.toString())?e.colorGamut=w.A.MEDIA_CAPABILITIES_API.COLORGAMUT.P3:n.schemeIdUri===w.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&["9"].includes(n.value.toString())?e.colorGamut=w.A.MEDIA_CAPABILITIES_API.COLORGAMUT.REC2020:n.schemeIdUri===w.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&["2"].includes(n.value.toString())?e.colorGamut=null:n.schemeIdUri===w.A.COLOUR_PRIMARIES_SCHEME_ID_URI&&(e.isSupported=!1),n.schemeIdUri===w.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["1","6","13","14","15"].includes(n.value.toString())?e.transferFunction=w.A.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.SRGB:n.schemeIdUri===w.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["16"].includes(n.value.toString())?e.transferFunction=w.A.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.PQ:n.schemeIdUri===w.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["18"].includes(n.value.toString())?e.transferFunction=w.A.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.HLG:n.schemeIdUri===w.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["2"].includes(n.value.toString())?e.transferFunction=null:n.schemeIdUri===w.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&(e.isSupported=!1);return e}(t));let r=n.isSupported;i.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties&&Object.assign(n,function(t){let e={isSupported:!0,hdrMetadataType:null};for(const n of t.EssentialProperty||[])n.schemeIdUri===w.A.HDR_METADATA_FORMAT_SCHEME_ID_URI&&n.value===w.A.HDR_METADATA_FORMAT_VALUES.ST2094_10?e.hdrMetadataType=w.A.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_10:n.schemeIdUri===w.A.HDR_METADATA_FORMAT_SCHEME_ID_URI&&n.value===w.A.HDR_METADATA_FORMAT_VALUES.SL_HDR2?e.hdrMetadataType=w.A.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SLHDR2:n.schemeIdUri===w.A.HDR_METADATA_FORMAT_SCHEME_ID_URI&&n.value===w.A.HDR_METADATA_FORMAT_VALUES.ST2094_40?e.hdrMetadataType=w.A.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_40:n.schemeIdUri===w.A.HDR_METADATA_FORMAT_SCHEME_ID_URI&&(e.isSupported=!1);return e}(t));let o=n.isSupported;return r&&o||(n.isSupported=!1),n}(e,n);break;case w.A.AUDIO:r=function(t,e){const n=t.audioSamplingRate||null;return{codec:e,bitrate:t.bandwidth||null,samplerate:n,isSupported:!0}}(e,n);break;default:return r}return function(t,e){return t&&t[S.A.CONTENT_PROTECTION]&&t[S.A.CONTENT_PROTECTION].length>0&&(e.keySystemsMetadata=l.getSupportedKeySystemMetadataFromContentProtection(t[S.A.CONTENT_PROTECTION])),e}(e,r)}function f(t){if(!t||0===t.length)return!0;let e=0;for(;e{const l=[w.A.VIDEO,w.A.AUDIO],d=[];l.forEach((e=>{const n=function(t,e){if(!t||!t.Period||0===t.Period.length)return[];const n=new Set,r=[];return t.Period.forEach((t=>{t.AdaptationSet.forEach((t=>{a.getIsTypeOf(t,e)&&t.Representation.forEach(((i,o)=>{const l=a.getCodec(t,o,!1);c(e,i,l,n,r);const s=a.getSupplementalCodecs(i);s.length>0&&c(e,i,s[0],n,r)}))}))})),r}(t,e);n.forEach((t=>{d.push(r.runCodecSupportCheck(t,e))}))})),Promise.allSettled(d).then((()=>(l.forEach((n=>{!function(t,n){n&&n.Period&&0!==n.Period.length&&n.Period.forEach((n=>{!function(t,n){t&&t.AdaptationSet&&0!==t.AdaptationSet.length&&(t.AdaptationSet=t.AdaptationSet.filter((t=>{a.getIsTypeOf(t,n)&&function(t,e){t.Representation&&0!==t.Representation.length&&(t.Representation=t.Representation.filter(((n,r)=>{const i=a.getCodec(t,r,!1),o=u(e,n,i);let l=function(t,e){let n=!1;const r=a.getSupplementalCodecs(t);return r.length>0&&(r.length>1&&s.warn("[CapabilitiesFilter] Multiple supplemental codecs not supported; using the first in list"),n=u(e,t,r[0])),n}(n,e);return l&&(s.debug(`[CapabilitiesFilter] Codec supported. Upgrading codecs string of Representation with ID ${n.id}`),n.codecs=n[S.A.SUPPLEMENTAL_CODECS]),o||l||s.warn(`[CapabilitiesFilter] Codec ${i} not supported. Removing Representation with ID ${n.id}`),o||l})))}(t,n);const r=t.Representation&&t.Representation.length>0;return r||(e.trigger(R.A.ADAPTATION_SET_REMOVED_NO_CAPABILITIES,{adaptationSet:t}),s.warn(`[CapabilitiesFilter] AdaptationSet with ID ${t.id?t.id:"undefined"} and codec ${t.codecs?t.codecs:"undefined"} has been removed because of no supported Representation`)),r})))}(n,t)}))}(n,t)})),i.get().streaming.capabilities.filterUnsupportedEssentialProperties&&function(t){t&&t.Period&&0!==t.Period.length&&t.Period.forEach((t=>{t.AdaptationSet=t.AdaptationSet.filter((t=>!t.Representation||0===t.Representation.length||!!f(a.getEssentialPropertiesForAdaptationSet(t))&&(t.Representation=t.Representation.filter((t=>f(a.getEssentialPropertiesForRepresentation(t)))),t.Representation&&t.Representation.length>0)))}))}(t),function(t){if(!t||!t.Period||0===t.Period.length)return Promise.resolve();const e=[];return t.Period.forEach((t=>{e.push(function(t){return new Promise((e=>{if(!t||!t.AdaptationSet||0===t.AdaptationSet.length)return void e();const n=[];t.AdaptationSet.forEach((t=>{n.push(function(t){return new Promise((e=>{if(!t.Representation||0===t.Representation.length)return void e();const n=[];t.Representation.forEach((t=>{n.push(function(t){const e=[],n=o.getCustomCapabilitiesFilters();return n&&0!==n.length?n.forEach((n=>{e.push(new Promise((e=>e(n(t)))))})):e.push(Promise.resolve(!0)),Promise.all(e)}(t))})),Promise.all(n).then((n=>{t.Representation=t.Representation.filter(((t,e)=>{let a=n[e].every((t=>t));return a||s.debug("[Stream] Representation "+t.id+" has been removed because of unsupported CustomFilter"),a})),e()})).catch((t=>{s.warn("[Stream] at least one promise rejected in CustomFilter with error: ",t),e()}))}))}(t))})),Promise.all(n).then((()=>{t.AdaptationSet=t.AdaptationSet.filter((t=>t.Representation&&t.Representation.length>0)),e()})).catch((()=>{e()}))}))}(t))})),Promise.all(e)}(t)))).then((()=>{n()})).catch((t=>{s.error(t),n()}))}))}},s=(0,C.A)(t).getInstance().getLogger(n),n}ui.__dashjs_factory_name="CapabilitiesFilter";var ci=N.A.getSingletonFactory(ui),di=class{constructor(){this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null}};function fi(){let t,e;return t={initialize:function(t){if(e=new di,!t)return null;const n=t.indexOf("#");if(-1!==n){const a=t.substr(n+1).split("&");for(let t=0,n=a.length;t0?(n&&e.warn("Supplied minimum playback rate is a positive value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."),0):t<-.5?(n&&e.warn("Supplied minimum playback rate is out of range and will be limited to -0.5: -50% playback speed."),-.5):t}function l(t,n){return isNaN(t)?0:t<0?(n&&e.warn("Supplied maximum playback rate is a negative value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."),0):t>1?(n&&e.warn("Supplied maximum playback rate is out of range and will be limited to 1: 200% playback speed."),1):t}function s(){const t=u(),e=n.getLiveDelay();return!isNaN(e)&&e>0?Math.min(t,e):t}function u(){return i.get().streaming.buffer.bufferTimeDefault>0?i.get().streaming.buffer.bufferTimeDefault:c()?20:12}function c(){return null!==i.get().streaming.buffer.fastSwitchEnabled?i.get().streaming.buffer.fastSwitchEnabled:!n.getLowLatencyModeEnabled()}return t={getCatchupMaxDrift:function(){if(!isNaN(i.get().streaming.liveCatchup.maxDrift)&&i.get().streaming.liveCatchup.maxDrift>=0)return i.get().streaming.liveCatchup.maxDrift;const t=a.getServiceDescriptionSettings();return t&&t.liveCatchup&&!isNaN(t.liveCatchup.maxDrift)&&t.liveCatchup.maxDrift>=0?t.liveCatchup.maxDrift:12},getCatchupModeEnabled:function(){return null!==i.get().streaming.liveCatchup.enabled?i.get().streaming.liveCatchup.enabled:n.getInitialCatchupModeActivated()},getBufferTimeDefault:s,getBufferTimeDefaultUnadjusted:u,getFastSwitchEnabled:c,getInitialBufferLevel:function(){const t=i.get().streaming.buffer.initialBufferLevel;return isNaN(t)||t<0?0:Math.min(s(),t)},getRetryAttemptsForType:function(t){const e=isNaN(i.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:i.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return n.getLowLatencyModeEnabled()?i.get().streaming.retryAttempts[t]*e:i.get().streaming.retryAttempts[t]},getRetryIntervalsForType:function(t){const e=isNaN(i.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:i.get().streaming.retryIntervals.lowLatencyReductionFactor;return n.getLowLatencyModeEnabled()?i.get().streaming.retryIntervals[t]/e:i.get().streaming.retryIntervals[t]},getCatchupPlaybackRates:function(t){const e=i.get().streaming.liveCatchup.playbackRate;if(!isNaN(e.min)||!isNaN(e.max))return{min:o(e.min,t),max:l(e.max,t)};const n=a.getServiceDescriptionSettings();if(n&&n.liveCatchup&&(!isNaN(n.liveCatchup.playbackRate.min)||!isNaN(n.liveCatchup.playbackRate.max))){const e=n.liveCatchup.playbackRate;return{min:o(e.min,t),max:l(e.max,t)}}return{min:-.5,max:.5}},getAbrBitrateParameter:function(t,e){try{const n=i.get().streaming.abr[t][e];if(!isNaN(n)&&-1!==n)return n;const r=a.getServiceDescriptionSettings();return r&&r[t]&&!isNaN(r[t][e])?r[t][e]:-1}catch(t){return-1}},setConfig:function(t){t.playbackController&&(n=t.playbackController),t.serviceDescriptionController&&(a=t.serviceDescriptionController)},reset:function(){}},e=(0,C.A)(r).getInstance().getLogger(t),t}pi.__dashjs_factory_name="MediaPlayerModel";var bi=N.A.getSingletonFactory(pi);const yi={DEFAULT:.5,STRONG:1,WEAK:0};function Ei(t,e,n,a){let r,i,o,l,s;return i=void 0===t?null:t,o=function(t){let e=yi.DEFAULT;return t!==yi.DEFAULT&&t!==yi.STRONG&&t!==yi.WEAK||(e=t),e}(n),l=void 0===e?null:e,s=void 0===a?null:a,r={representation:i,reason:l,rule:s,priority:o},r}Ei.__dashjs_factory_name="SwitchRequest";const _i=N.A.getClassFactory(Ei);_i.NO_CHANGE=null,_i.PRIORITY=yi,N.A.updateClassFactory(Ei.__dashjs_factory_name,_i);var Ai=_i;function Ti(t){t=t||{};const e=this.context,n=t.dashMetrics;let a,r;return a={getSwitchRequest:function(t){try{const a=Ai(e).create();a.rule=this.getClassName();const r=t.getMediaInfo(),i=t.getMediaType(),o=n.getCurrentBufferState(i),l=t.getScheduleController(),s=t.getAbrController(),u=t.getStreamInfo(),c=u?u.id:null,d=u&&u.manifestInfo?u.manifestInfo.isDynamic:null,f=t.getThroughputController(),g=f.getSafeAverageThroughput(i),m=f.getAverageLatency(i);return isNaN(g)||!o||s.getAbandonmentStateFor(c,i)===I.ALLOW_LOAD&&(o.state===I.BUFFER_LOADED||d)&&(a.representation=s.getOptimalRepresentationForBitrate(r,g,!0),a.reason={throughput:g,latency:m,message:`[ThroughputRule]: Switching to Representation with bitrate ${a.representation?a.representation.bitrateInKbit:"n/a"} kbit/s. Throughput: ${g}`},l.setTimeToLoadDelay(0)),a}catch(t){return r.error(t),Ai(e).create()}},reset:function(){}},r=(0,C.A)(e).getInstance().getLogger(a),a}Ti.__dashjs_factory_name="ThroughputRule";var vi=N.A.getClassFactory(Ti);function wi(t){t=t||{};const e=this.context,n=(0,k.A)(e).getInstance(),a=t.dashMetrics,r=(0,K.A)(e).getInstance();let i,o,l;function s(){const t=r.get().streaming.abr.rules.insufficientBufferRule.parameters.segmentIgnoreCount;l={},l[w.A.VIDEO]={ignoreCount:t},l[w.A.AUDIO]={ignoreCount:t}}function u(){s()}function c(t){isNaN(t.startTime)||t.mediaType!==w.A.AUDIO&&t.mediaType!==w.A.VIDEO||l[t.mediaType].ignoreCount>0&&l[t.mediaType].ignoreCount--}return i={getSwitchRequest:function(t){const n=Ai(e).create();if(n.rule=this.getClassName(),!t||!t.hasOwnProperty("getMediaType"))return n;const i=t.getMediaType(),s=a.getCurrentBufferState(i),u=t.getRepresentation().fragmentDuration;if(!function(t,e,n){return!t.getLowLatencyModeEnabled()&&l[e].ignoreCount<=0&&n}(t.getScheduleController().getPlaybackController(),i,u))return n;const c=t.getMediaInfo(),d=t.getAbrController();if(s&&s.state===I.BUFFER_EMPTY)o.debug("["+i+"] Switch to index 0; buffer is empty."),n.representation=d.getOptimalRepresentationForBitrate(c,0,!0),n.reason={message:"[InsufficientBufferRule]: Switching to lowest Representation because buffer is empty"};else{const e=t.getThroughputController(),o=a.getCurrentBufferLevel(i),l=e.getAverageThroughput(i,null,NaN)*r.get().streaming.abr.rules.insufficientBufferRule.parameters.throughputSafetyFactor*o/u;if(isNaN(l)||l<=0)return n;n.representation=d.getOptimalRepresentationForBitrate(c,l,!0),n.reason={message:"[InsufficientBufferRule]: Limiting maximum bitrate to avoid a buffer underrun.",bitrate:l}}return n},reset:function(){s(),n.off(D.A.PLAYBACK_SEEKING,u,i),n.off(R.A.BYTES_APPENDED_END_FRAGMENT,c,i)}},o=(0,C.A)(e).getInstance().getLogger(i),s(),n.on(D.A.PLAYBACK_SEEKING,u,i),n.on(R.A.BYTES_APPENDED_END_FRAGMENT,c,i),i}wi.__dashjs_factory_name="InsufficientBufferRule";var Si=N.A.getClassFactory(wi);function Ii(t){const e=(t=t||{}).mediaPlayerModel,n=t.dashMetrics,a=this.context,r=(0,K.A)(a).getInstance();let i,o,l;function s(){l={}}return i={shouldAbandon:function(t){const i=Ai(a).create();i.rule=this.getClassName();try{if(!t)return i;const a=t.getCurrentRequest();if(!isNaN(a.index)){if(null===a.firstByteDate||l.hasOwnProperty(a.index))return i;const o=e.getBufferTimeDefault(),s=t.getMediaType();if(n.getCurrentBufferLevel(s)>o)return i;const u=Date.now()-a.firstByteDate.getTime();if(a.traces.length>=r.get().streaming.abr.rules.abandonRequestsRule.parameters.minThroughputSamplesThreshold&&u>r.get().streaming.abr.rules.abandonRequestsRule.parameters.minSegmentDownloadTimeThresholdInMs&&a.bytesLoadedt+e.b[0]),0)-e.traces[0].b[0],s=Math.max(e.traces.reduce(((t,e)=>t+e.d),0)-e.traces[0].d,1),u=Math.round(8*o/s),c=Number(8*e.bytesTotal/u/1e3).toFixed(2),d=t.getRepresentation(),f=t.getAbrController();if(ce.bytesTotal*s.bitrateInKbit/c.bitrateInKbit&&(n.representation=s,n.reason={throughputInKbit:u,message:`[AbandonRequestRule][${i} is asking to abandon and switch to quality to ${s.absoluteIndex}. The measured bandwidth was ${u} kbit/s`},l[e.index]=!0)}return n}(t,a,i)}return i}catch(t){return o.error(t),i}},reset:s},o=(0,C.A)(a).getInstance().getLogger(i),s(),i}Ii.__dashjs_factory_name="AbandonRequestsRule";var ki=N.A.getClassFactory(Ii);function Ri(){const t=this.context,e=(0,K.A)(t).getInstance();let n;return n={getSwitchRequest:function(n){const a=Ai(t).create();if(a.rule=this.getClassName(),!n||!n.hasOwnProperty("getDroppedFramesHistory"))return a;const r=n.getDroppedFramesHistory();if(!r)return a;const i=n.getStreamInfo().id,o=n.getMediaInfo(),l=n.getAbrController(),s=r.getFrameHistory(i);if(!s||0===Object.keys(s).length)return a;let u=0,c=0;const d=l.getPossibleVoRepresentationsFilteredBySettings(o,!0);let f=null;for(let t=1;te.get().streaming.abr.rules.droppedFramesRule.parameters.minimumSampleSize&&u/c>e.get().streaming.abr.rules.droppedFramesRule.parameters.droppedFramesPercentageThreshold)){f=d[t-1];break}}return f&&(a.representation=f,a.reason={droppedFrames:u,message:`[DroppedFramesRule]: Switching to index ${f.absoluteIndex}. Dropped Frames: ${u}, Total Frames: ${c}`}),a}},n}Ri.__dashjs_factory_name="DroppedFramesRule";var Ni=N.A.getClassFactory(Ri);function Ci(){const t=this.context,e=(0,K.A)(t).getInstance();let n;return n={getSwitchRequest:function(n){const a=Ai(t).create();if(a.rule=this.getClassName(),!n)return a;const r=n.getStreamInfo().id,i=n.getMediaType(),o=n?n.getSwitchRequestHistory():null,l=o?o.getSwitchRequests(r,i):{},s=n.getAbrController(),u=n.getMediaInfo(),c=s.getPossibleVoRepresentationsFilteredBySettings(u,!0);let d=0,f=0;for(let t=0;t=e.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize&&d/f>e.get().streaming.abr.rules.switchHistoryRule.parameters.switchPercentageThreshold)){a.representation=t>0&&l[n.id].drops>0?c[t-1]:n,a.reason={drops:d,noDrops:f,message:`[SwitchHistoryRule]: Switch to index: ${a.representation.absoluteIndex} samples: ${d+f} drops: ${d}`};break}}return a}},n}Ci.__dashjs_factory_name="SwitchHistoryRule";var Di=N.A.getClassFactory(Ci);const xi="BOLA_STATE_ONE_BITRATE",Mi="BOLA_STATE_STARTUP",zi="BOLA_STATE_STEADY",Oi=10;function Li(t){t=t||{};const e=this.context,n=t.dashMetrics,a=t.mediaPlayerModel,r=(0,k.A)(e).getInstance(),i=co(e).getInstance();let o,l,s;function u(t){const e=t.mediaType,n=t.streamId,a=e===w.A.AUDIO?[w.A.AUDIO]:s[n];for(const t in a)s[n]&&s[n].hasOwnProperty(t)&&s[n][t].state===zi&&(s[n][t].placeholderBuffer=0)}function c(t){const e=t.streamId;for(const t in s[e])if(s[e].hasOwnProperty(t)){const n=s[e][t];n.state!==xi&&(n.state=Mi,d(n))}}function d(t){t.placeholderBuffer=0,t.mostAdvancedSegmentStart=NaN,t.lastSegmentWasReplacement=!1,t.lastSegmentStart=NaN,t.lastSegmentDurationS=NaN,t.lastSegmentRequestTimeMs=NaN,t.lastSegmentFinishTimeMs=NaN}function f(t){try{if(t&&t.metric===I.HTTP_REQUEST&&t.value&&t.value.type===z.G.MEDIA_SEGMENT_TYPE&&t.value.trace&&t.value.trace.length){const e=s[t.value._streamId]&&s[t.value._streamId][t.mediaType]?s[t.value._streamId][t.mediaType]:null;e&&e.state!==xi&&(e.lastSegmentRequestTimeMs=t.value.trequest.getTime(),e.lastSegmentFinishTimeMs=t.value._tfinish.getTime(),g(e,t.mediaType))}}catch(t){l.error(t)}}function g(t,e){if(!isNaN(t.lastSegmentStart)&&!isNaN(t.lastSegmentRequestTimeMs)&&!isNaN(t.placeholderBuffer)){if(t.placeholderBuffer*=.99,!isNaN(t.lastSegmentFinishTimeMs)){const a=n.getCurrentBufferLevel(e)+.001*(t.lastSegmentFinishTimeMs-t.lastSegmentRequestTimeMs),r=b(t,t.currentRepresentation),i=Math.max(0,r-a);t.placeholderBuffer=Math.min(i,t.placeholderBuffer)}t.lastSegmentWasReplacement&&!isNaN(t.lastSegmentDurationS)&&(t.placeholderBuffer+=t.lastSegmentDurationS),t.lastSegmentStart=NaN,t.lastSegmentRequestTimeMs=NaN}}function m(t){if(t&&s[t.streamId]&&s[t.streamId][t.mediaType]){const e=s[t.streamId][t.mediaType];e&&e.state!==xi&&(e.currentRepresentation=t.newRepresentation)}}function h(t,e,n){const a=n.reduce(((t,e,a)=>e>n[t]?a:t),0);if(0===a)return null;const r=Math.max(t,Oi+2*e.length),i=(n[a]-1)/(r/Oi-1);return{gp:i,Vp:Oi/i}}function p(t,e){const r=a.getBufferTimeDefault();if(t.bufferTimeDefault!==r){const a=h(r,t.representations,t.utilities);if(a.Vp!==t.Vp||a.gp!==t.gp){const i=n.getCurrentBufferLevel(e);let o=i+t.placeholderBuffer;o-=Oi,o*=a.Vp/t.Vp,o+=Oi,t.bufferTimeDefault=r,t.Vp=a.Vp,t.gp=a.gp,t.placeholderBuffer=Math.max(0,o-i)}}}function b(t,e){return t.Vp*(t.utilities[e.absoluteIndex]+t.gp)}function y(t){if(t&&t.chunk&&t.chunk.representation.mediaInfo&&s[t.streamId]){const e=s[t.streamId][t.chunk.representation.mediaInfo.type];if(e&&e.state!==xi){const n=t.chunk.start;isNaN(e.mostAdvancedSegmentStart)||n>e.mostAdvancedSegmentStart?(e.mostAdvancedSegmentStart=n,e.lastSegmentWasReplacement=!1):e.lastSegmentWasReplacement=!0,e.lastSegmentStart=n,e.lastSegmentDurationS=t.chunk.duration,e.currentRepresentation=t.chunk.representation,g(e,t.chunk.representation.mediaInfo.type)}}}function E(){T()}function _(t,e){const n=e.absoluteIndex,a=e.bandwidth,r=t.utilities[n];let i=0;for(let e=n-1;e>=0;--e)if(t.utilities[e]0?_(e,e.currentRepresentation):Oi;const i=Math.max(0,r-a);e.placeholderBuffer=Math.min(e.placeholderBuffer,i)}}}function T(){s={}}return o={getSwitchRequest:function(t){try{const r=Ai(e).create();t.getScheduleController().setTimeToLoadDelay(0),r.rule=this.getClassName(),r.reason=r.reason||{};const o=function(t){const e=t.getMediaType(),n=t.getStreamInfo().id;s[n]||(s={},s[n]={});let r=s[n][e];return r?r.state!==xi&&p(r,e):(r=function(t){const e={},n=t.getMediaInfo(),r=i.getPossibleVoRepresentationsFilteredBySettings(n,!0);let o=r.map((t=>t.bandwidth)).map((t=>Math.log(t)));o=o.map((t=>t-o[0]+1));const l=a.getBufferTimeDefault(),s=h(l,r,o);return s?(e.state=Mi,e.representations=r,e.utilities=o,e.bufferTimeDefault=l,e.Vp=s.Vp,e.gp=s.gp,e.currentRepresentation=null,d(e)):e.state=xi,e}(t),s[n][e]=r),r}(t);switch(r.reason.state=o.state,o.state){case xi:break;case Mi:!function(t,e,a){const r=e.getMediaType(),o=e.getThroughputController().getSafeAverageThroughput(r);if(isNaN(o))return;const l=e.getMediaInfo(),s=i.getOptimalRepresentationForBitrate(l,o,!0),u=n.getCurrentBufferLevel(r);t.representation=s,t.reason.throughput=o,a.placeholderBuffer=Math.max(0,_(a,s)-u),a.currentRepresentation=s,!isNaN(a.lastSegmentDurationS)&&u>=a.lastSegmentDurationS&&(a.state=zi)}(r,t,o);break;case zi:!function(t,e,a){const r=e.getMediaType(),o=e.getThroughputController(),l=e.getMediaInfo(),s=o.getSafeAverageThroughput(r),u=e.getScheduleController();!function(t,e){const n=Date.now();if(isNaN(t.lastSegmentFinishTimeMs)){if(!isNaN(t.lastCallTimeMs)){const e=.001*(n-t.lastCallTimeMs);t.placeholderBuffer+=Math.max(0,e)}}else{const e=.001*(n-t.lastSegmentFinishTimeMs);t.placeholderBuffer+=Math.max(0,e)}t.lastCallTimeMs=n,t.lastSegmentStart=NaN,t.lastSegmentRequestTimeMs=NaN,t.lastSegmentFinishTimeMs=NaN,p(t,e)}(a,r);const c=n.getCurrentBufferLevel(r);let d=function(t,e){const n=t.representations.length;let a=NaN,r=NaN;for(let i=0;i=r)&&(r=n,a=i)}return t.representations[a]}(a,c+a.placeholderBuffer);const f=i.getOptimalRepresentationForBitrate(l,s,!0);d.absoluteIndex>a.currentRepresentation.absoluteIndex&&d.absoluteIndex>f.absoluteIndex&&(d=f.absoluteIndex>a.currentRepresentation.absoluteIndex?f:a.currentRepresentation);let g=Math.max(0,c+a.placeholderBuffer-b(a,d));g<=a.placeholderBuffer?(a.placeholderBuffer-=g,g=0):(g-=a.placeholderBuffer,a.placeholderBuffer=0,i.isPlayingAtTopQuality(d)?g=0:u.setTimeToLoadDelay(1e3*g)),t.representation=d,t.reason.throughput=s,t.reason.bufferLevel=c,t.reason.placeholderBuffer=a.placeholderBuffer,t.reason.delay=g,a.currentRepresentation=d}(r,t,o);break;default:!function(t,e,n){l.debug("BOLA ABR rule invoked in bad state.");const a=e.getMediaInfo(),r=e.getMediaType(),o=e.getThroughputController().getSafeAverageThroughput(r);t.representation=i.getOptimalRepresentationForBitrate(a,o,!0),t.reason.state=n.state,t.reason.throughput=o,n.state=Mi,d(n)}(r,t,o)}return r}catch(t){return l.error(t),Ai(e).create()}},handleNewMediaInfo:function(t){t&&t.streamInfo&&t.type&&s[t.streamInfo.id]&&s[t.streamInfo.id][t.type]&&delete s[t.streamInfo.id][t.type]},reset:function(){T(),r.off(D.A.BUFFER_EMPTY,u,o),r.off(D.A.PLAYBACK_SEEKING,c,o),r.off(D.A.METRIC_ADDED,f,o),r.off(D.A.QUALITY_CHANGE_REQUESTED,m,o),r.off(D.A.FRAGMENT_LOADING_ABANDONED,A,o),r.off(R.A.MEDIA_FRAGMENT_LOADED,y,o),r.off(R.A.SETTING_UPDATED_MAX_BITRATE,E,o),r.off(R.A.SETTING_UPDATED_MIN_BITRATE,E,o)}},l=(0,C.A)(e).getInstance().getLogger(o),T(),r.on(D.A.BUFFER_EMPTY,u,o),r.on(D.A.PLAYBACK_SEEKING,c,o),r.on(D.A.METRIC_ADDED,f,o),r.on(D.A.QUALITY_CHANGE_REQUESTED,m,o),r.on(D.A.FRAGMENT_LOADING_ABANDONED,A,o),r.on(R.A.MEDIA_FRAGMENT_LOADED,y,o),r.on(R.A.SETTING_UPDATED_MAX_BITRATE,E,o),r.on(R.A.SETTING_UPDATED_MIN_BITRATE,E,o),o}Li.__dashjs_factory_name="BolaRule";var Pi=N.A.getClassFactory(Li);const Fi="L2A_STATE_ONE_BITRATE",Ui="L2A_STATE_STARTUP",ji="L2A_STATE_STEADY",Bi=Math.pow(4,.99);function qi(t){t=t||{};const e=this.context,n=t.dashMetrics,a=(0,k.A)(e).getInstance();let r,i,o,l;function s(t){t.placeholderBuffer=0,t.mostAdvancedSegmentStart=NaN,t.lastSegmentWasReplacement=!1,t.lastSegmentStart=NaN,t.lastSegmentDurationS=NaN,t.lastSegmentRequestTimeMs=NaN,t.lastSegmentFinishTimeMs=NaN,t.lastSegmentUrl=""}function u(){for(const t in i)if(i.hasOwnProperty(t)){const e=i[t];e.state!==Fi&&(e.state=Ui,s(e))}}function c(t){if(t&&t.chunk&&t.chunk.representation&&t.chunk.representation.mediaInfo){const e=i[t.chunk.representation.mediaInfo.type],n=o[t.chunk.representation.mediaInfo.type];if(e&&e.state!==Fi){const a=t.chunk.start;isNaN(e.mostAdvancedSegmentStart)||a>e.mostAdvancedSegmentStart?(e.mostAdvancedSegmentStart=a,e.lastSegmentWasReplacement=!1):e.lastSegmentWasReplacement=!0,e.lastSegmentStart=a,e.lastSegmentDurationS=t.chunk.duration,e.currentRepresentation=t.chunk.representation,f(e,n)}}}function d(t){if(t&&t.metric===I.HTTP_REQUEST&&t.value&&t.value.type===z.G.MEDIA_SEGMENT_TYPE&&t.value.trace&&t.value.trace.length){const e=i[t.mediaType],n=o[t.mediaType];e&&e.state!==Fi&&(e.lastSegmentRequestTimeMs=t.value.trequest.getTime(),e.lastSegmentFinishTimeMs=t.value._tfinish.getTime(),f(e,n))}}function f(t,e){isNaN(t.lastSegmentStart)||isNaN(t.lastSegmentRequestTimeMs)||(e.segment_request_start_s=.001*t.lastSegmentRequestTimeMs,e.segment_download_finish_s=.001*t.lastSegmentFinishTimeMs,t.lastSegmentStart=NaN,t.lastSegmentRequestTimeMs=NaN)}function g(t,e){if(t.length!==e.length)return-1;let n=0;for(let a=0;a=d.B_target){a.state=ji,d.Q=Bi;for(let t=0;ts&&(n=-1),d.w[t]=d.prev_w[t]+n*(e/(2*m))*((d.Q+Bi)*(f*a.bitrateInKbit/s))}d.w=function(t){const e=t.length;let n=!1,a=[];for(let n=0;n=r[t+1]){n=!0;break}n||(o=(i+r[e-1]-1)/e);for(let t=0;tt.bandwidth));d.Q=Math.max(0,d.Q-e+e*f*((g(h,d.prev_w)+g(h,r))/s));let p=[];for(let t=0;ta.currentRepresentation.absoluteIndex&&h[a.currentRepresentation.absoluteIndex+1]<=s&&(c=i.getRepresentationByAbsoluteIndex(a.currentRepresentation.absoluteIndex+1,o,!0)),c.bitrateInKbit>=s&&(d.Q=2*Math.max(Bi,d.Q)),a.lastSegmentUrl=u.url}e.representation=c,a.currentRepresentation=e.representation}(t,a,u);break;default:!function(t,e,n){const a=t.getAbrController(),r=t.getMediaInfo(),i=t.getMediaType(),o=t.getThroughputController().getSafeAverageThroughput(i);e.representation=a.getOptimalRepresentationForBitrate(r,o,!0),e.reason.throughput=o,n.state=Ui,s(n)}(t,a,u)}return a}catch(t){return l.error(t),Ai(e).create()}},reset:function(){m(),a.off(R.A.PLAYBACK_SEEKING,u,r),a.off(R.A.MEDIA_FRAGMENT_LOADED,c,r),a.off(R.A.METRIC_ADDED,d,r)}},l=(0,C.A)(e).getInstance().getLogger(r),m(),a.on(R.A.PLAYBACK_SEEKING,u,r),a.on(R.A.MEDIA_FRAGMENT_LOADED,c,r),a.on(R.A.METRIC_ADDED,d,r),r}qi.__dashjs_factory_name="L2ARule";var Gi=N.A.getClassFactory(qi);function Hi(){const t=this.context;let e,n,a,r,i,o,l,s,u;function c(){a=null,r=1,i=100,o=0,l=null,s=null,u="dynamic_weight_selection"}function d(){let t=0;if(a)for(let e=0;et&&(t=n.state.throughput)}return t}function f(t,e,n){let a=t.map(((t,a)=>n[a]*Math.pow(t-e[a],2))).reduce(((t,e)=>t+e));return(a<0?-1:1)*Math.sqrt(Math.abs(a))}function g(t,e){return f([t.state.throughput,t.state.latency,t.state.rebuffer,t.state.switch],[e.state.throughput,e.state.latency,e.state.rebuffer,e.state.switch],[1,1,1,1])}function m(t,e){for(let n=0;nt.bandwidth));o=Math.min(...i),r=function(t){const e=t.map((t=>Math.pow(t,2))).reduce(((t,e)=>t+e));return Math.sqrt(e)}(i),n.forEach((t=>{let e={representation:t,state:{throughput:t.bandwidth/r,latency:0,rebuffer:0,switch:0}};a.push(e)})),s=function(t){let e=[],n=function(t){let e=[];for(let n=0;nr)&&(t=o,r=l)}e.push(t)}let r=null,i=null;for(let t=0;tr)&&(r=n,i=t)}let o=[];for(o.push(e[i]),e.splice(i,1);e.length>0;){let t=null,n=null;for(let r=0;r1&&(A=d()),g/=i;let T=a.find((t=>t.representation.id===b.id)),v=T.representation.bandwidth*y.getSegmentDuration()/_,w=Math.max(0,v-h);if(h-vn&&e>o.representation.bandwidth&&(n=o.representation.bandwidth,r=o)}return r}(T,_).representation;switch(u){case"manual_weight_selection":l=[.4,.4,.4,.4];break;case"random_weight_selection":l=function(t){let e=[],n=Math.sqrt(2/t);for(let t=0;t<4;t++)e.push(Math.random()*n);return l=e,l}(a.length);break;default:!function(t,e,n,r,i,o){l||(l=s[s.length-1]);let u=t.findWeightVector(a,e,n,r,i,o);null!==u&&-1!==u&&(l=u)}(y,E,h,w,_,p)}let S=null,I=null,k=null;for(let t=0;tc-1e4||d)&&e.representation.bandwidth!==o&&(s[0]=100);let g=f(i,[A,0,0,0],s);(null===S||gn?t-n:t+n-e,a}return e={getMinBuffer:function(){return l},getSegmentDuration:c,getNextBufferWithBitrate:function(t,e,n){return d(e,t*s/n)},getNextBuffer:d,findWeightVector:function(t,e,n,a,c,f){let g=null,m=null,h=null,p=Math.abs(e-i);return t.forEach((t=>{r.forEach((a=>{a[0];let r,i=a[1],b=a[2],y=(a[3],t.representation.bandwidth*s/c),E=d(n,y);r=0===b?10:1/b;let _=r*Math.max(1e-5,y-E);r=0===i?10:1/i;let A=r*t.state.latency,T=u.calculateSingleUseQoe(t.representation.bandwidth,_,A,f);(null===g||T>g)&&function(t,e,n){return!(t>o+n)&&e>=l}(e,E,p)&&(g=T,m=a,h=t.representation.bandwidth)}))})),null===m&&null===h&&(m=-1),i=e,m}},n=[.2,.4,.6,.8,1],a=4,r=function(t){let e=t.map((function(t){return[t]})),n=function(e,a,r){if(r===a)return e;let i=e.length;for(let n=0;nt.bandwidth)),_=t.getRepresentation().fragmentDuration,A=Math.min(...E)/1e3,T=Math.max(...E)/1e3,v=c.bandwidth/1e3,S=i.getCurrentHttpRequest(l,!0),k=(S.tresponse.getTime()-S.trequest.getTime())/1e3,R=k>_?k-_:0;r.setupPerSegmentQoe(_,T,A),r.logSegmentMetrics(v,R,p,b);let N=Xi(o).create({targetLatency:1.5,bufferMin:.3,segmentDuration:_,qoeEvaluator:r});return n.representation=a.getNextQuality(s,d,1e3*y,p,m,b,c,N),n.reason={throughput:y,latency:p},n.priority=Ai.PRIORITY.STRONG,g.setTimeToLoadDelay(0),n}catch(t){throw t}},reset:function(){a.reset(),r.reset()}},e=(0,C.A)(o).getInstance().getLogger(n),a=Yi(o).create(),r=Wi(o).create(),n}Qi.__dashjs_factory_name="LoLPRule";var Zi=N.A.getClassFactory(Qi);function Ji(t){t=t||{};const e=this.context,n=t.mediaPlayerModel,a=t.customParametersModel,r=t.dashMetrics,i=t.settings,o=(0,k.A)(e).getInstance();let l,s,u,c;function d(){Object.values(w.A.QUALITY_SWITCH_RULES).forEach((t=>{s=f(t,s)})),Object.values(w.A.ABANDON_FRAGMENT_RULES).forEach((t=>{u=f(t,u)})),a.getAbrCustomRules().forEach((function(t){t.type===w.A.RULES_TYPES.QUALITY_SWITCH_RULES&&s.push(t.rule(e).create()),t.type===w.A.RULES_TYPES.ABANDON_FRAGMENT_RULES&&u.push(t.rule(e).create())})),0===s.length&&(s.push(Pi(e).create({dashMetrics:r,mediaPlayerModel:n,settings:i})),s.push(vi(e).create({dashMetrics:r})))}function f(t,a){const o=t.charAt(0).toLowerCase()+t.slice(1);return i.get().streaming.abr.rules[o].active&&!function(t,e){return t.filter((t=>t.getClassName()===e)).length>0}(a,t)?(a.push(function(t){switch(t){case w.A.QUALITY_SWITCH_RULES.BOLA_RULE:return Pi(e).create({dashMetrics:r,mediaPlayerModel:n,settings:i});case w.A.QUALITY_SWITCH_RULES.THROUGHPUT_RULE:return vi(e).create({dashMetrics:r});case w.A.QUALITY_SWITCH_RULES.INSUFFICIENT_BUFFER_RULE:return Si(e).create({dashMetrics:r,settings:i});case w.A.QUALITY_SWITCH_RULES.SWITCH_HISTORY_RULE:return Di(e).create();case w.A.QUALITY_SWITCH_RULES.DROPPED_FRAMES_RULE:return Ni(e).create();case w.A.QUALITY_SWITCH_RULES.LEARN_TO_ADAPT_RULE:return Gi(e).create({dashMetrics:r,settings:i});case w.A.QUALITY_SWITCH_RULES.LOL_PLUS_RULE:return Zi(e).create({dashMetrics:r});case w.A.ABANDON_FRAGMENT_RULES.ABANDON_REQUEST_RULE:return ki(e).create({dashMetrics:r,mediaPlayerModel:n,settings:i})}}(t)),a):i.get().streaming.abr.rules[o].active?a:function(t,e){return t.filter((t=>t.getClassName()!==e))}(a,t)}function g(t){return t.filter((t=>t.representation!==Ai.NO_CHANGE))}function m(t){const e={};let n,a,r,i=null;if(0!==t.length){for(e[Ai.PRIORITY.STRONG]=null,e[Ai.PRIORITY.WEAK]=null,e[Ai.PRIORITY.DEFAULT]=null,n=0,a=t.length;n{e&&e.length&&e.forEach((e=>e.clearDataForStream&&"function"==typeof e.clearDataForStream&&e.clearDataForStream(t)))}))},getAbandonFragmentRules:function(){return u},getBestPossibleSwitchRequest:function(t){return t&&m(g(s.filter((e=>{const n=e.getClassName();if(n!==w.A.QUALITY_SWITCH_RULES.BOLA_RULE&&n!==w.A.QUALITY_SWITCH_RULES.THROUGHPUT_RULE)return!0;const a=t.getMediaType();return c[a]&&n===w.A.QUALITY_SWITCH_RULES.BOLA_RULE||!c[a]&&n===w.A.QUALITY_SWITCH_RULES.THROUGHPUT_RULE})).map((e=>e.getSwitchRequest(t)))))||Ai(e).create()},getBolaState:function(t){return c[t]},getMinSwitchRequest:m,getQualitySwitchRules:function(){return s},handleNewMediaInfo:function(t){s.forEach((e=>e.handleNewMediaInfo&&e.handleNewMediaInfo(t))),u.forEach((e=>e.handleNewMediaInfo&&e.handleNewMediaInfo(t)))},initialize:function(){s=[],u=[],c={},d(),o.on(R.A.SETTING_UPDATED_ABR_ACTIVE_RULES,h,l)},reset:function(){[s,u].forEach((t=>{t&&t.length&&t.forEach((t=>t.reset&&t.reset()))})),s=[],u=[],c={},o.off(R.A.SETTING_UPDATED_ABR_ACTIVE_RULES,h,l)},setBolaState:function(t,e){c[t]=e},shouldAbandonFragment:function(t){if(!t)return Ai(e).create();const n=m(g(u.map((e=>e.shouldAbandon(t)))));return n&&(n.reason.forceAbandon=!0),n||Ai(e).create()}},l}Ji.__dashjs_factory_name="ABRRulesCollection";const to=N.A.getClassFactory(Ji);N.A.updateSingletonFactory(Ji.__dashjs_factory_name,to);var eo=to;function no(t){let e;const n=(t=t||{}).abrController,a=t.throughputController,r=t.switchRequestHistory,i=t.droppedFramesHistory,o=t.currentRequest,l=t.streamProcessor?t.streamProcessor.getScheduleController():null,s=t.streamProcessor?t.streamProcessor.getRepresentation():null,u=t.videoModel?t.videoModel:null;function c(){return s?s.mediaInfo:null}return e={getAbrController:function(){return n},getCurrentRequest:function(){return o},getDroppedFramesHistory:function(){return i},getMediaInfo:c,getMediaType:function(){const t=c();return t?t.type:null},getRepresentation:function(){return s},getScheduleController:function(){return l},getStreamInfo:function(){const t=c();return t?t.streamInfo:null},getSwitchRequestHistory:function(){return r},getThroughputController:function(){return a},getVideoModel:function(){return u}},e}no.__dashjs_factory_name="RulesContext";var ao=N.A.getClassFactory(no);function ro(){let t={},e={};const n=this.context,a=(0,K.A)(n).getInstance();return{clearForStream:function(n){delete t[n],delete e[n]},getSwitchRequests:function(e,n){return null!=e&&null!=n&&t[e]&&t[e][n]?t[e][n]:{}},push:function(n){const r=n.currentRepresentation,i=n.newRepresentation;if(r.mediaInfo.streamInfo.id!==i.mediaInfo.streamInfo.id||i.mediaInfo.id!==r.mediaInfo.id)return;const o=r.mediaInfo.streamInfo.id;t[o]||function(n){t[n]={},e[n]={}}(o);const l=r.mediaInfo.type;t[o][l]||function(n,a){t[n][a]={},e[n][a]=[]}(o,l);const s=n.currentRepresentation.id;t[o][l][s]||function(e,n,a){t[e][n][a]={noDrops:0,drops:0,dropSize:0}}(o,l,s);let u=n.newRepresentation.absoluteIndex-n.currentRepresentation.absoluteIndex,c=u<0?1:0,d=c?-u:0,f=c?0:1;t[o][l][n.currentRepresentation.id].drops+=c,t[o][l][n.currentRepresentation.id].dropSize+=d,t[o][l][n.currentRepresentation.id].noDrops+=f,e[o][l].push({id:n.currentRepresentation.id,noDrop:f,drop:c,dropSize:d});const g=function(t,n){return e[t][n].length>a.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize?e[t][n].shift():null}(o,l);g&&function(e,n,a){t[e][n][a.id].drops-=a.drop,t[e][n][a.id].dropSize-=a.dropSize,t[e][n][a.id].noDrops-=a.noDrop}(o,l,g)},reset:function(){t={},e={}}}}ro.__dashjs_factory_name="SwitchRequestHistory";var io=N.A.getClassFactory(ro);function oo(){let t={},e={},n={};return{clearForStream:function(a){delete t[a],delete e[a],delete n[a]},getFrameHistory:function(e){return t[e]},push:function(a,r,i){if(!r)return;t[a]||function(a){t[a]=[],e[a]=0,n[a]=0}(a);let o=i&&i.droppedVideoFrames?i.droppedVideoFrames:0,l=i&&i.totalVideoFrames?i.totalVideoFrames:0,s=o-e[a];e[a]=o;let u=l-n[a];n[a]=l;const c=t[a];c[r]?(c[r].droppedVideoFrames+=s,c[r].totalVideoFrames+=u):c[r]={droppedVideoFrames:s,totalVideoFrames:u}},reset:function(){t={},e={},n={}}}}oo.__dashjs_factory_name="DroppedFramesHistory";var lo=N.A.getClassFactory(oo);function so(){const t=this.context,e=(0,C.A)(t).getInstance(),n=(0,k.A)(t).getInstance();let a,r,i,o,l,s,u,c,d,f,g,m,h,p,b,y,E,_,A,T,v;function S(){u={},s={},void 0===d&&(d=!1),_&&_.reset(),E&&E.reset(),y=void 0,_=void 0,E=void 0,clearTimeout(c),c=null}function N(t){let e=x(t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1]);return e=function(t){try{return function(t){try{if(!v.get().streaming.cmsd.enabled||!v.get().streaming.cmsd.abr.applyMb)return t;const e=t.filter((t=>{const e=t.mediaInfo.type;let n=p.getMaxBitrate(e);if(e!==w.A.VIDEO||n<0)return!0;const a=t.mediaInfo.streamInfo.id;return n-=s[a][w.A.AUDIO].getRepresentation().bitrateInKbit||0,t.bitrateInKbit<=n}));return e.length>0?e:t}catch(e){return r.error(e),t}}(t=function(t){try{if(!v.get().streaming.abr.limitBitrateByPortal)return t;const{elementWidth:e}=g.getVideoElementSize(),n=t.filter((t=>t.mediaInfo.type!==w.A.VIDEO||t.width<=e));return n.length>0?n:t}catch(e){return r.error(e),t}}(t=function(t){try{const e=t.filter((t=>{const e=t.mediaInfo.type,n=t.bitrateInKbit,a=m.getAbrBitrateParameter("maxBitrate",e),r=m.getAbrBitrateParameter("minBitrate",e);return!(a>-1&&n>a||r>-1&&n0?e:t}catch(e){return r.error(e),t}}(t)))}catch(e){return r.error(e),t}}(e),e}function x(t,e){let n=[];if(!t)return n;const a=function(t){try{const e=[];if(t&&e.push(t),!v.get().streaming.abr.enableSupplementalPropertyAdaptationSetSwitching||!t.adaptationSetSwitchingCompatibleIds||0===t.adaptationSetSwitchingCompatibleIds.length)return e;const n=s[t.streamInfo.id][t.type].getAllMediaInfos().filter((e=>t.adaptationSetSwitchingCompatibleIds.includes(e.id)));return e.concat(n)}catch(e){return[t]}}(t);return a.forEach((t=>{let e=f.getVoRepresentations(t);e&&e.length>0&&(n=n.concat(e))})),n=function(t){return t=function(t){let e=null;return t.filter((t=>(e||(e=t.mediaInfo),!isNaN(t.qualityRanking)&&f.areMediaInfosEqual(e,t.mediaInfo)))).length===t.length}(t)?function(t){return t.sort(((t,e)=>e.qualityRanking-t.qualityRanking)),t}(t):function(t){return t.sort(((t,e)=>f.areMediaInfosEqual(t.mediaInfo,e.mediaInfo)?isNaN(t.pixelsPerSecond)||isNaN(e.pixelsPerSecond)||t.pixelsPerSecond===e.pixelsPerSecond?t.bandwidth-e.bandwidth:t.pixelsPerSecond-e.pixelsPerSecond:isNaN(t.pixelsPerSecond)||isNaN(e.pixelsPerSecond)||t.pixelsPerSecond===e.pixelsPerSecond?isNaN(t.bitsPerPixel)||isNaN(e.bitsPerPixel)?t.bandwidth-e.bandwidth:e.bitsPerPixel-t.bitsPerPixel:t.pixelsPerSecond-e.pixelsPerSecond)),t}(t)}(n),n.forEach(((t,e)=>{t.absoluteIndex=e})),n=n.filter((n=>{const a=!!e||f.areMediaInfosEqual(n.mediaInfo,t),r=!n||!n.mediaInfo||l.areKeyIdsUsable(n.mediaInfo);return a&&r})),n}function M(e){const n=e.request.mediaType,r=e.streamId;if(!(n&&r&&s[r]&&v.get().streaming.abr.autoSwitchBitrate[n]))return;const l=s[r][n];if(!l)return;const d=ao(t).create({abrController:a,streamProcessor:l,currentRequest:e.request,throughputController:A,adapter:f,videoModel:g}),m=i.shouldAbandonFragment(d);m&&m.representation!==Ai.NO_CHANGE&&function(t,e,n,a,r){if(a.getFragmentModel().getRequests({state:q.FRAGMENT_MODEL_LOADING,index:t.request.index})[0]){const t=function(t,e){return u[t]&&u[t][e]?u[t][e]:null}(e,n);t&&(t.state=I.ABANDON_LOAD),E.reset(),L(n,o.getActiveStreamInfo(),r.representation,r.reason),clearTimeout(c),c=setTimeout((()=>{t&&(u[e][n].state=I.ALLOW_LOAD),c=null}),v.get().streaming.abandonLoadTimeout)}}(e,r,n,l,m)}function z(t){t.mediaType===w.A.VIDEO&&(void 0!==y&&_.push(t.streamId,y,g.getPlaybackQuality()),y=t.newRepresentation.id)}function O(t){!F()||t.metric!==I.BUFFER_LEVEL||t.mediaType!==w.A.AUDIO&&t.mediaType!==w.A.VIDEO||function(t,e){try{const n=m.getBufferTimeDefault(),a=n,o=.5*n,l=i.getBolaState(t),s=e>=(l?o:a);i.setBolaState(t,s),s!==l&&(s?r.info("["+t+"] switching from throughput to buffer occupancy ABR rule (buffer: "+e.toFixed(3)+")."):r.info("["+t+"] switching from buffer occupancy to throughput ABR rule (buffer: "+e.toFixed(3)+")."))}catch(t){r.error(t)}}(t.mediaType,.001*t.value.level)}function L(t,e,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!(e&&e.id&&t&&s&&s[e.id]&&s[e.id][t]&&n))return;const r=s[e.id][t].getRepresentation();r&&n.id===r.id||P(r,n,a)}function P(t,e,a){const i=e.mediaInfo.streamInfo.id,o=e.mediaInfo.type;if(o&&s[i]&&s[i][o]){const l=s[i][o].getStreamInfo(),u=T.getCurrentBufferLevel(o),c=null!==t&&!f.areMediaInfosEqual(t.mediaInfo,e.mediaInfo),d=t?t.bitrateInKbit:0;r.info(`[AbrController]: Switching quality in period ${i} for media type ${o}. Switch from bitrate ${d} to bitrate ${e.bitrateInKbit}. Current buffer level: ${u}. Reason:`+(a?JSON.stringify(a):"/")),n.trigger(R.A.QUALITY_CHANGE_REQUESTED,{oldRepresentation:t,newRepresentation:e,reason:a,streamInfo:l,mediaType:o,isAdaptationSetSwitch:c},{streamId:l.id,mediaType:o});const g=A.getAverageThroughput(o);isNaN(g)||b.setSavedBitrateSettings(o,g)}}function F(){return v.get().streaming.abr.rules.bolaRule.active&&v.get().streaming.abr.rules.throughputRule.active}return a={checkPlaybackQuality:function(e,n){try{if(!(e&&s&&s[n]&&s[n][e]))return!1;if(_){const t=g.getPlaybackQuality();t&&_.push(n,y,t)}if(!v.get().streaming.abr.autoSwitchBitrate[e])return!1;const r=s[n][e],o=r.getRepresentation(),l=ao(t).create({abrController:a,throughputController:A,switchRequestHistory:E,droppedFramesHistory:_,streamProcessor:r,adapter:f,videoModel:g}),c=i.getBestPossibleSwitchRequest(l);if(!c||!c.representation)return!1;let d=c.representation;return E.push({currentRepresentation:o,newRepresentation:d}),d.id!==o.id&&(u[n][e].state===I.ALLOW_LOAD||d.absoluteIndex0)return e;let n=NaN;if(b&&b.hasOwnProperty("getSavedBitrateSettings")&&(n=b.getSavedBitrateSettings(t)),!isNaN(n))return n;const a=A.getAverageThroughput(t);return!isNaN(a)&&a>0?a:t===w.A.VIDEO?1e3:100},getOptimalRepresentationForBitrate:function(t,e){const n=N(t,!(arguments.length>2&&void 0!==arguments[2])||arguments[2]);if(!n||0===n.length)return null;const a=n.reduce(((t,e)=>t.bandwidtht.bitrateInKbit<=e));return r&&0!==r.length?r.reduce(((t,e)=>e.absoluteIndex>t.absoluteIndex?e:t)):a},getPossibleVoRepresentations:function(t){return x(t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1])},getPossibleVoRepresentationsFilteredBySettings:N,getRepresentationByAbsoluteIndex:function(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return isNaN(t)||t<0?null:N(e,n).find((e=>e.absoluteIndex===t))},handleNewMediaInfo:function(t){i.handleNewMediaInfo(t)},initialize:function(){_=lo(t).create(),E=io(t).create(),i=eo(t).create({dashMetrics:T,customParametersModel:h,mediaPlayerModel:m,settings:v}),i.initialize(),n.on(D.A.QUALITY_CHANGE_RENDERED,z,a),n.on(D.A.METRIC_ADDED,O,a),n.on(R.A.LOADING_PROGRESS,M,a)},isPlayingAtLowestQuality:function(t){return N(t.mediaInfo,!0)[0].id===t.id},isPlayingAtTopQuality:function(t){if(!t)return!0;const e=N(t.mediaInfo,!0);return e[e.length-1].id===t.id},registerStreamType:function(t,e){const n=e.getStreamInfo().id;s[n]||(s[n]={}),s[n][t]=e,u[n]||(u[n]={}),u[n][t]={},u[n][t].state=I.ALLOW_LOAD,void 0===i.getBolaState(t)&&i.setBolaState(t,v.get().streaming.abr.rules.bolaRule.active&&!F())},reset:function(){S(),n.off(D.A.QUALITY_CHANGE_RENDERED,z,a),n.off(D.A.METRIC_ADDED,O,a),n.off(R.A.LOADING_PROGRESS,M,a),i&&i.reset()},setConfig:function(t){t&&(t.streamController&&(o=t.streamController),t.throughputController&&(A=t.throughputController),t.domStorage&&(b=t.domStorage),t.mediaPlayerModel&&(m=t.mediaPlayerModel),t.customParametersModel&&(h=t.customParametersModel),t.cmsdModel&&(p=t.cmsdModel),t.dashMetrics&&(T=t.dashMetrics),t.adapter&&(f=t.adapter),t.videoModel&&(g=t.videoModel),t.settings&&(v=t.settings),t.capabilities&&(l=t.capabilities))},setPlaybackQuality:L,setWindowResizeEventCalled:function(t){d=t},unRegisterStreamType:function(t,e){try{s[t]&&s[t][e]&&delete s[t][e],u[t]&&u[t][e]&&delete u[t][e]}catch(t){}}},r=e.getLogger(a),S(),a}so.__dashjs_factory_name="AbrController";const uo=N.A.getSingletonFactory(so);N.A.updateSingletonFactory(so.__dashjs_factory_name,uo);var co=uo;const fo=new Map([[w.A.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,"loadedmetadata"],[w.A.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA,"loadeddata"],[w.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,"canplay"],[w.A.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA,"canplaythrough"]]);function go(){let t,e,n,a,r,i,o,l,s,u,c;const d=this.context,f=(0,k.A)(d).getInstance(),g=[];function m(t){a&&(arguments.length>1&&void 0!==arguments[1]&&arguments[1]?a.playbackRate=t:I(w.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,(()=>{a.playbackRate=t})))}function h(){return g.length>0}function p(t){let e=g.indexOf(t);if(null!==t&&(-1!==e&&g.splice(e,1),n.get().streaming.buffer.syntheticStallEvents.enabled&&a&&!h())){const t=()=>{if(m(u||1,n.get().streaming.buffer.syntheticStallEvents.ignoreReadyState),!a.paused){const t=document.createEvent("Event");t.initEvent("playing",!0,!1),a.dispatchEvent(t)}};n.get().streaming.buffer.syntheticStallEvents.ignoreReadyState?t():(o&&o.func&&o.event&&E(o.event,o.func),o=I(w.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,t))}}function b(){if(a&&h()&&0===a.playbackRate){const t=document.createEvent("Event");t.initEvent("waiting",!0,!1),a.dispatchEvent(t)}}function y(t,e){a&&a.addEventListener(t,e)}function E(t,e){a&&a.removeEventListener(t,e)}function _(){return a?a.readyState:NaN}function A(){return a?a.buffered:null}function T(){return a?a.clientWidth:NaN}function v(){return a?a.clientHeight:NaN}function S(t,e,n,r,i){if(a)for(let o=0;o=t?(e(),null):function(t,e){const n=()=>{E(t,n),e(t)};return y(t,n),{func:n,event:t}}(fo.get(t),e)}return t={addEventListener:y,addTextTrack:function(t,e,n,r,i){if(!a)return null;let o=S(t,e,n,r,i);return o||(o=a.addTextTrack(t,e,n),o.isEmbedded=i,o.isTTML=r),o},appendChild:function(t){a&&(a.appendChild(t),void 0!==t.isTTML&&(a.textTracks[a.textTracks.length-1].isTTML=t.isTTML,a.textTracks[a.textTracks.length-1].isEmbedded=t.isEmbedded))},getBufferRange:A,getClientHeight:v,getClientWidth:T,getElement:function(){return a},getEnded:function(){return a?a.ended:null},getPlaybackQuality:function(){if(!a)return null;let t="webkitDroppedFrameCount"in a&&"webkitDecodedFrameCount"in a,e=null;return"getVideoPlaybackQuality"in a?e=a.getVideoPlaybackQuality():t&&(e={droppedVideoFrames:a.webkitDroppedFrameCount,totalVideoFrames:a.webkitDroppedFrameCount+a.webkitDecodedFrameCount,creationTime:new Date}),e},getPlaybackRate:function(){return a?a.playbackRate:null},getPlayedRanges:function(){return a?a.played:null},getReadyState:_,getSource:function(){return a?a.src:null},getTTMLRenderingDiv:function(){return l},getTextTrack:S,getTextTracks:function(){return a?a.textTracks:[]},getTime:function(){return a?isNaN(r)?a.currentTime:r:null},getVideoElementSize:function(){const t=n.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;return{elementWidth:T()*t,elementHeight:v()*t}},getVideoHeight:function(){return a?a.videoHeight:NaN},getVideoRelativeOffsetLeft:function(){if(a){const t=a.parentNode.host||a.parentNode;return t?a.getBoundingClientRect().left-t.getBoundingClientRect().left:NaN}return NaN},getVideoRelativeOffsetTop:function(){if(a){const t=a.parentNode.host||a.parentNode;return t?a.getBoundingClientRect().top-t.getBoundingClientRect().top:NaN}return NaN},getVideoWidth:function(){return a?a.videoWidth:NaN},getVttRenderingDiv:function(){return s},initialize:function(){f.on(R.A.PLAYBACK_PLAYING,b,this)},isPaused:function(){return a?a.paused:null},isSeeking:function(){return a?a.seeking||!isNaN(r):null},isStalled:h,pause:function(){a&&(a.pause(),a.autoplay=!1)},play:function(){if(a){a.autoplay=!0;const t=a.play();t&&t.catch&&"undefined"!=typeof Promise&&t.catch((t=>{"NotAllowedError"===t.name&&f.trigger(R.A.PLAYBACK_NOT_ALLOWED),e.warn(`Caught pending play exception - continuing (${t})`)}))}},removeChild:function(t){a&&a.removeChild(t)},removeEventListener:E,reset:function(){clearTimeout(c),f.off(R.A.PLAYBACK_PLAYING,b,this),g.length=0},setConfig:function(t){t&&t.settings&&(n=t.settings)},setCurrentTime:function(t,e){a&&(i&&i.func&&i.event&&E(i.event,i.func),r=t,i=I(w.A.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,(()=>{if(a)if(a.currentTime!==r)try{r=e?function(t){const e=A();let n=t,a=9999999999;if(e)for(let r=0;r=i&&t<=o)return t;l=w.A.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA))){u=a.playbackRate,m(0,!0);const t=document.createEvent("Event");t.initEvent("waiting",!0,!1),a.dispatchEvent(t)}}(t):p(t)}(t,e)},setTTMLRenderingDiv:function(t){l=t,l.style.position="absolute",l.style.display="flex",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.top=0,l.style.left=0},setVttRenderingDiv:function(t){s=t},waitForReadyState:I},e=(0,C.A)(d).getInstance().getLogger(t),n=(0,K.A)(d).getInstance(),r=NaN,t}go.__dashjs_factory_name="VideoModel";var mo=N.A.getSingletonFactory(go);const ho=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}],po="dashjs_?_bitrate",bo="dashjs_?_settings",yo="localStorage",Eo="lastBitrate",_o="lastMediaSettings";function Ao(t){t=t||{};const e=this.context,n=t.settings;let a,r,i;function o(t){if(void 0!==i)return i;let e;i=!1;try{"undefined"!=typeof window&&(e=window[t])}catch(t){return r.warn("DOMStorage access denied: "+t.message),i}if(!e||t!==yo&&"sessionStorage"!==t)return i;try{e.setItem("1","1"),e.removeItem("1"),i=!0}catch(t){r.warn("DOMStorage is supported, but cannot be used: "+t.message)}return i}function l(){const t=6e5;return Math.round((new Date).getTime()/t)*t}function s(t,e){return o(t)&&n.get().streaming[e+"CachingInfo"].enabled}function u(){if(!n)throw new Error(w.A.MISSING_CONFIG_ERROR)}return a={getSavedBitrateSettings:function(t){if(u(),!n.get().streaming.lastBitrateCachingInfo.enabled)return NaN;let e=NaN;if(s(yo,Eo)){const a=po.replace(/\?/,t);try{const i=JSON.parse(localStorage.getItem(a))||{},o=(new Date).getTime()-parseInt(i.timestamp,10)>=n.get().streaming.lastBitrateCachingInfo.ttl||!1,l=parseFloat(i.bitrate);isNaN(l)||o?o&&localStorage.removeItem(a):(e=l,r.debug("Last saved bitrate for "+t+" was "+l))}catch(t){return null}}return e},setSavedBitrateSettings:function(t,e){if(s(yo,Eo)&&e){const n=po.replace(/\?/,t);try{localStorage.setItem(n,JSON.stringify({bitrate:e.toFixed(3),timestamp:l()}))}catch(t){r.error(t.message)}}},getSavedMediaSettings:function(t){if(u(),!n.get().streaming.lastMediaSettingsCachingInfo.enabled)return null;let e=null;if(s(yo,_o)){const a=bo.replace(/\?/,t);try{const t=JSON.parse(localStorage.getItem(a))||{},r=(new Date).getTime()-parseInt(t.timestamp,10)>=n.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;e=t.settings,r&&(localStorage.removeItem(a),e=null)}catch(t){return null}}return e},setSavedMediaSettings:function(t,e){if(s(yo,_o)){const n=bo.replace(/\?/,t);try{localStorage.setItem(n,JSON.stringify({settings:e,timestamp:l()}))}catch(t){r.error(t.message)}}}},r=(0,C.A)(e).getInstance().getLogger(a),o(yo)&&ho.forEach((t=>{const e=localStorage.getItem(t.oldKey);if(e){localStorage.removeItem(t.oldKey);try{localStorage.setItem(t.newKey,e)}catch(t){r.error(t.message)}}})),a}Ao.__dashjs_factory_name="DOMStorage";var To=N.A.getSingletonFactory(Ao),vo=n(8986);function wo(){const t=this.context;let e,n,a,r,i,o,l,s,u,c,d,f;function g(t,e,a,i){let o=null;const s=t?f.resolve(t.path):null,u=i||{init:!0,url:s?s.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:e,representation:t};n.debug("Start searching for initialization.");const c=p(u);l.load({request:c,success:function(n){if(u.bytesLoaded=u.range.end,o=r.findInitRange(n),!o)return u.range.end=u.bytesLoaded+u.bytesToLoad,g(t,e,a,u);t.range=o,a(t)},error:function(){a(t)}}),n.debug("Perform init search: "+u.url)}function m(t,e,a,i,o,s){if(a&&(void 0===a.start||void 0===a.end)){const t=a?a.toString().split("-"):null;a=t?{start:parseFloat(t[0]),end:parseFloat(t[1])}:null}o=o||h;let u=null,c=null;const d=!!a,g=t?f.resolve(t.path):null,b={init:!1,url:g?g.url:void 0,range:d?a:{start:0,end:1500},searching:!d,bytesLoaded:s?s.bytesLoaded:0,bytesToLoad:1500,mediaType:e,representation:t},y=p(b);l.load({request:y,success:function(a){const l=b.bytesToLoad,s=a.byteLength;if(b.bytesLoaded=b.range.end-b.range.start,u=r.parse(a),c=u.getBox("sidx"),c&&c.isComplete){const a=c.references;let r,l;if(null!=a&&a.length>0&&(r=1===a[0].reference_type),r){let r,l,s,u,d;n.debug("Initiate multiple SIDX load."),b.range.end=b.range.start+c.size;let f=[],g=0,h=(c.offset||b.range.start)+c.size;const p=function(e){e?(f=f.concat(e),g++,g>=l&&(f.sort((function(t,e){return t.startTime-e.startTime<0?-1:0})),o(f,t,i))):o(null,t,i)};for(r=0,l=a.length;r{g(t,e,n)}))},loadSegments:function(t,e,n){return new Promise((a=>{m(t,e,n,a)}))},reset:function(){l&&(l.abort(),l=null)}},e}wo.__dashjs_factory_name="SegmentBaseLoader";var So=N.A.getSingletonFactory(wo);function Io(t){let e;t=t||{};let n=new DataView(t.data),a=0;function r(t,e){let r,i,o=!0,l=0;if(void 0===e&&(e=!1),t.tag>16777215?(n.getUint32(a)!==t.tag&&(o=!1),l=4):t.tag>65535?(r=n.getUint16(a),i=n.getUint8(a+2),256*r+i!==t.tag&&(o=!1),l=3):t.tag>255?(n.getUint16(a)!==t.tag&&(o=!1),l=2):(n.getUint8(a)!==t.tag&&(o=!1),l=1),!o&&t.required&&!e)throw new Error("required tag not found");return o&&(a+=l),o}function i(t){let e=1,r=128,i=-1,o=0,l=n.getUint8(a),s=0;for(s=0;s<8;s+=1){if((l&r)===r){o=void 0===t?l&~r:l,i=s;break}r>>=1}for(s=0;s4)return function(t){const e=Math.floor(Number.MAX_SAFE_INTEGER/256);let r=0;for(let i=0;ie)throw new Error("Value exceeds safe integer limit");r*=256;const t=n.getUint8(a+i);if(r>Number.MAX_SAFE_INTEGER-t)throw new Error("Value exceeds safe integer limit");r+=t}return a+=t,r}(t);let e=0;for(let r=0;r>>0},moreData:function(){return a{let r=null,i=t?u.resolve(t.path):null,o=t?t.range.split("-"):null,s={range:{start:o?parseFloat(o[0]):null,end:o?parseFloat(o[1]):null},request:r,url:i?i.url:void 0,init:!0,mediaType:e};n.info("Start loading initialization."),r=c(s),l.load({request:r,success:function(){a(t)},error:function(){a(t)}}),n.debug("Perform init load: "+s.url)}))},loadSegments:function(e,r,i){return new Promise((o=>{let d=null,f=e?u.resolve(e.path):null,g=f?f.url:void 0;d=c({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:d,url:g,init:!1,mediaType:r,representation:e}),n.debug("Parsing ebml header"),l.load({request:d,success:function(r){!function(e,r,i,o){if(!e||0===e.byteLength)return void o(null);let s,u,d,f,g=ko(t).create({data:e}),m=i?i.split("-"):null,h=null,p={url:r,range:{start:m?parseFloat(m[0]):null,end:m?parseFloat(m[1]):null},request:h};for(n.debug("Parse EBML header: "+p.url),g.skipOverElement(a.EBML),g.consumeTag(a.Segment),d=g.getMatroskaCodedNum(),d+=g.getPos(),f=g.getPos();g.moreData()&&!g.consumeTagAndSize(a.Segment.Info,!0);)if(!(g.skipOverElement(a.Segment.SeekHead,!0)||g.skipOverElement(a.Segment.Tracks,!0)||g.skipOverElement(a.Segment.Cues,!0)||g.skipOverElement(a.Void,!0)))throw new Error("no valid top level element found");for(;void 0===s;){let t=g.getMatroskaCodedNum(!0),e=g.getMatroskaCodedNum();t===a.Segment.Info.Duration.tag?s=g[a.Segment.Info.Duration.parse](e):g.setPos(g.getPos()+e)}h=c(p),l.load({request:h,success:function(e){u=function(e,r,i,o){let l,s,u,c,d,f,g,m;for(s=function(e){let n,r,i=[],o=ko(t).create({data:e});for(o.consumeTagAndSize(a.Segment.Cues);o.moreData()&&o.consumeTagAndSize(a.Segment.Cues.CuePoint,!0);){for(n={},n.CueTime=o.parseTag(a.Segment.Cues.CuePoint.CueTime),n.CueTracks=[];o.moreData()&&o.consumeTag(a.Segment.Cues.CuePoint.CueTrackPositions,!0);){const t=o.getMatroskaCodedNum(),e=o.getPos();if(r={},r.Track=o.parseTag(a.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),0===r.Track)throw new Error("Cue track cannot be 0");r.ClusterPosition=o.parseTag(a.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),n.CueTracks.push(r),o.setPos(e+t)}if(0===n.CueTracks.length)throw new Error("Mandatory cuetrack not found");i.push(n)}if(0===i.length)throw new Error("mandatory cuepoint not found");return i}(e),u=[],d=0,f=s.length;d0!==t.length)).map((t=>{let e={name:t},n=t.indexOf("[");if(-1!=n){e.name=t.substring(0,n);let a=t.substring(n+1,t.length-1);this.valid=this.valid&&-1==a.indexOf("[");let r=a.indexOf("=");-1!=r?(e.attribute={name:a.substring(1,r),value:a.substring(r+1)},-1!=["'",'"'].indexOf(e.attribute.value[0])&&(e.attribute.value=e.attribute.value.substring(1,e.attribute.value.length-1))):e.position=parseInt(a,10)-1}return e}))}isValid(){return this.valid}findsElement(){return!this.findsAttribute()}findsAttribute(){return this.path[this.path.length-1].name.startsWith("@")}findsTextReplace(){return"text()"===this.path[this.path.length-1].name}getMpdTarget(t,e){let n=null,a=t,r=1,i="MPD";for(;rt[n.name]==n.value))[0]||null}else a=Array.isArray(e)?e[0]:e}r++}return null===a?null:i.startsWith("@")?{name:i.substring(1),leaf:a,target:a}:"text()"===i?{name:"__text",leaf:a,target:a}:{name:i,leaf:a,target:e?n:a}}},Lo=class{constructor(t,e,n){this.action=t,this.xpath=e,this.value=n,this.position=null}getMpdTarget(t){let e="remove"===this.action||"replace"===this.action||"before"===this.position||"after"===this.position;return this.xpath.getMpdTarget(t,e)}};function Po(){let t,e;const n=this.context;return t={getIsPatch:function(t){return t&&t.hasOwnProperty(S.A.ORIGINAL_MPD_ID)||!1},getMpdId:function(t){return t&&t[S.A.ORIGINAL_MPD_ID]||null},getOriginalPublishTime:function(t){return t&&t.hasOwnProperty(S.A.ORIGINAL_PUBLISH_TIME)?new Date(t[S.A.ORIGINAL_PUBLISH_TIME]):null},getPatchOperations:function(t){return t?(t.__children||[]).map((t=>{const n=t.tagName;if("add"!==n&&"remove"!==n&&"replace"!==n)return e.warn(`Ignoring node of invalid action: ${n}`),null;let a=t.sel;if("add"===n&&t.type){if(!t.type.startsWith("@"))return e.warn(`Ignoring add action for prefixed namespace declaration: ${t.type}=${t.__text}`),null;a=`${a}/${t.type}`}let r=new Oo(a);if(!r.isValid())return e.warn(`Ignoring action with invalid selector: ${n} - ${a}`),null;let i=null;r.findsAttribute()||r.findsTextReplace()?i=t.__text||"":"remove"!==n&&(i=t.__children.reduce(((t,e)=>{let n=e.tagName;return"#text"!==n&&(t[n]=t[n]||[],t[n].push(e)),t}),{}));let o=new Lo(n,r,i);return"add"===n&&(o.position=t.pos),o})).filter((t=>!!t)):[]},getPublishTime:function(t){return t&&t.hasOwnProperty(S.A.PUBLISH_TIME)?new Date(t[S.A.PUBLISH_TIME]):null}},e=(0,C.A)(n).getInstance().getLogger(t),t}Po.__dashjs_factory_name="PatchManifestModel";var Fo=N.A.getSingletonFactory(Po);function Uo(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("undefined"!=typeof TextDecoder){const n=new TextDecoder("utf-8").decode(t);if(e){const t=n.indexOf("\0");return-1!==t?n.substring(0,t):n}return n.replace(/\0/g,"")}const n=t.length;let a,r,i,o="",l=0;for(;l>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(a);break;case 12:case 13:r=t[l++],o+=String.fromCharCode((31&a)<<6|63&r);break;case 14:r=t[l++],i=t[l++],o+=String.fromCharCode((15&a)<<12|(63&r)<<6|63&i)}}return o}function jo(t){return function(t,e,n,a){const r=(i=t)instanceof ArrayBuffer?i:i.buffer;var i;let o=1;"BYTES_PER_ELEMENT"in a&&(o=a.BYTES_PER_ELEMENT);const l=(d=t)&&d.buffer instanceof ArrayBuffer&&void 0!==d.byteLength&&void 0!==d.byteOffset?t.byteOffset:0,s=(l+t.byteLength)/o,u=(l+e)/o,c=Math.floor(Math.max(0,Math.min(u,s)));var d;return new a(r,c,Math.floor(Math.min(c+Math.max(n,0),s))-c)}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,Uint8Array)}function Bo(t){return"PRIV"===t.type?function(t){if(t.size<2)return;const e=Uo(t.data,!0),n=new Uint8Array(t.data.subarray(e.length+1));return{key:t.type,info:e,data:n.buffer}}(t):"W"===t.type[0]?function(t){if("WXXX"===t.type){if(t.size<2)return;let e=1;const n=Uo(t.data.subarray(e),!0);e+=n.length+1;const a=Uo(t.data.subarray(e));return{key:t.type,info:n,data:a}}const e=Uo(t.data);return{key:t.type,info:"",data:e}}(t):"APIC"===t.type?function(t){const e={key:t.type,description:"",data:"",mimeType:null,pictureType:null};if(t.size<2)return;if(3!==t.data[0])return void console.log("Ignore frame with unrecognized character encoding");const n=t.data.subarray(1).indexOf(0);if(-1===n)return;const a=Uo(jo(t.data,1,n)),r=t.data[2+n],i=t.data.subarray(3+n).indexOf(0);if(-1===i)return;const o=Uo(jo(t.data,3+n,i));let l;return l="--\x3e"===a?Uo(jo(t.data,4+n+i)):(s=t.data.subarray(4+n+i))instanceof ArrayBuffer?s:0==s.byteOffset&&s.byteLength==s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer,e.mimeType=a,e.pictureType=r,e.description=o,e.data=l,e;var s}(t):function(t){if(t.size<2)return;if("TXXX"===t.type){let e=1;const n=Uo(t.data.subarray(e),!0);e+=n.length+1;const a=Uo(t.data.subarray(e));return{key:t.type,info:n,data:a}}const e=Uo(t.data.subarray(1));return{key:t.type,info:"",data:e}}(t)}function qo(t,e){let n=0;return n=(127&t[e])<<21,n|=(127&t[e+1])<<14,n|=(127&t[e+2])<<7,n|=127&t[e+3],n}function Go(t){const e=String.fromCharCode(t[0],t[1],t[2],t[3]),n=qo(t,4);return{type:e,size:n,data:t.subarray(10,10+n)}}function Ho(t,e){return e+10<=t.length&&51===t[e]&&68===t[e+1]&&73===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128}function Yo(t,e){return e+10<=t.length&&73===t[e]&&68===t[e+1]&&51===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128}function Vo(){let t,e,n,a,r,i;const o=this.context;function l(t,n){const r=n?n.index:0,i=e.getAdaptationsForType(a[r].mpd.manifest,r,t);if(!i||0===i.length)return null;if(i.length>1&&n)for(let t=0,n=i.length;t0?a[0].mpd.manifest:null)}function g(t){try{const n=m(t.streamInfo,a),r=e.getAdaptationsForPeriod(n);return t&&t.streamInfo&&void 0!==t.streamInfo.id&&r?r[t.index]:null}catch(t){return null}}function m(t,e){const n=e.length;for(let a=0;a=0&&void 0!==i)return!0}))[0]&&(n.embeddedCaptions=!0),n.audioChannelConfiguration=e.getAudioChannelConfigurationForAdaptation(a),0===n.audioChannelConfiguration.length&&a.Representation&&a.Representation.length>0&&(n.audioChannelConfiguration=e.getAudioChannelConfigurationForRepresentation(a.Representation[0])),n.roles=e.getRolesForAdaptation(a),n.codec=e.getCodec(a),n.mimeType=e.getMimeType(a),n.contentProtection=e.getContentProtectionByAdaptation(a),n.bitrateList=e.getBitrateListForAdaptation(a),n.selectionPriority=e.getSelectionPriority(a),n.contentProtection&&n.contentProtection.length>0&&(n.contentProtection=function(t,n){if(!t||!t.length||!n)return t;const a=e.getContentProtectionByManifest(n);if(!a||!a.length)return t;const r=a.reduce(((t,e)=>(e.refId&&t.set(e.refId,e),t)),new Map);return t.map((t=>{if(t.ref){const e=r.get(t.ref);e&&t.mergeAttributesFromReference(e)}return t}))}(n.contentProtection,t.period.mpd.manifest),n.contentProtection=function(t){const e=t.map((t=>t.cencDefaultKid)).filter((t=>null!==t));if(e.length){const n=e[0];t.forEach((t=>{t.keyId=n}))}return t}(n.contentProtection),n.normalizedKeyIds=function(t){const e=new Set;return t.forEach((t=>{t.cencDefaultKid&&"string"==typeof t.cencDefaultKid&&e.add(t.cencDefaultKid.replace(/-/g,"").toLowerCase())})),e}(n.contentProtection)),n.isText=e.getIsText(a),n.essentialProperties=e.getCombinedEssentialPropertiesForAdaptationSet(a),n.supplementalProperties=e.getCombinedSupplementalPropertiesForAdaptationSet(a),n.isFragmented=e.getIsFragmented(a),n.isEmbedded=!1,n.adaptationSetSwitchingCompatibleIds=function(t){if(!t||!t.supplementalProperties)return[];let e=[];const n=t.supplementalProperties.filter((t=>t.schemeIdUri===S.A.ADAPTATION_SET_SWITCHING_SCHEME_ID_URI));return n&&n.length>0&&(e=n[0].value.toString().split(",").map((t=>t))),e}(n),n}function p(t,e,n){t.id=e,t.index=100+parseInt(e.substring(2,3)),t.type=r.TEXT,t.codec="cea-608-in-SEI",t.isEmbedded=!0,t.isFragmented=!1,t.lang=rr(n),t.roles=[{schemeIdUri:"urn:mpeg:dash:role:2011",value:"caption"}]}function b(t){let n=new Mo;return n.id=t.id,n.index=t.index,n.start=t.start,n.duration=t.duration,n.manifestInfo=function(t){let n=new zo;return n.dvrWindowSize=t.timeShiftBufferDepth,n.loadedTime=t.manifest.loadedTime,n.availableFrom=t.availabilityStartTime,n.minBufferTime=t.manifest.minBufferTime,n.maxFragmentDuration=t.maxSegmentDuration,n.duration=e.getDuration(t.manifest),n.isDynamic=e.getIsDynamic(t.manifest),n.serviceDescriptions=e.getServiceDescriptions(t.manifest),n.protocol=t.manifest.protocol,n}(t.mpd),n.isLast=1===t.mpd.manifest.Period.length||Math.abs(n.start+n.duration-n.manifestInfo.duration)<1,n.isEncrypted=t.isEncrypted,n}function y(){if(!r)throw new Error("setConfig function has to be called previously")}function E(t){return a.length>0?a[0].mpd.manifest.Period[t]:null}function _(t,e,n){let a,r,i,o,l,s;if(t)for(r=t.AdaptationSet,l=0;l{let n=e.getMpdTarget(t);if(null===n)return;let{name:a,target:r,leaf:i}=n;if(e.xpath.findsAttribute()||"__text"===a){switch(e.action){case"add":case"replace":r[a]=e.value;break;case"remove":delete r[a]}return}let o=(r[a]||[]).indexOf(i),l="prepend"===e.position||"before"===e.position;if("remove"===e.action||"replace"===e.action)if(Array.isArray(r[a])){if(-1!=o){let t=r[a];t.splice(o,1),t.length>0?r[a]=t:delete r[a]}}else delete r[a];"add"!==e.action&&"replace"!==e.action||Object.keys(e.value).forEach((t=>{let n=e.value[t],i=r[t]||[];if(0===i.length&&r[t]&&i.push(r[t]),0===i.length)i=n;else{let r=i.length;r=t==a&&-1!=o?o+(l?0:1)+("replace"===e.action?-1:0):l?0:i.length,i.splice.apply(i,[r,0].concat(n))}r[t]=i}))}))},areMediaInfosEqual:function(t,e){if(!t||!e)return!1;const n=t.id===e.id,a=t.codec===e.codec,r=JSON.stringify(t.viewpoint)===JSON.stringify(e.viewpoint),i=t.lang===e.lang,o=JSON.stringify(t.roles)===JSON.stringify(e.roles),l=JSON.stringify(t.accessibility)===JSON.stringify(e.accessibility),s=JSON.stringify(t.audioChannelConfiguration)===JSON.stringify(e.audioChannelConfiguration);return n&&a&&r&&i&&o&&l&&s},getAllMediaInfoForType:function(t,n,i){let o=a,l=i,c=[];if(l)y(),o=u(l);else{if(!(a.length>0))return c;l=a[0].mpd.manifest}const d=m(t,o);let f=e.getAdaptationsForType(l,t?t.index:null,n);return c=s(l,d,t,f,n),n===r.TEXT&&(f=e.getAdaptationsForType(l,t?t.index:null,r.VIDEO),c=c.concat(s(l,d,t,f,n,!0))),c},getAvailabilityStartTime:function(t){const n=c(t);return e.getAvailabilityStartTime(n)},getBandwidthForRepresentation:function(t,e){let n;return n=_(E(e),t),n?n.bandwidth:null},getBaseURLsFromElement:function(t){return e.getBaseURLsFromElement(t)},getCodec:function(t,n,a){return e.getCodec(t,n,a)},getContentSteering:function(t){return e.getContentSteering(t)},getDuration:function(t){const n=f(t);return e.getDuration(n)},getEssentialPropertiesForAdaptationSet:function(t){try{return e.getEssentialPropertiesForRepresentation(t)}catch(t){return[]}},getEssentialPropertiesForRepresentation:function(t){try{return e.getEssentialPropertiesForRepresentation(t)}catch(t){return[]}},getEvent:function(t,e,n,a){try{if(!t||!e||isNaN(n)||!a)return null;const r=t.scheme_id_uri,i=t.value;if(!e[r+"/"+i])return null;const o=new ae,l=t.timescale||1,s=a.adaptation.period.start,u=e[r+"/"+i],c=isNaN(a.presentationTimeOffset)?isNaN(u.presentationTimeOffset)?0:u.presentationTimeOffset:a.presentationTimeOffset;let d,f=t.presentation_time_delta/l;d=0===t.version?s+n-c+f:s-c+f;const g=t.event_duration/l,m=t.id,h=t.message_data;return o.eventStream=u,o.eventStream.value=i,o.eventStream.timescale=l,o.duration=g,o.id=m,o.calculatedPresentationTime=d,o.messageData=h,o.presentationTimeDelta=f,o.parsedMessageData=r===w.A.ID3_SCHEME_ID_URI?function(t){let e=0;const n=[];for(;Yo(t,e);){const a=qo(t,e+6);t[e+5]>>6&1&&(e+=10),e+=10;const r=e+a;for(;e+100){const o=a[0].mpd.manifest;if(t instanceof Mo){const n=m(t,a);i=e.getEventsForPeriod(n)}else if(t instanceof xo){const n=m(r,a);i=e.getEventStreamForAdaptationSet(o,g(t),n)}else if(t instanceof fe){const t=m(r,a);i=e.getEventStreamForRepresentation(o,n,t)}}return i},getFramerate:function(t){return e.getFramerate(t)},getIndexForRepresentation:function(t,e){return function(t,e){const n=_(t,e,!0);return null!==n?n:-1}(E(e),t)},getIsDVB:function(t){return e.hasProfile(t,"urn:dvb:dash:profile:dvb-dash:2014")},getIsDynamic:function(t){const n=f(t);return e.getIsDynamic(n)},getIsPatch:function(t){return n.getIsPatch(t)},getIsTextTrack:function(t){return e.getIsText(t)},getIsTypeOf:function(t,n){return e.getIsTypeOf(t,n)},getLocation:function(t){return e.getLocation(t)},getMainAdaptationForType:l,getManifestUpdatePeriod:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.getManifestUpdatePeriod(t,n)},getMediaInfoForType:function(t,n){if(0===a.length||!t)return null;let r=m(t,a);if(!r)return null;const i=e.getAdaptationsForPeriod(r);let o=l(n,t);return o?h(i[e.getIndexForAdaptation(o,a[0].mpd.manifest,t.index)]):null},getMpd:c,getPatchLocation:function(t){const n=e.getPatchLocation(t),a=e.getPublishTime(t);return n&&0!==n.length&&a?n.filter((t=>isNaN(t.ttl)||a.getTime()+t.ttl>(new Date).getTime())):[]},getPeriodById:function(t){if(!t||0===a.length)return null;const e=a.filter((e=>e.id===t));return e&&e.length>0?e[0]:null},getProducerReferenceTimes:function(t,n){let r,i;const o=m(t,a);return r=n?n.id:null,a.length>0&&o&&(i=r?e.getAdaptationForId(r,a[0].mpd.manifest,o.index):e.getAdaptationForIndex(n?n.index:null,a[0].mpd.manifest,o.index)),i?e.getProducerReferenceTimesForAdaptation(i):[]},getPublishTime:function(t){return e.getPublishTime(t)},getRealAdaptation:function(t,n){let r,i;const o=m(t,a);return r=n?n.id:null,a.length>0&&o&&(i=r?e.getAdaptationForId(r,a[0].mpd.manifest,o.index):e.getAdaptationForIndex(n?n.index:null,a[0].mpd.manifest,o.index)),i},getRealPeriodByIndex:function(t){return e.getRealPeriodForIndex(t,a[0].mpd.manifest)},getRegularPeriods:u,getRepresentationSortFunction:function(){return e.getRepresentationSortFunction()},getStreamsInfo:function(t,e){const n=[];let r=a;if(t&&(y(),r=u(t)),r.length>0){(!e||e>r.length)&&(e=r.length);for(let t=0;t0?a[0].mpd:null;return e.getSuggestedPresentationDelay(t)},getSupplementalCodecs:function(t){const e=t[S.A.SUPPLEMENTAL_CODECS];return e?e.split(" ").map((e=>t.mimeType+';codecs="'+e+'"')):[]},getUTCTimingSources:function(){const t=f();return e.getUTCTimingSources(t)},getVoRepresentations:function(t){let n;const a=g(t);return n=e.getRepresentationsForAdaptation(a,t),n},isPatchValid:function(t,a){let r=e.getId(t),i=n.getMpdId(a),o=e.getPublishTime(t),l=n.getPublishTime(a),s=n.getOriginalPublishTime(a);return!!(r&&i&&r==i&&o&&s&&o.getTime()==s.getTime()&&l&&o.getTime()e.get().streaming.metrics.maxListDepth&&r[n].shift())}function f(t,e,n){d(t,e,n),u(t,e,n)}return n={addBufferLevel:function(t,e,n){let a=new Qo;a.t=e,a.level=n,f(t,I.BUFFER_LEVEL,a)},addBufferState:function(t,e,n){let a=new Zo;a.target=n,a.state=e,f(t,I.BUFFER_STATE,a)},addDVBErrors:function(t){f(w.A.STREAM,I.DVB_ERRORS,t)},addDVRInfo:function(t,e,n,a){let r=new Jo;r.time=e,r.range=a,r.manifestInfo=n,f(t,I.DVR_INFO,r)},addDroppedFrames:function(t,e){let n=new tl,a=c(t).DroppedFrames;e&&(n.time=e.creationTime,n.droppedFrames=e.droppedVideoFrames,a.length>0&&a[a.length-1]==n||f(t,I.DROPPED_FRAMES,n))},addHttpRequest:function t(e,n,a,r){let i=new z.G;n.url&&n.url!==e.url&&(t({mediaType:e.mediaType,type:e.type,url:e.url,serviceLocation:null,range:e.range,startDate:e.startDate,firstByteDate:null,endDate:null,duration:e.duration,fileLoaderType:e.fileLoaderType,resourceTimingValues:e.resourceTimingValues},{url:null,status:null,headers:null},null,r),i.actualurl=n.url),i.tcpid=null,i.type=e.type,i.url=e.url,i.range=e.range||null,i.trequest=e.startDate,i.tresponse=e.firstByteDate,i.responsecode=n.status,i.cmsd=r,i._tfinish=e.endDate,i._stream=e.mediaType,i._mediaduration=e.duration,i._responseHeaders="";for(const t in n.headers)i._responseHeaders+=t+": "+n.headers[t]+"\r\n";i._serviceLocation=e.serviceLocation||null,i._fileLoaderType=e.fileLoaderType,i._resourceTimingValues=e.resourceTimingValues,i._streamId=e&&e.representation&&e.representation.mediaInfo&&e.representation.mediaInfo.streamInfo?e.representation.mediaInfo.streamInfo.id:null,a?a.forEach((t=>{!function(t,e,n,a){let r=new z.N;r.s=e,r.d=n,r.b=a,t.trace.push(r),t.interval||(t.interval=0),t.interval+=n}(i,t.s,t.d,t.b,t.t)})):(delete i.interval,delete i.trace),f(e.mediaType,I.HTTP_REQUEST,i)},addManifestUpdate:function(t,e,n,a){let r=new el;r.mediaType=t,r.type=e,r.requestTime=n,r.fetchTime=a,d(w.A.STREAM,I.MANIFEST_UPDATE,r),u(t,I.MANIFEST_UPDATE,r)},addManifestUpdateRepresentationInfo:function(t,e,n){if(t&&t.representationInfo){const a=new al;a.id=e?e.id:null,a.index=e?e.index:null,a.mediaType=n,a.startNumber=e?e.startNumber:null,a.presentationTimeOffset=e?e.presentationTimeOffset:null,t.representationInfo.push(a),s(t.mediaType,I.MANIFEST_UPDATE_TRACK_INFO,t)}},addManifestUpdateStreamInfo:function(t,e,n,a,r){if(t){let i=new nl;i.id=e,i.index=n,i.start=a,i.duration=r,t.streamInfo.push(i),s(t.mediaType,I.MANIFEST_UPDATE_STREAM_INFO,t)}},addPlayList:function(t){t.trace&&Array.isArray(t.trace)?t.trace.forEach((t=>{t.hasOwnProperty("subreplevel")&&!t.subreplevel&&delete t.subreplevel})):delete t.trace,f(w.A.STREAM,I.PLAY_LIST,t)},addRepresentationSwitch:function(t,e,n,a,r){let i=new Xo;i.t=e,i.mt=n,i.to=a,r?i.lto=r:delete i.lto,f(t,I.TRACK_SWITCH,i)},addRequestsQueue:function(t,e,n){let a=new il;a.loadingRequests=e,a.executedRequests=n,c(t).RequestsQueue=a,u(t,I.REQUESTS_QUEUE,a)},addSchedulingInfo:function(t,e,n,a,r,i,o,l,s){let u=new rl;u.mediaType=t,u.t=e,u.type=n,u.startTime=a,u.availabilityStartTime=r,u.duration=i,u.bandwidth=o,u.range=l,u.state=s,f(t,I.SCHEDULING_INFO,u)},clearAllCurrentMetrics:function(){a={},o()},clearCurrentMetricsForType:function(t){delete a[t],l(t)},getMetricsFor:c,updateManifestUpdateInfo:function(t,e){if(t){for(let n in e)t[n]=e[n];s(t.mediaType,I.MANIFEST_UPDATE,t)}}},a={},n}ol.__dashjs_factory_name="MetricsModel";var ll=N.A.getSingletonFactory(ol);function sl(t){t=t||{};const e=this.context;let n,a,r,i,o=t.metricsModel;function l(t){const e=o.getMetricsFor(t,!0);if(!e)return null;const n=e.HttpList;let a,r=null;if(!n||n.length<=0)return null;for(a=n.length-1;a>=0;){if(n[a].responsecode){r=n[a];break}a--}return r}function s(t){const e=o.getMetricsFor(t,!0);return e&&e.HttpList?e.HttpList:[]}function u(t,e){if(!t)return null;const n=t[e];return n&&0!==n.length?n[n.length-1]:null}return n={getCurrentRepresentationSwitch:function(t){return u(o.getMetricsFor(t,!0),I.TRACK_SWITCH)},getCurrentBufferState:function(t){return u(o.getMetricsFor(t,!0),I.BUFFER_STATE)},getCurrentBufferLevel:function(t){const e=u(o.getMetricsFor(t,!0),I.BUFFER_LEVEL);return e?Wo.round10(e.level/1e3,-3):0},getCurrentHttpRequest:l,getHttpRequests:s,getCurrentDroppedFrames:function(){return u(o.getMetricsFor(w.A.VIDEO,!0),I.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(t){return u(o.getMetricsFor(t,!0),I.SCHEDULING_INFO)},getCurrentDVRInfo:function(t){return u(t?o.getMetricsFor(t,!0):o.getMetricsFor(w.A.VIDEO,!0)||o.getMetricsFor(w.A.AUDIO,!0),I.DVR_INFO)},getCurrentManifestUpdate:function(){return u(o.getMetricsFor(w.A.STREAM),I.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(t,e){if(!e)return null;let n={},a=l(t);a&&(n=Gt.A.parseHttpHeaders(a._responseHeaders));const r=n[e.toLowerCase()];return void 0===r?null:r},getLatestMPDRequestHeaderValueByID:function(t){if(!t)return null;let e,n,a,r={};for(e=s(w.A.STREAM),a=e.length-1;a>=0;a--)if(n=e[a],n.type===z.G.MPD_TYPE){r=Gt.A.parseHttpHeaders(n._responseHeaders);break}const i=r[t.toLowerCase()];return void 0===i?null:i},addRepresentationSwitch:function(t,e,n,a,r){o.addRepresentationSwitch(t,e,n,a,r)},addDVRInfo:function(t,e,n,a){o.addDVRInfo(t,e,n,a)},updateManifestUpdateInfo:function(t){const e=this.getCurrentManifestUpdate();o.updateManifestUpdateInfo(e,t)},addManifestUpdateStreamInfo:function(t){if(t){const e=this.getCurrentManifestUpdate();o.addManifestUpdateStreamInfo(e,t.id,t.index,t.start,t.duration)}},addManifestUpdateRepresentationInfo:function(t,e){if(t){const n=this.getCurrentManifestUpdate();o.addManifestUpdateRepresentationInfo(n,t,e)}},addManifestUpdate:function(t){o.addManifestUpdate(w.A.STREAM,t.type,t.startDate,t.endDate)},addHttpRequest:function(t,e,n,a,r,i){const l={status:n,headers:a,url:e};o.addHttpRequest(t,l,r,i)},addSchedulingInfo:function(t,e){o.addSchedulingInfo(t.mediaType,new Date,t.type,t.startTime,t.availabilityStartTime,t.duration,t.bandwidth,t.range,e)},addRequestsQueue:function(t,e,n){o.addRequestsQueue(t,e,n)},addBufferLevel:function(t,e,n){o.addBufferLevel(t,e,n)},addBufferState:function(t,e,n){o.addBufferState(t,e,n)},addDroppedFrames:function(t){o.addDroppedFrames(w.A.VIDEO,t)},addPlayList:function(){i&&(o.addPlayList(i),i=null)},addDVBErrors:function(t){o.addDVBErrors(t)},createPlaylistMetrics:function(t,e){i=new St,i.start=new Date,i.mstart=t,i.starttype=e},createPlaylistTraceMetrics:function(t,e,n){!0===a&&(a=!1,r=new It,r.representationid=t,r.start=new Date,r.mstart=e,r.playbackspeed=null!==n?n.toString():null)},updatePlayListTraceMetrics:function(t){if(r)for(let e in r)r[e]=t[e]},pushPlayListTraceMetrics:function(t,e){if(!1===a&&i&&r&&r.start){const n=r.start;r.duration=t.getTime()-n.getTime(),r.stopreason=e,i.trace.push(r),a=!0}},clearAllCurrentMetrics:function(){o.clearAllCurrentMetrics()}},o=o||ll(e).getInstance({settings:t.settings}),a=!0,r=null,i=null,n}sl.__dashjs_factory_name="DashMetrics";var ul=N.A.getSingletonFactory(sl);function cl(){const t=this.context,e=(0,k.A)(t).getInstance(),n=(0,K.A)(t).getInstance();let a,r,i,o;function l(t){o=t}function s(t,e,n,a){let r,i=e.adaptation.period.mpd;const o=i.availabilityStartTime;if(a)r=n&&i.timeShiftBufferDepth!==Number.POSITIVE_INFINITY?new Date(o.getTime()+1e3*(t+i.timeShiftBufferDepth)):i.availabilityEndTime;else if(n){const n=e.availabilityTimeOffset;r=new Date(o.getTime()+1e3*(t-n))}else r=o;return r}function u(t,e){return(t.getTime()-e.mpd.availabilityStartTime.getTime()+1e3*o)/1e3}function c(t,e){return t+(e.adaptation.period.start-e.presentationTimeOffset)}function d(t){const e={start:NaN,end:NaN},n=t[0].getAdapter().getRegularPeriods()[0],a=u(new Date,n);if(!t||0===t.length)return{range:e,now:a};t.forEach((t=>{let n=t.getCurrentRepresentationForType(w.A.VIDEO);if(n||(n=t.getCurrentRepresentationForType(w.A.AUDIO)),!n){const e=t.getAdapter(),a=e.getMediaInfoForType(t.getStreamInfo(),w.A.VIDEO)||e.getMediaInfoForType(t.getStreamInfo(),w.A.AUDIO);n=e.getVoRepresentations(a)[0]}let i={start:NaN,end:NaN};if(n)if(n.segmentInfoType===S.A.SEGMENT_TIMELINE)i=function(t){const e=t.adaptation.period.mpd.manifest.Period[t.adaptation.period.index].AdaptationSet[t.adaptation.index],n=r.getRepresentationFor(t.index,e),a=n.SegmentTemplate||n.SegmentList,i=a.SegmentTimeline,o=a.timescale,l=i.S,s={start:0,end:0},u=l[0].t,d=!isNaN(u),f=d?u:0;let g,m,h,p,b=0;for(d&&(s.start=c(f/o,t)),h=0,p=l.length;hi.start)&&(e.start=i.start),!isNaN(i.end)&&(isNaN(e.end)||e.end2&&void 0!==arguments[2]&&arguments[2];try{let a=0,r=!1,i=NaN;for(;!r&&a=e)?(i=e,r=!0):!n&&o.start>e&&(isNaN(i)||o.starti)&&(i=o.start+o.duration),a+=1}return i}catch(t){return e}}function m(t){void 0===t.offset||isNaN(t.offset)||l(t.offset/1e3)}function h(){o=0,i=0}function p(){e.off(R.A.UPDATE_TIME_SYNC_OFFSET,m,this),h()}return a={initialize:function(){h(),e.on(R.A.UPDATE_TIME_SYNC_OFFSET,m,this)},getClientTimeOffset:function(){return o},setClientTimeOffset:l,getClientReferenceTime:function(){return Date.now()-1e3*i+1e3*o},calcAvailabilityStartTimeFromPresentationTime:function(t,e,n){return s(t,e,n)},calcAvailabilityEndTimeFromPresentationTime:function(t,e,n){return s(t,e,n,!0)},calcPresentationTimeFromWallTime:u,calcPresentationTimeFromMediaTime:c,calcPeriodRelativeTimeFromMpdRelativeTime:function(t,e){return e-t.adaptation.period.start},calcMediaTimeFromPresentationTime:function(t,e){return t-e.adaptation.period.start+e.presentationTimeOffset},calcWallTimeForSegment:function(t,e){let n,a,r;return e&&(n=t.representation.adaptation.period.mpd.suggestedPresentationDelay,a=t.presentationStartTime+n,r=new Date(t.availabilityStartTime.getTime()+1e3*a)),r},calcTimeShiftBufferWindow:function(t,a){if(!a)return function(t){const e={start:NaN,end:NaN};let n=0,a=NaN;return t.forEach((t=>{const e=t.getStreamInfo();n+=e.duration,(isNaN(a)||e.start>6),e.push(128|63&a)):a<65536?(e.push(224|a>>12),e.push(128|63&a>>6),e.push(128|63&a)):(e.push(240|a>>18),e.push(128|63&a>>12),e.push(128|63&a>>6),e.push(128|63&a))}return e},yl=function(t){for(var e=[],n=0;n>18)),n.push(dl.charAt(63&r>>12)),n.push(dl.charAt(63&r>>6)),n.push(dl.charAt(63&r))}return 2==t.length-e?(r=(t[e]<<16)+(t[e+1]<<8),n.push(dl.charAt(63&r>>18)),n.push(dl.charAt(63&r>>12)),n.push(dl.charAt(63&r>>6)),n.push("=")):1==t.length-e&&(r=t[e]<<16,n.push(dl.charAt(63&r>>18)),n.push(dl.charAt(63&r>>12)),n.push("==")),n.join("")},gl=function(){for(var t=[],e=0;e<64;++e)t[dl.charCodeAt(e)]=e;return t["=".charCodeAt(0)]=0,t}(),ml=function(t){for(var e=0,n=[],a=0|t.length/4;0>16),n.push(255&r>>8),n.push(255&r),e+=4}return n&&("="==t.charAt(e-2)?(n.pop(),n.pop()):"="==t.charAt(e-1)&&n.pop()),n},hl={encode:function(t){for(var e=[],n=0;n0&&(m.spans.push({name:h,line:e,row:E}),e="");let t="style_cea608_"+i.foreground+"_"+i.background;i.underline&&(t+="_underline"),i.italics&&(t+="_italics"),b.hasOwnProperty(t)||(b[t]=JSON.parse(JSON.stringify(i))),a=i,h=t}e+=r.uchar}e.trim().length>0&&m.spans.push({name:h,line:e,row:E}),f=!0,g=i}else f=!1,g=-1,c&&(c.p.push(m),m={start:r,end:s,spans:[]},c.y2=E,c.name="region_"+c.x+"_"+c.y1+"_"+c.y2,!1===p.hasOwnProperty(c.name)?(y.push(c),p[c.name]=c):(d=p[c.name],d.p.contat(c.p)),c=null)}c&&(c.p.push(m),c.y2=E+1,c.name="region_"+c.x+"_"+c.y1+"_"+c.y2,!1===p.hasOwnProperty(c.name)?(y.push(c),p[c.name]=c):(d=p[c.name],d.p.contat(c.p)),c=null);const A=[];for(E=0;E0){if(0!==_&&r!=e.row){const t=document.createElement("br");t.className="lineBreak",g.appendChild(t)}let n=!1;r===e.row&&(n=!0),r=e.row;const s=b[e.name],u=document.createElement("span");u.className="spanPadding "+e.name+" customSpanColor",u.style.cssText=i(t,s),0!==_&&n?_===a.spans.length-1?u.textContent=l(e.line):u.textContent=e.line:a.spans.length>1&&_0||(127&e)>0}function Rl(t,e){let n=0;for(;ne+n));o++)6===r&&o+5+a<=t.byteLength&&Rl(Sl(t,o+5,o+5+a),i),o+=a+3;return i}function Cl(t){const e=t.errHandler,n=t.manifestModel,a=t.mediaController,r=t.videoModel,i=t.textTracks,o=t.vttParser,l=t.vttCustomRenderingParser,s=t.ttmlParser,u=t.streamInfo,c=t.settings,d=this.context,f=(0,k.A)(d).getInstance();let g,m,h,p,b,y,E,_,A,T,I,N,D,x,M,O,L,P=!1;function F(){y=null,_=NaN,A=[],T=null,E=!1,b=[],p=null}function U(t){const e={};e[S.A.SUBTITLE]="subtitles",e[S.A.CAPTION]="captions",e[S.A.FORCED_SUBTITLE]="subtitles";const n=new Al;for(let e in t)n[e]=t[e];n.defaultTrack=function(t){let e=!1;return N.length>1&&t.isEmbedded?e=t.id&&t.id===w.A.CC1:1===N.length?t.id&&"string"==typeof t.id&&"CC"===t.id.substring(0,2)&&(e=!0):0===N.length&&(e=t.index===b[0].index),e}(t),n.isTTML=function(t){return t.codec&&t.codec.search(w.A.STPP)>=0||t.mimeType&&t.mimeType.search(w.A.TTML)>=0}(t),n.kind=function(t,e){let n=t.roles&&t.roles.length>0?e[t.roles[0].value]:e.caption;return n=Object.values(e).includes(n)?n:e.caption,n}(t,e),i.addTextTrackInfo(n)}function j(t){const e=t.chunk;e.representation.mediaInfo.embeddedCaptions&&q(e.bytes,e)}function B(t){I=t}function q(t,a){const r=a.representation.mediaInfo,l=r.type,s=r.mimeType,u=r.codec||s;u?-1!==r.codec.indexOf("application/mp4")?function(t,e,a){let r,l;if("InitializationSegment"===e.segmentType)E=!0,_=h.getMediaTimescaleFromMoov(t);else{if(!E)return;l=h.getSamplesInfo(t),r=l.sampleList,r.length>0&&(T=r[0].cts-e.start*_),a.search(w.A.STPP)>=0?function(t,e,a){let r,o;for(p=null!==p?p:K(a),r=0;r0&&i.addCaptions(I,0,l)}(t,r)}}(t,a,u):l===w.A.VIDEO?function(t,e){let n,a;if(e.segmentType===z.G.INIT_SEGMENT_TYPE)0===D&&(D=h.getMediaTimescaleFromMoov(t));else if(e.segmentType===z.G.MEDIA_SEGMENT_TYPE){if(0===D)return void m.warn("CEA-608: No timescale for embeddedTextTrack yet");a=h.getSamplesInfo(t);const r=a.lastSequenceNumber,o=Math.trunc(e.start),l=Math.trunc(e.end);if(O[0]||O[1]||function(){let t;for(let e=0;e0){r.cts!==o?l=0:l+=1;const e=Y();n.fields[t].push([r.cts+e*D,i[t],l]),o=r.cts}}return n.fields.forEach((function(t){t.sort((function(t,e){return t[0]===e[0]?t[2]-e[2]:t[0]-e[0]}))})),n}(t,a.sampleList);for(let t=0;t=0?e=c.get().streaming.text.webvtt.customRenderingEnabled&&l?l:o:(t.search(w.A.TTML)>=0||t.search(w.A.STPP)>=0)&&(e=s),e}function W(t,e){void 0===t&&t===e&&(t=g.buffered.start(0),e=g.buffered.end(g.buffered.length-1)),g.buffered.remove(t,e),i.deleteCuesFromTrackIdx(I,t,e)}function $(t){N.forEach((function(e){const n=i.getTrackIdxForId(e.id);n>=0&&i.deleteCuesFromTrackIdx(n,t.from,t.to)}))}return g={initialize:function(){P||(N=[],I=null,D=0,O=[],x=null,M=null,P=!0,L=wl(d).getInstance(),f.on(R.A.VIDEO_CHUNK_RECEIVED,j,g),f.on(R.A.BUFFER_CLEARED,$,g))},addMediaInfos:function(t,e,n){if(b=b.concat(e),t===w.A.TEXT&&e[0].isFragmented&&!e[0].isEmbedded){y=n,g.buffered=(0,Tl.A)(d).create(),A=a.getTracksFor(w.A.TEXT,u.id).filter((t=>t.isFragmented));const t=a.getCurrentTrackFor(w.A.TEXT,u.id);for(let e=0;e{return a=t,(n=e).startTime===a.startTime&&n.endTime===a.endTime&&n instanceof VTTCue&&a instanceof VTTCue&&n.text===a.text;var n,a}))}addCue(t){const e=this.cues.get(t.startTime);e?this.hasCue(t)||e.push(t):this.cues.set(t.startTime,[t])}}var Ml=n(7640);const zl=["text","align","fontSize","id","isd","line","lineAlign","lineHeight","linePadding","position","positionAlign","region","size","snapToLines","vertical"];function Ol(t){const e=this.context,n=(0,k.A)(e).getInstance(),a=t.videoModel,r=t.streamInfo,i=t.settings;let o,l,s,u,c,d,f,g,m,h,p,b,y,E,_,A,T,v,S,I;function N(t){const e=t.kind,n=void 0!==t.id?t.id:t.lang,r=t.lang,i=t.isTTML,o=t.isEmbedded;return a.addTextTrack(e,n,r,i,o)}function x(t,e,n,a,r,i){let o=0,l=0;t/e>n/a?(l=e,o=l/a*n):(o=t,l=o/n*a);let s=0,u=0,c=0,d=0;return o/l>r?(d=l,c=l*r):(c=o,d=o/r),s=(t-c)/2,u=(e-d)/2,i?{x:s+.1*c,y:u+.1*d,w:.8*c,h:.8*d}:{x:s,y:u,w:c,h:d}}function M(t,e){const r=a.getClientWidth(),i=a.getClientHeight(),o=a.getVideoWidth(),l=a.getVideoHeight(),s=a.getVideoRelativeOffsetTop(),u=a.getVideoRelativeOffsetLeft();if(0!==o&&0!==l){let a=o/l,c=!1;t.isFromCEA608&&(a=3.5/3,c=!0);const d=x.call(this,r,i,o,l,a,c),b=d.w,y=d.h,A=d.x,v=d.y;if(b!=m||y!=h||A!=f||v!=g||e){if(f=A+u,g=v+s,m=b,h=y,p){const t=p.style;t&&(t.left=f+"px",t.top=g+"px",t.width=m+"px",t.height=h+"px",t.zIndex=E&&document[E]||_?T:null,n.trigger(D.A.CAPTION_CONTAINER_RESIZE))}const e=t.activeCues;if(e){const t=e.length;for(let n=0;n=t.startTime}function F(t,e){return!!i.get().streaming.text.extendSegmentedCues&&!!function(t,e,n){for(let a=0;a{e.kind&&"image"===e.kind&&(e.src=O(t,e.src)),U(t,e.contents)}))}function j(t,e,n){const r=X(t),o=i.get().streaming.text.dispatchForManualRendering;if(!r)return;if(!Array.isArray(n)||0===n.length)return;const s=new xl(r.cues);for(let t=0;tL(this))):L(this),l.debug("Cue enter id:"+this.cueID)):(p.appendChild(this.cueHTMLElement),z.call(r,this),n.trigger(D.A.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:d})))},i.onexit=function(){if(p){const t=p.childNodes;for(let e=0;e=0&&u[t]?a.getTextTrack(u[t].kind,u[t].id,u[t].lang,u[t].isTTML,u[t].isEmbedded):null}function Q(t){if(t===d)return;d=t;const e=X(d);Z.call(this,e),y&&(clearInterval(y),y=null),e&&"html"===e.renderingType&&(M.call(this,e,!0),window.ResizeObserver?(v=new window.ResizeObserver((()=>{M.call(this,e,!0)})),v.observe(a.getElement())):y=setInterval(M.bind(this,e),500))}function Z(t){it.call(this),t&&"html"===t.renderingType?at.call(this):rt.call(this)}function J(t,e,n){let a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return!!t&&(isNaN(e)||(a?t.startTime:t.endTime)>=e)&&(isNaN(n)||(a?t.endTime:t.startTime)<=n)}function tt(t,e,n){if(!(n0?"native":"custom",r="native"===a?t.cues:t.manualCueList;if(!r||0===r.length)return;for(let i=r.length-1;i>=0;i--)J(r[i],e,n,!0)&&!nt(r[i])&&("native"===a?t.removeCue(r[i]):(W(r[i]),delete t.manualCueList[i]))}}function et(t,e,n){let a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(t&&(t.cues||t.manualCueList)){const r=t.cues&&t.cues.length>0?"native":"custom",i="native"===r?t.cues:t.manualCueList;if(!i||0===i.length)return;for(let o=i.length-1;o>=0;o--)J(i[o],e,n,a)&&("native"===r?(i[o].onexit&&i[o].onexit(),t.removeCue(i[o])):(W(i[o]),delete t.manualCueList[o]))}}function nt(t){const e=a.getTime();return e>=t.startTime&&e<=t.endTime}function at(){let t=document.getElementById("native-cue-style");if(t)return;t=document.createElement("style"),t.id="native-cue-style",document.head.appendChild(t);const e=t.sheet,n=a.getElement();try{n&&(n.id?e.insertRule("#"+n.id+"::cue {background: transparent}",0):0!==n.classList.length?e.insertRule("."+n.className+"::cue {background: transparent}",0):e.insertRule("video::cue {background: transparent}",0))}catch(t){l.info(""+t.message)}}function rt(){const t=document.getElementById("native-cue-style");t&&document.head.removeChild(t)}function it(){if(p)for(;p.firstChild;)p.removeChild(p.firstChild)}return o={addCaptions:j,addTextTrackInfo:function(t){u.push(t)},createTracks:function(){u.sort((function(t,e){return t.index-e.index})),p=a.getTTMLRenderingDiv(),b=a.getVttRenderingDiv();let t=-1;for(let e=0;e=0){let e=function(){const a=X(t);a&&"html"===a.renderingType&&M.call(this,a,!0),n.off(D.A.PLAYBACK_METADATA_LOADED,e,this)};n.on(D.A.PLAYBACK_METADATA_LOADED,e,this);for(let e=0;e0){const e=t[0].manualCueList;e&&e.length>0&&e.forEach((t=>{if(t.isActive)if(t.isActive=!1,i.get().streaming.text.dispatchForManualRendering)G(t);else if(b){const e=b.childNodes;for(let n=0;n0){const n=e[0].manualCueList;n&&n.length>0&&n.forEach((e=>{e.startTime<=t&&e.endTime>=t&&!e.isActive?(e.isActive=!0,i.get().streaming.text.dispatchForManualRendering?q(e):WebVTT.processCues(window,[e],b,e.cueID)):e.isActive&&(e.startTime>t||e.endTime1){const[t,a]=n;switch(t){case"align":case"A":e.align=a;break;case"line":case"L":const[t,n]=a.split(","),r=t.endsWith("%");e.line="auto"===t?t:parseInt(t,10),r&&(e.snapToLines=!1),n&&(e.lineAlign=n);break;case"position":case"P":const[i,o]=a.split(",");e.position=parseInt(i,10),o&&(e.positionAlign=o);break;case"size":case"S":e.size=parseInt(a,10)}}})),e}function c(t,e){let n,a=e,i="",o="";for(;""!==t[a]&&a1)for(let a=0;a0&&"WEBVTT"!==o&&o.match(r)){const r=s(o),d=r.cuePoints,f=r.styles,g=c(t,a+1),m=l(d[0].replace(i,"")),h=l(d[1].replace(i,""));!isNaN(m)&&!isNaN(h)&&m>=u&&h>m?""!==g?(u=m,e.push({start:m,end:h,data:g,styles:f})):n.error("Skipping cue due to empty/malformed cue text"):n.error("Skipping cue due to incorrect cue timing")}}return e},getCaptionStyles:u},n=(0,C.A)(t).getInstance().getLogger(e),a=/(?:\r\n|\r|\n)/gm,r=/-->/,i=/(^[\s]+|[\s]+$)/g,o=/\s\b/g,e}Pl.__dashjs_factory_name="VTTParser";var Fl=N.A.getSingletonFactory(Pl);function Ul(){let t,e;return t={parse:function(t){let n=[];return e.oncue=function(t){t.start=t.startTime,t.end=t.endTime,t.data=t.text,t.styles={align:t.align,line:t.line,position:t.position,size:t.size},n.push(t)},e.parse(t),n}},function(){try{window&&window.WebVTT&&window.WebVTT.Parser&&(e=new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder()))}catch(t){}}(),t}Ul.__dashjs_factory_name="VttCustomRenderingParser";var jl=N.A.getSingletonFactory(Ul);function Bl(){const t=this.context,e=(0,k.A)(t).getInstance();let n,a,r=0;function i(){const t="cue_TTML_"+r;return r++,t}return n={parse:function(t,n,r,o,l){let s="";const u=[];let c,d,f;const g={},m={};let h="",p="",b={onOpenTag:function(t,n,r){if(r[" imagetype"]&&!r[" imageType"]&&(e.trigger(D.A.CONFORMANCE_VIOLATION,{level:ka.LEVELS.ERROR,event:ka.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),r[" imageType"]=r[" imagetype"]),"image"===n&&("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"===t||"http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"===t)){if(!r[" imageType"]||"PNG"!==r[" imageType"].value)return void a.warn("smpte-tt imageType != PNG. Discarded");h=r["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){h&&(m[h]=p.trim()),p="",h=""},onText:function(t){h&&(p+=t)}};if(!t)throw s="no ttml data to parse",new Error(s);g.data=t,e.trigger(R.A.TTML_TO_PARSE,g);let y=(0,Ml.fromXML)(g.data,(function(t){s=t}),b);e.trigger(R.A.TTML_PARSED,{ttmlString:g.data,ttmlDoc:y});const E=y.getMediaTimeEvents();for(f=0;ft.contents.length))&&(c=E[f]+n,d=E[f+1]+n,c0&&(n=i.resolve(e[0].path).url)}const u=t.essentialProperties.filter((t=>t.schemeIdUri&&t.schemeIdUri===w.A.FONT_DOWNLOAD_DVB_SCHEME)),c=t.supplementalProperties.filter((t=>t.schemeIdUri&&t.schemeIdUri===w.A.FONT_DOWNLOAD_DVB_SCHEME));u.length>0?(l=!0,o=u):o=c,o.forEach((r=>{if(function(t){return!(!(t.value&&1===parseInt(t.value)&&t.dvbUrl&&t.dvbUrl.length>0&&t.dvbFontFamily&&t.dvbFontFamily.length>0&&t.dvbMimeType)||t.dvbMimeType!==w.A.OFF_MIMETYPE&&t.dvbMimeType!==w.A.WOFF_MIMETYPE)}(r)){let u=(i=r.dvbUrl,o=n,a.isPathAbsolute(i)?i:a.isRelative(i)?o?a.resolve(i,o):a.resolve(i):i);d.push({fontFamily:r.dvbFontFamily,url:u,mimeType:r.dvbMimeType,trackId:t.id,streamId:e,isEssential:l,status:s,fontFace:new FontFace(r.dvbFontFamily,`url(${u})`,{display:"swap"})})}var i,o}))}function g(t,e){const n=d[t];d[t]={...n,status:e}}function m(){d=[]}return u={addFontsFromTracks:function(t,e){if(t&&Array.isArray(t)&&e)for(let n=0;n{g(t,l),n.trigger(D.A.DVB_FONT_DOWNLOAD_COMPLETE,e)}),(a=>{g(t,o),c.debug("Font download error: ",a),n.trigger(D.A.DVB_FONT_DOWNLOAD_FAILED,e)}))}},getFonts:function(){return d},getFontsForTrackId:function(t){return d.filter((e=>e.trackId&&e.trackId===t))},reset:function(){!function(){for(const t of d){let e=document.fonts.delete(t.fontFace);c.debug(`Removal of fontFamily: ${t.fontFamily} was ${e?"successful":"unsuccessful"}`)}}(),m()}},c=(0,C.A)(e).getInstance().getLogger(u),m(),u}Gl.__dashjs_factory_name="DVBFonts";var Hl=N.A.getClassFactory(Gl);function Yl(t){let e=this.context;const n=t.adapter,a=t.errHandler,r=t.manifestModel,i=t.mediaController,o=t.baseURLController,l=t.videoModel,s=t.settings;let u,c,d,f,g,m,h,p,b,y,E,_,A,T;function v(t){if(T.error(`Could not download ${t.isEssential?"an essential":"a"} font - fontFamily: ${t.fontFamily}, url: ${t.url}`),t.isEssential){let e=f[t.streamId].getTrackIdxForId(t.trackId);f[t.streamId].setModeForTrackIdx(e,w.A.TEXT_DISABLED)}}function I(t){if(T.debug(`Successfully downloaded ${t.isEssential?"an essential":"a"} font - fontFamily: ${t.fontFamily}, url: ${t.url}`),t.isEssential){let e=f[t.streamId].getTrackIdxForId(t.trackId);e===f[t.streamId].getCurrentTrackIdx()?f[t.streamId].setModeForTrackIdx(e,w.A.TEXT_SHOWING):f[t.streamId].setModeForTrackIdx(e,w.A.TEXT_HIDDEN)}}function N(t){let e=t.tracks,n=t.index;const a=t.streamId;if(!1===s.get().streaming.text.defaultEnabled&&!O()||_)L(a,-1);else{const t=i.getCurrentTrackFor(w.A.TEXT,a);if(t){const r={lang:t.lang,role:t.roles[0],index:t.index,codec:t.codec,accessibility:t.accessibility[0]};e.some(((t,e)=>{if(i.matchSettings(r,t))return L(a,e),n=e,!0}))}b=!1}c[a].lastEnabledIndex=n,p.trigger(D.A.TEXT_TRACKS_ADDED,{enabled:O(),index:n,tracks:e,streamId:a}),E=!0,A.addFontsFromTracks(e,a),A.getFonts().forEach((t=>{if(t.isEssential){let e=f[t.streamId].getTrackIdxForId(t.trackId);f[t.streamId].setModeForTrackIdx(e,w.A.TEXT_DISABLED)}})),A.downloadFonts()}function x(t){try{const e=t.streamId;if(!f[e]||isNaN(t.time))return;f[e].manualCueProcessing(t.time)}catch(t){}}function M(t){try{const e=t.streamId;if(!f[e])return;f[e].disableManualTracks()}catch(t){}}function z(t){try{if(!t||!t.mediaType||t.mediaType!==w.A.AUDIO||!t.currentMediaInfo)return;const e=f[t.streamId].getCurrentTextTrackInfo();let n=NaN;b?n=P(t.streamId):F(e)&&t.currentMediaInfo.lang&&t.currentMediaInfo.lang!==e.lang&&(n=P(t.streamId),isNaN(n)&&(n=-1)),isNaN(n)||L(t.streamId,n)}catch(t){T.error(t)}}function O(){let t=!0;return b&&!y&&(t=!1),t}function L(t,e){b=-1===e,b&&i&&i.saveTextSettingsDisabled();let n=U(t);if(n===e||!f[t])return;f[t].disableManualTracks();let a=f[t].getCurrentTextTrackInfo(),r=a?l.getTextTrack(a.kind,a.id,a.lang,a.isTTML,a.isEmbedded):null;r&&r.mode!==w.A.TEXT_DISABLED&&f[t].setModeForTrackIdx(n,w.A.TEXT_HIDDEN),f[t].setCurrentTrackIdx(e),a=f[t].getCurrentTextTrackInfo();const o=s.get().streaming.text.dispatchForManualRendering;if(a&&!o&&a.mode!==w.A.TEXT_DISABLED&&f[t].setModeForTrackIdx(e,w.A.TEXT_SHOWING),a&&a.isFragmented&&!a.isEmbedded)!function(t,e,n){if(!d[t])return;let a=d[t].getConfig().fragmentedTracks;for(let r=0;r(t._indexToSelect=e,!!(t&&t.roles&&t.roles.length>0)&&F(t))))}(t);if(!e||e.length<=0)return NaN;const n=i.getCurrentTrackFor(w.A.AUDIO,t);if(!n)return NaN;const a=e.find((t=>n.lang===t.lang));return a?a._indexToSelect:NaN}function F(t){return!(!t||!t.roles||0===t.roles.length)&&t.roles.some((t=>t.schemeIdUri===w.A.DASH_ROLE_SCHEME_ID&&t.value===S.A.FORCED_SUBTITLE))}function U(t){return f[t].getCurrentTrackIdx()}function j(){d={},f={},c={},b=!0,E=!1,_=!1}return u={addEmbeddedTrack:function(t,e){const n=t.id;d[n]&&d[n].addEmbeddedTrack(e)},addMediaInfosToBuffer:function(t,e,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const r=t.id;d[r]&&d[r].addMediaInfos(e,n,a)},createTracks:function(t){const e=t.id;f[e]&&f[e].createTracks()},deactivateStream:function(t){if(!t)return;const e=t.id;d[e]&&d[e].resetMediaInfos(),f[e]&&f[e].deleteAllTextTracks()},enableForcedTextStreaming:function(t){return(0,yt.sq)(t,"boolean"),y=t,!0},enableText:function(t,e){return(0,yt.sq)(e,"boolean"),O()!==e&&(e&&L(t,c[t].lastEnabledIndex),e||(c[t].lastEnabledIndex=U(t),E?L(t,-1):_=!0)),!0},getAllTracksAreDisabled:function(){return b},getCurrentTrackIdx:U,getTextSourceBuffer:function(t){const e=t.id;if(d&&d[e])return d[e]},initialize:function(){A=Hl(e).create({adapter:n,baseURLController:o}),p.on(R.A.TEXT_TRACKS_QUEUE_INITIALIZED,N,u),p.on(R.A.DVB_FONT_DOWNLOAD_FAILED,v,u),p.on(R.A.DVB_FONT_DOWNLOAD_COMPLETE,I,u),p.on(R.A.MEDIAINFO_UPDATED,z,u),s.get().streaming.text.webvtt.customRenderingEnabled&&(p.on(R.A.PLAYBACK_TIME_UPDATED,x,u),p.on(R.A.PLAYBACK_SEEKING,M,u))},initializeForStream:function(t){const o=t.id,u=Ll(e).create({videoModel:l,settings:s,streamInfo:t});u.initialize(),f[o]=u;const p=Dl(e).create({errHandler:a,adapter:n,dvbFonts:A,manifestModel:r,mediaController:i,videoModel:l,textTracks:u,vttParser:g,vttCustomRenderingParser:m,ttmlParser:h,streamInfo:t,settings:s});p.initialize(),d[o]=p,c[o]={},c[o].lastEnabledIndex=-1},isTextEnabled:O,reset:function(){Object.keys(d).forEach((t=>{d[t].resetEmbedded(),d[t].reset()})),A.reset(),j(),p.off(R.A.TEXT_TRACKS_QUEUE_INITIALIZED,N,u),p.off(R.A.DVB_FONT_DOWNLOAD_FAILED,v,u),p.off(R.A.DVB_FONT_DOWNLOAD_COMPLETE,I,u),p.off(R.A.MEDIAINFO_UPDATED,z,u),s.get().streaming.text.webvtt.customRenderingEnabled&&(p.off(R.A.PLAYBACK_TIME_UPDATED,x,u),p.off(R.A.PLAYBACK_SEEKING,M,u))},setTextTrack:L,clearDataForStream:function(t){d[t]&&(d[t].resetEmbedded(),d[t].reset(),delete d[t]),f[t]&&(f[t].deleteAllTextTracks(),delete f[t]),c[t]&&delete c[t]}},y=!1,E=!1,_=!1,g=Fl(e).getInstance(),m=jl(e).getInstance(),h=ql(e).getInstance(),p=(0,k.A)(e).getInstance(),T=(0,C.A)(e).getInstance().getLogger(u),j(),u}Yl.__dashjs_factory_name="TextController";var Vl=N.A.getClassFactory(Yl);function Kl(t){t=t||{};const e=this.context,n=(0,C.A)(e).getInstance(),a=t.settings,r=(0,k.A)(e).getInstance();let i,o,l,s,u,c;function d(){return navigator&&navigator.connection&&!isNaN(navigator.connection.downlink)&&navigator.connection.downlink>0?1e3*navigator.connection.downlink:NaN}function f(t,e,n,a){const r=Math.pow(.5,n/a.fast);t.fastEstimate=(1-r)*e+r*t.fastEstimate;const i=Math.pow(.5,n/a.slow);t.slowEstimate=(1-i)*e+i*t.slowEstimate,t.totalWeight+=n}function g(){i={},o={},l={},s={}}const m={addEntry:function(t,e){try{if(!(t&&e&&e.trace&&e.trace.length))return;!function(t){i[t]=i[t]||[],o[t]=o[t]||[],l[t]=l[t]||{fastEstimate:0,slowEstimate:0,totalWeight:0},s[t]=s[t]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}(t);const n=e.tresponse.getTime()-e.trequest.getTime()||1;let g=function(t,e){return t._fileLoaderType&&t._fileLoaderType===w.A.FILE_LOADER_TYPES.FETCH?function(t){const e=t.trace.reduce(((t,e)=>t+e.b[0]),0),n=t.trace.reduce(((t,e)=>t+e.d),0);let r=NaN;return a.get().streaming.abr.throughput.useNetworkInformationApi.fetch&&(r=d()),isNaN(r)&&(r=Math.round(8*e/n)),{downloadedBytes:e,value:r,downloadTimeInMs:n}}(t):function(t,e){let n=NaN,r=NaN,i=!1;if(a.get().streaming.abr.throughput.useResourceTimingApi&&t._resourceTimingValues)n=t._resourceTimingValues.transferSize,r=t._resourceTimingValues.responseEnd-t._resourceTimingValues.responseStart,i=!0;else{if(t.trace.length<=1)return{throughput:NaN,downloadTimeInMs:NaN};n=t.trace.reduce(((t,e)=>t+e.b[0]),0)-t.trace[0].b[0],r=Math.max(t.trace.reduce(((t,e)=>t+e.d),0)-t.trace[0].d,1)}let o=NaN;if(!i&&a.get().streaming.abr.throughput.useNetworkInformationApi.xhr&&(o=d()),isNaN(o)){const t=a.get().streaming.abr.throughput.useDeadTimeLatency?r:r+e;o=Math.round(8*n/t)}return{downloadedBytes:n,value:o,downloadTimeInMs:r}}(t,e)}(e,n);if(g.latencyInMs=n,isNaN(g.value)||!isFinite(g.value))return;if(e.cmsd){const t=e.cmsd.dynamic&&e.cmsd.dynamic.etp?e.cmsd.dynamic.etp:null;if(t){const e=a.get().streaming.cmsd.abr.etpWeightRatio;e>0&&e<=1&&(g.value=g.value*(1-e)+t*e)}}if(function(t,e,n){return a.get().streaming.abr.throughput.useResourceTimingApi&&n._resourceTimingValues?0===n._resourceTimingValues.transferSize&&n._resourceTimingValues.decodedBodySize>0:!isNaN(e)&&(t===w.A.VIDEO?ea.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep&&i[t].shift(),o[t].length>a.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep&&o[t].shift()}(t),r.trigger(D.A.THROUGHPUT_MEASUREMENT_STORED,{throughputValues:g}),e.type!==z.G.MPD_TYPE&&(f(l[t],g.value,a.get().streaming.abr.throughput.ewma.weightDownloadTimeMultiplicationFactor*g.downloadTimeInMs,u.bandwidthHalfLife),f(s[t],n,1,u.latencyHalfLife))}catch(t){c.error(t)}},getThroughputDict:function(t){return t?i[t]:i},getEwmaThroughputDict:function(t){return t?l[t]:l},getEwmaLatencyDict:function(t){return t?s[t]:s},getEwmaHalfLife:function(){return u},getLatencyDict:function(t){return t?o[t]:o},reset:g};return c=n.getLogger(m),u={bandwidthHalfLife:{fast:a.get().streaming.abr.throughput.ewma.throughputFastHalfLifeSeconds,slow:a.get().streaming.abr.throughput.ewma.throughputSlowHalfLifeSeconds},latencyHalfLife:{fast:a.get().streaming.abr.throughput.ewma.latencyFastHalfLifeCount,slow:a.get().streaming.abr.throughput.ewma.latencySlowHalfLifeCount}},g(),m}Kl.__dashjs_factory_name="ThroughputModel";var Wl=N.A.getClassFactory(Kl);function $l(){const t=this.context,e=(0,k.A)(t).getInstance();let n,a,r;function i(){performance.clearResourceTimings()}function o(t){t.metric!==I.HTTP_REQUEST||!t.value||t.value.type!==z.G.MPD_TYPE&&(t.value.type!==z.G.MEDIA_SEGMENT_TYPE||t.mediaType!==w.A.AUDIO&&t.mediaType!==w.A.VIDEO)||n.addEntry(t.mediaType,t.value)}function l(t,e){let i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:NaN,b=null,y=n.getEwmaHalfLife(),E=null,_=!0;switch(o||(o=r.get().streaming.abr.throughput.averageCalculationMode),t){case w.A.THROUGHPUT_TYPES.BANDWIDTH:b=o===w.A.THROUGHPUT_CALCULATION_MODES.EWMA?n.getEwmaThroughputDict(e):n.getThroughputDict(e),E=y.bandwidthHalfLife,_=!0,l=isNaN(l)?a.getIsDynamic()?r.get().streaming.abr.throughput.sampleSettings.live:r.get().streaming.abr.throughput.sampleSettings.vod:l;break;case w.A.THROUGHPUT_TYPES.LATENCY:b=o===w.A.THROUGHPUT_CALCULATION_MODES.EWMA?n.getEwmaLatencyDict(e):n.getLatencyDict(e),E=y.latencyHalfLife,_=!1,l=isNaN(l)?r.get().streaming.abr.throughput.sampleSettings.averageLatencySampleAmount:l}if(!b||0===b.length)return NaN;switch(o){case w.A.THROUGHPUT_CALCULATION_MODES.ARITHMETIC_MEAN:return i=s(b,l,t),u(b,i);case w.A.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_ARITHMETIC_MEAN:return i=s(b,l,t),c(b,i);case w.A.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_ARITHMETIC_MEAN:return i=s(b,l,t),d(b,i);case w.A.THROUGHPUT_CALCULATION_MODES.HARMONIC_MEAN:return i=s(b,l,t),f(b,i);case w.A.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_HARMONIC_MEAN:return i=s(b,l,t),g(b,i);case w.A.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_HARMONIC_MEAN:return i=s(b,l,t),m(b,i);case w.A.THROUGHPUT_CALCULATION_MODES.EWMA:return h(b,E,_);case w.A.THROUGHPUT_CALCULATION_MODES.ZLEMA:return i=s(b,l,t),p(b,i)}}function s(t,e,n){if(t){if(e>=t.length)e=t.length;else if(n===w.A.THROUGHPUT_TYPES.BANDWIDTH&&r.get().streaming.abr.throughput.sampleSettings.enableSampleSizeAdjustment)for(let n=1;n=r.get().streaming.abr.throughput.sampleSettings.increaseScale||a<=r.get().streaming.abr.throughput.sampleSettings.decreaseScale)&&(e+=1)===t.length)break}}else e=0;return e}function u(t,e){let n=t;return 0!==e&&n&&0!==n.length?(n=n.slice(-e),n.reduce(((t,e)=>t+e.value),0)/n.length):NaN}function c(t,e){let n=t;if(0===e||!n||0===n.length)return NaN;n=n.slice(-e);let a=0;return n.reduce(((t,e)=>{let n=Math.sqrt(e.downloadedBytes);return a+=n,t+e.value*n}),0)/a}function d(t,e){let n=t;if(0===e||!n||0===n.length)return NaN;n=n.slice(-e);let a=0;return n.reduce(((t,e,n)=>{let r=n+1;return a+=r,t+e.value*r}),0)/a}function f(t,e){let n=t;if(0===e||!n||0===n.length)return NaN;n=n.slice(-e);const a=n.reduce(((t,e)=>t+1/e.value),0);return n.length/a}function g(t,e){let n=t;if(0===e||!n||0===n.length)return NaN;n=n.slice(-e);let a=0;const r=n.reduce(((t,e)=>{let n=Math.sqrt(e.downloadedBytes);return a+=n,t+1/e.value*n}),0);return a/r}function m(t,e){let n=t;if(0===e||!n||0===n.length)return NaN;n=n.slice(-e);let a=0;const r=n.reduce(((t,e,n)=>{let r=n+1;return a+=r,t+1/e.value*r}),0);return a/r}function h(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||t.totalWeight<=0)return NaN;const a=t.fastEstimate/(1-Math.pow(.5,t.totalWeight/e.fast)),r=t.slowEstimate/(1-Math.pow(.5,t.totalWeight/e.slow));return n?Math.min(a,r):Math.max(a,r)}function p(t,e){if(0===e||!t||0===t.length)return NaN;let n=t.slice(-e).map((t=>t.value)),a=2/(n.length+1),r=n[n.length-1],i=n[n.length-1];for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN;const a=l(w.A.THROUGHPUT_TYPES.BANDWIDTH,t,e,n);return Math.round(a)}const y={getArithmeticMean:u,getAverageLatency:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN;const a=l(w.A.THROUGHPUT_TYPES.LATENCY,t,e,n);return Math.round(a)},getAverageThroughput:b,getByteSizeWeightedArithmeticMean:c,getByteSizeWeightedHarmonicMean:g,getDateWeightedArithmeticMean:d,getDateWeightedHarmonicMean:m,getEwma:h,getHarmonicMean:f,getRawThroughputData:function(t){return t?n.getThroughputDict(t):[]},getSafeAverageThroughput:function(t){let e=b(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN);return isNaN(e)||(e*=r.get().streaming.abr.throughput.bandwidthSafetyFactor),e},getZlema:p,initialize:function(){n=Wl(t).create({settings:r}),e.on(D.A.METRIC_ADDED,o,y),performance&&performance.addEventListener("resourcetimingbufferfull",i)},reset:function(){n.reset(),e.off(D.A.METRIC_ADDED,o,y),performance&&performance.removeEventListener("resourcetimingbufferfull",i)},setConfig:function(t){t.settings&&(r=t.settings),t.playbackController&&(a=t.playbackController)}};return y}$l.__dashjs_factory_name="ThroughputController";var Xl=N.A.getSingletonFactory($l);function Ql(){const t="You must first call initialize() and set a source before calling this method",e="You must first call initialize() and set a valid source and view before calling this method",n="You must first call attachView() to set the video element before calling this method",a="You must first call attachSource() with a valid source before calling this method",r="MediaPlayer not initialized!",i=this.context,o=(0,k.A)(i).getInstance();let l=(0,K.A)(i).getInstance();const s=(0,C.A)(i).getInstance({settings:l});let u,c,d,f,g,m,h,p,b,y,E,_,A,T,x,O,L,P,F,U,j,B,q,H,Y,W,$,X,Q,Z,J,tt,et,nt,at,rt,it,ot,lt,st,ut;function ct(){It(null),vt(null),f=null,x&&(x.reset(),x=null),O&&(O.reset(),O=null),j&&j.reset(),l.reset(),P&&(P.reset(),P=null)}function dt(){return!!d&&!!it.getElement()}function ft(){return(0,vo.i)()}function gt(){if(!h)throw e;return Q.isPaused()}function mt(){if(!h)throw e;return Q.getIsDynamic()}function ht(t){const e=W&&W.hasVideoTrack()?w.A.VIDEO:w.A.AUDIO;let n=et.getCurrentDVRInfo(e);return n?pt(n.range.start+t,n):0}function pt(t,e){let n=Q.getOriginalLiveDelay();return t>e.range.end-n&&(t=e.range.end-n),t}function bt(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(!h)throw e;let n=Tt().currentTime;return""!==t&&(n=W.getTimeRelativeToStreamId(n,t)),n}function Et(t){(0,yt.sq)(t,"boolean"),p=t}function _t(){j.restoreDefaultUTCTimingSources()}function At(){return et}function Tt(){if(!it.getElement())throw n;return it.getElement()}function vt(t){if(!g)throw r;it.setElement(t),t&&(Ct(),function(){if(O||"undefined"==typeof dashjs)return;let t=dashjs.MetricsReporting;if("function"==typeof t){let e=t(i).create();O=e.createMetricsReporting({debug:s,eventBus:o,mediaElement:Tt(),adapter:F,dashMetrics:et,mediaPlayerModel:U,events:R.A,constants:w.A,metricsConstants:I})}}(),function(){if(L||"undefined"==typeof dashjs)return;let t=dashjs.MssHandler;"function"==typeof t&&(V.extend(t.errors),L=t(i).create({eventBus:o,mediaPlayerModel:U,dashMetrics:et,manifestModel:nt,playbackController:Q,streamController:W,protectionController:x,baseURLController:q,errHandler:B,events:R.A,constants:w.A,debug:s,initSegmentType:z.G.INIT_SEGMENT_TYPE,BASE64:_l,ISOBoxer:Jn,settings:l}))}(),W&&W.switchToVideoElement(b)),h&&Rt(),xt(b)}function St(e){if(!m)throw t;let n=W.getActiveStreamInfo();return n?T.getTracksFor(e,n.id).filter((t=>!x||x.areKeyIdsUsable(t.normalizedKeyIds))):[]}function It(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN;if(!g)throw r;"string"==typeof t&&ot.initialize(t),null==e&&(e=NaN),isNaN(e)||(e=Math.max(0,e)),b=e,d=t,(m||h)&&Rt(),dt()&&xt(b)}function kt(){if(!m)throw t;let e=W.getActiveStreamInfo();return e?W.getStreamById(e.id):null}function Rt(){h=!1,m=!1,F.reset(),W.reset(),X.reset(),tt.reset(),Q.reset(),Z.reset(),J.reset(),y.reset(),E.reset(),T.reset(),st.reset(),x&&(l.get().streaming.protection.keepProtectionMediaKeys?x.stop():(x.reset(),x=null,Ct())),$.reset(),at.reset(),rt.reset()}function Nt(){return ii(i).create({debug:s,errHandler:B,dashMetrics:et,mediaPlayerModel:U,mssHandler:L,settings:l})}function Ct(){if(x)return x;if("undefined"==typeof dashjs)return null;let t=dashjs.Protection;if("function"==typeof t){let e=t(i).create();return R.A.extend(t.events),D.A.extend(t.events,{publicOnly:!0}),V.extend(t.errors),x=e.createProtectionSystem({debug:s,errHandler:B,videoModel:it,customParametersModel:j,capabilities:H,eventBus:o,events:R.A,BASE64:_l,constants:w.A,cmcdModel:at,settings:l}),H||(H=(0,si.A)(i).getInstance()),H.setProtectionController(x),x}return null}function Dt(){if(!g)throw r;if(P)return P;if("undefined"==typeof dashjs)return null;let t=dashjs.OfflineController;if("function"==typeof t){R.A.extend(t.events),D.A.extend(t.events,{publicOnly:!0}),V.extend(t.errors);const e=Nt(),n=Ea(i).create();return n.setConfig({manifestModel:nt,adapter:F,manifestLoader:e,errHandler:B,contentSteeringController:J}),P=t(i).create({debug:s,manifestUpdater:n,baseURLController:q,manifestLoader:e,manifestModel:nt,mediaPlayerModel:U,abrController:y,playbackController:Q,adapter:F,errHandler:B,dashMetrics:et,timelineConverter:A,segmentBaseController:st,schemeLoaderFactory:_,eventBus:o,events:R.A,errors:V,constants:w.A,settings:l,dashConstants:S.A,urlUtils:wt(i).getInstance()}),P}return null}function xt(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN;P&&P.resetRecords(),!m&&d&&(m=!0,c.info("Streaming Initialized"),function(){const t=Nt();W||(W=Da(i).getInstance()),$||($=Vl(i).create({errHandler:B,manifestModel:nt,adapter:F,mediaController:T,baseURLController:q,videoModel:it,settings:l})),Y.setConfig({capabilities:H,customParametersModel:j,adapter:F,settings:l,protectionController:x,manifestModel:nt,errHandler:B}),W.setConfig({capabilities:H,capabilitiesFilter:Y,manifestLoader:t,manifestModel:nt,mediaPlayerModel:U,customParametersModel:j,protectionController:x,textController:$,adapter:F,dashMetrics:et,errHandler:B,timelineConverter:A,videoModel:it,playbackController:Q,serviceDescriptionController:Z,contentSteeringController:J,abrController:y,throughputController:E,mediaController:T,settings:l,baseURLController:q,uriFragmentModel:ot,segmentBaseController:st}),X.setConfig({settings:l,playbackController:Q,streamController:W,videoModel:it,timelineConverter:A,adapter:F}),Q.setConfig({streamController:W,serviceDescriptionController:Z,dashMetrics:et,adapter:F,videoModel:it,timelineConverter:A,settings:l}),tt.setConfig({streamController:W,playbackController:Q,mediaPlayerModel:U,videoModel:it,settings:l}),E.setConfig({settings:l,playbackController:Q}),y.setConfig({streamController:W,capabilities:H,domStorage:lt,mediaPlayerModel:U,customParametersModel:j,throughputController:E,cmsdModel:rt,dashMetrics:et,adapter:F,videoModel:it,settings:l}),at.setConfig({abrController:y,dashMetrics:et,playbackController:Q,serviceDescriptionController:Z,throughputController:E}),ut.setConfig({serviceDescriptionController:Z}),rt.setConfig({}),T.initialize(),E.initialize(),y.initialize(),W.initialize(p,f),$.initialize(),X.initialize(),tt.initialize(),at.initialize(p),rt.initialize(),J.initialize(),st.initialize()}(),"string"==typeof d?W.load(d,t):W.loadWithManifest(d,t)),!h&&dt()&&(h=!0,o.trigger(D.A.PLAYBACK_INITIALIZED),c.info("Playback Initialized"))}return u={addABRCustomRule:function(t,e,n){j.addAbrCustomRule(t,e,n)},addRequestInterceptor:function(t){j.addRequestInterceptor(t)},addResponseInterceptor:function(t){j.addResponseInterceptor(t)},addUTCTimingSource:function(t,e){j.addUTCTimingSource(t,e)},attachProtectionController:function(t){x=t},attachSource:It,attachTTMLRenderingDiv:function(t){if(!it.getElement())throw n;it.setTTMLRenderingDiv(t)},attachView:vt,attachVttRenderingDiv:function(t){if(!it.getElement())throw n;it.setVttRenderingDiv(t)},clearDefaultUTCTimingSources:function(){j.clearDefaultUTCTimingSources()},convertToTimeCode:function(t){t=Math.max(t,0);let e=Math.floor(t/3600),n=Math.floor(t%3600/60),a=Math.floor(t%3600%60);return(0===e?"":e<10?"0"+e.toString()+":":e.toString()+":")+(n<10?"0"+n.toString():n.toString())+":"+(a<10?"0"+a.toString():a.toString())},destroy:function(){ct(),N.A.deleteSingletonInstances(i)},duration:function(){if(!h)throw e;let t=Tt().duration;if(Q.getIsDynamic()){const e=W&&W.hasVideoTrack()?w.A.VIDEO:w.A.AUDIO;let n=et.getCurrentDVRInfo(e);t=n?n.range.end-n.range.start:0}return t},enableForcedTextStreaming:function(t){return!(!W.getActiveStreamInfo()||!$)&&$.enableForcedTextStreaming(t)},enableText:function(t){const e=W.getActiveStreamInfo();return!(!e||!$)&&$.enableText(e.id,t)},extend:function(t,e,n){N.A.extend(t,e,n,i)},formatUTC:function(t,e,n){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Date(1e3*t),i=r.toLocaleDateString(e),o=r.toLocaleTimeString(e,{hour12:n});return a?o+" "+i:o},getABRCustomRules:function(){return j.getAbrCustomRules()},getActiveStream:kt,getAutoPlay:function(){return p},getAvailableBaseUrls:function(){const t=nt.getValue();return t?q.getBaseUrls(t):[]},getAvailableLocations:function(){const t=nt.getValue();if(!t)return[];const e=F.getLocation(t),n=J.getSynthesizedLocationElements(e);return e.concat(n)},getAverageLatency:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w.A.VIDEO,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN;return E?E.getAverageLatency(t,e,n):0},getAverageThroughput:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w.A.VIDEO,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN;return E?E.getAverageThroughput(t,e,n):0},getBufferLength:function(t){const e=[w.A.VIDEO,w.A.AUDIO,w.A.TEXT];if(t){if(-1!==e.indexOf(t)){return At().getCurrentBufferLevel(t)||NaN}return c.warn("getBufferLength requested for invalid type"),NaN}{const t=e.map((t=>St(t).length>0?At().getCurrentBufferLevel(t):Number.MAX_VALUE)).reduce(((t,e)=>Math.min(t,e)));return t===Number.MAX_VALUE?NaN:t}},getCurrentLiveLatency:function(){if(!g)throw r;return h?Q.getCurrentLiveLatency():NaN},getCurrentRepresentationForType:function(e){if(!m)throw t;if(e!==w.A.IMAGE&&e!==w.A.VIDEO&&e!==w.A.AUDIO)return null;const n=kt();if(!n)return null;if(e===w.A.IMAGE){const t=n.getThumbnailController();return t?t.getCurrentTrack():-1}return n.getCurrentRepresentationForType(e)},getCurrentSteeringResponseData:function(){if(J)return J.getCurrentSteeringResponseData()},getCurrentTextTrackIndex:function(){let t=NaN;const e=W.getActiveStreamInfo();if(e&&$)return t=$.getCurrentTrackIdx(e.id),t},getCurrentTrackFor:function(e){if(!m)throw t;let n=W.getActiveStreamInfo();return n?T.getCurrentTrackFor(e,n.id):null},getDashAdapter:function(){return F},getDashMetrics:At,getDebug:function(){return s},getDvrSeekOffset:ht,getDvrWindow:function(){if(!h)throw e;const t=W&&W.hasVideoTrack()?w.A.VIDEO:w.A.AUDIO;let n=et.getCurrentDVRInfo(t);if(!n)return{};let a=0;const r=Q.getIsDynamic();return r&&(a=n.manifestInfo.availableFrom.getTime()/1e3),{start:n.range.start,end:n.range.end,startAsUtc:r?a+n.range.start:NaN,endAsUtc:r?a+n.range.end:NaN,size:n.range.end-n.range.start}},getInitialMediaSettingsFor:function(t){if(!g)throw r;return T.getInitialSettings(t)},getLowLatencyModeEnabled:function(){if(!h)throw e;return Q.getLowLatencyModeEnabled()},getManifest:function(){return nt.getValue()},getOfflineController:function(){return Dt()},getPlaybackRate:function(){return Tt().playbackRate},getProtectionController:function(){return Ct()},getRawThroughputData:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w.A.VIDEO;return E?E.getRawThroughputData(t):[]},getRepresentationsByType:function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!m)throw t;let a=n?W.getStreamById(n):kt();return a?a.getRepresentationsByType(e):[]},getSafeAverageThroughput:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w.A.VIDEO,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN;return E?E.getSafeAverageThroughput(t,e,n):0},getSettings:function(){return l.get()},getSource:function(){if(!d)throw a;return d},getStreamsFromManifest:function(e){if(!m)throw t;return F.getStreamsInfo(e)},getTTMLRenderingDiv:function(){return it?it.getTTMLRenderingDiv():null},getTargetLiveDelay:function(){if(!h)throw e;return Q.getOriginalLiveDelay()},getTracksFor:St,getTracksForTypeFromManifest:function(e,n,a){if(!m)throw t;return(a=a||F.getStreamsInfo(n,1)[0])?F.getAllMediaInfoForType(a,e,n):[]},getVersion:ft,getVideoElement:Tt,getVolume:function(){return Tt().volume},getXHRWithCredentialsForType:function(t){return j.getXHRWithCredentialsForType(t)},initialize:function(t,e,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:NaN;H||(H=(0,si.A)(i).getInstance(),H.setConfig({settings:l,protectionController:x})),B||(B=li(i).getInstance()),H.supportsMediaSource()?(g||(g=!0,A=pl(i).getInstance(),E||(E=Xl(i).getInstance()),y||(y=co(i).getInstance()),_||(_=Un(i).getInstance()),Q||(Q=M(i).getInstance()),T||(T=mr(i).getInstance()),W||(W=Da(i).getInstance()),X||(X=Ma(i).getInstance()),tt||(tt=Oa(i).getInstance()),Z||(Z=ja(i).getInstance()),J||(J=ha(i).getInstance()),Y||(Y=ci(i).getInstance()),F=Ko(i).getInstance(),nt=hi(i).getInstance(),at=an(i).getInstance(),rt=In(i).getInstance(),ut=Dn(i).getInstance(),et=ul(i).getInstance({settings:l}),lt=To(i).getInstance({settings:l}),F.setConfig({constants:w.A,cea608parser:new v,errHandler:B,BASE64:_l}),q||(q=Rr(i).create()),q.setConfig({adapter:F,contentSteeringController:J}),Z.setConfig({adapter:F}),st||(st=Do(i).getInstance({dashMetrics:et,mediaPlayerModel:U,errHandler:B,baseURLController:q,events:R.A,eventBus:o,debug:s,boxParser:na(i).getInstance(),errors:V})),T.setConfig({domStorage:lt,settings:l,mediaPlayerModel:U,customParametersModel:j,videoModel:it}),U.setConfig({playbackController:Q,serviceDescriptionController:Z}),J.setConfig({adapter:F,errHandler:B,dashMetrics:et,mediaPlayerModel:U,manifestModel:nt,serviceDescriptionController:Z,throughputController:E,eventBus:o}),_t(),Et(void 0===n||n),Dt()),t&&vt(t),e&&It(e,a),c.info("[dash.js "+ft()+"] MediaPlayer has been initialized")):B.error(new G.A(V.CAPABILITY_MEDIASOURCE_ERROR_CODE,V.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},isDynamic:mt,isMuted:function(){return Tt().muted},isPaused:gt,isReady:dt,isSeeking:function(){if(!h)throw e;return Q.isSeeking()},isTextEnabled:function(){const t=W.getActiveStreamInfo();return!(!t||!$)&&$.isTextEnabled(t)},off:function(t,e,n){o.off(t,e,n)},on:function(t,e,n,a){o.on(t,e,n,a)},pause:function(){if(!h)throw e;Q.pause()},play:function(){if(!h)throw e;(!p||gt()&&h)&&Q.play(!0)},preload:function(){if(!it.getElement()&&!m){if(!d)throw a;xt(b)}},provideThumbnail:function(t,e){if("function"!=typeof e)return;if(t<0)return void e(null);const n=Q.getIsDynamic()?ht(t):t,a=W.getStreamForTime(n);if(null===a)return void e(null);const r=a.getThumbnailController();if(r)return r.provide(n,e);e(null)},refreshManifest:function(t){if(!g)throw r;if(!dt())return t(null,a);let e=this;if("function"==typeof t){const n=function(a){o.off(R.A.INTERNAL_MANIFEST_LOADED,n,e),a.error?t(null,a.error):t(a.manifest)};o.on(R.A.INTERNAL_MANIFEST_LOADED,n,e)}W.refreshManifest()},registerCustomCapabilitiesFilter:function(t){j.registerCustomCapabilitiesFilter(t)},registerLicenseRequestFilter:function(t){j.registerLicenseRequestFilter(t)},registerLicenseResponseFilter:function(t){j.registerLicenseResponseFilter(t)},removeABRCustomRule:function(t){j.removeAbrCustomRule(t)},removeAllABRCustomRule:function(){j.removeAllAbrCustomRule()},removeRequestInterceptor:function(t){j.removeRequestInterceptor(t)},removeResponseInterceptor:function(t){j.removeResponseInterceptor(t)},removeUTCTimingSource:function(t,e){j.removeUTCTimingSource(t,e)},reset:ct,resetCustomInitialTrackSelectionFunction:function(){j.resetCustomInitialTrackSelectionFunction(null)},resetSettings:function(){l.reset()},restoreDefaultUTCTimingSources:_t,retrieveManifest:function(t,e){let n=Nt(),a=this;const r=function(t){t.error?e(null,t.error):e(t.manifest),o.off(R.A.INTERNAL_MANIFEST_LOADED,r,a),n.reset()};o.on(R.A.INTERNAL_MANIFEST_LOADED,r,a),ot.initialize(t),n.load(t)},seek:function(t){if(!h)throw e;if((0,yt.sq)(t,"number"),isNaN(t))throw w.A.BAD_ARGUMENT_ERROR;t<0&&(t=0);let n=Q.getIsDynamic()?ht(t):t;const a=Tt();!Q.getIsDynamic()&&a.duration&&(n=Math.min(a.duration,n)),Q.seek(n,!1,!1,!0)},seekToOriginalLive:function(){h&&mt()&&Q.seekToOriginalLive()},seekToPresentationTime:function(t){if(!h)throw e;if((0,yt.sq)(t,"number"),isNaN(t))throw w.A.BAD_ARGUMENT_ERROR;t<0&&(t=0);const n=Tt();if(!Q.getIsDynamic()&&n.duration&&(t=Math.min(n.duration,t)),Q.getIsDynamic()){const e=W&&W.hasVideoTrack()?w.A.VIDEO:w.A.AUDIO;let n=et.getCurrentDVRInfo(e);if(!n)return;(t=pt(t,n))1&&void 0!==arguments[1]&&arguments[1];if(!m)throw t;!x||x.areKeyIdsUsable(e.normalizedKeyIds)?T.setTrack(e,{noSettingsSave:n}):c.error(`Can not switch to track with index ${e.index} because key is not usable`)},setCustomInitialTrackSelectionFunction:function(t){j.setCustomInitialTrackSelectionFunction(t)},setInitialMediaSettingsFor:function(t,e){if(!g)throw r;let n=function(t){const e=l.get().streaming.defaultSchemeIdUri;let n={};function a(t,e,n){let a={};if(e){if(e instanceof Array)throw"Array type not supported for settings!";return e instanceof Object?(a.schemeIdUri=e.schemeIdUri?e.schemeIdUri:"",a.value=e.value?e.value:""):(a.schemeIdUri=n,a.value=e,c.warn("No schemeIdUri provided for "+t+', using default "'+n+'"')),a}return null}return void 0!==t.id&&(n.id=t.id),void 0!==t.lang&&(n.lang=t.lang),isNaN(t.index)||(n.index=t.index),void 0!==t.viewpoint&&(n.viewpoint=a("viewpoint",t.viewpoint,e.viewpoint)),void 0!==t.audioChannelConfiguration&&(n.audioChannelConfiguration=a("audioChannelConfiguration",t.audioChannelConfiguration,e.audioChannelConfiguration)),void 0!==t.role&&(n.role=a("role",t.role,e.role),n.role.schemeIdUri===w.A.DASH_ROLE_SCHEME_ID&&"Main"===n.role.value&&(n.role.value=S.A.MAIN)),void 0!==t.accessibility&&(n.accessibility=a("accessibility",t.accessibility,e.accessibility)),n}(e);T.setInitialSettings(t,n)},setMute:function(t){(0,yt.sq)(t,"boolean"),Tt().muted=t},setPlaybackRate:function(t){Tt().playbackRate=t},setProtectionData:function(t){f=t,W&&W.setProtectionData(f)},setRepresentationForTypeById:function(e,n){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e!==w.A.IMAGE&&e!==w.A.VIDEO&&e!==w.A.AUDIO)return;if(!m)throw t;const r=kt();if(r)if(e===w.A.IMAGE){const t=r.getThumbnailController();t&&t.setTrackById(n)}else{const t=r.getRepresentationForTypeById(e,n);t&&y.setPlaybackQuality(e,W.getActiveStreamInfo(),t,{forceReplace:a})}},setRepresentationForTypeByIndex:function(e,n){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e!==w.A.IMAGE&&e!==w.A.VIDEO&&e!==w.A.AUDIO)return;if(!m)throw t;const r=kt();if(r)if(e===w.A.IMAGE){const t=r.getThumbnailController();t&&t.setTrackByIndex(n)}else{const t=r.getRepresentationForTypeByIndex(e,n);t&&y.setPlaybackQuality(e,W.getActiveStreamInfo(),t,{forceReplace:a})}},setTextTrack:function(t){if(!h)throw e;const n=W.getActiveStreamInfo();n&&$&&$.setTextTrack(n.id,t)},setVolume:function(t){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw w.A.BAD_ARGUMENT_ERROR;Tt().volume=t},setXHRWithCredentialsForType:function(t,e){j.setXHRWithCredentialsForType(t,e)},time:bt,timeAsUTC:function(){if(!h)throw e;if(!Q.getIsDynamic()||bt()<0)return NaN;const t=W&&W.hasVideoTrack()?w.A.VIDEO:w.A.AUDIO;let n,a,r=et.getCurrentDVRInfo(t);return r?(n=r.manifestInfo.availableFrom.getTime()/1e3,a=n+bt(),a):0},timeInDvrWindow:function(){if(!h)throw e;if(!Q.getIsDynamic())return bt();let t=Tt().currentTime;const n=W&&W.hasVideoTrack()?w.A.VIDEO:w.A.AUDIO;let a=et.getCurrentDVRInfo(n);return t=null===a||0===t?0:Math.max(0,t-a.range.start),t},trigger:function(t,e,n){o.trigger(t,e,n)},triggerSteeringRequest:function(){if(J)return J.loadSteeringData()},unregisterCustomCapabilitiesFilter:function(t){j.unregisterCustomCapabilitiesFilter(t)},unregisterLicenseRequestFilter:function(t){j.unregisterLicenseRequestFilter(t)},unregisterLicenseResponseFilter:function(t){j.unregisterLicenseResponseFilter(t)},updateSettings:function(t){l.update(t)},updateSource:function(t){d=t,W.load(d)}},c=s.getLogger(u),g=!1,h=!1,m=!1,p=!0,b=NaN,x=null,P=null,f=null,F=null,st=null,R.A.extend(D.A),U=bi(i).getInstance(),j=(0,kn.A)(i).getInstance(),it=mo(i).getInstance(),ot=gi(i).getInstance(),u}Ql.__dashjs_factory_name="MediaPlayer";const Zl=N.A.getClassFactory(Ql);Zl.events=D.A,Zl.errors=V,N.A.updateClassFactory(Ql.__dashjs_factory_name,Zl);var Jl=Zl},1191:function(t,e,n){"use strict";var a=n(7252);class r extends a.A{constructor(){super(),this.AST_IN_FUTURE="astInFuture",this.BASE_URLS_UPDATED="baseUrlsUpdated",this.BUFFER_EMPTY="bufferStalled",this.BUFFER_LOADED="bufferLoaded",this.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",this.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",this.DVB_FONT_DOWNLOAD_ADDED="dvbFontDownloadAdded",this.DVB_FONT_DOWNLOAD_COMPLETE="dvbFontDownloadComplete",this.DVB_FONT_DOWNLOAD_FAILED="dvbFontDownloadFailed",this.DYNAMIC_TO_STATIC="dynamicToStatic",this.ERROR="error",this.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",this.FRAGMENT_LOADING_PROGRESS="fragmentLoadingProgress",this.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",this.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",this.LOG="log",this.MANIFEST_LOADING_STARTED="manifestLoadingStarted",this.MANIFEST_LOADING_FINISHED="manifestLoadingFinished",this.MANIFEST_LOADED="manifestLoaded",this.METRICS_CHANGED="metricsChanged",this.METRIC_CHANGED="metricChanged",this.METRIC_ADDED="metricAdded",this.METRIC_UPDATED="metricUpdated",this.PERIOD_SWITCH_STARTED="periodSwitchStarted",this.PERIOD_SWITCH_COMPLETED="periodSwitchCompleted",this.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",this.QUALITY_CHANGE_RENDERED="qualityChangeRendered",this.NEW_TRACK_SELECTED="newTrackSelected",this.TRACK_CHANGE_RENDERED="trackChangeRendered",this.STREAM_INITIALIZING="streamInitializing",this.STREAM_UPDATED="streamUpdated",this.STREAM_ACTIVATED="streamActivated",this.STREAM_DEACTIVATED="streamDeactivated",this.STREAM_INITIALIZED="streamInitialized",this.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",this.TEXT_TRACKS_ADDED="allTextTracksAdded",this.TEXT_TRACK_ADDED="textTrackAdded",this.CUE_ENTER="cueEnter",this.CUE_EXIT="cueExit",this.THROUGHPUT_MEASUREMENT_STORED="throughputMeasurementStored",this.TTML_PARSED="ttmlParsed",this.TTML_TO_PARSE="ttmlToParse",this.CAPTION_RENDERED="captionRendered",this.CAPTION_CONTAINER_RESIZE="captionContainerResize",this.CAN_PLAY="canPlay",this.CAN_PLAY_THROUGH="canPlayThrough",this.PLAYBACK_ENDED="playbackEnded",this.PLAYBACK_ERROR="playbackError",this.PLAYBACK_INITIALIZED="playbackInitialized",this.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",this.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",this.PLAYBACK_LOADED_DATA="playbackLoadedData",this.PLAYBACK_PAUSED="playbackPaused",this.PLAYBACK_PLAYING="playbackPlaying",this.PLAYBACK_PROGRESS="playbackProgress",this.PLAYBACK_RATE_CHANGED="playbackRateChanged",this.PLAYBACK_SEEKED="playbackSeeked",this.PLAYBACK_SEEKING="playbackSeeking",this.PLAYBACK_STALLED="playbackStalled",this.PLAYBACK_STARTED="playbackStarted",this.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",this.PLAYBACK_VOLUME_CHANGED="playbackVolumeChanged",this.PLAYBACK_WAITING="playbackWaiting",this.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",this.EVENT_MODE_ON_START="eventModeOnStart",this.EVENT_MODE_ON_RECEIVE="eventModeOnReceive",this.CONFORMANCE_VIOLATION="conformanceViolation",this.REPRESENTATION_SWITCH="representationSwitch",this.ADAPTATION_SET_REMOVED_NO_CAPABILITIES="adaptationSetRemovedNoCapabilities",this.CONTENT_STEERING_REQUEST_COMPLETED="contentSteeringRequestCompleted",this.INBAND_PRFT="inbandPrft",this.MANAGED_MEDIA_SOURCE_START_STREAMING="managedMediaSourceStartStreaming",this.MANAGED_MEDIA_SOURCE_END_STREAMING="managedMediaSourceEndStreaming"}}let i=new r;e.A=i},5212:function(t,e){"use strict";e.A={STREAM:"stream",VIDEO:"video",AUDIO:"audio",TEXT:"text",MUXED:"muxed",IMAGE:"image",STPP:"stpp",TTML:"ttml",VTT:"vtt",WVTT:"wvtt",CONTENT_STEERING:"contentSteering",LIVE_CATCHUP_MODE_DEFAULT:"liveCatchupModeDefault",LIVE_CATCHUP_MODE_LOLP:"liveCatchupModeLoLP",MOVING_AVERAGE_SLIDING_WINDOW:"slidingWindow",MOVING_AVERAGE_EWMA:"ewma",BAD_ARGUMENT_ERROR:"Invalid Arguments",MISSING_CONFIG_ERROR:"Missing config parameter(s)",TRACK_SWITCH_MODE_ALWAYS_REPLACE:"alwaysReplace",TRACK_SWITCH_MODE_NEVER_REPLACE:"neverReplace",TRACK_SELECTION_MODE_FIRST_TRACK:"firstTrack",TRACK_SELECTION_MODE_HIGHEST_BITRATE:"highestBitrate",TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:"highestEfficiency",TRACK_SELECTION_MODE_WIDEST_RANGE:"widestRange",CMCD_QUERY_KEY:"CMCD",CMCD_MODE_QUERY:"query",CMCD_MODE_HEADER:"header",CMCD_AVAILABLE_KEYS:["br","d","ot","tb","bl","dl","mtp","nor","nrr","su","bs","rtp","cid","pr","sf","sid","st","v"],CMCD_V2_AVAILABLE_KEYS:["msd","ltc"],CMCD_AVAILABLE_REQUESTS:["segment","mpd","xlink","steering","other"],INITIALIZE:"initialize",TEXT_SHOWING:"showing",TEXT_HIDDEN:"hidden",TEXT_DISABLED:"disabled",ACCESSIBILITY_CEA608_SCHEME:"urn:scte:dash:cc:cea-608:2015",CC1:"CC1",CC3:"CC3",UTF8:"utf-8",SCHEME_ID_URI:"schemeIdUri",START_TIME:"starttime",SERVICE_DESCRIPTION_DVB_LL_SCHEME:"urn:dvb:dash:lowlatency:scope:2019",SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME:"urn:dvb:dash:lowlatency:critical:2019",CTA_5004_2023_SCHEME:"urn:mpeg:dash:cta-5004:2023",THUMBNAILS_SCHEME_ID_URIS:["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"],FONT_DOWNLOAD_DVB_SCHEME:"urn:dvb:dash:fontdownload:2014",COLOUR_PRIMARIES_SCHEME_ID_URI:"urn:mpeg:mpegB:cicp:ColourPrimaries",URL_QUERY_INFO_SCHEME:"urn:mpeg:dash:urlparam:2014",EXT_URL_QUERY_INFO_SCHEME:"urn:mpeg:dash:urlparam:2016",MATRIX_COEFFICIENTS_SCHEME_ID_URI:"urn:mpeg:mpegB:cicp:MatrixCoefficients",TRANSFER_CHARACTERISTICS_SCHEME_ID_URI:"urn:mpeg:mpegB:cicp:TransferCharacteristics",HDR_METADATA_FORMAT_SCHEME_ID_URI:"urn:dvb:dash:hdr-dmi",HDR_METADATA_FORMAT_VALUES:{ST2094_10:"ST2094-10",SL_HDR2:"SL-HDR2",ST2094_40:"ST2094-40"},MEDIA_CAPABILITIES_API:{COLORGAMUT:{SRGB:"srgb",P3:"p3",REC2020:"rec2020"},TRANSFERFUNCTION:{SRGB:"srgb",PQ:"pq",HLG:"hlg"},HDR_METADATATYPE:{SMPTE_ST_2094_10:"smpteSt2094-10",SLHDR2:"slhdr2",SMPTE_ST_2094_40:"smpteSt2094-40"}},XML:"XML",ARRAY_BUFFER:"ArrayBuffer",DVB_REPORTING_URL:"dvb:reportingUrl",DVB_PROBABILITY:"dvb:probability",OFF_MIMETYPE:"application/font-sfnt",WOFF_MIMETYPE:"application/font-woff",VIDEO_ELEMENT_READY_STATES:{HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4},FILE_LOADER_TYPES:{FETCH:"fetch_loader",XHR:"xhr_loader"},THROUGHPUT_TYPES:{LATENCY:"throughput_type_latency",BANDWIDTH:"throughput_type_bandwidth"},THROUGHPUT_CALCULATION_MODES:{EWMA:"throughputCalculationModeEwma",ZLEMA:"throughputCalculationModeZlema",ARITHMETIC_MEAN:"throughputCalculationModeArithmeticMean",BYTE_SIZE_WEIGHTED_ARITHMETIC_MEAN:"throughputCalculationModeByteSizeWeightedArithmeticMean",DATE_WEIGHTED_ARITHMETIC_MEAN:"throughputCalculationModeDateWeightedArithmeticMean",HARMONIC_MEAN:"throughputCalculationModeHarmonicMean",BYTE_SIZE_WEIGHTED_HARMONIC_MEAN:"throughputCalculationModeByteSizeWeightedHarmonicMean",DATE_WEIGHTED_HARMONIC_MEAN:"throughputCalculationModeDateWeightedHarmonicMean"},LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE:{MOOF_PARSING:"lowLatencyDownloadTimeCalculationModeMoofParsing",DOWNLOADED_DATA:"lowLatencyDownloadTimeCalculationModeDownloadedData",AAST:"lowLatencyDownloadTimeCalculationModeAast"},RULES_TYPES:{QUALITY_SWITCH_RULES:"qualitySwitchRules",ABANDON_FRAGMENT_RULES:"abandonFragmentRules"},QUALITY_SWITCH_RULES:{BOLA_RULE:"BolaRule",THROUGHPUT_RULE:"ThroughputRule",INSUFFICIENT_BUFFER_RULE:"InsufficientBufferRule",SWITCH_HISTORY_RULE:"SwitchHistoryRule",DROPPED_FRAMES_RULE:"DroppedFramesRule",LEARN_TO_ADAPT_RULE:"L2ARule",LOL_PLUS_RULE:"LoLPRule"},ABANDON_FRAGMENT_RULES:{ABANDON_REQUEST_RULE:"AbandonRequestsRule"},ID3_SCHEME_ID_URI:"https://aomedia.org/emsg/ID3",COMMON_ACCESS_TOKEN_HEADER:"common-access-token",DASH_ROLE_SCHEME_ID:"urn:mpeg:dash:role:2011",CODEC_FAMILIES:{MP3:"mp3",AAC:"aac",AC3:"ac3",EC3:"ec3",DTSX:"dtsx",DTSC:"dtsc",AVC:"avc",HEVC:"hevc"}}},2861:function(t,e){"use strict";e.A={CLEARKEY_KEYSTEM_STRING:"org.w3.clearkey",WIDEVINE_KEYSTEM_STRING:"com.widevine.alpha",PLAYREADY_KEYSTEM_STRING:"com.microsoft.playready",PLAYREADY_RECOMMENDATION_KEYSTEM_STRING:"com.microsoft.playready.recommendation",WIDEVINE_UUID:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",PLAYREADY_UUID:"9a04f079-9840-4286-ab92-e65be0885f95",CLEARKEY_UUID:"e2719d58-a985-b3c9-781a-b030af78d30e",W3C_CLEARKEY_UUID:"1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",INITIALIZATION_DATA_TYPE_CENC:"cenc",INITIALIZATION_DATA_TYPE_KEYIDS:"keyids",INITIALIZATION_DATA_TYPE_WEBM:"webm",ENCRYPTION_SCHEME_CENC:"cenc",ENCRYPTION_SCHEME_CBCS:"cbcs",MEDIA_KEY_MESSAGE_TYPES:{LICENSE_REQUEST:"license-request",LICENSE_RENEWAL:"license-renewal",LICENSE_RELEASE:"license-release",INDIVIDUALIZATION_REQUEST:"individualization-request"},ROBUSTNESS_STRINGS:{WIDEVINE:{SW_SECURE_CRYPTO:"SW_SECURE_CRYPTO",SW_SECURE_DECODE:"SW_SECURE_DECODE",HW_SECURE_CRYPTO:"HW_SECURE_CRYPTO",HW_SECURE_DECODE:"HW_SECURE_DECODE",HW_SECURE_ALL:"HW_SECURE_ALL"}},MEDIA_KEY_STATUSES:{USABLE:"usable",EXPIRED:"expired",RELEASED:"released",OUTPUT_RESTRICTED:"output-restricted",OUTPUT_DOWNSCALED:"output-downscaled",STATUS_PENDING:"status-pending",INTERNAL_ERROR:"internal-error"}}},4469:function(t,e,n){"use strict";n.d(e,{default:function(){return K}});class a{constructor(){this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null}}a.SSL_CONNECTION_FAILED_PREFIX="SSL",a.DNS_RESOLUTION_FAILED="C00",a.HOST_UNREACHABLE="C01",a.CONNECTION_REFUSED="C02",a.CONNECTION_ERROR="C03",a.CORRUPT_MEDIA_ISOBMFF="M00",a.CORRUPT_MEDIA_OTHER="M01",a.BASE_URL_CHANGED="F00",a.BECAME_REPORTER="S00";var r=a,i=n(913),o=n(138);function l(t){let e,n;const a=(t=t||{}).eventBus,o=t.dashMetrics,l=t.metricsConstants,s=t.events;function u(t){let e=new r;if(n){for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.mpdurl||(e.mpdurl=n.originalUrl||n.url),e.terror||(e.terror=new Date),o.addDVBErrors(e)}}function c(t){t.error||(n=t.manifest)}function d(t){u({errorcode:r.BASE_URL_CHANGED,servicelocation:t.entry})}function f(){u({errorcode:r.BECAME_REPORTER})}function g(t){var e;t.metric===l.HTTP_REQUEST&&(0===(e=t.value).responsecode||null==e.responsecode||e.responsecode>=400||e.responsecode<100||e.responsecode>=600)&&u({errorcode:e.responsecode||r.CONNECTION_ERROR,url:e.url,terror:e.tresponse,servicelocation:e._serviceLocation})}function m(t){let e;switch(t.error?t.error.code:0){case MediaError.MEDIA_ERR_NETWORK:e=r.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:e=r.CORRUPT_MEDIA_OTHER;break;default:return}u({errorcode:e})}return e={initialize:function(){a.on(s.MANIFEST_UPDATED,c,e),a.on(s.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,d,e),a.on(s.METRIC_ADDED,g,e),a.on(s.METRIC_UPDATED,g,e),a.on(s.PLAYBACK_ERROR,m,e),a.on(i.A.BECAME_REPORTING_PLAYER,f,e)},reset:function(){a.off(s.MANIFEST_UPDATED,c,e),a.off(s.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,d,e),a.off(s.METRIC_ADDED,g,e),a.off(s.METRIC_UPDATED,g,e),a.off(s.PLAYBACK_ERROR,m,e),a.off(i.A.BECAME_REPORTING_PLAYER,f,e)}},e}l.__dashjs_factory_name="DVBErrorsTranslator";var s=o.A.getSingletonFactory(l),u=n(7377);function c(t){t=t||{};let e,n,a=!1,r=this.context,i=t.mediaElement;return e={initialize:function(t){t&&t.length&&(t.forEach((t=>{let e=t.starttime,a=e+t.duration;n.add(e,a)})),a=!!t[0]._useWallClockTime)},reset:function(){n.clear()},isEnabled:function(){let t,e=n.length;if(!e)return!0;t=a?(new Date).getTime()/1e3:i.currentTime;for(let a=0;a=200&&r.status<300)&&(n&&n()))};c.push(r);try{r.open("GET",t),r.onloadend=i,r.onerror=i,r.send()}catch(t){r.onerror()}}(r,0,(function(){o=!1}))}))},initialize:function(t,e){let n;if(s=e,l=t.dvbReportingUrl,!l)throw new Error("required parameter missing (dvb:reportingUrl)");i||(n=t.dvbProbability,n&&(1e3===n||n/1e3>=r.random())&&(o=!0),i=!0)},reset:function(){f()}},n=g(u).getInstance(),r=h(u).getInstance(),a=(0,p.A)(u).getInstance(),f(),e}b.__dashjs_factory_name="DVBReporting";var y=o.A.getClassFactory(b);function E(t){t=t||{};const e={"urn:dvb:dash:reporting:2014":y},n=this.context;let a;const r=t.debug?t.debug.getLogger(a):{},i=t.metricsConstants,o=t.mediaPlayerModel||{};return a={create:function(t,a){let l;try{l=e[t.schemeIdUri](n).create({metricsConstants:i,mediaPlayerModel:o}),l.initialize(t,a)}catch(e){l=null,r.error(`ReportingFactory: could not create Reporting with schemeIdUri ${t.schemeIdUri} (${e.message})`)}return l},register:function(t,n){e[t]=n},unregister:function(t){delete e[t]}},a}E.__dashjs_factory_name="ReportingFactory";var _=o.A.getSingletonFactory(E);function A(t){let e,n=[];const a=_(this.context).getInstance(t);return e={initialize:function(t,e){t.some((t=>{let r=a.create(t,e);if(r)return n.push(r),!0}))},reset:function(){n.forEach((t=>t.reset())),n=[]},report:function(t,e){n.forEach((n=>n.report(t,e)))}},e}A.__dashjs_factory_name="ReportingController";var T=o.A.getClassFactory(A);function v(){return{reconstructFullMetricName:function(t,e,n){let a=t;return e&&(a+="("+e,n&&n.length&&(a+=","+n),a+=")"),a},validateN:function(t){if(!t)throw new Error("missing n");if(isNaN(t))throw new Error("n is NaN");if(t<0)throw new Error("n must be positive");return t}}}v.__dashjs_factory_name="HandlerHelpers";var w=o.A.getSingletonFactory(v);function S(t){let e,n,a,r,i,o;t=t||{};let l=this.context,s=w(l).getInstance(),u=[];const c=t.metricsConstants;function d(){let t=function(){try{return Object.keys(u).map((t=>u[t])).reduce(((t,e)=>t.level{e.handleNewMetric(t.metric,t.value,t.mediaType)}))}return e={initialize:function(t,a){t.split(",").forEach(((t,e,r)=>{let i;if(-1!==t.indexOf("(")&&-1===t.indexOf(")")){let n=r[e+1];n&&-1===n.indexOf("(")&&-1!==n.indexOf(")")&&(t+=","+n,delete r[e+1])}i=o.create(t,a),i&&n.push(i)})),r.on(i.METRIC_ADDED,l,e),r.on(i.METRIC_UPDATED,l,e)},reset:function(){r.off(i.METRIC_ADDED,l,e),r.off(i.METRIC_UPDATED,l,e),n.forEach((t=>t.reset())),n=[]}},e}z.__dashjs_factory_name="MetricsHandlersController";var O=o.A.getClassFactory(z);function L(t){let e,n,a,r;t=t||{};let i=this.context;function o(){e&&e.reset(),n&&n.reset(),a&&a.reset()}return r={initialize:function(r){try{a=d(i).create({mediaElement:t.mediaElement}),a.initialize(r.Range),n=T(i).create({debug:t.debug,metricsConstants:t.metricsConstants,mediaPlayerModel:t.mediaPlayerModel}),n.initialize(r.Reporting,a),e=O(i).create({debug:t.debug,eventBus:t.eventBus,metricsConstants:t.metricsConstants,events:t.events}),e.initialize(r.metrics,n)}catch(t){throw o(),t}},reset:o},r}L.__dashjs_factory_name="MetricsController";var P=o.A.getClassFactory(L),F=class{constructor(){this.metrics="",this.Range=[],this.Reporting=[]}},U=class{constructor(){this.starttime=0,this.duration=1/0,this._useWallClockTime=!1}},j=class{constructor(){this.schemeIdUri="",this.value="",this.dvbReportingUrl="",this.dvbProbability=1e3}};function B(t){let e,n=(t=t||{}).adapter;const a=t.constants;return e={getMetrics:function(t){let e=[];return t&&t.Metrics&&t.Metrics.forEach((r=>{var i=new F,o=n.getIsDynamic(t);r.hasOwnProperty("metrics")&&(i.metrics=r.metrics,r.Range&&r.Range.forEach((e=>{var r=new U;r.starttime=function(t,e,r){let i,o,l=0;return e?l=n.getAvailabilityStartTime(t)/1e3:(i=n.getRegularPeriods(t),i.length&&(l=i[0].start)),o=l,r&&r.hasOwnProperty(a.START_TIME)&&(o+=r.starttime),o}(t,o,e),e.hasOwnProperty("duration")?r.duration=e.duration:r.duration=n.getDuration(t),r._useWallClockTime=o,i.Range.push(r)})),r.Reporting&&(r.Reporting.forEach((t=>{var e=new j;t.hasOwnProperty(a.SCHEME_ID_URI)&&(e.schemeIdUri=t.schemeIdUri,t.hasOwnProperty("value")&&(e.value=t.value),t.hasOwnProperty(a.DVB_REPORTING_URL)&&(e.dvbReportingUrl=t[a.DVB_REPORTING_URL]),t.hasOwnProperty(a.DVB_PROBABILITY)&&(e.dvbProbability=t[a.DVB_PROBABILITY]),i.Reporting.push(e))})),e.push(i)))})),e}},e}B.__dashjs_factory_name="ManifestParsing";var q=o.A.getSingletonFactory(B);function G(t){let e;t=t||{};let n={},a=this.context,r=t.eventBus;const o=t.events;function l(e){if(e.error)return;let o=Object.keys(n);q(a).getInstance({adapter:t.adapter,constants:t.constants}).getMetrics(e.manifest).forEach((e=>{const r=JSON.stringify(e);if(n.hasOwnProperty(r))o.splice(r,1);else try{let i=P(a).create(t);i.initialize(e),n[r]=i}catch(t){}})),o.forEach((t=>{n[t].reset(),delete n[t]})),r.trigger(i.A.METRICS_INITIALISATION_COMPLETE)}function s(){Object.keys(n).forEach((t=>{n[t].reset()})),n={}}return e={reset:function(){r.off(o.MANIFEST_UPDATED,l,e),r.off(o.STREAM_TEARDOWN_COMPLETE,s,e)}},r.on(o.MANIFEST_UPDATED,l,e),r.on(o.STREAM_TEARDOWN_COMPLETE,s,e),e}G.__dashjs_factory_name="MetricsCollectionController";var H=o.A.getClassFactory(G);function Y(){let t,e,n=this.context;return t={createMetricsReporting:function(t){return e=s(n).getInstance({eventBus:t.eventBus,dashMetrics:t.dashMetrics,metricsConstants:t.metricsConstants,events:t.events}),e.initialize(),H(n).create(t)},getReportingFactory:function(){return _(n).getInstance()},getMetricsHandlerFactory:function(){return M(n).getInstance()}},t}Y.__dashjs_factory_name="MetricsReporting";const V=dashjs.FactoryMaker.getClassFactory(Y);V.events=i.A,dashjs.FactoryMaker.updateClassFactory(Y.__dashjs_factory_name,V);var K=V},913:function(t,e,n){"use strict";var a=n(7252);class r extends a.A{constructor(){super(),this.METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",this.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",this.CMCD_DATA_GENERATED="cmcdDataGenerated"}}let i=new r;e.A=i},1926:function(t,e,n){"use strict";var a=n(5717),r=n(138),i=n(8261),o=n(656),l=n(5212);function s(){let t,e,n,r,s,u,c,d,f,g;const m=this.context,h=(0,i.A)(m).getInstance();function p(){r=[],s=[],u=[],c=[],d=[],g=[],f=null,e=[]}function b(t,e){let n=-1;t.some(((t,a)=>{if(t===e)return n=a,!0})),n<0||t.splice(n,1)}function y(t){let e;for(e=0;e{t(e,a)}))},unregisterCustomCapabilitiesFilter:function(t){b(d,t)},unregisterLicenseRequestFilter:function(t){b(u,t)},unregisterLicenseResponseFilter:function(t){b(c,t)}},n={default:!1},p(),t}s.__dashjs_factory_name="CustomParametersModel",e.A=r.A.getSingletonFactory(s)},3888:function(t,e,n){"use strict";n.d(e,{default:function(){return mt}});var a=n(8854),r=n(2861);const i={prefixes:["clearkey","dashif","ck"]};class o{static findMp4ProtectionElement(t){let e=null;for(let n=0;n0&&(e+=4+16*n.getUint32(e)),e+=4,t.slice(e)}static getPSSHForKeySystem(t,e){let n=o.parsePSSHList(e);return t&&n.hasOwnProperty(t.uuid.toLowerCase())?n[t.uuid.toLowerCase()]:null}static parseInitDataFromContentProtection(t,e){return"pssh"in t&&t.pssh?(t.pssh.__text=t.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),e.decodeArray(t.pssh.__text).buffer):null}static parsePSSHList(t){if(null==t)return[];let e=new DataView(t.buffer||t),n={},a=0;for(;;){let t,r,i,o,l,s,u=a;if(a>=e.buffer.byteLength)break;if(t=e.getUint32(a),r=a+t,a+=4,1886614376===e.getUint32(a))if(a+=4,i=e.getUint8(a),0===i||1===i){for(a++,a+=3,o="",l=0;l<4;l++)s=e.getUint8(a+l).toString(16),o+=1===s.length?"0"+s:s;for(a+=4,o+="-",l=0;l<2;l++)s=e.getUint8(a+l).toString(16),o+=1===s.length?"0"+s:s;for(a+=2,o+="-",l=0;l<2;l++)s=e.getUint8(a+l).toString(16),o+=1===s.length?"0"+s:s;for(a+=2,o+="-",l=0;l<2;l++)s=e.getUint8(a+l).toString(16),o+=1===s.length?"0"+s:s;for(a+=2,o+="-",l=0;l<6;l++)s=e.getUint8(a+l).toString(16),o+=1===s.length?"0"+s:s;a+=6,o=o.toLowerCase(),a+=4,n[o]=e.buffer.slice(u,r),a=r}else a=r;else a=r}return n}static getLicenseServerUrlFromMediaInfo(t,e){try{if(!t||0===t.length)return null;let n=0,a=null;for(;n0){const t=r.contentProtection.filter((t=>t.schemeIdUri&&t.schemeIdUri===e));if(t&&t.length>0){let e=0;for(;e0?o:[r.A.INITIALIZATION_DATA_TYPE_CENC],t&&t.length&&(this.audioCapabilities=t),e&&e.length&&(this.videoCapabilities=e),this.distinctiveIdentifier=n,this.persistentState=a,this.sessionTypes=i}},c=n(1923),d=n(1944),f=class{constructor(t,e,n,a,r,i,o,l){this.url=t,this.method=e,this.responseType=n,this.headers=a,this.withCredentials=r,this.messageType=i,this.sessionId=o,this.data=l}},g=class{constructor(t,e,n){this.url=t,this.headers=e,this.data=n}},m=n(7568),h=n(7263),p=n(5212),b=n(138);function y(t){const e=(t=t||{}).BASE64,n=t.cmcdModel,a=t.constants,i=t.customParametersModel,o=t.debug,b=t.eventBus,y=t.events,E=t.protectionKeyController,_=t.settings;let A,T,v,w,S,I,k,R,N,C,D,x,M=t.protectionModel,z=[];function O(){if(!(b&&b.hasOwnProperty("on")&&E&&E.hasOwnProperty("getSupportedKeySystemMetadataFromContentProtection")))throw new Error("Missing config parameter(s)")}function L(t,n){D||w?D&&P():function(t,n){if(w)return;var a;w=!0;const r=function(t){const e=[];for(let n=0;n(A&&A[t.ks.systemString]&&A[t.ks.systemString].priority>=0?A[t.ks.systemString].priority:a.length)-(A&&A[e.ks.systemString]&&A[e.ks.systemString].priority>=0?A[e.ks.systemString].priority:a.length))));let i;M.requestKeySystemAccess(r).then((t=>(i=t.data,function(t){let e=t&&t.selectedSystemString?t.selectedSystemString:t.keySystem.systemString;return k.info("DRM: KeySystem Access Granted for system string ("+e+")! Selecting key system..."),M.selectKeySystem(t)}(i)))).then((t=>{!function(t,n){D=t,w=!1,b.trigger(y.KEY_SYSTEM_SELECTED,{data:n});const a=B(D);a&&a.serverCertificate&&a.serverCertificate.length>0&&M.setServerCertificate(e.decodeArray(a.serverCertificate).buffer),P()}(t,i)})).catch((t=>{!function(t,e){D=null,w=!1,e||b.trigger(y.KEY_SYSTEM_SELECTED,{data:null,error:new d.A(c.A.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,c.A.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+t.error)})}(t,n)}))}(t,n)}function P(){let t;for(let n=0;n0?e.initDataTypes:[r.A.INITIALIZATION_DATA_TYPE_CENC],l=e&&e.audioRobustness&&e.audioRobustness.length>0?e.audioRobustness:C,c=e&&e.videoRobustness&&e.videoRobustness.length>0?e.videoRobustness:C,d=t.sessionType,f=e&&e.distinctiveIdentifier?e.distinctiveIdentifier:"optional",g=e&&e.persistentState?e.persistentState:"temporary"===d?"optional":"required";return R.forEach((t=>{t.type===a.AUDIO?n.push(new s(t.codec,l)):t.type===a.VIDEO&&i.push(new s(t.codec,c))})),new u(n,i,f,g,[d],o)}function U(t){O(),M.loadKeySession(t)}function j(t){if(t&&function(t){if(!t)return!1;try{const e=M.getSessionTokens();for(let n=0;n{"authorization"===t.toLowerCase()&&(y=!0)})),n&&"boolean"==typeof n.withCredentials&&(y=n.withCredentials);const T=function(t){if(M)if(t.status>=200&&t.status<=299){const n=h.A.parseHttpHeaders(t.getAllResponseHeaders?t.getAllResponseHeaders():null);let r=new g(t.responseURL,n,t.response);X(i.getLicenseResponseFilters(),r).then((()=>{const n=e.getLicenseMessage(r.data,u,o);null!==n?(Y(s),M.updateKeySession(a,n)):$(t,s,u,o,e)}))}else $(t,s,u,o,e)},v=function(t){Y(s,new d.A(c.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,c.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+u+' update, XHR aborted. status is "'+t.statusText+'" ('+t.status+"), readyState is "+t.readyState))},w=function(t){Y(s,new d.A(c.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,c.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+u+' update, XHR error. status is "'+t.statusText+'" ('+t.status+"), readyState is "+t.readyState))},S=D.getLicenseRequestFromMessage(A),I=e.getHTTPMethod(o),k=e.getResponseType(u,o),N=n&&!isNaN(n.httpTimeout)?n.httpTimeout:8e3,C=a.getSessionId()||null;let x=new f(p,I,k,b,y,o,C,S);const z=isNaN(_.get().streaming.retryAttempts[m.G.LICENSE])?3:_.get().streaming.retryAttempts[m.G.LICENSE];X(i.getLicenseRequestFilters(),x).then((()=>{V(x,z,N,T,v,w)}))}(e,u,s)}else Y(p,new d.A(c.A.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,c.A.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function Y(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;b.trigger(y.LICENSE_REQUEST_COMPLETE,{data:t,error:e})}function V(t,e,a,r,i,o){const l=new XMLHttpRequest,s=n.getCmcdParametersFromManifest();if(n.isCmcdEnabled()&&(s.mode?s.mode:_.get().streaming.cmcd.mode)===p.A.CMCD_MODE_QUERY){const e=n.getQueryParameter({url:t.url,type:m.G.LICENSE});e&&(t.url=h.A.addAdditionalQueryParameterToUrl(t.url,[e]))}l.open(t.method,t.url,!0),l.responseType=t.responseType,l.withCredentials=t.withCredentials,a>0&&(l.timeout=a);for(const e in t.headers)l.setRequestHeader(e,t.headers[e]);if(n.isCmcdEnabled()&&(s.mode?s.mode:_.get().streaming.cmcd.mode)===p.A.CMCD_MODE_HEADER){const e=n.getHeaderParameters({url:t.url,type:m.G.LICENSE});if(e)for(const t in e){let n=e[t];n&&l.setRequestHeader(t,n)}}const u=function(){e--;const n=isNaN(_.get().streaming.retryIntervals[m.G.LICENSE])?1e3:_.get().streaming.retryIntervals[m.G.LICENSE];S=setTimeout((function(){V(t,e,a,r,i,o)}),n)};l.onload=function(){I=null,this.status>=200&&this.status<=299||e<=0?r(this):(k.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+e),u())},l.ontimeout=l.onerror=function(){I=null,e<=0?o(this):(k.warn("License request network request failed . Retrying it... Pending retries: "+e),u())},l.onabort=function(){i(this)},b.trigger(y.LICENSE_REQUEST_SENDING,{url:t.url,headers:t.headers,payload:t.data,sessionId:t.sessionId}),I=l,l.send(t.data)}function K(){I&&(I.onloadend=I.onerror=I.onprogress=void 0,I.abort(),I=null),S&&(clearTimeout(S),S=null)}function W(t,e){if(e)for(const n in e)t[n]=e[n]}function $(t,e,n,a,r){let i="NONE",o=null;t.response&&(i=r.getErrorResponse(t.response,n,a),o={serverResponse:t.response||null,responseCode:t.status||null,responseText:t.statusText||null}),Y(e,new d.A(c.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,c.A.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+n+' update, XHR complete. status is "'+t.statusText+'" ('+t.status+"), readyState is "+t.readyState+". Response is "+i,o))}function X(t,e){return t?t.reduce(((t,n)=>t.then((()=>n(e)))),Promise.resolve()):Promise.resolve()}function Q(t,e){if(_.get().streaming.protection.ignoreEmeEncryptedEvent)return;if(k.debug("DRM: onNeedKey"),t.key.initDataType!==r.A.INITIALIZATION_DATA_TYPE_CENC)return void k.warn("DRM: Only 'cenc' initData is supported! Ignoring initData of type: "+t.key.initDataType);if(0===R.length&&(k.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(e=void 0===e?1:e+1)<5))return void z.push(setTimeout((()=>{Q(t,e)}),500));let n=t.key.initData;if(ArrayBuffer.isView(n)&&(n=n.buffer),D){const t=l.getPSSHForKeySystem(D,n);if(t&&q(t))return}k.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(n)));const a=E.getSupportedKeySystemMetadataFromSegmentPssh(n,A,x);0!==a.length?function(t){N.push(t),L(t,!1)}(a):k.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!")}function Z(t,e){if(t.size<=0)return!1;if(e.size>0&&[...t].every((t=>{const n=e.get(t);return void 0!==n&&""!==n})))return!0;const n=M.getSessionTokens();if(n&&n.length>0){const e=n.filter((e=>[...t].includes(e.normalizedKeyId)));if(e.some((t=>!t.hasTriggeredKeyStatusMapUpdate))||0===e.length)return!1}return!_.get().streaming.protection.ignoreKeyStatuses&&t&&t.size>0&&e&&e.size>0}return T={areKeyIdsExpired:function(t){try{return!!Z(t,v)&&[...t].every((t=>v.get(t)===r.A.MEDIA_KEY_STATUSES.EXPIRED))}catch(t){return k.error(t),!1}},areKeyIdsUsable:function(t){try{return!Z(t,v)||[...t].some((t=>{const e=v.get(t);return e&&e!==r.A.MEDIA_KEY_STATUSES.INTERNAL_ERROR&&e!==r.A.MEDIA_KEY_STATUSES.OUTPUT_RESTRICTED}))}catch(t){return k.error(t),!0}},clearMediaInfoArray:function(){R=[]},closeKeySession:function(t){O(),M.closeKeySession(t)},createKeySession:j,getKeySystems:function(){return E?E.getKeySystems():[]},getSupportedKeySystemMetadataFromContentProtection:function(t){return O(),E.getSupportedKeySystemMetadataFromContentProtection(t,A,x)},handleKeySystemFromManifest:function(){if(!R||0===R.length)return;let t=[];R.forEach((e=>{const n=E.getSupportedKeySystemMetadataFromContentProtection(e.contentProtection,A,x);n.length>0&&(0===t.length&&(t=n),N.push(n))})),t&&t.length>0&&L(t,!0)},initializeForMedia:function(t){if(!t)throw new Error("mediaInfo can not be null or undefined");O(),R.push(t)},loadKeySession:U,removeKeySession:function(t){O(),M.removeKeySession(t)},reset:function(){b.off(y.INTERNAL_KEY_MESSAGE,H,T),O(),K(),G(null),D=null,w=!1,v=new Map,M&&(M.reset(),M=null),z.forEach((t=>clearTimeout(t))),z=[],R=[],N=[]},setKeySystems:function(t){E&&E.setKeySystems(t)},setMediaElement:G,setProtectionData:function(t){A=t,E.setProtectionData(t)},setRobustnessLevel:function(t){C=t},setServerCertificate:function(t){O(),M.setServerCertificate(t)},setSessionType:function(t){x=t},stop:function(){K(),M&&M.stop()},updateKeyStatusesMap:function(t){try{if(!t||!t.sessionToken||!t.parsedKeyStatuses)return;t.sessionToken.hasTriggeredKeyStatusMapUpdate=!0;const e=t.parsedKeyStatuses,n=h.A.parseUserAgent(),a=n&&n.browser&&n.browser.name&&"edge"===n.browser.name.toLowerCase();e.forEach((t=>{a&&D.uuid===r.A.PLAYREADY_UUID&&t.keyId&&16===t.keyId.byteLength&&function(t){const e=h.A.bufferSourceToDataView(t),n=e.getUint32(0,!0),a=e.getUint16(4,!0),r=e.getUint16(6,!0);e.setUint32(0,n,!1),e.setUint16(4,a,!1),e.setUint16(6,r,!1)}(t.keyId);const e=h.A.bufferSourceToHex(t.keyId).slice(0,32);e&&""!==e&&v.set(e,t.status)})),b.trigger(y.KEY_STATUSES_MAP_UPDATED,{keyStatusMap:v})}catch(t){k.error(t)}}},k=o.getLogger(T),N=[],R=[],x="temporary",C="",I=null,S=null,v=new Map,b.on(y.INTERNAL_KEY_MESSAGE,H,T),T}y.__dashjs_factory_name="ProtectionController";var E=b.A.getClassFactory(y),_=class{constructor(t,e){this.keyID=t,this.key=e}},A=class{constructor(t,e){if(e&&"persistent"!==e&&"temporary"!==e)throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'");this.keyPairs=t,this.type=e}toJWK(){let t,e=this.keyPairs.length,n={keys:[]};for(t=0;tString.fromCharCode(parseInt(t,16)))).join("")),e.replace(/=/g,"").replace(/\//g,"_").replace(/\+/g,"-")}catch(t){return null}}(e.cencDefaultKid)]};a=(new TextEncoder).encode(JSON.stringify(t))}return a}catch(t){return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(t){return JSON.stringify(JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(t,e){let n=null;if(t){const a=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(e))),r=[];for(let e=0;e%CUSTOMDATA%'.replace("%CUSTOMDATA%",e),r=[],o=0;o{b(t,e,0,n,a)}))})(o||(at[u]?at[u]:[u]),l).then((t=>{const e=t&&t.nativeMediaKeySystemAccessObject&&"function"==typeof t.nativeMediaKeySystemAccessObject.getConfiguration?t.nativeMediaKeySystemAccessObject.getConfiguration():null,i=new nt(s,e);i.selectedSystemString=t.selectedSystemString,i.nativeMediaKeySystemAccessObject=t.nativeMediaKeySystemAccessObject,n.trigger(a.KEY_SYSTEM_ACCESS_COMPLETE,{data:i}),r({data:i})})).catch((o=>{if(e+1{a({nativeMediaKeySystemAccessObject:t,selectedSystemString:i})})).catch((i=>{n+1{E(i),l.debug("DRM: Session closed. SessionID = "+i.getSessionId()),n.trigger(a.KEY_SESSION_CLOSED,{data:i.getSessionId()})})),g.push(i),i}function A(t){let e,n;return t&&t.length>0&&(t[0]&&("string"==typeof t[0]?e=t[0]:n=t[0]),t[1]&&("string"==typeof t[1]?e=t[1]:n=t[1])),{status:e,keyId:n}}return o={closeKeySession:function(t){y(t).catch((function(e){E(t),n.trigger(a.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+t.getSessionId()+") "+e.name})}))},createKeySession:function(t){if(!s||!f)throw new Error("Can not create sessions until you have selected a key system");const e=f.createSession(t.sessionType),i=_(e,t),o=s.systemString===r.A.CLEARKEY_KEYSTEM_STRING&&(t.initData||t.protData&&t.protData.clearkeys)?r.A.INITIALIZATION_DATA_TYPE_KEYIDS:r.A.INITIALIZATION_DATA_TYPE_CENC;e.generateRequest(o,t.initData).then((function(){l.debug("DRM: Session created. SessionID = "+i.getSessionId()),n.trigger(a.KEY_SESSION_CREATED,{data:i})})).catch((function(t){E(i),n.trigger(a.KEY_SESSION_CREATED,{data:null,error:new d.A(c.A.KEY_SESSION_CREATED_ERROR_CODE,c.A.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+t.name)})}))},getAllInitData:function(){const t=[];for(let e=0;e{p(t,0,e,n)}))},reset:function(){const t=g.length;let e;if(0!==t){const r=function(t){E(t),0===g.length&&(u?(u.removeEventListener("encrypted",m),u.setMediaKeys(null).then((function(){n.trigger(a.TEARDOWN_COMPLETE)}))):n.trigger(a.TEARDOWN_COMPLETE))};for(let n=0;n{t.nativeMediaKeySystemAccessObject.createMediaKeys().then((e=>(s=t.keySystem,f=e,u?u.setMediaKeys(f):Promise.resolve()))).then((()=>{e(s)})).catch((function(){n({error:"Error selecting keys system ("+t.keySystem.systemString+")! Could not create MediaKeys -- TODO"})}))}))},setMediaElement:function(t){u!==t&&(u&&(u.removeEventListener("encrypted",m),u.setMediaKeys&&u.setMediaKeys(null)),u=t,u&&(u.addEventListener("encrypted",m),u.setMediaKeys&&f&&u.setMediaKeys(f)))},setServerCertificate:function(t){return new Promise(((e,r)=>{f.setServerCertificate(t).then((function(){l.info("DRM: License server certificate successfully updated."),n.trigger(a.SERVER_CERTIFICATE_UPDATED),e()})).catch((t=>{r(t),n.trigger(a.SERVER_CERTIFICATE_UPDATED,{error:new d.A(c.A.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,c.A.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+t.name)})}))}))},stop:function(){let t;for(let e=0;e{n.trigger(a.KEY_SESSION_UPDATED)})).catch((function(e){n.trigger(a.KEY_ERROR,{error:new d.A(c.A.MEDIA_KEYERR_CODE,"Error sending update() message! "+e.name,t)})}))}},l=i.getLogger(o),s=null,u=null,f=null,g=[],h=Z(e).getInstance(),m={handleEvent:function(t){if("encrypted"===t.type&&t.initData){let e=ArrayBuffer.isView(t.initData)?t.initData.buffer:t.initData;n.trigger(a.NEED_KEY,{key:new tt(e,t.initDataType)})}}},o}at[r.A.PLAYREADY_KEYSTEM_STRING]=[r.A.PLAYREADY_KEYSTEM_STRING,r.A.PLAYREADY_RECOMMENDATION_KEYSTEM_STRING],at[r.A.WIDEVINE_KEYSTEM_STRING]=[r.A.WIDEVINE_KEYSTEM_STRING],at[r.A.CLEARKEY_KEYSTEM_STRING]=[r.A.CLEARKEY_KEYSTEM_STRING],rt.__dashjs_factory_name="DefaultProtectionModel";var it=b.A.getClassFactory(rt);function ot(t){t=t||{};const e=this.context,n=t.eventBus,a=t.events,i=t.debug,o=t.api;let l,s,f,g,m,h,p,b,y;function E(){try{for(let t=0;t=1?e():(t=e.bind(this),f.addEventListener("loadedmetadata",t))}return l={getAllInitData:function(){const t=[];for(let e=0;e{let i=!1;for(let r=0;r{try{m=t.mediaKeys=new window[o.MediaKeys](t.keySystem.systemString),g=t.keySystem,h=t,f&&A(),e(g)}catch(t){n({error:"Error selecting keys system ("+g.systemString+")! Could not create MediaKeys -- TODO"})}}))},setMediaElement:function(t){f!==t&&(f&&f.removeEventListener(o.needkey,b),f=t,f&&(f.addEventListener(o.needkey,b),m&&A()))},createKeySession:function(t){if(!g||!m||!h)throw new Error("Can not create sessions until you have selected a key system");let e=null;if(h.ksConfiguration.videoCapabilities&&h.ksConfiguration.videoCapabilities.length>0&&(e=h.ksConfiguration.videoCapabilities[0]),null===e&&h.ksConfiguration.audioCapabilities&&h.ksConfiguration.audioCapabilities.length>0&&(e=h.ksConfiguration.audioCapabilities[0]),null===e)throw new Error("Can not create sessions for unknown content types.");const r=e.contentType,i=m.createSession(r,new Uint8Array(t.initData),t.cdmData?new Uint8Array(t.cdmData):null),l=function(t,e){return{session:t,keyId:e.keyId,normalizedKeyId:e&&e.keyId&&"string"==typeof e.keyId?e.keyId.replace(/-/g,"").toLowerCase():"",initData:e.initData,hasTriggeredKeyStatusMapUpdate:!1,getKeyId:function(){return this.keyId},getSessionId:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},getKeyStatuses:function(){return{size:0,has:()=>!1,get:()=>{}}},handleEvent:function(t){switch(t.type){case o.error:let e="KeyError";n.trigger(a.KEY_ERROR,{error:new d.A(c.A.MEDIA_KEYERR_CODE,e,this)});break;case o.message:let r=ArrayBuffer.isView(t.message)?t.message.buffer:t.message;n.trigger(a.INTERNAL_KEY_MESSAGE,{data:new et(this,r,t.destinationURL)});break;case o.ready:s.debug("DRM: Key added."),n.trigger(a.KEY_ADDED);break;case o.close:s.debug("DRM: Session closed. SessionID = "+this.getSessionId()),n.trigger(a.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}}(i,t);i.addEventListener(o.error,l),i.addEventListener(o.message,l),i.addEventListener(o.ready,l),i.addEventListener(o.close,l),p.push(l),s.debug("DRM: Session created. SessionID = "+l.getSessionId()),n.trigger(a.KEY_SESSION_CREATED,{data:l})},updateKeySession:function(t,e){const r=t.session;y.isClearKey(g)?r.update(new Uint8Array(e.toJWK())):r.update(new Uint8Array(e)),n.trigger(a.KEY_SESSION_UPDATED)},closeKeySession:_,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:E,reset:E},s=i.getLogger(l),f=null,g=null,m=null,h=null,p=[],y=Z(e).getInstance(),b={handleEvent:function(t){if(t.type===o.needkey&&t.initData){const e=ArrayBuffer.isView(t.initData)?t.initData.buffer:t.initData;n.trigger(a.NEED_KEY,{key:new tt(e,r.A.INITIALIZATION_DATA_TYPE_CENC)})}}},l}ot.__dashjs_factory_name="ProtectionModel_3Feb2014";var lt=b.A.getClassFactory(ot);function st(t){t=t||{};const e=this.context,n=t.eventBus,a=t.events,i=t.debug,o=t.api,l=t.errHandler;let s,f,g,m,h,p,b,y,E;function _(){g&&v();for(let t=0;t{let i=g;i||(i=document.createElement("video"));let o=!1;for(let r=0;r!1,get:()=>{}}}};return p.push(e),g[o.generateKeyRequest](m.systemString,new Uint8Array(t.initData)),e}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(t,e){const r=t.sessionId;if(h.isClearKey(m))for(let t=0;t0&&(e=p.shift(),b.push(e),e.sessionId=t.sessionId,n.trigger(a.KEY_SESSION_CREATED,{data:e}))):p.length>0&&(e=p.shift(),b.push(e),0!==p.length&&l.error(new d.A(c.A.MEDIA_KEY_MESSAGE_ERROR_CODE,c.A.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),e){let r=ArrayBuffer.isView(t.message)?t.message.buffer:t.message;e.keyMessage=r,n.trigger(a.INTERNAL_KEY_MESSAGE,{data:new et(e,r,t.defaultURL)})}else f.warn("No session token found for key message")}}},s}st.__dashjs_factory_name="ProtectionModel_01b";var ut=b.A.getClassFactory(st);const ct=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],dt=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];function ft(){let t;const e=this.context;function n(t,e){for(let n=0;n{const a={...t};if(e.ks){a.keySystemConfiguration={},e.ks.systemString&&(a.keySystemConfiguration.keySystem=e.ks.systemString);let t="";e.ks.systemString===i.A.WIDEVINE_KEYSTEM_STRING&&(t=i.A.ROBUSTNESS_STRINGS.WIDEVINE.SW_SECURE_CRYPTO);const o=e.protData,l=o&&o.audioRobustness&&o.audioRobustness.length>0?o.audioRobustness:t,s=o&&o.videoRobustness&&o.videoRobustness.length>0?o.videoRobustness:t;n===r.A.AUDIO?a.keySystemConfiguration[n]={robustness:l}:n===r.A.VIDEO&&(a.keySystemConfiguration[n]={robustness:s})}return a})):[t]}(n,t,e)}function m(t){if(a&&0!==a.length&&t)return a.find((e=>{const n=h(t,e,r.A.AUDIO),a=h(t,e,r.A.VIDEO),i=h(t,e,"keySystemConfiguration");return n&&a&&i}))}function h(t,e,n){return!t[n]&&!e[n]||!(!t[n]||!e[n])&&f.areEqual(t[n],e[n])}function p(t,e){return(t=t.filter((t=>!(t.schemeIdUri&&e.some((e=>e.schemeIdUri===t.schemeIdUri)))))).push(...e),t}return t={areKeyIdsExpired:function(t){return!!(n&&t&&t.normalizedKeyIds&&0!==t.normalizedKeyIds.size)&&n.areKeyIdsExpired(t.normalizedKeyIds)},areKeyIdsUsable:function(t){return!(n&&t&&t.normalizedKeyIds&&0!==t.normalizedKeyIds.size)||n.areKeyIdsUsable(t.normalizedKeyIds)},isCodecSupportedBasedOnTestedConfigurations:function(t,e){if(!t||!t.codec||!1===t.isSupported)return!1;const n=g(t,e).map((t=>m(t))).filter((t=>null!=t));return!(n&&n.length>0)||function(t){return t.some((t=>t&&t.decodingInfo&&t.decodingInfo.supported))}(n)},isProtectionCompatible:function(t,e){return!e||!(!t.isEncrypted&&e.isEncrypted)},runCodecSupportCheck:function(t,n){if(n!==r.A.AUDIO&&n!==r.A.VIDEO)return Promise.resolve();const i=g(t,n);return function(t,n){return e.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(t.codec&&n===r.A.AUDIO||n===r.A.VIDEO&&t.codec&&t.width&&t.height&&t.bitrate&&t.framerate)}(t,n)?function(t){return new Promise((e=>{if(!t||0===t.length)return void e();const n=t.map((t=>function(t){return new Promise((e=>{m(t)?e():navigator.mediaCapabilities.decodingInfo(t).then((n=>{t.decodingInfo=n,a.push(t),e()})).catch((n=>{t.decodingInfo={supported:!1},a.push(t),c.error(n),e()}))}))}(t)));Promise.allSettled(n).then((()=>{e()})).catch((t=>{c.error(t),e()}))}))}(i):(function(t){if(!t||!t.length)return;const e=t[0];if(m(e))return;let n={supported:!1};("ManagedMediaSource"in window&&ManagedMediaSource.isTypeSupported(e.mediaSourceCodecString)||"MediaSource"in window&&MediaSource.isTypeSupported(e.mediaSourceCodecString)||"WebKitMediaSource"in window&&WebKitMediaSource.isTypeSupported(e.mediaSourceCodecString))&&(n.supported=!0),e.decodingInfo=n,a.push(e)}(i),Promise.resolve())},setConfig:function(t){t&&(t.settings&&(e=t.settings),t.protectionController&&(n=t.protectionController))},setEncryptedMediaSupported:function(t){u=t},setProtectionController:function(t){n=t},supportsChangeType:function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType},supportsEncryptedMedia:function(){return u},supportsEssentialProperty:function(t){let n=e.get().streaming.capabilities.supportedEssentialProperties;e.get().streaming.capabilities.useMediaCapabilitiesApi&&e.get().streaming.capabilities.filterVideoColorimetryEssentialProperties&&(n=p(n,[{schemeIdUri:r.A.COLOUR_PRIMARIES_SCHEME_ID_URI},{schemeIdUri:r.A.MATRIX_COEFFICIENTS_SCHEME_ID_URI},{schemeIdUri:r.A.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI}])),e.get().streaming.capabilities.useMediaCapabilitiesApi&&e.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties&&(n=p(n,[{schemeIdUri:r.A.HDR_METADATA_FORMAT_SCHEME_ID_URI}]));try{return t.inArray(n)}catch(t){return!0}},supportsMediaSource:s},u=!1,a=[],c=(0,l.A)(d).getInstance().getLogger(t),t}u.__dashjs_factory_name="Capabilities",e.A=a.A.getSingletonFactory(u)},7377:function(t,e,n){"use strict";var a=n(138),r=n(656);function i(){return{customTimeRangeArray:[],length:0,add:function(t,e){let n;for(n=0;nthis.customTimeRangeArray[n].start;n++);for(this.customTimeRangeArray.splice(n,0,{start:t,end:e}),n=0;n=this.customTimeRangeArray[n].end)this.customTimeRangeArray.splice(n,1),n--;else{if(t>this.customTimeRangeArray[n].start&&ethis.customTimeRangeArray[n].start&&tthis.customTimeRangeArray[n].start&&e=this.customTimeRangeArray.length||t<0?NaN:this.customTimeRangeArray[t].start},end:function(t){return(0,r.zQ)(t),t>=this.customTimeRangeArray.length||t<0?NaN:this.customTimeRangeArray[t].end}}}i.__dashjs_factory_name="CustomTimeRanges",e.A=a.A.getClassFactory(i)},7393:function(t,e,n){"use strict";var a=n(138),r=n(7316);function i(){let t;return t={areEqual:function(t,e){return r(t,e)}},t}i.__dashjs_factory_name="ObjectUtils",e.A=a.A.getSingletonFactory(i)},656:function(t,e,n){"use strict";n.d(e,{sq:function(){return r},zQ:function(){return i}});var a=n(5212);function r(t,e){if(typeof t!==e)throw a.A.BAD_ARGUMENT_ERROR}function i(t){if(null===t||isNaN(t)||t%1!=0)throw a.A.BAD_ARGUMENT_ERROR+" : argument is not an integer"}},1944:function(t,e){"use strict";e.A=class{constructor(t,e,n){this.code=t||null,this.message=e||null,this.data=n||null}}},7568:function(t,e,n){"use strict";n.d(e,{G:function(){return a},N:function(){return r}});class a{constructor(){this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this.cmsd=null,this._stream=null,this._tfinish=null,this._mediaduration=null,this._responseHeaders=null,this._serviceLocation=null,this._fileLoaderType=null,this._resourceTimingValues=null}}class r{constructor(){this.s=null,this.d=null,this.b=[]}}a.GET="GET",a.HEAD="HEAD",a.MPD_TYPE="MPD",a.XLINK_EXPANSION_TYPE="XLinkExpansion",a.INIT_SEGMENT_TYPE="InitializationSegment",a.INDEX_SEGMENT_TYPE="IndexSegment",a.MEDIA_SEGMENT_TYPE="MediaSegment",a.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",a.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",a.DVB_REPORTING_TYPE="DVBReporting",a.LICENSE="license",a.CONTENT_STEERING_TYPE="ContentSteering",a.OTHER_TYPE="other"}},e={};function n(a){var r=e[a];if(void 0!==r)return r.exports;var i=e[a]={exports:{}};return t[a].call(i.exports,i,i.exports,n),i.exports}n.amdO={},n.d=function(t,e){for(var a in e)n.o(e,a)&&!n.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var r={};return function(){"use strict";n.d(r,{default:function(){return d}}),n(5393);var t=n(4469),e=n(3888),a=n(255);let i,o=function(){const t="application/dash+xml";let e;function n(n,r,i){if(!n||!/^VIDEO$/i.test(n.nodeName))return null;if(n._dashjs_player)return n._dashjs_player;let o,l=n.id||n.name||"video element";if(!(r=r||[].slice.call(n.querySelectorAll("source")).filter((function(e){return e.type==t}))[0])&&n.src)(r=document.createElement("source")).src=n.src;else if(!r&&!n.src)return null;return i=i||{},o=(0,a.A)(i).create(),o.initialize(n,r.src,n.autoplay),e||(e=o.getDebug().getLogger()),e.debug("Converted "+l+" to dash.js player and added content: "+r.src),n._dashjs_player=o,o}function r(t){return/^VIDEO$/i.test(t.nodeName)?t:r(t.parentNode)}return{create:n,createAll:function(e,a){let i=[];e=e||"[data-dashjs-player]";let o=(a=a||document).querySelectorAll(e);for(let t=0;t