PageSourceSearch

https://www.seafood.no/Seafood/Static/build/js/303.c208535b8789ac210445.js

js seafood.no collected 2026-10-02 04:30:32 UTC 827,051 bytes, 3 lines download raw bytes

vendor: 11,320 bytes, lines 1-2
1/*! For license information please see 303.c208535b8789ac210445.js.LICENSE.txt */
2"use strict";(self.webpackChunkseafood=self.webpackChunkseafood||[]).push([[303],{20303(e,t,n){n.d(t,{MediaPlayer:()=>y});var r={7267:function(e,t){t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,a=s(e),o=a[0],l=a[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,o,l)),c=0,d=l>0?o-4:o;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[c++]=255&t),1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],o=16383,s=0,u=r-i;s<u;s+=o)a.push(l(e,s,s+o>u?u:s+o));return 1===i?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),a.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)n[o]=a[o],r[a.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,r){for(var i,a,o=[],s=t;s<r;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(n[(a=i)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},44:function(e,t,n){const r=n(7267),i=n(7986),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50;const o=2147483647;function s(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,n)}function u(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|p(e,t);let r=s(n);const i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(e,Uint8Array)){const t=new Uint8Array(e);return g(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return g(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return g(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return l.from(r,t,n);const i=function(e){if(l.isBuffer(e)){const t=0|h(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||Q(e.length)?s(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return c(e),s(e<0?0:0|h(e))}function f(e){const t=e.length<0?0:0|h(e.length),n=s(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function g(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,l.prototype),r}function h(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(i)return r?-1:j(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return D(this,t,n);case"latin1":case"binary":return v(this,t,n);case"base64":return N(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function E(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function T(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Q(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:_(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):_(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function _(e,t,n,r,i){let a,o=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,n/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){let r=-1;for(a=n;a<s;a++)if(u(e,a)===u(t,-1===r?0:a-r)){if(-1===r&&(r=a),a-r+1===l)return r*o}else-1!==r&&(a-=a-r),r=-1}else for(n+l>s&&(n=s-l),a=n;a>=0;a--){let n=!0;for(let r=0;r<l;r++)if(u(e,a+r)!==u(t,r)){n=!1;break}if(n)return a}return-1}function y(e,t,n,r){n=Number(n)||0;const i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;const a=t.length;let o;for(r>a/2&&(r=a/2),o=0;o<r;++o){const r=parseInt(t.substr(2*o,2),16);if(Q(r))return o;e[n+o]=r}return o}function S(e,t,n,r){return z(j(t,e.length-n),e,n,r)}function I(e,t,n,r){return z(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function A(e,t,n,r){return z(W(t),e,n,r)}function R(e,t,n,r){return z(function(e,t){let n,r,i;const a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function N(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i<n;){const t=e[i];let a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,l;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(a=l));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(l=(15&t)<<12|(63&n)<<6|63&r,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(l=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),i+=o}return function(e){const t=e.length;if(t<=b)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=b));return n}(r)}t.kMaxLength=o,l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.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(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,n){return u(e,t,n)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,n){return function(e,t,n){return c(e),e<=0?s(e):void 0!==t?"string"==typeof n?s(e).fill(t,n):s(e).fill(t):s(e)}(e,t,n)},l.allocUnsafe=function(e){return d(e)},l.allocUnsafeSlow=function(e){return d(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if($(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),$(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).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}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=l.allocUnsafe(t);let i=0;for(n=0;n<e.length;++n){let t=e[n];if($(t,Uint8Array))i+t.length>r.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},l.byteLength=p,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)E(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)E(this,t,t+3),E(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)E(this,t,t+7),E(this,t+1,t+6),E(this,t+2,t+5),E(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?C(this,0,e):m.apply(this,arguments)}
vendor: 12,003 bytes, line 2
2,l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(e,t,n,r,i){if($(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0);const s=Math.min(a,o),u=this.slice(r,i),c=e.slice(t,n);for(let e=0;e<s;++e)if(u[e]!==c[e]){a=u[e],o=c[e];break}return a<o?-1:o<a?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return T(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return T(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let a=!1;for(;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return S(this,e,t,n);case"ascii":case"latin1":case"binary":return I(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const b=4096;function D(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function v(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function M(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=t;r<n;++r)i+=X[e[r]];return i}function w(e,t,n){const r=e.slice(t,n);let i="";for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+256*r[e+1]);return i}function P(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,n,r,i,a){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function L(e,t,n,r,i){Y(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function F(e,t,n,r,i){Y(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}function U(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function x(e,t,n,r,a){return t=+t,n>>>=0,a||U(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,a){return t=+t,n>>>=0,a||U(e,0,n,8),i.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,l.prototype),r},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=Z(function(e){q(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||V(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),l.prototype.readBigUInt64BE=Z(function(e){q(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||V(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=Z(function(e){q(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||V(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),l.prototype.readBigInt64BE=Z(function(e){q(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||V(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)}),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||O(this,e,t,n,Math.pow(2,8*n)-1,0);let i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||O(this,e,t,n,Math.pow(2,8*n)-1,0);let i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=Z(function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=Z(function(e,t=0){return F(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);O(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/a|0)-o&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);O(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/a|0)-o&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=Z(function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=Z(function(e,t=0){return F(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeFloatLE=function(e,t,n){return x(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return x(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{const a=l.isBuffer(e)?e:l.from(e,r),o=a.length;
vendor: 4,925 bytes, line 2
2if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};const k={};function G(e,t,n){k[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function H(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function Y(e,t,n,r,i,a){if(e>n||e<t){const r="bigint"==typeof t?"n":"";let i;throw i=a>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(a+1)}${r}`:`>= -(2${r} ** ${8*(a+1)-1}${r}) and < 2 ** ${8*(a+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new k.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){q(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||V(t,e.length-(n+1))}(r,i,a)}function q(e,t){if("number"!=typeof e)throw new k.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,n){if(Math.floor(e)!==e)throw q(e,n),new k.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new k.ERR_BUFFER_OUT_OF_BOUNDS;throw new k.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}G("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),G("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),G("ERR_OUT_OF_RANGE",function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=H(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=H(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r},RangeError);const K=/[^+/0-9A-Za-z-_]/g;function j(e,t){let n;t=t||1/0;const r=e.length;let i=null;const a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function W(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!=e}const X=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function Z(e){return"undefined"==typeof BigInt?J:e}function J(){throw new Error("BigInt not supported")}},6877:function(e,t){var n={parseBuffer:function(e){return new r(e).parse()},addBoxProcessor:function(e,t){"string"==typeof e&&"function"==typeof t&&(i.prototype._boxProcessors[e]=t)},createFile:function(){return new r},createBox:function(e,t,n){var r=i.create(e);return t&&t.append(r,n),r},createFullBox:function(e,t,r){var i=n.createBox(e,t,r);return i.version=0,i.flags=0,i},Utils:{}};n.Utils.dataViewToString=function(e,t){var n=t||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(n).decode(e);var r=[],i=0;if("utf-8"===n)for(;i<e.byteLength;){var a=e.getUint8(i++);a<128||(a<224?(a=(31&a)<<6,a|=63&e.getUint8(i++)):a<240?(a=(15&a)<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++)):(a=(7&a)<<18,a|=(63&e.getUint8(i++))<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++))),r.push(String.fromCharCode(a))}else for(;i<e.byteLength;)r.push(String.fromCharCode(e.getUint8(i++)));return r.join("")},n.Utils.utf8ToByteArray=function(e){var t,n;if("undefined"!=typeof TextEncoder)t=(new TextEncoder).encode(e);else for(t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},n.Utils.appendBox=function(e,t,n){if(t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,-1!==n)if(null!=n){var r,i=-1;if("number"==typeof n)i=n;else{if("string"==typeof n)r=n;else{if("object"!=typeof n||!n.type)return void e.boxes.push(t);r=n.type}for(var a=0;a<e.boxes.length;a++)if(r===e.boxes[a].type){i=a
vendor: 11,109 bytes, line 2
2+1;break}}e.boxes.splice(i,0,t)}else e.boxes.push(t)},t.parseBuffer=n.parseBuffer,t.addBoxProcessor=n.addBoxProcessor,t.createFile=n.createFile,t.createBox=n.createBox,t.createFullBox=n.createFullBox,t.Utils=n.Utils,n.Cursor=function(e){this.offset=void 0===e?0:e};var r=function(e){this._cursor=new n.Cursor,this.boxes=[],e&&(this._raw=new DataView(e))};r.prototype.fetch=function(e){var t=this.fetchAll(e,!0);return t.length?t[0]:null},r.prototype.fetchAll=function(e,t){var n=[];return r._sweep.call(this,e,n,t),n},r.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var e=i.parse(this);if(void 0===e.type)break;this.boxes.push(e)}return this},r._sweep=function(e,t,n){for(var i in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&n)return;r._sweep.call(this.boxes[i],e,t,n)}},r.prototype.write=function(){var e,t=0;for(e=0;e<this.boxes.length;e++)t+=this.boxes[e].getLength(!1);var n=new Uint8Array(t);for(this._rawo=new DataView(n.buffer),this.bytes=n,this._cursor.offset=0,e=0;e<this.boxes.length;e++)this.boxes[e].write();return n.buffer},r.prototype.append=function(e,t){n.Utils.appendBox(this,e,t)};var i=function(){this._cursor=new n.Cursor};i.parse=function(e){var t=new i;return t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,t._parseBox(),e._cursor.offset=t._raw.byteOffset+t._raw.byteLength,t},i.create=function(e){var t=new i;return t.type=e,t.boxes=[],t},i.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"],i.prototype._boxProcessors={},i.prototype._procField=function(e,t,n){this._parsing?this[e]=this._readField(t,n):this._writeField(t,n,this[e])},i.prototype._procFieldArray=function(e,t,n,r){var i;if(this._parsing)for(this[e]=[],i=0;i<t;i++)this[e][i]=this._readField(n,r);else for(i=0;i<this[e].length;i++)this._writeField(n,r,this[e][i])},i.prototype._procFullBox=function(){this._procField("version","uint",8),this._procField("flags","uint",24)},i.prototype._procEntries=function(e,t,n){var r;if(this._parsing)for(this[e]=[],r=0;r<t;r++)this[e].push({}),n.call(this,this[e][r]);else for(r=0;r<t;r++)n.call(this,this[e][r])},i.prototype._procSubEntries=function(e,t,n,r){var i;if(this._parsing)for(e[t]=[],i=0;i<n;i++)e[t].push({}),r.call(this,e[t][i]);else for(i=0;i<n;i++)r.call(this,e[t][i])},i.prototype._procEntryField=function(e,t,n,r){this._parsing?e[t]=this._readField(n,r):this._writeField(n,r,e[t])},i.prototype._procSubBoxes=function(e,t){var n;if(this._parsing)for(this[e]=[],n=0;n<t;n++)this[e].push(i.parse(this));else for(n=0;n<t;n++)this._rawo?this[e][n].write():this.size+=this[e][n].getLength()},i.prototype._readField=function(e,t){switch(e){case"uint":return this._readUint(t);case"int":return this._readInt(t);case"template":return this._readTemplate(t);case"string":return-1===t?this._readTerminatedString():this._readString(t);case"data":return this._readData(t);case"utf8":return this._readUTF8String();case"utf8string":return this._readUTF8TerminatedString();default:return-1}},i.prototype._readInt=function(e){var t=null,n=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:t=this._raw.getInt8(n);break;case 16:t=this._raw.getInt16(n);break;case 32:t=this._raw.getInt32(n);break;case 64:var r=this._raw.getInt32(n),i=this._raw.getInt32(n+4);t=r*Math.pow(2,32)+i}return this._cursor.offset+=e>>3,t},i.prototype._readUint=function(e){var t,n,r=null,i=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:r=this._raw.getUint8(i);break;case 16:r=this._raw.getUint16(i);break;case 24:r=((t=this._raw.getUint16(i))<<8)+(n=this._raw.getUint8(i+2));break;case 32:r=this._raw.getUint32(i);break;case 64:t=this._raw.getUint32(i),n=this._raw.getUint32(i+4),r=t*Math.pow(2,32)+n}return this._cursor.offset+=e>>3,r},i.prototype._readString=function(e){for(var t="",n=0;n<e;n++){var r=this._readUint(8);t+=String.fromCharCode(r)}return t},i.prototype._readTemplate=function(e){return this._readUint(e/2)+this._readUint(e/2)/Math.pow(2,e/2)},i.prototype._readTerminatedString=function(){for(var e="";this._cursor.offset-this._offset<this._raw.byteLength;){var t=this._readUint(8);if(0===t)break;e+=String.fromCharCode(t)}return e},i.prototype._readData=function(e){var t=e>0?e:this._raw.byteLength-(this._cursor.offset-this._offset);if(t>0){var n=new Uint8Array(this._raw.buffer,this._cursor.offset,t);return this._cursor.offset+=t,n}return null},i.prototype._readUTF8String=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;return e>0&&(t=new DataView(this._raw.buffer,this._cursor.offset,e),this._cursor.offset+=e),t?n.Utils.dataViewToString(t):t},i.prototype._readUTF8TerminatedString=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;if(e>0){var r;for(t=new DataView(this._raw.buffer,this._cursor.offset,e),r=0;r<e&&0!==t.getUint8(r);r++);t=new DataView(this._raw.buffer,this._cursor.offset,r),this._cursor.offset+=Math.min(r+1,e)}return t?n.Utils.dataViewToString(t):t},i.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())}},i.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},i.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(i.parse(this))},i.prototype.append=function(e,t){n.Utils.appendBox(this,e,t)},i.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 e=0;e<this.boxes.length;e++)this.size+=this.boxes[e].getLength();return this._data&&this._writeData(this._data),this.size},i.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 e=0;e<this.boxes.length;e++)this.boxes[e].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},i.prototype._writeInt=function(e,t){if(this._rawo){var n=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setInt8(n,t);break;case 16:this._rawo.setInt16(n,t);break;case 32:this._rawo.setInt32(n,t);break;case 64:var r=Math.floor(t/Math.pow(2,32)),i=t-r*Math.pow(2,32);this._rawo.setUint32(n,r),this._rawo.setUint32(n+4,i)}this._cursor.offset+=e>>3}else this.size+=e>>3},i.prototype._writeUint=function(e,t){if(this._rawo){var n,r,i=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setUint8(i,t);break;case 16:this._rawo.setUint16(i,t);break;case 24:n=(16776960&t)>>8,r=255&t,this._rawo.setUint16(i,n),this._rawo.setUint8(i+2,r);break;case 32:this._rawo.setUint32(i,t);break;case 64:r=t-(n=Math.floor(t/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(i,n),this._rawo.setUint32(i+4,r)}this._cursor.offset+=e>>3}else this.size+=e>>3},i.prototype._writeString=function(e,t){for(var n=0;n<e;n++)this._writeUint(8,t.charCodeAt(n))},i.prototype._writeTerminatedString=function(e){if(0!==e.length){for(var t=0;t<e.length;t++)this._writeUint(8,e.charCodeAt(t));this._writeUint(8,0)}},i.prototype._writeTemplate=function(e,t){var n=Math.floor(t),r=(t-n)*Math.pow(2,e/2);this._writeUint(e/2,n),this._writeUint(e/2,r)},i.prototype._writeData=function(e){if(e)if(this._rawo){if(e instanceof Array){for(var t=this._cursor.offset-this._rawo.byteOffset,n=0;n<e.length;n++)this._rawo.setInt8(t+n,e[n]);this._cursor.offset+=e.length}e instanceof Uint8Array&&(this._root.bytes.set(e,this._cursor.offset),this._cursor.offset+=e.length)}else this.size+=e.length},i.prototype._writeUTF8String=function(e){var t=n.Utils.utf8ToByteArray(e);if(this._rawo)for(var r=new DataView(this._rawo.buffer,this._cursor.offset,t.length),i=0;i<t.length;i++)r.setUint8(i,t[i]);else this.size+=t.length},i.prototype._writeField=function(e,t,n){switch(e){case"uint":this._writeUint(t,n);break;case"int":this._writeInt(t,n);break;case"template":this._writeTemplate(t,n);break;case"string":-1==t?this._writeTerminatedString(n):this._writeString(t,n);break;case"data":this._writeData(n);break;case"utf8":this._writeUTF8String(n)}},i.prototype._boxProcessors.ardi=function(){this._procFullBox(),this._procField("audio_rendering_indication","uint",8)},i.prototype._boxProcessors.avc1=i.prototype._boxProcessors.avc2=i.prototype._boxProcessors.avc3=i.prototype._boxProcessors.avc4=i.prototype._boxProcessors.hvc1=i.prototype._boxProcessors.hev1=i.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)},i.prototype._boxProcessors.ctts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,
vendor: 7,853 bytes, line 2
2function(e){this._procEntryField(e,"sample_count","uint",32),this._procEntryField(e,"sample_offset",1===this.version?"int":"uint",32)})},i.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},i.prototype._boxProcessors.elng=function(){this._procFullBox(),this._procField("extended_language","utf8string")},i.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,function(e){this._procEntryField(e,"segment_duration","uint",1===this.version?64:32),this._procEntryField(e,"media_time","int",1===this.version?64:32),this._procEntryField(e,"media_rate_integer","int",16),this._procEntryField(e,"media_rate_fraction","int",16)})},i.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)},i.prototype._boxProcessors.free=i.prototype._boxProcessors.skip=function(){this._procField("data","data",-1)},i.prototype._boxProcessors.frma=function(){this._procField("data_format","uint",32)},i.prototype._boxProcessors.ftyp=i.prototype._boxProcessors.styp=function(){this._procField("major_brand","string",4),this._procField("minor_version","uint",32);var e=-1;this._parsing&&(e=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray("compatible_brands",e,"string",4)},i.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)},i.prototype._boxProcessors.imda=function(){this._procField("imda_identifier","uint",32),this._procField("data","data",-1)},i.prototype._boxProcessors.kind=function(){this._procFullBox(),this._procField("schemeURI","utf8string"),this._procField("value","utf8string")},i.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")},i.prototype._boxProcessors.mdat=function(){this._procField("data","data",-1)},i.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)},i.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},i.prototype._boxProcessors.meta=function(){this._procFullBox()},i.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},i.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},i.prototype._boxProcessors.mp4a=i.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)},i.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)},i.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},i.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)},i.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(e){this._procEntryField(e,"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")},i.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},i.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)},i.prototype._boxProcessors.sdtp=function(){this._procFullBox();var e=-1;this._parsing&&(e=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",e,"uint",8)},i.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(e){this._parsing||(e.reference=(1&e.reference_type)<<31,e.reference|=2147483647&e.referenced_size,e.sap=(1&e.starts_with_SAP)<<31,e.sap|=(3&e.SAP_type)<<28,e.sap|=268435455&e.SAP_delta_time),this._procEntryField(e,"reference","uint",32),this._procEntryField(e,"subsegment_duration","uint",32),this._procEntryField(e,"sap","uint",32),this._parsing&&(e.reference_type=e.reference>>31&1,e.referenced_size=2147483647&e.reference,e.starts_with_SAP=e.sap>>31&1,e.SAP_type=e.sap>>28&7,e.SAP_delta_time=268435455&e.sap)})},i.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},i.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,function(e){this._procEntryField(e,"ranges_count","uint",32),this._procSubEntries(e,"ranges",e.ranges_count,function(e){this._procEntryField(e,"level","uint",8),this._procEntryField(e,"range_size","uint",24)})})},i.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entr
2ies",this.entry_count)},i.prototype._boxProcessors.sttg=function(){this._procField("settings","utf8")},i.prototype._boxProcessors.stts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,function(e){this._procEntryField(e,"sample_count","uint",32),this._procEntryField(e,"sample_delta","uint",32)})},i.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,function(e){this._procEntryField(e,"sample_delta","uint",32),this._procEntryField(e,"subsample_count","uint",16),this._procSubEntries(e,"subsamples",e.subsample_count,function(e){this._procEntryField(e,"subsample_size","uint",1===this.version?32:16),this._procEntryField(e,"subsample_priority","uint",8),this._procEntryField(e,"discardable","uint",8),this._procEntryField(e,"codec_specific_parameters","uint",32)})})},i.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)},i.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},i.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)},i.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(e){this._procEntryField(e,"time","uint",1===this.version?64:32),this._procEntryField(e,"moof_offset","uint",1===this.version?64:32),this._procEntryField(e,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(e,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(e,"sample_number","uint",8*(this.length_size_of_sample_num+1))})},i.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)},i.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)},i.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(e){256&this.flags&&this._procEntryField(e,"sample_duration","uint",32),512&this.flags&&this._procEntryField(e,"sample_size","uint",32),1024&this.flags&&this._procEntryField(e,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(e,"sample_composition_time_offset",1===this.version?"int":"uint",32)})},i.prototype._boxProcessors["url "]=i.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},i.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},i.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},i.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},i.prototype._boxProcessors.vtte=function(){}},9826:function(e){var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}p(e,t,a,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&p(e,"error",t,{once:!0})}(e,i)})},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function u(e,t,n,r){var i,a,o,u;if(s(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),void 0===o)o=a[t]=n,++e._eventsCount;else if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=l(e))>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,u=c,console&&console.warn&&console.warn(u)}return e}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(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=c.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):h(i,i.length)}function g(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function h(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function p(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)})}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return o}
vendor: 7,174 bytes, line 2
2,set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),a.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},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)r(l,this,t);else{var u=l.length,c=h(l,u);for(n=0;n<u;++n)r(c[n],this,t)}return!0},a.prototype.addListener=function(e,t){return u(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return u(this,e,t,!0)},a.prototype.once=function(e,t){return s(t),this.on(e,d(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,d(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,r,i,a,o;if(s(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,n,r;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[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return f(this,e,!0)},a.prototype.rawListeners=function(e){return f(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7316:function(e){e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;0!=i--;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!=t&&n!=n}},7986:function(e,t){t.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,l=(1<<s)-1,u=l>>1,c=-7,d=n?i-1:0,f=n?-1:1,g=e[t+d];for(d+=f,a=g&(1<<-c)-1,g>>=-c,c+=s;c>0;a=256*a+e[t+d],d+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+e[t+d],d+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(g?-1:1);o+=Math.pow(2,r),a-=u}return(g?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var o,s,l,u=8*a-i-1,c=(1<<u)-1,d=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,g=r?0:a-1,h=r?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+d>=1?f/l:f*Math.pow(2,1-d))*l>=2&&(o++,l/=2),o+d>=c?(s=0,o=c):o+d>=1?(s=(t*l-1)*Math.pow(2,i),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+g]=255&s,g+=h,s/=256,i-=8);for(o=o<<i|s,u+=i;u>0;e[n+g]=255&o,g+=h,o/=256,u-=8);e[n+g-h]|=128*p}},5474:function(e,t,n){!function(e){e.parser=function(e,t){return new i(e,t)},e.SAXParser=i,e.SAXStream=o,e.createStream=function(e,t){return new o(e,t)},e.MAX_BUFFER_LENGTH=65536;var t,r=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function i(t,n){if(!(this instanceof i))return new i(t,n);var a=this;!function(e){for(var t=0,n=r.length;t<n;t++)e[r[t]]=""}(a),a.q=a.c="",a.bufferCheckPosition=e.MAX_BUFFER_LENGTH,a.opt=n||{},a.opt.lowercase=a.opt.lowercase||a.opt.lowercasetags,a.looseCase=a.opt.lowercase?"toLowerCase":"toUpperCase",a.tags=[],a.closed=a.closedRoot=a.sawRoot=!1,a.tag=a.error=null,a.strict=!!t,a.noscript=!(!t&&!a.opt.noscript),a.state=b.BEGIN,a.strictEntities=a.opt.strictEntities,a.ENTITIES=a.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),a.attribList=[],a.opt.xmlns&&(a.ns=Object.create(m)),a.trackPosition=!1!==a.opt.position,a.trackPosition&&(a.position=a.line=a.column=0),v(a,"onready")}e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}),i.prototype={end:function(){L(this)},write:function(t){var n=this;if(this.error)throw this.error;if(n.closed)return O(n,"Cannot write after close. Assign an onready handler.");if(null===t)return L(n);"object"==typeof t&&(t=t.toString());for(var i=0,a="";a=q(t,i++),n.c=a,a;)switch(n.trackPosition&&(n.position++,"\n"===a?(n.line++,n.column=0):n.column++),n.state){case b.BEGIN:if(n.state=b.BEGIN_WHITESPACE,"\ufeff"===a)continue;Y(n,a);continue;case b.BEGIN_WHITESPACE:Y(n,a);continue;case b.TEXT:if(n.sawRoot&&!n.closedRoot){for(var o=i-1;a&&"<"!==a&&"&"!==a;)(a=q(t,i++))&&n.trackPosition&&(n.position++,"\n"===a?(n.line++,n.column=0):n.column++);n.textNode+=t.substring(o,i-1)}"<"!==a||n.sawRoot&&n.closedRoot&&!n.strict?(!A(s,a)||n.sawRoot&&!n.closedRoot||F(n,"Text data outside of root node."),"&"===a?n.state=b.TEXT_ENTITY:n.textNode+=a):(n.state=b.OPEN_WAKA,n.startTagPosition=n.position);continue;case b.SCRIPT:"<"===a?n.state=b.SCRIPT_ENDING:n.script+=a;continue;case b.SCRIPT_ENDING:"/"===a?n.state=b.CLOSE_TAG:(n.script+="<"+
vendor: 14,007 bytes, line 2
2a,n.state=b.SCRIPT);continue;case b.OPEN_WAKA:if("!"===a)n.state=b.SGML_DECL,n.sgmlDecl="";else if(I(s,a));else if(I(E,a))n.state=b.OPEN_TAG,n.tagName=a;else if("/"===a)n.state=b.CLOSE_TAG,n.tagName="";else if("?"===a)n.state=b.PROC_INST,n.procInstName=n.procInstBody="";else{if(F(n,"Unencoded <"),n.startTagPosition+1<n.position){var l=n.position-n.startTagPosition;a=new Array(l).join(" ")+a}n.textNode+="<"+a,n.state=b.TEXT}continue;case b.SGML_DECL:(n.sgmlDecl+a).toUpperCase()===f?(M(n,"onopencdata"),n.state=b.CDATA,n.sgmlDecl="",n.cdata=""):n.sgmlDecl+a==="--"?(n.state=b.COMMENT,n.comment="",n.sgmlDecl=""):(n.sgmlDecl+a).toUpperCase()===g?(n.state=b.DOCTYPE,(n.doctype||n.sawRoot)&&F(n,"Inappropriately located doctype declaration"),n.doctype="",n.sgmlDecl=""):">"===a?(M(n,"onsgmldeclaration",n.sgmlDecl),n.sgmlDecl="",n.state=b.TEXT):I(c,a)?(n.state=b.SGML_DECL_QUOTED,n.sgmlDecl+=a):n.sgmlDecl+=a;continue;case b.SGML_DECL_QUOTED:a===n.q&&(n.state=b.SGML_DECL,n.q=""),n.sgmlDecl+=a;continue;case b.DOCTYPE:">"===a?(n.state=b.TEXT,M(n,"ondoctype",n.doctype),n.doctype=!0):(n.doctype+=a,"["===a?n.state=b.DOCTYPE_DTD:I(c,a)&&(n.state=b.DOCTYPE_QUOTED,n.q=a));continue;case b.DOCTYPE_QUOTED:n.doctype+=a,a===n.q&&(n.q="",n.state=b.DOCTYPE);continue;case b.DOCTYPE_DTD:n.doctype+=a,"]"===a?n.state=b.DOCTYPE:I(c,a)&&(n.state=b.DOCTYPE_DTD_QUOTED,n.q=a);continue;case b.DOCTYPE_DTD_QUOTED:n.doctype+=a,a===n.q&&(n.state=b.DOCTYPE_DTD,n.q="");continue;case b.COMMENT:"-"===a?n.state=b.COMMENT_ENDING:n.comment+=a;continue;case b.COMMENT_ENDING:"-"===a?(n.state=b.COMMENT_ENDED,n.comment=P(n.opt,n.comment),n.comment&&M(n,"oncomment",n.comment),n.comment=""):(n.comment+="-"+a,n.state=b.COMMENT);continue;case b.COMMENT_ENDED:">"!==a?(F(n,"Malformed comment"),n.comment+="--"+a,n.state=b.COMMENT):n.state=b.TEXT;continue;case b.CDATA:"]"===a?n.state=b.CDATA_ENDING:n.cdata+=a;continue;case b.CDATA_ENDING:"]"===a?n.state=b.CDATA_ENDING_2:(n.cdata+="]"+a,n.state=b.CDATA);continue;case b.CDATA_ENDING_2:">"===a?(n.cdata&&M(n,"oncdata",n.cdata),M(n,"onclosecdata"),n.cdata="",n.state=b.TEXT):"]"===a?n.cdata+="]":(n.cdata+="]]"+a,n.state=b.CDATA);continue;case b.PROC_INST:"?"===a?n.state=b.PROC_INST_ENDING:I(s,a)?n.state=b.PROC_INST_BODY:n.procInstName+=a;continue;case b.PROC_INST_BODY:if(!n.procInstBody&&I(s,a))continue;"?"===a?n.state=b.PROC_INST_ENDING:n.procInstBody+=a;continue;case b.PROC_INST_ENDING:">"===a?(M(n,"onprocessinginstruction",{name:n.procInstName,body:n.procInstBody}),n.procInstName=n.procInstBody="",n.state=b.TEXT):(n.procInstBody+="?"+a,n.state=b.PROC_INST_BODY);continue;case b.OPEN_TAG:I(T,a)?n.tagName+=a:(U(n),">"===a?k(n):"/"===a?n.state=b.OPEN_TAG_SLASH:(A(s,a)&&F(n,"Invalid character in tag name"),n.state=b.ATTRIB));continue;case b.OPEN_TAG_SLASH:">"===a?(k(n,!0),G(n)):(F(n,"Forward-slash in opening tag not followed by >"),n.state=b.ATTRIB);continue;case b.ATTRIB:if(I(s,a))continue;">"===a?k(n):"/"===a?n.state=b.OPEN_TAG_SLASH:I(E,a)?(n.attribName=a,n.attribValue="",n.state=b.ATTRIB_NAME):F(n,"Invalid attribute name");continue;case b.ATTRIB_NAME:"="===a?n.state=b.ATTRIB_VALUE:">"===a?(F(n,"Attribute without value"),n.attribValue=n.attribName,B(n),k(n)):I(s,a)?n.state=b.ATTRIB_NAME_SAW_WHITE:I(T,a)?n.attribName+=a:F(n,"Invalid attribute name");continue;case b.ATTRIB_NAME_SAW_WHITE:if("="===a)n.state=b.ATTRIB_VALUE;else{if(I(s,a))continue;F(n,"Attribute without value"),n.tag.attributes[n.attribName]="",n.attribValue="",M(n,"onattribute",{name:n.attribName,value:""}),n.attribName="",">"===a?k(n):I(E,a)?(n.attribName=a,n.state=b.ATTRIB_NAME):(F(n,"Invalid attribute name"),n.state=b.ATTRIB)}continue;case b.ATTRIB_VALUE:if(I(s,a))continue;I(c,a)?(n.q=a,n.state=b.ATTRIB_VALUE_QUOTED):(F(n,"Unquoted attribute value"),n.state=b.ATTRIB_VALUE_UNQUOTED,n.attribValue=a);continue;case b.ATTRIB_VALUE_QUOTED:if(a!==n.q){"&"===a?n.state=b.ATTRIB_VALUE_ENTITY_Q:n.attribValue+=a;continue}B(n),n.q="",n.state=b.ATTRIB_VALUE_CLOSED;continue;case b.ATTRIB_VALUE_CLOSED:I(s,a)?n.state=b.ATTRIB:">"===a?k(n):"/"===a?n.state=b.OPEN_TAG_SLASH:I(E,a)?(F(n,"No whitespace between attributes"),n.attribName=a,n.attribValue="",n.state=b.ATTRIB_NAME):F(n,"Invalid attribute name");continue;case b.ATTRIB_VALUE_UNQUOTED:if(A(d,a)){"&"===a?n.state=b.ATTRIB_VALUE_ENTITY_U:n.attribValue+=a;continue}B(n),">"===a?k(n):n.state=b.ATTRIB;continue;case b.CLOSE_TAG:if(n.tagName)">"===a?G(n):I(T,a)?n.tagName+=a:n.script?(n.script+="</"+n.tagName,n.tagName="",n.state=b.SCRIPT):(A(s,a)&&F(n,"Invalid tagname in closing tag"),n.state=b.CLOSE_TAG_SAW_WHITE);else{if(I(s,a))continue;A(E,a)?n.script?(n.script+="</"+a,n.state=b.SCRIPT):F(n,"Invalid tagname in closing tag."):n.tagName=a}continue;case b.CLOSE_TAG_SAW_WHITE:if(I(s,a))continue;">"===a?G(n):F(n,"Invalid characters in closing tag");continue;case b.TEXT_ENTITY:case b.ATTRIB_VALUE_ENTITY_Q:case b.ATTRIB_VALUE_ENTITY_U:var u,h;switch(n.state){case b.TEXT_ENTITY:u=b.TEXT,h="textNode";break;case b.ATTRIB_VALUE_ENTITY_Q:u=b.ATTRIB_VALUE_QUOTED,h="attribValue";break;case b.ATTRIB_VALUE_ENTITY_U:u=b.ATTRIB_VALUE_UNQUOTED,h="attribValue"}";"===a?(n[h]+=H(n),n.entity="",n.state=u):I(n.entity.length?y:_,a)?n.entity+=a:(F(n,"Invalid character in entity name"),n[h]+="&"+n.entity+a,n.entity="",n.state=u);continue;default:throw new Error(n,"Unknown state: "+n.state)}return n.position>=n.bufferCheckPosition&&function(t){for(var n=Math.max(e.MAX_BUFFER_LENGTH,10),i=0,a=0,o=r.length;a<o;a++){var s=t[r[a]].length;if(s>n)switch(r[a]){case"textNode":w(t);break;case"cdata":M(t,"oncdata",t.cdata),t.cdata="";break;case"script":M(t,"onscript",t.script),t.script="";break;default:O(t,"Max buffer length exceeded: "+r[a])}i=Math.max(i,s)}var l=e.MAX_BUFFER_LENGTH-i;t.bufferCheckPosition=l+t.position}(n),n},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;w(e=this),""!==e.cdata&&(M(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(M(e,"onscript",e.script),e.script="")}};try{t=n(3515).Stream}catch(e){t=function(){}}var a=e.EVENTS.filter(function(e){return"error"!==e&&"end"!==e});function o(e,n){if(!(this instanceof o))return new o(e,n);t.apply(this),this._parser=new i(e,n),this.writable=!0,this.readable=!0;var r=this;this._parser.onend=function(){r.emit("end")},this._parser.onerror=function(e){r.emit("error",e),r._parser.error=null},this._decoder=null,a.forEach(function(e){Object.defineProperty(r,"on"+e,{get:function(){return r._parser["on"+e]},set:function(t){if(!t)return r.removeAllListeners(e),r._parser["on"+e]=t,t;r.on(e,t)},enumerable:!0,configurable:!1})})}o.prototype=Object.create(t.prototype,{constructor:{value:o}}),o.prototype.write=function(e){if("function"==typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(e)){if(!this._decoder){var t=n(748).StringDecoder;this._decoder=new t("utf8")}e=this._decoder.write(e)}return this._parser.write(e.toString()),this.emit("data",e),!0},o.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},o.prototype.on=function(e,n){var r=this;return r._parser["on"+e]||-1===a.indexOf(e)||(r._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),r.emit.apply(r,t)}),t.prototype.on.call(r,e,n)};var s="\r\n\t ",l="0124356789",u="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",c="'\"",d=s+">",f="[CDATA[",g="DOCTYPE",h="http://www.w3.org/XML/1998/namespace",p="http://www.w3.org/2000/xmlns/",m={xml:h,xmlns:p};s=S(s),l=S(l),u=S(u);var 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]/,T=/[:_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-]/,_=/[#:_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-]/;function S(e){return e.split("").reduce(function(e,t){return e[t]=!0,e},{})}function I(e,t){return function(e){return"[object RegExp]"===Object.prototype.toString.call(e)}(e)?!!t.match(e):e[t]}function A(e,t){return!I(e,t)}c=S(c),d=S(d);var R,N,C,b=0;for(var D in e.STATE={BEGIN:b++,BEGIN_WHITESPACE:b++,TEXT:b++,TEXT_ENTITY:b++,OPEN_WAKA:b++,SGML_DECL:b++,SGML_DECL_QUOTED:b++,DOCTYPE:b++,DOCTYPE_QUOTED:b++,DOCTYPE_DTD:b++,DOCTYPE_DTD_QUOTED:b++,COMMENT_STARTING:b++,COMMENT:b++,COMMENT_ENDING:b++,COMMENT_ENDED:b++,CDATA:b++,CDATA_ENDING:b++,CDATA_ENDING_2:b++,PROC_INST:b++,PROC_INST_BODY:b++,PROC_INST_ENDING:b++,OPEN_TAG:b++,OPEN_TAG_SLASH:b++,ATTRIB:b++,ATTRIB_NAME:b++,ATTRIB_NAME_SAW_WHITE:b++,ATTRIB_VALUE:b++,ATTRIB_VALUE_QUOTED:b++,ATTRIB_VALUE_CLOSED:b++,ATTRIB_VALUE_UNQUOTED:b++,ATTRIB_VALUE_ENTITY_Q:b++,ATTRIB_VALUE_ENTITY_U:b++,CLOSE_TAG:b++,CLOSE_TAG_SAW_WHITE:b++,SCRIPT:b++,SCRIPT_ENDING:b++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.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(e.ENTITIES).forEach(function(t){var n=e.ENTITIES[t],r="number"==typeof n?String.fromCharCode(n):n;e.ENTITIES[t]=r}),e.STATE)e.STATE[e.STATE[D]]=D;function v(e,t,n){e[t]&&e[t](n)}function M(e,t,n){e.textNode&&w(e),v(e,t,n)}function w(e){e.textNode=P(e.opt,e.textNode),e.textNode&&v(e,"ontext",e.textNode),e.textNode=""}function P(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function O(e,t){return w(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,v(e,"onerror",t),e}function L(e){return e.sawRoot&&!e.closedRoot&&F(e,"Unclosed root tag"),e.state!==b.BEGIN&&e.state!==b.BEGIN_WHITESPACE&&e.state!==b.TEXT&&O(e,"Unexpected end"),w(e),e.c="",e.closed=!0,v(e,"onend"),i.call(e,e.strict,e.opt),e}function F(e,t){if("object"!=typeof e||!(e instanceof i))throw new Error("bad call to strictFail");e.strict&&O(e,t)}function U(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,M(e,"onopentagstart",n)}function x(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function B(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=x(e.attribName,!0),n=t.prefix,r=t.local;if("xmlns"===n)if("xml"===r&&e.attribValue!==h)F(e,"xml: prefix must be bound to "+h+"\nActual: "+e.attribValue);else if("xmlns"===r&&e.attribValue!==p)F(e,"xmlns: prefix must be bound to "+p+"\nActual: "+e.attribValue);else{var i=e.tag,a=e.tags[e.tags.length-1]||e;i.ns===a.ns&&(i.ns=Object.create(a.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,M(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function k(e,t){if(e.opt.xmlns){var n=e.tag,r=x(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(F(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;
vendor: 7,235 bytes, line 2
2n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach(function(t){M(e,"onopennamespace",{prefix:t,uri:n.ns[t]})});for(var a=0,o=e.attribList.length;a<o;a++){var s=e.attribList[a],l=s[0],u=s[1],c=x(l,!0),d=c.prefix,f=c.local,g=""===d?"":n.ns[d]||"",h={name:l,value:u,prefix:d,local:f,uri:g};d&&"xmlns"!==d&&!g&&(F(e,"Unbound namespace prefix: "+JSON.stringify(d)),h.uri=d),e.tag.attributes[l]=h,M(e,"onattribute",h)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),M(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=b.TEXT:e.state=b.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function G(e){if(!e.tagName)return F(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=b.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=b.SCRIPT);M(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--&&e.tags[t].name!==r;)F(e,"Unexpected close tag");if(t<0)return F(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=b.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,M(e,"onclosetag",e.tagName);var o={};for(var s in a.ns)o[s]=a.ns[s];var l=e.tags[e.tags.length-1]||e;e.opt.xmlns&&a.ns!==l.ns&&Object.keys(a.ns).forEach(function(t){var n=a.ns[t];M(e,"onclosenamespace",{prefix:t,uri:n})})}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=b.TEXT}function H(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),i.toLowerCase()!==n?(F(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function Y(e,t){"<"===t?(e.state=b.OPEN_WAKA,e.startTagPosition=e.position):A(s,t)&&(F(e,"Non-whitespace before first tag."),e.textNode=t,e.state=b.TEXT)}function q(e,t){var n="";return t<e.length&&(n=e.charAt(t)),n}b=e.STATE,String.fromCodePoint||(R=String.fromCharCode,N=Math.floor,C=function(){var e,t,n=[],r=-1,i=arguments.length;if(!i)return"";for(var a="";++r<i;){var o=Number(arguments[r]);if(!isFinite(o)||o<0||o>1114111||N(o)!==o)throw RangeError("Invalid code point: "+o);o<=65535?n.push(o):(e=55296+((o-=65536)>>10),t=o%1024+56320,n.push(e,t)),(r+1===i||n.length>16384)&&(a+=R.apply(null,n),n.length=0)}return a},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:C,configurable:!0,writable:!0}):String.fromCodePoint=C)}(t)},6739:function(e,t,n){!function(e,t,n,r,i){function a(e){if("contents"in e)for(var t=("styleAttrs"in e?e.styleAttrs[r.byName.ruby.qname]:null),n="span"===e.kind&&("container"===t||"textContainer"===t||"baseContainer"===t),i=e.contents.length-1;i>=0;i--)!n||"styleAttrs"in e.contents[i]&&r.byName.ruby.qname in e.contents[i].styleAttrs?a(e.contents[i]):delete e.contents[i]}function o(e,t,n,r){var i=r&&"seq"===r.timeContainer,a=0;r&&(a=i&&n?n.end:r.begin),t.begin=t.explicit_begin?t.explicit_begin+a:a;var s=t.begin,l=null;if("sets"in t)for(var u=0;u<t.sets.length;u++)o(e,t.sets[u],l,t),s="seq"===t.timeContainer?t.sets[u].end:Math.max(s,t.sets[u].end),l=t.sets[u];if("contents"in t){if("contents"in t)for(var c=0;c<t.contents.length;c++)o(e,t.contents[c],l,t),s="seq"===t.timeContainer?t.contents[c].end:Math.max(s,t.contents[c].end),l=t.contents[c]}else s=i?t.begin:Number.POSITIVE_INFINITY;null!==t.explicit_end&&null!==t.explicit_dur?t.end=Math.min(t.begin+t.explicit_dur,a+t.explicit_end):null===t.explicit_end&&null!==t.explicit_dur?t.end=t.begin+t.explicit_dur:null!==t.explicit_end&&null===t.explicit_dur?t.end=a+t.explicit_end:t.end=s,delete t.explicit_begin,delete t.explicit_dur,delete t.explicit_end,e._registerEvent(t)}function s(e){this.node=e}function l(){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 h(e,t){p.call(this,"image"),this.src=e,this.type=t}function p(e){this.kind=e}function m(e){this.id=e}function E(e){this.regionID=e}function T(e){this.styleAttrs=e}function _(e){this.sets=e}function y(e){this.contents=e}function S(e,t,n){this.explicit_begin=e,this.explicit_end=t,this.explicit_dur=n}function I(){p.call(this,"body")}function A(){p.call(this,"div")}function R(){p.call(this,"p")}function N(){p.call(this,"span")}function C(){p.call(this,"span")}function b(){p.call(this,"br")}function D(){}function v(){}function M(e){return e&&"xml:id"in e.attributes&&e.attributes["xml:id"].value||null}function w(e){return e&&"style"in e.attributes?e.attributes.style.value.split(" "):[]}function P(e,t){var n={};if(null!==e)for(var i in e.attributes){var a=e.attributes[i].uri+" "+e.attributes[i].local,o=r.byQName[a];if(void 0!==o){var s=o.parse(e.attributes[i].value);null!==s?(n[a]=s,o===r.byName.zIndex&&B(t,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):k(t,"Cannot parse styling attribute "+a+" --\x3e "+e.attributes[i].value)}}return n}function O(e,t,n){for(var r in e.attributes)if(e.attributes[r].uri===t&&e.attributes[r].local===n)return e.attributes[r].value;return null}function L(e,t,n){var r,i=null;return null!==(r=/^(\d+(?:\.\d+)?)f$/.exec(n))?null!==t&&(i=parseFloat(r[1])/t):null!==(r=/^(\d+(?:\.\d+)?)t$/.exec(n))?null!==e&&(i=parseFloat(r[1])/e):null!==(r=/^(\d+(?:\.\d+)?)ms$/.exec(n))?i=parseFloat(r[1])/1e3:null!==(r=/^(\d+(?:\.\d+)?)s$/.exec(n))?i=parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)h$/.exec(n))?i=3600*parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)m$/.exec(n))?i=60*parseFloat(r[1]):null!==(r=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(n))?i=3600*parseInt(r[1])+60*parseInt(r[2])+parseFloat(r[3]):null!==(r=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(n))&&null!==t&&(i=3600*parseInt(r[1])+60*parseInt(r[2])+parseInt(r[3])+(null===r[4]?0:parseInt(r[4])/t)),i}function F(e,t,n){for(;t.styleRefs.length>0;){var r=t.styleRefs.pop();r in e.styles?(F(e,e.styles[r],n),x(e.styles[r].styleAttrs,t.styleAttrs)):k(n,"Non-existant style id referenced")}}function U(e,t,n,r){for(var i=t.length-1;i>=0;i--){var a=t[i];a in e.styles?x(e.styles[a].styleAttrs,n):k(r,"Non-existant style id referenced")}}function x(e,t){for(var n in e)e.hasOwnProperty(n)&&(n in t||(t[n]=e[n]))}function B(e,t){if(e&&e.warn&&e.warn(t))throw t}function k(e,t){if(e&&e.error&&e.error(t))throw t}function G(e,t){throw e&&e.fatal&&e.fatal(t),t}function H(e,t){for(var n,r=0,i=e.length-1;r<=i;){var a=e[n=Math.floor((r+i)/2)];if(a<t)r=n+1;else{if(!(a>t))return{found:!0,index:n};i=n-1}}return{found:!1,index:r}}e.fromXML=function(e,i,p){var m=t.parser(!0,{xmlns:!0}),E=[],T=[],_=[],y=0,S=null;m.onclosetag=function(e){if(E[0]instanceof D)null!==S.head&&null!==S.head.styling&&U(S.head.styling,E[0].styleRefs,E[0].styleAttrs,i),delete E[0].styleRefs;else if(E[0]instanceof c)for(var t in E[0].styles)E[0].styles.hasOwnProperty(t)&&F(E[0],E[0].styles[t],i);
vendor: 4,347 bytes, line 2
2else if(E[0]instanceof R||E[0]instanceof N){if(E[0].contents.length>1){var r,a=[E[0].contents[0]];for(r=1;r<E[0].contents.length;r++)E[0].contents[r]instanceof C&&a[a.length-1]instanceof C?a[a.length-1].text+=E[0].contents[r].text:a.push(E[0].contents[r]);E[0].contents=a}E[0]instanceof N&&1===E[0].contents.length&&E[0].contents[0]instanceof C&&(E[0].text=E[0].contents[0].text,delete E[0].contents)}else E[0]instanceof s&&(E[0].node.uri===n.ns_tt&&"metadata"===E[0].node.local?y--:y>0&&p&&"onCloseTag"in p&&p.onCloseTag());_.shift(),T.shift(),E.shift()},m.ontext=function(e){if(void 0===E[0]);else if(E[0]instanceof N||E[0]instanceof R){if(E[0]instanceof N){var t=E[0].styleAttrs[r.byName.ruby.qname];if("container"===t||"textContainer"===t||"baseContainer"===t)return}var n=new C;n.initFromText(S,E[0],e,T[0],_[0],i),E[0].contents.push(n)}else E[0]instanceof s&&y>0&&p&&"onText"in p&&p.onText(e)},m.onopentag=function(e){var t=e.attributes["xml:space"];t?_.unshift(t.value):0===_.length?_.unshift("default"):_.unshift(_[0]);var a=e.attributes["xml:lang"];if(a?T.unshift(a.value):0===T.length?T.unshift(""):T.unshift(T[0]),e.uri===n.ns_tt)if("tt"===e.local)null!==S&&G(i,"Two <tt> elements at ("+this.line+","+this.column+")"),(S=new l).initFromNode(e,T[0],i),E.unshift(S);else if("head"===e.local)E[0]instanceof l||G(i,"Parent of <head> element is not <tt> at ("+this.line+","+this.column+")"),E.unshift(S.head);else if("styling"===e.local)E[0]instanceof u||G(i,"Parent of <styling> element is not <head> at ("+this.line+","+this.column+")"),E.unshift(S.head.styling);else if("style"===e.local){var o;E[0]instanceof c?((o=new d).initFromNode(e,i),o.id?S.head.styling.styles[o.id]=o:k(i,"<style> element missing @id attribute"),E.unshift(o)):E[0]instanceof D?((o=new d).initFromNode(e,i),x(o.styleAttrs,E[0].styleAttrs),E.unshift(o)):G(i,"Parent of <style> element is not <styling> or <region> at ("+this.line+","+this.column+")")}else if("initial"===e.local){var m;if(E[0]instanceof c){for(var C in(m=new f).initFromNode(e,i),m.styleAttrs)m.styleAttrs.hasOwnProperty(C)&&(S.head.styling.initials[C]=m.styleAttrs[C]);E.unshift(m)}else G(i,"Parent of <initial> element is not <styling> at ("+this.line+","+this.column+")")}else if("layout"===e.local)E[0]instanceof u||G(i,"Parent of <layout> element is not <head> at "+this.line+","+this.column+")"),E.unshift(S.head.layout);else if("region"===e.local){E[0]instanceof g||G(i,"Parent of <region> element is not <layout> at "+this.line+","+this.column+")");var M=new D;M.initFromNode(S,e,T[0],i),!M.id||M.id in S.head.layout.regions?k(i,"Ignoring <region> with duplicate or missing @id at "+this.line+","+this.column+")"):S.head.layout.regions[M.id]=M,E.unshift(M)}else if("body"===e.local){E[0]instanceof l||G(i,"Parent of <body> element is not <tt> at "+this.line+","+this.column+")"),null!==S.body&&G(i,"Second <body> element at "+this.line+","+this.column+")");var w=new I;w.initFromNode(S,e,T[0],i),S.body=w,E.unshift(w)}else if("div"===e.local){E[0]instanceof A||E[0]instanceof I||G(i,"Parent of <div> element is not <body> or <div> at "+this.line+","+this.column+")");var P=new A;P.initFromNode(S,E[0],e,T[0],i);var O=P.styleAttrs[r.byName.backgroundImage.qname];O&&(P.contents.push(new h(O)),delete P.styleAttrs[r.byName.backgroundImage.qname]),E[0].contents.push(P),E.unshift(P)}else if("image"===e.local){E[0]instanceof A||G(i,"Parent of <image> element is not <div> at "+this.line+","+this.column+")");var L=new h;L.initFromNode(S,E[0],e,T[0],i),E[0].contents.push(L),E.unshift(L)}else if("p"===e.local){E[0]instanceof A||G(i,"Parent of <p> element is not <div> at "+this.line+","+this.column+")");var F=new R;F.initFromNode(S,E[0],e,T[0],i),E[0].contents.push(F),E.unshift(F)}else if("span"===e.local){E[0]instanceof N||E[0]instanceof R||G(i,"Parent of <span> element is not <span> or <p> at "+this.line+","+this.column+")");var U=new N;U.initFromNode(S,E[0],e,T[0],_[0],i),E[0].contents.push(U),E.unshift(U)}else if("br"===e.local){E[0]instanceof N||E[0]instanceof R||G(i,"Parent of <br> element is not <span> or <p> at "+this.line+","+this.column+")");var B=new b;B.initFromNode(S,E[0],e,T[0],i),E[0].contents.push(B),E.unshift(B)}else if("set"===e.local){E[0]instanceof N||E[0]instanceof R||E[0]instanceof A||E[0]instanceof I||E[0]instanceof D||E[0]instanceof b||G(i,"Parent of <set>
2 element is not a content element or a region at "+this.line+","+this.column+")");var H=new v;H.initFromNode(S,E[0],e,i),E[0].sets.push(H),E.unshift(H)}else E.unshift(new s(e));else E.unshift(new s(e));if(E[0]instanceof s)if(e.uri===n.ns_tt&&"metadata"===e.local)y++;else if(y>0&&p&&"onOpenTag"in p){var Y=[];for(var q in e.attributes)Y[e.attributes[q].uri+" "+e.attributes[q].local]={uri:e.attributes[q].uri,local:e.attributes[q].local,value:e.attributes[q].value};p.onOpenTag(e.uri,e.local,Y)}},m.write(e).close(),delete S.head.styling.styles;var M=!1;for(var w in S.head.layout.regions)if(S.head.layout.regions.hasOwnProperty(w)){M=!0;break}if(!M){var P=D.prototype.createDefaultRegion(S.lang);S.head.layout.regions[P.id]=P}for(var O in S.head.layout.regions)S.head.layout.regions.hasOwnProperty(O)&&o(S,S.head.layout.regions[O],null,null);return S.body&&o(S,S.body,null,null),S.body&&a(S.body),S},l.prototype.initFromNode=function(e,t,r){var a=function(e,t){var r=O(e,n.ns_ttp,"cellResolution"),i=15,a=32;if(null!==r){var o=/(\d+) (\d+)/.exec(r);null!==o?(a=parseInt(o[1]),i=parseInt(o[2])):B(t,"Malformed cellResolution value (using initial value instead)")}return{w:a,h:i}}(e,r);this.cellLength={h:new i.ComputedLength(0,1/a.h),w:new i.ComputedLength(1/a.w,0)};var o=function(e,t){var r,i=O(e,n.ns_ttp,"frameRate"),a=30;null!==i&&(null!==(r=/(\d+)/.exec(i))?a=parseInt(r[1]):B(t,"Malformed frame rate attribute (using initial value instead)"));var o=O(e,n.ns_ttp,"frameRateMultiplier"),s=1;null!==o&&(null!==(r=/(\d+) (\d+)/.exec(o))?s=parseInt(r[1])/parseInt(r[2]):B(t,"Malformed frame rate multiplier attribute (using initial value instead)"));var l=s*a,u=1,c=O(e,n.ns_ttp,"tickRate");return null===c?null!==i&&(u=l):null!==(r=/(\d+)/.exec(c))?u=parseInt(r[1]):B(t,"Malformed tick rate attribute (using initial value instead)"),{effectiveFrameRate:l,tickRate:u}}(e,r);this.effectiveFrameRate=o.effectiveFrameRate,this.tickRate=o.tickRate,this.aspectRatio=function(e,t){var r=O(e,n.ns_ittp,"aspectRatio");null===r&&(r=O(e,n.ns_ttp,"displayAspectRatio"));var i=null;if(null!==r){var a=/(\d+)\s+(\d+)/.exec(r);if(null!==a){var o=parseInt(a[1]),s=parseInt(a[2]);0!==o&&0!==s?i=o/s:k(t,"Illegal aspectRatio values (ignoring)")}else k(t,"Malformed aspectRatio attribute (ignoring)")}return i}(e,r);var s=O(e,n.ns_ttp,"timeBase");null!==s&&"media"!==s&&G(r,"Unsupported time base");var l=function(e,t){var r=O(e,n.ns_tts,"extent");if(null===r)return null;var a=r.split(" ");if(2!==a.length)return B(t,"Malformed extent (ignoring)"),null;var o=i.parseLength(a[0]),s=i.parseLength(a[1]);return s&&o?{h:s,w:o}:(B(t,"Malformed extent values (ignoring)"),null)}(e,r);null===l?this.pxLength={h:null,w:null}:("px"===l.h.unit&&"px"===l.w.unit||G(r,"Extent on TT must be in px or absent"),this.pxLength={h:new i.ComputedLength(0,1/l.h.value),w:new i.ComputedLength(1/l.w.value,0)}),this.dimensions={h:new i.ComputedLength(0,1),w:new i.ComputedLength(1,0)},this.lang=t},l.prototype._registerEvent=function(e){if(!(e.end<=e.begin)){var t=H(this.events,e.begin);if(t.found||this.events.splice(t.index,0,e.begin),e.end!==Number.POSITIVE_INFINITY){var n=H(this.events,e.end);n.found||this.events.splice(n.index,0,e.end)}}},l.prototype.getMediaTimeRange=function(){return[this.events[0],this.events[this.events.length-1]]},l.prototype.getMediaTimeEvents=function(){return this.events},d.prototype.initFromNode=function(e,t){this.id=M(e),this.styleAttrs=P(e,t),this.styleRefs=w(e)},f.prototype.initFromNode=function(e,t){for(var r in this.styleAttrs={},e.attributes)if(e.attributes[r].uri===n.ns_itts||e.attributes[r].uri===n.ns_ebutts||e.attributes[r].uri===n.ns_tts){var i=e.attributes[r].uri+" "+e.attributes[r].local;this.styleAttrs[i]=e.attributes[r].value}},h.prototype.initFromNode=function(e,t,n,r,i){this.src="src"in n.attributes?n.attributes.src.value:null,this.src||k(i,"Invalid image@src attribute"),this.type="type"in n.attributes?n.attributes.type.value:null,this.type||k(i,"Invalid image@type attribute"),T.prototype.initFromNode.call(this,e,t,n,i),S.prototype.initFromNode.call(this,e,t,n,i),_.prototype.initFromNode.call(this,e,t,n,i),E.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},m.prototype.initFromNode=function(e,t,n,r){this.id=M(n)},E.prototype.initFromNode=function(e,t,n,r){this.regionID=function(e){return e&&"region"in e.attributes?e.attributes.region.value:""}(n)},T.prototype.initFromNode=function(e,t,n,r){this.styleAttrs=P(n,r),null!==e.head&&null!==e.head.styling&&U(e.head.styling,w(n),this.styleAttrs,r)},_.prototype.initFromNode=function(e,t,n,r){this.sets=[]},y.prototype.initFromNode=function(e,t,n,r){this.contents=[]},S.prototype.initFromNode=function(e,t,n,r){var i=function(e,t,n,r){var i=null;n&&"begin"in n.attributes&&null===(i=L(e.tickRate,e.effectiveFrameRate,n.attributes.begin.value))&&B(r,"Malformed begin value "+n.attributes.begin.value+" (using 0)");var a=null;n&&"dur"in n.attributes&&null===(a=L(e.tickRate,e.effectiveFrameRate,n.attributes.dur.value))&&B(r,"Malformed dur value "+n.attributes.dur.value+" (ignoring)");var o=null;return n&&"end"in n.attributes&&null===(o=L(e.tickRate,e.effectiveFrameRate,n.attributes.end.value))&&B(r,"Malformed end value (ignoring)"),{explicit_begin:i,explicit_end:o,explicit_dur:a}}(e,0,n,r);this.explicit_begin=i.explicit_begin,this.explicit_end=i.explicit_end,this.explicit_dur=i.explicit_dur,this.timeContainer=function(e,t){var n=e&&"timeContainer"in e.attributes?e.attributes.timeContainer.value:null;return n&&"par"!==n?"seq"===n?"seq":(k(t,"Illegal value of timeContainer (assuming 'par')"),"par"):"par"}(n,r)},I.prototype.initFromNode=function(e,t,n,r){T.prototype.initFromNode.call(this,e,null,t,r),S.prototype.initFromNode.call(this,e,null,t,r),_.prototype.initFromNode.call(this,e,null,t,r),E.prototype.initFromNode.call(this,e,null,t,r),y.prototype.initFromNode.call(this,e,null,t,r),this.lang=n},A.prototype.initFromNode=function(e,t,n,r,i){T.prototype.initFromNode.call(this,e,t,n,i),S.prototype.initFromNode.call(this,e,t,n,i),_.prototype.initFromNode.call(this,e,t,n,i),E.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},R.prototype.initFromNode=function(e,t,n,r,i){T.prototype.initFromNode.call(this,e,t,n,i),S.prototype.initFromNode.call(this,e,t,n,i),_.prototype.initFromNode.call(this,e,t,n,i),E.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},N.prototype.initFromNode=function(e,t,n,r,i,a){T.prototype.initFromNode.call(this,e,t,n,a),S.prototype.initFromNode.call(this,e,t,n,a),_.prototype.initFromNode.call(this,e,t,n,a),E.prototype.initFromNode.call(this,e,t,n,a),y.prototype.initFromNode.call(this,e,t,n,a),this.space=i,this.lang=r},C.prototype.initFromText=function(e,t,n,r,i,a){S.prototype.initFromNode.call(this,e,t,null,a),this.text=n,this.space=i,this.lang=r},b.prototype.initFromNode=function(e,t,n,r,i){E.prototype.initFromNode.call(this,e,t,n,i),S.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},D.prototype.createDefaultRegion=function(e){var t=new D;return m.call(t,""),T.call(t,{}),_.call(t,[]),S.call(t,0,Number.POSITIVE_INFINITY,null),this.lang=e,t},D.prototype.initFromNode=function(e,t,n,r){m.prototype.initFromNode.call(this,e,null,t,r),S.prototype.initFromNode.call(this,e,null,t,r),_.prototype.initFromNode.call(this,e,null,t,r),this.styleAttrs=P(t,r),this.styleRefs=w(t),this.lang=n},v.prototype.initFromNode=function(e,t,n,r){S.prototype.initFromNode.call(this,e,t,n,r);var i=P(n,r);for(var a in this.qname=null,this.value=null,i)if(i.hasOwnProperty(a)){if(this.qname){k(r,"More than one style specified on set");break}this.qname=a,this.value=i[a]}}}(t,"undefined"==typeof sax?n(5474):sax,"undefined"==typeof imscNames?n(977):imscNames,"undefined"==typeof imscStyles?n(1219):imscStyles,"undefined"==typeof imscUtils?n(6404):imscUtils)}
vendor: 9,564 bytes, line 2
2,1612:function(e,t,n){var r=/firefox/i.test(navigator.userAgent);!function(e,t,n){function i(e,t,d,g){var h;if("region"===d.kind)(h=document.createElement("div")).style.position="absolute";else if("body"===d.kind)h=document.createElement("div");else if("div"===d.kind)h=document.createElement("div");else if("image"===d.kind){if(h=document.createElement("img"),null!==e.imgResolver&&null!==d.src){var E=e.imgResolver(d.src,h);E&&(h.src=E),h.height=e.regionH,h.width=e.regionW}}else if("p"===d.kind)h=document.createElement("p");else if("span"===d.kind)if("container"===d.styleAttrs[n.byName.ruby.qname])h=document.createElement("ruby"),e.ruby=!0;else if("base"===d.styleAttrs[n.byName.ruby.qname])h=document.createElement("span");else if("text"===d.styleAttrs[n.byName.ruby.qname])h=document.createElement("rt");else if("baseContainer"===d.styleAttrs[n.byName.ruby.qname])h=document.createElement("rbc");else if("textContainer"===d.styleAttrs[n.byName.ruby.qname])h=document.createElement("rtc");else{if("delimiter"===d.styleAttrs[n.byName.ruby.qname])return;h=document.createElement("span")}else"br"===d.kind&&(h=document.createElement("br"));if(h){if(d.lang&&("region"!==d.kind&&d.lang===g.lang||(h.lang=d.lang)),t.appendChild(h),h.style.margin="0","region"===d.kind){var y=d.styleAttrs[n.byName.writingMode.qname];"lrtb"===y||"lr"===y?(e.ipd="lr",e.bpd="tb"):"rltb"===y||"rl"===y?(e.ipd="rl",e.bpd="tb"):"tblr"===y?(e.ipd="tb",e.bpd="lr"):"tbrl"!==y&&"tb"!==y||(e.ipd="tb",e.bpd="rl")}else if("p"===d.kind&&"tb"===e.bpd){var S=d.styleAttrs[n.byName.direction.qname];e.ipd="ltr"===S?"lr":"rl"}for(var I=0;I<f.length;I++){var A=f[I],R=d.styleAttrs[A.qname];void 0!==R&&null!==A.map&&A.map(e,h,d,R)}var N=h,C=d.styleAttrs[n.byName.linePadding.qname];if(C&&!C.isZero()){var b=C.toUsedLength(e.w,e.h);if(b>0){var D=Math.ceil(b)+"px";"tb"===e.bpd?(N.style.paddingLeft=D,N.style.paddingRight=D):(N.style.paddingTop=D,N.style.paddingBottom=D),e.lp=C}}var v=d.styleAttrs[n.byName.multiRowAlign.qname];if(v&&"auto"!==v){var M=document.createElement("span");M.style.display="inline-block",M.style.textAlign=v,h.appendChild(M),N=M,e.mra=v}var w=d.styleAttrs[n.byName.rubyReserve.qname];if(w&&"none"!==w[0]&&(e.rubyReserve=w),d.styleAttrs[n.byName.fillLineGap.qname]&&(e.flg=!0),"span"===d.kind&&d.text){var P=d.styleAttrs[n.byName.textEmphasis.qname];if(P&&"none"!==P.style&&(e.textEmphasis=!0),n.byName.textCombine.qname in d.styleAttrs&&"all"===d.styleAttrs[n.byName.textCombine.qname])h.textContent=d.text,h._isd_element=d,P&&c(e,h,0,P);else for(var O="",L=0;L<d.text.length;L++){O+=d.text.charAt(L);var F=d.text.charCodeAt(L);if(F<55296||F>56319||L===d.text.length-1){var U=document.createElement("span");U.textContent=O,P&&c(e,U,0,P),h.appendChild(U),O="",U._isd_element=d}}}if("contents"in d)for(var x=0;x<d.contents.length;x++)i(e,N,d.contents[x],d);var B=[];if("p"===d.kind&&(u(e,N,B,null),e.rubyReserve&&(function(e,t){for(var n=0;n<e.length;n++){var r,i,a=document.createElement("ruby"),o=document.createElement("span");o.textContent="​",a.appendChild(o);var s,l=t.rubyReserve[1].toUsedLength(t.w,t.h)+"px";"both"===t.rubyReserve[0]||"outside"===t.rubyReserve[0]&&1==e.length?((r=document.createElement("rtc")).style[m]=p?"after":"under",r.textContent="​",r.style.fontSize=l,(i=document.createElement("rtc")).style[m]=p?"before":"over",i.textContent="​",i.style.fontSize=l,a.appendChild(r),a.appendChild(i)):((r=document.createElement("rtc")).textContent="​",r.style.fontSize=l,s="after"===t.rubyReserve[0]||"outside"===t.rubyReserve[0]&&n>0?p?"after":"tb"===t.bpd||"rl"===t.bpd?"under":"over":p?"before":"tb"===t.bpd||"rl"===t.bpd?"over":"under",r.style[m]=s,a.appendChild(r));for(var u=null,c=0;c<e[n].rbc.length;c++)if("ruby"===e[n].rbc[c].localName){u=e[n].rbc[c];for(var d=0;d<u.style.length;d++)a.style.setProperty(u.style.item(d),u.style.getPropertyValue(u.style.item(d)));break}(u=u||e[n].elements[0].node).parentElement.insertBefore(a,u)}}(B,e),e.rubyReserve=null),(e.ruby||e.rubyReserve)&&(function(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<e[n].rbc.length;r++){var i;e[n].rbc[r].style[m]||(i=p?0===n?"before":"after":"tb"===t.bpd||"rl"===t.bpd?0===n?"over":"under":0===n?"under":"over",e[n].rbc[r].style[m]=i)}}(B,e),e.ruby=null),e.textEmphasis&&(function(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<e[n].te.length;r++){var i;e[n].te[r].style[T]&&"none"!==e[n].te[r].style[T]||(i="tb"===t.bpd?0===n?"left over":"left under":"rl"===t.bpd?0===n?"right under":"left under":0===n?"left under":"right under",e[n].te[r].style[T]=i)}}(B,e),e.textEmphasis=null),e.mra&&(function(e){for(var t=0;t<e.length-1;t++){var n=e[t].elements.length;if(0!==n&&!1===e[t].br){var r=document.createElement("br"),i=e[t].elements[n-1].node;i.parentElement.insertBefore(r,i.nextSibling)}}}(B),e.mra=null),e.lp&&(function(e,t,n){if(null!==e)for(var i=0;i<e.length;i++){var a=e[i].elements.length,o=Math.ceil(t)+"px",s="-"+Math.ceil(t)+"px";if(0!==a){var l=e[i].elements[e[i].start_elem],u=e[i].elements[e[i].end_elem];if(l===u){var c=l.node.getBoundingClientRect();if(0==c.width||0==c.height)continue}"lr"===n.ipd?(l.node.style.marginLeft=s,l.node.style.paddingLeft=o):"rl"===n.ipd?(l.node.style.paddingRight=o,l.node.style.marginRight=s):"tb"===n.ipd&&(l.node.style.paddingTop=o,l.node.style.marginTop=s),"lr"===n.ipd?(r||(u.node.style.marginRight=s),u.node.style.paddingRight=o):"rl"===n.ipd?(u.node.style.paddingLeft=o,r||(u.node.style.marginLeft=s)):"tb"===n.ipd&&(u.node.style.paddingBottom=o,u.node.style.marginBottom=s)}}}(B,e.lp.toUsedLength(e.w,e.h),e),e.lp=null),function(e,t){for(var n=0;n<e.length;n++)for(var r=e[n],i=1;i<r.elements.length;){var s=r.elements[i-1],l=r.elements[i];o(s.node,l.node,t)?r.elements.splice(i,1):i++}for(var u,c,d=[],f=0;f<e.length;f++)for(var g=0;g<e[f].elements.length;g++)(c=a(u=e[f].elements[g].node,d,!1))&&(u.style.backgroundColor=c);for(var h=0;h<d.length;h++)d[h].style.backgroundColor=""}(B,e),e.flg)){var k=l(N.getBoundingClientRect(),e);!function(e,t,n,r){for(var i=Math.sign(n-t),a=0;a<=e.length;a++){var o,s,l,u;if(o=0===a?Math.round(t):a===e.length?Math.round(n):Math.round((e[a-1].after+e[a].before)/2),a>0&&e[a-1])for(l=0;l<e[a-1].elements.length;l++)s=i*(o-(u=e[a-1].elements[l]).after)+"px","lr"===r.bpd?u.node.style.paddingRight=s:"rl"===r.bpd?u.node.style.paddingLeft=s:"tb"===r.bpd&&(u.node.style.paddingBottom=s);if(a<e.length)for(l=0;l<e[a].elements.length;l++)s=i*((u=e[a].elements[l]).before-o)+"px","lr"===r.bpd?u.node.style.paddingLeft=s:"rl"===r.bpd?u.node.style.paddingRight=s:"tb"===r.bpd&&(u.node.style.paddingTop=s)}}(B,k.before,k.after,e),e.flg=null}if("region"===d.kind&&"tb"===e.bpd&&e.enableRollUp&&d.contents.length>0&&"after"===d.styleAttrs[n.byName.displayAlign.qname]){u(e,N,B,null);var G=new s(""===d.id?"_":d.id,B);if(e.currentISDState[G.id]=G,e.previousISDState&&G.id in e.previousISDState&&e.previousISDState[G.id].plist.length>0&&G.plist.length>1&&G.plist[G.plist.length-2].text===e.previousISDState[G.id].plist[e.previousISDState[G.id].plist.length-1].text){var H=h.firstElementChild,Y=G.plist[G.plist.length-1].after-G.plist[G.plist.length-1].before;H.style.bottom="-"+Y+"px",H.style.transition="transform 0.4s",H.style.position="relative",H.style.transform="translateY(-"+Y+"px)"}}}else _(e.errorHandler,"Error processing ISD element kind: "+d.kind)}function a(e,t,n){return e.style.backgroundColor?(n&&!t.includes(e)&&t.push(e),e.style.backgroundColor):"SPAN"===e.parentElement.nodeName||"RUBY"===e.parentElement.nodeName||"RBC"===e.parentElement.nodeName||"RTC"===e.parentElement.nodeName||"RT"===e.parentElement.nodeName?a(e.parentElement,t,!0):void 0}function o(e,t,n){if("SPAN"===e.tagName&&"SPAN"===t.tagName&&e._isd_element===t._isd_element){if(!e._isd_element)return _(n.errorHandler,"Internal error: HTML span is not linked to a source element; cannot merge spans."),!1;e.textContent+=t.textContent;for(var r=0;r<t.style.length;r++){var i=t.style[r];(i.indexOf("border")>=0||i.indexOf("padding")>=0||i.indexOf("margin")>=0)&&(e.style[i]=t.style[i])}return t.parentElement.removeChild(t),!0}return!1}function s(e,t){this.id=e,this.plist=t}function l(e,t){var n={before:null,after:null,start:null,end:null};return"tb"===t.bpd?(n.before=e.top,n.after=e.bottom,"lr"===t.ipd?(n.start=e.left,n.end=e.right):(n.start=e.right,n.end=e.left)):"lr"===t.bpd?(n.before=e.left,n.after=e.right,n.start=e.top,n.end=e.bottom):"rl"===t.bpd&&(n.before=e.right,n.after=e.left,n.start=e.top,n.end=e.bottom),n}function u(e,t,n,r){if("rt"!==t.localName&&"rtc"!==t.localName){var i,a,o,s,c=t.style.backgroundColor||r;if(0===t.childElementCount)if("span"===t.localName||"rb"===t.localName){var d=l(t.getBoundingClientRect(),e);if(0!==n.length&&(i=d.before,a=d.after,o=n[n.length-1].before,a<(s=n[n.length-1].after)&&i>o||s<=a&&o>=i)){var f=Math.sign(d.after-d.before),g=Math.sign(d.end-d.start);f*(d.before-n[n.length-1].before)<0&&(n[n.length-1].before=d.before),f*(d.after-n[n.length-1].after)>0&&(n[n.length-1].after=d.after),g*(d.start-n[n.length-1].start)<0&&(n[n.length-1].start=d.start,n[n.length-1].start_elem=n[n.length-1].elements.length),g*(d.end-n[n.length-1].end)>0&&(n[n.length-1].end=d.end,n[n.length-1].end_elem=n[n.length-1].elements.length)}else n.push({before:d.before,after:d.after,start:d.start,end:d.end,start_elem:0,end_elem:0,elements:[],rbc:[],te:[],text:"",br:!1});n[n.length-1].text+=t.textContent,n[n.length-1].elements.push({node:t,bgcolor:c,before:d.before,after:d.after})}else"br"===t.localName&&0!==n.length&&(n[n.length-1].br=!0);else for(var h=t.firstChild;h;
2)h.nodeType===Node.ELEMENT_NODE&&(u(e,h,n,c),"ruby"===h.localName||"rtc"===h.localName?n.length>0&&n[n.length-1].rbc.push(h):"span"===h.localName&&h.style[E]&&"none"!==h.style[E]&&n.length>0&&n[n.length-1].te.push(h)),h=h.nextSibling}}function c(e,t,n,r){var i;"none"!==r.style&&("auto"===r.style?t.style[E]="filled":t.style[E]=r.style+" "+r.symbol,("before"===r.position||"after"===r.position)&&(i="tb"===e.bpd?"before"===r.position?"left over":"left under":"rl"===e.bpd?"before"===r.position?"right under":"left under":"before"===r.position?"left under":"right under",t.style[T]=i))}function d(e,t){this.qname=e,this.map=t}e.render=function(e,t,n,r,a,o,s,l,u){var c=r||t.clientHeight,d=a||t.clientWidth;if(null!==e.aspectRatio){var f=c*e.aspectRatio;f>d?c=Math.round(d/e.aspectRatio):d=f}var g=document.createElement("div");g.style.position="relative",g.style.width=d+"px",g.style.height=c+"px",g.style.margin="auto",g.style.top=0,g.style.bottom=0,g.style.left=0,g.style.right=0,g.style.zIndex=0;var h={h:c,w:d,regionH:null,regionW:null,imgResolver:n,displayForcedOnlyMode:o||!1,isd:e,errorHandler:s,previousISDState:l,enableRollUp:u||!1,currentISDState:{},flg:null,lp:null,mra:null,ipd:null,bpd:null,ruby:null,textEmphasis:null,rubyReserve:null};if(t.appendChild(g),"contents"in e)for(var p=0;p<e.contents.length;p++)i(h,g,e.contents[p],e);return h.currentISDState};for(var f=[new d("http://www.w3.org/ns/ttml#styling backgroundColor",function(e,t,n,r){0!==r[3]&&(t.style.backgroundColor="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")")}),new d("http://www.w3.org/ns/ttml#styling color",function(e,t,n,r){t.style.color="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")"}),new d("http://www.w3.org/ns/ttml#styling direction",function(e,t,n,r){t.style.direction=r}),new d("http://www.w3.org/ns/ttml#styling display",function(e,t,n,r){}),new d("http://www.w3.org/ns/ttml#styling displayAlign",function(e,t,n,r){t.style.display="flex",t.style.flexDirection="column","before"===r?t.style.justifyContent="flex-start":"center"===r?t.style.justifyContent="center":"after"===r&&(t.style.justifyContent="flex-end")}),new d("http://www.w3.org/ns/ttml#styling extent",function(e,t,n,r){e.regionH=r.h.toUsedLength(e.w,e.h),e.regionW=r.w.toUsedLength(e.w,e.h);var i=0,a=0,o=n.styleAttrs["http://www.w3.org/ns/ttml#styling padding"];o&&(i=o[0].toUsedLength(e.w,e.h)+o[2].toUsedLength(e.w,e.h),a=o[1].toUsedLength(e.w,e.h)+o[3].toUsedLength(e.w,e.h)),t.style.height=e.regionH-i+"px",t.style.width=e.regionW-a+"px"}),new d("http://www.w3.org/ns/ttml#styling fontFamily",function(e,t,n,r){for(var i=[],a=0;a<r.length;a++)r[a]=r[a].trim(),"monospaceSerif"===r[a]?(i.push("Courier New"),i.push('"Liberation Mono"'),i.push("Courier"),i.push("monospace")):"proportionalSansSerif"===r[a]?(i.push("Arial"),i.push("Helvetica"),i.push('"Liberation Sans"'),i.push("sans-serif")):"monospace"===r[a]?i.push("monospace"):"sansSerif"===r[a]?i.push("sans-serif"):"serif"===r[a]?i.push("serif"):"monospaceSansSerif"===r[a]?(i.push("Consolas"),i.push("monospace")):"proportionalSerif"===r[a]?i.push("serif"):i.push(r[a]);if(i.length>0){for(var o=[i[0]],s=1;s<i.length;s++)-1==o.indexOf(i[s])&&o.push(i[s]);i=o}t.style.fontFamily=i.join(",")}),new d("http://www.w3.org/ns/ttml#styling shear",function(e,t,n,r){if(0!==r){var i=-.9*r;"tb"===e.bpd?t.style.transform="skewX("+i+"deg)":t.style.transform="skewY("+i+"deg)"}}),new d("http://www.w3.org/ns/ttml#styling fontSize",function(e,t,n,r){t.style.fontSize=r.toUsedLength(e.w,e.h)+"px"}),new d("http://www.w3.org/ns/ttml#styling fontStyle",function(e,t,n,r){t.style.fontStyle=r}),new d("http://www.w3.org/ns/ttml#styling fontWeight",function(e,t,n,r){t.style.fontWeight=r}),new d("http://www.w3.org/ns/ttml#styling lineHeight",function(e,t,n,r){t.style.lineHeight="normal"===r?"normal":r.toUsedLength(e.w,e.h)+"px"}),new d("http://www.w3.org/ns/ttml#styling opacity",function(e,t,n,r){t.style.opacity=r}),new d("http://www.w3.org/ns/ttml#styling origin",function(e,t,n,r){t.style.top=r.h.toUsedLength(e.w,e.h)+"px",t.style.left=r.w.toUsedLength(e.w,e.h)+"px"}),new d("http://www.w3.org/ns/ttml#styling overflow",function(e,t,n,r){t.style.overflow=r}),new d("http://www.w3.org/ns/ttml#styling padding",function(e,t,n,r){var i=[];
2i[0]=r[0].toUsedLength(e.w,e.h)+"px",i[1]=r[3].toUsedLength(e.w,e.h)+"px",i[2]=r[2].toUsedLength(e.w,e.h)+"px",i[3]=r[1].toUsedLength(e.w,e.h)+"px",t.style.padding=i.join(" ")}),new d("http://www.w3.org/ns/ttml#styling position",function(e,t,n,r){t.style.top=r.h.toUsedLength(e.w,e.h)+"px",t.style.left=r.w.toUsedLength(e.w,e.h)+"px"}),new d("http://www.w3.org/ns/ttml#styling rubyAlign",function(e,t,n,r){t.style.rubyAlign="spaceAround"===r?"space-around":"center"}),new d("http://www.w3.org/ns/ttml#styling rubyPosition",function(e,t,n,r){var i;"before"!==r&&"after"!==r||(i=p?r:"tb"===e.bpd||"rl"===e.bpd?"before"===r?"over":"under":"before"===r?"under":"over",t.parentElement.style[m]=i)}),new d("http://www.w3.org/ns/ttml#styling showBackground",null),new d("http://www.w3.org/ns/ttml#styling textAlign",function(e,t,n,r){var i;i="start"===r?"rl"===e.ipd?"right":"left":"end"===r?"rl"===e.ipd?"left":"right":r,t.style.textAlign=i}),new d("http://www.w3.org/ns/ttml#styling textDecoration",function(e,t,n,r){t.style.textDecoration=r.join(" ").replace("lineThrough","line-through")}),new d("http://www.w3.org/ns/ttml#styling textOutline",function(e,t,n,r){}),new d("http://www.w3.org/ns/ttml#styling textShadow",function(e,t,r,i){var a=r.styleAttrs[n.byName.textOutline.qname];if("none"===i&&"none"===a)t.style.textShadow="";else{var o=[];if("none"!==a){var s="rgba("+a.color[0].toString()+","+a.color[1].toString()+","+a.color[2].toString()+","+(a.color[3]/255).toString()+")";o.push("1px 1px 1px "+s),o.push("-1px 1px 1px "+s),o.push("1px -1px 1px "+s),o.push("-1px -1px 1px "+s)}if("none"!==i)for(var l=0;l<i.length;l++)o.push(i[l].x_off.toUsedLength(e.w,e.h)+"px "+i[l].y_off.toUsedLength(e.w,e.h)+"px "+i[l].b_radius.toUsedLength(e.w,e.h)+"px rgba("+i[l].color[0].toString()+","+i[l].color[1].toString()+","+i[l].color[2].toString()+","+(i[l].color[3]/255).toString()+")");t.style.textShadow=o.join(",")}}),new d("http://www.w3.org/ns/ttml#styling textCombine",function(e,t,n,r){t.style.textCombineUpright=r}),new d("http://www.w3.org/ns/ttml#styling textEmphasis",function(e,t,n,r){}),new d("http://www.w3.org/ns/ttml#styling unicodeBidi",function(e,t,n,r){var i;i="bidiOverride"===r?"bidi-override":r,t.style.unicodeBidi=i}),new d("http://www.w3.org/ns/ttml#styling visibility",function(e,t,n,r){t.style.visibility=r}),new d("http://www.w3.org/ns/ttml#styling wrapOption",function(e,t,n,r){"wrap"===r?"preserve"===n.space?t.style.whiteSpace="pre-wrap":t.style.whiteSpace="normal":"preserve"===n.space?t.style.whiteSpace="pre":t.style.whiteSpace="noWrap"}),new d("http://www.w3.org/ns/ttml#styling writingMode",function(e,t,n,r){"lrtb"===r||"lr"===r||"rltb"===r||"rl"===r?t.style.writingMode="horizontal-tb":"tblr"===r?t.style.writingMode="vertical-lr":"tbrl"!==r&&"tb"!==r||(t.style.writingMode="vertical-rl")}),new d("http://www.w3.org/ns/ttml#styling zIndex",function(e,t,n,r){t.style.zIndex=r}),new d("http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay",function(e,t,n,r){e.displayForcedOnlyMode&&!1===r&&(t.style.visibility="hidden")})],g={},h=0;h<f.length;h++)g[f[h].qname]=f[h];var p="webkitRubyPosition"in window.getComputedStyle(document.documentElement),m=p?"webkitRubyPosition":"rubyPosition",E="webkitTextEmphasisStyle"in window.getComputedStyle(document.documentElement)?"webkitTextEmphasisStyle":"textEmphasisStyle",T="webkitTextEmphasisPosition"in window.getComputedStyle(document.documentElement)?"webkitTextEmphasisPosition":"textEmphasisPosition";function _(e,t){if(e&&e.error&&e.error(t))throw t}}(t,"undefined"==typeof imscNames?n(977):imscNames,"undefined"==typeof imscStyles?n(1219):imscStyles,"undefined"==typeof imscUtils?n(6404):imscUtils)},8905:function(e,t,n){!function(e,t,n,r){e.generateISD=function(e,t,r){var i,o=new l(e),s={},u={},c=e.head.styling.initials[n.byName.showBackground.qname],d=e.head.styling.initials[n.byName.backgroundColor.qname];for(var f in e.head.layout.regions)if(e.head.layout.regions.hasOwnProperty(f)){var g=e.head.layout.regions[f],h=g.styleAttrs[n.byName.showBackground.qname]||c,p=g.styleAttrs[n.byName.backgroundColor.qname]||d;
vendor: 5,008 bytes, line 2
2u[g.id]=("always"===h||void 0===h)&&void 0!==p&&!(t<g.begin||t>=g.end)}for(var m in e.body&&e.body.regionID&&(u[e.body.regionID]=!0),i=null!==e.body?function e(t,n){if(n.contents){var r={};for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i]);return r.contents=[],n.contents.filter(function(e){return!(t<e.begin||t>=e.end)}).forEach(function(n){var i=e(t,n);i.regionID&&(u[i.regionID]=!0),null!==i&&r.contents.push(i)}),r}return n}(t,e.body):null,void 0!==u[""]&&(u[""]=!0),u)if(u[m]){var E=a(e,t,e.head.layout.regions[m],i,null,"",e.head.layout.regions[m],r,s);null!==E&&o.contents.push(E.element)}return o};var i=[n.byName.color.qname,n.byName.textCombine.qname,n.byName.textDecoration.qname,n.byName.textEmphasis.qname,n.byName.textOutline.qname,n.byName.textShadow.qname];function a(e,t,l,d,f,g,h,p,m){if(t<h.begin||t>=h.end)return null;var E="regionID"in h&&""!==h.regionID?h.regionID:g;if(null!==f&&E!==l.id&&(!("contents"in h)||"contents"in h&&0===h.contents.length||""!==E))return null;var T=new u(h);if("sets"in h)for(var _=0;_<h.sets.length;_++)t<h.sets[_].begin||t>=h.sets[_].end||(T.styleAttrs[h.sets[_].qname]=h.sets[_].value);var y={};for(var S in T.styleAttrs)if(T.styleAttrs.hasOwnProperty(S)&&(y[S]=!0,"region"===T.kind&&S===n.byName.writingMode.qname&&!(n.byName.direction.qname in T.styleAttrs))){var I=T.styleAttrs[S];"lrtb"===I||"lr"===I?T.styleAttrs[n.byName.direction.qname]="ltr":"rltb"!==I&&"rl"!==I||(T.styleAttrs[n.byName.direction.qname]="rtl")}if(null!==f)for(var A=0;A<n.all.length;A++){var R=n.all[A];if(R.qname===n.byName.textDecoration.qname){var N=f.styleAttrs[R.qname],C=T.styleAttrs[R.qname],b=[];void 0===C?b=N:-1===C.indexOf("none")?((-1===C.indexOf("noUnderline")&&-1!==N.indexOf("underline")||-1!==C.indexOf("underline"))&&b.push("underline"),(-1===C.indexOf("noLineThrough")&&-1!==N.indexOf("lineThrough")||-1!==C.indexOf("lineThrough"))&&b.push("lineThrough"),(-1===C.indexOf("noOverline")&&-1!==N.indexOf("overline")||-1!==C.indexOf("overline"))&&b.push("overline")):b.push("none"),T.styleAttrs[R.qname]=b}else if(R.qname!==n.byName.fontSize.qname||R.qname in T.styleAttrs||"span"!==T.kind||"textContainer"!==T.styleAttrs[n.byName.ruby.qname])if(R.qname!==n.byName.fontSize.qname||R.qname in T.styleAttrs||"span"!==T.kind||"text"!==T.styleAttrs[n.byName.ruby.qname])R.inherit&&R.qname in f.styleAttrs&&!(R.qname in T.styleAttrs)&&(T.styleAttrs[R.qname]=f.styleAttrs[R.qname]);else{var D=f.styleAttrs[n.byName.fontSize.qname];"textContainer"===f.styleAttrs[n.byName.ruby.qname]?T.styleAttrs[R.qname]=D:T.styleAttrs[R.qname]=new r.ComputedLength(.5*D.rw,.5*D.rh)}else{var v=f.styleAttrs[n.byName.fontSize.qname];T.styleAttrs[R.qname]=new r.ComputedLength(.5*v.rw,.5*v.rh)}}for(var M=0;M<n.all.length;M++){var w=n.all[M];if(!(w.qname in T.styleAttrs)&&!(w.qname===n.byName.position.qname&&n.byName.origin.qname in T.styleAttrs||w.qname===n.byName.origin.qname&&n.byName.position.qname in T.styleAttrs)){var P=e.head.styling.initials[w.qname]||w.initial;if(null!==P&&("region"===T.kind||!1===w.inherit&&null!==P)){var O=w.parse(P);null!==O?(T.styleAttrs[w.qname]=O,y[w.qname]=!0):c(p,"Invalid initial value for '"+w.qname+"' on element '"+T.kind)}}}for(var L=0;L<n.all.length;L++){var F=n.all[L];if(F.qname in y&&null!==F.compute){var U=F.compute(e,f,T,T.styleAttrs[F.qname],m);null!==U?T.styleAttrs[F.qname]=U:(T.styleAttrs[F.qname]=F.compute(e,f,T,F.parse(F.initial),m),c(p,"Style '"+F.qname+"' on element '"+T.kind+"' cannot be computed"))}}if("none"===T.styleAttrs[n.byName.display.qname])return null;var x=null;null===f?x=null===d?[]:[d]:"contents"in h&&(x=h.contents);for(var B=0;null!==x&&B<x.length;B++){var k=a(e,t,l,d,T,E,x[B],p,m);null!==k&&T.contents.push(k.element)}for(var G in T.styleAttrs)if(T.styleAttrs.hasOwnProperty(G)){var H=!1;if("span"===T.kind){var Y=T.styleAttrs[n.byName.ruby.qname];(H=("container"===Y||"textContainer"===Y||"baseContainer"===Y)&&-1!==i.indexOf(G))||(H="container"!==Y&&G===n.byName.rubyAlign.qname),H||(H=!("textContainer"===Y||"text"===Y)&&G===n.byName.rubyPosition.qname)}if(!H){var q=n.byQName[G];"applies"in q&&(H=-1===q.applies.indexOf(T.kind))}H&&delete T.styleAttrs[G]}var V=T.styleAttrs[n.byName.ruby.qname];if("p"===T.kind||"span"===T.kind&&("textContainer"===V||"text"===V)){var K=[];o(T,K),function(e){for(var t,n=0;n<e.length;)if("br"!==(t=e[n]).kind&&"preserve"!==t.space){var r=t.text.replace(/[\t\r\n ]+/g," ");/^[ ]/.test(r)&&(0===n||"br"===(i=e[n-1]).kind||/[\r\n\t ]$/.test(i.text))&&(r=r.substring(1)),t.text=r,0===r.length?e.splice(n,1):n++}else n++;var i,a;for(n=0;n<e.length;n++)"br"!==(t=e[n]).kind&&"preserve"!==t.space?/[ ]$/.test(t.text)&&(n===e.length-1||"br"===(a=e[n+1]).kind||"preserve"===a.space&&/^[\r\n]/.test(a.text))&&(t.text=t.text.slice(0,-1)):n++}(K),s(T)}return"div"===T.kind&&n.byName.backgroundImage.qname in T.styleAttrs||"br"===T.kind||"image"===T.kind||"contents"in T&&T.contents.length>0||"span"===T.kind&&null!==T.text||"region"===T.kind&&"always"===T.styleAttrs[n.byName.showBackgroun
vendor: 4,084 bytes, line 2
2d.qname]?{region_id:E,element:T}:null}function o(e,t){if("contents"in e)for(var r=0;r<e.contents.length;r++){var i=e.contents[r],a=i.styleAttrs[n.byName.ruby.qname];("span"!==i.kind||"textContainer"!==a&&"text"!==a)&&("contents"in i?o(i,t):("span"===i.kind&&0!==i.text.length||"br"===i.kind)&&t.push(i))}}function s(e){if("br"===e.kind)return!1;if("text"in e)return 0===e.text.length;if("contents"in e){for(var t=e.contents.length;t--;)s(e.contents[t])&&e.contents.splice(t,1);return 0===e.contents.length}}function l(e){this.contents=[],this.aspectRatio=e.aspectRatio,this.lang=e.lang}function u(e){for(var t in this.kind=e.kind||"region",this.lang=e.lang,e.id&&(this.id=e.id),this.styleAttrs={},e.styleAttrs)e.styleAttrs.hasOwnProperty(t)&&(this.styleAttrs[t]=e.styleAttrs[t]);"src"in e&&(this.src=e.src),"type"in e&&(this.type=e.type),"text"in e?this.text=e.text:("region"===this.kind||"contents"in e)&&(this.contents=[]),"space"in e&&(this.space=e.space)}function c(e,t){if(e&&e.error&&e.error(t))throw t}}(t,"undefined"==typeof imscNames?n(977):imscNames,"undefined"==typeof imscStyles?n(1219):imscStyles,"undefined"==typeof imscUtils?n(6404):imscUtils)},7640:function(e,t,n){t.generateISD=n(8905).generateISD,t.fromXML=n(6739).fromXML,t.renderHTML=n(1612).render},977:function(e,t){!function(e){e.ns_tt="http://www.w3.org/ns/ttml",e.ns_tts="http://www.w3.org/ns/ttml#styling",e.ns_ttp="http://www.w3.org/ns/ttml#parameter",e.ns_xml="http://www.w3.org/XML/1998/namespace",e.ns_itts="http://www.w3.org/ns/ttml/profile/imsc1#styling",e.ns_ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter",e.ns_smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt",e.ns_ebutts="urn:ebu:tt:style"}(t)},1219:function(e,t,n){!function(e,t,n){function r(e,t,n,r,i,a,o,s){this.name=t,this.ns=e,this.qname=e+" "+t,this.inherit=i,this.animatable=a,this.initial=n,this.applies=r,this.parse=o,this.compute=s}for(var i in e.all=[new r(t.ns_tts,"backgroundColor","transparent",["body","div","p","region","span"],!1,!0,n.parseColor,null),new r(t.ns_tts,"color","white",["span"],!0,!0,n.parseColor,null),new r(t.ns_tts,"direction","ltr",["p","span"],!0,!0,function(e){return e},null),new r(t.ns_tts,"display","auto",["body","div","p","region","span"],!1,!0,function(e){return e},null),new r(t.ns_tts,"displayAlign","before",["region"],!1,!0,function(e){return e},null),new r(t.ns_tts,"extent","auto",["tt","region"],!1,!0,function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null},function(e,t,r,i,a){var o,s;if("auto"===i)o=new n.ComputedLength(0,1);else if(null===(o=n.toComputedLength(i.h.value,i.h.unit,null,e.dimensions.h,null,e.pxLength.h)))return null;if("auto"===i)s=new n.ComputedLength(1,0);else if(null===(s=n.toComputedLength(i.w.value,i.w.unit,null,e.dimensions.w,null,e.pxLength.w)))return null;return{h:o,w:s}}),new r(t.ns_tts,"fontFamily","default",["span","p"],!0,!0,function(e){for(var t=e.split(","),n=[],r=0;r<t.length;r++)t[r]=t[r].trim(),"'"!==t[r].charAt(0)&&'"'!==t[r].charAt(0)&&"default"===t[r]?n.push("monospaceSerif"):n.push(t[r]);return n},null),new r(t.ns_tts,"shear","0%",["p"],!0,!0,n.parseLength,function(e,t,n,r){return"%"!==r.unit?null:Math.abs(r.value)>100?100*Math.sign(r.value):r.value}),new r(t.ns_tts,"fontSize","1c",["span","p"],!0,!0,n.parseLength,function(t,r,i,a,o){return n.toComputedLength(a.value,a.unit,null!==r?r.styleAttrs[e.byName.fontSize.qname]:t.cellLength.h,null!==r?r.styleAttrs[e.byName.fontSize.qname]:t.cellLength.h,t.cellLength.h,t.pxLength.h)}),new r(t.ns_tts,"fontStyle","normal",["span","p"],!0,!0,function(e){return e},null),new r(t.ns_tts,"fontWeight","normal",["span","p"],!0,!0,function(e){return e},null),new r(t.ns_tts,"lineHeight","normal",["p"],!0,!0,function(e){return"normal"===e?e:n.parseLength(e)},function(t,r,i,a,o){var s;if("normal"===a)s=a;else if(null===(s=n.toComputedLength(a.value,a.unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h)))return null;return s}
2),new r(t.ns_tts,"opacity",1,["region"],!1,!0,parseFloat,null),new r(t.ns_tts,"origin","auto",["region"],!1,!0,function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null},function(e,t,r,i,a){var o,s;if("auto"===i)o=new n.ComputedLength(0,0);else if(null===(o=n.toComputedLength(i.h.value,i.h.unit,null,e.dimensions.h,null,e.pxLength.h)))return null;if("auto"===i)s=new n.ComputedLength(0,0);else if(null===(s=n.toComputedLength(i.w.value,i.w.unit,null,e.dimensions.w,null,e.pxLength.w)))return null;return{h:o,w:s}}),new r(t.ns_tts,"overflow","hidden",["region"],!1,!0,function(e){return e},null),new r(t.ns_tts,"padding","0px",["region"],!1,!0,function(e){var t=e.split(" ");if(t.length>4)return null;for(var r=[],i=0;i<t.length;i++){var a=n.parseLength(t[i]);if(!a)return null;r.push(a)}return r},function(t,r,i,a,o){var s;if(1===a.length)s=[a[0],a[0],a[0],a[0]];else if(2===a.length)s=[a[0],a[1],a[0],a[1]];else if(3===a.length)s=[a[0],a[1],a[2],a[1]];else{if(4!==a.length)return null;s=[a[0],a[1],a[2],a[3]]}var l=i.styleAttrs[e.byName.writingMode.qname];if("lrtb"===l||"lr"===l)s=[s[0],s[3],s[2],s[1]];else if("rltb"===l||"rl"===l)s=[s[0],s[1],s[2],s[3]];else if("tblr"===l)s=[s[3],s[0],s[1],s[2]];else{if("tbrl"!==l&&"tb"!==l)return null;s=[s[3],s[2],s[1],s[0]]}for(var u=[],c=0;c<s.length;c++)if(0===s[c].value)u[c]=new n.ComputedLength(0,0);else if(u[c]=n.toComputedLength(s[c].value,s[c].unit,i.styleAttrs[e.byName.fontSize.qname],0===c||2===c?i.styleAttrs[e.byName.extent.qname].h:i.styleAttrs[e.byName.extent.qname].w,0===c||2===c?t.cellLength.h:t.cellLength.w,0===c||2===c?t.pxLength.h:t.pxLength.w),null===u[c])return null;return u}),new r(t.ns_tts,"position","top left",["region"],!1,!0,function(e){return n.parsePosition(e)},function(t,r,i,a){var o,s;return null===(o=n.toComputedLength(a.v.offset.value,a.v.offset.unit,null,new n.ComputedLength(-i.styleAttrs[e.byName.extent.qname].h.rw,t.dimensions.h.rh-i.styleAttrs[e.byName.extent.qname].h.rh),null,t.pxLength.h))?null:("bottom"===a.v.edge&&(o=new n.ComputedLength(-o.rw-i.styleAttrs[e.byName.extent.qname].h.rw,t.dimensions.h.rh-o.rh-i.styleAttrs[e.byName.extent.qname].h.rh)),s=n.toComputedLength(a.h.offset.value,a.h.offset.unit,null,new n.ComputedLength(t.dimensions.w.rw-i.styleAttrs[e.byName.extent.qname].w.rw,-i.styleAttrs[e.byName.extent.qname].w.rh),null,t.pxLength.w),null===o?null:("right"===a.h.edge&&(s=new n.ComputedLength(t.dimensions.w.rw-s.rw-i.styleAttrs[e.byName.extent.qname].w.rw,-s.rh-i.styleAttrs[e.byName.extent.qname].w.rh)),{h:o,w:s}))}),new r(t.ns_tts,"ruby","none",["span"],!1,!0,function(e){return e},null),new r(t.ns_tts,"rubyAlign","center",["span"],!0,!0,function(e){return"center"!==e&&"spaceAround"!==e?null:e},null),new r(t.ns_tts,"rubyPosition","outside",["span"],!0,!0,function(e){return e},null),new r(t.ns_tts,"rubyReserve","none",["p"],!0,!0,function(e){var t=e.split(" "),r=[null,null];if(0===t.length||t.length>2)return null;if("none"!==t[0]&&"both"!==t[0]&&"after"!==t[0]&&"before"!==t[0]&&"outside"!==t[0])return null;if(r[0]=t[0],2===t.length&&"none"!==t[0]){var i=n.parseLength(t[1]);if(!i)return null;r[1]=i}return r},function(t,r,i,a,o){return"none"===a[0]?a:null===(s=null===a[1]?new n.ComputedLength(.5*i.styleAttrs[e.byName.fontSize.qname].rw,.5*i.styleAttrs[e.byName.fontSize.qname].rh):n.toComputedLength(a[1].value,a[1].unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h))?null:[a[0],s];var s}),new r(t.ns_tts,"showBackground","always",["region"],!1,!0,function(e){return e},null),new r(t.ns_tts,"textAlign","start",["p"],!0,!0,function(e){return e},function(e,t,n,r,i){return"left"===r?"start":"right"===r?"end":r}),new r(t.ns_tts,"textCombine","none",["span"],!0,!0,function(e){return"none"===e||"all"===e?e:null},null),new r(t.ns_tts,"textDecoration","none",["span"],!0,!0,function(e){return e.split(" ")},null),new r(t.ns_tts,"textEmphasis","none",["span"],!0,!0,function(e){for(var t=e.split(" "),r={style:null,symbol:null,color:null,position:null},i=0;i<t.length;i++)if("none"===t[i]||"auto"===t[i])r.style=t[i];else if("filled"===t[i]||"open"===t[i])r.style=t[i];else if("circle"===t[i]||"dot"===t[i]||"sesame"===t[i])r.symbol=t[i];else if("current"===t[i])r.color=t[i];else if("outside"===t[i]||"before"===t[i]||"after"===t[i])r.position=t[i];else if(r.color=n.parseColor(t[i]),null===r.color)return null;return null==r.style&&null==r.symbol?r.style="auto":(r.symbol=r.symbol||"circle",r.style=r.style||"filled"),r.position=r.position||"outside",r.color=r.color||"current",r},null),new r(t.ns_tts,"textOutline","none",["span"],!0,!0,function(e){if("none"===e)return e;var t={},r=e.split(" ");if(0===r.length||r.length>2)return null;var i=n.parseColor(r[0]);if(t.color=i,null!==i&&r.shift(),1!==r.length)return null;var a=n.parseLength(r[0]);return a?(t.thickness=a,t):null},function(t,r,i,a,o){if("none"===a)return a;var s={};return null===a.color?s.color=i.styleAttrs[e.byName.color.qname]:s.color=a.color,s.thickness=n.toComputedLength(a.thickness.value,a.thickness.unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h),null===s.thickness?null:s}),new r(t.ns_tts,"textShadow","none",["span"],!0,!0,n.parseTextShadow,function(t,r,i,a){if("none"===a)return a;for(var o=[],s=0;s<a.length;s++){var l={};if(l.x_off=n.toComputedLength(a[s][0].value,a[s][0].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.w),null===l.x_off)return null;if(l.y_off=n.toComputedLength(a[s][1].value,a[s][1].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.h),null===l.y_off)return null;if(null===a[s][2])l.b_radius=0;else if(l.b_radius=n.toComputedLength(a[s][2].value,a[s][2].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.h),null===l.b_radius)return null;null===a[s][3]?l.color=i.styleAttrs[e.byName.color.qname]:l.color=a[s][3],o.push(l)}return o}
vendor: 10,336 bytes, line 2
2),new r(t.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,function(e){return e},null),new r(t.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,function(e){return e},null),new r(t.ns_tts,"wrapOption","wrap",["span"],!0,!0,function(e){return e},null),new r(t.ns_tts,"writingMode","lrtb",["region"],!1,!0,function(e){return e},null),new r(t.ns_tts,"zIndex","auto",["region"],!1,!0,function(e){var t;return"auto"===e?t=e:(t=parseInt(e),isNaN(t)&&(t=null)),t},null),new r(t.ns_ebutts,"linePadding","0c",["p"],!0,!1,n.parseLength,function(e,t,r,i,a){return n.toComputedLength(i.value,i.unit,null,null,e.cellLength.w,null)}),new r(t.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,function(e){return e},null),new r(t.ns_smpte,"backgroundImage",null,["div"],!1,!1,function(e){return e},null),new r(t.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,function(e){return"true"===e},null),new r(t.ns_itts,"fillLineGap","false",["p"],!0,!0,function(e){return"true"===e},null)],e.byQName={},e.all)e.byQName[e.all[i].qname]=e.all[i];for(var a in e.byName={},e.all)e.byName[e.all[a].name]=e.all[a]}(t,"undefined"==typeof imscNames?n(977):imscNames,"undefined"==typeof imscUtils?n(6404):imscUtils)},6404:function(e,t){!function(e){var t=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,n=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,r=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,i={transparent:[0,0,0,0],black:[0,0,0,255],silver:[192,192,192,255],gray:[128,128,128,255],white:[255,255,255,255],maroon:[128,0,0,255],red:[255,0,0,255],purple:[128,0,128,255],fuchsia:[255,0,255,255],magenta:[255,0,255,255],green:[0,128,0,255],lime:[0,255,0,255],olive:[128,128,0,255],yellow:[255,255,0,255],navy:[0,0,128,255],blue:[0,0,255,255],teal:[0,128,128,255],aqua:[0,255,255,255],cyan:[0,255,255,255]};e.parseColor=function(e){var a,o=null,s=i[e.toLowerCase()];return void 0!==s?o=s:null!==(a=t.exec(e))?o=[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),void 0!==a[4]?parseInt(a[4],16):255]:null!==(a=n.exec(e))?o=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),255]:null!==(a=r.exec(e))&&(o=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),parseInt(a[4])]),o};var a=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/;e.parseLength=function(e){var t,n=null;return null!==(t=a.exec(e))&&(n={value:parseFloat(t[1]),unit:t[2]}),n},e.parseTextShadow=function(t){for(var n=t.match(/([^\(,\)]|\([^\)]+\))+/g),r=[],i=0;i<n.length;i++){var a=n[i].split(" ");if(1===a.length&&"none"===a[0])return"none";if(a.length>1&&a.length<5){var o=[null,null,null,null],s=e.parseLength(a.shift());if(null===s)return null;if(o[0]=s,null===(s=e.parseLength(a.shift())))return null;if(o[1]=s,0===a.length){r.push(o);continue}if(null!==(s=e.parseLength(a[0]))&&(o[2]=s,a.shift()),0===a.length){r.push(o);continue}var l=e.parseColor(a[0]);if(null===l)return null;o[3]=l,r.push(o)}}return r},e.parsePosition=function(t){var n=t.split(" "),r=function(e){return"center"===e||"left"===e||"top"===e||"bottom"===e||"right"===e};if(n.length>4)return null;for(var i=0;i<n.length;i++)if(!r(n[i])){var a=e.parseLength(n[i]);if(null===a)return null;n[i]=a}for(var o={h:{edge:"left",offset:{value:50,unit:"%"}},v:{edge:"top",offset:{value:50,unit:"%"}}},s=0;s<n.length;){var l=n[s++];if(r(l)){var u={value:0,unit:"%"};2!==n.length&&s<n.length&&!r(n[s])&&(u=n[s++]),"right"===l?(o.h.edge=l,o.h.offset=u):"bottom"===l?(o.v.edge=l,o.v.offset=u):"left"===l?o.h.offset=u:"top"===l&&(o.v.offset=u)}else{if(1!==n.length&&2!==n.length)return null;1===s?o.h.offset=l:o.v.offset=l}}return o},e.ComputedLength=function(e,t){this.rw=e,this.rh=t},e.ComputedLength.prototype.toUsedLength=function(e,t){return e*this.rw+t*this.rh},e.ComputedLength.prototype.isZero=function(){return 0===this.rw&&0===this.rh},e.toComputedLength=function(t,n,r,i,a,o){return"%"===n&&i?new e.ComputedLength(i.rw*t/100,i.rh*t/100):"em"===n&&r?new e.ComputedLength(r.rw*t,r.rh*t):"c"===n&&a?new e.ComputedLength(t*a.rw,t*a.rh):"px"===n&&o?new e.ComputedLength(t*o.rw,t*o.rh):"rh"===n?new e.ComputedLength(0,t/100):"rw"===n?new e.ComputedLength(t/100,0):null}}(t)},7523:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},3282:function(e){function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,a=-1,o=0,s=0;s<=e.length;++s){if(s<e.length)n=e.charCodeAt(s);else{if(47===n)break;n=47}if(47===n){if(a===s-1||1===o);else if(a!==s-1&&2===o){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var l=r.lastIndexOf("/");if(l!==r.length-1){-1===l?(r="",i=0):i=(r=r.slice(0,l)).length-1-r.lastIndexOf("/"),a=s,o=0;continue}}else if(2===r.length||1===r.length){r="",i=0,a=s,o=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(a+1,s):r=e.slice(a+1,s),i=s-a-1;a=s,o=0}else 46===n&&-1!==o?++o:o=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var o;a>=0?o=arguments[a]:(void 0===e&&(e=process.cwd()),o=e),t(o),0!==o.length&&(r=o+"/"+r,i=47===o.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var a=e.length,o=a-i,s=1;s<n.length&&47===n.charCodeAt(s);++s);for(var l=n.length-s,u=o<l?o:l,c=-1,d=0;d<=u;++d){if(d===u){if(l>u){if(47===n.charCodeAt(s+d))return n.slice(s+d+1);if(0===d)return n.slice(s+d)}else o>u&&(47===e.charCodeAt(i+d)?c=d:0===d&&(c=0));break}var f=e.charCodeAt(i+d);if(f!==n.charCodeAt(s+d))break;47===f&&(c=d)}var g="";for(d=i+c+1;d<=a;++d)d!==a&&47!==e.charCodeAt(d)||(0===g.length?g+="..":g+="/..");return g.length>0?g+n.slice(s+c):(s+=c,47===n.charCodeAt(s)&&++s,n.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,a=!0,o=e.length-1;o>=1;--o)if(47===(n=e.charCodeAt(o))){if(!a){i=o;break}}else a=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,a=-1,o=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var s=n.length-1,l=-1;for(r=e.length-1;r>=0;--r){var u=e.charCodeAt(r);if(47===u){if(!o){i=r+1;break}}else-1===l&&(o=!1,l=r+1),s>=0&&(u===n.charCodeAt(s)?-1==--s&&(a=r):(s=-1,a=l))}return i===a?a=l:-1===a&&(a=e.length),e.slice(i,a)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!o){i=r+1;break}}else-1===a&&(o=!1,a=r+1);return-1===a?"":e.slice(i,a)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,a=!0,o=0,s=e.length-1;s>=0;--s){var l=e.charCodeAt(s);if(47!==l)-1===i&&(a=!1,i=s+1),46===l?-1===n?n=s:1!==o&&(o=1):-1!==n&&(o=-1);else if(!a){r=s+1;break}}return-1===n||-1===i||0===o||1===o&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),a=47===i;a?(n.root="/",r=1):r=0;for(var o=-1,s=0,l=-1,u=!0,c=e.length-1,d=0;c>=r;--c)if(47!==(i=e.charCodeAt(c)))-1===l&&(u=!1,l=c+1),46===i?-1===o?o=c:1!==d&&(d=1):-1!==o&&(d=-1);else if(!u){s=c+1;break}return-1===o||-1===l||0===d||1===d&&o===l-1&&o===s+1?-1!==l&&(n.base=n.name=0===s&&a?e.slice(1,l):e.slice(s,l)):(0===s&&a?(n.name=e.slice(1,o),n.base=e.slice(1,l)):(n.name=e.slice(s,o),n.base=e.slice(s,l)),n.ext=e.slice(o,l)),s>0?n.dir=e.slice(0,s-1):a&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r},3515:function(e,t,n){e.exports=i;var r=n(9826).EventEmitter;function i(){r.call(this)}n(7523)(i,r),i.Readable=n(2762),i.Writable=n(3726),i.Duplex=n(884),i.Transform=n(6756),i.PassThrough=n(1390),i.finished=n(2896),i.pipeline=n(8460),i.Stream=i,i.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",l));var o=!1;function s(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===r.listenerCount(this,"error"))throw e}function c(){n.removeListener("data",i),e.removeListener("drain",a),n.removeListener("end",s),n.removeListener("close",l),n.removeListener("error",u),e.removeListener("error",u),n.removeListener("end",c),n.removeListener("close",c),e.removeListener("close",c)}return n.on("error",u),e.on("error",u),n.on("end",c),n.on("close",c),e.on("close",c),e.emit("pipe",n),e}},1602:function(e){var t={};function n(e,n,r){r||(r=Error);var i=function(e){var t,r;function i(t,r,i){return e.call(this,function(e,t,r){return"string"==typeof n?n:n(e,t,r)}(t,r,i))||this}return r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,i}(r);i.prototype.name=r.name,i.prototype.code=e,t[e]=i}function r(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invali
2d for option "'+e+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(e,t,n){var i,a,o,s;if("string"==typeof t&&"not "===t.substr(0,4)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length)," argument"===e.substring(n-9,n)}(e))a="The ".concat(e," ").concat(i," ").concat(r(t,"type"));else{var l=("number"!=typeof s&&(s=0),s+1>(o=e).length||-1===o.indexOf(".",s)?"argument":"property");a='The "'.concat(e,'" ').concat(l," ").concat(i," ").concat(r(t,"type"))}return a+". Received type ".concat(typeof n)},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=t},884:function(e,t,n){var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=u;var i=n(2762),a=n(3726);n(7523)(u,i);for(var o=r(a.prototype),s=0;s<o.length;s++){var l=o[s];u.prototype[l]||(u.prototype[l]=a.prototype[l])}function u(e){if(!(this instanceof u))return new u(e);i.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||process.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},1390:function(e,t,n){e.exports=i;var r=n(6756);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}n(7523)(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},2762:function(e,t,n){var r;e.exports=R,R.ReadableState=A,n(9826).EventEmitter;var i,a=function(e,t){return e.listeners(t).length},o=n(2611),s=n(44).Buffer,l=(void 0!==n.g?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},u=n(7199);i=u&&u.debuglog?u.debuglog("stream"):function(){};var c,d,f,g=n(3791),h=n(2410),p=n(1749).getHighWaterMark,m=n(1602).codes,E=m.ERR_INVALID_ARG_TYPE,T=m.ERR_STREAM_PUSH_AFTER_EOF,_=m.ERR_METHOD_NOT_IMPLEMENTED,y=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(7523)(R,o);var S=h.errorOrDestroy,I=["error","close","destroy","pause","resume"];function A(e,t,i){r=r||n(884),e=e||{},"boolean"!=typeof i&&(i=t instanceof r),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=p(this,e,"readableHighWaterMark",i),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(c||(c=n(748).StringDecoder),this.decoder=new c(e.encoding),this.encoding=e.encoding)}function R(e){if(r=r||n(884),!(this instanceof R))return new R(e);var t=this instanceof r;this._readableState=new A(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function N(e,t,n,r,a){i("readableAddChunk",t);var o,u=e._readableState;if(null===t)u.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?v(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,M(e)))}}(e,u);else if(a||(o=function(e,t){var n,r;return r=t,s.isBuffer(r)||r instanceof l||"string"==typeof t||void 0===t||e.objectMode||(n=new E("chunk",["string","Buffer","Uint8Array"],t)),n}(u,t)),o)S(e,o);else if(u.objectMode||t&&t.length>0)if("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),r)u.endEmitted?S(e,new y):C(e,u,t,!0);else if(u.ended)S(e,new T);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!n?(t=u.decoder.write(t),u.objectMode||0!==t.length?C(e,u,t,!1):w(e,u)):C(e,u,t,!1)}else r||(u.reading=!1,w(e,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function C(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&v(e)),w(e,t)}Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),R.prototype.destroy=h.destroy,R.prototype._undestroy=h.undestroy,R.prototype._destroy=function(e,t){t(e)},R.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=s.from(e,t),t=""),n=!0),N(this,e,t,!1,n)},R.prototype.unshift=function(e){return N(this,e,null,!0,!1)},R.prototype.isPaused=function(){return!1===this._readableState.flowing},R.prototype.setEncoding=function(e){c||(c=n(748).StringDecoder);var t=new c(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;
vendor: 4,772 bytes, line 2
2for(var r=this._readableState.buffer.head,i="";null!==r;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var b=1073741824;function D(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=b?e=b:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function v(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(M,e))}function M(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,U(e)}function w(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(P,e,t))}function P(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(i("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function O(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function L(e){i("readable nexttick read 0"),e.read(0)}function F(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),U(e),t.flowing&&!t.reading&&e.read(0)}function U(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function x(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function B(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(k,t,e))}function k(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function G(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}R.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):v(this),null;if(0===(e=D(e,t))&&t.ended)return 0===t.length&&B(this),null;var r,a=t.needReadable;return i("need readable",a),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",a=!0),t.ended||t.reading?i("reading or ended",a=!1):a&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=D(n,t))),null===(r=e>0?x(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&B(this)),null!==r&&this.emit("data",r),r},R.prototype._read=function(e){S(this,new _("_read()"))},R.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,i("pipe count=%d opts=%j",r.pipesCount,t);var o=t&&!1===t.end||e===process.stdout||e===process.stderr?h:s;function s(){i("onend"),e.end()}r.endEmitted?process.nextTick(o):n.once("end",o),e.on("unpipe",function t(a,o){i("onunpipe"),a===n&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,i("cleanup"),e.removeListener("close",f),e.removeListener("finish",g),e.removeListener("drain",l),e.removeListener("error",d),e.removeListener("unpipe",t),n.removeListener("end",s),n.removeListener("end",h),n.removeListener("data",c),u=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||l())});var l=function(e){return function(){var t=e._readableState;i("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,U(e))}}(n);e.on("drain",l);var u=!1;function c(t){i("ondata");var a=e.write(t);i("dest.write",a),!1===a&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==G(r.pipes,e))&&!u&&(i("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function d(t){i("onerror",t),h(),e.removeListener("error",d),0===a(e,"error")&&S(e,t)}function f(){e.removeListener("finish",g),h()}function g(){i("onfinish"),e.removeListener("close",f),h()}function h(){i("unpipe"),n.unpipe(e)}return n.on("data",c),function(e,t,n){if("function"==typeof e.prependListener)return e.prepe
vendor: 5,858 bytes, line 2
2ndListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",d),e.once("close",f),e.once("finish",g),e.emit("pipe",n),r.flowing||(i("pipe resume"),n.resume()),e},R.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)r[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=G(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},R.prototype.on=function(e,t){var n=o.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,i("on readable",r.length,r.reading),r.length?v(this):r.reading||process.nextTick(L,this))),n},R.prototype.addListener=R.prototype.on,R.prototype.removeListener=function(e,t){var n=o.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(O,this),n},R.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(O,this),t},R.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(F,e,t))}(this,e)),e.paused=!1,this},R.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},R.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var a in e.on("end",function(){if(i("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(a){i("wrapped data"),n.decoder&&(a=n.decoder.write(a)),n.objectMode&&null==a||(n.objectMode||a&&a.length)&&(t.push(a)||(r=!0,e.pause()))}),e)void 0===this[a]&&"function"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var o=0;o<I.length;o++)e.on(I[o],this.emit.bind(this,I[o]));return this._read=function(t){i("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(R.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=n(5857)),d(this)}),Object.defineProperty(R.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(R.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(R.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),R._fromList=x,Object.defineProperty(R.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(R.from=function(e,t){return void 0===f&&(f=n(3411)),f(R,e,t)})},6756:function(e,t,n){e.exports=c;var r=n(1602).codes,i=r.ERR_METHOD_NOT_IMPLEMENTED,a=r.ERR_MULTIPLE_CALLBACK,o=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,l=n(884);function u(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new a);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);l.call(this,e),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function d(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush(function(t,n){f(e,t,n)})}function f(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new s;if(e._transformState.transforming)throw new o;return e.push(null)}n(7523)(c,l),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,l.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,n){n(new i("_transform()"))},c.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){l.prototype._destroy.call(this,e,function(e){t(e)})}},3726:function(e,t,n){function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var n=e.entry;for(e.entry=null;n;){var r=n.callback;t.pendingcb--,r(void 0),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var i;e.exports=R,R.WritableState=A;var a,o={deprecate:n(9e3)},s=n(2611),l=n(44).Buffer,u=(void 0!==n.g?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},c=n(2410),d=n(1749).getHighWaterMark,f=n(1602).codes,g=f.ERR_INVALID_ARG_TYPE,h=f.ERR_METHOD_NOT_IMPLEMENT
vendor: 7,643 bytes, line 2
2ED,p=f.ERR_MULTIPLE_CALLBACK,m=f.ERR_STREAM_CANNOT_PIPE,E=f.ERR_STREAM_DESTROYED,T=f.ERR_STREAM_NULL_VALUES,_=f.ERR_STREAM_WRITE_AFTER_END,y=f.ERR_UNKNOWN_ENCODING,S=c.errorOrDestroy;function I(){}function A(e,t,a){i=i||n(884),e=e||{},"boolean"!=typeof a&&(a=t instanceof i),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===e.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new p;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(process.nextTick(i,r),process.nextTick(M,e,t),e._writableState.errorEmitted=!0,S(e,r)):(i(r),e._writableState.errorEmitted=!0,S(e,r),M(e,t))}(e,n,r,t,i);else{var a=D(n)||e.destroyed;a||n.corked||n.bufferProcessing||!n.bufferedRequest||b(e,n),r?process.nextTick(C,e,n,a,i):C(e,n,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function R(e){var t=this instanceof(i=i||n(884));if(!t&&!a.call(R,this))return new R(e);this._writableState=new A(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),s.call(this)}function N(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new E("write")):n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function C(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),M(e,t)}function b(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var i=t.bufferedRequestCount,a=new Array(i),o=t.corkedRequestsFree;o.entry=n;for(var s=0,l=!0;n;)a[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;a.allBuffers=l,N(e,t,!0,t.length,a,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,c=n.encoding,d=n.callback;if(N(e,t,!1,t.objectMode?1:u.length,u,c,d),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function D(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function v(e,t){e._final(function(n){t.pendingcb--,n&&S(e,n),t.prefinished=!0,e.emit("prefinish"),M(e,t)})}function M(e,t){var n=D(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(v,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}n(7523)(R,s),A.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(A.prototype,"buffer",{get:o.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(R,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===R&&e&&e._writableState instanceof A}})):a=function(e){return e instanceof this},R.prototype.pipe=function(){S(this,new m)},R.prototype.write=function(e,t,n){var r,i=this._writableState,a=!1,o=!i.objectMode&&(r=e,l.isBuffer(r)||r instanceof u);return o&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(n=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=I),i.ending?function(e,t){var n=new _;S(e,n),process.nextTick(t,n)}(this,n):(o||function(e,t,n,r){var i;return null===n?i=new T:"string"==typeof n||t.objectMode||(i=new g("chunk",["string","Buffer"],n)),!i||(S(e,i),process.nextTick(r,i),!1)}(this,i,e,n))&&(i.pendingcb++,a=function(e,t,n,r,i,a){if(!n){var o=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,n)),t}(t,r,i);r!==o&&(n=!0,i="buffer",r=o)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else N(e,t,!1,s,r,i,a);return u}(this,i,o,e,t,n)),a},R.prototype.cork=function(){this._writableState.corked++},R.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||b(this,e))},R.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new y(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(R.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(R.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),R.prototype._write=function(e,t,n){n(new h("_write()"))},R.prototype._writev=null,R.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,M(e,t),n&&(t.finished?process.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(R.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),R.prototype.destroy=c.destroy,R.prototype._undestroy=c.undestroy,R.prototype._destroy=function(e,t){t(e)}},5857:function(e,t,n){var r;function i(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=n(2896),o=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),u=Symbol("ended"),c=Symbol("lastPromise"),d=Symbol("handlePromise"),f=Symbol("stream");function g(e,t){return{value:e,done:t}}function h(e){var t=e[o];if(null!==t){var n=e[f].read();null!==n&&(e[c]=null,e[o]=null,e[s]=null,t(g(n,!1)))}}function p(e){process.nextTick(h,e)}var m=Object.getPrototypeOf(function(){}
vendor: 8,634 bytes, line 2
2),E=Object.setPrototypeOf((i(r={get stream(){return this[f]},next:function(){var e=this,t=this[l];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(g(void 0,!0));if(this[f].destroyed)return new Promise(function(t,n){process.nextTick(function(){e[l]?n(e[l]):t(g(void 0,!0))})});var n,r=this[c];if(r)n=new Promise(function(e,t){return function(n,r){e.then(function(){t[u]?n(g(void 0,!0)):t[d](n,r)},r)}}(r,this));else{var i=this[f].read();if(null!==i)return Promise.resolve(g(i,!1));n=new Promise(this[d])}return this[c]=n,n}},Symbol.asyncIterator,function(){return this}),i(r,"return",function(){var e=this;return new Promise(function(t,n){e[f].destroy(null,function(e){e?n(e):t(g(void 0,!0))})})}),r),m);e.exports=function(e){var t,n=Object.create(E,(i(t={},f,{value:e,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,l,{value:null,writable:!0}),i(t,u,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var r=n[f].read();r?(n[c]=null,n[o]=null,n[s]=null,e(g(r,!1))):(n[o]=e,n[s]=t)},writable:!0}),t));return n[c]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[s];return null!==t&&(n[c]=null,n[o]=null,n[s]=null,t(e)),void(n[l]=e)}var r=n[o];null!==r&&(n[c]=null,n[o]=null,n[s]=null,r(g(void 0,!0))),n[u]=!0}),e.on("readable",p.bind(null,n)),n}},3791:function(e,t,n){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function a(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var s=n(44).Buffer,l=n(3779).inspect,u=l&&l.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,n;return t=e,(n=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t,n,r,i=s.allocUnsafe(e>>>0),a=this.head,o=0;a;)t=a.data,n=i,r=o,s.prototype.copy.call(t,n,r),o+=a.data.length,a=a.next;return i}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,a=e>i.length?i.length:e;if(a===i.length?r+=i:r+=i.slice(0,e),0==(e-=a)){a===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),0==(e-=a)){a===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(a));break}++r}return this.length-=r,t}},{key:u,value:function(e,t){return l(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},2410:function(e){function t(e,t){r(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}e.exports={destroy:function(e,i){var a=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(i?i(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(r,this,e)):process.nextTick(r,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!i&&e?a._writableState?a._writableState.errorEmitted?process.nextTick(n,a):(a._writableState.errorEmitted=!0,process.nextTick(t,a,e)):process.nextTick(t,a,e):i?(process.nextTick(n,a),i(e)):process.nextTick(n,a)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}},2896:function(e,t,n){var r=n(1602).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,n,a){if("function"==typeof n)return e(t,null,n);n||(n={}),a=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r)}}}(a||i);var o=n.readable||!1!==n.readable&&t.readable,s=n.writable||!1!==n.writable&&t.writable,l=function(){t.writable||c()},u=t._writableState&&t._writableState.finished,c=function(){s=!1,u=!0,o||a.call(t)},d=t._readableState&&t._readableState.endEmitted,f=function(){o=!1,d=!0,s||a.call(t)},g=function(e){a.call(t,e)},h=function(){var e;return o&&!d?(t._readableState&&t._readableState.ended||(e=new r),a.call(t,e)):s&&!u?(t._writableState&&t._writableState.ended||(e=new r),a.call(t,e)):void 0},p=function(){t.req.on("finish",c)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",c),t.on("abort",h),t.req?p():t.on("request",p)):s&&!t._writableState&&(t.on("end",l),t.on("close",l)),t.on("end",f),t.on("finish",c),!1!==n.error&&t.on("error",g),t.on("close",h),function(){t.removeListener("complete",c),t.removeListener("abort",h),t.removeListener("request",p),t.req&&t.req.removeListener("finish",c),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",c),t.removeListener("end",f),t.removeListener("error",g),t.removeListener("close",h)}}},3411:function(e){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},8460:function(e,t,n){var r,i=n(1602).codes,a=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function l(e){e()}function u(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var c,d=function(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new a("streams");var f=t.map(function(e,i){var a=i<t.length-1;return function(e,t,i,a){a=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(a);var s=!1;e.on("close",function(){s=!0}),void 0===r&&(r=n(2896)),r(e,{readable:t,writable:i},function(e){if(e)return a(e);s=!0,a()});var l=!1;return function(t){if(!s&&!l)return l=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void a(t||new o("pipe"))}}(e,a,i>0,function(e){c||(c=e),e&&f.forEach(l),a||(f.forEach(l),d(c))})}
vendor: 5,141 bytes, line 2
2);return t.reduce(u)}},1749:function(e,t,n){var r=n(1602).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,n,i){var a=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,i,n);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new r(i?n:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},2611:function(e,t,n){e.exports=n(9826).EventEmitter},748:function(e,t,n){var r=n(4598).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=d,t=3;break;default:return this.write=f,void(this.end=g)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function g(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=o(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=o(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=o(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},4598:function(e,t,n){var r=n(44),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=o),a(i,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},9e3:function(e,t,n){function r(e){try{if(!n.g.localStorage)return!1}catch(e){return!1}var t=n.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}},3779:function(){},7199:function(){},5393:function(e,t,
2r){r.r(t),r.d(t,{Debug:function(){return o.default},FactoryMaker:function(){return a.default},MediaPlayer:function(){return i.default}});var i=r(9839),a=r(138),o=r(649),s=r(8986),l="undefined"!=typeof window&&window||n.g,u=l.dashjs;u||(u=l.dashjs={}),u.MediaPlayer=i.default,u.FactoryMaker=a.default,u.Debug=o.default,u.Version=(0,s.getVersionString)(),t.default=u},8735:function(e,t,n){n.r(t),n.d(t,{CMCD_DEFAULT_TIME_INTERVAL:function(){return Te},CMCD_EVENT_AD_BREAK_END:function(){return C},CMCD_EVENT_AD_BREAK_START:function(){return N},CMCD_EVENT_AD_END:function(){return R},CMCD_EVENT_AD_START:function(){return A},CMCD_EVENT_BACKGROUNDED_MODE:function(){return E},CMCD_EVENT_BITRATE_CHANGE:function(){return f},CMCD_EVENT_CONTENT_ID:function(){return m},CMCD_EVENT_CUSTOM_EVENT:function(){return D},CMCD_EVENT_ERROR:function(){return h},CMCD_EVENT_KEYS:function(){return O},CMCD_EVENT_MODE:function(){return M},CMCD_EVENT_MUTE:function(){return T},CMCD_EVENT_PLAYER_COLLAPSE:function(){return S},CMCD_EVENT_PLAYER_EXPAND:function(){return y},CMCD_EVENT_PLAY_STATE:function(){return g},CMCD_EVENT_RESPONSE_RECEIVED:function(){return I},CMCD_EVENT_SKIP:function(){return b},CMCD_EVENT_TIME_INTERVAL:function(){return p},CMCD_EVENT_UNMUTE:function(){return _},CMCD_FORMATTER_MAP:function(){return c},CMCD_HEADERS:function(){return Ne},CMCD_HEADER_FIELDS:function(){return ae},CMCD_HEADER_MAP:function(){return oe},CMCD_JSON:function(){return Ce},CMCD_KEYS:function(){return _e},CMCD_MIME_TYPE:function(){return ye},CMCD_OBJECT:function(){return ee},CMCD_PARAM:function(){return de},CMCD_QUERY:function(){return Re},CMCD_REQUEST:function(){return te},CMCD_REQUEST_KEYS:function(){return L},CMCD_REQUEST_MODE:function(){return w},CMCD_RESPONSE_KEYS:function(){return k},CMCD_SESSION:function(){return ne},CMCD_STATUS:function(){return re},CMCD_V1:function(){return Se},CMCD_V1_KEYS:function(){return K},CMCD_V2:function(){return d},CMCD_VALIDATION_SEVERITY_ERROR:function(){return Oe},CMCD_VALIDATION_SEVERITY_WARNING:function(){return Le},CmcdEventType:function(){return v},CmcdHeaderField:function(){return ie},CmcdObjectType:function(){return Ie},CmcdPlayerState:function(){return Ae},CmcdReporter:function(){return Me},CmcdReportingMode:function(){return P},CmcdStreamType:function(){return Pe},CmcdStreamingFormat:function(){return we},CmcdTransmissionMode:function(){return be},CmcdValidationSeverity:function(){return Fe},appendCmcdHeaders:function(){return ce},appendCmcdQuery:function(){return Ee},decodeCmcd:function(){return Be},encodeCmcd:function(){return ge},fromCmcdHeaders:function(){return Ge},fromCmcdQuery:function(){return He},fromCmcdUrl:function(){return Ye},groupCmcdHeaders:function(){return se},isCmcdCustomKey:function(){return U},isCmcdEventKey:function(){return q},isCmcdRequestKey:function(){return B},isCmcdResponseReceivedKey:function(){return H},isCmcdV1Data:function(){return qe},isCmcdV1Key:function(){return W},isCmcdV2Data:function(){return Ve},prepareCmcdData:function(){return J},toCmcdHeaders:function(){return ue},toCmcdQuery:function(){return pe},toCmcdUrl:function(){return he},toCmcdValue:function(){return Ke},validateCmcd:function(){return mt},validateCmcdEventReport:function(){return Tt},validateCmcdEvents:function(){return Et},validateCmcdHeaders:function(){return _t},validateCmcdKeys:function(){return Qe},validateCmcdRequest:function(){return yt},validateCmcdStructure:function(){return Xe},validateCmcdValues:function(){return pt}});var r=n(2877),i=n(9259);const a=e=>e instanceof r.SfItem?new r.SfItem(Math.round(e.value),e.params):Math.round(e),o=e=>Array.isArray(e)?e.map(a):a(e),s=(e,t)=>Array.isArray(e)?e.map(e=>s(e,t)):e instanceof r.SfItem&&"string"==typeof e.value?new r.SfItem(s(e.value,t),e.params):(t.baseUrl&&(e=(0,i.urlToRelativePath)(e,(0,i.getBaseUrl)(t.baseUrl))),1===t.version?encodeURIComponent(e):e),l=e=>e instanceof r.SfItem?new r.SfItem(100*Math.round(e.value/100),e.params):100*Math.round(e/100),u=e=>Array.isArray(e)?e.map(l):l(e),c={br:o,d:o,bl:u,dl:u,mtp:u,nor:(e,t)=>
vendor: 10,408 bytes, line 2
2{let n=e;return t.version>=2&&(e instanceof r.SfItem&&"string"==typeof e.value?n=new r.SfItem([e]):"string"==typeof e&&(n=[e])),s(n,t)},rtp:u,tb:o},d=2,f="bc",g="ps",h="e",p="t",m="c",E="b",T="m",_="um",y="pe",S="pc",I="rr",A="as",R="ae",N="abs",C="abe",b="sk",D="ce",v={BITRATE_CHANGE:f,PLAY_STATE:g,ERROR:h,TIME_INTERVAL:p,CONTENT_ID:m,BACKGROUNDED_MODE:E,MUTE:T,UNMUTE:_,PLAYER_EXPAND:y,PLAYER_COLLAPSE:S,RESPONSE_RECEIVED:I,AD_START:A,AD_END:R,AD_BREAK_START:N,AD_BREAK_END:C,SKIP:b,CUSTOM_EVENT:D},M="event",w="request",P={REQUEST:w,EVENT:M},O=["cen","e","h","ts"],L=["ab","bg","bl","br","bs","bsa","bsd","bsda","cdn","cid","cs","d","dfa","dl","ec","lab","lb","ltc","msd","mtp","nor","nr","ot","pb","pr","pt","rtp","sf","sid","sn","st","sta","su","tab","tb","tbl","tpb","v"],F=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function U(e){return F.test(e)}const x=new Set(L);function B(e){return x.has(e)||U(e)}const k=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"],G=new Set(k);function H(e){return G.has(e)}const Y=new Set(O);function q(e){return B(e)||H(e)||Y.has(e)}const V=new Set(["ab","bl","br","bsa","bsd","bsda","lab","lb","mtp","pb","tab","tb","tbl","tpb"]),K=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"],j=new Set(K);function W(e){return j.has(e)||U(e)}const z=new Set(["ot","sf","st","e","sta"]);function $(e){return z.has(e)}function Q(e){return"number"==typeof e?Number.isFinite(e):null!=e&&""!==e&&!1!==e}const X={[M]:q,[w]:B};function Z(e,t){if(Array.isArray(e)){let n;return t&&(n=e.find(e=>e.params?.ot===t)),n||(n=e[0]),Z(n)}return e instanceof r.SfItem?e.value:e}function J(e,t={}){const n={};if(null==e||"object"!=typeof e)return n;const i=t.version||e.v||d,a=t.reportingMode||w,o=1===i?function(e){const t={};for(const[n,i]of Object.entries(e))if(null!=i)if("nor"===n){const e=(Array.isArray(i)?i:[i])[0];e instanceof r.SfItem?(t.nor=e.value,e.params?.r&&(t.nrr=e.params.r)):t.nor=e}else V.has(n)?t[n]=Z(i,e.ot):t[n]=i;else t[n]=i;return t}(e):e,s=1===i?W:X[a];let l=Object.keys(o).filter(s);o.e&&o.e!==I&&(l=l.filter(e=>!H(e)));const u=t.filter;"function"==typeof u&&(l=l.filter(u));const f=a===M;if(f){const e=o.e;l.includes("e")||null==e||l.push("e"),l.includes("ts")||l.push("ts"),l.includes("cen")||null==o.cen||e!==D||l.push("cen")}if(0===l.length)return n;i>1&&!l.includes("v")&&l.push("v");const g={version:i,reportingMode:a,baseUrl:t.baseUrl};l.sort();for(const e of l){let a=o[e];const s=t.formatters?.[e]??c[e];if("function"==typeof s&&(a=s(a,g)),"v"===e){if(1===i)continue;a=i}"pr"===e&&1===a||(f&&"ts"===e&&!Number.isFinite(a)&&(a=Date.now()),Q(a)&&($(e)&&"string"==typeof a&&(a=new r.SfToken(a)),n[e]=a))}return n}const ee="CMCD-Object",te="CMCD-Request",ne="CMCD-Session",re="CMCD-Status",ie={OBJECT:ee,REQUEST:te,SESSION:ne,STATUS:re},ae=[ee,te,ne,re],oe={ab:ee,br:ee,d:ee,lab:ee,lb:ee,ot:ee,tab:ee,tb:ee,tpb:ee,bl:te,cs:te,dfa:te,dl:te,ltc:te,mtp:te,nor:te,nrr:te,pb:te,sn:te,sta:te,su:te,tbl:te,cid:ne,msd:ne,sf:ne,sid:ne,st:ne,v:ne,bg:re,bs:re,bsa:re,bsd:re,bsda:re,cdn:re,ec:re,nr:re,pr:re,pt:re,rtp:re};function se(e,t){const n={};if(!e)return n;const r=Object.keys(e),i=t?(a=t,Object.keys(a).reduce((e,t)=>(a[t]?.forEach(n=>e[n]=t),e),{})):{};var a;for(const t of r){const r=oe[t]||i[t]||ie.REQUEST;(n[r]??={})[t]=e[t]}return n}function le(e,t){const n={},i=se(e,t);for(const[e,t]of Object.entries(i)){const i=(0,r.encodeSfDict)(t,{whitespace:!1});i&&(n[e]=i)}return n}function ue(e,t={}){return e?le(J(e,t),t?.customHeaderMap):{}}function ce(e,t,n){return Object.assign(e,ue(t,n))}const de="CMCD";function fe(e){return(0,r.encodeSfDict)(e,{whitespace:!1})}function ge(e,t={}){return e?fe(J(e,t)):""}function he(e,t={}){if(!e)return"";const n=ge(e,t);return encodeURIComponent(n)}function pe(e,t={}){return e?`${de}=${he(e,t)}`:""}const me=/CMCD=[^&#]+/;function Ee(e,t,n){const r=pe(t,n);return r?me.test(e)?e.replace(me,r):`${e}${e.includes("?")?"&":"?"}${r}`:e}const Te=30,_e=[...K,...L,...k,...O].filter((e,t,n)=>n.indexOf(e)===t),ye="application/cmcd",Se=1,Ie={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},Ae={STARTING:"s",PLAYING:"p",SEEKING:"k",REBUFFERING:"r",PAUSED:"a",WAITING:"w",ENDED:"e",FATAL_ERROR:"f",QUIT:"q",PRELOADING:"d"},Re="query",Ne="headers",Ce="json",be={JSON:Ce,QUERY:Re,HEADERS:Ne};function De(e,t,n){const r=new Set(t.enabledKeys??[]);return{version:t.version||d,reportingMode:e,filter:e=>r.has(e),baseUrl:n}}function ve(e){const{url:t,...n}=e;return fetch(t,n)}var Me=class{constructor(e,t=ve){this.timeOrigin=performance.timeOrigin||performance.timing?.fetchStart||Date.now()-performance.now(),this.data={},this.msd=NaN,this.eventTargets=new Map,this.requestTarget={sn:0,msdSent:!1},this.config=function(e){const{version:t=d,eventTargets:n=[],sid:r=(0,i.uuid)(),transmissionMode:a=Re,...o}=e;return{...o,version:t,transmissionMode:a,sid:r,eventTargets:n.reduce((e,t)=>(t?.url&&t.events?.length&&e.push({version:t.version||d,enabledKeys:t.enabledKeys?.slice()||[],url:t.url,events:t.events.slice(),interval:t.interval??Te,batchSize:t.batchSize||1}),e),[])}}(e),this.data={cid:this.config.cid,sid:this.config.sid,v:this.config.version},this.requester=t;for(const e of this.config.eventTargets)this.eventTargets.set(e,{intervalId:void 0,sn:0,msdSent:!1,queue:[]})}start(){this.eventTargets.forEach((e,t)=>{if(this.disarmInterval(e),0===t.interval||!t.events.includes(v.TIME_INTERVAL))return;const n=()=>{this.recordTargetEvent(e,t,p),this.processEventTargets()};e.intervalId=setInterval(n,1e3*t.interval),n()})}stop(e=!1){e&&this.flush(),this.eventTargets.forEach(e=>{this.disarmInterval(e)})}flush(){this.processEventTargets(!0)}update(e){e.sid&&e.sid!==this.data.sid&&this.resetSession(),e.msd&&!isNaN(e.msd)&&(this.msd=e.msd),this.data={...this.data,...e,msd:void 0}}recordEvent(e,t={}){this.eventTargets.forEach((n,r)=>{this.recordTargetEvent(n,r,e,t)}),this.processEventTargets()}recordTargetEvent(e,t,n,r={}){if(!t.events.includes(n))return;const i={...this.data,...r,e:n,ts:r.ts??Date.now(),sn:e.sn++};isNaN(this.msd)||e.msdSent||(i.msd=this.msd,e.msdSent=!0),e.queue.push(i)}recordResponseReceived(e,t={}){const{request:n}=e,r=t.url??n?.url;if(!r)return;const i=new URL(r);i.searchParams.delete(de);const a={url:i.toString(),rc:e.status},o=e.resourceTiming;o&&(null!=o.startTime&&(a.ts=Math.round(this.timeOrigin+o.startTime),null!=o.responseStart&&(a.ttfb=Math.round(o.responseStart-o.startTime))),null!=o.duration&&(a.ttlb=Math.round(o.duration)));const s=n.customData?.cmcd??{};this.recordEvent(I,{...s,...a,...t})}applyRequestReport(e){return this.createRequestReport(e)??e}isRequestReportingEnabled(){return!!this.config.enabledKeys?.length}createRequestReport(e,t){const{customData:n={},headers:r={},...i}=e,a={...i,headers:{...r},customData:{...n,cmcd:{}}};if(!this.config.enabledKeys?.length||!a.url)return a;const o=new URL(a.url),s={...this.data,...t,sn:this.requestTarget.sn++},l=De(w,this.config,a.url);isNaN(this.msd)||this.requestTarget.msdSent||(s.msd=this.msd,this.requestTarget.msdSent=!0);const u=a.customData.cmcd=J(s,l);switch(this.config.transmissionMode){case Re:const e=fe(u);e&&(o.searchParams.set(de,e),a.url=o.toString());break;case Ne:Object.assign(a.headers,le(u,l.customHeaderMap))}return a}processEventTargets(e=!1){let t=!1;this.eventTargets.forEach((n,r)=>{const{queue:i}=n;if(!i.length)return;if(i.length<r.batchSize&&!e)return;const a=e?i.length:r.batchSize,o=i.splice(0,a);this.sendEventReport(r,o).catch(()=>{n.queue.unshift(...o)}),t||=i.length>0}),t&&this.processEventTargets()}async sendEventReport(e,t){const n=De(M,e),{status:r}=await this.requester({url:e.url,method:"POST",headers:{"Content-Type":ye},body:t.map(e=>ge(e,n)).join("\n")+"\n"});if(410===r)this.disposeEventTarget(e);else if(429===r||r>499&&r<600)throw new Error(`Event report failed with status ${r}`)}disarmInterval(e){clearInterval(e.intervalId),e.intervalId=void 0}disposeEventTarget(e){const t=this.eventTargets.get(e);t&&(this.disarmInterval(t),this.eventTargets.delete(e))}resetSession(){this.eventTargets.forEach(e=>e.sn=0),this.requestTarget.sn=0}};const we={DASH:"d",HLS:"h",SMOOTH:"s",OTHER:"o"},Pe={VOD:"v",LIVE:"l",LOW_LATENCY:"ll"},Oe="error",Le="warning",Fe={ERROR:Oe,WARNING:Le};function Ue(e){if(e.v===d)return e;const t={};for(const[n,r]of Object.entries(e))null!=r?V.has(n)&&!Array.isArray(r)?t[n]=[r]:t[n]="nor"===n&&"string"==typeof r?[r]:r:t[n]=r;return t}function xe(e){return Array.isArray(e)?e.map(xe):"symbol"==typeof e?(0,r.symbolToStr)(e):e instanceof r.SfItem&&!e.params?xe(e.value):e}function Be(e,t){if(!e)return{};const n=(0,r.decodeSfDict)(e),i={};for(const[e,t]of Object.entries(n))i[e]=xe(t.value);return t?.convertToLatest?Ue(i):i}function ke(e){return e instanceof Headers?e:new Headers(e)}function Ge(e,t){const n=ke(e),r={};for(const e of ae){const t=n.get(e);t&&Object.assign(r,Be(t))}return t?.convertToLatest?Ue(r):r}function He(e,t){return"string"==typeof e&&(e=new URLSearchParams(e)),Be(e.get(de)??"",t)}function Ye(e,t){return Be(decodeURIComponent(e.replace(/^CMCD=/,"")),t)}function qe(e){return e.v!==d}function Ve(e){return e.v===d}function Ke(e,t){return new r.SfItem(e,t)}function je(...e){const t=e.flatMap(e=>e.issues);return{valid:t.every(e=>e.severity!==Oe),issues:t}}function We(e,t){if(1===t?.version||2===t?.version)return t.version;const n=e.v;return 1===n||2===n?n:Se}const ze=new Set(K),$e=new Set(_e);function Qe(e,t){const n=We(e,t),r=n===Se?ze:$e,i=[];for(const t of Object.keys(e))U(t)||r.has(t)||i.push({key:t,message:`Unknown CMCD key "${t}" for version ${n}.`,severity:Oe});return{valid:0===i.length,issues:i}}function Xe(e,t){const n=We(e,t),r=[];if(t?.reportingMode===w){for(const t of O)t in e&&r.push({key:t,message:`Event key "${t}" must not be present in request mode.`,severity:Oe});for(const t of k)t in e&&r.push({key:t,message:`Response key "${t}" must not be present in request mode.`,severity:Oe})}if(t?.reportingMode===M&&("e"in e||r.push({key:"e",message:'Event mode requires the "e" key to be present.',severity:Oe}),"ts"in e||r.push({key:"ts",message:'Event mode requires the "ts" key to be present.',severity:Oe})),"e"in e){if(e.e===D?"cen"in e||r.push({key:"cen",message:'Custom event (e="ce") requires the "cen" key to be present.',severity:Oe}):"cen"in e&&r.push({key:"cen",message:'The "cen" key must only be present when e="
2ce".',severity:Oe}),e.e===I)"url"in e||r.push({key:"url",message:'Response received event (e="rr") requires the "url" key to be present.',severity:Oe});else for(const t of k)t in e&&r.push({key:t,message:`Response key "${t}" must only be present when e="rr".`,severity:Oe});e.e!==g||"sta"in e||r.push({key:"sta",message:'Play state event (e="ps") requires the "sta" key to be present.',severity:Oe}),e.e!==h||"ec"in e||r.push({key:"ec",message:'Error event (e="e") requires the "ec" key to be present.',severity:Oe})}return"v"in e&&1!==e.v&&2!==e.v?r.push({key:"v",message:`Unsupported CMCD version "${String(e.v)}". Expected 1 or 2.`,severity:Oe}):n>1&&!("v"in e)?r.push({key:"v",message:'Version 2 payloads require the "v" key to be present.',severity:Oe}):n===Se&&"v"in e&&r.push({key:"v",message:'Version 1 payloads should omit the "v" key (v1 is the default).',severity:Le}),{valid:r.every(e=>e.severity!==Oe),issues:r}}const Ze="number[]",Je="string[]",et="integer",tt="number",nt="boolean",rt="string",it="token",at={ab:Ze,bl:Ze,br:Ze,bsa:Ze,bsd:Ze,bsda:Ze,lab:Ze,lb:Ze,mtp:Ze,pb:Ze,tab:Ze,tb:Ze,tbl:Ze,tpb:Ze,ec:Je,nor:Je,d:et,dfa:et,dl:et,ltc:et,msd:et,pt:et,rc:et,rtp:et,sn:et,ts:et,ttfb:et,ttfbb:et,ttlb:et,v:et,pr:tt,bg:nt,bs:nt,nr:nt,su:nt,cdn:rt,cen:rt,cid:rt,cmsdd:rt,cmsds:rt,cs:rt,h:rt,nrr:rt,sid:rt,smrt:rt,url:rt,e:it,ot:it,sf:it,st:it,sta:it},ot={bl:et,br:tt,mtp:et,tb:tt,nor:rt},st={sid:64,cid:128,cdn:128,h:128,cen:64},lt=64,ut={e:["bc","ps","e","t","c","b","m","um","pe","pc","rr","as","ae","abs","abe","sk","ce"],ot:["m","a","v","av","i","c","tt","k","o"],sf:["d","h","s","o"],st:["v","l","ll"],sta:["s","p","k","r","a","w","e","f","q","d"]},ct=new Set(["bl","dl","mtp","rtp","tbl"]),dt=new Set(["br","d","tb"]);function ft(e){return"number"==typeof e&&Number.isFinite(e)}function gt(e,t,n){if(Array.isArray(t))for(let i=0;i<t.length;i++){const a=t[i];a instanceof r.SfItem?ft(a.value)||n.push({key:e,message:`Key "${e}" array element [${i}] must be a finite number.`,severity:Oe}):ft(a)||n.push({key:e,message:`Key "${e}" array element [${i}] must be a finite number.`,severity:Oe})}else n.push({key:e,message:`Key "${e}" must be an array.`,severity:Oe})}function ht(e,t,n){if(Array.isArray(t))for(let i=0;i<t.length;i++){const a=t[i];a instanceof r.SfItem?"string"!=typeof a.value&&n.push({key:e,message:`Key "${e}" array element [${i}] must be a string.`,severity:Oe}):"string"!=typeof a&&n.push({key:e,message:`Key "${e}" array element [${i}] must be a string.`,severity:Oe})}else n.push({key:e,message:`Key "${e}" must be an array.`,severity:Oe})}function pt(e,t){const n=We(e,t),r=[];for(const[t,i]of Object.entries(e)){if(U(t)){"string"!=typeof i?r.push({key:t,message:`Custom key "${t}" value must be a string or token.`,severity:Oe}):i.length>lt&&r.push({key:t,message:`Custom key "${t}" value exceeds maximum length of ${lt}.`,severity:Oe});continue}if("v"===t){1!==i&&2!==i&&r.push({key:t,message:'Key "v" must be 1 or 2.',severity:Oe});continue}let e=at[t];if(e)switch(n===Se&&t in ot&&(e=ot[t]),e){case et:ft(i)&&Number.isInteger(i)?ct.has(t)&&i%100!=0&&r.push({key:t,message:`Key "${t}" should be rounded to the nearest 100.`,severity:Le}):r.push({key:t,message:`Key "${t}" must be a finite integer.`,severity:Oe});break;case tt:ft(i)?ct.has(t)&&i%100!=0?r.push({key:t,message:`Key "${t}" should be rounded to the nearest 100.`,severity:Le}):dt.has(t)&&!Number.isInteger(i)&&r.push({key:t,message:`Key "${t}" should be rounded to an integer.`,severity:Le}):r.push({key:t,message:`Key "${t}" must be a finite number.`,severity:Oe});break;case nt:"boolean"!=typeof i&&r.push({key:t,message:`Key "${t}
2" must be a boolean.`,severity:Oe});break;case rt:"string"!=typeof i?r.push({key:t,message:`Key "${t}" must be a string.`,severity:Oe}):t in st&&i.length>st[t]&&r.push({key:t,message:`Key "${t}" exceeds maximum length of ${st[t]}.`,severity:Oe});break;case it:{const e=ut[t];e&&!e.includes(i)&&r.push({key:t,message:`Key "${t}" has invalid token value "${String(i)}". Expected one of: ${e.join(", ")}.`,severity:Oe});break}case Ze:gt(t,i,r);break;case Je:ht(t,i,r)}}return{valid:r.every(e=>e.severity!==Oe),issues:r}}function mt(e,t){return je(Qe(e,t),pt(e,t),Xe(e,t))}function Et(e,t){const n={...t,reportingMode:M},r=e.split(/\r?\n/).filter(e=>e.length>0);if(0===r.length)return{valid:!1,issues:[{message:"Empty event mode payload. At least one event line is required.",severity:Oe}],data:[]};const i=[],a=[];for(let e=0;e<r.length;e++)try{const t=Be(r[e]);i.push(t),a.push(mt(t,n))}catch{i.push({}),a.push({valid:!1,issues:[{message:`Failed to decode event line ${e+1}: invalid structured field syntax.`,severity:Oe}]})}return{...je(...a),data:i}}function Tt(e,t){const n=[];"POST"!==e.method&&n.push({message:`Invalid HTTP method '${e.method??"GET"}'. Event reports must use POST.`,severity:Oe});const r=e.headers?ke(e.headers).get("Content-Type"):void 0;if(r){const e=r.split(";")[0].trim().toLowerCase();e!==ye&&n.push({message:`Invalid Content-Type '${e}'. Event reports must use '${ye}'.`,severity:Oe})}else n.push({message:`Missing Content-Type header. Event reports must use '${ye}'.`,severity:Oe});const i=e.body;if(null==i)return n.push({message:"Missing request body. Event reports must include a body.",severity:Oe}),{valid:!1,issues:n,data:[]};if("string"!=typeof i)return n.push({message:"Request body must be a string.",severity:Oe}),{valid:!1,issues:n,data:[]};const a=Et(i,t);return{valid:0===n.length&&a.valid,issues:[...n,...a.issues],data:a.data}}function _t(e,t){const n=ke(e),r=[],i={};for(const e of ae){const t=n.get(e);if(!t)continue;let a;try{a=Be(t)}catch{r.push({key:e,message:`Failed to decode "${e}" header: invalid structured field syntax.`,severity:Oe});continue}i[e]=a;for(const t of Object.keys(a)){if(U(t))continue;const n=oe[t];n&&n!==e&&r.push({key:t,message:`Key "${t}" is in "${e}" but should be in "${n}".`,severity:Oe})}}const a={valid:0===r.length,issues:r},o=Object.assign({},...ae.map(e=>i[e]).filter(Boolean));return{...je(a,mt(o,{...t,reportingMode:w})),data:o}}function yt(e,t){const n=function(e){if(!e)return;const t=ke(e),n={};let r=!1;for(const e of ae){const i=t.get(e);i&&(n[e]=i,r=!0)}return r?n:void 0}(e.headers);if(n)return _t(n,t);const r=new URL(e.url).searchParams.get(de);if(!r)return{valid:!1,issues:[{message:"No CMCD data found in request headers or query parameters.",severity:Oe}],data:{}};let i;try{i=Be(r)}catch{return{valid:!1,issues:[{message:"Failed to decode CMCD query parameter: invalid structured field syntax.",severity:Oe}],data:{}}}return{...mt(i,{...t,reportingMode:w}),data:i}}},1103:function(e,t,n){n.r(t),n.d(t,{CMSD_DYNAMIC:function(){return a},CMSD_STATIC:function(){return o},CMSD_V1:function(){return s},CmsdHeaderField:function(){return l},CmsdObjectType:function(){return u},CmsdStreamType:function(){return d},CmsdStreamingFormat:function(){return c},decodeCmsdDynamic:function(){return f},decodeCmsdStatic:function(){return g},encodeCmsdDynamic:function(){return h},encodeCmsdStatic:function(){return p}});var r=n(6390),i=n(2877);const a="CMSD-Dynamic",o="CMSD-Static",s=1,l={STATIC:o,DYNAMIC:a},u=r.CmObjectType,c=r.CmStreamingFormat,d=r.CmStreamType;function f(e){return e?(0,i.decodeSfList)(e):[]}function g(e){return e?Object.entries((0,i.decodeSfDict)(e)).reduce((e,[t,n])=>{const{value:r}=n;return e[t]="symbol"==typeof r?(0,i.symbolToStr)(r):r,e},{}):{}}function h(e,t){if(!e)return"";if("string"==typeof e){if(!t)return"";e=[new i.SfItem(e,t)]}return(0,i.encodeSfList)(e,{whitespace:!1})}function p(e,t){return e?(0,i.encodeSfDict)(function(e,t){const n={};if(null==e||"object"!=typeof e)return n;const a=Object.keys(e),o=!1!==t?.useSymbol;return a.forEach(t=>{let a=e[t];"v"===t&&1===a||(0,r.isValid)(a)&&((0,r.isTokenField)(t)&&"string"==typeof a&&(a=o?Symbol.for(a):new i.SfToken(a)),n[t]=a)}),n}(e,t),{whitespace:!1}):""}},6390:function(e,t,n){n.r(t),n.d(t,{CmObjectType:function(){return r},CmStreamType:function(){return a},CmStreamingFormat:function(){return i},isTokenField:function(){return o},isValid:function(){return s}});const r={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",
2KEY:"k",OTHER:"o"},i={DASH:"d",HLS:"h",SMOOTH:"s",OTHER:"o"},a={VOD:"v",LIVE:"l"};function o(e){return["ot","sf","st","e","sta"].includes(e)}function s(e){return"number"==typeof e?Number.isFinite(e):null!=e&&""!==e&&!1!==e}},2877:function(e,t,n){n.r(t),n.d(t,{SfItem:function(){return i},SfToken:function(){return N},decodeSfDict:function(){return U},decodeSfItem:function(){return B},decodeSfList:function(){return H},encodeSfDict:function(){return re},encodeSfItem:function(){return ie},encodeSfList:function(){return oe},parseBareItem:function(){return D},parseBoolean:function(){return f},parseByteSequence:function(){return h},parseDate:function(){return S},parseDict:function(){return F},parseError:function(){return l},parseInnerList:function(){return O},parseIntegerOrDecimal:function(){return y},parseItem:function(){return P},parseItemOrInnerList:function(){return L},parseKey:function(){return M},parseList:function(){return G},parseParameters:function(){return w},parseString:function(){return R},parseToken:function(){return b},serializeBareItem:function(){return X},serializeBoolean:function(){return q},serializeByteSequence:function(){return V},serializeDate:function(){return j},serializeDecimal:function(){return W},serializeDict:function(){return ne},serializeError:function(){return Y},serializeInnerList:function(){return te},serializeInteger:function(){return K},serializeItem:function(){return ee},serializeKey:function(){return Z},serializeList:function(){return ae},serializeParams:function(){return J},serializeString:function(){return z},serializeToken:function(){return Q},symbolToStr:function(){return $}});var r=n(9259),i=class e{constructor(t,n){Array.isArray(t)&&(t=t.map(t=>t instanceof e?t:new e(t))),this.value=t,this.params=n}};const a="Dict";function o(e,t){return{value:e,src:t}}function s(e,t,n,r){return new Error(`failed to ${e} "${i=t,Array.isArray(i)?JSON.stringify(i):i instanceof Map?"Map{}":i instanceof Set?"Set{}":"object"==typeof i?JSON.stringify(i):String(i)}" as ${n}`,{cause:r});var i}function l(e,t,n){return s("parse",e,t,n)}const u="Inner List",c="Bare Item",d="Boolean";function f(e){let t=0;
vendor: 4,287 bytes, line 2
2if("?"!==e[t])throw l(e,d);if(t++,"1"===e[t])return o(!0,e.substring(++t));if("0"===e[t])return o(!1,e.substring(++t));throw l(e,d)}const g="Byte Sequence";function h(e){if(":"!==e[0])throw l(e,g);if(!1===(e=e.substring(1)).includes(":"))throw l(e,g);const t=/(^.*?)(:)/g,n=t.exec(e)[1];return e=e.substring(t.lastIndex),o((0,r.decodeBase64)(n),e)}const p="Date",m="Decimal",E="Integer",T=`${E} or ${m}`;function _(e){return e<-999999999999999||999999999999999<e}function y(e){let t,n=1,r="";const i=l(e,T);if("-"===e[0]&&(n=-1,e=e.substring(1)),e.length<=0)throw i;const a=/^(\d+)?/g,s=a.exec(e);if(0===s[0].length)throw i;if(r+=s[1],"."===(e=e.substring(a.lastIndex))[0]){if(r.length>12)throw i;const a=/^(\.\d+)?/g,o=a.exec(e);if(e=e.substring(a.lastIndex),0===o[0].length||o[1].length>4)throw i;if(r+=o[1],r.length>16)throw i;t=parseFloat(r)*n}else{if(r.length>15)throw i;if(t=parseInt(r)*n,_(t))throw l(r,T)}return o(t,e)}function S(e){let t=0;if("@"!==e[t])throw l(e,p);t++;const n=y(e.substring(t));if(!1===Number.isInteger(n.value))throw l(e,p);return o(new Date(1e3*n.value),n.src)}const I="String",A=/[\x00-\x1f\x7f]+/;function R(e){let t="",n=0;if('"'!==e[n])throw l(e,I);for(n++;e.length>n;){if("\\"===e[n]){if(e.length<=n+1)throw l(e,I);if(n++,'"'!==e[n]&&"\\"!==e[n])throw l(e,I);t+=e[n]}else{if('"'===e[n])return o(t,e.substring(++n));if(A.test(e[n]))throw l(e,I);t+=e[n]}n++}throw l(e,I)}var N=class{constructor(e){this.description=e}};const C="Token";function b(e,t){if(!1===/^[a-zA-Z*]$/.test(e[0]))throw l(e,C);const n=/^([!#$%&'*+\-.^_`|~\w:/]+)/g,r=n.exec(e)[1];return e=e.substring(n.lastIndex),o(!1===t?.useSymbol?new N(r):Symbol.for(r),e)}function D(e,t){const n=e[0];if('"'===n)return R(e);if(/^[-0-9]/.test(n))return y(e);if("?"===n)return f(e);if(":"===n)return h(e);if(/^[a-zA-Z*]/.test(n))return b(e,t);if("@"===n)return S(e);throw l(e,c)}const v="Key";function M(e){let t=0;if(!1===/^[a-z*]$/.test(e[t]))throw l(e,v);let n="";for(;e.length>t;){if(!1===/^[a-z0-9_\-.*]$/.test(e[t]))return o(n,e.substring(t));n+=e[t],t++}return o(n,e.substring(t))}function w(e,t){let n;for(;e.length>0&&";"===e[0];){const r=M(e=e.substring(1).trim()),i=r.value;let a=!0;if("="===(e=r.src)[0]){const n=D(e=e.substring(1),t);a=n.value,e=n.src}null==n&&(n={}),n[i]=a}return o(n,e)}function P(e,t){const n=D(e,t),r=w(e=n.src,t);return e=r.src,o(new i(n.value,r.value),e)}function O(e,t){if("("!==e[0])throw l(e,u);e=e.substring(1);const n=[];for(;e.length>0;){if(")"===(e=e.trim())[0]){const r=w(e=e.substring(1),t);return o(new i(n,r.value),r.src)}const r=P(e,t);if(n.push(r.value)," "!==(e=r.src)[0]&&")"!==e[0])throw l(e,u)}throw l(e,u)}function L(e,t){return"("===e[0]?O(e,t):P(e,t)}function F(e,t){const n={};for(;e.length>0;){let r;const s=M(e),u=s.value;if("="===(e=s.src)[0]){const n=L(e.substring(1),t);r=n.value,e=n.src}else{const n=w(e,t);r=new i(!0,n.value),e=n.src}if(n[u]=r,0===(e=e.trim()).length)return o(n,e);if(","!==e[0])throw l(e,a);if(0===(e=e.substring(1).trim()).length||","===e[0])throw l(e,a)}return o(n,e)}function U(e,t){try{const{src:n,value:r}=F(e.trim(),t);if(""!==n)throw l(n,a);return r}catch(t){throw l(e,a,t)}}const x="Item";function B(e,t){try{const{src:n,value:r}=P(e.trim(),t);if(""!==n)throw l(n,x);return r}catch(t){throw l(e,x,t)}}const k="List";function G(e,t){const n=[];for(;e.length>0;){const r=L(e,t);if(n.push(r.value),0===(e=r.src.trim()).length)return o(n,e);if(","!==e[0])throw l(e,k);if(0===(e=e.substring(1).trim()).length||","===e[0])throw l(e,k)}return o(n,e)}function H(e,t){try{const{src:n,value:r}=G(e.trim(),t);if(""!==n)throw l(n,k);return r}catch(t){throw l(e,k,t)}}function Y(e,t,n){return s("serialize",e,t,n)}function q(e){if("boolean"!=typeof e)throw Y(e,d);return e?"?1":"?0"}function V(e){if(!1===ArrayBuffer.isView(e))throw Y(e,g);return`:${(0,r.encodeBase64)(e)}:`}function K(e){if(_(e))throw Y(e,E);return e.toString()}function j(e){return`@${K(e.getTime()/1e3)}`}function W(e){const t=(0,r.roundToEven)(e,3);if(Math.floor(Math.abs(t)).toString().length>12)throw Y(e,m);const n=t.toString();return n.includes(".")?n:`${n}.0`}function z(e){if(A.test(e))throw Y(e,I);return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function $(e){return e.description||e.toString().slice(7,-1)}function Q(e){const t=$(e);
2if(!1===/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(t))throw Y(t,C);return t}function X(e){switch(typeof e){case"number":if(!Number.isFinite(e))throw Y(e,c);return Number.isInteger(e)?K(e):W(e);case"string":return z(e);case"symbol":return Q(e);case"boolean":return q(e);case"object":if(e instanceof Date)return j(e);if(e instanceof Uint8Array)return V(e);if(e instanceof N)return Q(e);default:throw Y(e,c)}}function Z(e){if(!1===/^[a-z*][a-z0-9\-_.*]*$/.test(e))throw Y(e,v);return e}function J(e){return null==e?"":Object.entries(e).map(([e,t])=>!0===t?`;${Z(e)}`:`;${Z(e)}=${X(t)}`).join("")}function ee(e){return e instanceof i?`${X(e.value)}${J(e.params)}`:X(e)}function te(e){return`(${e.value.map(ee).join(" ")})${J(e.params)}`}function ne(e,t={whitespace:!0}){if("object"!=typeof e||null==e)throw Y(e,a);const n=e instanceof Map?e.entries():Object.entries(e),r=t?.whitespace?" ":"";return Array.from(n).map(([e,t])=>{t instanceof i==0&&(t=new i(t));let n=Z(e);return!0===t.value?n+=J(t.params):(n+="=",Array.isArray(t.value)?n+=te(t):n+=ee(t)),n}).join(`,${r}`)}function re(e,t){return ne(e,t)}function ie(e,t){return e instanceof i||(e=new i(e,t)),ee(e)}function ae(e,t={whitespace:!0}){if(!1===Array.isArray(e))throw Y(e,k);const n=t?.whitespace?" ":"";return e.map(e=>{e instanceof i==0&&(e=new i(e));const t=e;return Array.isArray(t.value)?te(t):ee(t)}).join(`,${n}`)}function oe(e,t){return ae(e,t)}},9259:function(e,t,n){function r(e){return new Uint8Array(e).reduce((e,t)=>e+t.toString(16).padStart(2,"0"),"")}function i(e){return r(e).replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/,"$1-$2-$3-$4-$5")}function a(e){return new Uint8Array([...atob(e)].map(e=>e.charCodeAt(0)))}n.r(t),n.d(t,{Encoding:function(){return E},RequestResponseType:function(){return S},UTF_16:function(){return d},UTF_16_BE:function(){return f},UTF_16_LE:function(){return g},UTF_8:function(){return h},arrayBufferToHex:function(){return r},arrayBufferToUuid:function(){return i},base64decode:function(){return o},base64encode:function(){return l},convertUint8ToUint16:function(){return u},decodeBase64:function(){return a},decodeText:function(){return p},encodeBase64:function(){return s},encodeText:function(){return m},getBandwidthBps:function(){return T},getBaseUrl:function(){return _},hexToArrayBuffer:function(){return y},isArrayBufferLike:function(){return c},roundToEven:function(){return I},stringToUint16:function(){return A},unescapeHtml:function(){return N},urlToRelativePath:function(){return C},uuid:function(){return b},uuidToArrayBuffer:function(){return D}});const o=a;function s(e){return btoa(String.fromCharCode(...e))}const l=s;function u(e){if(e.length%2!=0){const t=new Uint8Array(e.length+1);return t.set(e),new Uint16Array(t.buffer)}return new Uint16Array(e.buffer)}function c(e){return e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer}const d="utf-16",f="utf-16be",g="utf-16le",h="utf-8";function p(e,t={}){let n;n=c(e)?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength);let r=0,{encoding:i}=t;if(!i){const e=n.getUint8(0),t=n.getUint8(1);239==e&&187==t&&191==n.getUint8(2)?(i=h,r=3):254==e&&255==t?(i=f,r=2):255==e&&254==t?(i=g,r=2):i=h}if("undefined"!=typeof TextDecoder)return new TextDecoder(i).decode(n);const{byteLength:a}=n,o=i!==f;let s,l="";for(;r<a;){switch(i){case h:if(s=n.getUint8(r),s<128)r++;else if(s>=194&&s<=223)if(r+1<a){const e=n.getUint8(r+1);e>=128&&e<=191?(s=(31&s)<<6|63&e,r+=2):r++}else r++;else if(s>=224&&s<=239)if(r+2<=a-1){const e=n.getUint8(r+1),t=n.getUint8(r+2);e>=128&&e<=191&&t>=128&&t<=191?(s=(15&s)<<12|(63&e)<<6|63&t,r+=3):r++}else r++;else if(s>=240&&s<=244)if(r+3<=a-1){const e=n.getUint8(r+1),t=n.getUint8(r+2),i=n.getUint8(r+3);e>=128&&e<=191&&t>=128&&t<=191&&i>=128&&i<=191?(s=(7&s)<<18|(63&e)<<12|(63&t)<<6|63&i,r+=4):r++}else r++;else r++;break;case f:case d:case g:s=n.getUint16(r,o),r+=2}l+=String.fromCodePoint(s)}return l}function m(e){return(new TextEncoder).encode(e)}const E={UTF8:h,UTF16:d,UTF16BE:f,UTF16LE:g};function T(e){const t=e.duration/1e3;return 8*e.encodedBodySize/t}function _(e){const t="string"==typeof e?new URL(e):e;return t.origin+t.pathname.substring(0,t.pathname.lastIndexOf("/")+1)}function y(e){const t=new ArrayBuffer(e.length/2),n=new Uint8Array(t);for(let t=0;t<e.length;t+=2)n[t/2]=parseInt(e.slice(t,t+2),16);return t}const S={TEXT:"text",JSON:"json",BLOB:"blob",ARRAY_BUFFER:"arrayBuffer",DOCUMENT:"document",STREAM:"stream"};function I(e,t){if(e<0)return-I(-e,t);const n=Math.pow(10,t);if(Math.abs(e*n%1-.5)<Number.EPSILON){const t=Math.floor(e*n);return(t%2==0?t:t+1)/n}return Math.round(e*n)/n}function A(e){const t=new ArrayBuffer(2*e.length),n=new DataView(t);for(let t=0;t<e.length;t++)n.setUint16(2*t,e.charCodeAt(t),!0);return new Uint16Array(t)}const R=/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g;function N(e){return-1===e.indexOf("&")?e:e.replace(R,e=>{switch(e){case"&amp;":return"&";case"&lt;":return"<";case"&gt;":return">";case"&quot;":return'"';case"&apos;":return"'";case"&nbsp;":return" ";case"&lrm;":return"‎";case"&rlm;":return"‏";default:if("#"===e[1]){const t="x"===e[2]||"X"===e[2]?parseInt(e.slice(3),16):parseInt(e.slice(2),10);return String.fromCodePoint(t)}return e}})}function C(e,t){let n;try{n=new URL(e)}catch{return e}
2const r=new URL(t);if(n.origin!==r.origin)return e;const i=n.pathname.split("/").slice(1),a=r.pathname.split("/").slice(1,-1),o=Math.min(i.length,a.length);for(let e=0;e<o&&i[e]===a[e];e++)i.shift(),a.shift();for(;a.length;)a.shift(),i.unshift("..");return i.join("/")+n.search+n.hash}function b(){try{return crypto.randomUUID()}catch(e){try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch(e){let t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)})}}}function D(e){return y(e.replace(/-/g,""))}},649:function(e,t,n){n.r(t);var r=n(8850),i=n(3621),a=n(138);function o(e){e=e||{};const t=this.context,n=(0,r.default)(t).getInstance(),a=e.settings,o=[];let s,l,u,c;function d(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function f(...e){E(1,this,...e)}function g(...e){E(2,this,...e)}function h(...e){E(3,this,...e)}function p(...e){E(4,this,...e)}function m(...e){E(5,this,...e)}function E(e,t,...r){let s="",d=null;l&&(d=(new Date).getTime(),s+="["+(d-c)+"]"),u&&t&&t.getClassName&&(s+="["+t.getClassName()+"]",t.getType&&(s+="["+t.getType()+"]")),s.length>0&&(s+=" "),Array.apply(null,r).forEach(function(e){s+=e+" "}),o[e]&&a&&a.get().debug.logLevel>=e&&o[e](s),a&&a.get().debug.dispatchEvent&&n.trigger(i.default.LOG,{message:s,level:e})}return s={getLogger:function(e){return{fatal:f.bind(e),error:g.bind(e),warn:h.bind(e),info:p.bind(e),debug:m.bind(e)}},setLogTimestampVisible:function(e){l=e},setCalleeNameVisible:function(e){u=e}},l=!0,u=!0,c=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(o[1]=d(window.console.error),o[2]=d(window.console.error),o[3]=d(window.console.warn),o[4]=d(window.console.info),o[5]=d(window.console.debug)),s}o.__dashjs_factory_name="Debug";const s=a.default.getSingletonFactory(o);s.LOG_LEVEL_NONE=0,s.LOG_LEVEL_FATAL=1,s.LOG_LEVEL_ERROR=2,s.LOG_LEVEL_WARNING=3,s.LOG_LEVEL_INFO=4,s.LOG_LEVEL_DEBUG=5,a.default.updateSingletonFactory(o.__dashjs_factory_name,s),t.default=s},8850:function(e,t,n){n.r(t);var r=n(138),i=n(1191);function a(){let e={};function t(t,n,i,a={},o=!1){if(!t)throw new Error("event type cannot be null or undefined");if(!n||"function"!=typeof n)throw new Error("listener must be a function: "+n);let s=a.priority||0;if(r(t,n,i)>=0)return;e[t]=e[t]||[];const l={callback:n,scope:i,priority:s,executeOnlyOnce:o};i&&i.getStreamId&&(l.streamId=i.getStreamId()),i&&i.getType&&(l.mediaType=i.getType()),a&&a.mode&&(l.mode=a.mode),e[t].some((n,r)=>{if(n&&s>n.priority)return e[t].splice(r,0,l),!0})||e[t].push(l)}function n(t,n,i){if(!t||!n||!e[t])return;const a=r(t,n,i);a<0||e[t].splice(a,1)}function r(t,n,r){let i=-1;return e[t]?(e[t].some((e,t)=>{if(e&&e.callback===n&&(!r||r===e.scope))return i=t,!0}),i):i}return{on:function(e,n,r,i={}){t(e,n,r,i)},once:function(e,n,r,i={}){t(e,n,r,i,!0)},off:n,trigger:function(t,r={},a={}){if(!t||!e[t])return;if((r=r||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");r.type=t,a.streamId&&(r.streamId=a.streamId),a.mediaType&&(r.mediaType=a.mediaType);const o=[];e[t].filter(e=>!(!e||a.streamId&&e.streamId&&e.streamId!==a.streamId||a.mediaType&&e.mediaType&&e.mediaType!==a.mediaType||a.mode&&e.mode&&e.mode!==a.mode||!e.mode&&a.mode&&a.mode===i.default.EVENT_MODE_ON_RECEIVE)).forEach(e=>{e&&e.callback.call(e.scope,r),e.executeOnlyOnce&&o.push(e)}),o.forEach(e=>{n(t,e.callback,e.scope)})},reset:function(){e={}}}}a.__dashjs_factory_name="EventBus";const o=r.default.getSingletonFactory(a);o.EVENT_PRIORITY_LOW=0,o.EVENT_PRIORITY_HIGH=5e3,r.default.updateSingletonFactory(a.__dashjs_factory_name,o),t.default=o},138:function(e,t,n){n.r(t);const r=function(){let e,t=[];const n={},r={};function i(e,n){for(const r in t){const i=t[r];if(i.context===e&&i.name===n)return i.instance}return null}function a(e,t){return t[e]}function o(e,t,n){e in n&&(n[e]=t)}function s(t,n,r){let i;const a=t.__dashjs_factory_name,o=n[a];if(o){let a=o.instance;if(!o.override)return a.apply({context:n,factory:e},r);i=t.apply({context:n},r),a=a.apply({context:n,factory:e,parent:i},r);for(const e in a)i.hasOwnProperty(e)&&(i[e]=a[e])}else i=t.apply({context:n},r);return i.getClassName=function(){return a},i}return e={deleteSingletonInstances:function(e){t=t.filter(t=>t.context!==e)},extend:function(e,t,n,r){!r[e]&&t&&(r[e]={instance:t,override:n})},getClassFactory:function(e){let t=a(e.__dashjs_factory_name,r);return t||(t=function(t){return void 0===t&&(t={}),{create:function(){return s(e,t,arguments)}}},r[e.__dashjs_factory_name]=t),t},getClassFactoryByName:function(e){return a(e,r)},getSingletonFactory:function(e){let r=a(e.__dashjs_factory_name,n);return r||(r=function(n){let r;return void 0===n&&(n={}),{getInstance:function(){return r||(r=i(n,e.__dashjs_factory_name)),r||(r=s(e,n,arguments),t.push({name:e.__dashjs_factory_name,context:n,instance:r})),r}}},n[e.__dashjs_factory_name]=r),r},getSingletonFactoryByName:function(e){return a(e,n)},getSingletonInstance:i,setSingletonInstance:function(e,n,r){for(const i in t){const a=t[i];if(a.context===e&&a.name===n)return void(t[i].instance=r)}t.push({name:n,context:e,instance:r})},updateClassFactory:function(e,t){o(e,t,r)},updateSingletonFactory:function(e,t){o(e,t,n)}},e}();t.default=r},8261:function(e,t,n){n.r(t);var r=n(138),i=n(7263),a=n(649),o=n(5212),s=n(7568),l=n(8850),u=n(3621),c=n(4246);function d(){let e;const t=this.context,n=(0,l.default)(t).getInstance(),r={"streaming.delay.liveDelay":u.default.SETTING_UPDATED_LIVE_DELAY,"streaming.delay.liveDelayFragmentCount":u.default.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,"streaming.liveCatchup.enabled":u.default.SETTING_UPDATED_CATCHUP_ENABLED,"streaming.liveCatchup.playbackRate.min":u.default.SETTING_UPDATED_PLAYBACK_RATE_MIN,"streaming.liveCatchup.playbackRate.max":u.default.SETTING_UPDATED_PLAYBACK_RATE_MAX,"streaming.abr.rules.throughputRule.active":u.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.bolaRule.active":u.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.insufficientBufferRule.active":u.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.switchHistoryRule.active":u.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.droppedFramesRule.active":u.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.abandonRequestsRule.active":u.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.l2ARule.active":u.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.loLPRule.active":u.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.maxBitrate.video":u.default.SETTING_UPDATED_MAX_BITRATE,"streaming.abr.maxBitrate.audio":u.default.SETTING_UPDATED_MAX_BITRATE,"streaming.abr.minBitrate.video":u.default.SETTING_UPDATED_MIN_BITRATE,"streaming.abr.minBitrate.audio":u.default.SETTING_UPDATED_MIN_BITRATE},d={debug:{logLevel:a.default.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{abandonLoadTimeout:1e4,wallclockTimeUpdateInterval:100,manifestUpdateRetryInterval:100,liveUpdateTimeThresholdInMilliseconds:0,cacheInitSegments:!1,cacheInitSegmentsLimit:50,applyServiceDescription:!0,applyProducerReferenceTime:!0,applyContentSteering:!0,enableManifestDurationMismatchFix:!0,parseInbandPrft:!1,enableManifestTimescaleMismatchFix:!1,capabilities:{filterUnsupportedEssentialProperties:!0,supportedEssentialProperties:[{schemeIdUri:o.default.FONT_DOWNLOAD_DVB_SCHEME},{schemeIdUri:o.default.COLOUR_PRIMARIES_SCHEME_ID_URI,value:/1|5|6|7/},{schemeIdUri:o.default.URL_QUERY_INFO_SCHEME},{schemeIdUri:o.default.EXT_URL_QUERY_INFO_SCHEME},{schemeIdUri:o.default.MATRIX_COEFFICIENTS_SCHEME_ID_URI,value:/0|1|5|6/},{schemeIdUri:o.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI,value:/1|6|13|14|15/},{schemeIdUri:o.default.SEGMENT_SEQUENCE_REPRESENTATION_SCHEME_ID_URI},...o.default.THUMBNAILS_SCHEME_ID_URIS.map(e=>({schemeIdUri:e}))],useMediaCapabilitiesApi:!0,filterVideoColorimetryEssentialProperties:!0,filterHDRMetadataFormatEssentialProperties:!0,filterAudioChannelConfiguration:!1},events:{eventControllerRefreshDelay:100,deleteEventMessageDataTimeout:1e4},timeShiftBuffer:{calcFromSegmentTimeline:!1,fallbackToSegmentTimeline:!0},metrics:{maxListDepth:100},delay:{liveDelayFragmentCount:NaN,liveDelay:NaN,useSuggestedPresentationDelay:!0},protection:{keepProtectionMediaKeys:!1,keepProtectionMediaKeysMaximumOpenSessions:-1,ignoreEmeEncryptedEvent:!1,detectPlayreadyMessageFormat:!0,ignoreKeyStatuses:!1},buffer:{enableSeekDecorrelationFix:!1,fastSwitchEnabled:null,flushBufferAtTrackSwitch:!1,reuseExistingSourceBuffers:!0,bufferPruningInterval:10,bufferToKeep:20,bufferTimeAtTopQuality:30,bufferTimeAtTopQualityLongForm:60,initialBufferLevel:NaN,bufferTimeDefault:18,longFormContentDurationThreshold:600,stallThreshold:.3,lowLatencyStallThreshold:.3,useAppendWindow:!0,setStallState:!0,avoidCurrentTimeRangePruning:!1,useChangeType:!0,mediaSourceDurationInfinity:!0,resetSourceBuffersForTrackSwitch:!1,syntheticStallEvents:{enabled:!1,ignoreReadyState:!1}},gaps:{jumpGaps:!0,jumpLargeGaps:!0,smallGapLimit:1.5,threshold:.3,enableSeekFix:!0,enableStallFix:!1,stallSeek:.1,seekOffset:0,checkInterval:250},utcSynchronization:{enabled:!0,useManifestDateHeaderTimeSource:!0,backgroundAttempts:2,timeBetweenSyncAttempts:30,maximumTimeBetweenSyncAttempts:600,minimumTimeBetweenSyncAttempts:2,timeBetweenSyncAttemptsAdjustmentFactor:2,maximumAllowedDrift:100,enableBackgroun
2dSyncAfterSegmentDownloadError:!0,defaultTimingSource:{scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"https://time.akamai.com/?iso&ms"},artificialTimeOffsetToApply:0},scheduling:{defaultTimeout:500,lowLatencyTimeout:0,scheduleWhilePaused:!0},text:{defaultEnabled:!0,dispatchForManualRendering:!1,extendSegmentedCues:!0,imsc:{displayForcedOnlyMode:!1,enableRollUp:!0},webvtt:{customRenderingEnabled:!1}},liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN},step:{start:{min:NaN,max:NaN},stop:{min:NaN,max:NaN}},liveThreshold:-1,playbackBufferMin:.5,enabled:null,mode:o.default.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},saveLastMediaSettingsForCurrentStreamingSession:!0,cacheLoadThresholds:{video:10,audio:5},trackSwitchMode:{audio:o.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:o.default.TRACK_SWITCH_MODE_NEVER_REPLACE},includePreselectionsInMediainfoArray:!0,includePreselectionsForInitialTrackSelection:!1,ignoreSelectionPriority:!1,prioritizeRoleMain:!0,assumeDefaultRoleAsMain:!0,selectionModeForInitialTrack:o.default.TRACK_SELECTION_MODE_LOWEST_STARTUP_DELAY,blacklistExpiryTime:-1,fragmentRequestTimeout:2e4,fragmentRequestProgressTimeout:-1,manifestRequestTimeout:1e4,retryIntervals:{[s.HTTPRequest.MPD_TYPE]:500,[s.HTTPRequest.XLINK_EXPANSION_TYPE]:500,[s.HTTPRequest.MEDIA_SEGMENT_TYPE]:1e3,[s.HTTPRequest.INIT_SEGMENT_TYPE]:1e3,[s.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE]:1e3,[s.HTTPRequest.INDEX_SEGMENT_TYPE]:1e3,[s.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE]:1e3,[s.HTTPRequest.LICENSE]:1e3,[s.HTTPRequest.LICENSE_CERTIFICATE]:1e3,[s.HTTPRequest.OTHER_TYPE]:1e3,lowLatencyReductionFactor:10},retryAttempts:{[s.HTTPRequest.MPD_TYPE]:3,[s.HTTPRequest.XLINK_EXPANSION_TYPE]:1,[s.HTTPRequest.MEDIA_SEGMENT_TYPE]:3,[s.HTTPRequest.INIT_SEGMENT_TYPE]:3,[s.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE]:3,[s.HTTPRequest.INDEX_SEGMENT_TYPE]:3,[s.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE]:3,[s.HTTPRequest.LICENSE]:3,[s.HTTPRequest.LICENSE_CERTIFICATE]:3,[s.HTTPRequest.OTHER_TYPE]:3,lowLatencyMultiplyFactor:5},abr:{limitBitrateByPortal:!1,usePixelRatioInLimitBitrateByPortal:!1,limitBitrateByPortalMinimum:0,enableSupplementalPropertyAdaptationSetSwitching:!0,rules:{throughputRule:{active:!0,priority:c.default.PRIORITY.DEFAULT},bolaRule:{active:!0,priority:c.default.PRIORITY.DEFAULT},insufficientBufferRule:{active:!0,priority:c.default.PRIORITY.DEFAULT,parameters:{throughputSafetyFactor:.7,segmentIgnoreCount:2}},switchHistoryRule:{active:!0,priority:c.default.PRIORITY.DEFAULT,parameters:{sampleSize:8,switchPercentageThreshold:.075}},droppedFramesRule:{active:!1,priority:c.default.PRIORITY.DEFAULT,parameters:{minimumSampleSize:375,droppedFramesPercentageThreshold:.15}},abandonRequestsRule:{active:!0,priority:c.default.PRIORITY.DEFAULT,parameters:{abandonDurationMultiplier:1.8,minSegmentDownloadTimeThresholdInMs:500,minThroughputSamplesThreshold:6}},l2ARule:{active:!1,priority:c.default.PRIORITY.DEFAULT},loLPRule:{active:!1,priority:c.default.PRIORITY.DEFAULT}},throughput:{averageCalculationMode:o.default.THROUGHPUT_CALCULATION_MODES.EWMA,lowLatencyDownloadTimeCalculationMode:o.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING,useResourceTimingApi:!0,useNetworkInformationApi:{xhr:!1,fetch:!1},useDeadTimeLatency:!0,bandwidthSafetyFactor:.9,sampleSettings:{live:3,vod:4,enableSampleSizeAdjustment:!0,decreaseScale:.7,increaseScale:1.3,maxMeasurementsToKeep:20,averageLatencySampleAmount:4},ewma:{throughputSlowHalfLifeSeconds:8,throughputFastHalfLifeSeconds:3,latencySlowHalfLifeCount:2,latencyFastHalfLifeCount:1,weightDownloadTimeMultiplicationFactor:.0015}},maxBitrate:{audio:-1,video:-1},minBitrate:{audio:-1,video:-1},initialBitrate:{audio:-1,video:-1},autoSwitchBitrate:{audio:!0,video:!0}},cmcd:{applyParametersFromMpd:!0,enabled:!1,sid:null,cid:null,rtp:null,rtpSafetyFactor:5,mode:o.default.CMCD_MODE_QUERY,enabledKeys:o.default.CMCD_KEYS,includeInRequests:["segment","mpd"],version:1,eventTargets:[]},cmsd:{enabled:!1,abr:{applyMb:!1,etpWeightRatio:0}}
2,enhancement:{enabled:!1,codecs:["lvc1"]},defaultSchemeIdUri:{viewpoint:"",audioChannelConfiguration:"urn:mpeg:mpegB:cicp:ChannelConfiguration",role:"urn:mpeg:dash:role:2011",accessibility:"urn:mpeg:dash:role:2011"},dvbReporting:{reportingUrl:null}},errors:{recoverAttempts:{mediaErrorDecode:5}}};let f=i.default.clone(d);function g(e,t,a){for(let o in e)e.hasOwnProperty(o)&&(t.hasOwnProperty(o)?"object"!=typeof e[o]||e[o]instanceof RegExp||e[o]instanceof Array||null===e[o]?(t[o]=i.default.clone(e[o]),r[a+o]&&n.trigger(r[a+o])):g(e[o],t[o],a.slice()+o+"."):console.error("Settings parameter "+a+o+" is not supported"))}return e={get:function(){return f},update:function(e){"object"==typeof e&&g(e,f,"")},reset:function(){f=i.default.clone(d)}},e}d.__dashjs_factory_name="Settings";let f=r.default.getSingletonFactory(d);t.default=f},7263:function(e,t,n){n.r(t);var r=n(3282),i=n(5212);class a{static mixin(e,t,n){let r,i={};if(e)for(let o in t)t.hasOwnProperty(o)&&(r=t[o],o in e&&(e[o]===r||o in i&&i[o]===r)||("object"==typeof e[o]&&null!==e[o]?e[o]=a.mixin(e[o],r,n):e[o]=n(r)));return e}static clone(e){if(!e||"object"!=typeof e)return e;if(e instanceof RegExp)return new RegExp(e);let t;if(e instanceof Array){t=[];for(let n=0,r=e.length;n<r;++n)n in e&&t.push(a.clone(e[n]))}else t={};return a.mixin(t,e,a.clone)}static addAdditionalQueryParameterToUrl(e,t){try{if(!t||0===t.length)return e;let n=e;return t.forEach(({key:e,value:t})=>{const r=n.includes("?")?"&":"?";n+=`${r}${encodeURIComponent(e)}=${encodeURIComponent(t)}`}),n}catch(t){return e}}static removeQueryParameterFromUrl(e,t){if(!e||!t)return e;const n=new URL(e),r=new URLSearchParams(n.search);if(!r||0===r.size||!r.has(t))return e;r.delete(t);const i=Array.from(r.entries()).map(([e,t])=>`${e}=${t}`).join("&"),a=`${n.origin}${n.pathname}`;return i?`${a}?${i}`:a}static parseHttpHeaders(e){let t={};if(!e)return t;let n=e.trim().split("\r\n");for(let e=0,r=n.length;e<r;e++){let r=n[e],i=r.indexOf(": ");i>0&&(t[r.substring(0,i)]=r.substring(i+2))}return t}static parseQueryParams(e){const t=[],n=new URLSearchParams(e);for(const[e,r]of n.entries())t.push({key:decodeURIComponent(e),value:decodeURIComponent(r)});return t}static generateUuid(){let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)})}static generateHashCode(e){let t=0;if(0===e.length)return t;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}static getRelativeUrl(e,t){try{const n=new URL(e),i=new URL(t);if(n.protocol=i.protocol,n.origin!==i.origin)return t;let a=r.relative(n.pathname.substr(0,n.pathname.lastIndexOf("/")),i.pathname.substr(0,i.pathname.lastIndexOf("/")));const o=0===a.length?1:0;return a+=i.pathname.substr(i.pathname.lastIndexOf("/")+o,i.pathname.length-1),i.pathname.length<a.length?i.pathname:a}catch(e){return t}}static getHostFromUrl(e){try{return new URL(e).host}catch(e){return null}}static parseUserAgent(e=null){try{const t="string"==typeof e?e.toLowerCase():"undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",n={name:""};return/edg/.test(t)?n.name="edge":/opr|opios/.test(t)?n.name="opera":/chrome|crios/.test(t)?n.name="chrome":/firefox|fxios/.test(t)?n.name="firefox":/safari/.test(t)&&(n.name="safari"),{browser:n}}catch(e){return{}}}static stringHasProtocol(e){return/(http(s?)):\/\//i.test(e)}static bufferSourceToDataView(e){return a.toDataView(e,DataView)}static bufferSourceToInt8(e){return a.toDataView(e,Uint8Array)}static uint8ArrayToString(e){return new TextDecoder("utf-8").decode(e)}static bufferSourceToHex(e){const t=a.bufferSourceToInt8(e);let n="";for(let e of t)e=e.toString(16),1===e.length&&(e="0"+e),n+=e;return n}static toDataView(e,t){const n=a.getArrayBuffer(e);let r=1;"BYTES_PER_ELEMENT"in DataView&&(r=DataView.BYTES_PER_ELEMENT);const i=((e.byteOffset||0)+e.byteLength)/r,o=(e.byteOffset||0)/r,s=Math.floor(Math.max(0,Math.min(o,i)));return new t(n,s,Math.floor(Math.min(s+Math.max(1/0,0),i))-s)}static getArrayBuffer(e){return e instanceof ArrayBuffer?e:e.buffer}static getCodecFamily(e){const{base:t,profile:n}=a._getCodecParts(e);
2switch(t){case"mp4a":switch(n){case"69":case"6b":case"40.34":return i.default.CODEC_FAMILIES.MP3;case"66":case"67":case"68":case"40.2":case"40.02":case"40.5":case"40.05":case"40.29":case"40.42":return i.default.CODEC_FAMILIES.AAC;case"a5":return i.default.CODEC_FAMILIES.AC3;case"e6":return i.default.CODEC_FAMILIES.EC3;case"b2":return i.default.CODEC_FAMILIES.DTSX;case"a9":return i.default.CODEC_FAMILIES.DTSC}break;case"avc1":case"avc3":return i.default.CODEC_FAMILIES.AVC;case"hvc1":case"hvc3":return i.default.CODEC_FAMILIES.HEVC;default:return t}return t}static _getCodecParts(e){const[t,...n]=e.split(".");return{base:t,profile:n.join(".")}}}t.default=a},8986:function(e,t,n){n.r(t),n.d(t,{getVersionString:function(){return i}});const r="5.2.0";function i(){return r}
vendor: 6,820 bytes, line 2
2},893:function(e,t,n){n.r(t);var r=n(8748);class i extends r.default{constructor(){super(),this.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE=10,this.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE=11,this.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE=12,this.SEGMENT_BASE_LOADER_ERROR_CODE=15,this.TIME_SYNC_FAILED_ERROR_CODE=16,this.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE=17,this.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE=18,this.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE=19,this.APPEND_ERROR_CODE=20,this.REMOVE_ERROR_CODE=21,this.DATA_UPDATE_FAILED_ERROR_CODE=22,this.CAPABILITY_MEDIASOURCE_ERROR_CODE=23,this.CAPABILITY_MEDIAKEYS_ERROR_CODE=24,this.DOWNLOAD_ERROR_ID_MANIFEST_CODE=25,this.DOWNLOAD_ERROR_ID_SIDX_CODE=26,this.DOWNLOAD_ERROR_ID_CONTENT_CODE=27,this.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE=28,this.DOWNLOAD_ERROR_ID_XLINK_CODE=29,this.MANIFEST_ERROR_ID_PARSE_CODE=31,this.MANIFEST_ERROR_ID_NOSTREAMS_CODE=32,this.TIMED_TEXT_ERROR_ID_PARSE_CODE=33,this.MANIFEST_ERROR_ID_MULTIPLEXED_CODE=34,this.MEDIASOURCE_TYPE_UNSUPPORTED_CODE=35,this.NO_SUPPORTED_KEY_IDS=36,this.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE="parsing failed for ",this.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading manifest: ",this.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading Xlink element: ",this.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE="Segments update failed",this.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE="no segments are available yet",this.SEGMENT_BASE_LOADER_ERROR_MESSAGE="error loading segment ranges from sidx",this.TIME_SYNC_FAILED_ERROR_MESSAGE="Failed to synchronize client and server time",this.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE="request is null",this.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE="Failed to resolve a valid URL",this.APPEND_ERROR_MESSAGE="chunk is not defined",this.REMOVE_ERROR_MESSAGE="Removing data from the SourceBuffer",this.DATA_UPDATE_FAILED_ERROR_MESSAGE="Data update failed",this.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE="mediasource is not supported",this.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE="mediakeys is not supported",this.TIMED_TEXT_ERROR_MESSAGE_PARSE="parsing error :",this.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE="Error creating source buffer of type : ",this.NO_SUPPORTED_KEY_IDS_MESSAGE="All possible Adaptation Sets have an invalid key status"}}let a=new i;t.default=a},8748:function(e,t,n){n.r(t),t.default=class{extend(e,t){if(!e)return;let n=!!t&&t.override,r=!!t&&t.publicOnly;for(const t in e)!e.hasOwnProperty(t)||this[t]&&!n||r&&-1===e[t].indexOf("public_")||(this[t]=e[t])}}},5734:function(e,t,n){n.r(t);var r=n(7252);class i extends r.default{constructor(){super(),this.ATTEMPT_BACKGROUND_SYNC="attemptBackgroundSync",this.BUFFERING_COMPLETED="bufferingCompleted",this.BUFFER_CLEARED="bufferCleared",this.BUFFER_REPLACEMENT_STARTED="bufferReplacementStarted",this.BYTES_APPENDED_END_FRAGMENT="bytesAppendedEndFragment",this.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",this.CMSD_STATIC_HEADER="cmsdStaticHeader",this.CURRENT_TRACK_CHANGED="currentTrackChanged",this.DATA_UPDATE_COMPLETED="dataUpdateCompleted",this.INBAND_EVENTS="inbandEvents",this.INITIAL_STREAM_SWITCH="initialStreamSwitch",this.INIT_FRAGMENT_LOADED="initFragmentLoaded",this.INIT_FRAGMENT_NEEDED="initFragmentNeeded",this.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",this.LOADING_ABANDONED="loadingAborted",this.LOADING_COMPLETED="loadingCompleted",this.LOADING_DATA_PROGRESS="loadingDataProgress",this.LOADING_PROGRESS="loadingProgress",this.MANIFEST_UPDATED="manifestUpdated",this.MEDIAINFO_UPDATED="mediaInfoUpdated",this.MEDIA_FRAGMENT_LOADED="mediaFragmentLoaded",this.MEDIA_FRAGMENT_NEEDED="mediaFragmentNeeded",this.ORIGINAL_MANIFEST_LOADED="originalManifestLoaded",this.QUOTA_EXCEEDED="quotaExceeded",this.SEEK_TARGET="seekTarget",this.SEGMENT_LOCATION_BLACKLIST_ADD="segmentLocationBlacklistAdd",this.SEGMENT_LOCATION_BLACKLIST_CHANGED="segmentLocationBlacklistChanged",this.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD="serviceLocationBlacklistAdd",this.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",this.SERVICE_LOCATION_LOCATION_BLACKLIST_ADD="serviceLocationLocationBlacklistAdd",this.SERVICE_LOCATION_LOCATION_BLACKLIST_CHANGED="serviceLocationLocationBlacklistChanged",this.SETTING_UPDATED_ABR_ACTIVE_RULES="settingUpdatedAbrActiveRules",this.SETTING_UPDATED_CATCHUP_ENABLED="settingUpdatedCatchupEnabled",this.SETTING_UPDATED_LIVE_DELAY="settingUpdatedLiveDelay",this.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT="settingUpdatedLiveDelayFragmentCount",this.SETTING_UPDATED_MAX_BITRATE="settingUpdatedMaxBitrate",this.SETTING_UPDATED_MIN_BITRATE="settingUpdatedMinBitrate",this.SETTING_UPDATED_PLAYBACK_RATE_MAX="settingUpdatedPlaybackRateMax",this.SETTING_UPDATED_PLAYBACK_RATE_MIN="settingUpdatedPlaybackRateMin",this.SET_FRAGMENTED_TEXT_AFTER_DISABLED="setFragmentedTextAfterDisabled",this.SET_NON_FRAGMENTED_TEXT="setNonFragmentedText",this.SOURCE_BUFFER_ERROR="sourceBufferError",this.STREAMS_COMPOSED="streamsComposed",this.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",this.STREAM_REQUESTING_COMPLETED="streamRequestingCompleted",this.TEXT_TRACKS_QUEUE_INITIALIZED="textTracksQueueInitialized",this.TIME_SYNCHRONIZATION_COMPLETED="timeSynchronizationComplete",this.UPDATE_TIME_SYNC_OFFSET="updateTimeSyncOffset",this.URL_RESOLUTION_FAILED="urlResolutionFailed",this.VIDEO_CHUNK_RECEIVED="videoChunkReceived",this.VIDEO_ELEMENT_RESIZED="videoElementResized",this.WALLCLOCK_TIME_UPDATED="wallclockTimeUpdated",this.XLINK_ELEMENT_LOADED="xlinkElementLoaded",this.XLINK_READY="xlinkReady"}}t.default=i},3621:function(e,t,n){n.r(t);var r=n(5734);class i extends r.default{}let a=new i;t.default=a},7252:function(e,t,n){n.r(t),t.default=class{extend(e,t){if(!e)return;let n=!!t&&t.override,r=!!t&&t.publicOnly;for(const t in e)!e.hasOwnProperty(t)||this[t]&&!n||r&&-1===e[t].indexOf("public_")||(this[t]=e[t])}}},8854:function(e,t,n){n.r(t),t.default={ACCESSIBILITY:"Accessibility",ADAPTATION_SET:"AdaptationSet",ADAPTATION_SETS:"adaptationSets",ADAPTATION_SET_SWITCHING_SCHEME_ID_URI:"urn:mpeg:dash:adaptation-set-switching:2016",ADD:"add",ASSET_IDENTIFIER:"AssetIdentifier",AUDIO_CHANNEL_CONFIGURATION:"AudioChannelConfiguration",AUDIO_SAMPLING_RATE:"audioSamplingRate",AVAILABILITY_END_TIME:"availabilityEndTime",AVAILABILITY_START_TIME:"availabilityStartTime",AVAILABILITY_TIME_COMPLETE:"availabilityTimeComplete",AVAILABILITY_TIME_OFFSET:"availabilityTimeOffset",BANDWITH:"bandwidth",BASE_URL:"BaseURL",BITSTREAM_SWITCHING:"BitstreamSwitching",BITSTREAM_SWITCHING_MINUS:"bitstreamSwitching",BYTE_RANGE:"byteRange",CAPTION:"caption",CENC_DEFAULT_KID:"cenc:default_KID",CLIENT_DATA_REPORTING:"ClientDataReporting",CLIENT_REQUIREMENT:"clientRequirement",CMCD_PARAMETERS:"CMCDParameters",CODECS:"codecs",CODEC_PRIVATE_DATA:"co
vendor: 3,901 bytes, line 2
2decPrivateData",CODING_DEPENDENCY:"codingDependency",CONTENT_COMPONENT:"ContentComponent",CONTENT_PROTECTION:"ContentProtection",CONTENT_STEERING:"ContentSteering",CONTENT_STEERING_RESPONSE:{VERSION:"VERSION",TTL:"TTL",RELOAD_URI:"RELOAD-URI",PATHWAY_PRIORITY:"PATHWAY-PRIORITY",PATHWAY_CLONES:"PATHWAY-CLONES",BASE_ID:"BASE-ID",ID:"ID",URI_REPLACEMENT:"URI-REPLACEMENT",HOST:"HOST",PARAMS:"PARAMS"},CONTENT_TYPE:"contentType",DEFAULT_SERVICE_LOCATION:"defaultServiceLocation",DEPENDENCY_ID:"dependencyId",DURATION:"duration",DVB_PRIORITY:"dvb:priority",DVB_WEIGHT:"dvb:weight",DVB_URL:"dvb:url",DVB_MIMETYPE:"dvb:mimeType",DVB_FONTFAMILY:"dvb:fontFamily",DYNAMIC:"dynamic",END_NUMBER:"endNumber",ESSENTIAL_PROPERTY:"EssentialProperty",EVENT:"Event",EVENT_STREAM:"EventStream",FORCED_SUBTITLE:"forced-subtitle",FRAMERATE:"frameRate",FRAME_PACKING:"FramePacking",GROUP_LABEL:"GroupLabel",HEIGHT:"height",ID:"id",INBAND:"inband",INBAND_EVENT_STREAM:"InbandEventStream",INDEX:"index",INDEX_RANGE:"indexRange",INITIALIZATION:"Initialization",INITIALIZATION_MINUS:"initialization",K:"k",LA_URL:"Laurl",LA_URL_LOWER_CASE:"laurl",CERT_URL:"Certurl",LABEL:"Label",LANG:"lang",LOCATION:"Location",MAIN:"main",MAXIMUM_SAP_PERIOD:"maximumSAPPeriod",MAX_PLAYOUT_RATE:"maxPlayoutRate",MAX_SEGMENT_DURATION:"maxSegmentDuration",MAX_SUBSEGMENT_DURATION:"maxSubsegmentDuration",MEDIA:"media",MEDIA_PRESENTATION_DURATION:"mediaPresentationDuration",MEDIA_RANGE:"mediaRange",MEDIA_STREAM_STRUCTURE_ID:"mediaStreamStructureId",METRICS:"Metrics",METRICS_MINUS:"metrics",MIME_TYPE:"mimeType",MINIMUM_UPDATE_PERIOD:"minimumUpdatePeriod",MIN_BUFFER_TIME:"minBufferTime",MP4_PROTECTION_SCHEME:"urn:mpeg:dash:mp4protection:2011",MPD:"MPD",MPD_TYPE:"mpd",MPD_PATCH_TYPE:"mpdpatch",ORDER:"order",ORIGINAL_MPD_ID:"mpdId",ORIGINAL_PUBLISH_TIME:"originalPublishTime",PATCH_LOCATION:"PatchLocation",PERIOD:"Period",PRESELECTION:"Preselection",PRESELECTION_COMPONENTS:"preselectionComponents",PRESENTATION_TIME:"presentationTime",PRESENTATION_TIME_OFFSET:"presentationTimeOffset",PRO:"pro",PRODUCER_REFERENCE_TIME:"ProducerReferenceTime",PRODUCER_REFERENCE_TIME_TYPE:{ENCODER:"encoder",CAPTURED:"captured",APPLICATION:"application"},PROFILES:"profiles",PSSH:"pssh",PUBLISH_TIME:"publishTime",QUALITY_RANKING:"qualityRanking",QUERY_BEFORE_START:"queryBeforeStart",QUERY_PART:"$querypart$",RANGE:"range",RATING:"Rating",REF:"ref",REF_ID:"refId",REMOVE:"remove",REPLACE:"replace",REPORTING:"Reporting",REPRESENTATION:"Representation",REPRESENTATION_INDEX:"RepresentationIndex",ROBUSTNESS:"robustness",ROLE:"Role",S:"S",SAR:"sar",SCAN_TYPE:"scanType",SEGMENT_ALIGNMENT:"segmentAlignment",SEGMENT_BASE:"SegmentBase",SEGMENT_LIST:"SegmentList",SEGMENT_PROFILES:"segmentProfiles",SEGMENT_SEQUENCE_PROPERTIES:"SegmentSequenceProperties",SEGMENT_TEMPLATE:"SegmentTemplate",SEGMENT_TIMELINE:"SegmentTimeline",SEGMENT_TYPE:"segment",SEGMENT_URL:"SegmentURL",SERVICE_DESCRIPTION:"ServiceDescription",SERVICE_DESCRIPTION_LATENCY:"Latency",SERVICE_DESCRIPTION_OPERATING_BANDWIDTH:"OperatingBandwidth",SERVICE_DESCRIPTION_OPERATING_QUALITY:"OperatingQuality",SERVICE_DESCRIPTION_PLAYBACK_RATE:"PlaybackRate",SERVICE_DESCRIPTION_SCOPE:"Scope",SERVICE_LOCATION:"serviceLocation",SERVICE_LOCATIONS:"serviceLocations",SOURCE_URL:"sourceURL",START:"start",START_NUMBER:"startNumber",START_WITH_SAP:"startWithSAP",STATIC:"static",STEERING_TYPE:"steering",SUBSET:"Subset",SUBTITLE:"subtitle",SUB_REPRESENTATION:"SubRepresentation",SUB_SEGMENT_ALIGNMENT:"subsegmentAlignment",SUGGESTED_PRESENTATION_DELAY:"suggestedPresentationDelay",SUPPLEMENTAL_PROPERTY:"SupplementalProperty",SUPPLEMENTAL_CODECS:"scte214:supplementalCodecs",TAG:"tag",TIMESCALE:"timescale",TIMESHIFT_BUFFER_DEPTH:"timeShiftBufferDepth",TTL:"ttl",TYPE:"type",UTC_TIMING:"UTCTiming",VALUE:"value",VIEWPOINT:"Viewpoint",WALL_CLOCK_TIME:"wallClockTime",WIDTH:"width"}},9302:function(e,t,n){
2n.r(t);var r=n(8062),i=n(9415),a=n(9578),o=n(4770),s=n(5212),l=n(5915),u=n(6455),c=n(8854),d=n(1944),f=n(649),g=n(1036),h=n(893),p=n(1465),m=n(7153),E=n(138),T=n(5274),_=n(6517),y=n(7393),S=n(4740),I=n(7408),A=n(2436),R=n(2655),N=n(5876),C=n(6503),b=n(5717),D=n(7263),v=n(7356);function M(){let e,t,n,E;const M=this.context,w=(0,C.default)(M).getInstance(),P=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function O(e,t){if(!e)throw new Error("adaptation is not defined");if(!t)throw new Error("type is not defined");if(e.Representation&&e.Representation.length){const n=W(e.Representation[0]);if(n&&n.some(e=>s.default.THUMBNAILS_SCHEME_ID_URIS.indexOf(e.schemeIdUri)>=0))return t===s.default.IMAGE}if(e.ContentComponent&&e.ContentComponent.length>0){if(e.ContentComponent.length>1)return t===s.default.MUXED;if(e.ContentComponent[0].contentType===t)return!0}const n=t===s.default.TEXT?new RegExp("(ttml|vtt|wvtt|stpp)"):new RegExp(t);if(e.Representation&&e.Representation.length){const t=e.Representation[0].codecs;if(n.test(t))return!0}if(e.hasOwnProperty(c.default.MIME_TYPE))return n.test(e.mimeType);if(e.Representation){let t;for(let r=0;r<e.Representation.length;r++)if(t=e.Representation[r],t.hasOwnProperty(c.default.MIME_TYPE))return n.test(t.mimeType)}return!1}function L(e){if(!e)throw new Error("adaptation is not defined");if(e.hasOwnProperty(c.default.SEGMENT_TEMPLATE)||e.hasOwnProperty(c.default.SEGMENT_TIMELINE)||e.hasOwnProperty(c.default.SEGMENT_LIST)||e.hasOwnProperty(c.default.SEGMENT_BASE))return!0;if(e.Representation&&e.Representation.length>0){const t=e.Representation[0];if(t.hasOwnProperty(c.default.SEGMENT_TEMPLATE)||t.hasOwnProperty(c.default.SEGMENT_TIMELINE)||t.hasOwnProperty(c.default.SEGMENT_LIST)||t.hasOwnProperty(c.default.SEGMENT_BASE))return!0}return!1}function F(e){return O(e,s.default.TEXT)}function U(e){return e&&e.Representation&&e.Representation.sort((e,t)=>e.bandwidth-t.bandwidth),e}function x(e,t){return e&&e.Period&&P(t)&&e.Period[t]?e.Period[t].AdaptationSet:[]}function B(e){return e&&e.Period?e.Period:[]}function k(e,t,n){let r=null;if(e&&e.Representation&&e.Representation.length>0){const i=P(t)&&t>=0&&t<e.Representation.length?e.Representation[t]:e.Representation[0];i&&(r=i.mimeType+';codecs="'+i.codecs+'"',n&&void 0!==i.width&&(r+=';width="'+i.width+'";height="'+i.height+'"'))}return r&&(r=r.replace(/\sprofiles=[^;]*/g,"")),r}function G(e){const t=H(e);return t&&t.length>0}function H(e){let t=[];if(!e)return t;const n=Y(e);return t=t.concat(n),e.hasOwnProperty(c.default.ADAPTATION_SET)&&e[c.default.ADAPTATION_SET].length>0&&e[c.default.ADAPTATION_SET].forEach(e=>{const n=Y(e);t=t.concat(n)}),t}function Y(e){return e&&e.hasOwnProperty(c.default.CONTENT_PROTECTION)&&0!==e.ContentProtection.length?e[c.default.CONTENT_PROTECTION].map(e=>{const t=new l.default;return t.init(e),t}):[]}function q(e){let t=!1;return e&&e.hasOwnProperty("type")&&(t=e.type===c.default.DYNAMIC),t}function V(e){if(!e)return null;const t=e[c.default.FRAMERATE];if(!t)return null;if("string"==typeof t&&t.includes("/")){const[e,n]=t.split("/").map(e=>parseInt(e,10));if(!isNaN(e)&&!isNaN(n)&&0!==n)return e/n}return parseInt(t)}function K(e,t){return t&&t.hasOwnProperty(e)&&t[e].length?t[e].map(e=>{const t=new g.default;return t.init(e),t}):[]}function j(e,t){if(!t)return[];let n=function(e,t){if(!t||!t.length)return[];let n=t[0][e]||[];return 0===n.length?[]:1===t.length?n:n.filter(n=>t.slice(1).every(t=>t.hasOwnProperty(e)&&t[e].some(e=>e.schemeIdUri===n.schemeIdUri&&e.value===n.value)))}(e,t[c.default.REPRESENTATION]);return t.hasOwnProperty(e)&&t[e].length&&t[e].forEach(e=>{n.some(t=>t.schemeIdUri===e.schemeIdUri&&t.value===e.value)||n.push(e)}),n.map(e=>{const t=new g.default;return t.init(e),t})}function W(e){return K(c.default.ESSENTIAL_PROPERTY,e)}function z(e){return K(c.default.SUPPLEMENTAL_PROPERTY,e)}function $(e){return e&&e.hasOwnProperty(c.default.SEGMENT_SEQUENCE_PROPERTIES)&&e[c.default.SEGMENT_SEQUENCE_PROPERTIES].length?e[c.default.SEGMENT_SEQUENCE_PROPERTIES].map(e=>{const t=new v.default(e);return t.init(e),t}):[]}function Q(e,t,n,r,i,a){const o=new N.default;!function(e,t,n,r,i){if(e.index=i,e.adaptation=n,e.mediaInfo=r,t.hasOwnProperty(c.default.ID)&&(e.id=t.id),t.hasOwnProperty(c.default.CODECS)&&(e.codecs=t.codecs,e.codecFamily=D.default.getCodecFamily(e.codecs)),t.hasOwnProperty(c.default.DEPENDENCY_ID)){const n=t[c.default.DEPENDENCY_ID].toString().split(" ")[0];e.dependencyId=n,e.dependentRepresentation=new N.default,e.dependentRepresentation.id=n}t.hasOwnProperty(c.default.MIME_TYPE)&&(e.mimeType=t[c.default.MIME_TYPE]),t.hasOwnProperty(c.default.CODEC_PRIVATE_DATA)&&(e.codecPrivateData=t.codecPrivateData),t.hasOwnProperty(c.default.BANDWITH)&&(e.bandwidth=t.bandwidth,e.bitrateInKbit=t.bandwidth/1e3),t.hasOwnProperty(c.default.WIDTH)&&(e.width=t.width),t.hasOwnProperty(c.default.HEIGHT)&&(e.height=t.height),t.hasOwnProperty(c.default.SCAN_TYPE)&&(e.scanType=t.scanType),t.hasOwnProperty(c.default.FRAMERATE)&&(e.frameRate=V(t)),t.hasOwnProperty(c.default.QUALITY_RANKING)&&(e.qualityRanking=t[c.default.QUALITY_RANKING]),t.hasOwnProperty(c.default.MAX_PLAYOUT_RATE)&&(e.maxPlayoutRate=t.maxPlayoutRate),e.essentialProperties=W(t),e.supplementalProperties=z(t),e.segmentSequenceProperties=$(t),e.path=[n.period.index,n.index,i]}(o,t,n,e,a);const{segmentInfo:s,segmentInfoType:l}=function(e){let t,n;return e.hasOwnProperty(c.default.SEGMENT_BASE)?(t=e.SegmentBase,n=c.default.SEGMENT_BASE):e.hasOwnProperty(c.default.SEGMENT_LIST)?(t=e.SegmentList,n=t.hasOwnProperty(c.default.SEGMENT_TIMELINE)?c.default.SEGMENT_TIMELINE:c.default.SEGMENT_LIST):e.hasOwnProperty(c.default.SEGMENT_TEMPLATE)?(t=e.SegmentTemplate,n=t.hasOwnProperty(c.default.SEGMENT_TIMELINE)?c.default.SEGMENT_TIMELINE:c.default.SEGMENT_TEMPLATE):n=c.default.BASE_URL,{segmentInfo:t,segmentInfoType:n}}(t);return o.segmentInfoType=l,function(e,t,n,r,i,a){if(e){if(e.hasOwnProperty(c.default.INITIALIZATION_MINUS)&&(n.initialization=e.initialization.split("$Bandwidth$").join(i.bandwidth).split("$RepresentationID$").join(i.id)),e.hasOwnProperty(c.default.INITIALIZATION)){const t=e.Initialization;t.hasOwnProperty(c.default.SOURCE_URL)&&(n.initialization=t.sourceURL),t.hasOwnProperty(c.default.RANGE)&&(n.range=t.range)}else F(r)&&L(r)&&r.mimeType&&-1===r.mimeType.indexOf("application/mp4")&&(n.range=0);e.hasOwnProperty(c.default.TIMESCALE)&&(n.timescale=e.timescale),e.hasOwnProperty(c.default.DURATION)?n.segmentDuration=e.duration/n.timescale:t===c.default.SEGMENT_TIMELINE&&(n.segmentDuration=function(e){if(!e||!e.S)return NaN;let t=e.S[0],n=e.S[1];return t.hasOwnProperty("d")?t.d:n.t-t.t}(e.SegmentTimeline)/n.timescale,n.k=function(e){if(!e||!e.S)return 1;const t=e.S[0];return t.hasOwnProperty(c.default.K)?t.k:1}(e.SegmentTimeline)),e.hasOwnProperty(c.default.MEDIA)&&(n.media=e.media),e.hasOwnProperty(c.default.K)&&
2(n.k=e.k||1),e.hasOwnProperty(c.default.START_NUMBER)&&(n.startNumber=parseInt(e.startNumber)),e.hasOwnProperty(c.default.INDEX_RANGE)&&(n.indexRange=e.indexRange),e.hasOwnProperty(c.default.PRESENTATION_TIME_OFFSET)&&(n.presentationTimeOffset=e.presentationTimeOffset/n.timescale),e.hasOwnProperty(c.default.AVAILABILITY_TIME_OFFSET)?n.availabilityTimeOffset=e.availabilityTimeOffset:a&&void 0!==a.availabilityTimeOffset&&(n.availabilityTimeOffset=a.availabilityTimeOffset),e.hasOwnProperty(c.default.AVAILABILITY_TIME_COMPLETE)?n.availabilityTimeComplete="false"!==e.availabilityTimeComplete:a&&void 0!==a.availabilityTimeComplete&&(n.availabilityTimeComplete=a.availabilityTimeComplete),e.hasOwnProperty(c.default.END_NUMBER)&&(n.endNumber=e[c.default.END_NUMBER]),n.mseTimeOffset=function(e){const t=e.presentationTimeOffset;return e.adaptation.period.start-t}(n)}}(s,l,o,r,t,i),function(e){isNaN(e.width)||isNaN(e.height)||isNaN(e.frameRate)||(e.pixelsPerSecond=Math.max(1,e.width*e.height*e.frameRate),isNaN(e.bandwidth)||(e.bitsPerPixel=e.bandwidth/e.pixelsPerSecond))}(o),o}function X(e){return O(e,s.default.MUXED)?s.default.MUXED:O(e,s.default.AUDIO)?s.default.AUDIO:function(e){return O(e,s.default.VIDEO)}(e)?s.default.VIDEO:F(e)?s.default.TEXT:function(e){return O(e,s.default.IMAGE)}(e)?s.default.IMAGE:(t.warn("Unknown Preselection stream type"),null)}function Z(e,t){if(e&&e.hasOwnProperty(c.default.PRESELECTION_COMPONENTS)&&Array.isArray(t))return String(e.preselectionComponents).split(" ").map(e=>t.find(t=>t.id===e))}function J(e,t){if(!e||!e.hasOwnProperty(c.default.PRESELECTION_COMPONENTS)||!Array.isArray(t))return;const n=String(e.preselectionComponents).split(" ");return t.find(e=>e.id===n[0])}function ee(e,t){if(!e)throw new Error("Period cannot be null or undefined");let n=I.default.DEFAULT_ID+"_"+t;return e.hasOwnProperty(c.default.ID)&&e.id.toString().length>0&&"__proto__"!==e.id&&(n=e.id.toString()),n}function te(e,t,n){const r=[];let i;if(!e)return r;for(i=0;i<e.length;i++){const a=new m.default;if(a.timescale=1,a.representation=t,!e[i].hasOwnProperty(s.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");a.schemeIdUri=e[i].schemeIdUri,e[i].hasOwnProperty(c.default.TIMESCALE)&&(a.timescale=e[i].timescale),e[i].hasOwnProperty(c.default.VALUE)&&(a.value=e[i].value),r.push(a),a.period=n}return r}function ne(e){const t=[],n=e.BaseURL||[e.baseUri];let r=!1;return n.some(n=>{if(n){const a=new i.default;let o=n.__text||n;return w.isRelative(o)&&(r=!0,e.baseUri&&(o=w.resolve(o,e.baseUri))),a.url=o,n.hasOwnProperty(c.default.SERVICE_LOCATION)&&n.serviceLocation.length?a.serviceLocation=n.serviceLocation:a.serviceLocation=o,n.hasOwnProperty(c.default.DVB_PRIORITY)&&(a.dvbPriority=n[c.default.DVB_PRIORITY]),n.hasOwnProperty(c.default.DVB_WEIGHT)&&(a.dvbWeight=n[c.default.DVB_WEIGHT]),n.hasOwnProperty(c.default.AVAILABILITY_TIME_OFFSET)&&(a.availabilityTimeOffset=n[c.default.AVAILABILITY_TIME_OFFSET]),n.hasOwnProperty(c.default.AVAILABILITY_TIME_COMPLETE)&&(a.availabilityTimeComplete="false"!==n[c.default.AVAILABILITY_TIME_COMPLETE]),t.push(a),r}}),t}function re(e){const t=new u.default;return t.serverUrl=e.__text,e.hasOwnProperty(c.default.DEFAULT_SERVICE_LOCATION)&&(t.defaultServiceLocation=e[c.default.DEFAULT_SERVICE_LOCATION],t.defaultServiceLocationArray=t.defaultServiceLocation.split(" ")),e.hasOwnProperty(c.default.QUERY_BEFORE_START)&&(t.queryBeforeStart="true"===e[c.default.QUERY_BEFORE_START].toLowerCase()),e.hasOwnProperty(c.default.CLIENT_REQUIREMENT)&&(t.clientRequirement="false"!==e[c.default.CLIENT_REQUIREMENT].toLowerCase()),t}function ie(e){const t=new o.default,n=e.schemeIdUri||e[c.default.CMCD_PARAMETERS]?.schemeIdUri,r=[s.default.CTA_5004_2023_SCHEME,s.default.CTA_5004_2025_SCHEME].includes(n);return e.hasOwnProperty(c.default.CMCD_PARAMETERS)&&r&&(t.cmcdParameters=new a.default,t.cmcdParameters.init(e[c.default.CMCD_PARAMETERS])),e.hasOwnProperty(c.default.SERVICE_LOCATIONS)&&""!==e[c.default.SERVICE_LOCATIONS]&&(t.serviceLocations=e[c.default.SERVICE_LOCATIONS],t.serviceLocationsArray=t.serviceLocations.toString().split(" ")),e.hasOwnProperty(c.default.ADAPTATION_SETS)&&""!==e[c.default.ADAPTATION_SETS]&&(t.adaptationSets=e[c.default.ADAPTATION_SETS],t.adaptationSetsArray=t.adaptationSets.toString().split(" ")),t}return e={getAccessibilityForAdaptation:function(e){return e&&e.hasOwnProperty(c.default.ACCESSIBILITY)&&e[c.default.ACCESSIBILITY].length?e[c.default.ACCESSIBILITY].map(e=>{const t=new g.default;return t.init(e),t}):[]},getAdaptationForId:function(e,t,n){const r=x(t,n);let i,a;for(i=0,a=r.length;i<a;i++)if(r[i].hasOwnProperty(c.default.ID)&&r[i].id===e)return r[i];return null},getAdaptationForIndex:function(e,t,n){const r=x(t,n);return r.length>0&&P(e)?r[e]:null},getAdaptationsForPeriod:function(e){const t=e&&P(e.index)?e.mpd.manifest.Period[e.index]:null,n=[];let i,a,o;if(t&&t.AdaptationSet)for(o=0;o<t.AdaptationSet.length;o++)a=t.AdaptationSet[o],i=new r.default,a.hasOwnProperty(c.default.ID)&&(i.id=a.id),i.index=o,i.period=e,i.type=X(a),n.push(i);return n},getAdaptationsForType:function(e,t,n){const r=x(e,t);let i,a;const o=[];for(i=0,a=r.length;i<a;i++)O(r[i],n)&&o.push(U(r[i]));return o},getAudioChannelConfigurationForAdaptation:function(e){return e&&e.hasOwnProperty(c.default.AUDIO_CHANNEL_CONFIGURATION)&&e[c.default.AUDIO_CHANNEL_CONFIGURATION].length?e[c.default.AUDIO_CHANNEL_CONFIGURATION].map(e=>{const t=new g.default;return t.init(e),t}):[]},getAudioChannelConfigurationForRepresentation:function(e){return e&&e.hasOwnProperty(c.default.AUDIO_CHANNEL_CONFIGURATION)&&e[c.default.AUDIO_CHANNEL_CONFIGURATION].length?e[c.default.AUDIO_CHANNEL_CONFIGURATION].map(e=>{const t=new g.default;return t.init(e),t}):[]},getAvailabilityStartTime:function(e){return e&&e.hasOwnProperty(c.default.AVAILABILITY_START_TIME)&&null!==e.availabilityStartTime?e.availabilityStartTime.getTime():null},getBandwidth:function(e){return e&&e.bandwidth?e.bandwidth:NaN},getBaseURLsFromElement:ne,getBitrateListForAdaptation:function(e){const t=U(e);return(t&&t.Representation?t.Representation:[]).map(e=>({bandwidth:e.bandwidth,width:e.width||0,height:e.height||0,scanType:e.scanType||null,id:e.id||null}))},getCodec:k,getCodecForPreselection:function(e,n,r){let i=null;if(e&&n){let a=k(J(e,n),0,r);if(e.hasOwnProperty(c.default.CODECS)){let n=e.codecs;i=a.replace(/(codecs=")[^"]*(")/,`$1${n}$2`),t.info("Preselection has own codecs-attribute: replacing in MainAdaptationSet (was: "+a+"), new Preselection codec is: "+i)}else i=a}return i},getCombinedEssentialPropertiesForAdaptationSet:function(e){return j(c.default.ESSENTIAL_PROPERTY,e)},getCombinedSupplementalPropertiesForAdaptationSet:function(e){return j(c.default.SUPPLEMENTAL_PROPERTY,e)},getContentProtectionByAdaptation:function(e){return Y(e)},getContentProtectionByManifest:function(e){let t=[];if(!e)return t;const n=Y(e);return t=t.concat(n),e.hasOwnProperty(c.default.PERIOD)&&e[c.default.PERIOD].length>
20&&e[c.default.PERIOD].forEach(e=>{const n=H(e);t=t.concat(n)}),t},getContentProtectionByPeriod:H,getContentSteering:function(e){if(e&&e.hasOwnProperty(c.default.CONTENT_STEERING))return re(e[c.default.CONTENT_STEERING][0])},getDuration:function(e){let t;return t=e&&e.hasOwnProperty(c.default.MEDIA_PRESENTATION_DURATION)?e.mediaPresentationDuration:e&&"dynamic"===e.type?Number.POSITIVE_INFINITY:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE,t},getEssentialProperties:W,getEventStreamForAdaptationSet:function(e,t,n){let r,i,a;return e&&e.Period&&t&&t.period&&P(t.period.index)&&(i=e.Period[t.period.index],i&&i.AdaptationSet&&P(t.index)&&(a=i.AdaptationSet[t.index],a&&(r=a.InbandEventStream))),te(r,null,n)},getEventStreamForRepresentation:function(e,t,n){let r,i,a,o;return e&&e.Period&&t&&t.adaptation&&t.adaptation.period&&P(t.adaptation.period.index)&&(i=e.Period[t.adaptation.period.index],i&&i.AdaptationSet&&P(t.adaptation.index)&&(a=i.AdaptationSet[t.adaptation.index],a&&a.Representation&&P(t.index)&&(o=a.Representation[t.index],o&&(r=o.InbandEventStream)))),te(r,t,n)},getEventsForPeriod:function(e){const t=e&&e.mpd&&e.mpd.manifest?e.mpd.manifest:null,n=t?t.Period:null,r=n&&e&&P(e.index)?n[e.index].EventStream:null,i=[];let a,o;if(r)for(a=0;a<r.length;a++){const t=new m.default;if(t.period=e,t.timescale=1,!r[a].hasOwnProperty(s.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");for(t.schemeIdUri=r[a][s.default.SCHEME_ID_URI],r[a].hasOwnProperty(c.default.TIMESCALE)&&(t.timescale=r[a][c.default.TIMESCALE]),r[a].hasOwnProperty(c.default.VALUE)&&(t.value=r[a][c.default.VALUE]),r[a].hasOwnProperty(c.default.PRESENTATION_TIME_OFFSET)&&(t.presentationTimeOffset=r[a][c.default.PRESENTATION_TIME_OFFSET]),o=0;r[a].Event&&o<r[a].Event.length;o++){const n=r[a].Event[o],s=new p.default;s.presentationTime=0,s.eventStream=t,n.hasOwnProperty(c.default.PRESENTATION_TIME)&&(s.presentationTime=n.presentationTime);const l=t.presentationTimeOffset?t.presentationTimeOffset/t.timescale:0;s.calculatedPresentationTime=s.presentationTime/t.timescale+e.start-l,n.hasOwnProperty(c.default.DURATION)&&(s.duration=n.duration/t.timescale),n.hasOwnProperty(c.default.ID)?s.id=parseInt(n.id):s.id=null,n.Signal&&n.Signal.Binary&&n.Signal.Binary.__text?s.messageData=E.decodeArray(n.Signal.Binary.__text.toString()):s.messageData=n.messageData||n.__cdata||n.__text,i.push(s)}}return i},getFramerate:V,getId:function(e){return e&&e[c.default.ID]||null},getIndexForAdaptation:function(e,t,n){if(!e)return-1;const r=x(t,n);for(let t=0;t<r.length;t++)if((0,y.default)(M).getInstance().areEqual(r[t],e))return t;return-1},getIsDynamic:q,getIsFragmented:L,getIsText:F,getIsTypeOf:O,getLabelsForAdaptation:function(e){if(!e||!e.Label)return[];const t=[];for(let n=0;n<e.Label.length;n++)t.push({lang:e.Label[n].lang,text:e.Label[n].__text||e.Label[n]});return t},getLanguageForAdaptation:function(e){let t="";return e&&e.hasOwnProperty(c.default.LANG)&&(t=e.lang),t},getLocation:function(e){return e&&e.hasOwnProperty(c.default.LOCATION)?e[c.default.LOCATION].map(e=>{const t=e.__text||e,n=e.hasOwnProperty(c.default.SERVICE_LOCATION)?e[c.default.SERVICE_LOCATION]:null;return new _.default(t,n)}):[]},getMainAdaptationSetForPreselection:J,getCommonRepresentationForPreselection:function(e,t){if(!e||!Array.isArray(t))return;const n=J(e,t);return n?n.Representation[0]:void 0},getManifestUpdatePeriod:function(e,t=0){let n=NaN;return e&&e.hasOwnProperty(c.default.MINIMUM_UPDATE_PERIOD)&&(n=e.minimumUpdatePeriod),isNaN(n)?n:Math.max(n-t,1)},getMimeType:function(e){return e&&e.Representation&&e.Representation.length>0?e.Representation[0].mimeType:null},getMpd:function(e){const t=new T.default;return e&&(t.manifest=e,e.hasOwnProperty(c.default.AVAILABILITY_START_TIME)?t.availabilityStartTime=new Date(e.availabilityStartTime.getTime()):e.loadedTime&&(t.availabilityStartTime=new Date(e.loadedTime.getTime())),e.hasOwnProperty(c.default.AVAILABILITY_END_TIME)&&(t.availabilityEndTime=new Date(e.availabilityEndTime.getTime())),e.hasOwnProperty(c.default.MINIMUM_UPDATE_PERIOD)&&(t.minimumUpdatePeriod=e.minimumUpdatePeriod),e.hasOwnProperty(c.default.MEDIA_PRESENTATION_DURATION)&&(t.mediaPresentationDuration=e.mediaPresentationDuration),e.hasOwnProperty(c.default.SUGGESTED_PRESENTATION_DELAY)&&(t.suggestedPresentationDelay=e.suggestedPresentationDelay),e.hasOwnProperty(c.default.TIMESHIFT_BUFFER_DEPTH)&&(t.timeShiftBufferDepth=e.timeShiftBufferDepth),e.hasOwnProperty(c.default.MAX_SEGMENT_DURATION)&&(t.maxSegmentDuration=e.maxSegmentDuration),e.hasOwnProperty(c.default.PUBLISH_TIME)&&(t.publishTime=new Date(e.publishTime))),t},getPatchLocation:function(e){return e&&e.hasOwnProperty(c.default.PATCH_LOCATION)?e[c.default.PATCH_LOCATION].map(e=>{const t=e.__text||e,n=e.hasOwnProperty(c.default.SERVICE_LOCATION)?e[c.default.SERVICE_LOCATION]:null;let r=e.hasOwnProperty(c.default.TTL)?1e3*parseFloat(e[c.default.TTL]):NaN;return new S.default(t,n,r)}):[]},getPreselectionIsTypeOf:function(e,t,n){if(!e)throw new Error("preselection is not defined");if(!t)throw new Error("adaptations is not defined");if(!n)throw new Error("type is not defined");const r=J(e,t);return!!r&&O(r,n)},getPreselectionsForPeriod:function(e){const n=e&&P(e.index)?e.mpd.manifest.Period[e.index]:null,r=[];let i,a,o;if(n&&n.Preselection)for(o=0;o<n.Preselection.length;o++){a=n.Preselection[o],i=new A.default;const s=Z(a,n.AdaptationSet);s.every(e=>!!e)&&1===s.length?(a.hasOwnProperty(c.default.ID)&&(i.id=a.id),i.index=o,i.period=e,a.hasOwnProperty(c.default.TAG)&&(i.tag=a.tag),a.hasOwnProperty(c.default.PRESELECTION_COMPONENTS)?i.preselectionComponents=s:t.warn("Preselection (index: "+i.index+") missing component(s)"),a.hasOwnProperty(c.default.ORDER)&&(i.order=a.order),i.type=X(s[0]),r.push(i)):t.warn("Preselection removed because we don't support multi-representation preselections or not all c
2omponents available.")}return r},getProducerReferenceTimesForAdaptation:function(e){const t=e&&e.hasOwnProperty(c.default.PRODUCER_REFERENCE_TIME)?e[c.default.PRODUCER_REFERENCE_TIME]:[];(e&&e.hasOwnProperty(c.default.REPRESENTATION)?e[c.default.REPRESENTATION]:[]).forEach(e=>{e.hasOwnProperty(c.default.PRODUCER_REFERENCE_TIME)&&t.push(...e[c.default.PRODUCER_REFERENCE_TIME])});const n=[];return t.forEach(e=>{const t=new R.default;e.hasOwnProperty(c.default.ID)&&(t[c.default.ID]=parseInt(e[c.default.ID]),e.hasOwnProperty(c.default.WALL_CLOCK_TIME)&&(t[c.default.WALL_CLOCK_TIME]=e[c.default.WALL_CLOCK_TIME],e.hasOwnProperty(c.default.PRESENTATION_TIME)&&(t[c.default.PRESENTATION_TIME]=e[c.default.PRESENTATION_TIME],e.hasOwnProperty(c.default.INBAND)&&(t[c.default.INBAND]="false"!==e[c.default.INBAND]),e.hasOwnProperty(c.default.TYPE)&&(t[c.default.TYPE]=e[c.default.TYPE]),n.push(t))))}),n},getPublishTime:function(e){return e&&e.hasOwnProperty(c.default.PUBLISH_TIME)?new Date(e[c.default.PUBLISH_TIME]):null},getRealPeriodForIndex:function(e,t){const n=B(t);return n.length>0&&P(e)?n[e]:null},getRealPeriods:B,getRegularPeriods:function(e){const r=!!e&&q(e.manifest),i=[];let a,o,l=null,u=null,f=null,g=null;for(o=0,a=e&&e.manifest&&e.manifest.Period?e.manifest.Period.length:0;o<a;o++)u=e.manifest.Period[o],u.hasOwnProperty(c.default.START)?(g=new I.default,g.start=u.start):null!==l&&l.hasOwnProperty(c.default.DURATION)&&null!==f?(g=new I.default,g.start=parseFloat((f.start+f.duration).toFixed(5))):0!==o||r||(g=new I.default,g.start=0),null!==f&&isNaN(f.duration)&&(null!==g?f.duration=parseFloat((g.start-f.start).toFixed(5)):t.warn("First period duration could not be calculated because lack of start and duration period properties. This will cause timing issues during playback")),null!==g&&(g.id=ee(u,o),g.index=o,g.mpd=e,g.isEncrypted=G(u),u.hasOwnProperty(c.default.DURATION)&&(g.duration=u.duration),f&&(f.nextPeriodId=g.id),i.push(g),l=u,f=g),u=null,g=null;return 0===i.length||null!==f&&isNaN(f.duration)&&(f.duration=parseFloat((function(e){!function(){if(!n||!n.hasOwnProperty("error"))throw new Error(s.default.MISSING_CONFIG_ERROR)}();const t=q(e.mpd.manifest);let r;return e.mpd.manifest.mediaPresentationDuration?r=e.mpd.manifest.mediaPresentationDuration:e.duration?r=e.duration:t?r=Number.POSITIVE_INFINITY:n.error(new d.default(h.default.MANIFEST_ERROR_ID_PARSE_CODE,"Must have @mediaPresentationDuration on MPD or an explicit @duration on the last period.",e)),r}(f)-f.start).toFixed(5))),i},getRepresentationCount:function(e){return e&&e.Representation?e.Representation.length:0},getRepresentationFor:function(e,t){return t&&t.Representation&&t.Representation.length>0&&P(e)?t.Representation[e]:null},getRepresentationSortFunction:function(){return(e,t)=>e.bandwidth-t.bandwidth},getRepresentationsForAdaptation:function(e,t){const n=[],r=function(e){if(e&&e.period&&P(e.period.index)){const t=e.period.mpd.manifest.Period[e.period.index];if(t&&t.AdaptationSet&&P(e.index))return U(t.AdaptationSet[e.index])}}(e);let i;if(r&&r.Representation){if(e&&e.period&&P(e.period.index)){const t=ne(e.period.mpd.manifest);t&&(i=t[0])}for(let a=0,o=r.Representation.length;a<o;++a){const o=Q(t,r.Representation[a],e,r,i,a);n.push(o)}}return n},getRolesForAdaptation:function(e){return e&&e.hasOwnProperty(c.default.ROLE)&&e[c.default.ROLE].length?e[c.default.ROLE].map(e=>{e.schemeIdUri===s.default.DASH_ROLE_SCHEME_ID&&"Main"===e.value&&(e.value=c.default.MAIN);const t=new g.default;return t.init(e),t}):[]},getSegmentAlignment:function(e){return!(!e||!e.hasOwnProperty(c.default.SEGMENT_ALIGNMENT))&&"true"===e[c.default.SEGMENT_ALIGNMENT]},getSegmentSequencePropertiesForAdaptationSet:function(e){const t=[];return e?(t.push(...$(e)),e.Representation&&e.Representation.length&&e.Representation.forEach(e=>{t.push(...$(e))}),t):t},getSelectionPriority:function(e){try{const t=e&&void 0!==e.selectionPriority?parseInt(e.selectionPriority):1;return isNaN(t)?1:t}catch(e){return 1}},getServiceDescriptions:function(e){const t=[];if(e&&e.hasOwnProperty(c.default.SERVICE_DESCRIPTION))for(const n of e.ServiceDescription){let e=null,r=null,i=null,a=null,o=null,s=null,l=null,u=null;for(const t in n)if(n.hasOwnProperty(t))if(t===c.default.ID)e=n[t];
2else if(t===c.default.SERVICE_DESCRIPTION_SCOPE)r=n[t].schemeIdUri;else if(t===c.default.SERVICE_DESCRIPTION_LATENCY)i={target:parseInt(n[t].target),max:parseInt(n[t].max),min:parseInt(n[t].min),referenceId:parseInt(n[t].referenceId)};else if(t===c.default.SERVICE_DESCRIPTION_PLAYBACK_RATE)a={max:parseFloat(n[t].max),min:parseFloat(n[t].min)};else if(t===c.default.SERVICE_DESCRIPTION_OPERATING_QUALITY)o={mediaType:n[t].mediaType,max:parseInt(n[t].max),min:parseInt(n[t].min),target:parseInt(n[t].target),type:n[t].type,maxQualityDifference:parseInt(n[t].maxQualityDifference)};else if(t===c.default.SERVICE_DESCRIPTION_OPERATING_BANDWIDTH)s={mediaType:n[t].mediaType,max:parseInt(n[t].max),min:parseInt(n[t].min),target:parseInt(n[t].target)};else if(t===c.default.CONTENT_STEERING){let e=n[t];e=Array.isArray(e)?e.at(e.length-1):e,l=re(e)}else t===c.default.CLIENT_DATA_REPORTING&&(u=ie(n[t]));t.push({id:e,schemeIdUri:r,latency:i,playbackRate:a,operatingQuality:o,operatingBandwidth:s,contentSteering:l,clientDataReporting:u})}return t},getSubSegmentAlignment:function(e){return!(!e||!e.hasOwnProperty(c.default.SUB_SEGMENT_ALIGNMENT))&&"true"===e[c.default.SUB_SEGMENT_ALIGNMENT]},getSuggestedPresentationDelay:function(e){return e&&e.hasOwnProperty(c.default.SUGGESTED_PRESENTATION_DELAY)?e.suggestedPresentationDelay:null},getSupplementalProperties:z,getUTCTimingSources:function(e){const t=q(e),n=!!e&&e.hasOwnProperty(c.default.AVAILABILITY_START_TIME),r=e?e.UTCTiming:null,i=[];return(t||n)&&r&&r.forEach(function(e){const t=new b.default;e.hasOwnProperty(s.default.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty(c.default.VALUE)&&(t.value=e.value.toString(),i.push(t)))}),i},getViewpointForAdaptation:function(e){return e&&e.hasOwnProperty(c.default.VIEWPOINT)&&e[c.default.VIEWPOINT].length?e[c.default.VIEWPOINT].map(e=>{const t=new g.default;return t.init(e),t}):[]},hasProfile:function(e,t){let n=!1;return e&&e.profiles&&e.profiles.length>0&&(n=-1!==e.profiles.indexOf(t)),n},isPeriodEncrypted:G,setConfig:function(e){e&&(e.errHandler&&(n=e.errHandler),e.BASE64&&(E=e.BASE64))}},t=(0,f.default)(M).getInstance().getLogger(e),e}M.__dashjs_factory_name="DashManifestModel",t.default=E.default.getSingletonFactory(M)},8062:function(e,t,n){n.r(t),t.default=class{constructor(){this.period=null,this.index=-1,this.id=null,this.type=null}}},9415:function(e,t,n){n.r(t);class r{constructor(e,t,n,r){this.url=e||"",this.serviceLocation=t||e||"",this.dvbPriority=n||1,this.dvbWeight=r||1,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0,this.queryParams={}}}r.DEFAULT_DVB_PRIORITY=1,r.DEFAULT_DVB_WEIGHT=1,t.default=r},9578:function(e,t,n){n.r(t);var r=n(1036),i=n(5212);class a extends r.default{constructor(){super(),this.version=null,this.sessionID=null,this.contentID=null,this.mode=null,this.keys=null,this.includeInRequests=null}init(e){super.init(e),e&&(this.version=e.version?parseInt(e.version):null,this.sessionID=e.sessionID,this.contentID=e.contentID,this.mode=e.mode??"query",this.keys=e.keys?e.keys.split(" "):null,this.includeInRequests=e.includeInRequests?e.includeInRequests.split(" "):[i.default.CMCD_DEFAULT_INCLUDE_IN_REQUESTS],this.schemeIdUri=e.schemeIdUri)}}t.default=a},4770:function(e,t,n){n.r(t),t.default=class{constructor(){this.adaptationSets=null,this.adaptationSetsArray=[],this.cmcdParameters=null,this.serviceLocations=null,this.serviceLocationsArray=[]}}},5915:function(e,t,n){n.r(t);var r=n(1349),i=n(1036),a=n(8854);class o extends i.default{constructor(){super(),this.ref=null,this.refId=null,this.robustness=null,this.keyId=null,this.cencDefaultKid=null,this.pssh=null,this.pro=null,this.laUrl=null,this.certUrls=[]}init(e){if(super.init(e),e){this.ref=e.hasOwnProperty(a.default.REF)?e[a.default.REF]:null,this.refId=e.hasOwnProperty(a.default.REF_ID)?e[a.default.REF_ID]:null,this.robustness=e.hasOwnProperty(a.default.ROBUSTNESS)?e[a.default.ROBUSTNESS]:null,this.cencDefaultKid=e.hasOwnProperty(a.default.CENC_DEFAULT_KID)?e[a.default.CENC_DEFAULT_KID]:null,this.pssh=e.hasOwnProperty(a.default.PSSH)?e[a.default.PSSH]:null,this.pro=e.hasOwnProperty(a.default.PRO)?e[a.default.PRO]:null,this.laUrl=e.hasOwnProperty(a.default.LA_URL)?e[a.default.LA_URL]:e.hasOwnProperty(a.default.LA_URL_LOWER_CASE)?e[a.default.LA_URL_LOWER_CASE]:null;const t=Object.keys(e).find(e=>e.toLowerCase()===a.default.CERT_URL.toLowerCase()),n=t?e[t]:null;this.certUrls=r.default.normalizeCertUrls(n)}}mergeAttributesFromReference(e){if(["schemeIdUri","value","id","robustness","cencDefaultKid","pro","pssh","laUrl"].forEach(t=>{null===this[t]&&(this[t]=e[t])}),e.certUrls&&e.certUrls.length){const t=new Set(this.certUrls.map(e=>`${e.url}||${e.certType||""}`));
2e.certUrls.forEach(e=>{const n=`${e.url}||${e.certType||""}`;t.has(n)||this.certUrls.push({url:e.url,certType:e.certType||null})})}}}t.default=o},6455:function(e,t,n){n.r(t),t.default=class{constructor(){this.defaultServiceLocation=null,this.defaultServiceLocationArray=[],this.queryBeforeStart=!1,this.serverUrl=null,this.clientRequirement=!0}}},1036:function(e,t,n){n.r(t);var r=n(8854);t.default=class{constructor(){this.schemeIdUri=null,this.value=null,this.id=null}init(e){e&&(this.schemeIdUri=e.schemeIdUri?e.schemeIdUri:null,this.value=null!==e.value&&void 0!==e.value?e.value.toString():null,this.id=e.id?e.id:null,e[r.default.DVB_URL]&&(this.dvbUrl=e[r.default.DVB_URL]),e[r.default.DVB_MIMETYPE]&&(this.dvbMimeType=e[r.default.DVB_MIMETYPE]),e[r.default.DVB_FONTFAMILY]&&(this.dvbFontFamily=e[r.default.DVB_FONTFAMILY]))}inArray(e){return!!e&&e.some(e=>this.schemeIdUri===e.schemeIdUri&&(this.value?this.value.toString().match(e.value):"".match(e.value)))}}},1465:function(e,t,n){n.r(t),t.default=class{constructor(){this.type="",this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData="",this.eventStream=null,this.presentationTimeDelta=NaN,this.parsedMessageData=null}}},7153:function(e,t,n){n.r(t),t.default=class{constructor(){this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri="",this.presentationTimeOffset=0}}},5274:function(e,t,n){n.r(t),t.default=class{constructor(){this.availabilityEndTime=Number.POSITIVE_INFINITY,this.availabilityStartTime=null,this.manifest=null,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.mediaPresentationDuration=NaN,this.minimumUpdatePeriod=NaN,this.publishTime=null,this.suggestedPresentationDelay=0,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY}}},6517:function(e,t,n){n.r(t),t.default=class{constructor(e,t){this.url=e||"",this.serviceLocation=t||null,this.queryParams={}}}},4740:function(e,t,n){n.r(t),t.default=class{constructor(e,t,n){this.url=e||"",this.serviceLocation=t||null,this.ttl=n||NaN,this.queryParams={}}}},7408:function(e,t,n){n.r(t);class r{constructor(){this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null,this.nextPeriodId=null,this.isEncrypted=!1}}r.DEFAULT_ID="defaultId",t.default=r},2436:function(e,t,n){n.r(t),t.default=class{constructor(){this.period=null,this.index=-1,this.id=1,this.type=null,this.tag=null,this.order="undefined",this.preselectionComponents=[]}}},2655:function(e,t,n){n.r(t),t.default=class{constructor(){this.id=null,this.inband=!1,this.type="encoder",this.applicationScheme=null,this.wallClockTime=null,this.presentationTime=NaN,this.UTCTiming=null}}},5876:function(e,t,n){n.r(t);var r=n(8854);t.default=class{constructor(){this.absoluteIndex=NaN,this.adaptation=null,this.availabilityTimeComplete=!0,this.availabilityTimeOffset=0,this.bandwidth=NaN,this.bitrateInKbit=NaN,this.bitsPerPixel=NaN,this.codecFamily=null,this.co
2decPrivateData=null,this.codecs=null,this.dependencyId=null,this.dependentRepresentation=null,this.endNumber=null,this.essentialProperties=[],this.fragmentDuration=null,this.frameRate=null,this.height=NaN,this.id=null,this.indexRange=null,this.initialization=null,this.k=1,this.maxPlayoutRate=NaN,this.mediaFinishedInformation={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN},this.mediaInfo=null,this.mimeType=null,this.mseTimeOffset=NaN,this.pixelsPerSecond=NaN,this.presentationTimeOffset=0,this.qualityRanking=NaN,this.range=null,this.scanType=null,this.segments=null,this.segmentDuration=NaN,this.segmentInfoType=null,this.segmentSequenceProperties=[],this.supplementalProperties=[],this.startNumber=1,this.timescale=1,this.width=NaN}hasInitialization(){return null!==this.initialization||null!==this.range}hasSegments(){return this.segmentInfoType!==r.default.BASE_URL&&this.segmentInfoType!==r.default.SEGMENT_BASE&&!this.indexRange}isBootstrapRepresentation(){return!(!this.segmentSequenceProperties||0===this.segmentSequenceProperties.length)&&this.segmentSequenceProperties.some(e=>e.isBootstrapConfiguration())}}},7356:function(e,t,n){n.r(t),t.default=class{constructor(){this.cadence=1,this.sapType=0,this.event=!0,this.alignment=null}init(e){e&&(this.cadence=void 0===e.cadence||isNaN(e.cadence)?1:e.cadence,this.sapType=void 0===e.sapType||isNaN(e.sapType)?0:e.sapType,this.event=void 0===e.event||e.event,this.alignment=void 0!==e.alignment?e.alignment:null)}isBootstrapConfiguration(){return 1===this.cadence&&(0===this.sapType||1===this.sapType)}}},5717:function(e,t,n){n.r(t),t.default=class{constructor(){this.schemeIdUri="",this.value=""}}},9839:function(e,t,n){n.r(t),n.d(t,{default:function(){return eo}});var r=n(138),i=n(4246),o={TCP_CONNECTION:"TcpList",HTTP_REQUEST:"HttpList",TRACK_SWITCH:"RepSwitchList",BUFFER_LEVEL:"BufferLevel",BUFFER_LOADED:"bufferLoaded",ABANDON_LOAD:"abandonload",ALLOW_LOAD:"allowload",BUFFER_EMPTY:"bufferStalled",BUFFER_STATE:"BufferState",DVR_INFO:"DVRInfo",DROPPED_FRAMES:"DroppedFrames",SCHEDULING_INFO:"SchedulingInfo",REQUESTS_QUEUE:"RequestsQueue",MANIFEST_UPDATE:"ManifestUpdate",MANIFEST_UPDATE_STREAM_INFO:"ManifestUpdatePeriodInfo",MANIFEST_UPDATE_TRACK_INFO:"ManifestUpdateRepresentationInfo",PLAY_LIST:"PlayList",DVB_ERRORS:"DVBErrors",HTTP_REQUEST_DVB_REPORTING_TYPE:"DVBReporting"},l=n(649),u=n(8261);function c(e){e=e||{};const t=this.context,n=e.dashMetrics;let r,a,s;return r={getSwitchRequest:function(e){try{const r=(0,i.default)(t).create();r.rule=this.getClassName();const s=e.getMediaInfo(),l=e.getMediaType(),u=n.getCurrentBufferState(l),c=e.getScheduleController(),d=e.getAbrController(),f=e.getStreamInfo(),g=f?f.id:null,h=f&&f.manifestInfo?f.manifestInfo.isDynamic:null,p=e.getThroughputController(),m=p.getSafeAverageThroughput(l),E=p.getAverageLatency(l);return isNaN(m)||!u||d.getAbandonmentStateFor(g,l)===o.ALLOW_LOAD&&(u.state===o.BUFFER_LOADED||h)&&(r.representation=d.getOptimalRepresentationForBitrate(s,m,!0),r.priority=a.get().streaming.abr.rules.throughputRule.priority,r.reason={throughput:m,latency:E,message:`[ThroughputRule]: Switching to Representation with bitrate ${r.representation?r.representation.bitrateInKbit:"n/a"} kbit/s. Throughput: ${m}`},c.setTimeToLoadDelay(0)),r}catch(e){return s.error(e),(0,i.default)(t).create()}},reset:function(){}},s=(0,l.default)(t).getInstance().getLogger(r),a=(0,u.default)(t).getInstance(),r}c.__dashjs_factory_name="ThroughputRule";var d=r.default.getClassFactory(c),f=n(8850),g=n(3621),h=n(5212),p=n(1191);function m(e){e=e||{};const t=this.context,n=(0,f.default)(t).getInstance(),r=e.dashMetrics,a=(0,u.default)(t).getInstance();let s,c,d;function m(){const e=a.get().streaming.abr.rules.insufficientBufferRule.parameters.segmentIgnoreCount;d={},d[h.default.VIDEO]={ignoreCount:e},d[h.default.AUDIO]={ignoreCount:e},d[h.default.ENHANCEMENT]={ignoreCount:e}}function E(){m()}function T(e){isNaN(e.startTime)||e.mediaType!==h.default.AUDIO&&e.mediaType!==h.default.VIDEO||d[e.mediaType].ignoreCount>0&&d[e.mediaType].ignoreCount--}return s={getSwitchRequest:function(e){const n=(0,i.default)(t).create();if(n.rule=this.getClassName(),!e||!e.hasOwnProperty("getMediaType"))return n;const s=e.getMediaType(),l=r.getCurrentBufferState(s),u=e.getRepresentation().fragmentDuration;if(!function(e,t,n){return!e.getLowLatencyModeEnabled()&&d[t].ignoreCount<=0&&n}(e.getScheduleController().getPlaybackController(),s,u))return n;const f=e.getMediaInfo(),g=e.getAbrController();if(l&&l.state===o.BUFFER_EMPTY)c.debug("["+s+"] Switch to index 0; buffer is empty."),n.representation=g.getOptimalRepresentationForBitrate(f,0,!0),n.reason={message:"[InsufficientBufferRule]: Switching to lowest Representation because buffer is empty"};else{const t=e.getThroughputController(),i=r.getCurrentBufferLevel(s),o=t.getAverageThroughput(s,null,NaN)*a.get().streaming.abr.rules.insufficientBufferRule.parameters.throughputSafetyFactor*i/u;if(isNaN(o)||o<=0)return n;n.representation=g.getOptimalRepresentationForBitrate(f,o,!0),n.priority=a.get().streaming.abr.rules.insufficientBufferRule.priority,n.reason={message:"[InsufficientBufferRule]: Limiting maximum bitrate to avoid a buffer underrun.",bitrate:o}}return n},reset:function(){m(),n.off(p.default.PLAYBACK_SEEKING,E,s),n.off(g.default.BYTES_APPENDED_END_FRAGMENT,T,s)}},c=(0,l.default)(t).getInstance().getLogger(s),m(),n.on(p.default.PLAYBACK_SEEKING,E,s),n.on(g.default.BYTES_APPENDED_END_FRAGMENT,T,s),s}m.__dashjs_factory_name="InsufficientBufferRule";var E=r.default.getClassFactory(m);function T(e){const t=(e=e||{}).mediaPlayerModel,n=e.dashMetrics,r=this.context,a=(0,u.default)(r).getInstance();let o,s,c;function d(){c={}}return o={shouldAbandon:function(e){const o=(0,i.default)(r).create();o.rule=this.getClassName();try{if(!e)return o;const r=e.getCurrentRequest();if(!isNaN(r.index)){if(null===r.firstByteDate||c.hasOwnProperty(r.index))return o;const i=t.getBufferTimeDefault(),s=e.getMediaType();if(n.getCurrentBufferLevel(s)>i)return o;const l=Date.now()-r.firstByteDate.getTime();if(r.traces.length>=a.get().streaming.abr.rules.abandonRequestsRule.parameters.minThroughputSamplesThreshold&&l>a.get().streaming.abr.rules.abandonRequestsRule.parameters.minSegmentDownloadTimeThresholdInMs&&r.bytesLoaded<r.bytesTotal)return function(e,t,n){const r=e.getMediaInfo(),i=e.getMediaType(),o=t.traces.reduce((e,t)=>
2e+t.b[0],0)-t.traces[0].b[0],s=Math.max(t.traces.reduce((e,t)=>e+t.d,0)-t.traces[0].d,1),l=Math.round(8*o/s),u=Number(8*t.bytesTotal/l/1e3).toFixed(2),d=e.getRepresentation(),f=e.getAbrController();if(u<t.duration*a.get().streaming.abr.rules.abandonRequestsRule.parameters.abandonDurationMultiplier||f.isPlayingAtLowestQuality(d))return n;if(!c.hasOwnProperty(t.index)){const o=e.getAbrController(),s=t.bytesTotal-t.bytesLoaded,u=o.getOptimalRepresentationForBitrate(r,l,!0),d=t.representation;s>t.bytesTotal*u.bitrateInKbit/d.bitrateInKbit&&(n.representation=u,n.priority=a.get().streaming.abr.rules.abandonRequestsRule.priority,n.reason={throughputInKbit:l,message:`[AbandonRequestRule][${i} is asking to abandon and switch to quality to ${u.absoluteIndex}. The measured bandwidth was ${l} kbit/s`},c[t.index]=!0)}return n}(e,r,o)}return o}catch(e){return s.error(e),o}},reset:d},s=(0,l.default)(r).getInstance().getLogger(o),d(),o}T.__dashjs_factory_name="AbandonRequestsRule";var _=r.default.getClassFactory(T);function y(){const e=this.context,t=(0,u.default)(e).getInstance();let n;return n={getSwitchRequest:function(n){const r=(0,i.default)(e).create();if(r.rule=this.getClassName(),!n||!n.hasOwnProperty("getDroppedFramesHistory"))return r;const a=n.getDroppedFramesHistory();if(!a)return r;const o=n.getStreamInfo().id,s=n.getMediaInfo(),l=n.getAbrController(),u=a.getFrameHistory(o);if(!u||0===Object.keys(u).length)return r;let c=0,d=0;const f=l.getPossibleVoRepresentationsFilteredBySettings(s,!0);let g=null;for(let e=1;e<f.length;e++){const n=f[e];if(n&&u[n.id]&&(c=u[n.id].droppedVideoFrames,d=u[n.id].totalVideoFrames,d>t.get().streaming.abr.rules.droppedFramesRule.parameters.minimumSampleSize&&c/d>t.get().streaming.abr.rules.droppedFramesRule.parameters.droppedFramesPercentageThreshold)){g=f[e-1];break}}return g&&(r.representation=g,r.priority=t.get().streaming.abr.rules.droppedFramesRule.priority,r.reason={droppedFrames:c,message:`[DroppedFramesRule]: Switching to index ${g.absoluteIndex}. Dropped Frames: ${c}, Total Frames: ${d}`}),r}},n}y.__dashjs_factory_name="DroppedFramesRule";var S=r.default.getClassFactory(y);function I(){const e=this.context,t=(0,u.default)(e).getInstance();let n;return n={getSwitchRequest:function(n){const r=(0,i.default)(e).create();if(r.rule=this.getClassName(),!n)return r;const a=n.getStreamInfo().id,o=n.getMediaType(),s=n?n.getSwitchRequestHistory():null,l=s?s.getSwitchRequests(a,o):{},u=n.getAbrController(),c=n.getMediaInfo(),d=u.getPossibleVoRepresentationsFilteredBySettings(c,!0);let f=0,g=0;for(let e=0;e<d.length;e++){const n=d[e];if(n&&l[n.id]&&(f+=l[n.id].drops,g+=l[n.id].noDrops,f+g>=t.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize&&f/g>t.get().streaming.abr.rules.switchHistoryRule.parameters.switchPercentageThreshold)){r.representation=e>0&&l[n.id].drops>0?d[e-1]:n,r.priority=t.get().streaming.abr.rules.switchHistoryRule.priority,r.reason={drops:f,noDrops:g,message:`[SwitchHistoryRule]: Switch to index: ${r.representation.absoluteIndex} samples: ${f+g} drops:  ${f}`};break}}return r}},n}I.__dashjs_factory_name="SwitchHistoryRule";var A=r.default.getClassFactory(I),R=n(7568);const N="BOLA_STATE_ONE_BITRATE",C="BOLA_STATE_STARTUP",b="BOLA_STATE_STEADY",D=10;function v(e){e=e||{};const t=this.context,n=e.dashMetrics,r=e.mediaPlayerModel,a=(0,f.default)(t).getInstance(),s=pe(t).getInstance();let c,d,m,E;function T(e){const t=e.mediaType,n=e.streamId,r=t===h.default.AUDIO?[h.default.AUDIO]:E[n];for(const e in r)E[n]&&E[n].hasOwnProperty(e)&&E[n][e].state===b&&(E[n][e].placeholderBuffer=0)}function _(e){const t=e.streamId;for(const e in E[t])if(E[t].hasOwnProperty(e)){const n=E[t][e];n.state!==N&&(n.state=C,y(n))}}function y(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function S(e){try{if(e&&e.metric===o.HTTP_REQUEST&&e.value&&e.value.type===R.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){const t=E[e.value._streamId]&&E[e.value._streamId][e.mediaType]?E[e.value._streamId][e.mediaType]:null;t&&t.state!==N&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),I(t,e.mediaType))}}catch(e){d.error(e)}}function I(e,t){if(!isNaN(e.lastSegmentStart)&&!isNaN(e.lastSegmentRequestTimeMs)&&!isNaN(e.placeholderBuffer)){if(e.placeholderBuffer*=.99,!isNaN(e.lastSegmentFinishTimeMs)){const r=n.getCurrentBufferLevel(t)+.001*(e.lastSegmentFinishTimeMs-e.lastSegmentRequestTimeMs),i=w(e,e.currentRepresentation),a=Math.max(0,i-r);e.placeholderBuffer=Math.min(a,e.placeholderBuffer)}e.lastSegmentWasReplacement&&!isNaN(e.lastSegmentDurationS)&&(e.placeholderBuffer+=e.lastSegmentDurationS),e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN}}function A(e){if(e&&E[e.streamId]&&E[e.streamId][e.mediaType]){const t=E[e.streamId][e.mediaType];t&&t.state!==N&&(t.currentRepresentation=e.newRepresentation)}}function v(e,t,n){const r=n.reduce((e,t,r)=>t>n[e]?r:e,0);if(0===r)return null;const i=Math.max(e,D+2*t.length),a=(n[r]-1)/(i/D-1);return{gp:a,Vp:D/a}}function M(e,t){const i=r.getBufferTimeDefault();if(e.bufferTimeDefault!==i){const r=v(i,e.representations,e.utilities);if(r.Vp!==e.Vp||r.gp!==e.gp){const a=n.getCurrentBufferLevel(t);let o=a+e.placeholderBuffer;o-=D,o*=r.Vp/e.Vp,o+=D,e.bufferTimeDefault=i,e.Vp=r.Vp,e.gp=r.gp,e.placeholderBuffer=Math.max(0,o-a)}}}function w(e,t){return e.Vp*(e.utilities[t.absoluteIndex]+e.gp)}function P(e){if(e&&e.chunk&&e.chunk.representation.mediaInfo&&E[e.streamId]){const t=E[e.streamId][e.chunk.representation.mediaInfo.type];if(t&&t.state!==N){const n=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||n>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=n,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=n,t.lastSegmentDurationS=e.chunk.duration,t.currentRepresentation=e.chunk.representation,I(t,e.chunk.representation.mediaInfo.type)}}}function O(){x()}function L(){m.get().streaming.abr.limitBitrateByPortal&&x()}function F(e,t){const n=t.absoluteIndex,r=t.bandwidth,i=e.utilities[n];let a=0;for(let t=n-1;t>=0;--t)if(e.utilities[t]<e.utilities[n]){const n=e.representations[t].bandwidth,o=e.utilities[t],s=e.Vp*(e.gp+(r*o-n*i)/(r-n));a=Math.max(a,s)}return a}function U(e){if(e&&E[e.streamId]){const t=E[e.streamId][e.mediaType];if(t&&t.state!==N){const r=n.getCurrentBufferLevel(e.mediaType);let i;i=t.currentRepresentation.absoluteIndex>0?F(t,t.currentRepresentation):D;const a=Math.max(0,i-r);t.placeholderBuffer=Math.min(t.placeholderBuffer,a)}}}function x(){E={}}return c={getSwitchRequest:function(e){try{const a=(0,i.default)(t).create();e.getScheduleController().setTimeToLoadDelay(0),a.rule=this.getClassName(),a.reason=a.reason||{};const o=function(e){const t=e.getMediaType(),n=e.getStreamInfo().id;E[n]||(E={},E[n]={});let i=E[n][t];return i?i.state!==N&&M(i,t):(i=function(e){const t={}
2,n=e.getMediaInfo(),i=s.getPossibleVoRepresentationsFilteredBySettings(n,!0);let a=i.map(e=>e.bandwidth).map(e=>Math.log(e));a=a.map(e=>e-a[0]+1);const o=r.getBufferTimeDefault(),l=v(o,i,a);return l?(t.state=C,t.representations=i,t.utilities=a,t.bufferTimeDefault=o,t.Vp=l.Vp,t.gp=l.gp,t.currentRepresentation=null,y(t)):t.state=N,t}(e),E[n][t]=i),i}(e);switch(a.reason.state=o.state,o.state){case N:break;case C:!function(e,t,r){const i=t.getMediaType(),a=t.getThroughputController().getSafeAverageThroughput(i);if(isNaN(a))return;const o=t.getMediaInfo(),l=s.getOptimalRepresentationForBitrate(o,a,!0),u=n.getCurrentBufferLevel(i);e.representation=l,e.reason.throughput=a,r.placeholderBuffer=Math.max(0,F(r,l)-u),r.currentRepresentation=l,!isNaN(r.lastSegmentDurationS)&&u>=r.lastSegmentDurationS&&(r.state=b)}(a,e,o);break;case b:!function(e,t,r){const i=t.getMediaType(),a=t.getThroughputController(),o=t.getMediaInfo(),l=a.getSafeAverageThroughput(i),u=t.getScheduleController();!function(e,t){const n=Date.now();if(isNaN(e.lastSegmentFinishTimeMs)){if(!isNaN(e.lastCallTimeMs)){const t=.001*(n-e.lastCallTimeMs);e.placeholderBuffer+=Math.max(0,t)}}else{const t=.001*(n-e.lastSegmentFinishTimeMs);e.placeholderBuffer+=Math.max(0,t)}e.lastCallTimeMs=n,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN,M(e,t)}(r,i);const c=n.getCurrentBufferLevel(i);let d=function(e,t){const n=e.representations.length;let r=NaN,i=NaN;for(let a=0;a<n;++a){let n=(e.Vp*(e.utilities[a]-1+e.gp)-t)/e.representations[a].bandwidth;(isNaN(i)||n>=i)&&(i=n,r=a)}return e.representations[r]}(r,c+r.placeholderBuffer);const f=s.getOptimalRepresentationForBitrate(o,l,!0);d.absoluteIndex>r.currentRepresentation.absoluteIndex&&d.absoluteIndex>f.absoluteIndex&&(d=f.absoluteIndex>r.currentRepresentation.absoluteIndex?f:r.currentRepresentation);let g=Math.max(0,c+r.placeholderBuffer-w(r,d));g<=r.placeholderBuffer?(r.placeholderBuffer-=g,g=0):(g-=r.placeholderBuffer,r.placeholderBuffer=0,s.isPlayingAtTopQuality(d)?g=0:u.setTimeToLoadDelay(1e3*g)),e.representation=d,e.reason.throughput=l,e.reason.bufferLevel=c,e.reason.placeholderBuffer=r.placeholderBuffer,e.reason.delay=g,r.currentRepresentation=d}(a,e,o);break;default:!function(e,t,n){d.debug("BOLA ABR rule invoked in bad state.");const r=t.getMediaInfo(),i=t.getMediaType(),a=t.getThroughputController().getSafeAverageThroughput(i);e.representation=s.getOptimalRepresentationForBitrate(r,a,!0),e.reason.state=n.state,e.reason.throughput=a,n.state=C,y(n)}(a,e,o)}return a.priority=m.get().streaming.abr.rules.bolaRule.priority,a}catch(e){return d.error(e),(0,i.default)(t).create()}},handleNewMediaInfo:function(e){e&&e.streamInfo&&e.type&&E[e.streamInfo.id]&&E[e.streamInfo.id][e.type]&&delete E[e.streamInfo.id][e.type]},reset:function(){x(),a.off(p.default.BUFFER_EMPTY,T,c),a.off(p.default.PLAYBACK_SEEKING,_,c),a.off(p.default.METRIC_ADDED,S,c),a.off(p.default.QUALITY_CHANGE_REQUESTED,A,c),a.off(p.default.FRAGMENT_LOADING_ABANDONED,U,c),a.off(g.default.MEDIA_FRAGMENT_LOADED,P,c),a.off(g.default.SETTING_UPDATED_MAX_BITRATE,O,c),a.off(g.default.SETTING_UPDATED_MIN_BITRATE,O,c),a.off(g.default.VIDEO_ELEMENT_RESIZED,L,c)}},d=(0,l.default)(t).getInstance().getLogger(c),m=(0,u.default)(t).getInstance(),x(),a.on(p.default.BUFFER_EMPTY,T,c),a.on(p.default.PLAYBACK_SEEKING,_,c),a.on(p.default.METRIC_ADDED,S,c),a.on(p.default.QUALITY_CHANGE_REQUESTED,A,c),a.on(p.default.FRAGMENT_LOADING_ABANDONED,U,c),a.on(g.default.MEDIA_FRAGMENT_LOADED,P,c),a.on(g.default.SETTING_UPDATED_MAX_BITRATE,O,c),a.on(g.default.SETTING_UPDATED_MIN_BITRATE,O,c),a.on(g.default.VIDEO_ELEMENT_RESIZED,L,c),c}v.__dashjs_factory_name="BolaRule";var M=r.default.getClassFactory(v);const w="L2A_STATE_ONE_BITRATE",P="L2A_STATE_STARTUP",O="L2A_STATE_STEADY",L=Math.pow(4,.99);function F(e){e=e||{};const t=this.context,n=e.dashMetrics,r=(0,f.default)(t).getInstance(),a=(0,u.default)(t).getInstance();let s,c,d,p;function m(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN,e.lastSegmentUrl=""}function E(){for(const e in c)if(c.hasOwnProperty(e)){const t=c[e];t.state!==w&&(t.state=P,m(t))}}function T(e){if(e&&e.chunk&&e.chunk.representation&&e.chunk.representation.mediaInfo){const t=c[e.chunk.representation.mediaInfo.type],n=d[e.chunk.representation.mediaInfo.type];if(t&&t.state!==w){const r=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||r>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=r,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=r,t.lastSegmentDurationS=e.chunk.duration,t.currentRepresentation=e.chunk.representation,y(t,n)}}}function _(e){if(e&&e.metric===o.HTTP_REQUEST&&e.value&&e.value.type===R.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){const t=c[e.mediaType],n=d[e.mediaType];t&&t.state!==w&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),y(t,n))}}function y(e,t){isNaN(e.lastSegmentStart)||isNaN(e.lastSegmentRequestTimeMs)||(t.segment_request_start_s=.001*e.lastSegmentRequestTimeMs,t.segment_download_finish_s=.001*e.lastSegmentFinishTimeMs,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN)}function S(e,t){if(e.length!==t.length)return-1;let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n}function I(){c={},d={}}return s={getSwitchRequest:function(e){try{const r=(0,i.default)(t).create();r.rule=this.getClassName();const o=e.getMediaType(),s=e.getScheduleController();if(r.reason=r.reason||{},o===h.default.AUDIO)return r;s.setTimeToLoadDelay(0);const l=function(e){const t=e.getMediaType();let n=c[t];return n||(n=function(e){const t={},n=e.getMediaInfo();return t.state=P,t.currentRepresentation=null,function(e){e&&e.type&&(d[e.type]={},d[e.type].w=[],d[e.type].prev_w=[],d[e.type].Q=0,d[e.type].segment_request_start_s=0,d[e.type].segment_download_finish_s=0,d[e.type].B_target=1.5)}(n),m(t),t}(e),c[t]=n),n}(e);if(!d[o])return r;switch(r.reason.state=l.state,l.state){case w:break;case P:!function(e,t,r){const i=e.getMediaInfo(),a=e.getMediaType(),o=e.getThroughputController().getSafeAverageThroughput(a);if(isNaN(o))return t;const s=e.getAbrController(),l=s.getOptimalRepresentationForBitrate(i,o,!0),u=n.getCurrentBufferLevel(a,!0),c=d[a],f=s.getPossibleV
2oRepresentationsFilteredBySettings(i,!0);if(t.representation=l,t.reason.throughput=o,r.currentRepresentation=l,!isNaN(r.lastSegmentDurationS)&&u>=c.B_target){r.state=O,c.Q=L;for(let e=0;e<f.length;++e)f[e].id===r.currentRepresentation.id?c.prev_w[e]=1:c.prev_w[e]=0}}(e,r,l);break;case O:!function(e,t,r){let i=[];const a=e.getThroughputController(),o=e.getMediaType();let s=a.getAverageThroughput(o,h.default.THROUGHPUT_CALCULATION_MODES.ARITHMETIC_MEAN,1),l=n.getCurrentHttpRequest(o),u=null;const c=d[o];if(s<1&&(s=1),l.url===r.lastSegmentUrl||l.type===R.HTTPRequest.INIT_SEGMENT_TYPE)u=r.currentRepresentation;else{let t=r.lastSegmentDurationS,n=1;const a=e.getAbrController(),o=e.getMediaInfo(),d=a.getPossibleVoRepresentationsFilteredBySettings(o,!0);let f=e.getVideoModel().getPlaybackRate();const g=Math.max(Math.pow(4,1),L*Math.sqrt(4));for(let e=0;e<d.length;++e){const r=d[e];f*r.bitrateInKbit>s&&(n=-1),c.w[e]=c.prev_w[e]+n*(t/(2*g))*((c.Q+L)*(f*r.bitrateInKbit/s))}c.w=function(e){const t=e.length;let n=!1,r=[];for(let n=0;n<t;++n)r[n]=e[n];let i=e.sort(function(e,t){return t-e}),a=0,o=0,s=[];for(let e=0;e<t-1;++e)if(a+=i[e],o=(a-1)/(e+1),o>=i[e+1]){n=!0;break}n||(o=(a+i[t-1]-1)/t);for(let e=0;e<t;++e)s[e]=Math.max(r[e]-o,0);return s}(c.w);for(let e=0;e<d.length;++e)i[e]=c.w[e]-c.prev_w[e],c.prev_w[e]=c.w[e];const h=d.map(e=>e.bandwidth);c.Q=Math.max(0,c.Q-t+t*f*((S(h,c.prev_w)+S(h,i))/s));let p=[];for(let e=0;e<h.length;++e)p[e]=Math.abs(h[e]-S(c.w,h));const m=p.indexOf(Math.min(...p));u=a.getRepresentationByAbsoluteIndex(m,o,!0),u.absoluteIndex>r.currentRepresentation.absoluteIndex&&h[r.currentRepresentation.absoluteIndex+1]<=s&&(u=a.getRepresentationByAbsoluteIndex(r.currentRepresentation.absoluteIndex+1,o,!0)),u.bitrateInKbit>=s&&(c.Q=2*Math.max(L,c.Q)),r.lastSegmentUrl=l.url}t.representation=u,r.currentRepresentation=t.representation}(e,r,l);break;default:!function(e,t,n){const r=e.getAbrController(),i=e.getMediaInfo(),a=e.getMediaType(),o=e.getThroughputController().getSafeAverageThroughput(a);t.representation=r.getOptimalRepresentationForBitrate(i,o,!0),t.reason.throughput=o,n.state=P,m(n)}(e,r,l)}return r.priority=a.get().streaming.abr.rules.l2ARule.priority,r}catch(e){return p.error(e),(0,i.default)(t).create()}},reset:function(){I(),r.off(g.default.PLAYBACK_SEEKING,E,s),r.off(g.default.MEDIA_FRAGMENT_LOADED,T,s),r.off(g.default.METRIC_ADDED,_,s)}},p=(0,l.default)(t).getInstance().getLogger(s),I(),r.on(g.default.PLAYBACK_SEEKING,E,s),r.on(g.default.MEDIA_FRAGMENT_LOADED,T,s),r.on(g.default.METRIC_ADDED,_,s),s}F.__dashjs_factory_name="L2ARule";var U=r.default.getClassFactory(F);function x(){const e=this.context;let t,n,r,i,a,o,s,u,c;function d(){r=null,i=1,a=100,o=0,s=null,u=null,c="dynamic_weight_selection"}function f(){let e=0;if(r)for(let t=0;t<r.length;t++){let n=r[t];n.state.throughput>e&&(e=n.state.throughput)}return e}function g(e,t,n){let r=e.map((e,r)=>n[r]*Math.pow(e-t[r],2)).reduce((e,t)=>e+t);return(r<0?-1:1)*Math.sqrt(Math.abs(r))}function h(e,t){return g([e.state.throughput,e.state.latency,e.state.rebuffer,e.state.switch],[t.state.throughput,t.state.latency,t.state.rebuffer,t.state.switch],[1,1,1,1])}function p(e,t){for(let n=0;n<r.length;n++){let i=r[n],a=.1;const o=h(i,e);m(i,t,Math.exp(-1*Math.pow(o,2)/(2*Math.pow(a,2))))}}function m(e,t,n){let r=e.state,i=[.01,.01,.01,.01];r.throughput=r.throughput+(t[0]-r.throughput)*i[0]*n,r.latency=r.latency+(t[1]-r.latency)*i[1]*n,r.rebuffer=r.rebuffer+(t[2]-r.rebuffer)*i[2]*n,r.switch=r.switch+(t[3]-r.switch)*i[3]*n}return t={getNextQuality:function(e,t,l,d,h,m,E,T){let _=d,y=l;!function(e,t){if(!r){r=[];const n=t.getPossibleVoRepresentationsFilteredBySettings(e,!0),a=n.map(e=>e.bandwidth);o=Math.min(...a),i=function(e){const t=e.map(e=>Math.pow(e,2)).reduce((e,t)=>e+t);return Math.sqrt(t)}(a),n.forEach(e=>{let t={representation:e,state:{throughput:e.bandwidth/i,latency:0,rebuffer:0,switch:0}};r.push(t)}),u=function(e){let t=[],n=function(e){let t=[];for(let n=0;n<e;n++){let e=[Math.random()*f(),Math.random(),Math.random(),Math.random()];t.push(e)}return t}(Math.pow(e.length,2));t.push(n[0]);let r=[1,1,1,1];for(let i=1;i<e.length;i++){let e=null,i=null;for(let a=0;a<n.length;a++){let o=n[a],s=null;for(let e=0;e<t.length;e++){let n=g(o,t[e],r);(null===s||n<s)&&(s=n)}(null===i||s>i)&&(e=o,i=s)}t.push(e)}let i=null,a=null;for(let e=0;e<t.length;e++){let n=0;for(let i=0;i<t.length;i++)e!==i&&(n+=g(t[e],t[i],r));(null===i||n>i)&&(i=n,a=e)}let o=[];for(o.push(t[a]),t.splice(a,1);t.length>0;){let e=null,n=null;for(let i=0;i<t.length;i++){let a=g(o[0],t[i],r);(null===e||a<e)&&(e=a,n=i)}o.push(t[n]),t.splice(n,1)}return o}(r)}}(t,e);let S=l/i;S>1&&(S=f()),d/=a;let I=r.find(e=>e.representation.id===E.id),A=I.representation.bandwidth*T.getSegmentDuration()/y,R=Math.max(0,A-h);if(h-A<T.getMinBuffer())return n.debug(`Buffer is low for bitrate= ${I.representation.bandwidth} downloadTime=${A} currentBuffer=${h} rebuffer=${R}`),function(e,t){let n=0,i=e;if(r)for(let a=0;a<r.length;a++){let o=r[a];o.representation.bandwidth<e.representation.bandwidth&&o.representation.bandwidth>n&&t>o.representation.bandwidth&&(n=o.representation.bandwidth,i=o)}return i}(I,y).representation;switch(c){case"manual_weight_selection":s=[.4,.4,.4,.4];break;case"random_weight_selection":s=function(e){let t=[],n=Math.sqrt(2/e);for(let e=0;e<4;e++)t.push(Math.random()*n);return s=t,s}(r.length);break;default:!function(e,t,n,i,a,o){s||(s=u[u.length-1]);let l=e.findWeightVector(r,t,n,i,a,o);null!==l&&-1!==l&&(s=l)}(T,_,h,R,y,m)}let N=null,C=null,b=null;for(let e=0;e<r.length;e++){let t=r[e],i=t.state,a=[i.throughput,i.latency,i.rebuffer,i.switch],u=s.slice(),c=T.getNextBufferWithBitrate(t.representation.bandwidth,h,y),d=c<T.getMinBuffer();d&&n.debug(`Buffer is low for bitrate=${t.representation.bandwidth} downloadTime=${A} currentBuffer=${h} nextBuffer=${c}`),(t.representation.bandwidth>l-1e4||d)&&t.representation.bandwidth!==o&&(u[0]=100);let f=g(a,[S,0,0,0],u);(null===N||f<N)&&(N=f,C=t.representation,b=t)}let D=Math.abs(I.representation.bandwidth-b.representation.bandwidth)/i;return p(I,[S,d,R,D]),p(b,[S,0,0,D]),C},reset:function(){d()}},n=(0,l.default)(e).getInstance().getLogger(t),d(),t}x.__dashjs_factory_name="LearningAbrController";var B=r.default.getClassFactory(x),k=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 G(){let e,t,n,r,i;function a(){t=null,n=null,r=null,i=null}function o(e,t,n,r){let i=new k;return i.type=e,i.weights.bitrateReward=t||1,i.weights.bitrateSwitchPenalty=1,i.weights.rebufferPenalty=n||1e3,i.weights.latencyPenalty=[],i.weights.latencyPenalty.push({threshold:1.1,penalty:.05*r}),i.weights.latencyPenalty.push({threshold:1e8,penalty:.1*n}),i.weights.playbackSpeedPenalty=r||200,i}function s(e,t,n,r,i){i.bitrateWSum+=i.weights.bitrateReward*e,i.lastBitrate&&(i.bitrateSwitchWSum+=i.weights.bitrateSwitchPenalty*Math.abs(e-i.lastBitrate)),i.lastBitrate=e,i.rebufferWSum+=i.weights.rebufferPenalty*t;for(let e=0;e<i.weights.latencyPenalty.length;e++){let t=i.weights.latencyPenalty[e];if(n<=t.threshold){i.latencyWSum+=t.penalty*n;break}}i.playbackSpeedWSum+=i.weights.playbackSpeedPenalty*Math.abs(1-r),i.totalQoe=i.bitrateWSum-i.bitrateSwitchWSum-i.rebufferWSum-i.latencyWSum-i.playbackSpeedWSum}return e={setupPerSegmentQoe:function(e,a,s){t=o("segment",e,a,s),n=e,r=a,i=s},logSegmentMetrics:function(e,n,r,i){t&&s(e,n,r,i,t)},getPerSegmentQoe:function(){return t},calculateSingleUseQoe:function(e,t,a,l){let u=null;return n&&r&&i&&(u=o("segment",n,r,i)),u?(s(e,t,a,l,u),u.totalQoe):0},reset:function(){a()}},a(),e}G.__dashjs_factory_name="LoLpQoeEvaluator";var H=r.default.getClassFactory(G);function Y(e){let t,n,r,i,a,o=e.targetLatency,s=e.bufferMin,l=e.segmentDuration,u=e.qoeEvaluator;function c(){return l}function d(e,t){const n=c();let r;return r=t>n?e-n:e+n-t,r}return t={getMinBuffer:function(){return s},getSegmentDuration:c,getNextBufferWithBitrate:function(e,t,n){return d(t,e*l/n)},getNextBuffer:d,findWeightVector:function(e,t,n,r,c,f){let g=null,h=null,p=null,m=Math.abs(t-a);
2return e.forEach(e=>{i.forEach(r=>{r[0];let i,a=r[1],E=r[2],T=(r[3],e.representation.bandwidth*l/c),_=d(n,T);i=0===E?10:1/E;let y=i*Math.max(1e-5,T-_);i=0===a?10:1/a;let S=i*e.state.latency,I=u.calculateSingleUseQoe(e.representation.bandwidth,y,S,f);(null===g||I>g)&&function(e,t,n){return!(e>o+n)&&t>=s}(t,_,m)&&(g=I,h=r,p=e.representation.bandwidth)})}),null===h&&null===p&&(h=-1),a=t,h}},n=[.2,.4,.6,.8,1],r=4,i=function(e){let t=e.map(function(e){return[e]}),n=function(t,r,i){if(i===r)return t;let a=t.length;for(let n=0;n<a;n++){let n=t.shift();for(let r=0;r<e.length;r++)t.push(n.concat(e[r]))}return n(t,r,i+1)};return n(t,4,1)}(n),a=0,t}Y.__dashjs_factory_name="LoLpWeightSelector";var q=r.default.getClassFactory(Y);function V(e){let t,n,r,a,s,c=(e=e||{}).dashMetrics,d=this.context;return r={getSwitchRequest:function(e){try{let r=(0,i.default)(d).create();r.rule=this.getClassName();let l=e.getMediaInfo().type,u=e.getAbrController();const f=e.getStreamInfo();let g=e.getRepresentation();const p=e.getMediaInfo(),m=c.getCurrentBufferState(l),E=e.getScheduleController(),T=c.getCurrentBufferLevel(l,!0),_=E.getPlaybackController();let y=_.getCurrentLiveLatency();if(l===h.default.AUDIO)return r;y||(y=0);const S=_.getPlaybackRate(),I=e.getThroughputController().getSafeAverageThroughput(l);if(t.debug(`Throughput ${Math.round(I)} kbps`),isNaN(I)||!m)return r;if(u.getAbandonmentStateFor(f.id,l)===o.ABANDON_LOAD)return r;let A=u.getPossibleVoRepresentationsFilteredBySettings(p,!0).map(e=>e.bandwidth),R=e.getRepresentation().fragmentDuration,N=Math.min(...A)/1e3,C=Math.max(...A)/1e3,b=g.bandwidth/1e3,D=c.getCurrentHttpRequest(l,!0),v=(D.tresponse.getTime()-D.trequest.getTime())/1e3,M=v>R?v-R:0;s.setupPerSegmentQoe(R,C,N),s.logSegmentMetrics(b,M,y,S);let w=q(d).create({targetLatency:1.5,bufferMin:.3,segmentDuration:R,qoeEvaluator:s});return r.representation=a.getNextQuality(u,p,1e3*I,y,T,S,g,w),r.reason={throughput:I,latency:y},r.priority=n.get().streaming.abr.rules.loLPRule.priority,E.setTimeToLoadDelay(0),r}catch(e){throw e}},reset:function(){a.reset(),s.reset()}},t=(0,l.default)(d).getInstance().getLogger(r),a=B(d).create(),s=H(d).create(),n=(0,u.default)(d).getInstance(),r}V.__dashjs_factory_name="LoLPRule";var K=r.default.getClassFactory(V);function j(e){e=e||{};const t=this.context,n=e.mediaPlayerModel,r=e.customParametersModel,a=e.dashMetrics,o=e.settings,s=(0,f.default)(t).getInstance();let l,u,c,p;function m(){Object.values(h.default.QUALITY_SWITCH_RULES).forEach(e=>{u=T(e,u)}),Object.values(h.default.ABANDON_FRAGMENT_RULES).forEach(e=>{c=T(e,c)}
2),r.getAbrCustomRules().forEach(function(e){e.type===h.default.RULES_TYPES.QUALITY_SWITCH_RULES&&u.push(e.rule(t).create()),e.type===h.default.RULES_TYPES.ABANDON_FRAGMENT_RULES&&c.push(e.rule(t).create())}),0===u.length&&(u.push(M(t).create({dashMetrics:a,mediaPlayerModel:n,settings:o})),u.push(d(t).create({dashMetrics:a})))}function T(e,r){const i=e.charAt(0).toLowerCase()+e.slice(1);return o.get().streaming.abr.rules[i].active&&!function(e,t){return e.filter(e=>e.getClassName()===t).length>0}(r,e)?(r.push(function(e){switch(e){case h.default.QUALITY_SWITCH_RULES.BOLA_RULE:return M(t).create({dashMetrics:a,mediaPlayerModel:n,settings:o});case h.default.QUALITY_SWITCH_RULES.THROUGHPUT_RULE:return d(t).create({dashMetrics:a});case h.default.QUALITY_SWITCH_RULES.INSUFFICIENT_BUFFER_RULE:return E(t).create({dashMetrics:a,settings:o});case h.default.QUALITY_SWITCH_RULES.SWITCH_HISTORY_RULE:return A(t).create();case h.default.QUALITY_SWITCH_RULES.DROPPED_FRAMES_RULE:return S(t).create();case h.default.QUALITY_SWITCH_RULES.LEARN_TO_ADAPT_RULE:return U(t).create({dashMetrics:a,settings:o});case h.default.QUALITY_SWITCH_RULES.LOL_PLUS_RULE:return K(t).create({dashMetrics:a});case h.default.ABANDON_FRAGMENT_RULES.ABANDON_REQUEST_RULE:return _(t).create({dashMetrics:a,mediaPlayerModel:n,settings:o})}}(e)),r):o.get().streaming.abr.rules[i].active?r:function(e,t){return e.filter(e=>e.getClassName()!==t)}(r,e)}function y(e){return e.filter(e=>e.representation!==i.default.NO_CHANGE)}function I(e){const t={};let n,r,a,o=null;if(0!==e.length){for(t[i.default.PRIORITY.STRONG]=null,t[i.default.PRIORITY.WEAK]=null,t[i.default.PRIORITY.DEFAULT]=null,n=0,r=e.length;n<r;n+=1)a=e[n],a.representation!==i.default.NO_CHANGE&&(null===t[a.priority]||t[a.priority].representation!==i.default.NO_CHANGE&&a.representation.bitrateInKbit<t[a.priority].representation.bitrateInKbit)&&(t[a.priority]=a);return t[i.default.PRIORITY.WEAK]&&t[i.default.PRIORITY.WEAK].representation!==i.default.NO_CHANGE&&(o=t[i.default.PRIORITY.WEAK]),t[i.default.PRIORITY.DEFAULT]&&t[i.default.PRIORITY.DEFAULT].representation!==i.default.NO_CHANGE&&(o=t[i.default.PRIORITY.DEFAULT]),t[i.default.PRIORITY.STRONG]&&t[i.default.PRIORITY.STRONG].representation!==i.default.NO_CHANGE&&(o=t[i.default.PRIORITY.STRONG]),o}}function R(){m()}return l={clearDataForStream:function(e){[u,c].forEach(t=>{t&&t.length&&t.forEach(t=>t.clearDataForStream&&"function"==typeof t.clearDataForStream&&t.clearDataForStream(e))})},getAbandonFragmentRules:function(){return c},getBestPossibleSwitchRequest:function(e){return e&&I(y(u.filter(t=>{const n=t.getClassName();if(n!==h.default.QUALITY_SWITCH_RULES.BOLA_RULE&&n!==h.default.QUALITY_SWITCH_RULES.THROUGHPUT_RULE)return!0;const r=e.getMediaType();return p[r]&&n===h.default.QUALITY_SWITCH_RULES.BOLA_RULE||!p[r]&&n===h.default.QUALITY_SWITCH_RULES.THROUGHPUT_RULE}).map(t=>t.getSwitchRequest(e))))||(0,i.default)(t).create()},getBolaState:function(e){return p[e]},getMinSwitchRequest:I,getQualitySwitchRules:function(){return u},handleNewMediaInfo:function(e){u.forEach(t=>t.handleNewMediaInfo&&t.handleNewMediaInfo(e)),c.forEach(t=>t.handleNewMediaInfo&&t.handleNewMediaInfo(e))},initialize:function(){u=[],c=[],p={},m(),s.on(g.default.SETTING_UPDATED_ABR_ACTIVE_RULES,R,l)},reset:function(){[u,c].forEach(e=>{e&&e.length&&e.forEach(e=>e.reset&&e.reset())}),u=[],c=[],p={},s.off(g.default.SETTING_UPDATED_ABR_ACTIVE_RULES,R,l)},setBolaState:function(e,t){p[e]=t},shouldAbandonFragment:function(e){if(!e)return(0,i.default)(t).create();const n=I(y(c.map(t=>t.shouldAbandon(e))));return n&&n.reason&&(n.reason.forceAbandon=!0),n||(0,i.default)(t).create()}},l}j.__dashjs_factory_name="ABRRulesCollection";const W=r.default.getClassFactory(j);r.default.updateSingletonFactory(j.__dashjs_factory_name,W);var z=W,$=n(2842);const Q="loading",X="executed",Z="failed";function J(e){const t=(e=e||{}).eventBus,n=e.events,r=e.dashMetrics,i=e.fragmentLoader,a=e.debug,o=e.streamInfo,s=e.type;let l,u,c,d;function f(e){return!!e&&function(t){let n=!1;return t.some(t=>{if(r=e,i=t,!isNaN(r.index)&&r.startTime===i.startTime&&r.adaptationIndex===i.adaptationIndex&&r.type===i.type||function(e,t){return e.representation.id===t.representation.id}(e,t)||function(e,t){return e.action===$.default.ACTION_COMPLETE&&e.action===t.action}(e,t))return n=!0,n;var r,i}),n}(c)}function g(e){return isNaN(e.duration)?.25:Math.min(e.duration/8,.5)}function h(e){c=c.filter(t=>{const n=g(t);return isNaN(t.startTime)||void 0!==e&&t.startTime>=e-n})}function p(e,t){t<=e+.5||(c=c.filter(n=>{const r=g(n);return isNaN(n.startTime)||n.startTime>=t-r||isNaN(n.duration)||n.startTime+n.duration<=e+r}))}function m(e,t,n){for(let r=e.length-1;r>=0;r--){const i=e[r],a=i.startTime,o=a+i.duration;if(n=isNaN(n)?g(i):n,!isNaN(a)&&!isNaN(o)&&t+n>=a&&t-n<o||isNaN(a)&&isNaN(t))return i}return null}function E(e,t){r.addSchedulingInfo(e,t),r.addRequestsQueue(e.mediaType,d,c)}function T(e){e.sender===i&&(d.splice(d.indexOf(e.request),1),e.response&&!e.error&&c.push(e.request),E(e.request,e.error?Z:X),t.trigger(n.FRAGMENT_LOADING_COMPLETED,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:o.id,mediaType:s}))}function _(e){e.sender===i&&t.trigger(n.FRAGMENT_LOADING_PROGRESS,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:o.id,mediaType:s})}function y(e){e.sender===i&&t.trigger(n.FRAGMENT_LOADING_ABANDONED,{request:e.request},{streamId:o.id,mediaType:s})}function S(){c=[],d=[],i&&i.resetInitialSettings()}return l={abortRequests:function(){u.debug("abort requests"),i.abort(),d=[]},executeRequest:function(e){e.action===$.default.ACTION_DOWNLOAD?(E(e,Q),d.push(e),function(e){t.trigger(n.FRAGMENT_LOADING_STARTED,{request:e},{streamId:o.id,mediaType:s}),i.load(e)}(e)):u.warn("Unknown request action.")},getRequests:function(e){const t=e?e.state instanceof Array?e.state:[e.state]:[];let n=[];return t.forEach(t=>{const r=function(e){let t;switch(e){case Q:t=d;break;case X:t=c;break;default:t=[]}return t}(t);
2n=n.concat(function(e,t){return t.hasOwnProperty("time")?[m(e,t.time,t.threshold)]:e.filter(e=>{for(const n in t)if("state"!==n&&t.hasOwnProperty(n)&&e[n]!=t[n])return!1;return!0})}(r,e))}),n},getStreamId:function(){return o.id},getType:function(){return s},isFragmentLoaded:f,isFragmentLoadedOrPending:function(e){let t,n=!1,r=0;if(n=f(e),!n)for(r=0;r<d.length;r++)t=d[r],e.url===t.url&&e.startTime===t.startTime&&(n=!0);return n},removeExecutedRequestsAfterTime:function(e){c=c.filter(t=>isNaN(t.startTime)||void 0!==e&&t.startTime<e)},removeExecutedRequestsBeforeTime:h,reset:function(){t.off(n.LOADING_COMPLETED,T,this),t.off(n.LOADING_DATA_PROGRESS,_,this),t.off(n.LOADING_ABANDONED,y,this),i&&i.reset(),S()},resetInitialSettings:S,syncExecutedRequestsWithBufferedRange:function(e,t){if(!e||0===e.length)return void h();let n=0;for(let t=0,r=e.length;t<r;t++)p(n,e.start(t)),n=e.end(t);t>0&&p(n,t)}},u=a.getLogger(l),S(),t.on(n.LOADING_COMPLETED,T,l),t.on(n.LOADING_DATA_PROGRESS,_,l),t.on(n.LOADING_ABANDONED,y,l),l}J.__dashjs_factory_name="FragmentModel";const ee=r.default.getClassFactory(J);ee.FRAGMENT_MODEL_LOADING=Q,ee.FRAGMENT_MODEL_EXECUTED=X,ee.FRAGMENT_MODEL_CANCELED="canceled",ee.FRAGMENT_MODEL_FAILED=Z,r.default.updateClassFactory(J.__dashjs_factory_name,ee);var te=ee;function ne(e){let t;const n=(e=e||{}).abrController,r=e.throughputController,i=e.switchRequestHistory,a=e.droppedFramesHistory,o=e.currentRequest,s=e.streamProcessor?e.streamProcessor.getScheduleController():null,l=e.streamProcessor?e.streamProcessor.getRepresentation():null,u=e.videoModel?e.videoModel:null;function c(){return l?l.mediaInfo:null}return t={getAbrController:function(){return n},getCurrentRequest:function(){return o},getDroppedFramesHistory:function(){return a},getMediaInfo:c,getMediaType:function(){const e=c();return e?e.type:null},getRepresentation:function(){return l},getScheduleController:function(){return s},getStreamInfo:function(){const e=c();return e?e.streamInfo:null},getSwitchRequestHistory:function(){return i},getThroughputController:function(){return r},getVideoModel:function(){return u}},t}ne.__dashjs_factory_name="RulesContext";var re=r.default.getClassFactory(ne);function ie(){let e={},t={};const n=this.context,r=(0,u.default)(n).getInstance();return{clearForStream:function(n){delete e[n],delete t[n]},getSwitchRequests:function(t,n){return null!=t&&null!=n&&e[t]&&e[t][n]?e[t][n]:{}},push:function(n){const i=n.currentRepresentation,a=n.newRepresentation;if(i.mediaInfo.streamInfo.id!==a.mediaInfo.streamInfo.id||a.mediaInfo.id!==i.mediaInfo.id)return;const o=i.mediaInfo.streamInfo.id;e[o]||function(n){e[n]={},t[n]={}}(o);const s=i.mediaInfo.type;e[o][s]||function(n,r){e[n][r]={},t[n][r]=[]}(o,s);const l=n.currentRepresentation.id;e[o][s][l]||function(t,n,r){e[t][n][r]={noDrops:0,drops:0,dropSize:0}}(o,s,l);let u=n.newRepresentation.absoluteIndex-n.currentRepresentation.absoluteIndex,c=u<0?1:0,d=c?-u:0,f=c?0:1;e[o][s][n.currentRepresentation.id].drops+=c,e[o][s][n.currentRepresentation.id].dropSize+=d,e[o][s][n.currentRepresentation.id].noDrops+=f,t[o][s].push({id:n.currentRepresentation.id,noDrop:f,drop:c,dropSize:d});const g=function(e,n){return t[e][n].length>r.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize?t[e][n].shift():null}(o,s);g&&function(t,n,r){e[t][n][r.id].drops-=r.drop,e[t][n][r.id].dropSize-=r.dropSize,e[t][n][r.id].noDrops-=r.noDrop}(o,s,g)},reset:function(){e={},t={}}}}ie.__dashjs_factory_name="SwitchRequestHistory";var ae=r.default.getClassFactory(ie);function oe(){let e={},t={},n={};return{clearForStream:function(r){delete e[r],delete t[r],delete n[r]},getFrameHistory:function(t){return e[t]},push:function(r,i,a){if(!i)return;e[r]||function(r){e[r]=[],t[r]=0,n[r]=0}(r);let o=a&&a.droppedVideoFrames?a.droppedVideoFrames:0,s=a&&a.totalVideoFrames?a.totalVideoFrames:0,l=o-t[r];t[r]=o;let u=s-n[r];n[r]=s;const c=e[r];c[i]?(c[i].droppedVideoFrames+=l,c[i].totalVideoFrames+=u):c[i]={droppedVideoFrames:l,totalVideoFrames:u}},reset:function(){e={},t={},n={}}}}oe.__dashjs_factory_name="DroppedFramesHistory";var se=r.default.getClassFactory(oe);function le(){const e=this.context,t=(0,l.default)(e).getInstance(),n=(0,f.default)(e).getInstance();let r,a,s,u,c,d,m,E,T,_,y,S,I,A,R,N,C,b,D,v,M;function w(){r={},b={},R=new Map,y&&y.reset(),D&&D.reset(),m=void 0,y=void 0,D=void 0,clearTimeout(a),a=null}function P(e,t=!0){let n=O(e,t);return n=function(e){try{return function(e){try{if(!N.get().streaming.cmsd.enabled||!N.get().streaming.cmsd.abr.applyMb)return e;const t=e.filter(e=>{const t=e.mediaInfo.type;let n=d.getMaxBitrate(t);if(t!==h.default.VIDEO||n<0)return!0;const r=e.mediaInfo.streamInfo.id;return n-=b[r][h.default.AUDIO].getRepresentation().bitrateInKbit||0,e.bitrateInKbit<=n});return t.length>0?t:e}catch(t){return I.error(t),e}}(e=function(e){try{if(!N.get().streaming.abr.limitBitrateByPortal)return e;const t=1e3*N.get().streaming.abr.limitBitrateByPortalMinimum||0,{elementWidth:n}=M.getVideoElementSize(),r=e.filter(e=>e.mediaInfo.type!==h.default.VIDEO||e.width<=n||e.bandwidth<=t);return r.length>0?r:e}catch(t){return I.error(t),e}}(e=function(e){try{const t=e.filter(e=>{const t=e.mediaInfo.type,n=e.bitrateInKbit,r=A.getAbrBitrateParameter("maxBitrate",t),i=A.getAbrBitrateParameter("minBitrate",t);return!(r>-1&&n>r||i>-1&&n<i)});return t.length>0?t:e}catch(t){return I.error(t),e}}(e)))}catch(t){return I.error(t),e}}(n),n}function O(e,t){let n=[];if(!e)return n;const r=function(e){try{const t=[];if(e&&t.push(e),!N.get().streaming.abr.enableSupplementalPropertyAdaptationSetSwitching||!e.adaptationSetSwitchingCompatibleIds||0===e.adaptationSetSwitchingCompatibleIds.length)return t;const n=b[e.streamInfo.id][e.type].getAllMediaInfos().filter(t=>e.adaptationSetSwitchingCompatibleIds.includes(t.id));return t.concat(n)}catch(t){return[e]}}(e);
2return r.forEach(e=>{let t=u.getVoRepresentations(e);t&&t.length>0&&(n=n.concat(t))}),n=function(e){return e.forEach(t=>{if(t.dependentRepresentation&&null===t.dependentRepresentation.mediaInfo){let n=t.dependentRepresentation.id,r=e.find(e=>e.id===n);r&&(t.dependentRepresentation=r)}}),e}(n),n=function(e){return function(e){let t=null;return e.filter(e=>(t||(t=e.mediaInfo),!isNaN(e.qualityRanking)&&u.areMediaInfosEqual(t,e.mediaInfo))).length===e.length}(e)?function(e){return e.sort((e,t)=>t.qualityRanking-e.qualityRanking),e}(e):function(e){return e.sort((e,t)=>u.areMediaInfosEqual(e.mediaInfo,t.mediaInfo)?function(e,t){if(!isNaN(e.pixelsPerSecond)&&!isNaN(t.pixelsPerSecond)&&e.pixelsPerSecond!==t.pixelsPerSecond)return e.pixelsPerSecond-t.pixelsPerSecond;const n=e.bandwidth-t.bandwidth;return 0!==n?n:L(e,t)}(e,t):function(e,t){if(!isNaN(e.pixelsPerSecond)&&!isNaN(t.pixelsPerSecond)&&e.pixelsPerSecond!==t.pixelsPerSecond)return e.pixelsPerSecond-t.pixelsPerSecond;if(!isNaN(e.bitsPerPixel)&&!isNaN(t.bitsPerPixel)&&e.bitsPerPixel!==t.bitsPerPixel)return t.bitsPerPixel-e.bitsPerPixel;const n=e.bandwidth-t.bandwidth;return 0!==n?n:L(e,t)}(e,t)),e}(e)}
2(n),n.forEach((e,t)=>{e.absoluteIndex=t}),n=n.filter(n=>{const r=!!t||u.areMediaInfosEqual(n.mediaInfo,e),i=!n||!n.mediaInfo||c.areKeyIdsUsable(n.mediaInfo);return r&&i}),n}function L(e,t){const n=e.isBootstrapRepresentation();return n!==t.isBootstrapRepresentation()?n?-1:1:t.k-e.k}function F(e){const t=e.request.mediaType,n=e.streamId;if(!(t&&n&&b[n]&&N.get().streaming.abr.autoSwitchBitrate[t]))return;const l=b[n][t];if(!l)return;var u;if((u=l.getLastSegment())&&u.isPartialSegment&&!isNaN(u.totalNumberOfPartialSegments)&&!isNaN(u.replacementSubNumber)&&0!==u.replacementSubNumber)return;const c=x(l,e.request),d=s.shouldAbandonFragment(c);d&&d.representation!==i.default.NO_CHANGE&&function(e,t,n,i,s){if(i.getFragmentModel().getRequests({state:te.FRAGMENT_MODEL_LOADING,index:e.request.index})[0]){const e=function(e,t){return r[e]&&r[e][t]?r[e][t]:null}(t,n);e&&(e.state=o.ABANDON_LOAD),D.reset(),q(n,C.getActiveStreamInfo(),s.representation,s.reason),clearTimeout(a),a=setTimeout(()=>{e&&(r[t][n].state=o.ALLOW_LOAD),a=null},N.get().streaming.abandonLoadTimeout)}}(e,n,t,l,d)}function U(){if(N.get().streaming.abr.limitBitrateByPortal)for(const e in b)for(const t in b[e])G(t,e)}function x(t,n){return re(e).create({abrController:S,adapter:u,currentRequest:n,droppedFramesHistory:y,streamProcessor:t,switchRequestHistory:D,throughputController:v,videoModel:M})}function B(e){e.mediaType===h.default.VIDEO&&(Y(e.streamId),m=e.newRepresentation.id)}function k(e){!j()||e.metric!==o.BUFFER_LEVEL||e.mediaType!==h.default.AUDIO&&e.mediaType!==h.default.VIDEO||function(e,t){try{const n=A.getBufferTimeDefault(),r=n,i=.5*n,a=s.getBolaState(e),o=t>=(a?i:r);s.setBolaState(e,o),o!==a&&(o?I.info("["+e+"] switching from throughput to buffer occupancy ABR rule (buffer: "+t.toFixed(3)+")."):I.info("["+e+"] switching from buffer occupancy to throughput ABR rule (buffer: "+t.toFixed(3)+")."))}catch(e){I.error(e)}}(e.mediaType,.001*e.value.level)}function G(e,t){try{if(!(e&&b&&b[t]&&b[t][e]))return!1;Y(t);const n=b[t][e],i=n.getLastSegment(),a=n.getRepresentationController()?.getCurrentCompositeRepresentation(),l=H(i,a);if(!N.get().streaming.abr.autoSwitchBitrate[e]||!l)return!1;const u=x(n),c=s.getBestPossibleSwitchRequest(u);if(!c||!c.representation)return!1;let d=c.representation;return function(e,t){D.push({currentRepresentation:e,newRepresentation:t})}(a,d),d.id!==a.id&&(r[t][e].state===o.ALLOW_LOAD||d.absoluteIndex<a.absoluteIndex)&&(K(e,a,d,c.reason),!0)}catch(e){return I.error(e),!1}}function H(e,t){return!(e&&e.isPartialSegment&&!isNaN(e.totalNumberOfPartialSegments)&&!isNaN(e.replacementSubNumber))||e.replacementSubNumber===e.totalNumberOfPartialSegments-1||function(e,t){if(!t||!t.segmentSequenceProperties||t.segmentSequenceProperties.length<=0)return!1;if(t&&t.mediaInfo&&t.mediaInfo.adaptationSetSwitchingCompatibleIds&&t.mediaInfo.adaptationSetSwitchingCompatibleIds.length>0)return!1;const n=t.segmentSequenceProperties.filter(e=>!isNaN(e.sapType)&&e.sapType<=1);if(0===n.length)return!1;let r=(e.replacementSubNumber+1)%e.totalNumberOfPartialSegments;return n.some(e=>r%e.cadence==0)}(e,t)}function Y(e){if(y){const t=M.getPlaybackQuality();t&&y.push(e,m,t)}}function q(e,t,n,r={}){if(!(t&&t.id&&e&&b&&b[t.id]&&b[t.id][e]&&n))return!1;const i=b[t.id][e],a=i.getRepresentationController()?.getCurrentCompositeRepresentation();return(!a||n.id!==a.id)&&K(e,a,n,r)}function V(e,t){return`${e}-${t}`}function K(e,t,r,i){const a=r.mediaInfo.streamInfo.id;if(!e||!b[a]||!b[a][e])return!1;const o=b[a][e].getStreamInfo(),s=T.getCurrentBufferLevel(e),l=null!==t&&!u.areMediaInfosEqual(t.mediaInfo,r.mediaInfo),c=t?t.bitrateInKbit:0;return I.info(`[AbrController]: Switching quality in period ${a} for media type ${e}. Switch from bitrate ${c} to bitrate ${r.bitrateInKbit}. Current buffer level: ${s}. Reason:`+(i?JSON.stringify(i):"/")),n.trigger(p.default.QUALITY_CHANGE_REQUESTED,{isAdaptationSetSwitch:l,mediaType:e,newRepresentation:r,oldRepresentation:t,reason:i,streamInfo:o},{streamId:o.id,mediaType:e}),function(e){const t=v.getAverageThroughput(e);isNaN(t)||_.setSavedBitrateSettings(e,t)}(e),!0}function j(){return N.get().streaming.abr.rules.bolaRule.active&&N.get().streaming.abr.rules.throughputRule.active}return S={canPerformQualitySwitch:H,checkPlaybackQuality:G,clearDataForStream:function(e){y&&y.clearForStream(e),b[e]&&delete b[e],D&&D.clearForStream(e),r[e]&&delete r[e],s.clearDataForStream(e)},getAbandonmentStateFor:function(e,t){return r[e]&&r[e][t]?r[e][t].state:null},getInitialBitrateFor:function(e){if(e===h.default.TEXT)return NaN;let t=A.getAbrBitrateParameter("initialBitrate",e);if(t>0)return t;let n=NaN;if(_&&_.hasOwnProperty("getSavedBitrateSettings")&&(n=_.getSavedBitrateSettings(e)),!isNaN(n))return n;const r=v.getAverageThroughput(e);return!isNaN(r)&&r>0?r:e===h.default.VIDEO?1e3:100},getOptimalRepresentationForBitrate:function(e,t,n=!0){const r=P(e,n);if(!r||0===r.length)return null;const i=r.reduce((e,t)=>
2e.bandwidth<t.bandwidth?e:t);if(t<=0)return i;const a=r.filter(e=>e.bitrateInKbit<=t);return a&&0!==a.length?a.reduce((e,t)=>t.absoluteIndex>e.absoluteIndex?t:e):i},getPossibleVoRepresentations:function(e,t=!0){return O(e,t)},getPossibleVoRepresentationsFilteredBySettings:P,getRepresentationByAbsoluteIndex:function(e,t,n=!0){return isNaN(e)||e<0?null:P(t,n).find(t=>t.absoluteIndex===e)},handleNewMediaInfo:function(e){s.handleNewMediaInfo(e)},handlePendingManualQualitySwitch:function(e,t){try{const n=V(e,t);let r=null;if(R.has(n)&&(r=R.get(n)),!r)return!1;const i=b[e][t];if(!H(i.getLastSegment(),i.getRepresentation()))return!1;const{type:a,streamInfo:o,representation:s,reason:l}=r;return R.delete(n),q(a,o,s,l),!0}catch(e){I.error(`Can not handle pending manual quality switch: ${e}`)}},initialize:function(){y=se(e).create(),D=ae(e).create(),s=z(e).create({dashMetrics:T,customParametersModel:E,mediaPlayerModel:A,settings:N}),s.initialize(),n.on(p.default.QUALITY_CHANGE_RENDERED,B,S),n.on(p.default.METRIC_ADDED,k,S),n.on(g.default.LOADING_PROGRESS,F,S),n.on(g.default.VIDEO_ELEMENT_RESIZED,U,S)},isPlayingAtLowestQuality:function(e){return P(e.mediaInfo,!0)[0].id===e.id},isPlayingAtTopQuality:function(e){if(!e)return!0;const t=P(e.mediaInfo,!0);return t[t.length-1].id===e.id},manuallySetPlaybackQuality:function(e,t,n,r={}){const i=b[t.id][e];if(H(i.getLastSegment(),i.getRepresentation()))return q(e,t,n,r);!function(e,t,n,r){try{I.debug(`[AbrController] Queuing manual quality switch for stream ${t.id} and type ${e} to representation ${n.id}`);const i=V(t.id,e);R.set(i,{type:e,streamInfo:t,representation:n,reason:r})}catch(e){I.error(`Can not queue manual quality switch: ${e}`)}}(e,t,n,r)},registerStreamType:function(e,t){const n=t.getStreamInfo().id;b[n]||(b[n]={}),b[n][e]=t,r[n]||(r[n]={}),r[n][e]={},r[n][e].state=o.ALLOW_LOAD,void 0===s.getBolaState(e)&&s.setBolaState(e,N.get().streaming.abr.rules.bolaRule.active&&!j())},reset:function(){w(),n.off(p.default.QUALITY_CHANGE_RENDERED,B,S),n.off(p.default.METRIC_ADDED,k,S),n.off(g.default.LOADING_PROGRESS,F,S),n.off(g.default.VIDEO_ELEMENT_RESIZED,U,S),s&&s.reset()},setConfig:function(e){e&&(e.streamController&&(C=e.streamController),e.throughputController&&(v=e.throughputController),e.domStorage&&(_=e.domStorage),e.mediaPlayerModel&&(A=e.mediaPlayerModel),e.customParametersModel&&(E=e.customParametersModel),e.cmsdModel&&(d=e.cmsdModel),e.dashMetrics&&(T=e.dashMetrics),e.adapter&&(u=e.adapter),e.videoModel&&(M=e.videoModel),e.settings&&(N=e.settings),e.capabilities&&(c=e.capabilities))},setPlaybackQuality:q,unRegisterStreamType:function(e,t){try{b[e]&&b[e][t]&&delete b[e][t],r[e]&&r[e][t]&&delete r[e][t]}catch(e){}}},I=t.getLogger(S),w(),S}le.__dashjs_factory_name="AbrController";const ue=r.default.getSingletonFactory(le);r.default.updateSingletonFactory(le.__dashjs_factory_name,ue);var ce,de,fe,ge,he,pe=ue,me={};ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",de=function(e){for(var t=0,n=[],r=0|e.length/3;0<r--;){var i=(e[t]<<16)+(e[t+1]<<8)+e[t+2];t+=3,n.push(ce.charAt(63&i>>18)),n.push(ce.charAt(63&i>>12)),n.push(ce.charAt(63&i>>6)),n.push(ce.charAt(63&i))}return 2==e.length-t?(i=(e[t]<<16)+(e[t+1]<<8),n.push(ce.charAt(63&i>>18)),n.push(ce.charAt(63&i>>12)),n.push(ce.charAt(63&i>>6)),n.push("=")):1==e.length-t&&(i=e[t]<<16,n.push(ce.charAt(63&i>>18)),n.push(ce.charAt(63&i>>12)),n.push("==")),n.join("")},fe=function(){for(var e=[],t=0;t<64;++t)e[ce.charCodeAt(t)]=t;return e["=".charCodeAt(0)]=0,e}(),ge=function(e){for(var t=0,n=[],r=0|e.length/4;0<r--;){var i=(fe[e.charCodeAt(t)]<<18)+(fe[e.charCodeAt(t+1)]<<12)+(fe[e.charCodeAt(t+2)]<<6)+fe[e.charCodeAt(t+3)];n.push(255&i>>16),n.push(255&i>>8),n.push(255&i),t+=4}return n&&("="==e.charAt(t-2)?(n.pop(),n.pop()):"="==e.charAt(t-1)&&n.pop()),n},he={encode:function(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t},decode:function(e){for(var t=0;t<s.length;++t)a[t]=String.fromCharCode(a[t]);return a.join("")}},me.decodeArray=function(e){var t=ge(e);return new Uint8Array(t)},me.encodeASCII=function(e){var t=he.encode(e);return de(t)},me.decodeASCII=function(e){var t=ge(e);return he.decode(t)},me.encode=function(e){var t=function(e){for(var t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t}(e);return de(t)},me.decode=function(e){return function(e){for(var t=[],n=0;n<e.length;){var r=e[n++];r<128||(r<224?(r=(31&r)<<6,r|=63&e[n++]):r<240?(r=(15&r)<<12,r|=(63&e[n++])<<6,r|=63&e[n++]):(r=(7&r)<<18,r|=(63&e[n++])<<12,r|=(63&e[n++])<<6,r|=63&e[n++])),t.push(String.fromCharCode(r))}return t.join("")}(ge(e))},"undefined"!=typeof exports&&(exports.decode=me.decode,exports.decodeArray=me.decodeArray,exports.encode=me.encode,exports.encodeASCII=me.encodeASCII);var Ee=me,Te=n(7393);const _e=NaN;class ye{constructor(e,t){this.data={baseUrls:e||null,selectedIdx:t||_e},this.children=[]}}function Se(){let e,t,n,r;const i=this.context,a=(0,Te.default)(i).getInstance();function o(e,t,n){const r=s(n);e[t]?a.areEqual(r,e[t].data.baseUrls)||(e[t].data.baseUrls=r,e[t].data.selectedIdx=_e):e[t]=new ye(r)}function s(e){let t=n.getBaseURLsFromElement(e);const i=r.getSynthesizedBaseUrlElements(t);return i&&i.length>
20&&i.forEach(e=>{const n=t.findIndex(t=>t.serviceLocation===e.serviceLocation);-1!==n?t[n]=e:t.push(e)}),t}function l(e,n){const r=n||t;e(r.data),r.children&&r.children.forEach(t=>l(e,t))}function u(){t=new ye}return e={reset:u,update:function(e){!function(e){!function(){if(!n||!n.hasOwnProperty("getBaseURLsFromElement")||!n.hasOwnProperty("getRepresentationSortFunction"))throw new Error("setConfig function has to be called previously")}();const r=s(e);a.areEqual(r,t.data.baseUrls)||(t.data.baseUrls=r,t.data.selectedIdx=_e),e&&e.Period&&e.Period.forEach((e,r)=>{o(t.children,r,e),e.AdaptationSet&&e.AdaptationSet.forEach((e,i)=>{o(t.children[r].children,i,e),e.Representation&&e.Representation.sort(n.getRepresentationSortFunction()).forEach((e,n)=>{o(t.children[r].children[i].children,n,e)})})})}(e)},getForPath:function(e){let n=t;const r=[n.data];return e&&e.forEach(e=>{n=n.children[e],n&&r.push(n.data)}),r.filter(e=>e.baseUrls.length)},invalidateSelectedIndexes:function(e){l(t=>{isNaN(t.selectedIdx)||e===t.baseUrls[t.selectedIdx].serviceLocation&&(t.selectedIdx=_e)})},setConfig:function(e){e.adapter&&(n=e.adapter),e.contentSteeringController&&(r=e.contentSteeringController)},getBaseUrls:function(e){return s(e)}},u(),e}Se.__dashjs_factory_name="BaseURLTreeModel";var Ie=r.default.getClassFactory(Se),Ae=n(893),Re=n(3773),Ne=class{constructor(e){this.url=e||null,this.type=R.HTTPRequest.CONTENT_STEERING_TYPE,this.responseType="json"}},Ce=class{constructor(){this.version=null,this.ttl=300,this.reloadUri=null,this.pathwayPriority=[],this.pathwayClones=[]}},be=n(8854),De=n(6503),ve=n(9415),Me=n(6517),we=n(7263);function Pe(){const e=this.context,t=(0,De.default)(e).getInstance();let n,r,i,a,o,s,u,c,d,f,g,h,m,E,T,_;function y(e){A(e,"baseUrl")}function S(e){A(e,"location")}function I(e){var t,n;e&&e.throughputValues&&e.throughputValues.serviceLocation&&(t=e.throughputValues.serviceLocation,n=e.throughputValues,E[t]||(E[t]=[]),E[t].push(n),E[t].length>4&&E[t].shift())}function A(e,t){if(e&&e.request&&e.request.serviceLocation){const n=e.request.serviceLocation;-1===h[t].all.indexOf(n)&&h[t].all.push(n),h[t].current=n}}function R(){const e=c.getValue();let t=n.getContentSteering(e);return t||(t=g.getServiceDescriptionSettings().contentSteering),!t&&r&&(t=r),r=t,t}function N(){return new Promise(e=>{try{const n=R();if(!n||!n.serverUrl)return void e();const a=function(e){let n=e.serverUrl;i&&i.reloadUri&&(n=t.isRelative(i.reloadUri)?t.resolve(i.reloadUri,e.serverUrl):i.reloadUri);const r=[],a=h.baseUrl.all.concat(h.location.all);if(a.length>0){const e=a.map(e=>{const t=function(e){if(!e||!E[e]||0===E[e].length)return-1;const t=m.getArithmeticMean(E[e],E[e].length,!0);return parseInt(1e3*t)}(e);return{serviceLocation:e,throughput:t}});let t="",n="";e.forEach((e,r)=>{0!==r&&(t+=",",n+=","),t+=e.serviceLocation,n+=e.throughput>-1?e.throughput:""}),r.push({key:"_DASH_pathway",value:`"${t}"`}),r.push({key:"_DASH_throughput",value:n})}return n=we.default.addAdditionalQueryParameterToUrl(n,r),n}(n),o=new Ne(a);T.load({request:o,success:t=>{!function(e){e&&e[be.default.CONTENT_STEERING_RESPONSE.VERSION]&&1===parseInt(e[be.default.CONTENT_STEERING_RESPONSE.VERSION])&&(i=new Ce,i.version=e[be.default.CONTENT_STEERING_RESPONSE.VERSION],e[be.default.CONTENT_STEERING_RESPONSE.TTL]&&!isNaN(e[be.default.CONTENT_STEERING_RESPONSE.TTL])&&(i.ttl=e[be.default.CONTENT_STEERING_RESPONSE.TTL]),e[be.default.CONTENT_STEERING_RESPONSE.RELOAD_URI]&&(i.reloadUri=e[be.default.CONTENT_STEERING_RESPONSE.RELOAD_URI]),e[be.default.CONTENT_STEERING_RESPONSE.PATHWAY_PRIORITY]&&(i.pathwayPriority=e[be.default.CONTENT_STEERING_RESPONSE.PATHWAY_PRIORITY]),e[be.default.CONTENT_STEERING_RESPONSE.PATHWAY_CLONES]&&(i.pathwayClones=e[be.default.CONTENT_STEERING_RESPONSE.PATHWAY_CLONES],i.pathwayClones=i.pathwayClones.filter(e=>function(e){return e[be.default.CONTENT_STEERING_RESPONSE.BASE_ID]&&e[be.default.CONTENT_STEERING_RESPONSE.ID]&&e[be.default.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT]&&e[be.default.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][be.default.CONTENT_STEERING_RESPONSE.HOST]}(e))),D())}(t),s.trigger(p.default.CONTENT_STEERING_REQUEST_COMPLETED,{currentSteeringResponseData:i,url:a}),e()},error:(t,n,a,o)=>{!function(e,t){try{switch(u.warn("Error fetching data from content steering server",e),t.status){case 404:case 410:r=null;break;case 429:const e=t&&t.headers&&t.headers["retry-after"];null!==e&&(i||(i={}),i.ttl=parseInt(e)),D();break;default:D()}}catch(e){u.error(e)}}(t,o),e(t)},complete:()=>{h.baseUrl.all=C(h.baseUrl),h.location.all=C(h.location)}})}catch(t){e(t)}})}function C(e){return e.all&&0!==e.all.length&&e.current?e.all.filter(t=>t===e.current):[]}function b(e){try{const t=[];return e&&0!==e.length&&i&&i.pathwayClones&&0!==i.pathwayClones.length?(i.pathwayClones.forEac
2h(n=>{let r=e.filter(e=>n[be.default.CONTENT_STEERING_RESPONSE.BASE_ID]===e.serviceLocation),i=null;if(r&&r.length>0&&(i=r[0]),i){const e=new URL(i.url);let r=n[be.default.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][be.default.CONTENT_STEERING_RESPONSE.HOST];r=we.default.stringHasProtocol(r)?r:`${e.protocol}//${r}`;const a={synthesizedUrl:`${r}${e.pathname}`,serviceLocation:n[be.default.CONTENT_STEERING_RESPONSE.ID],queryParams:n[be.default.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][be.default.CONTENT_STEERING_RESPONSE.PARAMS],reference:i};t.push(a)}}),t):t}catch(e){return u.error(e),[]}}function D(){i&&i.ttl&&!isNaN(i.ttl)&&(f&&clearTimeout(f),f=setTimeout(()=>{N()},1e3*i.ttl))}function v(){f&&clearTimeout(f),f=null}function M(){i=null,r=null,E={},h={baseUrl:{current:null,all:[]},location:{current:null,all:[]}},v()}return _={reset:function(){M(),s.off(p.default.FRAGMENT_LOADING_STARTED,y,_),s.off(p.default.MANIFEST_LOADING_STARTED,S,_),s.off(p.default.THROUGHPUT_MEASUREMENT_STORED,I,_)},setConfig:function(e){e&&(e.adapter&&(n=e.adapter),e.errHandler&&(o=e.errHandler),e.dashMetrics&&(a=e.dashMetrics),e.mediaPlayerModel&&(d=e.mediaPlayerModel),e.manifestModel&&(c=e.manifestModel),e.serviceDescriptionController&&(g=e.serviceDescriptionController),e.throughputController&&(m=e.throughputController),e.eventBus&&(s=e.eventBus))},loadSteeringData:N,getCurrentSteeringResponseData:function(){return i},shouldQueryBeforeStart:function(){const e=R();return!!e&&e.queryBeforeStart},getSteeringDataFromManifest:R,stopSteeringRequestTimer:v,getSynthesizedBaseUrlElements:function(e){try{return b(e).map(e=>{const t=new ve.default(e.synthesizedUrl,e.serviceLocation);return t.queryParams=e.queryParams,t.dvbPriority=e.reference.dvbPriority,t.dvbWeight=e.reference.dvbWeight,t.availabilityTimeOffset=e.reference.availabilityTimeOffset,t.availabilityTimeComplete=e.reference.availabilityTimeComplete,t})}catch(e){return u.error(e),[]}},getSynthesizedLocationElements:function(e){try{return b(e).map(e=>{const t=new Me.default(e.synthesizedUrl,e.serviceLocation);return t.queryParams=e.queryParams,t})}catch(e){return u.error(e),[]}},initialize:function(){T=(0,Re.default)(e).create({errHandler:o,dashMetrics:a,mediaPlayerModel:d,errors:Ae.default}),s.on(p.default.FRAGMENT_LOADING_STARTED,y,_),s.on(p.default.MANIFEST_LOADING_STARTED,S,_),s.on(p.default.THROUGHPUT_MEASUREMENT_STORED,I,_)}},u=(0,l.default)(e).getInstance().getLogger(_),M(),_}Pe.__dashjs_factory_name="ContentSteeringController";var Oe=r.default.getSingletonFactory(Pe);function Le(e){let t;e=e||{};let n=[];const r=(0,f.default)(this.context).getInstance(),i=(0,u.default)(this.context).getInstance(),a=Oe(this.context).getInstance(),o=e.updateEventName,s=e.addBlacklistEventName;function l(t){if(-1!==n.findIndex(e=>e.entry===t))return;const s=e.enableExpiry?function(){const e=a?a.getCurrentSteeringResponseData():null;return e&&Number.isFinite(e.ttl)?e.ttl:i.get().streaming.blacklistExpiryTime}():NaN;if(e.enableExpiry&&s&&s>0){const e=setTimeout(()=>{c(t)},1e3*s);n.push({entry:t,timeoutId:e})}else n.push({entry:t});r.trigger(o,{entry:t})}function c(e){const t=n.findIndex(t=>t.entry===e);-1!==t&&n.splice(t,1)}function d(e){l(e.entry)}return t={add:l,remove:c,contains:function(e){return!!(n.length&&e&&e.length)&&-1!==n.findIndex(t=>t.entry===e)},reset:function(){s&&r.off(s,d,t);for(const e of n)e.timeoutId&&clearTimeout(e.timeoutId);n=[]}},s&&r.on(s,d,t),t}Le.__dashjs_factory_name="BlackListController";var Fe=r.default.getClassFactory(Le);function Ue(e){let t;const n=(e=e||{}).blacklistController;return t={select:function(e){return e&&function(e){let t,n,r=0,i=[],a=0;if(n=e.sort(function(e,t){let n=e.dvbPriority-t.dvbPriority;return isNaN(n)?0:n}).filter(function(e,t,n){return!t||n[0].dvbPriority&&e.dvbPriority&&n[0].dvbPriority===e.dvbPriority}),n.length)return n.length>1&&(n.forEach(e=>{r+=e.dvbWeight,i.push(r)}),t=Math.floor(Math.random()*r),i.every((e,n)=>(a=n,!(t<e)))),n[a]}(function(e){let t=[];return e.filter(function(e){return!n.contains(e.serviceLocation)||(e.dvbPriority&&t.push(e.dvbPriority),!1)}).filter(function(e){return!t.length||!e.dvbPriority||-1===t.indexOf(e.dvbPriority)})}(e))}},t}Ue.__dashjs_factory_name="DVBSelector";var xe=r.default.getClassFactory(Ue);function Be(e){let t;const n=(e=e||{}).blacklistController;return t={select:function(e){let t,r=0;return e&&e.some((e,t)=>(r=t,!n.contains(e.serviceLocation)))&&(t=e[r]),t}},t}Be.__dashjs_factory_name="BasicSelector";var ke=r.default.getClassFactory(Be),Ge=n(1944),He=n(656);function Ye(){const e=this.context;let t,n,r;function i(e=[],t=[]){let n=0,i=NaN;for(;n<e.length;){const a=e[n],o=t.findIndex(e=>e.serviceLocation&&e.serviceLocation===a);if(-1!==o&&!r.contains(t[o].serviceLocation)){i=o;break}n+=1}return i}return t={selectBaseUrlIndex:function(e){let t=NaN;if(isNaN(e.selectedIdx)){const r=n.getSteeringDataFromManifest();r&&r.defaultServiceLocationArray.length>
20&&(t=i(r.defaultServiceLocationArray,e.baseUrls))}const r=n.getCurrentSteeringResponseData();return e.baseUrls&&e.baseUrls.length&&r&&r.pathwayPriority&&r.pathwayPriority.length&&(t=i(r.pathwayPriority,e.baseUrls)),t},setConfig:function(e){e.blacklistController&&(r=e.blacklistController),e.contentSteeringController&&(n=e.contentSteeringController)}},n=Oe(e).getInstance(),t}Ye.__dashjs_factory_name="ContentSteeringSelector";var qe=r.default.getClassFactory(Ye);function Ve(){const e=this.context,t=(0,f.default)(e).getInstance(),n=(0,u.default)(e).getInstance();let r,i,a,o,s,l;function c(){i.reset()}return r={chooseSelector:function(e){(0,He.checkParameterType)(e,"boolean"),l=e?o:a},select:function(e){if(!e)return;if(n.get().streaming.applyContentSteering){const t=s.selectBaseUrlIndex(e);isNaN(t)||-1===t||(e.selectedIdx=t)}if(!isNaN(e.selectedIdx))return e.baseUrls[e.selectedIdx];let r=l.select(e.baseUrls);return r?(e.selectedIdx=e.baseUrls.indexOf(r),r):(t.trigger(g.default.URL_RESOLUTION_FAILED,{error:new Ge.default(Ae.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,Ae.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE)}),void(l===a&&c()))},reset:c,setConfig:function(e){e.selector&&(l=e.selector),e.contentSteeringSelector&&(s=e.contentSteeringSelector)}},i=Fe(e).create({updateEventName:g.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,addBlacklistEventName:g.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD,enableExpiry:!0}),a=ke(e).create({blacklistController:i}),o=xe(e).create({blacklistController:i}),s=qe(e).create(),s.setConfig({blacklistController:i,addBlacklistEventName:g.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD}),l=a,r}Ve.__dashjs_factory_name="BaseURLSelector";var Ke=r.default.getClassFactory(Ve);function je(){let e,t;const n=this.context,r=(0,f.default)(n).getInstance(),i=(0,De.default)(n).getInstance();let a,o,s;function l(e){a.update(e),o.chooseSelector(t.getIsDVB(e)),r.trigger(p.default.BASE_URLS_UPDATED,{baseUrls:u(e)})}function u(e){return a.getBaseUrls(e)}return e={reset:function(){a.reset(),o.reset()},initialize:function(e){a.setConfig({adapter:t,contentSteeringController:s}),l(e)},resolve:function(e){const t=a.getForPath(e).reduce((e,t)=>{const n=o.select(t);return n?(i.isRelative(n.url)?e.url=i.resolve(n.url,e.url):(e.url=n.url,e.serviceLocation=n.serviceLocation),e.availabilityTimeOffset=n.availabilityTimeOffset,e.availabilityTimeComplete=n.availabilityTimeComplete,e.queryParams=n.queryParams,e):new ve.default},new ve.default);if(!i.isRelative(t.url))return t},setConfig:function(e){e.baseURLTreeModel&&(a=e.baseURLTreeModel),e.baseURLSelector&&(o=e.baseURLSelector),e.adapter&&(t=e.adapter),e.contentSteeringController&&(s=e.contentSteeringController)},getBaseUrls:u,update:l},a=Ie(n).create(),o=Ke(n).create(),r.on(g.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,function(e){a.invalidateSelectedIndexes(e.entry)},e),e}je.__dashjs_factory_name="BaseURLController";var We=r.default.getClassFactory(je);class ze{constructor(e){if(this.offset=e._offset,this.type=e.type,this.size=e.size,this.boxes=[],e.boxes)for(let t=0;t<e.boxes.length;t++)this.boxes.push(new ze(e.boxes[t]));switch(this.isComplete=!0,e.type){case"sidx":if(this.timescale=e.timescale,this.earliest_presentation_time=e.earliest_presentation_time,this.first_offset=e.first_offset,this.references=e.references,e.references){this.references=[];for(let t=0;t<e.references.length;t++){let n={reference_type:e.references[t].reference_type,referenced_size:e.references[t].referenced_size,subsegment_duration:e.references[t].subsegment_duration};this.references.push(n)}}break;case"emsg":this.id=e.id,this.version=1===e.version?1:0,this.value=e.value,this.timescale=e.timescale,this.scheme_id_uri=e.scheme_id_uri,this.presentation_time_delta=1===e.version?e.presentation_time:e.presentation_time_delta,this.event_duration=e.event_duration,this.message_data=e.message_data;break;case"mdhd":this.timescale=e.timescale;break;case"mfhd":this.sequence_number=e.sequence_number;break;case"subs":this.entry_count=e.entry_count,this.entries=e.entries;break;case"tfhd":this.base_data_offset=e.base_data_offset,this.sample_description_index=e.sample_description_index,this.default_sample_duration=e.default_sample_duration,this.default_sample_size=e.default_sample_size,this.default_sample_flags=e.default_sample_flags,this.flags=e.flags;break;case"tfdt":this.version=e.version,this.baseMediaDecodeTime=e.baseMediaDecodeTime,this.flags=e.flags;break;case"trun":if(this.sample_count=e.sample_count,this.first_sample_flags=e.first_sample_flags,this.data_offset=e.data_offset,this.flags=e.flags,this.samples=e.samples,e.samples){this.samples=[];for(let t=0,n=e.samples.length;t<n;
2t++){let n={sample_size:e.samples[t].sample_size,sample_duration:e.samples[t].sample_duration,sample_composition_time_offset:e.samples[t].sample_composition_time_offset};this.samples.push(n)}}break;case"prft":this.version=e.version,this.reference_track_ID=e.reference_track_ID,this.ntp_timestamp_sec=e.ntp_timestamp_sec,this.ntp_timestamp_frac=e.ntp_timestamp_frac,this.media_time=e.media_time,this.flags=e.flags}}getChildBox(e){for(let t=0;t<this.boxes.length;t++)if(this.boxes[t].type===e)return this.boxes[t]}getChildBoxes(e){let t=[];for(let n=0;n<this.boxes.length;n++)this.boxes[n].type===e&&t.push(this.boxes[n]);return t}}var $e=ze;function Qe(){let e,t;function n(e){let n=[];if(!e||!t||"function"!=typeof t.fetchAll)return n;let i,a=t.fetchAll(e);for(let e=0,t=a.length;e<t;e++)i=r(a[e]),i&&n.push(i);return n}function r(e){if(!e)return null;let t=new $e(e);return e.hasOwnProperty("_incomplete")&&(t.isComplete=!e._incomplete),t}return e={getBox:function(e){return e&&t&&t.boxes&&0!==t.boxes.length&&"function"==typeof t.fetch?r(t.fetch(e)):null},getBoxes:n,setData:function(e){t=e},getLastBox:function(){if(!t||!t.boxes||!t.boxes.length)return null;let e=n(t.boxes[t.boxes.length-1].type);return e.length>0?e[e.length-1]:null}},e}Qe.__dashjs_factory_name="IsoFile";var Xe=r.default.getClassFactory(Qe),Ze=n(6877),Je=class{constructor({found:e,sizeOfLastCompletedBox:t,sizeOfLastFoundTargetBox:n,startOffsetOfLastCompletedBox:r,startOffsetOfLastFoundTargetBox:i,typeOfLastCompletedBox:a,typeOfLastTargetBox:o}){this.found=void 0!==e&&e,this.sizeOfLastCompletedBox=void 0!==t?t:0,this.sizeOfLastFoundTargetBox=void 0!==n?n:0,this.startOffsetOfLastCompletedBox=void 0!==r?r:0,this.startOffsetOfLastFoundTargetBox=void 0!==i?i:0,this.typeOfLastCompletedBox=void 0!==a?a:null,this.typeOfLastTargetBox=void 0!==o?o:null}};function et(){let e,t,n=this.context;function r(e){if(!e)return null;void 0===e.fileStart&&(e.fileStart=0);let t=Ze.parseBuffer(e),r=Xe(n).create();return r.setData(t),r}function i(e,t){return e[t+3]>>>0|e[t+2]<<8>>>0|e[t+1]<<16>>>0|e[t]<<24>>>0}function a(e,t){return String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t])}return t={findInitRange:function(t){let n,i,a=null;const o=r(t);if(!o)return a;const s=o.getBox("ftyp"),l=o.getBox("moov");return e.debug("Searching for initialization."),l&&l.isComplete&&(n=s?s.offset:l.offset,i=l.offset+l.size-1,a=n+"-"+i,e.debug("Found the initialization.  Range: "+a)),a},findLastTopIsoBoxCompleted:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new Je({found:!1});const r=t instanceof ArrayBuffer?new Uint8Array(t):t;let o,s=0,l=0,u=null;for(;n<r.byteLength;){const t=i(r,n),c=a(r,n+4);if(0===t)break;n+t<=r.byteLength&&(e.indexOf(c)>=0?o=new Je({found:!0,startOffsetOfLastFoundTargetBox:n,sizeOfLastFoundTargetBox:t,typeOfLastTargetBox:c}):(s=n,l=t,u=c)),n+=t}return o||new Je({found:!1,startOffsetOfLastCompletedBox:s,sizeOfLastCompletedBox:l,typeOfLastCompletedBox:u})},getMediaTimescaleFromMoov:function(e){let t=r(e),n=t?t.getBox("mdhd"):void 0;return n?n.timescale:NaN},getSamplesInfo:function(e){if(!e||0===e.byteLength)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};let t,n,i,a,o,s,l,u,c,d,f,g,h,p,m,E,T,_=r(e),y=_.getBoxes("moof"),S=_.getBoxes("mfhd");E=_.getBoxes("moof").length,m=S[S.length-1].sequence_number,i=0,s=[];let I=-1,A=-1;for(f=0;f<y.length;f++){let e=y[f],r=e.getChildBoxes("traf");for(c=0;c<r.length;c++){let f=r[c],m=f.getChildBox("tfhd"),E=f.getChildBox("tfdt");o=E.baseMediaDecodeTime;let _=f.getChildBoxes("trun"),y=f.getChildBoxes("subs");for(d=0;d<_.length;d++){let r=_[d];for(i=r.sample_count,p=(m.base_data_offset||0)+(r.data_offset||0),u=0;u<i;u++){l=r.samples[u],t=void 0!==l.sample_duration?l.sample_duration:m.default_sample_duration,a=void 0!==l.sample_size?l.sample_size:m.default_sample_size,n=void 0!==l.sample_composition_time_offset?l.sample_composition_time_offset:0;let i={dts:o,cts:o+n,duration:t,offset:e.offset+p,size:a,subSizes:[a]};if(y)for(g=0;g<y.length;g++){let e=y[g];if(I<e.entry_count-1&&u>A&&(I++,A+=e.entries[I].sample_delta),u==A){i.subSizes=[];let t=e.entries[I];for(h=0;h<t.subsample_count;h++)i.subSizes.push(t.subsamples[h].subsample_size)}}s.push(i),p+=a,o+=t}}T=o-E.baseMediaDecodeTime}}return{sampleList:s,lastSequenceNumber:m,totalDuration:T,numSequences:E}},parse:r},e=(0,l.default)(n).getInstance().getLogger(t),t}et.__dashjs_factory_name="BoxParser";var tt=r.default.getSingletonFactory(et),nt=n(559);const rt={0:void 0,1:{channels:1,lfe:0},2:{channels:2,lfe:0},3:{channels:3,lfe:0},4:{channels:4,lfe:0},5:{channels:5,lfe:0},6:{channels:5,lfe:1},7:{channels:7,lfe:1},8:{channels:2,lfe:0},9:{channels:3,lfe:0},10:{channels:4,lfe:0},11:{channels:6,lfe:1},12:{channels:7,lfe:1},13:{channels:22,lfe:2},14:{channels:7,lfe:1},15:{channels:10,lfe:2},16:{channels:9,lfe:1},17:{channels:11,lfe:1},18:{channels:13,lfe:1},19:{channels:11,lfe:1},20:{channels:13,lfe:1}};function it(e){return 0==e?0:e.toString(2).match(/1/g).length}function at(e,t){let n,r=parseInt("0x"+e,16),i=r&t[0],a=r&t[1];return n=it(i)+2*it(a),n}var ot=function(e,t=!1){let n;if(!e||!e.schemeIdUri||!e.value)return;const r=e.schemeIdUri,i=e.value;
2return"urn:mpeg:dash:23003:3:audio_channel_configuration:2011"===r||"urn:mpeg:mpegB:cicp:ChannelConfiguration"===r?n=rt[i]&&rt[i].channels+(t?rt[i].lfe:0):"tag:dolby.com,2014:dash:audio_channel_configuration:2011"===r?n=function(e,t){if(4===e.length)return at(e,[63880+(t?6:0),1648])}(i,t):"tag:dolby.com,2015:dash:audio_channel_configuration:2015"===r?n=function(e,t){if(6===e.length)return"800000"===e?24:at(e,[56834+(t?4160:0),205245])}(i,t):"tag:dts.com,2014:dash:audio_channel_configuration:2012"===r?n=parseInt(i):"tag:dts.com,2018:uhd:audio_channel_configuration"===r&&(n=function(e,t){if(!(e.length>8))return at(e,[4294901727+(t?65568:0),0])}(i,t)),n};function st(){const e=this.context,t=(0,f.default)(e).getInstance();let n,r,i,a,o,s,u;function c(e,t,n,r=void 0){const a=p(e,t,n,r);return i.isCodecSupportedBasedOnTestedConfigurations(a,e)}function d(e,t,n,r,i,a=void 0){const o=p(e,t,n,a),s=JSON.stringify(o);r.has(s)||(r.add(s),i.push(o))}function p(e,t,n,i){let o=null;switch(e){case h.default.VIDEO:o=function(e,t,n){let i={codec:t,width:e&&e.width||null,height:e&&e.height||null,framerate:r.getFramerate(e)||null,bitrate:e&&e.bandwidth||null,isSupported:!0};if(e.tagName===be.default.PRESELECTION&&n&&(i.width||(i.width=n.width||null),i.height||(i.height=n.height||null),i.bitrate||(i.bitrate=n.bandwidth||null),i.framerate||(i.framerate=r.getFramerate(n)||null)),a.get().streaming.capabilities.filterVideoColorimetryEssentialProperties&&(Object.assign(i,E(e)),e.tagName===be.default.PRESELECTION&&n)){let e=E(n),t=e.isSupported;delete e.isSupported,i.isSupported=i.isSupported&&t,m(i,e)}let o=i.isSupported;if(a.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties&&(Object.assign(i,T(e)),e.tagName===be.default.PRESELECTION&&n)){let e=T(n),t=e.isSupported;delete e.isSupported,i.isSupported=i.isSupported&&t,m(i,e)}let s=i.isSupported;return o&&s||(i.isSupported=!1),i}(t,n,i);break;case h.default.AUDIO:o=function(e,t,n){let r={codec:t,samplerate:e&&e.audioSamplingRate||null,bitrate:e&&e.bandwidth||null,isSupported:!0};return e.tagName===be.default.PRESELECTION&&n&&(r.samplerate||(r.samplerate=n.audioSamplingRate||null),r.bitrate||(r.bitrate=n.bandwidth||null)),a.get().streaming.capabilities.filterAudioChannelConfiguration&&Object.assign(r,function(e,t){let n=e[be.default.AUDIO_CHANNEL_CONFIGURATION]||[],r=null;0==n.length&&t&&(n=t[be.default.AUDIO_CHANNEL_CONFIGURATION]||[]);const i=n.map(e=>ot(e,!0));return i.every(e=>e==i[0])&&(r=i[0]),{channels:r}}(e,n)),r}(t,n,i);break;default:return o}return i&&(o=_(i,o)),_(t,o)}function m(e,t){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&!(n in e)&&(e[n]=t[n]);return e}function E(e){let t={colorGamut:null,transferFunction:null,isSupported:!0};for(const n of e.EssentialProperty||[])n.schemeIdUri===h.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&["1","5","6","7"].includes(n.value.toString())?t.colorGamut=h.default.MEDIA_CAPABILITIES_API.COLORGAMUT.SRGB:n.schemeIdUri===h.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&["11","12"].includes(n.value.toString())?t.colorGamut=h.default.MEDIA_CAPABILITIES_API.COLORGAMUT.P3:n.schemeIdUri===h.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&["9"].includes(n.value.toString())?t.colorGamut=h.default.MEDIA_CAPABILITIES_API.COLORGAMUT.REC2020:n.schemeIdUri===h.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&["2"].includes(n.value.toString())?t.colorGamut=null:n.schemeIdUri===h.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&(t.isSupported=!1),n.schemeIdUri===h.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["1","6","13","14","15"].includes(n.value.toString())?t.transferFunction=h.default.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.SRGB:n.schemeIdUri===h.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["16"].includes(n.value.toString())?t.transferFunction=h.default.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.PQ:n.schemeIdUri===h.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["18"].includes(n.value.toString())?t.transferFunction=h.default.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.HLG:n.schemeIdUri===h.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["2"].includes(n.value.toString())?t.transferFunction=null:n.schemeIdUri===h.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&(t.isSupported=!1);return t}function T(e){let t={isSupported:!0,hdrMetadataType:null};for(const n of e.EssentialProperty||[])n.schemeIdUri===h.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&n.value===h.default.HDR_METADATA_FORMAT_VALUES.ST2094_10?t.hdrMetadataType=h.default.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_10:n.schemeIdUri===h.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&n.value===h.default.HDR_METADATA_FORMAT_VALUES.SL_HDR2?t.hdrMetadataType=h.default.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SLHDR2:n.schemeIdUri===h.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&n.value===h.default.HDR_METADATA_FORMAT_VALUES.ST2094_40?t.hdrMetadataType=h.default.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_40:n.schemeIdUri===h.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&(t.isSupported=!1);return t}function _(e,t){return s&&e&&e[be.default.CONTENT_PROTECTION]&&e[be.default.CONTENT_PROTECTION].length>
20&&(t.keySystemsMetadata=s.getSupportedKeySystemMetadataFromContentProtection(e[be.default.CONTENT_PROTECTION])),t}function y(e){if(!e||0===e.length)return!0;let t=0;for(;t<e.length;){if(!i.supportsEssentialProperty(e[t]))return u.debug("[Stream] EssentialProperty not supported: "+e[t].schemeIdUri),!1;t+=1}return!0}return n={setConfig:function(e){e&&(e.adapter&&(r=e.adapter),e.capabilities&&(i=e.capabilities),e.settings&&(a=e.settings),e.protectionController&&(s=e.protectionController),e.customParametersModel&&(o=e.customParametersModel))},filterUnsupportedFeatures:function(e){return new Promise(n=>{const s=[h.default.VIDEO,h.default.AUDIO],l=[];s.forEach(t=>{const n=function(e,t){if(!e||!e.Period||0===e.Period.length)return[];const n=new Set,i=[];return e.Period.forEach(e=>{e.AdaptationSet.forEach(e=>{r.getIsTypeOf(e,t)&&e.Representation.forEach((a,o)=>{const s=r.getCodec(e,o,!1);d(t,a,s,n,i);const l=r.getSupplementalCodecs(a);l.length>0&&d(t,a,l[0],n,i)})}),e.Preselection&&e.Preselection.length&&e.Preselection.forEach(a=>{if(r.getPreselectionIsTypeOf(a,e.AdaptationSet,t)){const o=r.getCodecForPreselection(a,e.AdaptationSet),s=r.getCommonRepresentationForPreselection(a,e.AdaptationSet);d(t,a,o,n,i,s)}})}),i}(e,t);n.forEach(e=>{l.push(i.runCodecSupportCheck(e,t))})}),Promise.allSettled(l).then(()=>(s.forEach(n=>
2{!function(e,n){n&&n.Period&&0!==n.Period.length&&n.Period.forEach(n=>{!function(e,n){e&&e.AdaptationSet&&0!==e.AdaptationSet.length&&(e.AdaptationSet=e.AdaptationSet.filter(e=>{r.getIsTypeOf(e,n)&&function(e,t){e.Representation&&0!==e.Representation.length&&(e.Representation=e.Representation.filter((n,i)=>{const a=r.getCodec(e,i,!1),o=c(t,n,a);let s=function(e,t){let n=!1;const i=r.getSupplementalCodecs(e);return i.length>0&&(i.length>1&&u.warn("[CapabilitiesFilter] Multiple supplemental codecs not supported; using the first in list"),n=c(t,e,i[0])),n}(n,t);return s&&(u.debug(`[CapabilitiesFilter] Codec supported. Upgrading codecs string of Representation with ID ${n.id}`),n.codecs=n[be.default.SUPPLEMENTAL_CODECS]),o||s||u.warn(`[CapabilitiesFilter] Codec ${a} not supported. Removing Representation with ID ${n.id}`),o||s}))}(e,n);const i=e.Representation&&e.Representation.length>0;return i||(t.trigger(g.default.ADAPTATION_SET_REMOVED_NO_CAPABILITIES,{adaptationSet:e}),u.warn(`[CapabilitiesFilter] AdaptationSet with ID ${e.id?e.id:"undefined"} and codec ${e.codecs?e.codecs:"undefined"} has been removed because of no supported Representation`)),i}))}(n,e),function(e,t){e&&e.Preselection&&0!==e.Preselection.length&&(e.Preselection=e.Preselection.filter(n=>{if(r.getPreselectionIsTypeOf(n,e.AdaptationSet,t)){const i=r.getCodecForPreselection(n,e.AdaptationSet);let a=!0;if(i){let o=r.getCommonRepresentationForPreselection(n,e.AdaptationSet);a=c(t,n,i,o)}return a||u.warn(`[CapabilitiesFilter] Preselection@codecs ${i} not supported. Removing Preselection with ID ${n.id}`),a}return!0}))}(n,e)})}(n,e)}),a.get().streaming.capabilities.filterUnsupportedEssentialProperties&&function(e){e&&e.Period&&0!==e.Period.length&&e.Period.forEach(e=>{e.AdaptationSet=e.AdaptationSet.filter(e=>{if(!e.Representation||0===e.Representation.length)return!0;if(!y(r.getEssentialProperties(e)))return u.warn(`[CapabilitiesFilter] removed AdaptationSet (id: ${e.id}) with unsupported EssentialProperty`),!1;e.Representation=e.Representation.filter(e=>y(r.getEssentialProperties(e)));const t=e.Representation&&e.Representation.length>0;return t||u.warn(`[CapabilitiesFilter] removed AdaptationSet (id: ${e.id}) with unsupported EssentialProperty on all Representations`),t}),e.Preselection&&e.Preselection.length&&(e.Preselection=e.Preselection.filter(e=>!!y(r.getEssentialProperties(e))||(u.warn(`[CapabilitiesFilter] removed Preselection (id: ${e.id}) with unsupported EssentialProperty`),!1)))})}(e),function(e){e&&e.Period&&0!==e.Period.length&&e.Period.forEach(e=>{e.Preselection&&(e.Preselection=e.Preselection.filter(e=>{const t=String(e.preselectionComponents).split(" ").length;return 1!==t&&u.warn(`Multi-Representation Preselection (id: ${e.id}) removed as not supported.`),1===t}))})}(e),function(e){e&&e.Period&&0!==e.Period.length&&e.Period.forEach(e=>{e.Preselection&&(e.Preselection=e.Preselection.filter(t=>{const n=String(t.preselectionComponents).split(" "),r=e.AdaptationSet.map(e=>e.id);return n.every(e=>r.includes(e))}))})}(e),function(e){if(!e||!e.Period||0===e.Period.length)return Promise.resolve();const t=[];return e.Period.forEach(e=>{t.push(function(e){return new Promise(t=>{if(!e||!e.AdaptationSet||0===e.AdaptationSet.length)return void t();const n=[];e.AdaptationSet.forEach(e=>{n.push(function(e){return new Promise(t=>{if(!e.Representation||0===e.Representation.length)return void t();const n=[];e.Representation.forEach(e=>{n.push(function(e){const t=[],n=o.getCustomCapabilitiesFilters();return n&&0!==n.length?n.forEach(n=>{t.push(new Promise(t=>t(n(e))))}):t.push(Promise.resolve(!0)),Promise.all(t)}(e))}),Promise.all(n).then(n=>{e.Representation=e.Representation.filter((e,t)=>{let r=n[t].every(e=>e);return r||u.debug("[Stream] Representation "+e.id+" has been removed because of unsupported CustomFilter"),r}),t()}).catch(e=>{u.warn("[Stream] at least one promise rejected in CustomFilter with error: ",e),t()})})}(e))}),Promise.all(n).then(()=>{e.AdaptationSet=e.AdaptationSet.filter(e=>e.Representation&&e.Representation.length>0),t()}).catch(()=>{t()})})}(e))}),Promise.all(t)}(e))).then(()=>{n()}).catch(e=>{u.error(e),n()})})}},u=(0,l.default)(e).getInstance().getLogger(n),n}st.__dashjs_factory_name="CapabilitiesFilter";var lt=r.default.getSingletonFactory(st),ut=n(1234);function ct(){const e=this.context,t=(0,f.default)(e).getInstance();let n,r,i,a,s,u,c,d,m,E;function T(){r=!1;const e=we.default.parseUserAgent();i=e&&e.browser&&e.browser.name&&"safari"===e.browser.name.toLowerCase()}function _(){r=!1}function y(e){if(e.streamId!==u.getActiveStreamInfo().id||!m)return;const t=c.getLiveDelay();c.getBufferLevel()>t/2&&(m=!1)}function S(e){e.streamId===u.getActiveStreamInfo().id&&(m=e.state===o.BUFFER_EMPTY)}function I(){d.getCatchupModeEnabled()||a.setPlaybackRate(1)}function A(){c.getIsDynamic()&&d.getCatchupModeEnabled()&&(d.getCatchupPlaybackRates().max>0||d.getCatchupPlaybackRates().min<0)&&!c.isPaused()&&!c.isSeeking()&&function(){try{if(c.getTime()<=0||r)return!1;if(m&&0===a.getPlaybackRate())return!1;const e=C();return e===h.default.LIVE_CATCHUP_MODE_LOLP?function(e,t){try{return Math.abs(R())>0||e<t}catch(e){return!1}}(c.getBufferLevel(),s.get().streaming.liveCatchup.playbackBufferMin):e===h.default.LIVE_CATCHUP_MODE_STEP?function(){try{const e=d.getCatchupStepSettings(),t=N();if(t<-1*e.start.min||t>e.start.max)return E.debug(`[_stepNeedToCatchUp] latency offset ${t}`),!0;if(1!==c.getPlaybackRate())return!0}catch(e){return!1}}():function(){try{return Math.abs(R())>0}catch(e){return!1}}()}catch(e){return!1}}()&&function(){if(!r&&a){let e;const t=a.getPlaybackRate(),n=d.getCatchupPlaybackRates(),o=c.getBufferLevel(),l=R(),u=N(),f=s.get().streaming.liveCatchup.liveThreshold,g=d.getCatchupMaxDrift();if(!isNaN(g)&&g>0&&l>g)E.info("[CatchupController]: Low Latency catchup mechanism. Latency too high, doing a seek to live point"),r=!0,c.seekToCurrentLive(!0,!1);else if(!isNaN(f)&&f>0&&u>f)t>1&&(E.info("[CatchupController]: Past live threshold, setting playback rate to 1.0"),a.setPlaybackRate(1));else{const r=c.getCurrentLiveLatency(),l=c.getLiveDelay();e=C()===h.default.LIVE_CATCHUP_MODE_LOLP?function(e,t,n,r,i){let a;if(i<r){const t=Math.abs(e.min),n=5*(i-r);a=1-t+2*t/(1+Math.pow(Math.E,-n)),E.debug("[LoL+ playback control_buffer-based] bufferLevel: "+i+", newRate: "+a)}else{const r=.02;if(Math.abs(t-n)<=r*n)a=1;else{const r=t-n,i=r<0?Math.abs(e.min):e.max,o=5*r;a=1-i+2*i/(1+Math.pow(Math.E,-o))}E.debug("[LoL+ playback control_latency-based] latency: "+t+", newRate: "+a)}return a}(n,r,l,s.get().streaming.liveCatchup.playbackBufferMin,o):C()===h.default.LIVE_CATCHUP_MODE_STEP?function(e,t,n){let r=1;const i=d.getCatchupStepSettings();if(!m){const a=N();a>i.stop.max&&a>0?r=1+e.max:a<-1*i.stop.min&&a<0&&(r=1+e.min),(a>-1*i.stop.min&&a<0||a<i.stop.max&&a>0||0===a)&&(r=1),c.getPlaybackStalled()&&n<=t/2&&a>0&&(r=1)}return E.debug(`[_calculateNewPlaybackRateStep] rate should be ${r}`),r}(n,l,o):function(e,t,n,r){if(m)return 1;const i=t-n,a=i<0?Math.abs(e.min):e.max,o=5*i;let s=1-a+2*a/(1+Math.pow(Math.E,-o));return c.getPlaybackStalled()&&r<=n/2&&i>0&&(s=1),s}(n,r,l,o);const u=i?.25:.02/(.5/n.max);(e&&Math.abs(t-e)>=u||1==e)&&(E.debug(`[CatchupController]: Setting playback rate to ${e}`),a.setPlaybackRate(e))}}}()}function R(){return c.getCurrentLiveLatency()-c.getLiveDelay()}function N(){return c.getCurrentLiveLatency()-c.getOriginalLiveDelay()}function C(){const e=s.get().streaming.liveCatchup.playbackBufferMin;let t=h.default.LIVE_CATCHUP_MODE_DEFAULT;return s.get().streaming.liveCatchup.mode===h.default.LIVE_CATCHUP_MODE_STEP?t=h.default.LIVE_CATCHUP_MODE_STEP:s.get().streaming.liveCatchup.mode!==h.default.LIVE_CATCHUP_MODE_LOLP||null===e||isNaN(e)||(t=h.default.LIVE_CATCHUP_MODE_LOLP),t}function b(){d.getCatchupPlaybackRates(!0)}return n={reset:function(){t.off(p.default.BUFFER_LEVEL_UPDATED,y,n),t.off(p.default.BUFFER_LEVEL_STATE_CHANGED,S,n),t.off(p.default.PLAYBACK_PROGRESS,A,n),t.off(p.default.PLAYBACK_TIME_UPDATED,A,n),t.off(p.default.PLAYBACK_SEEKED,_,n),t.off(g.default.SETTING_UPDATED_CATCHUP_ENABLED,I,n),t.off(g.default.SETTING_UPDATED_PLAYBACK_RATE_MIN,b,n),t.off(g.default.SETTING_UPDATED_PLAYBACK_RATE_MAX,b,n),t.off(p.default.STREAM_INITIALIZED,b,n),T(),a.setPlaybackRate(1,!0)},setConfig:function(e){e&&(e.settings&&(s=e.settings),e.videoModel&&(a=e.videoModel),e.streamController&&(u=e.streamController),e.playbackController&&(c=e.playbackController),e.mediaPlayerModel&&(d=e.mediaPlayerModel))},initialize:function(){t.on(p.default.BUFFER_LEVEL_UPDATED,y,n),t.on(p.default.BUFFER_LEVEL_STATE_CHANGED,S,n),t.on(p.default.PLAYBACK_PROGRESS,A,n),t.on(p.default.PLAYBACK_TIME_UPDATED,A,n),t.on(p.default.PLAYBACK_SEEKED,_,n),t.on(g.default.SETTING_UPDATED_CATCHUP_ENABLED,I,n),t.on(g.default.SETTING_UPDATED_PLAYBACK_RATE_MIN,b,n),t.on(g.default.SETTING_UPDATED_PLAYBACK_RATE_MAX,b,n),t.on(p.default.STREAM_INITIALIZED,b,n),b()}},E=(0,l.default)(e).getInstance().getLogger(n),T(),n}ct.__dashjs_factory_name="CatchupController";var dt=r.default.getSingletonFactory(ct);function ft(){let e,t;return e={setConfig:function(e){e&&e.serviceDescriptionController&&(t=e.serviceDescriptionController)},isAdaptationsIncluded:function(e){const{adaptationSetsArray:n}=t?.getServiceDescriptionSettings()?.clientDataReporting??{};return!n||0===n?.length||n.includes(e)},isServiceLocationIncluded:function(e,n){if(e===R.HTTPRequest.CONTENT_STEERING_TYPE)return!0;const{serviceLocationsArray:r}=t?.getServiceDescriptionSettings()?.clientDataReporting??{};return!r||0===r?.length||r.includes(n)}},e}ft.__dashjs_factory_name="ClientDataReportingController";var gt=r.default.getSingletonFactory(ft),ht=n(6066),pt=n(1926);const mt=[{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"}],Et="dashjs_?_bitrate",Tt="dashjs_?_settings",_t="localStorage",yt="lastBitrate",St="lastMediaSettings";function It(e){e=e||{};const t=this.context,n=e.settings;let r,i,a;function o(e){if(void 0!==a)return a;let t;a=!1;try{"undefined"!=typeof window&&(t=window[e])}catch(e){return i.warn("DOMStorage access denied: "+e.message),a}if(!t||e!==_t&&"sessionStorage"!==e)return a;try{t.setItem("1","1"),t.removeItem("1"),a=!0}catch(e){i.warn("DOMStorage is supported, but cannot be used: "+e.message)}return a}function s(){const e=6e5;return Math.round((new Date).getTime()/e)*e}function u(e,t){return o(e)&&n.get().streaming[t+"CachingInfo"].enabled}function c(){if(!n)throw new Error(h.default.MISSING_CONFIG_ERROR)}return r={getSavedBitrateSettings:function(e){if(c(),!n.get().streaming.lastBitrateCachingInfo.enabled)return NaN;let t=NaN;if(u(_t,yt)){const r=Et.replace(/\?/,e);try{const a=JSON.parse(localStorage.getItem(r))||{},o=(new Date).getTime()-parseInt(a.timestamp,10)>=n.get().streaming.lastBitrateCachingInfo.ttl||!1,s=parseFloat(a.bitrate);isNaN(s)||o?o&&localStorage.removeItem(r):(t=s,i.debug("Last saved bitrate for "+e+" was "+s))}catch(e){return null}}return t},setSavedBitrateSettings:function(e,t){if(u(_t,yt)&&t){const n=Et.replace(/\?/,e);try{localStorage.setItem(n,JSON.stringify({bitrate:t.toFixed(3),timestamp:s()}))}catch(e){i.error(e.message)}}},getSavedMediaSettings:function(e){if(c(),!n.get().streaming.lastMediaSettingsCachingInfo.enabled)return null;let t=null;if(u(_t,St)){const r=Tt.replace(/\?/,e);try{const e=JSON.parse(localStorage.getItem(r))||{},i=(new Date).getTime()-parseInt(e.timestamp,10)>=n.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;t=e.settings,i&&(localStorage.removeItem(r),t=null)}catch(e){return null}}return t},setSavedMediaSettings:function(e,t){if(u(_t,St)){const n=Tt.replace(/\?/,e);try{localStorage.setItem(n,JSON.stringify({settings:t,timestamp:s()}))}catch(e){i.error(e.message)}}}},i=(0,l.default)(t).getInstance().getLogger(r),o(_t)&&mt.forEach(e
2=>{const t=localStorage.getItem(e.oldKey);if(t){localStorage.removeItem(e.oldKey);try{localStorage.setItem(e.newKey,t)}catch(e){i.error(e.message)}}}),r}It.__dashjs_factory_name="DOMStorage";var At=r.default.getSingletonFactory(It);function Rt(){const e=this.context,t=(0,u.default)(e).getInstance();let n={},r=[];return{save:function(e){const i=e.streamId,a=e.representation.id;n[i]=n[i]||{};const o=!n[i][a];n[i][a]=e,o&&(r.push({streamId:i,representationId:a}),function(){const e=t.get().streaming.cacheInitSegmentsLimit;for(;r.length>e;){const e=r.shift();n[e.streamId]&&n[e.streamId][e.representationId]&&(delete n[e.streamId][e.representationId],0===Object.keys(n[e.streamId]).length&&delete n[e.streamId])}}())},extract:function(e,t){return n&&n[e]&&n[e][t]?n[e][t]:null},reset:function(){n={},r=[]},getStats:function(){const e=Object.keys(n).length;let i=0;for(const e in n)i+=Object.keys(n[e]).length;return{entryCount:i,streamCount:e,maxSize:t.get().streaming.cacheInitSegmentsLimit,accessOrderLength:r.length}}}}Rt.__dashjs_factory_name="InitCache";var Nt=r.default.getSingletonFactory(Rt),Ct=class{constructor(){this.accessibility=null,this.adaptationSetSwitchingCompatibleIds=[],this.audioChannelConfiguration=null,this.bitrateList=null,this.co
2dec=null,this.contentProtection=null,this.essentialProperties=[],this.id=null,this.index=null,this.isEmbedded=null,this.isFragmented=null,this.isPreselection=!1,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.segmentSequenceProperties=[],this.selectionPriority=1,this.streamInfo=null,this.subSegmentAlignment=!1,this.supplementalProperties=[],this.type=null,this.viewpoint=null}},bt=class{constructor(){this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0,this.isEncrypted=!1}},Dt=class{constructor(){this.availableFrom=null,this.duration=NaN,this.dvrWindowSize=NaN,this.isDynamic=!1,this.loadedTime=null,this.maxFragmentDuration=null,this.minBufferTime=NaN,this.protocol=null,this.serviceDescriptions=[]}},vt=n(1465),Mt=n(9302),wt=class{constructor(e){this.valid="/"==e[0],this.path=e.split("/").filter(e=>0!==e.length).map(e=>{let t={name:e},n=e.indexOf("[");if(-1!=n){t.name=e.substring(0,n);let r=e.substring(n+1,e.length-1);this.valid=this.valid&&-1==r.indexOf("[");let i=r.indexOf("=");-1!=i?(t.attribute={name:r.substring(1,i),value:r.substring(i+1)},-1!=["'",'"'].indexOf(t.attribute.value[0])&&(t.attribute.value=t.attribute.value.substring(1,t.attribute.value.length-1))):t.position=parseInt(r,10)-1}return t})}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(e,t){let n=null,r=e,i=1,a="MPD";for(;i<this.path.length&&null!==r;){n=r;let e=this.path[i];if(a=e.name,i!==this.path.length-1||!a.startsWith("@")&&"text()"!==a){let t=n[a]||[];if(0===t.length&&n[a]&&t.push(n[a]),e.position)r=t[e.position]||null;else if(e.attribute){let n=e.attribute;r=t.filter(e=>e[n.name]==n.value)[0]||null}else r=Array.isArray(t)?t[0]:t}i++}return null===r?null:a.startsWith("@")?{name:a.substring(1),leaf:r,target:r}:"text()"===a?{name:"__text",leaf:r,target:r}:{name:a,leaf:r,target:t?n:r}}},Pt=class{constructor(e,t,n){this.action=e,this.xpath=t,this.value=n,this.position=null}getMpdTarget(e){let t="remove"===this.action||"replace"===this.action||"before"===this.position||"after"===this.position;return this.xpath.getMpdTarget(e,t)}};function Ot(){let e,t;const n=this.context;return e={getIsPatch:function(e){return e&&e.hasOwnProperty(be.default.ORIGINAL_MPD_ID)||!1},getMpdId:function(e){return e&&e[be.default.ORIGINAL_MPD_ID]||null},getOriginalPublishTime:function(e){return e&&e.hasOwnProperty(be.default.ORIGINAL_PUBLISH_TIME)?new Date(e[be.default.ORIGINAL_PUBLISH_TIME]):null},getPatchOperations:function(e){return e?(e.__children||[]).map(e=>{const n=e.tagName;if("add"!==n&&"remove"!==n&&"replace"!==n)return t.warn(`Ignoring node of invalid action: ${n}`),null;let r=e.sel;if("add"===n&&e.type){if(!e.type.startsWith("@"))return t.warn(`Ignoring add action for prefixed namespace declaration: ${e.type}=${e.__text}`),null;r=`${r}/${e.type}`}let i=new wt(r);if(!i.isValid())return t.warn(`Ignoring action with invalid selector: ${n} - ${r}`),null;let a=null;i.findsAttribute()||i.findsTextReplace()?a=e.__text||"":"remove"!==n&&(a=e.__children.reduce((e,t)=>{let n=t.tagName;return"#text"!==n&&(e[n]=e[n]||[],e[n].push(t)),e},{}));let o=new Pt(n,i,a);return"add"===n&&(o.position=e.pos),o}).filter(e=>!!e):[]},getPublishTime:function(e){return e&&e.hasOwnProperty(be.default.PUBLISH_TIME)?new Date(e[be.default.PUBLISH_TIME]):null}},t=(0,l.default)(n).getInstance().getLogger(e),e}Ot.__dashjs_factory_name="PatchManifestModel";var Lt=r.default.getSingletonFactory(Ot),Ft=n(5876);const Ut
vendor: 1,875 bytes, line 2
2=Object.create(null,Object.getOwnPropertyDescriptors({aar:"aa",abk:"ab",afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arg:"an",arm:"hy",asm:"as",ava:"av",ave:"ae",aym:"ay",aze:"az",bak:"ba",bam:"bm",baq:"eu",bel:"be",ben:"bn",bis:"bi",bod:"bo",bos:"bs",bre:"br",bul:"bg",bur:"my",cat:"ca",ces:"cs",cha:"ch",che:"ce",chi:"zh",chu:"cu",chv:"cv",cor:"kw",cos:"co",cre:"cr",cym:"cy",cze:"cs",dan:"da",deu:"de",div:"dv",dut:"nl",dzo:"dz",ell:"el",eng:"en",epo:"eo",est:"et",eus:"eu",ewe:"ee",fao:"fo",fas:"fa",fij:"fj",fin:"fi",fra:"fr",fre:"fr",fry:"fy",ful:"ff",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",glv:"gv",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",heb:"he",her:"hz",hin:"hi",hmo:"ho",hrv:"hr",hun:"hu",hye:"hy",ibo:"ig",ice:"is",ido:"io",iii:"ii",iku:"iu",ile:"ie",ina:"ia",ind:"id",ipk:"ik",isl:"is",ita:"it",jav:"jv",jpn:"ja",kal:"kl",kan:"kn",kas:"ks",kat:"ka",kau:"kr",kaz:"kk",khm:"km",kik:"ki",kin:"rw",kir:"ky",kom:"kv",kon:"kg",kor:"ko",kua:"kj",kur:"ku",lao:"lo",lat:"la",lav:"lv",lim:"li",lin:"ln",lit:"lt",ltz:"lb",lub:"lu",lug:"lg",mac:"mk",mah:"mh",mal:"ml",mao:"mi",mar:"mr",may:"ms",mkd:"mk",mlg:"mg",mlt:"mt",mon:"mn",mri:"mi",msa:"ms",mya:"my",nau:"na",nav:"nv",nbl:"nr",nde:"nd",ndo:"ng",nep:"ne",nld:"nl",nno:"nn",nob:"nb",nor:"no",nya:"ny",oci:"oc",oji:"oj",ori:"or",orm:"om",oss:"os",pan:"pa",per:"fa",pli:"pi",pol:"pl",por:"pt",pus:"ps",que:"qu",roh:"rm",ron:"ro",rum:"ro",run:"rn",rus:"ru",sag:"sg",san:"sa",sin:"si",slk:"sk",slo:"sk",slv:"sl",sme:"se",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",sqi:"sq",srd:"sc",srp:"sr",ssw:"ss",sun:"su",swa:"sw",swe:"sv",tah:"ty",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tgl:"tl",tha:"th",tir:"ti",ton:"to",tsn:"tn",tso:"ts",tuk:"tk",tur:"tr",twi:"tw",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",ven:"ve",vie:"vi",vol:"vo",wel:"cy",wln:"wa",wol:"wo",xho:"xh",yid:"yi",yor:"yo",zha:"za",zho:"zh",zul:"zu"}));
2function xt(e){if(!e||"string"!=typeof e)return e;const t=e.split("-");t[0]=t[0].toLowerCase(),t[0]=Ut[t[0]]||t[0];for(let e=1;e<t.length;e++)4===t[e].length?t[e]=t[e].charAt(0).toUpperCase()+t[e].slice(1).toLowerCase():2===t[e].length&&/^[a-zA-Z]+$/.test(t[e])&&(t[e]=t[e].toUpperCase());return t.join("-")}var Bt=n(9259);function kt(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}function Gt(e,t){let n=0;return n=(127&e[t])<<21,n|=(127&e[t+1])<<14,n|=(127&e[t+2])<<7,n|=127&e[t+3],n}function Ht(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}function Yt(e,t=0,n=1/0){return function(e,t,n,r){const i=(a=e,(0,Bt.isArrayBufferLike)(a)?a:a.buffer);var a;let o=1;"BYTES_PER_ELEMENT"in r&&(o=r.BYTES_PER_ELEMENT);const s=(d=e)&&(0,Bt.isArrayBufferLike)(d.buffer)&&void 0!==d.byteLength&&void 0!==d.byteOffset?e.byteOffset:0,l=(s+e.byteLength)/o,u=(s+t)/o,c=Math.floor(Math.max(0,Math.min(u,l)));var d;return new r(i,c,Math.floor(Math.min(c+Math.max(n,0),l))-c)}(e,t,n,Uint8Array)}function qt(e,t=!1){const n=t?e.indexOf(0):e.length,r=(0,Bt.decodeText)(new DataView(e.buffer,e.byteOffset,n),{encoding:Bt.UTF_8});return t?r:r.replace(/\0/g,"")}function Vt(e){return"PRIV"===e.type?function(e){if(e.size<2)return;const t=qt(e.data,!0),n=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:n.buffer}}(e):"W"===e.type[0]?function(e){if("WXXX"===e.type){if(e.size<2)return;let t=1;const n=qt(e.data.subarray(t),!0);t+=n.length+1;const r=qt(e.data.subarray(t));return{key:e.type,info:n,data:r}}const t=qt(e.data);return{key:e.type,info:"",data:t}}(e):"APIC"===e.type?function(e){const t={key:e.type,description:"",data:"",mimeType:null,pictureType:null};if(e.size<2)return;if(3!==e.data[0])return void console.log("Ignore frame with unrecognized character encoding");const n=e.data.subarray(1).indexOf(0);if(-1===n)return;const r=qt(Yt(e.data,1,n)),i=e.data[2+n],a=e.data.subarray(3+n).indexOf(0);if(-1===a)return;const o=qt(Yt(e.data,3+n,a));let s;var l;return"--\x3e"===r?s=qt(Yt(e.data,4+n+a)):(l=e.data.subarray(4+n+a),s=(0,Bt.isArrayBufferLike)(l)?l:0==l.byteOffset&&l.byteLength==l.buffer.byteLength?l.buffer:new Uint8Array(l).buffer),t.mimeType=r,t.pictureType=i,t.description=o,t.data=s,t}(e):function(e){if(e.size<2)return;if("TXXX"===e.type){let t=1;const{data:n}=e,r=qt(n.subarray(t),!0);t+=r.length+1;const i=qt(n.subarray(t));return{key:e.type,info:r,data:i}}const t=qt(e.data.subarray(1));return{key:e.type,info:"",data:t}}(e)}function Kt(e){const t=String.fromCharCode(e[0],e[1],e[2],e[3]),n=Gt(e,4);return{type:t,size:n,data:e.subarray(10,10+n)}}function jt(){let e,t,n,r,i,a,o;const s=this.context;function l(e,n){const r=n?n.index:0,a=t.getAdaptationsForType(i[r].mpd.manifest,r,e);if(!a||0===a.length)return null;if(a.length>1&&n)for(let e=0,n=a.length;e<n;e++)if(o=a[e],t.getRolesForAdaptation(o).filter(function(e){return e.schemeIdUri===h.default.DASH_ROLE_SCHEME_ID&&e.value===be.default.MAIN})[0])return a[e];var o;return a[0]}function c(e,n,i,o,s,l){let u,c,d,f,g,h,p=[];if(!o||0===o.length)return[];const m=t.getAdaptationsForPeriod(n);for(f=0,h=o.length;f<h;f++)if(u=o[f],d=t.getIndexForAdaptation(u,e,i.index),c=T(m[d]),c)if(l){let e=c.accessibility.length;for(g=0;g<e;g++){if(!c)continue;let e=c.accessibility[g];if(e.schemeIdUri===a.ACCESSIBILITY_CEA608_SCHEME)if(e.value&&""!==e.value){let t=e.value.split(";");if("CC"===t[0].substring(0,2))for(g=0;g<t.length;g++)c||(c=T.call(this,m[d])),y(c,t[g].substring(0,3),t[g].substring(4)),p.push(c),c=null;else for(g=0;g<t.length;g++)c||(c=T.call(this,m[d])),y(c,"CC"+(g+1),t[g]),p.push(c),c=null}else y(c,a.CC1,"eng"),p.push(c),c=null}}else s===a.IMAGE?(c.type=a.IMAGE,p.push(c),c=null):c&&p.push(c);if(r.get().streaming.includePreselectionsInMediainfoArray){const e=t.getPreselectionsForPeriod(n);for(f=0,h=e.length;f<h;f++){const t=e[f];t.hasOwnProperty("type")&&t.type===s&&(c=_(e[f]),c&&p.push(c))}}return p}function d(e){const n=f(e);return t.getRegularPeriods(n)}function f(e){const n=p(e);return t.getMpd(n)}function g(){i=[]}function p(e){return e||(i.length>0?i[0].mpd.manifest:null)}function m(e){try{const n=E(e.streamInfo,i),r=t.getAdaptationsForPeriod(n);return e&&e.streamInfo&&void 0!==e.streamInfo.id&&r?r[e.index]:null}catch(e){return null}}function E(e,t){const n=t.length;for(let r=0;r<n;r++){let n=t[r];
2if(e&&e.id===n.id)return n}return null}function T(e){if(!e)return null;let n=new Ct;const i=e.period.mpd.manifest.Period[e.period.index].AdaptationSet[e.index];n.id=e.id,n.index=e.index,n.codec=t.getCodec(i);const a=r.get().streaming.enhancement.codecs;return n.type=a.some(e=>n.codec?.includes(e))?h.default.ENHANCEMENT:e.type,n.streamInfo=S(e.period),n.representationCount=t.getRepresentationCount(i),n.labels=t.getLabelsForAdaptation(i),n.lang=t.getLanguageForAdaptation(i),n.segmentAlignment=t.getSegmentAlignment(i),n.subSegmentAlignment=t.getSubSegmentAlignment(i),n.viewpoint=t.getViewpointForAdaptation(i),n.accessibility=t.getAccessibilityForAdaptation(i),n.accessibility.filter(function(e){if(e.schemeIdUri&&e.schemeIdUri.search("cea-608")>=0&&void 0!==o)return!0})[0]&&(n.embeddedCaptions=!0),n.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(i),0===n.audioChannelConfiguration.length&&i.Representation&&i.Representation.length>0&&(n.audioChannelConfiguration=t.getAudioChannelConfigurationForRepresentation(i.Representation[0])),n.roles=t.getRolesForAdaptation(i),n.mimeType=t.getMimeType(i),n.contentProtection=t.getContentProtectionByAdaptation(i),n.bitrateList=t.getBitrateListForAdaptation(i),n.selectionPriority=t.getSelectionPriority(i),n.contentProtection&&n.contentProtection.length>0&&(n.contentProtection=function(e,n){if(!e||!e.length||!n)return e;const r=t.getContentProtectionByManifest(n);if(!r||!r.length)return e;const i=r.reduce((e,t)=>(t.refId&&e.set(t.refId,t),e),new Map);return e.map(e=>{if(e.ref){const t=i.get(e.ref);t&&e.mergeAttributesFromReference(t)}return e})}(n.contentProtection,e.period.mpd.manifest),n.contentProtection=function(e){const t=e.map(e=>e.cencDefaultKid).filter(e=>null!==e);if(t.length){const n=t[0];e.forEach(e=>{e.keyId=n})}return e}(n.contentProtection),n.normalizedKeyIds=function(e){const t=new Set;return e.forEach(e=>{e.cencDefaultKid&&"string"==typeof e.cencDefaultKid&&t.add(e.cencDefaultKid.replace(/-/g,"").toLowerCase())}),t}(n.contentProtection)),n.isText=t.getIsText(i),n.essentialProperties=t.getCombinedEssentialPropertiesForAdaptationSet(i),n.supplementalProperties=t.getCombinedSupplementalPropertiesForAdaptationSet(i),n.isFragmented=t.getIsFragmented(i),n.isEmbedded=!1,n.adaptationSetSwitchingCompatibleIds=function(e){if(!e||!e.supplementalProperties)return[];let t=[];const n=e.supplementalProperties.filter(e=>e.schemeIdUri===be.default.ADAPTATION_SET_SWITCHING_SCHEME_ID_URI);return n&&n.length>0&&(t=n[0].value.toString().split(",").filter(t=>t!==e.id)),t}(n),n.segmentSequenceProperties=t.getSegmentSequencePropertiesForAdaptationSet(i),n}function _(e){if(!e)return null;let n=new Ct;const r=e.period.mpd.manifest.Period[e.period.index].Preselection[e.index],i=e.period.mpd.manifest.Period[e.period.index].AdaptationSet,a=t.getAdaptationsForPeriod(e.period);return n=T(t.getMainAdaptationSetForPreselection(r,a)),n&&(n.isPreselection=!0,n.tag=e.tag,n.id=e.id,n.codec=t.getCodecForPreselection(r,i),n.selectionPriority=t.getSelectionPriority(r),n.labels=t.getLabelsForAdaptation(r),n.lang=t.getLanguageForAdaptation(r),n.viewpoint=t.getViewpointForAdaptation(r),n.accessibility=t.getAccessibilityForAdaptation(r),n.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(r),n.roles=t.getRolesForAdaptation(r),n.essentialProperties=t.getCombinedEssentialPropertiesForAdaptationSet(r),n.supplementalProperties=t.getCombinedSupplementalPropertiesForAdaptationSet(r)),n}function y(e,t,n){e.id=t,e.index=100+parseInt(t.substring(2,3)),e.type=a.TEXT,e.codec="cea-608-in-SEI",e.isEmbedded=!0,e.isFragmented=!1,e.lang=xt(n),e.roles=[{schemeIdUri:"urn:mpeg:dash:role:2011",value:"caption"}]}function S(e){let n=new bt;return n.id=e.id,n.index=e.index,n.start=e.start,n.duration=e.duration,n.manifestInfo=function(e){let n=new Dt;return n.dvrWindowSize=e.timeShiftBufferDepth,n.loadedTime=e.manifest.loadedTime,n.availableFrom=e.availabilityStartTime,n.minBufferTime=e.manifest.minBufferTime,n.maxFragmentDuration=e.maxSegmentDuration,n.duration=t.getDuration(e.manifest),n.isDynamic=t.getIsDynamic(e.manifest),n.serviceDescriptions=t.getServiceDescriptions(e.manifest),n.protocol=e.manifest.protocol,n}(e.mpd),n.isLast=1===e.mpd.manifest.Period.length||Math.abs(n.start+n.duration-n.manifestInfo.duration)<1,n.isEncrypted=e.isEncrypted,n}function I(){if(!a)throw new Error("setConfig function has to be called previously")}function A(e){return i.length>0?i[0].mpd.manifest.Period[e]:null}function R(e,t,n){let r,i,a,o,s,l;if(e)for(i=e.AdaptationSet,s=0;s<i.length;s+=1)for(r=i[s],o=r.Representation,l=0;l<o.length;
2l+=1)if(a=o[l],t===a.id)return n?l:a;return null}return e={applyPatchToManifest:function(e,t){n.getPatchOperations(t).forEach(t=>{let n=t.getMpdTarget(e);if(null===n)return;let{name:r,target:i,leaf:a}=n;if(t.xpath.findsAttribute()||"__text"===r){switch(t.action){case"add":case"replace":i[r]=t.value;break;case"remove":delete i[r]}return}let o=(i[r]||[]).indexOf(a),s="prepend"===t.position||"before"===t.position;if("remove"===t.action||"replace"===t.action)if(Array.isArray(i[r])){if(-1!=o){let e=i[r];e.splice(o,1),e.length>0?i[r]=e:delete i[r]}}else delete i[r];"add"!==t.action&&"replace"!==t.action||Object.keys(t.value).forEach(e=>{let n=t.value[e],a=i[e]||[];if(0===a.length&&i[e]&&a.push(i[e]),0===a.length)a=n;else{let i=a.length;i=e==r&&-1!=o?o+(s?0:1)+("replace"===t.action?-1:0):s?0:a.length,a.splice.apply(a,[i,0].concat(n))}i[e]=a})})},areMediaInfosEqual:function(e,t){if(!e||!t)return!1;const n=e.id===t.id,r=e.codec===t.codec,i=JSON.stringify(e.viewpoint)===JSON.stringify(t.viewpoint),a=e.lang===t.lang,o=JSON.stringify(e.roles)===JSON.stringify(t.roles),s=JSON.stringify(e.accessibility)===JSON.stringify(t.accessibility),l=JSON.stringify(e.audioChannelConfiguration)===JSON.stringify(t.audioChannelConfiguration);return n&&r&&i&&a&&o&&s&&l},convertAdaptationToMediaInfo:T,getAllMediaInfoForType:function(e,n,r){let o=i,s=r,l=[];if(s)I(),o=d(s);else{if(!(i.length>0))return l;s=i[0].mpd.manifest}const u=E(e,o);let f=t.getAdaptationsForType(s,e?e.index:null,n);return l=c(s,u,e,f,n),n===a.TEXT&&(f=t.getAdaptationsForType(s,e?e.index:null,a.VIDEO),l=l.concat(c(s,u,e,f,n,!0))),l},getAvailabilityStartTime:function(e){const n=f(e);return t.getAvailabilityStartTime(n)},getBandwidthForRepresentation:function(e,t){let n;return n=R(A(t),e),n?n.bandwidth:null},getBaseURLsFromElement:function(e){return t.getBaseURLsFromElement(e)},getCodec:function(e,n,r){return t.getCodec(e,n,r)},getCodecForPreselection:function(e,n){return t.getCodecForPreselection(e,n)},getContentSteering:function(e){return t.getContentSteering(e)},getDuration:function(e){const n=p(e);return t.getDuration(n)},getEssentialProperties:function(e){try{return t.getEssentialProperties(e)}catch(e){return[]}},getEvent:function(e,t,n,r){try{if(!e||!t||isNaN(n)||!r)return null;const i=e.scheme_id_uri,a=e.value;if(!t[i+"/"+a])return null;const o=new vt.default,s=e.timescale||1,l=r.adaptation.period.start,u=t[i+"/"+a],c=isNaN(r.presentationTimeOffset)?isNaN(u.presentationTimeOffset)?0:u.presentationTimeOffset:r.presentationTimeOffset;let d,f=e.presentation_time_delta/s;d=0===e.version?l+n-c+f:l-c+f;const g=e.event_duration/s,p=e.id,m=e.message_data;return o.eventStream=u,o.eventStream.value=a,o.eventStream.timescale=s,o.duration=g,o.id=p,o.calculatedPresentationTime=d,o.messageData=m,o.presentationTimeDelta=f,o.parsedMessageData=i===h.default.ID3_SCHEME_ID_URI?function(e){let t=0;const n=[];for(;kt(e,t);){const r=Gt(e,t+6);e[t+5]>>6&1&&(t+=10),t+=10;const i=t+r;for(;t+10<i;){const r=Kt(e.subarray(t)),i=Vt(r);i&&n.push(i),t+=r.size+10}Ht(e,t)&&(t+=10)}return n}(m):null,o}catch(e){return null}},getEventsFor:function(e,n,r){let a=[];if(i.length>0){const o=i[0].mpd.manifest;if(e instanceof bt){const n=E(e,i);a=t.getEventsForPeriod(n)}else if(e instanceof Ct){const n=E(r,i);a=t.getEventStreamForAdaptationSet(o,m(e),n)}else if(e instanceof Ft.default){const e=E(r,i);a=t.getEventStreamForRepresentation(o,n,e)}}return a},getFramerate:function(e){return t.getFramerate(e)},getIndexForRepresentation:function(e,t){return function(e,t){const n=R(e,t,!0);return null!==n?n:-1}(A(t),e)},getIsDVB:function(e){return t.hasProfile(e,"urn:dvb:dash:profile:dvb-dash:2014")},getIsDynamic:function(e){const n=p(e);return t.getIsDynamic(n)},getIsPatch:function(e){return n.getIsPatch(e)},getIsTextTrack:function(e){return t.getIsText(e)},getIsTypeOf:function(e,n){return t.getIsTypeOf(e,n)},getLocation:function(e){return t.getLocation(e)},getMainAdaptationForType:l,getMainAdaptationSetForPreselection:function(e,n){return t.getMainAdaptationSetForPreselection(e,n)},getCommonRepresentationForPreselection:function(e,n){return t.getCommonRepresentationForPreselection(e,n)},getManifestUpdatePeriod:function(e,n=0){return t.getManifestUpdatePeriod(e,n)},getMediaInfoForType:function(e,n){if(0===i.length||!e)return null;let r=E(e,i);if(!r)return null;const a=t.getAdaptationsForPeriod(r);let o=l(n,e);return o?T(a[t.getIndexForAdaptation(o,i[0].mpd.manifest,e.index)]):null},getMpd:f,getPatchLocation:function(e){const n=t.getPatchLocation(e),r=t.getPublishTime(e);return n&&0!==n.length&&r?n.filter(e=>isNaN(e.ttl)||r.getTime()+e.ttl>(new Date).getTime()):[]},getPeriodById:function(e){if(!e||0===i.length)return null;const t=i.filter(t=>t.id===e);return t&&t.length>0?t[0]:null},getPreselectionIsTypeOf:function(e,n,r){return t.getPreselectionIsTypeOf(e,n,r)},getProducerReferenceTimes:function(e,n){let r,a;const o=E(e,i);return r=n?n.id:null,i.length>0&&o&&(a=r?t.getAdaptationForId(r,i[0].mpd.manifest,o.index):t.getAdaptationForIndex(n?n.index:null,i[
20].mpd.manifest,o.index)),a?t.getProducerReferenceTimesForAdaptation(a):[]},getPublishTime:function(e){return t.getPublishTime(e)},getRealAdaptation:function(e,n){let r,a;const o=E(e,i);return r=n?n.id:null,i.length>0&&o&&(a=r?t.getAdaptationForId(r,i[0].mpd.manifest,o.index):t.getAdaptationForIndex(n?n.index:null,i[0].mpd.manifest,o.index)),a},getRealPeriodByIndex:function(e){return t.getRealPeriodForIndex(e,i[0].mpd.manifest)},getRegularPeriods:d,getRepresentationSortFunction:function(){return t.getRepresentationSortFunction()},getStreamsInfo:function(e,t){const n=[];let r=i;if(e&&(I(),r=d(e)),r.length>0){(!t||t>r.length)&&(t=r.length);for(let e=0;e<t;e++)n.push(S(r[e]))}return n},getSuggestedPresentationDelay:function(){const e=i.length>0?i[0].mpd:null;return t.getSuggestedPresentationDelay(e)},getSupplementalCodecs:function(e){const t=e[be.default.SUPPLEMENTAL_CODECS];return t?t.split(" ").map(t=>e.mimeType+';codecs="'+t+'"'):[]},getUTCTimingSources:function(){const e=p();return t.getUTCTimingSources(e)},getVoRepresentations:function(e){let n;const r=m(e);return n=t.getRepresentationsForAdaptation(r,e),n},isPatchValid:function(e,r){let i=t.getId(e),a=n.getMpdId(r),o=t.getPublishTime(e),s=n.getPublishTime(r),l=n.getOriginalPublishTime(r);return!!(i&&a&&i==a&&o&&l&&o.getTime()==l.getTime()&&s&&o.getTime()<s.getTime())},reset:g,setConfig:function(e){e&&(e.constants&&(a=e.constants),e.cea608parser&&(o=e.cea608parser),e.errHandler&&t.setConfig({errHandler:e.errHandler}),e.BASE64&&t.setConfig({BASE64:e.BASE64}))},updatePeriods:function(e){if(!e)return null;I(),i=d(e)}},t=(0,Mt.default)(s).getInstance(),n=Lt(s).getInstance(),r=(0,u.default)(s).getInstance(),g(),e}jt.__dashjs_factory_name="DashAdapter";var Wt=r.default.getSingletonFactory(jt);class zt{static round10(e,t){return function(e,t,n){return void 0===n||0==+n?Math[e](t):(n=+n,null===(t=+t)||isNaN(t)||"number"!=typeof n||n%1!=0?NaN:(t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-n:-n)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+n:n))))}("round",e,t)}}var $t=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=[]}},Qt=class{constructor(){this.t=null,this.mt=null,this.to=null,this.lto=null}},Xt=class{constructor(){this.t=null,this.level=null}},Zt=class{constructor(){this.target=null,this.state=o.BUFFER_EMPTY}},Jt=class{constructor(){this.time=null,this.range=null,this.manifestInfo=null}},en=class{constructor(){this.time=null,this.droppedFrames=null}};class tn{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 nn{constructor(){this.id=null,this.index=null,this.start=null,this.duration=null}}class rn{constructor(){this.id=null,this.index=null,this.mediaType=null,this.presentationTimeOffset=null,this.startNumber=null}}var an=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}},on=class{constructor(){this.loadingRequests=[],this.executedRequests=[]}};function sn(e){const t=(e=e||{}).settings;let n,r,i=this.context,a=(0,f.default)(i).getInstance();function s(){a.trigger(g.default.METRICS_CHANGED)}function l(e){a.trigger(g.default.METRIC_CHANGED,{mediaType:e}),s()}function u(e,t,n){a.trigger(g.default.METRIC_UPDATED,{mediaType:e,metric:t,value:n}),l(e)}function c(e,t,n){a.trigger(g.default.METRIC_ADDED,{mediaType:e,metric:t,value:n}),l(e)}function d(e,t){let n=null;return e?(r.hasOwnProperty(e)?n=r[e]:t||(n=new $t,r[e]=n),n):n}function p(e,n,r){let i=d(e);null!==i&&(i[n].push(r),i[n].length>t.get().streaming.metrics.maxListDepth&&i[n].shift())}function m(e,t,n){p(e,t,n),c(e,t,n)}return n={addBufferLevel:function(e,t,n){let r=new Xt;r.t=t,r.level=n,m(e,o.BUFFER_LEVEL,r)},addBufferState:function(e,t,n){let r=new Zt;r.target=n,r.state=t,m(e,o.BUFFER_STATE,r)},addDVBErrors:function(e){m(h.default.STREAM,o.DVB_ERRORS,e)},addDVRInfo:function(e,t,n,r){let i=new Jt;i.time=t,i.range=r,i.manifestInfo=n,m(e,o.DVR_INFO,i)},addDroppedFrames:function(e,t){let n=new en,r=d(e).DroppedFrames;t&&(n.time=t.creationTime,n.droppedFrames=t.droppedVideoFrames,r.length>0&&r[r.length-1]==n||m(e,o.DROPPED_FRAMES,n))},addHttpRequest:function e(t,n,r,i){let a=new R.HTTPRequest;n.url&&n.url!==t.url&&(e({mediaType:t.mediaType,type:t.type,url:t.url,serviceLocation:null,range:t.range,startDate:t.startDate,firstByteDate:null,endD
2ate:null,duration:t.duration,fileLoaderType:t.fileLoaderType,resourceTimingValues:t.resourceTimingValues},{url:null,status:null,headers:null},null,i),a.actualurl=n.url),a.tcpid=null,a.type=t.type,a.url=t.url,a.range=t.range||null,a.trequest=t.startDate,a.tresponse=t.firstByteDate,a.responsecode=n.status,a.cmsd=i,a._tfinish=t.endDate,a._stream=t.mediaType,a._mediaduration=t.duration,a._responseHeaders="";for(const e in n.headers)a._responseHeaders+=e+": "+n.headers[e]+"\r\n";a._serviceLocation=t.serviceLocation||null,a._fileLoaderType=t.fileLoaderType,a._resourceTimingValues=t.resourceTimingValues,a._streamId=t&&t.representation&&t.representation.mediaInfo&&t.representation.mediaInfo.streamInfo?t.representation.mediaInfo.streamInfo.id:null,r?r.forEach(e=>{!function(e,t,n,r){let i=new R.HTTPRequestTrace;i.s=t,i.d=n,i.b=r,e.trace.push(i),e.interval||(e.interval=0),e.interval+=n}(a,e.s,e.d,e.b,e.t)}):(delete a.interval,delete a.trace),m(t.mediaType,o.HTTP_REQUEST,a)},addManifestUpdate:function(e,t,n,r){let i=new tn;i.mediaType=e,i.type=t,i.requestTime=n,i.fetchTime=r,p(h.default.STREAM,o.MANIFEST_UPDATE,i),c(e,o.MANIFEST_UPDATE,i)},addManifestUpdateRepresentationInfo:function(e,t,n){if(e&&e.representationInfo){const r=new rn;r.id=t?t.id:null,r.index=t?t.index:null,r.mediaType=n,r.startNumber=t?t.startNumber:null,r.presentationTimeOffset=t?t.presentationTimeOffset:null,e.representationInfo.push(r),u(e.mediaType,o.MANIFEST_UPDATE_TRACK_INFO,e)}},addManifestUpdateStreamInfo:function(e,t,n,r,i){if(e){let a=new nn;a.id=t,a.index=n,a.start=r,a.duration=i,e.streamInfo.push(a),u(e.mediaType,o.MANIFEST_UPDATE_STREAM_INFO,e)}},addPlayList:function(e){e.trace&&Array.isArray(e.trace)?e.trace.forEach(e=>{e.hasOwnProperty("subreplevel")&&!e.subreplevel&&delete e.subreplevel}):delete e.trace,m(h.default.STREAM,o.PLAY_LIST,e)},addRepresentationSwitch:function(e,t,n,r,i){let a=new Qt;a.t=t,a.mt=n,a.to=r,i?a.lto=i:delete a.lto,m(e,o.TRACK_SWITCH,a)},addRequestsQueue:function(e,t,n){let r=new on;r.loadingRequests=t,r.executedRequests=n,d(e).RequestsQueue=r,c(e,o.REQUESTS_QUEUE,r)},addSchedulingInfo:function(e,t,n,r,i,a,s,l,u){let c=new an;c.mediaType=e,c.t=t,c.type=n,c.startTime=r,c.availabilityStartTime=i,c.duration=a,c.bandwidth=s,c.range=l,c.state=u,m(e,o.SCHEDULING_INFO,c)},clearAllCurrentMetrics:function(){r={},s()},clearCurrentMetricsForType:function(e){delete r[e],l(e)},getMetricsFor:d,updateManifestUpdateInfo:function(e,t){if(e){for(let n in t)e[n]=t[n];u(e.mediaType,o.MANIFEST_UPDATE,e)}}},r={},n}sn.__dashjs_factory_name="MetricsModel";var ln=r.default.getSingletonFactory(sn);class un{constructor(){this.start=null,this.mstart=null,this.starttype=null,this.trace=[]}}un.INITIAL_PLAYOUT_START_REASON="initial_playout",un.SEEK_START_REASON="seek",un.RESUME_FROM_PAUSE_START_REASON="resume",un.METRICS_COLLECTION_START_REASON="metrics_collection_start";class cn{constructor(){this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null}}function dn(e){e=e||{};const t=this.context;let n,r,i,a,s=e.metricsModel;function l(e){const t=s.getMetricsFor(e,!0);if(!t)return null;const n=t.HttpList;let r,i=null;if(!n||n.length<=0)return null;for(r=n.length-1;r>=0;){if(n[r].responsecode){i=n[r];break}r--}return i}function u(e){const t=s.getMetricsFor(e,!0);return t&&t.HttpList?t.HttpList:[]}function c(e,t){if(!e)return null;const n=e[t];return n&&0!==n.length?n[n.length-1]:null}return n={addBufferLevel:function(e,t,n){s.addBufferLevel(e,t,n)},addBufferState:function(e,t,n){s.addBufferState(e,t,n)},addDVBErrors:function(e){s.addDVBErrors(e)},addDVRInfo:function(e,t,n,r){s.addDVRInfo(e,t,n,r)},addDroppedFrames:function(e){s.addDroppedFrames(h.default.VIDEO,e)},addHttpRequest:function(e,t,n,r,i,a){const o={status:n,headers:r,url:t};s.addHttpRequest(e,o,i,a)},addManifestUpdate:function(e){s.addManifestUpdate(h.default.STREAM,e.type,e.startDate,e.endDate)},addManifestUpdateRepresentationInfo:function(e,t){if(e){const n=this.getCurrentManifestUpdate();s.addManifestUpdateRepresentationInfo(n,e,t)}},addManifestUpdateStreamInfo:function(e){if(e){const t=this.getCurrentManifestUpdate();s.addManifestUpdateStreamInfo(t,e.id,e.index,e.start,e.duration)}},addPlayList:function(){a&&(s.addPlayList(a),a=null)},addRepresentationSwitch:function(e,t,n,r,i){s.addRepresentationSwitch(e,t,n,r,i)},addRequestsQueue:function(e,t,n){s.addRequestsQueue(e,t,n)},addSchedulingInfo:function(e,t){s.addSchedulingInfo(e.mediaType,new Date,e.type,e.startTime,e.availabilityStartTime,e.duration,e.bandwidth,e.range,t)},clearAllCurrentMetrics:function(){s.clearAllCurrentMetrics()},createPlaylistMetrics:function(e,t){a=new un,a.start=new Date,a.mstart=e,a.starttype=t},createPlaylistTraceMetrics:function(e,t,n){!0===r&&(r=!1,i=new cn,i.representationid=e,i.start=new Date,i.mstart=t,i.playbackspeed=null!==n?n.toString():null)},getCurrentBufferLevel:function(e){const t=c(s.getMetricsFor(e,!0),o.BUFFER_LEVEL);return t?zt.round10(t.level/1e3,-3):0},getCurrentBufferState:function(e){return c(s.getMetricsFor(e,!0),o.BUFFER_STATE)},getCurrentDVRInfo:function(e){return c(e?s.getMetricsFor(e,!0):s.getMetricsFor(h.default.VIDEO,!0)||s.getMetricsFor(h.default.AUDIO,!0),o.DVR_INFO)},getCurrentDroppedFrames:function(){return c(s.getMetricsFor(h.default.VIDEO,!0),o.DROPPED_FRAMES)},getCurrentHttpRequest:l,getCurrentManifestUpdate:function(){return c(s.getMetricsFor(h.default.STREAM),o.MANIFEST_UPDATE)},getCurrentRepresentationSwitch:function(e){return c(s.getMetricsFor(e,!0),o.TRACK_SWITCH)},getCurrentSchedulingInfo:function(e){return c(s.getMetricsFor(e,!0),o.SCHEDULING_INFO)},getHttpRequests:u,getLatestFragmentRequestHeaderValueByID:function(e,t){if(!t)return null;let n={},r=l(e);r&&(n=we.default.parseHttpHeaders(r._responseHeaders));const i=n[t.toLowerCase()];return void 0===i?null:i},getLatestMPDRequestHeaderValueByID:function(e){if(!e)return null;let t,n,r,i={};for(t=u(h.default.STREAM),r=t.length-1;r>=0;r--)if(n=t[r],n.type===R.HTTPRequest.MPD_TYPE){i=we.default.parseHttpHeaders(n._responseHeaders);break}const a=i[e.toLowerCase()];return void 0===a?null:a},pushPlayListTraceMetrics:function(e,t){if(!1===r&&a&&i&&i.start){const n=i.start;i.duration=e.getTime()-n.getTime(),i.stopreason=t,a.trace.push(i),r=!0}},updateManifestUpdateInfo:function(e){const t=this.getCurrentManifestUpdate();s.updateManifestUpdateInfo(t,e)},updatePlayListTraceMetrics:function(e){if(i)for(let t in i)i[t]=e[t]}},s=s||ln(t).getInstance({settings:e.settings}
2),r=!0,i=null,a=null,n}cn.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",cn.REBUFFERING_REASON="rebuffering",cn.USER_REQUEST_STOP_REASON="user_request",cn.END_OF_PERIOD_STOP_REASON="end_of_period",cn.END_OF_CONTENT_STOP_REASON="end_of_content",cn.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",cn.FAILURE_STOP_REASON="failure",dn.__dashjs_factory_name="DashMetrics";var fn=r.default.getSingletonFactory(dn);function gn(){let e;const t=this.context,n=(0,f.default)(t).getInstance();return e={error:function(e){n.trigger(g.default.ERROR,{error:e})}},e}gn.__dashjs_factory_name="ErrorHandler";var hn=r.default.getSingletonFactory(gn),pn=n(5560);function mn(){const e=this.context,t=(0,f.default)(e).getInstance();let n,r,i,a,o,s,u,c,d,p,m,E;function T(){E.debug("Stopping the gap controller"),o&&(clearInterval(o),o=null),function(){t.off(g.default.WALLCLOCK_TIME_UPDATED,A,this),t.off(g.default.INITIAL_STREAM_SWITCH,I,this),t.off(g.default.PLAYBACK_SEEKING,_,this),t.off(g.default.BUFFER_REPLACEMENT_STARTED,y,n),t.off(g.default.TRACK_CHANGE_RENDERED,S,n)}(),o=null,s=NaN,a=0,p=null,m={}}function _(){p&&(clearTimeout(p),p=null)}function y(e){try{if(e.streamId!==c.getActiveStreamInfo().id||e.mediaType!==h.default.VIDEO&&e.mediaType!==h.default.AUDIO)return;e.streamId===c.getActiveStreamInfo().id&&(m[e.mediaType]=!0)}catch(e){E.error(e)}}function S(e){e&&e.mediaType&&(m[e.mediaType]=!1)}function I(){o||function(){try{o||(E.debug("Starting the gap controller"),o=setInterval(()=>{R()&&N(u.getTime())},i.get().streaming.gaps.checkInterval))}catch(e){}}()}function A(){if(R(i.get().streaming.gaps.enableSeekFix)&&(a++,a>=10)){const e=u.getTime();r===e?N(e,!0):(r=e,s=NaN),a=0}}function R(e=!1){if(!c.getActiveStream())return!1;let t=!1;for(const e in m)if(m[e]){t=!0;break}const n=!!e&&function(){const e=c.getActiveStream(),t=parseFloat((e.getStartTime()+e.getDuration()).toFixed(5));return u.getTime()+i.get().streaming.gaps.threshold>=t}();return!t&&i.get().streaming.gaps.jumpGaps&&c.getActiveStreamProcessors().length>0&&(!u.isSeeking()||n)&&!u.isPaused()&&!c.getIsStreamSwitchInProgress()&&!c.getHasMediaOrInitialisationError()}function N(e,t=!1){const n=i.get().streaming.gaps,r=n.enableStallFix,a=n.stallSeek,o=n.smallGapLimit,l=n.jumpLargeGaps,f=n.seekOffset,g=d.getBufferRange();let h,m=NaN,T=!1;if(h=function(e,t){try{if(!e||e.length<=1&&t>0)return NaN;let n=NaN,r=0;for(;isNaN(n)&&r<e.length;){const a=r>0?e.end(r-1):0;t<e.start(r)&&a-t<i.get().streaming.gaps.threshold&&(n=r),r+=1}return n}catch(e){return null}}(g,e),!isNaN(h)){const t=g.start(h),n=t-e;n>0&&(n<=o||l)&&(m=t)}const _=u.getTimeToStreamEnd();if(isNaN(m)&&t&&isFinite(_)&&!isNaN(_)&&_<o&&(m=parseFloat(u.getStreamEndTime().toFixed(5)),T=!0),r&&isNaN(m)&&t&&isNaN(h)&&function(e,t){for(let n=0,r=e.length;n<r;n++)if(t>=e.start(n)&&t<=e.end(n))return!0;return!1}(g,e)&&(0===a?(E.warn("Toggle play pause to break stall"),d.pause(),d.play()):(E.warn(`Jumping ${a}s to break stall`),m=e+a)),m>0&&s!==m&&m>e&&!p){const t=m-e;if(T){const n=c.getStreamForTime(m),r=n&&!!n.getPreloaded();E.warn(`Jumping to end of stream because of gap from ${e} to ${m}. Gap duration: ${t}`),u.seek(m+f,!0,r)}else{const n=u.getIsDynamic(),r=h>0?g.end(h-1):e,i=n?1e3*Math.max(0,t-.1):0;p=window.setTimeout(()=>{u.seek(m+f,!0,!0);const e=c.getActiveStream();e&&E.warn(`Jumping gap occuring in period ${e.getStreamId()} starting at ${r} and ending at ${m}. Jumping by: ${m+f-r}`),p=null},i)}s=m}}return n={reset:T,setConfig:function(e){e&&(e.settings&&(i=e.settings),e.playbackController&&(u=e.playbackController),e.streamController&&(c=e.streamController),e.videoModel&&(d=e.videoModel))},initialize:function(){!function(){t.on(g.default.WALLCLOCK_TIME_UPDATED,A,this),t.on(g.default.INITIAL_STREAM_SWITCH,I,this),t.on(g.default.PLAYBACK_SEEKING,_,this),t.on(g.default.BUFFER_REPLACEMENT_STARTED,y,n),t.on(g.default.TRACK_CHANGE_RENDERED,S,n)}()}},E=(0,l.default)(e).getInstance().getLogger(n),T(),n}mn.__dashjs_factory_name="GapController";var En=r.default.getSingletonFactory(mn);class Tn extends $.default{constructor(e,t){super(),this.url=e||null,this.type=t||null,this.mediaType=h.default.STREAM,this.responseType=""}}var _n=Tn;function yn(e){e=e||{};const t=this.context,n=(0,f.default)(t).getInstance();let r,i=(0,Re.default)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,errors:Ae.default});return r={load:function(e,t,r){const a=function(i,a){t.resolved=!0,t.resolvedContent=i||null,
2n.trigger(g.default.XLINK_ELEMENT_LOADED,{element:t,resolveObject:r,error:i||a?null:new Ge.default(Ae.default.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,Ae.default.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+e)})};if("urn:mpeg:dash:resolve-to-zero:2013"===e)a(null,!0);else{const t=new _n(e,R.HTTPRequest.XLINK_EXPANSION_TYPE);i.load({request:t,success:function(e){a(e)},error:function(){a(null)}})}},reset:function(){i&&(i.abort(),i=null)}},r}yn.__dashjs_factory_name="XlinkLoader";var Sn=r.default.getClassFactory(yn);const In="onLoad";function An(e){e=e||{};let t=this.context,n=(0,f.default)(t).getInstance();const r=(0,De.default)(t).getInstance();let i,a,o,s;function l(e,t,n){let i,a,o={};o.elements=e,o.type=t,o.resolveType=n,0===o.elements.length&&c(o);for(let e=0;e<o.elements.length;e++)i=o.elements[e],a=r.isHTTPURL(i.url)?i.url:i.originalContent.BaseURL+i.url,s.load(a,i,o)}function u(e){let t,n,r="";if(t=e.element,n=e.resolveObject,t.resolvedContent){let e=0;0===t.resolvedContent.indexOf("<?xml")&&(e=t.resolvedContent.indexOf("?>")+2),r=t.resolvedContent.substr(0,e)+"<response>"+t.resolvedContent.substr(e)+"</response>",t.resolvedContent=a.parseXml(r).response}(function(e){let t,n;for(t=0;t<e.elements.length;t++)if(n=e.elements[t],!1===n.resolved)return!1;return!0})(n)&&c(n)}function c(e){let t,r,i=[];if(function(e){let t,n,r,i,s,l,u=[];for(i=e.elements.length-1;i>=0;i--){if(t=e.elements[i],n=t.type,t.resolvedContent){if(t.resolvedContent)for(s=0;s<t.resolvedContent[n].length;s++)r=t.resolvedContent[n][s],u.push(r)}else delete t.originalContent["xlink:actuate"],delete t.originalContent["xlink:href"],u.push(t.originalContent);for(t.parentElement[n].splice(t.index,1),l=0;l<u.length;l++)t.parentElement[n].splice(t.index+l,0,u[l]);u=[]}e.elements.length>0&&a.getIron().run(o)}(e),"onActuate"===e.resolveType&&n.trigger(g.default.XLINK_READY,{manifest:o}),e.resolveType===In)switch(e.type){case be.default.PERIOD:for(t=0;t<o[be.default.PERIOD].length;t++)r=o[be.default.PERIOD][t],r.hasOwnProperty(be.default.ADAPTATION_SET)&&(i=i.concat(d(r[be.default.ADAPTATION_SET],r,be.default.ADAPTATION_SET,In))),r.hasOwnProperty(be.default.EVENT_STREAM)&&(i=i.concat(d(r[be.default.EVENT_STREAM],r,be.default.EVENT_STREAM,In)));l(i,be.default.ADAPTATION_SET,In);break;case be.default.ADAPTATION_SET:n.trigger(g.default.XLINK_READY,{manifest:o})}}function d(e,t,n,r){let i,a,o,s=[];for(a=e.length-1;a>=0;a--)i=e[a],i.hasOwnProperty("xlink:href")&&"urn:mpeg:dash:resolve-to-zero:2013"===i["xlink:href"]&&e.splice(a,1);for(a=0;a<e.length;a++)i=e[a],i.hasOwnProperty("xlink:href")&&i.hasOwnProperty("xlink:actuate")&&i["xlink:actuate"]===r&&(o=h(i["xlink:href"],t,n,a,r,i),s.push(o));return s}function h(e,t,n,r,i,a){return{url:e,parentElement:t,type:n,index:r,resolveType:i,originalContent:a,resolvedContent:null,resolved:!1}}return i={resolveManifestOnLoad:function(e){let t;o=e,o.Period?(t=d(o.Period,o,be.default.PERIOD,In),l(t,be.default.PERIOD,In)):n.trigger(g.default.XLINK_READY,{manifest:o})},setParser:function(e){e&&(a=e)},reset:function(){n.off(g.default.XLINK_ELEMENT_LOADED,u,i),s&&(s.reset(),s=null)}},n.on(g.default.XLINK_ELEMENT_LOADED,u,i),s=Sn(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,settings:e.settings}),i}An.__dashjs_factory_name="XlinkController";var Rn=r.default.getClassFactory(An);function Nn(e){function t(e,t,n,r,i){(function(e,t){let n=!0;if(t)for(const[r,i]of Object.entries(t)){let t=e[r];i.some(e=>t.match(e))&&(n=!1)}return n})(r,e)&&(i[t]?n?i[t].push(r):function(e,t){if("object"==typeof e)for(let n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(r,i[t]):i[t]=n?[r]:r)}function n(e,n,r,i){for(let a=0,o=e.length;a<o;++a){const o=e[a];if(r[o]){const e=r[o];Array.isArray(e)?e.forEach(e=>{t(n[o],o,!0,e,i)}):t(n[o],o,!1,e,i)}}}function r(e,t){for(let i=0,a=e.children.length;i<a;++i){const a=e.children[i],o=t[a.name];if(o)for(let i=0,s=o.length;i<s;++i){const s=o[i];n(e.properties,e.exceptions,t,s),r(a,s)}}}return{run:function(t){if(null===t||"object"!=typeof t)return t;if(t.Period&&"period"in e){const n=e.period,i=t.Period;for(let t=0,a=i.length;t<a;++t){const a=i[t];if(r(n,a),"adaptationset"in e){const t=a.AdaptationSet;if(t){const n=e.adaptationset;for(let e=0,i=t.length;e<i;++e)r(n,t[e])}}}}return t}}}Nn.__dashjs_factory_name="ObjectIron";var Cn=r.default.getClassFactory(Nn),bn=class{constructor(e,t){this._test=e,this._converter=t}get test(){return this._test}
2get converter(){return this._converter}};const Dn=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/;var vn=class extends bn{constructor(){super((e,t,n)=>{const r=[be.default.MIN_BUFFER_TIME,be.default.MEDIA_PRESENTATION_DURATION,be.default.MINIMUM_UPDATE_PERIOD,be.default.TIMESHIFT_BUFFER_DEPTH,be.default.MAX_SEGMENT_DURATION,be.default.MAX_SUBSEGMENT_DURATION,be.default.SUGGESTED_PRESENTATION_DELAY,be.default.START,h.default.START_TIME,be.default.DURATION],i=r.length;for(let e=0;e<i;e++)if(t===r[e])return Dn.test(n);return!1},e=>{const t=Dn.exec(e);let n=31536e3*parseFloat(t[3]||0)+2592e3*parseFloat(t[5]||0)+86400*parseFloat(t[7]||0)+3600*parseFloat(t[9]||0)+60*parseFloat(t[11]||0)+parseFloat(t[13]||0);return void 0!==t[1]&&(n=-n),n})}};const Mn=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+-])([0-9]{2})(?::?)([0-9]{2}))?/;var wn=class extends bn{constructor(){super((e,t,n)=>Mn.test(n),e=>{const t=Mn.exec(e);let n;if(n=Date.UTC(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10),parseInt(t[4],10),parseInt(t[5],10),t[6]&&parseInt(t[6],10)||0,t[7]&&1e3*parseFloat(t[7])||0),t[9]&&t[10]){const e=60*parseInt(t[9],10)+parseInt(t[10],10);n+=("+"===t[8]?-1:1)*e*60*1e3}return new Date(n)})}};const Pn=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,On=[be.default.ID];var Ln=class extends bn{constructor(){super((e,t,n)=>Pn.test(n)&&-1===On.indexOf(t),e=>parseFloat(e))}},Fn=class extends bn{constructor(){super((e,t)=>{const n={[be.default.ADAPTATION_SET]:[be.default.LANG],[be.default.REPRESENTATION]:[be.default.LANG],[be.default.CONTENT_COMPONENT]:[be.default.LANG],[be.default.LABEL]:[be.default.LANG],[be.default.GROUP_LABEL]:[be.default.LANG]};if(n.hasOwnProperty(e)){let r=n[e];return void 0!==r&&r.indexOf(t)>=0}return!1},e=>xt(e)||String(e))}},Un=class{constructor(e,t,n,r){this._name=e||"",this._properties=t||[],this._exceptions=n||{},this._children=r||[]}get name(){return this._name}get children(){return this._children}get properties(){return this._properties}get exceptions(){return this._exceptions}},xn=class extends Un{constructor(){const e=[be.default.AUDIO_CHANNEL_CONFIGURATION,be.default.AUDIO_SAMPLING_RATE,be.default.CODECS,be.default.CODING_DEPENDENCY,be.default.CONTENT_PROTECTION,be.default.ESSENTIAL_PROPERTY,be.default.FRAMERATE,be.default.FRAME_PACKING,be.default.HEIGHT,be.default.INBAND_EVENT_STREAM,be.default.MAXIMUM_SAP_PERIOD,be.default.MAX_PLAYOUT_RATE,be.default.MIME_TYPE,be.default.PROFILES,be.default.SAR,be.default.SCAN_TYPE,be.default.SEGMENT_PROFILES,be.default.SEGMENT_SEQUENCE_PROPERTIES,be.default.START_WITH_SAP,be.default.SUPPLEMENTAL_CODECS,be.default.SUPPLEMENTAL_PROPERTY,be.default.WIDTH],t={[be.default.SUPPLEMENTAL_PROPERTY]:{schemeIdUri:[h.default.URL_QUERY_INFO_SCHEME,h.default.EXT_URL_QUERY_INFO_SCHEME,h.default.ADV_URL_QUERY_INFO_SCHEME,h.default.URL_QUERY_STATE_PREFIX]},[be.default.ESSENTIAL_PROPERTY]:{schemeIdUri:[h.default.URL_QUERY_INFO_SCHEME,h.default.EXT_URL_QUERY_INFO_SCHEME,h.default.ADV_URL_QUERY_INFO_SCHEME,h.default.URL_QUERY_STATE_PREFIX]}};super(be.default.ADAPTATION_SET,e,t,[new Un(be.default.REPRESENTATION,e,t,[new Un(be.default.SUB_REPRESENTATION,e,t)])])}},Bn=class extends Un{constructor(){const e=[be.default.SEGMENT_BASE,be.default.SEGMENT_TEMPLATE,be.default.SEGMENT_LIST],t={};super(be.default.PERIOD,e,t,[new Un(be.default.ADAPTATION_SET,e,t,[new Un(be.default.REPRESENTATION,e,t)])])}};const kn=new Set([13,10,9,62,47,61,32]),Gn=[be.default.ACCESSIBILITY,be.default.ADAPTATION_SET,be.default.ADD,be.default.AUDIO_CHANNEL_CONFIGURATION,be.default.BASE_URL,be.default.CONTENT_COMPONENT,be.default.CONTENT_PROTECTION,be.default.CONTENT_STEERING,be.default.ESSENTIAL_PROPERTY,be.default.EVENT,be.default.EVENT_STREAM,be.default.INBAND_EVENT_STREAM,be.default.LABEL,be.default.LOCATION,be.default.METRICS,be.default.PATCH_LOCATION,be.default.PERIOD,be.default.PRESELECTION,be.default.PRODUCER_REFERENCE_TIME,be.default.REMOVE,be.default.REPLACE,be.default.REPORTING,be.default.REPRESENTATION,be.default.ROLE,be.default.S,be.default.SEGMENT_SEQUENCE_PROPERTIES,be.default.SEGMENT_URL,be.default.SERVICE_DESCRIPTION,be.default.SUPPLEMENTAL_PROPERTY,be.default.UTC_TIMING];function Hn(e){e=e||{};const t=this.context,n=e.debug;let r,i,a,o;function s(e){try{const t=function(e){const t=function(e,t={}){let n=t.pos||0;const r=e.length,i=!!t.keepComments,a=!!t.keepWhitespace,o=!!t.includeParentElement;function s(e,t="#text"){return{nodeName:t,nodeValue:e,attributes:{},childNodes:[]}}function l(t=""){const o=[];for(;n<r;)if(60===e.charCodeAt(n)){const a=e.charCodeAt(n+1);if(47===a){const r=n+2;if(n=e.indexOf(">",n),!e.startsWith(t,r)){const t=e.substring(0,n).split("\n");throw new Error("Unexpected close tag\nLine: "+(t.length-1)+"\nColumn: "+(t[t.length-1].length+1)+"\nChar: "+e[n])}return n+1&&(n+=1),o}if(63===a){n=e.indexOf(">",n),n++;continue}if(33===a){const t=e.charCodeAt(n+2);if(45===t){const t=n;for(;-1!==n&&(62!==e.charCodeAt(n)||45!==e.charCodeAt(n-1)||45!==e.charCodeAt(n-2));)n=e.indexOf(">",n+1);-1===n&&(n=r),i&&o.push(s(e.substring(t,n+1),"#comment"))}
2else{if(91===t&&91===e.charCodeAt(n+8)&&e.startsWith("CDATA",n+3)){const t=e.indexOf("]]>",n);-1===t?(o.push(s(e.substr(n+9),"#cdata")),n=r):(o.push(s(e.substring(n+9,t),"#cdata")),n=t+3);continue}{const t=n+1;n+=2;let i=!1;for(;n<r&&(62!==e.charCodeAt(n)||i);){const t=e.charCodeAt(n);91===t?i=!0:i&&93===t&&(i=!1),n++}o.push(s(e.substring(t,n),"#doctype"))}}n++;continue}const l=d();o.push(l)}else{const e=u();if(a)e.length>0&&o.push(s(e));else{const t=e.trim();t.length>0&&o.push(s(t))}n++}return o}function u(){const t=n;return n=e.indexOf("<",n)-1,-2===n&&(n=r),(0,Bt.unescapeHtml)(e.slice(t,n+1))}function c(){const t=n;for(;n<r&&!kn.has(e.charCodeAt(n));)n++;return e.slice(t,n)}function d(){n++;const t=c();let i=t,a=null;const o=t.indexOf(":");-1!==o&&(a=t.slice(0,o),i=t.slice(o+1));const s=function(){const t={};for(;n<r&&62!==e.charCodeAt(n);){const r=e.charCodeAt(n);if(r>64&&r<91||r>96&&r<123){const r=c();let i="",a=e.charCodeAt(n);for(;39!==a&&34!==a;)n++,a=e.charCodeAt(n);if(39===a||34===a){if(i=f(),-1===n)throw new Error("Missing closing quote")}else n--;t[r]=(0,Bt.unescapeHtml)(i)}n++}return t}();let u=[];const d=e.charCodeAt(n-1);return n++,47!==d&&(u=l(t)),{nodeName:t,nodeValue:null,attributes:s,childNodes:u,prefix:a,localName:i}}function f(){const t=e[n],r=n+1;return n=e.indexOf(t,r),e.slice(r,n)}const g={nodeName:"#document",nodeValue:null,childNodes:l(""),attributes:{}};return o&&function e(t,n){t.parentElement=n?.nodeName.startsWith("#")?null:n;for(const n of t.childNodes)e(n,t)}(g,null),g}(e),n=t.childNodes.find(e=>"MPD"===e.nodeName||"Patch"===e.nodeName)||t.childNodes[0];return function e(t){-1!==t.nodeName.indexOf(":")&&(t.__prefix=t.prefix,t.nodeName=t.localName);const{childNodes:n,attributes:r,nodeName:i}=t;t.tagName=i;for(let e in r){let n=r[e];if("S"===i)n=parseInt(n);else for(let t=0,r=a.length;t<r;t++){const r=a[t];if(r.test(i,e,n)){n=r.converter(n);break}}t[e]=n}const o=n?.length;for(let r=0;r<o;r++){const i=n[r];if("#text"===i.nodeName){t.__text=i.nodeValue;continue}e(i);const{nodeName:a}=i;Array.isArray(t[a])?t[a].push(i):-1!==Gn.indexOf(a)?(t[a]||(t[a]=[]),t[a].push(i)):t[a]=i}t.__children=n}(n),n}(e);return{[t.tagName]:t}}catch(e){return null}}return r={getIron:function(){return o},parseXml:s,parse:function(e){let t;const n=window.performance.now();if(t=s(e),!t)throw new Error("failed to parse the manifest");t.Patch?(t=t.Patch,t.add&&t.add.forEach(e=>o.run(e)),t.replace&&t.replace.forEach(e=>o.run(e))):(t=t.MPD,o.run(t));const r=window.performance.now();return i.info("Parsing complete: "+(r-n).toPrecision(3)+"ms"),t.protocol="DASH",t}},i=n.getLogger(r),a=[new vn,new wn,new Ln,new Fn],o=Cn(t).create({adaptationset:new xn,period:new Bn}),r}Hn.__dashjs_factory_name="DashParser";var Yn=r.default.getClassFactory(Hn);function qn(e){e=e||{};const t=this.context,n=e.debug,r=e.settings,i=(0,f.default)(t).getInstance(),a=(0,De.default)(t).getInstance();let o,s,l,u,c,d=e.mssHandler,p=e.errHandler;function m(e){i.trigger(g.default.INTERNAL_MANIFEST_LOADED,{manifest:e.manifest})}return o={load:function(e,o=null,f=null){const h=new Date,p=new _n(e,R.HTTPRequest.MPD_TYPE);o&&(p.serviceLocation=o),f&&(p.queryParams=f),p.startDate||(p.startDate=h),i.trigger(g.default.MANIFEST_LOADING_STARTED,{request:p}),l.load({request:p,success:function(o,l,f){if(!u)return;let h,p,m;if(f&&f!==e?(p=a.parseBaseUrl(f),h=f):(a.isRelative(e)&&(e=a.resolve(e,window.location.href)),p=a.parseBaseUrl(e)),"No Content"!=l)if(null===c&&(c=function(e){let r=null;return e.indexOf("SmoothStreamingMedia")>-1?(d&&(r=d.createMssParser(),d.createMssFragmentProcessor(),d.registerEvents()),r):e.indexOf("MPD")>-1||e.indexOf("Patch")>-1?Yn(t).create({debug:n}):r}(o)),null!==c){u.setParser(c);try{m=c.parse(o)}catch(t){return void i.trigger(g.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Ge.default(Ae.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,Ae.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${e}`)})}if(m){if(m.url=h||e,m.originalUrl||(m.originalUrl=m.url),r&&r.get().streaming.enableManifestDurationMismatchFix&&m.mediaPresentationDuration&&m.Period.length>1){const e=m.Period.reduce((e,t)=>
2e+t.duration,0);!isNaN(e)&&m.mediaPresentationDuration>e&&(s.warn("Media presentation duration greater than duration of all periods. Setting duration to total period duration"),m.mediaPresentationDuration=e)}m.baseUri=p,m.loadedTime=new Date,u.resolveManifestOnLoad(m),i.trigger(g.default.ORIGINAL_MANIFEST_LOADED,{originalManifest:o})}else i.trigger(g.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Ge.default(Ae.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,Ae.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${e}`)})}else i.trigger(g.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Ge.default(Ae.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,Ae.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${e}`)});else i.trigger(g.default.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(t,n,r){i.trigger(g.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Ge.default(Ae.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,Ae.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+`${e}, ${r}`)})}})},reset:function(){i.off(g.default.XLINK_READY,m,o),d&&d.reset(),u&&(u.reset(),u=null),l&&(l.abort(),l=null)}},s=n.getLogger(o),i.on(g.default.XLINK_READY,m,o),l=(0,Re.default)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,urlUtils:a,constants:h.default,dashConstants:be.default,errors:Ae.default}),u=Rn(t).create({errHandler:p,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,settings:e.settings}),c=null,o}qn.__dashjs_factory_name="ManifestLoader";var Vn=r.default.getClassFactory(qn);function Kn(){let e,t,n=this.context,r=(0,f.default)(n).getInstance();return e={getValue:function(){return t},setValue:function(e){t=e,e&&r.trigger(g.default.MANIFEST_LOADED,{data:e})}},e}Kn.__dashjs_factory_name="ManifestModel";var jn=r.default.getSingletonFactory(Kn);function Wn(){const e=this.context,t=(0,u.default)(e).getInstance();let n,r,i;return n={select:function(e){if(!e||0===e.length)return null;let n=null;return t.get().streaming.applyContentSteering&&(n=function(e){const t=i.getCurrentSteeringResponseData();return t&&t.pathwayPriority&&t.pathwayPriority.length>0?function(e=[],t=[]){let n=0,i=null;for(;n<e.length;){const a=e[n],o=t.findIndex(e=>e.serviceLocation&&e.serviceLocation===a);if(-1!==o&&!r.contains(t[o].serviceLocation)){i=t[o];break}n+=1}return i}(t.pathwayPriority,e):null}(e)),n||(n=function(e){return e[0]}(e)),n},setConfig:function(e){e.blacklistController&&(r=e.blacklistController),e.contentSteeringController&&(i=e.contentSteeringController)},reset:function(){r.reset()}},r=Fe(e).create({updateEventName:g.default.SERVICE_LOCATION_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:g.default.SERVICE_LOCATION_LOCATION_BLACKLIST_ADD,enableExpiry:!1}),i=Oe(e).getInstance(),n}Wn.__dashjs_factory_name="LocationSelector";var zn=r.default.getClassFactory(Wn);function $n(){const e=this.context,t=(0,f.default)(e).getInstance(),n=(0,De.default)(e).getInstance();let r,i,a,o,s,u,c,d,m,E,T,_,y,S,I;function A(){y=NaN,d=!1,u=!0,c=!1,R()}function R(){null!==S&&(clearTimeout(S),S=null)}function N(e){R(),c||(isNaN(e)&&!isNaN(y)&&(e=1e3*y),isNaN(e)||(E.debug("Refresh manifest in "+e+" milliseconds."),S=setTimeout(D,e)))}function C(e=!1){d=!0;const t=_.getValue();let a=t.url;a&&(a=we.default.removeQueryParameterFromUrl(a,h.default.CMCD_QUERY_KEY));let o=null;const s=r.getPatchLocation(t),l=m.select(s);let u=null;if(l&&!e)a=l.url,o=l.serviceLocation,u=l.queryParams;else{const e=function(e){const t=r.getLocation(e),n=i.getSynthesizedLocationElements(t);return t.concat(n)}(t),n=m.select(e);n&&(a=n.url,o=n.serviceLocation,u=n.queryParams)}n.isRelative(a)&&(a=n.resolve(a,t.url)),T.load(a,o,u)}function b(e){if(e){if(r.getIsPatch(e)){let t=e;e=_.getValue();let n=r.isPatchValid(e,t),i=n;if(n){let n=r.getPublishTime(e);r.applyPatchToManifest(e,t);let a=r.getPublishTime(e);i=n.getTime()!==a.getTime()}if(!i)return E.debug("Patch provided is invalid, performing full manifest refresh"),void C(!0);e.loadedTime=new Date}}else(e=_.getValue()).loadedTime=new Date;if(_.getValue()&&_.getValue().type===be.default.DYNAMIC&&e.type===be.default.STATIC)return t.trigger(g.default.DYNAMIC_TO_STATIC),d=!1,void(c=!0);_.setValue(e);const n=new Date,i=(n.getTime()-e.loadedTime.getTime())/1e3;y=r.getManifestUpdatePeriod(e,i),1e3*y>2147483647&&(y=2147483.647),t.trigger(g.default.MANIFEST_UPDATED,{manifest:e}),E.info("Manifest has been refreshed at "+n+"["+n.getTime()/1e3+"] "),u||N()}function D(){u||(d?N(I.get().streaming.manifestUpdateRetryInterval):C())}function v(e){if(e.error)e.error.code===Ae.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&o.error(e.error);else{const t=e.manifest;!function(e){!function(e){const t=a.getExternalSubtitles();if(!t||0===t.length)return;const n=e&&e.Period?e.Period.length:0;t.forEach(t=>{if(null===t.periodId&&n>1)E.warn(`External subtitle with id ${t.id} has no periodId and the MPD contains more than one period. Unable to add the external subtitle as it is not clear which period shall be used.`);else if(1===n)M(e.Period[0],t);else{const n=e.Period.find(e=>e.id===t.periodId);n?M(n,t):E.warn(`External subtitle with id ${t.id} has periodId ${t.periodId} but the MPD does not contain a period with that id. Unable to add the external subtitle.`)}})}(e)}(t),b(t)}}function M(e,t){if(!e||!e.AdaptationSet)return e;e.AdaptationSet.push(t.serializeToMpdParserFormat())}function w(){u=!1,N()}function P(){u=!I.get().streaming.scheduling.scheduleWhilePaused,u&&R()}function O(){d=!1}return s={getIsUpdating:function(){return d},initialize:function(){A(),t.on(g.default.STREAMS_COMPOSED,O,this),t.on(p.default.PLAYBACK_STARTED,w,this),t.on(p.default.PLAYBACK_PAUSED,P,this),t.on(g.default.INTERNAL_MANIFEST_LOADED,v,this)},refreshManifest:C,reset:function(){t.off(p.default.PLAYBACK_STARTED,w,this),t.off(p.default.PLAYBACK_PAUSED,P,this),t.off(g.default.STREAMS_COMPOSED,O,this),t.off(g.default.INTERNAL_MANIFEST_LOADED,v,this),A()},setConfig:function(e){e&&(e.manifestModel&&(_=e.manifestModel),e.adapter&&(r=e.adapter),e.manifestLoader&&(T=e.manifestLoader),e.errHandler&&(o=e.errHandler),e.locationSelector&&(m=e.locationSelector),e.settings&&(I=e.settings),e.contentSteeringController&&(i=e.contentSteeringController),e.customParametersModel&&(a=e.customParametersModel))},setManifest:function(e){b(e)}},E=(0,l.default)(e).getInstance().getLogger(s),m=zn(e).create(),a=(0,pt.default)(e).getInstance(),s}$n.__dashjs_factory_name="ManifestUpdater";var Qn=r.default.getClassFactory($n);function Xn(e,t){return function(n,r){let i=Jn(n,"tag");const a=Jn(r??"*","range"),o=[];let s=-1;for(;++s<a.length;){const n=a[s].toLowerCase();if(!t&&"*"===n)continue;let r=-1;const l=[];for(;++r<i.length;)if(e(i[r].toLowerCase(),n)){if(!t)return i[r];o.push(i[r])}else l.push(i[r]);i=l}return t?o:void 0}}Xn(function(e,t){return"*"===t||e===t||e.includes(t+"-")}
2,!0);const Zn=Xn(function(e,t){const n=e.split("-"),r=t.split("-");let i=0,a=0;if("*"!==r[a]&&n[i]!==r[a])return!1;for(i++,a++;a<r.length;)if("*"!==r[a]){if(!n[i])return!1;if(n[i]!==r[a]){if(1===n[i].length)return!1;i++}else i++,a++}else a++;return!0},!0);function Jn(e,t){const n=e&&"string"==typeof e?[e]:e;if(!n||"object"!=typeof n||!("length"in n))throw new Error("Invalid "+t+" `"+n+"`, expected non-empty string");return n}function er(){const e=this.context,t=(0,f.default)(e).getInstance();let n,r,i,a,o,s,u,c,d,m,E;function T(e){if(!(e&&e.currentRepresentation&&e.currentRepresentation.mediaInfo&&e.currentRepresentation.mediaInfo.type))return;const t=e.currentRepresentation.mediaInfo.type;u[t]=e.currentRepresentation}function _(e,t){return e&&i[t]&&i[t][e]?i[t][e].list:[]}function y(e,t){return e&&i[t]&&i[t][e]?i[t][e].current:null}function S(e,n={}){if(!e||!e.streamInfo)return;const r=e.type,o=e.streamInfo.id,l=y(r,o);if(i[o]&&i[o][r]&&(i[o][r].current=e,i[o][r].current&&(r!==h.default.TEXT&&!R(e,l)||r===h.default.TEXT&&e.isFragmented)&&t.trigger(g.default.CURRENT_TRACK_CHANGED,{oldMediaInfo:l,newMediaInfo:e,switchMode:a.get().streaming.trackSwitchMode[r],options:n},{streamId:o}),!n.hasOwnProperty("noSettingsSave")||!n.noSettingsSave)){let t=function(e){const t={lang:e.lang,viewpoint:e.viewpoint,roles:e.roles,accessibility:e.accessibility,audioChannelConfiguration:e.audioChannelConfiguration,codec:e.codec};return t.lang||t.viewpoint||t.role&&t.role.length>0||t.accessibility&&t.accessibility.length>0||t.audioChannelConfiguration&&t.audioChannelConfiguration.length>0?t:null}(e);if(!t||!i[o][r].storeLastSettings)return;t.roles&&(t.role=t.roles[0],delete t.roles),t.accessibility&&(t.accessibility=t.accessibility[0]),t.audioChannelConfiguration&&(t.audioChannelConfiguration=t.audioChannelConfiguration[0]),s[r]=t,E.setSavedMediaSettings(r,t)}}function I(e,t){e&&t&&(o[e]=t)}function A(e){return e?o[e]:null}function R(t,n){if(!t&&!n)return!0;if(!t||!n)return!1;if(t.isPreselection!==n.isPreselection)return!1;let r=(0,Te.default)(e).getInstance();const i=t.id===n.id,a=r.areEqual(t.viewpoint,n.viewpoint),o=t.lang===n.lang,s=t.codec===n.codec,l=r.areEqual(t.roles,n.roles),u=r.areEqual(t.accessibility,n.accessibility),c=r.areEqual(t.audioChannelConfiguration,n.audioChannelConfiguration),d=r.areEqual(t.supplementalProperties,n.supplementalProperties),f=r.areEqual(t.essentialProperties,n.essentialProperties);return i&&s&&a&&o&&l&&u&&c&&d&&f}function N(){i={},s={},u={},o={audio:null,video:null,text:null},t.off(p.default.REPRESENTATION_SWITCH,T,n)}function C(e,t,n){let i=[];return e.forEach(function(e){t(n,e)&&i.push(e)}),0!==i.length?(r.info("Filter-Function ("+t.name+") resulted in "+i.length+" tracks"),i):t===w&&a.get().streaming.assumeDefaultRoleAsMain&&q(n.role,{schemeIdUri:h.default.DASH_ROLE_SCHEME_ID,value:be.default.MAIN})&&(r.info("no track with Role set to main - assuming main as default and searching again"),i=C(e,P,null),0!==i.length)?i:(r.info("Filter-Function ("+t.name+") resulted in no tracks; setting ignored"),e)}function b(e,t){try{return!e.lang||e.lang instanceof RegExp?t.lang.match(e.lang):""!==t.lang&&Zn(t.lang,xt(e.lang)).length>0}catch(e){return!1}}function D(e,t){return void 0===e.index||null===e.index||t.index===e.index}function v(e,t){return void 0===e.id||null===e.id||t.id===e.id}function M(e,t){return!e.viewpoint||!!t.viewpoint.filter(function(t){return q(t,e.viewpoint)})[0]}function w(e,t,n=!1){return!!t.roles&&(!e.role||!!t.roles.filter(function(t){return q(t,e.role)})[0]||t.type===h.default.AUDIO&&n)}function P(e,t){return!t.roles||0===t.roles.length}function O(e,t){let n;return n=e.accessibility?!!t.accessibility.filter(function(t){return q(t,e.accessibility)})[0]:!t.accessibility.length,n}function L(e,t){return!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter(function(t){return q(t,e.audioChannelConfiguration)})[0]}function F(e,t){return!e.codec||e.codec===t.codec}function U(e){let t=0,n=[];return e.forEach(e=>{isNaN(e.selectionPriority)||(e.selectionPriority>t?(t=e.selectionPriority,n=[e]):e.selectionPriority===t&&n.push(e))}),n}function x(e){let t,n=0,r=[];return e.forEach(function(e){t=Math.max.apply(Math,e.bitrateList.map(function(e){return e.bandwidth})),t>n?(n=t,r=[e]):t===n&&r.push(e)}),r}function B(e){return e[0]&&e[0].type===h.default.VIDEO?function(e){let t,n=1/0,r=[];return e.forEach(function(e){const i=e.bitrateList.reduce(function(e,t){const n=Math.max(1,t.width*t.height);return e+t.bandwidth/n},0);t=i/e.bitrateList.length,t<n?(n=t,r=[e]):t===n&&r.push(e)}),r}(e):e[0]&&e[0].type===h.default.AUDIO?function(e){let t=1/0,n=[];return e.forEach(function(e){let r=e.audioChannelConfiguration.reduce(function(e,t){return e+(ot(t)||0)},0)/e.audioChannelConfiguration.length;e.hasOwnProperty("supplementalProperties")&&e.supplementalProperties.some(e=>"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"===e.schemeIdUri&&"JOC"===e.value)&&(r=16),r||(r=1);
2let i=e.bitrateList.reduce(function(e,t){return e+t.bandwidth/r},0)/e.bitrateList.length;i<t?(t=i,n=[e]):i===t&&n.push(e)}),n}(e):e}function k(e){let t,n=0,r=[];return e.forEach(function(e){t=e.representationCount,t>n?(n=t,r=[e]):t===n&&r.push(e)}),r}function G(e,t){if(e===h.default.TEXT)return function(e){if(!e||0===e.length)return null;const t=e.filter(e=>!(e&&e.roles&&e.roles.length>0)||e.roles.every(e=>e.schemeIdUri!==h.default.DASH_ROLE_SCHEME_ID||e.value!==be.default.FORCED_SUBTITLE));return t.length>0?t[0]:e[0]}(t);let n;const i=c.getCustomInitialTrackSelectionFunction();if(n=function(e){try{let t;return t=function(e){try{const t=e.filter(e=>{const t=e.type;return e.bitrateList.some(e=>{const n=d.getAbrBitrateParameter("maxBitrate",t),r=d.getAbrBitrateParameter("minBitrate",t);return!(n>-1&&e.bandwidth>1e3*n||r>-1&&e.bandwidth<1e3*r)})});return t.length>0?t:e}catch(t){return r.error(t),e}}(e),t=function(e){try{if(!a.get().streaming.abr.limitBitrateByPortal)return e;const{elementWidth:t}=m.getVideoElementSize(),n=e.filter(e=>e.type!==h.default.VIDEO||e.bitrateList.some(e=>e.width<=t));return n.length>0?n:e}catch(t){return r.error(t),e}}(t),t}catch(t){return r.error(t),e}}(t),i&&"function"==typeof i)n=i(n);else if(u[e])n=function(e,t){if(!e||0===e.length||!t||!u[t])return e;const n=u[t].bandwidth;if(!n||isNaN(n))return e;let r={min:NaN,track:null};return e.forEach(e=>{e.bitrateList.forEach(t=>{const i=Math.abs(t.bandwidth-n);(isNaN(r.min)||i<r.min)&&(r.min=i,r.track=e)})}),r.track?[r.track]:e}(n,e);else if(a.get().streaming.ignoreSelectionPriority||(r.info("Trying to find track with highest selectionPriority"),n=function(e){return U(e)}(n)),n.length>1&&a.get().streaming.prioritizeRoleMain&&(r.info("Trying to find a main track"),n=C(n,w,{role:{schemeIdUri:h.default.DASH_ROLE_SCHEME_ID,value:be.default.MAIN}})),n.length>1){r.info("Selecting track based on selectionModeForInitialTrack");let e=a.get().streaming.selectionModeForInitialTrack;switch(e){case h.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE:n=function(e){let t=x(e);return t.length>1&&(t=k(t)),t}(n);break;case h.default.TRACK_SELECTION_MODE_FIRST_TRACK:n=H(n);break;case h.default.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:n=Y(n);break;case h.default.TRACK_SELECTION_MODE_WIDEST_RANGE:n=function(e){let t=k(e);return t.length>1&&(t=x(e)),t}(n);break;case h.default.TRACK_SELECTION_MODE_LOWEST_STARTUP_DELAY:n=function(e){let t=e.filter(e=>!(!e.segmentSequenceProperties||0===e.segmentSequenceProperties.length)&&e.segmentSequenceProperties.some(e=>e.isBootstrapConfiguration()));return Y(t.length>0?t:e)}(n);break;default:r.warn(`Track selection mode ${e} is not supported. Falling back to TRACK_SELECTION_MODE_FIRST_TRACK`),n=H(n)}}return n.length>0?n[0]:t[0]}function H(e){return e[0]}function Y(e){let t=B(e);return t.length>1&&(t=x(t)),t}function q(e,t){return!(!e||!t)&&JSON.stringify({schemeIdUri:e.schemeIdUri,value:e.value})===JSON.stringify({schemeIdUri:t.schemeIdUri,value:t.value})}return n={addTrack:function(e){if(!e)return;const t=e.type;if((n=t)!==h.default.AUDIO&&n!==h.default.VIDEO&&n!==h.default.TEXT&&n!==h.default.IMAGE)return void r.info("track not added (_isMultiTrackSupportedByType), track.index="+e.index);var n;let o=e.streamInfo.id;i[o]||(i[o]=function(){const e=a.get().streaming.saveLastMediaSettingsForCurrentStreamingSession;return{audio:{list:[],storeLastSettings:e,current:null},video:{list:[],storeLastSettings:e,current:null},text:{list:[],storeLastSettings:e,current:null},image:{list:[],storeLastSettings:e,current:null}}}());const s=i[o][t].list;for(let t=0,n=s.length;t<n;++t)if(R(s[t],e))return void r.info("track not added as it is already set (this track-index="+e.index+" - existing track.index="+s[t].index+")");r.info("addTrack with track.codec='"+e.codec+"', track.type='"+e.type+"', track.id='"+e.id+"', track.index="+e.index),s.push(e)},areTracksEqual:R,clearDataForStream:function(e){i[e]&&delete i[e]},getCurrentTrackFor:y,getInitialSettings:A,getTracksFor:_,getTracksWithHighestSelectionPriority:U,getTracksWithHighestBitrate:x,getTracksWithHighestEfficiency:B,getTracksWithWidestRange:k,initialize:function(){t.on(p.default.REPRESENTATION_SWITCH,T,n)},isCurrentTrack:function(e){if(!e)return!1;const t=e.type,n=e.streamInfo.id;return i[n]&&i[n][t]&&R(i[n][t].current,e)}
2,matchSettings:function(e,t,n=!1){try{let r=!1;if(e.lang){if(e.lang instanceof RegExp)r=t.lang.match(e.lang);else if(""!==t.lang){const n=xt(e.lang);n&&(r=Zn(t.lang,n).length>0)}}else r=!0;const i=void 0===e.index||null===e.index||t.index===e.index,a=!e.viewpoint||!!t.viewpoint.filter(function(t){return q(t,e.viewpoint)})[0],o=!e.role||!!t.roles.filter(function(t){return q(t,e.role)})[0];let s=!e.accessibility||!!t.accessibility.filter(function(t){return q(t,e.accessibility)})[0],l=!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter(function(t){return q(t,e.audioChannelConfiguration)})[0];return r&&i&&a&&(o||t.type===h.default.AUDIO&&n)&&s&&l}catch(e){return r.error(e),!1}},matchSettingsAccessibility:O,matchSettingsAudioChannelConfig:L,matchSettingsIndex:D,matchSettingsLang:b,matchSettingsRole:w,matchSettingsViewPoint:M,reset:N,saveTextSettingsDisabled:function(){E.setSavedMediaSettings(h.default.TEXT,null)},selectInitialTrack:G,setConfig:function(e){e&&(e.domStorage&&(E=e.domStorage),e.settings&&(a=e.settings),e.customParametersModel&&(c=e.customParametersModel),e.mediaPlayerModel&&(d=e.mediaPlayerModel),e.videoModel&&(m=e.videoModel))},setInitialMediaSettingsForType:function(e,t){let n=s[e]||A(e);const i=_(e,t.id);let o=[];n&&0!==Object.keys(n).length||(n=E.getSavedMediaSettings(e),n&&delete n.codec,I(e,n)),i&&0!==i.length&&(o=a.get().streaming.includePreselectionsForInitialTrackSelection?Array.from(i):i.filter(e=>!e.isPreselection),n&&(r.info("Filtering "+o.length+" "+e+" tracks based on settings"),o=C(o,v,n),o=C(o,b,n),o=C(o,D,n),o=C(o,M,n),e===h.default.AUDIO&&s[e]||(o=C(o,w,n)),o=C(o,O,n),o=C(o,L,n),o=C(o,F,n),r.info("Filtering "+e+" tracks ended, found "+o.length+" matching track(s).")),o.length>1?S(G(e,o)):S(o[0]))},setInitialSettings:I,setTrack:S},r=(0,l.default)(e).getInstance().getLogger(n),N(),n}Xn(function(e,t){let n=t;for(;;){if("*"===n||e===n)return!0;let t=n.lastIndexOf("-");if(t<0)return!1;"-"===n.charAt(t-2)&&(t-=2),n=n.slice(0,t)}},!1),er.__dashjs_factory_name="MediaController";const tr=r.default.getSingletonFactory(er);r.default.updateSingletonFactory(er.__dashjs_factory_name,tr);var nr=tr;function rr(){let e,t,n,r;const i=this.context,a=(0,u.default)(i).getInstance();function o(e,n){return isNaN(e)?0:e>0?(n&&t.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):e<-.5?(n&&t.warn("Supplied minimum playback rate is out of range and will be limited to -0.5: -50% playback speed."),-.5):e}function s(e,n){return isNaN(e)?0:e<0?(n&&t.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):e>1?(n&&t.warn("Supplied maximum playback rate is out of range and will be limited to 1: 200% playback speed."),1):e}function c(e,n){return isNaN(e)?0:e<0?(n&&t.warn("Supplied step algorithm value is a negative value when it should be positive or 0. The supplied value will not be applied and set to 0."),0):e<0?(n&&t.warn("Supplied step algorithm value is out of range and will be limited to 0"),0):e}function d(){const e=f(),t=n.getLiveDelay();return!isNaN(t)&&t>0?Math.min(e,t):e}function f(){return a.get().streaming.buffer.bufferTimeDefault>0?a.get().streaming.buffer.bufferTimeDefault:g()?20:12}function g(){return null!==a.get().streaming.buffer.fastSwitchEnabled?a.get().streaming.buffer.fastSwitchEnabled:!n.getLowLatencyModeEnabled()}return e={getAbrBitrateParameter:function(e,t){try{const n=a.get().streaming.abr[e][t];if(!isNaN(n)&&-1!==n)return n;const i=r.getServiceDescriptionSettings();return i&&i[e]&&!isNaN(i[e][t])?i[e][t]:-1}catch(e){return-1}},getBufferTimeDefault:d,getBufferTimeDefaultUnadjusted:f,getCatchupMaxDrift:function(){if(!isNaN(a.get().streaming.liveCatchup.maxDrift))return a.get().streaming.liveCatchup.maxDrift;const e=r.getServiceDescriptionSettings();return e&&e.liveCatchup&&!isNaN(e.liveCatchup.maxDrift)&&e.liveCatchup.maxDrift>=0?e.liveCatchup.maxDrift:12},getCatchupModeEnabled:function(){return null!==a.get().streaming.liveCatchup.enabled?a.get().streaming.liveCatchup.enabled:n.getInitialCatchupModeActivated()},getCatchupPlaybackRates:function(e){const t=a.get().streaming.liveCatchup.playbackRate;if(!isNaN(t.min)||!isNaN(t.max))return{min:o(t.min,e),max:s(t.max,e)};const n=r.getServiceDescriptionSettings();if(n&&n.liveCatchup&&(!isNaN(n.liveCatchup.playbackRate.min)||!isNaN(n.liveCatchup.playbackRate.max))){const t=n.liveCatchup.playbackRate;return{min:o(t.min,e),max:s(t.max,e)}}return{min:-.5,max:.5}},getCatchupStepSettings:function(e){const t=a.get().streaming.liveCatchup.step;return isNaN(t.start.min)&&isNaN(t.start.max)&&isNaN(t.stop.min)&&isNaN(t.stop.max)?{start:{min:0,max:1},stop:{min:0,max:1}}:{start:{min:c(t.start.min,e),max:c(t.start.max,e)},stop:{min:c(t.stop.min,e),max:c(t.stop.max,e)}}},getFastSwitchEnabled:g,getInitialBufferLevel:function(){const e=a.get().streaming.buffer.initialBufferLevel;return isNaN(e)||e<0?0:Math.min(d(),e)},getRetryAttemptsForType:function(e){const t=isNaN(a.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:a.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return n.getLowLatencyModeEnabled()?a.get().streaming.retryAttempts[e]*t:a.get().streaming.retryAttempts[e]},getRetryIntervalsForType:function(e){const t=isNaN(a.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:a.get().streaming.retryIntervals.lowLatencyReductionFactor;return n.getLowLatencyModeEnabled()?a.get().streaming.retryIntervals[e]/t:a.get().streaming.retryIntervals[e]},getScheduleTimeout:function(){return n.getLowLatencyModeEnabled()?a.get().streaming.scheduling.lowLatencyTimeout:a.get().streaming.scheduling.defaultTimeout},reset:function(){},setConfig:function(e){e.playbackController&&(n=e.playbackController),e.serviceDescriptionController&&(r=e.serviceDescriptionController)}},t=(0,l.default)(i).getInstance().getLogger(e),e}rr.__dashjs_factory_name="MediaPlayerModel";var ir=r.default.getSingletonFactory(rr);function ar(){const e=this.context,t=(0,f.default)(e).getInstance();let n,r,i,a,s,u,c,d,m,E,T,_,y,S,I,A,R,N,C,b,D,v,M,w;function P(){U(),I=!1,E=0,S=0,r=0,y=!1,_=!1,a=!1,R=NaN,m=NaN,M&&(t.off(g.default.DATA_UPDATE_COMPLETED,Q,s),t.off(g.default.MANIFEST_UPDATED,_e,s),t.off(g.default.STREAMS_COMPOSED,ye,s),t.off(p.default.PLAYBACK_ENDED,ge,s),t.off(p.default.STREAM_INITIALIZING,Ee,s),t.off(p.default.REPRESENTATION_SWITCH,Te,s),t.off(p.default.BUFFER_LEVEL_STATE_CHANGED,J,s),$(),M.removeEventListener("canplay",X),M.removeEventListener("canplaythrough",Z),M.removeEventListener("ended",de),M.removeEventListener("error",he),M.removeEventListener("loadeddata",ce),M.removeEventListener("loadedmetadata",ue),M.removeEventListener("pause",re),M.removeEventListener("play",ee),M.removeEventListener("playing",ne),M.removeEventListener("progress",se),M.removeEventListener("ratechange",le),M.removeEventListener("seeked",ae),M.removeEventListener("seeking",ie),M.removeEventListener("stalled",me),M.removeEventListener("timeupdate",oe),M.removeEventListener("volumechange",fe),M.removeEventListener("waiting",te)),w=null,M=null,D=null,c=null}function O(e=null){return parseFloat((L(e)-G()).toFixed(5))}function L(e){const t=e||D;return t.start+t.duration}function F(e=!1){D&&M&&M.getElement()?(e&&c&&k(G()),M.play()):I=!0}function U(){D&&M&&M.pause()}function x(e,t=!1,n=!1,r=!1){D&&M&&M.getElement()&&e!==(isNaN(R)?M.getTime():R)&&(u=!0===n,u||(R=e),T.
2info("Requesting seek to time: "+e+(u?" (internal)":"")),c&&r&&k(e),M.setCurrentTime(e,t))}function B(){if(!D||!M||!c)return;const e=b&&b.hasVideoTrack()?h.default.VIDEO:h.default.AUDIO,t=i.getCurrentDVRInfo(e);return t&&t.range?t.range.end:0}function k(e){const t=new Date(v.getClientReferenceTime()),r=n.getRegularPeriods()[0],i=v.calcPresentationTimeFromWallTime(t,r);E=i-e}function G(){return D&&M?M.getTime():null}function H(){return D&&M?M.isPaused():null}function Y(){return D&&M?M.isSeeking():null}function q(){return D&&M?M.isStalled():null}function V(){return D&&M?M.getPlaybackRate():null}function K(){return D&&M?M.getEnded():null}function j(){return c}function W(e=null){if(H()||!c||0===M.getReadyState()||Y()||y)return;e||(e=b.hasVideoTrack()?h.default.VIDEO:h.default.AUDIO);const t=G(),n=function(e,t){const n=i.getCurrentDVRInfo(t),r=n?n.range:null;let a;return r?(a=e>r.end?Math.max(r.end-E,r.start):e>0&&e+.25<r.start&&Math.abs(e-r.start)<31536e4?_?Math.max(r.end-E,r.start):r.start:e,a):NaN}(t,e);!isNaN(n)&&n!==t&&!Y()&&(q()||A||1===M.getReadyState())&&(T.debug(`UpdateCurrentTime: Seek to actual time: ${n} from currentTime: ${t}`),x(n,!1,!1))}function z(){null===w&&(w=setInterval(()=>{!function(){if(t.trigger(g.default.WALLCLOCK_TIME_UPDATED,{isDynamic:c,time:new Date}),j()){const e=Date.now();(isNaN(m)||e>m+C.get().streaming.liveUpdateTimeThresholdInMilliseconds)&&(b.addDVRMetric(),H()?function(){const e=Date.now();(!d||e>d+500)&&(d=e,oe())}():W(),m=e)}}()},C.get().streaming.wallclockTimeUpdateInterval))}function $(){clearInterval(w),w=null}function Q(e){const t=e.currentRepresentation,n=t?t.mediaInfo.streamInfo:null;null!==n&&D.id===n.id&&(D=n)}function X(){t.trigger(g.default.CAN_PLAY)}function Z(){t.trigger(g.default.CAN_PLAY_THROUGH)}function J(e){e.streamId===b.getActiveStreamInfo().id&&(A=e.state===o.BUFFER_EMPTY,C.get().streaming.buffer.setStallState&&M.setStallState(e.mediaType,e.state===o.BUFFER_EMPTY))}function ee(){T.info("Native video element event: play"),W(),z(),t.trigger(g.default.PLAYBACK_STARTED,{startTime:G()})}function te(){T.info("Native video element event: waiting"),t.trigger(g.default.PLAYBACK_WAITING,{playingTime:G()})}function ne(){T.info("Native video element event: playing"),u=!1,t.trigger(g.default.PLAYBACK_PLAYING,{playingTime:G()})}function re(){T.info("Native video element event: pause"),t.trigger(g.default.PLAYBACK_PAUSED,{ended:K()})}function ie(){if(u)return;let e=G();isNaN(R)||R===e||(e=R),R=NaN,T.info("Seeking to: "+e),z(),t.trigger(g.default.PLAYBACK_SEEKING,{seekTime:e,streamId:D.id})}function ae(){T.info("Native video element event: seeked"),u=!1,t.trigger(g.default.PLAYBACK_SEEKED,{streamId:D.id})}function oe(){D&&t.trigger(g.default.PLAYBACK_TIME_UPDATED,{timeToEnd:O(),time:G(),streamId:D.id})}function se(){t.trigger(g.default.PLAYBACK_PROGRESS,{streamId:D.id})}function le(){const e=V();T.info("Native video element event: ratechange: ",e),t.trigger(g.default.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function ue(){T.info("Native video element event: loadedmetadata"),t.trigger(g.default.PLAYBACK_METADATA_LOADED),z()}function ce(){T.info("Native video element event: loadeddata"),t.trigger(g.default.PLAYBACK_LOADED_DATA)}function de(){T.info("Native video element event: ended"),U(),$();const e=b?b.getActiveStreamInfo():null;e&&t.trigger(g.default.PLAYBACK_ENDED,{isLast:e.isLast})}function fe(){t.trigger(g.default.PLAYBACK_VOLUME_CHANGED)}function ge(e){if(w&&e.isLast){T.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");const t=e.seekTime?e.seekTime:L();M.setCurrentTime(t),U(),$()}}function he(e){const n=e.target||e.srcElement;t.trigger(g.default.PLAYBACK_ERROR,{error:n.error})}function pe(){c=!1}function me(e){t.trigger(g.default.PLAYBACK_STALLED,{e})}function Ee(e){var t;(t=e.mediaInfo)&&t.supplementalProperties&&t.supplementalProperties.find(e=>e.schemeIdUri===h.default.SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME)&&(T.debug("Low Latency critical SupplementalProperty set: Enabling low Latency"),_=!0)}function Te(e){const t=b.getActiveStreamInfo();e&&t&&e.currentRepresentation&&e.streamId&&e.streamId===t.id&&e.mediaType&&(e.mediaType===h.default.VIDEO||e.mediaType===h.default.AUDIO)&&(_=!1===e.currentRepresentation.availabilityTimeComplete||e.currentRepresentation.k>1,_&&!a&&(a=!0))}function _e(){y=!0}function ye(){y=!1}return s={computeAndSetLiveDelay:function(e,t){let i,a,o;const s=!isNaN(e)&&isFinite(e)?e:NaN;let l=n.getSuggestedPresentationDelay();const u=N.getServiceDescriptionSettings();return i=isNaN(C.get().streaming.delay.liveDelay)?null===C.get().streaming.delay.liveDelayFragmentCount||isNaN(C.get().streaming.delay.liveDelayFragmentCount)||isNaN(s)?u&&!isNaN(u.liveDelay)&&u.liveDelay>0?u.liveDelay:!0===C.get().streaming.delay.useSuggestedPresentationDelay&&null!==l&&!isNaN(l)&&l>0?l:isNaN(s)?t&&!isNaN(t.minBufferTime)?4*t.minBufferTime:4*D.manifestInfo.minBufferTime:4*s:s*C.get().streaming.delay.liveDelayFragmentCount:C.get().streaming.delay.liveDelay,o=n.getAvailabilityStartTime(),null!==o&&(r=o),a=t&&t.dvrWindowSize>0?Math.min(i,t.dvrWindowSize):i,E=a,S=a,a},getAvailabilityStartTime:function(){return r},getBufferLevel:function(e=null){let t=null;
2return b.getActiveStreamProcessors().forEach(n=>{if(!e||0===e.length||-1===e.indexOf(n.getType())){const e=n.getBufferLevel();t=null===t?e:Math.min(t,e)}}),t},getCurrentLiveLatency:function(){if(!c||isNaN(r))return NaN;let e=G();if(isNaN(e)||0===e)return 0;const t=(new Date).getTime()+1e3*v.getClientTimeOffset();return Math.max(((t-r-1e3*e)/1e3).toFixed(3),0)},getEnded:K,getInitialCatchupModeActivated:function(){return a},getIsDynamic:j,getIsManifestUpdateInProgress:function(){return y},getLiveDelay:function(){return E},getLowLatencyModeEnabled:function(){return _},getOriginalLiveDelay:function(){return S},getPlaybackRate:V,getPlaybackStalled:function(){return A},getPlayedRanges:function(){return D&&M?M.getPlayedRanges():null},getStreamController:function(){return b},getStreamEndTime:L,getTime:G,getTimeToStreamEnd:O,initialize:function(e,n){D=e,!0!==n&&(M.addEventListener("canplay",X),M.addEventListener("canplaythrough",Z),M.addEventListener("ended",de),M.addEventListener("error",he),M.addEventListener("loadeddata",ce),M.addEventListener("loadedmetadata",ue),M.addEventListener("pause",re),M.addEventListener("play",ee),M.addEventListener("playing",ne),M.addEventListener("progress",se),M.addEventListener("ratechange",le),M.addEventListener("seeked",ae),M.addEventListener("seeking",ie),M.addEventListener("stalled",me),M.addEventListener("timeupdate",oe),M.addEventListener("volumechange",fe),M.addEventListener("waiting",te),c=D.manifestInfo.isDynamic,A=!1,u=!1,t.on(g.default.DATA_UPDATE_COMPLETED,Q,s),t.on(g.default.MANIFEST_UPDATED,_e,s),t.on(g.default.STREAMS_COMPOSED,ye,s),t.on(p.default.PLAYBACK_ENDED,ge,s,{priority:f.default.EVENT_PRIORITY_HIGH}),t.on(p.default.STREAM_INITIALIZING,Ee,s),t.on(p.default.REPRESENTATION_SWITCH,Te,s),t.on(p.default.BUFFER_LEVEL_STATE_CHANGED,J,s),t.on(p.default.DYNAMIC_TO_STATIC,pe,s),I&&(I=!1,F()))},isPaused:H,isProgressing:function(e=500){return new Promise(n=>{let r=-1,i=null;const a=e=>{clearTimeout(i),i=null,t.off(p.default.PLAYBACK_TIME_UPDATED,o,s),n(e)},o=e=>{r<0?r=e.time:e.time>r+.1&&a(!0)};i=setTimeout(()=>{a(!1)},e),t.on(p.default.PLAYBACK_TIME_UPDATED,o,s)})},isSeeking:Y,isStalled:q,pause:U,play:F,reset:P,seek:x,seekToCurrentLive:function(e=!1,t=!1,n=!1){const r=B();0!==r&&x(r-E,e,t,n)},seekToOriginalLive:function(e=!1,t=!1,n=!1){const r=B();0!==r&&(E=S,x(r-E,e,t,n))},setConfig:function(e){e&&(e.streamController&&(b=e.streamController),e.serviceDescriptionController&&(N=e.serviceDescriptionController),e.dashMetrics&&(i=e.dashMetrics),e.adapter&&(n=e.adapter),e.videoModel&&(M=e.videoModel),e.timelineConverter&&(v=e.timelineConverter),e.settings&&(C=e.settings))},updateCurrentTime:W},T=(0,l.default)(e).getInstance().getLogger(s),P(),s}ar.__dashjs_factory_name="PlaybackController";var or=r.default.getSingletonFactory(ar),sr=n(1721),lr=class{constructor(){this.availabilityEndTime=NaN,this.availabilityStartTime=NaN,this.duration=NaN,this.index=null,this.indexRange=null,this.isPartialSegment=!1,this.media=null,this.mediaRange=null,this.mediaUrl=null,this.mediaStartTime=NaN,this.presentationStartTime=NaN,this.replacementNumber=NaN,this.replacementTime=null,this.representation=null,this.wallStartTime=NaN}assignAttributes(e){for(let t in e)e.hasOwnProperty(t)&&this.hasOwnProperty(t)&&(this[t]=e[t])}},ur=class extends lr{constructor(){super()}};function cr(){const e=this.context;let t,n,r,i,a,o,s,l,u,c,d,f;function g(e,t,r,a){let o=null;const l=e?f.resolve(e.path):null,u=a||{init:!0,url:l?l.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:t,representation:e};n.debug("Start searching for initialization.");const c=m(u);s.load({request:c,success:function(n){if(u.bytesLoaded=u.range.end,o=i.findInitRange(n),!o)return u.range.end=u.bytesLoaded+u.bytesToLoad,g(e,t,r,u);e.range=o,r(e)},error:function(){r(e)}}),n.debug("Perform init search: "+u.url)}function h(e,t,r,a,o,l){if(r&&(void 0===r.start||void 0===r.end)){const e=r?r.toString().split("-"):null;r=e?{start:parseFloat(e[0]),end:parseFloat(e[1])}:null}o=o||p;let u=null,c=null;const d=!!r,g=e?f.resolve(e.path):null,E={init:!1,url:g?g.url:void 0,range:d?r:{start:0,end:1500}
2,searching:!d,bytesLoaded:l?l.bytesLoaded:0,bytesToLoad:1500,mediaType:t,representation:e},T=m(E);s.load({request:T,success:function(r){const s=E.bytesToLoad,l=r.byteLength;if(E.bytesLoaded=E.range.end-E.range.start,u=i.parse(r),c=u.getBox("sidx"),c&&c.isComplete){const r=c.references;let i,s;if(null!=r&&r.length>0&&(i=1===r[0].reference_type),i){let i,s,l,u,d;n.debug("Initiate multiple SIDX load."),E.range.end=E.range.start+c.size;let f=[],g=0,p=(c.offset||E.range.start)+c.size;const m=function(t){t?(f=f.concat(t),g++,g>=s&&(f.sort(function(e,t){return e.startTime-t.startTime<0?-1:0}),o(f,e,a))):o(null,e,a)};for(i=0,s=r.length;i<s;i++)l=p,u=p+r[i].referenced_size-1,p+=r[i].referenced_size,d={start:l,end:u},h(e,t,d,a,m,E)}else n.debug("Parsing segments from SIDX. representation "+t+" - id: "+e.id+" for range : "+E.range.start+" - "+E.range.end),s=function(e,t){const n=e.references,r=n.length,i=e.timescale;let a=e.earliest_presentation_time,o=t.range.start+e.offset+e.first_offset+e.size;const s=[];let l,u,c,d;for(let e=0;e<r;e++)c=n[e].subsegment_duration,d=n[e].referenced_size,l=new ur,l.duration=c,l.startTime=a,l.timescale=i,u=o+d-1,l.mediaRange=o+"-"+u,s.push(l),a+=c,o+=d;return s}(c,E),o(s,e,a)}else{if(c)E.range.start=c.offset||E.range.start,E.range.end=E.range.start+(c.size||s);else{if(l<E.bytesLoaded)return void o(null,e,a);{const e=u.getLastBox();e&&e.size?(E.range.start=e.offset+e.size,E.range.end=E.range.start+s):E.range.end+=s}}h(e,t,E.range,a,null,E)}},error:function(){o(null,e,a)}}),n.debug(`Perform SIDX load for type ${t} : ${E.url} with range ${E.range.start} - ${E.range.end}`)}function p(e,t,n){n({segments:e,representation:t,error:e?void 0:new Ge.default(l.SEGMENT_BASE_LOADER_ERROR_CODE,l.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}function m(e){if(!e.url)return;const t=new $.default;return t.setInfo(e),t}return t={setConfig:function(e){e.baseURLController&&(f=e.baseURLController),e.dashMetrics&&(a=e.dashMetrics),e.mediaPlayerModel&&(o=e.mediaPlayerModel),e.errHandler&&(r=e.errHandler),e.boxParser&&(i=e.boxParser),e.debug&&(n=e.debug.getLogger(t)),e.errors&&(l=e.errors),e.urlUtils&&(d=e.urlUtils),e.constants&&(u=e.constants),e.dashConstants&&(c=e.dashConstants)},initialize:function(){s=(0,Re.default)(e).create({errHandler:r,dashMetrics:a,mediaPlayerModel:o,boxParser:i,errors:l,urlUtils:d,constants:u,dashConstants:c})},loadInitialization:function(e,t){return new Promise(n=>{g(e,t,n)})},loadSegments:function(e,t,n){return new Promise(r=>{h(e,t,n,r)})},reset:function(){s&&(s.abort(),s=null)}},t}cr.__dashjs_factory_name="SegmentBaseLoader";var dr=r.default.getSingletonFactory(cr);function fr(e){let t;e=e||{};let n=new DataView(e.data),r=0;function i(e,t){let i,a,o=!0,s=0;if(void 0===t&&(t=!1),e.tag>16777215?(n.getUint32(r)!==e.tag&&(o=!1),s=4):e.tag>65535?(i=n.getUint16(r),a=n.getUint8(r+2),256*i+a!==e.tag&&(o=!1),s=3):e.tag>255?(n.getUint16(r)!==e.tag&&(o=!1),s=2):(n.getUint8(r)!==e.tag&&(o=!1),s=1),!o&&e.required&&!t)throw new Error("required tag not found");return o&&(r+=s),o}function a(e){let t=1,i=128,a=-1,o=0,s=n.getUint8(r),l=0;for(l=0;l<8;l+=1){if((s&i)===i){o=void 0===e?s&~i:s,a=l;break}i>>=1}for(l=0;l<a;l+=1,t+=1)o=o<<8|255&n.getUint8(r+t);return r+=t,o}return t={getPos:function(){return r},setPos:function(e){r=e},consumeTag:i,consumeTagAndSize:function(e,t){let n=i(e,t);return n&&a(),n},parseTag:function(e){let n;return i(e),n=a(),t[e.parse](n)},skipOverElement:function(e,t){let n,o=i(e,t);return o&&(n=a(),r+=n),o},getMatroskaCodedNum:a,getMatroskaFloat:function(e){let t;switch(e){case 4:t=n.getFloat32(r),r+=4;break;case 8:t=n.getFloat64(r),r+=8}return t},getMatroskaUint:function(e){if(e>4)return function(e){const t=Math.floor(Number.MAX_SAFE_INTEGER/256);let i=0;for(let a=0;a<e;a+=1){if(i>t)throw new Error("Value exceeds safe integer limit");i*=256;const e=n.getUint8(r+a);if(i>Number.MAX_SAFE_INTEGER-e)throw new Error("Value exceeds safe integer limit");i+=e}return r+=e,i}(e);let t=0;for(let i=0;i<e;i+=1)t<<=8,t|=255&n.getUint8(r+i);return r+=e,t>>>0},moreData:function(){return r<n.byteLength}},t}fr.__dashjs_factory_name="EBMLParser";var gr=r.default.getClassFactory(fr);function hr(){const e=this.context;let t,n,r,i,a,o,s,l,u;function c(e){const t=new $.default;return t.setInfo(e),t}return t={setConfig:function(e){if(!(e.baseURLController&&e.dashMetrics&&e.mediaPlayerModel&&e.errHandler))throw new Error(h.default.MISSING_CONFIG_ERROR);u=e.baseURLController,a=e.dashMetrics,o=e.mediaPlayerModel,i=e.errHandler,l=e.errors,n=e.debug.getLogger(t)},initialize:function(){s=(0,Re.default)(e).create({errHandler:i,dashMetrics:a,mediaPlayerModel:o,errors:l})},loadInitialization:function(e,t){return new Promise(r=>{let i=null,a=e?u.resolve(e.path):null,o=e?e.range.split("-"):null,l={range:{start:o?parseFloat(o[0]):null,end:o?parseFloat(o[1]):null},request:i,url:a?a.url:void 0,init:!0,mediaType:t};n.info("Start loading initialization."),i=c(l),s.load({request:i,success:function(){r(e)},error:function(){r(e)}}),n.debug("Perform init load: "+l.url)})},loadSegments:function(t,i,a){return new Promise(o=>{let d=null,f=t?u.resolve(t.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:i,representation:t}),n.debug("Parsing ebml header"),s.load({request:d,success:function(i){!function(t,i,a,o){if(!t||0===t.byteLength)return void o(null);let l,u,d,f,g=gr(e).create({data:t}),h=a?a.split("-"):null,p=null,m={url:i,range:{start:h?parseFloat(h[0]):null,end:h?parseFloat(h[1]):null},request:p};
2for(n.debug("Parse EBML header: "+m.url),g.skipOverElement(r.EBML),g.consumeTag(r.Segment),d=g.getMatroskaCodedNum(),d+=g.getPos(),f=g.getPos();g.moreData()&&!g.consumeTagAndSize(r.Segment.Info,!0);)if(!(g.skipOverElement(r.Segment.SeekHead,!0)||g.skipOverElement(r.Segment.Tracks,!0)||g.skipOverElement(r.Segment.Cues,!0)||g.skipOverElement(r.Void,!0)))throw new Error("no valid top level element found");for(;void 0===l;){let e=g.getMatroskaCodedNum(!0),t=g.getMatroskaCodedNum();e===r.Segment.Info.Duration.tag?l=g[r.Segment.Info.Duration.parse](t):g.setPos(g.getPos()+t)}p=c(m),s.load({request:p,success:function(t){u=function(t,i,a,o){let s,l,u,c,d,f,g,h;for(l=function(t){let n,i,a=[],o=gr(e).create({data:t});for(o.consumeTagAndSize(r.Segment.Cues);o.moreData()&&o.consumeTagAndSize(r.Segment.Cues.CuePoint,!0);){for(n={},n.CueTime=o.parseTag(r.Segment.Cues.CuePoint.CueTime),n.CueTracks=[];o.moreData()&&o.consumeTag(r.Segment.Cues.CuePoint.CueTrackPositions,!0);){const e=o.getMatroskaCodedNum(),t=o.getPos();if(i={},i.Track=o.parseTag(r.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),0===i.Track)throw new Error("Cue track cannot be 0");i.ClusterPosition=o.parseTag(r.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),n.CueTracks.push(i),o.setPos(t+e)}if(0===n.CueTracks.length)throw new Error("Mandatory cuetrack not found");a.push(n)}if(0===a.length)throw new Error("mandatory cuepoint not found");return a}(t),u=[],d=0,f=l.length;d<f;d+=1)c=new ur,s=0,s=d<l.length-1?l[d+1].CueTime-l[d].CueTime:o-l[d].CueTime,c.duration=s,c.startTime=l[d].CueTime,c.timescale=1e3,g=l[d].CueTracks[0].ClusterPosition+i,h=d<l.length-1?l[d+1].CueTracks[0].ClusterPosition+i-1:a-1,c.mediaRange=g+"-"+h,u.push(c);return n.debug("Parsed cues: "+u.length+" cues."),u}(t,f,d,l),o(u)},error:function(){n.error("Download Error: Cues "+m.url),o(null)}}),n.debug("Perform cues load: "+m.url+" bytes="+m.range.start+"-"+m.range.end)}(i,g,a,function(e){o({segments:e,representation:t,error:e?void 0:new Ge.default(l.SEGMENT_BASE_LOADER_ERROR_CODE,l.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})})},error:function(){o({representation:t,error:new Ge.default(l.SEGMENT_BASE_LOADER_ERROR_CODE,l.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}})})},reset:function(){s&&(s.abort(),s=null)}},r={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}},t}hr.__dashjs_factory_name="WebmSegmentBaseLoader";var pr=r.default.getSingletonFactory(hr);function mr(e){e=e||{};const t=this.context,n=e.eventBus,r=e.events,i=e.dashMetrics,a=e.mediaPlayerModel,o=e.errHandler,s=e.baseURLController,l=e.debug,u=e.boxParser,c=e.errors;let d,f,g;function h(e){return"webm"===(e?e.split("/")[1]:"").toLowerCase()}return d={initialize:function(){f.initialize(),g.initialize()},getSegmentBaseInitSegment:function(e){return h(e.representation.mimeType)?g.loadInitialization(e.representation,e.mediaType):f.loadInitialization(e.representation,e.mediaType)},getSegmentList:function(e){return h(e.mimeType)?g.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null):f.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null)},reset:function(){f.reset(),g.reset()}},f=dr(t).getInstance(),g=pr(t).getInstance(),f.setConfig({baseURLController:s,dashMetrics:i,mediaPlayerModel:a,errHandler:o,eventBus:n,events:r,errors:c,debug:l,boxParser:u}),g.setConfig({baseURLController:s,dashMetrics:i,mediaPlayerModel:a,errHandler:o,eventBus:n,events:r,errors:c,debug:l}),d}mr.__dashjs_factory_name="SegmentBaseController";var Er=r.default.getSingletonFactory(mr);const Tr=[h.default.SERVICE_DESCRIPTION_DVB_LL_SCHEME],_r="video",yr="audio";function Sr(){const e=this.context;let t,n,r,i,a;function o(){n={liveDelay:NaN,liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN}},minBitrate:{},maxBitrate:{},initialBitrate:{},contentSteering:null,clientDataReporting:null},r=[]}function s(e,t,r){try{n[e][t]=r/1e3}catch(e){i.error(e)}}return t={applyServiceDescription:function(e){if(!e||!e.serviceDescriptions)return;const t=e.serviceDescriptions.filter(e=>Tr.includes(e.schemeIdUri)),a=e.serviceDescriptions.filter(e=>null==e.schemeIdUri);let o=t.length>0?t[t.length-1]:a[a.length-1];o&&(o.latency&&o.latency.target>0&&function(e){let t;if(e.schemeIdUri,h.default.SERVICE_DESCRIPTION_DVB_LL_SCHEME,t=function(e){return{liveDelay:e.latency.target/1e3,maxDrift:!isNaN(e.latency.max)&&e.latency.max>e.latency.target?(e.latency.max-e.latency.target+500)/1e3:NaN,referenceId:e.latency.referenceId||NaN}}(e),r.length>0){let{to:e,id:a}=function(e){let t,n=0,i=r.filter(t=>t.id===e.referenceId);return 0===i.length?(n=r.length>0?r[0].to:0,t=r[0].id||NaN):(n=i[0].to||0,t=i[0].id||NaN),{to:n,id:t}}(t);n.liveDelay=t.liveDelay-e,n.liveCatchup.maxDrift=t.maxDrift,i.debug(`\n                Found latency properties coming from service description. Applied time offset of ${e} from ProducerReferenceTime element with id ${a}.\n                Live Delay: ${t.liveDelay-e}, Live catchup max drift: ${t.maxDrift}\n            `)}else n.liveDelay=t.liveDelay,n.liveCatchup.maxDrift=t.maxDrift,i.debug(`Found latency properties coming from service description: Live Delay: ${t.liveDelay}, Live catchup max drift: ${t.maxDrift}`)}(o),o.playbackRate&&function(e){const t=e.playbackRate.min?Math.round(1e3*(e.playbackRate.min-1))/1e3:NaN,r=e.playbackRate.max?Math.round(1e3*(e.playbackRate.max-1))/1e3:NaN;n.liveCatchup.playbackRate.min=t,n.liveCatchup.playbackRate.max=r,i.debug(`Found latency properties coming from service description: Live catchup min playback rate: ${t}`),i.debug(`Found latency properties coming from service description: Live catchup max playback rate: ${r}`)}(o),o.operatingQuality,o.operatingBandwidth&&function(e){if(!e||!e.operatingBandwidth||!e.operatingBandwidth.mediaType||"all"===e.operatingBandwidth.mediaType)return;const t={};t.minBandwidth=e.operatingBandwidth.min,t.maxBandwidth=e.operatingBandwidth.max,t.targetBandwidth=e.operatingBandwidth.target;const n=[];e.operatingBandwidth.mediaType===_r||e.operatingBandwidth.mediaType===yr?n.push(e.operatingBandwidth.mediaType):"any"===e.operatingBandwidth.mediaType&&(n.push(yr),n.push(_r)),n.forEac
2h(e=>{isNaN(t.minBandwidth)||s("minBitrate",e,t.minBandwidth),isNaN(t.maxBandwidth)||s("maxBitrate",e,t.maxBandwidth),isNaN(t.targetBandwidth)||s("initialBitrate",e,t.targetBandwidth)})}(o),o.contentSteering&&function(e){n.contentSteering=e.contentSteering}(o),o.clientDataReporting&&function(e){n.clientDataReporting=e.clientDataReporting}(o))},calculateProducerReferenceTimeOffsets:function(e){try{let t=[];if(e&&e.length>0){const n=[h.default.VIDEO,h.default.AUDIO,h.default.TEXT],r=a.getAvailabilityStartTime()/1e3;e.forEach(e=>{const i=n.reduce((t,n)=>t.concat(a.getAllMediaInfoForType(e,n)),[]).reduce((t,n)=>(a.getProducerReferenceTimes(e,n).forEach(i=>{const o=a.getVoRepresentations(n);if(o&&o.length>0&&o[0].adaptation&&o[0].segmentInfoType===be.default.SEGMENT_TEMPLATE){const n=o[0],a=new Date(i[be.default.WALL_CLOCK_TIME]).getTime()/1e3-(i[be.default.PRESENTATION_TIME]/n[be.default.TIMESCALE]-n[be.default.PRESENTATION_TIME_OFFSET]+e.start),s=r-a;t.push({id:i[be.default.ID],to:s})}}),t),[]);t=t.concat(i)})}r=t}catch(e){i.error(e),r=[]}},getProducerReferenceTimeOffsets:function(){return r},getServiceDescriptionSettings:function(){return n},reset:function(){o()},setConfig:function(e){e&&e.adapter&&(a=e.adapter)}},i=(0,l.default)(e).getInstance().getLogger(t),o(),t}Sr.__dashjs_factory_name="ServiceDescriptionController";var Ir=r.default.getSingletonFactory(Sr);class Ar{constructor(e){this._ranges=[];for(const t of e){const e=this._ranges,n={start:t.start,end:t.end},r=e.length?e[e.length-1]:null;!r||n.start>r.end?e.push(n):r.end=n.end}}get length(){return this._ranges.length}start(e){return this._ranges[e].start}end(e){return this._ranges[e].end}}var Rr=class{constructor(e,t){this.eventBus=t,this.mimeType=e,this.updating=!1,this.chunks=[],this.appendWindowStart=0,this.appendWindowEnd=1/0,this.timestampOffset=0,this.mode="segments"}appendBuffer(e,t,n){if(this.updating)throw new Error("SourceBuffer is currently updating");this.updating=!0,this.eventBus.trigger("externalSourceBufferUpdateStart",{mimeType:this.mimeType,request:"appendBuffer",data:e,start:t,end:n}),Number.isNaN(t)||(this.chunks.push({data:e,start:t,end:n}),this.chunks.sort((e,t)=>e.start-t.start)),setTimeout(()=>{this.updating=!1,this.eventBus.trigger("externalSourceBufferUpdating",{mimeType:this.mimeType}),this.eventBus.trigger("externalSourceBufferUpdateEnd",{mimeType:this.mimeType})},10)}abort(){this.updating&&(this.updating=!1,this.eventBus.trigger("externalSourceBufferAbort",{mimeType:this.mimeType}),this.eventBus.trigger("externalSourceBufferUpdateEnd",{mimeType:this.mimeType}))}remove(e,t){if(this.updating)throw new Error("SourceBuffer is currently updating");this.updating=!0,this.eventBus.trigger("externalSourceBufferUpdateStart",{mimeType:this.mimeType,request:"remove",start:e,end:t}),this.chunks=this.chunks.filter(n=>n.end<=e||n.start>=t),setTimeout(()=>{this.updating=!1,this.eventBus.trigger("externalSourceBufferUpdating",{mimeType:this.mimeType}),this.eventBus.trigger("externalSourceBufferUpdateEnd",{mimeType:this.mimeType})},10)}get buffered(){return new Ar(this.chunks)}},Nr=class{constructor(e){this.eventBus=e,this.reset()}get duration(){return this._duration}set duration(e){if("open"!==this._readyState)throw new Error("ExternalMediaSource is not open");this._duration=e}get readyState(){return this._readyState}addSourceBuffer(e){if("open"!==this._readyState)throw new Error("ExternalMediaSource is not open");const t=new Rr(e,this.eventBus);return this.sourceBuffers.set(t,e),t}removeSourceBuffer(e){if(!this.sourceBuffers.has(e))throw new Error("ExternalSourceBuffer not found");this.sourceBuffers.delete(e)}open(){this._readyState="open",this.eventBus.trigger("externalMediaSourceOpen",{})}endOfStream(){if("open"!==this._readyState)throw new Error("ExternalMediaSource is not open");this._readyState="ended",this.eventBus.trigger("externalMediaSourceEnded",{})}close(){this._readyState="closed",this.eventBus.trigger("externalMediaSourceClosed",{})}reset(){this.sourceBuffers=new Map,this._duration=NaN,this._readyState="closed"}},Cr=class{constructor(){this.streamId=null,this.segmentType=null,this.index=NaN,this.bytes=null,this.start=NaN,this.end=NaN,this.duration=NaN,this.representation=null,this.endFragment=null}};class br extends $.default{constructor(e){super(e),this.checkForExistenceOnly=!0}}var Dr=br;function vr(e){e=e||{};const t=this.context,n=e.eventBus,r=e.events,i=e.urlUtils,a=e.errors,o=e.streamId;let s,l;return s={abort:function(){l&&l.abort()},checkForExistence:function(e){const t=function(t){n.trigger(r.CHECK_FOR_EXISTENCE_COMPLETED,{request:e,exists:t})};if(e){let n=new Dr(e.url);l.load({request:n,success:function(){t(!0)},error:function(){t(!1)}})}else t(!1)},load:function(e){const t=function(t,i){n.trigger(r.LOADING_COMPLETED,{request:e,response:t||null,error:i||null,sender:s})};e?l.load({request:e,progress:function(t){n.trigger(r.LOADING_PROGRESS,{request:e,stream:t.stream,streamId:o}),t.data&&n.trigger(r.LOADING_DATA_PROGRESS,{request:e,response:t.data||null,error:null,sender:s})},success:function(e){t(e)},error:function(e,n,r){t(void 0,new Ge.default(a.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,r,n))},abort:function(e){e&&n.trigger(r.LOADING_ABANDONED,{mediaType:e.mediaType,request:e,sender:s})}}):t(void 0,new Ge.default(a.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,a.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},reset:function(){l&&(l.abort(),l.reset(),l=null)},resetInitialSettings:function(){l&&l.resetInitialSettings()}},l=(0,Re.default)(t).create({errHandler:e.errHandler,errors:a,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,urlUtils:i,constants:h.default,boxParser:e.boxParser,dashConstants:e.dashConstants}),s}vr.__dashjs_factory_name="FragmentLoader";var Mr=r.default.getClassFactory(vr);function wr(e){e=e||{};const t=this.context,n=(0,f.default)(t).getInstance(),r=e.errHandler,i=e.mediaPlayerModel,a=e.dashMetrics,o=(0,l.default)(t).getInstance(),s=e.streamInfo;let u,c,d;function m(){return s.id}function E(){for(let e in d)d[e].reset();d={}}function T(e){if(!e.sender)return;const t=e.request,r=e.response,i=t.isInitializationRequest(),a=t.representation.mediaInfo.streamInfo;if(e.error&&(t.mediaType===h.default.AUDIO||t.mediaType===h.default.VIDEO||t.mediaType===h.default.TEXT&&t.representation.mediaInfo.isFragmented)&&n.trigger(g.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD,{entry:e.request.serviceLocation}),!r||!a)return void c.warn("No "+t.mediaType+" bytes to push or stream is inactive.");const o=function(e,t,n,r){const i=new Cr;return i.streamId=n,i.segmentType=t.type,i.start=t.startTime,i.duration=t.duration,i.end=i.start+i.duration,i.bytes=e,i.index=t.index,i.representation=t.representation,i.endFragment=r,i}(r,t,s.id,e.type!==g.default.FRAGMENT_LOADING_PROGRESS);n.trigger(i?g.default.INIT_FRAGMENT_LOADED:g.default.MEDIA_FRAGMENT_LOADED,{chunk:o,request:t},{streamId:a.id,mediaType:t.mediaType})}return u={getStreamId:m,getModel:function(l){let u=d[l];return u||(u=te(t).create({streamInfo:s,type:l,dashMetrics:a,fragmentLoader:Mr(t).create({dashMetrics:a,mediaPlayerModel:i,errHandler:r,settings:e.settings,boxParser:e.boxParser,eventBus:n,events:g.default,errors:Ae.default,dashConstants:e.dashConstants,urlUtils:e.urlUtils,streamId:m()}),debug:o,eventBus:n,events:g.default}),d[l]=u),u},reset:function(){n.off(p.default.FRAGMENT_LOADING_COMPLETED,T,this),n.off(p.default.FRAGMENT_LOADING_PROGRESS,T,this),E()}},c=o.getLogger(u),E(),n.on(p.default.FRAGMENT_LOADING_COMPLETED,T,u),n.on(p.default.FRAGMENT_LOADING_PROGRESS,T,u),u}wr.__dashjs_factory_name="FragmentController";var Pr=r.default.getClassFactory(wr),Or=class{constructor(e){this.newMediaInfo=e.newMediaInfo,this.previouslySelectedRepresentation=e.previouslySelectedRepresentation,this.newRepresentation=e.newRepresentation}};function Lr(e){const t=this.context,n=(0,u.default)(t).getInstance(),r=e.textController,i=e.eventBus;let a,o,s,c,d,f,p=[],m=[],E=!1,T=e.mediaSource,_=null;function y(e){return e.mimeType+';codecs="'+e.codecs+'"'}function S(e){return c=r.getTextSourceBuffer(e),Promise.resolve()}function I(){if("function"==typeof c.addEventListener)try{c.addEventListener("updateend",v,!1),c.addEventListener("error",M,!1),c.addEventListener("abort",M,!1)}catch(e){f=setInterval(v,50)}else f=setInterval(v,50)}function A(){try{"function"==typeof c.removeEventListener&&(c.removeEventListener("updateend",v,!1),c.removeEventListener("error",M,!1),c.removeEventListener("abort",M,!1)),clearInterval(f)}catch(e){s.error(e)}}function N(e){return new Promise(t=>{c&&n.get().streaming.buffer.useAppendWindow?w(()=>{try{if(!c)return void t();let n=T.duration,r=0;e&&!isNaN(e.start)&&!isNaN(e.duration)&&isFinite(e.duration)&&(n=e.start+e.duration),e&&!isNaN(e.start)&&(r=e.start),c.appendWindowEnd===n&&c.appendWindowStart===r||(c.appendWindowStart=0,c.appendWindowEnd=n+.01,c.appendWindowStart=Math.max(r-.1,0),s.debug(`Upd
2ated append window for ${d.type}. Set start to ${c.appendWindowStart} and end to ${c.appendWindowEnd}`)),t()}catch(e){s.warn("Failed to set append window"),t()}}):t()})}function C(e){return new Promise(t=>{c?w(()=>{try{c.timestampOffset===e||isNaN(e)||(c.timestampOffset=e,s.debug(`Set MSE timestamp offset to ${e}`)),t()}catch(e){t()}}):t()})}function b(){if(!E&&m.length>0){E=!0;const e=m[0];m.splice(0,1);const t=function(){E=!1,m.length>0&&b.call(this),e&&e.data&&e.data.segmentType&&e.data.segmentType!==R.HTTPRequest.INIT_SEGMENT_TYPE&&delete e.data.bytes,e.promise.resolve({chunk:e.data})};try{if(_=e.request,0===e.data.bytes.byteLength)t.call(this);else{try{s.debug(`Appending ${e.data.segmentType} from period ${e.data.streamId} to buffer. Request URL: ${e.request.url}, Representation: ID: ${e.data.representation.id}, bitrate: ${e.data.representation.bitrateInKbit}`)}catch(e){}c instanceof Rr?c.appendBuffer(e.data.bytes,e.data.start,e.data.end):c.appendBuffer?c.appendBuffer(e.data.bytes):c.append(e.data.bytes,e.data),w(t.bind(this))}}catch(t){s.fatal('SourceBuffer append failed "'+t+'"'),m.length>0?b():E=!1,delete e.data.bytes,e.promise.reject({chunk:e.data,error:new Ge.default(t.code,t.message)})}}}function D(){p.length>0&&!c.updating&&(p.shift()(),D())}function v(){c&&!c.updating&&D()}function M(e){const t=e.target||{};!function(e,t){let n=t||{};i.trigger(e,n,{streamId:d.streamInfo.id,mediaType:o})}(g.default.SOURCE_BUFFER_ERROR,{error:t,lastRequestAppended:_})}function w(e){try{p.push(e),c&&!c.updating&&D()}catch(e){s.error(e)}}return a={abort:function(){return new Promise(e=>{try{m=[],"open"===T.readyState?w(()=>{try{c&&c.abort(),e()}catch(t){e()}}):c&&c.setTextTrack&&"ended"===T.readyState?(c.abort(),e()):e()}catch(t){e()}})},abortBeforeAppend:function(){return new Promise(e=>{w(()=>{const t=c.appendWindowStart,n=c.appendWindowEnd;c&&(c.abort(),c.appendWindowStart=t,c.appendWindowEnd=n),e()})})},append:function(e,t=null){return new Promise((n,r)=>{e?(m.push({data:e,promise:{resolve:n,reject:r},request:t}),w(b.bind(this))):r({chunk:e,error:new Ge.default(Ae.default.APPEND_ERROR_CODE,Ae.default.APPEND_ERROR_MESSAGE)})})},changeType:function(e){const t=y(e);return new Promise((e,r)=>{w(()=>{if(c&&c.changeType)try{s.debug(`Changing SourceBuffer codec to ${t}`),c.changeType(t),e()}catch(e){!function(e){s.error(e),"string"==typeof e?.name&&"NotSupportedError"===e.name&&n.update({streaming:{buffer:{useChangeType:!1,resetSourceBuffersForTrackSwitch:!0}}})}(e),r()}else e()})})},getAllBufferRanges:function(){try{return c?.buffered}catch(e){return s.error("getAllBufferRanges exception: "+e.message),null}},getBuffer:function(){return c},getType:function(){return o},initializeForFirstUse:function(e,t){d=e;const n=e.streamInfo;o=d.type;const r=t?y(t):e.codec;try{if(r.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))return S(n);c=T.addSourceBuffer(r),I();const e=[];return e.push(N(d.streamInfo)),t&&void 0!==t.mseTimeOffset&&e.push(C(t.mseTimeOffset)),Promise.all(e)}catch(e){return d.type==h.default.TEXT&&!d.isFragmented||-1!==r.indexOf('codecs="stpp')||-1!==r.indexOf('codecs="vtt')||-1!==r.indexOf("text/vtt")?S(n):Promise.reject(e)}},initializeForStreamSwitch:function(e,t,n){d=e,o=d.type,function(e){c=e.getBuffer()}(n),I()},remove:function(e){return new Promise((t,n)=>{const r=e.start,i=e.end;r>=0&&i>r?w(function(){try{c.remove(r,i),w(function(){t({from:r,to:i,unintended:!1}),e.resolve&&e.resolve()})}catch(t){n({from:r,to:i,unintended:!1,error:new Ge.default(Ae.default.REMOVE_ERROR_CODE,Ae.default.REMOVE_ERROR_MESSAGE)}),e.reject&&e.reject(t)}}):t()})},removeEventListeners:A,reset:function(){if(c){try{p=[],A(),E=!1,m=[],c.getClassName&&"TextSourceBuffer"===c.getClassName()||(s.debug("Removing sourcebuffer from media source"),T.removeSourceBuffer(c))}catch(e){}c=null}_=null},updateAppendWindow:N,updateTimestampOffset:C},s=(0,l.default)(t).getInstance().getLogger(a),a}Lr.__dashjs_factory_name="SourceBufferSink";var Fr=r.default.getClassFactory(Lr);function Ur(e){const t=this.context;let n,r,i,a=[],o=[],s=e;return n={getAllBufferRanges:function(){let e=[];for(let t=0;t<o.length;t++){let n=o[t];0===e.length||n.start>e[e.length-1].end?e.push({start:n.start,end:n.end}):e[e.length-1].end=n.end}const t={start:function(t){return e[t].start},end:function(t){return e[t].end}};return Object.defineProperty(t,"length",{get:function(){return e.length}}),t},append:function(e){return"InitializationSegment"!==e.segmentType?(o.push(e),o.sort(function(e,t){return e.start-t.start}),i=null):(a.includes(e)||a.push(e),i=e),r.debug("PreBufferSink a
2ppended chunk s: "+e.start+"; e: "+e.end),s&&s({chunk:e}),Promise.resolve()},remove:function(e,t){return o=o.filter(n=>!((isNaN(t)||n.start<t)&&(isNaN(e)||n.end>e))),Promise.resolve()},abort:function(){return Promise.resolve()},discharge:function(){const e=o;let t=null;for(let n=0;n<e.length;n++)t&&e[n].representation.id==t.representation.id||(t=a.find(t=>t.representation.id===e[n].representation.id),t&&(e.splice(n,0,t),n++));return i&&(e.push(i),i=null),o=[],a=[],e},reset:function(){o=[],a=[],i=null,s=null},updateTimestampOffset:function(){return Promise.resolve()},waitForUpdateEnd:function(e){e()},getBuffer:function(){return this}},r=(0,l.default)(t).getInstance().getLogger(n),n}Ur.__dashjs_factory_name="PreBufferSink";var xr=r.default.getClassFactory(Ur);const Br=.01,kr="BufferController";function Gr(e){const t=(e=e||{}).capabilities,n=this.context,r=(0,f.default)(n).getInstance(),i=e.fragmentModel,a=e.playbackController,s=e.representationController,u=e.settings,c=e.streamInfo,d=e.textController,m=e.type;let E,T,_,y,S,I,A,N,C,b,D,v,M,w,P,O,L,F,U,x,B;function k(e,t=null){return new Promise((n,r)=>{I=e,C&&t&&"function"==typeof C.discharge?(b=C,G(t).then(()=>{n()}).catch(e=>{r(e)})):n()})}function G(e,t=new Map,i){return new Promise((a,o)=>{F&&e?I?(D=!1,function(e,t,i){return new Promise(a=>{C=Fr(n).create({mediaSource:I,textController:d,eventBus:r}),function(e,t,n){const r=s.getCurrentRepresentation();let i=null;return m!==h.default.VIDEO&&m!==h.default.AUDIO||(i=t.get(m)),i?function(e,t,n,r){C.initializeForStreamSwitch(e,t,n);const i=[];return i.push(C.abortBeforeAppend()),i.push(de()),i.push(W(t,r)),t&&void 0!==t.mseTimeOffset&&i.push(ce(t)),Promise.allSettled(i)}(e,r,i,n):function(e,t){return C.initializeForFirstUse(e,t)}(e,r)}(e,t,i).then(()=>ce(s.getCurrentRepresentation())).then(()=>{a(C)}).catch(e=>{T.warn("Caught error on create SourceBuffer: "+e),a(C)})})}(e,t,i).then(e=>{a(e)}).catch(e=>{o(e)})):(D=!0,function(){return new Promise((e,t)=>{C=xr(n).create(K.bind(this)),ce(s.getCurrentRepresentation()).then(()=>{e(C)}).catch(()=>{t()})})}().then(e=>{a(e)}).catch(e=>{o(e)})):a(null)})}function H(e){u.get().streaming.cacheInitSegments&&(T.info("Init fragment finished loading saving to",m+"'s init cache"),F.save(e.chunk)),T.debug(`Appending init fragment for type ${m}, representationId ${e.chunk.representation.id} and bandwidth ${e.chunk.representation.bandwidth}`),q(e.chunk)}function Y(e){q(e.chunk,e.request)}function q(e,t=null){C&&(C.append(e,t).then(e=>{K(e)}).catch(e=>{K(e)}),e.representation.mediaInfo.type===h.default.VIDEO&&Te(g.default.VIDEO_CHUNK_RECEIVED,{chunk:e}))}function V(e){if(e&&e.length>0)for(let t=0,n=e.length;t<n;t++)T.debug("Buffered range: "+e.start(t)+" - "+e.end(t)+", currentTime = ",a.getTime())}function K(e){if(e.error)return void function(e){22===e.error.code&&function(){if(L=!0,S=.8*pe(),T.warn("Quota exceeded, Critical Buffer: "+S),S>0){const e=Math.max(.2*S,1),t=S-e,n=Math.min(u.get().streaming.buffer.bufferTimeAtTopQuality,.9*t),r=Math.min(u.get().streaming.buffer.bufferTimeAtTopQualityLongForm,.9*t),i={streaming:{buffer:{bufferToKeep:parseFloat(e.toFixed(5)),bufferTimeAtTopQuality:parseFloat(n.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(r.toFixed(5))}}};u.update(i)}}(),22!==e.error.code&&Ee()||(T.warn("Clearing playback buffer to overcome quota exceed situation"),Te(g.default.QUOTA_EXCEEDED,{criticalBufferLevel:S,quotaExceededTime:e.chunk.start}),se(oe()))}(e);if(!C)return;if(ee(),L=!1,w=e.chunk,!w||!w.endFragment)return;w&&!isNaN(w.index)&&(A=Math.max(w.index,A),ne());const t=C.getAllBufferRanges();w.segmentType===R.HTTPRequest.MEDIA_SEGMENT_TYPE&&(V(t),Q(),function(){if(isNaN(B)||D)return;if(m!==h.default.AUDIO&&m!==h.default.VIDEO)return void(B=NaN);const e=a.getTime(),t=J(e,0),n=J(B,0);if(t&&n&&t.start===n.start)return void(B=NaN);const r=s.getCurrentRepresentation().segmentDuration,i=J(B,r);i&&(u.get().streaming.buffer.enableSeekDecorrelationFix&&Math.abs(e-B)>r?B<=i.end&&a.seek(Math.max(B,i.start),!1,!0):e<i.start&&a.seek(i.start,!1,!0))}());let n=!1;v&&(v.indexOf(w)>0&&(n=!0),v=null),w&&!n&&Te(g.default.BYTES_APPENDED_END_FRAGMENT,{startTime:w.start,index:w.index,bufferedRanges:t,segmentType:w.segmentType,mediaType:m,representationId:w.representation.id})}function j(e,t){const n=[];return n.push(ce(e)),n.push(C?C.abort():Promise.resolve()),n.push(W(e,t)),Promise.allSettled(n)}function W(e,n){if(!e||!n)return T.warn("BufferController._changeCodec() is missing the information about the Representations. Doing nothing"),Promise.resolve();if(e&&n&&e.mimeType===n.mimeType&&e.codecFamily===n.codecFamily)return T.debug(`Switching to new codec ${e.codecs} without changeType as previous codec ${n.codecs} is compatible.`),Promise.resolve();
2if(!u.get().streaming.buffer.useChangeType||!t.supportsChangeType())return T.debug("changeType() not available"),Promise.resolve();T.debug(`Using changeType() to switch from codec ${n.codecs} to ${e.codecs}`);const r=e.dependentRepresentation?e.dependentRepresentation:e;return C.changeType(r)}function z(){return new Promise((e,t)=>{let n=$();if(!n||0===n.length)return Q(),void e();se(n).then(()=>{e()}).catch(e=>{t(e)})})}function $(e){const t=[],n=C.getAllBufferRanges();if(!n||0===n.length)return t;if(!e&&0!==e||isNaN(e))t.push({start:n.start(0),end:n.end(n.length-1)+.5});else{const r=function(e,t){const n=u.get().streaming.buffer.bufferToKeep,r=t.start(0);if(e-r>n){let t=Math.max(0,e-n);const a=i.getRequests({state:te.FRAGMENT_MODEL_EXECUTED,time:e,threshold:Br})[0];if(a&&(t=Math.min(a.startTime,t)),t>0)return{start:r,end:t}}return null}(e,n),a=function(e,t){const n=t.end(t.length-1)+.5,r=me(e),a=c.manifestInfo.duration>=u.get().streaming.buffer.longFormContentDurationThreshold?u.get().streaming.buffer.bufferTimeAtTopQualityLongForm:u.get().streaming.buffer.bufferTimeAtTopQuality;let o=isNaN(r)?e:Math.min(r,e+a);if(o>=t.end(t.length-1))return null;const s=i.getRequests({state:te.FRAGMENT_MODEL_EXECUTED,time:e,threshold:Br})[0];if(s&&(o=Math.max(s.startTime+s.duration,o)),u.get().streaming.buffer.avoidCurrentTimeRangePruning)for(let r=0;r<t.length;r++)if(t.start(r)<=e&&e<=t.end(r)&&t.start(r)<=o&&o<=t.end(r)){let i=o;o=r+1<t.length?t.start(r+1):t.end(r)+1,T.debug("Buffered range ["+t.start(r)+", "+t.end(r)+"] overlaps with targetTime "+e+" and range to be pruned ["+i+", "+n+"], using ["+o+", "+n+"] instead"+(o<n?"":" (no actual pruning)"));break}return o<t.end(t.length-1)?{start:o,end:n}:null}(e,n);r&&t.push(r),a&&t.push(a)}return t}function Q(){x||m===h.default.TEXT&&!d.isTextEnabled()||ee()}function X(){re()}function Z(){re(),B=NaN}function J(e,t){if(!C)return null;const n=C.getAllBufferRanges();let r,i,a=0,o=0,s=null,l=null,u=0;const c=isNaN(t)?.15:t;if(null!=n){for(i=0,r=n.length;i<r;i++)if(a=n.start(i),o=n.end(i),null===s)u=Math.abs(a-e),(e>=a&&e<o||u<=c)&&(s=a,l=o);else{if(u=a-l,!(u<=c))break;l=o}if(null!==s)return{start:s,end:l}}return null}function ee(){if(a){let e=a.getTime()||0;D&&(e=isNaN(B)?0:B);const t=u.get().streaming.gaps.jumpGaps&&!isNaN(u.get().streaming.gaps.smallGapLimit)?u.get().streaming.gaps.smallGapLimit:NaN;y=Math.max(function(e,t){let n,r;return u.get().streaming.gaps.jumpGaps&&(t=u.get().streaming.gaps.smallGapLimit),n=J(e,t),r=null===n?0:n.end-e,r}(e,t),0),Te(g.default.BUFFER_LEVEL_UPDATED,{mediaType:m,bufferLevel:y}),re()}}function ne(){const e=A>=N-1,t=a.getTimeToStreamEnd(c)-y<1e-5;!e&&!t||_||(he(!0),T.debug(`checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id ${c.id} and type ${m}`))}function re(){if(m!==h.default.AUDIO&&m!==h.default.VIDEO)return;const e=a.getLowLatencyModeEnabled()?u.get().streaming.buffer.lowLatencyStallThreshold:u.get().streaming.buffer.stallThreshold;y<=e&&!_?ie(o.BUFFER_EMPTY):(_||y>e)&&ie(o.BUFFER_LOADED)}function ie(e){M===e||e===o.BUFFER_EMPTY&&0===a.getTime()||m===h.default.TEXT&&!d.isTextEnabled()||(M=e,Te(g.default.BUFFER_LEVEL_STATE_CHANGED,{state:e}),Te(e===o.BUFFER_LOADED?g.default.BUFFER_LOADED:g.default.BUFFER_EMPTY),T.debug(e===o.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function ae(){C&&m!==h.default.TEXT&&(_||se(oe()))}function oe(){const e=[],t=C.getAllBufferRanges();if(!t||0===t.length)return e;const n=a.getTime();let r=Math.max(0,n-u.get().streaming.buffer.bufferToKeep);const o=i.getRequests({state:te.FRAGMENT_MODEL_EXECUTED,time:n,threshold:Br})[0];if(o)r=Math.min(o.startTime,r);else if(0===n&&a.getIsDynamic())return[];if(t.start(0)<=r){const n={start:0,end:r};for(let e=0;e<t.length&&t.end(e)<=r;e++)n.end=t.end(e);n.start<n.end&&e.push(n)}return e}function se(e){return new Promise((t,n)=>{if(!e||!C||0===e.length)return ee(),void t();const r=[];e.forEach(e=>{r.push(function(e){return new Promise((t,n)=>{e.resolve=t,e.reject=n,U.push(e)})}(e))}),O||le(),Promise.all(r).then(()=>{t()}).catch(e=>{n(e)})})}function le(){try{if(0===U.length||!C)return T.debug("Nothing to prune, halt pruning"),U=[],void(O=!1);const e=C.getBuffer();if(!e||!e.buffered||0===e.buffered.length)return T.debug("SourceBuffer is empty (or does not exist), halt pruning"),U=[],void(O=!1);const t=U.shift();T.debug(`${m}: Removing buffer from: ${t.start} to ${t.end}`),O=!0,a.getTime()<t.end&&he(!1),C.remove(t).then(e=>{ue(e)}).catch(e=>{ue(e)})}catch(e){O=!1}}function ue(e){T.debug("onRemoved buffer from:",e.from,"to",e.to),C&&(V(C.getAllBufferRanges()),0===U.length&&(O=!1,ee()),e.unintended&&(T.warn("Detected unintended removal from:",e.from,"to",e.to,"setting streamprocessor time to",e.from),Te(g.default.SEEK_TARGET,{time:e.from})),O?le():(x?x=!1:ee(),Te(g.default.BUFFER_CLEARED,{from:e.from,to:e.to,unintended:e.unintended,hasEnoughSpaceToAppend:Ee(),quotaExceeded:L})))}function ce(e){return new Promise(t=>{e&&void 0!==e.mseTimeOffset&&C&&C.updateTimestampOffset?C.updateTimestampOffset(e.mseTimeOffset).then(()=>{t()}).catch(()=>{t()}):t()})}function de(){return C&&!_?C.updateAppendWindow(c):Promise.resolve()}function fe(){P++,P*(u.get().streaming.wallclockTimeUpdateInterval/1e3)>=u.get().streaming.buffer.bufferPruningInterval&&(P=0,ae())}function ge(){re()}function he(e){_=e,_?Te(g.default.BUFFERING_COMPLETED):N=Number.POSITIVE_INFINITY}function pe(){try{const e=C.getAllBufferRanges();let t,n,r=0;if(!e)return r;for(n=0,t=e.length;n<t;n++)r+=e.end(n)-e.start(n);return r}catch(e){return 0}}function me(e){try{let t=e;const n=C.getAllBufferRanges();
2if(!n||0===n.length)return NaN;let r=0;for(;t===e&&r<n.length;){const e=n.start(r),i=n.end(r);t>=e&&t<=i&&(t=i),r+=1}return t===e?NaN:t}catch(e){return NaN}}function Ee(){const e=pe();return isNaN(e)||e<S}function Te(e,t){let n=t||{};r.trigger(e,n,{streamId:c.id,mediaType:m})}function _e(e,t){if(S=Number.POSITIVE_INFINITY,M=void 0,N=Number.POSITIVE_INFINITY,A=0,w=null,_=!1,O=!1,L=!1,y=0,P=0,U=[],B=NaN,D=!1,C){let n=C;C=null,e||(t?n.removeEventListeners():n.abort().then(()=>{n.reset(t),n=null}))}x=!1}return E={appendInitSegmentFromCache:function(e){const t=F.extract(c.id,e);return!!t&&(T.debug(`Appending init fragment for type ${m}, representationId ${t.representation.id} and bandwidth ${t.representation.bandwidth}`),q(t),!0)},clearBuffers:se,createBufferSink:G,dischargePreBuffer:function(){if(C&&b&&"function"==typeof b.discharge){const e=b.getAllBufferRanges();if(e.length>0){let t="Beginning "+m+"PreBuffer discharge, adding buffer for:";for(let n=0;n<e.length;n++)t+=" start: "+e.start(n)+", end: "+e.end(n)+";";T.debug(t)}else T.debug("PreBuffer discharge requested, but there were no media segments in the PreBuffer.");v=[];let t=b.discharge();for(let e=0;e<t.length;e++){const n=t[e];v.push(n),C.append(n)}b.reset(),b=null}},getAllRangesWithSafetyFactor:$,getBuffer:function(){return C},getBufferControllerType:function(){return kr},getBufferLevel:function(){return y},getContinuousBufferTimeForTargetTime:me,getIsBufferingCompleted:function(){return _},getIsPruningInProgress:function(){return O},getMediaSource:function(){return I},getRangeAt:J,getStreamId:function(){return c.id},getType:function(){return m},hasBufferAtTime:function(e){try{const t=C.getAllBufferRanges();if(!t||0===t.length)return!1;let n=0;for(;n<t.length;){const r=t.start(n),i=t.end(n);if(e>=r&&e<=i)return!0;n+=1}return!1}catch(e){return T.error(e),!1}},initialize:function(e){k(e),r.on(g.default.INIT_FRAGMENT_LOADED,H,E),r.on(g.default.MEDIA_FRAGMENT_LOADED,Y,E),r.on(g.default.WALLCLOCK_TIME_UPDATED,fe,E),r.on(p.default.PLAYBACK_PLAYING,Z,E),r.on(p.default.PLAYBACK_PROGRESS,Q,E),r.on(p.default.PLAYBACK_TIME_UPDATED,Q,E),r.on(p.default.PLAYBACK_RATE_CHANGED,ge,E),r.on(p.default.PLAYBACK_STALLED,X,E)},prepareForAbandonQualitySwitch:function(e,t){return j(e,t)},prepareForDefaultQualitySwitch:function(e,t){return j(e,t)},prepareForFastQualitySwitch:function(e,t){return j(e,t)},prepareForForceReplacementQualitySwitch:function(e,t){return new Promise(n=>{const r=[];r.push(C.abort()),r.push(de()),r.push(z()),r.push(ce(e)),r.push(W(e,t)),Promise.allSettled(r).then(()=>{he(!1),n()})})},prepareForNonReplacementTrackSwitch:function(e,t){return new Promise(n=>{const r=[];r.push(de()),r.push(W(e,t)),Promise.allSettled(r).then(()=>{n()})})},prepareForPlaybackSeek:function(){return _&&he(!1),C.abort()},prepareForReplacementTrackSwitch:function(e,t){return new Promise(n=>{const r=[];r.push(C.abort()),r.push(de()),r.push(W(e,t)),r.push(z()),r.push(ce(e)),Promise.allSettled(r).then(()=>{he(!1),n()})})},pruneAllSafely:z,pruneBuffer:ae,reset:function(e,t){r.off(g.default.INIT_FRAGMENT_LOADED,H,this),r.off(g.default.MEDIA_FRAGMENT_LOADED,Y,this),r.off(g.default.WALLCLOCK_TIME_UPDATED,fe,this),r.off(p.default.PLAYBACK_PLAYING,Z,this),r.off(p.default.PLAYBACK_PROGRESS,Q,this),r.off(p.default.PLAYBACK_TIME_UPDATED,Q,this),r.off(p.default.PLAYBACK_RATE_CHANGED,ge,this),r.off(p.default.PLAYBACK_STALLED,X,this),_e(e,t)},segmentRequestingCompleted:function(e){isNaN(e)||(N=e,ne())},setIsBufferingCompleted:he,setMediaSource:k,setSeekTarget:function(e){B=e},updateAppendWindow:de,updateBufferTimestampOffset:ce},T=(0,l.default)(n).getInstance().getLogger(E),F=Nt(n).getInstance(),_e(),E}Gr.__dashjs_factory_name=kr;var Hr=r.default.getClassFactory(Gr);const Yr="NotFragmentedTextBufferController";function qr(e){e=e||{};const t=this.context,n=(0,f.default)(t).getInstance(),r=e.textController,i=e.errHandler,a=e.streamInfo,o=e.type;let s,l,u,c,d,h;function p(e){c=e}function m(e){l!==e&&(l=e,l&&function(e){n.trigger(e,{},{streamId:a.id,mediaType:o})}(g.default.BUFFERING_COMPLETED))}function E(e){e.chunk.bytes&&!l&&(h.save(e.chunk),d.append(e.chunk),m(!0))}return s={appendInitSegmentFromCache:function(e){return null!==h.extract(a.id,e)},clearBuffers:function(){return Promise.resolve()},createBufferSink:function(e){return new Promise((a,s)=>{try{d=Fr(t).create({mediaSource:c,textController:r,eventBus:n}),d.initializeForFirstUse(e),u||(d.getBuffer()&&"function"==typeof d.getBuffer().initialize&&d.getBuffer().initialize(),u=!0),a(d)}catch(e){i.error(new Ge.default(Ae.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,Ae.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+o)),s(e)}})},dischargePreBuffer:function(){},getAllRangesWithSafetyFactor:function(){return[]},getBuffer:function(){return d},getBufferControllerType:function(){return Yr},getBufferLevel:function(){return 0},getContinuousBufferTimeForTargetTime:function(){return Number.POSITIVE_INFINITY},getIsBufferingCompleted:function(){return l},getIsPruningInProgress:function(){return!1},getMediaSource:function(){return c},getRangeAt:function(){return null},getStreamId:function(){return a.id},getType:function(){return o},hasBufferAtTime:function(){return!0},initialize:function(e){p(e)},prepareForPlaybackSeek:function(){return Promise.resolve()},prepareForReplacementTrackSwitch:function(){return l=!1,Promise.resolve()},pruneAllSafely:function(){return Promise.resolve()},pruneBuffer:function(){},reset:function(e){n.off(g.default.INIT_FRAGMENT_LOADED,E,s),!e&&d&&(d.abort(),d.reset(),d=null)}
2,segmentRequestingCompleted:function(){},setIsBufferingCompleted:m,setMediaSource:p,setSeekTarget:function(){},updateAppendWindow:function(){return Promise.resolve()},updateBufferTimestampOffset:function(){return Promise.resolve()}},u=!1,c=null,l=!1,h=Nt(t).getInstance(),n.on(g.default.INIT_FRAGMENT_LOADED,E,s),s}qr.__dashjs_factory_name=Yr;var Vr=r.default.getClassFactory(qr);function Kr(e){const t=(e=e||{}).abrController,n=e.bufferController,r=this.context,i=e.dashMetrics,a=(0,f.default)(r).getInstance(),s=e.fragmentModel,u=e.mediaPlayerModel,c=e.playbackController,d=e.representationController,m=e.settings,E=e.textController,T=e.type;let _,y,S,I,A,R,N,C,b,D,v,M;function w(){R=(0,l.default)(r).getInstance().getLogger(S),q(),b=e.streamInfo}function P(){N=!0}function O(){N=!1}function L(e){if(n.getIsBufferingCompleted())return;F();const t=isNaN(e)?0:e;C=setTimeout(U,t)}function F(){C&&(clearTimeout(C),C=null)}function U(){const e=u.getScheduleTimeout();try{if(function(){try{return T===h.default.TEXT&&!E.isTextEnabled()||c.isPaused()&&(!c.getStreamController().getInitialPlayback()||!c.getStreamController().getAutoPlay())&&!m.get().streaming.scheduling.scheduleWhilePaused}catch(e){return!1}}())return void F();!function(){try{return!!N&&d.getCurrentRepresentation()&&(null==A||D||function(){const e=d.getCurrentRepresentation();if(!T||!e)return!0;let t=e&&e.segmentDuration&&!isNaN(e.segmentDuration)?e.segmentDuration:0;const n=i.getCurrentBufferLevel(T),r=x();return(r<=t||c.getLowLatencyModeEnabled()||T===h.default.AUDIO&&_)&&(t=0),n+t<r}())}catch(e){return!1}}()?L(e):function(){if(t.handlePendingManualQualitySwitch(b.id,T))return;let e=!1;M&&(e=t.checkPlaybackQuality(T,b.id)),e||function(){const e=d.getCurrentRepresentation();y||e.id!==A||D?function(e){D?(R.debug("Switch track for "+T+", representation id = "+e.id),D=!1):R.debug("Quality has changed, get init request for representationid = "+e.id),a.trigger(g.default.INIT_FRAGMENT_NEEDED,{representationId:e.id,sender:S},{streamId:b.id,mediaType:T}),M=!1,y=!1}(e):(R.debug(`Media segment needed for ${T} and stream id ${b.id}`),a.trigger(g.default.MEDIA_FRAGMENT_NEEDED,{},{streamId:b.id,mediaType:T}),M=!0)}()}()}catch(t){L(e)}}function x(){let e=NaN;const n=d.getCurrentRepresentation();return T&&n?(e=T===h.default.TEXT?function(){try{if(E.isTextEnabled()){const e=d.getCurrentRepresentation();if(isNaN(e.fragmentDuration)){const e=i.getCurrentSchedulingInfo(o.SCHEDULING_INFO);return e?e.duration:0}return e.fragmentDuration}return 0}catch(e){return 0}}():T===h.default.AUDIO&&_?function(){try{const e=i.getCurrentBufferLevel(h.default.VIDEO),t=d.getCurrentRepresentation();return isNaN(t.fragmentDuration)?e+1:Math.max(e+1,t.fragmentDuration)}catch(e){return 0}}():function(){try{const e=m.get().streaming.enhancement.enabled?d.getCurrentCompositeRepresentation():d.getCurrentRepresentation(),n=e.mediaInfo.streamInfo;return t.isPlayingAtTopQuality(e)?n.manifestInfo.duration>=m.get().streaming.buffer.longFormContentDurationThreshold?m.get().streaming.buffer.bufferTimeAtTopQualityLongForm:m.get().streaming.buffer.bufferTimeAtTopQuality:u.getBufferTimeDefaultUnadjusted()}catch(e){return u.getBufferTimeDefaultUnadjusted()}}(),e):e}function B(){k(!0)}function k(e){if(c&&s){const t=s.getRequests({state:te.FRAGMENT_MODEL_EXECUTED,time:c.getTime(),threshold:0})[0];t&&c.getTime()>=t.startTime&&((!I.representation||t.representation.mediaInfo.type===I.representation.mediaInfo.type&&t.representation.mediaInfo.index!==I.representation.mediaInfo.index)&&e&&function(e){R.debug(`Track change rendered for streamId ${b.id} and type ${T}`),a.trigger(g.default.TRACK_CHANGE_RENDERED,{mediaType:T,oldMediaInfo:I&&I.representation&&I.representation.mediaInfo?I.representation.mediaInfo:null,newMediaInfo:e.representation.mediaInfo,streamId:b.id})}(t),I.representation&&t.representation.id===I.representation.id||!e||function(e){R.debug(`Quality change rendered for streamId ${b.id} and type ${T}`),a.trigger(g.default.QUALITY_CHANGE_RENDERED,{mediaType:T,oldRepresentation:I.representation?I.representation:null,newRepresentation:e.representation,streamId:b.id})}(t),I.representation=t.representation)}}function G(){s.abortRequests(),F()}function H(){m.get().streaming.scheduling.scheduleWhilePaused||L()}function Y(e){i.updatePlayListTraceMetrics({playbackspeed:e.playbackRate.toString()})}function q(){M=!0,v=0,A=null,I={representation:null},D=!1,y=!1,N=!0}return S={clearScheduleTimer:F,getBufferTarget:x,getPlaybackController:function(){return c},getStreamId:function(){return b.id},getSwitchTrack:function(){return D},getTimeToLoadDelay:function(){return v},getType:function(){return T},initialize:function(e){_=e,a.on(g.default.URL_RESOLUTION_FAILED,G,S),a.on(p.default.PLAYBACK_STARTED,H,S),a.on(p.default.PLAYBACK_RATE_CHANGED,Y,S),a.on(p.default.PLAYBACK_TIME_UPDATED,B,S),a.on(p.default.MANAGED_MEDIA_SOURCE_START_STREAMING,P,S),a.on(p.default.MANAGED_MEDIA_SOURCE_END_STREAMING,O,S)},reset:function(){a.off(g.default.URL_RESOLUTION_FAILED,G,S),a.off(p.default.PLAYBACK_STARTED,H,S),a.off(p.default.PLAYBACK_RATE_CHANGED,Y,S),a.off(p.default.PLAYBACK_TIME_UPDATED,B,S),a.off(p.default.MANAGED_MEDIA_SOURCE_START_STREAMING,P,S),a.off(p.default.MANAGED_MEDIA_SOURCE_END_STREAMING,O,S),F(),k(!1),q(),b=null},setShouldCheckPlaybackQuality:function(e){M=e},setInitSegmentRequired:function(e){y=e},setLastInitializedRepresentationId:function(e){A=e},setup:w,setSwitchTrack:function(e){D=e},setTimeToLoadDelay:function(e){v=e},startScheduleTimer:L},w(),S}Kr.__dashjs_factory_name="ScheduleController";var jr=r.default.getClassFactory(Kr);const Wr=/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g;var zr=class extends lr{constructor(){super(),this.isPartialSegment=!0,this.replacementSubNumber=NaN,this.totalNumberOfPartialSegments=NaN}};function $r(e){return e?e.totalNumberOfPartialSegments&&!isNaN(e.totalNumberOfPartialSegments)&&e.totalNumberOfPartialSegments>0&&!isNaN(e.subNumberOfPartialSegmentToRequest)?function(e){const t=function(e,t){const n=new zr,r=e.segmentDurationInSeconds/e.totalNumberOfPartialSegments,{representation:i,timelineConverter:a,isDynamic:o,index:s,totalNumberOfPartialSegments:l}=e,u=Qr({representation:i,segmentDurationInSeconds:r,presentationStartTime:e.presentationStartTime+t*r,presentationEndTime:e.presentationStartTime+(t+1)*r,timelineConverter:a,isDynamic:o,mediaTimeInSeconds:e.mediaTimeInSeconds+t*r,index:s});return n.assignAttributes(u),n.replacementSubNumber=t,n.totalNumberOfPartialSegments=l,n}(e,e.subNumberOfPartialSegmentToRequest);return Xr(t,e),t}(e):function(e){const t=new ur,n=Qr(e);return t.assignAttributes(n),Xr(t,e),t}(e):null}function Qr(e){const{representation:t,segmentDurationInSeconds:n,presentationStartTime:r,presentationEndTime:i,mediaTimeInSeconds:a,timelineConverter:o,isDynamic:s,index:l}=e,u={availabilityEndTime:o.calcAvailabilityEndTimeFromPresentationTime(i+n,t,s),availabilityStartTime:o.calcAvailabilityStartTimeFromPresentationTime(i,t,s),duration:n,index:l,mediaStartTime:a,presentationStartTime:r,replacementNumber:t.startNumber+l,representation:t};return u.wallStartTime=o.calcWallTimeForSegment(u,s),u}function Xr(e,t){const{tManifest:n,mediaTime:r,mediaUrl:i,mediaRange:a}=t;e.replacementTime=n||r,e.media=Jr(i,e.representation.id,e.replacementNumber,e.replacementSubNumber,e.representation.bandwidth,e.replacementTime),e.mediaRange=a,e.mediaUrl=i}function Zr(e,t,n,r){const i=t.adaptation.period;if(isFinite(i.duration)&&i.start+i.duration<=n.presentationStartTime)return!1;if(r){if("INF"===t.availabilityTimeOffset)return!0;const r=e.getClientReferenceTime();return n.availabilityStartTime.getTime()<=r&&(!isFinite(n.availabilityEndTime)||n.availabilityEndTime.getTime()>=r)}return!0}function Jr(e,t,n,r,i,a){return e?function(e,t,n,r,i,a){return e.replace(Wr,(e,o,s,l)=>{let u,c;switch(o){case void 0:return"$";case"RepresentationID":u=t;break;case"Number":u=n;break;case"SubNumber":u=r;break;case"Bandwidth":u=i;break;case"Time":if("string"==typeof a)return a;u=a?Math.round(a):a;break;default:u=null}if(null==u)return e;switch(l){case void 0:case"d":case"i":case"u":c=u.toString();break;case"o":c=u.toString(8);break;case"x":c=u.toString(16);break;case"X":c=u.toString(16).toUpperCase();break;default:c=u.toString()}const d=parseInt(s,10)||1;return c.padStart(d,"0")})}(e,t,n,r,i,a):e}function ei(e){const{index:t,isDynamic:n,mediaRange:r,mediaTime:i,mediaUrl:a,representation:o,subNumberOfPartialSegmentToRequest:s,timelineConverter:l,totalNumberOfPartialSegments:u}=e;let c,d,f;c=o.segmentDuration,isNaN(c)&&(c=o.adaptation.period.duration),d=parseFloat((o.adaptation.period.start+t*c).toFixed(5)),f=parseFloat((d+c).toFixed(5));const g=$r({index:t,isDynamic:n,mediaRange:r,mediaTime:i,mediaTimeInSeconds:l.calcMediaTimeFromPresentationTime(d,o),mediaUrl:a,presentationEndTime:f,presentationStartTime:d,representation:o,segmentDurationInSeconds:c,subNumberOfPartialSegmentToRequest:s,timelineConverter:l,totalNumberOfPartialSegments:u});return Zr(l,o,g,n)?g:null}function ti(e){const{durationInTimescale:t,fTimescale:n,index:r,subNumberOfPartialSegmentToRequest:i,isDynamic:a,mediaRange:o,mediaTime:s,mediaUrl:l,totalNumberOfPartialSegments:u,representation:c,tManifest:d,timelineConverter:f}=e,g=s/n,h=t/n;let p=f.calcPresentationTimeFromMediaTime(g,c),m=$r({representation:c,segmentDurationInSeconds:h,presentationStartTime:p,presentationEndTime:p+h,mediaTimeInSeconds:g,timelineConverter:f,isDynamic:a,index:r,totalNumberOfPartialSegments:u,subNumberOfPartialSegmentToRequest:i,mediaUrl:l,mediaRange:o,tManifest:d,mediaTime:s});return Zr(f,c,m,a)?m:null}function ni(e){return e.k}function ri(e){const t=(e=e||{}).eventBus,n=e.events,r=e.abrController,i=e.dashMetrics,a=e.playbackController,o=e.timelineConverter,s=e.type,l=e.streamInfo,u=e.segmentsController,c=e.isDynamic;let d,f,g;function m(){return s}function E(){return g?.mediaInfo.type===s?g:function(){let e=g?.dependentRepresentation;if(e){if(!e.mediaInfo)throw new Error("dependentRepresentation has no mediaInfo!");if(e.mediaInfo.type===s)return e}return null}()}function T(){g=null,f=[]}function _(e){return new Promise((t,n)=>{const r=e.hasInitialization(),a=e.hasSegments(),s=[];
2s.push(u.updateInitData(e,r)),s.push(u.updateSegmentData(e,a)),Promise.all(s).then(n=>{var r;n[0]&&!n[0].error&&(e=function(e,t){return t&&!t.error&&t.representation?t.representation:e}(e,n[0])),n[1]&&!n[1].error&&(e=function(e,t){if(!t||t.error)return;const n=t.segments,r=[];let i,a,s,l,u=0;for(i=0,a=n?n.length:0;i<a;i++)s=n[i],l=ti({durationInTimescale:s.duration,fTimescale:s.timescale,index:u,isDynamic:c,mediaRange:s.mediaRange,mediaTime:s.startTime,mediaUrl:s.media,representation:e,timelineConverter:o}),l&&(r.push(l),l=null,u++);return r.length>0&&(e.segments=r),e}(e,n[1])),e.fragmentDuration=e.segmentDuration?e.segmentDuration:e.segments&&e.segments.length>0?e.segments[0].duration:NaN,(r=e).mediaFinishedInformation=u.getMediaFinishedInformation(r),function(e){let t,n=i.getCurrentManifestUpdate(),r=!1;if(n){for(let i=0;i<n.representationInfo.length;i++)if(t=n.representationInfo[i],t.index===e.index&&t.mediaType===m()){r=!0;break}r||i.addManifestUpdateRepresentationInfo(e,m())}}(e),t()}).catch(e=>{n(e)})})}function y(e){if(!f||0===f.length)return null;const t=f.filter(t=>t.id===e);return t.length>0?t[0]:null}function S(e){t.trigger(n.DATA_UPDATE_COMPLETED,{currentRepresentation:g,error:e},{streamId:l.id,mediaType:s})}function I(e){g&&g.id===e.id||function(e){!function(){if(!(r&&i&&a&&o))throw new Error(h.default.MISSING_CONFIG_ERROR)}();const n=new Date,u=1e3*a.getTime();e&&i.addRepresentationSwitch(e.adaptation.type,n,u,e.id),t.trigger(p.default.REPRESENTATION_SWITCH,{mediaType:s,streamId:l.id,currentRepresentation:e},{streamId:l.id,mediaType:s})}(e),g=e}function A(e){if(e.newDuration){const t=E();t&&t.adaptation.period&&(t.adaptation.period.duration=e.newDuration)}}return d={getCurrentCompositeRepresentation:function(){return g},getCurrentRepresentation:E,getRepresentationById:y,getStreamId:function(){return l.id},getType:m,prepareQualityChange:function(e){const t=f.filter(t=>t.id===e.id);t.length>0&&I(t[0])},reset:function(){t.off(p.default.MANIFEST_VALIDITY_CHANGED,A,d),T()},updateData:function(e,t,n){return new Promise((o,u)=>{if(f=e,I(y(n)),s!==h.default.VIDEO&&s!==h.default.ENHANCEMENT&&s!==h.default.AUDIO&&(s!==h.default.TEXT||!t))return S(),void o();const c=[];for(let e=0,t=f.length;e<t;e++){const t=f[e];c.push(_(t))}Promise.all(c).then(()=>{!function(){r.setPlaybackQuality(s,l,g);const e=i.getCurrentDVRInfo(s);e&&i.updateManifestUpdateInfo({latency:e.range.end-a.getTime()}),S()}(),o()}).catch(e=>{u(e)})})}},T(),t.on(p.default.MANIFEST_VALIDITY_CHANGED,A,d),d}ri.__dashjs_factory_name="RepresentationController";var ii=r.default.getClassFactory(ri);function ai(e){const t=(e=e||{}).eventBus,n=e.debug,r=e.urlUtils,i=e.type,a=e.streamInfo,o=e.segmentsController,s=e.timelineConverter,l=e.baseURLController;let u,c,d,f,g;function h(){return i}function m(){d=null}function E(e,t,n){const i=l.resolve(n.path);let a,o,s={};return i&&t!==i.url&&r.isRelative(t)?(a=i.url,o=i.serviceLocation,s=i.queryParams,t&&(a=r.resolve(t,a))):a=t,!r.isRelative(a)&&(e.url=a,e.serviceLocation=o,e.queryParams=s,!0)}function T(e,t,n){let r=null;if(!t||!t.segmentInfoType)return r;const i=o.getSegmentByTime(t,n);return i&&(d=i,c.debug("Index for time "+n+" is "+i.index),r=_(0,i)),r}function _(e,t){if(null==t)return null;const n=new $.default,r=t.representation,i=r.bandwidth,a=Jr(t.media,r.id,t.replacementNumber,t.replacementSubNumber,i,t.replacementTime);return n.adaptationIndex=r.adaptation.index,n.availabilityEndTime=t.availabilityEndTime,n.availabilityStartTime=t.availabilityStartTime,n.availabilityTimeComplete=r.availabilityTimeComplete,n.bandwidth=r.bandwidth,n.duration=t.duration,n.index=t.index,n.isPartialSegmentRequest=t.isPartialSegment,n.mediaStartTime=t.mediaStartTime,n.mediaType=h(),n.presentationStartTime=t.presentationStartTime,n.range=t.mediaRange,n.representation=r,n.startTime=t.presentationStartTime,n.timescale=r.timescale,n.type=R.HTTPRequest.MEDIA_SEGMENT_TYPE,n.wallStartTime=t.wallStartTime,E(n,a,r)?n:void 0}function y(e){if(!e)return{indexToRequest:0,subNumberOfPartialSegmentToRequest:NaN};const t=e.isPartialSegment,n=!isNaN(e.replacementSubNumber),r=!isNaN(e.totalNumberOfPartialSegments);if(t&&n&&r){const t=e.replacementSubNumber+1;return t<e.totalNumberOfPartialSegments?{indexToRequest:e.index,subNumberOfPartialSegmentToRequest:t}:{indexToRequest:e.index+1,subNumberOfPartialSegmentToRequest:0}}return{indexToRequest:e.index+1,subNumberOfPartialSegmentToRequest:NaN}}function S(e,t,n,r){let i=null;const a=o.getSegmentByIndex(t,n,r,d);if(a)i=_(0,a),d=a;else{if(f&&!g)return c.debug(h()+" No segment found at index: "+n+". Wait for next loop"),null;g=!0}return i}function I(){c.debug("Dynamic stream complete"),g=!0}return u={getCurrentIndex:function(){return d?d.index:-1},getInitRequest:function(e,t){return t?function(e,t,n){const r=new $.default,i=t.adaptation.period,a=i.start;if(r.mediaType=n,r.type=R.HTTPRequest.INIT_SEGMENT_TYPE,r.range=t.range,r.availabilityStartTime=s.calcAvailabilityStartTimeFromPresentationTime(a,t,f),r.availabilityEndTime=s.calcAvailabilityEndTimeFromPresentationTime(a+i.duration,t,f),r.representation=t,E(r,t.initialization,t))return r.url=Jr(r.url,t.id,void 0,void 0,t.bandwidth),r}(0,t,h()):null},getLastSegment:function(){return d},getNextSegmentRequest:function(e,t){if(!t||!t.segmentInfoType)return null;if(function(e){return e&&d&&e.endNumber&&d.replacementNumber&&d.replacementNumber>=e.endNumber}(t))return g=!0,null;let{indexToRequest:n,subNumberOfPartialSegmentToRequest:r}=y(d);return S(0,t,n,r)},getNextSegmentRequestIdempotent:function(e,t){let n=null,{indexToRequest:r,subNumberOfPartialSegmentToRequest:i}=y(d);const a=o.getSegmentByIndex(t,r,i,d);return a?(n=_(0,a),n):null},getSegmentRequestForTime:T,getStreamId:function(){return a.id},getStreamInfo:function(){return a},getType:h,getValidTimeAheadOfTargetTime:function(e,t,n,r){try{if(isNaN(e)||!t||!n)return NaN;if(e<0&&(e=0),isNaN(r)&&(r=.5),T(0,n,e))return e;if(n.adaptation.period.start+n.adaptation.period.duration<e)return NaN;const i=isFinite(n.adaptation.period.duration)?n.adaptation.period.start+n.adaptation.period.duration:e+30;let a=Math.min(e+r,i),o=NaN,s=null;for(;a<=i;){let e=null;if(a<=i&&(e=T(0,n,a)),e){o=a,s=e;break}a+=r}if(s){const t=s.startTime+s.duration;return e>s.startTime&&t-e>r?e:!isNaN(s.startTime)&&e<s.startTime&&o>s.startTime?s.startTime+.001:Math.min(t-r,o)}return o}catch(e){return NaN}},initialize:function(e){f=e,g=!1,o.initialize(e)},isLastSegmentRequested:function(e,t){if(!e||!d)return!1;if(g)return!0;
2if(!isFinite(e.adaptation.period.duration))return!1;if(d.presentationStartTime+d.duration>t)return!1;if(e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.numberOfSegments)&&!isNaN(d.index)&&d.index>=e.mediaFinishedInformation.numberOfSegments-1){if(!f||e.segmentInfoType===be.default.SEGMENT_TEMPLATE)return!0;if(f&&e.segmentInfoType===be.default.SEGMENT_LIST&&e.adaptation.period.nextPeriodId)return!0}return!!(f&&e.adaptation.period.nextPeriodId&&e.segmentInfoType===be.default.SEGMENT_TIMELINE&&e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment)&&d&&!isNaN(d.mediaStartTime)&&!isNaN(d.duration)&&d.mediaStartTime+d.duration>=e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment-.05)},repeatSegmentRequest:function(e,t){return t&&t.segmentInfoType?S(0,t,d?d.index:0,d&&d.isPartialSegment&&!isNaN(d.replacementSubNumber)?d.replacementSubNumber:NaN):null},reset:function(){m(),t.off(p.default.DYNAMIC_TO_STATIC,I,u)}},c=n.getLogger(u),m(),t.on(p.default.DYNAMIC_TO_STATIC,I,u),u}ai.__dashjs_factory_name="DashHandler";var oi=r.default.getClassFactory(ai);function si(e,t){const n=(e=e||{}).timelineConverter,r=e.dashMetrics;let i;function a(e,r){if(function(){if(!n)throw new Error(h.default.MISSING_CONFIG_ERROR)}(),!e)return null;void 0===r&&(r=null);let i=null;const a=n.calcMediaTimeFromPresentationTime(r,e);return function(e,t){const n=function(e){return e.adaptation.period.mpd.manifest.Period[e.adaptation.period.index].AdaptationSet[e.adaptation.index].Representation[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period[e.adaptation.period.index].AdaptationSet[e.adaptation.index].Representation[e.index].SegmentList}(e),r=n.SegmentTimeline,i=n.SegmentURL;let a,s,l,u,c,d,f=0,g=-1;d=e.timescale,a=r.S;let h=!1;const p=a.length;for(l=0;l<p&&!h;l++)for(s=a[l],c=0,s.hasOwnProperty("r")&&(c=s.r),s.hasOwnProperty("t")&&(f=s.t),c<0&&(c=o(e,a[l+1],s,d,f/d)),u=0;u<=c&&!h;u++)g++,h=t({mediaTime:f,segmentBase:n,segmentURL:i,currentSElement:s,sElementCounterIncludingRepeats:g,sElementCounter:l}),h&&(e.segmentDuration=s.d/d),f+=s.d}(e,function(r){const o=e.timescale;return function(r,a){const{mediaTime:o,segmentBase:s,segmentURL:l,currentSElement:u,sElementCounterIncludingRepeats:c,sElementCounter:d}=a,f=u.d,g=e.timescale;return r<o+f&&r>=o&&(function(r){const{segmentBase:a,segmentURL:o,sElementCounter:s,currentSElement:l,mediaTime:u,durationInTimescale:c,fTimescale:d,requiredMediaTimeInTimescaleUnits:f,sElementCounterIncludingRepeats:g}=r;let h=function(e,t,n){let r=e.media;return t&&(r=t[n].media||""),r}(a,o,s),p=function(e,t,n){let r=e.mediaRange;return t&&(r=t[n].mediaRange),r}(l,o,s);const m=ni(l),E=function(e){if(!e||void 0===e.totalNumberOfPartialSegments||isNaN(e.totalNumberOfPartialSegments)||e.totalNumberOfPartialSegments<1)return;const{durationInTimescale:t,requiredMediaTimeInTimescaleUnits:n,mediaTime:r,totalNumberOfPartialSegments:i}=e,a=t/i;for(let e=0;e<i;e++){const t=r+e*a;if(n>=t&&n<t+a)return e}return NaN}({durationInTimescale:c,requiredMediaTimeInTimescaleUnits:f,mediaTime:u,totalNumberOfPartialSegments:m});i=ti({timelineConverter:n,isDynamic:t,representation:e,mediaTime:u,durationInTimescale:c,fTimescale:d,mediaUrl:h,mediaRange:p,index:g,tManifest:l.tManifest,totalNumberOfPartialSegments:m,subNumberOfPartialSegmentToRequest:E})}({segmentBase:s,segmentURL:l,sElementCounter:d,currentSElement:u,mediaTime:o,durationInTimescale:f,fTimescale:g,requiredMediaTimeInTimescaleUnits:r,sElementCounterIncludingRepeats:c}),!0)}(parseFloat((a*o).toPrecision(15)),r)}),i}function o(e,t,i,a,o){let s;if(t&&t.hasOwnProperty("t"))s=t.t/a;else try{let t=0;if(isNaN(e.adaptation.period.start)||isNaN(e.adaptation.period.duration)||!isFinite(e.adaptation.period.duration)){const e=r.getCurrentDVRInfo();t=isNaN(e.end)?0:e.end}else t=e.adaptation.period.start+e.adaptation.period.duration;s=n.calcMediaTimeFromPresentationTime(t,e),e.segmentDuration=i.d/a}catch(e){s=0}return Math.max(Math.ceil((s-o)/(i.d/a))-1,0)}return i={getMediaFinishedInformation:function(e){if(!e)return 0;const t=(e.adaptation.period.mpd.manifest.Period[e.adaptation.period.index].AdaptationSet[e.adaptation.index].Representation[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period[e.adaptation.period.index].AdaptationSet[e.adaptation.index].Representation[e.index].SegmentList).SegmentTimeline;let n,r,i,a,s,l,u=0,c=0,d=0;l=e.timescale,n=t.S;const f=n.length;for(i=0;i<f;i++)for(r=n[i],s=0,r.hasOwnProperty("r")&&(s=r.r),r.hasOwnProperty("t")&&(u=r.t,c=u/l),s<0&&(s=o(e,n[i+1],r,l,c)),a=0;a<=s;a++)d++,u+=r.d,c=u/l;return{numberOfSegments:d,mediaTimeOfLastSignaledSegment:c}},getSegmentByIndex:function(e,t){return e?a(e,t&&!isNaN(t.presentationStartTime)?t.presentationStartTime+t.duration+.01:0):null},getSegmentByTime:a},i}si.__dashjs_factory_name="TimelineSegmentsGetter";var li=r.default.getClassFactory(si);function ui(e,t){const n=(e=e||{}).timelineConverter;let r;
2function i(e,r,i){if(!e)return null;const o=a(e),s=ni(o);void 0!==s&&s>=0&&(i=void 0!==i&&i<s?i:0);const l=ei({index:r=Math.max(r,0),isDynamic:t,mediaTime:Math.round(r*e.segmentDuration*e.timescale,10),mediaUrl:o.media,representation:e,subNumberOfPartialSegmentToRequest:i,timelineConverter:n,totalNumberOfPartialSegments:s});return l&&e.endNumber&&l.replacementNumber>e.endNumber?null:l}function a(e){return e.adaptation.period.mpd.manifest.Period[e.adaptation.period.index].AdaptationSet[e.adaptation.index].Representation[e.index].SegmentTemplate}return r={getMediaFinishedInformation:function(e){const t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;const n=e.segmentDuration;return isNaN(n)?t.numberOfSegments=1:t.numberOfSegments=Math.ceil(e.adaptation.period.duration/n),t},getSegmentByIndex:i,getSegmentByTime:function(e,t){if(!e)return null;const r=e.segmentDuration;if(isNaN(r))return null;let o=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);const s=a(e),l=Math.floor(o/r),u=function(e){if(!e||void 0===e.totalNumberOfPartialSegments||isNaN(e.totalNumberOfPartialSegments)||e.totalNumberOfPartialSegments<1)return;const{totalNumberOfPartialSegments:t,representation:n,requestedTimeRelativeToPeriodStart:r,indexWithoutStartNumber:i}=e,a=i*n.segmentDuration,o=n.segmentDuration/t,s=r-a;let l=Math.floor(s/o);return l=Math.max(0,Math.min(l,t-1)),l}({totalNumberOfPartialSegments:ni(s),representation:e,requestedTimeRelativeToPeriodStart:o,indexWithoutStartNumber:l});return i(e,l,u)}},r}ui.__dashjs_factory_name="TemplateSegmentsGetter";var ci=r.default.getClassFactory(ui);function di(e,t){const n=(e=e||{}).timelineConverter;let r;function i(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(h.default.MISSING_CONFIG_ERROR)}function a(e,r){if(i(),!e)return null;const a=e.adaptation.period.mpd.manifest.Period[e.adaptation.period.index].AdaptationSet[e.adaptation.index].Representation[e.index].SegmentList,o=a.SegmentURL.length,s=e&&!isNaN(e.startNumber)?e.startNumber:1,l=Math.max(s-1,0),u=Math.max(r-l,0);let c=null;if(u<o){const i=a.SegmentURL[u];c=ei({index:r,isDynamic:t,mediaRange:i.mediaRange,mediaTime:(s+r-1)*e.segmentDuration,representation:e,timelineConverter:n}),c&&(c.media=i.media?i.media:"",c.indexRange=i.indexRange)}return c}return r={getSegmentByIndex:a,getSegmentByTime:function(e,t){if(i(),!e)return null;const r=e.segmentDuration;if(isNaN(r))return null;const o=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return a(e,Math.floor(o/r))},getMediaFinishedInformation:function(e){const t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;const n=e.adaptation.period.mpd.manifest.Period[e.adaptation.period.index].AdaptationSet[e.adaptation.index].Representation[e.index].SegmentList,r=e&&!isNaN(e.startNumber)?e.startNumber:1,i=Math.max(r-1,0);return t.numberOfSegments=i+n.SegmentURL.length,t}},r}di.__dashjs_factory_name="ListSegmentsGetter";var fi=r.default.getClassFactory(di);function gi(e){const t=(e=e||{}).timelineConverter;let n;function r(){if(!t||!t.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(h.default.MISSING_CONFIG_ERROR)}function i(e,t){if(r(),!e)return null;const n=e.segments?e.segments.length:-1;let i;if(t<n&&(i=e.segments[t],i&&i.index===t))return i;for(let r=0;r<n;r++)if(i=e.segments[r],i&&i.index===t)return i;return null}return n={getSegmentByIndex:i,getSegmentByTime:function(e,t){r();const n=function(e,t){if(!e)return-1;const n=e.segments,r=n?n.length:null;let i,a,o,s,l,u=-1;if(n&&r>0)for(l=0;l<r;l++)if(a=n[l],o=a.presentationStartTime,s=a.duration,i=s/2,t+i>=o&&t-i<o+s){u=a.index;break}return u}(e,t);return i(e,n)},getMediaFinishedInformation:function(e){const t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};return e&&e.segments?(t.numberOfSegments=e.segments.length,t):t}},n}gi.__dashjs_factory_name="SegmentBaseGetter";var hi=r.default.getClassFactory(gi);function pi(e){e=e||{};const t=this.context,n=e.dashConstants,r=e.type,i=e.segmentBaseController;let a,o;function s(e){return e?e.segments?o[n.SEGMENT_BASE]:o[e.segmentInfoType]:null}return a={initialize:function(r){o[n.SEGMENT_TIMELINE]=li(t).create(e,r),o[n.SEGMENT_TEMPLATE]=ci(t).create(e,r),o[n.SEGMENT_LIST]=fi(t).create(e,r),o[n.SEGMENT_BASE]=hi(t).create(e,r)},updateInitData:function(e,t){return t?Promise.resolve():i.getSegmentBaseInitSegment({representation:e,mediaType:r})},updateSegmentData:function(e,t){return t?Promise.resolve():i.getSegmentList({mimeType:e.mimeType,representation:e,mediaType:r})},getSegmentByIndex:function(e,t,r,i){const a=s(e);return a?e.segmentInfoType?e.segmentInfoType===n.SEGMENT_TIMELINE?a.get
2SegmentByIndex(e,i):e.segmentInfoType===n.SEGMENT_TEMPLATE?a.getSegmentByIndex(e,t,r):a.getSegmentByIndex(e,t):a.getSegmentByIndex(e,t):null},getSegmentByTime:function(e,t){const n=s(e);return n?n.getSegmentByTime(e,t):null},getMediaFinishedInformation:function(e){const t=s(e);return t?t.getMediaFinishedInformation(e):{numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN}}},o={},a}pi.__dashjs_factory_name="SegmentsController";var mi=r.default.getClassFactory(pi);function Ei(){let e;return e={ntpToUTC:function(e){const t=new Date(Date.UTC(1900,0,1,0,0,0));return new Date(t.getTime()+e).getTime()}},e}Ei.__dashjs_factory_name="TimeUtils";var Ti=r.default.getSingletonFactory(Ei);function _i(e){e=e||{};let t,n,r,i,a,s,u,c,d,m,E,T,_,y,S,I,A,N,C=this.context,b=(0,f.default)(C).getInstance(),D=e.abrController,v=e.adapter,M=e.boxParser,w=e.capabilities,P=e.dashMetrics,O=e.errHandler,L=e.fragmentModel,F=e.manifestModel,U=e.mediaController,x=e.mediaPlayerModel,B=e.mimeType,k=e.playbackController,G=e.segmentBlacklistController,H=e.settings,Y=e.streamInfo,q=e.textController,V=e.timelineConverter,K=e.type;function j(){return Y.id}function W(){return K}function z(){m=[],i=null,n=0,A=!1,I=!1,T=!1,s=null,N=!1,ae()}function $(e){return!isNaN(e)&&!isNaN(Y.duration)&&isFinite(Y.duration)&&e>=Y.start+Y.duration}function Q(e,n=!0){if(e.sender)if(k.getIsManifestUpdateInProgress())J();else if((!i.isText||q.isTextEnabled())&&t&&e.representationId&&!t.appendInitSegmentFromCache(e.representationId)){const e=_.getCurrentRepresentation();if(0===e.range)return void X();const t=a?a.getInitRequest(i,e):null;t?L.executeRequest(t):n&&(y.setInitSegmentRequired(!0),J())}}function X(e,r=!0){if(k.getIsManifestUpdateInProgress()||t.getIsPruningInProgress())return void J();let o=function(){let e;if(isNaN(n)||W()===h.default.TEXT&&!q.isTextEnabled())return null;if(a){const t=Ie();e=A?a.getSegmentRequestForTime(i,t,n):I?a.repeatSegmentRequest(i,t):a.getNextSegmentRequest(i,t)}return e}();o?(A=!1,I=!1,function(e){isNaN(e.startTime+e.duration)||(n=e.startTime+e.duration),e.delayLoadingTime=(new Date).getTime()+y.getTimeToLoadDelay(),y.setTimeToLoadDelay(0),function(e){let t=e.url;return e.range&&(t=t.concat("_",e.range)),G.contains(t)}(e)?(d.warn(`Fragment request url ${e.url} for stream id ${Y.id} and media type ${K} is on the ignore list and will be skipped`),J()):(d.debug(`Next fragment request url for stream id ${Y.id} and media type ${K} is ${e.url} with request range ${e.range}`),L.executeRequest(e))}(o)):function(e){const t=_.getCurrentRepresentation();try{if(H.get().streaming.gaps.enableSeekFix&&(A||0===k.getTime())){let r;if(c?c&&t.segmentInfoType===be.default.SEGMENT_TIMELINE&&(r=function(e){return a.getValidTimeAheadOfTargetTime(n,i,e,H.get().streaming.gaps.threshold)}(t)):r=function(e){let t=a.getValidTimeAheadOfTargetTime(n,i,e,H.get().streaming.gaps.threshold);return isNaN(t)&&n>=e.adaptation.period.mpd.mediaPresentationDuration-e.segmentDuration&&(t=n-.1),t}(t),!isNaN(r)&&r!==n)return void function(e,t){k.isSeeking()||0===k.getTime()?(d.warn(`Adjusting playback time ${e} because of gap in the manifest. Seeking by ${e-n}`),k.seek(e,!1,!1)):(d.warn(`Adjusting buffering time ${e} because of gap in the manifest. Adjusting time by ${e-n}`),Pe(e),t&&J())}(r,e)}}catch(e){d.error(e)}Z()||e&&J()}(r)}function Z(){const e=_.getCurrentRepresentation(),r=a.isLastSegmentRequested(e,n);if(r){const e=a.getCurrentIndex();d.debug(`Segment requesting for stream ${Y.id} has finished`),b.trigger(g.default.STREAM_REQUESTING_COMPLETED,{segmentIndex:e},{streamId:Y.id,mediaType:K}),t.segmentRequestingCompleted(e),Se()}return r}function J(){const e=x.getScheduleTimeout();y.startScheduleTimer(e)}function ee(e){P.addBufferState(K,e.state,y.getBufferTarget()),e.state!==o.BUFFER_EMPTY||k.isSeeking()||(d.info("Buffer is empty! Stalling!"),P.pushPlayListTraceMetrics(new Date,cn.REBUFFERING_REASON))}function ne(e){L.syncExecutedRequestsWithBufferedRange(t.getBuffer().getAllBufferRanges(),Y.duration),e.quotaExceeded&&e.from>k.getTime()&&Pe(e.from),e.hasEnoughSpaceToAppend&&e.quotaExceeded&&y.startScheduleTimer()}function re(e){if(!e||!e.lastRequestAppended||!e.lastRequestAppended.url)return;let t=e.lastRequestAppended.url;e.lastRequestAppended.range&&(t=t.concat("_",e.lastRequestAppended.range)),d.warn(`Blacklisting segment with url ${t}`),G.add(t)}function ie(e){if(d.debug(`Appended bytes for ${e.mediaType} and stream id ${e.streamId}`),e.segmentType===R.HTTPRequest.INIT_SEGMENT_TYPE){const t=e.representationId;y.setLastInitializedRepresentationId(t),d.info("["+K+"] lastInitializedRepresentationId changed to "+t)}E&&E.enabled?fe(E.newRepresentation,E.oldRepresentation):N||y.startScheduleTimer(0)}function ae(){E={newRepresentation:null,oldRepresentation:null,enabled:!1}}function oe(e){return new Promise(n=>{if(!_)return Promise.resolve();let r=null;var a;r=e.newRepresentation?{selectedRepresentation:(a=e).newRepresentation,currentMediaInfo:a.newMediaInfo}:null!==i&&v.areMediaInfosEqual(i,e.newMediaInfo)?function(e){return{currentMediaInfo:e.newMediaInfo,selectedRepresentation:_.getCurrentRepresentation()}}(e):function(e){let t=NaN;return t=!H.get().streaming.abr.autoSwitchBitrate[e.newMediaInfo.type]&&e.previouslySelectedRepresentation?e.previouslySelectedRepresentation.bitrateInKbit:D.getInitialBitrateFor(K),{selectedRepresentation:D.getOptimalRepresentationForBitrate(e.newMediaInfo,t,!1),currentMediaInfo:e.newMediaInfo}}(e),se(r.currentMediaInfo),b.trigger(),function(e){s&&e.selectedRepresentation.dependentRepresentation&&(d.info("["+K+"] selectMediaInfo : call selectMediaInfo on enhancementStreamProcessor for index = "+e.selectedRepresentation.absoluteIndex),s.selectMediaInfo(new Or({newMediaInfo:e.selectedRepresentation.mediaInfo,newRepresentation:e.selectedRepresentation})))}(r);
2const o=D.getPossibleVoRepresentations(i,!1);return _.updateData(o,i.isFragmented,r.selectedRepresentation.id).then(()=>{!function(){if(!t||!_)return;const e=_.getCurrentCompositeRepresentation();t.getIsBufferingCompleted()||t.updateBufferTimestampOffset(e)}(),n()}).catch(e=>{d.error(e),n()})})}function se(e){v.areMediaInfosEqual(i,e)||b.trigger(p.default.NEW_TRACK_SELECTED,{value:e}),i=e,D.handleNewMediaInfo(i),b.trigger(g.default.MEDIAINFO_UPDATED,{mediaType:K,streamId:Y.id,currentMediaInfo:i})}function le(e){const n=e.newRepresentation,r=e.oldRepresentation,a=Oe();n&&r||d.warn("_handleDifferentSwitchTypes() is missing the target representations"),e.reason&&e.reason.forceReplace?function(e,n){L.abortRequests(),b.trigger(g.default.BUFFER_REPLACEMENT_STARTED,{mediaType:K,streamId:Y.id},{mediaType:K,streamId:Y.id}),y.setShouldCheckPlaybackQuality(!1),t.prepareForForceReplacementQualitySwitch(e,n).then(()=>{ue()}).catch(()=>{ue()})}(n,r):e&&e.reason&&e.reason.forceAbandon?function(e,n){t.prepareForAbandonQualitySwitch(e,n).then(()=>{ce()}).catch(()=>{ce()})}(n,r):!x.getFastSwitchEnabled()||a&&a.isPartialSegment?fe(n,r):function(e,n){const r=k.getTime();let a=1.5*(isNaN(e.fragmentDuration)?1:e.fragmentDuration);const s=L.getRequests({state:te.FRAGMENT_MODEL_EXECUTED,time:r+a,threshold:0})[0];if(s&&!i.isText){const i=t.getBufferLevel(),l=D.getAbandonmentStateFor(Y.id,K),u=K===h.default.VIDEO&&e.dependentRepresentation?e.dependentRepresentation.bandwidth:e.bandwidth;s.bandwidth<u&&i>=a&&l===o.ALLOW_LOAD?t.prepareForFastQualitySwitch(e,n).then(()=>{de(r,a)}).catch(()=>{de(r,a)}):fe(e,n)}else fe(e,n)}(n,r),P.pushPlayListTraceMetrics(new Date,cn.REPRESENTATION_SWITCH_STOP_REASON),P.createPlaylistTraceMetrics(n.id,1e3*k.getTime(),k.getPlaybackRate())}function ue(){ve(),ae(),T=!1}function ce(){L.abortRequests(),I=!0,y.setShouldCheckPlaybackQuality(!1),y.startScheduleTimer(),T=!1}function de(e,t){L.abortRequests(),Pe(e+t),y.setShouldCheckPlaybackQuality(!1),y.startScheduleTimer(),T=!1}function fe(e,n){const r=L.getRequests({state:te.FRAGMENT_MODEL_LOADING});if(r&&r.length>0)return d.debug("Preparing for default quality switch: Waiting for ongoing segment request to be finished before applying switch."),E.newRepresentation=e,E.oldRepresentation=n,void(E.enabled=!0);t.prepareForDefaultQualitySwitch(e,n).then(()=>{ge()}).catch(()=>{ge()})}function ge(){y.setShouldCheckPlaybackQuality(!1),i.segmentAlignment||i.subSegmentAlignment?y.startScheduleTimer():Me(),ae(),T=!1}function he(e){d.info("onFragmentLoadingAbandoned request: "+e.request.url+" has been aborted"),k.isSeeking()||y.getSwitchTrack()||T||(d.info("onFragmentLoadingAbandoned request: "+e.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),e.request&&e.request.isInitializationRequest()?y.setInitSegmentRequired(!0):Pe(e.request.startTime+e.request.duration/2),y.startScheduleTimer(0))}function pe(e){d.info("OnFragmentLoadingCompleted for stream id "+Y.id+" and media type "+K+" - Url:",e.request?e.request.url:"undefined",e.request.range?", Range:"+e.request.range:""),i.isText&&y.startScheduleTimer(0),e.error&&e.request.serviceLocation&&function(e){d.info("Fragment loading completed with an error"),e&&e.request&&e.request.type&&(e.request.type===R.HTTPRequest.INIT_SEGMENT_TYPE?Q({representationId:e.request.representation.id,sender:{}},!1):e.request.type===R.HTTPRequest.MEDIA_SEGMENT_TYPE&&(Pe(e.request.startTime+e.request.duration/2),X(0,!1)))}(e)}function me(){Pe(k.getTime()),ye().startScheduleTimer()}function Ee(e){const n=e.currentTrackInfo;if(!n)return;const r=m.find(e=>e.index===n.index&&e.lang===n.lang);r&&oe(new Or({newMediaInfo:r})).then(()=>{t.setIsBufferingCompleted(!1),Pe(k.getTime()),y.setInitSegmentRequired(!0),y.startScheduleTimer()})}function Te(e){Pe(e.quotaExceededTime),Se()}function _e(){return t?t.getBuffer():null}function ye(){return y}function Se(){y&&y.clearScheduleTimer()}function Ie(e=NaN){let t;return isNaN(e)?t=_?_.getCurrentRepresentation():null:((0,He.checkInteger)(e),t=_?_.getRepresentationById(e):null),t}function Re(){return!!t&&t.getIsBufferingCompleted()}function Ne(e){if(!H.get().streaming.enableManifestTimescaleMismatchFix)return;const t=e.chunk,n=t.bytes,r=Ie(t.representation.id);r&&(r.timescale=M.getMediaTimescaleFromMoov(n))}function Ce(e){const t=e.chunk,n=t.bytes,r=Ie(t.representation.id);if(r){let t;if(H.get().streaming.parseInbandPrft&&e.request.type===R.HTTPRequest.MEDIA_SEGMENT_TYPE){t=t||M.parse(n);const e=function(e,t){const n=e.getBoxes("prft"),r=[];
2return n.forEach(e=>{r.push(function(e,t){let n="unknown";switch(e.flags){case 0:n=be.default.PRODUCER_REFERENCE_TIME_TYPE.ENCODER;break;case 16:n=be.default.PRODUCER_REFERENCE_TIME_TYPE.APPLICATION;break;case 24:n=be.default.PRODUCER_REFERENCE_TIME_TYPE.CAPTURED}let r=1e3*e.ntp_timestamp_sec+e.ntp_timestamp_frac/2**32*1e3;return r=Ti(C).getInstance().ntpToUTC(r),{type:n,ntpTimestamp:r,mediaTime:e.media_time/t}}(e,t))}),r}(t,r.timescale);e&&e.length&&b.trigger(p.default.INBAND_PRFT,{data:e},{streamId:Y.id,mediaType:K})}const i=v.getEventsFor(r.mediaInfo,null,Y),a=v.getEventsFor(r,r,Y);if(i&&i.length>0||a&&a.length>0){const r=e.request;t=t||M.parse(n);const o=function(e,t,n,r){try{const i={},a=[],o=n.concat(r);for(let e=0,t=o.length;e<t;e++)i[o[e].schemeIdUri+"/"+o[e].value]=o[e];const s=e.getBoxes("emsg");if(!s||0===s.length)return a;const l=e.getBox("sidx"),u=!l||isNaN(l.earliest_presentation_time)||isNaN(l.timescale)?t&&!isNaN(t.mediaStartTime)?t.mediaStartTime:0:l.earliest_presentation_time/l.timescale,c=Math.max(u,0),d=_.getCurrentRepresentation();for(let e=0,t=s.length;e<t;e++){const t=v.getEvent(s[e],i,c,d);t&&a.push(t)}return a}catch(e){return[]}}(t,r,i,a);b.trigger(g.default.INBAND_EVENTS,{events:o},{streamId:Y.id})}}}function ve(){const e=k.getTime();H.get().streaming.buffer.flushBufferAtTrackSwitch&&k.seek(e+.001,!1,!0),Pe(e),t.setSeekTarget(e),y.startScheduleTimer()}function Me(){const e=k.getTime(),n=t.getContinuousBufferTimeForTargetTime(e);Pe(isNaN(n)?e:n),y.startScheduleTimer()}function we(e){e&&!isNaN(e.time)&&(Pe(e.time),t.setSeekTarget(e.time))}function Pe(e){n=e,A=!0}function Oe(){return a.getLastSegment()}return u={checkAndHandleCompletedBuffering:Z,clearScheduleTimer:Se,createBufferSinks:function(e,n){const r=_e();return r?Promise.resolve(r):t?t.createBufferSink(i,e,n):Promise.resolve(null)},dischargePreBuffer:function(){t.dischargePreBuffer()},finalisePlayList:function(e,t){P.pushPlayListTraceMetrics(e,t)},getAllMediaInfos:function(){return m},getBuffer:_e,getBufferController:function(){return t},getBufferLevel:function(){return t?t.getBufferLevel():0},getFragmentModel:function(){return L},getLastSegment:Oe,getMediaInfo:function(){return i},getMediaSource:function(){return t.getMediaSource()},getRepresentation:Ie,getRepresentationController:function(){return _},getScheduleController:ye,getStreamId:j,getStreamInfo:function(){return Y},getType:W,initialize:function(i,o,s){S=mi(C).create({events:g.default,eventBus:b,streamInfo:Y,timelineConverter:V,dashConstants:be.default,segmentBaseController:e.segmentBaseController,type:K}),a=oi(C).create({baseURLController:e.baseURLController,boxParser:M,constants:h.default,dashConstants:be.default,dashMetrics:P,debug:(0,l.default)(C).getInstance(),errHandler:O,errors:Ae.default,eventBus:b,events:g.default,mediaPlayerModel:x,segmentsController:S,settings:H,streamInfo:Y,timelineConverter:V,type:K,urlUtils:(0,De.default)(C).getInstance()}),c=Y.manifestInfo.isDynamic,a.initialize(c),D.registerStreamType(K,u),_=ii(C).create({abrController:D,adapter:v,dashConstants:be.default,dashMetrics:P,errors:Ae.default,eventBus:b,events:g.default,isDynamic:c,playbackController:k,segmentsController:S,streamInfo:Y,timelineConverter:V,type:K}),t=function(e,t){let n=null;return e?(n=e!==h.default.TEXT||t?Hr(C).create({abrController:D,capabilities:w,errHandler:O,fragmentModel:L,manifestModel:F,mediaController:U,mediaPlayerModel:x,playbackController:k,representationController:_,settings:H,streamInfo:Y,textController:q,type:e}):Vr(C).create({errHandler:O,fragmentModel:L,mimeType:B,settings:H,streamInfo:Y,textController:q,type:e}),n):(O.error(new Ge.default(Ae.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,Ae.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+"not properly defined")),null)}(K,s),t&&t.initialize(i),y=jr(C).create({abrController:D,adapter:v,bufferController:t,dashMetrics:P,fragmentModel:L,mediaController:U,mediaPlayerModel:x,mimeType:B,playbackController:k,representationController:_,settings:H,streamInfo:Y,textController:q,type:K}),r=o,y.initialize(o),n=0,A=!1,I=!1},isBufferingCompleted:Re,prepareInnerPeriodPlaybackSeeking:function(e){return new Promise(n=>{if(t.hasBufferAtTime(e.seekTime))return t.pruneBuffer(),$(t.getContinuousBufferTimeForTargetTime(e.seekTime))&&t.setIsBufferingCompleted(!0),void n();Se(),L.abortRequests(),t.prepareForPlaybackSeek().then(()=>{const n=t.getAllRangesWithSafetyFactor(e.seekTime);return t.clearBuffers(n)}).then(()=>{const r=t.getContinuousBufferTimeForTargetTime(e.seekTime);if($(r))t.setIsBufferingCompleted(!0),n();else{const i=isNaN(r)?e.seekTime:r;Pe(i),t.setSeekTarget(i);const a=[];a.push(t.updateAppendWindow());const o=Ie();a.push(t.updateBufferTimestampOffset(o)),Promise.all(a).then(()=>{y.setInitSegmentRequired(!0),y.setShouldCheckPlaybackQuality(!1),y.startScheduleTimer(),n()})}}).catch(e=>{d.error(e)})})},prepareOuterPeriodPlaybackSeeking:function(){return new Promise((e,n
2)=>{try{Se(),L.abortRequests(),t.prepareForPlaybackSeek().then(()=>t.pruneAllSafely()).then(()=>{e()})}catch(e){n(e)}})},prepareQualityChange:function(e){e.newRepresentation&&(function(e){if(s)s.prepareQualityChange(e);else if(K===h.default.ENHANCEMENT){const t=e.oldRepresentation.mediaInfo.type,n=e.newRepresentation.mediaInfo.type;if(t===h.default.ENHANCEMENT&&n===h.default.VIDEO)return d.info("Stop "+K+" stream processor"),y.reset(),!0;if(t===h.default.VIDEO&&n===h.default.ENHANCEMENT)return d.info("Start "+K+" stream processor"),oe(new Or({newMediaInfo:e.newRepresentation.mediaInfo,newRepresentation:e.newRepresentation})).then(()=>{y.setup(),y.initialize(r),y.startScheduleTimer()}),!0}return!1}(e)||(E&&E.enabled&&d.warn(`Canceling queued representation switch to ${E.newRepresentation.id} for ${K}`),e.isAdaptationSetSwitch?(d.debug(`Preparing quality switch to different AdaptationSet for type ${K} from representation id ${e.oldRepresentation.id} to ${e.newRepresentation.id}`),function(e){const t=e.newRepresentation;T=!0,Se(),y.setSwitchTrack(!0);const n=t.mediaInfo;se(n),oe(new Or({newMediaInfo:n,newRepresentation:t})).then(()=>{le(e)})}(e)):(d.debug(`Preparing quality within the same AdaptationSet for type ${K} from representation id ${e.oldRepresentation.id} to ${e.newRepresentation.id}`),function(e){const t=e.newRepresentation;T=!0,Se(),_.prepareQualityChange(t),le(e)}(e))))},prepareTrackSwitch:function(e,n=!1){return new Promise(r=>{d.debug(`Preparing track switch for type ${K}`);const i=K===h.default.TEXT||n||H.get().streaming.trackSwitchMode[K]===h.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&k.getTimeToStreamEnd(Y)>H.get().streaming.buffer.stallThreshold;t.getIsBufferingCompleted()&&!i?function(e){return new Promise(n=>{const r=_.getCurrentRepresentation();t.prepareForNonReplacementTrackSwitch(r,e).then(()=>{b.trigger(g.default.BUFFERING_COMPLETED,{},{streamId:Y.id,mediaType:K}),n()}).catch(()=>{b.trigger(g.default.BUFFERING_COMPLETED,{},{streamId:Y.id,mediaType:K}),n()})})}(e).then(()=>{r()}):(y.setSwitchTrack(!0),i?function(e){return new Promise(n=>{b.trigger(g.default.BUFFER_REPLACEMENT_STARTED,{mediaType:K,streamId:Y.id},{mediaType:K,streamId:Y.id}),L.abortRequests();const r=Ie();t.prepareForReplacementTrackSwitch(r,e).then(()=>{ve(),n()}).catch(()=>{ve(),n()})})}(e).then(()=>{r()}):function(e){return new Promise(n=>{const r=()=>{const i=L.getRequests({state:te.FRAGMENT_MODEL_LOADING});if(i&&0!==i.length)b.once(p.default.FRAGMENT_LOADING_COMPLETED,r,u);else{const r=Ie();t.prepareForNonReplacementTrackSwitch(r,e).then(()=>{Me(),n()}).catch(e=>{d.error(e),Me(),n()})}};r()})}(e).then(()=>{r()}))})},probeNextRequest:function(){const e=Ie();return a.getNextSegmentRequestIdempotent(i,e)},reset:function(e,n){a&&a.reset(),t&&(t.reset(e,n),t=null),y&&(y.reset(),y=null),_&&(_.reset(),_=null),S&&(S=null),D&&D.unRegisterStreamType(j(),K),b.off(g.default.BUFFER_CLEARED,ne,u),b.off(g.default.BUFFER_LEVEL_STATE_CHANGED,ee,u),b.off(g.default.BYTES_APPENDED_END_FRAGMENT,ie,u),b.off(g.default.FRAGMENT_LOADING_ABANDONED,he,u),b.off(g.default.FRAGMENT_LOADING_COMPLETED,pe,u),b.off(g.default.INIT_FRAGMENT_LOADED,Ne,u),b.off(g.default.INIT_FRAGMENT_NEEDED,Q,u),b.off(g.default.MEDIA_FRAGMENT_LOADED,Ce,u),b.off(g.default.MEDIA_FRAGMENT_NEEDED,X,u),b.off(g.default.QUOTA_EXCEEDED,Te,u),b.off(g.default.SEEK_TARGET,we,u),b.off(g.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,me,u),b.off(g.default.SET_NON_FRAGMENTED_TEXT,Ee,u),b.off(g.default.SOURCE_BUFFER_ERROR,re,u),z(),K=null,Y=null},selectMediaInfo:oe,setEnhancementStreamProcessor:function(e){s=e,d.info("enhancementStreamProcessor = "+s)},setExplicitBufferingTime:Pe,setMediaInfoArray:function(e){m=e},setMediaSource:function(e){return t.setMediaSource(e,i)},setTrackSwitchInProgress:function(e){N=e},updateStreamInfo:function(e){return Y=e,Re()?Promise.resolve():t.updateAppendWindow()}},d=(0,l.default)(C).getInstance().getLogger(u),z(),b.on(g.default.BUFFER_CLEARED,ne,u),b.on(g.default.BUFFER_LEVEL_STATE_CHANGED,ee,u),b.on(g.default.BYTES_APPENDED_END_FRAGMENT,ie,u),b.on(g.default.FRAGMENT_LOADING_ABANDONED,he,u),b.on(g.default.FRAGMENT_LOADING_COMPLETED,pe,u),b.on(g.default.INIT_FRAGMENT_LOADED,Ne,u),b.on(g.default.INIT_FRAGMENT_NEEDED,Q,u),b.on(g.default.MEDIA_FRAGMENT_LOADED,Ce,u),b.on(g.default.MEDIA_FRAGMENT_NEEDED,X,u),b.on(g.default.QUOTA_EXCEEDED,Te,u),b.on(g.default.SEEK_TARGET,we,u),b.on(g.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,me,u),b.on(g.default.SET_NON_FRAGMENTED_TEXT,Ee,u),b.on(g.default.SOURCE_BUFFER_ERROR,re,u),u}_i.__dashjs_factory_name="StreamProcessor";var yi=r.default.getClassFactory(_i),Si=class{constructor(){this.url=null,this.width=null,this.height=null,this.x=null,this.y=null}},Ii=class{constructor(){this.bitrate=0,this.width=0,this.height=0,this.tilesHor=0,this.tilesVert=0,this.widthPerTile=0,this.heightPerTile=0,this.startNumber=0,this.segmentDuration=0,this.timescale=0,this.templateUrl="",this.id=""}},Ai=n(9838),Ri=n(447),Ni=n(5099);function Ci(e){const t=this.context,n=e.adapter,r=e.baseURLController,i=e.streamInfo,a=e.timelineConverter,o=e.debug,s=e.eventBus,l=e.events,u=e.dashConstants,c=(0,De.default)(t).getInstance();let d,f,g,p,m,E,T,_,y;function S(e,t){const i=new Ii;i.id=e.id,i.bitrate=e.bandwidth,i.width=e.width,i.height=e.height,i.tilesHor=1,i.tilesVert=1,e.essentialProperties&&e.essentialProperties.forEac
2h(e=>{if(h.default.THUMBNAILS_SCHEME_ID_URIS.indexOf(e.schemeIdUri)>=0&&e.value){const t=e.value.split("x");2!==t.length||isNaN(t[0])||isNaN(t[1])||(i.tilesHor=parseInt(t[0],10),i.tilesVert=parseInt(t[1],10))}}),t?T.updateSegmentData(e).then(t=>{!function(e,t,i){let o=[];const s=function(e,t){const r=[];let i,o,s,l,u=0;for(i=0,o=e.segments.length;i<o;i++)s=e.segments[i],l=ti({durationInTimescale:s.duration,fTimescale:s.timescale,index:u,isDynamic:n.getIsDynamic(),mediaRange:s.mediaRange,mediaTime:s.startTime,mediaUrl:s.media,representation:t,timelineConverter:a}),l&&(r.push(l),l=null,u++);return r}(i,t);t.segments=s,t.fragmentDuration=t.segmentDuration||(t.segments&&t.segments.length>0?t.segments[0].duration:NaN),e.segmentDuration=t.segments[0].duration,e.readThumbnail=function(e,n){let i=null;o.some(t=>{if(t.start<=e&&t.end>e)return i=t.url,!0}),i?n(i):t.segments.some(i=>{if(i.mediaStartTime<=e&&i.mediaStartTime+i.duration>e){const e=r.resolve(t.path),a=new Ri.default({method:"get",url:e.url,responseType:"arraybuffer",customData:{request:{range:i.mediaRange},onloadend:function(e){let t=y.getSamplesInfo(e.target.response),r=new Blob([e.target.response.slice(t.sampleList[0].offset,t.sampleList[0].offset+t.sampleList[0].size)],{type:"image/jpeg"}),a=window.URL.createObjectURL(r);o.push({start:i.mediaStartTime,end:i.mediaStartTime+i.duration,url:a}),n&&n(a)}}}),s=new Ni.default({request:a});return _.load(a,s),!0}})}}(i,e,t)}):(i.startNumber=e.startNumber,i.segmentDuration=e.segmentDuration,i.timescale=e.timescale,i.templateUrl=function(e){const t=c.isRelative(e.media)?c.resolve(e.media,r.resolve(e.path).url):e.media;return t?Jr(t,e.id):""}(e)),i.tilesHor>0&&i.tilesVert>0&&(i.widthPerTile=i.width/i.tilesHor,i.heightPerTile=i.height/i.tilesVert,f.push(i))}function I(){f=[],g=[],m=-1,E=null,p&&(p.reset(),p=null)}return d={addTracks:function(){if(!i||!n)return;if(E=n.getMediaInfoForType(i,h.default.IMAGE),!E)return;const e=n.getVoRepresentations(E);e&&e.length>0&&e.forEach(e=>{(e.segmentInfoType===be.default.SEGMENT_TEMPLATE&&e.segmentDuration>0&&e.media||e.segmentInfoType===be.default.SEGMENT_TIMELINE)&&S(e),e.segmentInfoType===be.default.SEGMENT_BASE&&S(e,!0),g.push(e)}),f.length>0&&f.sort((e,t)=>e.bitrate-t.bitrate)},getCurrentTrack:function(){return m<0?null:f[m]},getCurrentTrackIndex:function(){return m},getRepresentations:function(){return g},getThumbnailRequestForTime:function(e){let t;const r=n.getVoRepresentations(E);for(let e=0;e<r.length;e++)if(f[m].id===r[e].id){t=r[e];break}return p.getSegmentRequestForTime(E,t,e)},getTracks:function(){return f},reset:I,setTrackById:function(e){if(!f||0===f.length)return;const t=f.findIndex(t=>t.id===e);-1!==t&&(m=t)},setTrackByIndex:function(e){f&&0!==f.length&&(e>=f.length&&(e=f.length-1),m=e)}},I(),_=(0,Ai.default)(t).create({}),y=tt(t).getInstance(),T=mi(t).create({events:l,eventBus:s,streamInfo:i,timelineConverter:a,dashConstants:u,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController,type:h.default.IMAGE}),p=oi(t).create({streamInfo:i,type:h.default.IMAGE,timelineConverter:a,segmentsController:T,baseURLController:r,debug:o,eventBus:s,events:l,dashConstants:u,urlUtils:c}),p.initialize(!!n&&n.getIsDynamic()),d}Ci.__dashjs_factory_name="ThumbnailTracks";var bi=r.default.getClassFactory(Ci);function Di(e){const t=this.context,n=e.streamInfo;let r,i;function a(e){i.setTrackByIndex(e)}function o(){i&&i.reset()}return r={getCurrentTrack:function(){return i.getCurrentTrack()},getCurrentTrackIndex:function(){return i.getCurrentTrackIndex()},getPossibleVoRepresentations:function(){return i.getRepresentations()},getStreamId:function(){return n.id},initialize:function(){i.addTracks();const e=i.getTracks();e&&e.length>0&&a(0)},provide:function(e,t){if("function"!=typeof t)return;const n=i.getCurrentTrack();let r,a;if(!n||n.segmentDuration<=0||null==e)return void t(null);a=i.getThumbnailRequestForTime(e),a&&(n.segmentDuration=a.duration),r=e%n.segmentDuration;const o=Math.floor(r*n.tilesHor*n.tilesVert/n.segmentDuration),s=new Si;if(s.width=Math.floor(n.widthPerTile),s.height=Math.floor(n.heightPerTile),s.x=Math.floor(o%n.tilesHor)*n.widthPerTile,s.y=Math.floor(o/n.tilesHor)*n.heightPerTile,"readThumbnail"in n)return n.readThumbnail(e,e=>{s.url=e,t(s)});if(a)s.url=a.url,n.segmentDuration=NaN;else{const t=Math.floor(e/n.segmentDuration);s.url=function(e,t){const n=t+e.startNumber;return Jr(e.templateUrl,void 0,n,void 0,e.bandwidth,(n-1)*e.segmentDuration*e.timescale)}(n,t)}t(s)},reset:o,setTrackByIndex:a,setTrackById:function(e){i.setTrackById(e)}},o(),i=bi(t).create({streamInfo:n,adapter:e.adapter,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:e.debug,eventBus:e.eventBus,events:e.events,dashConstants:e.dashConstants,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController}),r}
2Di.__dashjs_factory_name="ThumbnailController";var vi=r.default.getClassFactory(Di);const Mi=[h.default.VIDEO,h.default.AUDIO,h.default.TEXT,h.default.MUXED,h.default.IMAGE];function wi(e){e=e||{};const t=this.context,n=(0,f.default)(t).getInstance(),r=(0,De.default)(t).getInstance(),i=e.manifestModel,a=e.mediaPlayerModel,o=e.dashMetrics,s=e.manifestUpdater,u=e.adapter,c=e.timelineConverter,d=e.capabilities,m=e.errHandler,E=e.abrController,T=e.playbackController,_=e.throughputController,y=e.eventController,S=e.mediaController,I=e.protectionController,A=e.textController,R=e.videoModel;let N=e.streamInfo;const C=e.settings;let b,D,v,M,w,P,O,L,F,U,x,B,k,G,H,Y;function q(e,t,n){return new Promise((r,a)=>{Z(),ee();let o=R.getElement();const s=[];Mi.forEach(t=>{if((t!==h.default.TEXT||e)&&(t!==h.default.VIDEO||!o||o&&/^VIDEO$/i.test(o.nodeName))){const r=n.find(e=>e.mediaInfo.type===t);s.push(V(t,e,r))}}),Promise.all(s).then(()=>function(e,t){return new Promise(n=>{const r={},i=G.map(n=>{const r=n.getRepresentation(),i=t.find(e=>e.mediaInfo.type===r.mediaInfo.type);return n.createBufferSinks(e,i)});Promise.all(i).then(e=>{e.forEach(e=>{e&&(r[e.getType()]=e)}),n(r)}).catch(()=>{n(r)})})}(t,n)).then(t=>{if(0===G.length){const e="No streams to play.";m.error(new Ge.default(Ae.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e,i.getValue())),x.fatal(e)}else de();e&&A.createTracks(N),r(t)}).catch(e=>{a(e)})})}function V(r,i,a){let o,s=u.getAllMediaInfoForType(N,r),l=[],c=null,d=-1;if(!s||0===s.length)return x.info("No "+r+" data."),Promise.resolve();r===h.default.VIDEO&&(P=!0),r===h.default.AUDIO&&(M=!0);for(let e=0,t=s.length;e<t;e++)c=s[e],r===h.default.TEXT&&c.isEmbedded&&(A.addEmbeddedTrack(N,c),l.push(c)),K(c)&&S.addTrack(c),c.type===h.default.ENHANCEMENT&&(d=e);if(l.length>0&&(S.setInitialMediaSettingsForType(r,N),A.addMediaInfosToBuffer(N,r,l)),s=s.filter(e=>!e.isEmbedded),0===s.length)return Promise.resolve();if(r===h.default.IMAGE)return H=vi(t).create({streamInfo:N,adapter:u,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:D,eventBus:n,events:g.default,dashConstants:be.default,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController}),H.initialize(),Promise.resolve();n.trigger(g.default.STREAM_INITIALIZING,{streamInfo:N,mediaInfo:c}),S.setInitialMediaSettingsForType(r,N);let f=j(s,i,r);if(d>=0){let e=new Nr(n);e.open(),e.duration=N.manifestInfo.duration;let t=j(s,e,h.default.ENHANCEMENT);t.selectMediaInfo(new Or({newMediaInfo:s[d]})),f.setEnhancementStreamProcessor(t)}if(o=S.getCurrentTrackFor(r,N.id),o){const e=r===h.default.TEXT&&o.isEmbedded?s[0]:o,t=new Or({newMediaInfo:e,previouslySelectedRepresentation:a});return f.selectMediaInfo(t)}return Promise.resolve()}function K(e){const t=e?e.type:null;let n;return t===h.default.MUXED?(n="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",x.fatal(n),m.error(new Ge.default(Ae.default.MANIFEST_ERROR_ID_MULTIPLEXED_CODE,n,i.getValue())),!1):!(t!==h.default.TEXT&&t!==h.default.IMAGE&&e.contentProtection&&e.contentProtection.length>0&&!d.supportsEncryptedMedia()&&(m.error(new Ge.default(Ae.default.CAPABILITY_MEDIAKEYS_ERROR_CODE,Ae.default.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE)),1))}function j(n,r,o){const s=n&&n.length>0?n.filter(e=>e.type===o)[0]:null;let l=v.getModel(s?s.type:null);const f=s?s.type:null,g=s?s.mimeType:null,p=s?s.isFragmented:null;let y=yi(t).create({abrController:E,adapter:u,baseURLController:e.baseURLController,boxParser:b,capabilities:d,dashMetrics:e.dashMetrics,errHandler:m,fragmentModel:l,manifestModel:i,mediaController:S,mediaPlayerModel:a,mimeType:g,playbackController:T,segmentBaseController:e.segmentBaseController,segmentBlacklistController:k,settings:C,streamInfo:N,textController:A,throughputController:_,timelineConverter:c,type:f});return y.initialize(r,P,p),G.push(y),y.setMediaInfoArray(n),f===h.default.TEXT&&A.addMediaInfosToBuffer(N,f,n,l),y}function W(e){let t=G?G.length:0;for(let n=0;n<t;n++){let t=G[n].getFragmentModel();t.abortRequests(),t.resetInitialSettings(),G[n].reset(!1,e)}A&&A.deactivateStream(N),H&&(H.reset(),H=null),G=[],L=!1,w=!1,fe(!1),$(!1),n.trigger(g.default.STREAM_DEACTIVATED,{streamInfo:N})}function z(e){W(e),U=!1,P=!1,M=!1,F=!1,Y=[]}function $(e){F=e}function Q(){return N?N.start:NaN}function X(){return N?N.id:null}function Z(){if(!R||!E)throw new Error(h.default.MISSING_CONFIG_ERROR)}function J(e){e.error&&(m.error(e.error),x.fatal(e.error.message))}function ee(){if(y){const e=u.getEventsFor(N);e&&e.length>0&&y.addInlineEvents(e,N.id)}}function te(e){let t=ne(e);return t?t.getMediaInfo():null}function ne(e){return e?G.find(t=>t.getType()===e):null}function re(){let e=ue();const t=e.length;if(0!==t){for(let n=0;n<t;n++)if(!e[n].isBufferingCompleted()&&(e[n].getType()===h.default.AUDIO||e[n].getType()===h.default.VIDEO))return void x.debug("onBufferingCompleted - One streamProcessor has finished but",e[n].getType(),"one is not buffering completed");x.debug("onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED"),w=!0,n.trigger(g.default.STREAM_BUFFERING_COMPLETED,{streamInfo:N},{streamInfo:N})}else x.warn("onBufferingCompleted - can't trigger STREAM_BUFFERING_COMPLETED because no streamProcessor is defined")}function ie(e){y&&y.addInbandEvents(e.events,N.id)}function ae(){de()}function oe(){ee()}function se(e){return e&&e.type?le(e.type):null}function le(e){return e?ue().filter(function(t){return t.getType()===e})[0]:null}function ue(){let e,t,n=[];for(let r=0;r<G.length;r++)t=G[r],e=t.getType(),e!==h.default.AUDIO&&e!==h.default.VIDEO&&e!==h.default.TEXT&&e!==h.default.ENHANCEMENT||n.push(t);return n}function ce(){const e=G.length;for(let t=0;t<e&&G[t];t++)G[t].getScheduleController().startScheduleTimer()}function de(){const e=G.length;if(I){I.clearMediaInfoArray();for(let t=0;t<e&&G[t];t++){const e=G[t].getType(),n=G[t].getMediaInfo();if(e===h.default.AUDIO||e===h.default.VIDEO||e===h.default.TEXT&&n&&n.isFragmented){let e=G[t].getMediaInfo();e&&I.initializeForMedia(e)}}I.handleKeySystemFromManifest()}U||(U=!0,R.waitForReadyState(h.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,()=>{n.trigger(g.default.STREAM_INITIALIZED,{streamInfo:N})}))}function fe(e){B=e}function ge(){return B}return O={activate:function(e,t,r=[]){return new Promise((i,a)=>
2{if(!L)return ge()?(L=!0,n.trigger(g.default.STREAM_ACTIVATED,{streamInfo:N}),void i()):void function(e,t,n=[]){return q(e,t,n)}(e,t,r).then(()=>{L=!0,r&&r.length>0&&ce(),n.trigger(g.default.STREAM_ACTIVATED,{streamInfo:N}),i()}).catch(e=>{a(e)});i()})},checkAndHandleCompletedBuffering:function(){w||G.forEach(e=>{e.checkAndHandleCompletedBuffering()})},deactivate:W,getAdapter:function(){return u},getCurrentMediaInfoForType:function(e){const t=le(e);return t?t.getMediaInfo():null},getCurrentRepresentationForType:function(e){const t=le(e);return t?t.getRepresentation():null},getDuration:function(){return N?N.duration:NaN},getHasAudioTrack:function(){return M},getHasFinishedBuffering:function(){return w},getHasVideoTrack:function(){return P},getId:X,getIsActive:function(){return L},getIsEndedEventSignaled:function(){return F},getPreloaded:ge,getRepresentationForTypeById:function(e,t){let n;if(e===h.default.IMAGE){if(!H)return null;n=H.getPossibleVoRepresentations()}else{const t=function(e){let t=ne(e);return t?t.getAllMediaInfos():[]}(e);n=t.flatMap(e=>E.getPossibleVoRepresentationsFilteredBySettings(e,!0))}if(!n||0===n.length)return null;const r=n.filter(e=>e.id===t);return r&&r.length>0?r[0]:null},getRepresentationForTypeByIndex:function(e,t){let n;if(e===h.default.IMAGE){if(!H)return null;n=H.getPossibleVoRepresentations()}else{const t=te(e);n=E.getPossibleVoRepresentationsFilteredBySettings(t,!0)}return n[t=Math.max(Math.min(t,n.length-1),0)]},getRepresentationsByType:function(e,t=!0){if(Z(),e===h.default.IMAGE)return H?H.getPossibleVoRepresentations():[];const n=te(e);return t?E.getPossibleVoRepresentationsFilteredBySettings(n,!0):E.getPossibleVoRepresentations(n,!0)},getStartTime:Q,getStreamId:function(){return N?N.id:null},getStreamInfo:function(){return N},getStreamProcessors:ue,getThumbnailController:function(){return H},initialize:function(){n.on(g.default.BUFFERING_COMPLETED,re,O),n.on(g.default.INBAND_EVENTS,ie,O),n.on(g.default.DATA_UPDATE_COMPLETED,ae,O),n.on(p.default.PLAYBACK_SEEKED,oe,O),I&&(n.on(g.default.KEY_ERROR,J,O),n.on(g.default.SERVER_CERTIFICATE_UPDATED,J,O),n.on(g.default.LICENSE_REQUEST_COMPLETE,J,O),n.on(g.default.KEY_SYSTEM_SELECTED,J,O),n.on(g.default.KEY_SESSION_CREATED,J,O)),A.initializeForStream(N),n.trigger(g.default.STREAM_UPDATED,{streamInfo:N})},initializeForTextWithMediaSource:function(e){return new Promise((t,n)=>{V(h.default.TEXT,e,null).then(()=>function(){const e=le(h.default.TEXT);return e?e.createBufferSinks():Promise.resolve()}()).then(()=>{A.createTracks(N),t()}).catch(e=>{n(e)})})},prepareQualityChange:function(e){const t=le(e.mediaType);t&&t.prepareQualityChange(e)},prepareTrackChange:function(e){if(!L||!N)return;w=!1;let t=e.newMediaInfo,n=i.getValue(),r=se(t);if(!r)return;let a=T.getTime();if(x.info("Stream -  Process track changed at current time "+a),n.refreshManifestOnSwitchTrack)Y.push(e),s.getIsUpdating()||(x.debug("Stream -  Refreshing manifest for switch track"),s.refreshManifest());else{r.clearScheduleTimer(),r.setTrackSwitchInProgress(!0);const n=r.getRepresentation();r.selectMediaInfo(new Or({newMediaInfo:t})).then(()=>{const t=!!(e&&e.options&&e.options.hasOwnProperty("replaceBuffer"))&&e.options.replaceBuffer;return r.prepareTrackSwitch(n,t)}).then(()=>{r.setTrackSwitchInProgress(!1)})}},reset:function(e){v&&(v.reset(),v=null),E&&N&&E.clearDataForStream(N.id),k&&(k.reset(),k=null),A&&N&&A.clearDataForStream(N.id),S&&N&&S.clearDataForStream(N.id),z(e),N=null,n.off(g.default.BUFFERING_COMPLETED,re,O),n.off(g.default.INBAND_EVENTS,ie,O),n.off(g.default.DATA_UPDATE_COMPLETED,ae,O),n.off(p.default.PLAYBACK_SEEKED,oe,O),I&&(n.off(g.default.KEY_ERROR,J,O),n.off(g.default.SERVER_CERTIFICATE_UPDATED,J,O),n.off(g.default.LICENSE_REQUEST_COMPLETE,J,O),n.off(g.default.KEY_SYSTEM_SELECTED,J,O),n.off(g.default.KEY_SESSION_CREATED,J,O))},setIsEndedEventSignaled:$,setMediaSource:function(e){return new Promise((t,n)=>{const r=[];for(let t=0;t<G.length;)K(G[t].getMediaInfo())?(r.push(G[t].setMediaSource(e)),t++):(G[t].reset(),G.splice(t,1));Promise.all(r).then(()=>{for(let e=0;e<G.length;e++)G[e].dischargePreBuffer();if(0===G.length){const e="No streams to play.";m.error(new Ge.default(Ae.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e+"nostreams",i.getValue())),x.fatal(e)}t()}).catch(e=>{x.error(e),n(e)})})},startPreloading:function(e,t,n=[]){return new Promise((r,i)=>
2{ge()?i():(x.info(`[startPreloading] Preloading next stream with id ${X()}`),fe(!0),q(e,t,n).then(()=>{for(let e=0;e<G.length&&G[e];e++)G[e].setExplicitBufferingTime(Q()),G[e].getScheduleController().startScheduleTimer();r()}).catch(()=>{fe(!1),i()}))})},startScheduleControllers:ce,triggerProtectionError:function(e){J(e)},updateData:function(e){return new Promise(t=>{N=e,y&&ee();let r,i=[];for(let e=0,t=G.length;e<t;e++){let t=G[e];const n=t.getMediaInfo();i.push(t.updateStreamInfo(N));let r=u.getAllMediaInfoForType(N,t.getType());if(r=r.filter(e=>!e.isEmbedded),t.setMediaInfoArray(r),r)for(let e=0;e<r.length;e++)u.areMediaInfosEqual(n,r[e])&&i.push(t.selectMediaInfo(new Or({newMediaInfo:r[e]})))}Promise.all(i).then(()=>{let e=[];for(;Y.length>0;){let t=Y.pop(),n=t.newMediaInfo;if(r=se(t.oldMediaInfo),!r)return;const i=r.getRepresentation();r.setTrackSwitchInProgress(!0),e.push(r.prepareTrackSwitch(i)),e.push(r.selectMediaInfo(new Or({newMediaInfo:n})))}return Promise.all(e)}).then(()=>{de(),r&&r.setTrackSwitchInProgress(!1),n.trigger(g.default.STREAM_UPDATED,{streamInfo:N}),t()}).catch(e=>{m.error(e)})})}},function(){try{D=(0,l.default)(t).getInstance(),x=D.getLogger(O),z(),b=tt(t).getInstance(),k=Fe(t).create({updateEventName:g.default.SEGMENT_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:g.default.SEGMENT_LOCATION_BLACKLIST_ADD,enableExpiry:!1}),v=Pr(t).create({streamInfo:N,mediaPlayerModel:a,dashMetrics:o,errHandler:m,settings:C,boxParser:b,dashConstants:be.default,urlUtils:r})}catch(e){throw e}}(),O}wi.__dashjs_factory_name="Stream";var Pi=r.default.getClassFactory(wi);function Oi(){const e=this.context,t=(0,f.default)(e).getInstance(),n=(0,De.default)(e).getInstance();let r,i,a,o,s,u,c,d,h,p,m,E,T,_,y,S;function I(){d=[],h=[],p=null,m=null,T=null,E=NaN,a=!1,o=!1,_=s.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function A(){s.get().streaming.utcSynchronization.enabled&&!a&&!o&&T&&T.value&&T.schemeIdUri&&!isNaN(E)&&!isNaN(s.get().streaming.utcSynchronization.backgroundAttempts)&&(m&&(Date.now()-m)/1e3<30||(d=[],o=!0,N(isNaN(s.get().streaming.utcSynchronization.backgroundAttempts)?2:s.get().streaming.utcSynchronization.backgroundAttempts)))}function N(e){try{if(e<=0)return void x();const t=Date.now();u[T.schemeIdUri](T.value,function(n){const r=Date.now(),i=b(t,r,n);d.push(i),N(e-1)},function(){x()})}catch(e){x()}}function C(e=null){let t=e||0;if(!h||0===h.length||t>=h.length)return void D();let n=h[t];if(n)if(u.hasOwnProperty(n.schemeIdUri)){const e=(new Date).getTime();u[n.schemeIdUri](n.value,function(t){const r=(new Date).getTime(),i=b(e,r,t);T=n,D(i)},function(){C(t+1)})}else C(t+1);else D()}function b(e,t,n){return n-(t-(t-e)/2)}function D(e=NaN){let t=isNaN(e);t&&s.get().streaming.utcSynchronization.useManifestDateHeaderTimeSource?function(){let e=c.getLatestMPDRequestHeaderValueByID("Date"),t=null!==e?new Date(e).getTime():Number.NaN;isNaN(t)?U(!0):U(!1,t-Date.now())}():U(t,e)}function v(e){let t=Date.parse(e);return isNaN(t)&&(t=function(e){let t,n,r=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/.exec(e);return t=Date.UTC(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),parseInt(r[4],10),parseInt(r[5],10),r[6]&&(parseInt(r[6],10)||0),r[7]&&1e3*parseFloat(r[7])||0),r[9]&&r[10]&&(n=60*parseInt(r[9],10)+parseInt(r[10],10),t+=("+"===r[8]?-1:1)*n*60*1e3),new Date(t).getTime()}(e)),t}function M(e){return Date.parse(e)}function w(e){return Date.parse(e)}function P(e,t,n){n()}function O(e,t,n){let r=v(e);isNaN(r)?n():t(r)}function L(e,t,r,i,a){let o,s,l=!1,u=new XMLHttpRequest,c=a?R.HTTPRequest.HEAD:R.HTTPRequest.GET,d=t.match(/\S+/g);if(t=d.shift(),o=function(){l||(l=!0,d.length?L(e,d.join(" "),r,i,a):i())},s=function(){let t,n;200===u.status&&(t=a?u.getResponseHeader("Date"):u.response,n=e(t),isNaN(n)||(r(n),l=!0))},n.isRelative(t)){const e=S.resolve();e&&(t=n.resolve(t,e.url))}u.open(c,t),u.timeout=5e3,u.onload=s,u.onloadend=o,u.send()}function F(e,t,n){L(w,e,t,n,!0)}function U(e,n){if(isNaN(E)||isNaN(n)||e||function(e){try{const t=B(e),n=isNaN(_)?30:_,r=isNaN(s.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:s.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,a=isNaN(s.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:s.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,o=isNaN(s.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:s.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts;let l;t?(l=Math.min(n*r,a),i.debug(`Increasing timeBetweenSyncAttempts to ${l}`)):(l=Math.max(n/r,o),i.debug(`Decreasing timeBetweenSyncAttempts to ${l}`)),_=l}catch(e){}}(n),!e&&!isNaN(n)){p=Date.now(),a=!1;const e=isNaN(E);E=n,e&&A(),i.debug(`Completed UTC sync. Setting client - server offset to ${n}`)}e&&(T=null,a=!1,y.error(new Ge.default(Ae.default.TIME_SYNC_FAILED_ERROR_CODE,Ae.default.TIME_SYNC_FAILED_ERROR_MESSAGE)));const r=s.get().streaming.utcSynchronization.artificialTimeOffsetToApply;t.trigger(g.default.UPDATE_TIME_SYNC_OFFSET,{offset:n+r}),t.trigger(g.default.TIME_SYNCHRONIZATION_COMPLETED)}function x(){if(!d||0===d.length)return;const e=d.reduce((e,t)=>
2e+t,0)/d.length;B(e)?i.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(i.debug(`Completed background UTC sync. Setting client - server offset to ${e}`),E=e,t.trigger(g.default.UPDATE_TIME_SYNC_OFFSET,{offset:E})),o=!1,m=Date.now()}function B(e){try{if(isNaN(E))return!0;const t=s.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(s.get().streaming.utcSynchronization.maximumAllowedDrift)?s.get().streaming.utcSynchronization.maximumAllowedDrift:100;return e>=E-t&&e<=E+t}catch(e){return!0}}return r={initialize:function(){I(),u={"urn:mpeg:dash:utc:http-head:2014":F,"urn:mpeg:dash:utc:http-xsdate:2014":L.bind(null,v),"urn:mpeg:dash:utc:http-iso:2014":L.bind(null,M),"urn:mpeg:dash:utc:direct:2014":O,"urn:mpeg:dash:utc:http-head:2012":F,"urn:mpeg:dash:utc:http-xsdate:2012":L.bind(null,v),"urn:mpeg:dash:utc:http-iso:2012":L.bind(null,M),"urn:mpeg:dash:utc:direct:2012":O,"urn:mpeg:dash:utc:http-ntp:2014":P,"urn:mpeg:dash:utc:ntp:2014":P,"urn:mpeg:dash:utc:sntp:2014":P}},attemptSync:function(e,n){h=e,a||(function(e){try{if(!e||!s.get().streaming.utcSynchronization.enabled)return!1;const t=isNaN(_)?30:_;return!(p&&t&&!isNaN(t))||(Date.now()-p)/1e3>=t}catch(e){return!0}}(n)?(a=!0,C()):t.trigger(g.default.TIME_SYNCHRONIZATION_COMPLETED))},setConfig:function(e){e&&(e.dashMetrics&&(c=e.dashMetrics),e.baseURLController&&(S=e.baseURLController),e.errHandler&&(y=e.errHandler),e.settings&&(s=e.settings))},reset:function(){I(),t.off(g.default.ATTEMPT_BACKGROUND_SYNC,A,r)}},i=(0,l.default)(e).getInstance().getLogger(r),t.on(g.default.ATTEMPT_BACKGROUND_SYNC,A,r),r}Oi.__dashjs_factory_name="TimeSyncController";const Li=r.default.getSingletonFactory(Oi);Li.HTTP_TIMEOUT_MS=5e3,r.default.updateSingletonFactory(Oi.__dashjs_factory_name,Li);var Fi=Li;function Ui(){let e,t,n,r,i;const a=this.context,o=(0,f.default)(a).getInstance();return e={attachMediaSource:function(e){let n=window.URL.createObjectURL(t);return e.setSource(n),"managedMediaSource"===r&&(e.setDisableRemotePlayback(!0),t.addEventListener("startstreaming",()=>{o.trigger(p.default.MANAGED_MEDIA_SOURCE_START_STREAMING)}),t.addEventListener("endstreaming",()=>{o.trigger(p.default.MANAGED_MEDIA_SOURCE_END_STREAMING)})),n},createMediaSource:function(){let e="WebKitMediaSource"in window,n="MediaSource"in window;return"ManagedMediaSource"in window?(t=new ManagedMediaSource,r="managedMediaSource",i.info("Created ManagedMediaSource")):n?(t=new MediaSource,r="mediaSource",i.info("Created MediaSource")):e&&(t=new WebKitMediaSource,i.info("Created WebkitMediaSource")),t},detachMediaSource:function(e){e.setSource(null)},setConfig:function(e){e&&e.settings&&(n=e.settings)},setDuration:function e(r){t&&"open"===t.readyState&&(null===r&&isNaN(r)||t.duration!==r&&(r!==1/0||n.get().streaming.buffer.mediaSourceDurationInfinity||(r=Math.pow(2,32)),function(e){let t=e.sourceBuffers;for(let e=0;e<t.length;e++)if(t[e].updating)return!0;return!1}(t)?setTimeout(e.bind(null,r),50):(i.info("Set MediaSource duration:"+r),t.duration=r)))},setSeekable:function(e,n){t&&"function"==typeof t.setLiveSeekableRange&&"function"==typeof t.clearLiveSeekableRange&&"open"===t.readyState&&e>=0&&e<n&&(t.clearLiveSeekableRange(),t.setLiveSeekableRange(e,n))},signalEndOfStream:function(e){if(!e||"open"!==e.readyState)return;let t=e.sourceBuffers;for(let e=0;e<t.length;e++){if(t[e].updating)return;if(0===t[e].buffered.length)return}i.info("call to mediaSource endOfStream"),e.endOfStream()}},i=(0,l.default)(a).getInstance().getLogger(e),e}Ui.__dashjs_factory_name="MediaSourceController";var xi=r.default.getSingletonFactory(Ui);function Bi(){const e="urn:mpeg:dash:event:2012",t="updated",n="added";function r(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}const i=this.context,a=(0,f.default)(i).getInstance();let o,s,u,c,d,g,h,m,E,T,_;function y(){if(!h||!m)throw new Error("setConfig function has to be called previously")}function S(){_=!1,u={},c={},d=null,T=!1,g=Date.now()/1e3}function I(){try{if(!T){T=!0;const e=m.getTime();let t=e-g;t=g>0?Math.max(0,t):0,A(c,t,e),A(u,t,e),R(c),R(u),g=e,T=!1}}catch(e){T=!1,s.error(e)}}function A(e,t,n){try{const r=function(r){if(void 0!==r){const i=isNaN(r.duration)?0:r.duration;r.calculatedPresentationTime<=n&&r.calculatedPresentationTime+t+i>=n?M(r,p.default.EVENT_MODE_ON_START):(v(n,i+t,r.calculatedPresentationTime)||function(e){try{const t=e.eventStream.period.start+e.eventStream.period.duration;return e.calculatedPresentationTime>t}catch(e){return s.error(e),!1}}(r))&&(s.debug(`Removing event ${r.id}
2 from period ${r.eventStream.period.id} as it is expired or invalid`),function(e,t){try{const n=t.eventStream.schemeIdUri,r=t.eventStream.period.id,i=t.eventStream.value,a=t.id;e[r][n]=e[r][n].filter(e=>i&&e.eventStream.value&&e.eventStream.value!==i||e.id!==a),0===e[r][n].length&&delete e[r][n]}catch(e){s.error(e)}}(e,r))}};D(e,r)}catch(e){s.error(e)}}function R(e){try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&r(e[t])&&delete e[t]}catch(e){s.error(e)}}function N(e,r,i=!1){const a=e.eventStream.schemeIdUri,o=e.eventStream.value,s=e.id;let l="discarded";r[a]||(r[a]=[]);const u=r[a].findIndex(e=>(!o||e.eventStream.value&&e.eventStream.value===o)&&e.id===s);if(-1===u)r[a].push(e),e.triggeredReceivedEvent=!1,e.triggeredStartEvent=!1,l=n;else if(i){const n=r[a][u];e.triggeredReceivedEvent=n.triggeredReceivedEvent,e.triggeredStartEvent=n.triggeredStartEvent,r[a][u]=e,l=t}return l}function C(e){try{if(1==e.eventStream.value){const t=e.calculatedPresentationTime;let n;n=4294967295==e.calculatedPresentationTime?NaN:e.calculatedPresentationTime+e.duration,a.trigger(p.default.MANIFEST_VALIDITY_CHANGED,{id:e.id,validUntil:t,newDuration:n,newManifestValidAfter:NaN},{mode:p.default.EVENT_MODE_ON_START})}}catch(e){s.error(e)}}function b(e){try{const t=m.getTime();D(e,function(e){const n=e.eventStream&&e.eventStream.period&&!isNaN(e.eventStream.period.duration)?e.eventStream.period.duration:NaN,r=e.eventStream&&e.eventStream.period&&!isNaN(e.eventStream.period.start)?e.eventStream.period.start:NaN;if(isNaN(n)||isNaN(r))return;const i=e.calculatedPresentationTime;Math.abs(i-t)<300&&M(e,p.default.EVENT_MODE_ON_START)})}catch(e){s.error(e)}}function D(e,t){try{if(e)for(const n in e){const r=e[n];for(const e in r){const n=r[e];for(let e=0;e<n.length;e++){const r=n[e];void 0!==r&&t(r)}}}}catch(e){s.error(e)}}function v(e,t,n){try{return e-t>n}catch(e){return s.error(e),!1}}function M(t,n){try{const r=m.getTime(),o=t.id;if(n===p.default.EVENT_MODE_ON_RECEIVE&&!t.triggeredReceivedEvent)return s.debug(`Received event ${o}`),t.triggeredReceivedEvent=!0,void a.trigger(t.eventStream.schemeIdUri,{event:t},{mode:n});t.triggeredStartEvent||(t.eventStream.schemeIdUri===e&&1==t.eventStream.value?0===t.duration&&0===t.presentationTimeDelta||(s.debug(`Starting manifest refresh event ${o} at ${r}`),function(){try{y(),h.refreshManifest()}catch(e){s.error(e)}}()):"urn:mpeg:dash:event:callback:2015"===t.eventStream.schemeIdUri&&1==t.eventStream.value?(s.debug(`Starting callback event ${o} at ${r}`),function(e){try{let t=(0,Ai.default)(i).create({});const n=new Ri.default({method:"get",url:e,responseType:"arraybuffer",customData:{}}),r=new Ni.default({request:n});t.load(n,r)}catch(e){s.error(e)}}(t.messageData instanceof Uint8Array?we.default.uint8ArrayToString(t.messageData):t.messageData)):(s.debug(`Starting event ${o} from period ${t.eventStream.period.id} at ${r}`),a.trigger(t.eventStream.schemeIdUri,{event:t},{mode:n}),E.get().streaming.events.deleteEventMessageDataTimeout>-1&&setTimeout(()=>{delete t.messageData,delete t.parsedMessageData},E.get().streaming.events.deleteEventMessageDataTimeout)),t.triggeredStartEvent=!0)}catch(e){s.error(e)}}return o={addInlineEvents:function(e,r){try{if(y(),u[r]||(u[r]={}),e)for(let i=0;i<e.length;i++){let a=e[i];if(!v(m.getTime(),isNaN(a.duration)?0:a.duration,a.calculatedPresentationTime)){let e=N(a,u[r],!0);e===n?(s.debug(`Added inline event with id ${a.id} from period ${r}`),M(a,p.default.EVENT_MODE_ON_RECEIVE)):e===t&&s.debug(`Updated inline event with id ${a.id} from period ${r}`)}}}catch(e){throw e}},addInbandEvents:function(t,r){try{y(),c[r]||(c[r]={});for(let i=0;i<t.length;i++){let a=t[i];v(m.getTime(),isNaN(a.duration)?0:a.duration,a.calculatedPresentationTime)||(N(a,c[r],!1)===n?(a.eventStream.schemeIdUri===e&&C(a),s.debug(`Added inband event with id ${a.id} from period ${r}`),M(a,p.default.EVENT_MODE_ON_RECEIVE)):s.debug(`Inband event with scheme_id_uri ${a.eventStream.schemeIdUri}, value ${a.eventStream.value}, period id ${r} and event id ${a.id} was ignored because it has been added before.`))}I()}catch(e){throw e}},getInbandEvents:function(){return c},getInlineEvents:function(){return u},start:function(){try{y(),s.debug("Start Event Controller");const e=E.get().streaming.events.eventControllerRefreshDelay;_||isNaN(e)||(_=!0,d=setInterval(I,e))}catch(e){throw e}},setConfig:function(e){try{if(!e)return;e.manifestUpdater&&(h=e.manifestUpdater),e.playbackController&&(m=e.playbackController),e.settings&&(E=e.settings)}catch(e){throw e}},reset:function(){(function(){try{null!==d&&_&&(clearInterval(d),d=null,_=!1,function(){try{b(c),b(u)}catch(e){s.error(e)}}())}catch(e){throw e}})(),S()}},s=(0,l.default)(i).getInstance().getLogger(o),S(),o}Bi.__dashjs_factory_name="EventController";var ki=r.default.getSingletonFactory(Bi),Gi={LEVELS:{SUGGESTION:"Suggestion",WARNING:"Warning",ERROR:"Error"},EVENTS:{NO_UTC_TIMING_ELEMENT:{key:"NO_UTC_TIMING_ELEMENT",message:"No UTCTiming element is present in the manifest. You may experience playback failures. For a detailed validation use https://conformance.dashif.org/"},NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE:{key:"NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE",message:'SMPTE 2052-1:2013 defines the attribute name as "imageType" and does not define "imagetype"'},INVALID_DVR_WINDOW:{key:"INVALID_DVR_WINDOW",message:"No valid segment found when applying a specification compliant DVR window calculation. Using SegmentTimeline entries as a fallback."}}},Hi=n(5313),Yi=n(445),qi=n(1923);function Vi(){const e=this.context,t=(0,f.default)(e).getInstance();let n,r,i,a,s,u,c,d,m,E,T,_,y,S,I,A,R,N,C,b,D,v,M,w,P,O,L,F,U,x,B,k,G,H,Y,q,V,K,j,W,z,$,Q,X,Z,J,ee,te;function ne(){if(!(u&&u.hasOwnProperty("load")&&v&&v.hasOwnProperty("initialize")&&v.hasOwnProperty("reset")&&v.hasOwnProperty("getClientTimeOff
2set")&&c&&D&&m&&Y))throw new Error(h.default.MISSING_CONFIG_ERROR)}function re(){!function(){try{const e=d.getStreamsInfo();if(!w&&0===e.length)throw new Error("There are no periods in the MPD");w&&e.length>0&&m.updateManifestUpdateInfo({currentTime:Y.getTime(),buffered:H.getBufferRange(),presentationStartTime:e[0].start,clientTimeOffset:v.getClientTimeOffset()}),M.length>0&&function(e){0!==e.length?M=M.filter(t=>{const n=e.filter(e=>e.id===t.getId()).length>0||t.getId()===w.getId();return n||(r.debug(`Removing stream ${t.getId()}`),t.reset(!0),t=null),n}):r.warn("No periods included in the current manifest. Skipping the filtering of outdated stream objects.")}(e);const n=[];for(let t=0,r=e.length;t<r;t++){const r=e[t];n.push(ae(r)),m.addManifestUpdateStreamInfo(r)}Promise.all(n).then(()=>new Promise((t,n)=>{w?t():oe(e,t,n)})).then(()=>{t.trigger(g.default.STREAMS_COMPOSED),ve()}).catch(e=>{throw e})}catch(e){D.error(new Ge.default(Ae.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e.message+" nostreamscomposed",c.getValue())),k=!0,Ze()}}()}function ie(){Z=!0}function ae(t){let n=$e(t.id);return n?n.updateData(t):(n=Pi(e).create({manifestModel:c,mediaPlayerModel:V,dashMetrics:m,manifestUpdater:s,adapter:d,timelineConverter:v,capabilities:i,capabilitiesFilter:a,errHandler:D,baseURLController:y,segmentBaseController:S,textController:O,abrController:A,playbackController:Y,throughputController:R,eventController:C,mediaController:N,protectionController:P,videoModel:H,streamInfo:t,settings:X}),M.push(n),n.initialize(),Promise.resolve())}function oe(e,n,i){try{ye();const a=m.getCurrentDVRInfo().range;if(a.end<a.start)return void function(e,n,i,a){J&&clearTimeout(J);const o=Math.min(1e3*(-1*(e.end-e.start)+2),2147483647);r.debug(`Waiting for ${o} ms before playback can start`),t.trigger(g.default.AST_IN_FUTURE,{delay:o}),J=setTimeout(()=>{oe(n,i,a)},o)}(a,e,n,i);X.get().streaming.applyProducerReferenceTime&&q.calculateProducerReferenceTimeOffsets(e);const o=e[0].manifestInfo;if(X.get().streaming.applyServiceDescription&&q.applyServiceDescription(o),d.getIsDynamic()){const e=xe(o);Y.computeAndSetLiveDelay(e,o)}(X.get().streaming.applyContentSteering&&_.shouldQueryBeforeStart()?_.loadSteeringData():Promise.resolve()).then(()=>{const e=c.getValue();e&&y.update(e),se(),n()}).catch(e=>{r.error(e),se(),n()})}catch(e){i(e)}}function se(){const e=function(){let e;return e=d.getIsDynamic()?function(){let e;const t=m.getCurrentDVRInfo();e=(t&&t.range?t.range.end:0)-Y.getOriginalLiveDelay();const n=t?t.range:null;if(n){if(isNaN(ee)&&-1===ee.toString().indexOf("posix:")){const t=Le(!0);isNaN(t)||(r.info(`Start time from URI parameters: ${t}`),e=Math.min(e,t))}else{r.info(`Start time provided by the app: ${ee}`);const t=Fe(!0,ee);isNaN(t)||(e=Math.min(e,t))}const t=X.get().streaming.timeShiftBuffer.calcFromSegmentTimeline?.1:0;e=Math.max(e,n.start+t)}return e}():function(){let e=et()[0].getStreamInfo().start;if(isNaN(ee)){const t=Le(!1);isNaN(t)||(r.info(`Start time from URI parameters: ${t}`),e=Math.max(e,t))}else{r.info(`Start time provided by the app: ${ee}`);const t=Fe(!1,ee);isNaN(t)||(e=Math.max(e,t))}return e}(),e}();let n=_e(e);const i=null!==n?n:M[0];t.trigger(g.default.INITIAL_STREAM_SWITCH,{startTime:e}),le(i,null,e),$||($=setInterval(function(){!x&&Y.getTimeToStreamEnd()<=0&&!Y.isSeeking()&&t.trigger(g.default.PLAYBACK_ENDED,{isLast:ze().isLast})},200))}function le(e,n,i){try{if(x||!e||n===e&&e.getIsActive())return;x=!0,t.trigger(g.default.PERIOD_SWITCH_STARTED,{fromStreamInfo:n?n.getStreamInfo():null,toStreamInfo:e.getStreamInfo()});let a=!1,o=[],s=fe(n);w=e,n&&(a=Ee(e,n),o=de(n),n.deactivate(a)),i=isNaN(i)?!a&&n?e.getStreamInfo().start:NaN:i,r.info(`Switch to stream ${e.getId()}. Seektime is ${i}, current playback time is ${Y.getTime()}. Seamless period switch is set to ${a}`),Q=Q.filter(e=>e.getId()!==w.getId()),Y.initialize(ze(),!!n),H.getElement()?ue({seekTime:i,keepBuffers:a,sourceBufferSinksFromPreviousPeriod:s,streamActivated:!1,representationsFromPreviousPeriod:o}):ce({seekTime:i,keepBuffers:a,sourceBufferSinksFromPreviousPeriod:s})}catch(e){x=!1}}function ue(e){let t;function n(){if(!G||"open"!==G.readyState)return;r.debug("MediaSource is open!"),window.URL.revokeObjectURL(t),G.removeEventListener("sourceopen",n),G.removeEventListener("webkitsourceopen",n),Oe();const i=m.getCurrentDVRInfo();E.setSeekable(i.range.start,i.range.end),e.streamActivated?(isNaN(e.seekTime)||Y.seek(e.seekTime,!0,!0),w.setMediaSource(G).then(()=>{w.initializeForTextWithMediaSource(G)})):ce(e)}function i(){G.addEventListener("sourceopen",n,!1),G.addEventListener("webkitsourceopen",n,!1),t=E.attachMediaSource(H),r.debug("MediaSource attached to element.  Waiting on open...")}G?e.keepBuffers?ce(e):(E.detachMediaSource(H),i()):(G=E.createMediaSource(),i())}function ce(e){const n=e.representationsFromPreviousPeriod||[];w.activate(G,e.sourceBufferSinksFromPreviousPeriod,n).then(()=>{isNaN(e.seekTime)||(t.trigger(g.default.SEEK_TARGET,{time:e.seekTime},{streamId:w.getId()}),Y.seek(e.seekTime,!1,!0),w.startScheduleControllers()),x=!1,t.trigger(g.default.PERIOD_SWITCH_COMPLETED,{toStreamInfo:ze()})})}function de(e){return(e?e.getStreamProcessors():[]).map(e=>e.getRepresentation())}function fe(e){const t=new Map;
2return e?((e?e.getStreamProcessors():[]).forEach(e=>{const n=e.getBuffer();n&&t.set(n.getType(),n)}),t):t}function ge(e){const t=_e(e.seekTime);t&&t!==w?t&&t!==w&&(he(t),function(e,t){const n=e&&!isNaN(e.seekTime)?e.seekTime:NaN,r=w.getStreamProcessors().map(t=>t.prepareOuterPeriodPlaybackSeeking(e));Promise.all(r).then(()=>{le(t,w,n)}).catch(e=>{D.error(e)})}(e,t)):(he(),function(e){w.getStreamProcessors().forEach(t=>t.prepareInnerPeriodPlaybackSeeking(e)),qe(cn.USER_REQUEST_STOP_REASON)}(e)),Ve(un.SEEK_START_REASON)}function he(e=null){pe()}function pe(){Q&&Q.length>0&&(Q.forEach(e=>{e.deactivate(!0)}),Q=[])}function me(e){if(e.newMediaInfo.streamInfo.id===w.getId()){if(pe(),X.get().streaming.buffer.resetSourceBuffersForTrackSwitch&&e.oldMediaInfo&&e.oldMediaInfo.codec!==e.newMediaInfo.codec){const e=Y.getTime();return w.deactivate(!1),void ue({seekTime:e,keepBuffers:!1,streamActivated:!1})}w.prepareTrackChange(e)}}function Ee(e,t){try{return X.get().streaming.buffer.reuseExistingSourceBuffers&&(i.isProtectionCompatible(t.getStreamInfo(),e.getStreamInfo())||Z)&&i.supportsChangeType()&&X.get().streaming.buffer.useChangeType}catch(e){return!1}}function Te(e,t=null){if(!G||e.getPreloaded())return;if(!Ee(e,t))return;const n=de(t),r=fe(t);e.startPreloading(G,r,n).then(()=>{Q.push(e)})}function _e(e){if(isNaN(e))return null;const t=M.length;for(let n=0;n<t;n++){const t=M[n];if(e<parseFloat((t.getStartTime()+t.getDuration()).toFixed(5)))return t}return null}function ye(){try{const e=d.getIsDynamic(),t=d.getStreamsInfo()[0].manifestInfo,n=Y.getTime(),r=v.calcTimeShiftBufferWindow(M,e),i=we();if(void 0===r.start||void 0===r.end)return;i&&0!==i.length?i.forEach(e=>{m.addDVRInfo(e.getType(),n,t,r)}):m.addDVRInfo(h.default.VIDEO,n,t,r)}catch(e){}}function Se(e){if(W&&U){const e=V.getInitialBufferLevel(),t=[h.default.TEXT];(isNaN(e)||e<=Y.getBufferLevel(t)||d.getIsDynamic()&&e>Y.getLiveDelay())&&(W=!1,Ve(un.INITIAL_PLAYOUT_START_REASON),Y.play())}e&&e.mediaType&&m.addBufferLevel(e.mediaType,new Date,1e3*e.bufferLevel)}function Ie(e){e.streamInfo.id===w.getId()&&pe(),$e(e.streamInfo.id).prepareQualityChange(e)}function Re(){if(d.getIsDynamic()&&0!==Y.getOriginalLiveDelay()&&w){const e=d.getStreamsInfo();if(e.length>0){const t=e[0].manifestInfo,n=xe(t);Y.computeAndSetLiveDelay(n,t)}}}function Ne(){if(He()){const e=H.getPlaybackQuality();e&&m.addDroppedFrames(e)}}function Ce(){r.debug("[onPlaybackStarted]"),!W&&j&&Ve(un.RESUME_FROM_PAUSE_START_REASON),W&&(W=!1),z&&(z=!1,X.get().streaming.applyContentSteering&&!_.shouldQueryBeforeStart()&&_.loadSteeringData()),j=!1}function be(e){r.debug("[onPlaybackPaused]"),e.ended||(j=!0,qe(cn.USER_REQUEST_STOP_REASON))}function De(e){r.debug(`Stream with id ${e.streamInfo.id} finished buffering`);const t=e.streamInfo.isLast;G&&t?(r.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),E.signalEndOfStream(G)):ve()}function ve(){if(!w)return;if(!w.getHasFinishedBuffering())return void w.checkAndHandleCompletedBuffering();const e=function(e=null){try{const t=e||w||null;if(t){const e=t.getStreamInfo();return M.filter(function(t){const n=t.getStreamInfo();return n.start>e.start&&e.id!==n.id})}}catch(e){return[]}}(w);let t=0;for(;t<e.length;){const n=e[t],r=0===t?w:e[t-1];!n.getPreloaded()&&r.getHasFinishedBuffering()&&Te(n,r),t+=1}}function Me(){$&&(clearInterval($),$=null)}function we(){return w?w.getStreamProcessors():[]}function Pe(e){if(w&&!w.getIsEndedEventSignaled()){w.setIsEndedEventSignaled(!0);const e=function(e=null){const t=e||w||null;if(!t)return null;const n=t.getStreamInfo(),r=n.start;let i=0,a=-1,o=NaN;for(;i<M.length;){const e=M[i].getStreamInfo(),t=e.start-r;t>0&&(isNaN(o)||t<o)&&n.id!==e.id&&(o=t,a=i),i+=1}return a>=0?M[a]:null}();e?(r.debug(`StreamController onEnded, found next stream with id ${e.getStreamInfo().id}. Switching from ${w.getStreamInfo().id} to ${e.getStreamInfo().id}`),le(e,w,NaN)):(r.debug("StreamController no next stream found"),w.setIsEndedEventSignaled(!1)),qe(e?cn.END_OF_PERIOD_STOP_REASON:cn.END_OF_CONTENT_STOP_REASON)}e&&e.isLast&&(Me(),_.stopSteeringRequestTimer())}function Oe(e){const t=e||ze().manifestInfo.duration;E.setDuration(t)}function Le(e){const t=I.getURIFragmentData();if(!t||!t.t)return NaN;const n=et()[0].getStreamInfo().start;return t.t=t.t.split(",")[0],Ue(e,t.t,n)}function Fe(e,t){let n=0;return e||(n=et()[0].getStreamInfo().start),Ue(e,t,n)}function Ue(e,t,n){const r=d.getRegularPeriods()[0],i=t.toString(),a=-1!==i.indexOf("posix:")?"now"===i.substring(6)?Date.now()/1e3:parseFloat(i.substring(6)):NaN;return e&&!isNaN(a)?v.calcPresentationTimeFromWallTime(new Date(1e3*a),r):parseFloat(i)+n}function xe(e){try{return e&&Number.isFinite(e.maxFragmentDuration)?e.maxFragmentDuration:NaN}catch(e){return NaN}}function Be(){const e=c.getValue();y.initialize(e)}function ke(e){if(e.error)k=!0,Ze();else{r.info("Manifest updated... updating data system wide.");const n=e.manifest;d.updatePeriods(n),a.filterUnsupportedFeatures(n).then(()=>{y.initialize(n);let e=d.getUTCTimingSources();!d.getIsDynamic()||e&&0!==e.length||t.trigger(p.default.CONFORMANCE_VIOLATION,{level:Gi.LEVELS.WARNING,event:Gi.EVENTS.NO_UTC_TIMING_ELEMENT});let r=d.getIsDynamic()?e.concat(K.getUTCTimingSources()):e;T.attemptSync(r,d.getIsDynamic()),F.createFinalQueryStrings(n)})}}function He(){return!!w&&w.getHasVideoTrack()}function Ye(){return!!w&&w.getHasAudioTrack()}
2function qe(e,t){t=t||new Date,we().forEach(n=>{n.finalisePlayList(t,e)}),m.addPlayList()}function Ve(e){m.createPlaylistMetrics(1e3*Y.getTime(),e)}function Ke(e){P.updateKeyStatusesMap(e),function(){const e=we();let r=!1;e.forEach(e=>{const t=e.getMediaInfo();!t||i.areKeyIdsUsable(t)?t&&i.areKeyIdsExpired(t)&&function(e){const t=$e(e.getStreamId());t&&t.triggerProtectionError({error:new Ge.default(qi.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,qi.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)})}(e):(r=!0,function(e){const t=e.getAllMediaInfos().filter(e=>i.areKeyIdsUsable(e));if(t&&0!==t.length)N.setTrack(t[0],{replaceBuffer:!0});else{const t=e.getType();D.error(new Ge.default(Ae.default.NO_SUPPORTED_KEY_IDS,`Type: ${t}: ${Ae.default.NO_SUPPORTED_KEY_IDS_MESSAGE}`))}}(e))}),r&&(0===Y.getTime()?t.once(p.default.FRAGMENT_LOADING_COMPLETED,()=>{je()},n):Y.isProgressing(500).then(e=>{e||je()}))}()}function je(){const e=Y.getTime();Y.seek(e+.01,!1,!1)}function We(e){if(!e.error)return;let t;switch(e.error.code){case 1:t="MEDIA_ERR_ABORTED";break;case 2:t="MEDIA_ERR_NETWORK";break;case 3:t="MEDIA_ERR_DECODE",te.counts.mediaErrorDecode+=1;break;case 4:t="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:t="MEDIA_ERR_ENCRYPTED";break;default:t="UNKNOWN"}"MEDIA_ERR_DECODE"===t&&X.get().errors.recoverAttempts.mediaErrorDecode>=te.counts.mediaErrorDecode?function(){r.error("A MEDIA_ERR_DECODE occured: Resetting the MediaSource");const e=Y.getTime();w.deactivate(!1),r.info(`MediaSource has been resetted. Resuming playback from time ${e}`),ue({seekTime:e,keepBuffers:!1,streamActivated:!1})}():(B=!0,e.error.message&&(t+=" ("+e.error.message+")"),e.error.msExtendedCode&&(t+=" (0x"+(e.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),r.fatal("Video Element Error: "+t),e.error&&r.fatal(e.error),D.error(new Ge.default(e.error.code,t)),Ze())}function ze(){return w?w.getStreamInfo():null}function $e(e){for(let t=0,n=M.length;t<n;t++)if(M[t].getId()===e)return M[t];return null}function Qe(e){isNaN(e.newDuration)||Oe(e.newDuration)}function Xe(){M=[],ee=NaN,P=null,x=!1,w=null,B=!1,k=!1,W=!0,z=!0,j=!1,U=!0,$=null,Z=!1,Q=[],J=null,te={counts:{mediaErrorDecode:0}}}function Ze(){ne(),T.reset(),qe(B||k?cn.FAILURE_STOP_REASON:cn.USER_REQUEST_STOP_REASON);for(let e=0,t=M?M.length:0;e<t;e++)M[e].reset(B);t.off(p.default.PLAYBACK_TIME_UPDATED,Ne,n),t.off(p.default.PLAYBACK_SEEKING,ge,n),t.off(p.default.PLAYBACK_ERROR,We,n),t.off(p.default.PLAYBACK_STARTED,Ce,n),t.off(p.default.PLAYBACK_PAUSED,be,n),t.off(p.default.PLAYBACK_ENDED,Pe,n),t.off(p.default.METRIC_ADDED,Je,n),t.off(p.default.MANIFEST_VALIDITY_CHANGED,Qe,n),t.off(p.default.BUFFER_LEVEL_UPDATED,Se,n),t.off(p.default.QUALITY_CHANGE_REQUESTED,Ie,n),t.off(p.default.CONTENT_STEERING_REQUEST_COMPLETED,Be,n),g.default.KEY_SESSION_UPDATED&&t.off(g.default.KEY_SESSION_UPDATED,ie,n),t.off(g.default.MANIFEST_UPDATED,ke,n),t.off(g.default.STREAM_BUFFERING_COMPLETED,De,n),t.off(g.default.TIME_SYNCHRONIZATION_COMPLETED,re,n),t.off(g.default.CURRENT_TRACK_CHANGED,me,n),t.off(g.default.SETTING_UPDATED_LIVE_DELAY,Re,n),t.off(g.default.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,Re,n),t.off(Yi.default.INTERNAL_KEY_STATUSES_CHANGED,Ke,n),y.reset(),s.reset(),C.reset(),m.clearAllCurrentMetrics(),c.setValue(null),u.reset(),v.reset(),b.reset(),G&&(E.detachMediaSource(H),G=null),H=null,P&&(P=null,L=null,c.getValue()&&t.trigger(g.default.PROTECTION_DESTROYED,{data:c.getValue().url})),Me(),t.trigger(g.default.STREAM_TEARDOWN_COMPLETE),Xe()}function Je(e){if(e.metric===o.DVR_INFO){const t=Ye()?h.default.AUDIO:h.default.VIDEO;e.mediaType===t&&E.setSeekable(e.value.range.start,e.value.range.end)}}function et(){return M}return n={addDVRMetric:ye,getActiveStream:function(){return w},getActiveStreamInfo:ze,getActiveStreamProcessors:we,getAutoPlay:function(){return U},getHasMediaOrInitialisationError:function(){return B||k},getInitialPlayback:function(){return W},getIsStreamSwitchInProgress:function(){return x},getProtectionData:function(){return P?P.getProtectionData():null},getStreamById:$e,getStreamForTime:_e,getStreams:et,getTimeRelativeToStreamId:function(e,t){let n=null,r=0,i=0,a=null;for(let o=0;o<M.length;o++){if(n=M[o],i=n.getStartTime(),a=n.getDuration(),Number.isFinite(i)&&(r=i),n.getId()===t)return e-r;Number.isFinite(a)&&(r+=a)}return null},hasAudioTrack:Ye,hasVideoTrack:He,initialize:function(r,i){ne(),U=r,L=i,v.initialize(),s=Qn(e).create(),s.setConfig({manifestModel:c,adapter:d,manifestLoader:u,errHandler:D,settings:X,contentSteeringController:_}),s.initialize(),C=ki(e).getInstance(),C.setConfig({manifestUpdater:s,playbackController:Y,settings:X}),C.start(),F=(0,Hi.default)(e).getInstance(),T.setConfig({dashMetrics:m,baseURLController:y,errHandler:D,settings:X}),T.initialize(),E.setConfig({settings:X}),P&&(t.trigger(g.default.PROTECTION_CREATED,{controller:P}),P.setMediaElement(H.getElement()),L&&P.setProtectionData(L)),t.on(p.default.PLAYBACK_TIME_UPDATED,Ne,n),t.on(p.default.PLAYBACK_SEEKING,ge,n),t.on(p.default.PLAYBACK_ERROR,We,n),t.on(p.default.PLAYBACK_STARTED,Ce,n),t.on(p.default.PLAYBACK_PAUSED,be,n),t.on(p.default.PLAYBACK_ENDED,Pe,n),t.on(p.default.METRIC_ADDED,Je,n),t.on(p.default.MANIFEST_VALIDITY_CHANGED,Qe,n),t.on(p.default.BUFFER_LEVEL_UPDATED,Se,n),t.on(p.default.QUALITY_CHANGE_REQUESTED,Ie,n),t.on(p.default.CONTENT_STEERING_REQUEST_COMPLETED,Be,n),g.default.KEY_SESSION_UPDATED&&t.on(g.default.KEY_SESSION_UPDATED,ie,n),t.on(g.default.MANIFEST_UPDATED,ke,n),t.on(g.default.STREAM_BUFFERING_COMPLETED,De,n),t.on(g.default.TIME_SYNCHRONIZATION_COMPLETED,re,n),t.on(g.default.CURRENT_TRACK_CHANGED,me,n),t.on(g.default.SETTING_UPDATED_LIVE_DELAY,Re,n),t.on(g.default.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,Re,n),t.on(Yi.default.INTERNAL_KEY_STATUSES_CHANGED,Ke,n)},load:function(e,t=NaN){ne(),ee=t,u.load(e)},loadWithManifest:function(e,t=NaN){!function(){if(!s||!s.hasOwnProperty("setManifest"))throw new Error("initialize function has to be called previously")}(),ee=t,s.setManifest(e)},refreshManifest:function(){s.getIsUpdating()||s.refreshManifest()},reset:Ze,setConfig:function(e){e&&(e.capabilities&&(i=e.capabilities),e.capabilitiesFilter&&(a=e.capabilitiesFilter),e.manifestLoader&&(u=e.manifestLoader),e.manifestModel&&(c=e.manifestModel),e.mediaPlayerModel&&(V=e.mediaPlayerModel),e.customParametersModel&&(K=e.customParametersModel),e.protectionController&&(P=e.protectionController),e.adapter&&(d=e.adapter),e.dashMetrics&&(m=e.dashMetrics),e.errHandler&&(D=e.errHandler),e.timelineConverter&&(v=e.timelineConverter),e.videoModel&&(H=e.videoModel),e.playbackController&&(Y=e.playbackController),e.throughputController&&(R=e.throughputController),e.serviceDescriptionController&&(q=e.serviceDescriptionController),e.contentSteeringController&&(_=e.contentSteeringController),e.textController&&(O=e.textController),e.abrController&&(A=e.abrController),e.mediaController&&(N=e.mediaController),e.settings&&(X=e.settings),e.baseURLController&&(y=e.baseURLController),e.uriFragmentModel&&(I=e.uriFragmentModel),e.segmentBaseController&&(S=e.segmentBaseController),e.manifestUpdater&&(s=e.manifestUpdater))},setProtectionData:function(e){L=e,P&&P.setProtectionData(L)},switchToVideoElement:function(e){w&&(Y.initialize(ze()),ue({seekTime:e,keepBuffers:!1,streamActivated:!0}))}},r=(0,l.default)(e).getInstance().getLogger(n),T=Fi(e).getInstance(),E=xi(e).getInstance(),b=Nt(e).getInstance(),Xe(),n}Vi.__dashjs_factory_name="StreamController";var Ki=r.default.getSingletonFactory(Vi),ji=class extends Ct{constructor(){super(),this.captionData=null,this.label=null,this.defaultTrack=!1,this.kind=null,this.isFragmented=!1,this.isEmbedded=!1,this.isTTML=null}},Wi=n(7377);function zi(){let e,t=0;function n(e){let t="";for(let n=0;n<e.length;++n)t+=e[n].uchar;return t.length-t.replace(/^\s+/,"").length}function r(e){return"left: "+3.125*e.x+"%; top: "+6.66*e.y1+"%; width: "+(100-3.125*e.x)+"%; height: "+6.66*Math.max(e.y2-1-e.y1,1)+"%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;"}function i(e){return"red"===e?"rgb(255, 0, 0)":"green"===e?"rgb(0, 255, 0)":"blue"===e?"rgb(0, 0, 255)":"cyan"===e?"rgb(0, 255, 255)":"magenta"===e?"rgb(255, 0, 255)":"yellow"===e?"rgb(255, 255, 0)":"white"===e?"rgb(255, 255, 255)":"black"===e?"rgb(0, 0, 0)":e}function a(e,t){const n=e.videoHeight/15;return t?"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: "+(t.foreground?i(t.foreground):"rgb(255, 255, 255)")+"; font-style: "+(t.italics?"italic":"normal")+"; text-decoration: "+(t.underline?"underline":"none")+"; white-space: pre; background-color: "+(t.background?i(t.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(e){return e.replace(/^\s+/g,"")}function s(e){return e.replace(/\s+$/g,"")}return e={createHTMLCaptionsFromScreen:function(e,i,l,u){let c=null,d=null,f=!1,g=-1,h={start:i,end:l,spans:[]},p="style_cea608_white_black";const m={},E={},T=[];let _,y;for(_=0;_<15;++_){const e=u.rows[_];let t="",r=null;if(!1===e.isEmpty()){const a=n(e.chars);null===c&&(c={x:a,y1:_,y2:_+1,p:[]}),a!==g&&f&&(c.p.push(h),h={start:i,end:l,spans:[]},c.y2=_,c.name="region_"+c.x+"_"+c.y1+"_"+c.y2,!1===m.hasOwnProperty(c.name)?(T.push(c),m[c.name]=c):(d=m[c.name],d.p.contat(c.p)),c={x:a,y1:_,y2:_+1,p:[]});for(let n=0;n<e.chars.length;++n){const i=e.chars[n],a=i.penState;
2if(null===r||!a.equals(r)){t.trim().length>0&&(h.spans.push({name:p,line:t,row:_}),t="");let e="style_cea608_"+a.foreground+"_"+a.background;a.underline&&(e+="_underline"),a.italics&&(e+="_italics"),E.hasOwnProperty(e)||(E[e]=JSON.parse(JSON.stringify(a))),r=a,p=e}t+=i.uchar}t.trim().length>0&&h.spans.push({name:p,line:t,row:_}),f=!0,g=a}else f=!1,g=-1,c&&(c.p.push(h),h={start:i,end:l,spans:[]},c.y2=_,c.name="region_"+c.x+"_"+c.y1+"_"+c.y2,!1===m.hasOwnProperty(c.name)?(T.push(c),m[c.name]=c):(d=m[c.name],d.p.contat(c.p)),c=null)}c&&(c.p.push(h),c.y2=_+1,c.name="region_"+c.x+"_"+c.y1+"_"+c.y2,!1===m.hasOwnProperty(c.name)?(T.push(c),m[c.name]=c):(d=m[c.name],d.p.contat(c.p)),c=null);const S=[];for(_=0;_<T.length;++_){const n=T[_],u="sub_cea608_"+t++,c=document.createElement("div");c.id=u;const d=r(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=a(e);const g=document.createElement("div");g.className="cueUniWrapper",g.style.cssText="unicode-bidi: normal; direction: ltr;";for(let t=0;t<n.p.length;++t){const r=n.p[t];let i=0;for(y=0;y<r.spans.length;++y){let t=r.spans[y];if(t.line.length>0){if(0!==y&&i!=t.row){const e=document.createElement("br");e.className="lineBreak",g.appendChild(e)}let n=!1;i===t.row&&(n=!0),i=t.row;const l=E[t.name],u=document.createElement("span");u.className="spanPadding "+t.name+" customSpanColor",u.style.cssText=a(e,l),0!==y&&n?y===r.spans.length-1?u.textContent=s(t.line):u.textContent=t.line:r.spans.length>1&&y<r.spans.length-1&&t.row===r.spans[y+1].row?u.textContent=o(t.line):u.textContent=t.line.trim(),g.appendChild(u)}}}f.appendChild(g),c.appendChild(f);const h={bodyStyle:["%",90]};for(const e in E)E.hasOwnProperty(e)&&(h[e]=["%",90]);S.push({type:"html",start:i,end:l,cueHTMLElement:c,cueID:u,cellResolution:[32,15],isFromCEA608:!0,fontSize:h,lineHeight:{},linePadding:{}})}return S}},e}zi.__dashjs_factory_name="EmbeddedTextHtmlRender";var $i=r.default.getSingletonFactory(zi),Qi=class{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n="function"==typeof t?t():t;console.log(`${this.time} [${e}] ${n}`)}}},Xi=class{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){for(const t of["foreground","underline","italics","background","flash"])Object.prototype.hasOwnProperty.call(e,t)&&(this[t]=e[t])}isDefault(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}},Zi=class{constructor(){this.uchar=" ",this.penState=new Xi}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return" "===this.uchar&&this.penState.isDefault()}};const Ji=100,ea={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499};function ta(e){return String.fromCharCode(ea[e]||e)}var na=class{constructor(e=new Qi){this.chars=[],this.cueStartTime=null,this.pos=0,this.currPenState=new Xi;for(let e=0;e<Ji;e++)this.chars.push(new Zi);this.logger=e}equals(e){for(let t=0;t<Ji;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<Ji;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<Ji;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}
2setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>Ji&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Ji)}moveCursor(e){const t=this.pos+e;if(e>1)for(let e=this.pos+1;e<t+1;e++)this.chars[e].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=ta(e);this.pos>=Ji?this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))}clearFromPos(e){let t;for(t=e;t<Ji;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let n=0;n<Ji;n++){const r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}};const ra=15;var ia=class{constructor(e=new Qi){this.rows=[],this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null;for(let t=0;t<ra;t++)this.rows.push(new na(e));this.logger=e}reset(){for(let e=0;e<ra;e++)this.rows[e].clear();this.currRow=14}equals(e){let t=!0;for(let n=0;n<ra;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<ra;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<ra;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,()=>"pacData = "+JSON.stringify(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let e=0;e<ra;e++)this.rows[e].clear();const e=this.currRow+1-this.nrRollUpRows,n=this.lastOutputScreen;if(n){const r=n.rows[e].cueStartTime,i=this.logger.time;if(null!==r&&null!==i&&r<i)for(let r=0;r<this.nrRollUpRows;r++)this.rows[t-this.nrRollUpRows+r+1].copy(n.rows[e+r])}}this.currRow=t;const n=this.rows[this.currRow];if(null!==e.indent){const t=e.indent,r=Math.max(t-1,0);n.setCursor(e.indent),e.color=n.chars[r].penState.foreground}const r={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(r)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(null===this.nrRollUpRows)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let n="",r=-1;for(let n=0;n<ra;n++){const i=this.rows[n].getTextString();i&&(r=n+1,e?t.push("Row "+r+": '"+i+"'"):t.push(i.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n}getTextAndFormat(){return this.rows}},aa=class{constructor(e,t,n=new Qi){this.chNr=e,this.outputFilter=t,this.mode=null,this.displayedMemory=new ia(n),this.nonDisplayedMemory=new ia(n),this.lastOutputScreen=new ia(n),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n,this.logger.log(2,"new Cea608Channel("+this.chNr+")")}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter?.reset?.(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.setRollUpRows(null),this.nonDisplayedMemory.setRollUpRows(null)),this.mode=e)}insertChars(e){for(const t of e)this.writeScreen.insertChar(t);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}
2ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};t.underline=e%2==1,t.italics=e>=46,t.italics?t.foreground="white":t.foreground=["white","green","blue","cyan","red","yellow","magenta"][Math.floor(e/2)-16],this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}};const oa=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];function sa(e,t,n){return n.a===e&&n.b===t}function la(e){const t=[];for(const n of e)t.push(n.toString(16));return t}const ua={17:2,18:4,21:6,22:8,23:10,19:13,20:15},ca={25:2,26:4,29:6,30:8,31:10,27:13,28:15},da={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},fa={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14};function ga(e,t,n){n.a=e,n.b=t}var ha=class{constructor(e,t,n){this.currentChannel=0,this.cmdHistory={a:null,b:null},this.lastTime=null;const r=this.logger=new Qi;this.channels=[null,new aa(e,t,r),new aa(e+1,n,r)]}addData(e,t){this.lastTime=e,this.logger.time=e;for(let n=0;n<t.length;n+=2){const r=127&t[n],i=127&t[n+1];let a=!1,o=null;if(null!==this.lastTime&&(e=this.lastTime+.5*n*1001/3e4,this.logger.time=e),0===r&&0===i)continue;this.logger.log(3,()=>"["+la([t[n],t[n+1]])+"] -> ("+la([r,i])+")");const s=this.cmdHistory;if(r>=16&&r<=31){if(sa(r,i,s)){ga(null,null,s),this.logger.log(3,()=>"Repeated command ("+la([r,i])+") is dropped");continue}ga(r,i,this.cmdHistory),a=this.parseCmd(r,i),a||(a=this.parseMidrow(r,i)),a||(a=this.parsePAC(r,i)),a||(a=this.parseBackgroundAttributes(r,i))}else ga(null,null,s);if(!a&&(o=this.parseChars(r,i),o.length)){const e=this.currentChannel;e&&e>0?this.channels[e].insertChars(o):this.logger.log(2,"No channel found yet. TEXT-MODE?")}a||o||this.logger.log(2,()=>"Couldn't parse cleaned data "+la([r,i])+" orig: "+la([t[n],t[n+1]]))}}parseCmd(e,t){if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=33&&t<=35))return!1;const n=20===e||21===e||23===e?1:2,r=this.channels[n];return 20===e||21===e||28===e||29===e?32===t?r.ccRCL():33===t?r.ccBS():34===t?r.ccAOF():35===t?r.ccAON():36===t?r.ccDER():37===t?r.ccRU(2):38===t?r.ccRU(3):39===t?r.ccRU(4):40===t?r.ccFON():41===t?r.ccRDC():42===t?r.ccTR():43===t?r.ccRTD():44===t?r.ccEDM():45===t?r.ccCR():46===t?r.ccENM():47===t&&r.ccEOC():r.ccTO(t-32),this.currentChannel=n,!0}parseMidrow(e,t){let n=0;if((17===e||25===e)&&t>=32&&t<=47){if(n=17===e?1:2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const r=this.channels[n];return!!r&&(r.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+la([e,t])+")"),!0)}return!1}parsePAC(e,t){let n;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127||(16===e||24===e)&&t>=64&&t<=95))return!1;const r=e<=23?1:2;n=t>=64&&t<=95?1===r?da[e]:fa[e]:1===r?ua[e]:ca[e];const i=this.channels[r];return!!i&&(i.setPAC(this.interpretPAC(n,t)),this.currentChannel=r,!0)}interpretPAC(e,t){let n;const r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>
295?t-96:t-64,r.underline=!(1&~n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r}parseChars(e,t){let n,r=[],i=null;if(e>=25?(n=2,i=e-8):(n=1,i=e),i>=17&&i<=19){let e;e=17===i?t+80:18===i?t+112:t+144,this.logger.log(2,()=>"Special char '"+ta(e)+"' in channel "+n),r=[e]}else e>=32&&e<=127&&(r=0===t?[e]:[e,t]);return r&&this.logger.log(3,()=>"Char codes =  "+la(r).join(",")),r}parseBackgroundAttributes(e,t){if(!((16===e||24===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=45&&t<=47))return!1;let n;const r={};16===e||24===e?(n=Math.floor((t-32)/2),r.background=oa[n],t%2==1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0));const i=e<=23?1:2;return this.channels[i].setBkgData(r),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}ga(null,null,this.cmdHistory)}cueSplitAtTime(e){for(const t of this.channels)t&&t.cueSplitAtTime(e)}};function pa(e,t,n){const r=[];for(let i=t;i<n;i++)i+2<n&&0===e.getUint8(i)&&0===e.getUint8(i+1)&&3===e.getUint8(i+2)?(r.push(0),r.push(0),i+=2):r.push(e.getUint8(i));return new DataView(new Uint8Array(r).buffer)}function ma(e,t,n,r){return!(4!==e||t<8)&&181===n.getUint8(r)&&49===n.getUint16(r+1)&&1195456820===n.getUint32(r+3)&&3===n.getUint8(r+7)}function Ea(e,t){return(127&e)>0||(127&t)>0}function Ta(e,t){const n=e.getUint8(t),r=31&n;if(6===r)return{nalType:r,headerSize:1};const i=n>>1&63;if(39===i||40===i)return{nalType:i,headerSize:2};if(t+1>=e.byteLength)return null;const a=e.getUint8(t+1)>>3&31;return 23===a||24===a?{nalType:a,headerSize:2}:null}function _a(e,t){let n=0;for(;n<e.byteLength-1;){let i,a=0,o=0;do{a+=i=e.getUint8(n++)}while(255===i);do{o+=i=e.getUint8(n++)}while(255===i);if(ma(a,o,e,n)){const i=n+10,a=i+3*(31&e.getUint8(i-2));for(let n=i;n<a;n+=3){const i=e.getUint8(n);if(4&i){const a=3&i;if(0===(r=a)||1===r){const r=e.getUint8(n+1),i=e.getUint8(n+2);Ea(r,i)&&t[a].push(r,i)}}}}n+=o}var r}function ya(e,t,n){let r=0;const i=[[],[]];for(let a=t;a<t+n-6;a++){r=e.getUint32(a);const o=a+4+r;if(o>t+n)break;const s=Ta(e,a+4);if(s){const t=a+4+s.headerSize;o<=e.byteLength&&_a(pa(e,t,o),i)}a+=r+3}return i}function Sa(e){const t=e.errHandler,n=e.manifestModel,r=e.mediaController,i=e.videoModel,a=e.textTracks,o=e.vttParser,s=e.vttCustomRenderingParser,u=e.ttmlParser,c=e.streamInfo,d=e.settings,p=this.context,m=(0,f.default)(p).getInstance();let E,T,_,y,S,I,A,N,C,b,D,v,M,w,P,O,L=!1;function F(){I=null,N=NaN,C=[],A=!1,S=[],y=null}function U(e){const t={};t[be.default.SUBTITLE]="subtitles",t[be.default.CAPTION]="captions",t[be.default.FORCED_SUBTITLE]="subtitles";const n=new ji;for(let t in e)n[t]=e[t];n.defaultTrack=function(e){let t=!1;return D.length>1&&e.isEmbedded?t=e.id&&e.id===h.default.CC1:1===D.length?e.id&&"string"==typeof e.id&&"CC"===e.id.substring(0,2)&&(t=!0):0===D.length&&(t=e.index===S[0].index),t}(e),n.isTTML=function(e){return e.codec&&e.codec.search(h.default.STPP)>=0||e.mimeType&&e.mimeType.search(h.default.TTML)>=0}(e),n.kind=function(e,t){let n=e.roles&&e.roles.length>0?t[e.roles[0].value]:t.caption;return n=Object.values(t).includes(n)?n:t.caption,n}(e,t),a.addTextTrackInfo(n)}function x(e){const t=e.chunk;t.representation.mediaInfo.embeddedCaptions&&k(t.bytes,t)}function B(e){b=e}function k(e,r){const i=r.representation.mediaInfo,s=i.type,l=i.mimeType,u=i.codec||l;u?-1!==i.codec.indexOf("application/mp4")?function(e,t,r){let i,s;if("InitializationSegment"===t.segmentType)A=!0,N=_.getMediaTimescaleFromMoov(e);else{if(!A)return;s=_.getSamplesInfo(e),i=s.sampleList,r.search(h.default.STPP)>=0?function(e,t,r){let i,o;for(y=null!==y?y:Y(r),i=0;i<t.length;i++){const r=t[i],s=r.cts,l=H(),u=l+s/N,c=u+r.duration/N;E.buffered.add(u,c);const d=new DataView(e,r.offset,r.subSizes[0]);let f=Ze.Utils.dataViewToString(d,h.default.UTF8);const g=[];let p=r.offset+r.subSizes[0];for(o=1;o<r.subSizes.length;o++){const t=new Uint8Array(e,p,r.subSizes[o]),n=String.fromCharCode.apply(null,t);g.push(n),p+=r.subSizes[o]}try{const e=n.getValue().ttmlTimeIsRelative?s/N:0,t=y.parse(f,e,s/N,(s+r.duration)/N,g);a.addCaptions(b,l,t)}catch(e){I.removeExecutedRequestsBeforeTime(),q(),T.error("TTML parser error: "+e)}}}(e,i,r):function(e,t){let n,r,i;const s=[];for(n=0;n<t.length;n++){const a=t[n],l=H()+a.cts/N,u=l+a.duration/N;E.buffered.add(l,u);const c=e.slice(a.offset,a.offset+a.size),d=Ze.parseBuffer(c);for(r=0;r<d.boxes.length;r++){const t=d.boxes[r];if(T.debug("VTT box1: "+t.type),"vtte"!==t.type&&"vttc"===t.type){T.debug("VTT vttc boxes.length = "+t.boxes.length);let n={styles:{}};for(i=0;i<t.boxes.length;i++){const r=t.boxes[i];if(T.debug("VTT box2: "+r.type),"payl"===r.type)n.start=a.cts/N,n.end=(a.cts+a.duration)/N,n.data=r.cue_text;else if("sttg"===r.type&&r.settings&&""!==r.settings)try{const e=r.settings.split(" ");n.styles=o.getCaptionStyles(e)}catch(e){}}n&&n.data&&(s.push(n),T.debug(`VTT  ${n.start} - ${n.end} :  ${n.data}`))}}}s.length>0&&a.addCaptions(b,0,s)}(e,i)}}(e,r,u):s===h.default.VIDEO?function(e,t){let n,r;if(t.segmentType===R.HTTPRequest.INIT_SEGMENT_TYPE)0===v&&(v=_.getMediaTimescaleFromMoov(e));else if(t.segmentType===R.HTTPRequest.MEDIA_SEGMENT_TYPE){if(0===v)return void T.warn("CEA-608: No timescale for embeddedTextTrack yet");r=_.getSamplesInfo(e);const i=r.lastSequenceNumber,o=Math.trunc(t.start),s=Math.trunc(t.end);if(P[0]||P[1]||function(){let e;for(let t=0;t<D.length;t++){if(e=a.getTrackIdxForId(D[t].id),-1===e)return void T.warn("CEA-608: data before track is ready.");const n=G(e);P[t]=new ha(t+1,{newCue:n},null)}}(),v){if(function(e,t,n,r,i){return null!==e&&null!==t&&null!==r&&null!==i&&(t===e?r!==i:t!==e+n)}(M,i,r.numSequences,w,o))for(n=0;n<P.length;n++)P[n]&&P[n].reset();const t=function(e,t){if(0===t.length)return null;const n={splits:[],fields:[[],[]]},r=new DataView(e);for(let e=0;e<t.length;
2e++){const i=t[e],a=ya(r,i.offset,i.size);let o=null,s=0;for(let e=0;e<2;e++)if(a[e].length>0){i.cts!==o?s=0:s+=1;const t=H();n.fields[e].push([i.cts+t*v,a[e],s]),o=i.cts}}return n.fields.forEach(function(e){e.sort(function(e,t){return e[0]===t[0]?e[2]-t[2]:e[0]-t[0]})}),n}(e,r.sampleList);for(let e=0;e<P.length;e++){const r=t.fields[e],i=P[e];if(i)for(n=0;n<r.length;n++)i.addData(r[n][0]/v,r[n][1])}M=i,w=s}}}(e,r):function(e,n,r){let i,o;const s=new DataView(e,0,e.byteLength);o=Ze.Utils.dataViewToString(s,h.default.UTF8);try{i=Y(r).parse(o,0),a.addCaptions(a.getCurrentTrackIdx(),0,i),E.buffered&&E.buffered.add(n.start,n.end)}catch(e){t.error(new Ge.default(Ae.default.TIMED_TEXT_ERROR_ID_PARSE_CODE,Ae.default.TIMED_TEXT_ERROR_MESSAGE_PARSE+e.message,o))}}(e,r,u):T.error("No text type defined")}function G(e){return function(t,n,r){let o;o=i.getTTMLRenderingDiv()?O.createHTMLCaptionsFromScreen(i.getElement(),t,n,r):[{start:t,end:n,data:r.getDisplayText(),styles:{}}],o&&a.addCaptions(e,0,o)}}function H(){return isNaN(E.timestampOffset)?0:E.timestampOffset}function Y(e){let t;return e.search(h.default.VTT)>=0?t=d.get().streaming.text.webvtt.customRenderingEnabled&&s?s:o:(e.search(h.default.TTML)>=0||e.search(h.default.STPP)>=0)&&(t=u),t}function q(e,t){void 0===e&&e===t&&(e=E.buffered.start(0),t=E.buffered.end(E.buffered.length-1)),E.buffered.remove(e,t),a.deleteCuesFromTrackIdx(b,e,t)}function V(e){D.forEach(function(t){const n=a.getTrackIdxForId(t.id);n>=0&&a.deleteCuesFromTrackIdx(n,e.from,e.to)})}return E={abort:function(){},addEmbeddedTrack:function(e){if(L&&e)if(e.id===h.default.CC1||e.id===h.default.CC3){for(let t=0;t<D.length;t++)if(D[t].id===e.id)return;D.push(e)}else T.warn("Embedded track "+e.id+" not supported!")},addMediaInfos:function(e,t,n){if(S=S.concat(t),e===h.default.TEXT&&t[0].isFragmented&&!t[0].isEmbedded){I=n,E.buffered=(0,Wi.default)(p).create(),C=r.getTracksFor(h.default.TEXT,c.id).filter(e=>e.isFragmented);const e=r.getCurrentTrackFor(h.default.TEXT,c.id);for(let t=0;t<C.length;t++)if(C[t]===e){B(t);break}}for(let e=0;e<t.length;e++)U(t[e])},append:k,getConfig:function(){return{fragmentModel:I,fragmentedTracks:C,videoModel:i}},getStreamId:function(){return c.id},initialize:function(){L||(D=[],b=null,v=0,P=[],M=null,w=null,L=!0,O=$i(p).getInstance(),m.on(g.default.VIDEO_CHUNK_RECEIVED,x,E),m.on(g.default.BUFFER_CLEARED,V,E))},remove:q,reset:function(){F(),S=[],_=null},resetEmbedded:function(){m.off(g.default.VIDEO_CHUNK_RECEIVED,x,E),m.off(g.default.BUFFER_CLEARED,V,E),a&&a.deleteAllTextTracks(),L=!1,D=[],P=[null,null],M=null,w=null},resetMediaInfos:function(){S=[]},setCurrentFragmentedTrackIdx:B},T=(0,l.default)(p).getInstance().getLogger(E),_=tt(p).getInstance(),F(),E}Sa.__dashjs_factory_name="TextSourceBuffer";var Ia=r.default.getClassFactory(Sa);class Aa{constructor(){this.root=null,this.size=0}addCue(e){const t={start:e.startTime,end:e.endTime,cue:e,maxEnd:e.endTime,left:null,right:null,height:1},[n,r]=this._insert(t,this.root);this.root=n,r&&this.size++}removeCue(e){const[t,n]=this._remove(e,this.root);return this.root=t,n&&this.size--,n}findCuesInRange(e,t){const n=[];return this._searchRange(this.root,e,t,n),n}findCuesAtTime(e){return this.findCuesInRange(e,e)}getAllCues(){const e=[];return this._inorderTraversal(this.root,e),e}getSize(){return this.size}clear(){this.root=null,this.size=0}_compareCues(e,t){return e.startTime!==t.startTime?e.startTime-t.startTime:e.endTime!==t.endTime?e.endTime-t.endTime:"undefined"!=typeof VTTCue&&e instanceof VTTCue&&t instanceof VTTCue||e.text&&t.text?e.text.localeCompare(t.text):0}_compareIntervals(e,t){return this._compareCues(e.cue,t.cue)}_insert(e,t){if(!t)return[e,!0];const n=this._compareIntervals(e,t);if(n<0){const[n]=this._insert(e,t.left);t.left=n}else{if(!(n>0))return[t,!1];{const[n]=this._insert(e,t.right);t.right=n}}t.height=1+Math.max(this._getHeight(t.left),this._getHeight(t.right)),t.maxEnd=Math.max(t.maxEnd,e.maxEnd);const r=this._getBalance(t);return r>1?(this._compareIntervals(e,t.left)<0||(t.left=this._leftRotate(t.left)),[this._rightRotate(t),!0]):r<-1?(this._compareIntervals(e,t.right)>0||(t.right=this._rightRotate(t.right)),[this._leftRotate(t),!0]):[t,!0]}
2_searchRange(e,t,n,r){e&&(this._overlaps(e,t,n)&&r.push(e.cue),e.left&&e.left.maxEnd>=t&&this._searchRange(e.left,t,n,r),e.right&&e.start<=n&&this._searchRange(e.right,t,n,r))}_inorderTraversal(e,t){e&&(this._inorderTraversal(e.left,t),t.push(e.cue),this._inorderTraversal(e.right,t))}_overlaps(e,t,n){if(n===t){const n=t;return e.start<=n&&n<e.end}return e.start<n&&t<e.end}_getHeight(e){return e?e.height:0}_getBalance(e){return e?this._getHeight(e.left)-this._getHeight(e.right):0}_leftRotate(e){const t=e.right,n=t.left;return t.left=e,e.right=n,e.height=1+Math.max(this._getHeight(e.left),this._getHeight(e.right)),t.height=1+Math.max(this._getHeight(t.left),this._getHeight(t.right)),e.maxEnd=Math.max(e.end,e.left?e.left.maxEnd:0,e.right?e.right.maxEnd:0),t.maxEnd=Math.max(t.end,t.left?t.left.maxEnd:0,t.right?t.right.maxEnd:0),t}_rightRotate(e){const t=e.left,n=t.right;return t.right=e,e.left=n,e.height=1+Math.max(this._getHeight(e.left),this._getHeight(e.right)),t.height=1+Math.max(this._getHeight(t.left),this._getHeight(t.right)),e.maxEnd=Math.max(e.end,e.left?e.left.maxEnd:0,e.right?e.right.maxEnd:0),t.maxEnd=Math.max(t.end,t.left?t.left.maxEnd:0,t.right?t.right.maxEnd:0),t}_remove(e,t){if(!t)return[null,!1];const n=this._compareCues(e,t.cue);if(n<0){const[n,r]=this._remove(e,t.left);return t.left=n,r&&this._updateNode(t),[t,r]}if(n>0){const[n,r]=this._remove(e,t.right);return t.right=n,r&&this._updateNode(t),[t,r]}if(t.left||t.right){if(t.left){if(t.right){const e=this._findMin(t.right);t.cue=e.cue,t.start=e.start,t.end=e.end;const[n]=this._remove(e.cue,t.right);return t.right=n,this._updateNode(t),[t,!0]}return[t.left,!0]}return[t.right,!0]}return[null,!0]}_findMin(e){for(;e.left;)e=e.left;return e}_updateNode(e){e.height=1+Math.max(this._getHeight(e.left),this._getHeight(e.right)),e.maxEnd=Math.max(e.end,e.left?e.left.maxEnd:0,e.right?e.right.maxEnd:0)}}var Ra=n(7640);const Na=["text","align","fontSize","id","isd","line","lineAlign","lineHeight","linePadding","position","positionAlign","region","size","snapToLines","vertical"];function Ca(e){const t=this.context,n=(0,f.default)(t).getInstance(),r=e.videoModel,i=e.streamInfo,a=e.settings;let o,s,u,c,d,m,E,T,_,y,S,I,A,R,N,C,b,D,v,M;const w=new Map;function P(e){const t=e.kind,n=void 0!==e.id?e.id:e.lang,i=e.lang,a=e.isTTML,o=e.isEmbedded;return r.addTextTrack(t,n,i,a,o)}function O(e,t,n,r,i,a){let o=0,s=0;e/t>n/r?(s=t,o=s/r*n):(o=e,s=o/n*r);let l=0,u=0,c=0,d=0;return o/s>i?(d=s,c=s*i):(c=o,d=o/i),l=(e-c)/2,u=(t-d)/2,a?{x:l+.1*c,y:u+.1*d,w:.8*c,h:.8*d}:{x:l,y:u,w:c,h:d}}function L(e,t){const i=r.getClientWidth(),a=r.getClientHeight(),o=r.getVideoWidth(),s=r.getVideoHeight(),l=r.getVideoRelativeOffsetTop(),u=r.getVideoRelativeOffsetLeft();if(0!==o&&0!==s){let r=o/s,c=!1;e.isFromCEA608&&(r=3.5/3,c=!0);const d=O.call(this,i,a,o,s,r,c),f=d.w,g=d.h,h=d.x,m=d.y;if(f!=_||g!=y||h!=E||m!=T||t){if(E=h+u,T=m+l,_=f,y=g,S){const e=S.style;e&&(e.left=E+"px",e.top=T+"px",e.width=_+"px",e.height=y+"px",e.zIndex=R&&document[R]||N?b:null,n.trigger(p.default.CAPTION_CONTAINER_RESIZE))}const t=e.activeCues;if(t){const e=t.length;for(let n=0;n<e;++n){const e=t[n];e.scaleCue(e)}}}}}function F(e){const t=_,n=y;let r,i,a,o,s;if(e.cellResolution){const l=[t/e.cellResolution[0],n/e.cellResolution[1]];if(e.linePadding)for(r in e.linePadding)if(e.linePadding.hasOwnProperty(r)){i=(e.linePadding[r]*l[0]).toString();const t=document.getElementsByClassName("spanPadding");for(let e=0;e<t.length;e++)t[e].style.cssText=t[e].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i),t[e].style.cssText=t[e].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i)}if(e.fontSize){for(r in e.fontSize)if(e.fontSize.hasOwnProperty(r)){"%"===e.fontSize[r][0]?a=e.fontSize[r][1]/100:"c"===e.fontSize[r][0]&&(a=e.fontSize[r][1]),i=(a*l[1]).toString(),s="defaultFontSize"!==r?document.getElementsByClassName(r):document.getElementsByClassName("paragraph");for(let e=0;e<s.length;e++)s[e].style.cssText=s[e].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i)}if(e.lineHeight)for(r in e.lineHeight)if(e.lineHeight.hasOwnProperty(r)){"%"===e.lineHeight[r][0]?o=e.lineHeight[r][1]/100:"c"===e.fontSize[r][0]&&(o=e.lineHeight[r][1]),i=(o*l[1]).toString(),s=document.getElementsByClassName(r);for(let e=0;e<s.length;e++)s[e].style.cssText=s[e].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+i)}}}if(e.isd){let t=document.getElementById(e.cueID);t&&S.removeChild(t),x(e)}}function U(e,t){const n=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/,r=/^#(.*)$/;if(n.test(t)){const r=n.exec(t),i=parseInt(r[4],10)-1;return"data:image/png;base64,"+btoa(e.images[i])}if(r.test(t)){const n=r.exec(t)[1];return"data:image/png;base64,"+e.embeddedImages[n]}return t}function x(e){if(S){oe.call(this);const t=document.createElement("div");S.appendChild(t),C=(0,Ra.renderHTML)(e.isd,t,function(t){return U(e,t)},S.clientHeight,S.clientWidth,a.get().streaming.text.imsc.displayForcedOnlyMode,function(e){s.info("renderCaption :",e)},C,a.get().streaming.text.imsc.enableRollUp),t.id=e.cueID,n.trigger(p.default.CAPTION_RENDERED,{captionDiv:t,currentTrackIdx:m})}}function B(e,t){const n=t.findCuesInRange(e.startTime-.1,e.endTime+.1);for(const t of n){if(k(e,t)&&G(e,t,Na))return t;if(k(t,e)&&G(e,t,Na))return t}return null}function k(e,t){return!!t&&t.endTime>=e.startTime}function G(e,t,n){for(let r=0;r<n.length;r++){const i=n[r];if(JSON.stringify(e[i])!==JSON.stringify(t[i]))return!1}return!0}function H(e,t){t&&t.forEach(t=>{t.kind&&"image"===t.kind&&(t.src=U(e,t.src)),H(e,t.contents)})}function Y(e,t,n){const r=Z(e),i=w.get(r),o=a.get().streaming.text.dispatchForManualRendering;if(r&&i&&Array.isArray(n)&&0!==n.length){for(let e=0;e<n.length;e++){let c=null;const d=n[e];if(r.cellResolution=d.cellResolution,r.isFromCEA608=d.isFromCEA608,isNaN(d.start)||isNaN(d.end)||(o?c=q(d,t):z(d)&&S?c=j(d,t,r):d.data&&(c=W(d,t,r))),c){if(a.get().streaming.text.extendSegmentedCues){const e=B(c,i.allCues);e&&(i.allCues.removeCue(e),u=c,(l=e).startTime=Math.min(l.startTime,u.startTime),l.endTime=Math.max(l.endTime,u.endTime),c=l)}i.allCues.addCue(c)}else s.error("Impossible to display subtitles. You might have missed setting a TTML rendering div via player.attachTTMLRenderingDiv(TTMLRenderingDiv)")}var l,u;re()}}function q(e,t){let n=$(e,t);return n.onenter=function(){z(e)&&M&&M.cueID!==n.cueID&&K(M),delete n.type,M=n,V(n)},n.onexit=function(){K(n),M=null},n}function V(e){n.trigger(p.default.CUE_ENTER,e)}function K(e){n.trigger(p.default.CUE_EXIT,{cueID:e.cueID})}function j(e,t,r){const i=this;let a=$(e,t);return S.style.left=E+"px",S.style.top=T+"px",S.style.width=_+"px",S.style.height=y+"px",a.onenter=function(){r.mode===h.default.TEXT_SHOWING&&(this.isd?(v?requestAnimationFrame(()=>x(this)):x(this),s.debug("Cue enter id:"+this.cueID)):(S.appendChild(this.cueHTMLElement),F.call(i,this),n.trigger(p.default.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:m})))},a.onexit=function(){if(S){const e=S.childNodes;for(let t=0;t<e.length;++t)e[t].id===this.cueID&&(s.debug("Cue exit id:"+e[t].id),S.removeChild(e[t]),--t)}},a}function W(e,t,r){let i=$(e,t);
2if(e.styles)try{void 0!==e.styles.align&&"align"in i&&(i.align=e.styles.align),void 0!==e.styles.line&&"line"in i&&(i.line=e.styles.line),void 0!==e.styles.lineAlign&&(i.lineAlign=e.styles.lineAlign),void 0!==e.styles.snapToLines&&"snapToLines"in i&&(i.snapToLines=e.styles.snapToLines),void 0!==e.styles.position&&"position"in i&&(i.position=e.styles.position),void 0!==e.styles.positionAlign&&(i.positionAlign=e.styles.positionAlign),void 0!==e.styles.size&&"size"in i&&(i.size=e.styles.size)}catch(e){s.error(e)}return i.onenter=function(){r.mode===h.default.TEXT_SHOWING&&n.trigger(p.default.CAPTION_RENDERED,{currentTrackIdx:m})},i}function z(e){return"html"===e.type}function $(e,t){return z(e)?function(e,t){let n=new u(e.start+t,e.end+t,"");return n.cueHTMLElement=e.cueHTMLElement,n.isd=e.isd,n.images=e.images,n.embeddedImages=e.embeddedImages,n.cueID=e.cueID,n.scaleCue=F.bind(self),n.cellResolution=e.cellResolution,n.lineHeight=e.lineHeight,n.linePadding=e.linePadding,n.fontSize=e.fontSize,n.isd&&H(n,n.isd.contents),n}(e,t):function(e,t){let n=new u(e.start-t,e.end-t,e.data);return n.cueID=we.default.generateUuid(),n}(e,t)}function Q(e){if(I){const t=I.childNodes;for(let n=0;n<t.length;++n)t[n].id===e.cueID&&(I.removeChild(t[n]),--n)}}function X(){const e=r.getTextTracks(),t=[];for(const n of e)n.manualMode===h.default.TEXT_SHOWING&&t.push(n);return t}function Z(e){return e>=0&&c[e]?r.getTextTrack(c[e].kind,c[e].id,c[e].lang,c[e].isTTML,c[e].isEmbedded):null}function J(e){if(e===m)return;m=e;const t=Z(m);ee.call(this,t),A&&(clearInterval(A),A=null),t&&"html"===t.renderingType&&(L.call(this,t,!0),window.ResizeObserver?(D=new window.ResizeObserver(()=>{L.call(this,t,!0)}),D.observe(r.getElement())):A=setInterval(L.bind(this,t),500))}function ee(e){oe.call(this),e&&"html"===e.renderingType?ie.call(this):ae.call(this)}function te(e,t,n,r=!0){return!!e&&(isNaN(t)||(r?e.startTime:e.endTime)>=t)&&(isNaN(n)||(r?e.endTime:e.startTime)<=n)}function ne(e,t,n,r=!0){if(!e)return;if(e.cues&&e.cues.length>0)for(let i=e.cues.length-1;i>=0;i--)te(e.cues[i],t,n,r)&&(e.cues[i].onexit&&e.cues[i].onexit(),e.removeCue(e.cues[i]));const i=w.get(e);if(i){const e=i.activeCues,r=e.filter(e=>e.startTime>=t&&e.endTime<=n);r.forEach(e=>{a.get().streaming.text.dispatchForManualRendering?K(e):Q(e)}),i.activeCues=e.filter(e=>!r.includes(e))}}function re(){for(const e of w.values())e.lastCueWindowUpdate=-1/0}function ie(){let e=document.getElementById("native-cue-style");if(e)return;e=document.createElement("style"),e.id="native-cue-style",document.head.appendChild(e);const t=e.sheet,n=r.getElement();try{n&&(n.id?t.insertRule("#"+n.id+"::cue {background: transparent}",0):0!==n.classList.length?t.insertRule("."+n.className+"::cue {background: transparent}",0):t.insertRule("video::cue {background: transparent}",0))}catch(e){s.info(""+e.message)}}function ae(){const e=document.getElementById("native-cue-style");e&&document.head.removeChild(e)}function oe(){if(S)for(;S.firstChild;)S.removeChild(S.firstChild)}function se(){return c}return o={addCaptions:Y,addTextTrackInfo:function(e){c.push(e)},createTracks:function(){c.sort(function(e,t){return e.index-t.index}),S=r.getTTMLRenderingDiv(),I=r.getVttRenderingDiv();let e=-1;for(let t=0;t<c.length;t++){const r=P(c[t]);d.push(r),c[t].defaultTrack&&(r.default=!0,e=t);const i=Z(t);i&&(i.mode=h.default.TEXT_SHOWING,S&&(c[t].isTTML||c[t].isEmbedded)?i.renderingType="html":i.renderingType="default",w.set(i,{allCues:new Aa,lastCueWindowUpdate:-1/0,activeCues:[]})),Y(t,0,c[t].captionData),n.trigger(p.default.TEXT_TRACK_ADDED)}if(J.call(this,e),e>=0){let t=function(){const r=Z(e);r&&"html"===r.renderingType&&L.call(this,r,!0),n.off(p.default.PLAYBACK_METADATA_LOADED,t,this)};n.on(p.default.PLAYBACK_METADATA_LOADED,t,this);for(let t=0;t<c.length;t++){const n=Z(t);if(n){const r=a.get().streaming.text.dispatchForManualRendering;n.mode=t!==e||r?h.default.TEXT_HIDDEN:h.default.TEXT_SHOWING,n.manualMode=t===e?h.default.TEXT_SHOWING:h.default.TEXT_HIDDEN}}}n.trigger(g.default.TEXT_TRACKS_QUEUE_INITIALIZED,{index:m,tracks:c,streamId:i.id})},deleteAllTextTracks:function(){const e=d?d.length:0;for(let t=0;t<e;t++){const e=Z(t);e&&ne.call(this,e,i.start,i.start+i.duration,!1)}d=[],c=[],A&&(clearInterval(A),A=null),D&&r&&(D.unobserve(r.getElement()),D=null),m=-1,oe.call(this),w.clear()},deleteCuesFromTrackIdx:function(e,t,n){const r=Z(e);r&&ne(r,t,n)},disableManualTracks:function(){const e=X();if(e&&e.length>0){const t=e[0],n=w.get(t);if(!n)return;
2n.activeCues.forEach(e=>{a.get().streaming.text.dispatchForManualRendering?K(e):Q(e)}),n.activeCues=[]}},getCurrentTrackIdx:function(){return m},getCurrentTextTrackInfo:function(){return c[m]},getStreamId:function(){return i.id},getTextTrackInfos:se,getTrackIdxForId:function(e){let t=-1;for(let n=0;n<c.length;n++)if(c[n].id===e){t=n;break}return t},initialize:function(){"undefined"!=typeof window&&"undefined"!=typeof navigator&&(u=window.VTTCue||window.TextTrackCue,c=[],d=[],m=-1,E=0,T=0,_=0,y=0,S=null,I=null,A=null,N=!1,b=2147483647,C=null,v="requestAnimationFrame"in window,w.clear(),void 0!==document.fullscreenElement?R="fullscreenElement":void 0!==document.webkitIsFullScreen?R="webkitIsFullScreen":document.msFullscreenElement?R="msFullscreenElement":document.mozFullScreen&&(R="mozFullScreen"))},manualCueProcessing:function(e){const t=X();if(t&&t.length>0){const n=t[0],r=w.get(n);if(!r)return;const i=r.activeCues,o=r.allCues.findCuesAtTime(e),s=i.filter(e=>!o.includes(e)),l=o.filter(e=>!i.includes(e));s.forEach(e=>{a.get().streaming.text.dispatchForManualRendering?K(e):Q(e)}),l.forEach(e=>{a.get().streaming.text.dispatchForManualRendering?V(e):WebVTT.processCues(window,[e],I,e.cueID)}),r.activeCues=o}},setCurrentTrackIdx:J,setModeForTrackIdx:function(e,t){const n=Z(e);n&&n.mode!==t&&(n.mode=t),n&&n.manualMode!==t&&(n.manualMode=t)},updateTextTrackWindow:function(e,t=!1){const n=se(),i=a.get().streaming.text.webvtt.customRenderingEnabled;for(let o=0;o<n.length;o++){const s=n[o],l=Z(o),u=w.get(l);if(!l||!u)continue;if(!s.isEmbedded&&i)continue;const{bufferToKeep:c,bufferPruningInterval:d}=a.get().streaming.buffer,f=Date.now();if((f-u.lastCueWindowUpdate)/1e3<d&&!t)continue;const g=r.getPlaybackRate()||1,p=Math.max(0,e-c/g),m=e+2*d/g;if(l.cues)for(;l.cues.length>0;)l.removeCue(l.cues[0]);l.mode!==h.default.TEXT_DISABLED&&u.allCues.findCuesInRange(p,m).forEach(e=>{l.addCue(e)}),u.lastCueWindowUpdate=f}},invalidateCueWindow:re},s=(0,l.default)(t).getInstance().getLogger(o),o}Ca.__dashjs_factory_name="TextTracks";var ba=r.default.getClassFactory(Ca);function Da(){const e=this.context;let t,n,r,i,a,o;function s(e){const t=e.split(":"),n=t.length-1;return e=60*parseInt(t[n-1],10)+parseFloat(t[n]),2===n&&(e+=3600*parseInt(t[0],10)),e}function u(e){const t=e.split(i),n=t[1].split(o);return n.shift(),t[1]=n[0],n.shift(),{cuePoints:t,styles:c(n)}}function c(e){const t={};return e.forEach(function(e){const n=e.split(":");if(n.length>1){const[e,r]=n;switch(e){case"align":case"A":t.align=r;break;case"line":case"L":const[e,n]=r.split(","),i=e.endsWith("%");t.line="auto"===e?e:parseInt(e,10),i&&(t.snapToLines=!1),n&&(t.lineAlign=n);break;case"position":case"P":const[a,o]=r.split(",");t.position=parseInt(a,10),o&&(t.positionAlign=o);break;case"size":case"S":t.size=parseInt(r,10)}}}),t}function d(e,t){let n,r=t,a="",o="";for(;""!==e[r]&&r<e.length;)r++;if(n=r-t,n>1)for(let r=0;r<n;r++){if(o=e[t+r],o.match(i)){a="";break}a+=o,r!==n-1&&(a+="\n")}else o=e[t],o.match(i)||(a=o);return a}return t={parse:function(e){const t=[];let o,l;if(!e)return t;o=(e=e.split(r)).length,l=-1;for(let r=0;r<o;r++){let o=e[r];if(o.length>0&&"WEBVTT"!==o&&o.match(i)){const i=u(o),c=i.cuePoints,f=i.styles,g=d(e,r+1),h=s(c[0].replace(a,"")),p=s(c[1].replace(a,""));!isNaN(h)&&!isNaN(p)&&h>=l&&p>h?""!==g?(l=h,t.push({start:h,end:p,data:g,styles:f})):n.error("Skipping cue due to empty/malformed cue text"):n.error("Skipping cue due to incorrect cue timing")}}return t},getCaptionStyles:c},n=(0,l.default)(e).getInstance().getLogger(t),r=/(?:\r\n|\r|\n)/gm,i=/-->/,a=/(^[\s]+|[\s]+$)/g,o=/\s\b/g,t}Da.__dashjs_factory_name="VTTParser";var va=r.default.getSingletonFactory(Da);function Ma(){let e,t;return e={parse:function(e){let n=[];return t.oncue=function(e){e.start=e.startTime,e.end=e.endTime,e.data=e.text,e.styles={align:e.align,line:e.line,position:e.position,size:e.size},n.push(e)},t.parse(e),n}},function(){try{window&&window.WebVTT&&window.WebVTT.Parser&&(t=new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder()))}catch(e){}}(),e}Ma.__dashjs_factory_name="VttCustomRenderingParser";var wa=r.default.getSingletonFactory(Ma);function Pa(){const e=this.context,t=(0,f.default)(e).getInstance();let n,r,i=0;function a(){const e="cue_TTML_"+i;return i++,e}return n={parse:function(e,n,i,o,s){let l="";const u=[];let c,d,f;const h={},m={};let E="",T="",_={onOpenTag:function(e,n,i){if(i[" imagetype"]&&!i[" imageType"]&&(t.trigger(p.default.CONFORMANCE_VIOLATION,{level:Gi.LEVELS.ERROR,event:Gi.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),i[" imageType"]=i[" imagetype"]),"image"===n&&("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"===e||"http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"===e)){if(!i[" imageType"]||"PNG"!==i[" imageType"].value)return void r.warn("smpte-tt imageType != PNG. Discarded");E=i["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){E&&(m[E]=T.trim()),T="",E=""},onText:function(e){E&&(T+=e)}};if(!e)throw l="no ttml data to parse",new Error(l);h.data=e,t.trigger(g.default.TTML_TO_PARSE,h);let y=(0,Ra.fromXML)(h.data,function(e){l=e},_);t.trigger(g.default.TTML_PARSED,{ttmlString:h.data,ttmlDoc:y});const S=y.getMediaTimeEvents();for(f=0;f<S.length;f++){let e=(0,Ra.generateISD)(y,S[f],function(e){l=e});e.contents.some(e=>e.contents.length)&&(c=S[f]+n,d=f+1<S.length?S[f+1]+n:o,c<d&&u.push({start:c,end:d,type:"html",cueID:a(),isd:e,images:s,embeddedImages:m}))}if(""!==l)throw r.error(l),new Error(l);return u}},r=(0,l.default)(e).getInstance().getLogger(n),n}Pa.__dashjs_factory_name="TTMLParser";var Oa=r.default.getSingletonFactory(Pa);function La(e){let t=this.context;const n=(0,f.default)(t).getInstance(),r=(0,De.default)(t).getInstance(),i=e.adapter,a=e.baseURLController;let o,s,u;function c(e,t){let n,o,s=!1;if(a.resolve()){const t=i.getVoRepresentations(e);t&&t.length>0&&(n=a.resolve(t[0].path).url)}const l=e.essentialProperties.filter(e=>e.schemeIdUri&&e.schemeIdUri===h.default.FONT_DOWNLOAD_DVB_SCHEME),c=e.supplementalProperties.filter(e=>e.schemeIdUri&&e.schemeIdUri===h.default.FONT_DOWNLOAD_DVB_SCHEME);l.length>0?(s=!0,o=l):o=c,o.forEach(i=>
2{if(function(e){return!(!(e.value&&1===parseInt(e.value)&&e.dvbUrl&&e.dvbUrl.length>0&&e.dvbFontFamily&&e.dvbFontFamily.length>0&&e.dvbMimeType)||e.dvbMimeType!==h.default.OFF_MIMETYPE&&e.dvbMimeType!==h.default.WOFF_MIMETYPE)}(i)){let l=(a=i.dvbUrl,o=n,r.isPathAbsolute(a)?a:r.isRelative(a)?o?r.resolve(a,o):r.resolve(a):a);u.push({fontFamily:i.dvbFontFamily,url:l,mimeType:i.dvbMimeType,trackId:e.id,streamId:t,isEssential:s,status:"unloaded",fontFace:new FontFace(i.dvbFontFamily,`url(${l})`,{display:"swap"})})}var a,o})}function d(e,t){const n=u[e];u[e]={...n,status:t}}function g(){u=[]}return o={addFontsFromTracks:function(e,t){if(e&&Array.isArray(e)&&t)for(let n=0;n<e.length;n++)c(e[n],t)},downloadFonts:function(){for(let e=0;e<u.length;e++){let t=u[e];document.fonts.add(t.fontFace),n.trigger(p.default.DVB_FONT_DOWNLOAD_ADDED,t),t.fontFace.load().then(()=>{d(e,"loaded"),n.trigger(p.default.DVB_FONT_DOWNLOAD_COMPLETE,t)},r=>{d(e,"error"),s.debug("Font download error: ",r),n.trigger(p.default.DVB_FONT_DOWNLOAD_FAILED,t)})}},getFonts:function(){return u},getFontsForTrackId:function(e){return u.filter(t=>t.trackId&&t.trackId===e)},reset:function(){!function(){for(const e of u){let t=document.fonts.delete(e.fontFace);s.debug(`Removal of fontFamily: ${e.fontFamily} was ${t?"successful":"unsuccessful"}`)}}(),g()}},s=(0,l.default)(t).getInstance().getLogger(o),g(),o}La.__dashjs_factory_name="DVBFonts";var Fa=r.default.getClassFactory(La);function Ua(e){let t=this.context;const n=e.adapter,r=e.errHandler,i=e.manifestModel,a=e.mediaController,o=e.baseURLController,s=e.videoModel,u=e.settings;let c,d,m,E,T,_,y,S,I,A,R,N,C,b;function D(e){if(b.error(`Could not download ${e.isEssential?"an essential":"a"} font - fontFamily: ${e.fontFamily}, url: ${e.url}`),e.isEssential){let t=E[e.streamId].getTrackIdxForId(e.trackId);E[e.streamId].setModeForTrackIdx(t,h.default.TEXT_DISABLED)}}function v(e){if(b.debug(`Successfully downloaded ${e.isEssential?"an essential":"a"} font - fontFamily: ${e.fontFamily}, url: ${e.url}`),e.isEssential){let t=E[e.streamId].getTrackIdxForId(e.trackId);t===E[e.streamId].getCurrentTrackIdx()?E[e.streamId].setModeForTrackIdx(t,h.default.TEXT_SHOWING):E[e.streamId].setModeForTrackIdx(t,h.default.TEXT_HIDDEN)}}function M(e){let t=e.tracks,n=e.index;const r=e.streamId;if(!1===u.get().streaming.text.defaultEnabled&&!F()||N)U(r,-1);else{const e=a.getCurrentTrackFor(h.default.TEXT,r);if(e){const i={lang:e.lang,role:e.roles[0],index:e.index,codec:e.codec,accessibility:e.accessibility[0]};t.some((e,t)=>{if(a.matchSettings(i,e))return U(r,t),n=t,!0})}I=!1}d[r].lastEnabledIndex=n,S.trigger(p.default.TEXT_TRACKS_ADDED,{enabled:F(),index:n,tracks:t,streamId:r}
2),R=!0,C.addFontsFromTracks(t,r),C.getFonts().forEach(e=>{if(e.isEssential){let t=E[e.streamId].getTrackIdxForId(e.trackId);E[e.streamId].setModeForTrackIdx(t,h.default.TEXT_DISABLED)}}),C.downloadFonts()}function w(e){try{const t=e.streamId,n=E[t];if(!n||isNaN(e.time))return;n.updateTextTrackWindow(e.time),u.get().streaming.text.webvtt.customRenderingEnabled&&n.manualCueProcessing(e.time)}catch(e){}}function P(e){try{const t=e.streamId;if(!E[t])return;E[t].disableManualTracks()}catch(e){}}function O(e){try{const t=E[e.streamId];if(!t)return;const n=s.getTime()||0;t.updateTextTrackWindow(n,!0)}catch(e){b.error(e)}}function L(e){try{if(!e||!e.mediaType||e.mediaType!==h.default.AUDIO||!e.currentMediaInfo)return;const t=E[e.streamId].getCurrentTextTrackInfo();let n=NaN;I?n=x(e.streamId):B(t)&&e.currentMediaInfo.lang&&e.currentMediaInfo.lang!==t.lang&&(n=x(e.streamId),isNaN(n)&&(n=-1)),isNaN(n)||U(e.streamId,n)}catch(e){b.error(e)}}function F(){let e=!0;return I&&!A&&(e=!1),e}function U(e,t){I=-1===t,I&&S.trigger(g.default.BUFFER_LEVEL_UPDATED,{mediaType:h.default.TEXT,bufferLevel:-1},{streamId:e,mediaType:h.default.TEXT}),I&&a&&a.saveTextSettingsDisabled();let n=k(e);if(n===t||!E[e])return;E[e].disableManualTracks(),E[e].invalidateCueWindow();let r=E[e].getCurrentTextTrackInfo(),i=r?s.getTextTrack(r.kind,r.id,r.lang,r.isTTML,r.isEmbedded):null;i&&i.mode!==h.default.TEXT_DISABLED&&E[e].setModeForTrackIdx(n,h.default.TEXT_HIDDEN),E[e].setCurrentTrackIdx(t),r=E[e].getCurrentTextTrackInfo();const o=u.get().streaming.text.dispatchForManualRendering;if(r&&!o&&r.mode!==h.default.TEXT_DISABLED&&E[e].setModeForTrackIdx(t,h.default.TEXT_SHOWING),r&&r.isFragmented&&!r.isEmbedded)!function(e,t,n){if(!m[e])return;let r=m[e].getConfig().fragmentedTracks;for(let i=0;i<r.length;i++){let o=r[i];if(t.lang===o.lang&&(o.id?t.id===o.id:t.index===o.index)){let t=a.getCurrentTrackFor(h.default.TEXT,e);(o.id?t.id!==o.id:t.index!==o.index)?(E[e].deleteCuesFromTrackIdx(n),m[e].setCurrentFragmentedTrackIdx(i)):-1===n&&S.trigger(g.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,{},{streamId:e,mediaType:h.default.TEXT})}}}(e,r,n);else if(r&&!r.isFragmented)!function(e,t){S.trigger(g.default.SET_NON_FRAGMENTED_TEXT,{currentTrackInfo:t},{streamId:e,mediaType:h.default.TEXT})}(e,r);else if(!r&&I){const t=x(e);return void(isNaN(t)||U(e,t))}a.setTrack(r)}function x(e){const t=function(e){return E[e].getTextTrackInfos().filter((e,t)=>(e._indexToSelect=t,!!(e&&e.roles&&e.roles.length>0)&&B(e)))}(e);if(!t||t.length<=0)return NaN;const n=a.getCurrentTrackFor(h.default.AUDIO,e);if(!n)return NaN;const r=t.find(e=>n.lang===e.lang);return r?r._indexToSelect:NaN}function B(e){return!(!e||!e.roles||0===e.roles.length)&&e.roles.some(e=>e.schemeIdUri===h.default.DASH_ROLE_SCHEME_ID&&e.value===be.default.FORCED_SUBTITLE)}function k(e){return E[e].getCurrentTrackIdx()}function G(){m={},E={},d={},I=!0,R=!1,N=!1}return c={addEmbeddedTrack:function(e,t){const n=e.id;m[n]&&m[n].addEmbeddedTrack(t)},addMediaInfosToBuffer:function(e,t,n,r=null){const i=e.id;m[i]&&m[i].addMediaInfos(t,n,r)},createTracks:function(e){const t=e.id;E[t]&&E[t].createTracks()},deactivateStream:function(e){if(!e)return;const t=e.id;m[t]&&m[t].resetMediaInfos(),E[t]&&E[t].deleteAllTextTracks()},enableForcedTextStreaming:function(e){return(0,He.checkParameterType)(e,"boolean"),A=e,!0},enableText:function(e,t){return(0,He.checkParameterType)(t,"boolean"),F()!==t&&(t&&U(e,d[e].lastEnabledIndex),t||(d[e].lastEnabledIndex=k(e),R?U(e,-1):N=!0)),!0},getAllTracksAreDisabled:function(){return I},getCurrentTrackIdx:k,getTextSourceBuffer:function(e){const t=e.id;if(m&&m[t])return m[t]},initialize:function(){C=Fa(t).create({adapter:n,baseURLController:o}),S.on(g.default.TEXT_TRACKS_QUEUE_INITIALIZED,M,c),S.on(g.default.DVB_FONT_DOWNLOAD_FAILED,D,c),S.on(g.default.DVB_FONT_DOWNLOAD_COMPLETE,v,c),S.on(g.default.MEDIAINFO_UPDATED,L,c),S.on(g.default.PLAYBACK_TIME_UPDATED,w,c),u.get().streaming.text.webvtt.customRenderingEnabled&&S.on(g.default.PLAYBACK_SEEKING,P,c),S.on(g.default.PLAYBACK_SEEKED,O,c)},initializeForStream:function(e){const o=e.id,l=ba(t).create({videoModel:s,settings:u,streamInfo:e});l.initialize(),E[o]=l;const c=Ia(t).create({errHandler:r,adapter:n,dvbFonts:C,manifestModel:i,mediaController:a,videoModel:s,textTracks:l,vttParser:T,vttCustomRenderingParser:_,ttmlParser:y,streamInfo:e,settings:u});c.initialize(),m[o]=c,d[o]={},d[o].lastEnabledIndex=-1}
2,isTextEnabled:F,reset:function(){Object.keys(m).forEach(e=>{m[e].resetEmbedded(),m[e].reset()}),C.reset(),G(),S.off(g.default.TEXT_TRACKS_QUEUE_INITIALIZED,M,c),S.off(g.default.DVB_FONT_DOWNLOAD_FAILED,D,c),S.off(g.default.DVB_FONT_DOWNLOAD_COMPLETE,v,c),S.off(g.default.MEDIAINFO_UPDATED,L,c),S.off(g.default.PLAYBACK_TIME_UPDATED,w,c),u.get().streaming.text.webvtt.customRenderingEnabled&&S.off(g.default.PLAYBACK_SEEKING,P,c),S.off(g.default.PLAYBACK_SEEKED,O,c)},setTextTrack:U,clearDataForStream:function(e){m[e]&&(m[e].resetEmbedded(),m[e].reset(),delete m[e]),E[e]&&(E[e].deleteAllTextTracks(),delete E[e]),d[e]&&delete d[e]}},A=!1,R=!1,N=!1,T=va(t).getInstance(),_=wa(t).getInstance(),y=Oa(t).getInstance(),S=(0,f.default)(t).getInstance(),b=(0,l.default)(t).getInstance().getLogger(c),G(),c}Ua.__dashjs_factory_name="TextController";var xa=r.default.getClassFactory(Ua);function Ba(e){e=e||{};const t=this.context,n=(0,l.default)(t).getInstance(),r=e.settings,i=(0,f.default)(t).getInstance();let a,o,s,u,c,d;function g(){return navigator&&navigator.connection&&!isNaN(navigator.connection.downlink)&&navigator.connection.downlink>0?1e3*navigator.connection.downlink:NaN}function m(e,t,n,r){const i=Math.pow(.5,n/r.fast);e.fastEstimate=(1-i)*t+i*e.fastEstimate;const a=Math.pow(.5,n/r.slow);e.slowEstimate=(1-a)*t+a*e.slowEstimate,e.totalWeight+=n}function E(){a={},o={},s={},u={}}const T={addEntry:function(e,t){try{if(!(e&&t&&t.trace&&t.trace.length))return;!function(e){a[e]=a[e]||[],o[e]=o[e]||[],s[e]=s[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0},u[e]=u[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}(e);const n=t.tresponse.getTime()-t.trequest.getTime()||1;let l=function(e,t){return e._fileLoaderType&&e._fileLoaderType===h.default.FILE_LOADER_TYPES.FETCH?function(e){const t=e.trace.reduce((e,t)=>e+t.b[0],0),n=e.trace.reduce((e,t)=>e+t.d,0);let i=NaN;return r.get().streaming.abr.throughput.useNetworkInformationApi.fetch&&(i=g()),isNaN(i)&&(i=Math.round(8*t/n)),{downloadedBytes:t,value:i,downloadTimeInMs:n}}(e):function(e,t){let n=NaN,i=NaN,a=!1;if(r.get().streaming.abr.throughput.useResourceTimingApi&&e._resourceTimingValues)n=e._resourceTimingValues.transferSize,i=e._resourceTimingValues.responseEnd-e._resourceTimingValues.responseStart,a=!0;else{if(e.trace.length<=1)return{throughput:NaN,downloadTimeInMs:NaN};n=e.trace.reduce((e,t)=>e+t.b[0],0)-e.trace[0].b[0],i=Math.max(e.trace.reduce((e,t)=>e+t.d,0)-e.trace[0].d,1)}let o=NaN;if(!a&&r.get().streaming.abr.throughput.useNetworkInformationApi.xhr&&(o=g()),isNaN(o)){const e=r.get().streaming.abr.throughput.useDeadTimeLatency?i:i+t;o=Math.round(8*n/e)}return{downloadedBytes:n,value:o,downloadTimeInMs:i}}(e,t)}(t,n);if(l.latencyInMs=n,isNaN(l.value)||!isFinite(l.value))return;if(t.cmsd){const e=t.cmsd.dynamic&&t.cmsd.dynamic.etp?t.cmsd.dynamic.etp:null;if(e){const t=r.get().streaming.cmsd.abr.etpWeightRatio;t>0&&t<=1&&(l.value=l.value*(1-t)+e*t)}}if(function(e,t,n){return r.get().streaming.abr.throughput.useResourceTimingApi&&n._resourceTimingValues?0===n._resourceTimingValues.transferSize&&n._resourceTimingValues.decodedBodySize>0:!isNaN(t)&&(e===h.default.VIDEO?t<r.get().streaming.cacheLoadThresholds[h.default.VIDEO]:e===h.default.AUDIO?t<r.get().streaming.cacheLoadThresholds[h.default.AUDIO]:void 0)}(e,t._tfinish.getTime()-t.trequest.getTime(),t))return void d.debug(`${e} Assuming segment ${t.url} came from cache, ignoring it for throughput calculation`);d.debug(`Added throughput entry for ${e}: ${l.value} kbit/s`),l.serviceLocation=t._serviceLocation,a[e].push(l),o[e].push({value:n}),function(e){a[e].length>r.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep&&a[e].shift(),o[e].length>r.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep&&o[e].shift()}(e),i.trigger(p.default.THROUGHPUT_MEASUREMENT_STORED,{throughputValues:l}),t.type!==R.HTTPRequest.MPD_TYPE&&(m(s[e],l.value,r.get().streaming.abr.throughput.ewma.weightDownloadTimeMultiplicationFactor*l.downloadTimeInMs,c.bandwidthHalfLife),m(u[e],n,1,c.latencyHalfLife))}catch(e){d.error(e)}},getThroughputDict:function(e){return e?a[e]:a},getEwmaThroughputDict:function(e){return e?s[e]:s},getEwmaLatencyDict:function(e){return e?u[e]:u},getEwmaHalfLife:function(){return c},getLatencyDict:function(e){return e?o[e]:o},reset:E};return d=n.getLogger(T),c={bandwidthHalfLife:{fast:r.get().streaming.abr.throughput.ewma.throughputFastHalfLifeSeconds,slow:r.get().streaming.abr.throughput.ewma.throughputSlowHalfLifeSeconds},latencyHalfLife:{fast:r.get().streaming.abr.throughput.ewma.latencyFastHalfLifeCount,slow:r.get().streaming.abr.throughput.ewma.latencySlowHalfLifeCount}},E(),T}Ba.__dashjs_factory_name="ThroughputModel";var ka=r.default.getClassFactory(Ba);function Ga(){const e=this.context,t=(0,f.default)(e).getInstance();let n,r,i;function a(){performance.clearResourceTimings()}function s(e){e.metric!==o.HTTP_REQUEST||!e.value||e.value.type!==R.HTTPRequest.MPD_TYPE&&(e.value.type!==R.HTTPRequest.MEDIA_SEGMENT_TYPE||e.mediaType!==h.default.AUDIO&&e.mediaType!==h.default.VIDEO)||n.addEntry(e.mediaType,e.value)}function l(e,t,a=null,o=NaN){let s,l=null,f=n.getEwmaHalfLife(),p=null,S=!0;switch(a||(a=i.get().streaming.abr.throughput.averageCalculationMode),e){case h.default.THROUGHPUT_TYPES.BANDWIDTH:l=a===h.default.THROUGHPUT_CALCULATION_MODES.EWMA?n.getEwmaThroughputDict(t):n.getThroughputDict(t),p=f.bandwidthHalfLife,S=!0,o=isNaN(o)?r.getIsDynamic()?i.get().streaming.abr.throughput.sampleSettings.live:i.get().streaming.abr.throughput.sampleSettings.vod:o;break;case h.default.THROUGHPUT_TYPES.LATENCY:l=a===h.default.THROUGHPUT_CALCULATION_MODES.EWMA?n.getEwmaLatencyDict(t):n.getLatencyDict(t),p=f.latencyHalfLife,S=!1,o=isNaN(o)?i.get().streaming.abr.throughput.sampleSettings.averageLatencySampleAmount:o}if(!l||0===l.length)return NaN;switch(a){case h.default.THROUGHPUT_CALCULATION_MODES.ARITHMETIC_MEAN:return s=u(l,o,e),c(l,s);case h.default.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_ARITHMETIC_MEAN:return s=u(l,o,e),d(l,s);case h.default.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_ARITHMETIC_MEAN:return s=u(l,o,e),g(l,s);case h.default.THROUGHPUT_CALCULATION_MODES.HARMONIC_MEAN:return s=u(l,o,e),m(l,s);case h.default.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_HARMONIC_MEAN:return s=u(l,o,e),E(l,s);case h.default.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_HARMONIC_MEAN:return s=u(l,o,e),T(l,s);case h.default.THROUGHPUT_CALCULATION_MODES.EWMA:return _(l,p,S);case h.default.THROUGHPUT_CALCULATION_MODES.ZLEMA:return s=u(l,o,e),y(l,s)}}function u(e,t,n){if(e){if(t>=e.length)t=e.length;else if(n===h.default.THROUGHPUT_TYPES.BANDWIDTH&&i.get().streaming.abr.throughput.sampleSettings.enableSampleSizeAdjustment)for(let n=1;n<t;++n){const r=e[e.length-n].value/e[e.length-n-1].value;if((r>=i.get().streaming.abr.throughput.sampleSettings.increaseScale||r<=i.get().streaming.abr.throughput.sampleSettings.decreaseScale)&&(t+=1)===e.length)break}}else t=0;return t}function c(e,t){let n=e;return 0!==t&&n&&0!==n.length?(n=n.slice(-t),n.reduce((e,t)=>
2e+t.value,0)/n.length):NaN}function d(e,t){let n=e;if(0===t||!n||0===n.length)return NaN;n=n.slice(-t);let r=0;return n.reduce((e,t)=>{let n=Math.sqrt(t.downloadedBytes);return r+=n,e+t.value*n},0)/r}function g(e,t){let n=e;if(0===t||!n||0===n.length)return NaN;n=n.slice(-t);let r=0;return n.reduce((e,t,n)=>{let i=n+1;return r+=i,e+t.value*i},0)/r}function m(e,t){let n=e;if(0===t||!n||0===n.length)return NaN;n=n.slice(-t);const r=n.reduce((e,t)=>e+1/t.value,0);return n.length/r}function E(e,t){let n=e;if(0===t||!n||0===n.length)return NaN;n=n.slice(-t);let r=0;const i=n.reduce((e,t)=>{let n=Math.sqrt(t.downloadedBytes);return r+=n,e+1/t.value*n},0);return r/i}function T(e,t){let n=e;if(0===t||!n||0===n.length)return NaN;n=n.slice(-t);let r=0;const i=n.reduce((e,t,n)=>{let i=n+1;return r+=i,e+1/t.value*i},0);return r/i}function _(e,t,n=!0){if(!e||e.totalWeight<=0)return NaN;const r=e.fastEstimate/(1-Math.pow(.5,e.totalWeight/t.fast)),i=e.slowEstimate/(1-Math.pow(.5,e.totalWeight/t.slow));return n?Math.min(r,i):Math.max(r,i)}function y(e,t){if(0===t||!e||0===e.length)return NaN;let n=e.slice(-t).map(e=>e.value),r=2/(n.length+1),i=n[n.length-1],a=n[n.length-1];for(let e=0;e<n.length;e++)i=r*n[e]+(1-r)*i,a=r*i+(1-r)*a;return a}function S(e,t=null,n=NaN){const r=l(h.default.THROUGHPUT_TYPES.BANDWIDTH,e,t,n);return Math.round(r)}const I={getArithmeticMean:c,getAverageLatency:function(e,t=null,n=NaN){const r=l(h.default.THROUGHPUT_TYPES.LATENCY,e,t,n);return Math.round(r)},getAverageThroughput:S,getByteSizeWeightedArithmeticMean:d,getByteSizeWeightedHarmonicMean:E,getDateWeightedArithmeticMean:g,getDateWeightedHarmonicMean:T,getEwma:_,getHarmonicMean:m,getRawThroughputData:function(e){return e?n.getThroughputDict(e):[]},getSafeAverageThroughput:function(e,t=null,n=NaN){let r=S(e,t,n);return isNaN(r)||(r*=i.get().streaming.abr.throughput.bandwidthSafetyFactor),r},getZlema:y,initialize:function(){n=ka(e).create({settings:i}),t.on(p.default.METRIC_ADDED,s,I),window.performance?.addEventListener?.("resourcetimingbufferfull",a)},reset:function(){n.reset(),t.off(p.default.METRIC_ADDED,s,I),window.performance?.removeEventListener?.("resourcetimingbufferfull",a)},setConfig:function(e){e.settings&&(i=e.settings),e.playbackController&&(r=e.playbackController)}};return I}Ga.__dashjs_factory_name="ThroughputController";var Ha=r.default.getSingletonFactory(Ga);function Ya(){const e=this.context,t=(0,f.default)(e).getInstance(),n=(0,u.default)(e).getInstance();let r,i,a,o;function s(e){o=e}function l(e,t,n,r){let i,a=t.adaptation.period.mpd;const o=a.availabilityStartTime;if(r)i=n&&a.timeShiftBufferDepth!==Number.POSITIVE_INFINITY?new Date(o.getTime()+1e3*(e+a.timeShiftBufferDepth)):a.availabilityEndTime;else if(n){const n=t.availabilityTimeOffset;i=new Date(o.getTime()+1e3*(e-n))}else i=o;return i}function c(e,t){return(e.getTime()-t.mpd.availabilityStartTime.getTime()+1e3*o)/1e3}function d(e,t){return e+(t.adaptation.period.start-t.presentationTimeOffset)}function m(e){const t={start:NaN,end:NaN},n=e[0].getAdapter().getRegularPeriods()[0],r=c(new Date,n);if(!e||0===e.length)return{range:t,now:r};e.forEach(e=>{let n=e.getCurrentRepresentationForType(h.default.VIDEO);if(n||(n=e.getCurrentRepresentationForType(h.default.AUDIO)),!n){const t=e.getAdapter(),r=t.getMediaInfoForType(e.getStreamInfo(),h.default.VIDEO)||t.getMediaInfoForType(e.getStreamInfo(),h.default.AUDIO);n=t.getVoRepresentations(r)[0]}let a={start:NaN,end:NaN};if(n)if(n.segmentInfoType===be.default.SEGMENT_TIMELINE)a=function(e){const t=e.adaptation.period.mpd.manifest.Period[e.adaptation.period.index].AdaptationSet[e.adaptation.index],n=i.getRepresentationFor(e.index,t),r=n.SegmentTemplate||n.SegmentList,a=r.SegmentTimeline,o=r.timescale,s=a.S,l={start:0,end:0},u=s[0].t,c=!isNaN(u),f=c?u:0;let g,h,p,m,E=0;for(c&&(l.start=d(f/o,e)),p=0,m=s.length;p<m;p++)g=s[p],h=0,g.hasOwnProperty("r")&&(h=g.r),E+=g.d*(1+h);return l.end=d((f+E)/o,e),l}(n);else{const e=n.adaptation.period;a.start=e.start,a.end=Math.max(r,e.start+e.duration)}!isNaN(a.start)&&(isNaN(t.start)||t.start>a.start)&&(t.start=a.start),!isNaN(a.end)&&(isNaN(t.end)||t.end<a.end)&&(t.end=a.end)}),t.end=Math.min(r,t.end);const a=T(e,t.end,!0);return t.end=isNaN(a)?t.end:a,t.start=n&&n.mpd&&n.mpd.timeShiftBufferDepth&&!isNaN(n.mpd.timeShiftBufferDepth)&&!isNaN(t.end)?Math.max(t.end-n.mpd.timeShiftBufferDepth,t.start):t.start,t.start=T(e,t.start),{range:t,now:r}}function E(e,t){a=e-t.end}function T(e,t,n=!1){try{let r=0,i=!1,a=NaN;for(;!i&&r<e.length;){const o=e[r].getStreamInfo();o.start<=t&&(!isFinite(o.duration)||o.start+o.duration>=t)?(a=t,i=!0):!n&&o.start>t&&(isNaN(a)||o.start<a)?a=o.start:n&&o.start+o.duration<t&&(isNaN(a)||o.start+o.duration>
2a)&&(a=o.start+o.duration),r+=1}return a}catch(e){return t}}function _(e){void 0===e.offset||isNaN(e.offset)||s(e.offset/1e3)}function y(){o=0,a=0}function S(){t.off(g.default.UPDATE_TIME_SYNC_OFFSET,_,this),y()}return r={calcAvailabilityEndTimeFromPresentationTime:function(e,t,n){return l(e,t,n,!0)},calcAvailabilityStartTimeFromPresentationTime:function(e,t,n){return l(e,t,n)},calcMediaTimeFromPresentationTime:function(e,t){return e-t.adaptation.period.start+t.presentationTimeOffset},calcPeriodRelativeTimeFromMpdRelativeTime:function(e,t){return t-e.adaptation.period.start},calcPresentationTimeFromMediaTime:d,calcPresentationTimeFromWallTime:c,calcTimeShiftBufferWindow:function(e,r){if(!r)return function(e){const t={start:NaN,end:NaN};let n=0,r=NaN;return e.forEach(e=>{const t=e.getStreamInfo();n+=t.duration,(isNaN(r)||t.start<r)&&(r=t.start)}),t.start=r,t.end=r+n,t}(e);if(n.get().streaming.timeShiftBuffer.calcFromSegmentTimeline){const t=m(e);return E(t.now,t.range),t.range}return function(e){const r={start:NaN,end:NaN};if(!e||0===e.length)return r;const i=e[0].getAdapter().getRegularPeriods()[0],a=c(new Date,i),o=i.mpd.timeShiftBufferDepth,s=isNaN(o)?0:a-o;if(r.start=T(e,s),r.end=!isNaN(r.start)&&a<r.start?a:T(e,a,!0),!isNaN(o)&&r.end<a-o&&(r.end=NaN),n.get().streaming.timeShiftBuffer.fallbackToSegmentTimeline){const n=m(e);if(n.range.end<r.start)return t.trigger(p.default.CONFORMANCE_VIOLATION,{level:Gi.LEVELS.WARNING,event:Gi.EVENTS.INVALID_DVR_WINDOW}),E(n.now,n.range),n.range}return r}(e)},calcWallTimeForSegment:function(e,t){let n,r,i;return t&&(n=e.representation.adaptation.period.mpd.suggestedPresentationDelay,r=e.presentationStartTime+n,i=new Date(e.availabilityStartTime.getTime()+1e3*r)),i},getClientReferenceTime:function(){return Date.now()-1e3*a+1e3*o},getClientTimeOffset:function(){return o},initialize:function(){y(),t.on(g.default.UPDATE_TIME_SYNC_OFFSET,_,this)},reset:S,setClientTimeOffset:s,setConfig:function(e){e&&e.dashManifestModel&&(i=e.dashManifestModel)}},i=(0,Mt.default)(e).getInstance(),S(),r}Ya.__dashjs_factory_name="TimelineConverter";var qa=r.default.getSingletonFactory(Ya),Va=class{constructor(){this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null}};function Ka(){let e,t;return e={initialize:function(e){if(t=new Va,!e)return null;const n=e.indexOf("#");if(-1!==n){const r=e.substr(n+1).split("&");for(let e=0,n=r.length;e<n;++e){const n=r[e],i=n.indexOf("=");if(-1!==i){const e=n.substring(0,i);t.hasOwnProperty(e)&&(t[e]=n.substr(i+1))}}}},getURIFragmentData:function(){return t}},e}Ka.__dashjs_factory_name="URIFragmentModel";var ja=r.default.getSingletonFactory(Ka),Wa=n(1349);const za=new Map([[h.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,"loadedmetadata"],[h.default.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA,"loadeddata"],[h.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,"canplay"],[h.default.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA,"canplaythrough"]]);function $a(){let e,t,n,r,i,a,o,s,c,d,p,m;const E=this.context,T=(0,f.default)(E).getInstance(),_=[];function y(e,t=!1){n&&(t?n.playbackRate=e:M(h.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,()=>{n.playbackRate=e}))}function S(){return _.length>0}function I(){if(n&&S()&&0===n.playbackRate){const e=document.createEvent("Event");e.initEvent("waiting",!0,!1),n.dispatchEvent(e)}}function A(e,t){n&&n.addEventListener(e,t)}function R(e,t){n&&n.removeEventListener(e,t)}function N(){return n?n.readyState:NaN}function C(){return n?n.buffered:null}function b(){return n?n.clientWidth:NaN}function D(){return n?n.clientHeight:NaN}function v(e,t,r,i,a){if(n)for(let o=0;o<n.textTracks.length;o++)if(n.textTracks[o].kind===e&&(!t||n.textTracks[o].label==t)&&n.textTracks[o].language===r&&n.textTracks[o].isTTML===i&&n.textTracks[o].isEmbedded===a)return n.textTracks[o];return null}function M(e,t){return e===h.default.VIDEO_ELEMENT_READY_STATES.HAVE_NOTHING||N()>=e?(t(),null):function(e,t){const n=()=>{R(e,n),t(e)};return A(e,n),{func:n,event:e}}(za.get(e),t)}return r={addEventListener:A,addTextTrack:function(e,t,r,i,a){if(!n)return null;let o=v(e,t,r,i,a);return o||(o=n.addTextTrack(e,t,r),o.isEmbedded=a,o.isTTML=i),o},appendChild:function(e){n&&(n.appendChild(e),void 0!==e.isTTML&&(n.textTracks[n.textTracks.length-1].isTTML=e.isTTML,n.textTracks[n.textTracks.length-1].isEmbedded=e.isEmbedded))},getBufferRange:C,getClientHeight:D,getClientWidth:b,getElement:function(){return n},getEnded:function(){return n?n.ended:null},getPlaybackQuality:function(){if(!n)return null;let e="webkitDroppedFrameCount"in n&&"webkitDecodedFrameCount"in n,t=null;return"getVideoPlaybackQuality"in n?t=n.getVideoPlaybackQuality():e&&(t={droppedVideoFrames:n.webkitDroppedFrameCount,totalVideoFrames:n.webkitDroppedFrameCount+n.webkitDecodedFrameCount,creationTime:new Date}),t},getPlaybackRate:function(){return n?n.playbackRate:null},getPlayedRanges:function(){return n?n.played:null},getReadyState:N,getSource:function(){return n?n.src:null},getTTMLRenderingDiv:function(){return e},getTextTrack:v,getTextTracks:function(){return n?n.textTracks:[]},getTime:function(){return n?isNaN(t)?n.currentTime:t:null},getVideoElementSize:function(){const e=d.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;return{elementWidth:b()*e,elementHeight:D()*e}},getVideoHeight:function(){return n?n.videoHeight:NaN},getVideoRelativeOffsetLeft:function(){if(n){const e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().left-e.getBoundingClientRect().left:NaN}
2return NaN},getVideoRelativeOffsetTop:function(){if(n){const e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().top-e.getBoundingClientRect().top:NaN}return NaN},getVideoWidth:function(){return n?n.videoWidth:NaN},getVttRenderingDiv:function(){return m},initialize:function(){T.on(g.default.PLAYBACK_PLAYING,I,this)},isPaused:function(){return n?n.paused:null},isSeeking:function(){return n?n.seeking||!isNaN(t):null},isStalled:S,pause:function(){n&&(n.pause(),n.autoplay=!1)},play:function(){if(n){n.autoplay=!0;const e=n.play();e&&e.catch&&"undefined"!=typeof Promise&&e.catch(e=>{"NotAllowedError"===e.name&&T.trigger(g.default.PLAYBACK_NOT_ALLOWED),i.warn(`Caught pending play exception - continuing (${e})`)})}},removeChild:function(e){n&&n.removeChild(e)},removeEventListener:R,reset:function(){clearTimeout(p),T.off(g.default.PLAYBACK_PLAYING,I,this),_.length=0,function(){try{o&&n&&(o.unobserve(n),o.disconnect(),o=null)}catch(e){}}()},setConfig:function(e){e&&e.settings&&(d=e.settings)},setCurrentTime:function(e,r){n&&(c&&c.func&&c.event&&R(c.event,c.func),t=e,c=M(h.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,()=>{if(n)if(n.currentTime!==t)try{t=r?function(e){const t=C();let n=e,r=9999999999;if(t)for(let i=0;i<t.length;i++){const a=t.start(i),o=t.end(i),s=Math.abs(a-e),l=Math.abs(o-e);if(e>=a&&e<=o)return e;s<r&&(r=s,n=a),l<r&&(r=l,n=o)}return n}(t):t,isNaN(t)||(n.currentTime=t),t=NaN}catch(e){0===n.readyState&&e.code===e.INVALID_STATE_ERR&&(p=setTimeout(function(){n.currentTime=t,t=NaN},400))}else t=NaN}))},setDisableRemotePlayback:function(e){n&&(n.disableRemotePlayback=e)},setElement:function(e){if(!(null==e||e&&/^(VIDEO|AUDIO)$/i.test(e.nodeName)))throw"element is not video or audio DOM type!";n=e,function(e){try{if(!o||!e)return;o.observe(e)}catch(e){}}(n)},setPlaybackRate:y,setSource:function(e){n&&(e?n.src=e:(n.removeAttribute("src"),n.load()))},setStallState:function(e,t){!function(e,t){t?function(e){if(null!==e&&n&&!n.seeking&&-1===_.indexOf(e)&&(_.push(e),d.get().streaming.buffer.syntheticStallEvents.enabled&&n&&1===_.length&&(d.get().streaming.buffer.syntheticStallEvents.ignoreReadyState||N()>=h.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA))){a=n.playbackRate,y(0,!0);const e=document.createEvent("Event");e.initEvent("waiting",!0,!1),n.dispatchEvent(e)}}(e):function(e){let t=_.indexOf(e);if(null!==e&&(-1!==t&&_.splice(t,1),d.get().streaming.buffer.syntheticStallEvents.enabled&&n&&!S())){const e=()=>{if(y(a||1,d.get().streaming.buffer.syntheticStallEvents.ignoreReadyState),!n.paused){const e=document.createEvent("Event");e.initEvent("playing",!0,!1),n.dispatchEvent(e)}};d.get().streaming.buffer.syntheticStallEvents.ignoreReadyState?e():(s&&s.func&&s.event&&R(s.event,s.func),s=M(h.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,e))}}(e)}(e,t)},setTTMLRenderingDiv:function(t){e=t,e.style.position="absolute",e.style.display="flex",e.style.overflow="hidden",e.style.pointerEvents="none",e.style.top=0,e.style.left=0},setVttRenderingDiv:function(e){m=e},waitForReadyState:M},i=(0,l.default)(E).getInstance().getLogger(r),d=(0,u.default)(E).getInstance(),t=NaN,function(){try{o=new ResizeObserver(()=>{T.trigger(g.default.VIDEO_ELEMENT_RESIZED)})}catch(e){}}(),r}$a.__dashjs_factory_name="VideoModel";var Qa=r.default.getSingletonFactory($a),Xa=n(8986);function Za(){const e="You must first call initialize() and set a source before calling this method",t="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",i="You must first call attachSource() with a valid source before calling this method",a="MediaPlayer not initialized!",s=this.context,c=(0,f.default)(s).getInstance();let d=(0,u.default)(s).getInstance();const m=(0,l.default)(s).getInstance({settings:d});let E,T,_,y,S,I,A,N,C,b,D,v,M,w,P,O,L,F,U,x,B,k,G,H,Y,q,V,K,j,W,z,$,Q,X,Z,J,ee,te,ne,re,ie,ae;function oe(){Re(null),ye(null),y=null,P&&(P.reset(),P=null),O&&(O.reset(),O=null),B&&B.reset(),d.reset(),F&&(F.reset(),F=null),ae&&(ae.resetLoader(),ae=null)}function se(){return!!_&&!!ee.getElement()}function le(){return(0,Xa.getVersionString)()}function ue(){if(!A)throw t;return j.isPaused()}
2function ce(){if(!A)throw t;return j.getIsDynamic()}function de(e){const t=q&&q.hasVideoTrack()?h.default.VIDEO:h.default.AUDIO;let n=Q.getCurrentDVRInfo(t);return n?fe(n.range.start+e,n):0}function fe(e,t){let n=j.getOriginalLiveDelay();return e>t.range.end-n&&(e=t.range.end-n),e}function ge(e=""){if(!A)throw t;let n=_e().currentTime;return""!==e&&(n=q.getTimeRelativeToStreamId(n,e)),n}function he(e){(0,He.checkParameterType)(e,"boolean"),N=e}function me(){B.restoreDefaultUTCTimingSources()}function Te(){return Q}function _e(){if(!ee.getElement())throw n;return ee.getElement()}function ye(e){if(!S)throw a;ee.setElement(e),e&&(we(),function(){if(O||"undefined"==typeof dashjs)return;let e=dashjs.MetricsReporting;if("function"==typeof e){let t=e(s).create();O=t.createMetricsReporting({debug:m,eventBus:c,mediaElement:_e(),adapter:U,dashMetrics:Q,mediaPlayerModel:x,events:g.default,constants:h.default,metricsConstants:o})}}(),function(){if(L||"undefined"==typeof dashjs)return;let e=dashjs.MssHandler;"function"==typeof e&&(Ae.default.extend(e.errors),L=e(s).create({eventBus:c,mediaPlayerModel:x,dashMetrics:Q,manifestModel:X,playbackController:j,streamController:q,protectionController:P,baseURLController:G,errHandler:k,events:g.default,constants:h.default,debug:m,initSegmentType:R.HTTPRequest.INIT_SEGMENT_TYPE,BASE64:Ee,ISOBoxer:Ze,settings:d}))}(),q&&q.switchToVideoElement(C)),A&&(Ce(),ve()),Le(C)}function Se(t,n,r=!0){if(!I)throw e;let i=n?q.getStreamById(n):Ne();return i?i.getRepresentationsByType(t,r):[]}function Ie(t){if(!I)throw e;let n=q.getActiveStreamInfo();return n?w.getTracksFor(t,n.id).filter(e=>!P||P.areKeyIdsUsable(e.normalizedKeyIds)):[]}function Re(e,t=NaN){if(!S)throw a;"string"==typeof e&&te.initialize(e),null==t&&(t=NaN),isNaN(t)||(t=Math.max(0,t)),C=t,_=e,(I||A)&&(Ce(),ve()),se()&&Le(C)}function Ne(){if(!I)throw e;let t=q.getActiveStreamInfo();return t?q.getStreamById(t.id):null}function Ce(){A=!1,I=!1,U.reset(),q.reset(),K.reset(),$.reset(),j.reset(),W.reset(),z.reset(),b.reset(),D.reset(),w.reset(),re.reset(),P&&(d.get().streaming.protection.keepProtectionMediaKeys?P.stop():(P.reset(),P=null,we())),V.reset(),Z.reset(),J.reset()}function ve(){B.resetPlaybackSessionSpecificSettings()}function Me(){return Vn(s).create({debug:m,errHandler:k,dashMetrics:Q,mediaPlayerModel:x,mssHandler:L,settings:d})}function we(){if(P)return P;if("undefined"==typeof dashjs)return null;let e=dashjs.Protection;if("function"==typeof e){let t=e(s).create();return g.default.extend(e.events),p.default.extend(e.events,{publicOnly:!0}),Ae.default.extend(e.errors),P=t.createProtectionSystem({debug:m,errHandler:k,videoModel:ee,customParametersModel:B,capabilities:H,eventBus:c,events:g.default,BASE64:Ee,constants:h.default,cmcdController:Z,settings:d}),H||(H=(0,nt.default)(s).getInstance()),H.setProtectionController(P),P}return null}function Pe(){if(!S)throw a;if(F)return F;if("undefined"==typeof dashjs)return null;let e=dashjs.OfflineController;if("function"==typeof e){g.default.extend(e.events),p.default.extend(e.events,{publicOnly:!0}),Ae.default.extend(e.errors);const t=Me(),n=Qn(s).create();return n.setConfig({manifestModel:X,adapter:U,manifestLoader:t,errHandler:k,contentSteeringController:z}),F=e(s).create({debug:m,manifestUpdater:n,baseURLController:G,manifestLoader:t,manifestModel:X,mediaPlayerModel:x,abrController:b,playbackController:j,adapter:U,errHandler:k,dashMetrics:Q,timelineConverter:M,segmentBaseController:re,schemeLoaderFactory:v,eventBus:c,events:g.default,errors:Ae.default,constants:h.default,settings:d,dashConstants:be.default,urlUtils:(0,De.default)(s).getInstance()}),F}return null}function Le(e=NaN){F&&F.resetRecords(),!I&&_&&(I=!0,T.info("Streaming Initialized"),function(){const e=Me();q||(q=Ki(s).getInstance()),V||(V=xa(s).create({adapter:U,baseURLController:G,errHandler:k,manifestModel:X,mediaController:w,settings:d,videoModel:ee})),Y.setConfig({adapter:U,capabilities:H,customParametersModel:B,errHandler:k,manifestModel:X,protectionController:P,settings:d}),q.setConfig({abrController:b,adapter:U,baseURLController:G,capabilities:H,capabilitiesFilter:Y,contentSteeringController:z,customParametersModel:B,dashMetrics:Q,errHandler:k,manifestLoader:e,manifestModel:X,mediaController:w,mediaPlayerModel:x,playbackController:j,protectionController:P,segmentBaseController:re,serviceDescriptionController:W,settings:d,textController:V,throughputController:D,timelineConverter:M,uriFragmentModel:te,videoModel:ee}),K.setConfig({adapter:U,playbackController:j,settings:d,streamController:q,timelineConverter:M,videoModel:ee}),j.setConfig({adapter:U,dashMetrics:Q,serviceDescriptionController:W,settings:d,streamController:q,timelineConverter:M,videoModel:ee}),$.setConfig({mediaPlayerModel:x,playbackController:j,settings:d,streamController:q,videoModel:ee}),D.setConfig({settings:d,playbackController:j}),b.setConfig({adapter:U,capabilities:H,cmsdModel:J,customParametersModel:B,dashMetrics:Q,domStorage:ne,mediaPlayerModel:x,settings:d,streamController:q,throughputController:D,videoModel:ee}),Z.setConfig({abrController:b,dashMetrics:Q,errHandler:k,mediaPlayerModel:x,playbackController:j,serviceDescriptionController:W,throughputController:D}),ie.setConfig({serviceDescriptionController:W}),J.setConfig({}),w.initialize(),D.initialize(),b.initialize(),q.initialize(N,y),V.initialize(),K.initialize(),$.initialize(),Z.initialize(N),J.initialize(),z.initialize(),re.initialize()}(),"string"==typeof _?q.load(_,e):q.loadWithManifest(_,e)),!A&&se()&&(A=!0,c.trigger(p.default.PLAYBACK_INITIALIZED),T.info("Playback Initialized"))}return E={addABRCustomRule:function(e,t,n){B.addAbrCustomRule(e,t,n)},addExternalSubtitle:function(e){e instanceof pn.default||T.error("Invalid external subtitle object. Must be an instance of dashjs.ExternalSubtitle"),B.addExternalSubtitle(e)},addRequestInterceptor:function(e){B.addRequestInterceptor(e)},addResponseInterceptor:function(e){B.addResponseInterceptor(e)},addUTCTimingSource:function(e,t){B.addUTCTimingSource(e,t)},attachProtectionController:function(e){P=e},attachSource:Re,attachTTMLRenderingDiv:function(e){if(!ee.getElement())throw n;ee.setTTMLRenderingDiv(e)},attachView:ye,attachVttRenderingDiv:function(e){if(!ee.getElement())throw n;ee.setVttRenderingDiv(e)},clearDefaultUTCTimingSources:function(){B.clearDefaultUTCTimingSources()},convertToTimeCode:function(e){e=Math.max(e,0);
2let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%3600%60);return(0===t?"":t<10?"0"+t.toString()+":":t.toString()+":")+(n<10?"0"+n.toString():n.toString())+":"+(r<10?"0"+r.toString():r.toString())},destroy:function(){oe(),r.default.deleteSingletonInstances(s)},duration:function(){if(!A)throw t;let e=_e().duration;if(j.getIsDynamic()){const t=q&&q.hasVideoTrack()?h.default.VIDEO:h.default.AUDIO;let n=Q.getCurrentDVRInfo(t);e=n?n.range.end-n.range.start:0}return e},enableForcedTextStreaming:function(e){return!(!q.getActiveStreamInfo()||!V)&&V.enableForcedTextStreaming(e)},enableText:function(e){const t=q.getActiveStreamInfo();return!(!t||!V)&&V.enableText(t.id,e)},extend:function(e,t,n){r.default.extend(e,t,n,s)},formatUTC:function(e,t,n,r=!1){const i=new Date(1e3*e),a=i.toLocaleDateString(t),o=i.toLocaleTimeString(t,{hour12:n});return r?o+" "+a:o},getABRCustomRules:function(){return B.getAbrCustomRules()},getActiveStream:Ne,getAutoPlay:function(){return N},getAvailableBaseUrls:function(){const e=X.getValue();return e?G.getBaseUrls(e):[]},getAvailableLocations:function(){const e=X.getValue();if(!e)return[];const t=U.getLocation(e),n=z.getSynthesizedLocationElements(t);return t.concat(n)},getAverageLatency:function(e=h.default.VIDEO,t=null,n=NaN){return D?D.getAverageLatency(e,t,n):0},getAverageThroughput:function(e=h.default.VIDEO,t=null,n=NaN){return D?D.getAverageThroughput(e,t,n):0},getBufferLength:function(e){const t=[h.default.VIDEO,h.default.AUDIO,h.default.TEXT];if(e)return-1!==t.indexOf(e)?Te().getCurrentBufferLevel(e)||NaN:(T.warn("getBufferLength requested for invalid type"),NaN);{const e=t.map(e=>Ie(e).length>0?Te().getCurrentBufferLevel(e):Number.MAX_VALUE).reduce((e,t)=>Math.min(e,t));return e===Number.MAX_VALUE?NaN:e}},getCurrentLiveLatency:function(){if(!S)throw a;return A?j.getCurrentLiveLatency():NaN},getCurrentRepresentationForType:function(t){if(!I)throw e;if(t!==h.default.IMAGE&&t!==h.default.VIDEO&&t!==h.default.AUDIO)return null;const n=Ne();if(!n)return null;if(t===h.default.IMAGE){const e=n.getThumbnailController();return e?e.getCurrentTrack():-1}return n.getCurrentRepresentationForType(t)},getCurrentSteeringResponseData:function(){if(z)return z.getCurrentSteeringResponseData()},getCurrentTextTrackIndex:function(){let e=NaN;const t=q.getActiveStreamInfo();if(t&&V)return e=V.getCurrentTrackIdx(t.id),e},getCurrentTrackFor:function(t){if(!I)throw e;let n=q.getActiveStreamInfo();return n?w.getCurrentTrackFor(t,n.id):null},getDashAdapter:function(){return U},getDashMetrics:Te,getDebug:function(){return m},getDvrSeekOffset:de,getDvrWindow:function(){if(!A)throw t;const e=q&&q.hasVideoTrack()?h.default.VIDEO:h.default.AUDIO;let n=Q.getCurrentDVRInfo(e);if(!n)return{};let r=0;const i=j.getIsDynamic();return i&&(r=n.manifestInfo.availableFrom.getTime()/1e3),{start:n.range.start,end:n.range.end,startAsUtc:i?r+n.range.start:NaN,endAsUtc:i?r+n.range.end:NaN,size:n.range.end-n.range.start}},getExternalSubtitles:function(){B.getExternalSubtitles()},getInitCache:function(){return Nt(s).getInstance()},getInitialMediaSettingsFor:function(e){if(!S)throw a;return w.getInitialSettings(e)},getLowLatencyModeEnabled:function(){if(!A)throw t;return j.getLowLatencyModeEnabled()},getManifest:function(){return X.getValue()},getOfflineController:function(){return Pe()},getPlaybackRate:function(){return _e().playbackRate},getProtectionController:function(){return we()},getProtectionData:function(){return q?q.getProtectionData():null},getRawThroughputData:function(e=h.default.VIDEO){return D?D.getRawThroughputData(e):[]},getRepresentationsByType:function(e,t=null){return Se(e,t,!0)},getRepresentationsByTypeUnfiltered:function(e,t=null){return Se(e,t,!1)},getSafeAverageThroughput:function(e=h.default.VIDEO,t=null,n=NaN){return D?D.getSafeAverageThroughput(e,t,n):0},getSettings:function(){return d.get()},getSource:function(){if(!_)throw i;return _},getStreamsFromManifest:function(t){if(!I)throw e;return U.getStreamsInfo(t)},getTTMLRenderingDiv:function(){return ee?ee.getTTMLRenderingDiv():null},getTargetLiveDelay:function(){if(!A)throw t;return j.getOriginalLiveDelay()},getTracksFor:Ie,getTracksForTypeFromManifest:function(t,n,r){if(!I)throw e;return(r=r||U.getStreamsInfo(n,1)[0])?U.getAllMediaInfoForType(r,t,n):[]},getVersion:le,getVideoElement:_e,getVolume:function(){return _e().volume},getXHRWithCredentialsForType:function(e){return B.getXHRWithCredentialsForType(e)},initialize:function(e,t,n,r=NaN){H||(H=(0,nt.default)(s).getInstance(),H.setConfig({settings:d,protectionController:P})),k||(k=hn(s).getInstance()),H.supportsMediaSource()?(S||(S=!0,M=qa(s).getInstance(),D||(D=Ha(s).getInstance()),b||(b=pe(s).getInstance()),v||(v=(0,sr.default)(s).getInstance()),j||(j=or(s).getInstance()),w||(w=nr(s).getInstance()),q||(q=Ki(s).getInstance()),K||(K=En(s).getInstance()),$||($=dt(s).getInstance()),W||(W=Ir(s).getInstance()),z||(z=Oe(s).getInstance()),Y||(Y=lt(s).getInstance()),U=Wt(s).getInstance(),X=jn(s).getInstance(),Z=(0,ut.default)(s).getInstance(),J=(0,ht.default)(s).getInstance(),ie=gt(s).getInstance(),Q=fn(s).getInstance({settings:d}),ne=At(s).getInstance({settings:d}),U.setConfig({constants:h.default,cea608parser:new ha,errHandler:k,BASE64:Ee}),G||(G=We(s).create()),G.setConfig({adapter:U,contentSteeringController:z}),W.setConfig({adapter:U}),re||(re=Er(s).getInstance({dashMetrics:Q,mediaPlayerModel:x,errHandler:k,baseURLController:G,events:g.default,eventBus:c,debug:m,boxParser:tt(s).getInstance(),errors:Ae.default})),w.setConfig({domStorage:ne,settings:d,mediaPlayerModel:x,customParametersModel:B,videoModel:ee}),x.setConfig({playbackController:j,serviceDescriptionController:W}),z.setConfig({adapter:U,errHandler:k,dashMetrics:Q,mediaPlayerModel:x,manifestModel:X,serviceDescriptionController:W,throughputController:D,eventBus:c}),me(),he(void 0===n||n),Pe()),e&&ye(e),t&&Re(t,r),T.info("[dash.js "+le()+"] MediaPlayer has been initialized")):k.error(new Ge.default(Ae.default.CAPABILITY_MEDIASOURCE_ERROR_CODE,Ae.default.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},isDynamic:ce,isMuted:function(){return _e().muted},isPaused:ue,isReady:se,isSeeking:function(){if(!A)throw t;return j.isSeeking()},isTextEnabled:function(){const e=q.getActiveStreamInfo();return!(!e||!V)&&V.isTextEnabled(e)},off:function(e,t,n){c.off(e,t,n)},on:function(e,t,n,r){c.on(e,t,n,r)},pause:function(){if(!A)throw t;j.pause()},play:function(){if(!A)throw t;(!N||ue()&&A)&&j.play(!0)}
2,preload:function(){if(!ee.getElement()&&!I){if(!_)throw i;Le(C)}},provideThumbnail:function(e,t){if("function"!=typeof t)return;if(e<0)return void t(null);const n=j.getIsDynamic()?de(e):e,r=q.getStreamForTime(n);if(null===r)return void t(null);const i=r.getThumbnailController();if(i)return i.provide(n,t);t(null)},refreshManifest:function(e){if(!S)throw a;if(!se())return e(null,i);let t=this;if("function"==typeof e){const n=function(r){c.off(g.default.INTERNAL_MANIFEST_LOADED,n,t),r.error?e(null,r.error):e(r.manifest)};c.on(g.default.INTERNAL_MANIFEST_LOADED,n,t)}q.refreshManifest()},registerCertificateRequestFilter:function(e){B.registerCertificateRequestFilter(e)},registerCertificateResponseFilter:function(e){B.registerCertificateResponseFilter(e)},registerCustomCapabilitiesFilter:function(e){B.registerCustomCapabilitiesFilter(e)},registerLicenseRequestFilter:function(e){B.registerLicenseRequestFilter(e)},registerLicenseResponseFilter:function(e){B.registerLicenseResponseFilter(e)},removeABRCustomRule:function(e){B.removeAbrCustomRule(e)},removeAllABRCustomRule:function(){B.removeAllAbrCustomRule()},removeExternalSubtitleById:function(e){B.removeExternalSubtitleById(e)},removeExternalSubtitleByUrl:function(e){B.removeExternalSubtitleByUrl(e)},removeRequestInterceptor:function(e){B.removeRequestInterceptor(e)},removeResponseInterceptor:function(e){B.removeResponseInterceptor(e)},removeUTCTimingSource:function(e,t){B.removeUTCTimingSource(e,t)},reset:oe,resetCustomInitialTrackSelectionFunction:function(){B.resetCustomInitialTrackSelectionFunction(null)},resetSettings:function(){d.reset()},restoreDefaultUTCTimingSources:me,retrieveManifest:function(e,t){ae&&ae.resetLoader();const n=Me(),r=()=>{c.off(g.default.INTERNAL_MANIFEST_LOADED,i,this),n.reset(),ae=null};ae={manifestLoader:n,resetLoader:r};const i=e=>{"function"==typeof t&&(e.error?t(null,e.error):t(e.manifest)),r()};c.on(g.default.INTERNAL_MANIFEST_LOADED,i,this),te.initialize(e),n.load(e)},seek:function(e){if(!A)throw t;if((0,He.checkParameterType)(e,"number"),isNaN(e))throw h.default.BAD_ARGUMENT_ERROR;e<0&&(e=0);let n=j.getIsDynamic()?de(e):e;const r=_e();!j.getIsDynamic()&&r.duration&&(n=Math.min(r.duration,n)),j.seek(n,!1,!1,!0)},seekToOriginalLive:function(){A&&ce()&&j.seekToOriginalLive()},seekToPresentationTime:function(e){if(!A)throw t;if((0,He.checkParameterType)(e,"number"),isNaN(e))throw h.default.BAD_ARGUMENT_ERROR;e<0&&(e=0);const n=_e();if(!j.getIsDynamic()&&n.duration&&(e=Math.min(n.duration,e)),j.getIsDynamic()){const t=q&&q.hasVideoTrack()?h.default.VIDEO:h.default.AUDIO;let n=Q.getCurrentDVRInfo(t);if(!n)return;(e=fe(e,n))<n.range.start&&(e=n.range.start)}j.seek(e,!1,!1,!0)},setAutoPlay:he,setConfig:function(e){e&&(e.capabilities&&(H=e.capabilities),e.capabilitiesFilter&&(Y=e.capabilitiesFilter),e.streamController&&(q=e.streamController),e.textController&&(V=e.textController),e.gapController&&(K=e.gapController),e.throughputController&&(D=e.throughputController),e.playbackController&&(j=e.playbackController),e.serviceDescriptionController&&(W=e.serviceDescriptionController),e.contentSteeringController&&(z=e.contentSteeringController),e.clientDataReportingController&&(ie=e.clientDataReportingController),e.catchupController&&($=e.catchupController),e.mediaPlayerModel&&(x=e.mediaPlayerModel),e.customParametersModel&&(B=e.customParametersModel),e.abrController&&(b=e.abrController),e.schemeLoaderFactory&&(v=e.schemeLoaderFactory),e.mediaController&&(w=e.mediaController),e.settings&&(d=e.settings),e.dashMetrics&&(Q=e.dashMetrics))},setCurrentTrack:function(t,n=!1){if(!I)throw e;!P||P.areKeyIdsUsable(t.normalizedKeyIds)?w.setTrack(t,{noSettingsSave:n}):T.error(`Can not switch to track with index ${t.index} because key is not usable`)},setCustomInitialTrackSelectionFunction:function(e){B.setCustomInitialTrackSelectionFunction(e)},setInitialMediaSettingsFor:function(e,t){if(!S)throw a;let n=function(e){const t=d.get().streaming.defaultSchemeIdUri;let n={};function r(e,t,n){let r={};if(t){if(t instanceof Array)throw"Array type not supported for settings!";return t instanceof Object?(r.schemeIdUri=t.schemeIdUri?t.schemeIdUri:"",r.value=t.value?t.value:""):(r.schemeIdUri=n,r.value=t,T.warn("No schemeIdUri provided for "+e+', using default "'+n+'"')),r}return null}return void 0!==e.id&&(n.id=e.id),void 0!==e.lang&&(n.lang=e.lang),isNaN(e.index)||(n.index=e.index),void 0!==e.viewpoint&&(n.viewpoint=r("viewpoint",e.viewpoint,t.viewpoint)),void 0!==e.audioChannelConfiguration&&(n.audioChannelConfiguration=r("audioChannelConfiguration",e.audioChannelConfiguration,t.audioChannelConfiguration)),void 0!==e.role&&null!==e.role&&(n.role=r("role",e.role,t.role),n.role.schemeIdUri===h.default.DASH_ROLE_SCHEME_ID&&"Main"===n.role.value&&(n.role.value=be.default.MAIN)),void 0!==e.accessibility&&(n.accessibility=r("accessibility",e.accessibility,t.accessibility)),n}(t);
2w.setInitialSettings(e,n)},setMute:function(e){(0,He.checkParameterType)(e,"boolean"),_e().muted=e},setPlaybackRate:function(e){_e().playbackRate=e},setProtectionData:function(e){const t=Wa.default.sanitizeProtectionDataCertUrls(e);y=t,q&&q.setProtectionData(y)},setRepresentationForTypeById:function(t,n,r=!1){if(t!==h.default.IMAGE&&t!==h.default.VIDEO&&t!==h.default.AUDIO)return;if(!I)throw e;const i=Ne();if(i)if(t===h.default.IMAGE){const e=i.getThumbnailController();e&&e.setTrackById(n)}else{const e=i.getRepresentationForTypeById(t,n);e&&b.manuallySetPlaybackQuality(t,q.getActiveStreamInfo(),e,{forceReplace:r})}},setRepresentationForTypeByIndex:function(t,n,r=!1){if(t!==h.default.IMAGE&&t!==h.default.VIDEO&&t!==h.default.AUDIO)return;if(!I)throw e;const i=Ne();if(i)if(t===h.default.IMAGE){const e=i.getThumbnailController();e&&e.setTrackByIndex(n)}else{const e=i.getRepresentationForTypeByIndex(t,n);e&&b.manuallySetPlaybackQuality(t,q.getActiveStreamInfo(),e,{forceReplace:r})}},setTextTrack:function(e){if(!A)throw t;const n=q.getActiveStreamInfo();n&&V&&V.setTextTrack(n.id,e)},setVolume:function(e){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw h.default.BAD_ARGUMENT_ERROR;_e().volume=e},setXHRWithCredentialsForType:function(e,t){B.setXHRWithCredentialsForType(e,t)},time:ge,timeAsUTC:function(){if(!A)throw t;if(!j.getIsDynamic()||ge()<0)return NaN;const e=q&&q.hasVideoTrack()?h.default.VIDEO:h.default.AUDIO;let n,r,i=Q.getCurrentDVRInfo(e);return i?(n=i.manifestInfo.availableFrom.getTime()/1e3,r=n+ge(),r):0},timeInDvrWindow:function(){if(!A)throw t;if(!j.getIsDynamic())return ge();let e=_e().currentTime;const n=q&&q.hasVideoTrack()?h.default.VIDEO:h.default.AUDIO;let r=Q.getCurrentDVRInfo(n);return e=null===r||0===e?0:Math.max(0,e-r.range.start),e},trigger:function(e,t,n){c.trigger(e,t,n)},triggerSteeringRequest:function(){if(z)return z.loadSteeringData()},unregisterCertificateRequestFilter:function(e){B.unregisterCertificateRequestFilter(e)},unregisterCertificateResponseFilter:function(e){B.unregisterCertificateResponseFilter(e)},unregisterCustomCapabilitiesFilter:function(e){B.unregisterCustomCapabilitiesFilter(e)},unregisterLicenseRequestFilter:function(e){B.unregisterLicenseRequestFilter(e)},unregisterLicenseResponseFilter:function(e){B.unregisterLicenseResponseFilter(e)},updateSettings:function(e){d.update(e)},updateSource:function(e){_=e,q.load(_)}},T=m.getLogger(E),S=!1,A=!1,I=!1,N=!0,C=NaN,P=null,F=null,y=null,U=null,re=null,g.default.extend(p.default),x=ir(s).getInstance(),B=(0,pt.default)(s).getInstance(),ee=Qa(s).getInstance(),te=ja(s).getInstance(),E}Za.__dashjs_factory_name="MediaPlayer";const Ja=r.default.getClassFactory(Za);Ja.events=p.default,Ja.errors=Ae.default,r.default.updateClassFactory(Za.__dashjs_factory_name,Ja);var eo=Ja},1191:function(e,t,n){n.r(t);var r=n(7252);class i extends r.default{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 a=new i;t.default=a},6882:function(e,t,n){n.r(t);var r=n(138),i=n(3346),a=n(8261),o=n(5212);function s(){let e,t,n,r;const s=this.context;function l(){const e=function(){if("function"!=typeof r)return null;try{return r()}catch(e){return null}}();return e&&Object.keys(e).length>0?e:n}function u(){const e=l();
2if(e&&e.version)return parseInt(e.version,10);const n=t.get().streaming.cmcd;return n&&n.version?parseInt(n.version,10):o.default.CMCD_DEFAULT_VERSION}function c(e,t,n={}){if(!e||!t)return;let r=t;for(const[e,t]of Object.entries(n))r=r.replace(`{${e}}`,t);const i=r.split(".");let a=e;for(let e=0;e<i.length;e++){const t=i[e];if(null==a)return;const n=t.match(/^([^\[]+)\[(\d+)\]$/);if(n){const[,e,t]=n;if(a=a[e],!Array.isArray(a))return;a=a[parseInt(t,10)]}else a=a[t]}return a}function d(e,n={}){const r=i.default[e];if(!r)return void 0!==n.defaultValue?n.defaultValue:void 0;const a=u(),o={settings:t.get(),manifestParams:l()||{}};if(r.version&&!r.version.includes(a))return void 0!==n.defaultValue?n.defaultValue:void 0;const s={};void 0!==n.targetIndex&&(s.targetIndex=n.targetIndex);const d="applyParametersFromMpd"===e||(o.settings?.streaming?.cmcd?.applyParametersFromMpd??!0),f=[...r.sources].sort((e,t)=>e.priority-t.priority);for(const e of f){if(!d&&e.path.startsWith("manifestParams"))continue;const t=c(o,e.path,s);if(null!=t)return"function"==typeof e.transform?e.transform(t):t}for(const e of f)if((d||!e.path.startsWith("manifestParams"))&&void 0!==e.default)return e.default;return void 0!==n.defaultValue?n.defaultValue:void 0}function f(){if(2!==u())return[];const e=d("eventTargets");return Array.isArray(e)?e:[]}return e={get:d,getEventTarget:function(e){const t=f();return e<0||e>=t.length?null:{get:t=>d(t,{targetIndex:e}),has:t=>null!=d(t,{targetIndex:e}),index:e,raw:t[e]}},getEventTargets:f,getVersion:function(){return u()},has:function(e){return null!=d(e)},hasManifestParams:function(){const e=l();return!(!e||!e.version)},isEnabled:function(){const e=t.get().streaming.cmcd;if(e?.applyParametersFromMpd??1){const e=l();if(e&&e.version)return!0}return(!e||!1!==e.enabled)&&!0===d
vendor: 9,678 bytes, line 2
2("enabled")},reset:function(){n=null,r=null},setManifestParams:function(e){n=e},setManifestParamsProviderFunction:function(e){r=e}},t=(0,a.default)(s).getInstance(),n=null,r=null,e}s.__dashjs_factory_name="CmcdConfigAccessor",t.default=r.default.getSingletonFactory(s)},3346:function(e,t,n){n.r(t);var r=n(5212);const i={version:{version:[1,2],sources:[{path:"manifestParams.version",priority:1,type:"number"},{path:"settings.streaming.cmcd.version",priority:2,type:"number",default:r.default.CMCD_DEFAULT_VERSION}]},enabled:{version:[1,2],sources:[{path:"settings.streaming.cmcd.enabled",priority:1,type:"boolean",default:!1}]},sessionID:{version:[1,2],sources:[{path:"manifestParams.sessionID",priority:1,type:"string"},{path:"settings.streaming.cmcd.sid",priority:2,type:"string",default:null}]},contentID:{version:[1,2],sources:[{path:"manifestParams.contentID",priority:1,type:"string"},{path:"settings.streaming.cmcd.cid",priority:2,type:"string",default:null}]},mode:{version:[1,2],sources:[{path:"manifestParams.mode",priority:1,type:"string"},{path:"settings.streaming.cmcd.mode",priority:2,type:"string",default:r.default.CMCD_MODE_QUERY}]},rtp:{version:[1,2],sources:[{path:"settings.streaming.cmcd.rtp",priority:1,type:"number",default:null}]},rtpSafetyFactor:{version:[1,2],sources:[{path:"settings.streaming.cmcd.rtpSafetyFactor",priority:1,type:"number",default:5}]},keys:{version:[1,2],sources:[{path:"manifestParams.keys",priority:1,type:"array",transform:e=>"string"==typeof e?e.split(" "):e},{path:"settings.streaming.cmcd.enabledKeys",priority:2,type:"array",default:r.default.CMCD_KEYS}]},includeInRequests:{version:[1,2],sources:[{path:"manifestParams.includeInRequests",priority:1,type:"array",transform:e=>"string"==typeof e?e.split(" "):e},{path:"settings.streaming.cmcd.includeInRequests",priority:2,type:"array",default:["segment","mpd"]}]},applyParametersFromMpd:{version:[1,2],sources:[{path:"settings.streaming.cmcd.applyParametersFromMpd",priority:1,type:"boolean",default:!0}]},eventTargets:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets",priority:1,type:"array",default:[]}]},targetEnabled:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].enabled",priority:1,type:"boolean",default:!0}]},targetUrl:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].url",priority:1,type:"string",default:null}]},targetKeys:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].enabledKeys",priority:1,type:"array",default:[]}]},targetEvents:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].events",priority:1,type:"array",default:[]}]},targetInterval:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].interval",priority:1,type:"number",default:r.default.CMCD_DEFAULT_TIME_INTERVAL}]},targetBatchSize:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].batchSize",priority:1,type:"number",default:0}]},targetIncludeInRequests:{version:[2],sources:[{path:"settings.streaming.cmcd.eventTargets[{targetIndex}].includeInRequests",priority:1,type:"array"},{path:"settings.streaming.cmcd.includeInRequests",priority:2,type:"array",default:["segment","mpd"]}]}};t.default=i},5212:function(e,t,n){n.r(t);var r=n(8735);t.default={STREAM:"stream",VIDEO:"video",ENHANCEMENT:"enhancement",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",LIVE_CATCHUP_MODE_STEP:"liveCatchupModeStep",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_LOWEST_STARTUP_DELAY:"lowestStartupDelay",TRACK_SELECTION_MODE_WIDEST_RANGE:"widestRange",CMCD_QUERY_KEY:r.CMCD_PARAM,CMCD_MODE_QUERY:r.CmcdTransmissionMode.QUERY,CMCD_MODE_HEADERS:r.CmcdTransmissionMode.HEADERS,CMCD_MODE_BODY:"body",CMCD_AVAILABLE_REQUESTS:["segment","mpd","xlink","steering","other"],CMCD_DEFAULT_TIME_INTERVAL:r.CMCD_DEFAULT_TIME_INTERVAL,CMCD_REPORTING_MODE:r.CmcdReportingMode,CMCD_KEYS:r.CMCD_KEYS,CMCD_REPORTING_EVENTS:r.CmcdEventType,CMCD_PLAYER_STATES:r.CmcdPlayerState,CMCD_DEFAULT_VERSION:1,CMCD_DEFAULT_INCLUDE_IN_REQUESTS:"segment",CMCD_CONTENT_TYPE_HEADER:{"Content-Type":"text/cmcd"},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",CTA_5004_2025_SCHEME:"urn:dashif:cta-5004:2025",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",ADV_URL_QUERY_INFO_SCHEME:"urn:mpeg:dash:urlparam:2025",URL_QUERY_STATE_PREFIX:/urn:mpeg:dash:state:/,MATRIX_COEFFICIENTS_SCHEME_ID_URI:"urn:mpeg:mpegB:cicp:MatrixCoefficients",TRANSFER_CHARACTERISTICS_SCHEME_ID_URI:"urn:mpeg:mpegB:cicp:TransferCharacteristics",SEGMENT_SEQUENCE_REPRESENTATION_SCHEME_ID_URI:"urn:mpeg:dash:ssr:2023",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(e,t,n){n.r(t),t.default={CLEARKEY_KEYSTEM_STRING:"org.w3.clearkey",CLEARKEY_UUID:"e2719d58-a985-b3c9-781a-b030af78d30e",ENCRYPTION_SCHEME_CBCS:"cbcs",ENCRYPTION_SCHEME_CENC:"cenc",FAIRPLAY_KEYSTEM_STRING:"com.apple.fps",FAIRPLAY_UUID:"94ce86fb-07ff-4f43-adb8-93d2fa968ca2",INITIALIZATION_DATA_TYPE_CENC:"cenc",INITIALIZATION_DATA_TYPE_KEYIDS:"keyids",INITIALIZATION_DATA_TYPE_SINF:"sinf",INITIALIZATION_DATA_TYPE_WEBM:"webm",MEDIA_KEY_MESSAGE_TYPES:{LICENSE_REQUEST:"license-request",LICENSE_RENEWAL:"license-renewal",LICENSE_RELEASE:"license-release",INDIVIDUALIZATION_REQUEST:"individualization-request"},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"},PLAYREADY_KEYSTEM_STRING:"com.microsoft.playready",PLAYREADY_RECOMMENDATION_KEYSTEM_STRING:"com.microsoft.playready.recommendation",PLAYREADY_UUID:"9a04f079-9840-4286-ab92-e65be0885f95",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"}},W3C_CLEARKEY_UUID:"1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",WIDEVINE_KEYSTEM_STRING:"com.widevine.alpha",WIDEVINE_UUID:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"}},1234:function(e,t,n){n.r(t);var r=n(8850),i=n(913),a=n(138),o=n(1191),s=n(5212),l=n(7568),u=n(8735),c=n(649),
2d=n(1613),f=n(3773),g=n(8898),h=n(893),p=n(6882);function m(){let e,t,n,a,m,E,T,_,y,S,I=this.context,A=(0,r.default)(I).getInstance(),R=(0,c.default)(I).getInstance();const N={[o.default.PLAYBACK_INITIALIZED]:s.default.CMCD_PLAYER_STATES.STARTING,[o.default.PLAYBACK_PAUSED]:s.default.CMCD_PLAYER_STATES.PAUSED,[o.default.PLAYBACK_ERROR]:s.default.CMCD_PLAYER_STATES.FATAL_ERROR,[o.default.PLAYBACK_ENDED]:s.default.CMCD_PLAYER_STATES.ENDED};let C={};function b(e){n&&n.update({sta:e}),F(s.default.CMCD_REPORTING_EVENTS.PLAY_STATE)}function D(){const t={version:e.getVersion(),transmissionMode:e.get("mode")===s.default.CMCD_MODE_HEADERS?u.CMCD_HEADERS:u.CMCD_QUERY,enabledKeys:e.get("keys"),eventTargets:e.getEventTargets().reduce((t,n,r)=>{if(!x(r))return t;const i=e.getEventTarget(r);return t.push({url:i.get("targetUrl"),events:i.get("targetEvents"),interval:i.get("targetInterval")??s.default.CMCD_DEFAULT_TIME_INTERVAL,batchSize:i.get("targetBatchSize")||1,enabledKeys:i.get("targetKeys")}),t},[])},n=e.get("sessionID");n&&(t.sid=n);const r=e.get("contentID");return r&&(t.cid=r),new u.CmcdReporter(t,v)}function v(e){return new Promise(t=>{const n=new d.default;n.url=e.url,n.method=e.method,n.headers=e.headers,n.body=e.body,n.type=l.HTTPRequest.CMCD_EVENT,S.load({request:n,success:()=>t({status:200}),error:e=>t({status:e?.status||500})})})}function M(){t.onPeriodSwitchComplete()}function w(){t.onPlaybackStarted()}function P(){t.onPlaybackPlaying(),b(s.default.CMCD_PLAYER_STATES.PLAYING)}function O(e){if(e.error?.data?.request?.type!==l.HTTPRequest.CMCD_EVENT){if(n){const t=e.error?.code||e.error?.data?.code;t&&n.update({ec:t})}F(s.default.CMCD_REPORTING_EVENTS.ERROR)}}function L(){y&&n&&(e.get("applyParametersFromMpd")??1)&&e.hasManifestParams()&&(y=!1,n.stop(!0),n=D(),n.start())}function F(e){if(!n)return;L();const r=t.getEventModeData(),i=t.calculateMsd();void 0!==i.msd&&n.update(i),n.recordEvent(e,r)}function U(r){if(n&&x()){L();try{const a=t.deriveCmcdDataForRequest(r),o=t.calculateMsd();void 0!==o.msd&&n.update(o);const l=n.createRequestReport(r,a);r.url=l.url,r.headers=l.headers,r.cmcd=l.customData?.cmcd||{},function(t){const n=e.get("mode"),r={url:t.url,mediaType:t.mediaType,requestType:t.type,cmcdData:t.cmcd,mode:n};if(n===s.default.CMCD_MODE_HEADERS)r.headers=t.headers;else try{const e=new URL(t.url);r.cmcdString=e.searchParams.get(u.CMCD_PARAM)||""}catch(e){r.cmcdString=""}A.trigger(i.default.CMCD_DATA_GENERATED,r)}(r)}catch(e){return T.warn(e),null}}}function x(t=null){return null!==t?function(t){if(2!==e.getVersion())return T.warn("CMCD version 2 is required for target configuration"),!1;const n=e.getEventTarget(t),r=n.get("targetEnabled"),i=n.get("targetUrl");return i?r&&i:(T.warn("Target URL is not configured"),!1)}(t)&&function(t){let n=e.getEventTarget(t).get("targetIncludeInRequests");if(!n)return!0;const r=s.default.CMCD_AVAILABLE_REQUESTS,i=n.filter(e=>!r.includes(e));return i.length===n.length?(T.error("None of the request types are supported."),!1):(i.forEach(e=>{T.warn(`request type ${e} is not supported.`)}),!0)}(t):function(){const t=e.getVersion();return 1!==t&&2!==t?(T.error(`version parameter must be 1 or 2, got ${t}.`),!1):e.isEnabled()}()&&function(){if(2===e.getVersion())return!0;const t=e.get("includeInRequests"),n=s.default.CMCD_AVAILABLE_REQUESTS,r=t.filter(e=>!n.includes(e));return r.length===t.length?(T.error("None of the request types are supported."),!1):(r.forEach(e=>{T.warn(`request type ${e} is not supported.`)}),!0)}()}function B(e){const r=t.onPlaybackRateChanged(e);n&&r&&n.update(r)}function k(e){if(t.updateCmcdManifestParamsInCmcdConfigAccessor(),y=!0,n){const r=t.onManifestLoaded(e);n.update(r)}}function G(e){t.onBufferLevelStateChanged(e)}function H(){t.onPlaybackSeeking(),b(s.default.CMCD_PLAYER_STATES.SEEKING)}function Y(){t.onPlaybackSeeked()}function q(){if(t.wasPlaying()){const e=t.getLastMediaTypeRequest();t.onRebufferingStarted(e),b(s.default.CMCD_PLAYER_STATES.REBUFFERING)}else b(s.default.CMCD_PLAYER_STATES.WAITING)}function V(e){const r=e.customData.request.type;if(!n||!x()||!t.isIncludedInRequestFilter(r))return e.cmcd=e.customData.request.cmcd,e;let i=e.customData.request;return U(i),{...e,url:i.url,headers:i.headers,cmcd:i.cmcd,customData:{...e.customData,cmcd:i.cmcd}}}function K(e){const r=e.request?.customData?.request?.type;return r===l.HTTPRequest.CMCD_EVENT||function(e){if(!n)return;L();const r=t.getEventModeData(),i=t.calculateMsd();void 0!==i.msd&&n.update(i);const a={};if(e.headers)try{const t=e.headers["cmsd-static"];t&&(a.cmsds=btoa(t));const n=e.headers["cmsd-dynamic"];n&&(a.cmsdd=btoa(n))}catch(e){T.warn("Failed to base64 encode CMSD headers, ignoring.",e)}try{n.recordResponseReceived(e,{...r,...a})}catch(e){T.error(e)}}(e),e}function j(){A.off(o.default.PLAYBACK_RATE_CHANGED,B,E),A.off(o.default.MANIFEST_LOADED,k,E),A.off(o.default.BUFFER_LEVEL_STATE_CHANGED,G,E),A.off(o.default.PLAYBACK_SEEKED,Y,E),A.off(o.default.PERIOD_SWITCH_COMPLETED,M,E),A.off(o.default.PLAYBACK_STARTED,w,E),A.off(o.default.MANIFEST_LOADING_STARTED,w,E),A.off(o.default.ERROR,O,E),A.off(o.default.PLAYBACK_PLAYING,P,E),A.off(o.default.PLAYBACK_SEEKING,H,E),A.off(o.default.PLAYBACK_WAITING,q,E),Object.keys(N).forEac
2h(e=>{A.off(e,C[e],E)}),n&&(n.stop(!0),n=null),t.resetInitialSettings()}return t=(0,g.default)(I).getInstance(),e=(0,p.default)(I).getInstance(),E={applyCmcdToRequest:U,getCmcdRequestInterceptors:function(){return[V]},getCmcdResponseReceivedInterceptors:function(){return[K]},getCmcdParametersFromManifest:function(){return t.getCmcdParametersFromManifest()},initialize:function(e){y=!1,function(e){A.on(o.default.PLAYBACK_RATE_CHANGED,B,E),A.on(o.default.MANIFEST_LOADED,k,E),A.on(o.default.BUFFER_LEVEL_STATE_CHANGED,G,E),A.on(o.default.PLAYBACK_SEEKED,Y,E),A.on(o.default.PERIOD_SWITCH_COMPLETED,M,E),e?A.on(o.default.MANIFEST_LOADING_STARTED,w,E):A.on(o.default.PLAYBACK_STARTED,w,E),A.on(o.default.ERROR,O,E)}(e),S||(S=(0,f.default)(I).create({errHandler:m,mediaPlayerModel:_,errors:h.default,dashMetrics:a})),n=D(),n.start(),A.on(o.default.PLAYBACK_PLAYING,P,E),A.on(o.default.PLAYBACK_SEEKING,H,E),A.on(o.default.PLAYBACK_WAITING,q,E),Object.entries(N).forEach(([e,t])=>{C[e]||(C[e]=()=>b(t)),A.on(e,C[e],E)})},isCmcdEnabled:x,reset:j,setConfig:function(n){n&&(n.dashMetrics&&(a=n.dashMetrics),n.mediaPlayerModel&&(_=n.mediaPlayerModel),n.errHandler&&(m=n.errHandler),n.urlLoader&&(S=n.urlLoader),n.serviceDescriptionController&&e.setManifestParamsProviderFunction(()=>{const e=n.serviceDescriptionController.getServiceDescriptionSettings();return e?.clientDataReporting?.cmcdParameters||null}),t.setConfig(n))}},T=R.getLogger(E),j(),E}m.__dashjs_factory_name="CmcdController",t.default=a.default.getSingletonFactory(m)},2473:function(e,t,n){n.r(t);var r=n(138),i=n(5212),a=n(7263);function o(){let e,t;function n(){t={}}return e={reset:function(){n()},processResponseHeaders:function(e){if(!(e&&e.headers&&e.request&&e.request.url))return;const n=e.headers[i.default.COMMON_ACCESS_TOKEN_HEADER];if(n){const r=a.default.getHostFromUrl(e.request.url);r&&(t[r]=n)}},getCommonAccessTokenForUrl:function(e){if(!e)return null;const n=a.default.getHostFromUrl(e);return n?t[n]?t[n]:null:void 0}},n(),e}o.__dashjs_factory_name="CommonAccessTokenController",t.default=r.default.getSingletonFactory(o)},5313:function(e,t,n){n.r(t);var r=n(138),i=n(7263),a=n(8854),o=n(5212),s=n(7568),l=n(649);function u(){let e,t,n;const r=this.context;function u(e,t,n,r,s){const l=function(e,t){let n=[];return n=t===a.default.PERIOD?e[a.default.SUPPLEMENTAL_PROPERTY]||[]:[...e[a.default.ESSENTIAL_PROPERTY]||[],...e[a.default.SUPPLEMENTAL_PROPERTY]||[]],n.find(e=>e.schemeIdUri===o.default.URL_QUERY_INFO_SCHEME&&e.UrlQueryInfo||e.schemeIdUri===o.default.EXT_URL_QUERY_INFO_SCHEME&&e.ExtUrlQueryInfo)}(t,s);!function(e,t,n,r){n.initialQueryString="";let i="";const a=e?.ExtUrlQueryInfo||e?.UrlQueryInfo;i=a&&a.queryString?t&&t.length>0?t+"&"+a.queryString:a.queryString:t,"true"===a?.useMPDUrlQuery&&r&&(i=i?i+"&"+r:r),n.initialQueryString=i}(l,r.initialQueryString,e,n),function(e,t,n){if(!e)return void(t.finalQueryString=n);const r=e?.ExtUrlQueryInfo?.queryTemplate||e?.UrlQueryInfo?.queryTemplate||"";t.finalQueryString=r===a.default.QUERY_PART?t?.initialQueryString:""}(l,e,r.finalQueryString),e.sameOriginOnly=l?.ExtUrlQueryInfo?.sameOriginOnly,e.queryParams=i.default.parseQueryParams(e?.finalQueryString),e.includeInRequests=function(e,t){return e?e.ExtUrlQueryInfo?.includeInRequests?e.ExtUrlQueryInfo.includeInRequests.split(" "):[a.default.SEGMENT_TYPE]:t}(l,r.includeInRequests)}return t=(0,l.default)(r).getInstance().getLogger(e),e={getFinalQueryString:function(e){try{if(!n)return null;if(e.type===s.HTTPRequest.MEDIA_SEGMENT_TYPE||e.type===s.HTTPRequest.INIT_SEGMENT_TYPE){const t=e.representation;if(!t)return null;const r=t.adaptation,i=r.period,o=n.period[i.index].adaptation[r.index].representation[t.index],s=new URL(e.url),l=!o.sameOriginOnly||n.origin===s.origin;if(o.includeInRequests.includes(a.default.SEGMENT_TYPE)&&l)return o.queryParams}else if(e.type===s.HTTPRequest.MPD_TYPE){if([a.default.MPD_TYPE,a.default.MPD_PATCH_TYPE].some(e=>n.includeInRequests.includes(e)))return n.queryParams}else if(e.type===s.HTTPRequest.CONTENT_STEERING_TYPE&&n.includeInRequests.includes(a.default.STEERING_TYPE))return n.queryParams}catch(e){return t.error(e),null}},createFinalQueryStrings:function(e){n={origin:new URL(e.url).origin,period:[]};const t=e.url.split("?")[1];u(n,e,t,{initialQueryString:"",includeInRequests:[]}
2,a.default.MPD),e.Period.forEach(e=>{const r={adaptation:[]};u(r,e,t,n,a.default.PERIOD),e.AdaptationSet.forEach(e=>{const n={representation:[]};u(n,e,t,r,a.default.ADAPTATION_SET),e.Representation.forEach(e=>{const r={};u(r,e,t,n,a.default.REPRESENTATION),n.representation.push(r)}),r.adaptation.push(n)}),n.period.push(r)})}},e}u.__dashjs_factory_name="ExtUrlQueryInfoController",t.default=r.default.getSingletonFactory(u)},4469:function(e,t,n){n.r(t),n.d(t,{default:function(){return z}});class r{constructor(){this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null}}r.SSL_CONNECTION_FAILED_PREFIX="SSL",r.DNS_RESOLUTION_FAILED="C00",r.HOST_UNREACHABLE="C01",r.CONNECTION_REFUSED="C02",r.CONNECTION_ERROR="C03",r.CORRUPT_MEDIA_ISOBMFF="M00",r.CORRUPT_MEDIA_OTHER="M01",r.BASE_URL_CHANGED="F00",r.BECAME_REPORTER="S00";var i=r,a=n(913),o=n(138);function s(e){let t,n;const r=(e=e||{}).eventBus,o=e.dashMetrics,s=e.metricsConstants,l=e.events;function u(e){let t=new i;if(n){for(const n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.mpdurl||(t.mpdurl=n.originalUrl||n.url),t.terror||(t.terror=new Date),o.addDVBErrors(t)}}function c(e){e.error||(n=e.manifest)}function d(e){u({errorcode:i.BASE_URL_CHANGED,servicelocation:e.entry})}function f(){u({errorcode:i.BECAME_REPORTER})}function g(e){var t;e.metric===s.HTTP_REQUEST&&(0===(t=e.value).responsecode||null==t.responsecode||t.responsecode>=400||t.responsecode<100||t.responsecode>=600)&&u({errorcode:t.responsecode||i.CONNECTION_ERROR,url:t.url,terror:t.tresponse,servicelocation:t._serviceLocation})}function h(e){let t;switch(e.error?e.error.code:0){case MediaError.MEDIA_ERR_NETWORK:t=i.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:t=i.CORRUPT_MEDIA_OTHER;break;default:return}u({errorcode:t})}return t={initialize:function(){r.on(l.MANIFEST_UPDATED,c,t),r.on(l.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,d,t),r.on(l.METRIC_ADDED,g,t),r.on(l.METRIC_UPDATED,g,t),r.on(l.PLAYBACK_ERROR,h,t),r.on(a.default.BECAME_REPORTING_PLAYER,f,t)},reset:function(){r.off(l.MANIFEST_UPDATED,c,t),r.off(l.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,d,t),r.off(l.METRIC_ADDED,g,t),r.off(l.METRIC_UPDATED,g,t),r.off(l.PLAYBACK_ERROR,h,t),r.off(a.default.BECAME_REPORTING_PLAYER,f,t)}},t}s.__dashjs_factory_name="DVBErrorsTranslator";var l=o.default.getSingletonFactory(s),u=n(7377);function c(e){e=e||{};let t,n,r=!1,i=this.context,a=e.mediaElement;return t={initialize:function(e){e&&e.length&&(e.forEach(e=>{let t=e.starttime,r=t+e.duration;n.add(t,r)}),r=!!e[0]._useWallClockTime)},reset:function(){n.clear()},isEnabled:function(){let e,t=n.length;if(!t)return!0;e=r?(new Date).getTime()/1e3:a.currentTime;for(let r=0;r<t;r+=1){let t=n.start(r),i=n.end(r);if(t<=e&&e<i)return!0}return!1}},n=(0,u.default)(i).create(),t}c.__dashjs_factory_name="RangeController";var d=o.default.getClassFactory(c);function f(){return{serialise:function e(t){let n,r,i=[],a=[];for(n in t)if(t.hasOwnProperty(n)&&0!==n.indexOf("_")){if(r=t[n],null==r&&(r=""),Array.isArray(r)){if(!r.length)continue;a=[],r.forEach(function(t){let n="Object"!==Object.prototype.toString.call(t).slice(8,-1);a.push(n?t:e(t))}),r=a.map(encodeURIComponent).join(",")}else"string"==typeof r?r=encodeURIComponent(r):r instanceof Date?r=r.toISOString():"number"==typeof r&&(r=Math.round(r));i.push(n+"="+r)}return i.join("&")}}}f.__dashjs_factory_name="MetricSerialiser";var g=o.default.getSingletonFactory(f);function h(){let e,t,n,r=window.crypto||window.msCrypto,i=Uint32Array,a=Math.pow(2,8*i.BYTES_PER_ELEMENT)-1;function o(){r&&(e||(e=new i(10)),r.getRandomValues(e),t=0)}return n={random:function(n,i){let s;return n||(n=0),i||(i=1),r?(t===e.length&&o(),s=e[t]/a,t+=1):s=Math.random(),s*(i-n)+n}},o(),n}h.__dashjs_factory_name="RNG";var p=o.default.getSingletonFactory(h),m=n(1926),E=n(8261);function T(e){let t;e=e||{};let n,r,i,a,o,s,l,u=this.context,c=(0,E.default)(u).getInstance(),d=[];const f=e.metricsConstants;function h(){a=!1,o=!1,s=null,l=null}return t={report:function(e,t){Array.isArray(t)||(t=[t]),o&&l.isEnabled()&&t.forEach(function(t){let i=n.serialise(t);e!==f.DVB_ERRORS&&(i=`metricname=${e}&${i}`),i=`${s}?${i}`,function(e,t,n){let i=new XMLHttpRequest;i.withCredentials=r.getXHRWithCredentialsForType(f.HTTP_REQUEST_DVB_REPORTING_TYPE);const a=function(){let e=d.indexOf(i);-1!==e&&(d.splice(e,1),!(i.status>=200&&i.status<300)&&n&&n())};d.push(i);try{i.open("GET",e),i.onloadend=a,i.onerror=a,i.send()}
2catch(e){i.onerror()}}(i,0,function(){o=!1})})},initialize:function(e,t){let n;if(l=t,s=c.get().streaming.dvbReporting.reportingUrl||e.dvbReportingUrl,!s)throw new Error('MPD parameter missing "dvb:reportingUrl" or URL not provided in player settings');a||(n=e.dvbProbability,n&&(1e3===n||n/1e3>=i.random())&&(o=!0),a=!0)},reset:function(){h()}},n=g(u).getInstance(),i=p(u).getInstance(),r=(0,m.default)(u).getInstance(),h(),t}T.__dashjs_factory_name="DVBReporting";var _=o.default.getClassFactory(T);function y(e){e=e||{};const t={"urn:dvb:dash:reporting:2014":_},n=this.context;let r;const i=e.debug?e.debug.getLogger(r):{},a=e.metricsConstants,o=e.mediaPlayerModel||{};return r={create:function(e,r){let s;try{s=t[e.schemeIdUri](n).create({metricsConstants:a,mediaPlayerModel:o}),s.initialize(e,r)}catch(t){s=null,i.error(`ReportingFactory: could not create Reporting with schemeIdUri ${e.schemeIdUri} (${t.message})`)}return s},register:function(e,n){t[e]=n},unregister:function(e){delete t[e]}},r}y.__dashjs_factory_name="ReportingFactory";var S=o.default.getSingletonFactory(y);function I(e){let t,n=[];const r=S(this.context).getInstance(e);return t={initialize:function(e,t){e.some(e=>{let i=r.create(e,t);if(i)return n.push(i),!0})},reset:function(){n.forEach(e=>e.reset()),n=[]},report:function(e,t){n.forEach(n=>n.report(e,t))}},t}I.__dashjs_factory_name="ReportingController";var A=o.default.getClassFactory(I);function R(){return{reconstructFullMetricName:function(e,t,n){let r=e;return t&&(r+="("+t,n&&n.length&&(r+=","+n),r+=")"),r},validateN:function(e){if(!e)throw new Error("missing n");if(isNaN(e))throw new Error("n is NaN");if(e<0)throw new Error("n must be positive");return e}}}R.__dashjs_factory_name="HandlerHelpers";var N=o.default.getSingletonFactory(R);function C(e){let t,n,r,i,a,o;e=e||{};let s=this.context,l=N(s).getInstance(),u=[];const c=e.metricsConstants;function d(){let e=function(){try{return Object.keys(u).map(e=>u[e]).reduce((e,t)=>e.level<t.level?e:t)}catch(e){return}}();e&&o!==e.t&&(o=e.t,n.report(i,e))}return t={initialize:function(e,t,o){t&&(r=l.validateN(o),n=t,i=l.reconstructFullMetricName(e,o),a=setInterval(d,r))},reset:function(){clearInterval(a),a=null,r=0,n=null,o=null},handleNewMetric:function(e,t,n){e===c.BUFFER_LEVEL&&(t.level<0?delete u[n]:u[n]=t)}},t}C.__dashjs_factory_name="BufferLevelHandler";var b=o.default.getClassFactory(C),D=o.default.getClassFactory(function(e){let t,n,r=(e=e||{}).eventBus;const i=e.metricsConstants;function o(){r.off(a.default.METRICS_INITIALISATION_COMPLETE,o,this),r.trigger(a.default.BECAME_REPORTING_PLAYER)}return t={initialize:function(e,t){t&&(n=t,r.on(a.default.METRICS_INITIALISATION_COMPLETE,o,this))},reset:function(){n=null},handleNewMetric:function(e,t){e===i.DVB_ERRORS&&n&&n.report(e,t)}},t});function v(e){let t,n,r,i,a,o;e=e||{};let s=[],l=N(this.context).getInstance();const u=e.metricsConstants;function c(){var e=s;e.length&&n&&n.report(a,e),s=[]}return t={initialize:function(e,t,s,u){t&&(r=l.validateN(s),n=t,u&&u.length&&(i=u),a=l.reconstructFullMetricName(e,s,u),o=setInterval(c,r))},reset:function(){clearInterval(o),o=null,r=null,i=null,s=[],n=null},handleNewMetric:function(e,t){e===u.HTTP_REQUEST&&(i&&i!==t.type||s.push(t))}},t}v.__dashjs_factory_name="HttpListHandler";var M=o.default.getClassFactory(v);function w(){let e,t,n;return e={initialize:function(e,r){t=e,n=r},reset:function(){n=null,t=void 0},handleNewMetric:function(e,r){e===t&&n&&n.report(t,r)}},e}w.__dashjs_factory_name="GenericMetricHandler";var P=o.default.getClassFactory(w);function O(e){let t;const n=(e=e||{}).debug?e.debug.getLogger(t):{};let r=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/;const i=this.context;let a={BufferLevel:b,DVBErrors:D,HttpList:M,PlayList:P,RepSwitchList:P,TcpList:P};return t={create:function(t,o){var s,l=t.match(r);if(l){try{(s=a[l[1]](i).create({eventBus:e.eventBus,metricsConstants:e.metricsConstants})).initialize(l[1],o,l[3],l[5])}catch(e){s=null,n.error(`MetricsHandlerFactory: Could not create handler for type ${l[1]} with args ${l[3]}, ${l[5]} (${e.message})`)}return s}},register:function(e,t){a[e]=t},unregister:function(e){delete a[e]}},t}O.__dashjs_factory_name="MetricsHandlerFactory";var L=o.default.getSingletonFactory(O);function F(e){e=e||{};let t,n=[];const r=this.context,i=e.eventBus,a=e.events;let o=L(r).getInstance({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants});
2function s(e){n.forEach(t=>{t.handleNewMetric(e.metric,e.value,e.mediaType)})}return t={initialize:function(e,r){e.split(",").forEach((e,t,i)=>{let a;if(-1!==e.indexOf("(")&&-1===e.indexOf(")")){let n=i[t+1];n&&-1===n.indexOf("(")&&-1!==n.indexOf(")")&&(e+=","+n,delete i[t+1])}a=o.create(e,r),a&&n.push(a)}),i.on(a.METRIC_ADDED,s,t),i.on(a.METRIC_UPDATED,s,t)},reset:function(){i.off(a.METRIC_ADDED,s,t),i.off(a.METRIC_UPDATED,s,t),n.forEach(e=>e.reset()),n=[]}},t}F.__dashjs_factory_name="MetricsHandlersController";var U=o.default.getClassFactory(F);function x(e){let t,n,r,i;e=e||{};let a=this.context;function o(){t&&t.reset(),n&&n.reset(),r&&r.reset()}return i={initialize:function(i){try{r=d(a).create({mediaElement:e.mediaElement}),r.initialize(i.Range),n=A(a).create({debug:e.debug,metricsConstants:e.metricsConstants,mediaPlayerModel:e.mediaPlayerModel}),n.initialize(i.Reporting,r),t=U(a).create({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants,events:e.events}),t.initialize(i.metrics,n)}catch(e){throw o(),e}},reset:o},i}x.__dashjs_factory_name="MetricsController";var B=o.default.getClassFactory(x),k=class{constructor(){this.metrics="",this.Range=[],this.Reporting=[]}},G=class{constructor(){this.starttime=0,this.duration=1/0,this._useWallClockTime=!1}},H=class{constructor(){this.schemeIdUri="",this.value="",this.dvbReportingUrl="",this.dvbProbability=1e3}};function Y(e){let t,n=(e=e||{}).adapter;const r=e.constants;return t={getMetrics:function(e){let t=[];return e&&e.Metrics&&e.Metrics.forEach(i=>{var a=new k,o=n.getIsDynamic(e);i.hasOwnProperty("metrics")&&(a.metrics=i.metrics,i.Range&&i.Range.forEach(t=>{var i=new G;i.starttime=function(e,t,i){let a,o,s=0;return t?s=n.getAvailabilityStartTime(e)/1e3:(a=n.getRegularPeriods(e),a.length&&(s=a[0].start)),o=s,i&&i.hasOwnProperty(r.START_TIME)&&(o+=i.starttime),o}(e,o,t),t.hasOwnProperty("duration")?i.duration=t.duration:i.duration=n.getDuration(e),i._useWallClockTime=o,a.Range.push(i)}),i.Reporting&&(i.Reporting.forEach(e=>{var t=new H;e.hasOwnProperty(r.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty("value")&&(t.value=e.value),e.hasOwnProperty(r.DVB_REPORTING_URL)&&(t.dvbReportingUrl=e[r.DVB_REPORTING_URL]),e.hasOwnProperty(r.DVB_PROBABILITY)&&(t.dvbProbability=e[r.DVB_PROBABILITY]),a.Reporting.push(t))}),t.push(a)))}),t}},t}Y.__dashjs_factory_name="ManifestParsing";var q=o.default.getSingletonFactory(Y);function V(e){let t;e=e||{};let n={},r=this.context,i=e.eventBus;const o=e.events;function s(t){if(t.error)return;let o=Object.keys(n);q(r).getInstance({adapter:e.adapter,constants:e.constants}).getMetrics(t.manifest).forEach(t=>{const i=JSON.stringify(t);if(n.hasOwnProperty(i))o.splice(i,1);else try{let a=B(r).create(e);a.initialize(t),n[i]=a}catch(e){}}),o.forEach(e=>{n[e].reset(),delete n[e]}),i.trigger(a.default.METRICS_INITIALISATION_COMPLETE)}function l(){Object.keys(n).forEach(e=>{n[e].reset()}),n={}}return t={reset:function(){i.off(o.MANIFEST_UPDATED,s,t),i.off(o.STREAM_TEARDOWN_COMPLETE,l,t)}},i.on(o.MANIFEST_UPDATED,s,t),i.on(o.STREAM_TEARDOWN_COMPLETE,l,t),t}V.__dashjs_factory_name="MetricsCollectionController";var K=o.default.getClassFactory(V);function j(){let e,t,n=this.context;return e={createMetricsReporting:function(e){return t=l(n).getInstance({eventBus:e.eventBus,dashMetrics:e.dashMetrics,metricsConstants:e.metricsConstants,events:e.events}),t.initialize(),K(n).create(e)},getReportingFactory:function(){return S(n).getInstance()},getMetricsHandlerFactory:function(){return L(n).getInstance()}},e}j.__dashjs_factory_name="MetricsReporting";const W=o.default.getClassFactory(j);W.events=a.default,o.default.updateClassFactory(j.__dashjs_factory_name,W);var z=W},913:function(e,t,n){n.r(t);var r=n(7252);class i extends r.default{constructor(){super(),this.METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",this.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",this.CMCD_DATA_GENERATED="cmcdDataGenerated"}}let a=new i;t.default=a},8898:function(e,t,n){n.r(t);var r=n(8735),i=n(7568),a=n(1191),o=n(7263),s=n(5212),l=n(138),u=n(9302),c=n(6882);const d={[i.HTTPRequest.INIT_SEGMENT_TYPE]:"segment",[i.HTTPRequest.MEDIA_SEGMENT_TYPE]:"segment",[i.HTTPRequest.XLINK_EXPANSION_TYPE]:"xlink",[i.HTTPRequest.MPD_TYPE]:"mpd",[i.HTTPRequest.CONTENT_STEERING_TYPE]:"steering",[i.HTTPRequest.OTHER_TYPE]:"other"};function f(){let e,t,n,l,f,g,h,p,m,E,T,_,y,S,I,A,R={},N={},C=this.context;function b(){h=(0,c.default)(C).getInstance(),K()}function D(e){return null!=e&&!isNaN(e)&&isFinite(e)}function v(e,t){const n=[];return D(e)&&n.push((0,r.toCmcdValue)(e,{v:!0})),D(t)&&n.push((0,r.toCmcdValue)(t,{a:!0})),n.length>0?n:null}function M(e,n){w(n);const i=V(n),a=function(e){try{return parseInt(e.bandwidth/1e3)}catch(e){return null}}(e),u=function(e){try{return isNaN(e.duration)?NaN:Math.round(1e3*e.duration)}catch(e){return null}}(e),c=k(n),d=function(e){try{const n=l?l.getPlaybackRate():1,r=t.getCurrentBufferLevel(e);return isNaN(n)||isNaN(r)?null:100*parseInt(r/n*10)}catch(e){return null}}(n),f=H(n),g=O(e.representation?.mediaInfo),p=B(n),_=L(n),y=function(e){if(S&&0!==S.length)for(let t of S)if(t.getType()===e)return t.probeNextRequest()}(n);let I;n===s.default.VIDEO&&(I=r.CmcdObjectType.VIDEO),n===s.default.AUDIO&&(I=r.CmcdObjectType.AUDIO),e.mediaType===s.default.ENHANCEMENT&&(I=r.CmcdObjectType.OTHER),n===s.default.TEXT&&(I="application/mp4"===e.representation.mediaInfo.mimeType?r.CmcdObjectType.TIMED_TEXT:r.CmcdObjectType.CAPTION);const A=h.has("rtp")?h.get("rtp"):function(e){try{let t=l.getPlaybackRate();t||(t=1);let{bandwidth:n,mediaType:r,representation:i,duration:a}=e;if(!i.mediaInfo)return NaN;let o=H(r);0===o&&(o=500);let s=n*a/1e3/(o/t/1e3);const u=h.get("rtpSafetyFactor",{defaultValue:5});return 100*(parseInt(s*u/100)+1)}catch(e){return NaN}}(e);if(isNaN(A)||(i.rtp=A),y&&e.url!==y.url){const t=o.default.getRelativeUrl(e.url,y.url),n=y.range?{r:y.range}:void 0;i.nor=[(0,r.toCmcdValue)(t,n)]}if(a){const e=n===s.default.VIDEO?a:null,t=n===s.default.AUDIO?a:null;i.br=v(e,t)||[(0,r.toCmcdValue)(a,{})]}if(I&&(i.ot=I),isNaN(u)||(i.d=u),!isNaN(c)){const e=n===s.default.VIDEO?c:null,t=n===s.default.AUDIO?c:null;i.mtp=v(e,t)||[(0,r.toCmcdValue)(c,{})]}if(isNaN(d)||(i.dl=d),!isNaN(f)){const e=n===s.default.VIDEO?f:null,t=n===s.default.AUDIO?f:null;i.bl=v(e,t)||[(0,r.toCmcdValue)(f,{})]}if(!isNaN(g)&&isFinite(g)){const e=n===s.default.VIDEO?g:null,t=n===s.default.AUDIO?g:null;i.tb=v(e,t)||[(0,r.toCmcdValue)(g,{})]}if(null!==p&&!isNaN(p)){const e=n===s.default.VIDEO?p:null,t=n===s.default.AUDIO?p:null;i.tpb=v(e,t)||[(0,r.toCmcdValue)(p,{})]}if(null!==_&&!isNaN(_)){const e=n===s.default.VIDEO?_:null,t=n===s.default.AUDIO?_:null;i.pb=v(e,t)||[(0,r.toCmcdValue)(_,{})]}if(E[n]&&(i.bs=!0,E[n]=!1),N[n]){const e=n===s.default.VIDEO?N[n]:null,t=n===s.default.AUDIO?N[n]:null;i.bsd=v(e,t)||[(0,r.toCmcdValue)(N[n],{})],delete N[n]}return!m[n]&&T[n]||(i.su=!0,m[n]=!1,T[n]=!0),Object.assign(i,$()),i}function w(e){T.hasOwnProperty(e)||(T[e]=!1),m.hasOwnProperty(e)||(m[e]=!1),E.hasOwnProperty(e)||(E[e]=!1)}function P(){const e={},t=l.getStreamController()?.getActiveStream();if(!t)return e;const n=t.getCurrentRepresentationForType(s.default.VIDEO),r=t.getCurrentRepresentationForType(s.default.AUDIO),i=v(n?Math.round(n.bitrateInKbit):null,r?Math.round(r.bitrateInKbit):null);return i&&(e.br=i),e}
2function O(e){try{const t=f.getPossibleVoRepresentationsFilteredBySettings(e).map(e=>e.bitrateInKbit);return Math.max(...t)}catch(e){return null}}function L(e){try{if(!S||0===S.length)return null;const t=S.find(t=>t.getType()===e),n=t?.getRepresentationController()?.getCurrentRepresentation()?.bitrateInKbit;return void 0===n||isNaN(n)?null:Math.round(n)}catch(e){return null}}function F(){const e={},t=v(L(s.default.VIDEO),L(s.default.AUDIO));return t&&(e.pb=t),e}function U(e){if(!S||0===S.length)return null;const t=S.find(t=>t.getType()===e);if(!t)return null;const n=O(t.getMediaInfo());return isFinite(n)&&n>0?n:null}function x(){const e={},t=v(U(s.default.VIDEO),U(s.default.AUDIO));t&&(e.tb=t);const n=v(B(s.default.VIDEO),B(s.default.AUDIO));return n&&(e.tpb=n),e}function B(e){try{if(!S||0===S.length)return null;const t=S.find(t=>t.getType()===e);if(t){const e=O(t.getMediaInfo());return isFinite(e)&&e>0?e:null}return null}catch(e){return null}}function k(e){try{return 100*parseInt(g.getSafeAverageThroughput(e)/100)}catch(e){return null}}function G(){const e={},t=v(k(s.default.VIDEO),k(s.default.AUDIO));return t&&(e.mtp=t),e}function H(e){try{const n=t.getCurrentBufferLevel(e);return isNaN(n)?null:100*parseInt(10*n)}catch(e){return null}}function Y(){const e={},t=v(H(s.default.VIDEO),H(s.default.AUDIO));return t&&(e.bl=t),e}function q(e){null!=R[e]&&(N[e]=Date.now()-R[e],delete R[e])}function V(e){const n={};let r=1e3*l.getCurrentLiveLatency();if(isNaN(r)||(n.ltc=r),"undefined"!=typeof document&&document.hidden&&(n.bg=!0),e&&function(e){return e===s.default.VIDEO||e===s.default.AUDIO||e===s.default.OTHER}(e)){const e=t.getCurrentDroppedFrames()?.droppedFrames;e>0&&(n.df=e)}return n}function K(){E={},m={},T={},y=!1,p=void 0,_=void 0,R={},N={},I=void 0,A=void 0,j()}function j(){if(!l)return;const e=l.getStreamController();if(!e)return;if("function"!=typeof e.getActiveStream)return;const t=e.getActiveStream();t&&(S=t.getStreamProcessors())}function W(){let e={};if(n){const t=n.getServiceDescriptionSettings();t.clientDataReporting&&t.clientDataReporting.cmcdParameters&&(e=t.clientDataReporting.cmcdParameters)}return e}function z(e,t){const n=t??h.get("includeInRequests"),r=d[e];return void 0!==r&&n.includes(r)}function $(){const e={},t=l.getStreamController()?.getActiveStream();if(!t)return e;const n=t.getCurrentRepresentationForType(s.default.VIDEO),r=t.getCurrentRepresentationForType(s.default.AUDIO),i=n?n.bitrateInKbit:0,a=r?r.bitrateInKbit:0,o=v(i>0?Math.round(i):null,a>0?Math.round(a):null);o&&(e.ab=o);const u=t.getRepresentationsByType(s.default.VIDEO)||[],c=t.getRepresentationsByType(s.default.AUDIO)||[],d=u.reduce((e,t)=>Math.max(e,t.bitrateInKbit),0),f=c.reduce((e,t)=>Math.max(e,t.bitrateInKbit),0),g=v(d>0?Math.round(d):null,f>0?Math.round(f):null);g&&(e.tab=g);const h=u.length>0?Math.min(...u.map(e=>e.bitrateInKbit)):0,p=c.length>0?Math.min(...c.map(e=>e.bitrateInKbit)):0,m=v(h>0?Math.round(h):null,p>0?Math.round(p):null);return m&&(e.lab=m),e}return e={calculateMsd:function(){const e={},t=_?Date.now()-_:null;return null===t||isNaN(t)||(e.msd=t),e},deriveCmcdDataForRequest:function(e){try{e.type,(t=e.mediaType)!==s.default.VIDEO&&t!==s.default.AUDIO||p&&p!==s.default.AUDIO||(p=t);let n={};if(z(e.type)){if(e.type===i.HTTPRequest.MPD_TYPE)return function(){const e=V();return e.ot=r.CmcdObjectType.MANIFEST,e}();if(e.type===i.HTTPRequest.MEDIA_SEGMENT_TYPE)return w(e.mediaType),M(e,e.mediaType);if(e.type===i.HTTPRequest.INIT_SEGMENT_TYPE)return function(){const e=V();return e.ot=r.CmcdObjectType.INIT,e.su=!0,e}();if(e.type===i.HTTPRequest.OTHER_TYPE||e.type===i.HTTPRequest.XLINK_EXPANSION_TYPE)return function(){const e=V();return e.ot=r.CmcdObjectType.OTHER,e}();if(e.type===i.HTTPRequest.LICENSE)return function(){const e=V();return e.ot=r.CmcdObjectType.KEY,e}();if(e.type===i.HTTPRequest.CONTENT_STEERING_TYPE)return function(e){const t=p?M(e,p):V();return t.ot=r.CmcdObjectType.OTHER,t}(e)}return n}catch(e){return null}var t},getCmcdParametersFromManifest:W,getEventModeData:function(){return{...V(),...$(),...P(),...Y(),...G(),...F(),...x()}},getLastMediaTypeRequest:function(){return p},isIncludedInRequestFilter:z,onBufferLevelStateChanged:function(e){try{e.state&&e.mediaType&&e.state===a.default.BUFFER_EMPTY&&(E[e.mediaType]||(E[e.mediaType]=!0),m[e.mediaType]||(m[e.mediaType]=!0))}catch(e){}},onManifestLoaded:function(e){try{const t=(0,u.default)(C).getInstance().getIsDynamic(e.data);return I=t?`${r.CmcdStreamType.LIVE}`:`${r.CmcdStreamType.VOD}`,A=e.protocol&&"MSS"===e.protocol?`${r.CmcdStreamingFormat.SMOOTH}`:`${r.CmcdStreamingFormat.DASH}`,{st:I,sf:A}}catch(e){return{}}},onPeriodSwitchComplete:function(){j()},onPlaybackPlaying:function(){for(const e in R)R.hasOwnProperty(e)&&q(e)},onPlaybackRateChanged:function(e){return void 0!==e.playbackRate?{pr:e.playbackRate}:null},onPlaybackSeeked:function(){y=!1;for(let e in E)E.hasOwnProperty(e)&&(E[e]=!0);for(let e in m)m.hasOwnProperty(e)&&(m[e]=!0)},onPlaybackSeeking:function(){y=!0},onPlaybackStarted:function(){_||(_=Date.now())},onRebufferingCompleted:q,onRebufferingStarted:function(e){e&&!R[e]&&(R[e]=Date.now())},reset:function(){K()},resetInitialSettings:K,setConfig:function(e){e&&(e.abrController&&(f=e.abrController),e.dashMetrics&&(t=e.dashMetrics),e.playbackController&&(l=e.playbackController),e.throughputController&&(g=e.throughputController),e.serviceDescriptionController&&(n=e.serviceDescriptionController))}
2,setup:b,updateCmcdManifestParamsInCmcdConfigAccessor:function(){const e=W();h&&Object.keys(e).length>0?h.setManifestParams(e):h&&h.setManifestParams(null)},wasPlaying:function(){return!y&&_}},b(),e}f.__dashjs_factory_name="CmcdModel",t.default=l.default.getSingletonFactory(f)},6066:function(e,t,n){n.r(t);var r=n(138),i=n(8850),a=n(3621),o=n(649),s=n(1103);const l=s.CMSD_STATIC.toLowerCase(),u=s.CMSD_DYNAMIC.toLowerCase(),c=["mb","st","sf","v"],d="stream",f={video:s.CmsdObjectType.VIDEO,audio:s.CmsdObjectType.AUDIO,text:s.CmsdObjectType.TIMED_TEXT,stream:d};function g(){const e=this.context,t=(0,i.default)(e).getInstance();let n,r,g,h;function p(){g={},h={}}function m(e){e&&Object.keys(e).forEach(t=>{c.includes(t)||delete e[t]})}function E(e){try{return(0,s.decodeCmsdStatic)(e)}catch(e){r.error("Failed to parse CMSD-Static response header value:",e)}}function T(e){try{const t=(0,s.decodeCmsdDynamic)(e),n=t[t.length-1];return n?.params||{}}catch(e){return r.error("Failed to parse CMSD-Dynamic response header value:",e),{}}}function _(e){return f[e]||s.CmsdObjectType.OTHER}function y(e,t,n){const r=e===s.CMSD_STATIC?g:h,i=r[t]||{},a=r[d]||{};return i[n]||a[n]}return n={setConfig:function(){},initialize:function(){},reset:function(){p()},parseResponseHeaders:function(e,n){let r=null,i=null;for(const n in e){const o=e[n];switch(n){case l:r=E(o),t.trigger(a.default.CMSD_STATIC_HEADER,r);break;case u:i||(i=T(o))}}let o=d;return r&&r.ot?o=r.ot:n&&(o=_(n)),m(g[o]),m(h[o]),r&&(g[o]=Object.assign(g[o]||{},r)),i&&(h[o]=Object.assign(h[o]||{},i)),{static:r,dynamic:i}},getMaxBitrate:function(e){let t=_(e);return y(s.CMSD_DYNAMIC,t,"mb")||-1},getEstimatedThroughput:function(e){let t=_(e);return y(s.CMSD_DYNAMIC,t,"etp")||null},getResponseDelay:function(e){let t=_(e);return y(s.CMSD_DYNAMIC,t,"rd")||null},getRoundTripTime:function(e){let t=_(e);return y(s.CMSD_DYNAMIC,t,"rtt")||null}},r=(0,o.default)(e).getInstance().getLogger(n),p(),n}g.__dashjs_factory_name="CmsdModel",t.default=r.default.getSingletonFactory(g)},1926:function(e,t,n){n.r(t);var r=n(5717),i=n(138),a=n(8261),o=n(656),s=n(5212),l=n(1234),u=n(5560);function c(){let e,t,n,i,c,d,f,g,h,p,m,E,T,_;const y=this.context,S=(0,a.default)(y).getInstance();function I(){d=[],h=[],f=[],g=[],p=[],T=[],m=null,t=[],i=_.getCmcdRequestInterceptors(),c=_.getCmcdResponseReceivedInterceptors(),E=new Set}function A(e,t){let n=-1;e.some((e,r)=>{if(e===t)return n=r,!0}),n<0||e.splice(n,1)}function R(e){let t;for(t=0;t<T.length;t++)if(T[t].rulename===e)return t;return-1}function N(e,t){let n=!1;return E.forEach(r=>{r[e]===t&&(n=!0)}),n}function C(e,n){b(e,n);let i=new r.default;i.schemeIdUri=e,i.value=n,t.push(i)}function b(e,n){(0,o.checkParameterType)(e,"string"),(0,o.checkParameterType)(n,"string"),t.forEach(function(r,i){r.schemeIdUri===e&&r.value===n&&t.splice(i,1)})}return e={addAbrCustomRule:function(e,t,n){if("string"!=typeof e||e!==s.default.RULES_TYPES.ABANDON_FRAGMENT_RULES&&e!==s.default.RULES_TYPES.QUALITY_SWITCH_RULES||"string"!=typeof t)throw s.default.BAD_ARGUMENT_ERROR;let r=R(t);-1===r?T.push({type:e,rulename:t,rule:n}):(T[r].type=e,T[r].rule=n)},addExternalSubtitle:function(e){if(!(e&&void 0!==e.id&&e.url&&e.language&&e.mimeType&&void 0!==e.bandwidth))return;const t=new u.default(e);N("url",t.url)||N("id",t.id)||E.add(t)},addRequestInterceptor:function(e){i.push(e)},addResponseInterceptor:function(e){c.push(e)},addUTCTimingSource:C,clearDefaultUTCTimingSources:function(){t=[]},getAbrCustomRules:function(){return T},getCertificateRequestFilters:function(){return f},getCertificateResponseFilters:function(){return g},getCustomCapabilitiesFilters:function(){return p},getCustomInitialTrackSelectionFunction:function(){return m},getExternalSubtitles:function(){return E},getLicenseRequestFilters:function(){return d},getLicenseResponseFilters:function(){return h},getRequestInterceptors:function(){return i},getResponseInterceptors:function(){return c},getUTCTimingSources:function(){return t},getXHRWithCredentialsForType:function(e){const t=n[e];return void 0===t?n.default:t},registerCertificateRequestFilter:function(e){f.push(e)},registerCertificateResponseFilter:function(e){g.push(e)},registerCustomCapabilitiesFilter:function(e){p.push(e)},registerLicenseRequestFilter:function(e){d.push(e)},registerLicenseResponseFilter:function(e){h.push(e)},removeAbrCustomRule:function(e){if(e){let t=R(e);-1!==t&&T.splice(t,1)}else T=[]},removeAllAbrCustomRule:function(){T=[]}
2,removeExternalSubtitleById:function(e){E.forEach(t=>{t.id===e&&E.delete(t)})},removeExternalSubtitleByUrl:function(e){E.forEach(t=>{t.url===e&&E.delete(t)})},removeRequestInterceptor:function(e){A(i,e)},removeResponseInterceptor:function(e){A(c,e)},removeUTCTimingSource:b,reset:function(){I()},resetCustomInitialTrackSelectionFunction:function(){m=null},resetPlaybackSessionSpecificSettings:function(){E=new Set},restoreDefaultUTCTimingSources:function(){let e=S.get().streaming.utcSynchronization.defaultTimingSource;C(e.scheme,e.value)},setConfig:function(){},setCustomInitialTrackSelectionFunction:function(e){m=e},setXHRWithCredentialsForType:function e(t,r){t?n[t]=!!r:Object.keys(n).forEach(t=>{e(t,r)})},unregisterCertificateRequestFilter:function(e){A(f,e)},unregisterCertificateResponseFilter:function(e){A(g,e)},unregisterCustomCapabilitiesFilter:function(e){A(p,e)},unregisterLicenseRequestFilter:function(e){A(d,e)},unregisterLicenseResponseFilter:function(e){A(h,e)}},n={default:!1},_=(0,l.default)(y).getInstance(),I(),e}c.__dashjs_factory_name="CustomParametersModel",t.default=i.default.getSingletonFactory(c)},1244:function(e,t,n){n.r(t);var r=n(138),i=n(8261),a=n(5212),o=n(649);function s(){const e=this.context,t=(0,i.default)(e).getInstance();let n,r,s;function l(e,t,n){e.customData.reader.read().then(n).catch(function(){u(e)})}function u(e){e.customData.onloadend&&e.customData.onloadend()}function c(){return"undefined"!=typeof performance&&"function"==typeof performance.now?performance.now():Date.now()}function d(){if(this.customData.abortController)this.customData.abortController.abort();else if(this.customData.reader)try{this.customData.reader.cancel(),this.onabort()}catch(e){}}function f(e,t){try{if((e=e.filter(n=>n.bytes>t/4/e.length)).length>1){let t=0;const n=(e[e.length-1].timestamp-e[0].timestamp)/e.length;return e.forEach((r,i)=>{const a=e[i+1];if(a){const e=a.timestamp-r.timestamp;t+=e<n?e:0}}),t}return null}catch(e){return null}}function g(e,t){return 8*e/t}return s=(0,o.default)(e).getInstance().getLogger(n),n={abort:d,calculateDownloadedTime:f,load:function(e,n){const i=function(e){const t=new Headers;if(e.headers)for(let n in e.headers){let r=e.headers[n];r&&t.append(n,r)}return t}(e),o=function(e){let t;return"function"==typeof window.AbortController&&(t=new AbortController,e.customData.abortController=t,t.signal.onabort=e.customData.onabort),e.customData.abort=d.bind(e),t}(e),h=function(e,t,n){return new Request(e.url,{method:e.method,headers:t,credentials:e.credentials,signal:n?n.signal:void 0})}(e,i,o);fetch(h).then(i=>{!function(e,n,i){!function(e,t){e.status=t.status,e.statusText=t.statusText,e.url=t.url;const n={};for(const e of t.headers.keys())n[e]=t.headers.get(e);e.headers=n}(i,e);let o=0,u=!1,d=new Uint8Array,h=0;n.customData.reader=e.body.getReader();let p=[],m=[],E=[],T=!0;const _=t.get().streaming.abr.throughput.lowLatencyDownloadTimeCalculationMode,y=({value:e,done:t})=>{t?function(){if(d){const e=function(){let e=null;return _===a.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING?e=function(){const e=function(e,t){try{let n,r;if(n=e.slice(0,-1),r=t.slice(0,-1),n.length!==r.length&&s.warn(`[FetchLoader] Moof and Mdat data arrays have different lengths. Moof: ${n.length}, Mdat: ${r.length}`),n.length<=1)return null;let i=[],a=0,o=0;for(let e=0;e<n.length;e++)if(n[e]&&r[e]){let t=r[e].timestamp-n[e].timestamp;if(t>1){const n=g(r[e].bytes,t);i.push(n),o=0}else{0===o&&(o=n[e].timestamp,a=0);let t=r[e].timestamp-o;if(t>1){a+=r[e].bytes;const n=g(a,t);i.push(n),o=0}else a+=r[e].bytes}}return i.length>0?i.reduce((e,t)=>e+t,0)/i.length:null}catch(e){return null}}(m,E);return e?8*o/e:null}():_===a.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.DOWNLOADED_DATA&&(e=f(p,o)),e}();n.customData.onprogress({loaded:o,total:o,lengthComputable:!0,time:e}),i.data=d.buffer}n.customData.onloadend()}():(e&&e.length>0&&function(e){d=function(e,t){if(0===e.length)return t;const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(d,e),o+=e.length,p.push({timestamp:c(),bytes:e.length}),_===a.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING&&T&&r.findLastTopIsoBoxCompleted(["moof"],d,h).found&&(T=!1,m.push({timestamp:c()}));const t=r.findLastTopIsoBoxCompleted(["moov","mdat"],d,h);t.found?function(e){const t=function(e){let t;return e===d.length?(t=d,d=new Uint8Array):(t=new Uint8Array(d.subarray(0,e)),d=d.subarray(e)),t}(e.startOffsetOfLastFoundTargetBox+e.sizeOfLastFoundTargetBox);_!==a.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING||T||(T=!0,E.push({timestamp:c(),bytes:t.length})),n.customData.onprogress({data:t.buffer,lengthComputable:!1,noTrace:!0}),h=0}(t):function(e){h=e.startOffsetOfLastCompletedBox+e.sizeOfLastCompletedBox,u||(n.customData.onprogress({lengthComputable:!1,noTrace:!0}),u=!0)}(t)}(e),l(n,0,y))};l(n,0,y)}(i,e,n)}).catch(()=>{u(e)})},reset:function(){},setConfig:function(e){r=e.boxParser}},n}s.__dashjs_factory_name="FetchLoader";const l=r.default.getClassFactory(s);t.default=l},868:function(e,t,n){n.r(t);var r=n(9838),i=n(1244),a=n(7568),o=n(138),s=n(1944),l=n(6066),u=n(7263),c=n(649),d=n(8850),f=n(3621),g=n(8261),h=n(5212),p=n(1926),m=n(2473),E=n(5313),T=n(447),_=n(5099);function y(e){e=e||{};const t=this.context,n=e.errHandler,o=e.dashMetrics,y=e.mediaPlayerModel,S=e.boxParser,I=e.errors,A=(0,d.default)(t).getInstance(),R=(0,g.default)(t).getInstance();let N,C,b,D,v,M,w,P,O,L,F,U;function x(e,l){const c=function(){m()},d=function(t){const n=new Date;H&&(H=!1,(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(k.firstByteDate=n,W.resourceTiming.responseStart=n.getTime())),t.lengthComputable&&(k.bytesLoaded=W.length=t.loaded,k.bytesTotal=W.resourceTiming.encodedBodySize=t.total,W.length=t.total,W.resourceTiming.encodedBodySize=t.loaded),t.noTrace||(G.push({s:q,d:t.time?t.time:n.getTime()-q.getTime(),b:[t.loaded?t.loaded-V:0],t:t.throughput}),k.traces=G,q=n,V=t.loaded),K&&(clearTimeout(K),K=null),R.get().streaming.fragmentRequestProgressTimeout>0&&(K=setTimeout(function(){U.warn("Abort request "+j.url+" due to progress timeout"),$.abort(j),c()},R.get().streaming.fragmentRequestProgressTimeout)),e.progress&&t&&e.progress(t)},g=function(){m(!0)},p=function(e){let t;if(e.lengthComputable){let n=e.loaded/e.total*100;t="Request timeout: loaded: "+e.loaded+", out of: "+e.total+" : "+n.toFixed(3)+"% Completed"}else t="Request timeout: non-computable download size";U.warn(t)},m=function(t=!1){-1!==C.indexOf(j)&&C.splice(C.indexOf(j),1),K&&(clearTimeout(K),K=null),L.processResponseHeaders(W),E(),I(),function(e){const t=O.getResponseInterceptors();return t?t.reduce((e,t)=>
2e.then(e=>t(e)),Promise.resolve(e)):Promise.resolve(e)}(W).then(n=>{if(W=n,function(e,t,n){const r=e.customData.request,i=R.get().streaming.cmsd&&R.get().streaming.cmsd.enabled?M.parseResponseHeaders(t.headers,r.mediaType):null;o.addHttpRequest(r,t.url,t.status,t.headers,n,i)}(j,W,G),t)return void(e.abort&&e.abort(k));k.type===a.HTTPRequest.MPD_TYPE&&(o.addManifestUpdate(k),A.trigger(f.default.MANIFEST_LOADING_FINISHED,{requestObject:k}));const r=!!W.data||k.method===a.HTTPRequest.POST;if(W.status>=200&&W.status<=299&&r)e.success&&e.success(W.data,W.statusText,W.url),e.complete&&e.complete(k,W.statusText);else{try{404===W.status&&R.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&k.type===a.HTTPRequest.MEDIA_SEGMENT_TYPE&&y.getRetryAttemptsForType(a.HTTPRequest.MEDIA_SEGMENT_TYPE)===l&&A.trigger(f.default.ATTEMPT_BACKGROUND_SYNC)}catch(e){}B()}})},E=function(){k.startDate=Y,k.endDate=new Date,k.firstByteDate=k.firstByteDate||Y},I=function(){W.resourceTiming.responseEnd=performance.now(),W.resourceTiming.duration=W.resourceTiming.responseEnd-W.resourceTiming.startTime,function(e,t){if(!R.get().streaming.abr.throughput.useResourceTimingApi)return;if("undefined"==typeof performance||e.range)return;const n=performance.getEntriesByType?.("resource");if(void 0===n||n.length<=0)return;let r=0,i=null;for(;r<n.length;){if(n[r].name===e.url){i=n[r];break}r+=1}(function(e){return e&&!isNaN(e.responseStart)&&e.responseStart>0&&!isNaN(e.responseEnd)&&e.responseEnd>0&&!isNaN(e.transferSize)&&e.transferSize>0})(i)&&(e.customData.request.resourceTimingValues=i,t.resourceTiming.startTime=i.startTime,t.resourceTiming.encodedBodySize=i.encodedBodySize,t.resourceTiming.responseStart=i.responseStart,t.resourceTiming.responseEnd=i.responseEnd,t.resourceTiming.duration=i.duration)}(j,W)},N=function(e,t,n){return new Promise(r=>{(function(e){const t=O.getRequestInterceptors();return t?t.reduce((e,t)=>e.then(e=>t(e)),Promise.resolve(e)):Promise.resolve(e)})(t).then(i=>{t=i,n.request=t,t.customData.onloadend=c,t.customData.onprogress=d,t.customData.onabort=g,t.customData.ontimeout=p,n.resourceTiming.startTime=performance.now(),e.load(t,n),r()})})},B=function(){if(l>0){l--,e&&e.request&&(e.request.retryAttempts+=1);let t={config:e};D.push(t),t.timeout=setTimeout(function(){-1!==D.indexOf(t)&&(D.splice(D.indexOf(t),1),x(e,l))},y.getRetryIntervalsForType(k.type))}else{if(k.type===a.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;n.error(new s.default(v[k.type],k.url+" is not available",{request:k,response:W})),e.error&&e.error(k,"error",W.statusText,W),e.complete&&e.complete(k,W.statusText)}},k=e.request,G=[];let H,Y,q,V,K,j,W;if(k.bytesLoaded=NaN,k.bytesTotal=NaN,k.firstByteDate=null,k.traces=[],H=!0,Y=new Date,q=Y,V=0,K=null,!o||!n)throw new Error("config object is not correct or missing");const z=function(e){let n,s;return!e.isPartialSegmentRequest&&e.hasOwnProperty("availabilityTimeComplete")&&!1===e.availabilityTimeComplete&&window.fetch&&"arraybuffer"===e.responseType&&e.type===a.HTTPRequest.MEDIA_SEGMENT_TYPE?(P||(P=(0,i.default)(t).create(),P.setConfig({dashMetrics:o,boxParser:S})),n=P,s=h.default.FILE_LOADER_TYPES.FETCH):(w||(w=(0,r.default)(t).create()),n=w,s=h.default.FILE_LOADER_TYPES.XHR),{loader:n,fileLoaderType:s}}(k),$=z.loader;var Q;k.fileLoaderType=z.fileLoaderType,k.headers=k.headers||{},0===(Q=k).retryAttempts&&function(e){let t=F.getFinalQueryString(e);t&&(e.url=u.default.addAdditionalQueryParameterToUrl(e.url,t))}(Q),function(e){if(e.queryParams){const t=[];for(const n in e.queryParams)t.push({key:n,value:e.queryParams[n]});e.url=u.default.addAdditionalQueryParameterToUrl(e.url,t)}}(Q),function(e){const t=L.getCommonAccessTokenForUrl(e.url);t&&(e.headers[h.default.COMMON_ACCESS_TOKEN_HEADER]=t)}(Q),k.range&&(k.headers.Range="bytes="+k.range);const X=O.getXHRWithCredentialsForType(k.type);j=new T.default({url:k.url,method:k.method||a.HTTPRequest.GET,responseType:k.responseType,headers:k.headers,credentials:X?"include":"omit",timeout:function(e){return e.type===a.HTTPRequest.MPD_TYPE?R.get().streaming.manifestRequestTimeout||0:((t=e)&&t.type===a.HTTPRequest.INIT_SEGMENT_TYPE||t.type===a.HTTPRequest.INDEX_SEGMENT_TYPE||t.type===a.HTTPRequest.MEDIA_SEGMENT_TYPE||t.type===a.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE||t.type===a.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE)&&R.get().streaming.fragmentRequestTimeout||0;var t}(k),body:k.body,customData:{request:k}}),W=new _.default({request:j,resourceTiming:{startTime:performance.now(),encodedBodySize:0},status:0});let Z=(new Date).getTime();if(isNaN(k.delayLoadingTime)||Z>=k.delayLoadingTime)return C.push(j),N($,j,W);{let e={httpRequest:j,httpResponse:W};return b.push(e),e.delayTimeout=setTimeout(function(){if(-1!==b.indexOf(e)){b.splice(b.indexOf(e),1);try{Y=new Date,q=Y,C.push(e.httpRequest),N($,e.httpRequest,e.httpResponse)}catch(t){e.httpRequest.onloadend()}}},k.delayLoadingTime-Z),Promise.resolve()}}
2return N={abort:function(){D.forEach(e=>{clearTimeout(e.timeout),e.config.request&&e.config.abort&&e.config.abort(e.config.request)}),D=[],b.forEach(e=>clearTimeout(e.delayTimeout)),b=[],C.forEach(e=>{const t=e.customData;t&&(t.request&&t.request.type===a.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE||(t.onloadend=t.onprogress=void 0,t.abort&&t.abort()))}),C=[]},load:function(e){return e.request?x(e,y.getRetryAttemptsForType(e.request.type)):(e.error&&e.error(e.request,"error"),Promise.resolve())},reset:function(){C=[],b=[],D=[],w&&w.reset(),P&&P.reset(),w=null,P=null},resetInitialSettings:function(){w&&w.resetInitialSettings()},setConfig:function(e){e&&(e.commonAccessTokenController&&(L=e.commonAccessTokenController),e.extUrlQueryInfoController&&(F=e.extUrlQueryInfoController))}},U=(0,c.default)(t).getInstance().getLogger(N),C=[],b=[],D=[],M=(0,l.default)(t).getInstance(),O=(0,p.default)(t).getInstance(),L=(0,m.default)(t).getInstance(),F=(0,E.default)(t).getInstance(),v={[a.HTTPRequest.MPD_TYPE]:I.DOWNLOAD_ERROR_ID_MANIFEST_CODE,[a.HTTPRequest.XLINK_EXPANSION_TYPE]:I.DOWNLOAD_ERROR_ID_XLINK_CODE,[a.HTTPRequest.INIT_SEGMENT_TYPE]:I.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE,[a.HTTPRequest.MEDIA_SEGMENT_TYPE]:I.DOWNLOAD_ERROR_ID_CONTENT_CODE,[a.HTTPRequest.INDEX_SEGMENT_TYPE]:I.DOWNLOAD_ERROR_ID_CONTENT_CODE,[a.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE]:I.DOWNLOAD_ERROR_ID_CONTENT_CODE,[a.HTTPRequest.OTHER_TYPE]:I.DOWNLOAD_ERROR_ID_CONTENT_CODE},N}y.__dashjs_factory_name="HTTPLoader";const S=o.default.getClassFactory(y);t.default=S},1721:function(e,t,n){n.r(t);var r=n(138),i=n(868);function a(){let e,t;function n(){t={}}function r(){n()}return r(),e={getLoader:function(e){for(var n in t)if(t.hasOwnProperty(n)&&e.startsWith(n))return t[n];return i.default},registerLoader:function(e,n){t[e]=n},unregisterLoader:function(e){t[e]&&delete t[e]},unregisterAllLoader:n,reset:r},e}a.__dashjs_factory_name="SchemeLoaderFactory";const o=r.default.getSingletonFactory(a);t.default=o},3773:function(e,t,n){n.r(t);var r=n(138),i=n(1721);function a(e){e=e||{};const t=this.context;let n,r,a;return r=(0,i.default)(t).getInstance(),n={abort:function(){a&&a.abort()},load:function(n){if(!a){let i=r.getLoader(n&&n.request?n.request.url:null);a=i(t).create({errHandler:e.errHandler,mediaPlayerModel:e.mediaPlayerModel,dashMetrics:e.dashMetrics,boxParser:e.boxParser?e.boxParser:null,constants:e.constants?e.constants:null,dashConstants:e.dashConstants?e.dashConstants:null,urlUtils:e.urlUtils?e.urlUtils:null,errors:e.errors})}a.load(n)},reset:function(){r&&(r.reset(),r=null),a&&"function"==typeof a.reset&&a.reset(),a=null},resetInitialSettings:function(){a&&"function"==typeof a.resetInitialSettings&&a.resetInitialSettings()}},n}a.__dashjs_factory_name="URLLoader";const o=r.default.getClassFactory(a);t.default=o},9838:function(e,t,n){n.r(t);var r=n(138),i=n(7263);function a(){let e,t;function n(){t&&(t.onloadend=t.onerror=t.onprogress=t.onload=null,t.abort(),t.onabort=t.ontimeout=null,t=null)}return e={load:function(e,r){if(t=null,t=new XMLHttpRequest,t.open(e.method,e.url,!0),e.responseType&&(t.responseType=e.responseType),e.headers)for(let n in e.headers){let r=e.headers[n];r&&t.setRequestHeader(n,r)}t.withCredentials="include"===e.credentials,t.timeout=e.timeout,t.onload=function(){r.url=this.responseURL,r.status=this.status,r.statusText=this.statusText,r.headers=i.default.parseHttpHeaders(this.getAllResponseHeaders()),r.data=this.response},e.customData&&(t.onloadend=e.customData.onloadend,t.onprogress=e.customData.onprogress,t.onabort=e.customData.onabort,t.ontimeout=e.customData.ontimeout);let a=e.body||null;return t.send(a),e.customData.abort=n.bind(this),!0},abort:n,getXhr:function(){return t},reset:function(){n(),e=null},resetInitialSettings:function(){n()}},e}a.__dashjs_factory_name="XHRLoader";const o=r.default.getClassFactory(a);t.default=o},7037:function(e,t,n){n.r(t),n.d(t,{default:function(){return Ae}});var r=n(8854),i=n(2861);const a={prefixes:["clearkey","dashif","ck"]};class o{static findMp4ProtectionElement(e){let t=null;for(let n=0;n<e.length;++n){let a=e[n];a.schemeIdUri&&a.schemeIdUri.toLowerCase()===r.default.MP4_PROTECTION_SCHEME&&a.value&&(
2a.value.toLowerCase()===i.default.ENCRYPTION_SCHEME_CENC||a.value.toLowerCase()===i.default.ENCRYPTION_SCHEME_CBCS)&&(t=a)}return t}static getPSSHData(e){let t=8,n=new DataView(e),r=n.getUint8(t);return t+=20,r>0&&(t+=4+16*n.getUint32(t)),t+=4,e.slice(t)}static getPSSHForKeySystem(e,t){let n=o.parsePSSHList(t);return e&&n.hasOwnProperty(e.uuid.toLowerCase())?n[e.uuid.toLowerCase()]:null}static parseInitDataFromContentProtection(e,t){return"pssh"in e&&e.pssh?(e.pssh.__text=e.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),t.decodeArray(e.pssh.__text).buffer):null}static parsePSSHList(e){if(null==e)return[];let t=new DataView(e.buffer||e),n={},r=0;for(;;){let e,i,a,o,s,l,u=r;if(r>=t.buffer.byteLength)break;if(e=t.getUint32(r),i=r+e,r+=4,1886614376===t.getUint32(r))if(r+=4,a=t.getUint8(r),0===a||1===a){for(r++,r+=3,o="",s=0;s<4;s++)l=t.getUint8(r+s).toString(16),o+=1===l.length?"0"+l:l;for(r+=4,o+="-",s=0;s<2;s++)l=t.getUint8(r+s).toString(16),o+=1===l.length?"0"+l:l;for(r+=2,o+="-",s=0;s<2;s++)l=t.getUint8(r+s).toString(16),o+=1===l.length?"0"+l:l;for(r+=2,o+="-",s=0;s<2;s++)l=t.getUint8(r+s).toString(16),o+=1===l.length?"0"+l:l;for(r+=2,o+="-",s=0;s<6;s++)l=t.getUint8(r+s).toString(16),o+=1===l.length?"0"+l:l;r+=6,o=o.toLowerCase(),r+=4,n[o]=t.buffer.slice(u,i),r=i}else r=i;else r=i}return n}static getLicenseServerUrlFromMediaInfo(e,t){try{if(!e||0===e.length)return null;let n=0,r=null;for(;n<e.length&&!r;){const i=e[n];if(i&&i.contentProtection&&i.contentProtection.length>0){const e=i.contentProtection.filter(e=>e.schemeIdUri&&e.schemeIdUri===t);if(e&&e.length>0){let t=0;for(;t<e.length&&!r;){const n=e[t];n.laUrl&&n.laUrl.__prefix&&a.prefixes.includes(n.laUrl.__prefix)&&n.laUrl.__text&&(r=n.laUrl.__text),t+=1}}}n+=1}return r}catch(e){return null}}static hexKidToBufferSource(e){const t=e.replace(/-/g,"");return new Uint8Array(t.match(/[\da-f]{2}/gi).map(function(e){return parseInt(e,16)})).buffer}}var s=o,l=class{constructor(e,t,n=null){this.contentType=e,this.robustness=t,this.encryptionScheme=n}},u=class{constructor(e,t,n,r,a,o){this.initDataTypes=o&&o.length>0?o:[i.default.INITIALIZATION_DATA_TYPE_CENC],e&&e.length&&(this.audioCapabilities=e),t&&t.length&&(this.videoCapabilities=t),this.distinctiveIdentifier=n,this.persistentState=r,this.sessionTypes=a}},c=n(1923),d=n(1944),f=class{constructor(e,t,n,r,i,a,o,s){this.url=e,this.method=t,this.responseType=n,this.headers=r,this.withCredentials=i,this.messageType=a,this.sessionId=o,this.data=s}},g=class{constructor(e,t,n){this.url=e,this.headers=t,this.data=n}},h=n(7568),p=n(1349),m=n(7263),E=n(138),T=class{constructor(e,t,n){this.url=e,this.method="GET",this.responseType="arraybuffer",this.headers=t,this.body=null,this.withCredentials=n}},_=class{constructor(e,t,n){this.url=e,this.headers=t,this.data=n}};function y(e){const t=(e=e||{}).BASE64,n=e.cmcdController,r=e.constants,a=e.customParametersModel,o=e.debug,E=e.eventBus,y=e.events,S=e.protectionKeyController,I=e.settings;let A,R,N,C,b,D,v,M,w,P,O,L,F,U,x=e.protectionModel,B=[];function k(){if(!(E&&E.hasOwnProperty("on")&&S&&S.hasOwnProperty("getSupportedKeySystemMetadataFromContentProtection")))throw new Error("Missing config parameter(s)")}function G(e,n){F||b?F&&(P?P.then(()=>{V()}):V()):function(e,n){if(b)return;var r;b=!0;const a=function(e){const t=[];for(let n=0;n<e.length;n++){const r=K(e[n]);t.push({ks:e[n].ks,configs:[r],protData:e[n].protData})}return t}(e=(r=e).sort((e,t)=>(A&&A[e.ks.systemString]&&A[e.ks.systemString].priority>=0?A[e.ks.systemString].priority:r.length)-(A&&A[t.ks.systemString]&&A[t.ks.systemString].priority>=0?A[t.ks.systemString].priority:r.length)));let o;x.requestKeySystemAccess(a).then(e=>(o=e.data,function(e){let t=e&&e.selectedSystemString?e.selectedSystemString:e.keySystem.systemString;return M.info("DRM: KeySystem Access Granted for system string ("+t+")!  Selecting key system..."),x.selectKeySystem(e)}(o))).then(e=>{!function(e,n){try{F=e,b=!1,E.trigger(y.KEY_SYSTEM_SELECTED,{data:n});const r=z(F);r&&r.serverCertificate&&r.serverCertificate.length>0&&x.setServerCertificate(t.decodeArray(r.serverCertificate).buffer),F.systemString===i.default.FAIRPLAY_KEYSTEM_STRING?P=H().then(()=>{P=null,V()}).catch(e=>{M.warn("DRM: Certificate acquisition failed for FairPlay: "+(e&&e.message?e.message:e)+". Proceeding anyway."),P=null,V()}):(H().catch(e=>{M.error(e)}),V())}catch(e){M.error(e)}}(e,o)}).catch(e=>{!function(e,t){F=null,b=!1,t||E.trigger(y.KEY_SYSTEM_SELECTED,{data:null,error:new d.default(c.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,c.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+e.error)})}(e,n)})}
2(e,n)}function H(){if(!F)return Promise.resolve();const e=F.systemString,t=R.get(e);if(t&&(t.applied||t.inProgress))return Promise.resolve();const n=function(){const e=[],t=z(F);return t&&Array.isArray(t.certUrls)&&t.certUrls.length&&t.certUrls.forEach(t=>{e.push(t)}),w.forEach(t=>{t&&t.contentProtection&&t.contentProtection.forEach(t=>{t&&Array.isArray(t.certUrls)&&t.certUrls.length&&t.schemeIdUri.toLowerCase()===F.schemeIdURI&&t.certUrls.forEach(t=>{e.push(t)})})}),p.default.dedupeCertUrls(e)}();if(!n.length)return M.debug("DRM: No Certificate Server URLs found for "+e+". Skipping certificate acquisition."),Promise.resolve();M.debug("DRM: Found "+n.length+" certificate candidate(s) for "+e+". Starting acquisition.");const r=z(F)||{},i=t||{applied:!1,inProgress:!0,attempts:0};return i.inProgress=!0,R.set(e,i),Y(n,0,r,e,i)}function Y(e,t,n,r,i){if(t>=e.length)return function(e,t){return e.inProgress=!1,e.error=e.error||"All certificate candidates failed",M.warn("DRM: All certificate candidates failed for "+t+"."),Promise.reject(new Error(e.error))}(i,r);const o=e[t],s=isNaN(I.get().streaming.retryAttempts[h.HTTPRequest.LICENSE_CERTIFICATE])?3:I.get().streaming.retryAttempts[h.HTTPRequest.LICENSE_CERTIFICATE];return M.debug("DRM: Attempting certificate download ("+(t+1)+"/"+e.length+") url="+o.url),function(e,t){const n=a.getCertificateRequestFilters();let r=!1;t&&"boolean"==typeof t.withCredentials&&(r=t.withCredentials);const i={};t&&ne(i,t.httpRequestHeaders);const o=new T(e.url,i,r);return ie(n,o).then(()=>o)}(o,n).then(e=>q(e,n,s)).then(e=>function(e,t,n,r){if(!e||!e.byteLength)throw new Error("Empty certificate response");return r.urlUsed=t.url,r.buffer=e,function(e,t,n){return new Promise((r,i)=>{try{const t=x.setServerCertificate(e);t&&"function"==typeof t.then?t.then(e=>{r("boolean"!=typeof e||e)}).catch(e=>{n.error=e&&e.message?e.message:e,i(e)}):r(!0)}catch(e){n.error=e&&e.message?e.message:e,M.warn("DRM: setServerCertificate threw for "+t+": "+n.error),i(e)}})}(e,n,r).then(e=>{if(!e)throw new Error("CDM rejected certificate");r.applied=!0,r.inProgress=!1})}(e,o,r,i)).then(()=>{!function(e,t,n){const r=e.certType?" certType="+e.certType:"";M.info("DRM: Server certificate applied successfully from "+n.urlUsed+r+" for "+t+".")}(o,r,i)}).catch(a=>(i.attempts++,i.lastError=a&&a.message?a.message:a,M.warn("DRM: Certificate attempt failed ("+o.url+"): "+i.lastError),Y(e,t+1,n,r,i)))}function q(e,t,n){return new Promise((r,i)=>{const o=new XMLHttpRequest;o.open(e.method,e.url,!0),o.responseType=e.responseType;const s=t&&!isNaN(t.httpTimeout)?t.httpTimeout:8e3;s>0&&(o.timeout=s),o.withCredentials=e.withCredentials;for(const t of Object.keys(e.headers))o.setRequestHeader(t,e.headers[t]);const l=a=>{if(n>0){const o=n-1,s=isNaN(I.get().streaming.retryIntervals[h.HTTPRequest.LICENSE_CERTIFICATE])?500:I.get().streaming.retryIntervals[h.HTTPRequest.LICENSE_CERTIFICATE];M.debug("DRM: Certificate request failed ("+a+"). Retrying... remaining="+o),setTimeout(()=>{q(e,t,o).then(r).catch(i)},s)}else i(new Error(a))};o.onload=function(){if(this.status>=200&&this.status<=299){const e=m.default.parseHttpHeaders(o.getAllResponseHeaders?o.getAllResponseHeaders():null);ie(a.getCertificateResponseFilters(),new _(o.responseURL,e,this.response)).then(()=>{r(this.response)}).catch(()=>{r(this.response)})}else l("HTTP "+this.status)},o.onerror=function(){l("network error")},o.ontimeout=function(){l("timeout")},o.onabort=function(){l("aborted")};try{o.send(e.body)}catch(e){i(e)}})}function V(){let e;for(let n=0;n<O.length;n++)for(e=0;e<O[n].length;e++)if(F===O[n][e].ks){t=O[n][e],S.isClearKey(F)&&function(e){if(e.protData&&e.protData.hasOwnProperty("clearkeys")&&0!==Object.keys(e.protData.clearkeys).length){const t={kids:Object.keys(e.protData.clearkeys)};e.initData=(new TextEncoder).encode(JSON.stringify(t))}}(t),t.sessionId?j(t):null!==t.initData&&W(t);break}var t;O=[]}function K(e){const t=e.protData,n=[],a=[];let o=i.default.INITIALIZATION_DATA_TYPE_CENC;e.ks&&e.ks.systemString===i.default.FAIRPLAY_KEYSTEM_STRING&&(o=i.default.INITIALIZATION_DATA_TYPE_SINF);const s=t&&t.initDataTypes&&t.initDataTypes.length>0?t.initDataTypes:[o],c=t&&t.audioRobustness&&t.audioRobustness.length>0?t.audioRobustness:L,d=t&&t.videoRobustness&&t.videoRobustness.length>0?t.videoRobustness:L,f=e.sessionType,g=t&&t.distinctiveIdentifier?t.distinctiveIdentifier:"optional",h=t&&t.persistentState?t.persistentState:"temporary"===f?"optional":"required",p=e.ks&&e.ks.systemString===i.default.FAIRPLAY_KEYSTEM_STRING?i.default.ENCRYPTION_SCHEME_CBCS:void 0;
2return w.forEach(e=>{e.type===r.AUDIO?n.push(new l(e.codec,c,p)):e.type===r.VIDEO&&a.push(new l(e.codec,d,p))}),new u(n,a,g,h,[f],s)}function j(e){k(),x.loadKeySession(e)}function W(e){if(e&&function(e){if(!e)return!1;try{const t=x.getSessionTokens();for(let n=0;n<t.length;n++)if(t[n].getKeyId()===e)return!0;return!1}catch(e){return!1}}(e.keyId))return;!function(){if(!I)return;const e=I.get().streaming.protection.keepProtectionMediaKeys,t=I.get().streaming.protection.keepProtectionMediaKeysMaximumOpenSessions;if("number"!=typeof t||t<=0)return;if(!e)return void M.warn("DRM: keepProtectionMediaKeysMaximumOpenSessions is set to "+t+", but keepProtectionMediaKeys is not enabled. Therefore, keepProtectionMediaKeysMaximumOpenSessions will be ignored.");if(!x||"function"!=typeof x.getSessionTokens)return;const n=x.getSessionTokens()||[];if(n.length<t)return;const r=n[0];r&&(M.info("DRM: Maximum number of open MediaKeySessions reached ("+t+"), closing oldest session."),Q(r))}();const t=s.getPSSHForKeySystem(F,e?e.initData:null);if(t){if($(t))return;try{e.initData=t,x.createKeySession(e)}catch(e){E.trigger(y.KEY_SESSION_CREATED,{data:null,error:new d.default(c.default.KEY_SESSION_CREATED_ERROR_CODE,c.default.KEY_SESSION_CREATED_ERROR_MESSAGE+e.message)})}}else e&&e.initData?x.createKeySession(e):E.trigger(y.KEY_SESSION_CREATED,{data:null,error:new d.default(c.default.KEY_SESSION_CREATED_ERROR_CODE,c.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+(F?F.systemString:null)+".  needkey/encrypted event contains no initData corresponding to that key system!")})}function z(e){if(e){const t=e.systemString;if(A)return t in A?A
vendor: 1,998 bytes, line 2
2[t]:null}return null}function $(e){if(!e)return!1;try{const t=x.getAllInitData();for(let n=0;n<t.length;n++)if(S.initDataEquals(e,t[n]))return M.debug("DRM: Ignoring initData because we have already seen it!"),!0;return!1}catch(e){return!1}}function Q(e){k(),x.closeKeySession(e)}function X(e){k(),e?(x.setMediaElement(e),E.on(y.NEED_KEY,ae,N)):null===e&&(x.setMediaElement(e),E.off(y.NEED_KEY,ae,N))}function Z(e){M.debug("DRM: onKeyMessage");const t=e.data;E.trigger(y.KEY_MESSAGE,{data:t});const n=t.messageType?t.messageType:i.default.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST,r=t.message,o=t.sessionToken,l=z(F),u=S.getLicenseServerModelInstance(F,l,n),p={sessionToken:o,messageType:n};if(r&&0!==r.byteLength){if(!u)return M.debug("DRM: License server request not required for this message (type = "+e.data.messageType+").  Session ID = "+o.getSessionId()),void J(p);if(S.isClearKey(F)){const e=S.processClearKeyLicenseRequest(F,l,r);if(e&&e.keyPairs&&e.keyPairs.length>0)return M.debug("DRM: ClearKey license request handled by application!"),J(p),void x.updateKeySession(o,e)}!function(e,t,n){const r=e.sessionToken,o=e.messageType?e.messageType:i.default.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST,l={sessionToken:r,messageType:o},u=F?F.systemString:null;let p=function(e,t,n,r,i){let a=null;const o=r.message;if(e&&e.serverURL){const n=e.serverURL;"string"==typeof n&&""!==n?a=n:"object"==typeof n&&n.hasOwnProperty(t)&&(a=n[t])}else if(e&&e.laURL&&""!==e.laURL)a=e.laURL;else if(a=s.getLicenseServerUrlFromMediaInfo(w,F.schemeIdURI),!a&&!S.isClearKey(F)){const e=s.getPSSHData(n.initData);a=F.getLicenseServerURLFromInitData(e),a||(a=r.laURL)}return a=i.getServerURLFromMessage(a,o,t),a}(n,o,r,e,t);if(!p)return void J(l,new d.default(c.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,c.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE));const E={};let T=!1;n&&ne(E,n.httpRequestHeaders);const _=e.message;ne(E,F.getRequestHeadersFromMessage(_)),Object.keys(E).forEach(
2e=>{"authorization"===e.toLowerCase()&&(T=!0)}),n&&"boolean"==typeof n.withCredentials&&(T=n.withCredentials);const y=function(e){if(x)if(e.status>=200&&e.status<=299){const n=m.default.parseHttpHeaders(e.getAllResponseHeaders?e.getAllResponseHeaders():null);let i=new g(e.responseURL,n,e.response);ie(a.getLicenseResponseFilters(),i).then(()=>{const n=t.getLicenseMessage(i.data,u,o);null!==n?(J(l),x.updateKeySession(r,n)):re(e,l,u,o,t)})}else re(e,l,u,o,t)},A=function(e){J(l,new d.default(c.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,c.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+u+' update, XHR aborted. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},R=function(e){J(l,new d.default(c.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,c.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+u+' update, XHR error. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},N=F.getLicenseRequestFromMessage(_),C=t.getHTTPMethod(o),b=t.getResponseType(u,o),D=n&&!isNaN(n.httpTimeout)?n.httpTimeout:8e3,v=r.getSessionId()||null;let M=new f(p,C,b,E,T,o,v,N);const P=isNaN(I.get().streaming.retryAttempts[h.HTTPRequest.LICENSE])?3:I.get().streaming.retryAttempts[h.HTTPRequest.LICENSE];ie(a.getLicenseRequestFilters(),M).then(()=>{ee(M,P,D,y,A,R)})}(t,u,l)}else J(p,new d.default(c.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,c.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function J(e,t=null){E.trigger(y.LICENSE_REQUEST_COMPLETE,{data:e,error:t})}function ee(e,t,r,i,a,o){const s=new XMLHttpRequest,l={url:e.url,type:h.HTTPRequest.LICENSE,method:e.method,headers:e.headers||{}};n.applyCmcdToRequest(l),e.url=l.url,e.headers=l.headers,s.open(e.method,e.url,!0),s.responseType=e.responseType,s.withCredentials=e.withCredentials,r>0&&(s.timeout=r);for(const t in e.headers)s.setRequestHeader(t,e.headers[t]);const u=function(){t--;const n=isNaN(I.get().streaming.retryIntervals[h.HTTPRequest.LICENSE])?1e3:I.get().streaming.retryIntervals[h.HTTPRequest.LICENSE];D=setTimeout(function(){ee(e,t,r,i,a,o)},n)};s.onload=function(){v=null,this.status>=200&&this.status<=299||t<=0?i(this):(M.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+t),u())},s.ontimeout=s.onerror=function(){v=null,t<=0?o(this):(M.warn("License request network request failed . Retrying it... Pending retries: "+t),u())},s.onabort=function(){a(this)},E.trigger(y.LICENSE_REQUEST_SENDING,{url:e.url,headers:e.headers,payload:e.data,sessionId:e.sessionId}),v=s,s.send(e.data)}function te(){v&&(v.onloadend=v.onerror=v.onprogress=void 0,v.abort(),v=null),D&&(clearTimeout(D),D=null)}function ne(e,t){if(t)for(const n in t)e[n]=t[n]}function re(e,t,n,r,i){let a="NONE",o=null;e.response&&(a=i.getErrorResponse(e.response,n,r),o={serverResponse:e.response||null,responseCode:e.status||null,responseText:e.statusText||null}),J(t,new d.default(c.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,c.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+n+' update, XHR complete. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState+".  Response is "+a,o))}function ie(e,t){return e?e.reduce((e,n)=>e.then(()=>n(t)),Promise.resolve()):Promise.resolve()}function ae(e,t){if(I.get().streaming.protection.ignoreEmeEncryptedEvent)return;if(M.debug("DRM: onNeedKey"),e.key.initDataType!==i.default.INITIALIZATION_DATA_TYPE_CENC&&e.key.initDataType!==i.default.INITIALIZATION_DATA_TYPE_SINF)return void M.warn("DRM:  Only 'cenc' and 'sinf' initData are supported!  Ignoring initData of type: "+e.key.initDataType);if(0===w.length&&(M.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(t=void 0===t?1:t+1)<5))return void B.push(setTimeout(()=>{ae(e,t)},500));let n=e.key.initData;ArrayBuffer.isView(n)&&(n=n.buffer);const r=e.key.initDataType===i.default.INITIALIZATION_DATA_TYPE_SINF;if(F){const e=r?n:s.getPSSHForKeySystem(F,n);if(e&&$(e))return}let a;M.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(n))),a=r?S.getSupportedKeySystemMetadataForSinf(n,A,U):S.getSupportedKeySystemMetadataFromSegmentPssh(n,A,U),0!==a.length?function(e){O.push(e),G(e,!1)}(a):M.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!")}function oe(e,t){if(e.size<=0)return!1;if(t.size>0&&[...e].every(e=>{const n=t.get(e);return void 0!==n&&""!==n}))return!0;const n=x.getSessionTokens();if(n&&n.length>0){const t=n.filter(t=>[...e].includes(t.normalizedKeyId));if(t.some(e=>!e.hasTriggeredKeyStatusMapUpdate)||0===t.length)return!1}return!I.get().streaming.protection.ignoreKeyStatuses&&e&&e.size>0&&t&&t.size>0}return N={areKeyIdsExpired:function(e){try{return!!oe(e,C)&&[...e].every(e=>C.get(e)===i.default.MEDIA_KEY_STATUSES.EXPIRED)}catch(e){return M.error(e),!1}},areKeyIdsUsable:function(e){try{return!oe(e,C)||[...e].some(e=>{const t=C.get(e);return t&&t!==i.default.MEDIA_KEY_STATUSES.INTERNAL_ERROR&&t!==i.default.MEDIA_KEY_STATUSES.OUTPUT_RESTRICTED})}catch(e){return M.error(e),!0}},clearMediaInfoArray:function(){w=[]},closeKeySession:Q,createKeySession:W,getKeySystems:function(){return S?S.getKeySystems():[]},getProtectionData:function(){return A},getSupportedKeySystemMetadataFromContentProtection:function(e){return k(),S.getSupportedKeySystemMetadataFromContentProtection(e,A,U)},handleKeySystemFromManifest:function(){if(!w||0===w.length)return;let e=[];
2w.forEach(t=>{const n=S.getSupportedKeySystemMetadataFromContentProtection(t.contentProtection,A,U);n.length>0&&(0===e.length&&(e=n),O.push(n))}),e&&e.length>0&&G(e,!0)},initializeForMedia:function(e){if(!e)throw new Error("mediaInfo can not be null or undefined");k(),w.push(e)},loadKeySession:j,removeKeySession:function(e){k(),x.removeKeySession(e)},reset:function(){E.off(y.INTERNAL_KEY_MESSAGE,Z,N),k(),te(),X(null),F=null,b=!1,C=new Map,R=new Map,x&&(x.reset(),x=null),B.forEach(e=>clearTimeout(e)),B=[],w=[],O=[]},setKeySystems:function(e){S&&S.setKeySystems(e)},setMediaElement:X,setProtectionData:function(e){A=e,S.setProtectionData(e)},setRobustnessLevel:function(e){L=e},setServerCertificate:function(e){return k(),x.setServerCertificate(e)},setSessionType:function(e){U=e},stop:function(){te(),x&&x.stop()},updateKeyStatusesMap:function(e){try{if(!e||!e.sessionToken||!e.parsedKeyStatuses)return;e.sessionToken.hasTriggeredKeyStatusMapUpdate=!0;const t=e.parsedKeyStatuses,n=m.default.parseUserAgent(),r=n&&n.browser&&n.browser.name&&"edge"===n.browser.name.toLowerCase();t.forEach(e=>{r&&F.uuid===i.default.PLAYREADY_UUID&&e.keyId&&16===e.keyId.byteLength&&function(e){const t=m.default.bufferSourceToDataView(e),n=t.getUint32(0,!0),r=t.getUint16(4,!0),i=t.getUint16(6,!0);t.setUint32(0,n,!1),t.setUint16(4,r,!1),t.setUint16(6,i,!1)}(e.keyId);const t=m.default.bufferSourceToHex(e.keyId).slice(0,32);t&&""!==t&&C.set(t,e.status)}),E.trigger(y.KEY_STATUSES_MAP_UPDATED,{keyStatusMap:C})}catch(e){M.error(e)}}},M=o.getLogger(N),O=[],w=[],U="temporary",L="",v=null,D=null,C=new Map,R=new Map,P=null,E.on(y.INTERNAL_KEY_MESSAGE,Z,N),N}y.__dashjs_factory_name="ProtectionController";var S=E.default.getClassFactory(y),I=class{constructor(e,t){this.keyID=e,this.key=t}},A=class{constructor(e,t){if(t&&"persistent"!==t&&"temporary"!==t)throw new Error("Invalid ClearKey key set type!  Must be one of 'persistent' or 'temporary'");this.keyPairs=e,this.type=t}toJWK(){let e,t=this.keyPairs.length,n={keys:[]};for(e=0;e<t;e++){let t={kty:"oct",alg:"A128KW",kid:this.keyPairs[e].keyID,k:this.keyPairs[e].key};n.keys.push(t)}
vendor: 10,309 bytes, line 2
2this.type&&(n.type=this.type);let r=JSON.stringify(n);const i=r.length;let a=new ArrayBuffer(i),o=new Uint8Array(a);for(e=0;e<i;e++)o[e]=r.charCodeAt(e);return a}};const R=i.default.CLEARKEY_UUID,N=i.default.CLEARKEY_KEYSTEM_STRING,C="urn:uuid:"+R;function b(e){let t;const n=(e=e||{}).BASE64;return t={uuid:R,schemeIdURI:C,systemString:N,getInitData:function(e,t){try{let r=s.parseInitDataFromContentProtection(e,n);if(!r&&t){const e={kids:[function(e){try{let t=e.replace(/-/g,"");return t=btoa(t.match(/\w{2}/g).map(e=>String.fromCharCode(parseInt(e,16))).join("")),t.replace(/=/g,"").replace(/\//g,"_").replace(/\+/g,"-")}catch(e){return null}}(t.cencDefaultKid)]};r=(new TextEncoder).encode(JSON.stringify(e))}return r}catch(e){return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(e){return JSON.stringify(JSON.parse(String.fromCharCode.apply(null,new Uint8Array(e))))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){let n=null;if(e){const r=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),i=[];for(let t=0;t<r.kids.length;t++){const n=r.kids[t],a=e.clearkeys&&e.clearkeys.hasOwnProperty(n)?e.clearkeys[n]:null;if(!a)throw new Error("DRM: ClearKey keyID ("+n+") is not known!");i.push(new I(n,a))}n=new A(i)}return n}},t}b.__dashjs_factory_name="KeySystemClearKey";var D=E.default.getSingletonFactory(b);const v=i.default.W3C_CLEARKEY_UUID,M=i.default.CLEARKEY_KEYSTEM_STRING,w="urn:uuid:"+v;function P(e){let t;const n=e.BASE64,r=e.debug.getLogger(t);return t={uuid:v,schemeIdURI:w,systemString:M,getInitData:function(e){return s.parseInitDataFromContentProtection(e,n)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){let n=null;if(e){const i=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),a=[];for(let t=0;t<i.kids.length;t++){const n=i.kids[t],r=e.clearkeys&&e.clearkeys.hasOwnProperty(n)?e.clearkeys[n]:null;if(!r)throw new Error("DRM: ClearKey keyID ("+n+") is not known!");a.push(new I(n,r))}n=new A(a),r.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}},t}P.__dashjs_factory_name="KeySystemW3CClearKey";var O=E.default.getSingletonFactory(P);const L=i.default.WIDEVINE_UUID,F=i.default.WIDEVINE_KEYSTEM_STRING,U="urn:uuid:"+L;function x(e){let t;const n=(e=e||{}).BASE64;return t={uuid:L,schemeIdURI:U,systemString:F,getInitData:function(e){return s.parseInitDataFromContentProtection(e,n)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}},t}x.__dashjs_factory_name="KeySystemWidevine";var B=E.default.getSingletonFactory(x);const k=i.default.PLAYREADY_UUID,G=i.default.PLAYREADY_KEYSTEM_STRING,H="urn:uuid:"+k;function Y(e){let t,n="utf-16";const r=(e=e||{}).BASE64,i=e.settings;function a(){if(!r||!r.hasOwnProperty("decodeArray")||!r.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}return t={uuid:k,schemeIdURI:H,systemString:G,getInitData:function(e){const t=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 i,o,l,u,c,d=0,f=null;if(a(),!e)return null;if("pssh"in e&&e.pssh)return s.parseInitDataFromContentProtection(e,r);if("pro"in e&&e.pro)f=r.decodeArray(e.pro.__text);else{if(!("prheader"in e)||!e.prheader)return null;f=r.decodeArray(e.prheader.__text)}return i=f.length,o=4+t.length+n.length+4+i,l=new ArrayBuffer(o),u=new Uint8Array(l),c=new DataView(l),c.setUint32(d,o),d+=4,u.set(t,d),d+=t.length,u.set(n,d),d+=n.length,c.setUint32(d,i),d+=4,u.set(f,d),d+=i,u.buffer},getRequestHeadersFromMessage:function(e){let t,r;const a={},o=new DOMParser;if(i&&i.get().streaming.protection.detectPlayreadyMessageFormat&&"utf-16"===n&&e&&e.byteLength%2==1)return a["Content-Type"]="text/xml; charset=utf-8",a;const s="utf-16"===n?new Uint16Array(e):new Uint8Array(e);t=String.fromCharCode.apply(null,s),r=o.parseFromString(t,"application/xml");const l=r.getElementsByTagName("name"),u=r.getElementsByTagName("value");for(let e=0;e<l.length;e++)a[l[e].childNodes[0].nodeValue]=u[e].childNodes[0].nodeValue;return a.hasOwnProperty("Content")&&(a["Content-Type"]=a.Content,delete a.Content),a.hasOwnProperty("Content-Type")||(a["Content-Type"]="text/xml; charset=utf-8"),a},getLicenseRequestFromMessage:function(e){let t=null;const o=new DOMParser;if(i&&i.get().streaming.protection.detectPlayreadyMessageFormat&&"utf-16"===n&&e&&e.byteLength%2==1)return e;const s="utf-16"===n?new Uint16Array(e):new Uint8Array(e);a();const l=String.fromCharCode.apply(null,s),u=o.parseFromString(l,"application/xml");if(!u.getElementsByTagName("PlayReadyKeyMessage")[0])return e;{const e=u.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;e&&(t=r.decode(e))}return t},getLicenseServerURLFromInitData:function(e){if(e){const t=new DataView(e),n=t.getUint16(4,!0);let r=6;const i=new DOMParser;for(let a=0;a<n;a++){const n=t.getUint16(r,!0);r+=2;const a=t.getUint16(r,!0);if(r+=2,1!==n){r+=a;continue}const o=e.slice(r,r+a),s=String.fromCharCode.apply(null,new Uint16Array(o)),l=i.parseFromString(s,"application/xml");if(l.getElementsByTagName("LA_URL")[0]){const e=l.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(e)return e}if(l.getElementsByTagName("LUI_URL")[0]){const e=l.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(e)return e}}}return null},getCDMData:function(e){let t,n,i,o;if(a(),!e)return null;for(t=[],o=0;o<e.length;++o)t.push(e.charCodeAt(o)),t.push(0);for(t=String.fromCharCode.apply(null,t),t=r.encode(t),n='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>'.replace("%CUSTOMDATA%",t),i=[],o=0;o<n.length;++o)i.push(n.charCodeAt(o)),i.push(0);return new Uint8Array(i).buffer},setPlayReadyMessageFormat:function(e){if("utf-8"!==e&&"utf-16"!==e)throw new Error('Specified message format is not one of "utf-8" or "utf-16"');n=e}},t}Y.__dashjs_factory_name="KeySystemPlayReady";var q=E.default.getSingletonFactory(Y);const V=i.default.FAIRPLAY_UUID,K=i.default.FAIRPLAY_KEYSTEM_STRING,j="urn:uuid:"+V;function W(){let e;return e={uuid:V,schemeIdURI:j,systemString:K,getInitData:function(){return null},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/octet-stream"}},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}},e}W.__dashjs_factory_name="KeySystemFairPlay";var z=E.default.getSingletonFactory(W);function $(e){const t=(e=e||{}).BASE64,n={};let r;return n[i.default.WIDEVINE_KEYSTEM_STRING]={responseType:"json",getLicenseMessage:function(e){return t.decodeArray(e.license)},getErrorResponse:function(e){return e}},n[i.default.PLAYREADY_KEYSTEM_STRING]={responseType:"arraybuffer",getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}},r={getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(e){return n[e].responseType},getLicenseMessage:function(e,r){return function(){if(!t||!t.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}(),n[r].getLicenseMessage(e)},getErrorResponse:function(e,t){return n[t].getErrorResponse(e)}},r}$.__dashjs_factory_name="DRMToday";var Q=E.default.getSingletonFactory($);function X(){let e;const t="http://schemas.xmlsoap.org/soap/envelope/";function n(e){const t=String.fromCharCode.apply(null,new Uint8Array(e));return decodeURIComponent(escape(t))}function r(e){if(window.DOMParser){const r=n(e),i=(new window.DOMParser).parseFromString(r,"text/xml"),a=i?i.getElementsByTagNameNS(t,"Envelope")[0]:null,o=a?a.getElementsByTagNameNS(t,"Body")[0]:null;if(o&&o.getElementsByTagNameNS(t,"Fault")[0])return null}return e}function i(e){let r="",i="",a="",o=-1,s=-1;if(window.DOMParser){const l=n(e),u=(new window.DOMParser).parseFromString(l,"text/xml"),c=u?u.getElementsByTagNameNS(t,"Envelope")[0]:null,d=c?c.getElementsByTagNameNS(t,"Body")[0]:null,f=d?d.getElementsByTagNameNS(t,"Fault")[0]:null,g=f?f.getElementsByTagName("detail")[0]:null,h=g?g.getElementsByTagName("Exception")[0]:null;let p=null;if(null===f)return l;p=f.getElementsByTagName("faultstring")[0].firstChild,r=p?p.nodeValue:null,null!==h&&(p=h.getElementsByTagName("StatusCode")[0],i=p?p.firstChild.nodeValue:null,p=h.getElementsByTagName("Message")[0],a=p?p.firstChild.nodeValue:null,o=a?a.lastIndexOf("[")+1:-1,s=a?a.indexOf("]"):-1,a=a?a.substring(o,s):"")}let l=`code: ${i}, name: ${r}`;return a&&(l+=`, message: ${a}`),l}return e={getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return r.call(this,e)},getErrorResponse:function(e){return i.call(this,e)}},e}X.__dashjs_factory_name="PlayReady";var Z=E.default.getSingletonFactory(X);function J(){let e;return e={getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}},e}J.__dashjs_factory_name="Widevine";var ee=E.default.getSingletonFactory(J);function te(){let e;function t(e){const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n.buffer}return e={getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))},getHTTPMethod:function(){return"POST"},getLicenseMessage:function(e){if(!e||!e.byteLength)return e;let n;try{n=String.fromCharCode.apply(null,new Uint8Array(e))}
2catch(t){const r=new Uint8Array(e);let i="";for(let e=0;e<r.length;e++)i+=String.fromCharCode(r[e]);n=i}if(!n)return e;if(n=n.trim(),"<ckc>"===n.substr(0,5)&&"</ckc>"===n.substr(-6))return t(n.slice(5,-6));try{const e=JSON.parse(n),r=e.ckc||e.CkcMessage||e.License;if(r)return t(r)}catch(e){}return/^[A-Za-z0-9+/\r\n]+=*$/.test(n)&&n.length>0?t(n):e},getResponseType:function(){return"arraybuffer"},getServerURLFromMessage:function(e){return e}},e}te.__dashjs_factory_name="FairPlay";var ne=E.default.getSingletonFactory(te);function re(){let e;return e={getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"json"},getLicenseMessage:function(e){if(!e.hasOwnProperty("keys"))return null;let t=[];for(let n=0;n<e.keys.length;n++){let r=e.keys[n],i=r.kid.replace(/=/g,""),a=r.k.replace(/=/g,"");t.push(new I(i,a))}return new A(t)},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}},e}re.__dashjs_factory_name="ClearKey";var ie=E.default.getSingletonFactory(re),ae=class{constructor(e){this.ks=e.ks,this.keyId=e.keyId,this.initData=e.initData,this.protData=e.protData,this.cdmData=e.cdmData,this.sessionId=e.sessionId,this.sessionType=e.sessionType}};function oe(){let e,t,n,r,a,o,l,u,c=this.context;function d(e){for(let t=0;t<r.length;t++)if(r[t].systemString===e)return r[t];return null}function f(e,t){return t&&e in t?t[e]:null}function g(e,t){return e&&e.sessionId?e.sessionId:t&&t.sessionId?t.sessionId:null}function h(e,t){return e&&e.sessionType?e.sessionType:t}return e={getKeySystemBySystemString:d,getKeySystems:function(){return r},getLicenseServerModelInstance:function(e,t,n){if(n===i.default.MEDIA_KEY_MESSAGE_TYPES.LICENSE_RELEASE||n===i.default.MEDIA_KEY_MESSAGE_TYPES.INDIVIDUALIZATION_REQUEST)return null;let r=null;return t&&t.hasOwnProperty("drmtoday")?r=Q(c).getInstance({BASE64:a}):e.systemString===i.default.WIDEVINE_KEYSTEM_STRING?r=ee(c).getInstance():e.systemString===i.default.FAIRPLAY_KEYSTEM_STRING?r=ne(c).getInstance():e.systemString===i.default.PLAYREADY_KEYSTEM_STRING?r=Z(c).getInstance():e.systemString===i.default.CLEARKEY_KEYSTEM_STRING&&(r=ie(c).getInstance()),r},getSupportedKeySystemMetadataForSinf:function(e,t,n){const r=d(i.default.FAIRPLAY_KEYSTEM_STRING);if(!r)return[];const a=function(e){if(!e||e.byteLength<12)return null;let t;try{const n=String.fromCharCode.apply(null,new Uint8Array(e)),r=JSON.parse(n);if(r.sinf&&r.sinf.length>0){const e=atob(r.sinf[0]);t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)}}catch(n){t=new Uint8Array(e)}if(!t||t.length<12)return null;for(let e=0;e<t.length-28;e++)if(116===t[e]&&101===t[e+1]&&110===t[e+2]&&99===t[e+3]){const n=e+12;if(n+16>t.length)return null;const r=t.subarray(n,n+16),i=Array.from(r).map(e=>e.toString(16).padStart(2,"0")).join("");return i.slice(0,8)+"-"+i.slice(8,12)+"-"+i.slice(12,16)+"-"+i.slice(16,20)+"-"+i.slice(20,32)}return null}(e),o=t&&t[i.default.FAIRPLAY_KEYSTEM_STRING]||null;return[{ks:r,keyId:a,initData:e,protData:o,cdmData:r.getCDMData(o?o.cdmData:null),sessionType:n}]},getSupportedKeySystemMetadataFromContentProtection:function(e,t,n){let i,a,o,l,u=[];if(!e||!e.length)return u;const c=s.findMp4ProtectionElement(e);for(o=0;o<r.length;o++){a=r[o];const s=f(a.systemString,t);for(l=0;l<e.length;l++)if(i=e[l],i.schemeIdUri.toLowerCase()===a.schemeIdURI){let e=a.getInitData(i,c);const t=new ae({ks:r[o],keyId:i.keyId,initData:e,protData:s,cdmData:a.getCDMData(s?s.cdmData:null),sessionId:g(s,i),sessionType:h(s,n)});s?u.unshift(t):u.push(t)}}return u},getSupportedKeySystemMetadataFromSegmentPssh:function(e,t,n){let i,a,o=[],l=s.parsePSSHList(e);for(let e=0;e<r.length;++e){i=r[e],a=i.systemString;const s=f(a,t);i.uuid in l&&o.push({ks:i,initData:l[i.uuid],protData:s,cdmData:i.getCDMData(s?s.cdmData:null),sessionId:g(s),sessionType:h(s,n)})}return o},initDataEquals:function(e,t){if(e.byteLength===t.byteLength){let n=new Uint8Array(e),r=new Uint8Array(t);for(let e=0;e<n.length;e++)if(n[e]!==r[e])return!1;return!0}return!1},initialize:function(){let e;r=[],e=q(c).getInstance({BASE64:a,settings:o}),r.push(e),e=B(c).getInstance({BASE64:a}),r.push(e),e=z(c).getInstance(),r.push(e),e=D(c).getInstance({BASE64:a}),r.push(e),l=e,e=O(c).getInstance({BASE64:a,debug:t}),r.push(e),u=e},isClearKey:function(e){return e===l||e===u},processClearKeyLicenseRequest:function(e,t,r){try{return e.getClearKeysFromProtectionData(t,r)}catch(e){return n.error("Failed to retrieve clearkeys from ProtectionData"),null}},setConfig:function(r){r&&(r.debug&&(t=r.debug,n=t.getLogger(e)),r.BASE64&&(a=r.BASE64),r.settings&&(o=r.settings))},setKeySystems:function(e){r=e},setProtectionData:function(e){for(var t,n,i=0;i<r.length;i++){var a=r[i];a.hasOwnProperty("init")&&a.init((t=a.systemString,n=void 0,n=null,e&&(n=t in e?e[t]:null),n))}}},e}oe.__dashjs_factory_name="ProtectionKeyController";var se=E.default.getSingletonFactory(oe),le=n(445),ue=class{constructor(e,t){this.initData=e,this.initDataType=t}},ce=class{constructor(e,t,n,r){this.sessionToken=e,this.message=t,this.defaultURL=n,this.messageType=r||i.default.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST}},de=class{constructor(e,t){this.keySystem=e,this.ksConfiguration=t,this.nativeMediaKeySystemAccessObject=null,this.selectedSystemString=null}};const fe={};function ge(e){e=e||{};const t=this.context,n=e.eventBus,r=e.events,a=e.debug;let o,s,l,u,f,g,h,p;function m(e,t,i,a){if(void 0===navigator.requestMediaKeySystemAccess||"function"!=typeof navigator.requestMediaKeySystemAccess){const e="Insecure origins are not allowed";return n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{error:e}),void a({error:e})}const o=e[t].protData&&e[t].protData.systemStringPriority?e[t].protData.systemStringPriority:null,s=e[t].configs,l=e[t].ks;let u=l.systemString;(function(e,t){return new Promise((n,r)=>{E(e,t,0,n,r)})})(o||(fe[u]?fe[u]:[u]),s).then(e=>{const t=e&&e.nativeMediaKeySystemAccessObject&&"function"==typeof e.nativeMediaKeySystemAccessObject.getConfiguration?e.nativeMediaKeySystemAccessObject.getConfiguration():null,a=new de(l,t);a.selectedSystemString=e.selectedSystemString,a.nativeMediaKeySystemAccessObject=e.nativeMediaKeySystemAccessObject,n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{data:a}),i({data:a})}).catch(o=>{if(t+1<e.length)m(e,t+1,i,a);else{const e="Key system access denied! ";n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{error:e+o.message}),a({error:e+o.message})}})}function E(e,t,n,r,i){const a=e[n];s.debug(`Requesting key system access for system string ${a}`),navigator.requestMediaKeySystemAccess(a,t).then(e=>{r({nativeMediaKeySystemAccessObject:e,selectedSystemString:a})}).catch(a=>{n+1<e.length?E(e,t,n+1,r,i):i(a)})}function T(e){if(!e||!e.session)return Promise.resolve;const t=e.session;return t.removeEventListener("keystatuseschange",e),t.removeEventListener("message",e),t.close()}function _(e){for(let t=0;t<g.length;t++)if(g[t]===e){g.splice(t,1);break}}function y(e,t){const a={session:e,keyId:t.keyId,normalizedKeyId:t&&t.keyId&&"string"==typeof t.keyId?t.keyId.replace(/-/g,"").toLowerCase():"",initData:t.initData,sessionId:t.sessionId,sessionType:t.sessionType,hasTriggeredKeyStatusMapUpdate:!1,handleEvent:function(e){switch(e.type){case"keystatuseschange":this._onKeyStatusesChange(e);break;case"message":this._onKeyMessage(e)}},_onKeyStatusesChange:function(e){n.trigger(r.KEY_STATUSES_CHANGED,{data:this});const t=[];
2e.target.keyStatuses.forEach(function(){t.push(S(arguments))}),n.trigger(r.INTERNAL_KEY_STATUSES_CHANGED,{parsedKeyStatuses:t,sessionToken:a})},_onKeyMessage:function(e){let t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;n.trigger(r.INTERNAL_KEY_MESSAGE,{data:new ce(this,t,void 0,e.messageType)})},getKeyId:function(){return this.keyId},getSessionId:function(){return e.sessionId},getSessionType:function(){return this.sessionType},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getUsable:function(){let t=!1;return e.keyStatuses.forEach(function(){S(arguments).status===i.default.MEDIA_KEY_STATUSES.USABLE&&(t=!0)}),t}};return e.addEventListener("keystatuseschange",a),e.addEventListener("message",a),e.closed.then(()=>{_(a),s.debug("DRM: Session closed.  SessionID = "+a.getSessionId()),n.trigger(r.KEY_SESSION_CLOSED,{data:a.getSessionId()})}),g.push(a),a}function S(e){let t,n;return e&&e.length>0&&(e[0]&&("string"==typeof e[0]?t=e[0]:n=e[0]),e[1]&&("string"==typeof e[1]?t=e[1]:n=e[1])),{status:t,keyId:n}}return o={closeKeySession:function(e){T(e).catch(function(t){_(e),n.trigger(r.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.getSessionId()+") "+t.name})})},createKeySession:function(e){if(!l||!f)throw new Error("Can not create sessions until you have selected a key system");const t=f.createSession(e.sessionType),a=y(t,e);let o;o=l.systemString===i.default.CLEARKEY_KEYSTEM_STRING&&(e.initData||e.protData&&e.protData.clearkeys)?i.default.INITIALIZATION_DATA_TYPE_KEYIDS:l.systemString===i.default.FAIRPLAY_KEYSTEM_STRING?i.default.INITIALIZATION_DATA_TYPE_SINF:i.default.INITIALIZATION_DATA_TYPE_CENC,t.generateRequest(o,e.initData).then(function(){s.debug("DRM: Session created.  SessionID = "+a.getSessionId()),n.trigger(r.KEY_SESSION_CREATED,{data:a})}).catch(function(e){_(a),n.trigger(r.KEY_SESSION_CREATED,{data:null,error:new d.default(c.default.KEY_SESSION_CREATED_ERROR_CODE,c.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+e.name)})})},getAllInitData:function(){const e=[];for(let t=0;t<g.length;t++)g[t].initData&&e.push(g[t].initData);return e},getSessionTokens:function(){return g},loadKeySession:function(e){if(!l||!f)throw new Error("Can not load sessions until you have selected a key system");const t=e.sessionId;for(let e=0;e<g.length;e++)if(t===g[e].sessionId)return void s.warn("DRM: Ignoring session ID because we have already seen it!");const i=f.createSession(e.sessionType),a=y(i,e);a.hasTriggeredKeyStatusMapUpdate=!0,i.load(t).then(function(e){e?(s.debug("DRM: Session loaded.  SessionID = "+a.getSessionId()),n.trigger(r.KEY_SESSION_CREATED,{data:a})):(_(a),n.trigger(r.KEY_SESSION_CREATED,{data:null,error:new d.default(c.default.KEY_SESSION_CREATED_ERROR_CODE,c.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+t+")")}))}).catch(function(e){_(a),n.trigger(r.KEY_SESSION_CREATED,{data:null,error:new d.default(c.default.KEY_SESSION_CREATED_ERROR_CODE,c.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+t+")! "+e.name)})})},removeKeySession:function(e){e.session.remove().then(function(){s.debug("DRM: Session removed.  SessionID = "+e.getSessionId()),n.trigger(r.KEY_SESSION_REMOVED,{data:e.getSessionId()})},function(t){n.trigger(r.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+e.getSessionId()+"). "+t.name})})},requestKeySystemAccess:function(e){return new Promise((t,n)=>{m(e,0,t,n)})},reset:function(){const e=g.length;let t;if(0!==e){const i=function(e){_(e),0===g.length&&(u?(u.removeEventListener("encrypted",h),u.setMediaKeys(null).then(function(){n.trigger(r.TEARDOWN_COMPLETE)})):n.trigger(r.TEARDOWN_COMPLETE))};for(let n=0;n<e;n++)t=g[n],function(e){T(t),i(e)}(t)}else n.trigger(r.TEARDOWN_COMPLETE)},selectKeySystem:function(e){return new Promise((t,n)=>{e.nativeMediaKeySystemAccessObject.createMediaKeys().then(t=>(l=e.keySystem,f=t,u?u.setMediaKeys(f):Promise.resolve())).then(()=>{t(l)}).catch(function(){n({error:"Error selecting keys system ("+e.keySystem.systemString+")! Could not create MediaKeys -- TODO"})})})},setMediaElement:function(e){u!==e&&(u&&(u.removeEventListener("encrypted",h),u.setMediaKeys&&u.setMediaKeys(null)),u=e,u&&(u.addEventListener("encrypted",h),u.setMediaKeys&&f&&u.setMediaKeys(f)))},setServerCertificate:function(e){return new Promise((t,i)=>{f.setServerCertificate(e).then(function(){s.info("DRM: License server certificate successfully updated."),n.trigger(r.SERVER_CERTIFICATE_UPDATED),t()}).catch(e=>{i(e),n.trigger(r.SERVER_CERTIFICATE_UPDATED,{error:new d.default(c.default.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,c.default.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+e.name)})})})},stop:function(){let e;for(let t=0;t<g.length;t++)e=g[t],e.getUsable()||(T(e),_(e))},updateKeySession:function(e,t){const i=e.session;p.isClearKey(l)&&(t=t.toJWK()),i.update(t).then(()=>{n.trigger(r.KEY_SESSION_UPDATED)}).catch(function(t){n.trigger(r.KEY_ERROR,{error:new d.default(c.default.MEDIA_KEYERR_CODE,"Error sending update() message! "+t.name,e)})})}},s=a.getLogger(o),l=null,u=null,f=null,g=[],p=se(t).getInstance(),h={handleEvent:function(e){if("encrypted"===e.type&&e.initData){let t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;n.trigger(r.NEED_KEY,{key:new ue(t,e.initDataType)})}}},o}fe[i.default.PLAYREADY_KEYSTEM_STRING]=[i.default.PLAYREADY_KEYSTEM_STRING,i.default.PLAYREADY_RECOMMENDATION_KEYSTEM_STRING],fe[i.default.WIDEVINE_KEYSTEM_STRING]=[i.default.WIDEVINE_KEYSTEM_STRING],fe[i.default.FAIRPLAY_KEYSTEM_STRING]=[i.default.FAIRPLAY_KEYSTEM_STRING],fe[i.default.CLEARKEY_KEYSTEM_STRING]=[i.default.CLEARKEY_KEYSTEM_STRING],ge.__dashjs_factory_name="DefaultProtectionModel";var he=E.default.getClassFactory(ge);function pe(e){e=e||{};const t=this.context,n=e.eventBus,r=e.events,a=e.debug,o=e.api;let s,l,f,g,h,p,m,E,T;function _(){try{for(let e=0;e<m.length;e++)y(m[e]);f&&f.removeEventListener(o.needkey,E),n.trigger(r.TEARDOWN_COMPLETE)}catch(e){n.trigger(r.TEARDOWN_COMPLETE,{error:"Error tearing down key sessions and MediaKeys! -- "+e.message})}}function y(e){const t=e.session;t.removeEventListener(o.error,e),t.removeEventListener(o.message,e),t.removeEventListener(o.ready,e),t.removeEventListener(o.close,e);for(let t=0;t<m.length;t++)if(m[t]===e){m.splice(t,1);break}t[o.release]()}function S(){let e=null;const t=function(){f.removeEventListener("loadedmetadata",e),f[o.setMediaKeys](h),n.trigger(r.VIDEO_ELEMENT_SELECTED)};f.readyState>=1?t():(e=t.bind(this),f.addEventListener("loadedmetadata",e))}return s={getAllInitData:function(){const e=[];for(let t=0;t<m.length;t++)e.push(m[t].initData);return e},getSessionTokens:function(){return m},requestKeySystemAccess:function(e){return new Promise((t,i)=>{let a=!1;for(let i=0;i<e.length;i++){const s=e[i].ks.systemString,l=e[i].configs;let c=null,d=null;for(let e=0;e<l.length;e++){const i=l[e].audioCapabilities,f=l[e].videoCapabilities;if(i&&0!==i.length){c=[];for(let e=0;e<i.length;
vendor: 5,320 bytes, line 2
2e++)window[o.MediaKeys].isTypeSupported(s,i[e].contentType)&&c.push(i[e])}if(f&&0!==f.length){d=[];for(let e=0;e<f.length;e++)window[o.MediaKeys].isTypeSupported(s,f[e].contentType)&&d.push(f[e])}if(!c&&!d||c&&0===c.length||d&&0===d.length)continue;a=!0;const g=new u(c,d),h=T.getKeySystemBySystemString(s),p=new de(h,g);n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{data:p}),t({data:p});break}}if(!a){const e="Key system access denied! -- No valid audio/video content configurations detected!";n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{error:e}),i({error:e})}})},selectKeySystem:function(e){return new Promise((t,n)=>{try{h=e.mediaKeys=new window[o.MediaKeys](e.keySystem.systemString),g=e.keySystem,p=e,f&&S(),t(g)}catch(e){n({error:"Error selecting keys system ("+g.systemString+")! Could not create MediaKeys -- TODO"})}})},setMediaElement:function(e){f!==e&&(f&&f.removeEventListener(o.needkey,E),f=e,f&&(f.addEventListener(o.needkey,E),h&&S()))},createKeySession:function(e){if(!g||!h||!p)throw new Error("Can not create sessions until you have selected a key system");let t=null;if(p.ksConfiguration.videoCapabilities&&p.ksConfiguration.videoCapabilities.length>0&&(t=p.ksConfiguration.videoCapabilities[0]),null===t&&p.ksConfiguration.audioCapabilities&&p.ksConfiguration.audioCapabilities.length>0&&(t=p.ksConfiguration.audioCapabilities[0]),null===t)throw new Error("Can not create sessions for unknown content types.");const i=t.contentType,a=h.createSession(i,new Uint8Array(e.initData),e.cdmData?new Uint8Array(e.cdmData):null),s=function(e,t){return{session:e,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.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},getKeyStatuses:function(){return{size:0,has:()=>!1,get:()=>{}}},handleEvent:function(e){switch(e.type){case o.error:let t="KeyError";n.trigger(r.KEY_ERROR,{error:new d.default(c.default.MEDIA_KEYERR_CODE,t,this)});break;case o.message:let i=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;n.trigger(r.INTERNAL_KEY_MESSAGE,{data:new ce(this,i,e.destinationURL)});break;case o.ready:l.debug("DRM: Key added."),n.trigger(r.KEY_ADDED);break;case o.close:l.debug("DRM: Session closed.  SessionID = "+this.getSessionId()),n.trigger(r.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}}(a,e);a.addEventListener(o.error,s),a.addEventListener(o.message,s),a.addEventListener(o.ready,s),a.addEventListener(o.close,s),m.push(s),l.debug("DRM: Session created.  SessionID = "+s.getSessionId()),n.trigger(r.KEY_SESSION_CREATED,{data:s})},updateKeySession:function(e,t){const i=e.session;T.isClearKey(g)?i.update(new Uint8Array(t.toJWK())):i.update(new Uint8Array(t)),n.trigger(r.KEY_SESSION_UPDATED)},closeKeySession:y,setServerCertificate:function(){return Promise.resolve()},loadKeySession:function(){},removeKeySession:function(){},stop:_,reset:_},l=a.getLogger(s),f=null,g=null,h=null,p=null,m=[],T=se(t).getInstance(),E={handleEvent:function(e){if(e.type===o.needkey&&e.initData){const t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;n.trigger(r.NEED_KEY,{key:new ue(t,i.default.INITIALIZATION_DATA_TYPE_CENC)})}}},s}pe.__dashjs_factory_name="ProtectionModel_3Feb2014";var me=E.default.getClassFactory(pe);function Ee(e){e=e||{};const t=this.context,n=e.eventBus,r=e.events,a=e.debug,o=e.api,s=e.errHandler;let l,f,g,h,p,m,E,T,_;function y(){g&&A();for(let e=0;e<E.length;e++)S(E[e]);n.trigger(r.TEARDOWN_COMPLETE)}function S(e){try{g[o.cancelKeyRequest](h.systemString,e.sessionId)}catch(t){n.trigger(r.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.sessionId+") "+t.message})}}function I(e,t){if(t&&e){const n=e.length;for(let r=0;r<n;r++)if(e[r].sessionId==t)return e[r];return null}return null}function A(){g.removeEventListener(o.keyerror,_),g.removeEventListener(o.needkey,_),g.removeEventListener(o.keymessage,_),g.removeEventListener(o.keyadded,_)}return l={getAllInitData:function(){const e=[];for(let t=0;t<m.length;t++)e.push(m[t].initData);for(let t=0;t<E.length;t++)e.push(E[t].initData);return e},getSessionTokens:function(){return E.concat(m)},requestKeySystemAccess:function(e){return new Promise((t,i)=>{let a=g;a||(a=document.createElement("video"));let o=!1;for(let i=0;i<e.length;i++){const s=e[i].ks.systemString,l=e[i].configs;let c=null,d=null;for(let e=0;e<l.length;e++){const i=l[e].videoCapabilities;if(i&&0!==i.length){d=[];for(let e=0;e<i.length;e++)""!==a.canPlayType(i[e].contentType,s)&&d.push(i[e])}if(!c&&!d||c&&0===c.length||d&&0===d.length)continue;o=!0;const f=new u(c,d),g=p.getKeySystemBySystemString(s),h=new de(g,f);n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{data:h}),t({data:h});break}}if(!o){const e="Key system access denied! -- No valid audio/video content configurations detected!";n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{error:e}),i({error:e})}})},selectKeySystem:function(e){return h=e.keySystem,Promise.resolve(h)},setMediaElement:function(e){if(g!==e){if(g){A();for(var t=0;t<E.length;t++)S(E[t]);E=[]}g=e,g&&(g.addEventListener(o.keyerror,_),g.addEventListener(o.needkey,_),g.addEventListener(o.keymessage,_),g.addEventListener(o.keya
2dded,_),n.trigger(r.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(e){if(!h)throw new Error("Can not create sessions until you have selected a key system");if(T||0===E.length){const t={sessionId:null,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.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},getKeyStatuses:function(){return{size:0,has:()=>!1,get:()=>{}}}};return m.push(t),g[o.generateKeyRequest](h.systemString,new Uint8Array(e.initData)),t}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(e,t){const i=e.sessionId;if(p.isClearKey(h))for(let e=0;e<t.keyPairs.length;e++)g[o.addKey](h.systemString,t.keyPairs[e].key,t.keyPairs[e].keyID,i);else g[o.addKey](h.systemString,new Uint8Array(t),new Uint8Array(e.initData),i);n.trigger(r.KEY_SESSION_UPDATED)},closeKeySession:S,setServerCertificate:function(){return Promise.resolve()},loadKeySession:function(){},removeKeySession:function(){},stop:y,reset:y},f=a.getLogger(l),g=null,h=null,m=[],E=[],p=se(t).getInstance(),_={handleEvent:function(e){let t=null;switch(e.type){case o.needkey:let a=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;n.trigger(r.NEED_KEY,{key:new ue(a,i.default.INITIALIZATION_DATA_TYPE_CENC)});break;case o.keyerror:if(t=I(E,e.sessionId),t||(t=I(m,e.sessionId)),t){let i=c.default.MEDIA_KEYERR_CODE,a="";switch(e.errorCode.code){case 1:i=c.default.MEDIA_KEYERR_UNKNOWN_CODE,a+="MEDIA_KEYERR_UNKNOWN - "+c.default.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:i=c.default.MEDIA_KEYERR_CLIENT_CODE,a+="MEDIA_KEYERR_CLIENT - "+c.default.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:i=c.default.MEDIA_KEYERR_SERVICE_CODE,a+="MEDIA_KEYERR_SERVICE - "+c.default.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:i=c.default.MEDIA_KEYERR_OUTPUT_CODE,a+="MEDIA_KEYERR_OUTPUT - "+c.default.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:i=c.default.MEDIA_KEYERR_HARDWARECHANGE_CODE,a+="MEDIA_KEYERR_HARDWARECHANGE - "+c.default.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:i=c.default.MEDIA_KEYERR_DOMAIN_CODE,a+="MEDIA_KEYERR_DOMAIN - "+c.default.MEDIA_KEYERR_DOMAIN_MESSAGE}a+="  System Code = "+e.systemCode,n.trigger(r.KEY_ERROR,{error:new d.default(i,a,t)})}else f.error("No session token found for key error");break;case o.keyadded:t=I(E,e.sessionId),t||(t=I(m,e.sessionId)),t?(f.debug("DRM: Key added."),n.trigger(r.KEY_ADDED,{data:t})):f.debug("No session token found for key added");break;case o.keymessage:if(T=null!==e.sessionId&&void 0!==e.sessionId,T?(t=I(E,e.sessionId),!t&&m.length>0&&(t=m.shift(),E.push(t),t.sessionId=e.sessionId,n.trigger(r.KEY_SESSION_CREATED,{data:t}))):m.length>0&&(t=m.shift(),E.push(t),0!==m.length&&s.error(new d.default(c.default.MEDIA_KEY_MESSAGE_ERROR_CODE,c.default.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),t){let i=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;t.keyMessage=i,n.trigger(r.INTERNAL_KEY_MESSAGE,{data:new ce(t,i,e.defaultURL)})}else f.warn("No session token found for key message")}}},l}Ee.__dashjs_factory_name="ProtectionModel_01b";var Te=E.default.getClassFactory(Ee);const _e=[{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"}],ye=[{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 Se(){let e;const t=this.context;function n(e,t){for(let n=0;n<t.length;n++){const r=t[n];if("function"==typeof e[r[Object.keys(r)[0]]])return r}return null}return e={createProtectionSystem:function(r){let i=null;const a=se(t).getInstance();a.setConfig({debug:r.debug,BASE64:r.BASE64,settings:r.settings}),a.initialize();let o=function(r){const i=r.debug,a=i.getLogger(e),o=r.eventBus,s=r.errHandler,l=r.videoModel?r.videoModel.getElement():null;return l&&void 0===l.onencrypted||l&&void 0===l.mediaKeys?n(l,ye)?(a.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"),me(t).create({debug:i,eventBus:o,events:r.events,api:n(l,ye)})):n(l,_e)?(a.info("EME detected on this user agent! (ProtectionModel_01b)"),Te(t).create({debug:i,eventBus:o,errHandler:s,events:r.events,api:n(l,_e)})):(a.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null):(a.info("EME detected on this user agent! (DefaultProtectionModel"),he(t).create({debug:i,eventBus:o,events:r.events}))}(r);return o&&(i=S(t).create({BASE64:r.BASE64,cmcdController:r.cmcdController,constants:r.constants,customParametersModel:r.customParametersModel,debug:r.debug,eventBus:r.eventBus,events:r.events,protectionKeyController:a,protectionModel:o,settings:r.settings}),r.capabilities.setEncryptedMediaSupported(!0)),i}},e}Se.__dashjs_factory_name="Protection";const Ie=E.default.getClassFactory(Se);Ie.events=le.default,Ie.errors=c.default,E.default.updateClassFactory(Se.__dashjs_factory_name,Ie);var Ae=Ie},445:function(e,t,n){n.r(t);var r=n(7252);class i extends r.default{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 a=new i;t.default=a},1923:function(e,t,n){n.r(t);var r=n(8748);class i extends r.default{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 a=new i;t.default=a},4246:function(e,t,n){n.r(t);var r=n(138);const i={DEFAULT:.5,STRONG:1,WEAK:0};function a(e,t,n,r){let a,o,s,l,u;return o=void 0===e?null:e,s=function(e){let t=i.DEFAULT;return e!==i.DEFAULT&&e!==i.STRONG&&e!==i.WEAK||(t=e),t}(n),l=void 0===t?null:t,u=void 0===r?null:r,a={representation:o,reason:l,rule:u,priority:s},a}a.__dashjs_factory_name="SwitchRequest";const o=r.default.getClassFactory(a);o.NO_CHANGE=null,o.PRIORITY=i,r.default.updateClassFactory(a.__dashjs_factory_name,o),t.default=o},559:function(e,t,n){n.r(t),n.d(t,{supportsMediaSource:function(){return l}});var r=n(138),i=n(5212),a=n(2861),o=n(7393),s=n(649);function l(){let e="ManagedMediaSource"in window,t="WebKitMediaSource"in window,n="MediaSource"in window;return e||t||n}function u(){let e,t,n,r,u,c;
2const d=this.context,f=(0,o.default)(d).getInstance();function g(e,t){let n;t===i.default.VIDEO?n=function(e){const t={video:{}};return e?(e.width&&(t.video.width=e.width),e.height&&(t.video.height=e.height),e.framerate&&(t.video.framerate=parseFloat(e.framerate)),e.hdrMetadataType&&(t.video.hdrMetadataType=e.hdrMetadataType),e.colorGamut&&(t.video.colorGamut=e.colorGamut),e.transferFunction&&(t.video.transferFunction=e.transferFunction),t):t}(e):t===i.default.AUDIO&&(n=function(e){const t={audio:{}};return e.samplerate&&(t.audio.samplerate=e.samplerate),e.channels&&(t.audio.channels=e.channels),t}(e)),n[t].contentType=e.codec,n[t].bitrate=parseInt(e.bitrate),n.type="media-source";let r=e.codec;return e.width&&e.height&&(r+=';width="'+e.width+'";height="'+e.height+'"'),n.mediaSourceCodecString=r,function(e,t,n){if(!t||!t.keySystemsMetadata||0===t.keySystemsMetadata.length)return[e];const r=[];return t.keySystemsMetadata.forEach(t=>{if(!t.ks)return void r.push({...e});const o=t.protData&&t.protData.systemStringPriority?t.protData.systemStringPriority:null;let s=t.ks.systemString;(o||[s]).forEach(o=>{const s={...e};s.keySystemConfiguration={},o&&(s.keySystemConfiguration.keySystem=o);let l="";t.ks.systemString===a.default.WIDEVINE_KEYSTEM_STRING&&(l=a.default.ROBUSTNESS_STRINGS.WIDEVINE.SW_SECURE_CRYPTO);const u=t.protData,c=u&&u.audioRobustness&&u.audioRobustness.length>0?u.audioRobustness:l,d=u&&u.videoRobustness&&u.videoRobustness.length>0?u.videoRobustness:l;n===i.default.AUDIO?s.keySystemConfiguration[n]={robustness:c}:n===i.default.VIDEO&&(s.keySystemConfiguration[n]={robustness:d}),r.push(s)})}),r}(n,e,t)}function h(e){return t.get().streaming.enhancement.codecs.some(t=>e.includes(t))}function p(e){if(r&&0!==r.length&&e)return r.find(t=>{const n=m(e,t,i.default.AUDIO),r=m(e,t,i.default.VIDEO),a=m(e,t,"keySystemConfiguration");return n&&r&&a})}function m(e,t,n){return!e[n]&&!t[n]||!(!e[n]||!t[n])&&f.areEqual(e[n],t[n])}function E(e,t){return(e=e.filter(e=>!(e.schemeIdUri&&t.some(t=>t.schemeIdUri===e.schemeIdUri)))).push(...t),e}return e={areKeyIdsExpired:function(e){return!!(n&&e&&e.normalizedKeyIds&&0!==e.normalizedKeyIds.size)&&n.areKeyIdsExpired(e.normalizedKeyIds)},areKeyIdsUsable:function(e){return!(n&&e&&e.normalizedKeyIds&&0!==e.normalizedKeyIds.size)||n.areKeyIdsUsable(e.normalizedKeyIds)},isCodecSupportedBasedOnTestedConfigurations:function(e,t){if(!e||!e.codec||!1===e.isSupported)return!1;const n=g(e,t).map(e=>p(e)).filter(e=>null!=e);return!(n&&n.length>0)||function(e){return e.some(e=>e&&e.decodingInfo&&e.decodingInfo.supported)}(n)},isProtectionCompatible:function(e,t){return!t||!(!e.isEncrypted&&t.isEncrypted)},runCodecSupportCheck:function(e,n){if(n!==i.default.AUDIO&&n!==i.default.VIDEO)return Promise.resolve();if(t.get().streaming.enhancement.enabled&&h(e.codec))return r=r.filter(e=>!h(e.mediaSourceCodecString)),Promise.resolve(!0);const a=g(e,n);return function(e,n){return t.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(e.codec&&n===i.default.AUDIO||n===i.default.VIDEO&&e.codec&&e.width&&e.height&&e.bitrate&&e.framerate)}(e,n)?function(e){return new Promise(t=>{if(!e||0===e.length)return void t();const n=e.map(e=>function(e){return new Promise(t=>{p(e)?t():navigator.mediaCapabilities.decodingInfo(e).then(n=>{e.decodingInfo=n,r.push(e),t()}).catch(n=>{e.decodingInfo={supported:!1},r.push(e),c.error(n),t()})})}(e));Promise.allSettled(n).then(()=>{t()}).catch(e=>{c.error(e),t()})})}(a):(function(e){if(!e||!e.length)return;const t=e[0];if(p(t))return;let n={supported:!1};("ManagedMediaSource"in window&&ManagedMediaSource.isTypeSupported(t.mediaSourceCodecString)||"MediaSource"in window&&MediaSource.isTypeSupported(t.mediaSourceCodecString)||"WebKitMediaSource"in window&&WebKitMediaSource.isTypeSupported(t.mediaSourceCodecString))&&(n.supported=!0),t.decodingInfo=n,r.push(t)}(a),Promise.resolve())},setConfig:function(e){e&&(e.settings&&(t=e.settings),e.protectionController&&(n=e.protectionController))},setEncryptedMediaSupported:function(e){u=e},setProtectionController:function(e){n=e},supportsChangeType:function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType},supportsEncryptedMedia:function(){return u},supportsEssentialProperty:function(e){let n=t.get().streaming.capabilities.supportedEssentialProperties;t.get().streaming.capabilities.useMediaCapabilitiesApi&&t.get().streaming.capabilities.filterVideoColorimetryEssentialProperties&&(n=E(n,[{schemeIdUri:i.default.COLOUR_PRIMARIES_SCHEME_ID_URI},{schemeIdUri:i.default.MATRIX_COEFFICIENTS_SCHEME_ID_URI},{schemeIdUri:i.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI}])),t.get().streaming.capabilities.useMediaCapabilitiesApi&&t.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties&&(n=E(n,[{schemeIdUri:i.default.HDR_METADATA_FORMAT_SCHEME_ID_URI}]));try{return e.inArray(n)}catch(e){return!0}},supportsMediaSource:l},u=!1,r=[],c=(0,s.default)(d).getInstance().getLogger(e),e}u.__dashjs_factory_name="Capabilities",t.default=r.default.getSingletonFactory(u)},1349:function(e,t,n){function r(e){return e?(Array.isArray(e)?e:[e]).map(e=>{if(!e)return null;if("string"==typeof e){const t=e.trim();return t?{url:t,certType:null}:null}if("object"==typeof e){let t=(e.__text||e.text||"").trim();t||"string"!=typeof e.url||(t=e.url.trim());let n=e.certType||e["@certType"]||null;return n&&"string"==typeof n?(n=n.trim(),""===n&&(n=null)):n=null,t?{url:t,certType:n}:null}return null}
2).filter(Boolean):[]}function i(e){if(!Array.isArray(e)||0===e.length)return[];const t=new Set,n=[];for(let r=0;r<e.length;r++){const i=e[r];if(!i||!i.url)continue;const a=i.url+"||"+(i.certType||"");t.has(a)||(t.add(a),n.push(i))}return n}n.r(t),t.default={normalizeCertUrls:r,dedupeCertUrls:i,sanitizeProtectionDataCertUrls:function(e){return e&&"object"==typeof e&&Object.keys(e).forEach(t=>{const n=e[t];n&&Array.isArray(n.certUrls)&&(n.certUrls=i(r(n.certUrls)))}),e}}},7377:function(e,t,n){n.r(t);var r=n(138),i=n(656);function a(){return{customTimeRangeArray:[],length:0,add:function(e,t){let n;for(n=0;n<this.customTimeRangeArray.length&&e>this.customTimeRangeArray[n].start;n++);for(this.customTimeRangeArray.splice(n,0,{start:e,end:t}),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(e,t){for(let n=0;n<this.customTimeRangeArray.length;n++)if(e<=this.customTimeRangeArray[n].start&&t>=this.customTimeRangeArray[n].end)this.customTimeRangeArray.splice(n,1),n--;else{if(e>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end){this.customTimeRangeArray.splice(n+1,0,{start:t,end:this.customTimeRangeArray[n].end}),this.customTimeRangeArray[n].end=e;break}e>this.customTimeRangeArray[n].start&&e<this.customTimeRangeArray[n].end?this.customTimeRangeArray[n].end=e:t>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end&&(this.customTimeRangeArray[n].start=t)}this.length=this.customTimeRangeArray.length},mergeRanges:function(e,t){let n=this.customTimeRangeArray[e],r=this.customTimeRangeArray[t];return n.start<=r.start&&r.start<=n.end&&n.end<=r.end?(n.end=r.end,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&r.end<=n.end?(n.start=r.start,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&n.end<=r.end?(this.customTimeRangeArray.splice(e,1),!0):n.start<=r.start&&r.start<=n.end&&r.end<=n.end&&(this.customTimeRangeArray.splice(t,1),!0)},start:function(e){return(0,i.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].start},end:function(e){return(0,i.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].end}}}a.__dashjs_factory_name="CustomTimeRanges",t.default=r.default.getClassFactory(a)},9026:function(e,t,n){n.r(t);var r=n(138);function i(){let e;const t=/^[a-z][a-z0-9+\-_.]*:/i,n=/^https?:\/\//i,r=/^https:\/\//i,i=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i,a=(e,t)=>{try{return new window.URL(e,t).toString()}catch(t){return e}},o=(e,t)=>{let n=s;if(!t)return e;if(!c(e))return e;d(e)&&(n=l),f(e)&&(n=u);const r=n(t),i="/"!==r.charAt(r.length-1)&&"/"!==e.charAt(0)?"/":"";return[r,e].join(i)};function s(e){const t=e.indexOf("/"),n=e.lastIndexOf("/");return-1!==t?n===t+1?e:(-1!==e.indexOf("?")&&(e=e.substring(0,e.indexOf("?"))),e.substring(0,n+1)):""}function l(e){const t=e.match(i);return t?t[1]:""}function u(e){const n=e.match(t);return n?n[0]:""}function c(e){return!t.test(e)}function d(e){return c(e)&&"/"===e.charAt(0)}function f(e){return 0===e.indexOf("//")}return function(){try{new window.URL("x","http://y"),e=a}catch(e){}finally{e=e||o}}(),{parseBaseUrl:s,parseOrigin:l,parseScheme:u,isRelative:c,isPathAbsolute:d,isSchemeRelative:f,isHTTPURL:function(e){return n.test(e)},isHTTPS:function(e){return r.test(e)},removeHostname:function(e){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(e)[2].substring(1)},resolve:function(t,n){return e(t,n)}}}i.__dashjs_factory_name="DefaultURLUtils",t.default=r.default.getSingletonFactory(i)},7393:function(e,t,n){n.r(t);var r=n(138),i=n(7316);function a(){let e;return e={areEqual:function(e,t){return i(e,t)}},e}a.__dashjs_factory_name="ObjectUtils",t.default=r.default.getSingletonFactory(a)},656:function(e,t,n){n.r(t),n.d(t,{checkInteger:function(){return a},checkIsVideoOrAudioType:function(){return s},checkParameterType:function(){return i},checkRange:function(){return o}});var r=n(5212);function i(e,t){if(typeof e!==t)throw r.default.BAD_ARGUMENT_ERROR}function a(e){if(null===e||isNaN(e)||e%1!=0)throw r.default.BAD_ARGUMENT_ERROR+" : argument is not an integer"}function o(e,t,n){if(e<t||e>n)throw r.default.BAD_ARGUMENT_ERROR+" : argument out of range"}function s(e){if("string"!=typeof e||e!==r.default.AUDIO&&e!==r.default.VIDEO)throw r.default.BAD_ARGUMENT_ERROR}},6503:function(e,t,n){n.r(t);var r=n(138),i=n(9026);function a(){let e,t,n=[];const r=this.context;function a(e,r,i){let a=function(e){let r;for(r=0;r<n.length;r++)if(n[r].regex.test(e))return n[r].utils;return t}(i||r);return a&&"function"==typeof a[e]?a[e](r,i):t[e](r,i)}return t=(0,i.default)(r).getInstance(),e={registerUrlRegex:function(e,t){n.push({regex:e,utils:t})},parseBaseUrl:function(e){return a("parseBaseUrl",e)},parseOrigin:function(e){return a("parseOrigin",e)},parseScheme:function(e){return a("parseScheme",e)},isRelative:function(e){return a("isRelative",e)},isPathAbsolute:function(e){return a("isPathAbsolute",e)},isSchemeRelative:function(e){return a("isSchemeRelative",e)},isHTTPURL:function(e){return a("isHTTPURL",e)},isHTTPS:function(e){return a("isHTTPS",e)},removeHostname:function(e){return a("removeHostname",e)},resolve:function(e,t){return a("resolve",e,t)}},e}a.__dashjs_factory_name="URLUtils";const o=r.default.getSingletonFactory(a);t.default=o},1613:function(e,t,n){n.r(t);var r=n(2842);class i extends r.default{constructor(e){super(),this.method=e||null}}t.default=i},447:function(e,t,n){n.r(t),t.default=class{constructor(e){this.url=e.url,this.method=e.method,this.body=void 0!==e.body?e.body:null,this.responseType=void 0!==e.responseType?e.responseType:null,this.headers=void 0!==e.headers?e.headers:{},this.credentials=void 0!==e.credentials?e.credentials:null,this.mode=void 0!==e.mode?e.mode:null,this.timeout=void 0!==e.timeout?e.timeout:0,this.customData=void 0!==e.customData?e.customData:{}}}},5099:function(e,t,n){n.r(t),t.default=class{constructor(e){this.request=e.request,this.url=void 0!==e.url?e.url:null,this.redirected=void 0!==e.redirected&&e.redirected,this.status=void 0!==e.status?e.status:null,this.statusText=void 0!==e.statusText?e.statusText:"",this.type=void 0!==e.type?e.type:"",this.headers=void 0!==e.headers?e.headers:{},this.data=void 0!==e.data?e.data:null,this.resourceTiming=void 0!==e.resourceTiming?e.resourceTiming:null}}},1944:function(e,t,n){n.r(t),t.default=class{constructor(e,t,n){this.co
2de=e||null,this.message=t||null,this.data=n||null}}},5560:function(e,t,n){n.r(t);var r=n(8854);t.default=class{constructor(e){this.id=e.id,this.url=e.url,this.language=e.language,this.mimeType=e.mimeType,this.bandwidth=e.bandwidth,this.periodId=e.periodId||null}serializeToMpdParserFormat(){return{tagName:r.default.ADAPTATION_SET,mimeType:this.mimeType,lang:this.language,Representation:[{tagName:r.default.REPRESENTATION,id:this.id,bandwidth:this.bandwidth,BaseURL:[{tagName:r.default.BASE_URL,__text:this.url}],mimeType:this.mimeType}]}}}},2842:function(e,t,n){n.r(t);var r=n(7568);class i{constructor(e){this.action=i.ACTION_DOWNLOAD,this.availabilityEndTime=null,this.availabilityStartTime=null,this.bandwidth=NaN,this.bytesLoaded=NaN,this.bytesTotal=NaN,this.delayLoadingTime=NaN,this.duration=NaN,this.endDate=null,this.firstByteDate=null,this.index=NaN,this.isPartialSegmentRequest=!1,this.mediaStartTime=NaN,this.mediaType=null,this.presentationStartTime=NaN,this.range=null,this.representation=null,this.responseType="arraybuffer",this.retryAttempts=0,this.serviceLocation=null,this.startDate=null,this.startTime=NaN,this.timescale=NaN,this.type=null,this.url=e||null,this.wallStartTime=null}isInitializationRequest(){return this.type&&this.type===r.HTTPRequest.INIT_SEGMENT_TYPE}setInfo(e){this.type=e&&e.init?r.HTTPRequest.INIT_SEGMENT_TYPE:r.HTTPRequest.MEDIA_SEGMENT_TYPE,this.url=e&&e.url?e.url:null,this.range=e&&e.range?e.range.start+"-"+e.range.end:null,this.mediaType=e&&e.mediaType?e.mediaType:null,this.representation=e&&e.representation?e.representation:null}}i.ACTION_DOWNLOAD="download",i.ACTION_COMPLETE="complete",t.default=i},7568:function(e,t,n){n.r(t),n.d(t,{HTTPRequest:function(){return r},HTTPRequestTrace:function(){return i}});class r{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 i{constructor(){this.s=null,this.d=null,this.b=[]}}r.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",r.CONTENT_STEERING_TYPE="ContentSteering",r.DVB_REPORTING_TYPE="DVBReporting",r.GET="GET",r.POST="POST",r.HEAD="HEAD",r.INDEX_SEGMENT_TYPE="IndexSegment",r.INIT_SEGMENT_TYPE="InitializationSegment",r.LICENSE="license",r.LICENSE_CERTIFICATE="licenseCertificate",r.MEDIA_SEGMENT_TYPE="MediaSegment",r.MPD_TYPE="MPD",r.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",r.CMCD_EVENT="CmcdEvent",r.OTHER_TYPE="other",r.XLINK_EXPANSION_TYPE="XLinkExpansion"}},i={};function o(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return r[e](n,n.exports,o),n.exports}o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};o.r(l),o.d(l,{Constants:function(){return m.default},Debug:function(){return p.default},ExternalSubtitle:function(){return T.default},MediaPlayer:function(){return u.MediaPlayer},MediaPlayerFactory:function(){return h},MetricsReporting:function(){return c.default},Protection:function(){return d.default},default:function(){return _},supportsMediaSource:function(){return E.supportsMediaSource}});var u=o(5393),c=o(4469),d=o(7037),f=o(9839);let g=function(){const e="application/dash+xml";let t;function n(n,r,i){if(!n||!/^VIDEO$/i.test(n.nodeName))return null;if(n._dashjs_player)return n._dashjs_player;let a,o=n.id||n.name||"video element";if(!(r=r||[].slice.call(n.querySelectorAll("source")).filter(function(t){return t.type==e})[0])&&n.src)(r=document.createElement("source")).src=n.src;else if(!r&&!n.src)return null;return i=i||{},a=(0,f.default)(i).create(),a.initialize(n,r.src,n.autoplay),t||(t=a.getDebug().getLogger()),t.debug("Converted "+o+" to dash.js player and added content: "+r.src),n._dashjs_player=a,a}function r(e){return/^VIDEO$/i.test(e.nodeName)?e:r(e.parentNode)}return{create:n,createAll:function(t,i){let a=[];t=t||"[data-dashjs-player]";let o=(i=i||document).querySelectorAll(t);for(let e=0;e<o.length;e++){let t=n(o[e],null);a.push(t)}let s=i.querySelectorAll('source[type="'+e+'"]');for(let e=0;e<s.length;e++){let t=n(r(s[e]),null);a.push(t)}return a}}}();if("undefined"!=typeof window&&window){let S;function I(){window.removeEventListener("load",I),g.createAll()}function A(){window.dashjs&&(window.clearInterval(S),g.createAll())}(!window.dashjs||!window.dashjs.skipAutoCreate)&&window.addEventListener&&("complete"===window.document.readyState?window.dashjs?g.createAll():S=window.setInterval(A,500):window.addEventListener("load",I))}var h=g,p=o(649),m=o(5212),E=o(559),T=o(5560);dashjs.Protection=d.default,dashjs.MetricsReporting=c.default,dashjs.MediaPlayerFactory=h,dashjs.Debug=p.default,dashjs.supportsMediaSource=E.supportsMediaSource,dashjs.Constants=m.default,dashjs.ExternalSubtitle=T.default;var _=dashjs,y=((l=l.default).Constants,l.Debug,l.ExternalSubtitle,l.MediaPlayer);l.MediaPlayerFactory,l.MetricsReporting,l.Protection,l.default,l.supp
2ortsMediaSource}}]);
3//# sourceMappingURL=303.c208535b8789ac210445.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.