Files
MultiRoombaRover/server/public/assets/dash.all.min-C9gxBrL1.js
T

24 lines
839 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var Yl={7267:function(wt,me){me.byteLength=function(w){var g=E(w),h=g[0],r=g[1];return 3*(h+r)/4-r},me.toByteArray=function(w){var g,h,r=E(w),H=r[0],G=r[1],le=new f((function(ce,Le,Be){return 3*(Le+Be)/4-Be})(0,H,G)),de=0,De=G>0?H-4:H;for(h=0;h<De;h+=4)g=F[w.charCodeAt(h)]<<18|F[w.charCodeAt(h+1)]<<12|F[w.charCodeAt(h+2)]<<6|F[w.charCodeAt(h+3)],le[de++]=g>>16&255,le[de++]=g>>8&255,le[de++]=255&g;return G===2&&(g=F[w.charCodeAt(h)]<<2|F[w.charCodeAt(h+1)]>>4,le[de++]=255&g),G===1&&(g=F[w.charCodeAt(h)]<<10|F[w.charCodeAt(h+1)]<<4|F[w.charCodeAt(h+2)]>>2,le[de++]=g>>8&255,le[de++]=255&g),le},me.fromByteArray=function(w){for(var g,h=w.length,r=h%3,H=[],G=16383,le=0,de=h-r;le<de;le+=G)H.push(_(w,le,le+G>de?de:le+G));return r===1?(g=w[h-1],H.push(P[g>>2]+P[g<<4&63]+"==")):r===2&&(g=(w[h-2]<<8)+w[h-1],H.push(P[g>>10]+P[g>>4&63]+P[g<<2&63]+"=")),H.join("")};for(var P=[],F=[],f=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0;p<64;++p)P[p]=o[p],F[o.charCodeAt(p)]=p;function E(w){var g=w.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var h=w.indexOf("=");return h===-1&&(h=g),[h,h===g?0:4-h%4]}function _(w,g,h){for(var r,H,G=[],le=g;le<h;le+=3)r=(w[le]<<16&16711680)+(w[le+1]<<8&65280)+(255&w[le+2]),G.push(P[(H=r)>>18&63]+P[H>>12&63]+P[H>>6&63]+P[63&H]);return G.join("")}F[45]=62,F[95]=63},44:function(wt,me,P){const F=P(7267),f=P(7986),o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;me.Buffer=_,me.SlowBuffer=function(i){return+i!=i&&(i=0),_.alloc(+i)},me.INSPECT_MAX_BYTES=50;const p=2147483647;function E(i){if(i>p)throw new RangeError('The value "'+i+'" is invalid for option "size"');const S=new Uint8Array(i);return Object.setPrototypeOf(S,_.prototype),S}function _(i,S,I){if(typeof i=="number"){if(typeof S=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(i)}return w(i,S,I)}function w(i,S,I){if(typeof i=="string")return(function(be,tt){if(typeof tt=="string"&&tt!==""||(tt="utf8"),!_.isEncoding(tt))throw new TypeError("Unknown encoding: "+tt);const ae=0|le(be,tt);let ze=E(ae);const je=ze.write(be,tt);return je!==ae&&(ze=ze.slice(0,je)),ze})(i,S);if(ArrayBuffer.isView(i))return(function(be){if(j(be,Uint8Array)){const tt=new Uint8Array(be);return H(tt.buffer,tt.byteOffset,tt.byteLength)}return r(be)})(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(j(i,ArrayBuffer)||i&&j(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(j(i,SharedArrayBuffer)||i&&j(i.buffer,SharedArrayBuffer)))return H(i,S,I);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const $=i.valueOf&&i.valueOf();if($!=null&&$!==i)return _.from($,S,I);const ie=(function(be){if(_.isBuffer(be)){const tt=0|G(be.length),ae=E(tt);return ae.length===0||be.copy(ae,0,0,tt),ae}return be.length!==void 0?typeof be.length!="number"||qe(be.length)?E(0):r(be):be.type==="Buffer"&&Array.isArray(be.data)?r(be.data):void 0})(i);if(ie)return ie;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return _.from(i[Symbol.toPrimitive]("string"),S,I);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}function g(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function h(i){return g(i),E(i<0?0:0|G(i))}function r(i){const S=i.length<0?0:0|G(i.length),I=E(S);for(let $=0;$<S;$+=1)I[$]=255&i[$];return I}function H(i,S,I){if(S<0||i.byteLength<S)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<S+(I||0))throw new RangeError('"length" is outside of buffer bounds');let $;return $=S===void 0&&I===void 0?new Uint8Array(i):I===void 0?new Uint8Array(i,S):new Uint8Array(i,S,I),Object.setPrototypeOf($,_.prototype),$}function G(i){if(i>=p)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p.toString(16)+" bytes");return 0|i}function le(i,S){if(_.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||j(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);const I=i.length,$=arguments.length>2&&arguments[2]===!0;if(!$&&I===0)return 0;let ie=!1;for(;;)switch(S){case"ascii":case"latin1":case"binary":return I;case"utf8":case"utf-8":return V(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*I;case"hex":return I>>>1;case"base64":return B(i).length;default:if(ie)return $?-1:V(i).length;S=(""+S).toLowerCase(),ie=!0}}function de(i,S,I){let $=!1;if((S===void 0||S<0)&&(S=0),S>this.length||((I===void 0||I>this.length)&&(I=this.length),I<=0)||(I>>>=0)<=(S>>>=0))return"";for(i||(i="utf8");;)switch(i){case"hex":return pt(this,S,I);case"utf8":case"utf-8":return Ne(this,S,I);case"ascii":return ht(this,S,I);case"latin1":case"binary":return ye(this,S,I);case"base64":return Se(this,S,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return He(this,S,I);default:if($)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),$=!0}}function De(i,S,I){const $=i[S];i[S]=i[I],i[I]=$}function ce(i,S,I,$,ie){if(i.length===0)return-1;if(typeof I=="string"?($=I,I=0):I>2147483647?I=2147483647:I<-2147483648&&(I=-2147483648),qe(I=+I)&&(I=ie?0:i.length-1),I<0&&(I=i.length+I),I>=i.length){if(ie)return-1;I=i.length-1}else if(I<0){if(!ie)return-1;I=0}if(typeof S=="string"&&(S=_.from(S,$)),_.isBuffer(S))return S.length===0?-1:Le(i,S,I,$,ie);if(typeof S=="number")return S&=255,typeof Uint8Array.prototype.indexOf=="function"?ie?Uint8Array.prototype.indexOf.call(i,S,I):Uint8Array.prototype.lastIndexOf.call(i,S,I):Le(i,[S],I,$,ie);throw new TypeError("val must be string, number or Buffer")}function Le(i,S,I,$,ie){let be,tt=1,ae=i.length,ze=S.length;if($!==void 0&&(($=String($).toLowerCase())==="ucs2"||$==="ucs-2"||$==="utf16le"||$==="utf-16le")){if(i.length<2||S.length<2)return-1;tt=2,ae/=2,ze/=2,I/=2}function je(Y,he){return tt===1?Y[he]:Y.readUInt16BE(he*tt)}if(ie){let Y=-1;for(be=I;be<ae;be++)if(je(i,be)===je(S,Y===-1?0:be-Y)){if(Y===-1&&(Y=be),be-Y+1===ze)return Y*tt}else Y!==-1&&(be-=be-Y),Y=-1}else for(I+ze>ae&&(I=ae-ze),be=I;be>=0;be--){let Y=!0;for(let he=0;he<ze;he++)if(je(i,be+he)!==je(S,he)){Y=!1;break}if(Y)return be}return-1}function Be(i,S,I,$){I=Number(I)||0;const ie=i.length-I;$?($=Number($))>ie&&($=ie):$=ie;const be=S.length;let tt;for($>be/2&&($=be/2),tt=0;tt<$;++tt){const ae=parseInt(S.substr(2*tt,2),16);if(qe(ae))return tt;i[I+tt]=ae}return tt}function ot(i,S,I,$){return Pe(V(S,i.length-I),i,I,$)}function Ge(i,S,I,$){return Pe((function(ie){const be=[];for(let tt=0;tt<ie.length;++tt)be.push(255&ie.charCodeAt(tt));return be})(S),i,I,$)}function X(i,S,I,$){return Pe(B(S),i,I,$)}function Z(i,S,I,$){return Pe((function(ie,be){let tt,ae,ze;const je=[];for(let Y=0;Y<ie.length&&!((be-=2)<0);++Y)tt=ie.charCodeAt(Y),ae=tt>>8,ze=tt%256,je.push(ze),je.push(ae);return je})(S,i.length-I),i,I,$)}function Se(i,S,I){return S===0&&I===i.length?F.fromByteArray(i):F.fromByteArray(i.slice(S,I))}function Ne(i,S,I){I=Math.min(i.length,I);const $=[];let ie=S;for(;ie<I;){const be=i[ie];let tt=null,ae=be>239?4:be>223?3:be>191?2:1;if(ie+ae<=I){let ze,je,Y,he;switch(ae){case 1:be<128&&(tt=be);break;case 2:ze=i[ie+1],(192&ze)==128&&(he=(31&be)<<6|63&ze,he>127&&(tt=he));break;case 3:ze=i[ie+1],je=i[ie+2],(192&ze)==128&&(192&je)==128&&(he=(15&be)<<12|(63&ze)<<6|63&je,he>2047&&(he<55296||he>57343)&&(tt=he));break;case 4:ze=i[ie+1],je=i[ie+2],Y=i[ie+3],(192&ze)==128&&(192&je)==128&&(192&Y)==128&&(he=(15&be)<<18|(63&ze)<<12|(63&je)<<6|63&Y,he>65535&&he<1114112&&(tt=he))}}tt===null?(tt=65533,ae=1):tt>65535&&(tt-=65536,$.push(tt>>>10&1023|55296),tt=56320|1023&tt),$.push(tt),ie+=ae}return(function(be){const tt=be.length;if(tt<=ke)return String.fromCharCode.apply(String,be);let ae="",ze=0;for(;ze<tt;)ae+=String.fromCharCode.apply(String,be.slice(ze,ze+=ke));return ae})($)}me.kMaxLength=p,_.TYPED_ARRAY_SUPPORT=(function(){try{const i=new Uint8Array(1),S={foo:function(){return 42}};return Object.setPrototypeOf(S,Uint8Array.prototype),Object.setPrototypeOf(i,S),i.foo()===42}catch{return!1}})(),_.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||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(_.prototype,"parent",{enumerable:!0,get:function(){if(_.isBuffer(this))return this.buffer}}),Object.defineProperty(_.prototype,"offset",{enumerable:!0,get:function(){if(_.isBuffer(this))return this.byteOffset}}),_.poolSize=8192,_.from=function(i,S,I){return w(i,S,I)},Object.setPrototypeOf(_.prototype,Uint8Array.prototype),Object.setPrototypeOf(_,Uint8Array),_.alloc=function(i,S,I){return(function($,ie,be){return g($),$<=0?E($):ie!==void 0?typeof be=="string"?E($).fill(ie,be):E($).fill(ie):E($)})(i,S,I)},_.allocUnsafe=function(i){return h(i)},_.allocUnsafeSlow=function(i){return h(i)},_.isBuffer=function(i){return i!=null&&i._isBuffer===!0&&i!==_.prototype},_.compare=function(i,S){if(j(i,Uint8Array)&&(i=_.from(i,i.offset,i.byteLength)),j(S,Uint8Array)&&(S=_.from(S,S.offset,S.byteLength)),!_.isBuffer(i)||!_.isBuffer(S))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(i===S)return 0;let I=i.length,$=S.length;for(let ie=0,be=Math.min(I,$);ie<be;++ie)if(i[ie]!==S[ie]){I=i[ie],$=S[ie];break}return I<$?-1:$<I?1:0},_.isEncoding=function(i){switch(String(i).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}},_.concat=function(i,S){if(!Array.isArray(i))throw new TypeError('"list" argument must be an Array of Buffers');if(i.length===0)return _.alloc(0);let I;if(S===void 0)for(S=0,I=0;I<i.length;++I)S+=i[I].length;const $=_.allocUnsafe(S);let ie=0;for(I=0;I<i.length;++I){let be=i[I];if(j(be,Uint8Array))ie+be.length>$.length?(_.isBuffer(be)||(be=_.from(be)),be.copy($,ie)):Uint8Array.prototype.set.call($,be,ie);else{if(!_.isBuffer(be))throw new TypeError('"list" argument must be an Array of Buffers');be.copy($,ie)}ie+=be.length}return $},_.byteLength=le,_.prototype._isBuffer=!0,_.prototype.swap16=function(){const i=this.length;if(i%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let S=0;S<i;S+=2)De(this,S,S+1);return this},_.prototype.swap32=function(){const i=this.length;if(i%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let S=0;S<i;S+=4)De(this,S,S+3),De(this,S+1,S+2);return this},_.prototype.swap64=function(){const i=this.length;if(i%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let S=0;S<i;S+=8)De(this,S,S+7),De(this,S+1,S+6),De(this,S+2,S+5),De(this,S+3,S+4);return this},_.prototype.toString=function(){const i=this.length;return i===0?"":arguments.length===0?Ne(this,0,i):de.apply(this,arguments)},_.prototype.toLocaleString=_.prototype.toString,_.prototype.equals=function(i){if(!_.isBuffer(i))throw new TypeError("Argument must be a Buffer");return this===i||_.compare(this,i)===0},_.prototype.inspect=function(){let i="";const S=me.INSPECT_MAX_BYTES;return i=this.toString("hex",0,S).replace(/(.{2})/g,"$1 ").trim(),this.length>S&&(i+=" ... "),"<Buffer "+i+">"},o&&(_.prototype[o]=_.prototype.inspect),_.prototype.compare=function(i,S,I,$,ie){if(j(i,Uint8Array)&&(i=_.from(i,i.offset,i.byteLength)),!_.isBuffer(i))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof i);if(S===void 0&&(S=0),I===void 0&&(I=i?i.length:0),$===void 0&&($=0),ie===void 0&&(ie=this.length),S<0||I>i.length||$<0||ie>this.length)throw new RangeError("out of range index");if($>=ie&&S>=I)return 0;if($>=ie)return-1;if(S>=I)return 1;if(this===i)return 0;let be=(ie>>>=0)-($>>>=0),tt=(I>>>=0)-(S>>>=0);const ae=Math.min(be,tt),ze=this.slice($,ie),je=i.slice(S,I);for(let Y=0;Y<ae;++Y)if(ze[Y]!==je[Y]){be=ze[Y],tt=je[Y];break}return be<tt?-1:tt<be?1:0},_.prototype.includes=function(i,S,I){return this.indexOf(i,S,I)!==-1},_.prototype.indexOf=function(i,S,I){return ce(this,i,S,I,!0)},_.prototype.lastIndexOf=function(i,S,I){return ce(this,i,S,I,!1)},_.prototype.write=function(i,S,I,$){if(S===void 0)$="utf8",I=this.length,S=0;else if(I===void 0&&typeof S=="string")$=S,I=this.length,S=0;else{if(!isFinite(S))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");S>>>=0,isFinite(I)?(I>>>=0,$===void 0&&($="utf8")):($=I,I=void 0)}const ie=this.length-S;if((I===void 0||I>ie)&&(I=ie),i.length>0&&(I<0||S<0)||S>this.length)throw new RangeError("Attempt to write outside buffer bounds");$||($="utf8");let be=!1;for(;;)switch($){case"hex":return Be(this,i,S,I);case"utf8":case"utf-8":return ot(this,i,S,I);case"ascii":case"latin1":case"binary":return Ge(this,i,S,I);case"base64":return X(this,i,S,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,i,S,I);default:if(be)throw new TypeError("Unknown encoding: "+$);$=(""+$).toLowerCase(),be=!0}},_.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const ke=4096;function ht(i,S,I){let $="";I=Math.min(i.length,I);for(let ie=S;ie<I;++ie)$+=String.fromCharCode(127&i[ie]);return $}function ye(i,S,I){let $="";I=Math.min(i.length,I);for(let ie=S;ie<I;++ie)$+=String.fromCharCode(i[ie]);return $}function pt(i,S,I){const $=i.length;(!S||S<0)&&(S=0),(!I||I<0||I>$)&&(I=$);let ie="";for(let be=S;be<I;++be)ie+=it[i[be]];return ie}function He(i,S,I){const $=i.slice(S,I);let ie="";for(let be=0;be<$.length-1;be+=2)ie+=String.fromCharCode($[be]+256*$[be+1]);return ie}function Fe(i,S,I){if(i%1!=0||i<0)throw new RangeError("offset is not uint");if(i+S>I)throw new RangeError("Trying to access beyond buffer length")}function Ke(i,S,I,$,ie,be){if(!_.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(S>ie||S<be)throw new RangeError('"value" argument is out of bounds');if(I+$>i.length)throw new RangeError("Index out of range")}function Pt(i,S,I,$,ie){Ie(S,$,ie,i,I,7);let be=Number(S&BigInt(4294967295));i[I++]=be,be>>=8,i[I++]=be,be>>=8,i[I++]=be,be>>=8,i[I++]=be;let tt=Number(S>>BigInt(32)&BigInt(4294967295));return i[I++]=tt,tt>>=8,i[I++]=tt,tt>>=8,i[I++]=tt,tt>>=8,i[I++]=tt,I}function Nt(i,S,I,$,ie){Ie(S,$,ie,i,I,7);let be=Number(S&BigInt(4294967295));i[I+7]=be,be>>=8,i[I+6]=be,be>>=8,i[I+5]=be,be>>=8,i[I+4]=be;let tt=Number(S>>BigInt(32)&BigInt(4294967295));return i[I+3]=tt,tt>>=8,i[I+2]=tt,tt>>=8,i[I+1]=tt,tt>>=8,i[I]=tt,I+8}function kt(i,S,I,$,ie,be){if(I+$>i.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("Index out of range")}function Ut(i,S,I,$,ie){return S=+S,I>>>=0,ie||kt(i,0,I,4),f.write(i,S,I,$,23,4),I+4}function ln(i,S,I,$,ie){return S=+S,I>>>=0,ie||kt(i,0,I,8),f.write(i,S,I,$,52,8),I+8}_.prototype.slice=function(i,S){const I=this.length;(i=~~i)<0?(i+=I)<0&&(i=0):i>I&&(i=I),(S=S===void 0?I:~~S)<0?(S+=I)<0&&(S=0):S>I&&(S=I),S<i&&(S=i);const $=this.subarray(i,S);return Object.setPrototypeOf($,_.prototype),$},_.prototype.readUintLE=_.prototype.readUIntLE=function(i,S,I){i>>>=0,S>>>=0,I||Fe(i,S,this.length);let $=this[i],ie=1,be=0;for(;++be<S&&(ie*=256);)$+=this[i+be]*ie;return $},_.prototype.readUintBE=_.prototype.readUIntBE=function(i,S,I){i>>>=0,S>>>=0,I||Fe(i,S,this.length);let $=this[i+--S],ie=1;for(;S>0&&(ie*=256);)$+=this[i+--S]*ie;return $},_.prototype.readUint8=_.prototype.readUInt8=function(i,S){return i>>>=0,S||Fe(i,1,this.length),this[i]},_.prototype.readUint16LE=_.prototype.readUInt16LE=function(i,S){return i>>>=0,S||Fe(i,2,this.length),this[i]|this[i+1]<<8},_.prototype.readUint16BE=_.prototype.readUInt16BE=function(i,S){return i>>>=0,S||Fe(i,2,this.length),this[i]<<8|this[i+1]},_.prototype.readUint32LE=_.prototype.readUInt32LE=function(i,S){return i>>>=0,S||Fe(i,4,this.length),(this[i]|this[i+1]<<8|this[i+2]<<16)+16777216*this[i+3]},_.prototype.readUint32BE=_.prototype.readUInt32BE=function(i,S){return i>>>=0,S||Fe(i,4,this.length),16777216*this[i]+(this[i+1]<<16|this[i+2]<<8|this[i+3])},_.prototype.readBigUInt64LE=_e((function(i){mt(i>>>=0,"offset");const S=this[i],I=this[i+7];S!==void 0&&I!==void 0||It(i,this.length-8);const $=S+256*this[++i]+65536*this[++i]+this[++i]*2**24,ie=this[++i]+256*this[++i]+65536*this[++i]+I*2**24;return BigInt($)+(BigInt(ie)<<BigInt(32))})),_.prototype.readBigUInt64BE=_e((function(i){mt(i>>>=0,"offset");const S=this[i],I=this[i+7];S!==void 0&&I!==void 0||It(i,this.length-8);const $=S*2**24+65536*this[++i]+256*this[++i]+this[++i],ie=this[++i]*2**24+65536*this[++i]+256*this[++i]+I;return(BigInt($)<<BigInt(32))+BigInt(ie)})),_.prototype.readIntLE=function(i,S,I){i>>>=0,S>>>=0,I||Fe(i,S,this.length);let $=this[i],ie=1,be=0;for(;++be<S&&(ie*=256);)$+=this[i+be]*ie;return ie*=128,$>=ie&&($-=Math.pow(2,8*S)),$},_.prototype.readIntBE=function(i,S,I){i>>>=0,S>>>=0,I||Fe(i,S,this.length);let $=S,ie=1,be=this[i+--$];for(;$>0&&(ie*=256);)be+=this[i+--$]*ie;return ie*=128,be>=ie&&(be-=Math.pow(2,8*S)),be},_.prototype.readInt8=function(i,S){return i>>>=0,S||Fe(i,1,this.length),128&this[i]?-1*(255-this[i]+1):this[i]},_.prototype.readInt16LE=function(i,S){i>>>=0,S||Fe(i,2,this.length);const I=this[i]|this[i+1]<<8;return 32768&I?4294901760|I:I},_.prototype.readInt16BE=function(i,S){i>>>=0,S||Fe(i,2,this.length);const I=this[i+1]|this[i]<<8;return 32768&I?4294901760|I:I},_.prototype.readInt32LE=function(i,S){return i>>>=0,S||Fe(i,4,this.length),this[i]|this[i+1]<<8|this[i+2]<<16|this[i+3]<<24},_.prototype.readInt32BE=function(i,S){return i>>>=0,S||Fe(i,4,this.length),this[i]<<24|this[i+1]<<16|this[i+2]<<8|this[i+3]},_.prototype.readBigInt64LE=_e((function(i){mt(i>>>=0,"offset");const S=this[i],I=this[i+7];S!==void 0&&I!==void 0||It(i,this.length-8);const $=this[i+4]+256*this[i+5]+65536*this[i+6]+(I<<24);return(BigInt($)<<BigInt(32))+BigInt(S+256*this[++i]+65536*this[++i]+this[++i]*16777216)})),_.prototype.readBigInt64BE=_e((function(i){mt(i>>>=0,"offset");const S=this[i],I=this[i+7];S!==void 0&&I!==void 0||It(i,this.length-8);const $=(S<<24)+65536*this[++i]+256*this[++i]+this[++i];return(BigInt($)<<BigInt(32))+BigInt(this[++i]*16777216+65536*this[++i]+256*this[++i]+I)})),_.prototype.readFloatLE=function(i,S){return i>>>=0,S||Fe(i,4,this.length),f.read(this,i,!0,23,4)},_.prototype.readFloatBE=function(i,S){return i>>>=0,S||Fe(i,4,this.length),f.read(this,i,!1,23,4)},_.prototype.readDoubleLE=function(i,S){return i>>>=0,S||Fe(i,8,this.length),f.read(this,i,!0,52,8)},_.prototype.readDoubleBE=function(i,S){return i>>>=0,S||Fe(i,8,this.length),f.read(this,i,!1,52,8)},_.prototype.writeUintLE=_.prototype.writeUIntLE=function(i,S,I,$){i=+i,S>>>=0,I>>>=0,$||Ke(this,i,S,I,Math.pow(2,8*I)-1,0);let ie=1,be=0;for(this[S]=255&i;++be<I&&(ie*=256);)this[S+be]=i/ie&255;return S+I},_.prototype.writeUintBE=_.prototype.writeUIntBE=function(i,S,I,$){i=+i,S>>>=0,I>>>=0,$||Ke(this,i,S,I,Math.pow(2,8*I)-1,0);let ie=I-1,be=1;for(this[S+ie]=255&i;--ie>=0&&(be*=256);)this[S+ie]=i/be&255;return S+I},_.prototype.writeUint8=_.prototype.writeUInt8=function(i,S,I){return i=+i,S>>>=0,I||Ke(this,i,S,1,255,0),this[S]=255&i,S+1},_.prototype.writeUint16LE=_.prototype.writeUInt16LE=function(i,S,I){return i=+i,S>>>=0,I||Ke(this,i,S,2,65535,0),this[S]=255&i,this[S+1]=i>>>8,S+2},_.prototype.writeUint16BE=_.prototype.writeUInt16BE=function(i,S,I){return i=+i,S>>>=0,I||Ke(this,i,S,2,65535,0),this[S]=i>>>8,this[S+1]=255&i,S+2},_.prototype.writeUint32LE=_.prototype.writeUInt32LE=function(i,S,I){return i=+i,S>>>=0,I||Ke(this,i,S,4,4294967295,0),this[S+3]=i>>>24,this[S+2]=i>>>16,this[S+1]=i>>>8,this[S]=255&i,S+4},_.prototype.writeUint32BE=_.prototype.writeUInt32BE=function(i,S,I){return i=+i,S>>>=0,I||Ke(this,i,S,4,4294967295,0),this[S]=i>>>24,this[S+1]=i>>>16,this[S+2]=i>>>8,this[S+3]=255&i,S+4},_.prototype.writeBigUInt64LE=_e((function(i,S=0){return Pt(this,i,S,BigInt(0),BigInt("0xffffffffffffffff"))})),_.prototype.writeBigUInt64BE=_e((function(i,S=0){return Nt(this,i,S,BigInt(0),BigInt("0xffffffffffffffff"))})),_.prototype.writeIntLE=function(i,S,I,$){if(i=+i,S>>>=0,!$){const ae=Math.pow(2,8*I-1);Ke(this,i,S,I,ae-1,-ae)}let ie=0,be=1,tt=0;for(this[S]=255&i;++ie<I&&(be*=256);)i<0&&tt===0&&this[S+ie-1]!==0&&(tt=1),this[S+ie]=(i/be|0)-tt&255;return S+I},_.prototype.writeIntBE=function(i,S,I,$){if(i=+i,S>>>=0,!$){const ae=Math.pow(2,8*I-1);Ke(this,i,S,I,ae-1,-ae)}let ie=I-1,be=1,tt=0;for(this[S+ie]=255&i;--ie>=0&&(be*=256);)i<0&&tt===0&&this[S+ie+1]!==0&&(tt=1),this[S+ie]=(i/be|0)-tt&255;return S+I},_.prototype.writeInt8=function(i,S,I){return i=+i,S>>>=0,I||Ke(this,i,S,1,127,-128),i<0&&(i=255+i+1),this[S]=255&i,S+1},_.prototype.writeInt16LE=function(i,S,I){return i=+i,S>>>=0,I||Ke(this,i,S,2,32767,-32768),this[S]=255&i,this[S+1]=i>>>8,S+2},_.prototype.writeInt16BE=function(i,S,I){return i=+i,S>>>=0,I||Ke(this,i,S,2,32767,-32768),this[S]=i>>>8,this[S+1]=255&i,S+2},_.prototype.writeInt32LE=function(i,S,I){return i=+i,S>>>=0,I||Ke(this,i,S,4,2147483647,-2147483648),this[S]=255&i,this[S+1]=i>>>8,this[S+2]=i>>>16,this[S+3]=i>>>24,S+4},_.prototype.writeInt32BE=function(i,S,I){return i=+i,S>>>=0,I||Ke(this,i,S,4,2147483647,-2147483648),i<0&&(i=4294967295+i+1),this[S]=i>>>24,this[S+1]=i>>>16,this[S+2]=i>>>8,this[S+3]=255&i,S+4},_.prototype.writeBigInt64LE=_e((function(i,S=0){return Pt(this,i,S,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),_.prototype.writeBigInt64BE=_e((function(i,S=0){return Nt(this,i,S,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),_.prototype.writeFloatLE=function(i,S,I){return Ut(this,i,S,!0,I)},_.prototype.writeFloatBE=function(i,S,I){return Ut(this,i,S,!1,I)},_.prototype.writeDoubleLE=function(i,S,I){return ln(this,i,S,!0,I)},_.prototype.writeDoubleBE=function(i,S,I){return ln(this,i,S,!1,I)},_.prototype.copy=function(i,S,I,$){if(!_.isBuffer(i))throw new TypeError("argument should be a Buffer");if(I||(I=0),$||$===0||($=this.length),S>=i.length&&(S=i.length),S||(S=0),$>0&&$<I&&($=I),$===I||i.length===0||this.length===0)return 0;if(S<0)throw new RangeError("targetStart out of bounds");if(I<0||I>=this.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("sourceEnd out of bounds");$>this.length&&($=this.length),i.length-S<$-I&&($=i.length-S+I);const ie=$-I;return this===i&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(S,I,$):Uint8Array.prototype.set.call(i,this.subarray(I,$),S),ie},_.prototype.fill=function(i,S,I,$){if(typeof i=="string"){if(typeof S=="string"?($=S,S=0,I=this.length):typeof I=="string"&&($=I,I=this.length),$!==void 0&&typeof $!="string")throw new TypeError("encoding must be a string");if(typeof $=="string"&&!_.isEncoding($))throw new TypeError("Unknown encoding: "+$);if(i.length===1){const be=i.charCodeAt(0);($==="utf8"&&be<128||$==="latin1")&&(i=be)}}else typeof i=="number"?i&=255:typeof i=="boolean"&&(i=Number(i));if(S<0||this.length<S||this.length<I)throw new RangeError("Out of range index");if(I<=S)return this;let ie;if(S>>>=0,I=I===void 0?this.length:I>>>0,i||(i=0),typeof i=="number")for(ie=S;ie<I;++ie)this[ie]=i;else{const be=_.isBuffer(i)?i:_.from(i,$),tt=be.length;if(tt===0)throw new TypeError('The value "'+i+'" is invalid for argument "value"');for(ie=0;ie<I-S;++ie)this[ie+S]=be[ie%tt]}return this};const an={};function En(i,S,I){an[i]=class extends I{constructor(){super(),Object.defineProperty(this,"message",{value:S.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${i}]`,this.stack,delete this.name}get code(){return i}set code($){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:$,writable:!0})}toString(){return`${this.name} [${i}]: ${this.message}`}}}function Oe(i){let S="",I=i.length;const $=i[0]==="-"?1:0;for(;I>=$+4;I-=3)S=`_${i.slice(I-3,I)}${S}`;return`${i.slice(0,I)}${S}`}function Ie(i,S,I,$,ie,be){if(i>I||i<S){const tt=typeof S=="bigint"?"n":"";let ae;throw ae=S===0||S===BigInt(0)?`>= 0${tt} and < 2${tt} ** ${8*(be+1)}${tt}`:`>= -(2${tt} ** ${8*(be+1)-1}${tt}) and < 2 ** ${8*(be+1)-1}${tt}`,new an.ERR_OUT_OF_RANGE("value",ae,i)}(function(tt,ae,ze){mt(ae,"offset"),tt[ae]!==void 0&&tt[ae+ze]!==void 0||It(ae,tt.length-(ze+1))})($,ie,be)}function mt(i,S){if(typeof i!="number")throw new an.ERR_INVALID_ARG_TYPE(S,"number",i)}function It(i,S,I){throw Math.floor(i)!==i?(mt(i,I),new an.ERR_OUT_OF_RANGE("offset","an integer",i)):S<0?new an.ERR_BUFFER_OUT_OF_BOUNDS:new an.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${S}`,i)}En("ERR_BUFFER_OUT_OF_BOUNDS",(function(i){return i?`${i} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),En("ERR_INVALID_ARG_TYPE",(function(i,S){return`The "${i}" argument must be of type number. Received type ${typeof S}`}),TypeError),En("ERR_OUT_OF_RANGE",(function(i,S,I){let $=`The value of "${i}" is out of range.`,ie=I;return Number.isInteger(I)&&Math.abs(I)>4294967296?ie=Oe(String(I)):typeof I=="bigint"&&(ie=String(I),(I>BigInt(2)**BigInt(32)||I<-(BigInt(2)**BigInt(32)))&&(ie=Oe(ie)),ie+="n"),$+=` It must be ${S}. Received ${ie}`,$}),RangeError);const Ye=/[^+/0-9A-Za-z-_]/g;function V(i,S){let I;S=S||1/0;const $=i.length;let ie=null;const be=[];for(let tt=0;tt<$;++tt){if(I=i.charCodeAt(tt),I>55295&&I<57344){if(!ie){if(I>56319){(S-=3)>-1&&be.push(239,191,189);continue}if(tt+1===$){(S-=3)>-1&&be.push(239,191,189);continue}ie=I;continue}if(I<56320){(S-=3)>-1&&be.push(239,191,189),ie=I;continue}I=65536+(ie-55296<<10|I-56320)}else ie&&(S-=3)>-1&&be.push(239,191,189);if(ie=null,I<128){if((S-=1)<0)break;be.push(I)}else if(I<2048){if((S-=2)<0)break;be.push(I>>6|192,63&I|128)}else if(I<65536){if((S-=3)<0)break;be.push(I>>12|224,I>>6&63|128,63&I|128)}else{if(!(I<1114112))throw new Error("Invalid code point");if((S-=4)<0)break;be.push(I>>18|240,I>>12&63|128,I>>6&63|128,63&I|128)}}return be}function B(i){return F.toByteArray((function(S){if((S=(S=S.split("=")[0]).trim().replace(Ye,"")).length<2)return"";for(;S.length%4!=0;)S+="=";return S})(i))}function Pe(i,S,I,$){let ie;for(ie=0;ie<$&&!(ie+I>=S.length||ie>=i.length);++ie)S[ie+I]=i[ie];return ie}function j(i,S){return i instanceof S||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===S.name}function qe(i){return i!=i}const it=(function(){const i="0123456789abcdef",S=new Array(256);for(let I=0;I<16;++I){const $=16*I;for(let ie=0;ie<16;++ie)S[$+ie]=i[I]+i[ie]}return S})();function _e(i){return typeof BigInt>"u"?Ue:i}function Ue(){throw new Error("BigInt not supported")}},6877:function(wt,me){var P={parseBuffer:function(o){return new F(o).parse()},addBoxProcessor:function(o,p){typeof o=="string"&&typeof p=="function"&&(f.prototype._boxProcessors[o]=p)},createFile:function(){return new F},createBox:function(o,p,E){var _=f.create(o);return p&&p.append(_,E),_},createFullBox:function(o,p,E){var _=P.createBox(o,p,E);return _.version=0,_.flags=0,_},Utils:{}};P.Utils.dataViewToString=function(o,p){var E=p||"utf-8";if(typeof TextDecoder<"u")return new TextDecoder(E).decode(o);var _=[],w=0;if(E==="utf-8")for(;w<o.byteLength;){var g=o.getUint8(w++);g<128||(g<224?(g=(31&g)<<6,g|=63&o.getUint8(w++)):g<240?(g=(15&g)<<12,g|=(63&o.getUint8(w++))<<6,g|=63&o.getUint8(w++)):(g=(7&g)<<18,g|=(63&o.getUint8(w++))<<12,g|=(63&o.getUint8(w++))<<6,g|=63&o.getUint8(w++))),_.push(String.fromCharCode(g))}else for(;w<o.byteLength;)_.push(String.fromCharCode(o.getUint8(w++)));return _.join("")},P.Utils.utf8ToByteArray=function(o){var p,E;if(typeof TextEncoder<"u")p=new TextEncoder().encode(o);else for(p=[],E=0;E<o.length;++E){var _=o.charCodeAt(E);_<128?p.push(_):_<2048?(p.push(192|_>>6),p.push(128|63&_)):_<65536?(p.push(224|_>>12),p.push(128|63&_>>6),p.push(128|63&_)):(p.push(240|_>>18),p.push(128|63&_>>12),p.push(128|63&_>>6),p.push(128|63&_))}return p},P.Utils.appendBox=function(o,p,E){if(p._offset=o._cursor.offset,p._root=o._root?o._root:o,p._raw=o._raw,p._parent=o,E!==-1)if(E!=null){var _,w=-1;if(typeof E=="number")w=E;else{if(typeof E=="string")_=E;else{if(typeof E!="object"||!E.type)return void o.boxes.push(p);_=E.type}for(var g=0;g<o.boxes.length;g++)if(_===o.boxes[g].type){w=g+1;break}}o.boxes.splice(w,0,p)}else o.boxes.push(p)},me.parseBuffer=P.parseBuffer,me.addBoxProcessor=P.addBoxProcessor,me.createFile=P.createFile,me.createBox=P.createBox,me.createFullBox=P.createFullBox,me.Utils=P.Utils,P.Cursor=function(o){this.offset=o===void 0?0:o};var F=function(o){this._cursor=new P.Cursor,this.boxes=[],o&&(this._raw=new DataView(o))};F.prototype.fetch=function(o){var p=this.fetchAll(o,!0);return p.length?p[0]:null},F.prototype.fetchAll=function(o,p){var E=[];return F._sweep.call(this,o,E,p),E},F.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var o=f.parse(this);if(o.type===void 0)break;this.boxes.push(o)}return this},F._sweep=function(o,p,E){for(var _ in this.type&&this.type==o&&p.push(this),this.boxes){if(p.length&&E)return;F._sweep.call(this.boxes[_],o,p,E)}},F.prototype.write=function(){var o,p=0;for(o=0;o<this.boxes.length;o++)p+=this.boxes[o].getLength(!1);var E=new Uint8Array(p);for(this._rawo=new DataView(E.buffer),this.bytes=E,this._cursor.offset=0,o=0;o<this.boxes.length;o++)this.boxes[o].write();return E.buffer},F.prototype.append=function(o,p){P.Utils.appendBox(this,o,p)};var f=function(){this._cursor=new P.Cursor};f.parse=function(o){var p=new f;return p._offset=o._cursor.offset,p._root=o._root?o._root:o,p._raw=o._raw,p._parent=o,p._parseBox(),o._cursor.offset=p._raw.byteOffset+p._raw.byteLength,p},f.create=function(o){var p=new f;return p.type=o,p.boxes=[],p},f.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"],f.prototype._boxProcessors={},f.prototype._procField=function(o,p,E){this._parsing?this[o]=this._readField(p,E):this._writeField(p,E,this[o])},f.prototype._procFieldArray=function(o,p,E,_){var w;if(this._parsing)for(this[o]=[],w=0;w<p;w++)this[o][w]=this._readField(E,_);else for(w=0;w<this[o].length;w++)this._writeField(E,_,this[o][w])},f.prototype._procFullBox=function(){this._procField("version","uint",8),this._procField("flags","uint",24)},f.prototype._procEntries=function(o,p,E){var _;if(this._parsing)for(this[o]=[],_=0;_<p;_++)this[o].push({}),E.call(this,this[o][_]);else for(_=0;_<p;_++)E.call(this,this[o][_])},f.prototype._procSubEntries=function(o,p,E,_){var w;if(this._parsing)for(o[p]=[],w=0;w<E;w++)o[p].push({}),_.call(this,o[p][w]);else for(w=0;w<E;w++)_.call(this,o[p][w])},f.prototype._procEntryField=function(o,p,E,_){this._parsing?o[p]=this._readField(E,_):this._writeField(E,_,o[p])},f.prototype._procSubBoxes=function(o,p){var E;if(this._parsing)for(this[o]=[],E=0;E<p;E++)this[o].push(f.parse(this));else for(E=0;E<p;E++)this._rawo?this[o][E].write():this.size+=this[o][E].getLength()},f.prototype._readField=function(o,p){switch(o){case"uint":return this._readUint(p);case"int":return this._readInt(p);case"template":return this._readTemplate(p);case"string":return p===-1?this._readTerminatedString():this._readString(p);case"data":return this._readData(p);case"utf8":return this._readUTF8String();case"utf8string":return this._readUTF8TerminatedString();default:return-1}},f.prototype._readInt=function(o){var p=null,E=this._cursor.offset-this._raw.byteOffset;switch(o){case 8:p=this._raw.getInt8(E);break;case 16:p=this._raw.getInt16(E);break;case 32:p=this._raw.getInt32(E);break;case 64:var _=this._raw.getInt32(E),w=this._raw.getInt32(E+4);p=_*Math.pow(2,32)+w}return this._cursor.offset+=o>>3,p},f.prototype._readUint=function(o){var p,E,_=null,w=this._cursor.offset-this._raw.byteOffset;switch(o){case 8:_=this._raw.getUint8(w);break;case 16:_=this._raw.getUint16(w);break;case 24:_=((p=this._raw.getUint16(w))<<8)+(E=this._raw.getUint8(w+2));break;case 32:_=this._raw.getUint32(w);break;case 64:p=this._raw.getUint32(w),E=this._raw.getUint32(w+4),_=p*Math.pow(2,32)+E}return this._cursor.offset+=o>>3,_},f.prototype._readString=function(o){for(var p="",E=0;E<o;E++){var _=this._readUint(8);p+=String.fromCharCode(_)}return p},f.prototype._readTemplate=function(o){return this._readUint(o/2)+this._readUint(o/2)/Math.pow(2,o/2)},f.prototype._readTerminatedString=function(){for(var o="";this._cursor.offset-this._offset<this._raw.byteLength;){var p=this._readUint(8);if(p===0)break;o+=String.fromCharCode(p)}return o},f.prototype._readData=function(o){var p=o>0?o:this._raw.byteLength-(this._cursor.offset-this._offset);if(p>0){var E=new Uint8Array(this._raw.buffer,this._cursor.offset,p);return this._cursor.offset+=p,E}return null},f.prototype._readUTF8String=function(){var o=this._raw.byteLength-(this._cursor.offset-this._offset),p=null;return o>0&&(p=new DataView(this._raw.buffer,this._cursor.offset,o),this._cursor.offset+=o),p&&P.Utils.dataViewToString(p)},f.prototype._readUTF8TerminatedString=function(){var o=this._raw.byteLength-(this._cursor.offset-this._offset),p=null;if(o>0){var E;for(p=new DataView(this._raw.buffer,this._cursor.offset,o),E=0;E<o&&p.getUint8(E)!==0;E++);p=new DataView(this._raw.buffer,this._cursor.offset,E),this._cursor.offset+=Math.min(E+1,o)}return p&&P.Utils.dataViewToString(p)},f.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),this.size===1&&this._procField("largesize","uint",64),this.type==="uuid"&&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),this._boxContainers.indexOf(this.type)!==-1?this._parseContainerBox():this._data=this._readData())}},f.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},f.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(f.parse(this))},f.prototype.append=function(o,p){P.Utils.appendBox(this,o,p)},f.prototype.getLength=function(){if(this._parsing=!1,this._rawo=null,this.size=0,this._procField("size","uint",32),this._procField("type","string",4),this.size===1&&this._procField("largesize","uint",64),this.type==="uuid"&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),this._boxContainers.indexOf(this.type)!==-1)for(var o=0;o<this.boxes.length;o++)this.size+=this.boxes[o].getLength();return this._data&&this._writeData(this._data),this.size},f.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),this.size===1&&this._procField("largesize","uint",64),this.type==="uuid"&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),this._boxContainers.indexOf(this.type)!==-1)for(var o=0;o<this.boxes.length;o++)this.boxes[o].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},f.prototype._writeInt=function(o,p){if(this._rawo){var E=this._cursor.offset-this._rawo.byteOffset;switch(o){case 8:this._rawo.setInt8(E,p);break;case 16:this._rawo.setInt16(E,p);break;case 32:this._rawo.setInt32(E,p);break;case 64:var _=Math.floor(p/Math.pow(2,32)),w=p-_*Math.pow(2,32);this._rawo.setUint32(E,_),this._rawo.setUint32(E+4,w)}this._cursor.offset+=o>>3}else this.size+=o>>3},f.prototype._writeUint=function(o,p){if(this._rawo){var E,_,w=this._cursor.offset-this._rawo.byteOffset;switch(o){case 8:this._rawo.setUint8(w,p);break;case 16:this._rawo.setUint16(w,p);break;case 24:E=(16776960&p)>>8,_=255&p,this._rawo.setUint16(w,E),this._rawo.setUint8(w+2,_);break;case 32:this._rawo.setUint32(w,p);break;case 64:_=p-(E=Math.floor(p/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(w,E),this._rawo.setUint32(w+4,_)}this._cursor.offset+=o>>3}else this.size+=o>>3},f.prototype._writeString=function(o,p){for(var E=0;E<o;E++)this._writeUint(8,p.charCodeAt(E))},f.prototype._writeTerminatedString=function(o){if(o.length!==0){for(var p=0;p<o.length;p++)this._writeUint(8,o.charCodeAt(p));this._writeUint(8,0)}},f.prototype._writeTemplate=function(o,p){var E=Math.floor(p),_=(p-E)*Math.pow(2,o/2);this._writeUint(o/2,E),this._writeUint(o/2,_)},f.prototype._writeData=function(o){if(o)if(this._rawo){if(o instanceof Array){for(var p=this._cursor.offset-this._rawo.byteOffset,E=0;E<o.length;E++)this._rawo.setInt8(p+E,o[E]);this._cursor.offset+=o.length}o instanceof Uint8Array&&(this._root.bytes.set(o,this._cursor.offset),this._cursor.offset+=o.length)}else this.size+=o.length},f.prototype._writeUTF8String=function(o){var p=P.Utils.utf8ToByteArray(o);if(this._rawo)for(var E=new DataView(this._rawo.buffer,this._cursor.offset,p.length),_=0;_<p.length;_++)E.setUint8(_,p[_]);else this.size+=p.length},f.prototype._writeField=function(o,p,E){switch(o){case"uint":this._writeUint(p,E);break;case"int":this._writeInt(p,E);break;case"template":this._writeTemplate(p,E);break;case"string":p==-1?this._writeTerminatedString(E):this._writeString(p,E);break;case"data":this._writeData(E);break;case"utf8":this._writeUTF8String(E)}},f.prototype._boxProcessors.ardi=function(){this._procFullBox(),this._procField("audio_rendering_indication","uint",8)},f.prototype._boxProcessors.avc1=f.prototype._boxProcessors.avc2=f.prototype._boxProcessors.avc3=f.prototype._boxProcessors.avc4=f.prototype._boxProcessors.hvc1=f.prototype._boxProcessors.hev1=f.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)},f.prototype._boxProcessors.ctts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(o){this._procEntryField(o,"sample_count","uint",32),this._procEntryField(o,"sample_offset",this.version===1?"int":"uint",32)}))},f.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},f.prototype._boxProcessors.elng=function(){this._procFullBox(),this._procField("extended_language","utf8string")},f.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(o){this._procEntryField(o,"segment_duration","uint",this.version===1?64:32),this._procEntryField(o,"media_time","int",this.version===1?64:32),this._procEntryField(o,"media_rate_integer","int",16),this._procEntryField(o,"media_rate_fraction","int",16)}))},f.prototype._boxProcessors.emsg=function(){this._procFullBox(),this.version==1?(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)},f.prototype._boxProcessors.free=f.prototype._boxProcessors.skip=function(){this._procField("data","data",-1)},f.prototype._boxProcessors.frma=function(){this._procField("data_format","uint",32)},f.prototype._boxProcessors.ftyp=f.prototype._boxProcessors.styp=function(){this._procField("major_brand","string",4),this._procField("minor_version","uint",32);var o=-1;this._parsing&&(o=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray("compatible_brands",o,"string",4)},f.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)},f.prototype._boxProcessors.imda=function(){this._procField("imda_identifier","uint",32),this._procField("data","data",-1)},f.prototype._boxProcessors.kind=function(){this._procFullBox(),this._procField("schemeURI","utf8string"),this._procField("value","utf8string")},f.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")},f.prototype._boxProcessors.mdat=function(){this._procField("data","data",-1)},f.prototype._boxProcessors.mdhd=function(){this._procFullBox(),this._procField("creation_time","uint",this.version==1?64:32),this._procField("modification_time","uint",this.version==1?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",this.version==1?64:32),this._parsing||typeof this.language!="string"||(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)},f.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",this.version==1?64:32)},f.prototype._boxProcessors.meta=function(){this._procFullBox()},f.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},f.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},f.prototype._boxProcessors.mp4a=f.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)},f.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",this.version==1?64:32),this._procField("modification_time","uint",this.version==1?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",this.version==1?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)},f.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},f.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",this.version==1?64:32)},f.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(o){this._procEntryField(o,"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")},f.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},f.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)},f.prototype._boxProcessors.sdtp=function(){this._procFullBox();var o=-1;this._parsing&&(o=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",o,"uint",8)},f.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",this.version==1?64:32),this._procField("first_offset","uint",this.version==1?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,(function(o){this._parsing||(o.reference=(1&o.reference_type)<<31,o.reference|=2147483647&o.referenced_size,o.sap=(1&o.starts_with_SAP)<<31,o.sap|=(3&o.SAP_type)<<28,o.sap|=268435455&o.SAP_delta_time),this._procEntryField(o,"reference","uint",32),this._procEntryField(o,"subsegment_duration","uint",32),this._procEntryField(o,"sap","uint",32),this._parsing&&(o.reference_type=o.reference>>31&1,o.referenced_size=2147483647&o.reference,o.starts_with_SAP=o.sap>>31&1,o.SAP_type=o.sap>>28&7,o.SAP_delta_time=268435455&o.sap)}))},f.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},f.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,(function(o){this._procEntryField(o,"ranges_count","uint",32),this._procSubEntries(o,"ranges",o.ranges_count,(function(p){this._procEntryField(p,"level","uint",8),this._procEntryField(p,"range_size","uint",24)}))}))},f.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},f.prototype._boxProcessors.sttg=function(){this._procField("settings","utf8")},f.prototype._boxProcessors.stts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(o){this._procEntryField(o,"sample_count","uint",32),this._procEntryField(o,"sample_delta","uint",32)}))},f.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(o){this._procEntryField(o,"sample_delta","uint",32),this._procEntryField(o,"subsample_count","uint",16),this._procSubEntries(o,"subsamples",o.subsample_count,(function(p){this._procEntryField(p,"subsample_size","uint",this.version===1?32:16),this._procEntryField(p,"subsample_priority","uint",8),this._procEntryField(p,"discardable","uint",8),this._procEntryField(p,"codec_specific_parameters","uint",32)}))}))},f.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)},f.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",this.version==1?64:32)},f.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)},f.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(o){this._procEntryField(o,"time","uint",this.version===1?64:32),this._procEntryField(o,"moof_offset","uint",this.version===1?64:32),this._procEntryField(o,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(o,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(o,"sample_number","uint",8*(this.length_size_of_sample_num+1))}))},f.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",this.version==1?64:32),this._procField("modification_time","uint",this.version==1?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",this.version==1?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)},f.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)},f.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(o){256&this.flags&&this._procEntryField(o,"sample_duration","uint",32),512&this.flags&&this._procEntryField(o,"sample_size","uint",32),1024&this.flags&&this._procEntryField(o,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(o,"sample_composition_time_offset",this.version===1?"int":"uint",32)}))},f.prototype._boxProcessors["url "]=f.prototype._boxProcessors["urn "]=function(){this._procFullBox(),this.type==="urn "&&this._procField("name","string",-1),this._procField("location","string",-1)},f.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},f.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},f.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},f.prototype._boxProcessors.vtte=function(){}},9826:function(wt){var me,P=typeof Reflect=="object"?Reflect:null,F=P&&typeof P.apply=="function"?P.apply:function(de,De,ce){return Function.prototype.apply.call(de,De,ce)};me=P&&typeof P.ownKeys=="function"?P.ownKeys:Object.getOwnPropertySymbols?function(de){return Object.getOwnPropertyNames(de).concat(Object.getOwnPropertySymbols(de))}:function(de){return Object.getOwnPropertyNames(de)};var f=Number.isNaN||function(de){return de!=de};function o(){o.init.call(this)}wt.exports=o,wt.exports.once=function(de,De){return new Promise((function(ce,Le){function Be(Ge){de.removeListener(De,ot),Le(Ge)}function ot(){typeof de.removeListener=="function"&&de.removeListener("error",Be),ce([].slice.call(arguments))}le(de,De,ot,{once:!0}),De!=="error"&&(function(Ge,X){typeof Ge.on=="function"&&le(Ge,"error",X,{once:!0})})(de,Be)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var p=10;function E(de){if(typeof de!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof de)}function _(de){return de._maxListeners===void 0?o.defaultMaxListeners:de._maxListeners}function w(de,De,ce,Le){var Be,ot,Ge,X;if(E(ce),(ot=de._events)===void 0?(ot=de._events=Object.create(null),de._eventsCount=0):(ot.newListener!==void 0&&(de.emit("newListener",De,ce.listener?ce.listener:ce),ot=de._events),Ge=ot[De]),Ge===void 0)Ge=ot[De]=ce,++de._eventsCount;else if(typeof Ge=="function"?Ge=ot[De]=Le?[ce,Ge]:[Ge,ce]:Le?Ge.unshift(ce):Ge.push(ce),(Be=_(de))>0&&Ge.length>Be&&!Ge.warned){Ge.warned=!0;var Z=new Error("Possible EventEmitter memory leak detected. "+Ge.length+" "+String(De)+" listeners added. Use emitter.setMaxListeners() to increase limit");Z.name="MaxListenersExceededWarning",Z.emitter=de,Z.type=De,Z.count=Ge.length,X=Z,console&&console.warn&&console.warn(X)}return de}function g(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(de,De,ce){var Le={fired:!1,wrapFn:void 0,target:de,type:De,listener:ce},Be=g.bind(Le);return Be.listener=ce,Le.wrapFn=Be,Be}function r(de,De,ce){var Le=de._events;if(Le===void 0)return[];var Be=Le[De];return Be===void 0?[]:typeof Be=="function"?ce?[Be.listener||Be]:[Be]:ce?(function(ot){for(var Ge=new Array(ot.length),X=0;X<Ge.length;++X)Ge[X]=ot[X].listener||ot[X];return Ge})(Be):G(Be,Be.length)}function H(de){var De=this._events;if(De!==void 0){var ce=De[de];if(typeof ce=="function")return 1;if(ce!==void 0)return ce.length}return 0}function G(de,De){for(var ce=new Array(De),Le=0;Le<De;++Le)ce[Le]=de[Le];return ce}function le(de,De,ce,Le){if(typeof de.on=="function")Le.once?de.once(De,ce):de.on(De,ce);else{if(typeof de.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof de);de.addEventListener(De,(function Be(ot){Le.once&&de.removeEventListener(De,Be),ce(ot)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return p},set:function(de){if(typeof de!="number"||de<0||f(de))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+de+".");p=de}}),o.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(de){if(typeof de!="number"||de<0||f(de))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+de+".");return this._maxListeners=de,this},o.prototype.getMaxListeners=function(){return _(this)},o.prototype.emit=function(de){for(var De=[],ce=1;ce<arguments.length;ce++)De.push(arguments[ce]);var Le=de==="error",Be=this._events;if(Be!==void 0)Le=Le&&Be.error===void 0;else if(!Le)return!1;if(Le){var ot;if(De.length>0&&(ot=De[0]),ot instanceof Error)throw ot;var Ge=new Error("Unhandled error."+(ot?" ("+ot.message+")":""));throw Ge.context=ot,Ge}var X=Be[de];if(X===void 0)return!1;if(typeof X=="function")F(X,this,De);else{var Z=X.length,Se=G(X,Z);for(ce=0;ce<Z;++ce)F(Se[ce],this,De)}return!0},o.prototype.addListener=function(de,De){return w(this,de,De,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(de,De){return w(this,de,De,!0)},o.prototype.once=function(de,De){return E(De),this.on(de,h(this,de,De)),this},o.prototype.prependOnceListener=function(de,De){return E(De),this.prependListener(de,h(this,de,De)),this},o.prototype.removeListener=function(de,De){var ce,Le,Be,ot,Ge;if(E(De),(Le=this._events)===void 0)return this;if((ce=Le[de])===void 0)return this;if(ce===De||ce.listener===De)--this._eventsCount==0?this._events=Object.create(null):(delete Le[de],Le.removeListener&&this.emit("removeListener",de,ce.listener||De));else if(typeof ce!="function"){for(Be=-1,ot=ce.length-1;ot>=0;ot--)if(ce[ot]===De||ce[ot].listener===De){Ge=ce[ot].listener,Be=ot;break}if(Be<0)return this;Be===0?ce.shift():(function(X,Z){for(;Z+1<X.length;Z++)X[Z]=X[Z+1];X.pop()})(ce,Be),ce.length===1&&(Le[de]=ce[0]),Le.removeListener!==void 0&&this.emit("removeListener",de,Ge||De)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(de){var De,ce,Le;if((ce=this._events)===void 0)return this;if(ce.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ce[de]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete ce[de]),this;if(arguments.length===0){var Be,ot=Object.keys(ce);for(Le=0;Le<ot.length;++Le)(Be=ot[Le])!=="removeListener"&&this.removeAllListeners(Be);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(De=ce[de])=="function")this.removeListener(de,De);else if(De!==void 0)for(Le=De.length-1;Le>=0;Le--)this.removeListener(de,De[Le]);return this},o.prototype.listeners=function(de){return r(this,de,!0)},o.prototype.rawListeners=function(de){return r(this,de,!1)},o.listenerCount=function(de,De){return typeof de.listenerCount=="function"?de.listenerCount(De):H.call(de,De)},o.prototype.listenerCount=H,o.prototype.eventNames=function(){return this._eventsCount>0?me(this._events):[]}},7316:function(wt){wt.exports=function me(P,F){if(P===F)return!0;if(P&&F&&typeof P=="object"&&typeof F=="object"){if(P.constructor!==F.constructor)return!1;var f,o,p;if(Array.isArray(P)){if((f=P.length)!=F.length)return!1;for(o=f;o--!=0;)if(!me(P[o],F[o]))return!1;return!0}if(P.constructor===RegExp)return P.source===F.source&&P.flags===F.flags;if(P.valueOf!==Object.prototype.valueOf)return P.valueOf()===F.valueOf();if(P.toString!==Object.prototype.toString)return P.toString()===F.toString();if((f=(p=Object.keys(P)).length)!==Object.keys(F).length)return!1;for(o=f;o--!=0;)if(!Object.prototype.hasOwnProperty.call(F,p[o]))return!1;for(o=f;o--!=0;){var E=p[o];if(!me(P[E],F[E]))return!1}return!0}return P!=P&&F!=F}},7986:function(wt,me){me.read=function(P,F,f,o,p){var E,_,w=8*p-o-1,g=(1<<w)-1,h=g>>1,r=-7,H=f?p-1:0,G=f?-1:1,le=P[F+H];for(H+=G,E=le&(1<<-r)-1,le>>=-r,r+=w;r>0;E=256*E+P[F+H],H+=G,r-=8);for(_=E&(1<<-r)-1,E>>=-r,r+=o;r>0;_=256*_+P[F+H],H+=G,r-=8);if(E===0)E=1-h;else{if(E===g)return _?NaN:1/0*(le?-1:1);_+=Math.pow(2,o),E-=h}return(le?-1:1)*_*Math.pow(2,E-o)},me.write=function(P,F,f,o,p,E){var _,w,g,h=8*E-p-1,r=(1<<h)-1,H=r>>1,G=p===23?Math.pow(2,-24)-Math.pow(2,-77):0,le=o?0:E-1,de=o?1:-1,De=F<0||F===0&&1/F<0?1:0;for(F=Math.abs(F),isNaN(F)||F===1/0?(w=isNaN(F)?1:0,_=r):(_=Math.floor(Math.log(F)/Math.LN2),F*(g=Math.pow(2,-_))<1&&(_--,g*=2),(F+=_+H>=1?G/g:G*Math.pow(2,1-H))*g>=2&&(_++,g/=2),_+H>=r?(w=0,_=r):_+H>=1?(w=(F*g-1)*Math.pow(2,p),_+=H):(w=F*Math.pow(2,H-1)*Math.pow(2,p),_=0));p>=8;P[f+le]=255&w,le+=de,w/=256,p-=8);for(_=_<<p|w,h+=p;h>0;P[f+le]=255&_,le+=de,_/=256,h-=8);P[f+le-de]|=128*De}},5474:function(wt,me,P){(function(F){F.parser=function(V,B){return new p(V,B)},F.SAXParser=p,F.SAXStream=_,F.createStream=function(V,B){return new _(V,B)},F.MAX_BUFFER_LENGTH=65536;var f,o=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function p(V,B){if(!(this instanceof p))return new p(V,B);var Pe=this;(function(j){for(var qe=0,it=o.length;qe<it;qe++)j[o[qe]]=""})(Pe),Pe.q=Pe.c="",Pe.bufferCheckPosition=F.MAX_BUFFER_LENGTH,Pe.opt=B||{},Pe.opt.lowercase=Pe.opt.lowercase||Pe.opt.lowercasetags,Pe.looseCase=Pe.opt.lowercase?"toLowerCase":"toUpperCase",Pe.tags=[],Pe.closed=Pe.closedRoot=Pe.sawRoot=!1,Pe.tag=Pe.error=null,Pe.strict=!!V,Pe.noscript=!(!V&&!Pe.opt.noscript),Pe.state=ye.BEGIN,Pe.strictEntities=Pe.opt.strictEntities,Pe.ENTITIES=Pe.strictEntities?Object.create(F.XML_ENTITIES):Object.create(F.ENTITIES),Pe.attribList=[],Pe.opt.xmlns&&(Pe.ns=Object.create(ce)),Pe.trackPosition=Pe.opt.position!==!1,Pe.trackPosition&&(Pe.position=Pe.line=Pe.column=0),He(Pe,"onready")}F.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(V){function B(){}return B.prototype=V,new B}),Object.keys||(Object.keys=function(V){var B=[];for(var Pe in V)V.hasOwnProperty(Pe)&&B.push(Pe);return B}),p.prototype={end:function(){kt(this)},write:function(V){var B=this;if(this.error)throw this.error;if(B.closed)return Nt(B,"Cannot write after close. Assign an onready handler.");if(V===null)return kt(B);typeof V=="object"&&(V=V.toString());for(var Pe=0,j="";j=Ye(V,Pe++),B.c=j,j;)switch(B.trackPosition&&(B.position++,j===`
`?(B.line++,B.column=0):B.column++),B.state){case ye.BEGIN:if(B.state=ye.BEGIN_WHITESPACE,j==="\uFEFF")continue;It(B,j);continue;case ye.BEGIN_WHITESPACE:It(B,j);continue;case ye.TEXT:if(B.sawRoot&&!B.closedRoot){for(var qe=Pe-1;j&&j!=="<"&&j!=="&";)(j=Ye(V,Pe++))&&B.trackPosition&&(B.position++,j===`
`?(B.line++,B.column=0):B.column++);B.textNode+=V.substring(qe,Pe-1)}j!=="<"||B.sawRoot&&B.closedRoot&&!B.strict?(!Se(w,j)||B.sawRoot&&!B.closedRoot||Ut(B,"Text data outside of root node."),j==="&"?B.state=ye.TEXT_ENTITY:B.textNode+=j):(B.state=ye.OPEN_WAKA,B.startTagPosition=B.position);continue;case ye.SCRIPT:j==="<"?B.state=ye.SCRIPT_ENDING:B.script+=j;continue;case ye.SCRIPT_ENDING:j==="/"?B.state=ye.CLOSE_TAG:(B.script+="<"+j,B.state=ye.SCRIPT);continue;case ye.OPEN_WAKA:if(j==="!")B.state=ye.SGML_DECL,B.sgmlDecl="";else if(!Z(w,j))if(Z(Le,j))B.state=ye.OPEN_TAG,B.tagName=j;else if(j==="/")B.state=ye.CLOSE_TAG,B.tagName="";else if(j==="?")B.state=ye.PROC_INST,B.procInstName=B.procInstBody="";else{if(Ut(B,"Unencoded <"),B.startTagPosition+1<B.position){var it=B.position-B.startTagPosition;j=new Array(it).join(" ")+j}B.textNode+="<"+j,B.state=ye.TEXT}continue;case ye.SGML_DECL:(B.sgmlDecl+j).toUpperCase()===G?(Fe(B,"onopencdata"),B.state=ye.CDATA,B.sgmlDecl="",B.cdata=""):B.sgmlDecl+j==="--"?(B.state=ye.COMMENT,B.comment="",B.sgmlDecl=""):(B.sgmlDecl+j).toUpperCase()===le?(B.state=ye.DOCTYPE,(B.doctype||B.sawRoot)&&Ut(B,"Inappropriately located doctype declaration"),B.doctype="",B.sgmlDecl=""):j===">"?(Fe(B,"onsgmldeclaration",B.sgmlDecl),B.sgmlDecl="",B.state=ye.TEXT):(Z(r,j)&&(B.state=ye.SGML_DECL_QUOTED),B.sgmlDecl+=j);continue;case ye.SGML_DECL_QUOTED:j===B.q&&(B.state=ye.SGML_DECL,B.q=""),B.sgmlDecl+=j;continue;case ye.DOCTYPE:j===">"?(B.state=ye.TEXT,Fe(B,"ondoctype",B.doctype),B.doctype=!0):(B.doctype+=j,j==="["?B.state=ye.DOCTYPE_DTD:Z(r,j)&&(B.state=ye.DOCTYPE_QUOTED,B.q=j));continue;case ye.DOCTYPE_QUOTED:B.doctype+=j,j===B.q&&(B.q="",B.state=ye.DOCTYPE);continue;case ye.DOCTYPE_DTD:B.doctype+=j,j==="]"?B.state=ye.DOCTYPE:Z(r,j)&&(B.state=ye.DOCTYPE_DTD_QUOTED,B.q=j);continue;case ye.DOCTYPE_DTD_QUOTED:B.doctype+=j,j===B.q&&(B.state=ye.DOCTYPE_DTD,B.q="");continue;case ye.COMMENT:j==="-"?B.state=ye.COMMENT_ENDING:B.comment+=j;continue;case ye.COMMENT_ENDING:j==="-"?(B.state=ye.COMMENT_ENDED,B.comment=Pt(B.opt,B.comment),B.comment&&Fe(B,"oncomment",B.comment),B.comment=""):(B.comment+="-"+j,B.state=ye.COMMENT);continue;case ye.COMMENT_ENDED:j!==">"?(Ut(B,"Malformed comment"),B.comment+="--"+j,B.state=ye.COMMENT):B.state=ye.TEXT;continue;case ye.CDATA:j==="]"?B.state=ye.CDATA_ENDING:B.cdata+=j;continue;case ye.CDATA_ENDING:j==="]"?B.state=ye.CDATA_ENDING_2:(B.cdata+="]"+j,B.state=ye.CDATA);continue;case ye.CDATA_ENDING_2:j===">"?(B.cdata&&Fe(B,"oncdata",B.cdata),Fe(B,"onclosecdata"),B.cdata="",B.state=ye.TEXT):j==="]"?B.cdata+="]":(B.cdata+="]]"+j,B.state=ye.CDATA);continue;case ye.PROC_INST:j==="?"?B.state=ye.PROC_INST_ENDING:Z(w,j)?B.state=ye.PROC_INST_BODY:B.procInstName+=j;continue;case ye.PROC_INST_BODY:if(!B.procInstBody&&Z(w,j))continue;j==="?"?B.state=ye.PROC_INST_ENDING:B.procInstBody+=j;continue;case ye.PROC_INST_ENDING:j===">"?(Fe(B,"onprocessinginstruction",{name:B.procInstName,body:B.procInstBody}),B.procInstName=B.procInstBody="",B.state=ye.TEXT):(B.procInstBody+="?"+j,B.state=ye.PROC_INST_BODY);continue;case ye.OPEN_TAG:Z(Be,j)?B.tagName+=j:(ln(B),j===">"?Oe(B):j==="/"?B.state=ye.OPEN_TAG_SLASH:(Se(w,j)&&Ut(B,"Invalid character in tag name"),B.state=ye.ATTRIB));continue;case ye.OPEN_TAG_SLASH:j===">"?(Oe(B,!0),Ie(B)):(Ut(B,"Forward-slash in opening tag not followed by >"),B.state=ye.ATTRIB);continue;case ye.ATTRIB:if(Z(w,j))continue;j===">"?Oe(B):j==="/"?B.state=ye.OPEN_TAG_SLASH:Z(Le,j)?(B.attribName=j,B.attribValue="",B.state=ye.ATTRIB_NAME):Ut(B,"Invalid attribute name");continue;case ye.ATTRIB_NAME:j==="="?B.state=ye.ATTRIB_VALUE:j===">"?(Ut(B,"Attribute without value"),B.attribValue=B.attribName,En(B),Oe(B)):Z(w,j)?B.state=ye.ATTRIB_NAME_SAW_WHITE:Z(Be,j)?B.attribName+=j:Ut(B,"Invalid attribute name");continue;case ye.ATTRIB_NAME_SAW_WHITE:if(j==="=")B.state=ye.ATTRIB_VALUE;else{if(Z(w,j))continue;Ut(B,"Attribute without value"),B.tag.attributes[B.attribName]="",B.attribValue="",Fe(B,"onattribute",{name:B.attribName,value:""}),B.attribName="",j===">"?Oe(B):Z(Le,j)?(B.attribName=j,B.state=ye.ATTRIB_NAME):(Ut(B,"Invalid attribute name"),B.state=ye.ATTRIB)}continue;case ye.ATTRIB_VALUE:if(Z(w,j))continue;Z(r,j)?(B.q=j,B.state=ye.ATTRIB_VALUE_QUOTED):(Ut(B,"Unquoted attribute value"),B.state=ye.ATTRIB_VALUE_UNQUOTED,B.attribValue=j);continue;case ye.ATTRIB_VALUE_QUOTED:if(j!==B.q){j==="&"?B.state=ye.ATTRIB_VALUE_ENTITY_Q:B.attribValue+=j;continue}En(B),B.q="",B.state=ye.ATTRIB_VALUE_CLOSED;continue;case ye.ATTRIB_VALUE_CLOSED:Z(w,j)?B.state=ye.ATTRIB:j===">"?Oe(B):j==="/"?B.state=ye.OPEN_TAG_SLASH:Z(Le,j)?(Ut(B,"No whitespace between attributes"),B.attribName=j,B.attribValue="",B.state=ye.ATTRIB_NAME):Ut(B,"Invalid attribute name");continue;case ye.ATTRIB_VALUE_UNQUOTED:if(Se(H,j)){j==="&"?B.state=ye.ATTRIB_VALUE_ENTITY_U:B.attribValue+=j;continue}En(B),j===">"?Oe(B):B.state=ye.ATTRIB;continue;case ye.CLOSE_TAG:if(B.tagName)j===">"?Ie(B):Z(Be,j)?B.tagName+=j:B.script?(B.script+="</"+B.tagName,B.tagName="",B.state=ye.SCRIPT):(Se(w,j)&&Ut(B,"Invalid tagname in closing tag"),B.state=ye.CLOSE_TAG_SAW_WHITE);else{if(Z(w,j))continue;Se(Le,j)?B.script?(B.script+="</"+j,B.state=ye.SCRIPT):Ut(B,"Invalid tagname in closing tag."):B.tagName=j}continue;case ye.CLOSE_TAG_SAW_WHITE:if(Z(w,j))continue;j===">"?Ie(B):Ut(B,"Invalid characters in closing tag");continue;case ye.TEXT_ENTITY:case ye.ATTRIB_VALUE_ENTITY_Q:case ye.ATTRIB_VALUE_ENTITY_U:var _e,Ue;switch(B.state){case ye.TEXT_ENTITY:_e=ye.TEXT,Ue="textNode";break;case ye.ATTRIB_VALUE_ENTITY_Q:_e=ye.ATTRIB_VALUE_QUOTED,Ue="attribValue";break;case ye.ATTRIB_VALUE_ENTITY_U:_e=ye.ATTRIB_VALUE_UNQUOTED,Ue="attribValue"}j===";"?(B[Ue]+=mt(B),B.entity="",B.state=_e):Z(B.entity.length?Ge:ot,j)?B.entity+=j:(Ut(B,"Invalid character in entity name"),B[Ue]+="&"+B.entity+j,B.entity="",B.state=_e);continue;default:throw new Error(B,"Unknown state: "+B.state)}return B.position>=B.bufferCheckPosition&&(function(i){for(var S=Math.max(F.MAX_BUFFER_LENGTH,10),I=0,$=0,ie=o.length;$<ie;$++){var be=i[o[$]].length;if(be>S)switch(o[$]){case"textNode":Ke(i);break;case"cdata":Fe(i,"oncdata",i.cdata),i.cdata="";break;case"script":Fe(i,"onscript",i.script),i.script="";break;default:Nt(i,"Max buffer length exceeded: "+o[$])}I=Math.max(I,be)}var tt=F.MAX_BUFFER_LENGTH-I;i.bufferCheckPosition=tt+i.position})(B),B},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var V;Ke(V=this),V.cdata!==""&&(Fe(V,"oncdata",V.cdata),V.cdata=""),V.script!==""&&(Fe(V,"onscript",V.script),V.script="")}};try{f=P(3515).Stream}catch{f=function(){}}var E=F.EVENTS.filter((function(V){return V!=="error"&&V!=="end"}));function _(V,B){if(!(this instanceof _))return new _(V,B);f.apply(this),this._parser=new p(V,B),this.writable=!0,this.readable=!0;var Pe=this;this._parser.onend=function(){Pe.emit("end")},this._parser.onerror=function(j){Pe.emit("error",j),Pe._parser.error=null},this._decoder=null,E.forEach((function(j){Object.defineProperty(Pe,"on"+j,{get:function(){return Pe._parser["on"+j]},set:function(qe){if(!qe)return Pe.removeAllListeners(j),Pe._parser["on"+j]=qe,qe;Pe.on(j,qe)},enumerable:!0,configurable:!1})}))}_.prototype=Object.create(f.prototype,{constructor:{value:_}}),_.prototype.write=function(V){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(V)){if(!this._decoder){var B=P(748).StringDecoder;this._decoder=new B("utf8")}V=this._decoder.write(V)}return this._parser.write(V.toString()),this.emit("data",V),!0},_.prototype.end=function(V){return V&&V.length&&this.write(V),this._parser.end(),!0},_.prototype.on=function(V,B){var Pe=this;return Pe._parser["on"+V]||E.indexOf(V)===-1||(Pe._parser["on"+V]=function(){var j=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);j.splice(0,0,V),Pe.emit.apply(Pe,j)}),f.prototype.on.call(Pe,V,B)};var w=`\r
`,g="0124356789",h="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",r=`'"`,H=w+">",G="[CDATA[",le="DOCTYPE",de="http://www.w3.org/XML/1998/namespace",De="http://www.w3.org/2000/xmlns/",ce={xml:de,xmlns:De};w=X(w),g=X(g),h=X(h);var Le=/[:_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]/,Be=/[:_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-]/,ot=/[#:_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]/,Ge=/[#:_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 X(V){return V.split("").reduce((function(B,Pe){return B[Pe]=!0,B}),{})}function Z(V,B){return(function(Pe){return Object.prototype.toString.call(Pe)==="[object RegExp]"})(V)?!!B.match(V):V[B]}function Se(V,B){return!Z(V,B)}r=X(r),H=X(H);var Ne,ke,ht,ye=0;for(var pt in F.STATE={BEGIN:ye++,BEGIN_WHITESPACE:ye++,TEXT:ye++,TEXT_ENTITY:ye++,OPEN_WAKA:ye++,SGML_DECL:ye++,SGML_DECL_QUOTED:ye++,DOCTYPE:ye++,DOCTYPE_QUOTED:ye++,DOCTYPE_DTD:ye++,DOCTYPE_DTD_QUOTED:ye++,COMMENT_STARTING:ye++,COMMENT:ye++,COMMENT_ENDING:ye++,COMMENT_ENDED:ye++,CDATA:ye++,CDATA_ENDING:ye++,CDATA_ENDING_2:ye++,PROC_INST:ye++,PROC_INST_BODY:ye++,PROC_INST_ENDING:ye++,OPEN_TAG:ye++,OPEN_TAG_SLASH:ye++,ATTRIB:ye++,ATTRIB_NAME:ye++,ATTRIB_NAME_SAW_WHITE:ye++,ATTRIB_VALUE:ye++,ATTRIB_VALUE_QUOTED:ye++,ATTRIB_VALUE_CLOSED:ye++,ATTRIB_VALUE_UNQUOTED:ye++,ATTRIB_VALUE_ENTITY_Q:ye++,ATTRIB_VALUE_ENTITY_U:ye++,CLOSE_TAG:ye++,CLOSE_TAG_SAW_WHITE:ye++,SCRIPT:ye++,SCRIPT_ENDING:ye++},F.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},F.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(F.ENTITIES).forEach((function(V){var B=F.ENTITIES[V],Pe=typeof B=="number"?String.fromCharCode(B):B;F.ENTITIES[V]=Pe})),F.STATE)F.STATE[F.STATE[pt]]=pt;function He(V,B,Pe){V[B]&&V[B](Pe)}function Fe(V,B,Pe){V.textNode&&Ke(V),He(V,B,Pe)}function Ke(V){V.textNode=Pt(V.opt,V.textNode),V.textNode&&He(V,"ontext",V.textNode),V.textNode=""}function Pt(V,B){return V.trim&&(B=B.trim()),V.normalize&&(B=B.replace(/\s+/g," ")),B}function Nt(V,B){return Ke(V),V.trackPosition&&(B+=`
Line: `+V.line+`
Column: `+V.column+`
Char: `+V.c),B=new Error(B),V.error=B,He(V,"onerror",B),V}function kt(V){return V.sawRoot&&!V.closedRoot&&Ut(V,"Unclosed root tag"),V.state!==ye.BEGIN&&V.state!==ye.BEGIN_WHITESPACE&&V.state!==ye.TEXT&&Nt(V,"Unexpected end"),Ke(V),V.c="",V.closed=!0,He(V,"onend"),p.call(V,V.strict,V.opt),V}function Ut(V,B){if(typeof V!="object"||!(V instanceof p))throw new Error("bad call to strictFail");V.strict&&Nt(V,B)}function ln(V){V.strict||(V.tagName=V.tagName[V.looseCase]());var B=V.tags[V.tags.length-1]||V,Pe=V.tag={name:V.tagName,attributes:{}};V.opt.xmlns&&(Pe.ns=B.ns),V.attribList.length=0,Fe(V,"onopentagstart",Pe)}function an(V,B){var Pe=V.indexOf(":")<0?["",V]:V.split(":"),j=Pe[0],qe=Pe[1];return B&&V==="xmlns"&&(j="xmlns",qe=""),{prefix:j,local:qe}}function En(V){if(V.strict||(V.attribName=V.attribName[V.looseCase]()),V.attribList.indexOf(V.attribName)!==-1||V.tag.attributes.hasOwnProperty(V.attribName))V.attribName=V.attribValue="";else{if(V.opt.xmlns){var B=an(V.attribName,!0),Pe=B.prefix,j=B.local;if(Pe==="xmlns")if(j==="xml"&&V.attribValue!==de)Ut(V,"xml: prefix must be bound to "+de+`
Actual: `+V.attribValue);else if(j==="xmlns"&&V.attribValue!==De)Ut(V,"xmlns: prefix must be bound to "+De+`
Actual: `+V.attribValue);else{var qe=V.tag,it=V.tags[V.tags.length-1]||V;qe.ns===it.ns&&(qe.ns=Object.create(it.ns)),qe.ns[j]=V.attribValue}V.attribList.push([V.attribName,V.attribValue])}else V.tag.attributes[V.attribName]=V.attribValue,Fe(V,"onattribute",{name:V.attribName,value:V.attribValue});V.attribName=V.attribValue=""}}function Oe(V,B){if(V.opt.xmlns){var Pe=V.tag,j=an(V.tagName);Pe.prefix=j.prefix,Pe.local=j.local,Pe.uri=Pe.ns[j.prefix]||"",Pe.prefix&&!Pe.uri&&(Ut(V,"Unbound namespace prefix: "+JSON.stringify(V.tagName)),Pe.uri=j.prefix);var qe=V.tags[V.tags.length-1]||V;Pe.ns&&qe.ns!==Pe.ns&&Object.keys(Pe.ns).forEach((function(ae){Fe(V,"onopennamespace",{prefix:ae,uri:Pe.ns[ae]})}));for(var it=0,_e=V.attribList.length;it<_e;it++){var Ue=V.attribList[it],i=Ue[0],S=Ue[1],I=an(i,!0),$=I.prefix,ie=I.local,be=$===""?"":Pe.ns[$]||"",tt={name:i,value:S,prefix:$,local:ie,uri:be};$&&$!=="xmlns"&&!be&&(Ut(V,"Unbound namespace prefix: "+JSON.stringify($)),tt.uri=$),V.tag.attributes[i]=tt,Fe(V,"onattribute",tt)}V.attribList.length=0}V.tag.isSelfClosing=!!B,V.sawRoot=!0,V.tags.push(V.tag),Fe(V,"onopentag",V.tag),B||(V.noscript||V.tagName.toLowerCase()!=="script"?V.state=ye.TEXT:V.state=ye.SCRIPT,V.tag=null,V.tagName=""),V.attribName=V.attribValue="",V.attribList.length=0}function Ie(V){if(!V.tagName)return Ut(V,"Weird empty close tag."),V.textNode+="</>",void(V.state=ye.TEXT);if(V.script){if(V.tagName!=="script")return V.script+="</"+V.tagName+">",V.tagName="",void(V.state=ye.SCRIPT);Fe(V,"onscript",V.script),V.script=""}var B=V.tags.length,Pe=V.tagName;V.strict||(Pe=Pe[V.looseCase]());for(var j=Pe;B--&&V.tags[B].name!==j;)Ut(V,"Unexpected close tag");if(B<0)return Ut(V,"Unmatched closing tag: "+V.tagName),V.textNode+="</"+V.tagName+">",void(V.state=ye.TEXT);V.tagName=Pe;for(var qe=V.tags.length;qe-- >B;){var it=V.tag=V.tags.pop();V.tagName=V.tag.name,Fe(V,"onclosetag",V.tagName);var _e={};for(var Ue in it.ns)_e[Ue]=it.ns[Ue];var i=V.tags[V.tags.length-1]||V;V.opt.xmlns&&it.ns!==i.ns&&Object.keys(it.ns).forEach((function(S){var I=it.ns[S];Fe(V,"onclosenamespace",{prefix:S,uri:I})}))}B===0&&(V.closedRoot=!0),V.tagName=V.attribValue=V.attribName="",V.attribList.length=0,V.state=ye.TEXT}function mt(V){var B,Pe=V.entity,j=Pe.toLowerCase(),qe="";return V.ENTITIES[Pe]?V.ENTITIES[Pe]:V.ENTITIES[j]?V.ENTITIES[j]:((Pe=j).charAt(0)==="#"&&(Pe.charAt(1)==="x"?(Pe=Pe.slice(2),qe=(B=parseInt(Pe,16)).toString(16)):(Pe=Pe.slice(1),qe=(B=parseInt(Pe,10)).toString(10))),Pe=Pe.replace(/^0+/,""),qe.toLowerCase()!==Pe?(Ut(V,"Invalid character entity"),"&"+V.entity+";"):String.fromCodePoint(B))}function It(V,B){B==="<"?(V.state=ye.OPEN_WAKA,V.startTagPosition=V.position):Se(w,B)&&(Ut(V,"Non-whitespace before first tag."),V.textNode=B,V.state=ye.TEXT)}function Ye(V,B){var Pe="";return B<V.length&&(Pe=V.charAt(B)),Pe}ye=F.STATE,String.fromCodePoint||(Ne=String.fromCharCode,ke=Math.floor,ht=function(){var V,B,Pe=[],j=-1,qe=arguments.length;if(!qe)return"";for(var it="";++j<qe;){var _e=Number(arguments[j]);if(!isFinite(_e)||_e<0||_e>1114111||ke(_e)!==_e)throw RangeError("Invalid code point: "+_e);_e<=65535?Pe.push(_e):(V=55296+((_e-=65536)>>10),B=_e%1024+56320,Pe.push(V,B)),(j+1===qe||Pe.length>16384)&&(it+=Ne.apply(null,Pe),Pe.length=0)}return it},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:ht,configurable:!0,writable:!0}):String.fromCodePoint=ht)})(me)},6739:function(wt,me,P){(function(F,f,o,p,E){function _(Ye){if("contents"in Ye)for(var V=("styleAttrs"in Ye)?Ye.styleAttrs[p.byName.ruby.qname]:null,B=Ye.kind==="span"&&(V==="container"||V==="textContainer"||V==="baseContainer"),Pe=Ye.contents.length-1;Pe>=0;Pe--)!B||"styleAttrs"in Ye.contents[Pe]&&p.byName.ruby.qname in Ye.contents[Pe].styleAttrs?_(Ye.contents[Pe]):delete Ye.contents[Pe]}function w(Ye,V,B,Pe){var j=Pe&&Pe.timeContainer==="seq",qe=0;Pe&&(qe=j&&B?B.end:Pe.begin),V.begin=V.explicit_begin?V.explicit_begin+qe:qe;var it=V.begin,_e=null;if("sets"in V)for(var Ue=0;Ue<V.sets.length;Ue++)w(Ye,V.sets[Ue],_e,V),it=V.timeContainer==="seq"?V.sets[Ue].end:Math.max(it,V.sets[Ue].end),_e=V.sets[Ue];if("contents"in V){if("contents"in V)for(var i=0;i<V.contents.length;i++)w(Ye,V.contents[i],_e,V),it=V.timeContainer==="seq"?V.contents[i].end:Math.max(it,V.contents[i].end),_e=V.contents[i]}else it=j?V.begin:Number.POSITIVE_INFINITY;V.explicit_end!==null&&V.explicit_dur!==null?V.end=Math.min(V.begin+V.explicit_dur,qe+V.explicit_end):V.explicit_end===null&&V.explicit_dur!==null?V.end=V.begin+V.explicit_dur:V.explicit_end!==null&&V.explicit_dur===null?V.end=qe+V.explicit_end:V.end=it,delete V.explicit_begin,delete V.explicit_dur,delete V.explicit_end,Ye._registerEvent(V)}function g(Ye){this.node=Ye}function h(){this.events=[],this.head=new r,this.body=null}function r(){this.styling=new H,this.layout=new de}function H(){this.styles={},this.initials={}}function G(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function le(){this.styleAttrs=null}function de(){this.regions={}}function De(Ye,V){ce.call(this,"image"),this.src=Ye,this.type=V}function ce(Ye){this.kind=Ye}function Le(Ye){this.id=Ye}function Be(Ye){this.regionID=Ye}function ot(Ye){this.styleAttrs=Ye}function Ge(Ye){this.sets=Ye}function X(Ye){this.contents=Ye}function Z(Ye,V,B){this.explicit_begin=Ye,this.explicit_end=V,this.explicit_dur=B}function Se(){ce.call(this,"body")}function Ne(){ce.call(this,"div")}function ke(){ce.call(this,"p")}function ht(){ce.call(this,"span")}function ye(){ce.call(this,"span")}function pt(){ce.call(this,"br")}function He(){}function Fe(){}function Ke(Ye){return Ye&&"xml:id"in Ye.attributes&&Ye.attributes["xml:id"].value||null}function Pt(Ye){return Ye&&"style"in Ye.attributes?Ye.attributes.style.value.split(" "):[]}function Nt(Ye,V){var B={};if(Ye!==null)for(var Pe in Ye.attributes){var j=Ye.attributes[Pe].uri+" "+Ye.attributes[Pe].local,qe=p.byQName[j];if(qe!==void 0){var it=qe.parse(Ye.attributes[Pe].value);it!==null?(B[j]=it,qe===p.byName.zIndex&&Oe(V,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):Ie(V,"Cannot parse styling attribute "+j+" --> "+Ye.attributes[Pe].value)}}return B}function kt(Ye,V,B){for(var Pe in Ye.attributes)if(Ye.attributes[Pe].uri===V&&Ye.attributes[Pe].local===B)return Ye.attributes[Pe].value;return null}function Ut(Ye,V,B){var Pe,j=null;return(Pe=/^(\d+(?:\.\d+)?)f$/.exec(B))!==null?V!==null&&(j=parseFloat(Pe[1])/V):(Pe=/^(\d+(?:\.\d+)?)t$/.exec(B))!==null?Ye!==null&&(j=parseFloat(Pe[1])/Ye):(Pe=/^(\d+(?:\.\d+)?)ms$/.exec(B))!==null?j=parseFloat(Pe[1])/1e3:(Pe=/^(\d+(?:\.\d+)?)s$/.exec(B))!==null?j=parseFloat(Pe[1]):(Pe=/^(\d+(?:\.\d+)?)h$/.exec(B))!==null?j=3600*parseFloat(Pe[1]):(Pe=/^(\d+(?:\.\d+)?)m$/.exec(B))!==null?j=60*parseFloat(Pe[1]):(Pe=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(B))!==null?j=3600*parseInt(Pe[1])+60*parseInt(Pe[2])+parseFloat(Pe[3]):(Pe=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(B))!==null&&V!==null&&(j=3600*parseInt(Pe[1])+60*parseInt(Pe[2])+parseInt(Pe[3])+(Pe[4]===null?0:parseInt(Pe[4])/V)),j}function ln(Ye,V,B){for(;V.styleRefs.length>0;){var Pe=V.styleRefs.pop();Pe in Ye.styles?(ln(Ye,Ye.styles[Pe],B),En(Ye.styles[Pe].styleAttrs,V.styleAttrs)):Ie(B,"Non-existant style id referenced")}}function an(Ye,V,B,Pe){for(var j=V.length-1;j>=0;j--){var qe=V[j];qe in Ye.styles?En(Ye.styles[qe].styleAttrs,B):Ie(Pe,"Non-existant style id referenced")}}function En(Ye,V){for(var B in Ye)Ye.hasOwnProperty(B)&&(B in V||(V[B]=Ye[B]))}function Oe(Ye,V){if(Ye&&Ye.warn&&Ye.warn(V))throw V}function Ie(Ye,V){if(Ye&&Ye.error&&Ye.error(V))throw V}function mt(Ye,V){throw Ye&&Ye.fatal&&Ye.fatal(V),V}function It(Ye,V){for(var B,Pe=0,j=Ye.length-1;Pe<=j;){var qe=Ye[B=Math.floor((Pe+j)/2)];if(qe<V)Pe=B+1;else{if(!(qe>V))return{found:!0,index:B};j=B-1}}return{found:!1,index:Pe}}F.fromXML=function(Ye,V,B){var Pe=f.parser(!0,{xmlns:!0}),j=[],qe=[],it=[],_e=0,Ue=null;Pe.onclosetag=function(ie){if(j[0]instanceof He)Ue.head!==null&&Ue.head.styling!==null&&an(Ue.head.styling,j[0].styleRefs,j[0].styleAttrs,V),delete j[0].styleRefs;else if(j[0]instanceof H)for(var be in j[0].styles)j[0].styles.hasOwnProperty(be)&&ln(j[0],j[0].styles[be],V);else if(j[0]instanceof ke||j[0]instanceof ht){if(j[0].contents.length>1){var tt,ae=[j[0].contents[0]];for(tt=1;tt<j[0].contents.length;tt++)j[0].contents[tt]instanceof ye&&ae[ae.length-1]instanceof ye?ae[ae.length-1].text+=j[0].contents[tt].text:ae.push(j[0].contents[tt]);j[0].contents=ae}j[0]instanceof ht&&j[0].contents.length===1&&j[0].contents[0]instanceof ye&&(j[0].text=j[0].contents[0].text,delete j[0].contents)}else j[0]instanceof g&&(j[0].node.uri===o.ns_tt&&j[0].node.local==="metadata"?_e--:_e>0&&B&&"onCloseTag"in B&&B.onCloseTag());it.shift(),qe.shift(),j.shift()},Pe.ontext=function(ie){if(j[0]!==void 0)if(j[0]instanceof ht||j[0]instanceof ke){if(j[0]instanceof ht){var be=j[0].styleAttrs[p.byName.ruby.qname];if(be==="container"||be==="textContainer"||be==="baseContainer")return}var tt=new ye;tt.initFromText(Ue,j[0],ie,qe[0],it[0],V),j[0].contents.push(tt)}else j[0]instanceof g&&_e>0&&B&&"onText"in B&&B.onText(ie)},Pe.onopentag=function(ie){var be=ie.attributes["xml:space"];be?it.unshift(be.value):it.length===0?it.unshift("default"):it.unshift(it[0]);var tt=ie.attributes["xml:lang"];if(tt?qe.unshift(tt.value):qe.length===0?qe.unshift(""):qe.unshift(qe[0]),ie.uri===o.ns_tt)if(ie.local==="tt")Ue!==null&&mt(V,"Two <tt> elements at ("+this.line+","+this.column+")"),(Ue=new h).initFromNode(ie,qe[0],V),j.unshift(Ue);else if(ie.local==="head")j[0]instanceof h||mt(V,"Parent of <head> element is not <tt> at ("+this.line+","+this.column+")"),j.unshift(Ue.head);else if(ie.local==="styling")j[0]instanceof r||mt(V,"Parent of <styling> element is not <head> at ("+this.line+","+this.column+")"),j.unshift(Ue.head.styling);else if(ie.local==="style"){var ae;j[0]instanceof H?((ae=new G).initFromNode(ie,V),ae.id?Ue.head.styling.styles[ae.id]=ae:Ie(V,"<style> element missing @id attribute"),j.unshift(ae)):j[0]instanceof He?((ae=new G).initFromNode(ie,V),En(ae.styleAttrs,j[0].styleAttrs),j.unshift(ae)):mt(V,"Parent of <style> element is not <styling> or <region> at ("+this.line+","+this.column+")")}else if(ie.local==="initial"){var ze;if(j[0]instanceof H){for(var je in(ze=new le).initFromNode(ie,V),ze.styleAttrs)ze.styleAttrs.hasOwnProperty(je)&&(Ue.head.styling.initials[je]=ze.styleAttrs[je]);j.unshift(ze)}else mt(V,"Parent of <initial> element is not <styling> at ("+this.line+","+this.column+")")}else if(ie.local==="layout")j[0]instanceof r||mt(V,"Parent of <layout> element is not <head> at "+this.line+","+this.column+")"),j.unshift(Ue.head.layout);else if(ie.local==="region"){j[0]instanceof de||mt(V,"Parent of <region> element is not <layout> at "+this.line+","+this.column+")");var Y=new He;Y.initFromNode(Ue,ie,qe[0],V),!Y.id||Y.id in Ue.head.layout.regions?Ie(V,"Ignoring <region> with duplicate or missing @id at "+this.line+","+this.column+")"):Ue.head.layout.regions[Y.id]=Y,j.unshift(Y)}else if(ie.local==="body"){j[0]instanceof h||mt(V,"Parent of <body> element is not <tt> at "+this.line+","+this.column+")"),Ue.body!==null&&mt(V,"Second <body> element at "+this.line+","+this.column+")");var he=new Se;he.initFromNode(Ue,ie,qe[0],V),Ue.body=he,j.unshift(he)}else if(ie.local==="div"){j[0]instanceof Ne||j[0]instanceof Se||mt(V,"Parent of <div> element is not <body> or <div> at "+this.line+","+this.column+")");var et=new Ne;et.initFromNode(Ue,j[0],ie,qe[0],V);var at=et.styleAttrs[p.byName.backgroundImage.qname];at&&(et.contents.push(new De(at)),delete et.styleAttrs[p.byName.backgroundImage.qname]),j[0].contents.push(et),j.unshift(et)}else if(ie.local==="image"){j[0]instanceof Ne||mt(V,"Parent of <image> element is not <div> at "+this.line+","+this.column+")");var Tt=new De;Tt.initFromNode(Ue,j[0],ie,qe[0],V),j[0].contents.push(Tt),j.unshift(Tt)}else if(ie.local==="p"){j[0]instanceof Ne||mt(V,"Parent of <p> element is not <div> at "+this.line+","+this.column+")");var st=new ke;st.initFromNode(Ue,j[0],ie,qe[0],V),j[0].contents.push(st),j.unshift(st)}else if(ie.local==="span"){j[0]instanceof ht||j[0]instanceof ke||mt(V,"Parent of <span> element is not <span> or <p> at "+this.line+","+this.column+")");var _t=new ht;_t.initFromNode(Ue,j[0],ie,qe[0],it[0],V),j[0].contents.push(_t),j.unshift(_t)}else if(ie.local==="br"){j[0]instanceof ht||j[0]instanceof ke||mt(V,"Parent of <br> element is not <span> or <p> at "+this.line+","+this.column+")");var Zt=new pt;Zt.initFromNode(Ue,j[0],ie,qe[0],V),j[0].contents.push(Zt),j.unshift(Zt)}else if(ie.local==="set"){j[0]instanceof ht||j[0]instanceof ke||j[0]instanceof Ne||j[0]instanceof Se||j[0]instanceof He||j[0]instanceof pt||mt(V,"Parent of <set> element is not a content element or a region at "+this.line+","+this.column+")");var In=new Fe;In.initFromNode(Ue,j[0],ie,V),j[0].sets.push(In),j.unshift(In)}else j.unshift(new g(ie));else j.unshift(new g(ie));if(j[0]instanceof g){if(ie.uri===o.ns_tt&&ie.local==="metadata")_e++;else if(_e>0&&B&&"onOpenTag"in B){var Vt=[];for(var _n in ie.attributes)Vt[ie.attributes[_n].uri+" "+ie.attributes[_n].local]={uri:ie.attributes[_n].uri,local:ie.attributes[_n].local,value:ie.attributes[_n].value};B.onOpenTag(ie.uri,ie.local,Vt)}}},Pe.write(Ye).close(),delete Ue.head.styling.styles;var i=!1;for(var S in Ue.head.layout.regions)if(Ue.head.layout.regions.hasOwnProperty(S)){i=!0;break}if(!i){var I=He.prototype.createDefaultRegion(Ue.lang);Ue.head.layout.regions[I.id]=I}for(var $ in Ue.head.layout.regions)Ue.head.layout.regions.hasOwnProperty($)&&w(Ue,Ue.head.layout.regions[$],null,null);return Ue.body&&w(Ue,Ue.body,null,null),Ue.body&&_(Ue.body),Ue},h.prototype.initFromNode=function(Ye,V,B){var Pe=(function(_e,Ue){var i=kt(_e,o.ns_ttp,"cellResolution"),S=15,I=32;if(i!==null){var $=/(\d+) (\d+)/.exec(i);$!==null?(I=parseInt($[1]),S=parseInt($[2])):Oe(Ue,"Malformed cellResolution value (using initial value instead)")}return{w:I,h:S}})(Ye,B);this.cellLength={h:new E.ComputedLength(0,1/Pe.h),w:new E.ComputedLength(1/Pe.w,0)};var j=(function(_e,Ue){var i,S=kt(_e,o.ns_ttp,"frameRate"),I=30;S!==null&&((i=/(\d+)/.exec(S))!==null?I=parseInt(i[1]):Oe(Ue,"Malformed frame rate attribute (using initial value instead)"));var $=kt(_e,o.ns_ttp,"frameRateMultiplier"),ie=1;$!==null&&((i=/(\d+) (\d+)/.exec($))!==null?ie=parseInt(i[1])/parseInt(i[2]):Oe(Ue,"Malformed frame rate multiplier attribute (using initial value instead)"));var be=ie*I,tt=1,ae=kt(_e,o.ns_ttp,"tickRate");return ae===null?S!==null&&(tt=be):(i=/(\d+)/.exec(ae))!==null?tt=parseInt(i[1]):Oe(Ue,"Malformed tick rate attribute (using initial value instead)"),{effectiveFrameRate:be,tickRate:tt}})(Ye,B);this.effectiveFrameRate=j.effectiveFrameRate,this.tickRate=j.tickRate,this.aspectRatio=(function(_e,Ue){var i=kt(_e,o.ns_ittp,"aspectRatio");i===null&&(i=kt(_e,o.ns_ttp,"displayAspectRatio"));var S=null;if(i!==null){var I=/(\d+)\s+(\d+)/.exec(i);if(I!==null){var $=parseInt(I[1]),ie=parseInt(I[2]);$!==0&&ie!==0?S=$/ie:Ie(Ue,"Illegal aspectRatio values (ignoring)")}else Ie(Ue,"Malformed aspectRatio attribute (ignoring)")}return S})(Ye,B);var qe=kt(Ye,o.ns_ttp,"timeBase");qe!==null&&qe!=="media"&&mt(B,"Unsupported time base");var it=(function(_e,Ue){var i=kt(_e,o.ns_tts,"extent");if(i===null)return null;var S=i.split(" ");if(S.length!==2)return Oe(Ue,"Malformed extent (ignoring)"),null;var I=E.parseLength(S[0]),$=E.parseLength(S[1]);return $&&I?{h:$,w:I}:(Oe(Ue,"Malformed extent values (ignoring)"),null)})(Ye,B);it===null?this.pxLength={h:null,w:null}:(it.h.unit==="px"&&it.w.unit==="px"||mt(B,"Extent on TT must be in px or absent"),this.pxLength={h:new E.ComputedLength(0,1/it.h.value),w:new E.ComputedLength(1/it.w.value,0)}),this.dimensions={h:new E.ComputedLength(0,1),w:new E.ComputedLength(1,0)},this.lang=V},h.prototype._registerEvent=function(Ye){if(!(Ye.end<=Ye.begin)){var V=It(this.events,Ye.begin);if(V.found||this.events.splice(V.index,0,Ye.begin),Ye.end!==Number.POSITIVE_INFINITY){var B=It(this.events,Ye.end);B.found||this.events.splice(B.index,0,Ye.end)}}},h.prototype.getMediaTimeRange=function(){return[this.events[0],this.events[this.events.length-1]]},h.prototype.getMediaTimeEvents=function(){return this.events},G.prototype.initFromNode=function(Ye,V){this.id=Ke(Ye),this.styleAttrs=Nt(Ye,V),this.styleRefs=Pt(Ye)},le.prototype.initFromNode=function(Ye,V){for(var B in this.styleAttrs={},Ye.attributes)if(Ye.attributes[B].uri===o.ns_itts||Ye.attributes[B].uri===o.ns_ebutts||Ye.attributes[B].uri===o.ns_tts){var Pe=Ye.attributes[B].uri+" "+Ye.attributes[B].local;this.styleAttrs[Pe]=Ye.attributes[B].value}},De.prototype.initFromNode=function(Ye,V,B,Pe,j){this.src="src"in B.attributes?B.attributes.src.value:null,this.src||Ie(j,"Invalid image@src attribute"),this.type="type"in B.attributes?B.attributes.type.value:null,this.type||Ie(j,"Invalid image@type attribute"),ot.prototype.initFromNode.call(this,Ye,V,B,j),Z.prototype.initFromNode.call(this,Ye,V,B,j),Ge.prototype.initFromNode.call(this,Ye,V,B,j),Be.prototype.initFromNode.call(this,Ye,V,B,j),this.lang=Pe},Le.prototype.initFromNode=function(Ye,V,B,Pe){this.id=Ke(B)},Be.prototype.initFromNode=function(Ye,V,B,Pe){this.regionID=(function(j){return j&&"region"in j.attributes?j.attributes.region.value:""})(B)},ot.prototype.initFromNode=function(Ye,V,B,Pe){this.styleAttrs=Nt(B,Pe),Ye.head!==null&&Ye.head.styling!==null&&an(Ye.head.styling,Pt(B),this.styleAttrs,Pe)},Ge.prototype.initFromNode=function(Ye,V,B,Pe){this.sets=[]},X.prototype.initFromNode=function(Ye,V,B,Pe){this.contents=[]},Z.prototype.initFromNode=function(Ye,V,B,Pe){var j=(function(qe,it,_e,Ue){var i=null;_e&&"begin"in _e.attributes&&(i=Ut(qe.tickRate,qe.effectiveFrameRate,_e.attributes.begin.value))===null&&Oe(Ue,"Malformed begin value "+_e.attributes.begin.value+" (using 0)");var S=null;_e&&"dur"in _e.attributes&&(S=Ut(qe.tickRate,qe.effectiveFrameRate,_e.attributes.dur.value))===null&&Oe(Ue,"Malformed dur value "+_e.attributes.dur.value+" (ignoring)");var I=null;return _e&&"end"in _e.attributes&&(I=Ut(qe.tickRate,qe.effectiveFrameRate,_e.attributes.end.value))===null&&Oe(Ue,"Malformed end value (ignoring)"),{explicit_begin:i,explicit_end:I,explicit_dur:S}})(Ye,0,B,Pe);this.explicit_begin=j.explicit_begin,this.explicit_end=j.explicit_end,this.explicit_dur=j.explicit_dur,this.timeContainer=(function(qe,it){var _e=qe&&"timeContainer"in qe.attributes?qe.attributes.timeContainer.value:null;return _e&&_e!=="par"?_e==="seq"?"seq":(Ie(it,"Illegal value of timeContainer (assuming 'par')"),"par"):"par"})(B,Pe)},Se.prototype.initFromNode=function(Ye,V,B,Pe){ot.prototype.initFromNode.call(this,Ye,null,V,Pe),Z.prototype.initFromNode.call(this,Ye,null,V,Pe),Ge.prototype.initFromNode.call(this,Ye,null,V,Pe),Be.prototype.initFromNode.call(this,Ye,null,V,Pe),X.prototype.initFromNode.call(this,Ye,null,V,Pe),this.lang=B},Ne.prototype.initFromNode=function(Ye,V,B,Pe,j){ot.prototype.initFromNode.call(this,Ye,V,B,j),Z.prototype.initFromNode.call(this,Ye,V,B,j),Ge.prototype.initFromNode.call(this,Ye,V,B,j),Be.prototype.initFromNode.call(this,Ye,V,B,j),X.prototype.initFromNode.call(this,Ye,V,B,j),this.lang=Pe},ke.prototype.initFromNode=function(Ye,V,B,Pe,j){ot.prototype.initFromNode.call(this,Ye,V,B,j),Z.prototype.initFromNode.call(this,Ye,V,B,j),Ge.prototype.initFromNode.call(this,Ye,V,B,j),Be.prototype.initFromNode.call(this,Ye,V,B,j),X.prototype.initFromNode.call(this,Ye,V,B,j),this.lang=Pe},ht.prototype.initFromNode=function(Ye,V,B,Pe,j,qe){ot.prototype.initFromNode.call(this,Ye,V,B,qe),Z.prototype.initFromNode.call(this,Ye,V,B,qe),Ge.prototype.initFromNode.call(this,Ye,V,B,qe),Be.prototype.initFromNode.call(this,Ye,V,B,qe),X.prototype.initFromNode.call(this,Ye,V,B,qe),this.space=j,this.lang=Pe},ye.prototype.initFromText=function(Ye,V,B,Pe,j,qe){Z.prototype.initFromNode.call(this,Ye,V,null,qe),this.text=B,this.space=j,this.lang=Pe},pt.prototype.initFromNode=function(Ye,V,B,Pe,j){Be.prototype.initFromNode.call(this,Ye,V,B,j),Z.prototype.initFromNode.call(this,Ye,V,B,j),this.lang=Pe},He.prototype.createDefaultRegion=function(Ye){var V=new He;return Le.call(V,""),ot.call(V,{}),Ge.call(V,[]),Z.call(V,0,Number.POSITIVE_INFINITY,null),this.lang=Ye,V},He.prototype.initFromNode=function(Ye,V,B,Pe){Le.prototype.initFromNode.call(this,Ye,null,V,Pe),Z.prototype.initFromNode.call(this,Ye,null,V,Pe),Ge.prototype.initFromNode.call(this,Ye,null,V,Pe),this.styleAttrs=Nt(V,Pe),this.styleRefs=Pt(V),this.lang=B},Fe.prototype.initFromNode=function(Ye,V,B,Pe){Z.prototype.initFromNode.call(this,Ye,V,B,Pe);var j=Nt(B,Pe);for(var qe in this.qname=null,this.value=null,j)if(j.hasOwnProperty(qe)){if(this.qname){Ie(Pe,"More than one style specified on set");break}this.qname=qe,this.value=j[qe]}}})(me,typeof sax>"u"?P(5474):sax,typeof imscNames>"u"?P(977):imscNames,typeof imscStyles>"u"?P(1219):imscStyles,typeof imscUtils>"u"?P(6404):imscUtils)},1612:function(wt,me,P){var F=/firefox/i.test(navigator.userAgent);(function(f,o,p){function E(X,Z,Se,Ne){var ke;if(Se.kind==="region")(ke=document.createElement("div")).style.position="absolute";else if(Se.kind==="body")ke=document.createElement("div");else if(Se.kind==="div")ke=document.createElement("div");else if(Se.kind==="image"){if(ke=document.createElement("img"),X.imgResolver!==null&&Se.src!==null){var ht=X.imgResolver(Se.src,ke);ht&&(ke.src=ht),ke.height=X.regionH,ke.width=X.regionW}}else if(Se.kind==="p")ke=document.createElement("p");else if(Se.kind==="span")if(Se.styleAttrs[p.byName.ruby.qname]==="container")ke=document.createElement("ruby"),X.ruby=!0;else if(Se.styleAttrs[p.byName.ruby.qname]==="base")ke=document.createElement("span");else if(Se.styleAttrs[p.byName.ruby.qname]==="text")ke=document.createElement("rt");else if(Se.styleAttrs[p.byName.ruby.qname]==="baseContainer")ke=document.createElement("rbc");else if(Se.styleAttrs[p.byName.ruby.qname]==="textContainer")ke=document.createElement("rtc");else{if(Se.styleAttrs[p.byName.ruby.qname]==="delimiter")return;ke=document.createElement("span")}else Se.kind==="br"&&(ke=document.createElement("br"));if(ke){if(Se.lang&&(Se.kind!=="region"&&Se.lang===Ne.lang||(ke.lang=Se.lang)),Z.appendChild(ke),ke.style.margin="0",Se.kind==="region"){var ye=Se.styleAttrs[p.byName.writingMode.qname];ye==="lrtb"||ye==="lr"?(X.ipd="lr",X.bpd="tb"):ye==="rltb"||ye==="rl"?(X.ipd="rl",X.bpd="tb"):ye==="tblr"?(X.ipd="tb",X.bpd="lr"):ye!=="tbrl"&&ye!=="tb"||(X.ipd="tb",X.bpd="rl")}else if(Se.kind==="p"&&X.bpd==="tb"){var pt=Se.styleAttrs[p.byName.direction.qname];X.ipd=pt==="ltr"?"lr":"rl"}for(var He=0;He<le.length;He++){var Fe=le[He],Ke=Se.styleAttrs[Fe.qname];Ke!==void 0&&Fe.map!==null&&Fe.map(X,ke,Se,Ke)}var Pt=ke,Nt=Se.styleAttrs[p.byName.linePadding.qname];if(Nt&&!Nt.isZero()){var kt=Nt.toUsedLength(X.w,X.h);if(kt>0){var Ut=Math.ceil(kt)+"px";X.bpd==="tb"?(Pt.style.paddingLeft=Ut,Pt.style.paddingRight=Ut):(Pt.style.paddingTop=Ut,Pt.style.paddingBottom=Ut),X.lp=Nt}}var ln=Se.styleAttrs[p.byName.multiRowAlign.qname];if(ln&&ln!=="auto"){var an=document.createElement("span");an.style.display="inline-block",an.style.textAlign=ln,ke.appendChild(an),Pt=an,X.mra=ln}var En=Se.styleAttrs[p.byName.rubyReserve.qname];if(En&&En[0]!=="none"&&(X.rubyReserve=En),Se.styleAttrs[p.byName.fillLineGap.qname]&&(X.flg=!0),Se.kind==="span"&&Se.text){var Oe=Se.styleAttrs[p.byName.textEmphasis.qname];if(Oe&&Oe.style!=="none"&&(X.textEmphasis=!0),p.byName.textCombine.qname in Se.styleAttrs&&Se.styleAttrs[p.byName.textCombine.qname]==="all")ke.textContent=Se.text,ke._isd_element=Se,Oe&&H(X,ke,0,Oe);else for(var Ie="",mt=0;mt<Se.text.length;mt++){Ie+=Se.text.charAt(mt);var It=Se.text.charCodeAt(mt);if(It<55296||It>56319||mt===Se.text.length-1){var Ye=document.createElement("span");Ye.textContent=Ie,Oe&&H(X,Ye,0,Oe),ke.appendChild(Ye),Ie="",Ye._isd_element=Se}}}if("contents"in Se)for(var V=0;V<Se.contents.length;V++)E(X,Pt,Se.contents[V],Se);var B=[];if(Se.kind==="p"&&(r(X,Pt,B,null),X.rubyReserve&&((function(_e,Ue){for(var i=0;i<_e.length;i++){var S,I,$=document.createElement("ruby"),ie=document.createElement("span");ie.textContent="​",$.appendChild(ie);var be,tt=Ue.rubyReserve[1].toUsedLength(Ue.w,Ue.h)+"px";Ue.rubyReserve[0]==="both"||Ue.rubyReserve[0]==="outside"&&_e.length==1?((S=document.createElement("rtc")).style[Le]=ce?"after":"under",S.textContent="​",S.style.fontSize=tt,(I=document.createElement("rtc")).style[Le]=ce?"before":"over",I.textContent="​",I.style.fontSize=tt,$.appendChild(S),$.appendChild(I)):((S=document.createElement("rtc")).textContent="​",S.style.fontSize=tt,be=Ue.rubyReserve[0]==="after"||Ue.rubyReserve[0]==="outside"&&i>0?ce?"after":Ue.bpd==="tb"||Ue.bpd==="rl"?"under":"over":ce?"before":Ue.bpd==="tb"||Ue.bpd==="rl"?"over":"under",S.style[Le]=be,$.appendChild(S));for(var ae=null,ze=0;ze<_e[i].rbc.length;ze++)if(_e[i].rbc[ze].localName==="ruby"){ae=_e[i].rbc[ze];for(var je=0;je<ae.style.length;je++)$.style.setProperty(ae.style.item(je),ae.style.getPropertyValue(ae.style.item(je)));break}(ae=ae||_e[i].elements[0].node).parentElement.insertBefore($,ae)}})(B,X),X.rubyReserve=null),(X.ruby||X.rubyReserve)&&((function(_e,Ue){for(var i=0;i<_e.length;i++)for(var S=0;S<_e[i].rbc.length;S++){var I;_e[i].rbc[S].style[Le]||(I=ce?i===0?"before":"after":Ue.bpd==="tb"||Ue.bpd==="rl"?i===0?"over":"under":i===0?"under":"over",_e[i].rbc[S].style[Le]=I)}})(B,X),X.ruby=null),X.textEmphasis&&((function(_e,Ue){for(var i=0;i<_e.length;i++)for(var S=0;S<_e[i].te.length;S++){var I;_e[i].te[S].style[ot]&&_e[i].te[S].style[ot]!=="none"||(I=Ue.bpd==="tb"?i===0?"left over":"left under":Ue.bpd==="rl"?i===0?"right under":"left under":i===0?"left under":"right under",_e[i].te[S].style[ot]=I)}})(B,X),X.textEmphasis=null),X.mra&&((function(_e){for(var Ue=0;Ue<_e.length-1;Ue++){var i=_e[Ue].elements.length;if(i!==0&&_e[Ue].br===!1){var S=document.createElement("br"),I=_e[Ue].elements[i-1].node;I.parentElement.insertBefore(S,I.nextSibling)}}})(B),X.mra=null),X.lp&&((function(_e,Ue,i){if(_e!==null)for(var S=0;S<_e.length;S++){var I=_e[S].elements.length,$=Math.ceil(Ue)+"px",ie="-"+Math.ceil(Ue)+"px";if(I!==0){var be=_e[S].elements[_e[S].start_elem],tt=_e[S].elements[_e[S].end_elem];if(be===tt){var ae=be.node.getBoundingClientRect();if(ae.width==0||ae.height==0)continue}i.ipd==="lr"?(be.node.style.marginLeft=ie,be.node.style.paddingLeft=$):i.ipd==="rl"?(be.node.style.paddingRight=$,be.node.style.marginRight=ie):i.ipd==="tb"&&(be.node.style.paddingTop=$,be.node.style.marginTop=ie),i.ipd==="lr"?(F||(tt.node.style.marginRight=ie),tt.node.style.paddingRight=$):i.ipd==="rl"?(tt.node.style.paddingLeft=$,F||(tt.node.style.marginLeft=ie)):i.ipd==="tb"&&(tt.node.style.paddingBottom=$,tt.node.style.marginBottom=ie)}}})(B,X.lp.toUsedLength(X.w,X.h),X),X.lp=null),(function(_e,Ue){for(var i=0;i<_e.length;i++)for(var S=_e[i],I=1;I<S.elements.length;){var $=S.elements[I-1],ie=S.elements[I];w($.node,ie.node,Ue)?S.elements.splice(I,1):I++}for(var be,tt,ae=[],ze=0;ze<_e.length;ze++)for(var je=0;je<_e[ze].elements.length;je++)(tt=_(be=_e[ze].elements[je].node,ae,!1))&&(be.style.backgroundColor=tt);for(var Y=0;Y<ae.length;Y++)ae[Y].style.backgroundColor=""})(B,X),X.flg)){var Pe=h(Pt.getBoundingClientRect(),X);(function(_e,Ue,i,S){for(var I=Math.sign(i-Ue),$=0;$<=_e.length;$++){var ie,be,tt,ae;if(ie=$===0?Math.round(Ue):$===_e.length?Math.round(i):Math.round((_e[$-1].after+_e[$].before)/2),$>0&&_e[$-1])for(tt=0;tt<_e[$-1].elements.length;tt++)be=I*(ie-(ae=_e[$-1].elements[tt]).after)+"px",S.bpd==="lr"?ae.node.style.paddingRight=be:S.bpd==="rl"?ae.node.style.paddingLeft=be:S.bpd==="tb"&&(ae.node.style.paddingBottom=be);if($<_e.length)for(tt=0;tt<_e[$].elements.length;tt++)be=I*((ae=_e[$].elements[tt]).before-ie)+"px",S.bpd==="lr"?ae.node.style.paddingLeft=be:S.bpd==="rl"?ae.node.style.paddingRight=be:S.bpd==="tb"&&(ae.node.style.paddingTop=be)}})(B,Pe.before,Pe.after,X),X.flg=null}if(Se.kind==="region"&&X.bpd==="tb"&&X.enableRollUp&&Se.contents.length>0&&Se.styleAttrs[p.byName.displayAlign.qname]==="after"){r(X,Pt,B,null);var j=new g(Se.id===""?"_":Se.id,B);if(X.currentISDState[j.id]=j,X.previousISDState&&j.id in X.previousISDState&&X.previousISDState[j.id].plist.length>0&&j.plist.length>1&&j.plist[j.plist.length-2].text===X.previousISDState[j.id].plist[X.previousISDState[j.id].plist.length-1].text){var qe=ke.firstElementChild,it=j.plist[j.plist.length-1].after-j.plist[j.plist.length-1].before;qe.style.bottom="-"+it+"px",qe.style.transition="transform 0.4s",qe.style.position="relative",qe.style.transform="translateY(-"+it+"px)"}}}else Ge(X.errorHandler,"Error processing ISD element kind: "+Se.kind)}function _(X,Z,Se){return X.style.backgroundColor?(Se&&!Z.includes(X)&&Z.push(X),X.style.backgroundColor):X.parentElement.nodeName==="SPAN"||X.parentElement.nodeName==="RUBY"||X.parentElement.nodeName==="RBC"||X.parentElement.nodeName==="RTC"||X.parentElement.nodeName==="RT"?_(X.parentElement,Z,!0):void 0}function w(X,Z,Se){if(X.tagName==="SPAN"&&Z.tagName==="SPAN"&&X._isd_element===Z._isd_element){if(!X._isd_element)return Ge(Se.errorHandler,"Internal error: HTML span is not linked to a source element; cannot merge spans."),!1;X.textContent+=Z.textContent;for(var Ne=0;Ne<Z.style.length;Ne++){var ke=Z.style[Ne];(ke.indexOf("border")>=0||ke.indexOf("padding")>=0||ke.indexOf("margin")>=0)&&(X.style[ke]=Z.style[ke])}return Z.parentElement.removeChild(Z),!0}return!1}function g(X,Z){this.id=X,this.plist=Z}function h(X,Z){var Se={before:null,after:null,start:null,end:null};return Z.bpd==="tb"?(Se.before=X.top,Se.after=X.bottom,Z.ipd==="lr"?(Se.start=X.left,Se.end=X.right):(Se.start=X.right,Se.end=X.left)):Z.bpd==="lr"?(Se.before=X.left,Se.after=X.right,Se.start=X.top,Se.end=X.bottom):Z.bpd==="rl"&&(Se.before=X.right,Se.after=X.left,Se.start=X.top,Se.end=X.bottom),Se}function r(X,Z,Se,Ne){if(Z.localName!=="rt"&&Z.localName!=="rtc"){var ke,ht,ye,pt,He=Z.style.backgroundColor||Ne;if(Z.childElementCount===0)if(Z.localName==="span"||Z.localName==="rb"){var Fe=h(Z.getBoundingClientRect(),X);if(Se.length!==0&&(ke=Fe.before,ht=Fe.after,ye=Se[Se.length-1].before,ht<(pt=Se[Se.length-1].after)&&ke>ye||pt<=ht&&ye>=ke)){var Ke=Math.sign(Fe.after-Fe.before),Pt=Math.sign(Fe.end-Fe.start);Ke*(Fe.before-Se[Se.length-1].before)<0&&(Se[Se.length-1].before=Fe.before),Ke*(Fe.after-Se[Se.length-1].after)>0&&(Se[Se.length-1].after=Fe.after),Pt*(Fe.start-Se[Se.length-1].start)<0&&(Se[Se.length-1].start=Fe.start,Se[Se.length-1].start_elem=Se[Se.length-1].elements.length),Pt*(Fe.end-Se[Se.length-1].end)>0&&(Se[Se.length-1].end=Fe.end,Se[Se.length-1].end_elem=Se[Se.length-1].elements.length)}else Se.push({before:Fe.before,after:Fe.after,start:Fe.start,end:Fe.end,start_elem:0,end_elem:0,elements:[],rbc:[],te:[],text:"",br:!1});Se[Se.length-1].text+=Z.textContent,Se[Se.length-1].elements.push({node:Z,bgcolor:He,before:Fe.before,after:Fe.after})}else Z.localName==="br"&&Se.length!==0&&(Se[Se.length-1].br=!0);else for(var Nt=Z.firstChild;Nt;)Nt.nodeType===Node.ELEMENT_NODE&&(r(X,Nt,Se,He),Nt.localName==="ruby"||Nt.localName==="rtc"?Se.length>0&&Se[Se.length-1].rbc.push(Nt):Nt.localName==="span"&&Nt.style[Be]&&Nt.style[Be]!=="none"&&Se.length>0&&Se[Se.length-1].te.push(Nt)),Nt=Nt.nextSibling}}function H(X,Z,Se,Ne){var ke;Ne.style!=="none"&&(Ne.style==="auto"?Z.style[Be]="filled":Z.style[Be]=Ne.style+" "+Ne.symbol,(Ne.position==="before"||Ne.position==="after")&&(ke=X.bpd==="tb"?Ne.position==="before"?"left over":"left under":X.bpd==="rl"?Ne.position==="before"?"right under":"left under":Ne.position==="before"?"left under":"right under",Z.style[ot]=ke))}function G(X,Z){this.qname=X,this.map=Z}f.render=function(X,Z,Se,Ne,ke,ht,ye,pt,He){var Fe=Ne||Z.clientHeight,Ke=ke||Z.clientWidth;if(X.aspectRatio!==null){var Pt=Fe*X.aspectRatio;Pt>Ke?Fe=Math.round(Ke/X.aspectRatio):Ke=Pt}var Nt=document.createElement("div");Nt.style.position="relative",Nt.style.width=Ke+"px",Nt.style.height=Fe+"px",Nt.style.margin="auto",Nt.style.top=0,Nt.style.bottom=0,Nt.style.left=0,Nt.style.right=0,Nt.style.zIndex=0;var kt={h:Fe,w:Ke,regionH:null,regionW:null,imgResolver:Se,displayForcedOnlyMode:ht||!1,isd:X,errorHandler:ye,previousISDState:pt,enableRollUp:He||!1,currentISDState:{},flg:null,lp:null,mra:null,ipd:null,bpd:null,ruby:null,textEmphasis:null,rubyReserve:null};if(Z.appendChild(Nt),"contents"in X)for(var Ut=0;Ut<X.contents.length;Ut++)E(kt,Nt,X.contents[Ut],X);return kt.currentISDState};for(var le=[new G("http://www.w3.org/ns/ttml#styling backgroundColor",(function(X,Z,Se,Ne){Ne[3]!==0&&(Z.style.backgroundColor="rgba("+Ne[0].toString()+","+Ne[1].toString()+","+Ne[2].toString()+","+(Ne[3]/255).toString()+")")})),new G("http://www.w3.org/ns/ttml#styling color",(function(X,Z,Se,Ne){Z.style.color="rgba("+Ne[0].toString()+","+Ne[1].toString()+","+Ne[2].toString()+","+(Ne[3]/255).toString()+")"})),new G("http://www.w3.org/ns/ttml#styling direction",(function(X,Z,Se,Ne){Z.style.direction=Ne})),new G("http://www.w3.org/ns/ttml#styling display",(function(X,Z,Se,Ne){})),new G("http://www.w3.org/ns/ttml#styling displayAlign",(function(X,Z,Se,Ne){Z.style.display="flex",Z.style.flexDirection="column",Ne==="before"?Z.style.justifyContent="flex-start":Ne==="center"?Z.style.justifyContent="center":Ne==="after"&&(Z.style.justifyContent="flex-end")})),new G("http://www.w3.org/ns/ttml#styling extent",(function(X,Z,Se,Ne){X.regionH=Ne.h.toUsedLength(X.w,X.h),X.regionW=Ne.w.toUsedLength(X.w,X.h);var ke=0,ht=0,ye=Se.styleAttrs["http://www.w3.org/ns/ttml#styling padding"];ye&&(ke=ye[0].toUsedLength(X.w,X.h)+ye[2].toUsedLength(X.w,X.h),ht=ye[1].toUsedLength(X.w,X.h)+ye[3].toUsedLength(X.w,X.h)),Z.style.height=X.regionH-ke+"px",Z.style.width=X.regionW-ht+"px"})),new G("http://www.w3.org/ns/ttml#styling fontFamily",(function(X,Z,Se,Ne){for(var ke=[],ht=0;ht<Ne.length;ht++)Ne[ht]=Ne[ht].trim(),Ne[ht]==="monospaceSerif"?(ke.push("Courier New"),ke.push('"Liberation Mono"'),ke.push("Courier"),ke.push("monospace")):Ne[ht]==="proportionalSansSerif"?(ke.push("Arial"),ke.push("Helvetica"),ke.push('"Liberation Sans"'),ke.push("sans-serif")):Ne[ht]==="monospace"?ke.push("monospace"):Ne[ht]==="sansSerif"?ke.push("sans-serif"):Ne[ht]==="serif"?ke.push("serif"):Ne[ht]==="monospaceSansSerif"?(ke.push("Consolas"),ke.push("monospace")):Ne[ht]==="proportionalSerif"?ke.push("serif"):ke.push(Ne[ht]);if(ke.length>0){for(var ye=[ke[0]],pt=1;pt<ke.length;pt++)ye.indexOf(ke[pt])==-1&&ye.push(ke[pt]);ke=ye}Z.style.fontFamily=ke.join(",")})),new G("http://www.w3.org/ns/ttml#styling shear",(function(X,Z,Se,Ne){if(Ne!==0){var ke=-.9*Ne;X.bpd==="tb"?Z.style.transform="skewX("+ke+"deg)":Z.style.transform="skewY("+ke+"deg)"}})),new G("http://www.w3.org/ns/ttml#styling fontSize",(function(X,Z,Se,Ne){Z.style.fontSize=Ne.toUsedLength(X.w,X.h)+"px"})),new G("http://www.w3.org/ns/ttml#styling fontStyle",(function(X,Z,Se,Ne){Z.style.fontStyle=Ne})),new G("http://www.w3.org/ns/ttml#styling fontWeight",(function(X,Z,Se,Ne){Z.style.fontWeight=Ne})),new G("http://www.w3.org/ns/ttml#styling lineHeight",(function(X,Z,Se,Ne){Z.style.lineHeight=Ne==="normal"?"normal":Ne.toUsedLength(X.w,X.h)+"px"})),new G("http://www.w3.org/ns/ttml#styling opacity",(function(X,Z,Se,Ne){Z.style.opacity=Ne})),new G("http://www.w3.org/ns/ttml#styling origin",(function(X,Z,Se,Ne){Z.style.top=Ne.h.toUsedLength(X.w,X.h)+"px",Z.style.left=Ne.w.toUsedLength(X.w,X.h)+"px"})),new G("http://www.w3.org/ns/ttml#styling overflow",(function(X,Z,Se,Ne){Z.style.overflow=Ne})),new G("http://www.w3.org/ns/ttml#styling padding",(function(X,Z,Se,Ne){var ke=[];ke[0]=Ne[0].toUsedLength(X.w,X.h)+"px",ke[1]=Ne[3].toUsedLength(X.w,X.h)+"px",ke[2]=Ne[2].toUsedLength(X.w,X.h)+"px",ke[3]=Ne[1].toUsedLength(X.w,X.h)+"px",Z.style.padding=ke.join(" ")})),new G("http://www.w3.org/ns/ttml#styling position",(function(X,Z,Se,Ne){Z.style.top=Ne.h.toUsedLength(X.w,X.h)+"px",Z.style.left=Ne.w.toUsedLength(X.w,X.h)+"px"})),new G("http://www.w3.org/ns/ttml#styling rubyAlign",(function(X,Z,Se,Ne){Z.style.rubyAlign=Ne==="spaceAround"?"space-around":"center"})),new G("http://www.w3.org/ns/ttml#styling rubyPosition",(function(X,Z,Se,Ne){var ke;Ne!=="before"&&Ne!=="after"||(ke=ce?Ne:X.bpd==="tb"||X.bpd==="rl"?Ne==="before"?"over":"under":Ne==="before"?"under":"over",Z.parentElement.style[Le]=ke)})),new G("http://www.w3.org/ns/ttml#styling showBackground",null),new G("http://www.w3.org/ns/ttml#styling textAlign",(function(X,Z,Se,Ne){var ke;ke=Ne==="start"?X.ipd==="rl"?"right":"left":Ne==="end"?X.ipd==="rl"?"left":"right":Ne,Z.style.textAlign=ke})),new G("http://www.w3.org/ns/ttml#styling textDecoration",(function(X,Z,Se,Ne){Z.style.textDecoration=Ne.join(" ").replace("lineThrough","line-through")})),new G("http://www.w3.org/ns/ttml#styling textOutline",(function(X,Z,Se,Ne){})),new G("http://www.w3.org/ns/ttml#styling textShadow",(function(X,Z,Se,Ne){var ke=Se.styleAttrs[p.byName.textOutline.qname];if(Ne==="none"&&ke==="none")Z.style.textShadow="";else{var ht=[];if(ke!=="none"){var ye="rgba("+ke.color[0].toString()+","+ke.color[1].toString()+","+ke.color[2].toString()+","+(ke.color[3]/255).toString()+")";ht.push("1px 1px 1px "+ye),ht.push("-1px 1px 1px "+ye),ht.push("1px -1px 1px "+ye),ht.push("-1px -1px 1px "+ye)}if(Ne!=="none")for(var pt=0;pt<Ne.length;pt++)ht.push(Ne[pt].x_off.toUsedLength(X.w,X.h)+"px "+Ne[pt].y_off.toUsedLength(X.w,X.h)+"px "+Ne[pt].b_radius.toUsedLength(X.w,X.h)+"px rgba("+Ne[pt].color[0].toString()+","+Ne[pt].color[1].toString()+","+Ne[pt].color[2].toString()+","+(Ne[pt].color[3]/255).toString()+")");Z.style.textShadow=ht.join(",")}})),new G("http://www.w3.org/ns/ttml#styling textCombine",(function(X,Z,Se,Ne){Z.style.textCombineUpright=Ne})),new G("http://www.w3.org/ns/ttml#styling textEmphasis",(function(X,Z,Se,Ne){})),new G("http://www.w3.org/ns/ttml#styling unicodeBidi",(function(X,Z,Se,Ne){var ke;ke=Ne==="bidiOverride"?"bidi-override":Ne,Z.style.unicodeBidi=ke})),new G("http://www.w3.org/ns/ttml#styling visibility",(function(X,Z,Se,Ne){Z.style.visibility=Ne})),new G("http://www.w3.org/ns/ttml#styling wrapOption",(function(X,Z,Se,Ne){Ne==="wrap"?Se.space==="preserve"?Z.style.whiteSpace="pre-wrap":Z.style.whiteSpace="normal":Se.space==="preserve"?Z.style.whiteSpace="pre":Z.style.whiteSpace="noWrap"})),new G("http://www.w3.org/ns/ttml#styling writingMode",(function(X,Z,Se,Ne){Ne==="lrtb"||Ne==="lr"||Ne==="rltb"||Ne==="rl"?Z.style.writingMode="horizontal-tb":Ne==="tblr"?Z.style.writingMode="vertical-lr":Ne!=="tbrl"&&Ne!=="tb"||(Z.style.writingMode="vertical-rl")})),new G("http://www.w3.org/ns/ttml#styling zIndex",(function(X,Z,Se,Ne){Z.style.zIndex=Ne})),new G("http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay",(function(X,Z,Se,Ne){X.displayForcedOnlyMode&&Ne===!1&&(Z.style.visibility="hidden")}))],de={},De=0;De<le.length;De++)de[le[De].qname]=le[De];var ce="webkitRubyPosition"in window.getComputedStyle(document.documentElement),Le=ce?"webkitRubyPosition":"rubyPosition",Be="webkitTextEmphasisStyle"in window.getComputedStyle(document.documentElement)?"webkitTextEmphasisStyle":"textEmphasisStyle",ot="webkitTextEmphasisPosition"in window.getComputedStyle(document.documentElement)?"webkitTextEmphasisPosition":"textEmphasisPosition";function Ge(X,Z){if(X&&X.error&&X.error(Z))throw Z}})(me,typeof imscNames>"u"?P(977):imscNames,typeof imscStyles>"u"?P(1219):imscStyles,typeof imscUtils>"u"?P(6404):imscUtils)},8905:function(wt,me,P){(function(F,f,o,p){F.generateISD=function(G,le,de){var De,ce=new h(G),Le={},Be={},ot=G.head.styling.initials[o.byName.showBackground.qname],Ge=G.head.styling.initials[o.byName.backgroundColor.qname];for(var X in G.head.layout.regions)if(G.head.layout.regions.hasOwnProperty(X)){var Z=G.head.layout.regions[X],Se=Z.styleAttrs[o.byName.showBackground.qname]||ot,Ne=Z.styleAttrs[o.byName.backgroundColor.qname]||Ge;Be[Z.id]=(Se==="always"||Se===void 0)&&Ne!==void 0&&!(le<Z.begin||le>=Z.end)}for(var ke in G.body&&G.body.regionID&&(Be[G.body.regionID]=!0),De=G.body!==null?(function ye(pt,He){if(He.contents){var Fe={};for(var Ke in He)He.hasOwnProperty(Ke)&&(Fe[Ke]=He[Ke]);return Fe.contents=[],He.contents.filter((function(Pt){return!(pt<Pt.begin||pt>=Pt.end)})).forEach((function(Pt){var Nt=ye(pt,Pt);Nt.regionID&&(Be[Nt.regionID]=!0),Nt!==null&&Fe.contents.push(Nt)})),Fe}return He})(le,G.body):null,Be[""]!==void 0&&(Be[""]=!0),Be)if(Be[ke]){var ht=_(G,le,G.head.layout.regions[ke],De,null,"",G.head.layout.regions[ke],de,Le);ht!==null&&ce.contents.push(ht.element)}return ce};var E=[o.byName.color.qname,o.byName.textCombine.qname,o.byName.textDecoration.qname,o.byName.textEmphasis.qname,o.byName.textOutline.qname,o.byName.textShadow.qname];function _(G,le,de,De,ce,Le,Be,ot,Ge){if(le<Be.begin||le>=Be.end)return null;var X="regionID"in Be&&Be.regionID!==""?Be.regionID:Le;if(ce!==null&&X!==de.id&&(!("contents"in Be)||"contents"in Be&&Be.contents.length===0||X!==""))return null;var Z=new r(Be);if("sets"in Be)for(var Se=0;Se<Be.sets.length;Se++)le<Be.sets[Se].begin||le>=Be.sets[Se].end||(Z.styleAttrs[Be.sets[Se].qname]=Be.sets[Se].value);var Ne={};for(var ke in Z.styleAttrs)if(Z.styleAttrs.hasOwnProperty(ke)&&(Ne[ke]=!0,Z.kind==="region"&&ke===o.byName.writingMode.qname&&!(o.byName.direction.qname in Z.styleAttrs))){var ht=Z.styleAttrs[ke];ht==="lrtb"||ht==="lr"?Z.styleAttrs[o.byName.direction.qname]="ltr":ht!=="rltb"&&ht!=="rl"||(Z.styleAttrs[o.byName.direction.qname]="rtl")}if(ce!==null)for(var ye=0;ye<o.all.length;ye++){var pt=o.all[ye];if(pt.qname===o.byName.textDecoration.qname){var He=ce.styleAttrs[pt.qname],Fe=Z.styleAttrs[pt.qname],Ke=[];Fe===void 0?Ke=He:Fe.indexOf("none")===-1?((Fe.indexOf("noUnderline")===-1&&He.indexOf("underline")!==-1||Fe.indexOf("underline")!==-1)&&Ke.push("underline"),(Fe.indexOf("noLineThrough")===-1&&He.indexOf("lineThrough")!==-1||Fe.indexOf("lineThrough")!==-1)&&Ke.push("lineThrough"),(Fe.indexOf("noOverline")===-1&&He.indexOf("overline")!==-1||Fe.indexOf("overline")!==-1)&&Ke.push("overline")):Ke.push("none"),Z.styleAttrs[pt.qname]=Ke}else if(pt.qname!==o.byName.fontSize.qname||pt.qname in Z.styleAttrs||Z.kind!=="span"||Z.styleAttrs[o.byName.ruby.qname]!=="textContainer")if(pt.qname!==o.byName.fontSize.qname||pt.qname in Z.styleAttrs||Z.kind!=="span"||Z.styleAttrs[o.byName.ruby.qname]!=="text")pt.inherit&&pt.qname in ce.styleAttrs&&!(pt.qname in Z.styleAttrs)&&(Z.styleAttrs[pt.qname]=ce.styleAttrs[pt.qname]);else{var Pt=ce.styleAttrs[o.byName.fontSize.qname];ce.styleAttrs[o.byName.ruby.qname]==="textContainer"?Z.styleAttrs[pt.qname]=Pt:Z.styleAttrs[pt.qname]=new p.ComputedLength(.5*Pt.rw,.5*Pt.rh)}else{var Nt=ce.styleAttrs[o.byName.fontSize.qname];Z.styleAttrs[pt.qname]=new p.ComputedLength(.5*Nt.rw,.5*Nt.rh)}}for(var kt=0;kt<o.all.length;kt++){var Ut=o.all[kt];if(!(Ut.qname in Z.styleAttrs)&&!(Ut.qname===o.byName.position.qname&&o.byName.origin.qname in Z.styleAttrs||Ut.qname===o.byName.origin.qname&&o.byName.position.qname in Z.styleAttrs)){var ln=G.head.styling.initials[Ut.qname]||Ut.initial;if(ln!==null&&(Z.kind==="region"||Ut.inherit===!1&&ln!==null)){var an=Ut.parse(ln);an!==null?(Z.styleAttrs[Ut.qname]=an,Ne[Ut.qname]=!0):H(ot,"Invalid initial value for '"+Ut.qname+"' on element '"+Z.kind)}}}for(var En=0;En<o.all.length;En++){var Oe=o.all[En];if(Oe.qname in Ne&&Oe.compute!==null){var Ie=Oe.compute(G,ce,Z,Z.styleAttrs[Oe.qname],Ge);Ie!==null?Z.styleAttrs[Oe.qname]=Ie:(Z.styleAttrs[Oe.qname]=Oe.compute(G,ce,Z,Oe.parse(Oe.initial),Ge),H(ot,"Style '"+Oe.qname+"' on element '"+Z.kind+"' cannot be computed"))}}if(Z.styleAttrs[o.byName.display.qname]==="none")return null;var mt=null;ce===null?mt=De===null?[]:[De]:"contents"in Be&&(mt=Be.contents);for(var It=0;mt!==null&&It<mt.length;It++){var Ye=_(G,le,de,De,Z,X,mt[It],ot,Ge);Ye!==null&&Z.contents.push(Ye.element)}for(var V in Z.styleAttrs)if(Z.styleAttrs.hasOwnProperty(V)){var B=!1;if(Z.kind==="span"){var Pe=Z.styleAttrs[o.byName.ruby.qname];(B=(Pe==="container"||Pe==="textContainer"||Pe==="baseContainer")&&E.indexOf(V)!==-1)||(B=Pe!=="container"&&V===o.byName.rubyAlign.qname),B||(B=!(Pe==="textContainer"||Pe==="text")&&V===o.byName.rubyPosition.qname)}if(!B){var j=o.byQName[V];"applies"in j&&(B=j.applies.indexOf(Z.kind)===-1)}B&&delete Z.styleAttrs[V]}var qe=Z.styleAttrs[o.byName.ruby.qname];if(Z.kind==="p"||Z.kind==="span"&&(qe==="textContainer"||qe==="text")){var it=[];w(Z,it),(function(_e){for(var Ue,i=0;i<_e.length;)if((Ue=_e[i]).kind!=="br"&&Ue.space!=="preserve"){var S=Ue.text.replace(/[\t\r\n ]+/g," ");/^[ ]/.test(S)&&(i===0||(I=_e[i-1]).kind==="br"||/[\r\n\t ]$/.test(I.text))&&(S=S.substring(1)),Ue.text=S,S.length===0?_e.splice(i,1):i++}else i++;var I,$;for(i=0;i<_e.length;i++)(Ue=_e[i]).kind!=="br"&&Ue.space!=="preserve"?/[ ]$/.test(Ue.text)&&(i===_e.length-1||($=_e[i+1]).kind==="br"||$.space==="preserve"&&/^[\r\n]/.test($.text))&&(Ue.text=Ue.text.slice(0,-1)):i++})(it),g(Z)}return Z.kind==="div"&&o.byName.backgroundImage.qname in Z.styleAttrs||Z.kind==="br"||Z.kind==="image"||"contents"in Z&&Z.contents.length>0||Z.kind==="span"&&Z.text!==null||Z.kind==="region"&&Z.styleAttrs[o.byName.showBackground.qname]==="always"?{region_id:X,element:Z}:null}function w(G,le){if("contents"in G)for(var de=0;de<G.contents.length;de++){var De=G.contents[de],ce=De.styleAttrs[o.byName.ruby.qname];(De.kind!=="span"||ce!=="textContainer"&&ce!=="text")&&("contents"in De?w(De,le):(De.kind==="span"&&De.text.length!==0||De.kind==="br")&&le.push(De))}}function g(G){if(G.kind==="br")return!1;if("text"in G)return G.text.length===0;if("contents"in G){for(var le=G.contents.length;le--;)g(G.contents[le])&&G.contents.splice(le,1);return G.contents.length===0}}function h(G){this.contents=[],this.aspectRatio=G.aspectRatio,this.lang=G.lang}function r(G){for(var le in this.kind=G.kind||"region",this.lang=G.lang,G.id&&(this.id=G.id),this.styleAttrs={},G.styleAttrs)G.styleAttrs.hasOwnProperty(le)&&(this.styleAttrs[le]=G.styleAttrs[le]);"src"in G&&(this.src=G.src),"type"in G&&(this.type=G.type),"text"in G?this.text=G.text:(this.kind==="region"||"contents"in G)&&(this.contents=[]),"space"in G&&(this.space=G.space)}function H(G,le){if(G&&G.error&&G.error(le))throw le}})(me,typeof imscNames>"u"?P(977):imscNames,typeof imscStyles>"u"?P(1219):imscStyles,typeof imscUtils>"u"?P(6404):imscUtils)},7640:function(wt,me,P){me.generateISD=P(8905).generateISD,me.fromXML=P(6739).fromXML,me.renderHTML=P(1612).render},977:function(wt,me){(function(P){P.ns_tt="http://www.w3.org/ns/ttml",P.ns_tts="http://www.w3.org/ns/ttml#styling",P.ns_ttp="http://www.w3.org/ns/ttml#parameter",P.ns_xml="http://www.w3.org/XML/1998/namespace",P.ns_itts="http://www.w3.org/ns/ttml/profile/imsc1#styling",P.ns_ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter",P.ns_smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt",P.ns_ebutts="urn:ebu:tt:style"})(me)},1219:function(wt,me,P){(function(F,f,o){function p(w,g,h,r,H,G,le,de){this.name=g,this.ns=w,this.qname=w+" "+g,this.inherit=H,this.animatable=G,this.initial=h,this.applies=r,this.parse=le,this.compute=de}for(var E in F.all=[new p(f.ns_tts,"backgroundColor","transparent",["body","div","p","region","span"],!1,!0,o.parseColor,null),new p(f.ns_tts,"color","white",["span"],!0,!0,o.parseColor,null),new p(f.ns_tts,"direction","ltr",["p","span"],!0,!0,(function(w){return w}),null),new p(f.ns_tts,"display","auto",["body","div","p","region","span"],!1,!0,(function(w){return w}),null),new p(f.ns_tts,"displayAlign","before",["region"],!1,!0,(function(w){return w}),null),new p(f.ns_tts,"extent","auto",["tt","region"],!1,!0,(function(w){if(w==="auto")return w;var g=w.split(" ");if(g.length!==2)return null;var h=o.parseLength(g[0]),r=o.parseLength(g[1]);return r&&h?{h:r,w:h}:null}),(function(w,g,h,r,H){var G,le;if(r==="auto")G=new o.ComputedLength(0,1);else if((G=o.toComputedLength(r.h.value,r.h.unit,null,w.dimensions.h,null,w.pxLength.h))===null)return null;if(r==="auto")le=new o.ComputedLength(1,0);else if((le=o.toComputedLength(r.w.value,r.w.unit,null,w.dimensions.w,null,w.pxLength.w))===null)return null;return{h:G,w:le}})),new p(f.ns_tts,"fontFamily","default",["span","p"],!0,!0,(function(w){for(var g=w.split(","),h=[],r=0;r<g.length;r++)g[r]=g[r].trim(),g[r].charAt(0)!=="'"&&g[r].charAt(0)!=='"'&&g[r]==="default"?h.push("monospaceSerif"):h.push(g[r]);return h}),null),new p(f.ns_tts,"shear","0%",["p"],!0,!0,o.parseLength,(function(w,g,h,r){return r.unit!=="%"?null:Math.abs(r.value)>100?100*Math.sign(r.value):r.value})),new p(f.ns_tts,"fontSize","1c",["span","p"],!0,!0,o.parseLength,(function(w,g,h,r,H){return o.toComputedLength(r.value,r.unit,g!==null?g.styleAttrs[F.byName.fontSize.qname]:w.cellLength.h,g!==null?g.styleAttrs[F.byName.fontSize.qname]:w.cellLength.h,w.cellLength.h,w.pxLength.h)})),new p(f.ns_tts,"fontStyle","normal",["span","p"],!0,!0,(function(w){return w}),null),new p(f.ns_tts,"fontWeight","normal",["span","p"],!0,!0,(function(w){return w}),null),new p(f.ns_tts,"lineHeight","normal",["p"],!0,!0,(function(w){return w==="normal"?w:o.parseLength(w)}),(function(w,g,h,r,H){var G;if(r==="normal")G=r;else if((G=o.toComputedLength(r.value,r.unit,h.styleAttrs[F.byName.fontSize.qname],h.styleAttrs[F.byName.fontSize.qname],w.cellLength.h,w.pxLength.h))===null)return null;return G})),new p(f.ns_tts,"opacity",1,["region"],!1,!0,parseFloat,null),new p(f.ns_tts,"origin","auto",["region"],!1,!0,(function(w){if(w==="auto")return w;var g=w.split(" ");if(g.length!==2)return null;var h=o.parseLength(g[0]),r=o.parseLength(g[1]);return r&&h?{h:r,w:h}:null}),(function(w,g,h,r,H){var G,le;if(r==="auto")G=new o.ComputedLength(0,0);else if((G=o.toComputedLength(r.h.value,r.h.unit,null,w.dimensions.h,null,w.pxLength.h))===null)return null;if(r==="auto")le=new o.ComputedLength(0,0);else if((le=o.toComputedLength(r.w.value,r.w.unit,null,w.dimensions.w,null,w.pxLength.w))===null)return null;return{h:G,w:le}})),new p(f.ns_tts,"overflow","hidden",["region"],!1,!0,(function(w){return w}),null),new p(f.ns_tts,"padding","0px",["region"],!1,!0,(function(w){var g=w.split(" ");if(g.length>4)return null;for(var h=[],r=0;r<g.length;r++){var H=o.parseLength(g[r]);if(!H)return null;h.push(H)}return h}),(function(w,g,h,r,H){var G;if(r.length===1)G=[r[0],r[0],r[0],r[0]];else if(r.length===2)G=[r[0],r[1],r[0],r[1]];else if(r.length===3)G=[r[0],r[1],r[2],r[1]];else{if(r.length!==4)return null;G=[r[0],r[1],r[2],r[3]]}var le=h.styleAttrs[F.byName.writingMode.qname];if(le==="lrtb"||le==="lr")G=[G[0],G[3],G[2],G[1]];else if(le==="rltb"||le==="rl")G=[G[0],G[1],G[2],G[3]];else if(le==="tblr")G=[G[3],G[0],G[1],G[2]];else{if(le!=="tbrl"&&le!=="tb")return null;G=[G[3],G[2],G[1],G[0]]}for(var de=[],De=0;De<G.length;De++)if(G[De].value===0)de[De]=new o.ComputedLength(0,0);else if(de[De]=o.toComputedLength(G[De].value,G[De].unit,h.styleAttrs[F.byName.fontSize.qname],De===0||De===2?h.styleAttrs[F.byName.extent.qname].h:h.styleAttrs[F.byName.extent.qname].w,De===0||De===2?w.cellLength.h:w.cellLength.w,De===0||De===2?w.pxLength.h:w.pxLength.w),de[De]===null)return null;return de})),new p(f.ns_tts,"position","top left",["region"],!1,!0,(function(w){return o.parsePosition(w)}),(function(w,g,h,r){var H,G;return(H=o.toComputedLength(r.v.offset.value,r.v.offset.unit,null,new o.ComputedLength(-h.styleAttrs[F.byName.extent.qname].h.rw,w.dimensions.h.rh-h.styleAttrs[F.byName.extent.qname].h.rh),null,w.pxLength.h))===null?null:(r.v.edge==="bottom"&&(H=new o.ComputedLength(-H.rw-h.styleAttrs[F.byName.extent.qname].h.rw,w.dimensions.h.rh-H.rh-h.styleAttrs[F.byName.extent.qname].h.rh)),G=o.toComputedLength(r.h.offset.value,r.h.offset.unit,null,new o.ComputedLength(w.dimensions.w.rw-h.styleAttrs[F.byName.extent.qname].w.rw,-h.styleAttrs[F.byName.extent.qname].w.rh),null,w.pxLength.w),H===null?null:(r.h.edge==="right"&&(G=new o.ComputedLength(w.dimensions.w.rw-G.rw-h.styleAttrs[F.byName.extent.qname].w.rw,-G.rh-h.styleAttrs[F.byName.extent.qname].w.rh)),{h:H,w:G}))})),new p(f.ns_tts,"ruby","none",["span"],!1,!0,(function(w){return w}),null),new p(f.ns_tts,"rubyAlign","center",["span"],!0,!0,(function(w){return w!=="center"&&w!=="spaceAround"?null:w}),null),new p(f.ns_tts,"rubyPosition","outside",["span"],!0,!0,(function(w){return w}),null),new p(f.ns_tts,"rubyReserve","none",["p"],!0,!0,(function(w){var g=w.split(" "),h=[null,null];if(g.length===0||g.length>2||g[0]!=="none"&&g[0]!=="both"&&g[0]!=="after"&&g[0]!=="before"&&g[0]!=="outside")return null;if(h[0]=g[0],g.length===2&&g[0]!=="none"){var r=o.parseLength(g[1]);if(!r)return null;h[1]=r}return h}),(function(w,g,h,r,H){if(r[0]==="none")return r;var G;return(G=r[1]===null?new o.ComputedLength(.5*h.styleAttrs[F.byName.fontSize.qname].rw,.5*h.styleAttrs[F.byName.fontSize.qname].rh):o.toComputedLength(r[1].value,r[1].unit,h.styleAttrs[F.byName.fontSize.qname],h.styleAttrs[F.byName.fontSize.qname],w.cellLength.h,w.pxLength.h))===null?null:[r[0],G]})),new p(f.ns_tts,"showBackground","always",["region"],!1,!0,(function(w){return w}),null),new p(f.ns_tts,"textAlign","start",["p"],!0,!0,(function(w){return w}),(function(w,g,h,r,H){return r==="left"?"start":r==="right"?"end":r})),new p(f.ns_tts,"textCombine","none",["span"],!0,!0,(function(w){return w==="none"||w==="all"?w:null}),null),new p(f.ns_tts,"textDecoration","none",["span"],!0,!0,(function(w){return w.split(" ")}),null),new p(f.ns_tts,"textEmphasis","none",["span"],!0,!0,(function(w){for(var g=w.split(" "),h={style:null,symbol:null,color:null,position:null},r=0;r<g.length;r++)if(g[r]==="none"||g[r]==="auto")h.style=g[r];else if(g[r]==="filled"||g[r]==="open")h.style=g[r];else if(g[r]==="circle"||g[r]==="dot"||g[r]==="sesame")h.symbol=g[r];else if(g[r]==="current")h.color=g[r];else if(g[r]==="outside"||g[r]==="before"||g[r]==="after")h.position=g[r];else if(h.color=o.parseColor(g[r]),h.color===null)return null;return h.style==null&&h.symbol==null?h.style="auto":(h.symbol=h.symbol||"circle",h.style=h.style||"filled"),h.position=h.position||"outside",h.color=h.color||"current",h}),null),new p(f.ns_tts,"textOutline","none",["span"],!0,!0,(function(w){if(w==="none")return w;var g={},h=w.split(" ");if(h.length===0||h.length>2)return null;var r=o.parseColor(h[0]);if(g.color=r,r!==null&&h.shift(),h.length!==1)return null;var H=o.parseLength(h[0]);return H?(g.thickness=H,g):null}),(function(w,g,h,r,H){if(r==="none")return r;var G={};return r.color===null?G.color=h.styleAttrs[F.byName.color.qname]:G.color=r.color,G.thickness=o.toComputedLength(r.thickness.value,r.thickness.unit,h.styleAttrs[F.byName.fontSize.qname],h.styleAttrs[F.byName.fontSize.qname],w.cellLength.h,w.pxLength.h),G.thickness===null?null:G})),new p(f.ns_tts,"textShadow","none",["span"],!0,!0,o.parseTextShadow,(function(w,g,h,r){if(r==="none")return r;for(var H=[],G=0;G<r.length;G++){var le={};if(le.x_off=o.toComputedLength(r[G][0].value,r[G][0].unit,null,h.styleAttrs[F.byName.fontSize.qname],null,w.pxLength.w),le.x_off===null||(le.y_off=o.toComputedLength(r[G][1].value,r[G][1].unit,null,h.styleAttrs[F.byName.fontSize.qname],null,w.pxLength.h),le.y_off===null))return null;if(r[G][2]===null)le.b_radius=0;else if(le.b_radius=o.toComputedLength(r[G][2].value,r[G][2].unit,null,h.styleAttrs[F.byName.fontSize.qname],null,w.pxLength.h),le.b_radius===null)return null;r[G][3]===null?le.color=h.styleAttrs[F.byName.color.qname]:le.color=r[G][3],H.push(le)}return H})),new p(f.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,(function(w){return w}),null),new p(f.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,(function(w){return w}),null),new p(f.ns_tts,"wrapOption","wrap",["span"],!0,!0,(function(w){return w}),null),new p(f.ns_tts,"writingMode","lrtb",["region"],!1,!0,(function(w){return w}),null),new p(f.ns_tts,"zIndex","auto",["region"],!1,!0,(function(w){var g;return w==="auto"?g=w:(g=parseInt(w),isNaN(g)&&(g=null)),g}),null),new p(f.ns_ebutts,"linePadding","0c",["p"],!0,!1,o.parseLength,(function(w,g,h,r,H){return o.toComputedLength(r.value,r.unit,null,null,w.cellLength.w,null)})),new p(f.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,(function(w){return w}),null),new p(f.ns_smpte,"backgroundImage",null,["div"],!1,!1,(function(w){return w}),null),new p(f.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,(function(w){return w==="true"}),null),new p(f.ns_itts,"fillLineGap","false",["p"],!0,!0,(function(w){return w==="true"}),null)],F.byQName={},F.all)F.byQName[F.all[E].qname]=F.all[E];for(var _ in F.byName={},F.all)F.byName[F.all[_].name]=F.all[_]})(me,typeof imscNames>"u"?P(977):imscNames,typeof imscUtils>"u"?P(6404):imscUtils)},6404:function(wt,me){(function(P){var F=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,f=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,o=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,p={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]};P.parseColor=function(_){var w,g=null,h=p[_.toLowerCase()];return h!==void 0?g=h:(w=F.exec(_))!==null?g=[parseInt(w[1],16),parseInt(w[2],16),parseInt(w[3],16),w[4]!==void 0?parseInt(w[4],16):255]:(w=f.exec(_))!==null?g=[parseInt(w[1]),parseInt(w[2]),parseInt(w[3]),255]:(w=o.exec(_))!==null&&(g=[parseInt(w[1]),parseInt(w[2]),parseInt(w[3]),parseInt(w[4])]),g};var E=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/;P.parseLength=function(_){var w,g=null;return(w=E.exec(_))!==null&&(g={value:parseFloat(w[1]),unit:w[2]}),g},P.parseTextShadow=function(_){for(var w=_.match(/([^\(,\)]|\([^\)]+\))+/g),g=[],h=0;h<w.length;h++){var r=w[h].split(" ");if(r.length===1&&r[0]==="none")return"none";if(r.length>1&&r.length<5){var H=[null,null,null,null],G=P.parseLength(r.shift());if(G===null||(H[0]=G,(G=P.parseLength(r.shift()))===null))return null;if(H[1]=G,r.length===0){g.push(H);continue}if((G=P.parseLength(r[0]))!==null&&(H[2]=G,r.shift()),r.length===0){g.push(H);continue}var le=P.parseColor(r[0]);if(le===null)return null;H[3]=le,g.push(H)}}return g},P.parsePosition=function(_){var w=_.split(" "),g=function(De){return De==="center"||De==="left"||De==="top"||De==="bottom"||De==="right"};if(w.length>4)return null;for(var h=0;h<w.length;h++)if(!g(w[h])){var r=P.parseLength(w[h]);if(r===null)return null;w[h]=r}for(var H={h:{edge:"left",offset:{value:50,unit:"%"}},v:{edge:"top",offset:{value:50,unit:"%"}}},G=0;G<w.length;){var le=w[G++];if(g(le)){var de={value:0,unit:"%"};w.length!==2&&G<w.length&&!g(w[G])&&(de=w[G++]),le==="right"?(H.h.edge=le,H.h.offset=de):le==="bottom"?(H.v.edge=le,H.v.offset=de):le==="left"?H.h.offset=de:le==="top"&&(H.v.offset=de)}else{if(w.length!==1&&w.length!==2)return null;G===1?H.h.offset=le:H.v.offset=le}}return H},P.ComputedLength=function(_,w){this.rw=_,this.rh=w},P.ComputedLength.prototype.toUsedLength=function(_,w){return _*this.rw+w*this.rh},P.ComputedLength.prototype.isZero=function(){return this.rw===0&&this.rh===0},P.toComputedLength=function(_,w,g,h,r,H){return w==="%"&&h?new P.ComputedLength(h.rw*_/100,h.rh*_/100):w==="em"&&g?new P.ComputedLength(g.rw*_,g.rh*_):w==="c"&&r?new P.ComputedLength(_*r.rw,_*r.rh):w==="px"&&H?new P.ComputedLength(_*H.rw,_*H.rh):w==="rh"?new P.ComputedLength(0,_/100):w==="rw"?new P.ComputedLength(_/100,0):null}})(me)},7523:function(wt){typeof Object.create=="function"?wt.exports=function(me,P){P&&(me.super_=P,me.prototype=Object.create(P.prototype,{constructor:{value:me,enumerable:!1,writable:!0,configurable:!0}}))}:wt.exports=function(me,P){if(P){me.super_=P;var F=function(){};F.prototype=P.prototype,me.prototype=new F,me.prototype.constructor=me}}},3282:function(wt){function me(f){if(typeof f!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(f))}function P(f,o){for(var p,E="",_=0,w=-1,g=0,h=0;h<=f.length;++h){if(h<f.length)p=f.charCodeAt(h);else{if(p===47)break;p=47}if(p===47){if(!(w===h-1||g===1))if(w!==h-1&&g===2){if(E.length<2||_!==2||E.charCodeAt(E.length-1)!==46||E.charCodeAt(E.length-2)!==46){if(E.length>2){var r=E.lastIndexOf("/");if(r!==E.length-1){r===-1?(E="",_=0):_=(E=E.slice(0,r)).length-1-E.lastIndexOf("/"),w=h,g=0;continue}}else if(E.length===2||E.length===1){E="",_=0,w=h,g=0;continue}}o&&(E.length>0?E+="/..":E="..",_=2)}else E.length>0?E+="/"+f.slice(w+1,h):E=f.slice(w+1,h),_=h-w-1;w=h,g=0}else p===46&&g!==-1?++g:g=-1}return E}var F={resolve:function(){for(var f,o="",p=!1,E=arguments.length-1;E>=-1&&!p;E--){var _;E>=0?_=arguments[E]:(f===void 0&&(f=process.cwd()),_=f),me(_),_.length!==0&&(o=_+"/"+o,p=_.charCodeAt(0)===47)}return o=P(o,!p),p?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(f){if(me(f),f.length===0)return".";var o=f.charCodeAt(0)===47,p=f.charCodeAt(f.length-1)===47;return(f=P(f,!o)).length!==0||o||(f="."),f.length>0&&p&&(f+="/"),o?"/"+f:f},isAbsolute:function(f){return me(f),f.length>0&&f.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var f,o=0;o<arguments.length;++o){var p=arguments[o];me(p),p.length>0&&(f===void 0?f=p:f+="/"+p)}return f===void 0?".":F.normalize(f)},relative:function(f,o){if(me(f),me(o),f===o||(f=F.resolve(f))===(o=F.resolve(o)))return"";for(var p=1;p<f.length&&f.charCodeAt(p)===47;++p);for(var E=f.length,_=E-p,w=1;w<o.length&&o.charCodeAt(w)===47;++w);for(var g=o.length-w,h=_<g?_:g,r=-1,H=0;H<=h;++H){if(H===h){if(g>h){if(o.charCodeAt(w+H)===47)return o.slice(w+H+1);if(H===0)return o.slice(w+H)}else _>h&&(f.charCodeAt(p+H)===47?r=H:H===0&&(r=0));break}var G=f.charCodeAt(p+H);if(G!==o.charCodeAt(w+H))break;G===47&&(r=H)}var le="";for(H=p+r+1;H<=E;++H)H!==E&&f.charCodeAt(H)!==47||(le.length===0?le+="..":le+="/..");return le.length>0?le+o.slice(w+r):(w+=r,o.charCodeAt(w)===47&&++w,o.slice(w))},_makeLong:function(f){return f},dirname:function(f){if(me(f),f.length===0)return".";for(var o=f.charCodeAt(0),p=o===47,E=-1,_=!0,w=f.length-1;w>=1;--w)if((o=f.charCodeAt(w))===47){if(!_){E=w;break}}else _=!1;return E===-1?p?"/":".":p&&E===1?"//":f.slice(0,E)},basename:function(f,o){if(o!==void 0&&typeof o!="string")throw new TypeError('"ext" argument must be a string');me(f);var p,E=0,_=-1,w=!0;if(o!==void 0&&o.length>0&&o.length<=f.length){if(o.length===f.length&&o===f)return"";var g=o.length-1,h=-1;for(p=f.length-1;p>=0;--p){var r=f.charCodeAt(p);if(r===47){if(!w){E=p+1;break}}else h===-1&&(w=!1,h=p+1),g>=0&&(r===o.charCodeAt(g)?--g==-1&&(_=p):(g=-1,_=h))}return E===_?_=h:_===-1&&(_=f.length),f.slice(E,_)}for(p=f.length-1;p>=0;--p)if(f.charCodeAt(p)===47){if(!w){E=p+1;break}}else _===-1&&(w=!1,_=p+1);return _===-1?"":f.slice(E,_)},extname:function(f){me(f);for(var o=-1,p=0,E=-1,_=!0,w=0,g=f.length-1;g>=0;--g){var h=f.charCodeAt(g);if(h!==47)E===-1&&(_=!1,E=g+1),h===46?o===-1?o=g:w!==1&&(w=1):o!==-1&&(w=-1);else if(!_){p=g+1;break}}return o===-1||E===-1||w===0||w===1&&o===E-1&&o===p+1?"":f.slice(o,E)},format:function(f){if(f===null||typeof f!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof f);return(function(o,p){var E=p.dir||p.root,_=p.base||(p.name||"")+(p.ext||"");return E?E===p.root?E+_:E+"/"+_:_})(0,f)},parse:function(f){me(f);var o={root:"",dir:"",base:"",ext:"",name:""};if(f.length===0)return o;var p,E=f.charCodeAt(0),_=E===47;_?(o.root="/",p=1):p=0;for(var w=-1,g=0,h=-1,r=!0,H=f.length-1,G=0;H>=p;--H)if((E=f.charCodeAt(H))!==47)h===-1&&(r=!1,h=H+1),E===46?w===-1?w=H:G!==1&&(G=1):w!==-1&&(G=-1);else if(!r){g=H+1;break}return w===-1||h===-1||G===0||G===1&&w===h-1&&w===g+1?h!==-1&&(o.base=o.name=g===0&&_?f.slice(1,h):f.slice(g,h)):(g===0&&_?(o.name=f.slice(1,w),o.base=f.slice(1,h)):(o.name=f.slice(g,w),o.base=f.slice(g,h)),o.ext=f.slice(w,h)),g>0?o.dir=f.slice(0,g-1):_&&(o.dir="/"),o},sep:"/",delimiter:":",win32:null,posix:null};F.posix=F,wt.exports=F},3515:function(wt,me,P){wt.exports=f;var F=P(9826).EventEmitter;function f(){F.call(this)}P(7523)(f,F),f.Readable=P(2762),f.Writable=P(3726),f.Duplex=P(884),f.Transform=P(6756),f.PassThrough=P(1390),f.finished=P(2896),f.pipeline=P(8460),f.Stream=f,f.prototype.pipe=function(o,p){var E=this;function _(le){o.writable&&o.write(le)===!1&&E.pause&&E.pause()}function w(){E.readable&&E.resume&&E.resume()}E.on("data",_),o.on("drain",w),o._isStdio||p&&p.end===!1||(E.on("end",h),E.on("close",r));var g=!1;function h(){g||(g=!0,o.end())}function r(){g||(g=!0,typeof o.destroy=="function"&&o.destroy())}function H(le){if(G(),F.listenerCount(this,"error")===0)throw le}function G(){E.removeListener("data",_),o.removeListener("drain",w),E.removeListener("end",h),E.removeListener("close",r),E.removeListener("error",H),o.removeListener("error",H),E.removeListener("end",G),E.removeListener("close",G),o.removeListener("close",G)}return E.on("error",H),o.on("error",H),E.on("end",G),E.on("close",G),o.on("close",G),o.emit("pipe",E),o}},1602:function(wt){var me={};function P(f,o,p){p||(p=Error);var E=(function(_){var w,g;function h(r,H,G){return _.call(this,(function(le,de,De){return typeof o=="string"?o:o(le,de,De)})(r,H,G))||this}return g=_,(w=h).prototype=Object.create(g.prototype),w.prototype.constructor=w,w.__proto__=g,h})(p);E.prototype.name=p.name,E.prototype.code=f,me[f]=E}function F(f,o){if(Array.isArray(f)){var p=f.length;return f=f.map((function(E){return String(E)})),p>2?"one of ".concat(o," ").concat(f.slice(0,p-1).join(", "),", or ")+f[p-1]:p===2?"one of ".concat(o," ").concat(f[0]," or ").concat(f[1]):"of ".concat(o," ").concat(f[0])}return"of ".concat(o," ").concat(String(f))}P("ERR_INVALID_OPT_VALUE",(function(f,o){return'The value "'+o+'" is invalid for option "'+f+'"'}),TypeError),P("ERR_INVALID_ARG_TYPE",(function(f,o,p){var E,_,w,g,h;if(typeof o=="string"&&(_="not ",o.substr(0,4)===_)?(E="must not be",o=o.replace(/^not /,"")):E="must be",(function(H,G,le){return(le===void 0||le>H.length)&&(le=H.length),H.substring(le-9,le)===G})(f," argument"))w="The ".concat(f," ").concat(E," ").concat(F(o,"type"));else{var r=(typeof h!="number"&&(h=0),h+1>(g=f).length||g.indexOf(".",h)===-1?"argument":"property");w='The "'.concat(f,'" ').concat(r," ").concat(E," ").concat(F(o,"type"))}return w+". Received type ".concat(typeof p)}),TypeError),P("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),P("ERR_METHOD_NOT_IMPLEMENTED",(function(f){return"The "+f+" method is not implemented"})),P("ERR_STREAM_PREMATURE_CLOSE","Premature close"),P("ERR_STREAM_DESTROYED",(function(f){return"Cannot call "+f+" after a stream was destroyed"})),P("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),P("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),P("ERR_STREAM_WRITE_AFTER_END","write after end"),P("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),P("ERR_UNKNOWN_ENCODING",(function(f){return"Unknown encoding: "+f}),TypeError),P("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),wt.exports.codes=me},884:function(wt,me,P){var F=Object.keys||function(r){var H=[];for(var G in r)H.push(G);return H};wt.exports=w;var f=P(2762),o=P(3726);P(7523)(w,f);for(var p=F(o.prototype),E=0;E<p.length;E++){var _=p[E];w.prototype[_]||(w.prototype[_]=o.prototype[_])}function w(r){if(!(this instanceof w))return new w(r);f.call(this,r),o.call(this,r),this.allowHalfOpen=!0,r&&(r.readable===!1&&(this.readable=!1),r.writable===!1&&(this.writable=!1),r.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",g)))}function g(){this._writableState.ended||process.nextTick(h,this)}function h(r){r.end()}Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(w.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(w.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(r){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=r,this._writableState.destroyed=r)}})},1390:function(wt,me,P){wt.exports=f;var F=P(6756);function f(o){if(!(this instanceof f))return new f(o);F.call(this,o)}P(7523)(f,F),f.prototype._transform=function(o,p,E){E(null,o)}},2762:function(wt,me,P){var F;wt.exports=Z,Z.ReadableState=X,P(9826).EventEmitter;var f,o=function(Oe,Ie){return Oe.listeners(Ie).length},p=P(2611),E=P(44).Buffer,_=(P.g!==void 0?P.g:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},w=P(7199);f=w&&w.debuglog?w.debuglog("stream"):function(){};var g,h,r,H=P(3791),G=P(2410),le=P(1749).getHighWaterMark,de=P(1602).codes,De=de.ERR_INVALID_ARG_TYPE,ce=de.ERR_STREAM_PUSH_AFTER_EOF,Le=de.ERR_METHOD_NOT_IMPLEMENTED,Be=de.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;P(7523)(Z,p);var ot=G.errorOrDestroy,Ge=["error","close","destroy","pause","resume"];function X(Oe,Ie,mt){F=F||P(884),Oe=Oe||{},typeof mt!="boolean"&&(mt=Ie instanceof F),this.objectMode=!!Oe.objectMode,mt&&(this.objectMode=this.objectMode||!!Oe.readableObjectMode),this.highWaterMark=le(this,Oe,"readableHighWaterMark",mt),this.buffer=new H,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=Oe.emitClose!==!1,this.autoDestroy=!!Oe.autoDestroy,this.destroyed=!1,this.defaultEncoding=Oe.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,Oe.encoding&&(g||(g=P(748).StringDecoder),this.decoder=new g(Oe.encoding),this.encoding=Oe.encoding)}function Z(Oe){if(F=F||P(884),!(this instanceof Z))return new Z(Oe);var Ie=this instanceof F;this._readableState=new X(Oe,this,Ie),this.readable=!0,Oe&&(typeof Oe.read=="function"&&(this._read=Oe.read),typeof Oe.destroy=="function"&&(this._destroy=Oe.destroy)),p.call(this)}function Se(Oe,Ie,mt,It,Ye){f("readableAddChunk",Ie);var V,B=Oe._readableState;if(Ie===null)B.reading=!1,(function(Pe,j){if(f("onEofChunk"),!j.ended){if(j.decoder){var qe=j.decoder.end();qe&&qe.length&&(j.buffer.push(qe),j.length+=j.objectMode?1:qe.length)}j.ended=!0,j.sync?ye(Pe):(j.needReadable=!1,j.emittedReadable||(j.emittedReadable=!0,pt(Pe)))}})(Oe,B);else if(Ye||(V=(function(Pe,j){var qe,it;return it=j,E.isBuffer(it)||it instanceof _||typeof j=="string"||j===void 0||Pe.objectMode||(qe=new De("chunk",["string","Buffer","Uint8Array"],j)),qe})(B,Ie)),V)ot(Oe,V);else if(B.objectMode||Ie&&Ie.length>0)if(typeof Ie=="string"||B.objectMode||Object.getPrototypeOf(Ie)===E.prototype||(Ie=(function(Pe){return E.from(Pe)})(Ie)),It)B.endEmitted?ot(Oe,new Be):Ne(Oe,B,Ie,!0);else if(B.ended)ot(Oe,new ce);else{if(B.destroyed)return!1;B.reading=!1,B.decoder&&!mt?(Ie=B.decoder.write(Ie),B.objectMode||Ie.length!==0?Ne(Oe,B,Ie,!1):He(Oe,B)):Ne(Oe,B,Ie,!1)}else It||(B.reading=!1,He(Oe,B));return!B.ended&&(B.length<B.highWaterMark||B.length===0)}function Ne(Oe,Ie,mt,It){Ie.flowing&&Ie.length===0&&!Ie.sync?(Ie.awaitDrain=0,Oe.emit("data",mt)):(Ie.length+=Ie.objectMode?1:mt.length,It?Ie.buffer.unshift(mt):Ie.buffer.push(mt),Ie.needReadable&&ye(Oe)),He(Oe,Ie)}Object.defineProperty(Z.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(Oe){this._readableState&&(this._readableState.destroyed=Oe)}}),Z.prototype.destroy=G.destroy,Z.prototype._undestroy=G.undestroy,Z.prototype._destroy=function(Oe,Ie){Ie(Oe)},Z.prototype.push=function(Oe,Ie){var mt,It=this._readableState;return It.objectMode?mt=!0:typeof Oe=="string"&&((Ie=Ie||It.defaultEncoding)!==It.encoding&&(Oe=E.from(Oe,Ie),Ie=""),mt=!0),Se(this,Oe,Ie,!1,mt)},Z.prototype.unshift=function(Oe){return Se(this,Oe,null,!0,!1)},Z.prototype.isPaused=function(){return this._readableState.flowing===!1},Z.prototype.setEncoding=function(Oe){g||(g=P(748).StringDecoder);var Ie=new g(Oe);this._readableState.decoder=Ie,this._readableState.encoding=this._readableState.decoder.encoding;for(var mt=this._readableState.buffer.head,It="";mt!==null;)It+=Ie.write(mt.data),mt=mt.next;return this._readableState.buffer.clear(),It!==""&&this._readableState.buffer.push(It),this._readableState.length=It.length,this};var ke=1073741824;function ht(Oe,Ie){return Oe<=0||Ie.length===0&&Ie.ended?0:Ie.objectMode?1:Oe!=Oe?Ie.flowing&&Ie.length?Ie.buffer.head.data.length:Ie.length:(Oe>Ie.highWaterMark&&(Ie.highWaterMark=(function(mt){return mt>=ke?mt=ke:(mt--,mt|=mt>>>1,mt|=mt>>>2,mt|=mt>>>4,mt|=mt>>>8,mt|=mt>>>16,mt++),mt})(Oe)),Oe<=Ie.length?Oe:Ie.ended?Ie.length:(Ie.needReadable=!0,0))}function ye(Oe){var Ie=Oe._readableState;f("emitReadable",Ie.needReadable,Ie.emittedReadable),Ie.needReadable=!1,Ie.emittedReadable||(f("emitReadable",Ie.flowing),Ie.emittedReadable=!0,process.nextTick(pt,Oe))}function pt(Oe){var Ie=Oe._readableState;f("emitReadable_",Ie.destroyed,Ie.length,Ie.ended),Ie.destroyed||!Ie.length&&!Ie.ended||(Oe.emit("readable"),Ie.emittedReadable=!1),Ie.needReadable=!Ie.flowing&&!Ie.ended&&Ie.length<=Ie.highWaterMark,kt(Oe)}function He(Oe,Ie){Ie.readingMore||(Ie.readingMore=!0,process.nextTick(Fe,Oe,Ie))}function Fe(Oe,Ie){for(;!Ie.reading&&!Ie.ended&&(Ie.length<Ie.highWaterMark||Ie.flowing&&Ie.length===0);){var mt=Ie.length;if(f("maybeReadMore read 0"),Oe.read(0),mt===Ie.length)break}Ie.readingMore=!1}function Ke(Oe){var Ie=Oe._readableState;Ie.readableListening=Oe.listenerCount("readable")>0,Ie.resumeScheduled&&!Ie.paused?Ie.flowing=!0:Oe.listenerCount("data")>0&&Oe.resume()}function Pt(Oe){f("readable nexttick read 0"),Oe.read(0)}function Nt(Oe,Ie){f("resume",Ie.reading),Ie.reading||Oe.read(0),Ie.resumeScheduled=!1,Oe.emit("resume"),kt(Oe),Ie.flowing&&!Ie.reading&&Oe.read(0)}function kt(Oe){var Ie=Oe._readableState;for(f("flow",Ie.flowing);Ie.flowing&&Oe.read()!==null;);}function Ut(Oe,Ie){return Ie.length===0?null:(Ie.objectMode?mt=Ie.buffer.shift():!Oe||Oe>=Ie.length?(mt=Ie.decoder?Ie.buffer.join(""):Ie.buffer.length===1?Ie.buffer.first():Ie.buffer.concat(Ie.length),Ie.buffer.clear()):mt=Ie.buffer.consume(Oe,Ie.decoder),mt);var mt}function ln(Oe){var Ie=Oe._readableState;f("endReadable",Ie.endEmitted),Ie.endEmitted||(Ie.ended=!0,process.nextTick(an,Ie,Oe))}function an(Oe,Ie){if(f("endReadableNT",Oe.endEmitted,Oe.length),!Oe.endEmitted&&Oe.length===0&&(Oe.endEmitted=!0,Ie.readable=!1,Ie.emit("end"),Oe.autoDestroy)){var mt=Ie._writableState;(!mt||mt.autoDestroy&&mt.finished)&&Ie.destroy()}}function En(Oe,Ie){for(var mt=0,It=Oe.length;mt<It;mt++)if(Oe[mt]===Ie)return mt;return-1}Z.prototype.read=function(Oe){f("read",Oe),Oe=parseInt(Oe,10);var Ie=this._readableState,mt=Oe;if(Oe!==0&&(Ie.emittedReadable=!1),Oe===0&&Ie.needReadable&&((Ie.highWaterMark!==0?Ie.length>=Ie.highWaterMark:Ie.length>0)||Ie.ended))return f("read: emitReadable",Ie.length,Ie.ended),Ie.length===0&&Ie.ended?ln(this):ye(this),null;if((Oe=ht(Oe,Ie))===0&&Ie.ended)return Ie.length===0&&ln(this),null;var It,Ye=Ie.needReadable;return f("need readable",Ye),(Ie.length===0||Ie.length-Oe<Ie.highWaterMark)&&f("length less than watermark",Ye=!0),Ie.ended||Ie.reading?f("reading or ended",Ye=!1):Ye&&(f("do read"),Ie.reading=!0,Ie.sync=!0,Ie.length===0&&(Ie.needReadable=!0),this._read(Ie.highWaterMark),Ie.sync=!1,Ie.reading||(Oe=ht(mt,Ie))),(It=Oe>0?Ut(Oe,Ie):null)===null?(Ie.needReadable=Ie.length<=Ie.highWaterMark,Oe=0):(Ie.length-=Oe,Ie.awaitDrain=0),Ie.length===0&&(Ie.ended||(Ie.needReadable=!0),mt!==Oe&&Ie.ended&&ln(this)),It!==null&&this.emit("data",It),It},Z.prototype._read=function(Oe){ot(this,new Le("_read()"))},Z.prototype.pipe=function(Oe,Ie){var mt=this,It=this._readableState;switch(It.pipesCount){case 0:It.pipes=Oe;break;case 1:It.pipes=[It.pipes,Oe];break;default:It.pipes.push(Oe)}It.pipesCount+=1,f("pipe count=%d opts=%j",It.pipesCount,Ie);var Ye=Ie&&Ie.end===!1||Oe===process.stdout||Oe===process.stderr?Ue:V;function V(){f("onend"),Oe.end()}It.endEmitted?process.nextTick(Ye):mt.once("end",Ye),Oe.on("unpipe",(function i(S,I){f("onunpipe"),S===mt&&I&&I.hasUnpiped===!1&&(I.hasUnpiped=!0,f("cleanup"),Oe.removeListener("close",it),Oe.removeListener("finish",_e),Oe.removeListener("drain",B),Oe.removeListener("error",qe),Oe.removeListener("unpipe",i),mt.removeListener("end",V),mt.removeListener("end",Ue),mt.removeListener("data",j),Pe=!0,!It.awaitDrain||Oe._writableState&&!Oe._writableState.needDrain||B())}));var B=(function(i){return function(){var S=i._readableState;f("pipeOnDrain",S.awaitDrain),S.awaitDrain&&S.awaitDrain--,S.awaitDrain===0&&o(i,"data")&&(S.flowing=!0,kt(i))}})(mt);Oe.on("drain",B);var Pe=!1;function j(i){f("ondata");var S=Oe.write(i);f("dest.write",S),S===!1&&((It.pipesCount===1&&It.pipes===Oe||It.pipesCount>1&&En(It.pipes,Oe)!==-1)&&!Pe&&(f("false write response, pause",It.awaitDrain),It.awaitDrain++),mt.pause())}function qe(i){f("onerror",i),Ue(),Oe.removeListener("error",qe),o(Oe,"error")===0&&ot(Oe,i)}function it(){Oe.removeListener("finish",_e),Ue()}function _e(){f("onfinish"),Oe.removeListener("close",it),Ue()}function Ue(){f("unpipe"),mt.unpipe(Oe)}return mt.on("data",j),(function(i,S,I){if(typeof i.prependListener=="function")return i.prependListener(S,I);i._events&&i._events[S]?Array.isArray(i._events[S])?i._events[S].unshift(I):i._events[S]=[I,i._events[S]]:i.on(S,I)})(Oe,"error",qe),Oe.once("close",it),Oe.once("finish",_e),Oe.emit("pipe",mt),It.flowing||(f("pipe resume"),mt.resume()),Oe},Z.prototype.unpipe=function(Oe){var Ie=this._readableState,mt={hasUnpiped:!1};if(Ie.pipesCount===0)return this;if(Ie.pipesCount===1)return Oe&&Oe!==Ie.pipes||(Oe||(Oe=Ie.pipes),Ie.pipes=null,Ie.pipesCount=0,Ie.flowing=!1,Oe&&Oe.emit("unpipe",this,mt)),this;if(!Oe){var It=Ie.pipes,Ye=Ie.pipesCount;Ie.pipes=null,Ie.pipesCount=0,Ie.flowing=!1;for(var V=0;V<Ye;V++)It[V].emit("unpipe",this,{hasUnpiped:!1});return this}var B=En(Ie.pipes,Oe);return B===-1||(Ie.pipes.splice(B,1),Ie.pipesCount-=1,Ie.pipesCount===1&&(Ie.pipes=Ie.pipes[0]),Oe.emit("unpipe",this,mt)),this},Z.prototype.on=function(Oe,Ie){var mt=p.prototype.on.call(this,Oe,Ie),It=this._readableState;return Oe==="data"?(It.readableListening=this.listenerCount("readable")>0,It.flowing!==!1&&this.resume()):Oe==="readable"&&(It.endEmitted||It.readableListening||(It.readableListening=It.needReadable=!0,It.flowing=!1,It.emittedReadable=!1,f("on readable",It.length,It.reading),It.length?ye(this):It.reading||process.nextTick(Pt,this))),mt},Z.prototype.addListener=Z.prototype.on,Z.prototype.removeListener=function(Oe,Ie){var mt=p.prototype.removeListener.call(this,Oe,Ie);return Oe==="readable"&&process.nextTick(Ke,this),mt},Z.prototype.removeAllListeners=function(Oe){var Ie=p.prototype.removeAllListeners.apply(this,arguments);return Oe!=="readable"&&Oe!==void 0||process.nextTick(Ke,this),Ie},Z.prototype.resume=function(){var Oe=this._readableState;return Oe.flowing||(f("resume"),Oe.flowing=!Oe.readableListening,(function(Ie,mt){mt.resumeScheduled||(mt.resumeScheduled=!0,process.nextTick(Nt,Ie,mt))})(this,Oe)),Oe.paused=!1,this},Z.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},Z.prototype.wrap=function(Oe){var Ie=this,mt=this._readableState,It=!1;for(var Ye in Oe.on("end",(function(){if(f("wrapped end"),mt.decoder&&!mt.ended){var B=mt.decoder.end();B&&B.length&&Ie.push(B)}Ie.push(null)})),Oe.on("data",(function(B){f("wrapped data"),mt.decoder&&(B=mt.decoder.write(B)),mt.objectMode&&B==null||(mt.objectMode||B&&B.length)&&(Ie.push(B)||(It=!0,Oe.pause()))})),Oe)this[Ye]===void 0&&typeof Oe[Ye]=="function"&&(this[Ye]=(function(B){return function(){return Oe[B].apply(Oe,arguments)}})(Ye));for(var V=0;V<Ge.length;V++)Oe.on(Ge[V],this.emit.bind(this,Ge[V]));return this._read=function(B){f("wrapped _read",B),It&&(It=!1,Oe.resume())},this},typeof Symbol=="function"&&(Z.prototype[Symbol.asyncIterator]=function(){return h===void 0&&(h=P(5857)),h(this)}),Object.defineProperty(Z.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(Z.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(Z.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(Oe){this._readableState&&(this._readableState.flowing=Oe)}}),Z._fromList=Ut,Object.defineProperty(Z.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),typeof Symbol=="function"&&(Z.from=function(Oe,Ie){return r===void 0&&(r=P(3411)),r(Z,Oe,Ie)})},6756:function(wt,me,P){wt.exports=g;var F=P(1602).codes,f=F.ERR_METHOD_NOT_IMPLEMENTED,o=F.ERR_MULTIPLE_CALLBACK,p=F.ERR_TRANSFORM_ALREADY_TRANSFORMING,E=F.ERR_TRANSFORM_WITH_LENGTH_0,_=P(884);function w(H,G){var le=this._transformState;le.transforming=!1;var de=le.writecb;if(de===null)return this.emit("error",new o);le.writechunk=null,le.writecb=null,G!=null&&this.push(G),de(H);var De=this._readableState;De.reading=!1,(De.needReadable||De.length<De.highWaterMark)&&this._read(De.highWaterMark)}function g(H){if(!(this instanceof g))return new g(H);_.call(this,H),this._transformState={afterTransform:w.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,H&&(typeof H.transform=="function"&&(this._transform=H.transform),typeof H.flush=="function"&&(this._flush=H.flush)),this.on("prefinish",h)}function h(){var H=this;typeof this._flush!="function"||this._readableState.destroyed?r(this,null,null):this._flush((function(G,le){r(H,G,le)}))}function r(H,G,le){if(G)return H.emit("error",G);if(le!=null&&H.push(le),H._writableState.length)throw new E;if(H._transformState.transforming)throw new p;return H.push(null)}P(7523)(g,_),g.prototype.push=function(H,G){return this._transformState.needTransform=!1,_.prototype.push.call(this,H,G)},g.prototype._transform=function(H,G,le){le(new f("_transform()"))},g.prototype._write=function(H,G,le){var de=this._transformState;if(de.writecb=le,de.writechunk=H,de.writeencoding=G,!de.transforming){var De=this._readableState;(de.needTransform||De.needReadable||De.length<De.highWaterMark)&&this._read(De.highWaterMark)}},g.prototype._read=function(H){var G=this._transformState;G.writechunk===null||G.transforming?G.needTransform=!0:(G.transforming=!0,this._transform(G.writechunk,G.writeencoding,G.afterTransform))},g.prototype._destroy=function(H,G){_.prototype._destroy.call(this,H,(function(le){G(le)}))}},3726:function(wt,me,P){function F(He){var Fe=this;this.next=null,this.entry=null,this.finish=function(){(function(Ke,Pt){var Nt=Ke.entry;for(Ke.entry=null;Nt;){var kt=Nt.callback;Pt.pendingcb--,kt(void 0),Nt=Nt.next}Pt.corkedRequestsFree.next=Ke})(Fe,He)}}var f;wt.exports=Z,Z.WritableState=X;var o,p={deprecate:P(9e3)},E=P(2611),_=P(44).Buffer,w=(P.g!==void 0?P.g:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},g=P(2410),h=P(1749).getHighWaterMark,r=P(1602).codes,H=r.ERR_INVALID_ARG_TYPE,G=r.ERR_METHOD_NOT_IMPLEMENTED,le=r.ERR_MULTIPLE_CALLBACK,de=r.ERR_STREAM_CANNOT_PIPE,De=r.ERR_STREAM_DESTROYED,ce=r.ERR_STREAM_NULL_VALUES,Le=r.ERR_STREAM_WRITE_AFTER_END,Be=r.ERR_UNKNOWN_ENCODING,ot=g.errorOrDestroy;function Ge(){}function X(He,Fe,Ke){f=f||P(884),He=He||{},typeof Ke!="boolean"&&(Ke=Fe instanceof f),this.objectMode=!!He.objectMode,Ke&&(this.objectMode=this.objectMode||!!He.writableObjectMode),this.highWaterMark=h(this,He,"writableHighWaterMark",Ke),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Pt=He.decodeStrings===!1;this.decodeStrings=!Pt,this.defaultEncoding=He.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Nt){(function(kt,Ut){var ln=kt._writableState,an=ln.sync,En=ln.writecb;if(typeof En!="function")throw new le;if((function(Ie){Ie.writing=!1,Ie.writecb=null,Ie.length-=Ie.writelen,Ie.writelen=0})(ln),Ut)(function(Ie,mt,It,Ye,V){--mt.pendingcb,It?(process.nextTick(V,Ye),process.nextTick(pt,Ie,mt),Ie._writableState.errorEmitted=!0,ot(Ie,Ye)):(V(Ye),Ie._writableState.errorEmitted=!0,ot(Ie,Ye),pt(Ie,mt))})(kt,ln,an,Ut,En);else{var Oe=ht(ln)||kt.destroyed;Oe||ln.corked||ln.bufferProcessing||!ln.bufferedRequest||ke(kt,ln),an?process.nextTick(Ne,kt,ln,Oe,En):Ne(kt,ln,Oe,En)}})(Fe,Nt)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=He.emitClose!==!1,this.autoDestroy=!!He.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new F(this)}function Z(He){var Fe=this instanceof(f=f||P(884));if(!Fe&&!o.call(Z,this))return new Z(He);this._writableState=new X(He,this,Fe),this.writable=!0,He&&(typeof He.write=="function"&&(this._write=He.write),typeof He.writev=="function"&&(this._writev=He.writev),typeof He.destroy=="function"&&(this._destroy=He.destroy),typeof He.final=="function"&&(this._final=He.final)),E.call(this)}function Se(He,Fe,Ke,Pt,Nt,kt,Ut){Fe.writelen=Pt,Fe.writecb=Ut,Fe.writing=!0,Fe.sync=!0,Fe.destroyed?Fe.onwrite(new De("write")):Ke?He._writev(Nt,Fe.onwrite):He._write(Nt,kt,Fe.onwrite),Fe.sync=!1}function Ne(He,Fe,Ke,Pt){Ke||(function(Nt,kt){kt.length===0&&kt.needDrain&&(kt.needDrain=!1,Nt.emit("drain"))})(He,Fe),Fe.pendingcb--,Pt(),pt(He,Fe)}function ke(He,Fe){Fe.bufferProcessing=!0;var Ke=Fe.bufferedRequest;if(He._writev&&Ke&&Ke.next){var Pt=Fe.bufferedRequestCount,Nt=new Array(Pt),kt=Fe.corkedRequestsFree;kt.entry=Ke;for(var Ut=0,ln=!0;Ke;)Nt[Ut]=Ke,Ke.isBuf||(ln=!1),Ke=Ke.next,Ut+=1;Nt.allBuffers=ln,Se(He,Fe,!0,Fe.length,Nt,"",kt.finish),Fe.pendingcb++,Fe.lastBufferedRequest=null,kt.next?(Fe.corkedRequestsFree=kt.next,kt.next=null):Fe.corkedRequestsFree=new F(Fe),Fe.bufferedRequestCount=0}else{for(;Ke;){var an=Ke.chunk,En=Ke.encoding,Oe=Ke.callback;if(Se(He,Fe,!1,Fe.objectMode?1:an.length,an,En,Oe),Ke=Ke.next,Fe.bufferedRequestCount--,Fe.writing)break}Ke===null&&(Fe.lastBufferedRequest=null)}Fe.bufferedRequest=Ke,Fe.bufferProcessing=!1}function ht(He){return He.ending&&He.length===0&&He.bufferedRequest===null&&!He.finished&&!He.writing}function ye(He,Fe){He._final((function(Ke){Fe.pendingcb--,Ke&&ot(He,Ke),Fe.prefinished=!0,He.emit("prefinish"),pt(He,Fe)}))}function pt(He,Fe){var Ke=ht(Fe);if(Ke&&((function(Nt,kt){kt.prefinished||kt.finalCalled||(typeof Nt._final!="function"||kt.destroyed?(kt.prefinished=!0,Nt.emit("prefinish")):(kt.pendingcb++,kt.finalCalled=!0,process.nextTick(ye,Nt,kt)))})(He,Fe),Fe.pendingcb===0&&(Fe.finished=!0,He.emit("finish"),Fe.autoDestroy))){var Pt=He._readableState;(!Pt||Pt.autoDestroy&&Pt.endEmitted)&&He.destroy()}return Ke}P(7523)(Z,E),X.prototype.getBuffer=function(){for(var He=this.bufferedRequest,Fe=[];He;)Fe.push(He),He=He.next;return Fe},(function(){try{Object.defineProperty(X.prototype,"buffer",{get:p.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(Z,Symbol.hasInstance,{value:function(He){return!!o.call(this,He)||this===Z&&He&&He._writableState instanceof X}})):o=function(He){return He instanceof this},Z.prototype.pipe=function(){ot(this,new de)},Z.prototype.write=function(He,Fe,Ke){var Pt,Nt=this._writableState,kt=!1,Ut=!Nt.objectMode&&(Pt=He,_.isBuffer(Pt)||Pt instanceof w);return Ut&&!_.isBuffer(He)&&(He=(function(ln){return _.from(ln)})(He)),typeof Fe=="function"&&(Ke=Fe,Fe=null),Ut?Fe="buffer":Fe||(Fe=Nt.defaultEncoding),typeof Ke!="function"&&(Ke=Ge),Nt.ending?(function(ln,an){var En=new Le;ot(ln,En),process.nextTick(an,En)})(this,Ke):(Ut||(function(ln,an,En,Oe){var Ie;return En===null?Ie=new ce:typeof En=="string"||an.objectMode||(Ie=new H("chunk",["string","Buffer"],En)),!Ie||(ot(ln,Ie),process.nextTick(Oe,Ie),!1)})(this,Nt,He,Ke))&&(Nt.pendingcb++,kt=(function(ln,an,En,Oe,Ie,mt){if(!En){var It=(function(Pe,j,qe){return Pe.objectMode||Pe.decodeStrings===!1||typeof j!="string"||(j=_.from(j,qe)),j})(an,Oe,Ie);Oe!==It&&(En=!0,Ie="buffer",Oe=It)}var Ye=an.objectMode?1:Oe.length;an.length+=Ye;var V=an.length<an.highWaterMark;if(V||(an.needDrain=!0),an.writing||an.corked){var B=an.lastBufferedRequest;an.lastBufferedRequest={chunk:Oe,encoding:Ie,isBuf:En,callback:mt,next:null},B?B.next=an.lastBufferedRequest:an.bufferedRequest=an.lastBufferedRequest,an.bufferedRequestCount+=1}else Se(ln,an,!1,Ye,Oe,Ie,mt);return V})(this,Nt,Ut,He,Fe,Ke)),kt},Z.prototype.cork=function(){this._writableState.corked++},Z.prototype.uncork=function(){var He=this._writableState;He.corked&&(He.corked--,He.writing||He.corked||He.bufferProcessing||!He.bufferedRequest||ke(this,He))},Z.prototype.setDefaultEncoding=function(He){if(typeof He=="string"&&(He=He.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((He+"").toLowerCase())>-1))throw new Be(He);return this._writableState.defaultEncoding=He,this},Object.defineProperty(Z.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(Z.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Z.prototype._write=function(He,Fe,Ke){Ke(new G("_write()"))},Z.prototype._writev=null,Z.prototype.end=function(He,Fe,Ke){var Pt=this._writableState;return typeof He=="function"?(Ke=He,He=null,Fe=null):typeof Fe=="function"&&(Ke=Fe,Fe=null),He!=null&&this.write(He,Fe),Pt.corked&&(Pt.corked=1,this.uncork()),Pt.ending||(function(Nt,kt,Ut){kt.ending=!0,pt(Nt,kt),Ut&&(kt.finished?process.nextTick(Ut):Nt.once("finish",Ut)),kt.ended=!0,Nt.writable=!1})(this,Pt,Ke),this},Object.defineProperty(Z.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(Z.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(He){this._writableState&&(this._writableState.destroyed=He)}}),Z.prototype.destroy=g.destroy,Z.prototype._undestroy=g.undestroy,Z.prototype._destroy=function(He,Fe){Fe(He)}},5857:function(wt,me,P){var F;function f(ce,Le,Be){return(Le=(function(ot){var Ge=(function(X){if(typeof X!="object"||X===null)return X;var Z=X[Symbol.toPrimitive];if(Z!==void 0){var Se=Z.call(X,"string");if(typeof Se!="object")return Se;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(X)})(ot);return typeof Ge=="symbol"?Ge:String(Ge)})(Le))in ce?Object.defineProperty(ce,Le,{value:Be,enumerable:!0,configurable:!0,writable:!0}):ce[Le]=Be,ce}var o=P(2896),p=Symbol("lastResolve"),E=Symbol("lastReject"),_=Symbol("error"),w=Symbol("ended"),g=Symbol("lastPromise"),h=Symbol("handlePromise"),r=Symbol("stream");function H(ce,Le){return{value:ce,done:Le}}function G(ce){var Le=ce[p];if(Le!==null){var Be=ce[r].read();Be!==null&&(ce[g]=null,ce[p]=null,ce[E]=null,Le(H(Be,!1)))}}function le(ce){process.nextTick(G,ce)}var de=Object.getPrototypeOf((function(){})),De=Object.setPrototypeOf((f(F={get stream(){return this[r]},next:function(){var ce=this,Le=this[_];if(Le!==null)return Promise.reject(Le);if(this[w])return Promise.resolve(H(void 0,!0));if(this[r].destroyed)return new Promise((function(X,Z){process.nextTick((function(){ce[_]?Z(ce[_]):X(H(void 0,!0))}))}));var Be,ot=this[g];if(ot)Be=new Promise((function(X,Z){return function(Se,Ne){X.then((function(){Z[w]?Se(H(void 0,!0)):Z[h](Se,Ne)}),Ne)}})(ot,this));else{var Ge=this[r].read();if(Ge!==null)return Promise.resolve(H(Ge,!1));Be=new Promise(this[h])}return this[g]=Be,Be}},Symbol.asyncIterator,(function(){return this})),f(F,"return",(function(){var ce=this;return new Promise((function(Le,Be){ce[r].destroy(null,(function(ot){ot?Be(ot):Le(H(void 0,!0))}))}))})),F),de);wt.exports=function(ce){var Le,Be=Object.create(De,(f(Le={},r,{value:ce,writable:!0}),f(Le,p,{value:null,writable:!0}),f(Le,E,{value:null,writable:!0}),f(Le,_,{value:null,writable:!0}),f(Le,w,{value:ce._readableState.endEmitted,writable:!0}),f(Le,h,{value:function(ot,Ge){var X=Be[r].read();X?(Be[g]=null,Be[p]=null,Be[E]=null,ot(H(X,!1))):(Be[p]=ot,Be[E]=Ge)},writable:!0}),Le));return Be[g]=null,o(ce,(function(ot){if(ot&&ot.code!=="ERR_STREAM_PREMATURE_CLOSE"){var Ge=Be[E];return Ge!==null&&(Be[g]=null,Be[p]=null,Be[E]=null,Ge(ot)),void(Be[_]=ot)}var X=Be[p];X!==null&&(Be[g]=null,Be[p]=null,Be[E]=null,X(H(void 0,!0))),Be[w]=!0})),ce.on("readable",le.bind(null,Be)),Be}},3791:function(wt,me,P){function F(h,r){var H=Object.keys(h);if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols(h);r&&(G=G.filter((function(le){return Object.getOwnPropertyDescriptor(h,le).enumerable}))),H.push.apply(H,G)}return H}function f(h){for(var r=1;r<arguments.length;r++){var H=arguments[r]!=null?arguments[r]:{};r%2?F(Object(H),!0).forEach((function(G){o(h,G,H[G])})):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(H)):F(Object(H)).forEach((function(G){Object.defineProperty(h,G,Object.getOwnPropertyDescriptor(H,G))}))}return h}function o(h,r,H){return(r=E(r))in h?Object.defineProperty(h,r,{value:H,enumerable:!0,configurable:!0,writable:!0}):h[r]=H,h}function p(h,r){for(var H=0;H<r.length;H++){var G=r[H];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(h,E(G.key),G)}}function E(h){var r=(function(H){if(typeof H!="object"||H===null)return H;var G=H[Symbol.toPrimitive];if(G!==void 0){var le=G.call(H,"string");if(typeof le!="object")return le;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(H)})(h);return typeof r=="symbol"?r:String(r)}var _=P(44).Buffer,w=P(3779).inspect,g=w&&w.custom||"inspect";wt.exports=(function(){function h(){(function(G,le){if(!(G instanceof le))throw new TypeError("Cannot call a class as a function")})(this,h),this.head=null,this.tail=null,this.length=0}var r,H;return r=h,(H=[{key:"push",value:function(G){var le={data:G,next:null};this.length>0?this.tail.next=le:this.head=le,this.tail=le,++this.length}},{key:"unshift",value:function(G){var le={data:G,next:this.head};this.length===0&&(this.tail=le),this.head=le,++this.length}},{key:"shift",value:function(){if(this.length!==0){var G=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,G}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(G){if(this.length===0)return"";for(var le=this.head,de=""+le.data;le=le.next;)de+=G+le.data;return de}},{key:"concat",value:function(G){if(this.length===0)return _.alloc(0);for(var le,de,De,ce=_.allocUnsafe(G>>>0),Le=this.head,Be=0;Le;)le=Le.data,de=ce,De=Be,_.prototype.copy.call(le,de,De),Be+=Le.data.length,Le=Le.next;return ce}},{key:"consume",value:function(G,le){var de;return G<this.head.data.length?(de=this.head.data.slice(0,G),this.head.data=this.head.data.slice(G)):de=G===this.head.data.length?this.shift():le?this._getString(G):this._getBuffer(G),de}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(G){var le=this.head,de=1,De=le.data;for(G-=De.length;le=le.next;){var ce=le.data,Le=G>ce.length?ce.length:G;if(Le===ce.length?De+=ce:De+=ce.slice(0,G),(G-=Le)==0){Le===ce.length?(++de,le.next?this.head=le.next:this.head=this.tail=null):(this.head=le,le.data=ce.slice(Le));break}++de}return this.length-=de,De}},{key:"_getBuffer",value:function(G){var le=_.allocUnsafe(G),de=this.head,De=1;for(de.data.copy(le),G-=de.data.length;de=de.next;){var ce=de.data,Le=G>ce.length?ce.length:G;if(ce.copy(le,le.length-G,0,Le),(G-=Le)==0){Le===ce.length?(++De,de.next?this.head=de.next:this.head=this.tail=null):(this.head=de,de.data=ce.slice(Le));break}++De}return this.length-=De,le}},{key:g,value:function(G,le){return w(this,f(f({},le),{},{depth:0,customInspect:!1}))}}])&&p(r.prototype,H),Object.defineProperty(r,"prototype",{writable:!1}),h})()},2410:function(wt){function me(f,o){F(f,o),P(f)}function P(f){f._writableState&&!f._writableState.emitClose||f._readableState&&!f._readableState.emitClose||f.emit("close")}function F(f,o){f.emit("error",o)}wt.exports={destroy:function(f,o){var p=this,E=this._readableState&&this._readableState.destroyed,_=this._writableState&&this._writableState.destroyed;return E||_?(o?o(f):f&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(F,this,f)):process.nextTick(F,this,f)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(f||null,(function(w){!o&&w?p._writableState?p._writableState.errorEmitted?process.nextTick(P,p):(p._writableState.errorEmitted=!0,process.nextTick(me,p,w)):process.nextTick(me,p,w):o?(process.nextTick(P,p),o(w)):process.nextTick(P,p)})),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(f,o){var p=f._readableState,E=f._writableState;p&&p.autoDestroy||E&&E.autoDestroy?f.destroy(o):f.emit("error",o)}}},2896:function(wt,me,P){var F=P(1602).codes.ERR_STREAM_PREMATURE_CLOSE;function f(){}wt.exports=function o(p,E,_){if(typeof E=="function")return o(p,null,E);E||(E={}),_=(function(Le){var Be=!1;return function(){if(!Be){Be=!0;for(var ot=arguments.length,Ge=new Array(ot),X=0;X<ot;X++)Ge[X]=arguments[X];Le.apply(this,Ge)}}})(_||f);var w=E.readable||E.readable!==!1&&p.readable,g=E.writable||E.writable!==!1&&p.writable,h=function(){p.writable||H()},r=p._writableState&&p._writableState.finished,H=function(){g=!1,r=!0,w||_.call(p)},G=p._readableState&&p._readableState.endEmitted,le=function(){w=!1,G=!0,g||_.call(p)},de=function(Le){_.call(p,Le)},De=function(){var Le;return w&&!G?(p._readableState&&p._readableState.ended||(Le=new F),_.call(p,Le)):g&&!r?(p._writableState&&p._writableState.ended||(Le=new F),_.call(p,Le)):void 0},ce=function(){p.req.on("finish",H)};return(function(Le){return Le.setHeader&&typeof Le.abort=="function"})(p)?(p.on("complete",H),p.on("abort",De),p.req?ce():p.on("request",ce)):g&&!p._writableState&&(p.on("end",h),p.on("close",h)),p.on("end",le),p.on("finish",H),E.error!==!1&&p.on("error",de),p.on("close",De),function(){p.removeListener("complete",H),p.removeListener("abort",De),p.removeListener("request",ce),p.req&&p.req.removeListener("finish",H),p.removeListener("end",h),p.removeListener("close",h),p.removeListener("finish",H),p.removeListener("end",le),p.removeListener("error",de),p.removeListener("close",De)}}},3411:function(wt){wt.exports=function(){throw new Error("Readable.from is not available in the browser")}},8460:function(wt,me,P){var F,f=P(1602).codes,o=f.ERR_MISSING_ARGS,p=f.ERR_STREAM_DESTROYED;function E(g){if(g)throw g}function _(g){g()}function w(g,h){return g.pipe(h)}wt.exports=function(){for(var g=arguments.length,h=new Array(g),r=0;r<g;r++)h[r]=arguments[r];var H,G=(function(de){return de.length?typeof de[de.length-1]!="function"?E:de.pop():E})(h);if(Array.isArray(h[0])&&(h=h[0]),h.length<2)throw new o("streams");var le=h.map((function(de,De){var ce=De<h.length-1;return(function(Le,Be,ot,Ge){Ge=(function(Se){var Ne=!1;return function(){Ne||(Ne=!0,Se.apply(void 0,arguments))}})(Ge);var X=!1;Le.on("close",(function(){X=!0})),F===void 0&&(F=P(2896)),F(Le,{readable:Be,writable:ot},(function(Se){if(Se)return Ge(Se);X=!0,Ge()}));var Z=!1;return function(Se){if(!X&&!Z)return Z=!0,(function(Ne){return Ne.setHeader&&typeof Ne.abort=="function"})(Le)?Le.abort():typeof Le.destroy=="function"?Le.destroy():void Ge(Se||new p("pipe"))}})(de,ce,De>0,(function(Le){H||(H=Le),Le&&le.forEach(_),ce||(le.forEach(_),G(H))}))}));return h.reduce(w)}},1749:function(wt,me,P){var F=P(1602).codes.ERR_INVALID_OPT_VALUE;wt.exports={getHighWaterMark:function(f,o,p,E){var _=(function(w,g,h){return w.highWaterMark!=null?w.highWaterMark:g?w[h]:null})(o,E,p);if(_!=null){if(!isFinite(_)||Math.floor(_)!==_||_<0)throw new F(E?p:"highWaterMark",_);return Math.floor(_)}return f.objectMode?16:16384}}},2611:function(wt,me,P){wt.exports=P(9826).EventEmitter},748:function(wt,me,P){var F=P(4598).Buffer,f=F.isEncoding||function(G){switch((G=""+G)&&G.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 o(G){var le;switch(this.encoding=(function(de){var De=(function(ce){if(!ce)return"utf8";for(var Le;;)switch(ce){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 ce;default:if(Le)return;ce=(""+ce).toLowerCase(),Le=!0}})(de);if(typeof De!="string"&&(F.isEncoding===f||!f(de)))throw new Error("Unknown encoding: "+de);return De||de})(G),this.encoding){case"utf16le":this.text=_,this.end=w,le=4;break;case"utf8":this.fillLast=E,le=4;break;case"base64":this.text=g,this.end=h,le=3;break;default:return this.write=r,void(this.end=H)}this.lastNeed=0,this.lastTotal=0,this.lastChar=F.allocUnsafe(le)}function p(G){return G<=127?0:G>>5==6?2:G>>4==14?3:G>>3==30?4:G>>6==2?-1:-2}function E(G){var le=this.lastTotal-this.lastNeed,de=(function(De,ce){if((192&ce[0])!=128)return De.lastNeed=0,"�";if(De.lastNeed>1&&ce.length>1){if((192&ce[1])!=128)return De.lastNeed=1,"�";if(De.lastNeed>2&&ce.length>2&&(192&ce[2])!=128)return De.lastNeed=2,"�"}})(this,G);return de!==void 0?de:this.lastNeed<=G.length?(G.copy(this.lastChar,le,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(G.copy(this.lastChar,le,0,G.length),void(this.lastNeed-=G.length))}function _(G,le){if((G.length-le)%2==0){var de=G.toString("utf16le",le);if(de){var De=de.charCodeAt(de.length-1);if(De>=55296&&De<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=G[G.length-2],this.lastChar[1]=G[G.length-1],de.slice(0,-1)}return de}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=G[G.length-1],G.toString("utf16le",le,G.length-1)}function w(G){var le=G&&G.length?this.write(G):"";if(this.lastNeed){var de=this.lastTotal-this.lastNeed;return le+this.lastChar.toString("utf16le",0,de)}return le}function g(G,le){var de=(G.length-le)%3;return de===0?G.toString("base64",le):(this.lastNeed=3-de,this.lastTotal=3,de===1?this.lastChar[0]=G[G.length-1]:(this.lastChar[0]=G[G.length-2],this.lastChar[1]=G[G.length-1]),G.toString("base64",le,G.length-de))}function h(G){var le=G&&G.length?this.write(G):"";return this.lastNeed?le+this.lastChar.toString("base64",0,3-this.lastNeed):le}function r(G){return G.toString(this.encoding)}function H(G){return G&&G.length?this.write(G):""}me.StringDecoder=o,o.prototype.write=function(G){if(G.length===0)return"";var le,de;if(this.lastNeed){if((le=this.fillLast(G))===void 0)return"";de=this.lastNeed,this.lastNeed=0}else de=0;return de<G.length?le?le+this.text(G,de):this.text(G,de):le||""},o.prototype.end=function(G){var le=G&&G.length?this.write(G):"";return this.lastNeed?le+"�":le},o.prototype.text=function(G,le){var de=(function(ce,Le,Be){var ot=Le.length-1;if(ot<Be)return 0;var Ge=p(Le[ot]);return Ge>=0?(Ge>0&&(ce.lastNeed=Ge-1),Ge):--ot<Be||Ge===-2?0:(Ge=p(Le[ot]))>=0?(Ge>0&&(ce.lastNeed=Ge-2),Ge):--ot<Be||Ge===-2?0:(Ge=p(Le[ot]))>=0?(Ge>0&&(Ge===2?Ge=0:ce.lastNeed=Ge-3),Ge):0})(this,G,le);if(!this.lastNeed)return G.toString("utf8",le);this.lastTotal=de;var De=G.length-(de-this.lastNeed);return G.copy(this.lastChar,0,De),G.toString("utf8",le,De)},o.prototype.fillLast=function(G){if(this.lastNeed<=G.length)return G.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);G.copy(this.lastChar,this.lastTotal-this.lastNeed,0,G.length),this.lastNeed-=G.length}},4598:function(wt,me,P){var F=P(44),f=F.Buffer;function o(E,_){for(var w in E)_[w]=E[w]}function p(E,_,w){return f(E,_,w)}f.from&&f.alloc&&f.allocUnsafe&&f.allocUnsafeSlow?wt.exports=F:(o(F,me),me.Buffer=p),o(f,p),p.from=function(E,_,w){if(typeof E=="number")throw new TypeError("Argument must not be a number");return f(E,_,w)},p.alloc=function(E,_,w){if(typeof E!="number")throw new TypeError("Argument must be a number");var g=f(E);return _!==void 0?typeof w=="string"?g.fill(_,w):g.fill(_):g.fill(0),g},p.allocUnsafe=function(E){if(typeof E!="number")throw new TypeError("Argument must be a number");return f(E)},p.allocUnsafeSlow=function(E){if(typeof E!="number")throw new TypeError("Argument must be a number");return F.SlowBuffer(E)}},9e3:function(wt,me,P){function F(f){try{if(!P.g.localStorage)return!1}catch{return!1}var o=P.g.localStorage[f];return o!=null&&String(o).toLowerCase()==="true"}wt.exports=function(f,o){if(F("noDeprecation"))return f;var p=!1;return function(){if(!p){if(F("throwDeprecation"))throw new Error(o);F("traceDeprecation")?console.trace(o):console.warn(o),p=!0}return f.apply(this,arguments)}}},3779:function(){},7199:function(){},5393:function(wt,me,P){P.r(me),P.d(me,{Debug:function(){return o.default},FactoryMaker:function(){return f.default},MediaPlayer:function(){return F.default}});var F=P(9839),f=P(138),o=P(649),p=P(8986),E=typeof window<"u"&&window||typeof globalThis<"u"&&globalThis||{},_=E.dashjs;_||(_=E.dashjs={}),_.MediaPlayer=F.default,_.FactoryMaker=f.default,_.Debug=o.default,_.Version=(0,p.getVersionString)(),me.default=_},8735:function(wt,me,P){P.r(me),P.d(me,{CMCD_DEFAULT_TIME_INTERVAL:function(){return In},CMCD_EVENT_AD_BREAK_END:function(){return Ne},CMCD_EVENT_AD_BREAK_START:function(){return Se},CMCD_EVENT_AD_END:function(){return Z},CMCD_EVENT_AD_START:function(){return X},CMCD_EVENT_BACKGROUNDED_MODE:function(){return De},CMCD_EVENT_BITRATE_CHANGE:function(){return r},CMCD_EVENT_CONTENT_ID:function(){return de},CMCD_EVENT_CUSTOM_EVENT:function(){return ht},CMCD_EVENT_ERROR:function(){return G},CMCD_EVENT_KEYS:function(){return Ke},CMCD_EVENT_MODE:function(){return pt},CMCD_EVENT_MUTE:function(){return ce},CMCD_EVENT_PLAYER_COLLAPSE:function(){return ot},CMCD_EVENT_PLAYER_EXPAND:function(){return Be},CMCD_EVENT_PLAY_STATE:function(){return H},CMCD_EVENT_RESPONSE_RECEIVED:function(){return Ge},CMCD_EVENT_SKIP:function(){return ke},CMCD_EVENT_TIME_INTERVAL:function(){return le},CMCD_EVENT_UNMUTE:function(){return Le},CMCD_FORMATTER_MAP:function(){return g},CMCD_HEADERS:function(){return Ft},CMCD_HEADER_FIELDS:function(){return be},CMCD_HEADER_MAP:function(){return tt},CMCD_JSON:function(){return Rt},CMCD_KEYS:function(){return Vt},CMCD_MIME_TYPE:function(){return _n},CMCD_OBJECT:function(){return i},CMCD_PARAM:function(){return he},CMCD_QUERY:function(){return xt},CMCD_REQUEST:function(){return S},CMCD_REQUEST_KEYS:function(){return Pt},CMCD_REQUEST_MODE:function(){return He},CMCD_RESPONSE_KEYS:function(){return an},CMCD_SESSION:function(){return I},CMCD_STATUS:function(){return $},CMCD_V1:function(){return gn},CMCD_V1_KEYS:function(){return Ye},CMCD_V2:function(){return h},CMCD_VALIDATION_SEVERITY_ERROR:function(){return ft},CMCD_VALIDATION_SEVERITY_WARNING:function(){return Qt},CmcdEventType:function(){return ye},CmcdHeaderField:function(){return ie},CmcdObjectType:function(){return Jn},CmcdPlayerState:function(){return Pn},CmcdReporter:function(){return tn},CmcdReportingMode:function(){return Fe},CmcdStreamType:function(){return Bt},CmcdStreamingFormat:function(){return rn},CmcdTransmissionMode:function(){return fe},CmcdValidationSeverity:function(){return Fn},appendCmcdHeaders:function(){return Y},appendCmcdQuery:function(){return Zt},decodeCmcd:function(){return mn},encodeCmcd:function(){return at},fromCmcdHeaders:function(){return un},fromCmcdQuery:function(){return yn},fromCmcdUrl:function(){return hn},groupCmcdHeaders:function(){return ae},isCmcdCustomKey:function(){return kt},isCmcdEventKey:function(){return mt},isCmcdRequestKey:function(){return ln},isCmcdResponseReceivedKey:function(){return Oe},isCmcdV1Data:function(){return Ct},isCmcdV1Key:function(){return B},isCmcdV2Data:function(){return dt},prepareCmcdData:function(){return Ue},toCmcdHeaders:function(){return je},toCmcdQuery:function(){return st},toCmcdUrl:function(){return Tt},toCmcdValue:function(){return Wt},validateCmcd:function(){return br},validateCmcdEventReport:function(){return vt},validateCmcdEvents:function(){return Gr},validateCmcdHeaders:function(){return nn},validateCmcdKeys:function(){return er},validateCmcdRequest:function(){return Sn},validateCmcdStructure:function(){return Qn},validateCmcdValues:function(){return Cr}});var F=P(2877),f=P(9259);const o=Re=>Re instanceof F.SfItem?new F.SfItem(Math.round(Re.value),Re.params):Math.round(Re),p=Re=>Array.isArray(Re)?Re.map(o):o(Re),E=(Re,ut)=>Array.isArray(Re)?Re.map((yt=>E(yt,ut))):Re instanceof F.SfItem&&typeof Re.value=="string"?new F.SfItem(E(Re.value,ut),Re.params):(ut.baseUrl&&(Re=(0,f.urlToRelativePath)(Re,(0,f.getBaseUrl)(ut.baseUrl))),ut.version===1?encodeURIComponent(Re):Re),_=Re=>Re instanceof F.SfItem?new F.SfItem(100*Math.round(Re.value/100),Re.params):100*Math.round(Re/100),w=Re=>Array.isArray(Re)?Re.map(_):_(Re),g={br:p,d:p,bl:w,dl:w,mtp:w,nor:(Re,ut)=>{let yt=Re;return ut.version>=2&&(Re instanceof F.SfItem&&typeof Re.value=="string"?yt=new F.SfItem([Re]):typeof Re=="string"&&(yt=[Re])),E(yt,ut)},rtp:w,tb:p},h=2,r="bc",H="ps",G="e",le="t",de="c",De="b",ce="m",Le="um",Be="pe",ot="pc",Ge="rr",X="as",Z="ae",Se="abs",Ne="abe",ke="sk",ht="ce",ye={BITRATE_CHANGE:r,PLAY_STATE:H,ERROR:G,TIME_INTERVAL:le,CONTENT_ID:de,BACKGROUNDED_MODE:De,MUTE:ce,UNMUTE:Le,PLAYER_EXPAND:Be,PLAYER_COLLAPSE:ot,RESPONSE_RECEIVED:Ge,AD_START:X,AD_END:Z,AD_BREAK_START:Se,AD_BREAK_END:Ne,SKIP:ke,CUSTOM_EVENT:ht},pt="event",He="request",Fe={REQUEST:He,EVENT:pt},Ke=["cen","e","h","ts"],Pt=["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"],Nt=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function kt(Re){return Nt.test(Re)}const Ut=new Set(Pt);function ln(Re){return Ut.has(Re)||kt(Re)}const an=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"],En=new Set(an);function Oe(Re){return En.has(Re)}const Ie=new Set(Ke);function mt(Re){return ln(Re)||Oe(Re)||Ie.has(Re)}const It=new Set(["ab","bl","br","bsa","bsd","bsda","lab","lb","mtp","pb","tab","tb","tbl","tpb"]),Ye=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"],V=new Set(Ye);function B(Re){return V.has(Re)||kt(Re)}const Pe=new Set(["ot","sf","st","e","sta"]);function j(Re){return Pe.has(Re)}function qe(Re){return typeof Re=="number"?Number.isFinite(Re):Re!=null&&Re!==""&&Re!==!1}const it={[pt]:mt,[He]:ln};function _e(Re,ut){if(Array.isArray(Re)){let yt;return ut&&(yt=Re.find((At=>At.params?.ot===ut))),yt||(yt=Re[0]),_e(yt)}return Re instanceof F.SfItem?Re.value:Re}function Ue(Re,ut={}){const yt={};if(Re==null||typeof Re!="object")return yt;const At=ut.version||Re.v||h,ct=ut.reportingMode||He,Ot=At===1?(function($n){const nr={};for(const[ur,or]of Object.entries($n))if(or!=null)if(ur==="nor"){const lr=(Array.isArray(or)?or:[or])[0];lr instanceof F.SfItem?(nr.nor=lr.value,lr.params?.r&&(nr.nrr=lr.params.r)):nr.nor=lr}else It.has(ur)?nr[ur]=_e(or,$n.ot):nr[ur]=or;else nr[ur]=or;return nr})(Re):Re,dn=At===1?B:it[ct];let Tn=Object.keys(Ot).filter(dn);Ot.e&&Ot.e!==Ge&&(Tn=Tn.filter(($n=>!Oe($n))));const Yn=ut.filter;typeof Yn=="function"&&(Tn=Tn.filter(Yn));const Gn=ct===pt;if(Gn){const $n=Ot.e;Tn.includes("e")||$n==null||Tn.push("e"),Tn.includes("ts")||Tn.push("ts"),Tn.includes("cen")||Ot.cen==null||$n!==ht||Tn.push("cen")}if(Tn.length===0)return yt;At>1&&!Tn.includes("v")&&Tn.push("v");const sr={version:At,reportingMode:ct,baseUrl:ut.baseUrl};Tn.sort();for(const $n of Tn){let nr=Ot[$n];const ur=ut.formatters?.[$n]??g[$n];if(typeof ur=="function"&&(nr=ur(nr,sr)),$n==="v"){if(At===1)continue;nr=At}$n==="pr"&&nr===1||(Gn&&$n==="ts"&&!Number.isFinite(nr)&&(nr=Date.now()),qe(nr)&&(j($n)&&typeof nr=="string"&&(nr=new F.SfToken(nr)),yt[$n]=nr))}return yt}const i="CMCD-Object",S="CMCD-Request",I="CMCD-Session",$="CMCD-Status",ie={OBJECT:i,REQUEST:S,SESSION:I,STATUS:$},be=[i,S,I,$],tt={ab:i,br:i,d:i,lab:i,lb:i,ot:i,tab:i,tb:i,tpb:i,bl:S,cs:S,dfa:S,dl:S,ltc:S,mtp:S,nor:S,nrr:S,pb:S,sn:S,sta:S,su:S,tbl:S,cid:I,msd:I,sf:I,sid:I,st:I,v:I,bg:$,bs:$,bsa:$,bsd:$,bsda:$,cdn:$,ec:$,nr:$,pr:$,pt:$,rtp:$};function ae(Re,ut){const yt={};if(!Re)return yt;const At=Object.keys(Re),ct=ut?(Ot=ut,Object.keys(Ot).reduce(((dn,Tn)=>(Ot[Tn]?.forEach((Yn=>dn[Yn]=Tn)),dn)),{})):{};var Ot;for(const dn of At){const Tn=tt[dn]||ct[dn]||ie.REQUEST;(yt[Tn]??={})[dn]=Re[dn]}return yt}function ze(Re,ut){const yt={},At=ae(Re,ut);for(const[ct,Ot]of Object.entries(At)){const dn=(0,F.encodeSfDict)(Ot,{whitespace:!1});dn&&(yt[ct]=dn)}return yt}function je(Re,ut={}){return Re?ze(Ue(Re,ut),ut?.customHeaderMap):{}}function Y(Re,ut,yt){return Object.assign(Re,je(ut,yt))}const he="CMCD";function et(Re){return(0,F.encodeSfDict)(Re,{whitespace:!1})}function at(Re,ut={}){return Re?et(Ue(Re,ut)):""}function Tt(Re,ut={}){if(!Re)return"";const yt=at(Re,ut);return encodeURIComponent(yt)}function st(Re,ut={}){return Re?`${he}=${Tt(Re,ut)}`:""}const _t=/CMCD=[^&#]+/;function Zt(Re,ut,yt){const At=st(ut,yt);return At?_t.test(Re)?Re.replace(_t,At):`${Re}${Re.includes("?")?"&":"?"}${At}`:Re}const In=30,Vt=[...Ye,...Pt,...an,...Ke].filter(((Re,ut,yt)=>yt.indexOf(Re)===ut)),_n="application/cmcd",gn=1,Jn={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},Pn={STARTING:"s",PLAYING:"p",SEEKING:"k",REBUFFERING:"r",PAUSED:"a",WAITING:"w",ENDED:"e",FATAL_ERROR:"f",QUIT:"q",PRELOADING:"d"},xt="query",Ft="headers",Rt="json",fe={JSON:Rt,QUERY:xt,HEADERS:Ft};function Ht(Re,ut,yt){const At=new Set(ut.enabledKeys??[]);return{version:ut.version||h,reportingMode:Re,filter:ct=>At.has(ct),baseUrl:yt}}function zt(Re){const{url:ut,...yt}=Re;return fetch(ut,yt)}var tn=class{constructor(Re,ut=zt){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(yt){const{version:At=h,eventTargets:ct=[],sid:Ot=(0,f.uuid)(),transmissionMode:dn=xt,...Tn}=yt;return{...Tn,version:At,transmissionMode:dn,sid:Ot,eventTargets:ct.reduce(((Yn,Gn)=>(Gn?.url&&Gn.events?.length&&Yn.push({version:Gn.version||h,enabledKeys:Gn.enabledKeys?.slice()||[],url:Gn.url,events:Gn.events.slice(),interval:Gn.interval??In,batchSize:Gn.batchSize||1}),Yn)),[])}})(Re),this.data={cid:this.config.cid,sid:this.config.sid,v:this.config.version},this.requester=ut;for(const yt of this.config.eventTargets)this.eventTargets.set(yt,{intervalId:void 0,sn:0,msdSent:!1,queue:[]})}start(){this.eventTargets.forEach(((Re,ut)=>{if(this.disarmInterval(Re),ut.interval===0||!ut.events.includes(ye.TIME_INTERVAL))return;const yt=()=>{this.recordTargetEvent(Re,ut,le),this.processEventTargets()};Re.intervalId=setInterval(yt,1e3*ut.interval),yt()}))}stop(Re=!1){Re&&this.flush(),this.eventTargets.forEach((ut=>{this.disarmInterval(ut)}))}flush(){this.processEventTargets(!0)}update(Re){Re.sid&&Re.sid!==this.data.sid&&this.resetSession(),Re.msd&&!isNaN(Re.msd)&&(this.msd=Re.msd),this.data={...this.data,...Re,msd:void 0}}recordEvent(Re,ut={}){this.eventTargets.forEach(((yt,At)=>{this.recordTargetEvent(yt,At,Re,ut)})),this.processEventTargets()}recordTargetEvent(Re,ut,yt,At={}){if(!ut.events.includes(yt))return;const ct={...this.data,...At,e:yt,ts:At.ts??Date.now(),sn:Re.sn++};isNaN(this.msd)||Re.msdSent||(ct.msd=this.msd,Re.msdSent=!0),Re.queue.push(ct)}recordResponseReceived(Re,ut={}){const{request:yt}=Re,At=ut.url??yt?.url;if(!At)return;const ct=new URL(At);ct.searchParams.delete(he);const Ot={url:ct.toString(),rc:Re.status},dn=Re.resourceTiming;dn&&(dn.startTime!=null&&(Ot.ts=Math.round(this.timeOrigin+dn.startTime),dn.responseStart!=null&&(Ot.ttfb=Math.round(dn.responseStart-dn.startTime))),dn.duration!=null&&(Ot.ttlb=Math.round(dn.duration)));const Tn=yt.customData?.cmcd??{};this.recordEvent(Ge,{...Tn,...Ot,...ut})}applyRequestReport(Re){return this.createRequestReport(Re)??Re}isRequestReportingEnabled(){return!!this.config.enabledKeys?.length}createRequestReport(Re,ut){const{customData:yt={},headers:At={},...ct}=Re,Ot={...ct,headers:{...At},customData:{...yt,cmcd:{}}};if(!this.config.enabledKeys?.length||!Ot.url)return Ot;const dn=new URL(Ot.url),Tn={...this.data,...ut,sn:this.requestTarget.sn++},Yn=Ht(He,this.config,Ot.url);isNaN(this.msd)||this.requestTarget.msdSent||(Tn.msd=this.msd,this.requestTarget.msdSent=!0);const Gn=Ot.customData.cmcd=Ue(Tn,Yn);switch(this.config.transmissionMode){case xt:const sr=et(Gn);sr&&(dn.searchParams.set(he,sr),Ot.url=dn.toString());break;case Ft:Object.assign(Ot.headers,ze(Gn,Yn.customHeaderMap))}return Ot}processEventTargets(Re=!1){let ut=!1;this.eventTargets.forEach(((yt,At)=>{const{queue:ct}=yt;if(!ct.length||ct.length<At.batchSize&&!Re)return;const Ot=Re?ct.length:At.batchSize,dn=ct.splice(0,Ot);this.sendEventReport(At,dn).catch((()=>{yt.queue.unshift(...dn)})),ut||=ct.length>0})),ut&&this.processEventTargets()}async sendEventReport(Re,ut){const yt=Ht(pt,Re),{status:At}=await this.requester({url:Re.url,method:"POST",headers:{"Content-Type":_n},body:ut.map((ct=>at(ct,yt))).join(`
`)+`
`});if(At===410)this.disposeEventTarget(Re);else if(At===429||At>499&&At<600)throw new Error(`Event report failed with status ${At}`)}disarmInterval(Re){clearInterval(Re.intervalId),Re.intervalId=void 0}disposeEventTarget(Re){const ut=this.eventTargets.get(Re);ut&&(this.disarmInterval(ut),this.eventTargets.delete(Re))}resetSession(){this.eventTargets.forEach((Re=>Re.sn=0)),this.requestTarget.sn=0}};const rn={DASH:"d",HLS:"h",SMOOTH:"s",OTHER:"o"},Bt={VOD:"v",LIVE:"l",LOW_LATENCY:"ll"},ft="error",Qt="warning",Fn={ERROR:ft,WARNING:Qt};function vn(Re){if(Re.v===h)return Re;const ut={};for(const[yt,At]of Object.entries(Re))At!=null?It.has(yt)&&!Array.isArray(At)?ut[yt]=[At]:ut[yt]=yt==="nor"&&typeof At=="string"?[At]:At:ut[yt]=At;return ut}function en(Re){return Array.isArray(Re)?Re.map(en):typeof Re=="symbol"?(0,F.symbolToStr)(Re):Re instanceof F.SfItem&&!Re.params?en(Re.value):Re}function mn(Re,ut){if(!Re)return{};const yt=(0,F.decodeSfDict)(Re),At={};for(const[ct,Ot]of Object.entries(yt))At[ct]=en(Ot.value);return ut?.convertToLatest?vn(At):At}function On(Re){return Re instanceof Headers?Re:new Headers(Re)}function un(Re,ut){const yt=On(Re),At={};for(const ct of be){const Ot=yt.get(ct);Ot&&Object.assign(At,mn(Ot))}return ut?.convertToLatest?vn(At):At}function yn(Re,ut){return typeof Re=="string"&&(Re=new URLSearchParams(Re)),mn(Re.get(he)??"",ut)}function hn(Re,ut){return mn(decodeURIComponent(Re.replace(/^CMCD=/,"")),ut)}function Ct(Re){return Re.v!==h}function dt(Re){return Re.v===h}function Wt(Re,ut){return new F.SfItem(Re,ut)}function $t(...Re){const ut=Re.flatMap((yt=>yt.issues));return{valid:ut.every((yt=>yt.severity!==ft)),issues:ut}}function Cn(Re,ut){if(ut?.version===1||ut?.version===2)return ut.version;const yt=Re.v;return yt===1||yt===2?yt:gn}const An=new Set(Ye),Wn=new Set(Vt);function er(Re,ut){const yt=Cn(Re,ut),At=yt===gn?An:Wn,ct=[];for(const Ot of Object.keys(Re))kt(Ot)||At.has(Ot)||ct.push({key:Ot,message:`Unknown CMCD key "${Ot}" for version ${yt}.`,severity:ft});return{valid:ct.length===0,issues:ct}}function Qn(Re,ut){const yt=Cn(Re,ut),At=[];if(ut?.reportingMode===He){for(const ct of Ke)ct in Re&&At.push({key:ct,message:`Event key "${ct}" must not be present in request mode.`,severity:ft});for(const ct of an)ct in Re&&At.push({key:ct,message:`Response key "${ct}" must not be present in request mode.`,severity:ft})}if(ut?.reportingMode===pt&&("e"in Re||At.push({key:"e",message:'Event mode requires the "e" key to be present.',severity:ft}),"ts"in Re||At.push({key:"ts",message:'Event mode requires the "ts" key to be present.',severity:ft})),"e"in Re){if(Re.e===ht?"cen"in Re||At.push({key:"cen",message:'Custom event (e="ce") requires the "cen" key to be present.',severity:ft}):"cen"in Re&&At.push({key:"cen",message:'The "cen" key must only be present when e="ce".',severity:ft}),Re.e===Ge)"url"in Re||At.push({key:"url",message:'Response received event (e="rr") requires the "url" key to be present.',severity:ft});else for(const ct of an)ct in Re&&At.push({key:ct,message:`Response key "${ct}" must only be present when e="rr".`,severity:ft});Re.e!==H||"sta"in Re||At.push({key:"sta",message:'Play state event (e="ps") requires the "sta" key to be present.',severity:ft}),Re.e!==G||"ec"in Re||At.push({key:"ec",message:'Error event (e="e") requires the "ec" key to be present.',severity:ft})}return"v"in Re&&Re.v!==1&&Re.v!==2?At.push({key:"v",message:`Unsupported CMCD version "${String(Re.v)}". Expected 1 or 2.`,severity:ft}):yt>1&&!("v"in Re)?At.push({key:"v",message:'Version 2 payloads require the "v" key to be present.',severity:ft}):yt===gn&&"v"in Re&&At.push({key:"v",message:'Version 1 payloads should omit the "v" key (v1 is the default).',severity:Qt}),{valid:At.every((ct=>ct.severity!==ft)),issues:At}}const qn="number[]",tr="string[]",Zn="integer",ar="number",dr="boolean",Xn="string",gr="token",hr={ab:qn,bl:qn,br:qn,bsa:qn,bsd:qn,bsda:qn,lab:qn,lb:qn,mtp:qn,pb:qn,tab:qn,tb:qn,tbl:qn,tpb:qn,ec:tr,nor:tr,d:Zn,dfa:Zn,dl:Zn,ltc:Zn,msd:Zn,pt:Zn,rc:Zn,rtp:Zn,sn:Zn,ts:Zn,ttfb:Zn,ttfbb:Zn,ttlb:Zn,v:Zn,pr:ar,bg:dr,bs:dr,nr:dr,su:dr,cdn:Xn,cen:Xn,cid:Xn,cmsdd:Xn,cmsds:Xn,cs:Xn,h:Xn,nrr:Xn,sid:Xn,smrt:Xn,url:Xn,e:gr,ot:gr,sf:gr,st:gr,sta:gr},kr={bl:Zn,br:ar,mtp:Zn,tb:ar,nor:Xn},Pr={sid:64,cid:128,cdn:128,h:128,cen:64},qr=64,Qr={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"]},mr=new Set(["bl","dl","mtp","rtp","tbl"]),Xr=new Set(["br","d","tb"]);function Nr(Re){return typeof Re=="number"&&Number.isFinite(Re)}function Kr(Re,ut,yt){if(Array.isArray(ut))for(let At=0;At<ut.length;At++){const ct=ut[At];ct instanceof F.SfItem?Nr(ct.value)||yt.push({key:Re,message:`Key "${Re}" array element [${At}] must be a finite number.`,severity:ft}):Nr(ct)||yt.push({key:Re,message:`Key "${Re}" array element [${At}] must be a finite number.`,severity:ft})}else yt.push({key:Re,message:`Key "${Re}" must be an array.`,severity:ft})}function Zr(Re,ut,yt){if(Array.isArray(ut))for(let At=0;At<ut.length;At++){const ct=ut[At];ct instanceof F.SfItem?typeof ct.value!="string"&&yt.push({key:Re,message:`Key "${Re}" array element [${At}] must be a string.`,severity:ft}):typeof ct!="string"&&yt.push({key:Re,message:`Key "${Re}" array element [${At}] must be a string.`,severity:ft})}else yt.push({key:Re,message:`Key "${Re}" must be an array.`,severity:ft})}function Cr(Re,ut){const yt=Cn(Re,ut),At=[];for(const[ct,Ot]of Object.entries(Re)){if(kt(ct)){typeof Ot!="string"?At.push({key:ct,message:`Custom key "${ct}" value must be a string or token.`,severity:ft}):Ot.length>qr&&At.push({key:ct,message:`Custom key "${ct}" value exceeds maximum length of ${qr}.`,severity:ft});continue}if(ct==="v"){Ot!==1&&Ot!==2&&At.push({key:ct,message:'Key "v" must be 1 or 2.',severity:ft});continue}let dn=hr[ct];if(dn)switch(yt===gn&&ct in kr&&(dn=kr[ct]),dn){case Zn:Nr(Ot)&&Number.isInteger(Ot)?mr.has(ct)&&Ot%100!=0&&At.push({key:ct,message:`Key "${ct}" should be rounded to the nearest 100.`,severity:Qt}):At.push({key:ct,message:`Key "${ct}" must be a finite integer.`,severity:ft});break;case ar:Nr(Ot)?mr.has(ct)&&Ot%100!=0?At.push({key:ct,message:`Key "${ct}" should be rounded to the nearest 100.`,severity:Qt}):Xr.has(ct)&&!Number.isInteger(Ot)&&At.push({key:ct,message:`Key "${ct}" should be rounded to an integer.`,severity:Qt}):At.push({key:ct,message:`Key "${ct}" must be a finite number.`,severity:ft});break;case dr:typeof Ot!="boolean"&&At.push({key:ct,message:`Key "${ct}" must be a boolean.`,severity:ft});break;case Xn:typeof Ot!="string"?At.push({key:ct,message:`Key "${ct}" must be a string.`,severity:ft}):ct in Pr&&Ot.length>Pr[ct]&&At.push({key:ct,message:`Key "${ct}" exceeds maximum length of ${Pr[ct]}.`,severity:ft});break;case gr:{const Tn=Qr[ct];Tn&&!Tn.includes(Ot)&&At.push({key:ct,message:`Key "${ct}" has invalid token value "${String(Ot)}". Expected one of: ${Tn.join(", ")}.`,severity:ft});break}case qn:Kr(ct,Ot,At);break;case tr:Zr(ct,Ot,At)}}return{valid:At.every((ct=>ct.severity!==ft)),issues:At}}function br(Re,ut){return $t(er(Re,ut),Cr(Re,ut),Qn(Re,ut))}function Gr(Re,ut){const yt={...ut,reportingMode:pt},At=Re.split(/\r?\n/).filter((dn=>dn.length>0));if(At.length===0)return{valid:!1,issues:[{message:"Empty event mode payload. At least one event line is required.",severity:ft}],data:[]};const ct=[],Ot=[];for(let dn=0;dn<At.length;dn++)try{const Tn=mn(At[dn]);ct.push(Tn),Ot.push(br(Tn,yt))}catch{ct.push({}),Ot.push({valid:!1,issues:[{message:`Failed to decode event line ${dn+1}: invalid structured field syntax.`,severity:ft}]})}return{...$t(...Ot),data:ct}}function vt(Re,ut){const yt=[];Re.method!=="POST"&&yt.push({message:`Invalid HTTP method '${Re.method??"GET"}'. Event reports must use POST.`,severity:ft});const At=Re.headers?On(Re.headers).get("Content-Type"):void 0;if(At){const dn=At.split(";")[0].trim().toLowerCase();dn!==_n&&yt.push({message:`Invalid Content-Type '${dn}'. Event reports must use '${_n}'.`,severity:ft})}else yt.push({message:`Missing Content-Type header. Event reports must use '${_n}'.`,severity:ft});const ct=Re.body;if(ct==null)return yt.push({message:"Missing request body. Event reports must include a body.",severity:ft}),{valid:!1,issues:yt,data:[]};if(typeof ct!="string")return yt.push({message:"Request body must be a string.",severity:ft}),{valid:!1,issues:yt,data:[]};const Ot=Gr(ct,ut);return{valid:yt.length===0&&Ot.valid,issues:[...yt,...Ot.issues],data:Ot.data}}function nn(Re,ut){const yt=On(Re),At=[],ct={};for(const Tn of be){const Yn=yt.get(Tn);if(!Yn)continue;let Gn;try{Gn=mn(Yn)}catch{At.push({key:Tn,message:`Failed to decode "${Tn}" header: invalid structured field syntax.`,severity:ft});continue}ct[Tn]=Gn;for(const sr of Object.keys(Gn)){if(kt(sr))continue;const $n=tt[sr];$n&&$n!==Tn&&At.push({key:sr,message:`Key "${sr}" is in "${Tn}" but should be in "${$n}".`,severity:ft})}}const Ot={valid:At.length===0,issues:At},dn=Object.assign({},...be.map((Tn=>ct[Tn])).filter(Boolean));return{...$t(Ot,br(dn,{...ut,reportingMode:He})),data:dn}}function Sn(Re,ut){const yt=(function(Ot){if(!Ot)return;const dn=On(Ot),Tn={};let Yn=!1;for(const Gn of be){const sr=dn.get(Gn);sr&&(Tn[Gn]=sr,Yn=!0)}return Yn?Tn:void 0})(Re.headers);if(yt)return nn(yt,ut);const At=new URL(Re.url).searchParams.get(he);if(!At)return{valid:!1,issues:[{message:"No CMCD data found in request headers or query parameters.",severity:ft}],data:{}};let ct;try{ct=mn(At)}catch{return{valid:!1,issues:[{message:"Failed to decode CMCD query parameter: invalid structured field syntax.",severity:ft}],data:{}}}return{...br(ct,{...ut,reportingMode:He}),data:ct}}},1103:function(wt,me,P){P.r(me),P.d(me,{CMSD_DYNAMIC:function(){return o},CMSD_STATIC:function(){return p},CMSD_V1:function(){return E},CmsdHeaderField:function(){return _},CmsdObjectType:function(){return w},CmsdStreamType:function(){return h},CmsdStreamingFormat:function(){return g},decodeCmsdDynamic:function(){return r},decodeCmsdStatic:function(){return H},encodeCmsdDynamic:function(){return G},encodeCmsdStatic:function(){return le}});var F=P(6390),f=P(2877);const o="CMSD-Dynamic",p="CMSD-Static",E=1,_={STATIC:p,DYNAMIC:o},w=F.CmObjectType,g=F.CmStreamingFormat,h=F.CmStreamType;function r(de){return de?(0,f.decodeSfList)(de):[]}function H(de){return de?Object.entries((0,f.decodeSfDict)(de)).reduce(((De,[ce,Le])=>{const{value:Be}=Le;return De[ce]=typeof Be=="symbol"?(0,f.symbolToStr)(Be):Be,De}),{}):{}}function G(de,De){if(!de)return"";if(typeof de=="string"){if(!De)return"";de=[new f.SfItem(de,De)]}return(0,f.encodeSfList)(de,{whitespace:!1})}function le(de,De){return de?(0,f.encodeSfDict)((function(ce,Le){const Be={};if(ce==null||typeof ce!="object")return Be;const ot=Object.keys(ce),Ge=Le?.useSymbol!==!1;return ot.forEach((X=>{let Z=ce[X];X==="v"&&Z===1||(0,F.isValid)(Z)&&((0,F.isTokenField)(X)&&typeof Z=="string"&&(Z=Ge?Symbol.for(Z):new f.SfToken(Z)),Be[X]=Z)})),Be})(de,De),{whitespace:!1}):""}},6390:function(wt,me,P){P.r(me),P.d(me,{CmObjectType:function(){return F},CmStreamType:function(){return o},CmStreamingFormat:function(){return f},isTokenField:function(){return p},isValid:function(){return E}});const F={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},f={DASH:"d",HLS:"h",SMOOTH:"s",OTHER:"o"},o={VOD:"v",LIVE:"l"};function p(_){return["ot","sf","st","e","sta"].includes(_)}function E(_){return typeof _=="number"?Number.isFinite(_):_!=null&&_!==""&&_!==!1}},2877:function(wt,me,P){P.r(me),P.d(me,{SfItem:function(){return f},SfToken:function(){return Se},decodeSfDict:function(){return kt},decodeSfItem:function(){return ln},decodeSfList:function(){return Oe},encodeSfDict:function(){return $},encodeSfItem:function(){return ie},encodeSfList:function(){return tt},parseBareItem:function(){return ht},parseBoolean:function(){return r},parseByteSequence:function(){return G},parseDate:function(){return ot},parseDict:function(){return Nt},parseError:function(){return _},parseInnerList:function(){return Ke},parseIntegerOrDecimal:function(){return Be},parseItem:function(){return Fe},parseItemOrInnerList:function(){return Pt},parseKey:function(){return pt},parseList:function(){return En},parseParameters:function(){return He},parseString:function(){return Z},parseToken:function(){return ke},serializeBareItem:function(){return it},serializeBoolean:function(){return mt},serializeByteSequence:function(){return It},serializeDate:function(){return V},serializeDecimal:function(){return B},serializeDict:function(){return I},serializeError:function(){return Ie},serializeInnerList:function(){return S},serializeInteger:function(){return Ye},serializeItem:function(){return i},serializeKey:function(){return _e},serializeList:function(){return be},serializeParams:function(){return Ue},serializeString:function(){return Pe},serializeToken:function(){return qe},symbolToStr:function(){return j}});var F=P(9259),f=class Hi{constructor(ze,je){Array.isArray(ze)&&(ze=ze.map((Y=>Y instanceof Hi?Y:new Hi(Y)))),this.value=ze,this.params=je}};const o="Dict";function p(ae,ze){return{value:ae,src:ze}}function E(ae,ze,je,Y){return new Error(`failed to ${ae} "${he=ze,Array.isArray(he)?JSON.stringify(he):he instanceof Map?"Map{}":he instanceof Set?"Set{}":typeof he=="object"?JSON.stringify(he):String(he)}" as ${je}`,{cause:Y});var he}function _(ae,ze,je){return E("parse",ae,ze,je)}const w="Inner List",g="Bare Item",h="Boolean";function r(ae){let ze=0;if(ae[ze]!=="?")throw _(ae,h);if(ze++,ae[ze]==="1")return p(!0,ae.substring(++ze));if(ae[ze]==="0")return p(!1,ae.substring(++ze));throw _(ae,h)}const H="Byte Sequence";function G(ae){if(ae[0]!==":"||(ae=ae.substring(1)).includes(":")===!1)throw _(ae,H);const ze=/(^.*?)(:)/g,je=ze.exec(ae)[1];return ae=ae.substring(ze.lastIndex),p((0,F.decodeBase64)(je),ae)}const le="Date",de="Decimal",De="Integer",ce=`${De} or ${de}`;function Le(ae){return ae<-999999999999999||999999999999999<ae}function Be(ae){let ze,je=1,Y="";const he=_(ae,ce);if(ae[0]==="-"&&(je=-1,ae=ae.substring(1)),ae.length<=0)throw he;const et=/^(\d+)?/g,at=et.exec(ae);if(at[0].length===0)throw he;if(Y+=at[1],(ae=ae.substring(et.lastIndex))[0]==="."){if(Y.length>12)throw he;const Tt=/^(\.\d+)?/g,st=Tt.exec(ae);if(ae=ae.substring(Tt.lastIndex),st[0].length===0||st[1].length>4||(Y+=st[1],Y.length>16))throw he;ze=parseFloat(Y)*je}else{if(Y.length>15)throw he;if(ze=parseInt(Y)*je,Le(ze))throw _(Y,ce)}return p(ze,ae)}function ot(ae){let ze=0;if(ae[ze]!=="@")throw _(ae,le);ze++;const je=Be(ae.substring(ze));if(Number.isInteger(je.value)===!1)throw _(ae,le);return p(new Date(1e3*je.value),je.src)}const Ge="String",X=/[\x00-\x1f\x7f]+/;function Z(ae){let ze="",je=0;if(ae[je]!=='"')throw _(ae,Ge);for(je++;ae.length>je;){if(ae[je]==="\\"){if(ae.length<=je+1||(je++,ae[je]!=='"'&&ae[je]!=="\\"))throw _(ae,Ge);ze+=ae[je]}else{if(ae[je]==='"')return p(ze,ae.substring(++je));if(X.test(ae[je]))throw _(ae,Ge);ze+=ae[je]}je++}throw _(ae,Ge)}var Se=class{constructor(ae){this.description=ae}};const Ne="Token";function ke(ae,ze){if(/^[a-zA-Z*]$/.test(ae[0])===!1)throw _(ae,Ne);const je=/^([!#$%&'*+\-.^_`|~\w:/]+)/g,Y=je.exec(ae)[1];return ae=ae.substring(je.lastIndex),p(ze?.useSymbol===!1?new Se(Y):Symbol.for(Y),ae)}function ht(ae,ze){const je=ae[0];if(je==='"')return Z(ae);if(/^[-0-9]/.test(je))return Be(ae);if(je==="?")return r(ae);if(je===":")return G(ae);if(/^[a-zA-Z*]/.test(je))return ke(ae,ze);if(je==="@")return ot(ae);throw _(ae,g)}const ye="Key";function pt(ae){let ze=0;if(/^[a-z*]$/.test(ae[ze])===!1)throw _(ae,ye);let je="";for(;ae.length>ze;){if(/^[a-z0-9_\-.*]$/.test(ae[ze])===!1)return p(je,ae.substring(ze));je+=ae[ze],ze++}return p(je,ae.substring(ze))}function He(ae,ze){let je;for(;ae.length>0&&ae[0]===";";){const Y=pt(ae=ae.substring(1).trim()),he=Y.value;let et=!0;if((ae=Y.src)[0]==="="){const at=ht(ae=ae.substring(1),ze);et=at.value,ae=at.src}je==null&&(je={}),je[he]=et}return p(je,ae)}function Fe(ae,ze){const je=ht(ae,ze),Y=He(ae=je.src,ze);return ae=Y.src,p(new f(je.value,Y.value),ae)}function Ke(ae,ze){if(ae[0]!=="(")throw _(ae,w);ae=ae.substring(1);const je=[];for(;ae.length>0;){if((ae=ae.trim())[0]===")"){const he=He(ae=ae.substring(1),ze);return p(new f(je,he.value),he.src)}const Y=Fe(ae,ze);if(je.push(Y.value),(ae=Y.src)[0]!==" "&&ae[0]!==")")throw _(ae,w)}throw _(ae,w)}function Pt(ae,ze){return ae[0]==="("?Ke(ae,ze):Fe(ae,ze)}function Nt(ae,ze){const je={};for(;ae.length>0;){let Y;const he=pt(ae),et=he.value;if((ae=he.src)[0]==="="){const at=Pt(ae.substring(1),ze);Y=at.value,ae=at.src}else{const at=He(ae,ze);Y=new f(!0,at.value),ae=at.src}if(je[et]=Y,(ae=ae.trim()).length===0)return p(je,ae);if(ae[0]!==","||(ae=ae.substring(1).trim()).length===0||ae[0]===",")throw _(ae,o)}return p(je,ae)}function kt(ae,ze){try{const{src:je,value:Y}=Nt(ae.trim(),ze);if(je!=="")throw _(je,o);return Y}catch(je){throw _(ae,o,je)}}const Ut="Item";function ln(ae,ze){try{const{src:je,value:Y}=Fe(ae.trim(),ze);if(je!=="")throw _(je,Ut);return Y}catch(je){throw _(ae,Ut,je)}}const an="List";function En(ae,ze){const je=[];for(;ae.length>0;){const Y=Pt(ae,ze);if(je.push(Y.value),(ae=Y.src.trim()).length===0)return p(je,ae);if(ae[0]!==","||(ae=ae.substring(1).trim()).length===0||ae[0]===",")throw _(ae,an)}return p(je,ae)}function Oe(ae,ze){try{const{src:je,value:Y}=En(ae.trim(),ze);if(je!=="")throw _(je,an);return Y}catch(je){throw _(ae,an,je)}}function Ie(ae,ze,je){return E("serialize",ae,ze,je)}function mt(ae){if(typeof ae!="boolean")throw Ie(ae,h);return ae?"?1":"?0"}function It(ae){if(ArrayBuffer.isView(ae)===!1)throw Ie(ae,H);return`:${(0,F.encodeBase64)(ae)}:`}function Ye(ae){if(Le(ae))throw Ie(ae,De);return ae.toString()}function V(ae){return`@${Ye(ae.getTime()/1e3)}`}function B(ae){const ze=(0,F.roundToEven)(ae,3);if(Math.floor(Math.abs(ze)).toString().length>12)throw Ie(ae,de);const je=ze.toString();return je.includes(".")?je:`${je}.0`}function Pe(ae){if(X.test(ae))throw Ie(ae,Ge);return`"${ae.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function j(ae){return ae.description||ae.toString().slice(7,-1)}function qe(ae){const ze=j(ae);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(ze)===!1)throw Ie(ze,Ne);return ze}function it(ae){switch(typeof ae){case"number":if(!Number.isFinite(ae))throw Ie(ae,g);return Number.isInteger(ae)?Ye(ae):B(ae);case"string":return Pe(ae);case"symbol":return qe(ae);case"boolean":return mt(ae);case"object":if(ae instanceof Date)return V(ae);if(ae instanceof Uint8Array)return It(ae);if(ae instanceof Se)return qe(ae);default:throw Ie(ae,g)}}function _e(ae){if(/^[a-z*][a-z0-9\-_.*]*$/.test(ae)===!1)throw Ie(ae,ye);return ae}function Ue(ae){return ae==null?"":Object.entries(ae).map((([ze,je])=>je===!0?`;${_e(ze)}`:`;${_e(ze)}=${it(je)}`)).join("")}function i(ae){return ae instanceof f?`${it(ae.value)}${Ue(ae.params)}`:it(ae)}function S(ae){return`(${ae.value.map(i).join(" ")})${Ue(ae.params)}`}function I(ae,ze={whitespace:!0}){if(typeof ae!="object"||ae==null)throw Ie(ae,o);const je=ae instanceof Map?ae.entries():Object.entries(ae),Y=ze?.whitespace?" ":"";return Array.from(je).map((([he,et])=>{et instanceof f==0&&(et=new f(et));let at=_e(he);return et.value===!0?at+=Ue(et.params):(at+="=",Array.isArray(et.value)?at+=S(et):at+=i(et)),at})).join(`,${Y}`)}function $(ae,ze){return I(ae,ze)}function ie(ae,ze){return ae instanceof f||(ae=new f(ae,ze)),i(ae)}function be(ae,ze={whitespace:!0}){if(Array.isArray(ae)===!1)throw Ie(ae,an);const je=ze?.whitespace?" ":"";return ae.map((Y=>{Y instanceof f==0&&(Y=new f(Y));const he=Y;return Array.isArray(he.value)?S(he):i(he)})).join(`,${je}`)}function tt(ae,ze){return be(ae,ze)}},9259:function(wt,me,P){function F(ye){return new Uint8Array(ye).reduce(((pt,He)=>pt+He.toString(16).padStart(2,"0")),"")}function f(ye){return F(ye).replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/,"$1-$2-$3-$4-$5")}function o(ye){return new Uint8Array([...atob(ye)].map((pt=>pt.charCodeAt(0))))}P.r(me),P.d(me,{Encoding:function(){return De},RequestResponseType:function(){return ot},UTF_16:function(){return h},UTF_16_BE:function(){return r},UTF_16_LE:function(){return H},UTF_8:function(){return G},arrayBufferToHex:function(){return F},arrayBufferToUuid:function(){return f},base64decode:function(){return p},base64encode:function(){return _},convertUint8ToUint16:function(){return w},decodeBase64:function(){return o},decodeText:function(){return le},encodeBase64:function(){return E},encodeText:function(){return de},getBandwidthBps:function(){return ce},getBaseUrl:function(){return Le},hexToArrayBuffer:function(){return Be},isArrayBufferLike:function(){return g},roundToEven:function(){return Ge},stringToUint16:function(){return X},unescapeHtml:function(){return Se},urlToRelativePath:function(){return Ne},uuid:function(){return ke},uuidToArrayBuffer:function(){return ht}});const p=o;function E(ye){return btoa(String.fromCharCode(...ye))}const _=E;function w(ye){if(ye.length%2!=0){const pt=new Uint8Array(ye.length+1);return pt.set(ye),new Uint16Array(pt.buffer)}return new Uint16Array(ye.buffer)}function g(ye){return ye instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&ye instanceof SharedArrayBuffer}const h="utf-16",r="utf-16be",H="utf-16le",G="utf-8";function le(ye,pt={}){let He;He=g(ye)?new DataView(ye):new DataView(ye.buffer,ye.byteOffset,ye.byteLength);let Fe=0,{encoding:Ke}=pt;if(!Ke){const ln=He.getUint8(0),an=He.getUint8(1);ln==239&&an==187&&He.getUint8(2)==191?(Ke=G,Fe=3):ln==254&&an==255?(Ke=r,Fe=2):ln==255&&an==254?(Ke=H,Fe=2):Ke=G}if(typeof TextDecoder<"u")return new TextDecoder(Ke).decode(He);const{byteLength:Pt}=He,Nt=Ke!==r;let kt,Ut="";for(;Fe<Pt;){switch(Ke){case G:if(kt=He.getUint8(Fe),kt<128)Fe++;else if(kt>=194&&kt<=223)if(Fe+1<Pt){const ln=He.getUint8(Fe+1);ln>=128&&ln<=191?(kt=(31&kt)<<6|63&ln,Fe+=2):Fe++}else Fe++;else if(kt>=224&&kt<=239)if(Fe+2<=Pt-1){const ln=He.getUint8(Fe+1),an=He.getUint8(Fe+2);ln>=128&&ln<=191&&an>=128&&an<=191?(kt=(15&kt)<<12|(63&ln)<<6|63&an,Fe+=3):Fe++}else Fe++;else if(kt>=240&&kt<=244)if(Fe+3<=Pt-1){const ln=He.getUint8(Fe+1),an=He.getUint8(Fe+2),En=He.getUint8(Fe+3);ln>=128&&ln<=191&&an>=128&&an<=191&&En>=128&&En<=191?(kt=(7&kt)<<18|(63&ln)<<12|(63&an)<<6|63&En,Fe+=4):Fe++}else Fe++;else Fe++;break;case r:case h:case H:kt=He.getUint16(Fe,Nt),Fe+=2}Ut+=String.fromCodePoint(kt)}return Ut}function de(ye){return new TextEncoder().encode(ye)}const De={UTF8:G,UTF16:h,UTF16BE:r,UTF16LE:H};function ce(ye){const pt=ye.duration/1e3;return 8*ye.encodedBodySize/pt}function Le(ye){const pt=typeof ye=="string"?new URL(ye):ye;return pt.origin+pt.pathname.substring(0,pt.pathname.lastIndexOf("/")+1)}function Be(ye){const pt=new ArrayBuffer(ye.length/2),He=new Uint8Array(pt);for(let Fe=0;Fe<ye.length;Fe+=2)He[Fe/2]=parseInt(ye.slice(Fe,Fe+2),16);return pt}const ot={TEXT:"text",JSON:"json",BLOB:"blob",ARRAY_BUFFER:"arrayBuffer",DOCUMENT:"document",STREAM:"stream"};function Ge(ye,pt){if(ye<0)return-Ge(-ye,pt);const He=Math.pow(10,pt);if(Math.abs(ye*He%1-.5)<Number.EPSILON){const Fe=Math.floor(ye*He);return(Fe%2==0?Fe:Fe+1)/He}return Math.round(ye*He)/He}function X(ye){const pt=new ArrayBuffer(2*ye.length),He=new DataView(pt);for(let Fe=0;Fe<ye.length;Fe++)He.setUint16(2*Fe,ye.charCodeAt(Fe),!0);return new Uint16Array(pt)}const Z=/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g;function Se(ye){return ye.indexOf("&")===-1?ye:ye.replace(Z,(pt=>{switch(pt){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(pt[1]==="#"){const He=pt[2]==="x"||pt[2]==="X"?parseInt(pt.slice(3),16):parseInt(pt.slice(2),10);return String.fromCodePoint(He)}return pt}}))}function Ne(ye,pt){let He;try{He=new URL(ye)}catch{return ye}const Fe=new URL(pt);if(He.origin!==Fe.origin)return ye;const Ke=He.pathname.split("/").slice(1),Pt=Fe.pathname.split("/").slice(1,-1),Nt=Math.min(Ke.length,Pt.length);for(let kt=0;kt<Nt&&Ke[kt]===Pt[kt];kt++)Ke.shift(),Pt.shift();for(;Pt.length;)Pt.shift(),Ke.unshift("..");return Ke.join("/")+He.search+He.hash}function ke(){try{return crypto.randomUUID()}catch{try{const pt=URL.createObjectURL(new Blob),He=pt.toString();return URL.revokeObjectURL(pt),He.slice(He.lastIndexOf("/")+1)}catch{let He=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(Fe=>{const Ke=(He+16*Math.random())%16|0;return He=Math.floor(He/16),(Fe=="x"?Ke:3&Ke|8).toString(16)}))}}}function ht(ye){return Be(ye.replace(/-/g,""))}},649:function(wt,me,P){P.r(me);var F=P(8850),f=P(3621),o=P(138);function p(_){_=_||{};const w=this.context,g=(0,F.default)(w).getInstance(),h=_.settings,r=[];let H,G,le,de;function De(Z){return Z&&Z.bind?Z.bind(window.console):window.console.log.bind(window.console)}function ce(...Z){X(1,this,...Z)}function Le(...Z){X(2,this,...Z)}function Be(...Z){X(3,this,...Z)}function ot(...Z){X(4,this,...Z)}function Ge(...Z){X(5,this,...Z)}function X(Z,Se,...Ne){let ke="",ht=null;G&&(ht=new Date().getTime(),ke+="["+(ht-de)+"]"),le&&Se&&Se.getClassName&&(ke+="["+Se.getClassName()+"]",Se.getType&&(ke+="["+Se.getType()+"]")),ke.length>0&&(ke+=" "),Array.apply(null,Ne).forEach((function(ye){ke+=ye+" "})),r[Z]&&h&&h.get().debug.logLevel>=Z&&r[Z](ke),h&&h.get().debug.dispatchEvent&&g.trigger(f.default.LOG,{message:ke,level:Z})}return H={getLogger:function(Z){return{fatal:ce.bind(Z),error:Le.bind(Z),warn:Be.bind(Z),info:ot.bind(Z),debug:Ge.bind(Z)}},setLogTimestampVisible:function(Z){G=Z},setCalleeNameVisible:function(Z){le=Z}},G=!0,le=!0,de=new Date().getTime(),typeof window<"u"&&window.console&&(r[1]=De(window.console.error),r[2]=De(window.console.error),r[3]=De(window.console.warn),r[4]=De(window.console.info),r[5]=De(window.console.debug)),H}p.__dashjs_factory_name="Debug";const E=o.default.getSingletonFactory(p);E.LOG_LEVEL_NONE=0,E.LOG_LEVEL_FATAL=1,E.LOG_LEVEL_ERROR=2,E.LOG_LEVEL_WARNING=3,E.LOG_LEVEL_INFO=4,E.LOG_LEVEL_DEBUG=5,o.default.updateSingletonFactory(p.__dashjs_factory_name,E),me.default=E},8850:function(wt,me,P){P.r(me);var F=P(138),f=P(1191);function o(){let E={};function _(h,r,H,G={},le=!1){if(!h)throw new Error("event type cannot be null or undefined");if(!r||typeof r!="function")throw new Error("listener must be a function: "+r);let de=G.priority||0;if(g(h,r,H)>=0)return;E[h]=E[h]||[];const De={callback:r,scope:H,priority:de,executeOnlyOnce:le};H&&H.getStreamId&&(De.streamId=H.getStreamId()),H&&H.getType&&(De.mediaType=H.getType()),G&&G.mode&&(De.mode=G.mode),E[h].some(((ce,Le)=>{if(ce&&de>ce.priority)return E[h].splice(Le,0,De),!0}))||E[h].push(De)}function w(h,r,H){if(!h||!r||!E[h])return;const G=g(h,r,H);G<0||E[h].splice(G,1)}function g(h,r,H){let G=-1;return E[h]&&E[h].some(((le,de)=>{if(le&&le.callback===r&&(!H||H===le.scope))return G=de,!0})),G}return{on:function(h,r,H,G={}){_(h,r,H,G)},once:function(h,r,H,G={}){_(h,r,H,G,!0)},off:w,trigger:function(h,r={},H={}){if(!h||!E[h])return;if((r=r||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");r.type=h,H.streamId&&(r.streamId=H.streamId),H.mediaType&&(r.mediaType=H.mediaType);const G=[];E[h].filter((le=>!(!le||H.streamId&&le.streamId&&le.streamId!==H.streamId||H.mediaType&&le.mediaType&&le.mediaType!==H.mediaType||H.mode&&le.mode&&le.mode!==H.mode||!le.mode&&H.mode&&H.mode===f.default.EVENT_MODE_ON_RECEIVE))).forEach((le=>{le&&le.callback.call(le.scope,r),le.executeOnlyOnce&&G.push(le)})),G.forEach((le=>{w(h,le.callback,le.scope)}))},reset:function(){E={}}}}o.__dashjs_factory_name="EventBus";const p=F.default.getSingletonFactory(o);p.EVENT_PRIORITY_LOW=0,p.EVENT_PRIORITY_HIGH=5e3,F.default.updateSingletonFactory(o.__dashjs_factory_name,p),me.default=p},138:function(wt,me,P){P.r(me);const F=(function(){let f,o=[];const p={},E={};function _(r,H){for(const G in o){const le=o[G];if(le.context===r&&le.name===H)return le.instance}return null}function w(r,H){return H[r]}function g(r,H,G){r in G&&(G[r]=H)}function h(r,H,G){let le;const de=r.__dashjs_factory_name,De=H[de];if(De){let ce=De.instance;if(!De.override)return ce.apply({context:H,factory:f},G);le=r.apply({context:H},G),ce=ce.apply({context:H,factory:f,parent:le},G);for(const Le in ce)le.hasOwnProperty(Le)&&(le[Le]=ce[Le])}else le=r.apply({context:H},G);return le.getClassName=function(){return de},le}return f={deleteSingletonInstances:function(r){o=o.filter((H=>H.context!==r))},extend:function(r,H,G,le){!le[r]&&H&&(le[r]={instance:H,override:G})},getClassFactory:function(r){let H=w(r.__dashjs_factory_name,E);return H||(H=function(G){return G===void 0&&(G={}),{create:function(){return h(r,G,arguments)}}},E[r.__dashjs_factory_name]=H),H},getClassFactoryByName:function(r){return w(r,E)},getSingletonFactory:function(r){let H=w(r.__dashjs_factory_name,p);return H||(H=function(G){let le;return G===void 0&&(G={}),{getInstance:function(){return le||(le=_(G,r.__dashjs_factory_name)),le||(le=h(r,G,arguments),o.push({name:r.__dashjs_factory_name,context:G,instance:le})),le}}},p[r.__dashjs_factory_name]=H),H},getSingletonFactoryByName:function(r){return w(r,p)},getSingletonInstance:_,setSingletonInstance:function(r,H,G){for(const le in o){const de=o[le];if(de.context===r&&de.name===H)return void(o[le].instance=G)}o.push({name:H,context:r,instance:G})},updateClassFactory:function(r,H){g(r,H,E)},updateSingletonFactory:function(r,H){g(r,H,p)}},f})();me.default=F},8261:function(wt,me,P){P.r(me);var F=P(138),f=P(7263),o=P(649),p=P(5212),E=P(7568),_=P(8850),w=P(3621),g=P(4246);function h(){let H;const G=this.context,le=(0,_.default)(G).getInstance(),de={"streaming.delay.liveDelay":w.default.SETTING_UPDATED_LIVE_DELAY,"streaming.delay.liveDelayFragmentCount":w.default.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,"streaming.liveCatchup.enabled":w.default.SETTING_UPDATED_CATCHUP_ENABLED,"streaming.liveCatchup.playbackRate.min":w.default.SETTING_UPDATED_PLAYBACK_RATE_MIN,"streaming.liveCatchup.playbackRate.max":w.default.SETTING_UPDATED_PLAYBACK_RATE_MAX,"streaming.abr.rules.throughputRule.active":w.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.bolaRule.active":w.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.insufficientBufferRule.active":w.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.switchHistoryRule.active":w.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.droppedFramesRule.active":w.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.abandonRequestsRule.active":w.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.l2ARule.active":w.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.loLPRule.active":w.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.maxBitrate.video":w.default.SETTING_UPDATED_MAX_BITRATE,"streaming.abr.maxBitrate.audio":w.default.SETTING_UPDATED_MAX_BITRATE,"streaming.abr.minBitrate.video":w.default.SETTING_UPDATED_MIN_BITRATE,"streaming.abr.minBitrate.audio":w.default.SETTING_UPDATED_MIN_BITRATE},De={debug:{logLevel:o.default.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{abandonLoadTimeout:1e4,seekDurationBackoff:.5,wallclockTimeUpdateInterval:100,manifestUpdateRetryInterval:100,liveUpdateTimeThresholdInMilliseconds:0,cacheInitSegments:!1,cacheInitSegmentsLimit:50,applyServiceDescription:!0,applyProducerReferenceTime:!0,applyContentSteering:!0,ignoreFinalStaticManifestOnDynamicToStaticTransition:!1,enableManifestDurationMismatchFix:!0,parseInbandPrft:!1,enableManifestTimescaleMismatchFix:!1,capabilities:{filterUnsupportedEssentialProperties:!0,supportedEssentialProperties:[{schemeIdUri:p.default.FONT_DOWNLOAD_DVB_SCHEME},{schemeIdUri:p.default.COLOUR_PRIMARIES_SCHEME_ID_URI,value:/1|5|6|7/},{schemeIdUri:p.default.URL_QUERY_INFO_SCHEME},{schemeIdUri:p.default.EXT_URL_QUERY_INFO_SCHEME},{schemeIdUri:p.default.MATRIX_COEFFICIENTS_SCHEME_ID_URI,value:/0|1|5|6/},{schemeIdUri:p.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI,value:/1|6|13|14|15/},{schemeIdUri:p.default.SEGMENT_SEQUENCE_REPRESENTATION_SCHEME_ID_URI},...p.default.THUMBNAILS_SCHEME_ID_URIS.map((Be=>({schemeIdUri:Be})))],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,enableBackgroundSyncAfterSegmentDownloadError:!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:p.default.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},saveLastMediaSettingsForCurrentStreamingSession:!0,cacheLoadThresholds:{video:10,audio:5},trackSwitchMode:{audio:p.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:p.default.TRACK_SWITCH_MODE_NEVER_REPLACE},includePreselectionsInMediainfoArray:!0,includePreselectionsForInitialTrackSelection:!1,ignoreSelectionPriority:!1,prioritizeRoleMain:!0,assumeDefaultRoleAsMain:!0,selectionModeForInitialTrack:p.default.TRACK_SELECTION_MODE_LOWEST_STARTUP_DELAY,blacklistExpiryTime:-1,fragmentRequestTimeout:2e4,fragmentRequestProgressTimeout:-1,manifestRequestTimeout:1e4,retryIntervals:{[E.HTTPRequest.MPD_TYPE]:500,[E.HTTPRequest.XLINK_EXPANSION_TYPE]:500,[E.HTTPRequest.MEDIA_SEGMENT_TYPE]:1e3,[E.HTTPRequest.INIT_SEGMENT_TYPE]:1e3,[E.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE]:1e3,[E.HTTPRequest.INDEX_SEGMENT_TYPE]:1e3,[E.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE]:1e3,[E.HTTPRequest.LICENSE]:1e3,[E.HTTPRequest.LICENSE_CERTIFICATE]:1e3,[E.HTTPRequest.OTHER_TYPE]:1e3,lowLatencyReductionFactor:10},retryAttempts:{[E.HTTPRequest.MPD_TYPE]:3,[E.HTTPRequest.XLINK_EXPANSION_TYPE]:1,[E.HTTPRequest.MEDIA_SEGMENT_TYPE]:3,[E.HTTPRequest.INIT_SEGMENT_TYPE]:3,[E.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE]:3,[E.HTTPRequest.INDEX_SEGMENT_TYPE]:3,[E.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE]:3,[E.HTTPRequest.LICENSE]:3,[E.HTTPRequest.LICENSE_CERTIFICATE]:3,[E.HTTPRequest.OTHER_TYPE]:3,lowLatencyMultiplyFactor:5},abr:{limitBitrateByPortal:!1,usePixelRatioInLimitBitrateByPortal:!1,limitBitrateByPortalMinimum:0,enableSupplementalPropertyAdaptationSetSwitching:!0,hybridSwitchBufferTime:12,rules:{throughputRule:{active:!0,priority:g.default.PRIORITY.DEFAULT},bolaRule:{active:!0,priority:g.default.PRIORITY.DEFAULT},insufficientBufferRule:{active:!0,priority:g.default.PRIORITY.DEFAULT,parameters:{throughputSafetyFactor:.7,segmentIgnoreCount:2}},switchHistoryRule:{active:!0,priority:g.default.PRIORITY.DEFAULT,parameters:{sampleSize:8,switchPercentageThreshold:.075}},droppedFramesRule:{active:!1,priority:g.default.PRIORITY.DEFAULT,parameters:{minimumSampleSize:375,droppedFramesPercentageThreshold:.15}},abandonRequestsRule:{active:!0,priority:g.default.PRIORITY.DEFAULT,parameters:{abandonDurationMultiplier:1.8,minSegmentDownloadTimeThresholdInMs:500,minThroughputSamplesThreshold:6}},l2ARule:{active:!1,priority:g.default.PRIORITY.DEFAULT},loLPRule:{active:!1,priority:g.default.PRIORITY.DEFAULT}},throughput:{averageCalculationMode:p.default.THROUGHPUT_CALCULATION_MODES.EWMA,lowLatencyDownloadTimeCalculationMode:p.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:p.default.CMCD_MODE_QUERY,enabledKeys:p.default.CMCD_KEYS,includeInRequests:["segment","mpd"],version:1,eventTargets:[]},cmsd:{enabled:!1,abr:{applyMb:!1,etpWeightRatio:0}},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 ce=f.default.clone(De);function Le(Be,ot,Ge){for(let X in Be)Be.hasOwnProperty(X)&&(ot.hasOwnProperty(X)?typeof Be[X]!="object"||Be[X]instanceof RegExp||Be[X]instanceof Array||Be[X]===null?(ot[X]=f.default.clone(Be[X]),de[Ge+X]&&le.trigger(de[Ge+X])):Le(Be[X],ot[X],Ge.slice()+X+"."):console.error("Settings parameter "+Ge+X+" is not supported"))}return H={get:function(){return ce},update:function(Be){typeof Be=="object"&&Le(Be,ce,"")},reset:function(){ce=f.default.clone(De)}},H}h.__dashjs_factory_name="Settings";let r=F.default.getSingletonFactory(h);me.default=r},7263:function(wt,me,P){P.r(me);var F=P(3282),f=P(5212);class o{static mixin(E,_,w){let g,h={};if(E)for(let r in _)_.hasOwnProperty(r)&&(g=_[r],r in E&&(E[r]===g||r in h&&h[r]===g)||(typeof E[r]=="object"&&E[r]!==null?E[r]=o.mixin(E[r],g,w):E[r]=w(g)));return E}static clone(E){if(!E||typeof E!="object")return E;if(E instanceof RegExp)return new RegExp(E);let _;if(E instanceof Array){_=[];for(let w=0,g=E.length;w<g;++w)w in E&&_.push(o.clone(E[w]))}else _={};return o.mixin(_,E,o.clone)}static addAdditionalQueryParameterToUrl(E,_){try{if(!_||_.length===0)return E;let w=E;return _.forEach((({key:g,value:h})=>{const r=w.includes("?")?"&":"?";w+=`${r}${encodeURIComponent(g)}=${encodeURIComponent(h)}`})),w}catch{return E}}static removeQueryParameterFromUrl(E,_){if(!E||!_)return E;const w=new URL(E),g=new URLSearchParams(w.search);if(!g||g.size===0||!g.has(_))return E;g.delete(_);const h=Array.from(g.entries()).map((([H,G])=>`${H}=${G}`)).join("&"),r=`${w.origin}${w.pathname}`;return h?`${r}?${h}`:r}static parseHttpHeaders(E){let _={};if(!E)return _;let w=E.trim().split(`\r
`);for(let g=0,h=w.length;g<h;g++){let r=w[g],H=r.indexOf(": ");H>0&&(_[r.substring(0,H)]=r.substring(H+2))}return _}static parseQueryParams(E){const _=[],w=new URLSearchParams(E);for(const[g,h]of w.entries())_.push({key:decodeURIComponent(g),value:decodeURIComponent(h)});return _}static generateUuid(){let E=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(_){const w=(E+16*Math.random())%16|0;return E=Math.floor(E/16),(_=="x"?w:3&w|8).toString(16)}))}static generateHashCode(E){let _=0;if(E.length===0)return _;for(let w=0;w<E.length;w++)_=(_<<5)-_+E.charCodeAt(w),_|=0;return _}static getRelativeUrl(E,_){try{const w=new URL(E),g=new URL(_);if(w.protocol=g.protocol,w.origin!==g.origin)return _;let h=F.relative(w.pathname.substr(0,w.pathname.lastIndexOf("/")),g.pathname.substr(0,g.pathname.lastIndexOf("/")));const r=h.length===0?1:0;return h+=g.pathname.substr(g.pathname.lastIndexOf("/")+r,g.pathname.length-1),g.pathname.length<h.length?g.pathname:h}catch{return _}}static getHostFromUrl(E){try{return new URL(E).host}catch{return null}}static parseUserAgent(E=null){try{const _=typeof E=="string"?E.toLowerCase():typeof navigator<"u"&&navigator.userAgent?navigator.userAgent.toLowerCase():"",w={name:""};return/edg/.test(_)?w.name="edge":/opr|opios/.test(_)?w.name="opera":/chrome|crios/.test(_)?w.name="chrome":/firefox|fxios/.test(_)?w.name="firefox":/safari/.test(_)&&(w.name="safari"),{browser:w}}catch{return{}}}static stringHasProtocol(E){return/(http(s?)):\/\//i.test(E)}static bufferSourceToDataView(E){return o.toDataView(E,DataView)}static bufferSourceToInt8(E){return o.toDataView(E,Uint8Array)}static uint8ArrayToString(E){return new TextDecoder("utf-8").decode(E)}static bufferSourceToHex(E){const _=o.bufferSourceToInt8(E);let w="";for(let g of _)g=g.toString(16),g.length===1&&(g="0"+g),w+=g;return w}static toDataView(E,_){const w=o.getArrayBuffer(E);let g=1;"BYTES_PER_ELEMENT"in DataView&&(g=DataView.BYTES_PER_ELEMENT);const h=((E.byteOffset||0)+E.byteLength)/g,r=(E.byteOffset||0)/g,H=Math.floor(Math.max(0,Math.min(r,h)));return new _(w,H,Math.floor(Math.min(H+Math.max(1/0,0),h))-H)}static getArrayBuffer(E){return E instanceof ArrayBuffer?E:E.buffer}static getCodecFamily(E){const{base:_,profile:w}=o._getCodecParts(E);switch(_){case"mp4a":switch(w){case"69":case"6b":case"40.34":return f.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 f.default.CODEC_FAMILIES.AAC;case"a5":return f.default.CODEC_FAMILIES.AC3;case"e6":return f.default.CODEC_FAMILIES.EC3;case"b2":return f.default.CODEC_FAMILIES.DTSX;case"a9":return f.default.CODEC_FAMILIES.DTSC}break;case"avc1":case"avc3":return f.default.CODEC_FAMILIES.AVC;case"hvc1":case"hvc3":return f.default.CODEC_FAMILIES.HEVC;default:return _}return _}static _getCodecParts(E){const[_,...w]=E.split(".");return{base:_,profile:w.join(".")}}}me.default=o},8986:function(wt,me,P){P.r(me),P.d(me,{getVersionString:function(){return f}});const F="5.2.1";function f(){return F}},893:function(wt,me,P){P.r(me);var F=P(8748);class f extends F.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 o=new f;me.default=o},8748:function(wt,me,P){P.r(me),me.default=class{extend(F,f){if(!F)return;let o=!!f&&f.override,p=!!f&&f.publicOnly;for(const E in F)!F.hasOwnProperty(E)||this[E]&&!o||p&&F[E].indexOf("public_")===-1||(this[E]=F[E])}}},5734:function(wt,me,P){P.r(me);var F=P(7252);class f extends F.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"}}me.default=f},3621:function(wt,me,P){P.r(me);var F=P(5734);class f extends F.default{}let o=new f;me.default=o},7252:function(wt,me,P){P.r(me),me.default=class{extend(F,f){if(!F)return;let o=!!f&&f.override,p=!!f&&f.publicOnly;for(const E in F)!F.hasOwnProperty(E)||this[E]&&!o||p&&F[E].indexOf("public_")===-1||(this[E]=F[E])}}},8854:function(wt,me,P){P.r(me),me.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:"codecPrivateData",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(wt,me,P){P.r(me);var F=P(8062),f=P(9415),o=P(9578),p=P(4770),E=P(5212),_=P(5915),w=P(6455),g=P(8854),h=P(1944),r=P(649),H=P(1036),G=P(893),le=P(1465),de=P(7153),De=P(138),ce=P(5274),Le=P(6517),Be=P(7393),ot=P(4740),Ge=P(7408),X=P(2436),Z=P(2655),Se=P(5876),Ne=P(6503),ke=P(5717),ht=P(7263),ye=P(7356);function pt(){let He,Fe,Ke,Pt;const Nt=this.context,kt=(0,Ne.default)(Nt).getInstance(),Ut=Number.isInteger||function(Y){return typeof Y=="number"&&isFinite(Y)&&Math.floor(Y)===Y};function ln(Y,he){if(!Y)throw new Error("adaptation is not defined");if(!he)throw new Error("type is not defined");if(Y.Representation&&Y.Representation.length){const at=_e(Y.Representation[0]);if(at&&at.some((Tt=>E.default.THUMBNAILS_SCHEME_ID_URIS.indexOf(Tt.schemeIdUri)>=0)))return he===E.default.IMAGE}if(Y.ContentComponent&&Y.ContentComponent.length>0){if(Y.ContentComponent.length>1)return he===E.default.MUXED;if(Y.ContentComponent[0].contentType===he)return!0}const et=he===E.default.TEXT?new RegExp("(ttml|vtt|wvtt|stpp)"):new RegExp(he);if(Y.Representation&&Y.Representation.length){const at=Y.Representation[0].codecs;if(et.test(at))return!0}if(Y.hasOwnProperty(g.default.MIME_TYPE))return et.test(Y.mimeType);if(Y.Representation){let at;for(let Tt=0;Tt<Y.Representation.length;Tt++)if(at=Y.Representation[Tt],at.hasOwnProperty(g.default.MIME_TYPE))return et.test(at.mimeType)}return!1}function an(Y){if(!Y)throw new Error("adaptation is not defined");if(Y.hasOwnProperty(g.default.SEGMENT_TEMPLATE)||Y.hasOwnProperty(g.default.SEGMENT_TIMELINE)||Y.hasOwnProperty(g.default.SEGMENT_LIST)||Y.hasOwnProperty(g.default.SEGMENT_BASE))return!0;if(Y.Representation&&Y.Representation.length>0){const he=Y.Representation[0];if(he.hasOwnProperty(g.default.SEGMENT_TEMPLATE)||he.hasOwnProperty(g.default.SEGMENT_TIMELINE)||he.hasOwnProperty(g.default.SEGMENT_LIST)||he.hasOwnProperty(g.default.SEGMENT_BASE))return!0}return!1}function En(Y){return ln(Y,E.default.TEXT)}function Oe(Y){return Y&&Y.Representation&&Y.Representation.sort(((he,et)=>he.bandwidth-et.bandwidth)),Y}function Ie(Y,he){return Y&&Y.Period&&Ut(he)&&Y.Period[he]?Y.Period[he].AdaptationSet:[]}function mt(Y){return Y&&Y.Period?Y.Period:[]}function It(Y,he,et){let at=null;if(Y&&Y.Representation&&Y.Representation.length>0){const Tt=Ut(he)&&he>=0&&he<Y.Representation.length?Y.Representation[he]:Y.Representation[0];Tt&&(at=Tt.mimeType+';codecs="'+Tt.codecs+'"',et&&Tt.width!==void 0&&(at+=';width="'+Tt.width+'";height="'+Tt.height+'"'))}return at&&(at=at.replace(/\sprofiles=[^;]*/g,"")),at}function Ye(Y){const he=V(Y);return he&&he.length>0}function V(Y){let he=[];if(!Y)return he;const et=B(Y);return he=he.concat(et),Y.hasOwnProperty(g.default.ADAPTATION_SET)&&Y[g.default.ADAPTATION_SET].length>0&&Y[g.default.ADAPTATION_SET].forEach((at=>{const Tt=B(at);he=he.concat(Tt)})),he}function B(Y){return Y&&Y.hasOwnProperty(g.default.CONTENT_PROTECTION)&&Y.ContentProtection.length!==0?Y[g.default.CONTENT_PROTECTION].map((he=>{const et=new _.default;return et.init(he),et})):[]}function Pe(Y){let he=!1;return Y&&Y.hasOwnProperty("type")&&(he=Y.type===g.default.DYNAMIC),he}function j(Y){if(!Y)return null;const he=Y[g.default.FRAMERATE];if(!he)return null;if(typeof he=="string"&&he.includes("/")){const[et,at]=he.split("/").map((Tt=>parseInt(Tt,10)));if(!isNaN(et)&&!isNaN(at)&&at!==0)return et/at}return parseInt(he)}function qe(Y,he){return he&&he.hasOwnProperty(Y)&&he[Y].length?he[Y].map((et=>{const at=new H.default;return at.init(et),at})):[]}function it(Y,he){if(!he)return[];let et=(function(at,Tt){if(!Tt||!Tt.length)return[];let st=Tt[0][at]||[];return st.length===0?[]:Tt.length===1?st:st.filter((_t=>Tt.slice(1).every((Zt=>Zt.hasOwnProperty(at)&&Zt[at].some((In=>In.schemeIdUri===_t.schemeIdUri&&In.value===_t.value))))))})(Y,he[g.default.REPRESENTATION]);return he.hasOwnProperty(Y)&&he[Y].length&&he[Y].forEach((at=>{et.some((Tt=>Tt.schemeIdUri===at.schemeIdUri&&Tt.value===at.value))||et.push(at)})),et.map((at=>{const Tt=new H.default;return Tt.init(at),Tt}))}function _e(Y){return qe(g.default.ESSENTIAL_PROPERTY,Y)}function Ue(Y){return qe(g.default.SUPPLEMENTAL_PROPERTY,Y)}function i(Y){return Y&&Y.hasOwnProperty(g.default.SEGMENT_SEQUENCE_PROPERTIES)&&Y[g.default.SEGMENT_SEQUENCE_PROPERTIES].length?Y[g.default.SEGMENT_SEQUENCE_PROPERTIES].map((he=>{const et=new ye.default(he);return et.init(he),et})):[]}function S(Y,he,et,at,Tt,st){const _t=new Se.default;(function(Vt,_n,gn,Jn,Pn){if(Vt.index=Pn,Vt.adaptation=gn,Vt.mediaInfo=Jn,_n.hasOwnProperty(g.default.ID)&&(Vt.id=_n.id),_n.hasOwnProperty(g.default.CODECS)&&(Vt.codecs=_n.codecs,Vt.codecFamily=ht.default.getCodecFamily(Vt.codecs)),_n.hasOwnProperty(g.default.DEPENDENCY_ID)){const xt=_n[g.default.DEPENDENCY_ID].toString().split(" ")[0];Vt.dependencyId=xt,Vt.dependentRepresentation=new Se.default,Vt.dependentRepresentation.id=xt}_n.hasOwnProperty(g.default.MIME_TYPE)&&(Vt.mimeType=_n[g.default.MIME_TYPE]),_n.hasOwnProperty(g.default.CODEC_PRIVATE_DATA)&&(Vt.codecPrivateData=_n.codecPrivateData),_n.hasOwnProperty(g.default.BANDWITH)&&(Vt.bandwidth=_n.bandwidth,Vt.bitrateInKbit=_n.bandwidth/1e3),_n.hasOwnProperty(g.default.WIDTH)&&(Vt.width=_n.width),_n.hasOwnProperty(g.default.HEIGHT)&&(Vt.height=_n.height),_n.hasOwnProperty(g.default.SCAN_TYPE)&&(Vt.scanType=_n.scanType),_n.hasOwnProperty(g.default.FRAMERATE)&&(Vt.frameRate=j(_n)),_n.hasOwnProperty(g.default.QUALITY_RANKING)&&(Vt.qualityRanking=_n[g.default.QUALITY_RANKING]),_n.hasOwnProperty(g.default.MAX_PLAYOUT_RATE)&&(Vt.maxPlayoutRate=_n.maxPlayoutRate),Vt.essentialProperties=_e(_n),Vt.supplementalProperties=Ue(_n),Vt.segmentSequenceProperties=i(_n),Vt.path=[gn.period.index,gn.index,Pn]})(_t,he,et,Y,st);const{segmentInfo:Zt,segmentInfoType:In}=(function(Vt){let _n,gn;return Vt.hasOwnProperty(g.default.SEGMENT_BASE)?(_n=Vt.SegmentBase,gn=g.default.SEGMENT_BASE):Vt.hasOwnProperty(g.default.SEGMENT_LIST)?(_n=Vt.SegmentList,gn=_n.hasOwnProperty(g.default.SEGMENT_TIMELINE)?g.default.SEGMENT_TIMELINE:g.default.SEGMENT_LIST):Vt.hasOwnProperty(g.default.SEGMENT_TEMPLATE)?(_n=Vt.SegmentTemplate,gn=_n.hasOwnProperty(g.default.SEGMENT_TIMELINE)?g.default.SEGMENT_TIMELINE:g.default.SEGMENT_TEMPLATE):gn=g.default.BASE_URL,{segmentInfo:_n,segmentInfoType:gn}})(he);return _t.segmentInfoType=In,(function(Vt,_n,gn,Jn,Pn,xt){if(Vt){if(Vt.hasOwnProperty(g.default.INITIALIZATION_MINUS)&&(gn.initialization=Vt.initialization.split("$Bandwidth$").join(Pn.bandwidth).split("$RepresentationID$").join(Pn.id)),Vt.hasOwnProperty(g.default.INITIALIZATION)){const Ft=Vt.Initialization;Ft.hasOwnProperty(g.default.SOURCE_URL)&&(gn.initialization=Ft.sourceURL),Ft.hasOwnProperty(g.default.RANGE)&&(gn.range=Ft.range)}else En(Jn)&&an(Jn)&&Jn.mimeType&&Jn.mimeType.indexOf("application/mp4")===-1&&(gn.range=0);Vt.hasOwnProperty(g.default.TIMESCALE)&&(gn.timescale=Vt.timescale),Vt.hasOwnProperty(g.default.DURATION)?gn.segmentDuration=Vt.duration/gn.timescale:_n===g.default.SEGMENT_TIMELINE&&(gn.segmentDuration=(function(Ft){if(!Ft||!Ft.S)return NaN;let Rt=Ft.S[0],fe=Ft.S[1];return Rt.hasOwnProperty("d")?Rt.d:fe.t-Rt.t})(Vt.SegmentTimeline)/gn.timescale,gn.k=(function(Ft){if(!Ft||!Ft.S)return 1;const Rt=Ft.S[0];return Rt.hasOwnProperty(g.default.K)?Rt.k:1})(Vt.SegmentTimeline)),Vt.hasOwnProperty(g.default.MEDIA)&&(gn.media=Vt.media),Vt.hasOwnProperty(g.default.K)&&(gn.k=Vt.k||1),Vt.hasOwnProperty(g.default.START_NUMBER)&&(gn.startNumber=parseInt(Vt.startNumber)),Vt.hasOwnProperty(g.default.INDEX_RANGE)&&(gn.indexRange=Vt.indexRange),Vt.hasOwnProperty(g.default.PRESENTATION_TIME_OFFSET)&&(gn.presentationTimeOffset=Vt.presentationTimeOffset/gn.timescale),Vt.hasOwnProperty(g.default.AVAILABILITY_TIME_OFFSET)?gn.availabilityTimeOffset=Vt.availabilityTimeOffset:xt&&xt.availabilityTimeOffset!==void 0&&(gn.availabilityTimeOffset=xt.availabilityTimeOffset),Vt.hasOwnProperty(g.default.AVAILABILITY_TIME_COMPLETE)?gn.availabilityTimeComplete=Vt.availabilityTimeComplete!=="false":xt&&xt.availabilityTimeComplete!==void 0&&(gn.availabilityTimeComplete=xt.availabilityTimeComplete),Vt.hasOwnProperty(g.default.END_NUMBER)&&(gn.endNumber=Vt[g.default.END_NUMBER]),gn.mseTimeOffset=(function(Ft){const Rt=Ft.presentationTimeOffset;return Ft.adaptation.period.start-Rt})(gn)}})(Zt,In,_t,at,he,Tt),(function(Vt){isNaN(Vt.width)||isNaN(Vt.height)||isNaN(Vt.frameRate)||(Vt.pixelsPerSecond=Math.max(1,Vt.width*Vt.height*Vt.frameRate),isNaN(Vt.bandwidth)||(Vt.bitsPerPixel=Vt.bandwidth/Vt.pixelsPerSecond))})(_t),_t}function I(Y){return ln(Y,E.default.MUXED)?E.default.MUXED:ln(Y,E.default.AUDIO)?E.default.AUDIO:(function(he){return ln(he,E.default.VIDEO)})(Y)?E.default.VIDEO:En(Y)?E.default.TEXT:(function(he){return ln(he,E.default.IMAGE)})(Y)?E.default.IMAGE:(Fe.warn("Unknown Preselection stream type"),null)}function $(Y,he){if(Y&&Y.hasOwnProperty(g.default.PRESELECTION_COMPONENTS)&&Array.isArray(he))return String(Y.preselectionComponents).split(" ").map((et=>he.find((at=>at.id===et))))}function ie(Y,he){if(!Y||!Y.hasOwnProperty(g.default.PRESELECTION_COMPONENTS)||!Array.isArray(he))return;const et=String(Y.preselectionComponents).split(" ");return he.find((at=>at.id===et[0]))}function be(Y,he){if(!Y)throw new Error("Period cannot be null or undefined");let et=Ge.default.DEFAULT_ID+"_"+he;return Y.hasOwnProperty(g.default.ID)&&Y.id.toString().length>0&&Y.id!=="__proto__"&&(et=Y.id.toString()),et}function tt(Y,he,et){const at=[];let Tt;if(!Y)return at;for(Tt=0;Tt<Y.length;Tt++){const st=new de.default;if(st.timescale=1,st.representation=he,!Y[Tt].hasOwnProperty(E.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");st.schemeIdUri=Y[Tt].schemeIdUri,Y[Tt].hasOwnProperty(g.default.TIMESCALE)&&(st.timescale=Y[Tt].timescale),Y[Tt].hasOwnProperty(g.default.VALUE)&&(st.value=Y[Tt].value),at.push(st),st.period=et}return at}function ae(Y){const he=[],et=Y.BaseURL||[Y.baseUri];let at=!1;return et.some((Tt=>{if(Tt){const st=new f.default;let _t=Tt.__text||Tt;return kt.isRelative(_t)&&(at=!0,Y.baseUri&&(_t=kt.resolve(_t,Y.baseUri))),st.url=_t,Tt.hasOwnProperty(g.default.SERVICE_LOCATION)&&Tt.serviceLocation.length?st.serviceLocation=Tt.serviceLocation:st.serviceLocation=_t,Tt.hasOwnProperty(g.default.DVB_PRIORITY)&&(st.dvbPriority=Tt[g.default.DVB_PRIORITY]),Tt.hasOwnProperty(g.default.DVB_WEIGHT)&&(st.dvbWeight=Tt[g.default.DVB_WEIGHT]),Tt.hasOwnProperty(g.default.AVAILABILITY_TIME_OFFSET)&&(st.availabilityTimeOffset=Tt[g.default.AVAILABILITY_TIME_OFFSET]),Tt.hasOwnProperty(g.default.AVAILABILITY_TIME_COMPLETE)&&(st.availabilityTimeComplete=Tt[g.default.AVAILABILITY_TIME_COMPLETE]!=="false"),he.push(st),at}})),he}function ze(Y){const he=new w.default;return he.serverUrl=Y.__text,Y.hasOwnProperty(g.default.DEFAULT_SERVICE_LOCATION)&&(he.defaultServiceLocation=Y[g.default.DEFAULT_SERVICE_LOCATION],he.defaultServiceLocationArray=he.defaultServiceLocation.split(" ")),Y.hasOwnProperty(g.default.QUERY_BEFORE_START)&&(he.queryBeforeStart=Y[g.default.QUERY_BEFORE_START].toLowerCase()==="true"),Y.hasOwnProperty(g.default.CLIENT_REQUIREMENT)&&(he.clientRequirement=Y[g.default.CLIENT_REQUIREMENT].toLowerCase()!=="false"),he}function je(Y){const he=new p.default,et=Y.schemeIdUri||Y[g.default.CMCD_PARAMETERS]?.schemeIdUri,at=[E.default.CTA_5004_2023_SCHEME,E.default.CTA_5004_2025_SCHEME].includes(et);return Y.hasOwnProperty(g.default.CMCD_PARAMETERS)&&at&&(he.cmcdParameters=new o.default,he.cmcdParameters.init(Y[g.default.CMCD_PARAMETERS])),Y.hasOwnProperty(g.default.SERVICE_LOCATIONS)&&Y[g.default.SERVICE_LOCATIONS]!==""&&(he.serviceLocations=Y[g.default.SERVICE_LOCATIONS],he.serviceLocationsArray=he.serviceLocations.toString().split(" ")),Y.hasOwnProperty(g.default.ADAPTATION_SETS)&&Y[g.default.ADAPTATION_SETS]!==""&&(he.adaptationSets=Y[g.default.ADAPTATION_SETS],he.adaptationSetsArray=he.adaptationSets.toString().split(" ")),he}return He={getAccessibilityForAdaptation:function(Y){return Y&&Y.hasOwnProperty(g.default.ACCESSIBILITY)&&Y[g.default.ACCESSIBILITY].length?Y[g.default.ACCESSIBILITY].map((he=>{const et=new H.default;return et.init(he),et})):[]},getAdaptationForId:function(Y,he,et){const at=Ie(he,et);let Tt,st;for(Tt=0,st=at.length;Tt<st;Tt++)if(at[Tt].hasOwnProperty(g.default.ID)&&at[Tt].id===Y)return at[Tt];return null},getAdaptationForIndex:function(Y,he,et){const at=Ie(he,et);return at.length>0&&Ut(Y)?at[Y]:null},getAdaptationsForPeriod:function(Y){const he=Y&&Ut(Y.index)?Y.mpd.manifest.Period[Y.index]:null,et=[];let at,Tt,st;if(he&&he.AdaptationSet)for(st=0;st<he.AdaptationSet.length;st++)Tt=he.AdaptationSet[st],at=new F.default,Tt.hasOwnProperty(g.default.ID)&&(at.id=Tt.id),at.index=st,at.period=Y,at.type=I(Tt),et.push(at);return et},getAdaptationsForType:function(Y,he,et){const at=Ie(Y,he);let Tt,st;const _t=[];for(Tt=0,st=at.length;Tt<st;Tt++)ln(at[Tt],et)&&_t.push(Oe(at[Tt]));return _t},getAudioChannelConfigurationForAdaptation:function(Y){return Y&&Y.hasOwnProperty(g.default.AUDIO_CHANNEL_CONFIGURATION)&&Y[g.default.AUDIO_CHANNEL_CONFIGURATION].length?Y[g.default.AUDIO_CHANNEL_CONFIGURATION].map((he=>{const et=new H.default;return et.init(he),et})):[]},getAudioChannelConfigurationForRepresentation:function(Y){return Y&&Y.hasOwnProperty(g.default.AUDIO_CHANNEL_CONFIGURATION)&&Y[g.default.AUDIO_CHANNEL_CONFIGURATION].length?Y[g.default.AUDIO_CHANNEL_CONFIGURATION].map((he=>{const et=new H.default;return et.init(he),et})):[]},getAvailabilityStartTime:function(Y){return Y&&Y.hasOwnProperty(g.default.AVAILABILITY_START_TIME)&&Y.availabilityStartTime!==null?Y.availabilityStartTime.getTime():null},getBandwidth:function(Y){return Y&&Y.bandwidth?Y.bandwidth:NaN},getBaseURLsFromElement:ae,getBitrateListForAdaptation:function(Y){const he=Oe(Y);return(he&&he.Representation?he.Representation:[]).map((et=>({bandwidth:et.bandwidth,width:et.width||0,height:et.height||0,scanType:et.scanType||null,id:et.id||null})))},getCodec:It,getCodecForPreselection:function(Y,he,et){let at=null;if(Y&&he){let Tt=It(ie(Y,he),0,et);if(Y.hasOwnProperty(g.default.CODECS)){let st=Y.codecs;at=Tt.replace(/(codecs=")[^"]*(")/,`$1${st}$2`),Fe.info("Preselection has own codecs-attribute: replacing in MainAdaptationSet (was: "+Tt+"), new Preselection codec is: "+at)}else at=Tt}return at},getCombinedEssentialPropertiesForAdaptationSet:function(Y){return it(g.default.ESSENTIAL_PROPERTY,Y)},getCombinedSupplementalPropertiesForAdaptationSet:function(Y){return it(g.default.SUPPLEMENTAL_PROPERTY,Y)},getContentProtectionByAdaptation:function(Y){return B(Y)},getContentProtectionByManifest:function(Y){let he=[];if(!Y)return he;const et=B(Y);return he=he.concat(et),Y.hasOwnProperty(g.default.PERIOD)&&Y[g.default.PERIOD].length>0&&Y[g.default.PERIOD].forEach((at=>{const Tt=V(at);he=he.concat(Tt)})),he},getContentProtectionByPeriod:V,getContentSteering:function(Y){if(Y&&Y.hasOwnProperty(g.default.CONTENT_STEERING))return ze(Y[g.default.CONTENT_STEERING][0])},getDuration:function(Y){let he;return he=Y&&Y.hasOwnProperty(g.default.MEDIA_PRESENTATION_DURATION)?Y.mediaPresentationDuration:Y&&Y.type==="dynamic"?Number.POSITIVE_INFINITY:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE,he},getEssentialProperties:_e,getEventStreamForAdaptationSet:function(Y,he,et){let at,Tt,st;return Y&&Y.Period&&he&&he.period&&Ut(he.period.index)&&(Tt=Y.Period[he.period.index],Tt&&Tt.AdaptationSet&&Ut(he.index)&&(st=Tt.AdaptationSet[he.index],st&&(at=st.InbandEventStream))),tt(at,null,et)},getEventStreamForRepresentation:function(Y,he,et){let at,Tt,st,_t;return Y&&Y.Period&&he&&he.adaptation&&he.adaptation.period&&Ut(he.adaptation.period.index)&&(Tt=Y.Period[he.adaptation.period.index],Tt&&Tt.AdaptationSet&&Ut(he.adaptation.index)&&(st=Tt.AdaptationSet[he.adaptation.index],st&&st.Representation&&Ut(he.index)&&(_t=st.Representation[he.index],_t&&(at=_t.InbandEventStream)))),tt(at,he,et)},getEventsForPeriod:function(Y){const he=Y&&Y.mpd&&Y.mpd.manifest?Y.mpd.manifest:null,et=he?he.Period:null,at=et&&Y&&Ut(Y.index)?et[Y.index].EventStream:null,Tt=[];let st,_t;if(at)for(st=0;st<at.length;st++){const Zt=new de.default;if(Zt.period=Y,Zt.timescale=1,!at[st].hasOwnProperty(E.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");for(Zt.schemeIdUri=at[st][E.default.SCHEME_ID_URI],at[st].hasOwnProperty(g.default.TIMESCALE)&&(Zt.timescale=at[st][g.default.TIMESCALE]),at[st].hasOwnProperty(g.default.VALUE)&&(Zt.value=at[st][g.default.VALUE]),at[st].hasOwnProperty(g.default.PRESENTATION_TIME_OFFSET)&&(Zt.presentationTimeOffset=at[st][g.default.PRESENTATION_TIME_OFFSET]),_t=0;at[st].Event&&_t<at[st].Event.length;_t++){const In=at[st].Event[_t],Vt=new le.default;Vt.presentationTime=0,Vt.eventStream=Zt,In.hasOwnProperty(g.default.PRESENTATION_TIME)&&(Vt.presentationTime=In.presentationTime);const _n=Zt.presentationTimeOffset?Zt.presentationTimeOffset/Zt.timescale:0;Vt.calculatedPresentationTime=Vt.presentationTime/Zt.timescale+Y.start-_n,In.hasOwnProperty(g.default.DURATION)&&(Vt.duration=In.duration/Zt.timescale),In.hasOwnProperty(g.default.ID)?Vt.id=parseInt(In.id):Vt.id=null,In.Signal&&In.Signal.Binary&&In.Signal.Binary.__text?Vt.messageData=Pt.decodeArray(In.Signal.Binary.__text.toString()):Vt.messageData=In.messageData||In.__cdata||In.__text,Tt.push(Vt)}}return Tt},getFramerate:j,getId:function(Y){return Y&&Y[g.default.ID]||null},getIndexForAdaptation:function(Y,he,et){if(!Y)return-1;const at=Ie(he,et);for(let Tt=0;Tt<at.length;Tt++)if((0,Be.default)(Nt).getInstance().areEqual(at[Tt],Y))return Tt;return-1},getIsDynamic:Pe,getIsFragmented:an,getIsText:En,getIsTypeOf:ln,getLabelsForAdaptation:function(Y){if(!Y||!Y.Label)return[];const he=[];for(let et=0;et<Y.Label.length;et++)he.push({lang:Y.Label[et].lang,text:Y.Label[et].__text||Y.Label[et]});return he},getLanguageForAdaptation:function(Y){let he="";return Y&&Y.hasOwnProperty(g.default.LANG)&&(he=Y.lang),he},getLocation:function(Y){return Y&&Y.hasOwnProperty(g.default.LOCATION)?Y[g.default.LOCATION].map((he=>{const et=he.__text||he,at=he.hasOwnProperty(g.default.SERVICE_LOCATION)?he[g.default.SERVICE_LOCATION]:null;return new Le.default(et,at)})):[]},getMainAdaptationSetForPreselection:ie,getCommonRepresentationForPreselection:function(Y,he){if(!Y||!Array.isArray(he))return;const et=ie(Y,he);return et?et.Representation[0]:void 0},getManifestUpdatePeriod:function(Y,he=0){let et=NaN;return Y&&Y.hasOwnProperty(g.default.MINIMUM_UPDATE_PERIOD)&&(et=Y.minimumUpdatePeriod),isNaN(et)?et:Math.max(et-he,1)},getMimeType:function(Y){return Y&&Y.Representation&&Y.Representation.length>0?Y.Representation[0].mimeType:null},getMpd:function(Y){const he=new ce.default;return Y&&(he.manifest=Y,Y.hasOwnProperty(g.default.AVAILABILITY_START_TIME)?he.availabilityStartTime=new Date(Y.availabilityStartTime.getTime()):Y.loadedTime&&(he.availabilityStartTime=new Date(Y.loadedTime.getTime())),Y.hasOwnProperty(g.default.AVAILABILITY_END_TIME)&&(he.availabilityEndTime=new Date(Y.availabilityEndTime.getTime())),Y.hasOwnProperty(g.default.MINIMUM_UPDATE_PERIOD)&&(he.minimumUpdatePeriod=Y.minimumUpdatePeriod),Y.hasOwnProperty(g.default.MEDIA_PRESENTATION_DURATION)&&(he.mediaPresentationDuration=Y.mediaPresentationDuration),Y.hasOwnProperty(g.default.SUGGESTED_PRESENTATION_DELAY)&&(he.suggestedPresentationDelay=Y.suggestedPresentationDelay),Y.hasOwnProperty(g.default.TIMESHIFT_BUFFER_DEPTH)&&(he.timeShiftBufferDepth=Y.timeShiftBufferDepth),Y.hasOwnProperty(g.default.MAX_SEGMENT_DURATION)&&(he.maxSegmentDuration=Y.maxSegmentDuration),Y.hasOwnProperty(g.default.PUBLISH_TIME)&&(he.publishTime=new Date(Y.publishTime))),he},getPatchLocation:function(Y){return Y&&Y.hasOwnProperty(g.default.PATCH_LOCATION)?Y[g.default.PATCH_LOCATION].map((he=>{const et=he.__text||he,at=he.hasOwnProperty(g.default.SERVICE_LOCATION)?he[g.default.SERVICE_LOCATION]:null;let Tt=he.hasOwnProperty(g.default.TTL)?1e3*parseFloat(he[g.default.TTL]):NaN;return new ot.default(et,at,Tt)})):[]},getPreselectionIsTypeOf:function(Y,he,et){if(!Y)throw new Error("preselection is not defined");if(!he)throw new Error("adaptations is not defined");if(!et)throw new Error("type is not defined");const at=ie(Y,he);return!!at&&ln(at,et)},getPreselectionsForPeriod:function(Y){const he=Y&&Ut(Y.index)?Y.mpd.manifest.Period[Y.index]:null,et=[];let at,Tt,st;if(he&&he.Preselection)for(st=0;st<he.Preselection.length;st++){Tt=he.Preselection[st],at=new X.default;const _t=$(Tt,he.AdaptationSet);_t.every((Zt=>!!Zt))&&_t.length===1?(Tt.hasOwnProperty(g.default.ID)&&(at.id=Tt.id),at.index=st,at.period=Y,Tt.hasOwnProperty(g.default.TAG)&&(at.tag=Tt.tag),Tt.hasOwnProperty(g.default.PRESELECTION_COMPONENTS)?at.preselectionComponents=_t:Fe.warn("Preselection (index: "+at.index+") missing component(s)"),Tt.hasOwnProperty(g.default.ORDER)&&(at.order=Tt.order),at.type=I(_t[0]),et.push(at)):Fe.warn("Preselection removed because we don't support multi-representation preselections or not all components available.")}return et},getProducerReferenceTimesForAdaptation:function(Y){const he=Y&&Y.hasOwnProperty(g.default.PRODUCER_REFERENCE_TIME)?Y[g.default.PRODUCER_REFERENCE_TIME]:[];(Y&&Y.hasOwnProperty(g.default.REPRESENTATION)?Y[g.default.REPRESENTATION]:[]).forEach((at=>{at.hasOwnProperty(g.default.PRODUCER_REFERENCE_TIME)&&he.push(...at[g.default.PRODUCER_REFERENCE_TIME])}));const et=[];return he.forEach((at=>{const Tt=new Z.default;at.hasOwnProperty(g.default.ID)&&(Tt[g.default.ID]=parseInt(at[g.default.ID]),at.hasOwnProperty(g.default.WALL_CLOCK_TIME)&&(Tt[g.default.WALL_CLOCK_TIME]=at[g.default.WALL_CLOCK_TIME],at.hasOwnProperty(g.default.PRESENTATION_TIME)&&(Tt[g.default.PRESENTATION_TIME]=at[g.default.PRESENTATION_TIME],at.hasOwnProperty(g.default.INBAND)&&(Tt[g.default.INBAND]=at[g.default.INBAND]!=="false"),at.hasOwnProperty(g.default.TYPE)&&(Tt[g.default.TYPE]=at[g.default.TYPE]),et.push(Tt))))})),et},getPublishTime:function(Y){return Y&&Y.hasOwnProperty(g.default.PUBLISH_TIME)?new Date(Y[g.default.PUBLISH_TIME]):null},getRealPeriodForIndex:function(Y,he){const et=mt(he);return et.length>0&&Ut(Y)?et[Y]:null},getRealPeriods:mt,getRegularPeriods:function(Y){const he=!!Y&&Pe(Y.manifest),et=[];let at,Tt,st=null,_t=null,Zt=null,In=null;for(Tt=0,at=Y&&Y.manifest&&Y.manifest.Period?Y.manifest.Period.length:0;Tt<at;Tt++)_t=Y.manifest.Period[Tt],_t.hasOwnProperty(g.default.START)?(In=new Ge.default,In.start=_t.start):st!==null&&st.hasOwnProperty(g.default.DURATION)&&Zt!==null?(In=new Ge.default,In.start=parseFloat((Zt.start+Zt.duration).toFixed(5))):Tt!==0||he||(In=new Ge.default,In.start=0),Zt!==null&&isNaN(Zt.duration)&&(In!==null?Zt.duration=parseFloat((In.start-Zt.start).toFixed(5)):Fe.warn("First period duration could not be calculated because lack of start and duration period properties. This will cause timing issues during playback")),In!==null&&(In.id=be(_t,Tt),In.index=Tt,In.mpd=Y,In.isEncrypted=Ye(_t),_t.hasOwnProperty(g.default.DURATION)&&(In.duration=_t.duration),Zt&&(Zt.nextPeriodId=In.id),et.push(In),st=_t,Zt=In),_t=null,In=null;return et.length===0||Zt!==null&&isNaN(Zt.duration)&&(Zt.duration=parseFloat(((function(Vt){(function(){if(!Ke||!Ke.hasOwnProperty("error"))throw new Error(E.default.MISSING_CONFIG_ERROR)})();const _n=Pe(Vt.mpd.manifest);let gn;return Vt.mpd.manifest.mediaPresentationDuration?gn=Vt.mpd.manifest.mediaPresentationDuration:Vt.duration?gn=Vt.duration:_n?gn=Number.POSITIVE_INFINITY:Ke.error(new h.default(G.default.MANIFEST_ERROR_ID_PARSE_CODE,"Must have @mediaPresentationDuration on MPD or an explicit @duration on the last period.",Vt)),gn})(Zt)-Zt.start).toFixed(5))),et},getRepresentationCount:function(Y){return Y&&Y.Representation?Y.Representation.length:0},getRepresentationFor:function(Y,he){return he&&he.Representation&&he.Representation.length>0&&Ut(Y)?he.Representation[Y]:null},getRepresentationSortFunction:function(){return(Y,he)=>Y.bandwidth-he.bandwidth},getRepresentationsForAdaptation:function(Y,he){const et=[],at=(function(st){if(st&&st.period&&Ut(st.period.index)){const _t=st.period.mpd.manifest.Period[st.period.index];if(_t&&_t.AdaptationSet&&Ut(st.index))return Oe(_t.AdaptationSet[st.index])}})(Y);let Tt;if(at&&at.Representation){if(Y&&Y.period&&Ut(Y.period.index)){const st=ae(Y.period.mpd.manifest);st&&(Tt=st[0])}for(let st=0,_t=at.Representation.length;st<_t;++st){const Zt=S(he,at.Representation[st],Y,at,Tt,st);et.push(Zt)}}return et},getRolesForAdaptation:function(Y){return Y&&Y.hasOwnProperty(g.default.ROLE)&&Y[g.default.ROLE].length?Y[g.default.ROLE].map((he=>{he.schemeIdUri===E.default.DASH_ROLE_SCHEME_ID&&he.value==="Main"&&(he.value=g.default.MAIN);const et=new H.default;return et.init(he),et})):[]},getSegmentAlignment:function(Y){return!(!Y||!Y.hasOwnProperty(g.default.SEGMENT_ALIGNMENT))&&Y[g.default.SEGMENT_ALIGNMENT]==="true"},getSegmentSequencePropertiesForAdaptationSet:function(Y){const he=[];return Y&&(he.push(...i(Y)),Y.Representation&&Y.Representation.length&&Y.Representation.forEach((et=>{he.push(...i(et))}))),he},getSelectionPriority:function(Y){try{const he=Y&&Y.selectionPriority!==void 0?parseInt(Y.selectionPriority):1;return isNaN(he)?1:he}catch{return 1}},getServiceDescriptions:function(Y){const he=[];if(Y&&Y.hasOwnProperty(g.default.SERVICE_DESCRIPTION))for(const et of Y.ServiceDescription){let at=null,Tt=null,st=null,_t=null,Zt=null,In=null,Vt=null,_n=null;for(const gn in et)if(et.hasOwnProperty(gn))if(gn===g.default.ID)at=et[gn];else if(gn===g.default.SERVICE_DESCRIPTION_SCOPE)Tt=et[gn].schemeIdUri;else if(gn===g.default.SERVICE_DESCRIPTION_LATENCY)st={target:parseInt(et[gn].target),max:parseInt(et[gn].max),min:parseInt(et[gn].min),referenceId:parseInt(et[gn].referenceId)};else if(gn===g.default.SERVICE_DESCRIPTION_PLAYBACK_RATE)_t={max:parseFloat(et[gn].max),min:parseFloat(et[gn].min)};else if(gn===g.default.SERVICE_DESCRIPTION_OPERATING_QUALITY)Zt={mediaType:et[gn].mediaType,max:parseInt(et[gn].max),min:parseInt(et[gn].min),target:parseInt(et[gn].target),type:et[gn].type,maxQualityDifference:parseInt(et[gn].maxQualityDifference)};else if(gn===g.default.SERVICE_DESCRIPTION_OPERATING_BANDWIDTH)In={mediaType:et[gn].mediaType,max:parseInt(et[gn].max),min:parseInt(et[gn].min),target:parseInt(et[gn].target)};else if(gn===g.default.CONTENT_STEERING){let Jn=et[gn];Jn=Array.isArray(Jn)?Jn.at(Jn.length-1):Jn,Vt=ze(Jn)}else gn===g.default.CLIENT_DATA_REPORTING&&(_n=je(et[gn]));he.push({id:at,schemeIdUri:Tt,latency:st,playbackRate:_t,operatingQuality:Zt,operatingBandwidth:In,contentSteering:Vt,clientDataReporting:_n})}return he},getSubSegmentAlignment:function(Y){return!(!Y||!Y.hasOwnProperty(g.default.SUB_SEGMENT_ALIGNMENT))&&Y[g.default.SUB_SEGMENT_ALIGNMENT]==="true"},getSuggestedPresentationDelay:function(Y){return Y&&Y.hasOwnProperty(g.default.SUGGESTED_PRESENTATION_DELAY)?Y.suggestedPresentationDelay:null},getSupplementalProperties:Ue,getUTCTimingSources:function(Y){const he=Pe(Y),et=!!Y&&Y.hasOwnProperty(g.default.AVAILABILITY_START_TIME),at=Y?Y.UTCTiming:null,Tt=[];return(he||et)&&at&&at.forEach((function(st){const _t=new ke.default;st.hasOwnProperty(E.default.SCHEME_ID_URI)&&(_t.schemeIdUri=st.schemeIdUri,st.hasOwnProperty(g.default.VALUE)&&(_t.value=st.value.toString(),Tt.push(_t)))})),Tt},getViewpointForAdaptation:function(Y){return Y&&Y.hasOwnProperty(g.default.VIEWPOINT)&&Y[g.default.VIEWPOINT].length?Y[g.default.VIEWPOINT].map((he=>{const et=new H.default;return et.init(he),et})):[]},hasProfile:function(Y,he){let et=!1;return Y&&Y.profiles&&Y.profiles.length>0&&(et=Y.profiles.indexOf(he)!==-1),et},isPeriodEncrypted:Ye,setConfig:function(Y){Y&&(Y.errHandler&&(Ke=Y.errHandler),Y.BASE64&&(Pt=Y.BASE64))}},Fe=(0,r.default)(Nt).getInstance().getLogger(He),He}pt.__dashjs_factory_name="DashManifestModel",me.default=De.default.getSingletonFactory(pt)},8062:function(wt,me,P){P.r(me),me.default=class{constructor(){this.period=null,this.index=-1,this.id=null,this.type=null}}},9415:function(wt,me,P){P.r(me);class F{constructor(o,p,E,_){this.url=o||"",this.serviceLocation=p||o||"",this.dvbPriority=E||1,this.dvbWeight=_||1,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0,this.queryParams={}}}F.DEFAULT_DVB_PRIORITY=1,F.DEFAULT_DVB_WEIGHT=1,me.default=F},9578:function(wt,me,P){P.r(me);var F=P(1036),f=P(5212);class o extends F.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(" "):[f.default.CMCD_DEFAULT_INCLUDE_IN_REQUESTS],this.schemeIdUri=E.schemeIdUri)}}me.default=o},4770:function(wt,me,P){P.r(me),me.default=class{constructor(){this.adaptationSets=null,this.adaptationSetsArray=[],this.cmcdParameters=null,this.serviceLocations=null,this.serviceLocationsArray=[]}}},5915:function(wt,me,P){P.r(me);var F=P(1349),f=P(1036),o=P(8854);class p extends f.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(_){if(super.init(_),_){this.ref=_.hasOwnProperty(o.default.REF)?_[o.default.REF]:null,this.refId=_.hasOwnProperty(o.default.REF_ID)?_[o.default.REF_ID]:null,this.robustness=_.hasOwnProperty(o.default.ROBUSTNESS)?_[o.default.ROBUSTNESS]:null,this.cencDefaultKid=_.hasOwnProperty(o.default.CENC_DEFAULT_KID)?_[o.default.CENC_DEFAULT_KID]:null,this.pssh=_.hasOwnProperty(o.default.PSSH)?_[o.default.PSSH]:null,this.pro=_.hasOwnProperty(o.default.PRO)?_[o.default.PRO]:null,this.laUrl=_.hasOwnProperty(o.default.LA_URL)?_[o.default.LA_URL]:_.hasOwnProperty(o.default.LA_URL_LOWER_CASE)?_[o.default.LA_URL_LOWER_CASE]:null;const w=Object.keys(_).find((h=>h.toLowerCase()===o.default.CERT_URL.toLowerCase())),g=w?_[w]:null;this.certUrls=F.default.normalizeCertUrls(g)}}mergeAttributesFromReference(_){if(["schemeIdUri","value","id","robustness","cencDefaultKid","pro","pssh","laUrl"].forEach((w=>{this[w]===null&&(this[w]=_[w])})),_.certUrls&&_.certUrls.length){const w=new Set(this.certUrls.map((g=>`${g.url}||${g.certType||""}`)));_.certUrls.forEach((g=>{const h=`${g.url}||${g.certType||""}`;w.has(h)||this.certUrls.push({url:g.url,certType:g.certType||null})}))}}}me.default=p},6455:function(wt,me,P){P.r(me),me.default=class{constructor(){this.defaultServiceLocation=null,this.defaultServiceLocationArray=[],this.queryBeforeStart=!1,this.serverUrl=null,this.clientRequirement=!0}}},1036:function(wt,me,P){P.r(me);var F=P(8854);me.default=class{constructor(){this.schemeIdUri=null,this.value=null,this.id=null}init(f){f&&(this.schemeIdUri=f.schemeIdUri?f.schemeIdUri:null,this.value=f.value!==null&&f.value!==void 0?f.value.toString():null,this.id=f.id?f.id:null,f[F.default.DVB_URL]&&(this.dvbUrl=f[F.default.DVB_URL]),f[F.default.DVB_MIMETYPE]&&(this.dvbMimeType=f[F.default.DVB_MIMETYPE]),f[F.default.DVB_FONTFAMILY]&&(this.dvbFontFamily=f[F.default.DVB_FONTFAMILY]))}inArray(f){return!!f&&f.some((o=>this.schemeIdUri===o.schemeIdUri&&(this.value?this.value.toString().match(o.value):"".match(o.value))))}}},1465:function(wt,me,P){P.r(me),me.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(wt,me,P){P.r(me),me.default=class{constructor(){this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri="",this.presentationTimeOffset=0}}},5274:function(wt,me,P){P.r(me),me.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(wt,me,P){P.r(me),me.default=class{constructor(F,f){this.url=F||"",this.serviceLocation=f||null,this.queryParams={}}}},4740:function(wt,me,P){P.r(me),me.default=class{constructor(F,f,o){this.url=F||"",this.serviceLocation=f||null,this.ttl=o||NaN,this.queryParams={}}}},7408:function(wt,me,P){P.r(me);class F{constructor(){this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null,this.nextPeriodId=null,this.isEncrypted=!1}}F.DEFAULT_ID="defaultId",me.default=F},2436:function(wt,me,P){P.r(me),me.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(wt,me,P){P.r(me),me.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(wt,me,P){P.r(me);var F=P(8854);me.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.codecPrivateData=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 this.initialization!==null||this.range!==null}hasSegments(){return this.segmentInfoType!==F.default.BASE_URL&&this.segmentInfoType!==F.default.SEGMENT_BASE&&!this.indexRange}isBootstrapRepresentation(){return!(!this.segmentSequenceProperties||this.segmentSequenceProperties.length===0)&&this.segmentSequenceProperties.some((f=>f.isBootstrapConfiguration()))}}},7356:function(wt,me,P){P.r(me),me.default=class{constructor(){this.cadence=1,this.sapType=0,this.event=!0,this.alignment=null}init(F){F&&(this.cadence=F.cadence===void 0||isNaN(F.cadence)?1:F.cadence,this.sapType=F.sapType===void 0||isNaN(F.sapType)?0:F.sapType,this.event=F.event===void 0||F.event,this.alignment=F.alignment!==void 0?F.alignment:null)}isBootstrapConfiguration(){return this.cadence===1&&(this.sapType===0||this.sapType===1)}}},5717:function(wt,me,P){P.r(me),me.default=class{constructor(){this.schemeIdUri="",this.value=""}}},9839:function(wt,me,P){P.r(me),P.d(me,{default:function(){return Hl}});var F=P(138),f=P(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"},p=P(649),E=P(8261);function _(n){n=n||{};const e=this.context,t=n.dashMetrics;let l,c,T;return l={getSwitchRequest:function(D){try{const R=(0,f.default)(e).create();R.rule=this.getClassName();const d=D.getMediaInfo(),b=D.getMediaType(),M=t.getCurrentBufferState(b),m=D.getScheduleController(),u=D.getAbrController(),N=D.getStreamInfo(),O=N?N.id:null,L=N&&N.manifestInfo?N.manifestInfo.isDynamic:null,x=D.getThroughputController(),U=x.getSafeAverageThroughput(b),K=x.getAverageLatency(b);return isNaN(U)||!M||u.getAbandonmentStateFor(O,b)===o.ALLOW_LOAD&&(M.state===o.BUFFER_LOADED||L)&&(R.representation=u.getOptimalRepresentationForBitrate(d,U,!0),R.priority=c.get().streaming.abr.rules.throughputRule.priority,R.reason={throughput:U,latency:K,message:`[ThroughputRule]: Switching to Representation with bitrate ${R.representation?R.representation.bitrateInKbit:"n/a"} kbit/s. Throughput: ${U}`},m.setTimeToLoadDelay(0)),R}catch(R){return T.error(R),(0,f.default)(e).create()}},reset:function(){}},T=(0,p.default)(e).getInstance().getLogger(l),c=(0,E.default)(e).getInstance(),l}_.__dashjs_factory_name="ThroughputRule";var w=F.default.getClassFactory(_),g=P(8850),h=P(3621),r=P(5212),H=P(1191);function G(n){n=n||{};const e=this.context,t=(0,g.default)(e).getInstance(),l=n.dashMetrics,c=(0,E.default)(e).getInstance();let T,D,R;function d(){const m=c.get().streaming.abr.rules.insufficientBufferRule.parameters.segmentIgnoreCount;R={},R[r.default.VIDEO]={ignoreCount:m},R[r.default.AUDIO]={ignoreCount:m},R[r.default.ENHANCEMENT]={ignoreCount:m}}function b(){d()}function M(m){isNaN(m.startTime)||m.mediaType!==r.default.AUDIO&&m.mediaType!==r.default.VIDEO||R[m.mediaType].ignoreCount>0&&R[m.mediaType].ignoreCount--}return T={getSwitchRequest:function(m){const u=(0,f.default)(e).create();if(u.rule=this.getClassName(),!m||!m.hasOwnProperty("getMediaType"))return u;const N=m.getMediaType(),O=l.getCurrentBufferState(N),L=m.getRepresentation().fragmentDuration;if(!(function(K,q,z){return!K.getLowLatencyModeEnabled()&&R[q].ignoreCount<=0&&z})(m.getScheduleController().getPlaybackController(),N,L))return u;const x=m.getMediaInfo(),U=m.getAbrController();if(O&&O.state===o.BUFFER_EMPTY)D.debug("["+N+"] Switch to index 0; buffer is empty."),u.representation=U.getOptimalRepresentationForBitrate(x,0,!0),u.reason={message:"[InsufficientBufferRule]: Switching to lowest Representation because buffer is empty"};else{const K=m.getThroughputController(),q=l.getCurrentBufferLevel(N),z=K.getAverageThroughput(N,null,NaN)*c.get().streaming.abr.rules.insufficientBufferRule.parameters.throughputSafetyFactor*q/L;if(isNaN(z)||z<=0)return u;u.representation=U.getOptimalRepresentationForBitrate(x,z,!0),u.priority=c.get().streaming.abr.rules.insufficientBufferRule.priority,u.reason={message:"[InsufficientBufferRule]: Limiting maximum bitrate to avoid a buffer underrun.",bitrate:z}}return u},reset:function(){d(),t.off(H.default.PLAYBACK_SEEKING,b,T),t.off(h.default.BYTES_APPENDED_END_FRAGMENT,M,T)}},D=(0,p.default)(e).getInstance().getLogger(T),d(),t.on(H.default.PLAYBACK_SEEKING,b,T),t.on(h.default.BYTES_APPENDED_END_FRAGMENT,M,T),T}G.__dashjs_factory_name="InsufficientBufferRule";var le=F.default.getClassFactory(G);function de(n){const e=(n=n||{}).mediaPlayerModel,t=n.dashMetrics,l=this.context,c=(0,E.default)(l).getInstance();let T,D,R;function d(){R={}}return T={shouldAbandon:function(b){const M=(0,f.default)(l).create();M.rule=this.getClassName();try{if(!b)return M;const m=b.getCurrentRequest();if(!isNaN(m.index)){if(m.firstByteDate===null||R.hasOwnProperty(m.index))return M;const u=e.getBufferTimeDefault(),N=b.getMediaType();if(t.getCurrentBufferLevel(N)>u)return M;const O=Date.now()-m.firstByteDate.getTime();if(m.traces.length>=c.get().streaming.abr.rules.abandonRequestsRule.parameters.minThroughputSamplesThreshold&&O>c.get().streaming.abr.rules.abandonRequestsRule.parameters.minSegmentDownloadTimeThresholdInMs&&m.bytesLoaded<m.bytesTotal)return(function(L,x,U){const K=L.getMediaInfo(),q=L.getMediaType(),z=x.traces.reduce(((ee,k)=>ee+k.b[0]),0)-x.traces[0].b[0],J=Math.max(x.traces.reduce(((ee,k)=>ee+k.d),0)-x.traces[0].d,1),v=Math.round(8*z/J),A=Number(8*x.bytesTotal/v/1e3).toFixed(2),y=L.getRepresentation(),C=L.getAbrController();if(A<x.duration*c.get().streaming.abr.rules.abandonRequestsRule.parameters.abandonDurationMultiplier||C.isPlayingAtLowestQuality(y))return U;if(!R.hasOwnProperty(x.index)){const ee=L.getAbrController(),k=x.bytesTotal-x.bytesLoaded,Q=ee.getOptimalRepresentationForBitrate(K,v,!0),W=x.representation;k>x.bytesTotal*Q.bitrateInKbit/W.bitrateInKbit&&(U.representation=Q,U.priority=c.get().streaming.abr.rules.abandonRequestsRule.priority,U.reason={throughputInKbit:v,message:`[AbandonRequestRule][${q} is asking to abandon and switch to quality to ${Q.absoluteIndex}. The measured bandwidth was ${v} kbit/s`},R[x.index]=!0)}return U})(b,m,M)}return M}catch(m){return D.error(m),M}},reset:d},D=(0,p.default)(l).getInstance().getLogger(T),d(),T}de.__dashjs_factory_name="AbandonRequestsRule";var De=F.default.getClassFactory(de);function ce(){const n=this.context,e=(0,E.default)(n).getInstance();let t;return t={getSwitchRequest:function(l){const c=(0,f.default)(n).create();if(c.rule=this.getClassName(),!l||!l.hasOwnProperty("getDroppedFramesHistory"))return c;const T=l.getDroppedFramesHistory();if(!T)return c;const D=l.getStreamInfo().id,R=l.getMediaInfo(),d=l.getAbrController(),b=T.getFrameHistory(D);if(!b||Object.keys(b).length===0)return c;let M=0,m=0;const u=d.getPossibleVoRepresentationsFilteredBySettings(R,!0);let N=null;for(let O=1;O<u.length;O++){const L=u[O];if(L&&b[L.id]&&(M=b[L.id].droppedVideoFrames,m=b[L.id].totalVideoFrames,m>e.get().streaming.abr.rules.droppedFramesRule.parameters.minimumSampleSize&&M/m>e.get().streaming.abr.rules.droppedFramesRule.parameters.droppedFramesPercentageThreshold)){N=u[O-1];break}}return N&&(c.representation=N,c.priority=e.get().streaming.abr.rules.droppedFramesRule.priority,c.reason={droppedFrames:M,message:`[DroppedFramesRule]: Switching to index ${N.absoluteIndex}. Dropped Frames: ${M}, Total Frames: ${m}`}),c}},t}ce.__dashjs_factory_name="DroppedFramesRule";var Le=F.default.getClassFactory(ce);function Be(){const n=this.context,e=(0,E.default)(n).getInstance();let t;return t={getSwitchRequest:function(l){const c=(0,f.default)(n).create();if(c.rule=this.getClassName(),!l)return c;const T=l.getStreamInfo().id,D=l.getMediaType(),R=l?l.getSwitchRequestHistory():null,d=R?R.getSwitchRequests(T,D):{},b=l.getAbrController(),M=l.getMediaInfo(),m=b.getPossibleVoRepresentationsFilteredBySettings(M,!0);let u=0,N=0;for(let O=0;O<m.length;O++){const L=m[O];if(L&&d[L.id]&&(u+=d[L.id].drops,N+=d[L.id].noDrops,u+N>=e.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize&&u/N>e.get().streaming.abr.rules.switchHistoryRule.parameters.switchPercentageThreshold)){c.representation=O>0&&d[L.id].drops>0?m[O-1]:L,c.priority=e.get().streaming.abr.rules.switchHistoryRule.priority,c.reason={drops:u,noDrops:N,message:`[SwitchHistoryRule]: Switch to index: ${c.representation.absoluteIndex} samples: ${u+N} drops: ${u}`};break}}return c}},t}Be.__dashjs_factory_name="SwitchHistoryRule";var ot=F.default.getClassFactory(Be),Ge=P(7568);const X="BOLA_STATE_ONE_BITRATE",Z="BOLA_STATE_STARTUP",Se="BOLA_STATE_STEADY",Ne=10;function ke(n){n=n||{};const e=this.context,t=n.dashMetrics,l=n.mediaPlayerModel,c=(0,g.default)(e).getInstance(),T=at(e).getInstance();let D,R,d,b;function M(C){const ee=C.mediaType,k=C.streamId,Q=ee===r.default.AUDIO?[r.default.AUDIO]:b[k];for(const W in Q)b[k]&&b[k].hasOwnProperty(W)&&b[k][W].state===Se&&(b[k][W].placeholderBuffer=0)}function m(C){const ee=C.streamId;for(const k in b[ee])if(b[ee].hasOwnProperty(k)){const Q=b[ee][k];Q.state!==X&&(Q.state=Z,u(Q))}}function u(C){C.placeholderBuffer=0,C.mostAdvancedSegmentStart=NaN,C.lastSegmentWasReplacement=!1,C.lastSegmentStart=NaN,C.lastSegmentDurationS=NaN,C.lastSegmentRequestTimeMs=NaN,C.lastSegmentFinishTimeMs=NaN}function N(C){try{if(C&&C.metric===o.HTTP_REQUEST&&C.value&&C.value.type===Ge.HTTPRequest.MEDIA_SEGMENT_TYPE&&C.value.trace&&C.value.trace.length){const ee=b[C.value._streamId]&&b[C.value._streamId][C.mediaType]?b[C.value._streamId][C.mediaType]:null;ee&&ee.state!==X&&(ee.lastSegmentRequestTimeMs=C.value.trequest.getTime(),ee.lastSegmentFinishTimeMs=C.value._tfinish.getTime(),O(ee,C.mediaType))}}catch(ee){R.error(ee)}}function O(C,ee){if(!isNaN(C.lastSegmentStart)&&!isNaN(C.lastSegmentRequestTimeMs)&&!isNaN(C.placeholderBuffer)){if(C.placeholderBuffer*=.99,!isNaN(C.lastSegmentFinishTimeMs)){const k=t.getCurrentBufferLevel(ee)+.001*(C.lastSegmentFinishTimeMs-C.lastSegmentRequestTimeMs),Q=K(C,C.currentRepresentation),W=Math.max(0,Q-k);C.placeholderBuffer=Math.min(W,C.placeholderBuffer)}C.lastSegmentWasReplacement&&!isNaN(C.lastSegmentDurationS)&&(C.placeholderBuffer+=C.lastSegmentDurationS),C.lastSegmentStart=NaN,C.lastSegmentRequestTimeMs=NaN}}function L(C){if(C&&b[C.streamId]&&b[C.streamId][C.mediaType]){const ee=b[C.streamId][C.mediaType];ee&&ee.state!==X&&(ee.currentRepresentation=C.newRepresentation)}}function x(C,ee,k){const Q=k.reduce(((Ce,Me,ve)=>Me>k[Ce]?ve:Ce),0);if(Q===0)return null;const W=Math.max(C,Ne+2*ee.length),re=(k[Q]-1)/(W/Ne-1);return{gp:re,Vp:Ne/re}}function U(C,ee){const k=l.getBufferTimeDefault();if(C.bufferTimeDefault!==k){const Q=x(k,C.representations,C.utilities);if(Q.Vp!==C.Vp||Q.gp!==C.gp){const W=t.getCurrentBufferLevel(ee);let re=W+C.placeholderBuffer;re-=Ne,re*=Q.Vp/C.Vp,re+=Ne,C.bufferTimeDefault=k,C.Vp=Q.Vp,C.gp=Q.gp,C.placeholderBuffer=Math.max(0,re-W)}}}function K(C,ee){return C.Vp*(C.utilities[ee.absoluteIndex]+C.gp)}function q(C){if(C&&C.chunk&&C.chunk.representation.mediaInfo&&b[C.streamId]){const ee=b[C.streamId][C.chunk.representation.mediaInfo.type];if(ee&&ee.state!==X){const k=C.chunk.start;isNaN(ee.mostAdvancedSegmentStart)||k>ee.mostAdvancedSegmentStart?(ee.mostAdvancedSegmentStart=k,ee.lastSegmentWasReplacement=!1):ee.lastSegmentWasReplacement=!0,ee.lastSegmentStart=k,ee.lastSegmentDurationS=C.chunk.duration,ee.currentRepresentation=C.chunk.representation,O(ee,C.chunk.representation.mediaInfo.type)}}}function z(){y()}function J(){d.get().streaming.abr.limitBitrateByPortal&&y()}function v(C,ee){const k=ee.absoluteIndex,Q=ee.bandwidth,W=C.utilities[k];let re=0;for(let Ce=k-1;Ce>=0;--Ce)if(C.utilities[Ce]<C.utilities[k]){const Me=C.representations[Ce].bandwidth,ve=C.utilities[Ce],ue=C.Vp*(C.gp+(Q*ve-Me*W)/(Q-Me));re=Math.max(re,ue)}return re}function A(C){if(C&&b[C.streamId]){const ee=b[C.streamId][C.mediaType];if(ee&&ee.state!==X){const k=t.getCurrentBufferLevel(C.mediaType);let Q;Q=ee.currentRepresentation.absoluteIndex>0?v(ee,ee.currentRepresentation):Ne;const W=Math.max(0,Q-k);ee.placeholderBuffer=Math.min(ee.placeholderBuffer,W)}}}function y(){b={}}return D={getSwitchRequest:function(C){try{const ee=(0,f.default)(e).create();C.getScheduleController().setTimeToLoadDelay(0),ee.rule=this.getClassName(),ee.reason=ee.reason||{};const k=(function(Q){const W=Q.getMediaType(),re=Q.getStreamInfo().id;b[re]||(b={},b[re]={});let Ce=b[re][W];return Ce?Ce.state!==X&&U(Ce,W):(Ce=(function(Me){const ve={},ue=Me.getMediaInfo(),oe=T.getPossibleVoRepresentationsFilteredBySettings(ue,!0);let ne=oe.map((te=>te.bandwidth)).map((te=>Math.log(te)));ne=ne.map((te=>te-ne[0]+1));const pe=l.getBufferTimeDefault(),Ee=x(pe,oe,ne);return Ee?(ve.state=Z,ve.representations=oe,ve.utilities=ne,ve.bufferTimeDefault=pe,ve.Vp=Ee.Vp,ve.gp=Ee.gp,ve.currentRepresentation=null,u(ve)):ve.state=X,ve})(Q),b[re][W]=Ce),Ce})(C);switch(ee.reason.state=k.state,k.state){case X:break;case Z:(function(Q,W,re){const Ce=W.getMediaType(),Me=W.getThroughputController().getSafeAverageThroughput(Ce);if(isNaN(Me))return;const ve=W.getMediaInfo(),ue=T.getOptimalRepresentationForBitrate(ve,Me,!0),oe=t.getCurrentBufferLevel(Ce);Q.representation=ue,Q.reason.throughput=Me,re.placeholderBuffer=Math.max(0,v(re,ue)-oe),re.currentRepresentation=ue,!isNaN(re.lastSegmentDurationS)&&oe>=re.lastSegmentDurationS&&(re.state=Se)})(ee,C,k);break;case Se:(function(Q,W,re){const Ce=W.getMediaType(),Me=W.getThroughputController(),ve=W.getMediaInfo(),ue=Me.getSafeAverageThroughput(Ce),oe=W.getScheduleController();(function(se,Ae){const ge=Date.now();if(isNaN(se.lastSegmentFinishTimeMs)){if(!isNaN(se.lastCallTimeMs)){const we=.001*(ge-se.lastCallTimeMs);se.placeholderBuffer+=Math.max(0,we)}}else{const we=.001*(ge-se.lastSegmentFinishTimeMs);se.placeholderBuffer+=Math.max(0,we)}se.lastCallTimeMs=ge,se.lastSegmentStart=NaN,se.lastSegmentRequestTimeMs=NaN,se.lastSegmentFinishTimeMs=NaN,U(se,Ae)})(re,Ce);const ne=t.getCurrentBufferLevel(Ce);let pe=(function(se,Ae){const ge=se.representations.length;let we=NaN,Ve=NaN;for(let $e=0;$e<ge;++$e){let Je=(se.Vp*(se.utilities[$e]-1+se.gp)-Ae)/se.representations[$e].bandwidth;(isNaN(Ve)||Je>=Ve)&&(Ve=Je,we=$e)}return se.representations[we]})(re,ne+re.placeholderBuffer);const Ee=T.getOptimalRepresentationForBitrate(ve,ue,!0);pe.absoluteIndex>re.currentRepresentation.absoluteIndex&&pe.absoluteIndex>Ee.absoluteIndex&&(pe=Ee.absoluteIndex>re.currentRepresentation.absoluteIndex?Ee:re.currentRepresentation);let te=Math.max(0,ne+re.placeholderBuffer-K(re,pe));te<=re.placeholderBuffer?(re.placeholderBuffer-=te,te=0):(te-=re.placeholderBuffer,re.placeholderBuffer=0,T.isPlayingAtTopQuality(pe)?te=0:oe.setTimeToLoadDelay(1e3*te)),Q.representation=pe,Q.reason.throughput=ue,Q.reason.bufferLevel=ne,Q.reason.placeholderBuffer=re.placeholderBuffer,Q.reason.delay=te,re.currentRepresentation=pe})(ee,C,k);break;default:(function(Q,W,re){R.debug("BOLA ABR rule invoked in bad state.");const Ce=W.getMediaInfo(),Me=W.getMediaType(),ve=W.getThroughputController().getSafeAverageThroughput(Me);Q.representation=T.getOptimalRepresentationForBitrate(Ce,ve,!0),Q.reason.state=re.state,Q.reason.throughput=ve,re.state=Z,u(re)})(ee,C,k)}return ee.priority=d.get().streaming.abr.rules.bolaRule.priority,ee}catch(ee){return R.error(ee),(0,f.default)(e).create()}},handleNewMediaInfo:function(C){C&&C.streamInfo&&C.type&&b[C.streamInfo.id]&&b[C.streamInfo.id][C.type]&&delete b[C.streamInfo.id][C.type]},reset:function(){y(),c.off(H.default.BUFFER_EMPTY,M,D),c.off(H.default.PLAYBACK_SEEKING,m,D),c.off(H.default.METRIC_ADDED,N,D),c.off(H.default.QUALITY_CHANGE_REQUESTED,L,D),c.off(H.default.FRAGMENT_LOADING_ABANDONED,A,D),c.off(h.default.MEDIA_FRAGMENT_LOADED,q,D),c.off(h.default.SETTING_UPDATED_MAX_BITRATE,z,D),c.off(h.default.SETTING_UPDATED_MIN_BITRATE,z,D),c.off(h.default.VIDEO_ELEMENT_RESIZED,J,D)}},R=(0,p.default)(e).getInstance().getLogger(D),d=(0,E.default)(e).getInstance(),y(),c.on(H.default.BUFFER_EMPTY,M,D),c.on(H.default.PLAYBACK_SEEKING,m,D),c.on(H.default.METRIC_ADDED,N,D),c.on(H.default.QUALITY_CHANGE_REQUESTED,L,D),c.on(H.default.FRAGMENT_LOADING_ABANDONED,A,D),c.on(h.default.MEDIA_FRAGMENT_LOADED,q,D),c.on(h.default.SETTING_UPDATED_MAX_BITRATE,z,D),c.on(h.default.SETTING_UPDATED_MIN_BITRATE,z,D),c.on(h.default.VIDEO_ELEMENT_RESIZED,J,D),D}ke.__dashjs_factory_name="BolaRule";var ht=F.default.getClassFactory(ke);const ye="L2A_STATE_ONE_BITRATE",pt="L2A_STATE_STARTUP",He="L2A_STATE_STEADY",Fe=Math.pow(4,.99);function Ke(n){n=n||{};const e=this.context,t=n.dashMetrics,l=(0,g.default)(e).getInstance(),c=(0,E.default)(e).getInstance();let T,D,R,d;function b(x){x.placeholderBuffer=0,x.mostAdvancedSegmentStart=NaN,x.lastSegmentWasReplacement=!1,x.lastSegmentStart=NaN,x.lastSegmentDurationS=NaN,x.lastSegmentRequestTimeMs=NaN,x.lastSegmentFinishTimeMs=NaN,x.lastSegmentUrl=""}function M(){for(const x in D)if(D.hasOwnProperty(x)){const U=D[x];U.state!==ye&&(U.state=pt,b(U))}}function m(x){if(x&&x.chunk&&x.chunk.representation&&x.chunk.representation.mediaInfo){const U=D[x.chunk.representation.mediaInfo.type],K=R[x.chunk.representation.mediaInfo.type];if(U&&U.state!==ye){const q=x.chunk.start;isNaN(U.mostAdvancedSegmentStart)||q>U.mostAdvancedSegmentStart?(U.mostAdvancedSegmentStart=q,U.lastSegmentWasReplacement=!1):U.lastSegmentWasReplacement=!0,U.lastSegmentStart=q,U.lastSegmentDurationS=x.chunk.duration,U.currentRepresentation=x.chunk.representation,N(U,K)}}}function u(x){if(x&&x.metric===o.HTTP_REQUEST&&x.value&&x.value.type===Ge.HTTPRequest.MEDIA_SEGMENT_TYPE&&x.value.trace&&x.value.trace.length){const U=D[x.mediaType],K=R[x.mediaType];U&&U.state!==ye&&(U.lastSegmentRequestTimeMs=x.value.trequest.getTime(),U.lastSegmentFinishTimeMs=x.value._tfinish.getTime(),N(U,K))}}function N(x,U){isNaN(x.lastSegmentStart)||isNaN(x.lastSegmentRequestTimeMs)||(U.segment_request_start_s=.001*x.lastSegmentRequestTimeMs,U.segment_download_finish_s=.001*x.lastSegmentFinishTimeMs,x.lastSegmentStart=NaN,x.lastSegmentRequestTimeMs=NaN)}function O(x,U){if(x.length!==U.length)return-1;let K=0;for(let q=0;q<x.length;q++)K+=x[q]*U[q];return K}function L(){D={},R={}}return T={getSwitchRequest:function(x){try{const U=(0,f.default)(e).create();U.rule=this.getClassName();const K=x.getMediaType(),q=x.getScheduleController();if(U.reason=U.reason||{},K===r.default.AUDIO)return U;q.setTimeToLoadDelay(0);const z=(function(J){const v=J.getMediaType();let A=D[v];return A||(A=(function(y){const C={},ee=y.getMediaInfo();return C.state=pt,C.currentRepresentation=null,(function(k){k&&k.type&&(R[k.type]={},R[k.type].w=[],R[k.type].prev_w=[],R[k.type].Q=0,R[k.type].segment_request_start_s=0,R[k.type].segment_download_finish_s=0,R[k.type].B_target=1.5)})(ee),b(C),C})(J),D[v]=A),A})(x);if(!R[K])return U;switch(U.reason.state=z.state,z.state){case ye:break;case pt:(function(J,v,A){const y=J.getMediaInfo(),C=J.getMediaType(),ee=J.getThroughputController().getSafeAverageThroughput(C);if(isNaN(ee))return v;const k=J.getAbrController(),Q=k.getOptimalRepresentationForBitrate(y,ee,!0),W=t.getCurrentBufferLevel(C,!0),re=R[C],Ce=k.getPossibleVoRepresentationsFilteredBySettings(y,!0);if(v.representation=Q,v.reason.throughput=ee,A.currentRepresentation=Q,!isNaN(A.lastSegmentDurationS)&&W>=re.B_target){A.state=He,re.Q=Fe;for(let Me=0;Me<Ce.length;++Me)Ce[Me].id===A.currentRepresentation.id?re.prev_w[Me]=1:re.prev_w[Me]=0}})(x,U,z);break;case He:(function(J,v,A){let y=[];const C=J.getThroughputController(),ee=J.getMediaType();let k=C.getAverageThroughput(ee,r.default.THROUGHPUT_CALCULATION_MODES.ARITHMETIC_MEAN,1),Q=t.getCurrentHttpRequest(ee),W=null;const re=R[ee];if(k<1&&(k=1),Q.url===A.lastSegmentUrl||Q.type===Ge.HTTPRequest.INIT_SEGMENT_TYPE)W=A.currentRepresentation;else{let Ce=A.lastSegmentDurationS,Me=1;const ve=J.getAbrController(),ue=J.getMediaInfo(),oe=ve.getPossibleVoRepresentationsFilteredBySettings(ue,!0);let ne=J.getVideoModel().getPlaybackRate();const pe=Math.max(Math.pow(4,1),Fe*Math.sqrt(4));for(let Ae=0;Ae<oe.length;++Ae){const ge=oe[Ae];ne*ge.bitrateInKbit>k&&(Me=-1),re.w[Ae]=re.prev_w[Ae]+Me*(Ce/(2*pe))*((re.Q+Fe)*(ne*ge.bitrateInKbit/k))}re.w=(function(Ae){const ge=Ae.length;let we=!1,Ve=[];for(let Jt=0;Jt<ge;++Jt)Ve[Jt]=Ae[Jt];let $e=Ae.sort((function(Jt,fn){return fn-Jt})),Je=0,gt=0,Et=[];for(let Jt=0;Jt<ge-1;++Jt)if(Je+=$e[Jt],gt=(Je-1)/(Jt+1),gt>=$e[Jt+1]){we=!0;break}we||(gt=(Je+$e[ge-1]-1)/ge);for(let Jt=0;Jt<ge;++Jt)Et[Jt]=Math.max(Ve[Jt]-gt,0);return Et})(re.w);for(let Ae=0;Ae<oe.length;++Ae)y[Ae]=re.w[Ae]-re.prev_w[Ae],re.prev_w[Ae]=re.w[Ae];const Ee=oe.map((Ae=>Ae.bandwidth));re.Q=Math.max(0,re.Q-Ce+Ce*ne*((O(Ee,re.prev_w)+O(Ee,y))/k));let te=[];for(let Ae=0;Ae<Ee.length;++Ae)te[Ae]=Math.abs(Ee[Ae]-O(re.w,Ee));const se=te.indexOf(Math.min(...te));W=ve.getRepresentationByAbsoluteIndex(se,ue,!0),W.absoluteIndex>A.currentRepresentation.absoluteIndex&&Ee[A.currentRepresentation.absoluteIndex+1]<=k&&(W=ve.getRepresentationByAbsoluteIndex(A.currentRepresentation.absoluteIndex+1,ue,!0)),W.bitrateInKbit>=k&&(re.Q=2*Math.max(Fe,re.Q)),A.lastSegmentUrl=Q.url}v.representation=W,A.currentRepresentation=v.representation})(x,U,z);break;default:(function(J,v,A){const y=J.getAbrController(),C=J.getMediaInfo(),ee=J.getMediaType(),k=J.getThroughputController().getSafeAverageThroughput(ee);v.representation=y.getOptimalRepresentationForBitrate(C,k,!0),v.reason.throughput=k,A.state=pt,b(A)})(x,U,z)}return U.priority=c.get().streaming.abr.rules.l2ARule.priority,U}catch(U){return d.error(U),(0,f.default)(e).create()}},reset:function(){L(),l.off(h.default.PLAYBACK_SEEKING,M,T),l.off(h.default.MEDIA_FRAGMENT_LOADED,m,T),l.off(h.default.METRIC_ADDED,u,T)}},d=(0,p.default)(e).getInstance().getLogger(T),L(),l.on(h.default.PLAYBACK_SEEKING,M,T),l.on(h.default.MEDIA_FRAGMENT_LOADED,m,T),l.on(h.default.METRIC_ADDED,u,T),T}Ke.__dashjs_factory_name="L2ARule";var Pt=F.default.getClassFactory(Ke);function Nt(){const n=this.context;let e,t,l,c,T,D,R,d,b;function M(){l=null,c=1,T=100,D=0,R=null,d=null,b="dynamic_weight_selection"}function m(){let x=0;if(l)for(let U=0;U<l.length;U++){let K=l[U];K.state.throughput>x&&(x=K.state.throughput)}return x}function u(x,U,K){let q=x.map(((z,J)=>K[J]*Math.pow(z-U[J],2))).reduce(((z,J)=>z+J));return(q<0?-1:1)*Math.sqrt(Math.abs(q))}function N(x,U){return u([x.state.throughput,x.state.latency,x.state.rebuffer,x.state.switch],[U.state.throughput,U.state.latency,U.state.rebuffer,U.state.switch],[1,1,1,1])}function O(x,U){for(let K=0;K<l.length;K++){let q=l[K],z=.1;const J=N(q,x);L(q,U,Math.exp(-1*Math.pow(J,2)/(2*Math.pow(z,2))))}}function L(x,U,K){let q=x.state,z=[.01,.01,.01,.01];q.throughput=q.throughput+(U[0]-q.throughput)*z[0]*K,q.latency=q.latency+(U[1]-q.latency)*z[1]*K,q.rebuffer=q.rebuffer+(U[2]-q.rebuffer)*z[2]*K,q.switch=q.switch+(U[3]-q.switch)*z[3]*K}return e={getNextQuality:function(x,U,K,q,z,J,v,A){let y=q,C=K;(function(ue,oe){if(!l){l=[];const ne=oe.getPossibleVoRepresentationsFilteredBySettings(ue,!0),pe=ne.map((Ee=>Ee.bandwidth));D=Math.min(...pe),c=(function(Ee){const te=Ee.map((se=>Math.pow(se,2))).reduce(((se,Ae)=>se+Ae));return Math.sqrt(te)})(pe),ne.forEach((Ee=>{let te={representation:Ee,state:{throughput:Ee.bandwidth/c,latency:0,rebuffer:0,switch:0}};l.push(te)})),d=(function(Ee){let te=[],se=(function($e){let Je=[];for(let gt=0;gt<$e;gt++){let Et=[Math.random()*m(),Math.random(),Math.random(),Math.random()];Je.push(Et)}return Je})(Math.pow(Ee.length,2));te.push(se[0]);let Ae=[1,1,1,1];for(let $e=1;$e<Ee.length;$e++){let Je=null,gt=null;for(let Et=0;Et<se.length;Et++){let Jt=se[Et],fn=null;for(let bn=0;bn<te.length;bn++){let kn=u(Jt,te[bn],Ae);(fn===null||kn<fn)&&(fn=kn)}(gt===null||fn>gt)&&(Je=Jt,gt=fn)}te.push(Je)}let ge=null,we=null;for(let $e=0;$e<te.length;$e++){let Je=0;for(let gt=0;gt<te.length;gt++)$e!==gt&&(Je+=u(te[$e],te[gt],Ae));(ge===null||Je>ge)&&(ge=Je,we=$e)}let Ve=[];for(Ve.push(te[we]),te.splice(we,1);te.length>0;){let $e=null,Je=null;for(let gt=0;gt<te.length;gt++){let Et=u(Ve[0],te[gt],Ae);($e===null||Et<$e)&&($e=Et,Je=gt)}Ve.push(te[Je]),te.splice(Je,1)}return Ve})(l)}})(U,x);let ee=K/c;ee>1&&(ee=m()),q/=T;let k=l.find((ue=>ue.representation.id===v.id)),Q=k.representation.bandwidth*A.getSegmentDuration()/C,W=Math.max(0,Q-z);if(z-Q<A.getMinBuffer())return t.debug(`Buffer is low for bitrate= ${k.representation.bandwidth} downloadTime=${Q} currentBuffer=${z} rebuffer=${W}`),(function(ue,oe){let ne=0,pe=ue;if(l)for(let Ee=0;Ee<l.length;Ee++){let te=l[Ee];te.representation.bandwidth<ue.representation.bandwidth&&te.representation.bandwidth>ne&&oe>te.representation.bandwidth&&(ne=te.representation.bandwidth,pe=te)}return pe})(k,C).representation;switch(b){case"manual_weight_selection":R=[.4,.4,.4,.4];break;case"random_weight_selection":R=(function(ue){let oe=[],ne=Math.sqrt(2/ue);for(let pe=0;pe<4;pe++)oe.push(Math.random()*ne);return R=oe,R})(l.length);break;default:(function(ue,oe,ne,pe,Ee,te){R||(R=d[d.length-1]);let se=ue.findWeightVector(l,oe,ne,pe,Ee,te);se!==null&&se!==-1&&(R=se)})(A,y,z,W,C,J)}let re=null,Ce=null,Me=null;for(let ue=0;ue<l.length;ue++){let oe=l[ue],ne=oe.state,pe=[ne.throughput,ne.latency,ne.rebuffer,ne.switch],Ee=R.slice(),te=A.getNextBufferWithBitrate(oe.representation.bandwidth,z,C),se=te<A.getMinBuffer();se&&t.debug(`Buffer is low for bitrate=${oe.representation.bandwidth} downloadTime=${Q} currentBuffer=${z} nextBuffer=${te}`),(oe.representation.bandwidth>K-1e4||se)&&oe.representation.bandwidth!==D&&(Ee[0]=100);let Ae=u(pe,[ee,0,0,0],Ee);(re===null||Ae<re)&&(re=Ae,Ce=oe.representation,Me=oe)}let ve=Math.abs(k.representation.bandwidth-Me.representation.bandwidth)/c;return O(k,[ee,q,W,ve]),O(Me,[ee,0,0,ve]),Ce},reset:function(){M()}},t=(0,p.default)(n).getInstance().getLogger(e),M(),e}Nt.__dashjs_factory_name="LearningAbrController";var kt=F.default.getClassFactory(Nt),Ut=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 ln(){let n,e,t,l,c;function T(){e=null,t=null,l=null,c=null}function D(d,b,M,m){let u=new Ut;return u.type=d,u.weights.bitrateReward=b||1,u.weights.bitrateSwitchPenalty=1,u.weights.rebufferPenalty=M||1e3,u.weights.latencyPenalty=[],u.weights.latencyPenalty.push({threshold:1.1,penalty:.05*m}),u.weights.latencyPenalty.push({threshold:1e8,penalty:.1*M}),u.weights.playbackSpeedPenalty=m||200,u}function R(d,b,M,m,u){u.bitrateWSum+=u.weights.bitrateReward*d,u.lastBitrate&&(u.bitrateSwitchWSum+=u.weights.bitrateSwitchPenalty*Math.abs(d-u.lastBitrate)),u.lastBitrate=d,u.rebufferWSum+=u.weights.rebufferPenalty*b;for(let N=0;N<u.weights.latencyPenalty.length;N++){let O=u.weights.latencyPenalty[N];if(M<=O.threshold){u.latencyWSum+=O.penalty*M;break}}u.playbackSpeedWSum+=u.weights.playbackSpeedPenalty*Math.abs(1-m),u.totalQoe=u.bitrateWSum-u.bitrateSwitchWSum-u.rebufferWSum-u.latencyWSum-u.playbackSpeedWSum}return n={setupPerSegmentQoe:function(d,b,M){e=D("segment",d,b,M),t=d,l=b,c=M},logSegmentMetrics:function(d,b,M,m){e&&R(d,b,M,m,e)},getPerSegmentQoe:function(){return e},calculateSingleUseQoe:function(d,b,M,m){let u=null;return t&&l&&c&&(u=D("segment",t,l,c)),u?(R(d,b,M,m,u),u.totalQoe):0},reset:function(){T()}},T(),n}ln.__dashjs_factory_name="LoLpQoeEvaluator";var an=F.default.getClassFactory(ln);function En(n){let e,t,l,c,T=n.targetLatency,D=n.bufferMin,R=n.segmentDuration,d=n.qoeEvaluator;function b(){return R}function M(m,u){const N=b();let O;return O=u>N?m-N:m+N-u,O}return e={getMinBuffer:function(){return D},getSegmentDuration:b,getNextBufferWithBitrate:function(m,u,N){return M(u,m*R/N)},getNextBuffer:M,findWeightVector:function(m,u,N,O,L,x){let U=null,K=null,q=null,z=Math.abs(u-c);return m.forEach((J=>{l.forEach((v=>{v[0];let A,y=v[1],C=v[2],ee=(v[3],J.representation.bandwidth*R/L),k=M(N,ee);A=C===0?10:1/C;let Q=A*Math.max(1e-5,ee-k);A=y===0?10:1/y;let W=A*J.state.latency,re=d.calculateSingleUseQoe(J.representation.bandwidth,Q,W,x);(U===null||re>U)&&(function(Ce,Me,ve){return!(Ce>T+ve)&&Me>=D})(u,k,z)&&(U=re,K=v,q=J.representation.bandwidth)}))})),K===null&&q===null&&(K=-1),c=u,K}},t=[.2,.4,.6,.8,1],l=(function(m){let u=m.map((function(O){return[O]})),N=function(O,L,x){if(x===L)return O;let U=O.length;for(let K=0;K<U;K++){let q=O.shift();for(let z=0;z<m.length;z++)O.push(q.concat(m[z]))}return N(O,L,x+1)};return N(u,4,1)})(t),c=0,e}En.__dashjs_factory_name="LoLpWeightSelector";var Oe=F.default.getClassFactory(En);function Ie(n){let e,t,l,c,T,D=(n=n||{}).dashMetrics,R=this.context;return l={getSwitchRequest:function(d){try{let b=(0,f.default)(R).create();b.rule=this.getClassName();let M=d.getMediaInfo().type,m=d.getAbrController();const u=d.getStreamInfo();let N=d.getRepresentation();const O=d.getMediaInfo(),L=D.getCurrentBufferState(M),x=d.getScheduleController(),U=D.getCurrentBufferLevel(M,!0),K=x.getPlaybackController();let q=K.getCurrentLiveLatency();if(M===r.default.AUDIO)return b;q||(q=0);const z=K.getPlaybackRate(),J=d.getThroughputController().getSafeAverageThroughput(M);if(e.debug(`Throughput ${Math.round(J)} kbps`),isNaN(J)||!L||m.getAbandonmentStateFor(u.id,M)===o.ABANDON_LOAD)return b;let v=m.getPossibleVoRepresentationsFilteredBySettings(O,!0).map((Ce=>Ce.bandwidth)),A=d.getRepresentation().fragmentDuration,y=Math.min(...v)/1e3,C=Math.max(...v)/1e3,ee=N.bandwidth/1e3,k=D.getCurrentHttpRequest(M,!0),Q=(k.tresponse.getTime()-k.trequest.getTime())/1e3,W=Q>A?Q-A:0;T.setupPerSegmentQoe(A,C,y),T.logSegmentMetrics(ee,W,q,z);let re=Oe(R).create({targetLatency:1.5,bufferMin:.3,segmentDuration:A,qoeEvaluator:T});return b.representation=c.getNextQuality(m,O,1e3*J,q,U,z,N,re),b.reason={throughput:J,latency:q},b.priority=t.get().streaming.abr.rules.loLPRule.priority,x.setTimeToLoadDelay(0),b}catch(b){throw b}},reset:function(){c.reset(),T.reset()}},e=(0,p.default)(R).getInstance().getLogger(l),c=kt(R).create(),T=an(R).create(),t=(0,E.default)(R).getInstance(),l}Ie.__dashjs_factory_name="LoLPRule";var mt=F.default.getClassFactory(Ie);function It(n){n=n||{};const e=this.context,t=n.mediaPlayerModel,l=n.customParametersModel,c=n.dashMetrics,T=n.settings,D=(0,g.default)(e).getInstance();let R,d,b,M;function m(){Object.values(r.default.QUALITY_SWITCH_RULES).forEach((x=>{d=u(x,d)})),Object.values(r.default.ABANDON_FRAGMENT_RULES).forEach((x=>{b=u(x,b)})),l.getAbrCustomRules().forEach((function(x){x.type===r.default.RULES_TYPES.QUALITY_SWITCH_RULES&&d.push(x.rule(e).create()),x.type===r.default.RULES_TYPES.ABANDON_FRAGMENT_RULES&&b.push(x.rule(e).create())})),d.length===0&&(d.push(ht(e).create({dashMetrics:c,mediaPlayerModel:t,settings:T})),d.push(w(e).create({dashMetrics:c})))}function u(x,U){const K=x.charAt(0).toLowerCase()+x.slice(1);return T.get().streaming.abr.rules[K].active&&!(function(q,z){return q.filter((J=>J.getClassName()===z)).length>0})(U,x)?(U.push((function(q){switch(q){case r.default.QUALITY_SWITCH_RULES.BOLA_RULE:return ht(e).create({dashMetrics:c,mediaPlayerModel:t,settings:T});case r.default.QUALITY_SWITCH_RULES.THROUGHPUT_RULE:return w(e).create({dashMetrics:c});case r.default.QUALITY_SWITCH_RULES.INSUFFICIENT_BUFFER_RULE:return le(e).create({dashMetrics:c,settings:T});case r.default.QUALITY_SWITCH_RULES.SWITCH_HISTORY_RULE:return ot(e).create();case r.default.QUALITY_SWITCH_RULES.DROPPED_FRAMES_RULE:return Le(e).create();case r.default.QUALITY_SWITCH_RULES.LEARN_TO_ADAPT_RULE:return Pt(e).create({dashMetrics:c,settings:T});case r.default.QUALITY_SWITCH_RULES.LOL_PLUS_RULE:return mt(e).create({dashMetrics:c});case r.default.ABANDON_FRAGMENT_RULES.ABANDON_REQUEST_RULE:return De(e).create({dashMetrics:c,mediaPlayerModel:t,settings:T})}})(x)),U):T.get().streaming.abr.rules[K].active?U:(function(q,z){return q.filter((J=>J.getClassName()!==z))})(U,x)}function N(x){return x.filter((U=>U.representation!==f.default.NO_CHANGE))}function O(x){const U={};let K,q,z,J=null;if(x.length!==0){for(U[f.default.PRIORITY.STRONG]=null,U[f.default.PRIORITY.WEAK]=null,U[f.default.PRIORITY.DEFAULT]=null,K=0,q=x.length;K<q;K+=1)z=x[K],z.representation!==f.default.NO_CHANGE&&(U[z.priority]===null||U[z.priority].representation!==f.default.NO_CHANGE&&z.representation.bitrateInKbit<U[z.priority].representation.bitrateInKbit)&&(U[z.priority]=z);return U[f.default.PRIORITY.WEAK]&&U[f.default.PRIORITY.WEAK].representation!==f.default.NO_CHANGE&&(J=U[f.default.PRIORITY.WEAK]),U[f.default.PRIORITY.DEFAULT]&&U[f.default.PRIORITY.DEFAULT].representation!==f.default.NO_CHANGE&&(J=U[f.default.PRIORITY.DEFAULT]),U[f.default.PRIORITY.STRONG]&&U[f.default.PRIORITY.STRONG].representation!==f.default.NO_CHANGE&&(J=U[f.default.PRIORITY.STRONG]),J}}function L(){m()}return R={clearDataForStream:function(x){[d,b].forEach((U=>{U&&U.length&&U.forEach((K=>K.clearDataForStream&&typeof K.clearDataForStream=="function"&&K.clearDataForStream(x)))}))},getAbandonFragmentRules:function(){return b},getBestPossibleSwitchRequest:function(x){return x&&O(N(d.filter((U=>{const K=U.getClassName();if(K!==r.default.QUALITY_SWITCH_RULES.BOLA_RULE&&K!==r.default.QUALITY_SWITCH_RULES.THROUGHPUT_RULE)return!0;const q=x.getMediaType();return M[q]&&K===r.default.QUALITY_SWITCH_RULES.BOLA_RULE||!M[q]&&K===r.default.QUALITY_SWITCH_RULES.THROUGHPUT_RULE})).map((U=>U.getSwitchRequest(x)))))||(0,f.default)(e).create()},getBolaState:function(x){return M[x]},getMinSwitchRequest:O,getQualitySwitchRules:function(){return d},handleNewMediaInfo:function(x){d.forEach((U=>U.handleNewMediaInfo&&U.handleNewMediaInfo(x))),b.forEach((U=>U.handleNewMediaInfo&&U.handleNewMediaInfo(x)))},initialize:function(){d=[],b=[],M={},m(),D.on(h.default.SETTING_UPDATED_ABR_ACTIVE_RULES,L,R)},reset:function(){[d,b].forEach((x=>{x&&x.length&&x.forEach((U=>U.reset&&U.reset()))})),d=[],b=[],M={},D.off(h.default.SETTING_UPDATED_ABR_ACTIVE_RULES,L,R)},setBolaState:function(x,U){M[x]=U},shouldAbandonFragment:function(x){if(!x)return(0,f.default)(e).create();const U=O(N(b.map((K=>K.shouldAbandon(x)))));return U&&U.reason&&(U.reason.forceAbandon=!0),U||(0,f.default)(e).create()}},R}It.__dashjs_factory_name="ABRRulesCollection";const Ye=F.default.getClassFactory(It);F.default.updateSingletonFactory(It.__dashjs_factory_name,Ye);var V=Ye,B=P(2842);const Pe="loading",j="executed",qe="failed";function it(n){const e=(n=n||{}).eventBus,t=n.events,l=n.dashMetrics,c=n.fragmentLoader,T=n.debug,D=n.streamInfo,R=n.type;let d,b,M,m;function u(v){return!!v&&(function(A){let y=!1;return A.some((C=>{if(ee=v,k=C,!isNaN(ee.index)&&ee.startTime===k.startTime&&ee.adaptationIndex===k.adaptationIndex&&ee.type===k.type||(function(Q,W){return Q.representation.id===W.representation.id})(v,C)||(function(Q,W){return Q.action===B.default.ACTION_COMPLETE&&Q.action===W.action})(v,C))return y=!0,y;var ee,k})),y})(M)}function N(v){return isNaN(v.duration)?.25:Math.min(v.duration/8,.5)}function O(v){M=M.filter((A=>{const y=N(A);return isNaN(A.startTime)||v!==void 0&&A.startTime>=v-y}))}function L(v,A){A<=v+.5||(M=M.filter((y=>{const C=N(y);return isNaN(y.startTime)||y.startTime>=A-C||isNaN(y.duration)||y.startTime+y.duration<=v+C})))}function x(v,A,y){for(let C=v.length-1;C>=0;C--){const ee=v[C],k=ee.startTime,Q=k+ee.duration;if(y=isNaN(y)?N(ee):y,!isNaN(k)&&!isNaN(Q)&&A+y>=k&&A-y<Q||isNaN(k)&&isNaN(A))return ee}return null}function U(v,A){l.addSchedulingInfo(v,A),l.addRequestsQueue(v.mediaType,m,M)}function K(v){v.sender===c&&(m.splice(m.indexOf(v.request),1),v.response&&!v.error&&M.push(v.request),U(v.request,v.error?qe:j),e.trigger(t.FRAGMENT_LOADING_COMPLETED,{request:v.request,response:v.response,error:v.error,sender:this},{streamId:D.id,mediaType:R}))}function q(v){v.sender===c&&e.trigger(t.FRAGMENT_LOADING_PROGRESS,{request:v.request,response:v.response,error:v.error,sender:this},{streamId:D.id,mediaType:R})}function z(v){v.sender===c&&e.trigger(t.FRAGMENT_LOADING_ABANDONED,{request:v.request},{streamId:D.id,mediaType:R})}function J(){M=[],m=[],c&&c.resetInitialSettings()}return d={abortRequests:function(){b.debug("abort requests"),c.abort(),m=[]},executeRequest:function(v){v.action===B.default.ACTION_DOWNLOAD?(U(v,Pe),m.push(v),(function(A){e.trigger(t.FRAGMENT_LOADING_STARTED,{request:A},{streamId:D.id,mediaType:R}),c.load(A)})(v)):b.warn("Unknown request action.")},getRequests:function(v){const A=v?v.state instanceof Array?v.state:[v.state]:[];let y=[];return A.forEach((C=>{const ee=(function(k){let Q;switch(k){case Pe:Q=m;break;case j:Q=M;break;default:Q=[]}return Q})(C);y=y.concat((function(k,Q){return Q.hasOwnProperty("time")?[x(k,Q.time,Q.threshold)]:k.filter((W=>{for(const re in Q)if(re!=="state"&&Q.hasOwnProperty(re)&&W[re]!=Q[re])return!1;return!0}))})(ee,v))})),y},getStreamId:function(){return D.id},getType:function(){return R},isFragmentLoaded:u,isFragmentLoadedOrPending:function(v){let A,y=!1,C=0;if(y=u(v),!y)for(C=0;C<m.length;C++)A=m[C],v.url===A.url&&v.startTime===A.startTime&&(y=!0);return y},removeExecutedRequestsAfterTime:function(v){M=M.filter((A=>isNaN(A.startTime)||v!==void 0&&A.startTime<v))},removeExecutedRequestsBeforeTime:O,reset:function(){e.off(t.LOADING_COMPLETED,K,this),e.off(t.LOADING_DATA_PROGRESS,q,this),e.off(t.LOADING_ABANDONED,z,this),c&&c.reset(),J()},resetInitialSettings:J,syncExecutedRequestsWithBufferedRange:function(v,A){if(!v||v.length===0)return void O();let y=0;for(let C=0,ee=v.length;C<ee;C++)L(y,v.start(C)),y=v.end(C);A>0&&L(y,A)}},b=T.getLogger(d),J(),e.on(t.LOADING_COMPLETED,K,d),e.on(t.LOADING_DATA_PROGRESS,q,d),e.on(t.LOADING_ABANDONED,z,d),d}it.__dashjs_factory_name="FragmentModel";const _e=F.default.getClassFactory(it);_e.FRAGMENT_MODEL_LOADING=Pe,_e.FRAGMENT_MODEL_EXECUTED=j,_e.FRAGMENT_MODEL_CANCELED="canceled",_e.FRAGMENT_MODEL_FAILED=qe,F.default.updateClassFactory(it.__dashjs_factory_name,_e);var Ue=_e;function i(n){let e;const t=(n=n||{}).abrController,l=n.throughputController,c=n.switchRequestHistory,T=n.droppedFramesHistory,D=n.currentRequest,R=n.streamProcessor?n.streamProcessor.getScheduleController():null,d=n.streamProcessor?n.streamProcessor.getRepresentation():null,b=n.videoModel?n.videoModel:null;function M(){return d?d.mediaInfo:null}return e={getAbrController:function(){return t},getCurrentRequest:function(){return D},getDroppedFramesHistory:function(){return T},getMediaInfo:M,getMediaType:function(){const m=M();return m?m.type:null},getRepresentation:function(){return d},getScheduleController:function(){return R},getStreamInfo:function(){const m=M();return m?m.streamInfo:null},getSwitchRequestHistory:function(){return c},getThroughputController:function(){return l},getVideoModel:function(){return b}},e}i.__dashjs_factory_name="RulesContext";var S=F.default.getClassFactory(i);function I(){let n={},e={};const t=this.context,l=(0,E.default)(t).getInstance();return{clearForStream:function(c){delete n[c],delete e[c]},getSwitchRequests:function(c,T){return c!=null&&T!=null&&n[c]&&n[c][T]?n[c][T]:{}},push:function(c){const T=c.currentRepresentation,D=c.newRepresentation;if(T.mediaInfo.streamInfo.id!==D.mediaInfo.streamInfo.id||D.mediaInfo.id!==T.mediaInfo.id)return;const R=T.mediaInfo.streamInfo.id;n[R]||(function(L){n[L]={},e[L]={}})(R);const d=T.mediaInfo.type;n[R][d]||(function(L,x){n[L][x]={},e[L][x]=[]})(R,d);const b=c.currentRepresentation.id;n[R][d][b]||(function(L,x,U){n[L][x][U]={noDrops:0,drops:0,dropSize:0}})(R,d,b);let M=c.newRepresentation.absoluteIndex-c.currentRepresentation.absoluteIndex,m=M<0?1:0,u=m?-M:0,N=m?0:1;n[R][d][c.currentRepresentation.id].drops+=m,n[R][d][c.currentRepresentation.id].dropSize+=u,n[R][d][c.currentRepresentation.id].noDrops+=N,e[R][d].push({id:c.currentRepresentation.id,noDrop:N,drop:m,dropSize:u});const O=(function(L,x){return e[L][x].length>l.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize?e[L][x].shift():null})(R,d);O&&(function(L,x,U){n[L][x][U.id].drops-=U.drop,n[L][x][U.id].dropSize-=U.dropSize,n[L][x][U.id].noDrops-=U.noDrop})(R,d,O)},reset:function(){n={},e={}}}}I.__dashjs_factory_name="SwitchRequestHistory";var $=F.default.getClassFactory(I);function ie(){let n={},e={},t={};return{clearForStream:function(l){delete n[l],delete e[l],delete t[l]},getFrameHistory:function(l){return n[l]},push:function(l,c,T){if(!c)return;n[l]||(function(m){n[m]=[],e[m]=0,t[m]=0})(l);let D=T&&T.droppedVideoFrames?T.droppedVideoFrames:0,R=T&&T.totalVideoFrames?T.totalVideoFrames:0,d=D-e[l];e[l]=D;let b=R-t[l];t[l]=R;const M=n[l];M[c]?(M[c].droppedVideoFrames+=d,M[c].totalVideoFrames+=b):M[c]={droppedVideoFrames:d,totalVideoFrames:b}},reset:function(){n={},e={},t={}}}}ie.__dashjs_factory_name="DroppedFramesHistory";var be=F.default.getClassFactory(ie);function tt(){const n=this.context,e=(0,p.default)(n).getInstance(),t=(0,g.default)(n).getInstance();let l,c,T,D,R,d,b,M,m,u,N,O,L,x,U,K,q,z,J,v,A;function y(){l={},z={},U=new Map,N&&N.reset(),J&&J.reset(),b=void 0,N=void 0,J=void 0,clearTimeout(c),c=null}function C(ge,we=!0){let Ve=ee(ge,we);return Ve=(function($e){try{return(function(Je){try{if(!K.get().streaming.cmsd.enabled||!K.get().streaming.cmsd.abr.applyMb)return Je;const gt=Je.filter((Et=>{const Jt=Et.mediaInfo.type;let fn=d.getMaxBitrate(Jt);if(Jt!==r.default.VIDEO||fn<0)return!0;const bn=Et.mediaInfo.streamInfo.id;return fn-=z[bn][r.default.AUDIO].getRepresentation().bitrateInKbit||0,Et.bitrateInKbit<=fn}));return gt.length>0?gt:Je}catch(gt){return L.error(gt),Je}})($e=(function(Je){try{if(!K.get().streaming.abr.limitBitrateByPortal)return Je;const gt=1e3*K.get().streaming.abr.limitBitrateByPortalMinimum||0,{elementWidth:Et}=A.getVideoElementSize(),Jt=Je.filter((fn=>fn.mediaInfo.type!==r.default.VIDEO||fn.width<=Et||fn.bandwidth<=gt));return Jt.length>0?Jt:Je}catch(gt){return L.error(gt),Je}})($e=(function(Je){try{const gt=Je.filter((Et=>{const Jt=Et.mediaInfo.type,fn=Et.bitrateInKbit,bn=x.getAbrBitrateParameter("maxBitrate",Jt),kn=x.getAbrBitrateParameter("minBitrate",Jt);return!(bn>-1&&fn>bn||kn>-1&&fn<kn)}));return gt.length>0?gt:Je}catch(gt){return L.error(gt),Je}})($e)))}catch(Je){return L.error(Je),$e}})(Ve),Ve}function ee(ge,we){let Ve=[];return ge&&((function(Je){try{const gt=[];if(Je&&gt.push(Je),!K.get().streaming.abr.enableSupplementalPropertyAdaptationSetSwitching||!Je.adaptationSetSwitchingCompatibleIds||Je.adaptationSetSwitchingCompatibleIds.length===0)return gt;const Et=z[Je.streamInfo.id][Je.type].getAllMediaInfos().filter((Jt=>Je.adaptationSetSwitchingCompatibleIds.includes(Jt.id)));return gt.concat(Et)}catch{return[Je]}})(ge).forEach((Je=>{let gt=D.getVoRepresentations(Je);gt&&gt.length>0&&(Ve=Ve.concat(gt))})),Ve=(function(Je){return Je.forEach((gt=>{if(gt.dependentRepresentation&&gt.dependentRepresentation.mediaInfo===null){let Et=gt.dependentRepresentation.id,Jt=Je.find((fn=>fn.id===Et));Jt&&(gt.dependentRepresentation=Jt)}})),Je})(Ve),Ve=(function(Je){return Je=(function(gt){let Et=null;return gt.filter((Jt=>(Et||(Et=Jt.mediaInfo),!isNaN(Jt.qualityRanking)&&D.areMediaInfosEqual(Et,Jt.mediaInfo)))).length===gt.length})(Je)?(function(gt){return gt.sort(((Et,Jt)=>Jt.qualityRanking-Et.qualityRanking)),gt})(Je):(function(gt){return gt.sort(((Et,Jt)=>D.areMediaInfosEqual(Et.mediaInfo,Jt.mediaInfo)?(function(fn,bn){return k(fn,bn)})(Et,Jt):(function(fn,bn){if(fn.codecFamily&&bn.codecFamily&&fn.codecFamily===bn.codecFamily)return(function(Kn,Un){const Bn=Q(Kn,Un);return Bn!==0?Bn:k(Kn,Un)})(fn,bn);if(!isNaN(fn.pixelsPerSecond)&&!isNaN(bn.pixelsPerSecond)&&fn.pixelsPerSecond!==bn.pixelsPerSecond)return fn.pixelsPerSecond-bn.pixelsPerSecond;if(!isNaN(fn.bitsPerPixel)&&!isNaN(bn.bitsPerPixel)&&fn.bitsPerPixel!==bn.bitsPerPixel)return bn.bitsPerPixel-fn.bitsPerPixel;const kn=fn.bandwidth-bn.bandwidth;return kn!==0?kn:W(fn,bn)})(Et,Jt))),gt})(Je)})(Ve),Ve.forEach(((Je,gt)=>{Je.absoluteIndex=gt})),Ve=Ve.filter((Je=>{const gt=!!we||D.areMediaInfosEqual(Je.mediaInfo,ge),Et=!Je||!Je.mediaInfo||R.areKeyIdsUsable(Je.mediaInfo);return gt&&Et}))),Ve}function k(ge,we){if(!isNaN(ge.pixelsPerSecond)&&!isNaN(we.pixelsPerSecond)&&ge.pixelsPerSecond!==we.pixelsPerSecond)return ge.pixelsPerSecond-we.pixelsPerSecond;const Ve=ge.bandwidth-we.bandwidth;return Ve!==0?Ve:W(ge,we)}function Q(ge,we){const Ve=ge.isBootstrapRepresentation();return Ve===we.isBootstrapRepresentation()?0:Ve?-1:1}function W(ge,we){const Ve=Q(ge,we);return Ve!==0?Ve:we.k-ge.k}function re(ge){const we=ge.request.mediaType,Ve=ge.streamId;if(!(we&&Ve&&z[Ve]&&K.get().streaming.abr.autoSwitchBitrate[we]))return;const $e=z[Ve][we];if(!$e)return;var Je;if(!(!((Je=$e.getLastSegment())&&Je.isPartialSegment&&!isNaN(Je.totalNumberOfPartialSegments)&&!isNaN(Je.replacementSubNumber))||Je.replacementSubNumber===0))return;const gt=Me($e,ge.request),Et=T.shouldAbandonFragment(gt);Et&&Et.representation!==f.default.NO_CHANGE&&(function(Jt,fn,bn,kn,Kn){if(kn.getFragmentModel().getRequests({state:Ue.FRAGMENT_MODEL_LOADING,index:Jt.request.index})[0]){const Un=(function(Bn,xn){return l[Bn]&&l[Bn][xn]?l[Bn][xn]:null})(fn,bn);Un&&(Un.state=o.ABANDON_LOAD),J.reset(),Ee(bn,q.getActiveStreamInfo(),Kn.representation,Kn.reason),clearTimeout(c),c=setTimeout((()=>{Un&&(l[fn][bn].state=o.ALLOW_LOAD),c=null}),K.get().streaming.abandonLoadTimeout)}})(ge,Ve,we,$e,Et)}function Ce(){if(K.get().streaming.abr.limitBitrateByPortal)for(const ge in z)for(const we in z[ge])oe(we,ge)}function Me(ge,we){return S(n).create({abrController:O,adapter:D,currentRequest:we,droppedFramesHistory:N,streamProcessor:ge,switchRequestHistory:J,throughputController:v,videoModel:A})}function ve(ge){ge.mediaType===r.default.VIDEO&&(pe(ge.streamId),b=ge.newRepresentation.id)}function ue(ge){!Ae()||ge.metric!==o.BUFFER_LEVEL||ge.mediaType!==r.default.AUDIO&&ge.mediaType!==r.default.VIDEO||(function(we,Ve){try{const $e=K.get().streaming.abr.hybridSwitchBufferTime,Je=$e,gt=.5*$e,Et=T.getBolaState(we),Jt=Ve>=(Et?gt:Je);T.setBolaState(we,Jt),Jt!==Et&&(Jt?L.info("["+we+"] switching from throughput to buffer occupancy ABR rule (buffer: "+Ve.toFixed(3)+")."):L.info("["+we+"] switching from buffer occupancy to throughput ABR rule (buffer: "+Ve.toFixed(3)+")."))}catch($e){L.error($e)}})(ge.mediaType,.001*ge.value.level)}function oe(ge,we){try{if(!(ge&&z&&z[we]&&z[we][ge]))return!1;pe(we);const Ve=z[we][ge],$e=Ve.getLastSegment(),Je=Ve.getRepresentationController()?.getCurrentCompositeRepresentation(),gt=ne($e,Je);if(!K.get().streaming.abr.autoSwitchBitrate[ge]||!gt)return!1;const Et=Me(Ve),Jt=T.getBestPossibleSwitchRequest(Et);if(!Jt||!Jt.representation)return!1;let fn=Jt.representation;return(function(bn,kn){J.push({currentRepresentation:bn,newRepresentation:kn})})(Je,fn),fn.id!==Je.id&&(l[we][ge].state===o.ALLOW_LOAD||fn.absoluteIndex<Je.absoluteIndex)&&(se(ge,Je,fn,Jt.reason),!0)}catch(Ve){return L.error(Ve),!1}}function ne(ge,we){return!(ge&&ge.isPartialSegment&&!isNaN(ge.totalNumberOfPartialSegments)&&!isNaN(ge.replacementSubNumber))||ge.replacementSubNumber===ge.totalNumberOfPartialSegments-1||(function(Ve,$e){if(!$e||!$e.segmentSequenceProperties||$e.segmentSequenceProperties.length<=0||$e&&$e.mediaInfo&&$e.mediaInfo.adaptationSetSwitchingCompatibleIds&&$e.mediaInfo.adaptationSetSwitchingCompatibleIds.length>0)return!1;const Je=$e.segmentSequenceProperties.filter((Et=>!isNaN(Et.sapType)&&Et.sapType<=1));if(Je.length===0)return!1;let gt=(Ve.replacementSubNumber+1)%Ve.totalNumberOfPartialSegments;return Je.some((Et=>gt%Et.cadence==0))})(ge,we)}function pe(ge){if(N){const we=A.getPlaybackQuality();we&&N.push(ge,b,we)}}function Ee(ge,we,Ve,$e={}){if(!(we&&we.id&&ge&&z&&z[we.id]&&z[we.id][ge]&&Ve))return!1;const Je=z[we.id][ge],gt=Je.getRepresentationController()?.getCurrentCompositeRepresentation();return(!gt||Ve.id!==gt.id)&&se(ge,gt,Ve,$e)}function te(ge,we){return`${ge}-${we}`}function se(ge,we,Ve,$e){const Je=Ve.mediaInfo.streamInfo.id;if(!ge||!z[Je]||!z[Je][ge])return!1;const gt=z[Je][ge].getStreamInfo(),Et=m.getCurrentBufferLevel(ge),Jt=we!==null&&!D.areMediaInfosEqual(we.mediaInfo,Ve.mediaInfo),fn=we?we.bitrateInKbit:0;return L.info(`[AbrController]: Switching quality in period ${Je} for media type ${ge}. Switch from bitrate ${fn} to bitrate ${Ve.bitrateInKbit}. Current buffer level: ${Et}. Reason:`+($e?JSON.stringify($e):"/")),t.trigger(H.default.QUALITY_CHANGE_REQUESTED,{isAdaptationSetSwitch:Jt,mediaType:ge,newRepresentation:Ve,oldRepresentation:we,reason:$e,streamInfo:gt},{streamId:gt.id,mediaType:ge}),(function(bn){const kn=v.getAverageThroughput(bn);isNaN(kn)||u.setSavedBitrateSettings(bn,kn)})(ge),!0}function Ae(){return K.get().streaming.abr.rules.bolaRule.active&&K.get().streaming.abr.rules.throughputRule.active}return O={canPerformQualitySwitch:ne,checkPlaybackQuality:oe,clearDataForStream:function(ge){N&&N.clearForStream(ge),z[ge]&&delete z[ge],J&&J.clearForStream(ge),l[ge]&&delete l[ge],T.clearDataForStream(ge)},getAbandonmentStateFor:function(ge,we){return l[ge]&&l[ge][we]?l[ge][we].state:null},getInitialBitrateFor:function(ge){if(ge===r.default.TEXT)return NaN;let we=x.getAbrBitrateParameter("initialBitrate",ge);if(we>0)return we;let Ve=NaN;if(u&&u.hasOwnProperty("getSavedBitrateSettings")&&(Ve=u.getSavedBitrateSettings(ge)),!isNaN(Ve))return Ve;const $e=v.getAverageThroughput(ge);return!isNaN($e)&&$e>0?$e:ge===r.default.VIDEO?1e3:100},getOptimalRepresentationForBitrate:function(ge,we,Ve=!0){const $e=C(ge,Ve);if(!$e||$e.length===0)return null;const Je=$e.reduce(((Et,Jt)=>Et.bandwidth<Jt.bandwidth?Et:Jt));if(we<=0)return Je;const gt=$e.filter((Et=>Et.bitrateInKbit<=we));return gt&&gt.length!==0?gt.reduce(((Et,Jt)=>Jt.absoluteIndex>Et.absoluteIndex?Jt:Et)):Je},getPossibleVoRepresentations:function(ge,we=!0){return ee(ge,we)},getPossibleVoRepresentationsFilteredBySettings:C,getRepresentationByAbsoluteIndex:function(ge,we,Ve=!0){return isNaN(ge)||ge<0?null:C(we,Ve).find(($e=>$e.absoluteIndex===ge))},handleNewMediaInfo:function(ge){T.handleNewMediaInfo(ge)},handlePendingManualQualitySwitch:function(ge,we){try{const Ve=te(ge,we);let $e=null;if(U.has(Ve)&&($e=U.get(Ve)),!$e)return!1;const Je=z[ge][we],gt=Je.getLastSegment();if(!ne(gt,Je.getRepresentation()))return!1;const{type:Et,streamInfo:Jt,representation:fn,reason:bn}=$e;return U.delete(Ve),Ee(Et,Jt,fn,bn),!0}catch(Ve){L.error(`Can not handle pending manual quality switch: ${Ve}`)}},initialize:function(){N=be(n).create(),J=$(n).create(),T=V(n).create({dashMetrics:m,customParametersModel:M,mediaPlayerModel:x,settings:K}),T.initialize(),t.on(H.default.QUALITY_CHANGE_RENDERED,ve,O),t.on(H.default.METRIC_ADDED,ue,O),t.on(h.default.LOADING_PROGRESS,re,O),t.on(h.default.VIDEO_ELEMENT_RESIZED,Ce,O)},isPlayingAtLowestQuality:function(ge){return C(ge.mediaInfo,!0)[0].id===ge.id},isPlayingAtTopQuality:function(ge){if(!ge)return!0;const we=C(ge.mediaInfo,!0);return we[we.length-1].id===ge.id},manuallySetPlaybackQuality:function(ge,we,Ve,$e={}){const Je=z[we.id][ge];if(ne(Je.getLastSegment(),Je.getRepresentation()))return Ee(ge,we,Ve,$e);(function(gt,Et,Jt,fn){try{L.debug(`[AbrController] Queuing manual quality switch for stream ${Et.id} and type ${gt} to representation ${Jt.id}`);const bn=te(Et.id,gt);U.set(bn,{type:gt,streamInfo:Et,representation:Jt,reason:fn})}catch(bn){L.error(`Can not queue manual quality switch: ${bn}`)}})(ge,we,Ve,$e)},registerStreamType:function(ge,we){const Ve=we.getStreamInfo().id;z[Ve]||(z[Ve]={}),z[Ve][ge]=we,l[Ve]||(l[Ve]={}),l[Ve][ge]={},l[Ve][ge].state=o.ALLOW_LOAD,T.getBolaState(ge)===void 0&&T.setBolaState(ge,K.get().streaming.abr.rules.bolaRule.active&&!Ae())},reset:function(){y(),t.off(H.default.QUALITY_CHANGE_RENDERED,ve,O),t.off(H.default.METRIC_ADDED,ue,O),t.off(h.default.LOADING_PROGRESS,re,O),t.off(h.default.VIDEO_ELEMENT_RESIZED,Ce,O),T&&T.reset()},setConfig:function(ge){ge&&(ge.streamController&&(q=ge.streamController),ge.throughputController&&(v=ge.throughputController),ge.domStorage&&(u=ge.domStorage),ge.mediaPlayerModel&&(x=ge.mediaPlayerModel),ge.customParametersModel&&(M=ge.customParametersModel),ge.cmsdModel&&(d=ge.cmsdModel),ge.dashMetrics&&(m=ge.dashMetrics),ge.adapter&&(D=ge.adapter),ge.videoModel&&(A=ge.videoModel),ge.settings&&(K=ge.settings),ge.capabilities&&(R=ge.capabilities))},setPlaybackQuality:Ee,unRegisterStreamType:function(ge,we){try{z[ge]&&z[ge][we]&&delete z[ge][we],l[ge]&&l[ge][we]&&delete l[ge][we]}catch{}}},L=e.getLogger(O),y(),O}tt.__dashjs_factory_name="AbrController";const ae=F.default.getSingletonFactory(tt);F.default.updateSingletonFactory(tt.__dashjs_factory_name,ae);var ze,je,Y,he,et,at=ae,Tt=function(n){for(var e=[],t=0;t<n.length;++t){var l=n.charCodeAt(t);l<128?e.push(l):l<2048?(e.push(192|l>>6),e.push(128|63&l)):l<65536?(e.push(224|l>>12),e.push(128|63&l>>6),e.push(128|63&l)):(e.push(240|l>>18),e.push(128|63&l>>12),e.push(128|63&l>>6),e.push(128|63&l))}return e},st=function(n){for(var e=[],t=0;t<n.length;){var l=n[t++];l<128||(l<224?(l=(31&l)<<6,l|=63&n[t++]):l<240?(l=(15&l)<<12,l|=(63&n[t++])<<6,l|=63&n[t++]):(l=(7&l)<<18,l|=(63&n[t++])<<12,l|=(63&n[t++])<<6,l|=63&n[t++])),e.push(String.fromCharCode(l))}return e.join("")},_t={};ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",je=function(n){for(var e=0,t=[],l=0|n.length/3;0<l--;){var c=(n[e]<<16)+(n[e+1]<<8)+n[e+2];e+=3,t.push(ze.charAt(63&c>>18)),t.push(ze.charAt(63&c>>12)),t.push(ze.charAt(63&c>>6)),t.push(ze.charAt(63&c))}return n.length-e==2?(c=(n[e]<<16)+(n[e+1]<<8),t.push(ze.charAt(63&c>>18)),t.push(ze.charAt(63&c>>12)),t.push(ze.charAt(63&c>>6)),t.push("=")):n.length-e==1&&(c=n[e]<<16,t.push(ze.charAt(63&c>>18)),t.push(ze.charAt(63&c>>12)),t.push("==")),t.join("")},Y=(function(){for(var n=[],e=0;e<64;++e)n[ze.charCodeAt(e)]=e;return n[61]=0,n})(),he=function(n){for(var e=0,t=[],l=0|n.length/4;0<l--;){var c=(Y[n.charCodeAt(e)]<<18)+(Y[n.charCodeAt(e+1)]<<12)+(Y[n.charCodeAt(e+2)]<<6)+Y[n.charCodeAt(e+3)];t.push(255&c>>16),t.push(255&c>>8),t.push(255&c),e+=4}return t&&(n.charAt(e-2)=="="?(t.pop(),t.pop()):n.charAt(e-1)=="="&&t.pop()),t},et={encode:function(n){for(var e=[],t=0;t<n.length;++t)e.push(n.charCodeAt(t));return e},decode:function(n){for(var e=0;e<s.length;++e)a[e]=String.fromCharCode(a[e]);return a.join("")}},_t.decodeArray=function(n){var e=he(n);return new Uint8Array(e)},_t.encodeASCII=function(n){var e=et.encode(n);return je(e)},_t.decodeASCII=function(n){var e=he(n);return et.decode(e)},_t.encode=function(n){var e=Tt(n);return je(e)},_t.decode=function(n){var e=he(n);return st(e)};var Zt=_t,In=P(7393);const Vt=NaN;class _n{constructor(e,t){this.data={baseUrls:e||null,selectedIdx:t||Vt},this.children=[]}}function gn(){let n,e,t,l,c;const T=this.context,D=(0,In.default)(T).getInstance();function R(m,u,N){const O=d(N);t.childBaseUrls.push(...O),m[u]?D.areEqual(O,m[u].data.baseUrls)||(m[u].data.baseUrls=O,m[u].data.selectedIdx=Vt):m[u]=new _n(O)}function d(m){let u=l.getBaseURLsFromElement(m);const N=c.getSynthesizedBaseUrlElements(u);return N&&N.length>0&&N.forEach((O=>{const L=u.findIndex((x=>x.serviceLocation===O.serviceLocation));L!==-1?u[L]=O:u.push(O)})),u}function b(m,u){const N=u||e;m(N.data),N.children&&N.children.forEach((O=>b(m,O)))}function M(){e=new _n,t={rootBaseUrls:[],childBaseUrls:[]}}return n={getAvailableBaseUrlsForElement:function(m){return d(m)},getBaseUrlsForPayload:function(){return{rootBaseUrls:t.rootBaseUrls.slice(),childBaseUrls:t.childBaseUrls.slice()}},getForPath:function(m){let u=e;const N=[u.data];return m&&m.forEach((O=>{u=u.children[O],u&&N.push(u.data)})),N.filter((O=>O.baseUrls.length))},invalidateSelectedIndexes:function(m){b((u=>{isNaN(u.selectedIdx)||m===u.baseUrls[u.selectedIdx].serviceLocation&&(u.selectedIdx=Vt)}))},reset:M,setConfig:function(m){m.adapter&&(l=m.adapter),m.contentSteeringController&&(c=m.contentSteeringController)},update:function(m){(function(u){(function(){if(!l||!l.hasOwnProperty("getBaseURLsFromElement")||!l.hasOwnProperty("getRepresentationSortFunction"))throw new Error("setConfig function has to be called previously")})();const N=d(u);t={rootBaseUrls:N,childBaseUrls:[]},D.areEqual(N,e.data.baseUrls)||(e.data.baseUrls=N,e.data.selectedIdx=Vt),u&&u.Period&&u.Period.forEach(((O,L)=>{R(e.children,L,O),O.AdaptationSet&&O.AdaptationSet.forEach(((x,U)=>{R(e.children[L].children,U,x),x.Representation&&x.Representation.sort(l.getRepresentationSortFunction()).forEach(((K,q)=>{R(e.children[L].children[U].children,q,K)}))}))}))})(m)}},M(),n}gn.__dashjs_factory_name="BaseURLTreeModel";var Jn=F.default.getClassFactory(gn),Pn=P(893),xt=P(3773),Ft=class{constructor(n){this.url=n||null,this.type=Ge.HTTPRequest.CONTENT_STEERING_TYPE,this.responseType="json"}},Rt=class{constructor(){this.version=null,this.ttl=300,this.reloadUri=null,this.pathwayPriority=[],this.pathwayClones=[]}},fe=P(8854),Ht=P(6503),zt=P(9415),tn=P(6517),rn=P(7263);function Bt(){const n=this.context,e=(0,Ht.default)(n).getInstance();let t,l,c,T,D,R,d,b,M,m,u,N,O,L,x,U;function K(W){J(W,"baseUrl")}function q(W){J(W,"location")}function z(W){var re,Ce;W&&W.throughputValues&&W.throughputValues.serviceLocation&&(re=W.throughputValues.serviceLocation,Ce=W.throughputValues,L[re]||(L[re]=[]),L[re].push(Ce),L[re].length>4&&L[re].shift())}function J(W,re){if(W&&W.request&&W.request.serviceLocation){const Ce=W.request.serviceLocation;N[re].all.indexOf(Ce)===-1&&N[re].all.push(Ce),N[re].current=Ce}}function v(){const W=b.getValue();let re=t.getContentSteering(W);return re||(re=u.getServiceDescriptionSettings().contentSteering),!re&&l&&(re=l),l=re,re}function A(){return new Promise((W=>{try{const re=v();if(!re||!re.serverUrl)return void W();const Ce=(function(ve){let ue=ve.serverUrl;c&&c.reloadUri&&(ue=e.isRelative(c.reloadUri)?e.resolve(c.reloadUri,ve.serverUrl):c.reloadUri);const oe=[],ne=N.baseUrl.all.concat(N.location.all);if(ne.length>0){const pe=ne.map((se=>{const Ae=(function(ge){if(!ge||!L[ge]||L[ge].length===0)return-1;const we=O.getArithmeticMean(L[ge],L[ge].length,!0);return parseInt(1e3*we)})(se);return{serviceLocation:se,throughput:Ae}}));let Ee="",te="";pe.forEach(((se,Ae)=>{Ae!==0&&(Ee+=",",te+=","),Ee+=se.serviceLocation,te+=se.throughput>-1?se.throughput:""})),oe.push({key:"_DASH_pathway",value:`"${Ee}"`}),oe.push({key:"_DASH_throughput",value:te})}return ue=rn.default.addAdditionalQueryParameterToUrl(ue,oe),ue})(re),Me=new Ft(Ce);x.load({request:Me,success:ve=>{(function(ue){ue&&ue[fe.default.CONTENT_STEERING_RESPONSE.VERSION]&&parseInt(ue[fe.default.CONTENT_STEERING_RESPONSE.VERSION])===1&&(c=new Rt,c.version=ue[fe.default.CONTENT_STEERING_RESPONSE.VERSION],ue[fe.default.CONTENT_STEERING_RESPONSE.TTL]&&!isNaN(ue[fe.default.CONTENT_STEERING_RESPONSE.TTL])&&(c.ttl=ue[fe.default.CONTENT_STEERING_RESPONSE.TTL]),ue[fe.default.CONTENT_STEERING_RESPONSE.RELOAD_URI]&&(c.reloadUri=ue[fe.default.CONTENT_STEERING_RESPONSE.RELOAD_URI]),ue[fe.default.CONTENT_STEERING_RESPONSE.PATHWAY_PRIORITY]&&(c.pathwayPriority=ue[fe.default.CONTENT_STEERING_RESPONSE.PATHWAY_PRIORITY]),ue[fe.default.CONTENT_STEERING_RESPONSE.PATHWAY_CLONES]&&(c.pathwayClones=ue[fe.default.CONTENT_STEERING_RESPONSE.PATHWAY_CLONES],c.pathwayClones=c.pathwayClones.filter((oe=>(function(ne){return ne[fe.default.CONTENT_STEERING_RESPONSE.BASE_ID]&&ne[fe.default.CONTENT_STEERING_RESPONSE.ID]&&ne[fe.default.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT]&&ne[fe.default.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][fe.default.CONTENT_STEERING_RESPONSE.HOST]})(oe)))),ee())})(ve),R.trigger(H.default.CONTENT_STEERING_REQUEST_COMPLETED,{currentSteeringResponseData:c,url:Ce}),W()},error:(ve,ue,oe,ne)=>{(function(pe,Ee){try{switch(d.warn("Error fetching data from content steering server",pe),Ee.status){case 404:case 410:l=null;break;case 429:const te=Ee&&Ee.headers&&Ee.headers["retry-after"];te!==null&&(c||(c={}),c.ttl=parseInt(te)),ee();break;default:ee()}}catch(te){d.error(te)}})(ve,ne),W(ve)},complete:()=>{N.baseUrl.all=y(N.baseUrl),N.location.all=y(N.location)}})}catch(re){W(re)}}))}function y(W){return W.all&&W.all.length!==0&&W.current?W.all.filter((re=>re===W.current)):[]}function C(W){try{const re=[];return W&&W.length!==0&&c&&c.pathwayClones&&c.pathwayClones.length!==0&&c.pathwayClones.forEach((Ce=>{let Me=W.filter((ue=>Ce[fe.default.CONTENT_STEERING_RESPONSE.BASE_ID]===ue.serviceLocation)),ve=null;if(Me&&Me.length>0&&(ve=Me[0]),ve){const ue=new URL(ve.url);let oe=Ce[fe.default.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][fe.default.CONTENT_STEERING_RESPONSE.HOST];oe=rn.default.stringHasProtocol(oe)?oe:`${ue.protocol}//${oe}`;const ne={synthesizedUrl:`${oe}${ue.pathname}`,serviceLocation:Ce[fe.default.CONTENT_STEERING_RESPONSE.ID],queryParams:Ce[fe.default.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][fe.default.CONTENT_STEERING_RESPONSE.PARAMS],reference:ve};re.push(ne)}})),re}catch(re){return d.error(re),[]}}function ee(){c&&c.ttl&&!isNaN(c.ttl)&&(m&&clearTimeout(m),m=setTimeout((()=>{A()}),1e3*c.ttl))}function k(){m&&clearTimeout(m),m=null}function Q(){c=null,l=null,L={},N={baseUrl:{current:null,all:[]},location:{current:null,all:[]}},k()}return U={reset:function(){Q(),R.off(H.default.FRAGMENT_LOADING_STARTED,K,U),R.off(H.default.MANIFEST_LOADING_STARTED,q,U),R.off(H.default.THROUGHPUT_MEASUREMENT_STORED,z,U)},setConfig:function(W){W&&(W.adapter&&(t=W.adapter),W.errHandler&&(D=W.errHandler),W.dashMetrics&&(T=W.dashMetrics),W.mediaPlayerModel&&(M=W.mediaPlayerModel),W.manifestModel&&(b=W.manifestModel),W.serviceDescriptionController&&(u=W.serviceDescriptionController),W.throughputController&&(O=W.throughputController),W.eventBus&&(R=W.eventBus))},loadSteeringData:A,getCurrentSteeringResponseData:function(){return c},shouldQueryBeforeStart:function(){const W=v();return!!W&&W.queryBeforeStart},getSteeringDataFromManifest:v,stopSteeringRequestTimer:k,getSynthesizedBaseUrlElements:function(W){try{return C(W).map((re=>{const Ce=new zt.default(re.synthesizedUrl,re.serviceLocation);return Ce.queryParams=re.queryParams,Ce.dvbPriority=re.reference.dvbPriority,Ce.dvbWeight=re.reference.dvbWeight,Ce.availabilityTimeOffset=re.reference.availabilityTimeOffset,Ce.availabilityTimeComplete=re.reference.availabilityTimeComplete,Ce}))}catch(re){return d.error(re),[]}},getSynthesizedLocationElements:function(W){try{return C(W).map((re=>{const Ce=new tn.default(re.synthesizedUrl,re.serviceLocation);return Ce.queryParams=re.queryParams,Ce}))}catch(re){return d.error(re),[]}},initialize:function(){x=(0,xt.default)(n).create({errHandler:D,dashMetrics:T,mediaPlayerModel:M,errors:Pn.default}),R.on(H.default.FRAGMENT_LOADING_STARTED,K,U),R.on(H.default.MANIFEST_LOADING_STARTED,q,U),R.on(H.default.THROUGHPUT_MEASUREMENT_STORED,z,U)}},d=(0,p.default)(n).getInstance().getLogger(U),Q(),U}Bt.__dashjs_factory_name="ContentSteeringController";var ft=F.default.getSingletonFactory(Bt);function Qt(n){let e;n=n||{};let t=[];const l=(0,g.default)(this.context).getInstance(),c=(0,E.default)(this.context).getInstance(),T=ft(this.context).getInstance(),D=n.updateEventName,R=n.addBlacklistEventName;function d(m){if(t.findIndex((N=>N.entry===m))!==-1)return;const u=n.enableExpiry?(function(){const N=T?T.getCurrentSteeringResponseData():null;return N&&Number.isFinite(N.ttl)?N.ttl:c.get().streaming.blacklistExpiryTime})():NaN;if(n.enableExpiry&&u&&u>0){const N=setTimeout((()=>{b(m)}),1e3*u);t.push({entry:m,timeoutId:N})}else t.push({entry:m});l.trigger(D,{entry:m})}function b(m){const u=t.findIndex((N=>N.entry===m));u!==-1&&t.splice(u,1)}function M(m){d(m.entry)}return e={add:d,remove:b,contains:function(m){return!!(t.length&&m&&m.length)&&t.findIndex((u=>u.entry===m))!==-1},initialize:function(){R&&l.on(R,M,e)},reset:function(){R&&l.off(R,M,e);for(const m of t)m.timeoutId&&clearTimeout(m.timeoutId);t=[]}},e}Qt.__dashjs_factory_name="BlackListController";var Fn=F.default.getClassFactory(Qt);function vn(n){let e;const t=(n=n||{}).blacklistController;return e={select:function(l){return l&&(function(c){let T,D,R=0,d=[],b=0;if(D=c.sort((function(M,m){let u=M.dvbPriority-m.dvbPriority;return isNaN(u)?0:u})).filter((function(M,m,u){return!m||u[0].dvbPriority&&M.dvbPriority&&u[0].dvbPriority===M.dvbPriority})),D.length)return D.length>1&&(D.forEach((M=>{R+=M.dvbWeight,d.push(R)})),T=Math.floor(Math.random()*R),d.every(((M,m)=>(b=m,!(T<M))))),D[b]})((function(c){let T=[];return c.filter((function(D){return!t.contains(D.serviceLocation)||(D.dvbPriority&&T.push(D.dvbPriority),!1)})).filter((function(D){return!T.length||!D.dvbPriority||T.indexOf(D.dvbPriority)===-1}))})(l))}},e}vn.__dashjs_factory_name="DVBSelector";var en=F.default.getClassFactory(vn);function mn(n){let e;const t=(n=n||{}).blacklistController;return e={select:function(l){let c,T=0;return l&&l.some(((D,R)=>(T=R,!t.contains(D.serviceLocation))))&&(c=l[T]),c}},e}mn.__dashjs_factory_name="BasicSelector";var On=F.default.getClassFactory(mn),un=P(1944),yn=P(656);function hn(){const n=this.context;let e,t,l;function c(T=[],D=[]){let R=0,d=NaN;for(;R<T.length;){const b=T[R],M=D.findIndex((m=>m.serviceLocation&&m.serviceLocation===b));if(M!==-1&&!l.contains(D[M].serviceLocation)){d=M;break}R+=1}return d}return e={selectBaseUrlIndex:function(T){let D=NaN;if(isNaN(T.selectedIdx)){const d=t.getSteeringDataFromManifest();d&&d.defaultServiceLocationArray.length>0&&(D=c(d.defaultServiceLocationArray,T.baseUrls))}const R=t.getCurrentSteeringResponseData();return T.baseUrls&&T.baseUrls.length&&R&&R.pathwayPriority&&R.pathwayPriority.length&&(D=c(R.pathwayPriority,T.baseUrls)),D},setConfig:function(T){T.blacklistController&&(l=T.blacklistController),T.contentSteeringController&&(t=T.contentSteeringController)}},t=ft(n).getInstance(),e}hn.__dashjs_factory_name="ContentSteeringSelector";var Ct=F.default.getClassFactory(hn);function dt(){const n=this.context,e=(0,g.default)(n).getInstance(),t=(0,E.default)(n).getInstance();let l,c,T,D,R,d;function b(){c.reset()}return l={chooseSelector:function(M){(0,yn.checkParameterType)(M,"boolean"),d=M?D:T},initialize:function(){c.initialize()},select:function(M){if(!M)return;if(t.get().streaming.applyContentSteering){const u=R.selectBaseUrlIndex(M);isNaN(u)||u===-1||(M.selectedIdx=u)}if(!isNaN(M.selectedIdx))return M.baseUrls[M.selectedIdx];let m=d.select(M.baseUrls);return m?(M.selectedIdx=M.baseUrls.indexOf(m),m):(e.trigger(h.default.URL_RESOLUTION_FAILED,{error:new un.default(Pn.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,Pn.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE)}),void(d===T&&b()))},reset:b,setConfig:function(M){M.selector&&(d=M.selector),M.contentSteeringSelector&&(R=M.contentSteeringSelector)}},c=Fn(n).create({updateEventName:h.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,addBlacklistEventName:h.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD,enableExpiry:!0}),T=On(n).create({blacklistController:c}),D=en(n).create({blacklistController:c}),R=Ct(n).create(),R.setConfig({blacklistController:c,addBlacklistEventName:h.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD}),d=T,l}dt.__dashjs_factory_name="BaseURLSelector";var Wt=F.default.getClassFactory(dt);function $t(){let n,e;const t=this.context,l=(0,g.default)(t).getInstance(),c=(0,Ht.default)(t).getInstance();let T,D,R;function d(u){T.invalidateSelectedIndexes(u.entry)}function b(u){T.update(u),D.chooseSelector(e.getIsDVB(u)),l.trigger(H.default.BASE_URLS_UPDATED,{baseUrls:M(u)})}function M(u){const{rootBaseUrls:N,childBaseUrls:O}=T.getBaseUrlsForPayload(),L=[],x={};return((function(K,q){return!(K&&!K.BaseURL&&q.length!==0)||!!q.some((z=>c.isRelative(z.url)))||!K.Period||K.Period.length===0||K.Period.some((z=>m(z)))})(u,O)?N.concat(O):O).forEach((K=>{const q=`${K.serviceLocation}_${K.url}`;x[q]||(L.push(K),x[q]=!0)})),L}function m(u){if(!u||u.BaseURL)return!1;const N=u.AdaptationSet||u.Representation;return!N||N.length===0||N.some((O=>m(O)))}return n={getBaseUrls:function(u){return T.getAvailableBaseUrlsForElement(u)},initialize:function(u){l.on(h.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,d,n),T.setConfig({adapter:e,contentSteeringController:R}),D.initialize(),b(u)},reset:function(){l.off(h.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,d,n),T.reset(),D.reset()},resolve:function(u){const N=T.getForPath(u).reduce(((O,L)=>{const x=D.select(L);return x?(c.isRelative(x.url)?O.url=c.resolve(x.url,O.url):(O.url=x.url,O.serviceLocation=x.serviceLocation),O.availabilityTimeOffset=x.availabilityTimeOffset,O.availabilityTimeComplete=x.availabilityTimeComplete,O.queryParams=x.queryParams,O):new zt.default}),new zt.default);if(!c.isRelative(N.url))return N},setConfig:function(u){u.baseURLTreeModel&&(T=u.baseURLTreeModel),u.baseURLSelector&&(D=u.baseURLSelector),u.adapter&&(e=u.adapter),u.contentSteeringController&&(R=u.contentSteeringController)},update:b},T=Jn(t).create(),D=Wt(t).create(),n}$t.__dashjs_factory_name="BaseURLController";var Cn=F.default.getClassFactory($t);class An{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 An(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 l={reference_type:e.references[t].reference_type,referenced_size:e.references[t].referenced_size,subsegment_duration:e.references[t].subsegment_duration};this.references.push(l)}}break;case"emsg":this.id=e.id,this.version=e.version===1?1:0,this.value=e.value,this.timescale=e.timescale,this.scheme_id_uri=e.scheme_id_uri,this.presentation_time_delta=e.version===1?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,l=e.samples.length;t<l;t++){let c={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(c)}}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 l=0;l<this.boxes.length;l++)this.boxes[l].type===e&&t.push(this.boxes[l]);return t}}var Wn=An;function er(){let n,e;function t(c){let T=[];if(!c||!e||typeof e.fetchAll!="function")return T;let D,R=e.fetchAll(c);for(let d=0,b=R.length;d<b;d++)D=l(R[d]),D&&T.push(D);return T}function l(c){if(!c)return null;let T=new Wn(c);return c.hasOwnProperty("_incomplete")&&(T.isComplete=!c._incomplete),T}return n={getBox:function(c){return c&&e&&e.boxes&&e.boxes.length!==0&&typeof e.fetch=="function"?l(e.fetch(c)):null},getBoxes:t,setData:function(c){e=c},getLastBox:function(){if(!e||!e.boxes||!e.boxes.length)return null;let c=t(e.boxes[e.boxes.length-1].type);return c.length>0?c[c.length-1]:null}},n}er.__dashjs_factory_name="IsoFile";var Qn=F.default.getClassFactory(er),qn=P(6877),tr=class{constructor({found:n,sizeOfLastCompletedBox:e,sizeOfLastFoundTargetBox:t,startOffsetOfLastCompletedBox:l,startOffsetOfLastFoundTargetBox:c,typeOfLastCompletedBox:T,typeOfLastTargetBox:D}){this.found=n!==void 0&&n,this.sizeOfLastCompletedBox=e!==void 0?e:0,this.sizeOfLastFoundTargetBox=t!==void 0?t:0,this.startOffsetOfLastCompletedBox=l!==void 0?l:0,this.startOffsetOfLastFoundTargetBox=c!==void 0?c:0,this.typeOfLastCompletedBox=T!==void 0?T:null,this.typeOfLastTargetBox=D!==void 0?D:null}};function Zn(){let n,e,t=this.context;function l(D){if(!D)return null;D.fileStart===void 0&&(D.fileStart=0);let R=qn.parseBuffer(D),d=Qn(t).create();return d.setData(R),d}function c(D,R){return D[R+3]>>>0|D[R+2]<<8>>>0|D[R+1]<<16>>>0|D[R]<<24>>>0}function T(D,R){return String.fromCharCode(D[R++])+String.fromCharCode(D[R++])+String.fromCharCode(D[R++])+String.fromCharCode(D[R])}return e={findInitRange:function(D){let R,d,b=null;const M=l(D);if(!M)return b;const m=M.getBox("ftyp"),u=M.getBox("moov");return n.debug("Searching for initialization."),u&&u.isComplete&&(R=m?m.offset:u.offset,d=u.offset+u.size-1,b=R+"-"+d,n.debug("Found the initialization. Range: "+b)),b},findLastTopIsoBoxCompleted:function(D,R,d){if(d===void 0&&(d=0),!R||d+8>=R.byteLength)return new tr({found:!1});const b=R instanceof ArrayBuffer?new Uint8Array(R):R;let M,m=0,u=0,N=null;for(;d<b.byteLength;){const O=c(b,d),L=T(b,d+4);if(O===0)break;d+O<=b.byteLength&&(D.indexOf(L)>=0?M=new tr({found:!0,startOffsetOfLastFoundTargetBox:d,sizeOfLastFoundTargetBox:O,typeOfLastTargetBox:L}):(m=d,u=O,N=L)),d+=O}return M||new tr({found:!1,startOffsetOfLastCompletedBox:m,sizeOfLastCompletedBox:u,typeOfLastCompletedBox:N})},getMediaTimescaleFromMoov:function(D){let R=l(D),d=R?R.getBox("mdhd"):void 0;return d?d.timescale:NaN},getSamplesInfo:function(D){if(!D||D.byteLength===0)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};let R,d,b,M,m,u,N,O,L,x,U,K,q,z,J,v,A,y=l(D),C=y.getBoxes("moof"),ee=y.getBoxes("mfhd");v=y.getBoxes("moof").length,J=ee[ee.length-1].sequence_number,b=0,u=[];let k=-1,Q=-1;for(U=0;U<C.length;U++){let W=C[U],re=W.getChildBoxes("traf");for(L=0;L<re.length;L++){let Ce=re[L],Me=Ce.getChildBox("tfhd"),ve=Ce.getChildBox("tfdt");m=ve.baseMediaDecodeTime;let ue=Ce.getChildBoxes("trun"),oe=Ce.getChildBoxes("subs");for(x=0;x<ue.length;x++){let ne=ue[x];for(b=ne.sample_count,z=(Me.base_data_offset||0)+(ne.data_offset||0),O=0;O<b;O++){N=ne.samples[O],R=N.sample_duration!==void 0?N.sample_duration:Me.default_sample_duration,M=N.sample_size!==void 0?N.sample_size:Me.default_sample_size,d=N.sample_composition_time_offset!==void 0?N.sample_composition_time_offset:0;let pe={dts:m,cts:m+d,duration:R,offset:W.offset+z,size:M,subSizes:[M]};if(oe)for(K=0;K<oe.length;K++){let Ee=oe[K];if(k<Ee.entry_count-1&&O>Q&&(k++,Q+=Ee.entries[k].sample_delta),O==Q){pe.subSizes=[];let te=Ee.entries[k];for(q=0;q<te.subsample_count;q++)pe.subSizes.push(te.subsamples[q].subsample_size)}}u.push(pe),z+=M,m+=R}}A=m-ve.baseMediaDecodeTime}}return{sampleList:u,lastSequenceNumber:J,totalDuration:A,numSequences:v}},parse:l},n=(0,p.default)(t).getInstance().getLogger(e),e}Zn.__dashjs_factory_name="BoxParser";var ar=F.default.getSingletonFactory(Zn),dr=P(559);const Xn={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 gr(n){return n==0?0:n.toString(2).match(/1/g).length}function hr(n,e){let t,l=parseInt("0x"+n,16),c=l&e[0],T=l&e[1];return t=gr(c)+2*gr(T),t}var kr=function(n,e=!1){let t;if(!n||!n.schemeIdUri||!n.value)return;const l=n.schemeIdUri,c=n.value;return l==="urn:mpeg:dash:23003:3:audio_channel_configuration:2011"||l==="urn:mpeg:mpegB:cicp:ChannelConfiguration"?t=Xn[c]&&Xn[c].channels+(e?Xn[c].lfe:0):l==="tag:dolby.com,2014:dash:audio_channel_configuration:2011"?t=(function(T,D){if(T.length===4)return hr(T,[63880+(D?6:0),1648])})(c,e):l==="tag:dolby.com,2015:dash:audio_channel_configuration:2015"?t=(function(T,D){if(T.length===6)return T==="800000"?24:hr(T,[56834+(D?4160:0),205245])})(c,e):l==="tag:dts.com,2014:dash:audio_channel_configuration:2012"?t=parseInt(c):l==="tag:dts.com,2018:uhd:audio_channel_configuration"&&(t=(function(T,D){if(!(T.length>8))return hr(T,[4294901727+(D?65568:0),0])})(c,e)),t};function Pr(){const n=this.context,e=(0,g.default)(n).getInstance();let t,l,c,T,D,R,d;function b(U,K,q,z=void 0){const J=m(U,K,q,z);return c.isCodecSupportedBasedOnTestedConfigurations(J,U)}function M(U,K,q,z,J,v=void 0){const A=m(U,K,q,v),y=JSON.stringify(A);z.has(y)||(z.add(y),J.push(A))}function m(U,K,q,z){let J=null;switch(U){case r.default.VIDEO:J=(function(v,A,y){let C={codec:A,width:v&&v.width||null,height:v&&v.height||null,framerate:l.getFramerate(v)||null,bitrate:v&&v.bandwidth||null,isSupported:!0};if(v.tagName===fe.default.PRESELECTION&&y&&(C.width||(C.width=y.width||null),C.height||(C.height=y.height||null),C.bitrate||(C.bitrate=y.bandwidth||null),C.framerate||(C.framerate=l.getFramerate(y)||null)),T.get().streaming.capabilities.filterVideoColorimetryEssentialProperties&&(Object.assign(C,N(v)),v.tagName===fe.default.PRESELECTION&&y)){let Q=N(y),W=Q.isSupported;delete Q.isSupported,C.isSupported=C.isSupported&&W,u(C,Q)}let ee=C.isSupported;if(T.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties&&(Object.assign(C,O(v)),v.tagName===fe.default.PRESELECTION&&y)){let Q=O(y),W=Q.isSupported;delete Q.isSupported,C.isSupported=C.isSupported&&W,u(C,Q)}let k=C.isSupported;return ee&&k||(C.isSupported=!1),C})(K,q,z);break;case r.default.AUDIO:J=(function(v,A,y){let C={codec:A,samplerate:v&&v.audioSamplingRate||null,bitrate:v&&v.bandwidth||null,isSupported:!0};return v.tagName===fe.default.PRESELECTION&&y&&(C.samplerate||(C.samplerate=y.audioSamplingRate||null),C.bitrate||(C.bitrate=y.bandwidth||null)),T.get().streaming.capabilities.filterAudioChannelConfiguration&&Object.assign(C,(function(ee,k){let Q=ee[fe.default.AUDIO_CHANNEL_CONFIGURATION]||[],W=null;Q.length==0&&k&&(Q=k[fe.default.AUDIO_CHANNEL_CONFIGURATION]||[]);const re=Q.map((Ce=>kr(Ce,!0)));return re.every((Ce=>Ce==re[0]))&&(W=re[0]),{channels:W}})(v,y)),C})(K,q,z);break;default:return J}return z&&(J=L(z,J)),L(K,J)}function u(U,K){for(const q in K)Object.prototype.hasOwnProperty.call(K,q)&&!(q in U)&&(U[q]=K[q]);return U}function N(U){let K={colorGamut:null,transferFunction:null,isSupported:!0};for(const q of U.EssentialProperty||[])q.schemeIdUri===r.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&["1","5","6","7"].includes(q.value.toString())?K.colorGamut=r.default.MEDIA_CAPABILITIES_API.COLORGAMUT.SRGB:q.schemeIdUri===r.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&["11","12"].includes(q.value.toString())?K.colorGamut=r.default.MEDIA_CAPABILITIES_API.COLORGAMUT.P3:q.schemeIdUri===r.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&["9"].includes(q.value.toString())?K.colorGamut=r.default.MEDIA_CAPABILITIES_API.COLORGAMUT.REC2020:q.schemeIdUri===r.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&["2"].includes(q.value.toString())?K.colorGamut=null:q.schemeIdUri===r.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&(K.isSupported=!1),q.schemeIdUri===r.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["1","6","13","14","15"].includes(q.value.toString())?K.transferFunction=r.default.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.SRGB:q.schemeIdUri===r.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["16"].includes(q.value.toString())?K.transferFunction=r.default.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.PQ:q.schemeIdUri===r.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["18"].includes(q.value.toString())?K.transferFunction=r.default.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.HLG:q.schemeIdUri===r.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["2"].includes(q.value.toString())?K.transferFunction=null:q.schemeIdUri===r.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&(K.isSupported=!1);return K}function O(U){let K={isSupported:!0,hdrMetadataType:null};for(const q of U.EssentialProperty||[])q.schemeIdUri===r.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&q.value===r.default.HDR_METADATA_FORMAT_VALUES.ST2094_10?K.hdrMetadataType=r.default.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_10:q.schemeIdUri===r.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&q.value===r.default.HDR_METADATA_FORMAT_VALUES.SL_HDR2?K.hdrMetadataType=r.default.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SLHDR2:q.schemeIdUri===r.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&q.value===r.default.HDR_METADATA_FORMAT_VALUES.ST2094_40?K.hdrMetadataType=r.default.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_40:q.schemeIdUri===r.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&(K.isSupported=!1);return K}function L(U,K){return R&&U&&U[fe.default.CONTENT_PROTECTION]&&U[fe.default.CONTENT_PROTECTION].length>0&&(K.keySystemsMetadata=R.getSupportedKeySystemMetadataFromContentProtection(U[fe.default.CONTENT_PROTECTION])),K}function x(U){if(!U||U.length===0)return!0;let K=0;for(;K<U.length;){if(!c.supportsEssentialProperty(U[K]))return d.debug("[Stream] EssentialProperty not supported: "+U[K].schemeIdUri),!1;K+=1}return!0}return t={setConfig:function(U){U&&(U.adapter&&(l=U.adapter),U.capabilities&&(c=U.capabilities),U.settings&&(T=U.settings),U.protectionController&&(R=U.protectionController),U.customParametersModel&&(D=U.customParametersModel))},filterUnsupportedFeatures:function(U){return new Promise((K=>{const q=[r.default.VIDEO,r.default.AUDIO],z=[];q.forEach((J=>{(function(A,y){if(!A||!A.Period||A.Period.length===0)return[];const C=new Set,ee=[];return A.Period.forEach((k=>{k.AdaptationSet.forEach((Q=>{l.getIsTypeOf(Q,y)&&Q.Representation.forEach(((W,re)=>{const Ce=l.getCodec(Q,re,!1);M(y,W,Ce,C,ee);const Me=l.getSupplementalCodecs(W);Me.length>0&&M(y,W,Me[0],C,ee)}))})),k.Preselection&&k.Preselection.length&&k.Preselection.forEach((Q=>{if(l.getPreselectionIsTypeOf(Q,k.AdaptationSet,y)){const W=l.getCodecForPreselection(Q,k.AdaptationSet),re=l.getCommonRepresentationForPreselection(Q,k.AdaptationSet);M(y,Q,W,C,ee,re)}}))})),ee})(U,J).forEach((A=>{z.push(c.runCodecSupportCheck(A,J))}))})),Promise.allSettled(z).then((()=>(q.forEach((J=>{(function(v,A){A&&A.Period&&A.Period.length!==0&&A.Period.forEach((y=>{(function(C,ee){if(!C||!C.AdaptationSet||C.AdaptationSet.length===0)return;const k=new Set,Q=C.AdaptationSet;C.AdaptationSet=Q.filter((W=>{l.getIsTypeOf(W,ee)&&(function(Ce,Me){Ce.Representation&&Ce.Representation.length!==0&&(Ce.Representation=Ce.Representation.filter(((ve,ue)=>{const oe=l.getCodec(Ce,ue,!1),ne=b(Me,ve,oe);let pe=(function(Ee,te){let se=!1;const Ae=l.getSupplementalCodecs(Ee);return Ae.length>0&&(Ae.length>1&&d.warn("[CapabilitiesFilter] Multiple supplemental codecs not supported; using the first in list"),se=b(te,Ee,Ae[0])),se})(ve,Me);return pe&&(d.debug(`[CapabilitiesFilter] Codec supported. Upgrading codecs string of Representation with ID ${ve.id}`),ve.codecs=ve[fe.default.SUPPLEMENTAL_CODECS]),ne||pe||d.warn(`[CapabilitiesFilter] Codec ${oe} not supported. Removing Representation with ID ${ve.id}`),ne||pe})))})(W,ee);const re=W.Representation&&W.Representation.length>0;if(!re){k.add(W);const Ce=Q.filter((Me=>Me!==W&&l.getIsTypeOf(Me,ee)&&!k.has(Me)));e.trigger(h.default.ADAPTATION_SET_REMOVED_NO_CAPABILITIES,{adaptationSet:W,remainingAdaptationSets:Ce}),d.warn(`[CapabilitiesFilter] AdaptationSet with ID ${W.id?W.id:"undefined"} and codec ${W.codecs?W.codecs:"undefined"} has been removed because of no supported Representation`)}return re}))})(y,v),(function(C,ee){C&&C.Preselection&&C.Preselection.length!==0&&(C.Preselection=C.Preselection.filter((k=>{if(l.getPreselectionIsTypeOf(k,C.AdaptationSet,ee)){const Q=l.getCodecForPreselection(k,C.AdaptationSet);let W=!0;if(Q){let re=l.getCommonRepresentationForPreselection(k,C.AdaptationSet);W=b(ee,k,Q,re)}return W||d.warn(`[CapabilitiesFilter] Preselection@codecs ${Q} not supported. Removing Preselection with ID ${k.id}`),W}return!0})))})(y,v)}))})(J,U)})),T.get().streaming.capabilities.filterUnsupportedEssentialProperties&&(function(J){J&&J.Period&&J.Period.length!==0&&J.Period.forEach((v=>{v.AdaptationSet=v.AdaptationSet.filter((A=>{if(!A.Representation||A.Representation.length===0)return!0;if(!x(l.getEssentialProperties(A)))return d.warn(`[CapabilitiesFilter] removed AdaptationSet (id: ${A.id}) with unsupported EssentialProperty`),!1;A.Representation=A.Representation.filter((C=>x(l.getEssentialProperties(C))));const y=A.Representation&&A.Representation.length>0;return y||d.warn(`[CapabilitiesFilter] removed AdaptationSet (id: ${A.id}) with unsupported EssentialProperty on all Representations`),y})),v.Preselection&&v.Preselection.length&&(v.Preselection=v.Preselection.filter((A=>!!x(l.getEssentialProperties(A))||(d.warn(`[CapabilitiesFilter] removed Preselection (id: ${A.id}) with unsupported EssentialProperty`),!1))))}))})(U),(function(J){J&&J.Period&&J.Period.length!==0&&J.Period.forEach((v=>{v.Preselection&&(v.Preselection=v.Preselection.filter((A=>{const y=String(A.preselectionComponents).split(" ").length;return y!==1&&d.warn(`Multi-Representation Preselection (id: ${A.id}) removed as not supported.`),y===1})))}))})(U),(function(J){J&&J.Period&&J.Period.length!==0&&J.Period.forEach((v=>{v.Preselection&&(v.Preselection=v.Preselection.filter((A=>{const y=String(A.preselectionComponents).split(" "),C=v.AdaptationSet.map((ee=>ee.id));return y.every((ee=>C.includes(ee)))})))}))})(U),(function(J){if(!J||!J.Period||J.Period.length===0)return Promise.resolve();const v=[];return J.Period.forEach((A=>{v.push((function(y){return new Promise((C=>{if(!y||!y.AdaptationSet||y.AdaptationSet.length===0)return void C();const ee=[];y.AdaptationSet.forEach((k=>{ee.push((function(Q){return new Promise((W=>{if(!Q.Representation||Q.Representation.length===0)return void W();const re=[];Q.Representation.forEach((Ce=>{re.push((function(Me){const ve=[],ue=D.getCustomCapabilitiesFilters();return ue&&ue.length!==0?ue.forEach((oe=>{ve.push(new Promise((ne=>ne(oe(Me)))))})):ve.push(Promise.resolve(!0)),Promise.all(ve)})(Ce))})),Promise.all(re).then((Ce=>{Q.Representation=Q.Representation.filter(((Me,ve)=>{let ue=Ce[ve].every((oe=>oe));return ue||d.debug("[Stream] Representation "+Me.id+" has been removed because of unsupported CustomFilter"),ue})),W()})).catch((Ce=>{d.warn("[Stream] at least one promise rejected in CustomFilter with error: ",Ce),W()}))}))})(k))})),Promise.all(ee).then((()=>{y.AdaptationSet=y.AdaptationSet.filter((k=>k.Representation&&k.Representation.length>0)),C()})).catch((()=>{C()}))}))})(A))})),Promise.all(v)})(U)))).then((()=>{K()})).catch((J=>{d.error(J),K()}))}))}},d=(0,p.default)(n).getInstance().getLogger(t),t}Pr.__dashjs_factory_name="CapabilitiesFilter";var qr=F.default.getSingletonFactory(Pr),Qr=P(1234);function mr(){const n=this.context,e=(0,g.default)(n).getInstance();let t,l,c,T,D,R,d,b,M,m;function u(){l=!1;const v=rn.default.parseUserAgent();c=v&&v.browser&&v.browser.name&&v.browser.name.toLowerCase()==="safari"}function N(){l=!1}function O(v){if(v.streamId!==R.getActiveStreamInfo().id||!M)return;const A=d.getLiveDelay();d.getBufferLevel()>A/2&&(M=!1)}function L(v){v.streamId===R.getActiveStreamInfo().id&&(M=v.state===o.BUFFER_EMPTY)}function x(){b.getCatchupModeEnabled()||T.setPlaybackRate(1)}function U(){d.getIsDynamic()&&b.getCatchupModeEnabled()&&(b.getCatchupPlaybackRates().max>0||b.getCatchupPlaybackRates().min<0)&&!d.isPaused()&&!d.isSeeking()&&(function(){try{if(d.getTime()<=0||l||M&&T.getPlaybackRate()===0)return!1;const v=z();return v===r.default.LIVE_CATCHUP_MODE_LOLP?(function(A,y){try{return Math.abs(K())>0||A<y}catch{return!1}})(d.getBufferLevel(),D.get().streaming.liveCatchup.playbackBufferMin):v===r.default.LIVE_CATCHUP_MODE_STEP?(function(){try{const A=b.getCatchupStepSettings(),y=q();if(y<-1*A.start.min||y>A.start.max)return m.debug(`[_stepNeedToCatchUp] latency offset ${y}`),!0;if(d.getPlaybackRate()!==1)return!0}catch{return!1}})():(function(){try{return Math.abs(K())>0}catch{return!1}})()}catch{return!1}})()&&(function(){if(!l&&T){let v;const A=T.getPlaybackRate(),y=b.getCatchupPlaybackRates(),C=d.getBufferLevel(),ee=K(),k=q(),Q=D.get().streaming.liveCatchup.liveThreshold,W=b.getCatchupMaxDrift();if(!isNaN(W)&&W>0&&ee>W)m.info("[CatchupController]: Low Latency catchup mechanism. Latency too high, doing a seek to live point"),l=!0,d.seekToCurrentLive(!0,!1);else if(!isNaN(Q)&&Q>0&&k>Q)A>1&&(m.info("[CatchupController]: Past live threshold, setting playback rate to 1.0"),T.setPlaybackRate(1));else{const re=d.getCurrentLiveLatency(),Ce=d.getLiveDelay();v=z()===r.default.LIVE_CATCHUP_MODE_LOLP?(function(ve,ue,oe,ne,pe){let Ee;if(pe<ne){const te=Math.abs(ve.min),se=5*(pe-ne);Ee=1-te+2*te/(1+Math.pow(Math.E,-se)),m.debug("[LoL+ playback control_buffer-based] bufferLevel: "+pe+", newRate: "+Ee)}else{if(Math.abs(ue-oe)<=.02*oe)Ee=1;else{const se=ue-oe,Ae=se<0?Math.abs(ve.min):ve.max,ge=5*se;Ee=1-Ae+2*Ae/(1+Math.pow(Math.E,-ge))}m.debug("[LoL+ playback control_latency-based] latency: "+ue+", newRate: "+Ee)}return Ee})(y,re,Ce,D.get().streaming.liveCatchup.playbackBufferMin,C):z()===r.default.LIVE_CATCHUP_MODE_STEP?(function(ve,ue,oe){let ne=1;const pe=b.getCatchupStepSettings();if(!M){const Ee=q();Ee>pe.stop.max&&Ee>0?ne=1+ve.max:Ee<-1*pe.stop.min&&Ee<0&&(ne=1+ve.min),(Ee>-1*pe.stop.min&&Ee<0||Ee<pe.stop.max&&Ee>0||Ee===0)&&(ne=1),d.getPlaybackStalled()&&oe<=ue/2&&Ee>0&&(ne=1)}return m.debug(`[_calculateNewPlaybackRateStep] rate should be ${ne}`),ne})(y,Ce,C):(function(ve,ue,oe,ne){if(M)return 1;const pe=ue-oe,Ee=pe<0?Math.abs(ve.min):ve.max,te=5*pe;let se=1-Ee+2*Ee/(1+Math.pow(Math.E,-te));return d.getPlaybackStalled()&&ne<=oe/2&&pe>0&&(se=1),se})(y,re,Ce,C);const Me=c?.25:.02/(.5/y.max);(v&&Math.abs(A-v)>=Me||v==1)&&(m.debug(`[CatchupController]: Setting playback rate to ${v}`),T.setPlaybackRate(v))}}})()}function K(){return d.getCurrentLiveLatency()-d.getLiveDelay()}function q(){return d.getCurrentLiveLatency()-d.getOriginalLiveDelay()}function z(){const v=D.get().streaming.liveCatchup.playbackBufferMin;let A=r.default.LIVE_CATCHUP_MODE_DEFAULT;return D.get().streaming.liveCatchup.mode===r.default.LIVE_CATCHUP_MODE_STEP?A=r.default.LIVE_CATCHUP_MODE_STEP:D.get().streaming.liveCatchup.mode!==r.default.LIVE_CATCHUP_MODE_LOLP||v===null||isNaN(v)||(A=r.default.LIVE_CATCHUP_MODE_LOLP),A}function J(){b.getCatchupPlaybackRates(!0)}return t={reset:function(){e.off(H.default.BUFFER_LEVEL_UPDATED,O,t),e.off(H.default.BUFFER_LEVEL_STATE_CHANGED,L,t),e.off(H.default.PLAYBACK_PROGRESS,U,t),e.off(H.default.PLAYBACK_TIME_UPDATED,U,t),e.off(H.default.PLAYBACK_SEEKED,N,t),e.off(h.default.SETTING_UPDATED_CATCHUP_ENABLED,x,t),e.off(h.default.SETTING_UPDATED_PLAYBACK_RATE_MIN,J,t),e.off(h.default.SETTING_UPDATED_PLAYBACK_RATE_MAX,J,t),e.off(H.default.STREAM_INITIALIZED,J,t),u(),T.setPlaybackRate(1,!0)},setConfig:function(v){v&&(v.settings&&(D=v.settings),v.videoModel&&(T=v.videoModel),v.streamController&&(R=v.streamController),v.playbackController&&(d=v.playbackController),v.mediaPlayerModel&&(b=v.mediaPlayerModel))},initialize:function(){e.on(H.default.BUFFER_LEVEL_UPDATED,O,t),e.on(H.default.BUFFER_LEVEL_STATE_CHANGED,L,t),e.on(H.default.PLAYBACK_PROGRESS,U,t),e.on(H.default.PLAYBACK_TIME_UPDATED,U,t),e.on(H.default.PLAYBACK_SEEKED,N,t),e.on(h.default.SETTING_UPDATED_CATCHUP_ENABLED,x,t),e.on(h.default.SETTING_UPDATED_PLAYBACK_RATE_MIN,J,t),e.on(h.default.SETTING_UPDATED_PLAYBACK_RATE_MAX,J,t),e.on(H.default.STREAM_INITIALIZED,J,t),J()}},m=(0,p.default)(n).getInstance().getLogger(t),u(),t}mr.__dashjs_factory_name="CatchupController";var Xr=F.default.getSingletonFactory(mr);function Nr(){let n,e;return n={setConfig:function(t){t&&t.serviceDescriptionController&&(e=t.serviceDescriptionController)},isAdaptationsIncluded:function(t){const{adaptationSetsArray:l}=e?.getServiceDescriptionSettings()?.clientDataReporting??{};return!l||l?.length===0||l.includes(t)},isServiceLocationIncluded:function(t,l){if(t===Ge.HTTPRequest.CONTENT_STEERING_TYPE)return!0;const{serviceLocationsArray:c}=e?.getServiceDescriptionSettings()?.clientDataReporting??{};return!c||c?.length===0||c.includes(l)}},n}Nr.__dashjs_factory_name="ClientDataReportingController";var Kr=F.default.getSingletonFactory(Nr),Zr=P(6066),Cr=P(1926);const br=[{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"}],Gr="dashjs_?_bitrate",vt="dashjs_?_settings",nn="localStorage",Sn="lastBitrate",Re="lastMediaSettings";function ut(n){n=n||{};const e=this.context,t=n.settings;let l,c,T;function D(M){if(T!==void 0)return T;let m;T=!1;try{typeof window<"u"&&(m=window[M])}catch(u){return c.warn("DOMStorage access denied: "+u.message),T}if(!m||M!==nn)return T;try{m.setItem("1","1"),m.removeItem("1"),T=!0}catch(u){c.warn("DOMStorage is supported, but cannot be used: "+u.message)}return T}function R(){return Math.round(new Date().getTime()/6e5)*6e5}function d(M,m){return D(M)&&t.get().streaming[m+"CachingInfo"].enabled}function b(){if(!t)throw new Error(r.default.MISSING_CONFIG_ERROR)}return l={getSavedBitrateSettings:function(M){if(b(),!t.get().streaming.lastBitrateCachingInfo.enabled)return NaN;let m=NaN;if(d(nn,Sn)){const u=Gr.replace(/\?/,M);try{const N=JSON.parse(localStorage.getItem(u))||{},O=new Date().getTime()-parseInt(N.timestamp,10)>=t.get().streaming.lastBitrateCachingInfo.ttl||!1,L=parseFloat(N.bitrate);isNaN(L)||O?O&&localStorage.removeItem(u):(m=L,c.debug("Last saved bitrate for "+M+" was "+L))}catch{return null}}return m},setSavedBitrateSettings:function(M,m){if(d(nn,Sn)&&m){const u=Gr.replace(/\?/,M);try{localStorage.setItem(u,JSON.stringify({bitrate:m.toFixed(3),timestamp:R()}))}catch(N){c.error(N.message)}}},getSavedMediaSettings:function(M){if(b(),!t.get().streaming.lastMediaSettingsCachingInfo.enabled)return null;let m=null;if(d(nn,Re)){const u=vt.replace(/\?/,M);try{const N=JSON.parse(localStorage.getItem(u))||{},O=new Date().getTime()-parseInt(N.timestamp,10)>=t.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;m=N.settings,O&&(localStorage.removeItem(u),m=null)}catch{return null}}return m},setSavedMediaSettings:function(M,m){if(d(nn,Re)){const u=vt.replace(/\?/,M);try{localStorage.setItem(u,JSON.stringify({settings:m,timestamp:R()}))}catch(N){c.error(N.message)}}}},c=(0,p.default)(e).getInstance().getLogger(l),D(nn)&&br.forEach((M=>{const m=localStorage.getItem(M.oldKey);if(m){localStorage.removeItem(M.oldKey);try{localStorage.setItem(M.newKey,m)}catch(u){c.error(u.message)}}})),l}ut.__dashjs_factory_name="DOMStorage";var yt=F.default.getSingletonFactory(ut);function At(){const n=this.context,e=(0,E.default)(n).getInstance();let t={},l=[];return{save:function(c){const T=c.streamId,D=c.representation.id;t[T]=t[T]||{};const R=!t[T][D];t[T][D]=c,R&&(l.push({streamId:T,representationId:D}),(function(){const d=e.get().streaming.cacheInitSegmentsLimit;for(;l.length>d;){const b=l.shift();t[b.streamId]&&t[b.streamId][b.representationId]&&(delete t[b.streamId][b.representationId],Object.keys(t[b.streamId]).length===0&&delete t[b.streamId])}})())},extract:function(c,T){return t&&t[c]&&t[c][T]?t[c][T]:null},reset:function(){t={},l=[]},getStats:function(){const c=Object.keys(t).length;let T=0;for(const D in t)T+=Object.keys(t[D]).length;return{entryCount:T,streamCount:c,maxSize:e.get().streaming.cacheInitSegmentsLimit,accessOrderLength:l.length}}}}At.__dashjs_factory_name="InitCache";var ct=F.default.getSingletonFactory(At),Ot=class{constructor(){this.accessibility=null,this.adaptationSetSwitchingCompatibleIds=[],this.audioChannelConfiguration=null,this.bitrateList=null,this.codec=null,this.contentProtection=null,this.essentialProperties=[],this.id=null,this.index=null,this.isEmbedded=null,this.isFragmented=null,this.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}},dn=class{constructor(){this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0,this.isEncrypted=!1}},Tn=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=[]}},Yn=P(1465),Gn=P(9302),sr=class{constructor(n){this.valid=n[0]=="/",this.path=n.split("/").filter((e=>e.length!==0)).map((e=>{let t={name:e},l=e.indexOf("[");if(l!=-1){t.name=e.substring(0,l);let c=e.substring(l+1,e.length-1);this.valid=this.valid&&c.indexOf("[")==-1;let T=c.indexOf("=");T!=-1?(t.attribute={name:c.substring(1,T),value:c.substring(T+1)},["'",'"'].indexOf(t.attribute.value[0])!=-1&&(t.attribute.value=t.attribute.value.substring(1,t.attribute.value.length-1))):t.position=parseInt(c,10)-1}return t}))}isValid(){return this.valid}findsElement(){return!this.findsAttribute()}findsAttribute(){return this.path[this.path.length-1].name.startsWith("@")}findsTextReplace(){return this.path[this.path.length-1].name==="text()"}getMpdTarget(n,e){let t=null,l=n,c=1,T="MPD";for(;c<this.path.length&&l!==null;){t=l;let D=this.path[c];if(T=D.name,c!==this.path.length-1||!T.startsWith("@")&&T!=="text()"){let R=t[T]||[];if(R.length===0&&t[T]&&R.push(t[T]),D.position)l=R[D.position]||null;else if(D.attribute){let d=D.attribute;l=R.filter((b=>b[d.name]==d.value))[0]||null}else l=Array.isArray(R)?R[0]:R}c++}return l===null?null:T.startsWith("@")?{name:T.substring(1),leaf:l,target:l}:T==="text()"?{name:"__text",leaf:l,target:l}:{name:T,leaf:l,target:e?t:l}}},$n=class{constructor(n,e,t){this.action=n,this.xpath=e,this.value=t,this.position=null}getMpdTarget(n){let e=this.action==="remove"||this.action==="replace"||this.position==="before"||this.position==="after";return this.xpath.getMpdTarget(n,e)}};function nr(){let n,e;const t=this.context;return n={getIsPatch:function(l){return l&&l.hasOwnProperty(fe.default.ORIGINAL_MPD_ID)||!1},getMpdId:function(l){return l&&l[fe.default.ORIGINAL_MPD_ID]||null},getOriginalPublishTime:function(l){return l&&l.hasOwnProperty(fe.default.ORIGINAL_PUBLISH_TIME)?new Date(l[fe.default.ORIGINAL_PUBLISH_TIME]):null},getPatchOperations:function(l){return l?(l.__children||[]).map((c=>{const T=c.tagName;if(T!=="add"&&T!=="remove"&&T!=="replace")return e.warn(`Ignoring node of invalid action: ${T}`),null;let D=c.sel;if(T==="add"&&c.type){if(!c.type.startsWith("@"))return e.warn(`Ignoring add action for prefixed namespace declaration: ${c.type}=${c.__text}`),null;D=`${D}/${c.type}`}let R=new sr(D);if(!R.isValid())return e.warn(`Ignoring action with invalid selector: ${T} - ${D}`),null;let d=null;R.findsAttribute()||R.findsTextReplace()?d=c.__text||"":T!=="remove"&&(d=c.__children.reduce(((M,m)=>{let u=m.tagName;return u!=="#text"&&(M[u]=M[u]||[],M[u].push(m)),M}),{}));let b=new $n(T,R,d);return T==="add"&&(b.position=c.pos),b})).filter((c=>!!c)):[]},getPublishTime:function(l){return l&&l.hasOwnProperty(fe.default.PUBLISH_TIME)?new Date(l[fe.default.PUBLISH_TIME]):null}},e=(0,p.default)(t).getInstance().getLogger(n),n}nr.__dashjs_factory_name="PatchManifestModel";var ur=F.default.getSingletonFactory(nr),or=P(5876);const lr=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"}));function Jr(n){if(!n||typeof n!="string")return n;const e=n.split("-");e[0]=e[0].toLowerCase(),e[0]=lr[e[0]]||e[0];for(let t=1;t<e.length;t++)e[t].length===4?e[t]=e[t].charAt(0).toUpperCase()+e[t].slice(1).toLowerCase():e[t].length===2&&/^[a-zA-Z]+$/.test(e[t])&&(e[t]=e[t].toUpperCase());return e.join("-")}var Or=P(9259);function Ii(n,e){return e+10<=n.length&&n[e]===73&&n[e+1]===68&&n[e+2]===51&&n[e+3]<255&&n[e+4]<255&&n[e+6]<128&&n[e+7]<128&&n[e+8]<128&&n[e+9]<128}function fi(n,e){let t=0;return t=(127&n[e])<<21,t|=(127&n[e+1])<<14,t|=(127&n[e+2])<<7,t|=127&n[e+3],t}function Ri(n,e){return e+10<=n.length&&n[e]===51&&n[e+1]===68&&n[e+2]===73&&n[e+3]<255&&n[e+4]<255&&n[e+6]<128&&n[e+7]<128&&n[e+8]<128&&n[e+9]<128}function oi(n,e=0,t=1/0){return(function(l,c,T,D){const R=(d=l,(0,Or.isArrayBufferLike)(d)?d:d.buffer);var d;let b=1;"BYTES_PER_ELEMENT"in D&&(b=D.BYTES_PER_ELEMENT);const M=(O=l)&&(0,Or.isArrayBufferLike)(O.buffer)&&O.byteLength!==void 0&&O.byteOffset!==void 0?l.byteOffset:0,m=(M+l.byteLength)/b,u=(M+c)/b,N=Math.floor(Math.max(0,Math.min(u,m)));var O;return new D(R,N,Math.floor(Math.min(N+Math.max(T,0),m))-N)})(n,e,t,Uint8Array)}function _r(n,e=!1){const t=e?n.indexOf(0):n.length,l=(0,Or.decodeText)(new DataView(n.buffer,n.byteOffset,t),{encoding:Or.UTF_8});return e?l:l.replace(/\0/g,"")}function Ai(n){return n.type==="PRIV"?(function(e){if(e.size<2)return;const t=_r(e.data,!0),l=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:l.buffer}})(n):n.type[0]==="W"?(function(e){if(e.type==="WXXX"){if(e.size<2)return;let l=1;const c=_r(e.data.subarray(l),!0);l+=c.length+1;const T=_r(e.data.subarray(l));return{key:e.type,info:c,data:T}}const t=_r(e.data);return{key:e.type,info:"",data:t}})(n):n.type==="APIC"?(function(e){const t={key:e.type,description:"",data:"",mimeType:null,pictureType:null};if(e.size<2)return;if(e.data[0]!==3)return void console.log("Ignore frame with unrecognized character encoding");const l=e.data.subarray(1).indexOf(0);if(l===-1)return;const c=_r(oi(e.data,1,l)),T=e.data[2+l],D=e.data.subarray(3+l).indexOf(0);if(D===-1)return;const R=_r(oi(e.data,3+l,D));let d;var b;return c==="-->"?d=_r(oi(e.data,4+l+D)):(b=e.data.subarray(4+l+D),d=(0,Or.isArrayBufferLike)(b)?b:b.byteOffset==0&&b.byteLength==b.buffer.byteLength?b.buffer:new Uint8Array(b).buffer),t.mimeType=c,t.pictureType=T,t.description=R,t.data=d,t})(n):(function(e){if(e.size<2)return;if(e.type==="TXXX"){let l=1;const{data:c}=e,T=_r(c.subarray(l),!0);l+=T.length+1;const D=_r(c.subarray(l));return{key:e.type,info:T,data:D}}const t=_r(e.data.subarray(1));return{key:e.type,info:"",data:t}})(n)}function di(n){const e=String.fromCharCode(n[0],n[1],n[2],n[3]),t=fi(n,4);return{type:e,size:t,data:n.subarray(10,10+t)}}const ei=10,rr=10;function Hr(){let n,e,t,l,c,T,D;const R=this.context;function d(A,y){const C=y?y.index:0,ee=e.getAdaptationsForType(c[C].mpd.manifest,C,A);if(!ee||ee.length===0)return null;if(ee.length>1&&y){for(let Q=0,W=ee.length;Q<W;Q++)if(k=ee[Q],e.getRolesForAdaptation(k).filter((function(re){return re.schemeIdUri===r.default.DASH_ROLE_SCHEME_ID&&re.value===fe.default.MAIN}))[0])return ee[Q]}var k;return ee[0]}function b(A,y,C,ee,k,Q){let W,re,Ce,Me,ve,ue,oe=[];if(!ee||ee.length===0)return[];const ne=e.getAdaptationsForPeriod(y);for(Me=0,ue=ee.length;Me<ue;Me++)if(W=ee[Me],Ce=e.getIndexForAdaptation(W,A,C.index),re=x(ne[Ce]),re)if(Q){let pe=re.accessibility.length;for(ve=0;ve<pe;ve++){if(!re)continue;let Ee=re.accessibility[ve];if(Ee.schemeIdUri===T.ACCESSIBILITY_CEA608_SCHEME)if(Ee.value&&Ee.value!==""){let te=Ee.value.split(";");if(te[0].substring(0,2)==="CC")for(ve=0;ve<te.length;ve++)re||(re=x.call(this,ne[Ce])),K(re,te[ve].substring(0,3),te[ve].substring(4)),oe.push(re),re=null;else for(ve=0;ve<te.length;ve++)re||(re=x.call(this,ne[Ce])),K(re,"CC"+(ve+1),te[ve]),oe.push(re),re=null}else K(re,T.CC1,"eng"),oe.push(re),re=null}}else k===T.IMAGE?(re.type=T.IMAGE,oe.push(re),re=null):re&&oe.push(re);if(l.get().streaming.includePreselectionsInMediainfoArray){const pe=e.getPreselectionsForPeriod(y);for(Me=0,ue=pe.length;Me<ue;Me++){const Ee=pe[Me];Ee.hasOwnProperty("type")&&Ee.type===k&&(re=U(pe[Me]),re&&oe.push(re))}}return oe}function M(A){const y=m(A);return e.getRegularPeriods(y)}function m(A){const y=N(A);return e.getMpd(y)}function u(){c=[]}function N(A){return A||(c.length>0?c[0].mpd.manifest:null)}function O(A){try{const y=L(A.streamInfo,c),C=e.getAdaptationsForPeriod(y);return A&&A.streamInfo&&A.streamInfo.id!==void 0&&C?C[A.index]:null}catch{return null}}function L(A,y){const C=y.length;for(let ee=0;ee<C;ee++){let k=y[ee];if(A&&A.id===k.id)return k}return null}function x(A){if(!A)return null;let y=new Ot;const C=A.period.mpd.manifest.Period[A.period.index].AdaptationSet[A.index];y.id=A.id,y.index=A.index,y.codec=e.getCodec(C);const ee=l.get().streaming.enhancement.codecs;return y.type=ee.some((k=>y.codec?.includes(k)))?r.default.ENHANCEMENT:A.type,y.streamInfo=q(A.period),y.representationCount=e.getRepresentationCount(C),y.labels=e.getLabelsForAdaptation(C),y.lang=e.getLanguageForAdaptation(C),y.segmentAlignment=e.getSegmentAlignment(C),y.subSegmentAlignment=e.getSubSegmentAlignment(C),y.viewpoint=e.getViewpointForAdaptation(C),y.accessibility=e.getAccessibilityForAdaptation(C),y.accessibility.filter((function(k){if(k.schemeIdUri&&k.schemeIdUri.search("cea-608")>=0&&D!==void 0)return!0}))[0]&&(y.embeddedCaptions=!0),y.audioChannelConfiguration=e.getAudioChannelConfigurationForAdaptation(C),y.audioChannelConfiguration.length===0&&C.Representation&&C.Representation.length>0&&(y.audioChannelConfiguration=e.getAudioChannelConfigurationForRepresentation(C.Representation[0])),y.roles=e.getRolesForAdaptation(C),y.mimeType=e.getMimeType(C),y.contentProtection=e.getContentProtectionByAdaptation(C),y.bitrateList=e.getBitrateListForAdaptation(C),y.selectionPriority=e.getSelectionPriority(C),y.contentProtection&&y.contentProtection.length>0&&(y.contentProtection=(function(k,Q){if(!k||!k.length||!Q)return k;const W=e.getContentProtectionByManifest(Q);if(!W||!W.length)return k;const re=W.reduce(((Ce,Me)=>(Me.refId&&Ce.set(Me.refId,Me),Ce)),new Map);return k.map((Ce=>{if(Ce.ref){const Me=re.get(Ce.ref);Me&&Ce.mergeAttributesFromReference(Me)}return Ce}))})(y.contentProtection,A.period.mpd.manifest),y.contentProtection=(function(k){const Q=k.map((W=>W.cencDefaultKid)).filter((W=>W!==null));if(Q.length){const W=Q[0];k.forEach((re=>{re.keyId=W}))}return k})(y.contentProtection),y.normalizedKeyIds=(function(k){const Q=new Set;return k.forEach((W=>{W.cencDefaultKid&&typeof W.cencDefaultKid=="string"&&Q.add(W.cencDefaultKid.replace(/-/g,"").toLowerCase())})),Q})(y.contentProtection)),y.isText=e.getIsText(C),y.essentialProperties=e.getCombinedEssentialPropertiesForAdaptationSet(C),y.supplementalProperties=e.getCombinedSupplementalPropertiesForAdaptationSet(C),y.isFragmented=e.getIsFragmented(C),y.isEmbedded=!1,y.adaptationSetSwitchingCompatibleIds=(function(k){if(!k||!k.supplementalProperties)return[];let Q=[];const W=k.supplementalProperties.filter((re=>re.schemeIdUri===fe.default.ADAPTATION_SET_SWITCHING_SCHEME_ID_URI));return W&&W.length>0&&(Q=W[0].value.toString().split(",").filter((re=>re!==k.id))),Q})(y),y.segmentSequenceProperties=e.getSegmentSequencePropertiesForAdaptationSet(C),y}function U(A){if(!A)return null;let y=new Ot;const C=A.period.mpd.manifest.Period[A.period.index].Preselection[A.index],ee=A.period.mpd.manifest.Period[A.period.index].AdaptationSet,k=e.getAdaptationsForPeriod(A.period);return y=x(e.getMainAdaptationSetForPreselection(C,k)),y&&(y.isPreselection=!0,y.tag=A.tag,y.id=A.id,y.codec=e.getCodecForPreselection(C,ee),y.selectionPriority=e.getSelectionPriority(C),y.labels=e.getLabelsForAdaptation(C),y.lang=e.getLanguageForAdaptation(C),y.viewpoint=e.getViewpointForAdaptation(C),y.accessibility=e.getAccessibilityForAdaptation(C),y.audioChannelConfiguration=e.getAudioChannelConfigurationForAdaptation(C),y.roles=e.getRolesForAdaptation(C),y.essentialProperties=e.getCombinedEssentialPropertiesForAdaptationSet(C),y.supplementalProperties=e.getCombinedSupplementalPropertiesForAdaptationSet(C)),y}function K(A,y,C){A.id=y,A.index=100+parseInt(y.substring(2,3)),A.type=T.TEXT,A.codec="cea-608-in-SEI",A.isEmbedded=!0,A.isFragmented=!1,A.lang=Jr(C),A.roles=[{schemeIdUri:"urn:mpeg:dash:role:2011",value:"caption"}]}function q(A){let y=new dn;return y.id=A.id,y.index=A.index,y.start=A.start,y.duration=A.duration,y.manifestInfo=(function(C){let ee=new Tn;return ee.dvrWindowSize=C.timeShiftBufferDepth,ee.loadedTime=C.manifest.loadedTime,ee.availableFrom=C.availabilityStartTime,ee.minBufferTime=C.manifest.minBufferTime,ee.maxFragmentDuration=C.maxSegmentDuration,ee.duration=e.getDuration(C.manifest),ee.isDynamic=e.getIsDynamic(C.manifest),ee.serviceDescriptions=e.getServiceDescriptions(C.manifest),ee.protocol=C.manifest.protocol,ee})(A.mpd),y.isLast=A.mpd.manifest.Period.length===1||Math.abs(y.start+y.duration-y.manifestInfo.duration)<1,y.isEncrypted=A.isEncrypted,y}function z(){if(!T)throw new Error("setConfig function has to be called previously")}function J(A){return c.length>0?c[0].mpd.manifest.Period[A]:null}function v(A,y,C){let ee,k,Q,W,re,Ce;if(A){for(k=A.AdaptationSet,re=0;re<k.length;re+=1)for(ee=k[re],W=ee.Representation,Ce=0;Ce<W.length;Ce+=1)if(Q=W[Ce],y===Q.id)return C?Ce:Q}return null}return n={applyPatchToManifest:function(A,y){t.getPatchOperations(y).forEach((C=>{let ee=C.getMpdTarget(A);if(ee===null)return;let{name:k,target:Q,leaf:W}=ee;if(C.xpath.findsAttribute()||k==="__text"){switch(C.action){case"add":case"replace":Q[k]=C.value;break;case"remove":delete Q[k]}return}let re=(Q[k]||[]).indexOf(W),Ce=C.position==="prepend"||C.position==="before";if(C.action==="remove"||C.action==="replace")if(Array.isArray(Q[k])){if(re!=-1){let Me=Q[k];Me.splice(re,1),Me.length>0?Q[k]=Me:delete Q[k]}}else delete Q[k];C.action!=="add"&&C.action!=="replace"||Object.keys(C.value).forEach((Me=>{let ve=C.value[Me],ue=Q[Me]||[];if(ue.length===0&&Q[Me]&&ue.push(Q[Me]),ue.length===0)ue=ve;else{let oe=ue.length;oe=Me==k&&re!=-1?re+(Ce?0:1)+(C.action==="replace"?-1:0):Ce?0:ue.length,ue.splice.apply(ue,[oe,0].concat(ve))}Q[Me]=ue}))}))},areMediaInfosEqual:function(A,y){if(!A||!y)return!1;const C=A.id===y.id,ee=A.codec===y.codec,k=JSON.stringify(A.viewpoint)===JSON.stringify(y.viewpoint),Q=A.lang===y.lang,W=JSON.stringify(A.roles)===JSON.stringify(y.roles),re=JSON.stringify(A.accessibility)===JSON.stringify(y.accessibility),Ce=JSON.stringify(A.audioChannelConfiguration)===JSON.stringify(y.audioChannelConfiguration);return C&&ee&&k&&Q&&W&&re&&Ce},convertAdaptationToMediaInfo:x,destroy:function(){D=null},getAllMediaInfoForType:function(A,y,C){let ee=c,k=C,Q=[];if(k)z(),ee=M(k);else{if(!(c.length>0))return Q;k=c[0].mpd.manifest}const W=L(A,ee);let re=e.getAdaptationsForType(k,A?A.index:null,y);return Q=b(k,W,A,re,y),y===T.TEXT&&(re=e.getAdaptationsForType(k,A?A.index:null,T.VIDEO),Q=Q.concat(b(k,W,A,re,y,!0))),Q},getAvailabilityStartTime:function(A){const y=m(A);return e.getAvailabilityStartTime(y)},getBandwidthForRepresentation:function(A,y){let C;return C=v(J(y),A),C?C.bandwidth:null},getBaseURLsFromElement:function(A){return e.getBaseURLsFromElement(A)},getCodec:function(A,y,C){return e.getCodec(A,y,C)},getCodecForPreselection:function(A,y){return e.getCodecForPreselection(A,y)},getContentSteering:function(A){return e.getContentSteering(A)},getDuration:function(A){const y=N(A);return e.getDuration(y)},getEssentialProperties:function(A){try{return e.getEssentialProperties(A)}catch{return[]}},getEvent:function(A,y,C,ee){try{if(!A||!y||isNaN(C)||!ee)return null;const k=A.scheme_id_uri,Q=A.value;if(!y[k+"/"+Q])return null;const W=new Yn.default,re=A.timescale||1,Ce=ee.adaptation.period.start,Me=y[k+"/"+Q],ve=isNaN(ee.presentationTimeOffset)?isNaN(Me.presentationTimeOffset)?0:Me.presentationTimeOffset:ee.presentationTimeOffset;let ue,oe=A.presentation_time_delta/re;ue=A.version===0?Ce+C-ve+oe:Ce-ve+oe;const ne=A.event_duration===4294967295?NaN:A.event_duration/re,pe=A.id,Ee=A.message_data;return W.eventStream=Me,W.eventStream.value=Q,W.eventStream.timescale=re,W.duration=ne,W.id=pe,W.calculatedPresentationTime=ue,W.messageData=Ee,W.presentationTimeDelta=oe,W.parsedMessageData=k===r.default.ID3_SCHEME_ID_URI?(function(te){let se=0;const Ae=[];for(;Ii(te,se);){const ge=fi(te,se+6);te[se+5]>>6&1&&(se+=ei),se+=ei;const we=se+ge;for(;se+rr<we;){const Ve=di(te.subarray(se)),$e=Ai(Ve);$e&&Ae.push($e),se+=Ve.size+ei}Ri(te,se)&&(se+=ei)}return Ae})(Ee):null,W}catch{return null}},getEventsFor:function(A,y,C){let ee=[];if(c.length>0){const k=c[0].mpd.manifest;if(A instanceof dn){const Q=L(A,c);ee=e.getEventsForPeriod(Q)}else if(A instanceof Ot){const Q=L(C,c);ee=e.getEventStreamForAdaptationSet(k,O(A),Q)}else if(A instanceof or.default){const Q=L(C,c);ee=e.getEventStreamForRepresentation(k,y,Q)}}return ee},getFramerate:function(A){return e.getFramerate(A)},getIndexForRepresentation:function(A,y){return(function(C,ee){const k=v(C,ee,!0);return k!==null?k:-1})(J(y),A)},getIsDVB:function(A){return e.hasProfile(A,"urn:dvb:dash:profile:dvb-dash:2014")},getIsDynamic:function(A){const y=N(A);return e.getIsDynamic(y)},getIsPatch:function(A){return t.getIsPatch(A)},getIsTextTrack:function(A){return e.getIsText(A)},getIsTypeOf:function(A,y){return e.getIsTypeOf(A,y)},getLocation:function(A){return e.getLocation(A)},getMainAdaptationForType:d,getMainAdaptationSetForPreselection:function(A,y){return e.getMainAdaptationSetForPreselection(A,y)},getCommonRepresentationForPreselection:function(A,y){return e.getCommonRepresentationForPreselection(A,y)},getManifestUpdatePeriod:function(A,y=0){return e.getManifestUpdatePeriod(A,y)},getMediaInfoForType:function(A,y){if(c.length===0||!A)return null;let C=L(A,c);if(!C)return null;const ee=e.getAdaptationsForPeriod(C);let k=d(y,A);return k?x(ee[e.getIndexForAdaptation(k,c[0].mpd.manifest,A.index)]):null},getMpd:m,getPatchLocation:function(A){const y=e.getPatchLocation(A),C=e.getPublishTime(A);return y&&y.length!==0&&C?y.filter((ee=>isNaN(ee.ttl)||C.getTime()+ee.ttl>new Date().getTime())):[]},getPeriodById:function(A){if(!A||c.length===0)return null;const y=c.filter((C=>C.id===A));return y&&y.length>0?y[0]:null},getPreselectionIsTypeOf:function(A,y,C){return e.getPreselectionIsTypeOf(A,y,C)},getProducerReferenceTimes:function(A,y){let C,ee;const k=L(A,c);return C=y?y.id:null,c.length>0&&k&&(ee=C?e.getAdaptationForId(C,c[0].mpd.manifest,k.index):e.getAdaptationForIndex(y?y.index:null,c[0].mpd.manifest,k.index)),ee?e.getProducerReferenceTimesForAdaptation(ee):[]},getPublishTime:function(A){return e.getPublishTime(A)},getRealAdaptation:function(A,y){let C,ee;const k=L(A,c);return C=y?y.id:null,c.length>0&&k&&(ee=C?e.getAdaptationForId(C,c[0].mpd.manifest,k.index):e.getAdaptationForIndex(y?y.index:null,c[0].mpd.manifest,k.index)),ee},getRealPeriodByIndex:function(A){return e.getRealPeriodForIndex(A,c[0].mpd.manifest)},getRegularPeriods:M,getRepresentationSortFunction:function(){return e.getRepresentationSortFunction()},getStreamsInfo:function(A,y){const C=[];let ee=c;if(A&&(z(),ee=M(A)),ee.length>0){(!y||y>ee.length)&&(y=ee.length);for(let k=0;k<y;k++)C.push(q(ee[k]))}return C},getSuggestedPresentationDelay:function(){const A=c.length>0?c[0].mpd:null;return e.getSuggestedPresentationDelay(A)},getSupplementalCodecs:function(A){const y=A[fe.default.SUPPLEMENTAL_CODECS];return y?y.split(" ").map((C=>A.mimeType+';codecs="'+C+'"')):[]},getUTCTimingSources:function(){const A=N();return e.getUTCTimingSources(A)},getVoRepresentations:function(A){let y;const C=O(A);return y=e.getRepresentationsForAdaptation(C,A),y},isPatchValid:function(A,y){let C=e.getId(A),ee=t.getMpdId(y),k=e.getPublishTime(A),Q=t.getPublishTime(y),W=t.getOriginalPublishTime(y);return!!(C&&ee&&C==ee&&k&&W&&k.getTime()==W.getTime()&&Q&&k.getTime()<Q.getTime())},reset:u,setConfig:function(A){A&&(A.constants&&(T=A.constants),A.cea608parser&&(D=A.cea608parser),A.errHandler&&e.setConfig({errHandler:A.errHandler}),A.BASE64&&e.setConfig({BASE64:A.BASE64}))},updatePeriods:function(A){if(!A)return null;z(),c=M(A)}},e=(0,Gn.default)(R).getInstance(),t=ur(R).getInstance(),l=(0,E.default)(R).getInstance(),u(),n}Hr.__dashjs_factory_name="DashAdapter";var ti=F.default.getSingletonFactory(Hr);class jr{static round10(e,t){return(function(l,c,T){return T===void 0||+T==0?Math[l](c):(T=+T,(c=+c)===null||isNaN(c)||typeof T!="number"||T%1!=0?NaN:(c=c.toString().split("e"),+((c=(c=Math[l](+(c[0]+"e"+(c[1]?+c[1]-T:-T)))).toString().split("e"))[0]+"e"+(c[1]?+c[1]+T:T))))})("round",e,t)}}var Ni=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=[]}},Tr=class{constructor(){this.t=null,this.mt=null,this.to=null,this.lto=null}},Ci=class{constructor(){this.t=null,this.level=null}},Dr=class{constructor(){this.target=null,this.state=o.BUFFER_EMPTY}},Fs=class{constructor(){this.time=null,this.range=null,this.manifestInfo=null}},Us=class{constructor(){this.time=null,this.droppedFrames=null}};class xs{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 Bs{constructor(){this.id=null,this.index=null,this.start=null,this.duration=null}}class ks{constructor(){this.id=null,this.index=null,this.mediaType=null,this.presentationTimeOffset=null,this.startNumber=null}}var Gs=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}},Hs=class{constructor(){this.loadingRequests=[],this.executedRequests=[]}};function Yi(n){const e=(n=n||{}).settings;let t,l,c=this.context,T=(0,g.default)(c).getInstance();function D(){T.trigger(h.default.METRICS_CHANGED)}function R(N){T.trigger(h.default.METRIC_CHANGED,{mediaType:N}),D()}function d(N,O,L){T.trigger(h.default.METRIC_UPDATED,{mediaType:N,metric:O,value:L}),R(N)}function b(N,O,L){T.trigger(h.default.METRIC_ADDED,{mediaType:N,metric:O,value:L}),R(N)}function M(N,O){let L=null;return N&&(l.hasOwnProperty(N)?L=l[N]:O||(L=new Ni,l[N]=L)),L}function m(N,O,L){let x=M(N);x!==null&&(x[O].push(L),x[O].length>e.get().streaming.metrics.maxListDepth&&x[O].shift())}function u(N,O,L){m(N,O,L),b(N,O,L)}return t={addBufferLevel:function(N,O,L){let x=new Ci;x.t=O,x.level=L,u(N,o.BUFFER_LEVEL,x)},addBufferState:function(N,O,L){let x=new Dr;x.target=L,x.state=O,u(N,o.BUFFER_STATE,x)},addDVBErrors:function(N){u(r.default.STREAM,o.DVB_ERRORS,N)},addDVRInfo:function(N,O,L,x){let U=new Fs;U.time=O,U.range=x,U.manifestInfo=L,u(N,o.DVR_INFO,U)},addDroppedFrames:function(N,O){let L=new Us,x=M(N).DroppedFrames;O&&(L.time=O.creationTime,L.droppedFrames=O.droppedVideoFrames,x.length>0&&x[x.length-1]==L||u(N,o.DROPPED_FRAMES,L))},addHttpRequest:function N(O,L,x,U){let K=new Ge.HTTPRequest;L.url&&L.url!==O.url&&(N({mediaType:O.mediaType,type:O.type,url:O.url,serviceLocation:null,range:O.range,startDate:O.startDate,firstByteDate:null,endDate:null,duration:O.duration,fileLoaderType:O.fileLoaderType,resourceTimingValues:O.resourceTimingValues},{url:null,status:null,headers:null},null,U),K.actualurl=L.url),K.tcpid=null,K.type=O.type,K.url=O.url,K.range=O.range||null,K.trequest=O.startDate,K.tresponse=O.firstByteDate,K.responsecode=L.status,K.cmsd=U,K._tfinish=O.endDate,K._stream=O.mediaType,K._mediaduration=O.duration,K._responseHeaders="";for(const q in L.headers)K._responseHeaders+=q+": "+L.headers[q]+`\r
`;K._serviceLocation=O.serviceLocation||null,K._fileLoaderType=O.fileLoaderType,K._resourceTimingValues=O.resourceTimingValues,K._streamId=O&&O.representation&&O.representation.mediaInfo&&O.representation.mediaInfo.streamInfo?O.representation.mediaInfo.streamInfo.id:null,x?x.forEach((q=>{(function(z,J,v,A){let y=new Ge.HTTPRequestTrace;y.s=J,y.d=v,y.b=A,z.trace.push(y),z.interval||(z.interval=0),z.interval+=v})(K,q.s,q.d,q.b,q.t)})):(delete K.interval,delete K.trace),u(O.mediaType,o.HTTP_REQUEST,K)},addManifestUpdate:function(N,O,L,x){let U=new xs;U.mediaType=N,U.type=O,U.requestTime=L,U.fetchTime=x,m(r.default.STREAM,o.MANIFEST_UPDATE,U),b(N,o.MANIFEST_UPDATE,U)},addManifestUpdateRepresentationInfo:function(N,O,L){if(N&&N.representationInfo){const x=new ks;x.id=O?O.id:null,x.index=O?O.index:null,x.mediaType=L,x.startNumber=O?O.startNumber:null,x.presentationTimeOffset=O?O.presentationTimeOffset:null,N.representationInfo.push(x),d(N.mediaType,o.MANIFEST_UPDATE_TRACK_INFO,N)}},addManifestUpdateStreamInfo:function(N,O,L,x,U){if(N){let K=new Bs;K.id=O,K.index=L,K.start=x,K.duration=U,N.streamInfo.push(K),d(N.mediaType,o.MANIFEST_UPDATE_STREAM_INFO,N)}},addPlayList:function(N){N.trace&&Array.isArray(N.trace)?N.trace.forEach((O=>{O.hasOwnProperty("subreplevel")&&!O.subreplevel&&delete O.subreplevel})):delete N.trace,u(r.default.STREAM,o.PLAY_LIST,N)},addRepresentationSwitch:function(N,O,L,x,U){let K=new Tr;K.t=O,K.mt=L,K.to=x,U?K.lto=U:delete K.lto,u(N,o.TRACK_SWITCH,K)},addRequestsQueue:function(N,O,L){let x=new Hs;x.loadingRequests=O,x.executedRequests=L,M(N).RequestsQueue=x,b(N,o.REQUESTS_QUEUE,x)},addSchedulingInfo:function(N,O,L,x,U,K,q,z,J){let v=new Gs;v.mediaType=N,v.t=O,v.type=L,v.startTime=x,v.availabilityStartTime=U,v.duration=K,v.bandwidth=q,v.range=z,v.state=J,u(N,o.SCHEDULING_INFO,v)},clearAllCurrentMetrics:function(){l={},D()},clearCurrentMetricsForType:function(N){delete l[N],R(N)},getMetricsFor:M,updateManifestUpdateInfo:function(N,O){if(N){for(let L in O)N[L]=O[L];d(N.mediaType,o.MANIFEST_UPDATE,N)}}},l={},t}Yi.__dashjs_factory_name="MetricsModel";var Ys=F.default.getSingletonFactory(Yi);class Yr{constructor(){this.start=null,this.mstart=null,this.starttype=null,this.trace=[]}}Yr.INITIAL_PLAYOUT_START_REASON="initial_playout",Yr.SEEK_START_REASON="seek",Yr.RESUME_FROM_PAUSE_START_REASON="resume",Yr.METRICS_COLLECTION_START_REASON="metrics_collection_start";class fr{constructor(){this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null}}function Vi(n){n=n||{};const e=this.context;let t,l,c,T,D=n.metricsModel;function R(M){const m=D.getMetricsFor(M,!0);if(!m)return null;const u=m.HttpList;let N,O=null;if(!u||u.length<=0)return null;for(N=u.length-1;N>=0;){if(u[N].responsecode){O=u[N];break}N--}return O}function d(M){const m=D.getMetricsFor(M,!0);return m&&m.HttpList?m.HttpList:[]}function b(M,m){if(!M)return null;const u=M[m];return u&&u.length!==0?u[u.length-1]:null}return t={addBufferLevel:function(M,m,u){D.addBufferLevel(M,m,u)},addBufferState:function(M,m,u){D.addBufferState(M,m,u)},addDVBErrors:function(M){D.addDVBErrors(M)},addDVRInfo:function(M,m,u,N){D.addDVRInfo(M,m,u,N)},addDroppedFrames:function(M){D.addDroppedFrames(r.default.VIDEO,M)},addHttpRequest:function(M,m,u,N,O,L){const x={status:u,headers:N,url:m};D.addHttpRequest(M,x,O,L)},addManifestUpdate:function(M){D.addManifestUpdate(r.default.STREAM,M.type,M.startDate,M.endDate)},addManifestUpdateRepresentationInfo:function(M,m){if(M){const u=this.getCurrentManifestUpdate();D.addManifestUpdateRepresentationInfo(u,M,m)}},addManifestUpdateStreamInfo:function(M){if(M){const m=this.getCurrentManifestUpdate();D.addManifestUpdateStreamInfo(m,M.id,M.index,M.start,M.duration)}},addPlayList:function(){T&&(D.addPlayList(T),T=null)},addRepresentationSwitch:function(M,m,u,N,O){D.addRepresentationSwitch(M,m,u,N,O)},addRequestsQueue:function(M,m,u){D.addRequestsQueue(M,m,u)},addSchedulingInfo:function(M,m){D.addSchedulingInfo(M.mediaType,new Date,M.type,M.startTime,M.availabilityStartTime,M.duration,M.bandwidth,M.range,m)},clearAllCurrentMetrics:function(){D.clearAllCurrentMetrics()},createPlaylistMetrics:function(M,m){T=new Yr,T.start=new Date,T.mstart=M,T.starttype=m},createPlaylistTraceMetrics:function(M,m,u){l===!0&&(l=!1,c=new fr,c.representationid=M,c.start=new Date,c.mstart=m,c.playbackspeed=u!==null?u.toString():null)},getCurrentBufferLevel:function(M){const m=b(D.getMetricsFor(M,!0),o.BUFFER_LEVEL);return m?jr.round10(m.level/1e3,-3):0},getCurrentBufferState:function(M){return b(D.getMetricsFor(M,!0),o.BUFFER_STATE)},getCurrentDVRInfo:function(M){return b(M?D.getMetricsFor(M,!0):D.getMetricsFor(r.default.VIDEO,!0)||D.getMetricsFor(r.default.AUDIO,!0),o.DVR_INFO)},getCurrentDroppedFrames:function(){return b(D.getMetricsFor(r.default.VIDEO,!0),o.DROPPED_FRAMES)},getCurrentHttpRequest:R,getCurrentManifestUpdate:function(){return b(D.getMetricsFor(r.default.STREAM),o.MANIFEST_UPDATE)},getCurrentRepresentationSwitch:function(M){return b(D.getMetricsFor(M,!0),o.TRACK_SWITCH)},getCurrentSchedulingInfo:function(M){return b(D.getMetricsFor(M,!0),o.SCHEDULING_INFO)},getHttpRequests:d,getLatestFragmentRequestHeaderValueByID:function(M,m){if(!m)return null;let u={},N=R(M);N&&(u=rn.default.parseHttpHeaders(N._responseHeaders));const O=u[m.toLowerCase()];return O===void 0?null:O},getLatestMPDRequestHeaderValueByID:function(M){if(!M)return null;let m,u,N,O={};for(m=d(r.default.STREAM),N=m.length-1;N>=0;N--)if(u=m[N],u.type===Ge.HTTPRequest.MPD_TYPE){O=rn.default.parseHttpHeaders(u._responseHeaders);break}const L=O[M.toLowerCase()];return L===void 0?null:L},pushPlayListTraceMetrics:function(M,m){if(l===!1&&T&&c&&c.start){const u=c.start;c.duration=M.getTime()-u.getTime(),c.stopreason=m,T.trace.push(c),l=!0}},updateManifestUpdateInfo:function(M){const m=this.getCurrentManifestUpdate();D.updateManifestUpdateInfo(m,M)},updatePlayListTraceMetrics:function(M){if(c)for(let m in c)c[m]=M[m]}},D=D||Ys(e).getInstance({settings:n.settings}),l=!0,c=null,T=null,t}fr.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",fr.REBUFFERING_REASON="rebuffering",fr.USER_REQUEST_STOP_REASON="user_request",fr.END_OF_PERIOD_STOP_REASON="end_of_period",fr.END_OF_CONTENT_STOP_REASON="end_of_content",fr.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",fr.FAILURE_STOP_REASON="failure",Vi.__dashjs_factory_name="DashMetrics";var Vs=F.default.getSingletonFactory(Vi);function qi(){let n;const e=this.context,t=(0,g.default)(e).getInstance();return n={error:function(l){t.trigger(h.default.ERROR,{error:l})}},n}qi.__dashjs_factory_name="ErrorHandler";var qs=F.default.getSingletonFactory(qi),Ks=P(5560);function Ki(){const n=this.context,e=(0,g.default)(n).getInstance();let t,l,c,T,D,R,d,b,M,m,u,N;function O(){N.debug("Stopping the gap controller"),D&&(clearInterval(D),D=null),(function(){e.off(h.default.WALLCLOCK_TIME_UPDATED,q,this),e.off(h.default.INITIAL_STREAM_SWITCH,K,this),e.off(h.default.PLAYBACK_SEEKING,L,this),e.off(h.default.BUFFER_REPLACEMENT_STARTED,x,t),e.off(h.default.TRACK_CHANGE_RENDERED,U,t)})(),D=null,R=NaN,T=0,m=null,u={}}function L(){m&&(clearTimeout(m),m=null)}function x(v){try{if(v.streamId!==b.getActiveStreamInfo().id||v.mediaType!==r.default.VIDEO&&v.mediaType!==r.default.AUDIO)return;v.streamId===b.getActiveStreamInfo().id&&(u[v.mediaType]=!0)}catch(A){N.error(A)}}function U(v){v&&v.mediaType&&(u[v.mediaType]=!1)}function K(){D||(function(){try{D||(N.debug("Starting the gap controller"),D=setInterval((()=>{z()&&J(d.getTime())}),c.get().streaming.gaps.checkInterval))}catch{}})()}function q(){if(z(c.get().streaming.gaps.enableSeekFix)&&(T++,T>=10)){const v=d.getTime();l===v?J(v,!0):(l=v,R=NaN),T=0}}function z(v=!1){if(!b.getActiveStream())return!1;let A=!1;for(const C in u)if(u[C]){A=!0;break}const y=!!v&&(function(){const C=b.getActiveStream(),ee=parseFloat((C.getStartTime()+C.getDuration()).toFixed(5));return d.getTime()+c.get().streaming.gaps.threshold>=ee})();return!A&&c.get().streaming.gaps.jumpGaps&&b.getActiveStreamProcessors().length>0&&(!d.isSeeking()||y)&&!d.isPaused()&&!b.getIsStreamSwitchInProgress()&&!b.getHasMediaOrInitialisationError()}function J(v,A=!1){const y=c.get().streaming.gaps,C=y.enableStallFix,ee=y.stallSeek,k=y.smallGapLimit,Q=y.jumpLargeGaps,W=y.seekOffset,re=M.getBufferRange();let Ce,Me=NaN,ve=!1;if(Ce=(function(oe,ne){try{if(!oe||oe.length<=1&&ne>0)return NaN;let pe=NaN,Ee=0;for(;isNaN(pe)&&Ee<oe.length;){const te=Ee>0?oe.end(Ee-1):0;ne<oe.start(Ee)&&te-ne<c.get().streaming.gaps.threshold&&(pe=Ee),Ee+=1}return pe}catch{return null}})(re,v),!isNaN(Ce)){const oe=re.start(Ce),ne=oe-v;ne>0&&(ne<=k||Q)&&(Me=oe)}const ue=d.getTimeToStreamEnd();if(isNaN(Me)&&A&&isFinite(ue)&&!isNaN(ue)&&ue<k&&(Me=parseFloat(d.getStreamEndTime().toFixed(5)),ve=!0),C&&isNaN(Me)&&A&&isNaN(Ce)&&(function(oe,ne){for(let pe=0,Ee=oe.length;pe<Ee;pe++)if(ne>=oe.start(pe)&&ne<=oe.end(pe))return!0;return!1})(re,v)&&(ee===0?(N.warn("Toggle play pause to break stall"),M.pause(),M.play()):(N.warn(`Jumping ${ee}s to break stall`),Me=v+ee)),Me>0&&R!==Me&&Me>v&&!m){const oe=Me-v;if(ve){const ne=b.getStreamForTime(Me),pe=ne&&!!ne.getPreloaded();N.warn(`Jumping to end of stream because of gap from ${v} to ${Me}. Gap duration: ${oe}`),d.seek(Me+W,!0,pe)}else{const ne=d.getIsDynamic(),pe=Ce>0?re.end(Ce-1):v,Ee=ne?1e3*Math.max(0,oe-.1):0;m=window.setTimeout((()=>{d.seek(Me+W,!0,!0);const te=b.getActiveStream();te&&N.warn(`Jumping gap occuring in period ${te.getStreamId()} starting at ${pe} and ending at ${Me}. Jumping by: ${Me+W-pe}`),m=null}),Ee)}R=Me}}return t={reset:O,setConfig:function(v){v&&(v.settings&&(c=v.settings),v.playbackController&&(d=v.playbackController),v.streamController&&(b=v.streamController),v.videoModel&&(M=v.videoModel))},initialize:function(){(function(){e.on(h.default.WALLCLOCK_TIME_UPDATED,q,this),e.on(h.default.INITIAL_STREAM_SWITCH,K,this),e.on(h.default.PLAYBACK_SEEKING,L,this),e.on(h.default.BUFFER_REPLACEMENT_STARTED,x,t),e.on(h.default.TRACK_CHANGE_RENDERED,U,t)})()}},N=(0,p.default)(n).getInstance().getLogger(t),O(),t}Ki.__dashjs_factory_name="GapController";var js=F.default.getSingletonFactory(Ki);class Ws extends B.default{constructor(e,t){super(),this.url=e||null,this.type=t||null,this.mediaType=r.default.STREAM,this.responseType=""}}var ji=Ws;function Wi(n){n=n||{};const e=this.context,t=(0,g.default)(e).getInstance();let l,c=(0,xt.default)(e).create({errHandler:n.errHandler,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,errors:Pn.default});return l={load:function(T,D,R){const d=function(b,M){D.resolved=!0,D.resolvedContent=b||null,t.trigger(h.default.XLINK_ELEMENT_LOADED,{element:D,resolveObject:R,error:b||M?null:new un.default(Pn.default.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,Pn.default.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+T)})};if(T==="urn:mpeg:dash:resolve-to-zero:2013")d(null,!0);else{const b=new ji(T,Ge.HTTPRequest.XLINK_EXPANSION_TYPE);c.load({request:b,success:function(M){d(M)},error:function(){d(null)}})}},reset:function(){c&&(c.abort(),c=null)}},l}Wi.__dashjs_factory_name="XlinkLoader";var zs=F.default.getClassFactory(Wi);const ni="onLoad";function zi(n){n=n||{};let e=this.context,t=(0,g.default)(e).getInstance();const l=(0,Ht.default)(e).getInstance();let c,T,D,R;function d(N,O,L){let x,U,K={};K.elements=N,K.type=O,K.resolveType=L,K.elements.length===0&&M(K);for(let q=0;q<K.elements.length;q++)x=K.elements[q],U=l.isHTTPURL(x.url)?x.url:x.originalContent.BaseURL+x.url,R.load(U,x,K)}function b(N){let O,L,x="";if(O=N.element,L=N.resolveObject,O.resolvedContent){let U=0;O.resolvedContent.indexOf("<?xml")===0&&(U=O.resolvedContent.indexOf("?>")+2),x=O.resolvedContent.substr(0,U)+"<response>"+O.resolvedContent.substr(U)+"</response>",O.resolvedContent=T.parseXml(x).response}(function(U){let K,q;for(K=0;K<U.elements.length;K++)if(q=U.elements[K],q.resolved===!1)return!1;return!0})(L)&&M(L)}function M(N){let O,L,x=[];if((function(U){let K,q,z,J,v,A,y=[];for(J=U.elements.length-1;J>=0;J--){if(K=U.elements[J],q=K.type,K.resolvedContent){if(K.resolvedContent)for(v=0;v<K.resolvedContent[q].length;v++)z=K.resolvedContent[q][v],y.push(z)}else delete K.originalContent["xlink:actuate"],delete K.originalContent["xlink:href"],y.push(K.originalContent);for(K.parentElement[q].splice(K.index,1),A=0;A<y.length;A++)K.parentElement[q].splice(K.index+A,0,y[A]);y=[]}U.elements.length>0&&T.getIron().run(D)})(N),N.resolveType==="onActuate"&&t.trigger(h.default.XLINK_READY,{manifest:D}),N.resolveType===ni)switch(N.type){case fe.default.PERIOD:for(O=0;O<D[fe.default.PERIOD].length;O++)L=D[fe.default.PERIOD][O],L.hasOwnProperty(fe.default.ADAPTATION_SET)&&(x=x.concat(m(L[fe.default.ADAPTATION_SET],L,fe.default.ADAPTATION_SET,ni))),L.hasOwnProperty(fe.default.EVENT_STREAM)&&(x=x.concat(m(L[fe.default.EVENT_STREAM],L,fe.default.EVENT_STREAM,ni)));d(x,fe.default.ADAPTATION_SET,ni);break;case fe.default.ADAPTATION_SET:t.trigger(h.default.XLINK_READY,{manifest:D})}}function m(N,O,L,x){let U,K,q,z=[];for(K=N.length-1;K>=0;K--)U=N[K],U.hasOwnProperty("xlink:href")&&U["xlink:href"]==="urn:mpeg:dash:resolve-to-zero:2013"&&N.splice(K,1);for(K=0;K<N.length;K++)U=N[K],U.hasOwnProperty("xlink:href")&&U.hasOwnProperty("xlink:actuate")&&U["xlink:actuate"]===x&&(q=u(U["xlink:href"],O,L,K,x,U),z.push(q));return z}function u(N,O,L,x,U,K){return{url:N,parentElement:O,type:L,index:x,resolveType:U,originalContent:K,resolvedContent:null,resolved:!1}}return c={resolveManifestOnLoad:function(N){let O;D=N,D.Period?(O=m(D.Period,D,fe.default.PERIOD,ni),d(O,fe.default.PERIOD,ni)):t.trigger(h.default.XLINK_READY,{manifest:D})},setParser:function(N){N&&(T=N)},reset:function(){t.off(h.default.XLINK_ELEMENT_LOADED,b,c),R&&(R.reset(),R=null)}},t.on(h.default.XLINK_ELEMENT_LOADED,b,c),R=zs(e).create({errHandler:n.errHandler,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,settings:n.settings}),c}zi.__dashjs_factory_name="XlinkController";var $s=F.default.getClassFactory(zi);function $i(n){function e(c,T,D,R,d){(function(b,M){let m=!0;if(M)for(const[u,N]of Object.entries(M)){let O=b[u];O&&N.some((L=>O.match(L)))&&(m=!1)}return m})(R,c)&&(d[T]?D?d[T].push(R):(function(b,M){if(typeof b=="object")for(let m in b)M.hasOwnProperty(m)||(M[m]=b[m])})(R,d[T]):d[T]=D?[R]:R)}function t(c,T,D,R){for(let d=0,b=c.length;d<b;++d){const M=c[d];if(D[M]){const m=D[M];Array.isArray(m)?m.forEach((u=>{e(T[M],M,!0,u,R)})):e(T[M],M,!1,m,R)}}}function l(c,T){for(let D=0,R=c.children.length;D<R;++D){const d=c.children[D],b=T[d.name];if(b)for(let M=0,m=b.length;M<m;++M){const u=b[M];t(c.properties,c.exceptions,T,u),l(d,u)}}}return{run:function(c){if(c===null||typeof c!="object")return c;if(c.Period&&"period"in n){const T=n.period,D=c.Period;for(let R=0,d=D.length;R<d;++R){const b=D[R];if(l(T,b),"adaptationset"in n){const M=b.AdaptationSet;if(M){const m=n.adaptationset;for(let u=0,N=M.length;u<N;++u)l(m,M[u])}}}}return c}}}$i.__dashjs_factory_name="ObjectIron";var Qs=F.default.getClassFactory($i),gi=class{constructor(n,e){this._test=n,this._converter=e}get test(){return this._test}get converter(){return this._converter}};const Qi=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/;var Xs=class extends gi{constructor(){super(((n,e,t)=>{const l=[fe.default.MIN_BUFFER_TIME,fe.default.MEDIA_PRESENTATION_DURATION,fe.default.MINIMUM_UPDATE_PERIOD,fe.default.TIMESHIFT_BUFFER_DEPTH,fe.default.MAX_SEGMENT_DURATION,fe.default.MAX_SUBSEGMENT_DURATION,fe.default.SUGGESTED_PRESENTATION_DELAY,fe.default.START,r.default.START_TIME,fe.default.DURATION],c=l.length;for(let T=0;T<c;T++)if(e===l[T])return Qi.test(t);return!1}),(n=>{const e=Qi.exec(n);let t=31536e3*parseFloat(e[3]||0)+2592e3*parseFloat(e[5]||0)+86400*parseFloat(e[7]||0)+3600*parseFloat(e[9]||0)+60*parseFloat(e[11]||0)+parseFloat(e[13]||0);return e[1]!==void 0&&(t=-t),t}))}};const Xi=/^([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 Zs=class extends gi{constructor(){super(((n,e,t)=>Xi.test(t)),(n=>{const e=Xi.exec(n);let t;if(t=Date.UTC(parseInt(e[1],10),parseInt(e[2],10)-1,parseInt(e[3],10),parseInt(e[4],10),parseInt(e[5],10),e[6]&&parseInt(e[6],10)||0,e[7]&&1e3*parseFloat(e[7])||0),e[9]&&e[10]){const l=60*parseInt(e[9],10)+parseInt(e[10],10);t+=(e[8]==="+"?-1:1)*l*60*1e3}return new Date(t)}))}};const Js=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,eo=[fe.default.ID];var to=class extends gi{constructor(){super(((n,e,t)=>Js.test(t)&&eo.indexOf(e)===-1),(n=>parseFloat(n)))}},no=class extends gi{constructor(){super(((n,e)=>{const t={[fe.default.ADAPTATION_SET]:[fe.default.LANG],[fe.default.REPRESENTATION]:[fe.default.LANG],[fe.default.CONTENT_COMPONENT]:[fe.default.LANG],[fe.default.LABEL]:[fe.default.LANG],[fe.default.GROUP_LABEL]:[fe.default.LANG]};if(t.hasOwnProperty(n)){let l=t[n];return l!==void 0&&l.indexOf(e)>=0}return!1}),(n=>Jr(n)||String(n)))}},ri=class{constructor(n,e,t,l){this._name=n||"",this._properties=e||[],this._exceptions=t||{},this._children=l||[]}get name(){return this._name}get children(){return this._children}get properties(){return this._properties}get exceptions(){return this._exceptions}},ro=class extends ri{constructor(){const n=[fe.default.AUDIO_CHANNEL_CONFIGURATION,fe.default.AUDIO_SAMPLING_RATE,fe.default.CODECS,fe.default.CODING_DEPENDENCY,fe.default.CONTENT_PROTECTION,fe.default.ESSENTIAL_PROPERTY,fe.default.FRAMERATE,fe.default.FRAME_PACKING,fe.default.HEIGHT,fe.default.INBAND_EVENT_STREAM,fe.default.MAXIMUM_SAP_PERIOD,fe.default.MAX_PLAYOUT_RATE,fe.default.MIME_TYPE,fe.default.PROFILES,fe.default.SAR,fe.default.SCAN_TYPE,fe.default.SEGMENT_PROFILES,fe.default.SEGMENT_SEQUENCE_PROPERTIES,fe.default.START_WITH_SAP,fe.default.SUPPLEMENTAL_CODECS,fe.default.SUPPLEMENTAL_PROPERTY,fe.default.WIDTH],e={[fe.default.SUPPLEMENTAL_PROPERTY]:{schemeIdUri:[r.default.URL_QUERY_INFO_SCHEME,r.default.EXT_URL_QUERY_INFO_SCHEME,r.default.ADV_URL_QUERY_INFO_SCHEME,r.default.URL_QUERY_STATE_PREFIX]},[fe.default.ESSENTIAL_PROPERTY]:{schemeIdUri:[r.default.URL_QUERY_INFO_SCHEME,r.default.EXT_URL_QUERY_INFO_SCHEME,r.default.ADV_URL_QUERY_INFO_SCHEME,r.default.URL_QUERY_STATE_PREFIX]}};super(fe.default.ADAPTATION_SET,n,e,[new ri(fe.default.REPRESENTATION,n,e,[new ri(fe.default.SUB_REPRESENTATION,n,e)])])}},io=class extends ri{constructor(){const n=[fe.default.SEGMENT_BASE,fe.default.SEGMENT_TEMPLATE,fe.default.SEGMENT_LIST],e={};super(fe.default.PERIOD,n,e,[new ri(fe.default.ADAPTATION_SET,n,e,[new ri(fe.default.REPRESENTATION,n,e)])])}};const ao=60,bi=62,Di=45,Zi=47,so=63,oo=33,Ji=39,ea=34,vi=91,lo=93,uo=new Set([13,10,9,62,47,61,32]),co=[fe.default.ACCESSIBILITY,fe.default.ADAPTATION_SET,fe.default.ADD,fe.default.AUDIO_CHANNEL_CONFIGURATION,fe.default.BASE_URL,fe.default.CONTENT_COMPONENT,fe.default.CONTENT_PROTECTION,fe.default.CONTENT_STEERING,fe.default.ESSENTIAL_PROPERTY,fe.default.EVENT,fe.default.EVENT_STREAM,fe.default.INBAND_EVENT_STREAM,fe.default.LABEL,fe.default.LOCATION,fe.default.METRICS,fe.default.PATCH_LOCATION,fe.default.PERIOD,fe.default.PRESELECTION,fe.default.PRODUCER_REFERENCE_TIME,fe.default.REMOVE,fe.default.REPLACE,fe.default.REPORTING,fe.default.REPRESENTATION,fe.default.ROLE,fe.default.S,fe.default.SEGMENT_SEQUENCE_PROPERTIES,fe.default.SEGMENT_URL,fe.default.SERVICE_DESCRIPTION,fe.default.SUPPLEMENTAL_PROPERTY,fe.default.UTC_TIMING];function ta(n){n=n||{};const e=this.context,t=n.debug;let l,c,T,D;function R(d){try{const b=(function(M){const m=(function(N,O={}){let L=O.pos||0;const x=N.length,U=!!O.keepComments,K=!!O.keepWhitespace,q=!!O.includeParentElement;function z(k,Q="#text"){return{nodeName:Q,nodeValue:k,attributes:{},childNodes:[]}}function J(k=""){const Q=[];for(;L<x;)if(N.charCodeAt(L)===ao){const W=N.charCodeAt(L+1);if(W===Zi){const Ce=L+2;if(L=N.indexOf(">",L),!N.startsWith(k,Ce)){const Me=N.substring(0,L).split(`
`);throw new Error(`Unexpected close tag
Line: `+(Me.length-1)+`
Column: `+(Me[Me.length-1].length+1)+`
Char: `+N[L])}return L+1&&(L+=1),Q}if(W===so){L=N.indexOf(">",L),L++;continue}if(W===oo){const Ce=N.charCodeAt(L+2);if(Ce===Di){const Me=L;for(;L!==-1&&(N.charCodeAt(L)!==bi||N.charCodeAt(L-1)!==Di||N.charCodeAt(L-2)!==Di);)L=N.indexOf(">",L+1);L===-1&&(L=x),U&&Q.push(z(N.substring(Me,L+1),"#comment"))}else{if(Ce===vi&&N.charCodeAt(L+8)===vi&&N.startsWith("CDATA",L+3)){const Me=N.indexOf("]]>",L);Me===-1?(Q.push(z(N.substr(L+9),"#cdata")),L=x):(Q.push(z(N.substring(L+9,Me),"#cdata")),L=Me+3);continue}{const Me=L+1;L+=2;let ve=!1;for(;L<x&&(N.charCodeAt(L)!==bi||ve);){const ue=N.charCodeAt(L);ue===vi?ve=!0:ve&&ue===lo&&(ve=!1),L++}Q.push(z(N.substring(Me,L),"#doctype"))}}L++;continue}const re=y();Q.push(re)}else{const W=v();if(K)W.length>0&&Q.push(z(W));else{const re=W.trim();re.length>0&&Q.push(z(re))}L++}return Q}function v(){const k=L;return L=N.indexOf("<",L)-1,L===-2&&(L=x),(0,Or.unescapeHtml)(N.slice(k,L+1))}function A(){const k=L;for(;L<x&&!uo.has(N.charCodeAt(L));)L++;return N.slice(k,L)}function y(){L++;const k=A();let Q=k,W=null;const re=k.indexOf(":");re!==-1&&(W=k.slice(0,re),Q=k.slice(re+1));const Ce=(function(){const ue={};for(;L<x&&N.charCodeAt(L)!==bi;){const oe=N.charCodeAt(L);if(oe>64&&oe<91||oe>96&&oe<123){const ne=A();let pe="",Ee=N.charCodeAt(L);for(;Ee!==Ji&&Ee!==ea;)L++,Ee=N.charCodeAt(L);if(Ee===Ji||Ee===ea){if(pe=C(),L===-1)throw new Error("Missing closing quote")}else L--;ue[ne]=(0,Or.unescapeHtml)(pe)}L++}return ue})();let Me=[];const ve=N.charCodeAt(L-1);return L++,ve!==Zi&&(Me=J(k)),{nodeName:k,nodeValue:null,attributes:Ce,childNodes:Me,prefix:W,localName:Q}}function C(){const k=N[L],Q=L+1;return L=N.indexOf(k,Q),N.slice(Q,L)}const ee={nodeName:"#document",nodeValue:null,childNodes:J(""),attributes:{}};return q&&(function k(Q,W){Q.parentElement=W?.nodeName.startsWith("#")?null:W;for(const re of Q.childNodes)k(re,Q)})(ee,null),ee})(M),u=m.childNodes.find((N=>N.nodeName==="MPD"||N.nodeName==="Patch"))||m.childNodes[0];return(function N(O){O.nodeName.indexOf(":")!==-1&&(O.__prefix=O.prefix,O.nodeName=O.localName);const{childNodes:L,attributes:x,nodeName:U}=O;O.tagName=U;for(let q in x){let z=x[q];if(U==="S")z=parseInt(z);else for(let J=0,v=T.length;J<v;J++){const A=T[J];if(A.test(U,q,z)){z=A.converter(z);break}}O[q]=z}const K=L?.length;for(let q=0;q<K;q++){const z=L[q];if(z.nodeName==="#text"){O.__text=z.nodeValue;continue}N(z);const{nodeName:J}=z;Array.isArray(O[J])?O[J].push(z):co.indexOf(J)!==-1?(O[J]||(O[J]=[]),O[J].push(z)):O[J]=z}O.__children=L})(u),u})(d);return{[b.tagName]:b}}catch{return null}}return l={getIron:function(){return D},parseXml:R,parse:function(d){let b;const M=window.performance.now();if(b=R(d),!b||!b.MPD&&!b.Patch)throw new Error("failed to parse the manifest");b.Patch?(b=b.Patch,b.add&&b.add.forEach((u=>D.run(u))),b.replace&&b.replace.forEach((u=>D.run(u)))):(b=b.MPD,D.run(b));const m=window.performance.now();return c.info("Parsing complete: "+(m-M).toPrecision(3)+"ms"),b.protocol="DASH",b}},c=t.getLogger(l),T=[new Xs,new Zs,new to,new no],D=Qs(e).create({adaptationset:new ro,period:new io}),l}ta.__dashjs_factory_name="DashParser";var fo=F.default.getClassFactory(ta);function na(n){n=n||{};const e=this.context,t=n.debug,l=n.settings,c=(0,g.default)(e).getInstance(),T=(0,Ht.default)(e).getInstance();let D,R,d,b,M,m=n.mssHandler,u=n.errHandler;function N(O){c.trigger(h.default.INTERNAL_MANIFEST_LOADED,{manifest:O.manifest})}return D={load:function(O,L=null,x=null){const U=new Date,K=new ji(O,Ge.HTTPRequest.MPD_TYPE);L&&(K.serviceLocation=L),x&&(K.queryParams=x),K.startDate||(K.startDate=U),c.trigger(h.default.MANIFEST_LOADING_STARTED,{request:K}),d.load({request:K,success:function(q,z,J){if(!b)return;let v,A,y;if(J&&J!==O?(A=T.parseBaseUrl(J),v=J):(T.isRelative(O)&&(O=T.resolve(O,window.location.href)),A=T.parseBaseUrl(O)),z!="No Content")if(M===null&&(M=(function(C){let ee=null;return C.indexOf("SmoothStreamingMedia")>-1?(m&&(ee=m.createMssParser(),m.createMssFragmentProcessor(),m.registerEvents()),ee):C.indexOf("MPD")>-1||C.indexOf("Patch")>-1?fo(e).create({debug:t}):ee})(q)),M!==null){b.setParser(M);try{y=M.parse(q)}catch{return void c.trigger(h.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new un.default(Pn.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,Pn.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${O}`)})}if(y){if(y.url=v||O,y.originalUrl||(y.originalUrl=y.url),l&&l.get().streaming.enableManifestDurationMismatchFix&&y.mediaPresentationDuration&&y.Period?.length>1){const C=y.Period.reduce(((ee,k)=>ee+k.duration),0);!isNaN(C)&&y.mediaPresentationDuration>C&&(R.warn("Media presentation duration greater than duration of all periods. Setting duration to total period duration"),y.mediaPresentationDuration=C)}y.baseUri=A,y.loadedTime=new Date,b.resolveManifestOnLoad(y),c.trigger(h.default.ORIGINAL_MANIFEST_LOADED,{originalManifest:q})}else c.trigger(h.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new un.default(Pn.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,Pn.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${O}`)})}else c.trigger(h.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new un.default(Pn.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,Pn.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${O}`)});else c.trigger(h.default.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(q,z,J){c.trigger(h.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new un.default(Pn.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,Pn.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+`${O}, ${J}`)})}})},reset:function(){c.off(h.default.XLINK_READY,N,D),m&&m.reset(),b&&(b.reset(),b=null),d&&(d.abort(),d=null)}},R=t.getLogger(D),c.on(h.default.XLINK_READY,N,D),d=(0,xt.default)(e).create({errHandler:n.errHandler,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,urlUtils:T,constants:r.default,dashConstants:fe.default,errors:Pn.default}),b=$s(e).create({errHandler:u,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,settings:n.settings}),M=null,D}na.__dashjs_factory_name="ManifestLoader";var go=F.default.getClassFactory(na);function ra(){let n,e,t=this.context,l=(0,g.default)(t).getInstance();return n={getValue:function(){return e},setValue:function(c){e=c,c&&l.trigger(h.default.MANIFEST_LOADED,{data:c})}},n}ra.__dashjs_factory_name="ManifestModel";var ho=F.default.getSingletonFactory(ra);function ia(){const n=this.context,e=(0,E.default)(n).getInstance();let t,l,c;return t={initialize:function(){l.initialize()},select:function(T){if(!T||T.length===0)return null;let D=null;return e.get().streaming.applyContentSteering&&(D=(function(R){const d=c.getCurrentSteeringResponseData();return d&&d.pathwayPriority&&d.pathwayPriority.length>0?(function(b=[],M=[]){let m=0,u=null;for(;m<b.length;){const N=b[m],O=M.findIndex((L=>L.serviceLocation&&L.serviceLocation===N));if(O!==-1&&!l.contains(M[O].serviceLocation)){u=M[O];break}m+=1}return u})(d.pathwayPriority,R):null})(T)),D||(D=(function(R){return R[0]})(T)),D},setConfig:function(T){T.blacklistController&&(l=T.blacklistController),T.contentSteeringController&&(c=T.contentSteeringController)},reset:function(){l.reset()}},l=Fn(n).create({updateEventName:h.default.SERVICE_LOCATION_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:h.default.SERVICE_LOCATION_LOCATION_BLACKLIST_ADD,enableExpiry:!1}),c=ft(n).getInstance(),t}ia.__dashjs_factory_name="LocationSelector";var po=F.default.getClassFactory(ia);function aa(){const n=this.context,e=(0,g.default)(n).getInstance(),t=(0,Ht.default)(n).getInstance();let l,c,T,D,R,d,b,M,m,u,N,O,L,x,U;function K(){L=NaN,M=!1,d=!0,b=!1,q()}function q(){x!==null&&(clearTimeout(x),x=null)}function z(W){q(),b||(isNaN(W)&&!isNaN(L)&&(W=1e3*L),isNaN(W)||(u.debug("Refresh manifest in "+W+" milliseconds."),x=setTimeout(A,W)))}function J(W=!1){M=!0;const re=O.getValue();let Ce=re.url;Ce&&(Ce=rn.default.removeQueryParameterFromUrl(Ce,r.default.CMCD_QUERY_KEY));let Me=null;const ve=l.getPatchLocation(re),ue=m.select(ve);let oe=null;if(ue&&!W)Ce=ue.url,Me=ue.serviceLocation,oe=ue.queryParams;else{const ne=(function(Ee){const te=l.getLocation(Ee),se=c.getSynthesizedLocationElements(te);return te.concat(se)})(re),pe=m.select(ne);pe&&(Ce=pe.url,Me=pe.serviceLocation,oe=pe.queryParams)}t.isRelative(Ce)&&(Ce=t.resolve(Ce,re.url)),N.load(Ce,Me,oe)}function v(W){if(W){if(l.getIsPatch(W)){let ve=W;W=O.getValue();let ue=l.isPatchValid(W,ve),oe=ue;if(ue){let ne=l.getPublishTime(W);l.applyPatchToManifest(W,ve);let pe=l.getPublishTime(W);oe=ne.getTime()!==pe.getTime()}if(!oe)return u.debug("Patch provided is invalid, performing full manifest refresh"),void J(!0);W.loadedTime=new Date}}else(W=O.getValue()).loadedTime=new Date;const re=O.getValue();if(re&&re.type===fe.default.DYNAMIC&&W.type===fe.default.STATIC&&(e.trigger(h.default.DYNAMIC_TO_STATIC),b=!0,U.get().streaming.ignoreFinalStaticManifestOnDynamicToStaticTransition))return void(M=!1);O.setValue(W);const Ce=new Date,Me=(Ce.getTime()-W.loadedTime.getTime())/1e3;L=l.getManifestUpdatePeriod(W,Me),1e3*L>2147483647&&(L=2147483647e-3),e.trigger(h.default.MANIFEST_UPDATED,{manifest:W}),u.info("Manifest has been refreshed at "+Ce+"["+Ce.getTime()/1e3+"] "),d||z()}function A(){d||(M?z(U.get().streaming.manifestUpdateRetryInterval):J())}function y(W){if(W.error)W.error.code===Pn.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&D.error(W.error);else{const re=W.manifest;(function(Ce){(function(Me){const ve=T.getExternalSubtitles();if(!ve||ve.length===0)return;const ue=Me&&Me.Period?Me.Period.length:0;ve.forEach((oe=>{if(oe.periodId===null&&ue>1)u.warn(`External subtitle with id ${oe.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(ue===1)C(Me.Period[0],oe);else{const ne=Me.Period.find((pe=>pe.id===oe.periodId));ne?C(ne,oe):u.warn(`External subtitle with id ${oe.id} has periodId ${oe.periodId} but the MPD does not contain a period with that id. Unable to add the external subtitle.`)}}))})(Ce)})(re),v(re)}}function C(W,re){if(!W||!W.AdaptationSet)return W;W.AdaptationSet.push(re.serializeToMpdParserFormat())}function ee(){d=!1,z()}function k(){d=!U.get().streaming.scheduling.scheduleWhilePaused,d&&q()}function Q(){M=!1}return R={getIsUpdating:function(){return M},initialize:function(){K(),m.initialize(),e.on(h.default.STREAMS_COMPOSED,Q,this),e.on(H.default.PLAYBACK_STARTED,ee,this),e.on(H.default.PLAYBACK_PAUSED,k,this),e.on(h.default.INTERNAL_MANIFEST_LOADED,y,this)},refreshManifest:J,reset:function(){e.off(H.default.PLAYBACK_STARTED,ee,this),e.off(H.default.PLAYBACK_PAUSED,k,this),e.off(h.default.STREAMS_COMPOSED,Q,this),e.off(h.default.INTERNAL_MANIFEST_LOADED,y,this),m.reset(),K()},setConfig:function(W){W&&(W.manifestModel&&(O=W.manifestModel),W.adapter&&(l=W.adapter),W.manifestLoader&&(N=W.manifestLoader),W.errHandler&&(D=W.errHandler),W.locationSelector&&(m=W.locationSelector),W.settings&&(U=W.settings),W.contentSteeringController&&(c=W.contentSteeringController),W.customParametersModel&&(T=W.customParametersModel))},setManifest:function(W){v(W)}},u=(0,p.default)(n).getInstance().getLogger(R),m=po(n).create(),T=(0,Cr.default)(n).getInstance(),R}aa.__dashjs_factory_name="ManifestUpdater";var sa=F.default.getClassFactory(aa);function mo(n,e){return function(t,l){let c=la(t,"tag");const T=la(l??"*","range"),D=[];let R=-1;for(;++R<T.length;){const d=T[R].toLowerCase();if(!e&&d==="*")continue;let b=-1;const M=[];for(;++b<c.length;)if(n(c[b].toLowerCase(),d)){if(!e)return c[b];D.push(c[b])}else M.push(c[b]);c=M}return e?D:void 0}}const oa=mo((function(n,e){const t=n.split("-"),l=e.split("-");let c=0,T=0;if(l[T]!=="*"&&t[c]!==l[T])return!1;for(c++,T++;T<l.length;)if(l[T]!=="*"){if(!t[c])return!1;if(t[c]!==l[T]){if(t[c].length===1)return!1;c++}else c++,T++}else T++;return!0}),!0);function la(n,e){const t=n&&typeof n=="string"?[n]:n;if(!t||typeof t!="object"||!("length"in t))throw new Error("Invalid "+e+" `"+t+"`, expected non-empty string");return t}function Mi(){const n=this.context,e=(0,g.default)(n).getInstance();let t,l,c,T,D,R,d,b,M,m,u;function N(te){if(!(te&&te.currentRepresentation&&te.currentRepresentation.mediaInfo&&te.currentRepresentation.mediaInfo.type))return;const se=te.currentRepresentation.mediaInfo.type;d[se]=te.currentRepresentation}function O(te,se){return te&&c[se]&&c[se][te]?c[se][te].list:[]}function L(te,se){return te&&c[se]&&c[se][te]?c[se][te].current:null}function x(te,se={}){if(!te||!te.streamInfo)return;const Ae=te.type,ge=te.streamInfo.id,we=L(Ae,ge);if(c[ge]&&c[ge][Ae]&&(c[ge][Ae].current=te,c[ge][Ae].current&&(Ae!==r.default.TEXT&&!q(te,we)||Ae===r.default.TEXT&&te.isFragmented)&&e.trigger(h.default.CURRENT_TRACK_CHANGED,{oldMediaInfo:we,newMediaInfo:te,switchMode:T.get().streaming.trackSwitchMode[Ae],options:se},{streamId:ge}),!se.hasOwnProperty("noSettingsSave")||!se.noSettingsSave)){let Ve=(function($e){const Je={lang:$e.lang,viewpoint:$e.viewpoint,roles:$e.roles,accessibility:$e.accessibility,audioChannelConfiguration:$e.audioChannelConfiguration,codec:$e.codec};return Je.lang||Je.viewpoint||Je.role&&Je.role.length>0||Je.accessibility&&Je.accessibility.length>0||Je.audioChannelConfiguration&&Je.audioChannelConfiguration.length>0?Je:null})(te);if(!Ve||!c[ge][Ae].storeLastSettings)return;Ve.roles&&(Ve.role=Ve.roles[0],delete Ve.roles),Ve.accessibility&&(Ve.accessibility=Ve.accessibility[0]),Ve.audioChannelConfiguration&&(Ve.audioChannelConfiguration=Ve.audioChannelConfiguration[0]),R[Ae]=Ve,u.setSavedMediaSettings(Ae,Ve)}}function U(te,se){te&&se&&(D[te]=se)}function K(te){return te?D[te]:null}function q(te,se){if(!te&&!se)return!0;if(!te||!se||te.isPreselection!==se.isPreselection)return!1;let Ae=(0,In.default)(n).getInstance();const ge=te.id===se.id,we=Ae.areEqual(te.viewpoint,se.viewpoint),Ve=te.lang===se.lang,$e=te.codec===se.codec,Je=Ae.areEqual(te.roles,se.roles),gt=Ae.areEqual(te.accessibility,se.accessibility),Et=Ae.areEqual(te.audioChannelConfiguration,se.audioChannelConfiguration),Jt=Ae.areEqual(te.supplementalProperties,se.supplementalProperties),fn=Ae.areEqual(te.essentialProperties,se.essentialProperties);return ge&&$e&&we&&Ve&&Je&&gt&&Et&&Jt&&fn}function z(){c={},R={},d={},D={audio:null,video:null,text:null},e.off(H.default.REPRESENTATION_SWITCH,N,t)}function J(te,se,Ae){let ge=[];return te.forEach((function(we){se(Ae,we)&&ge.push(we)})),ge.length!==0?(l.info("Filter-Function ("+se.name+") resulted in "+ge.length+" tracks"),ge):se===ee&&T.get().streaming.assumeDefaultRoleAsMain&&Ee(Ae.role,{schemeIdUri:r.default.DASH_ROLE_SCHEME_ID,value:fe.default.MAIN})&&(l.info("no track with Role set to main - assuming main as default and searching again"),ge=J(te,k,null),ge.length!==0)?ge:(l.info("Filter-Function ("+se.name+") resulted in no tracks; setting ignored"),te)}function v(te,se){try{return!te.lang||te.lang instanceof RegExp?se.lang.match(te.lang):se.lang!==""&&oa(se.lang,Jr(te.lang)).length>0}catch{return!1}}function A(te,se){return te.index===void 0||te.index===null||se.index===te.index}function y(te,se){return te.id===void 0||te.id===null||se.id===te.id}function C(te,se){return!te.viewpoint||!!se.viewpoint.filter((function(Ae){return Ee(Ae,te.viewpoint)}))[0]}function ee(te,se,Ae=!1){return!!se.roles&&(!te.role||!!se.roles.filter((function(ge){return Ee(ge,te.role)}))[0]||se.type===r.default.AUDIO&&Ae)}function k(te,se){return!se.roles||se.roles.length===0}function Q(te,se){let Ae;return Ae=te.accessibility?!!se.accessibility.filter((function(ge){return Ee(ge,te.accessibility)}))[0]:!se.accessibility.length,Ae}function W(te,se){return!te.audioChannelConfiguration||!!se.audioChannelConfiguration.filter((function(Ae){return Ee(Ae,te.audioChannelConfiguration)}))[0]}function re(te,se){return!te.codec||te.codec===se.codec}function Ce(te){let se=0,Ae=[];return te.forEach((ge=>{isNaN(ge.selectionPriority)||(ge.selectionPriority>se?(se=ge.selectionPriority,Ae=[ge]):ge.selectionPriority===se&&Ae.push(ge))})),Ae}function Me(te){let se,Ae=0,ge=[];return te.forEach((function(we){se=Math.max.apply(Math,we.bitrateList.map((function(Ve){return Ve.bandwidth}))),se>Ae?(Ae=se,ge=[we]):se===Ae&&ge.push(we)})),ge}function ve(te){return te[0]&&te[0].type===r.default.VIDEO?(function(se){let Ae,ge=1/0,we=[];return se.forEach((function(Ve){Ae=Ve.bitrateList.reduce((function(Je,gt){const Et=Math.max(1,gt.width*gt.height);return Je+gt.bandwidth/Et}),0)/Ve.bitrateList.length,Ae<ge?(ge=Ae,we=[Ve]):Ae===ge&&we.push(Ve)})),we})(te):te[0]&&te[0].type===r.default.AUDIO?(function(se){let Ae=1/0,ge=[];return se.forEach((function(we){let Ve=we.audioChannelConfiguration.reduce((function(Je,gt){return Je+(kr(gt)||0)}),0)/we.audioChannelConfiguration.length;we.hasOwnProperty("supplementalProperties")&&we.supplementalProperties.some((Je=>Je.schemeIdUri==="tag:dolby.com,2018:dash:EC3_ExtensionType:2018"&&Je.value==="JOC"))&&(Ve=16),Ve||(Ve=1);let $e=we.bitrateList.reduce((function(Je,gt){return Je+gt.bandwidth/Ve}),0)/we.bitrateList.length;$e<Ae?(Ae=$e,ge=[we]):$e===Ae&&ge.push(we)})),ge})(te):te}function ue(te){let se,Ae=0,ge=[];return te.forEach((function(we){se=we.representationCount,se>Ae?(Ae=se,ge=[we]):se===Ae&&ge.push(we)})),ge}function oe(te,se){if(te===r.default.TEXT)return(function(we){if(!we||we.length===0)return null;const Ve=we.filter(($e=>!($e&&$e.roles&&$e.roles.length>0)||$e.roles.every((Je=>Je.schemeIdUri!==r.default.DASH_ROLE_SCHEME_ID||Je.value!==fe.default.FORCED_SUBTITLE))));return Ve.length>0?Ve[0]:we[0]})(se);let Ae;const ge=b.getCustomInitialTrackSelectionFunction();if(Ae=(function(we){try{let Ve;return Ve=(function($e){try{const Je=$e.filter((gt=>{const Et=gt.type;return gt.bitrateList.some((Jt=>{const fn=M.getAbrBitrateParameter("maxBitrate",Et),bn=M.getAbrBitrateParameter("minBitrate",Et);return!(fn>-1&&Jt.bandwidth>1e3*fn||bn>-1&&Jt.bandwidth<1e3*bn)}))}));return Je.length>0?Je:$e}catch(Je){return l.error(Je),$e}})(we),Ve=(function($e){try{if(!T.get().streaming.abr.limitBitrateByPortal)return $e;const{elementWidth:Je}=m.getVideoElementSize(),gt=$e.filter((Et=>Et.type!==r.default.VIDEO||Et.bitrateList.some((Jt=>Jt.width<=Je))));return gt.length>0?gt:$e}catch(Je){return l.error(Je),$e}})(Ve),Ve}catch(Ve){return l.error(Ve),we}})(se),ge&&typeof ge=="function")Ae=ge(Ae);else if(d[te])Ae=(function(we,Ve){if(!we||we.length===0||!Ve||!d[Ve])return we;const $e=d[Ve].bandwidth;if(!$e||isNaN($e))return we;let Je={min:NaN,track:null};return we.forEach((gt=>{gt.bitrateList.forEach((Et=>{const Jt=Math.abs(Et.bandwidth-$e);(isNaN(Je.min)||Jt<Je.min)&&(Je.min=Jt,Je.track=gt)}))})),Je.track?[Je.track]:we})(Ae,te);else if(T.get().streaming.ignoreSelectionPriority||(l.info("Trying to find track with highest selectionPriority"),Ae=(function(we){return Ce(we)})(Ae)),Ae.length>1&&T.get().streaming.prioritizeRoleMain&&(l.info("Trying to find a main track"),Ae=J(Ae,ee,{role:{schemeIdUri:r.default.DASH_ROLE_SCHEME_ID,value:fe.default.MAIN}})),Ae.length>1){l.info("Selecting track based on selectionModeForInitialTrack");let we=T.get().streaming.selectionModeForInitialTrack;switch(we){case r.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE:Ae=(function(Ve){let $e=Me(Ve);return $e.length>1&&($e=ue($e)),$e})(Ae);break;case r.default.TRACK_SELECTION_MODE_FIRST_TRACK:Ae=ne(Ae);break;case r.default.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:Ae=pe(Ae);break;case r.default.TRACK_SELECTION_MODE_WIDEST_RANGE:Ae=(function(Ve){let $e=ue(Ve);return $e.length>1&&($e=Me(Ve)),$e})(Ae);break;case r.default.TRACK_SELECTION_MODE_LOWEST_STARTUP_DELAY:Ae=(function(Ve){let $e=Ve.filter((Je=>!(!Je.segmentSequenceProperties||Je.segmentSequenceProperties.length===0)&&Je.segmentSequenceProperties.some((gt=>gt.isBootstrapConfiguration()))));return pe($e.length>0?$e:Ve)})(Ae);break;default:l.warn(`Track selection mode ${we} is not supported. Falling back to TRACK_SELECTION_MODE_FIRST_TRACK`),Ae=ne(Ae)}}return Ae.length>0?Ae[0]:se[0]}function ne(te){return te[0]}function pe(te){let se=ve(te);return se.length>1&&(se=Me(se)),se}function Ee(te,se){return!(!te||!se)&&JSON.stringify({schemeIdUri:te.schemeIdUri,value:te.value})===JSON.stringify({schemeIdUri:se.schemeIdUri,value:se.value})}return t={addTrack:function(te){if(!te)return;const se=te.type;if((Ae=se)!==r.default.AUDIO&&Ae!==r.default.VIDEO&&Ae!==r.default.TEXT&&Ae!==r.default.IMAGE)return void l.info("track not added (_isMultiTrackSupportedByType), track.index="+te.index);var Ae;let ge=te.streamInfo.id;c[ge]||(c[ge]=(function(){const Ve=T.get().streaming.saveLastMediaSettingsForCurrentStreamingSession;return{audio:{list:[],storeLastSettings:Ve,current:null},video:{list:[],storeLastSettings:Ve,current:null},text:{list:[],storeLastSettings:Ve,current:null},image:{list:[],storeLastSettings:Ve,current:null}}})());const we=c[ge][se].list;for(let Ve=0,$e=we.length;Ve<$e;++Ve)if(q(we[Ve],te))return void l.info("track not added as it is already set (this track-index="+te.index+" - existing track.index="+we[Ve].index+")");l.info("addTrack with track.codec='"+te.codec+"', track.type='"+te.type+"', track.id='"+te.id+"', track.index="+te.index),we.push(te)},areTracksEqual:q,clearDataForStream:function(te){c[te]&&delete c[te]},getCurrentTrackFor:L,getInitialSettings:K,getTracksFor:O,getTracksWithHighestSelectionPriority:Ce,getTracksWithHighestBitrate:Me,getTracksWithHighestEfficiency:ve,getTracksWithWidestRange:ue,initialize:function(){e.on(H.default.REPRESENTATION_SWITCH,N,t)},isCurrentTrack:function(te){if(!te)return!1;const se=te.type,Ae=te.streamInfo.id;return c[Ae]&&c[Ae][se]&&q(c[Ae][se].current,te)},matchSettings:function(te,se,Ae=!1){try{let ge=!1;if(te.lang){if(te.lang instanceof RegExp)ge=se.lang.match(te.lang);else if(se.lang!==""){const Et=Jr(te.lang);Et&&(ge=oa(se.lang,Et).length>0)}}else ge=!0;const we=te.index===void 0||te.index===null||se.index===te.index,Ve=!te.viewpoint||!!se.viewpoint.filter((function(Et){return Ee(Et,te.viewpoint)}))[0],$e=!te.role||!!se.roles.filter((function(Et){return Ee(Et,te.role)}))[0];let Je=!te.accessibility||!!se.accessibility.filter((function(Et){return Ee(Et,te.accessibility)}))[0],gt=!te.audioChannelConfiguration||!!se.audioChannelConfiguration.filter((function(Et){return Ee(Et,te.audioChannelConfiguration)}))[0];return ge&&we&&Ve&&($e||se.type===r.default.AUDIO&&Ae)&&Je&&gt}catch(ge){return l.error(ge),!1}},matchSettingsAccessibility:Q,matchSettingsAudioChannelConfig:W,matchSettingsIndex:A,matchSettingsLang:v,matchSettingsRole:ee,matchSettingsViewPoint:C,reset:z,saveTextSettingsDisabled:function(){u.setSavedMediaSettings(r.default.TEXT,null)},selectInitialTrack:oe,setConfig:function(te){te&&(te.domStorage&&(u=te.domStorage),te.settings&&(T=te.settings),te.customParametersModel&&(b=te.customParametersModel),te.mediaPlayerModel&&(M=te.mediaPlayerModel),te.videoModel&&(m=te.videoModel))},setInitialMediaSettingsForType:function(te,se){let Ae=R[te]||K(te);const ge=O(te,se.id);let we=[];Ae&&Object.keys(Ae).length!==0||(Ae=u.getSavedMediaSettings(te),Ae&&delete Ae.codec,U(te,Ae)),ge&&ge.length!==0&&(we=T.get().streaming.includePreselectionsForInitialTrackSelection?Array.from(ge):ge.filter((Ve=>!Ve.isPreselection)),Ae&&(l.info("Filtering "+we.length+" "+te+" tracks based on settings"),we=J(we,y,Ae),we=J(we,v,Ae),we=J(we,A,Ae),we=J(we,C,Ae),te===r.default.AUDIO&&R[te]||(we=J(we,ee,Ae)),we=J(we,Q,Ae),we=J(we,re,Ae),we=J(we,W,Ae),l.info("Filtering "+te+" tracks ended, found "+we.length+" matching track(s).")),we.length>1?x(oe(te,we)):x(we[0]))},setInitialSettings:U,setTrack:x},l=(0,p.default)(n).getInstance().getLogger(t),z(),t}Mi.__dashjs_factory_name="MediaController";const ua=F.default.getSingletonFactory(Mi);F.default.updateSingletonFactory(Mi.__dashjs_factory_name,ua);var Eo=ua;function ca(){let n,e,t,l;const c=this.context,T=(0,E.default)(c).getInstance();function D(u,N){return isNaN(u)?0:u>0?(N&&e.warn("Supplied minimum playback rate is a positive value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."),0):u<-.5?(N&&e.warn("Supplied minimum playback rate is out of range and will be limited to -0.5: -50% playback speed."),-.5):u}function R(u,N){return isNaN(u)?0:u<0?(N&&e.warn("Supplied maximum playback rate is a negative value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."),0):u>1?(N&&e.warn("Supplied maximum playback rate is out of range and will be limited to 1: 200% playback speed."),1):u}function d(u,N){return isNaN(u)?0:u<0?(N&&e.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):u<0?(N&&e.warn("Supplied step algorithm value is out of range and will be limited to 0"),0):u}function b(){const u=M(),N=t.getLiveDelay();return!isNaN(N)&&N>0?Math.min(u,N):u}function M(){return T.get().streaming.buffer.bufferTimeDefault>0?T.get().streaming.buffer.bufferTimeDefault:m()?20:12}function m(){return T.get().streaming.buffer.fastSwitchEnabled!==null?T.get().streaming.buffer.fastSwitchEnabled:!t.getLowLatencyModeEnabled()}return n={getAbrBitrateParameter:function(u,N){try{const O=T.get().streaming.abr[u][N];if(!isNaN(O)&&O!==-1)return O;const L=l.getServiceDescriptionSettings();return L&&L[u]&&!isNaN(L[u][N])?L[u][N]:-1}catch{return-1}},getBufferTimeDefault:b,getBufferTimeDefaultUnadjusted:M,getCatchupMaxDrift:function(){if(!isNaN(T.get().streaming.liveCatchup.maxDrift))return T.get().streaming.liveCatchup.maxDrift;const u=l.getServiceDescriptionSettings();return u&&u.liveCatchup&&!isNaN(u.liveCatchup.maxDrift)&&u.liveCatchup.maxDrift>=0?u.liveCatchup.maxDrift:12},getCatchupModeEnabled:function(){return T.get().streaming.liveCatchup.enabled!==null?T.get().streaming.liveCatchup.enabled:t.getInitialCatchupModeActivated()},getCatchupPlaybackRates:function(u){const N=T.get().streaming.liveCatchup.playbackRate;if(!isNaN(N.min)||!isNaN(N.max))return{min:D(N.min,u),max:R(N.max,u)};const O=l.getServiceDescriptionSettings();if(O&&O.liveCatchup&&(!isNaN(O.liveCatchup.playbackRate.min)||!isNaN(O.liveCatchup.playbackRate.max))){const L=O.liveCatchup.playbackRate;return{min:D(L.min,u),max:R(L.max,u)}}return{min:-.5,max:.5}},getCatchupStepSettings:function(u){const N=T.get().streaming.liveCatchup.step;return isNaN(N.start.min)&&isNaN(N.start.max)&&isNaN(N.stop.min)&&isNaN(N.stop.max)?{start:{min:0,max:1},stop:{min:0,max:1}}:{start:{min:d(N.start.min,u),max:d(N.start.max,u)},stop:{min:d(N.stop.min,u),max:d(N.stop.max,u)}}},getFastSwitchEnabled:m,getInitialBufferLevel:function(){const u=T.get().streaming.buffer.initialBufferLevel;return isNaN(u)||u<0?0:Math.min(b(),u)},getRetryAttemptsForType:function(u){const N=isNaN(T.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:T.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return t.getLowLatencyModeEnabled()?T.get().streaming.retryAttempts[u]*N:T.get().streaming.retryAttempts[u]},getRetryIntervalsForType:function(u){const N=isNaN(T.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:T.get().streaming.retryIntervals.lowLatencyReductionFactor;return t.getLowLatencyModeEnabled()?T.get().streaming.retryIntervals[u]/N:T.get().streaming.retryIntervals[u]},getScheduleTimeout:function(){return t.getLowLatencyModeEnabled()?T.get().streaming.scheduling.lowLatencyTimeout:T.get().streaming.scheduling.defaultTimeout},reset:function(){},setConfig:function(u){u.playbackController&&(t=u.playbackController),u.serviceDescriptionController&&(l=u.serviceDescriptionController)}},e=(0,p.default)(c).getInstance().getLogger(n),n}ca.__dashjs_factory_name="MediaPlayerModel";var To=F.default.getSingletonFactory(ca);function fa(){const n=this.context,e=(0,g.default)(n).getInstance();let t,l,c,T,D,R,d,b,M,m,u,N,O,L,x,U,K,q,z,J,v,A,y,C;function ee(){re(),x=!1,m=0,L=0,l=0,O=!1,N=!1,T=!1,K=NaN,M=NaN,y&&(e.off(h.default.DATA_UPDATE_COMPLETED,Ve,D),e.off(h.default.MANIFEST_UPDATED,Ze,D),e.off(h.default.STREAMS_COMPOSED,bt,D),e.off(H.default.PLAYBACK_ENDED,cn,D),e.off(H.default.STREAM_INITIALIZING,jt,D),e.off(H.default.REPRESENTATION_SWITCH,xe,D),e.off(H.default.BUFFER_LEVEL_STATE_CHANGED,gt,D),we(),y.removeEventListener("canplay",$e),y.removeEventListener("canplaythrough",Je),y.removeEventListener("ended",St),y.removeEventListener("error",Nn),y.removeEventListener("loadeddata",Mt),y.removeEventListener("loadedmetadata",rt),y.removeEventListener("pause",bn),y.removeEventListener("play",Et),y.removeEventListener("playing",fn),y.removeEventListener("progress",Bn),y.removeEventListener("ratechange",xn),y.removeEventListener("seeked",Kn),y.removeEventListener("seeking",kn),y.removeEventListener("stalled",Lt),y.removeEventListener("timeupdate",Un),y.removeEventListener("volumechange",Gt),y.removeEventListener("waiting",Jt)),C=null,y=null,v=null,d=null}function k(Xe=null){return parseFloat((Q(Xe)-ue()).toFixed(5))}function Q(Xe){const qt=Xe||v;return qt.start+qt.duration}function W(Xe=!1){v&&y&&y.getElement()?(Xe&&d&&ve(ue()),y.play()):x=!0}function re(){v&&y&&y.pause()}function Ce(Xe,qt=!1,Xt=!1,sn=!1){v&&y&&y.getElement()&&Xe!==(isNaN(K)?y.getTime():K)&&(R=Xt===!0,R||(K=Xe),u.info("Requesting seek to time: "+Xe+(R?" (internal)":"")),d&&sn&&ve(Xe),y.setCurrentTime(Xe,qt))}function Me(){if(!v||!y||!d)return;const Xe=J&&J.hasVideoTrack()?r.default.VIDEO:r.default.AUDIO,qt=c.getCurrentDVRInfo(Xe);return qt&&qt.range?qt.range.end:0}function ve(Xe){const qt=new Date(A.getClientReferenceTime()),Xt=t.getRegularPeriods()[0];m=A.calcPresentationTimeFromWallTime(qt,Xt)-Xe}function ue(){return v&&y?y.getTime():null}function oe(){return v&&y?y.isPaused():null}function ne(){return v&&y?y.isSeeking():null}function pe(){return v&&y?y.isStalled():null}function Ee(){return v&&y?y.getPlaybackRate():null}function te(){return v&&y?y.getEnded():null}function se(){return d}function Ae(Xe=null){if(oe()||!d||y.getReadyState()===0||ne()||O)return;Xe||(Xe=J.hasVideoTrack()?r.default.VIDEO:r.default.AUDIO);const qt=ue(),Xt=(function(sn,wn){const Te=c.getCurrentDVRInfo(wn),nt=Te?Te.range:null;let Kt;return nt?(Kt=sn>nt.end?Math.max(nt.end-m,nt.start):sn>0&&sn+.25<nt.start&&Math.abs(sn-nt.start)<31536e4?N?Math.max(nt.end-m,nt.start):nt.start:sn,Kt):NaN})(qt,Xe);!isNaN(Xt)&&Xt!==qt&&!ne()&&(pe()||U||y.getReadyState()===1)&&(u.debug(`UpdateCurrentTime: Seek to actual time: ${Xt} from currentTime: ${qt}`),Ce(Xt,!1,!1))}function ge(){C===null&&(C=setInterval((()=>{(function(){if(e.trigger(h.default.WALLCLOCK_TIME_UPDATED,{isDynamic:d,time:new Date}),se()){const Xe=Date.now();(isNaN(M)||Xe>M+z.get().streaming.liveUpdateTimeThresholdInMilliseconds)&&(J.addDVRMetric(),oe()?(function(){const qt=Date.now();(!b||qt>b+500)&&(b=qt,Un())})():Ae(),M=Xe)}})()}),z.get().streaming.wallclockTimeUpdateInterval))}function we(){clearInterval(C),C=null}function Ve(Xe){const qt=Xe.currentRepresentation,Xt=qt?qt.mediaInfo.streamInfo:null;Xt!==null&&v.id===Xt.id&&(v=Xt)}function $e(){e.trigger(h.default.CAN_PLAY)}function Je(){e.trigger(h.default.CAN_PLAY_THROUGH)}function gt(Xe){Xe.streamId===J.getActiveStreamInfo().id&&(U=Xe.state===o.BUFFER_EMPTY,z.get().streaming.buffer.setStallState&&y.setStallState(Xe.mediaType,Xe.state===o.BUFFER_EMPTY))}function Et(){u.info("Native video element event: play"),Ae(),ge(),e.trigger(h.default.PLAYBACK_STARTED,{startTime:ue()})}function Jt(){u.info("Native video element event: waiting"),e.trigger(h.default.PLAYBACK_WAITING,{playingTime:ue()})}function fn(){u.info("Native video element event: playing"),R=!1,e.trigger(h.default.PLAYBACK_PLAYING,{playingTime:ue()})}function bn(){u.info("Native video element event: pause"),e.trigger(h.default.PLAYBACK_PAUSED,{ended:te()})}function kn(){if(R)return;let Xe=ue();isNaN(K)||K===Xe||(Xe=K),K=NaN,u.info("Seeking to: "+Xe),ge(),e.trigger(h.default.PLAYBACK_SEEKING,{seekTime:Xe,streamId:v.id})}function Kn(){u.info("Native video element event: seeked"),R=!1,e.trigger(h.default.PLAYBACK_SEEKED,{streamId:v.id})}function Un(){v&&e.trigger(h.default.PLAYBACK_TIME_UPDATED,{timeToEnd:k(),time:ue(),streamId:v.id})}function Bn(){e.trigger(h.default.PLAYBACK_PROGRESS,{streamId:v.id})}function xn(){const Xe=Ee();u.info("Native video element event: ratechange: ",Xe),e.trigger(h.default.PLAYBACK_RATE_CHANGED,{playbackRate:Xe})}function rt(){u.info("Native video element event: loadedmetadata"),e.trigger(h.default.PLAYBACK_METADATA_LOADED),ge()}function Mt(){u.info("Native video element event: loadeddata"),e.trigger(h.default.PLAYBACK_LOADED_DATA)}function St(){u.info("Native video element event: ended"),re(),we();const Xe=J?J.getActiveStreamInfo():null;Xe&&e.trigger(h.default.PLAYBACK_ENDED,{isLast:Xe.isLast})}function Gt(){e.trigger(h.default.PLAYBACK_VOLUME_CHANGED)}function cn(Xe){if(C&&Xe.isLast){u.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");const qt=Xe.seekTime?Xe.seekTime:Q();y.setCurrentTime(qt),re(),we()}}function Nn(Xe){const qt=Xe.target||Xe.srcElement;e.trigger(h.default.PLAYBACK_ERROR,{error:qt.error})}function lt(){d=!1}function Lt(Xe){e.trigger(h.default.PLAYBACK_STALLED,{e:Xe})}function jt(Xe){var qt;(qt=Xe.mediaInfo)&&qt.supplementalProperties&&qt.supplementalProperties.find((Xt=>Xt.schemeIdUri===r.default.SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME))&&(u.debug("Low Latency critical SupplementalProperty set: Enabling low Latency"),N=!0)}function xe(Xe){const qt=J.getActiveStreamInfo();Xe&&qt&&Xe.currentRepresentation&&Xe.streamId&&Xe.streamId===qt.id&&Xe.mediaType&&(Xe.mediaType===r.default.VIDEO||Xe.mediaType===r.default.AUDIO)&&(N=Xe.currentRepresentation.availabilityTimeComplete===!1||Xe.currentRepresentation.k>1,N&&!T&&(T=!0))}function Ze(){O=!0}function bt(){O=!1;const Xe=J?J.getActiveStreamInfo():null;Xe&&v&&Xe.id===v.id&&(v=Xe)}return D={computeAndSetLiveDelay:function(Xe,qt){let Xt,sn,wn;const Te=!isNaN(Xe)&&isFinite(Xe)?Xe:NaN;let nt=t.getSuggestedPresentationDelay();const Kt=q.getServiceDescriptionSettings();return Xt=isNaN(z.get().streaming.delay.liveDelay)?z.get().streaming.delay.liveDelayFragmentCount===null||isNaN(z.get().streaming.delay.liveDelayFragmentCount)||isNaN(Te)?Kt&&!isNaN(Kt.liveDelay)&&Kt.liveDelay>0?Kt.liveDelay:z.get().streaming.delay.useSuggestedPresentationDelay===!0&&nt!==null&&!isNaN(nt)&&nt>0?nt:isNaN(Te)?qt&&!isNaN(qt.minBufferTime)?4*qt.minBufferTime:4*v.manifestInfo.minBufferTime:4*Te:Te*z.get().streaming.delay.liveDelayFragmentCount:z.get().streaming.delay.liveDelay,wn=t.getAvailabilityStartTime(),wn!==null&&(l=wn),sn=qt&&qt.dvrWindowSize>0?Math.min(Xt,qt.dvrWindowSize):Xt,m=sn,L=sn,sn},getAvailabilityStartTime:function(){return l},getBufferLevel:function(Xe=null){let qt=null;return J.getActiveStreamProcessors().forEach((Xt=>{if(!Xe||Xe.length===0||Xe.indexOf(Xt.getType())===-1){const sn=Xt.getBufferLevel();qt=qt===null?sn:Math.min(qt,sn)}})),qt},getCurrentLiveLatency:function(){if(!d||isNaN(l))return NaN;let Xe=ue();if(isNaN(Xe)||Xe===0)return 0;const qt=new Date().getTime()+1e3*A.getClientTimeOffset();return Math.max(((qt-l-1e3*Xe)/1e3).toFixed(3),0)},getEnded:te,getInitialCatchupModeActivated:function(){return T},getIsDynamic:se,getIsManifestUpdateInProgress:function(){return O},getLiveDelay:function(){return m},getLowLatencyModeEnabled:function(){return N},getOriginalLiveDelay:function(){return L},getPlaybackRate:Ee,getPlaybackStalled:function(){return U},getPlayedRanges:function(){return v&&y?y.getPlayedRanges():null},getStreamController:function(){return J},getStreamEndTime:Q,getTime:ue,getTimeToStreamEnd:k,initialize:function(Xe,qt){v=Xe,qt!==!0&&(y.addEventListener("canplay",$e),y.addEventListener("canplaythrough",Je),y.addEventListener("ended",St),y.addEventListener("error",Nn),y.addEventListener("loadeddata",Mt),y.addEventListener("loadedmetadata",rt),y.addEventListener("pause",bn),y.addEventListener("play",Et),y.addEventListener("playing",fn),y.addEventListener("progress",Bn),y.addEventListener("ratechange",xn),y.addEventListener("seeked",Kn),y.addEventListener("seeking",kn),y.addEventListener("stalled",Lt),y.addEventListener("timeupdate",Un),y.addEventListener("volumechange",Gt),y.addEventListener("waiting",Jt),d=v.manifestInfo.isDynamic,U=!1,R=!1,e.on(h.default.DATA_UPDATE_COMPLETED,Ve,D),e.on(h.default.MANIFEST_UPDATED,Ze,D),e.on(h.default.STREAMS_COMPOSED,bt,D),e.on(H.default.PLAYBACK_ENDED,cn,D,{priority:g.default.EVENT_PRIORITY_HIGH}),e.on(H.default.STREAM_INITIALIZING,jt,D),e.on(H.default.REPRESENTATION_SWITCH,xe,D),e.on(H.default.BUFFER_LEVEL_STATE_CHANGED,gt,D),e.on(H.default.DYNAMIC_TO_STATIC,lt,D),x&&(x=!1,W()))},isPaused:oe,isProgressing:function(Xe=500){return new Promise((qt=>{let Xt=-1,sn=null;const wn=nt=>{clearTimeout(sn),sn=null,e.off(H.default.PLAYBACK_TIME_UPDATED,Te,D),qt(nt)},Te=nt=>{Xt<0?Xt=nt.time:nt.time>Xt+.1&&wn(!0)};sn=setTimeout((()=>{wn(!1)}),Xe),e.on(H.default.PLAYBACK_TIME_UPDATED,Te,D)}))},isSeeking:ne,isStalled:pe,pause:re,play:W,reset:ee,seek:Ce,seekToCurrentLive:function(Xe=!1,qt=!1,Xt=!1){const sn=Me();sn!==0&&Ce(sn-m,Xe,qt,Xt)},seekToOriginalLive:function(Xe=!1,qt=!1,Xt=!1){const sn=Me();sn!==0&&(m=L,Ce(sn-m,Xe,qt,Xt))},setConfig:function(Xe){Xe&&(Xe.streamController&&(J=Xe.streamController),Xe.serviceDescriptionController&&(q=Xe.serviceDescriptionController),Xe.dashMetrics&&(c=Xe.dashMetrics),Xe.adapter&&(t=Xe.adapter),Xe.videoModel&&(y=Xe.videoModel),Xe.timelineConverter&&(A=Xe.timelineConverter),Xe.settings&&(z=Xe.settings))},updateCurrentTime:Ae},u=(0,p.default)(n).getInstance().getLogger(D),ee(),D}fa.__dashjs_factory_name="PlaybackController";var _o=F.default.getSingletonFactory(fa),yo=P(1721),da=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(n){for(let e in n)n.hasOwnProperty(e)&&this.hasOwnProperty(e)&&(this[e]=n[e])}},wi=class extends da{constructor(){super()}};function ga(){const n=this.context;let e,t,l,c,T,D,R,d,b,M,m,u;function N(U,K,q,z){let J=null;const v=U?u.resolve(U.path):null,A=z||{init:!0,url:v?v.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:K,representation:U};t.debug("Start searching for initialization.");const y=x(A);R.load({request:y,success:function(C){if(A.bytesLoaded=A.range.end,J=c.findInitRange(C),!J)return A.range.end=A.bytesLoaded+A.bytesToLoad,N(U,K,q,A);U.range=J,q(U)},error:function(){q(U)}}),t.debug("Perform init search: "+A.url)}function O(U,K,q,z,J,v){if(q&&(q.start===void 0||q.end===void 0)){const W=q?q.toString().split("-"):null;q=W?{start:parseFloat(W[0]),end:parseFloat(W[1])}:null}J=J||L;let A=null,y=null;const C=!!q,ee=U?u.resolve(U.path):null,k={init:!1,url:ee?ee.url:void 0,range:C?q:{start:0,end:1500},searching:!C,bytesLoaded:v?v.bytesLoaded:0,bytesToLoad:1500,mediaType:K,representation:U},Q=x(k);R.load({request:Q,success:function(W){const re=k.bytesToLoad,Ce=W.byteLength;if(k.bytesLoaded=k.range.end-k.range.start,A=c.parse(W),y=A.getBox("sidx"),y&&y.isComplete){const Me=y.references;let ve,ue;if(Me!=null&&Me.length>0&&(ve=Me[0].reference_type===1),ve){let oe,ne,pe,Ee,te;t.debug("Initiate multiple SIDX load."),k.range.end=k.range.start+y.size;let se=[],Ae=0,ge=(y.offset||k.range.start)+y.size;const we=function(Ve){Ve?(se=se.concat(Ve),Ae++,Ae>=ne&&(se.sort((function($e,Je){return $e.startTime-Je.startTime<0?-1:0})),J(se,U,z))):J(null,U,z)};for(oe=0,ne=Me.length;oe<ne;oe++)pe=ge,Ee=ge+Me[oe].referenced_size-1,ge+=Me[oe].referenced_size,te={start:pe,end:Ee},O(U,K,te,z,we,k)}else t.debug("Parsing segments from SIDX. representation "+K+" - id: "+U.id+" for range : "+k.range.start+" - "+k.range.end),ue=(function(oe,ne){const pe=oe.references,Ee=pe.length,te=oe.timescale;let se=oe.earliest_presentation_time,Ae=ne.range.start+oe.offset+oe.first_offset+oe.size;const ge=[];let we,Ve,$e,Je;for(let gt=0;gt<Ee;gt++)$e=pe[gt].subsegment_duration,Je=pe[gt].referenced_size,we=new wi,we.duration=$e,we.startTime=se,we.timescale=te,Ve=Ae+Je-1,we.mediaRange=Ae+"-"+Ve,ge.push(we),se+=$e,Ae+=Je;return ge})(y,k),J(ue,U,z)}else{if(y)k.range.start=y.offset||k.range.start,k.range.end=k.range.start+(y.size||re);else{if(Ce<k.bytesLoaded)return void J(null,U,z);{const Me=A.getLastBox();Me&&Me.size?(k.range.start=Me.offset+Me.size,k.range.end=k.range.start+re):k.range.end+=re}}O(U,K,k.range,z,null,k)}},error:function(){J(null,U,z)}}),t.debug(`Perform SIDX load for type ${K} : ${k.url} with range ${k.range.start} - ${k.range.end}`)}function L(U,K,q){q({segments:U,representation:K,error:U?void 0:new un.default(d.SEGMENT_BASE_LOADER_ERROR_CODE,d.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}function x(U){if(!U.url)return;const K=new B.default;return K.setInfo(U),K}return e={setConfig:function(U){U.baseURLController&&(u=U.baseURLController),U.dashMetrics&&(T=U.dashMetrics),U.mediaPlayerModel&&(D=U.mediaPlayerModel),U.errHandler&&(l=U.errHandler),U.boxParser&&(c=U.boxParser),U.debug&&(t=U.debug.getLogger(e)),U.errors&&(d=U.errors),U.urlUtils&&(m=U.urlUtils),U.constants&&(b=U.constants),U.dashConstants&&(M=U.dashConstants)},initialize:function(){R=(0,xt.default)(n).create({errHandler:l,dashMetrics:T,mediaPlayerModel:D,boxParser:c,errors:d,urlUtils:m,constants:b,dashConstants:M})},loadInitialization:function(U,K){return new Promise((q=>{N(U,K,q)}))},loadSegments:function(U,K,q){return new Promise((z=>{O(U,K,q,z)}))},reset:function(){R&&(R.abort(),R=null)}},e}ga.__dashjs_factory_name="SegmentBaseLoader";var So=F.default.getSingletonFactory(ga);function ha(n){let e;n=n||{};let t=new DataView(n.data),l=0;function c(D,R){let d,b,M=!0,m=0;if(R===void 0&&(R=!1),D.tag>16777215?(t.getUint32(l)!==D.tag&&(M=!1),m=4):D.tag>65535?(d=t.getUint16(l),b=t.getUint8(l+2),256*d+b!==D.tag&&(M=!1),m=3):D.tag>255?(t.getUint16(l)!==D.tag&&(M=!1),m=2):(t.getUint8(l)!==D.tag&&(M=!1),m=1),!M&&D.required&&!R)throw new Error("required tag not found");return M&&(l+=m),M}function T(D){let R=1,d=128,b=-1,M=0,m=t.getUint8(l),u=0;for(u=0;u<8;u+=1){if((m&d)===d){M=D===void 0?m&~d:m,b=u;break}d>>=1}for(u=0;u<b;u+=1,R+=1)M=M<<8|255&t.getUint8(l+R);return l+=R,M}return e={getPos:function(){return l},setPos:function(D){l=D},consumeTag:c,consumeTagAndSize:function(D,R){let d=c(D,R);return d&&T(),d},parseTag:function(D){let R;return c(D),R=T(),e[D.parse](R)},skipOverElement:function(D,R){let d,b=c(D,R);return b&&(d=T(),l+=d),b},getMatroskaCodedNum:T,getMatroskaFloat:function(D){let R;switch(D){case 4:R=t.getFloat32(l),l+=4;break;case 8:R=t.getFloat64(l),l+=8}return R},getMatroskaUint:function(D){if(D>4)return(function(d){const b=Math.floor(Number.MAX_SAFE_INTEGER/256);let M=0;for(let m=0;m<d;m+=1){if(M>b)throw new Error("Value exceeds safe integer limit");M*=256;const u=t.getUint8(l+m);if(M>Number.MAX_SAFE_INTEGER-u)throw new Error("Value exceeds safe integer limit");M+=u}return l+=d,M})(D);let R=0;for(let d=0;d<D;d+=1)R<<=8,R|=255&t.getUint8(l+d);return l+=D,R>>>0},moreData:function(){return l<t.byteLength}},e}ha.__dashjs_factory_name="EBMLParser";var pa=F.default.getClassFactory(ha);function ma(){const n=this.context;let e,t,l,c,T,D,R,d,b;function M(m){const u=new B.default;return u.setInfo(m),u}return e={setConfig:function(m){if(!(m.baseURLController&&m.dashMetrics&&m.mediaPlayerModel&&m.errHandler))throw new Error(r.default.MISSING_CONFIG_ERROR);b=m.baseURLController,T=m.dashMetrics,D=m.mediaPlayerModel,c=m.errHandler,d=m.errors,t=m.debug.getLogger(e)},initialize:function(){R=(0,xt.default)(n).create({errHandler:c,dashMetrics:T,mediaPlayerModel:D,errors:d})},loadInitialization:function(m,u){return new Promise((N=>{let O=null,L=m?b.resolve(m.path):null,x=m?m.range.split("-"):null,U={range:{start:x?parseFloat(x[0]):null,end:x?parseFloat(x[1]):null},request:O,url:L?L.url:void 0,init:!0,mediaType:u};t.info("Start loading initialization."),O=M(U),R.load({request:O,success:function(){N(m)},error:function(){N(m)}}),t.debug("Perform init load: "+U.url)}))},loadSegments:function(m,u,N){return new Promise((O=>{let L=null,x=m?b.resolve(m.path):null,U=x?x.url:void 0;L=M({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:L,url:U,init:!1,mediaType:u,representation:m}),t.debug("Parsing ebml header"),R.load({request:L,success:function(K){(function(q,z,J,v){if(!q||q.byteLength===0)return void v(null);let A,y,C,ee,k=pa(n).create({data:q}),Q=J?J.split("-"):null,W=null,re={url:z,range:{start:Q?parseFloat(Q[0]):null,end:Q?parseFloat(Q[1]):null},request:W};for(t.debug("Parse EBML header: "+re.url),k.skipOverElement(l.EBML),k.consumeTag(l.Segment),C=k.getMatroskaCodedNum(),C+=k.getPos(),ee=k.getPos();k.moreData()&&!k.consumeTagAndSize(l.Segment.Info,!0);)if(!(k.skipOverElement(l.Segment.SeekHead,!0)||k.skipOverElement(l.Segment.Tracks,!0)||k.skipOverElement(l.Segment.Cues,!0)||k.skipOverElement(l.Void,!0)))throw new Error("no valid top level element found");for(;A===void 0;){let Ce=k.getMatroskaCodedNum(!0),Me=k.getMatroskaCodedNum();Ce===l.Segment.Info.Duration.tag?A=k[l.Segment.Info.Duration.parse](Me):k.setPos(k.getPos()+Me)}W=M(re),R.load({request:W,success:function(Ce){y=(function(Me,ve,ue,oe){let ne,pe,Ee,te,se,Ae,ge,we;for(pe=(function(Ve){let $e,Je,gt=[],Et=pa(n).create({data:Ve});for(Et.consumeTagAndSize(l.Segment.Cues);Et.moreData()&&Et.consumeTagAndSize(l.Segment.Cues.CuePoint,!0);){for($e={},$e.CueTime=Et.parseTag(l.Segment.Cues.CuePoint.CueTime),$e.CueTracks=[];Et.moreData()&&Et.consumeTag(l.Segment.Cues.CuePoint.CueTrackPositions,!0);){const Jt=Et.getMatroskaCodedNum(),fn=Et.getPos();if(Je={},Je.Track=Et.parseTag(l.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),Je.Track===0)throw new Error("Cue track cannot be 0");Je.ClusterPosition=Et.parseTag(l.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),$e.CueTracks.push(Je),Et.setPos(fn+Jt)}if($e.CueTracks.length===0)throw new Error("Mandatory cuetrack not found");gt.push($e)}if(gt.length===0)throw new Error("mandatory cuepoint not found");return gt})(Me),Ee=[],se=0,Ae=pe.length;se<Ae;se+=1)te=new wi,ne=0,ne=se<pe.length-1?pe[se+1].CueTime-pe[se].CueTime:oe-pe[se].CueTime,te.duration=ne,te.startTime=pe[se].CueTime,te.timescale=1e3,ge=pe[se].CueTracks[0].ClusterPosition+ve,we=se<pe.length-1?pe[se+1].CueTracks[0].ClusterPosition+ve-1:ue-1,te.mediaRange=ge+"-"+we,Ee.push(te);return t.debug("Parsed cues: "+Ee.length+" cues."),Ee})(Ce,ee,C,A),v(y)},error:function(){t.error("Download Error: Cues "+re.url),v(null)}}),t.debug("Perform cues load: "+re.url+" bytes="+re.range.start+"-"+re.range.end)})(K,U,N,(function(q){O({segments:q,representation:m,error:q?void 0:new un.default(d.SEGMENT_BASE_LOADER_ERROR_CODE,d.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}))},error:function(){O({representation:m,error:new un.default(d.SEGMENT_BASE_LOADER_ERROR_CODE,d.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}})}))},reset:function(){R&&(R.abort(),R=null)}},l={EBML:{tag:440786851,required:!0},Segment:{tag:408125543,required:!0,SeekHead:{tag:290298740,required:!0},Info:{tag:357149030,required:!0,TimecodeScale:{tag:2807729,required:!0,parse:"getMatroskaUint"},Duration:{tag:17545,required:!0,parse:"getMatroskaFloat"}},Tracks:{tag:374648427,required:!0},Cues:{tag:475249515,required:!0,CuePoint:{tag:187,required:!0,CueTime:{tag:179,required:!0,parse:"getMatroskaUint"},CueTrackPositions:{tag:183,required:!0,CueTrack:{tag:247,required:!0,parse:"getMatroskaUint"},CueClusterPosition:{tag:241,required:!0,parse:"getMatroskaUint"}}}}},Void:{tag:236,required:!0}},e}ma.__dashjs_factory_name="WebmSegmentBaseLoader";var Io=F.default.getSingletonFactory(ma);function Ea(n){n=n||{};const e=this.context,t=n.eventBus,l=n.events,c=n.dashMetrics,T=n.mediaPlayerModel,D=n.errHandler,R=n.baseURLController,d=n.debug,b=n.boxParser,M=n.errors;let m,u,N;function O(L){return(L?L.split("/")[1]:"").toLowerCase()==="webm"}return m={initialize:function(){u.initialize(),N.initialize()},getSegmentBaseInitSegment:function(L){return O(L.representation.mimeType)?N.loadInitialization(L.representation,L.mediaType):u.loadInitialization(L.representation,L.mediaType)},getSegmentList:function(L){return O(L.mimeType)?N.loadSegments(L.representation,L.mediaType,L.representation?L.representation.indexRange:null):u.loadSegments(L.representation,L.mediaType,L.representation?L.representation.indexRange:null)},reset:function(){u.reset(),N.reset()}},u=So(e).getInstance(),N=Io(e).getInstance(),u.setConfig({baseURLController:R,dashMetrics:c,mediaPlayerModel:T,errHandler:D,eventBus:t,events:l,errors:M,debug:d,boxParser:b}),N.setConfig({baseURLController:R,dashMetrics:c,mediaPlayerModel:T,errHandler:D,eventBus:t,events:l,errors:M,debug:d}),m}Ea.__dashjs_factory_name="SegmentBaseController";var Ro=F.default.getSingletonFactory(Ea);const Ao=[r.default.SERVICE_DESCRIPTION_DVB_LL_SCHEME],Ta="video",_a="audio";function ya(){const n=this.context;let e,t,l,c,T;function D(){t={liveDelay:NaN,liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN}},minBitrate:{},maxBitrate:{},initialBitrate:{},contentSteering:null,clientDataReporting:null},l=[]}function R(d,b,M){try{t[d][b]=M/1e3}catch(m){c.error(m)}}return e={applyServiceDescription:function(d){if(!d||!d.serviceDescriptions)return;const b=d.serviceDescriptions.filter((u=>Ao.includes(u.schemeIdUri))),M=d.serviceDescriptions.filter((u=>u.schemeIdUri==null));let m=b.length>0?b[b.length-1]:M[M.length-1];m&&(m.latency&&m.latency.target>0&&(function(u){let N;if(u.schemeIdUri,r.default.SERVICE_DESCRIPTION_DVB_LL_SCHEME,N=(function(O){return{liveDelay:O.latency.target/1e3,maxDrift:!isNaN(O.latency.max)&&O.latency.max>O.latency.target?(O.latency.max-O.latency.target+500)/1e3:NaN,referenceId:O.latency.referenceId||NaN}})(u),l.length>0){let{to:O,id:L}=(function(x){let U,K=0,q=l.filter((z=>z.id===x.referenceId));return q.length===0?(K=l.length>0?l[0].to:0,U=l[0].id||NaN):(K=q[0].to||0,U=q[0].id||NaN),{to:K,id:U}})(N);t.liveDelay=N.liveDelay-O,t.liveCatchup.maxDrift=N.maxDrift,c.debug(`
Found latency properties coming from service description. Applied time offset of ${O} from ProducerReferenceTime element with id ${L}.
Live Delay: ${N.liveDelay-O}, Live catchup max drift: ${N.maxDrift}
`)}else t.liveDelay=N.liveDelay,t.liveCatchup.maxDrift=N.maxDrift,c.debug(`Found latency properties coming from service description: Live Delay: ${N.liveDelay}, Live catchup max drift: ${N.maxDrift}`)})(m),m.playbackRate&&(function(u){const N=u.playbackRate.min?Math.round(1e3*(u.playbackRate.min-1))/1e3:NaN,O=u.playbackRate.max?Math.round(1e3*(u.playbackRate.max-1))/1e3:NaN;t.liveCatchup.playbackRate.min=N,t.liveCatchup.playbackRate.max=O,c.debug(`Found latency properties coming from service description: Live catchup min playback rate: ${N}`),c.debug(`Found latency properties coming from service description: Live catchup max playback rate: ${O}`)})(m),m.operatingQuality,m.operatingBandwidth&&(function(u){if(!u||!u.operatingBandwidth||!u.operatingBandwidth.mediaType||u.operatingBandwidth.mediaType==="all")return;const N={};N.minBandwidth=u.operatingBandwidth.min,N.maxBandwidth=u.operatingBandwidth.max,N.targetBandwidth=u.operatingBandwidth.target;const O=[];u.operatingBandwidth.mediaType===Ta||u.operatingBandwidth.mediaType===_a?O.push(u.operatingBandwidth.mediaType):u.operatingBandwidth.mediaType==="any"&&(O.push(_a),O.push(Ta)),O.forEach((L=>{isNaN(N.minBandwidth)||R("minBitrate",L,N.minBandwidth),isNaN(N.maxBandwidth)||R("maxBitrate",L,N.maxBandwidth),isNaN(N.targetBandwidth)||R("initialBitrate",L,N.targetBandwidth)}))})(m),m.contentSteering&&(function(u){t.contentSteering=u.contentSteering})(m),m.clientDataReporting&&(function(u){t.clientDataReporting=u.clientDataReporting})(m))},calculateProducerReferenceTimeOffsets:function(d){try{let b=[];if(d&&d.length>0){const M=[r.default.VIDEO,r.default.AUDIO,r.default.TEXT],m=T.getAvailabilityStartTime()/1e3;d.forEach((u=>{const N=M.reduce(((O,L)=>O.concat(T.getAllMediaInfoForType(u,L))),[]).reduce(((O,L)=>(T.getProducerReferenceTimes(u,L).forEach((x=>{const U=T.getVoRepresentations(L);if(U&&U.length>0&&U[0].adaptation&&U[0].segmentInfoType===fe.default.SEGMENT_TEMPLATE){const K=U[0],q=new Date(x[fe.default.WALL_CLOCK_TIME]).getTime()/1e3-(x[fe.default.PRESENTATION_TIME]/K[fe.default.TIMESCALE]-K[fe.default.PRESENTATION_TIME_OFFSET]+u.start),z=m-q;O.push({id:x[fe.default.ID],to:z})}})),O)),[]);b=b.concat(N)}))}l=b}catch(b){c.error(b),l=[]}},getProducerReferenceTimeOffsets:function(){return l},getServiceDescriptionSettings:function(){return t},reset:function(){D()},setConfig:function(d){d&&d.adapter&&(T=d.adapter)}},c=(0,p.default)(n).getInstance().getLogger(e),D(),e}ya.__dashjs_factory_name="ServiceDescriptionController";var No=F.default.getSingletonFactory(ya);class Co{constructor(e){this._ranges=[];for(const t of e){const l=this._ranges,c={start:t.start,end:t.end},T=l.length?l[l.length-1]:null;!T||c.start>T.end?l.push(c):T.end=c.end}}get length(){return this._ranges.length}start(e){return this._ranges[e].start}end(e){return this._ranges[e].end}}var Sa=class{constructor(n,e){this.eventBus=e,this.mimeType=n,this.updating=!1,this.chunks=[],this.appendWindowStart=0,this.appendWindowEnd=1/0,this.timestampOffset=0,this.mode="segments"}appendBuffer(n,e,t){if(this.updating)throw new Error("SourceBuffer is currently updating");this.updating=!0,this.eventBus.trigger("externalSourceBufferUpdateStart",{mimeType:this.mimeType,request:"appendBuffer",data:n,start:e,end:t}),Number.isNaN(e)||(this.chunks.push({data:n,start:e,end:t}),this.chunks.sort(((l,c)=>l.start-c.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(n,e){if(this.updating)throw new Error("SourceBuffer is currently updating");this.updating=!0,this.eventBus.trigger("externalSourceBufferUpdateStart",{mimeType:this.mimeType,request:"remove",start:n,end:e}),this.chunks=this.chunks.filter((t=>t.end<=n||t.start>=e)),setTimeout((()=>{this.updating=!1,this.eventBus.trigger("externalSourceBufferUpdating",{mimeType:this.mimeType}),this.eventBus.trigger("externalSourceBufferUpdateEnd",{mimeType:this.mimeType})}),10)}get buffered(){return new Co(this.chunks)}},bo=class{constructor(n){this.eventBus=n,this.reset()}get duration(){return this._duration}set duration(n){if(this._readyState!=="open")throw new Error("ExternalMediaSource is not open");this._duration=n}get readyState(){return this._readyState}addSourceBuffer(n){if(this._readyState!=="open")throw new Error("ExternalMediaSource is not open");const e=new Sa(n,this.eventBus);return this.sourceBuffers.set(e,n),e}removeSourceBuffer(n){if(!this.sourceBuffers.has(n))throw new Error("ExternalSourceBuffer not found");this.sourceBuffers.delete(n)}open(){this._readyState="open",this.eventBus.trigger("externalMediaSourceOpen",{})}endOfStream(){if(this._readyState!=="open")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"}},Do=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 vo extends B.default{constructor(e){super(e),this.checkForExistenceOnly=!0}}var Mo=vo;function Ia(n){n=n||{};const e=this.context,t=n.eventBus,l=n.events,c=n.urlUtils,T=n.errors,D=n.streamId;let R,d;return R={abort:function(){d&&d.abort()},checkForExistence:function(b){const M=function(m){t.trigger(l.CHECK_FOR_EXISTENCE_COMPLETED,{request:b,exists:m})};if(b){let m=new Mo(b.url);d.load({request:m,success:function(){M(!0)},error:function(){M(!1)}})}else M(!1)},load:function(b){const M=function(m,u){t.trigger(l.LOADING_COMPLETED,{request:b,response:m||null,error:u||null,sender:R})};b?d.load({request:b,progress:function(m){t.trigger(l.LOADING_PROGRESS,{request:b,stream:m.stream,streamId:D}),m.data&&t.trigger(l.LOADING_DATA_PROGRESS,{request:b,response:m.data||null,error:null,sender:R})},success:function(m){M(m)},error:function(m,u,N){M(void 0,new un.default(T.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,N,u))},abort:function(m){m&&t.trigger(l.LOADING_ABANDONED,{mediaType:m.mediaType,request:m,sender:R})}}):M(void 0,new un.default(T.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,T.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},reset:function(){d&&(d.abort(),d.reset(),d=null)},resetInitialSettings:function(){d&&d.resetInitialSettings()}},d=(0,xt.default)(e).create({errHandler:n.errHandler,errors:T,dashMetrics:n.dashMetrics,mediaPlayerModel:n.mediaPlayerModel,urlUtils:c,constants:r.default,boxParser:n.boxParser,dashConstants:n.dashConstants}),R}Ia.__dashjs_factory_name="FragmentLoader";var wo=F.default.getClassFactory(Ia);function Ra(n){n=n||{};const e=this.context,t=(0,g.default)(e).getInstance(),l=n.errHandler,c=n.mediaPlayerModel,T=n.dashMetrics,D=(0,p.default)(e).getInstance(),R=n.streamInfo;let d,b,M;function m(){return R.id}function u(){for(let O in M)M[O].reset();M={}}function N(O){if(!O.sender)return;const L=O.request,x=O.response,U=L.isInitializationRequest(),K=L.representation.mediaInfo.streamInfo;if(O.error&&(L.mediaType===r.default.AUDIO||L.mediaType===r.default.VIDEO||L.mediaType===r.default.TEXT&&L.representation.mediaInfo.isFragmented)&&t.trigger(h.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD,{entry:O.request.serviceLocation}),!x||!K)return void b.warn("No "+L.mediaType+" bytes to push or stream is inactive.");const q=(function(z,J,v,A){const y=new Do;return y.streamId=v,y.segmentType=J.type,y.start=J.startTime,y.duration=J.duration,y.end=y.start+y.duration,y.bytes=z,y.index=J.index,y.representation=J.representation,y.endFragment=A,y})(x,L,R.id,O.type!==h.default.FRAGMENT_LOADING_PROGRESS);t.trigger(U?h.default.INIT_FRAGMENT_LOADED:h.default.MEDIA_FRAGMENT_LOADED,{chunk:q,request:L},{streamId:K.id,mediaType:L.mediaType})}return d={getStreamId:m,getModel:function(O){let L=M[O];return L||(L=Ue(e).create({streamInfo:R,type:O,dashMetrics:T,fragmentLoader:wo(e).create({dashMetrics:T,mediaPlayerModel:c,errHandler:l,settings:n.settings,boxParser:n.boxParser,eventBus:t,events:h.default,errors:Pn.default,dashConstants:n.dashConstants,urlUtils:n.urlUtils,streamId:m()}),debug:D,eventBus:t,events:h.default}),M[O]=L),L},reset:function(){t.off(H.default.FRAGMENT_LOADING_COMPLETED,N,this),t.off(H.default.FRAGMENT_LOADING_PROGRESS,N,this),u()}},b=D.getLogger(d),u(),t.on(H.default.FRAGMENT_LOADING_COMPLETED,N,d),t.on(H.default.FRAGMENT_LOADING_PROGRESS,N,d),d}Ra.__dashjs_factory_name="FragmentController";var Po=F.default.getClassFactory(Ra),Lr=class{constructor(n){this.newMediaInfo=n.newMediaInfo,this.previouslySelectedRepresentation=n.previouslySelectedRepresentation,this.newRepresentation=n.newRepresentation}};function Aa(n){const e=this.context,t=(0,E.default)(e).getInstance(),l=n.textController,c=n.eventBus;let T,D,R,d,b,M,m=[],u=[],N=!1,O=n.mediaSource,L=null;function x(k){return k.mimeType+';codecs="'+k.codecs+'"'}function U(k){return d=l.getTextSourceBuffer(k),Promise.resolve()}function K(){if(typeof d.addEventListener=="function")try{d.addEventListener("updateend",y,!1),d.addEventListener("error",C,!1),d.addEventListener("abort",C,!1)}catch{M=setInterval(y,50)}else M=setInterval(y,50)}function q(){try{typeof d.removeEventListener=="function"&&(d.removeEventListener("updateend",y,!1),d.removeEventListener("error",C,!1),d.removeEventListener("abort",C,!1)),clearInterval(M)}catch(k){R.error(k)}}function z(k){return new Promise((Q=>{d&&t.get().streaming.buffer.useAppendWindow?ee((()=>{try{if(!d)return void Q();let W=O.duration,re=0;k&&!isNaN(k.start)&&!isNaN(k.duration)&&isFinite(k.duration)&&(W=k.start+k.duration),k&&!isNaN(k.start)&&(re=k.start),d.appendWindowEnd===W&&d.appendWindowStart===re||(d.appendWindowStart=0,d.appendWindowEnd=W+.01,d.appendWindowStart=Math.max(re-.1,0),R.debug(`Updated append window for ${b.type}. Set start to ${d.appendWindowStart} and end to ${d.appendWindowEnd}`)),Q()}catch{R.warn("Failed to set append window"),Q()}})):Q()}))}function J(k){return new Promise((Q=>{d?ee((()=>{try{d.timestampOffset===k||isNaN(k)||(d.timestampOffset=k,R.debug(`Set MSE timestamp offset to ${k}`)),Q()}catch{Q()}})):Q()}))}function v(){if(!N&&u.length>0){N=!0;const k=u[0];u.splice(0,1);const Q=function(){N=!1,u.length>0&&v.call(this),k&&k.data&&k.data.segmentType&&k.data.segmentType!==Ge.HTTPRequest.INIT_SEGMENT_TYPE&&delete k.data.bytes,k.promise.resolve({chunk:k.data})};try{if(L=k.request,k.data.bytes.byteLength===0)Q.call(this);else{try{R.debug(`Appending ${k.data.segmentType} from period ${k.data.streamId} to buffer. Request URL: ${k.request.url}, Representation: ID: ${k.data.representation.id}, bitrate: ${k.data.representation.bitrateInKbit}`)}catch{}d instanceof Sa?d.appendBuffer(k.data.bytes,k.data.start,k.data.end):d.appendBuffer?d.appendBuffer(k.data.bytes):d.append(k.data.bytes,k.data),ee(Q.bind(this))}}catch(W){R.fatal('SourceBuffer append failed "'+W+'"'),u.length>0?v():N=!1,delete k.data.bytes,k.promise.reject({chunk:k.data,error:new un.default(W.code,W.message)})}}}function A(){m.length>0&&!d.updating&&(m.shift()(),A())}function y(){d&&!d.updating&&A()}function C(k){const Q=k.target||{};(function(W,re){let Ce=re||{};c.trigger(W,Ce,{streamId:b.streamInfo.id,mediaType:D})})(h.default.SOURCE_BUFFER_ERROR,{error:Q,lastRequestAppended:L})}function ee(k){try{m.push(k),d&&!d.updating&&A()}catch(Q){R.error(Q)}}return T={abort:function(){return new Promise((k=>{try{u=[],O.readyState==="open"?ee((()=>{try{d&&d.abort(),k()}catch{k()}})):(d&&d.setTextTrack&&O.readyState==="ended"&&d.abort(),k())}catch{k()}}))},abortBeforeAppend:function(){return new Promise((k=>{try{if(O.readyState!=="open")return void k();ee((()=>{try{if(d&&O.readyState==="open"){const Q=d.appendWindowStart,W=d.appendWindowEnd;d.abort(),d.appendWindowStart=Q,d.appendWindowEnd=W}k()}catch{k()}}))}catch{k()}}))},append:function(k,Q=null){return new Promise(((W,re)=>{k?(u.push({data:k,promise:{resolve:W,reject:re},request:Q}),ee(v.bind(this))):re({chunk:k,error:new un.default(Pn.default.APPEND_ERROR_CODE,Pn.default.APPEND_ERROR_MESSAGE)})}))},changeType:function(k){const Q=x(k);return new Promise(((W,re)=>{ee((()=>{if(d&&d.changeType)try{R.debug(`Changing SourceBuffer codec to ${Q}`),d.changeType(Q),W()}catch(Ce){(function(Me){typeof Me?.name=="string"&&Me.name==="NotSupportedError"?(R.warn(Me),t.update({streaming:{buffer:{useChangeType:!1,resetSourceBuffersForTrackSwitch:!0}}})):R.error(Me)})(Ce),re()}else W()}))}))},getAllBufferRanges:function(){try{return d?.buffered}catch(k){return R.error("getAllBufferRanges exception: "+k.message),null}},getBuffer:function(){return d},getType:function(){return D},initializeForFirstUse:function(k,Q){b=k;const W=k.streamInfo;D=b.type;const re=Q?x(Q):k.codec;try{if(re.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))return U(W);d=O.addSourceBuffer(re),K();const Ce=[];return Ce.push(z(b.streamInfo)),Q&&Q.mseTimeOffset!==void 0&&Ce.push(J(Q.mseTimeOffset)),Promise.all(Ce)}catch(Ce){return b.type===r.default.TEXT&&!b.isFragmented||re.indexOf('codecs="stpp')!==-1||re.indexOf('codecs="vtt')!==-1||re.indexOf("text/vtt")!==-1?U(W):Promise.reject(Ce)}},initializeForStreamSwitch:function(k,Q,W){b=k,D=b.type,(function(re){d=re.getBuffer()})(W),K()},remove:function(k){return new Promise(((Q,W)=>{const re=k.start,Ce=k.end;re>=0&&Ce>re?ee((function(){try{d.remove(re,Ce),ee((function(){Q({from:re,to:Ce,unintended:!1}),k.resolve&&k.resolve()}))}catch(Me){W({from:re,to:Ce,unintended:!1,error:new un.default(Pn.default.REMOVE_ERROR_CODE,Pn.default.REMOVE_ERROR_MESSAGE)}),k.reject&&k.reject(Me)}})):Q()}))},removeEventListeners:q,reset:function(){if(d){try{m=[],q(),N=!1,u=[],d.getClassName&&d.getClassName()==="TextSourceBuffer"||(R.debug("Removing sourcebuffer from media source"),O.removeSourceBuffer(d))}catch{}d=null}L=null},updateAppendWindow:z,updateTimestampOffset:J},R=(0,p.default)(e).getInstance().getLogger(T),T}Aa.__dashjs_factory_name="SourceBufferSink";var Na=F.default.getClassFactory(Aa);function Ca(n){const e=this.context;let t,l,c,T=[],D=[],R=n;return t={getAllBufferRanges:function(){let d=[];for(let M=0;M<D.length;M++){let m=D[M];d.length===0||m.start>d[d.length-1].end?d.push({start:m.start,end:m.end}):d[d.length-1].end=m.end}const b={start:function(M){return d[M].start},end:function(M){return d[M].end}};return Object.defineProperty(b,"length",{get:function(){return d.length}}),b},append:function(d){return d.segmentType!=="InitializationSegment"?(D.push(d),D.sort((function(b,M){return b.start-M.start})),c=null):(T.includes(d)||T.push(d),c=d),l.debug("PreBufferSink appended chunk s: "+d.start+"; e: "+d.end),R&&R({chunk:d}),Promise.resolve()},remove:function(d,b){return D=D.filter((M=>!((isNaN(b)||M.start<b)&&(isNaN(d)||M.end>d)))),Promise.resolve()},abort:function(){return Promise.resolve()},discharge:function(){const d=D;let b=null;for(let M=0;M<d.length;M++)b&&d[M].representation.id==b.representation.id||(b=T.find((m=>m.representation.id===d[M].representation.id)),b&&(d.splice(M,0,b),M++));return c&&(d.push(c),c=null),D=[],T=[],d},reset:function(){D=[],T=[],c=null,R=null},updateTimestampOffset:function(){return Promise.resolve()},waitForUpdateEnd:function(d){d()},getBuffer:function(){return this}},l=(0,p.default)(e).getInstance().getLogger(t),t}Ca.__dashjs_factory_name="PreBufferSink";var Oo=F.default.getClassFactory(Ca);const Pi=.01,ba="BufferController";function Da(n){const e=(n=n||{}).capabilities,t=this.context,l=(0,g.default)(t).getInstance(),c=n.fragmentModel,T=n.playbackController,D=n.representationController,R=n.settings,d=n.streamInfo,b=n.textController,M=n.type;let m,u,N,O,L,x,U,K,q,z,J,v,A,y,C,ee,k,Q,W,re,Ce;function Me(xe,Ze=null){return new Promise(((bt,Xe)=>{x=xe,q&&Ze&&typeof q.discharge=="function"?(z=q,ve(Ze).then((()=>{bt()})).catch((qt=>{Xe(qt)}))):bt()}))}function ve(xe,Ze=new Map,bt){return new Promise(((Xe,qt)=>{Q&&xe?x?(J=!1,(function(Xt,sn,wn){return new Promise((Te=>{q=Na(t).create({mediaSource:x,textController:b,eventBus:l}),(function(nt,Kt,Qe){const Yt=D.getCurrentRepresentation();let pn=null;return M!==r.default.VIDEO&&M!==r.default.AUDIO||(pn=Kt.get(M)),pn?(function(Mn,Ln,Dn,jn){q.initializeForStreamSwitch(Mn,Ln,Dn);const zn=[];return zn.push(q.abortBeforeAppend()),zn.push(rt()),zn.push(se(Ln,jn)),Ln&&Ln.mseTimeOffset!==void 0&&zn.push(xn(Ln)),Promise.allSettled(zn)})(nt,Yt,pn,Qe):(function(Mn,Ln){return q.initializeForFirstUse(Mn,Ln)})(nt,Yt)})(Xt,sn,wn).then((()=>xn(D.getCurrentRepresentation()))).then((()=>{Te(q)})).catch((nt=>{u.warn("Caught error on create SourceBuffer: "+nt),Te(q)}))}))})(xe,Ze,bt).then((Xt=>{Xe(Xt)})).catch((Xt=>{qt(Xt)}))):(J=!0,(function(){return new Promise(((Xt,sn)=>{q=Oo(t).create(Ee.bind(this)),xn(D.getCurrentRepresentation()).then((()=>{Xt(q)})).catch((()=>{sn()}))}))})().then((Xt=>{Xe(Xt)})).catch((Xt=>{qt(Xt)}))):Xe(null)}))}function ue(xe){R.get().streaming.cacheInitSegments&&(u.info("Init fragment finished loading saving to",M+"'s init cache"),Q.save(xe.chunk)),u.debug(`Appending init fragment for type ${M}, representationId ${xe.chunk.representation.id} and bandwidth ${xe.chunk.representation.bandwidth}`),ne(xe.chunk)}function oe(xe){ne(xe.chunk,xe.request)}function ne(xe,Ze=null){q&&(q.append(xe,Ze).then((bt=>{Ee(bt)})).catch((bt=>{Ee(bt)})),xe.representation.mediaInfo.type===r.default.VIDEO&&Lt(h.default.VIDEO_CHUNK_RECEIVED,{chunk:xe}))}function pe(xe){if(xe&&xe.length>0)for(let Ze=0,bt=xe.length;Ze<bt;Ze++)u.debug("Buffered range: "+xe.start(Ze)+" - "+xe.end(Ze)+", currentTime = ",T.getTime())}function Ee(xe){if(xe.error)return void(function(Xe){Xe.error.code===22&&(function(){if(k=!0,L=.8*cn(),u.warn("Quota exceeded, Critical Buffer: "+L),L>0){const qt=Math.max(.2*L,1),Xt=L-qt,sn=Math.min(R.get().streaming.buffer.bufferTimeAtTopQuality,.9*Xt),wn=Math.min(R.get().streaming.buffer.bufferTimeAtTopQualityLongForm,.9*Xt),Te={streaming:{buffer:{bufferToKeep:parseFloat(qt.toFixed(5)),bufferTimeAtTopQuality:parseFloat(sn.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(wn.toFixed(5))}}};R.update(Te)}})(),Xe.error.code!==22&&lt()||(u.warn("Clearing playback buffer to overcome quota exceed situation"),Lt(h.default.QUOTA_EXCEEDED,{criticalBufferLevel:L,quotaExceededTime:Xe.chunk.start}),Kn(kn()))})(xe);if(!q||(gt(),k=!1,y=xe.chunk,!y||!y.endFragment))return;y&&!isNaN(y.index)&&(U=Math.max(y.index,U),Et());const Ze=q.getAllBufferRanges();y.segmentType===Ge.HTTPRequest.MEDIA_SEGMENT_TYPE&&(pe(Ze),we(),(function(){if(isNaN(Ce)||J)return;if(M!==r.default.AUDIO&&M!==r.default.VIDEO)return void(Ce=NaN);const Xe=T.getTime(),qt=Je(Xe,0),Xt=Je(Ce,0);if(qt&&Xt&&qt.start===Xt.start)return void(Ce=NaN);const sn=D.getCurrentRepresentation().segmentDuration,wn=Je(Ce,sn);wn&&(R.get().streaming.buffer.enableSeekDecorrelationFix&&Math.abs(Xe-Ce)>sn?Ce<=wn.end&&T.seek(Math.max(Ce,wn.start),!1,!0):Xe<wn.start&&T.seek(wn.start,!1,!0))})());let bt=!1;v&&(v.indexOf(y)>0&&(bt=!0),v=null),y&&!bt&&Lt(h.default.BYTES_APPENDED_END_FRAGMENT,{startTime:y.start,index:y.index,bufferedRanges:Ze,segmentType:y.segmentType,mediaType:M,representationId:y.representation.id})}function te(xe,Ze){const bt=[];return bt.push(xn(xe)),bt.push(q?q.abort():Promise.resolve()),bt.push(se(xe,Ze)),Promise.allSettled(bt)}function se(xe,Ze){if(!xe||!Ze)return u.warn("BufferController._changeCodec() is missing the information about the Representations. Doing nothing"),Promise.resolve();if(xe&&Ze&&xe.mimeType===Ze.mimeType&&xe.codecFamily===Ze.codecFamily)return u.debug(`Switching to new codec ${xe.codecs} without changeType as previous codec ${Ze.codecs} is compatible.`),Promise.resolve();if(!R.get().streaming.buffer.useChangeType||!e.supportsChangeType())return u.debug("changeType() not available"),Promise.resolve();u.debug(`Using changeType() to switch from codec ${Ze.codecs} to ${xe.codecs}`);const bt=xe.dependentRepresentation?xe.dependentRepresentation:xe;return q.changeType(bt)}function Ae(){return new Promise(((xe,Ze)=>{let bt=ge();if(!bt||bt.length===0)return we(),void xe();Kn(bt).then((()=>{xe()})).catch((Xe=>{Ze(Xe)}))}))}function ge(xe){const Ze=[],bt=q.getAllBufferRanges();if(!bt||bt.length===0)return Ze;if(!xe&&xe!==0||isNaN(xe))Ze.push({start:bt.start(0),end:bt.end(bt.length-1)+.5});else{const Xe=(function(Xt,sn){const wn=R.get().streaming.buffer.bufferToKeep,Te=sn.start(0);if(Xt-Te>wn){let nt=Math.max(0,Xt-wn);const Kt=c.getRequests({state:Ue.FRAGMENT_MODEL_EXECUTED,time:Xt,threshold:Pi})[0];if(Kt&&(nt=Math.min(Kt.startTime,nt)),nt>0)return{start:Te,end:nt}}return null})(xe,bt),qt=(function(Xt,sn){const wn=sn.end(sn.length-1)+.5,Te=Nn(Xt),nt=d.manifestInfo.duration>=R.get().streaming.buffer.longFormContentDurationThreshold?R.get().streaming.buffer.bufferTimeAtTopQualityLongForm:R.get().streaming.buffer.bufferTimeAtTopQuality;let Kt=isNaN(Te)?Xt:Math.min(Te,Xt+nt);if(Kt>=sn.end(sn.length-1))return null;const Qe=c.getRequests({state:Ue.FRAGMENT_MODEL_EXECUTED,time:Xt,threshold:Pi})[0];if(Qe&&(Kt=Math.max(Qe.startTime+Qe.duration,Kt)),R.get().streaming.buffer.avoidCurrentTimeRangePruning){for(let Yt=0;Yt<sn.length;Yt++)if(sn.start(Yt)<=Xt&&Xt<=sn.end(Yt)&&sn.start(Yt)<=Kt&&Kt<=sn.end(Yt)){let pn=Kt;Kt=Yt+1<sn.length?sn.start(Yt+1):sn.end(Yt)+1,u.debug("Buffered range ["+sn.start(Yt)+", "+sn.end(Yt)+"] overlaps with targetTime "+Xt+" and range to be pruned ["+pn+", "+wn+"], using ["+Kt+", "+wn+"] instead"+(Kt<wn?"":" (no actual pruning)"));break}}return Kt<sn.end(sn.length-1)?{start:Kt,end:wn}:null})(xe,bt);Xe&&Ze.push(Xe),qt&&Ze.push(qt)}return Ze}function we(){re||M===r.default.TEXT&&!b.isTextEnabled()||gt()}function Ve(){Jt()}function $e(){Jt(),Ce=NaN}function Je(xe,Ze){if(!q)return null;const bt=q.getAllBufferRanges();let Xe,qt,Xt=0,sn=0,wn=null,Te=null,nt=0;const Kt=isNaN(Ze)?.15:Ze;if(bt!=null){for(qt=0,Xe=bt.length;qt<Xe;qt++)if(Xt=bt.start(qt),sn=bt.end(qt),wn===null)nt=Math.abs(Xt-xe),(xe>=Xt&&xe<sn||nt<=Kt)&&(wn=Xt,Te=sn);else{if(nt=Xt-Te,!(nt<=Kt))break;Te=sn}if(wn!==null)return{start:wn,end:Te}}return null}function gt(){if(T){let xe=T.getTime()||0;J&&(xe=isNaN(Ce)?0:Ce);const Ze=R.get().streaming.gaps.jumpGaps&&!isNaN(R.get().streaming.gaps.smallGapLimit)?R.get().streaming.gaps.smallGapLimit:NaN;O=Math.max((function(bt,Xe){let qt,Xt;return R.get().streaming.gaps.jumpGaps&&(Xe=R.get().streaming.gaps.smallGapLimit),qt=Je(bt,Xe),Xt=qt===null?0:qt.end-bt,Xt})(xe,Ze),0),Lt(h.default.BUFFER_LEVEL_UPDATED,{mediaType:M,bufferLevel:O}),Jt()}}function Et(){const xe=U>=K-1,Ze=T.getTimeToStreamEnd(d)-O<1e-5;!xe&&!Ze||N||(Gt(!0),u.debug(`checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id ${d.id} and type ${M}`))}function Jt(){if(M!==r.default.AUDIO&&M!==r.default.VIDEO)return;const xe=T.getLowLatencyModeEnabled()?R.get().streaming.buffer.lowLatencyStallThreshold:R.get().streaming.buffer.stallThreshold;O<=xe&&!N?fn(o.BUFFER_EMPTY):(N||O>xe)&&fn(o.BUFFER_LOADED)}function fn(xe){A===xe||xe===o.BUFFER_EMPTY&&T.getTime()===0||M===r.default.TEXT&&!b.isTextEnabled()||(A=xe,Lt(h.default.BUFFER_LEVEL_STATE_CHANGED,{state:xe}),Lt(xe===o.BUFFER_LOADED?h.default.BUFFER_LOADED:h.default.BUFFER_EMPTY),u.debug(xe===o.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function bn(){q&&M!==r.default.TEXT&&(N||Kn(kn()))}function kn(){const xe=[],Ze=q.getAllBufferRanges();if(!Ze||Ze.length===0)return xe;const bt=T.getTime();let Xe=Math.max(0,bt-R.get().streaming.buffer.bufferToKeep);const qt=c.getRequests({state:Ue.FRAGMENT_MODEL_EXECUTED,time:bt,threshold:Pi})[0];if(qt)Xe=Math.min(qt.startTime,Xe);else if(bt===0&&T.getIsDynamic())return[];if(Ze.start(0)<=Xe){const Xt={start:0,end:Xe};for(let sn=0;sn<Ze.length&&Ze.end(sn)<=Xe;sn++)Xt.end=Ze.end(sn);Xt.start<Xt.end&&xe.push(Xt)}return xe}function Kn(xe){return new Promise(((Ze,bt)=>{if(!xe||!q||xe.length===0)return gt(),void Ze();const Xe=[];xe.forEach((qt=>{Xe.push((function(Xt){return new Promise(((sn,wn)=>{Xt.resolve=sn,Xt.reject=wn,W.push(Xt)}))})(qt))})),ee||Un(),Promise.all(Xe).then((()=>{Ze()})).catch((qt=>{bt(qt)}))}))}function Un(){try{if(W.length===0||!q)return u.debug("Nothing to prune, halt pruning"),W=[],void(ee=!1);const xe=q.getBuffer();if(!xe||!xe.buffered||xe.buffered.length===0)return u.debug("SourceBuffer is empty (or does not exist), halt pruning"),W=[],void(ee=!1);const Ze=W.shift();u.debug(`${M}: Removing buffer from: ${Ze.start} to ${Ze.end}`),ee=!0,T.getTime()<Ze.end&&Gt(!1),q.remove(Ze).then((bt=>{Bn(bt)})).catch((bt=>{Bn(bt)}))}catch{ee=!1}}function Bn(xe){u.debug("onRemoved buffer from:",xe.from,"to",xe.to),q&&(pe(q.getAllBufferRanges()),W.length===0&&(ee=!1,gt()),xe.unintended&&(u.warn("Detected unintended removal from:",xe.from,"to",xe.to,"setting streamprocessor time to",xe.from),Lt(h.default.SEEK_TARGET,{time:xe.from})),ee?Un():(re?re=!1:gt(),Lt(h.default.BUFFER_CLEARED,{from:xe.from,to:xe.to,unintended:xe.unintended,hasEnoughSpaceToAppend:lt(),quotaExceeded:k})))}function xn(xe){return new Promise((Ze=>{xe&&xe.mseTimeOffset!==void 0&&q&&q.updateTimestampOffset?q.updateTimestampOffset(xe.mseTimeOffset).then((()=>{Ze()})).catch((()=>{Ze()})):Ze()}))}function rt(){return q&&!N?q.updateAppendWindow(d):Promise.resolve()}function Mt(){C++,C*(R.get().streaming.wallclockTimeUpdateInterval/1e3)>=R.get().streaming.buffer.bufferPruningInterval&&(C=0,bn())}function St(){Jt()}function Gt(xe){N=xe,N?Lt(h.default.BUFFERING_COMPLETED):K=Number.POSITIVE_INFINITY}function cn(){try{const xe=q.getAllBufferRanges();let Ze,bt,Xe=0;if(!xe)return Xe;for(bt=0,Ze=xe.length;bt<Ze;bt++)Xe+=xe.end(bt)-xe.start(bt);return Xe}catch{return 0}}function Nn(xe){try{let Ze=xe;const bt=q.getAllBufferRanges();if(!bt||bt.length===0)return NaN;let Xe=0;for(;Ze===xe&&Xe<bt.length;){const qt=bt.start(Xe),Xt=bt.end(Xe);Ze>=qt&&Ze<=Xt&&(Ze=Xt),Xe+=1}return Ze===xe?NaN:Ze}catch{return NaN}}function lt(){const xe=cn();return isNaN(xe)||xe<L}function Lt(xe,Ze){let bt=Ze||{};l.trigger(xe,bt,{streamId:d.id,mediaType:M})}function jt(xe,Ze){if(L=Number.POSITIVE_INFINITY,A=void 0,K=Number.POSITIVE_INFINITY,U=0,y=null,N=!1,ee=!1,k=!1,O=0,C=0,W=[],Ce=NaN,J=!1,q){let bt=q;q=null,xe||(Ze?bt.removeEventListeners():bt.abort().then((()=>{bt.reset(Ze),bt=null})))}re=!1}return m={appendInitSegmentFromCache:function(xe){const Ze=Q.extract(d.id,xe);return!!Ze&&(u.debug(`Appending init fragment for type ${M}, representationId ${Ze.representation.id} and bandwidth ${Ze.representation.bandwidth}`),ne(Ze),!0)},clearBuffers:Kn,createBufferSink:ve,dischargePreBuffer:function(){if(q&&z&&typeof z.discharge=="function"){const xe=z.getAllBufferRanges();if(xe.length>0){let bt="Beginning "+M+"PreBuffer discharge, adding buffer for:";for(let Xe=0;Xe<xe.length;Xe++)bt+=" start: "+xe.start(Xe)+", end: "+xe.end(Xe)+";";u.debug(bt)}else u.debug("PreBuffer discharge requested, but there were no media segments in the PreBuffer.");v=[];let Ze=z.discharge();for(let bt=0;bt<Ze.length;bt++){const Xe=Ze[bt];v.push(Xe),q.append(Xe)}z.reset(),z=null}},getAllRangesWithSafetyFactor:ge,getBuffer:function(){return q},getBufferControllerType:function(){return ba},getBufferLevel:function(){return O},getContinuousBufferTimeForTargetTime:Nn,getIsBufferingCompleted:function(){return N},getIsPruningInProgress:function(){return ee},getMediaSource:function(){return x},getRangeAt:Je,getStreamId:function(){return d.id},getType:function(){return M},hasBufferAtTime:function(xe){try{const Ze=q.getAllBufferRanges();if(!Ze||Ze.length===0)return!1;let bt=0;for(;bt<Ze.length;){const Xe=Ze.start(bt),qt=Ze.end(bt);if(xe>=Xe&&xe<=qt)return!0;bt+=1}return!1}catch(Ze){return u.error(Ze),!1}},initialize:function(xe){Me(xe),l.on(h.default.INIT_FRAGMENT_LOADED,ue,m),l.on(h.default.MEDIA_FRAGMENT_LOADED,oe,m),l.on(h.default.WALLCLOCK_TIME_UPDATED,Mt,m),l.on(H.default.PLAYBACK_PLAYING,$e,m),l.on(H.default.PLAYBACK_PROGRESS,we,m),l.on(H.default.PLAYBACK_TIME_UPDATED,we,m),l.on(H.default.PLAYBACK_RATE_CHANGED,St,m),l.on(H.default.PLAYBACK_STALLED,Ve,m)},prepareForAbandonQualitySwitch:function(xe,Ze){return te(xe,Ze)},prepareForDefaultQualitySwitch:function(xe,Ze){return te(xe,Ze)},prepareForFastQualitySwitch:function(xe,Ze){return te(xe,Ze)},prepareForForceReplacementQualitySwitch:function(xe,Ze){return new Promise((bt=>{const Xe=[];Xe.push(q.abort()),Xe.push(rt()),Xe.push(Ae()),Xe.push(xn(xe)),Xe.push(se(xe,Ze)),Promise.allSettled(Xe).then((()=>{Gt(!1),bt()}))}))},prepareForNonReplacementTrackSwitch:function(xe,Ze){return new Promise((bt=>{const Xe=[];Xe.push(rt()),Xe.push(se(xe,Ze)),Promise.allSettled(Xe).then((()=>{bt()}))}))},prepareForPlaybackSeek:function(){return N&&Gt(!1),q.abort()},prepareForReplacementTrackSwitch:function(xe,Ze){return new Promise((bt=>{const Xe=[];Xe.push(q.abort()),Xe.push(rt()),Xe.push(se(xe,Ze)),Xe.push(Ae()),Xe.push(xn(xe)),Promise.allSettled(Xe).then((()=>{Gt(!1),bt()}))}))},pruneAllSafely:Ae,pruneBuffer:bn,reset:function(xe,Ze){l.off(h.default.INIT_FRAGMENT_LOADED,ue,this),l.off(h.default.MEDIA_FRAGMENT_LOADED,oe,this),l.off(h.default.WALLCLOCK_TIME_UPDATED,Mt,this),l.off(H.default.PLAYBACK_PLAYING,$e,this),l.off(H.default.PLAYBACK_PROGRESS,we,this),l.off(H.default.PLAYBACK_TIME_UPDATED,we,this),l.off(H.default.PLAYBACK_RATE_CHANGED,St,this),l.off(H.default.PLAYBACK_STALLED,Ve,this),jt(xe,Ze)},segmentRequestingCompleted:function(xe){isNaN(xe)||(K=xe,Et())},setIsBufferingCompleted:Gt,setMediaSource:Me,setSeekTarget:function(xe){Ce=xe},updateAppendWindow:rt,updateBufferTimestampOffset:xn},u=(0,p.default)(t).getInstance().getLogger(m),Q=ct(t).getInstance(),jt(),m}Da.__dashjs_factory_name=ba;var Lo=F.default.getClassFactory(Da);const va="NotFragmentedTextBufferController";function Ma(n){n=n||{};const e=this.context,t=(0,g.default)(e).getInstance(),l=n.textController,c=n.errHandler,T=n.streamInfo,D=n.type;let R,d,b,M,m,u;function N(x){M=x}function O(x){d!==x&&(d=x,d&&(function(U){let K={};t.trigger(U,K,{streamId:T.id,mediaType:D})})(h.default.BUFFERING_COMPLETED))}function L(x){x.chunk.bytes&&!d&&(u.save(x.chunk),m.append(x.chunk),O(!0))}return R={appendInitSegmentFromCache:function(x){return u.extract(T.id,x)!==null},clearBuffers:function(){return Promise.resolve()},createBufferSink:function(x){return new Promise(((U,K)=>{try{m=Na(e).create({mediaSource:M,textController:l,eventBus:t}),m.initializeForFirstUse(x),b||(m.getBuffer()&&typeof m.getBuffer().initialize=="function"&&m.getBuffer().initialize(),b=!0),U(m)}catch(q){c.error(new un.default(Pn.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,Pn.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+D)),K(q)}}))},dischargePreBuffer:function(){},getAllRangesWithSafetyFactor:function(){return[]},getBuffer:function(){return m},getBufferControllerType:function(){return va},getBufferLevel:function(){return 0},getContinuousBufferTimeForTargetTime:function(){return Number.POSITIVE_INFINITY},getIsBufferingCompleted:function(){return d},getIsPruningInProgress:function(){return!1},getMediaSource:function(){return M},getRangeAt:function(){return null},getStreamId:function(){return T.id},getType:function(){return D},hasBufferAtTime:function(){return!0},initialize:function(x){N(x)},prepareForPlaybackSeek:function(){return Promise.resolve()},prepareForReplacementTrackSwitch:function(){return d=!1,Promise.resolve()},pruneAllSafely:function(){return Promise.resolve()},pruneBuffer:function(){},reset:function(x){t.off(h.default.INIT_FRAGMENT_LOADED,L,R),!x&&m&&(m.abort(),m.reset(),m=null)},segmentRequestingCompleted:function(){},setIsBufferingCompleted:O,setMediaSource:N,setSeekTarget:function(){},updateAppendWindow:function(){return Promise.resolve()},updateBufferTimestampOffset:function(){return Promise.resolve()}},b=!1,M=null,d=!1,u=ct(e).getInstance(),t.on(h.default.INIT_FRAGMENT_LOADED,L,R),R}Ma.__dashjs_factory_name=va;var Fo=F.default.getClassFactory(Ma);function wa(n){const e=(n=n||{}).abrController,t=n.bufferController,l=this.context,c=n.dashMetrics,T=(0,g.default)(l).getInstance(),D=n.fragmentModel,R=n.mediaPlayerModel,d=n.playbackController,b=n.representationController,M=n.settings,m=n.textController,u=n.type;let N,O,L,x,U,K,q,z,J,v,A,y;function C(){K=(0,p.default)(l).getInstance().getLogger(L),pe(),J=n.streamInfo}function ee(){q=!0}function k(){q=!1}function Q(Ee){if(t.getIsBufferingCompleted())return;W();const te=isNaN(Ee)?0:Ee;z=setTimeout(re,te)}function W(){z&&(clearTimeout(z),z=null)}function re(){const Ee=R.getScheduleTimeout();try{if((function(){try{return u===r.default.TEXT&&!m.isTextEnabled()||d.isPaused()&&(!d.getStreamController().getInitialPlayback()||!d.getStreamController().getAutoPlay())&&!M.get().streaming.scheduling.scheduleWhilePaused}catch{return!1}})())return void W();(function(){try{return!!q&&b.getCurrentRepresentation()&&(U==null||v||(function(){const te=b.getCurrentRepresentation();if(!u||!te)return!0;let se=te&&te.segmentDuration&&!isNaN(te.segmentDuration)?te.segmentDuration:0;const Ae=c.getCurrentBufferLevel(u),ge=Ce();return(ge<=se||d.getLowLatencyModeEnabled()||u===r.default.AUDIO&&N)&&(se=0),Ae+se<ge})())}catch{return!1}})()?(function(){if(e.handlePendingManualQualitySwitch(J.id,u))return;let te=!1;y&&(te=e.checkPlaybackQuality(u,J.id)),te||(function(){const se=b.getCurrentRepresentation();O||se.id!==U||v?(function(Ae){v?(K.debug("Switch track for "+u+", representation id = "+Ae.id),v=!1):K.debug("Quality has changed, get init request for representationid = "+Ae.id),T.trigger(h.default.INIT_FRAGMENT_NEEDED,{representationId:Ae.id,sender:L},{streamId:J.id,mediaType:u}),y=!1,O=!1})(se):(K.debug(`Media segment needed for ${u} and stream id ${J.id}`),T.trigger(h.default.MEDIA_FRAGMENT_NEEDED,{},{streamId:J.id,mediaType:u}),y=!0)})()})():Q(Ee)}catch{Q(Ee)}}function Ce(){let Ee=NaN;const te=b.getCurrentRepresentation();return u&&te&&(Ee=u===r.default.TEXT?(function(){try{if(m.isTextEnabled()){const se=b.getCurrentRepresentation();if(isNaN(se.fragmentDuration)){const Ae=c.getCurrentSchedulingInfo(o.SCHEDULING_INFO);return Ae?Ae.duration:0}return se.fragmentDuration}return 0}catch{return 0}})():u===r.default.AUDIO&&N?(function(){try{const se=c.getCurrentBufferLevel(r.default.VIDEO),Ae=b.getCurrentRepresentation();return isNaN(Ae.fragmentDuration)?se+1:Math.max(se+1,Ae.fragmentDuration)}catch{return 0}})():(function(){try{const se=M.get().streaming.enhancement.enabled?b.getCurrentCompositeRepresentation():b.getCurrentRepresentation(),Ae=se.mediaInfo.streamInfo;return e.isPlayingAtTopQuality(se)?Ae.manifestInfo.duration>=M.get().streaming.buffer.longFormContentDurationThreshold?M.get().streaming.buffer.bufferTimeAtTopQualityLongForm:M.get().streaming.buffer.bufferTimeAtTopQuality:R.getBufferTimeDefaultUnadjusted()}catch{return R.getBufferTimeDefaultUnadjusted()}})()),Ee}function Me(){ve(!0)}function ve(Ee){if(d&&D){const te=D.getRequests({state:Ue.FRAGMENT_MODEL_EXECUTED,time:d.getTime(),threshold:0})[0];te&&d.getTime()>=te.startTime&&((!x.representation||te.representation.mediaInfo.type===x.representation.mediaInfo.type&&te.representation.mediaInfo.index!==x.representation.mediaInfo.index)&&Ee&&(function(se){K.debug(`Track change rendered for streamId ${J.id} and type ${u}`),T.trigger(h.default.TRACK_CHANGE_RENDERED,{mediaType:u,oldMediaInfo:x&&x.representation&&x.representation.mediaInfo?x.representation.mediaInfo:null,newMediaInfo:se.representation.mediaInfo,streamId:J.id})})(te),x.representation&&te.representation.id===x.representation.id||!Ee||(function(se){K.debug(`Quality change rendered for streamId ${J.id} and type ${u}`),T.trigger(h.default.QUALITY_CHANGE_RENDERED,{mediaType:u,oldRepresentation:x.representation?x.representation:null,newRepresentation:se.representation,streamId:J.id})})(te),x.representation=te.representation)}}function ue(){D.abortRequests(),W()}function oe(){M.get().streaming.scheduling.scheduleWhilePaused||Q()}function ne(Ee){c.updatePlayListTraceMetrics({playbackspeed:Ee.playbackRate.toString()})}function pe(){y=!0,A=0,U=null,x={representation:null},v=!1,O=!1,q=!0}return L={clearScheduleTimer:W,getBufferTarget:Ce,getPlaybackController:function(){return d},getStreamId:function(){return J.id},getSwitchTrack:function(){return v},getTimeToLoadDelay:function(){return A},getType:function(){return u},initialize:function(Ee){N=Ee,T.on(h.default.URL_RESOLUTION_FAILED,ue,L),T.on(H.default.PLAYBACK_STARTED,oe,L),T.on(H.default.PLAYBACK_RATE_CHANGED,ne,L),T.on(H.default.PLAYBACK_TIME_UPDATED,Me,L),T.on(H.default.MANAGED_MEDIA_SOURCE_START_STREAMING,ee,L),T.on(H.default.MANAGED_MEDIA_SOURCE_END_STREAMING,k,L)},reset:function(){T.off(h.default.URL_RESOLUTION_FAILED,ue,L),T.off(H.default.PLAYBACK_STARTED,oe,L),T.off(H.default.PLAYBACK_RATE_CHANGED,ne,L),T.off(H.default.PLAYBACK_TIME_UPDATED,Me,L),T.off(H.default.MANAGED_MEDIA_SOURCE_START_STREAMING,ee,L),T.off(H.default.MANAGED_MEDIA_SOURCE_END_STREAMING,k,L),W(),ve(!1),pe(),J=null},setShouldCheckPlaybackQuality:function(Ee){y=Ee},setInitSegmentRequired:function(Ee){O=Ee},setLastInitializedRepresentationId:function(Ee){U=Ee},setup:C,setSwitchTrack:function(Ee){v=Ee},setTimeToLoadDelay:function(Ee){A=Ee},startScheduleTimer:Q},C(),L}wa.__dashjs_factory_name="ScheduleController";var Uo=F.default.getClassFactory(wa);const xo=/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g;var Bo=class extends da{constructor(){super(),this.isPartialSegment=!0,this.replacementSubNumber=NaN,this.totalNumberOfPartialSegments=NaN}};function Pa(n){return n?n.totalNumberOfPartialSegments&&!isNaN(n.totalNumberOfPartialSegments)&&n.totalNumberOfPartialSegments>0&&!isNaN(n.subNumberOfPartialSegmentToRequest)?(function(e){const t=(function(l,c){const T=new Bo,D=l.segmentDurationInSeconds/l.totalNumberOfPartialSegments,{representation:R,timelineConverter:d,isDynamic:b,index:M,totalNumberOfPartialSegments:m}=l,u=Oa({representation:R,segmentDurationInSeconds:D,presentationStartTime:l.presentationStartTime+c*D,presentationEndTime:l.presentationStartTime+(c+1)*D,timelineConverter:d,isDynamic:b,mediaTimeInSeconds:l.mediaTimeInSeconds+c*D,index:M});return T.assignAttributes(u),T.replacementSubNumber=c,T.totalNumberOfPartialSegments=m,T})(e,e.subNumberOfPartialSegmentToRequest);return La(t,e),t})(n):(function(e){const t=new wi,l=Oa(e);return t.assignAttributes(l),La(t,e),t})(n):null}function Oa(n){const{representation:e,segmentDurationInSeconds:t,presentationStartTime:l,presentationEndTime:c,mediaTimeInSeconds:T,timelineConverter:D,isDynamic:R,index:d}=n,b={availabilityEndTime:D.calcAvailabilityEndTimeFromPresentationTime(c+t,e,R),availabilityStartTime:D.calcAvailabilityStartTimeFromPresentationTime(c,e,R),duration:t,index:d,mediaStartTime:T,presentationStartTime:l,replacementNumber:e.startNumber+d,representation:e};return b.wallStartTime=D.calcWallTimeForSegment(b,R),b}function La(n,e){const{tManifest:t,mediaTime:l,mediaUrl:c,mediaRange:T}=e;n.replacementTime=t||l,n.media=li(c,n.representation.id,n.replacementNumber,n.replacementSubNumber,n.representation.bandwidth,n.replacementTime),n.mediaRange=T,n.mediaUrl=c}function Fa(n,e,t,l){const c=e.adaptation.period;if(isFinite(c.duration)&&c.start+c.duration<=t.presentationStartTime)return!1;if(l){if(e.availabilityTimeOffset==="INF")return!0;const T=n.getClientReferenceTime();return t.availabilityStartTime.getTime()<=T&&(!isFinite(t.availabilityEndTime)||t.availabilityEndTime.getTime()>=T)}return!0}function li(n,e,t,l,c,T){return n&&(function(D,R,d,b,M,m){return D.replace(xo,((u,N,O,L)=>{let x,U;switch(N){case void 0:return"$";case"RepresentationID":x=R;break;case"Number":x=d;break;case"SubNumber":x=b;break;case"Bandwidth":x=M;break;case"Time":if(typeof m=="string")return m;x=m&&Math.round(m);break;default:x=null}if(x==null)return u;switch(L){case void 0:case"d":case"i":case"u":U=x.toString();break;case"o":U=x.toString(8);break;case"x":U=x.toString(16);break;case"X":U=x.toString(16).toUpperCase();break;default:U=x.toString()}const K=parseInt(O,10)||1;return U.padStart(K,"0")}))})(n,e,t,l,c,T)}function Ua(n){const{index:e,isDynamic:t,mediaRange:l,mediaTime:c,mediaUrl:T,representation:D,subNumberOfPartialSegmentToRequest:R,timelineConverter:d,totalNumberOfPartialSegments:b}=n;let M,m,u;M=D.segmentDuration,isNaN(M)&&(M=D.adaptation.period.duration),m=parseFloat((D.adaptation.period.start+e*M).toFixed(5)),u=parseFloat((m+M).toFixed(5));const N=Pa({index:e,isDynamic:t,mediaRange:l,mediaTime:c,mediaTimeInSeconds:d.calcMediaTimeFromPresentationTime(m,D),mediaUrl:T,presentationEndTime:u,presentationStartTime:m,representation:D,segmentDurationInSeconds:M,subNumberOfPartialSegmentToRequest:R,timelineConverter:d,totalNumberOfPartialSegments:b});return Fa(d,D,N,t)?N:null}function Oi(n){const{durationInTimescale:e,fTimescale:t,index:l,subNumberOfPartialSegmentToRequest:c,isDynamic:T,mediaRange:D,mediaTime:R,mediaUrl:d,totalNumberOfPartialSegments:b,representation:M,tManifest:m,timelineConverter:u}=n,N=R/t,O=e/t;let L=u.calcPresentationTimeFromMediaTime(N,M),x=Pa({representation:M,segmentDurationInSeconds:O,presentationStartTime:L,presentationEndTime:L+O,mediaTimeInSeconds:N,timelineConverter:u,isDynamic:T,index:l,totalNumberOfPartialSegments:b,subNumberOfPartialSegmentToRequest:c,mediaUrl:d,mediaRange:D,tManifest:m,mediaTime:R});return Fa(u,M,x,T)?x:null}function Li(n){return n.k}function xa(n){const e=(n=n||{}).eventBus,t=n.events,l=n.abrController,c=n.dashMetrics,T=n.playbackController,D=n.timelineConverter,R=n.type,d=n.streamInfo,b=n.segmentsController;let M,m,u,N=n.isDynamic;function O(){return R}function L(){return u?.mediaInfo.type===R?u:(function(){let v=u?.dependentRepresentation;if(v){if(!v.mediaInfo)throw new Error("dependentRepresentation has no mediaInfo!");if(v.mediaInfo.type===R)return v}return null})()}function x(){u=null,m=[]}function U(v){return new Promise(((A,y)=>{const C=v.hasInitialization(),ee=v.hasSegments(),k=[];k.push(b.updateInitData(v,C)),k.push(b.updateSegmentData(v,ee)),Promise.all(k).then((Q=>{var W;Q[0]&&!Q[0].error&&(v=(function(re,Ce){return Ce&&!Ce.error&&Ce.representation?Ce.representation:re})(v,Q[0])),Q[1]&&!Q[1].error&&(v=(function(re,Ce){if(!Ce||Ce.error)return;const Me=Ce.segments,ve=[];let ue,oe,ne,pe,Ee=0;for(ue=0,oe=Me?Me.length:0;ue<oe;ue++)ne=Me[ue],pe=Oi({durationInTimescale:ne.duration,fTimescale:ne.timescale,index:Ee,isDynamic:N,mediaRange:ne.mediaRange,mediaTime:ne.startTime,mediaUrl:ne.media,representation:re,timelineConverter:D}),pe&&(ve.push(pe),pe=null,Ee++);return ve.length>0&&(re.segments=ve),re})(v,Q[1])),v.fragmentDuration=v.segmentDuration?v.segmentDuration:v.segments&&v.segments.length>0?v.segments[0].duration:NaN,(W=v).mediaFinishedInformation=b.getMediaFinishedInformation(W),(function(re){let Ce,Me=c.getCurrentManifestUpdate(),ve=!1;if(Me){for(let ue=0;ue<Me.representationInfo.length;ue++)if(Ce=Me.representationInfo[ue],Ce.index===re.index&&Ce.mediaType===O()){ve=!0;break}ve||c.addManifestUpdateRepresentationInfo(re,O())}})(v),A()})).catch((Q=>{y(Q)}))}))}function K(v){if(!m||m.length===0)return null;const A=m.filter((y=>y.id===v));return A.length>0?A[0]:null}function q(v){e.trigger(t.DATA_UPDATE_COMPLETED,{currentRepresentation:u,error:v},{streamId:d.id,mediaType:R})}function z(v){u&&u.id===v.id||(function(A){(function(){if(!(l&&c&&T&&D))throw new Error(r.default.MISSING_CONFIG_ERROR)})();const y=new Date,C=1e3*T.getTime();A&&c.addRepresentationSwitch(A.adaptation.type,y,C,A.id),e.trigger(H.default.REPRESENTATION_SWITCH,{mediaType:R,streamId:d.id,currentRepresentation:A},{streamId:d.id,mediaType:R})})(v),u=v}function J(v){if(v.newDuration){const A=L();A&&A.adaptation.period&&(A.adaptation.period.duration=v.newDuration)}}return M={getCurrentCompositeRepresentation:function(){return u},getCurrentRepresentation:L,getRepresentationById:K,getStreamId:function(){return d.id},getType:O,prepareQualityChange:function(v){const A=m.filter((y=>y.id===v.id));A.length>0&&z(A[0])},reset:function(){e.off(H.default.MANIFEST_VALIDITY_CHANGED,J,M),x()},setIsDynamic:function(v){N=v},updateData:function(v,A,y){return new Promise(((C,ee)=>{if(m=v,z(K(y)),R!==r.default.VIDEO&&R!==r.default.ENHANCEMENT&&R!==r.default.AUDIO&&(R!==r.default.TEXT||!A))return q(),void C();const k=[];for(let Q=0,W=m.length;Q<W;Q++){const re=m[Q];k.push(U(re))}Promise.all(k).then((()=>{(function(){l.setPlaybackQuality(R,d,u);const Q=c.getCurrentDVRInfo(R);Q&&c.updateManifestUpdateInfo({latency:Q.range.end-T.getTime()}),q()})(),C()})).catch((Q=>{ee(Q)}))}))}},x(),e.on(H.default.MANIFEST_VALIDITY_CHANGED,J,M),M}xa.__dashjs_factory_name="RepresentationController";var ko=F.default.getClassFactory(xa);function Ba(n){const e=(n=n||{}).eventBus,t=n.debug,l=n.urlUtils,c=n.type,T=n.streamInfo,D=n.segmentsController,R=n.timelineConverter,d=n.baseURLController;let b,M,m,u,N;function O(){return c}function L(){m=null}function x(v,A,y){const C=d.resolve(y.path);let ee,k,Q={};return C&&A!==C.url&&l.isRelative(A)?(ee=C.url,k=C.serviceLocation,Q=C.queryParams,A&&(ee=l.resolve(A,ee))):ee=A,!l.isRelative(ee)&&(v.url=ee,v.serviceLocation=k,v.queryParams=Q,!0)}function U(v,A,y){let C=null;if(!A||!A.segmentInfoType)return C;const ee=D.getSegmentByTime(A,y);return ee&&(m=ee,M.debug("Index for time "+y+" is "+ee.index),C=K(0,ee)),C}function K(v,A){if(A==null)return null;const y=new B.default,C=A.representation,ee=C.bandwidth,k=li(A.media,C.id,A.replacementNumber,A.replacementSubNumber,ee,A.replacementTime);return y.adaptationIndex=C.adaptation.index,y.availabilityEndTime=A.availabilityEndTime,y.availabilityStartTime=A.availabilityStartTime,y.availabilityTimeComplete=C.availabilityTimeComplete,y.bandwidth=C.bandwidth,y.duration=A.duration,y.index=A.index,y.isPartialSegmentRequest=A.isPartialSegment,y.mediaStartTime=A.mediaStartTime,y.mediaType=O(),y.presentationStartTime=A.presentationStartTime,y.range=A.mediaRange,y.representation=C,y.startTime=A.presentationStartTime,y.timescale=C.timescale,y.type=Ge.HTTPRequest.MEDIA_SEGMENT_TYPE,y.wallStartTime=A.wallStartTime,x(y,k,C)?y:void 0}function q(v){if(!v)return{indexToRequest:0,subNumberOfPartialSegmentToRequest:NaN};const A=v.isPartialSegment,y=!isNaN(v.replacementSubNumber),C=!isNaN(v.totalNumberOfPartialSegments);if(A&&y&&C){const ee=v.replacementSubNumber+1;return ee<v.totalNumberOfPartialSegments?{indexToRequest:v.index,subNumberOfPartialSegmentToRequest:ee}:{indexToRequest:v.index+1,subNumberOfPartialSegmentToRequest:0}}return{indexToRequest:v.index+1,subNumberOfPartialSegmentToRequest:NaN}}function z(v,A,y,C){let ee=null;const k=D.getSegmentByIndex(A,y,C,m);if(k)ee=K(0,k),m=k;else{if(u&&!N)return M.debug(O()+" No segment found at index: "+y+". Wait for next loop"),null;N=!0}return ee}function J(){M.debug("Dynamic stream complete"),N=!0}return b={getCurrentIndex:function(){return m?m.index:-1},getInitRequest:function(v,A){return A?(function(y,C,ee){const k=new B.default,Q=C.adaptation.period,W=Q.start;if(k.mediaType=ee,k.type=Ge.HTTPRequest.INIT_SEGMENT_TYPE,k.range=C.range,k.availabilityStartTime=R.calcAvailabilityStartTimeFromPresentationTime(W,C,u),k.availabilityEndTime=R.calcAvailabilityEndTimeFromPresentationTime(W+Q.duration,C,u),k.representation=C,x(k,C.initialization,C))return k.url=li(k.url,C.id,void 0,void 0,C.bandwidth),k})(0,A,O()):null},getLastSegment:function(){return m},getNextSegmentRequest:function(v,A){if(!A||!A.segmentInfoType)return null;if((function(ee){return ee&&m&&ee.endNumber&&m.replacementNumber&&m.replacementNumber>=ee.endNumber})(A))return N=!0,null;let{indexToRequest:y,subNumberOfPartialSegmentToRequest:C}=q(m);return z(0,A,y,C)},getNextSegmentRequestIdempotent:function(v,A){let y=null,{indexToRequest:C,subNumberOfPartialSegmentToRequest:ee}=q(m);const k=D.getSegmentByIndex(A,C,ee,m);return k?(y=K(0,k),y):null},getSegmentRequestForTime:U,getStreamId:function(){return T.id},getStreamInfo:function(){return T},getType:O,getValidTimeAheadOfTargetTime:function(v,A,y,C){try{if(isNaN(v)||!A||!y)return NaN;if(v<0&&(v=0),isNaN(C)&&(C=.5),U(0,y,v))return v;if(y.adaptation.period.start+y.adaptation.period.duration<v)return NaN;const ee=isFinite(y.adaptation.period.duration)?y.adaptation.period.start+y.adaptation.period.duration:v+30;let k=Math.min(v+C,ee),Q=NaN,W=null;for(;k<=ee;){let re=null;if(k<=ee&&(re=U(0,y,k)),re){Q=k,W=re;break}k+=C}if(W){const re=W.startTime+W.duration;return v>W.startTime&&re-v>C?v:!isNaN(W.startTime)&&v<W.startTime&&Q>W.startTime?W.startTime+.001:Math.min(re-C,Q)}return Q}catch{return NaN}},initialize:function(v){u=v,N=!1,D.initialize(v)},isLastSegmentRequested:function(v,A){return!v||!m?!1:N?!0:!isFinite(v.adaptation.period.duration)||m.presentationStartTime+m.duration>A?!1:v.mediaFinishedInformation&&!isNaN(v.mediaFinishedInformation.numberOfSegments)&&!isNaN(m.index)&&m.index>=v.mediaFinishedInformation.numberOfSegments-1&&(!u||v.segmentInfoType===fe.default.SEGMENT_TEMPLATE||u&&v.segmentInfoType===fe.default.SEGMENT_LIST&&v.adaptation.period.nextPeriodId)?!0:!!(u&&v.adaptation.period.nextPeriodId&&v.segmentInfoType===fe.default.SEGMENT_TIMELINE&&v.mediaFinishedInformation&&!isNaN(v.mediaFinishedInformation.mediaTimeOfLastSignaledSegment)&&m&&!isNaN(m.mediaStartTime)&&!isNaN(m.duration)&&m.mediaStartTime+m.duration>=v.mediaFinishedInformation.mediaTimeOfLastSignaledSegment-.05)},repeatSegmentRequest:function(v,A){return A&&A.segmentInfoType?z(0,A,m?m.index:0,m&&m.isPartialSegment&&!isNaN(m.replacementSubNumber)?m.replacementSubNumber:NaN):null},reset:function(){L(),e.off(H.default.DYNAMIC_TO_STATIC,J,b)}},M=t.getLogger(b),L(),e.on(H.default.DYNAMIC_TO_STATIC,J,b),b}Ba.__dashjs_factory_name="DashHandler";var ka=F.default.getClassFactory(Ba);function Ga(n,e){const t=(n=n||{}).timelineConverter,l=n.dashMetrics;let c;function T(R,d){if((function(){if(!t)throw new Error(r.default.MISSING_CONFIG_ERROR)})(),!R)return null;d===void 0&&(d=null);let b=null;const M=t.calcMediaTimeFromPresentationTime(d,R);return(function(m,u){const N=(function(ee){return ee.adaptation.period.mpd.manifest.Period[ee.adaptation.period.index].AdaptationSet[ee.adaptation.index].Representation[ee.index].SegmentTemplate||ee.adaptation.period.mpd.manifest.Period[ee.adaptation.period.index].AdaptationSet[ee.adaptation.index].Representation[ee.index].SegmentList})(m),O=N.SegmentTimeline,L=N.SegmentURL;let x,U,K,q,z,J,v=0,A=-1;J=m.timescale,x=O.S;let y=!1;const C=x.length;for(K=0;K<C&&!y;K++)for(U=x[K],z=0,U.hasOwnProperty("r")&&(z=U.r),U.hasOwnProperty("t")&&(v=U.t),z<0&&(z=D(m,x[K+1],U,J,v/J)),q=0;q<=z&&!y;q++)A++,y=u({mediaTime:v,segmentBase:N,segmentURL:L,currentSElement:U,sElementCounterIncludingRepeats:A,sElementCounter:K}),y&&(m.segmentDuration=U.d/J),v+=U.d})(R,(function(m){const u=R.timescale;return(function(N,O){const{mediaTime:L,segmentBase:x,segmentURL:U,currentSElement:K,sElementCounterIncludingRepeats:q,sElementCounter:z}=O,J=K.d,v=R.timescale;return N<L+J&&N>=L&&((function(A){const{segmentBase:y,segmentURL:C,sElementCounter:ee,currentSElement:k,mediaTime:Q,durationInTimescale:W,fTimescale:re,requiredMediaTimeInTimescaleUnits:Ce,sElementCounterIncludingRepeats:Me}=A;let ve=(function(pe,Ee,te){let se=pe.media;return Ee&&(se=Ee[te].media||""),se})(y,C,ee),ue=(function(pe,Ee,te){let se=pe.mediaRange;return Ee&&(se=Ee[te].mediaRange),se})(k,C,ee);const oe=Li(k),ne=(function(pe){if(!pe||pe.totalNumberOfPartialSegments===void 0||isNaN(pe.totalNumberOfPartialSegments)||pe.totalNumberOfPartialSegments<1)return;const{durationInTimescale:Ee,requiredMediaTimeInTimescaleUnits:te,mediaTime:se,totalNumberOfPartialSegments:Ae}=pe,ge=Ee/Ae;for(let we=0;we<Ae;we++){const Ve=se+we*ge;if(te>=Ve&&te<Ve+ge)return we}return NaN})({durationInTimescale:W,requiredMediaTimeInTimescaleUnits:Ce,mediaTime:Q,totalNumberOfPartialSegments:oe});b=Oi({timelineConverter:t,isDynamic:e,representation:R,mediaTime:Q,durationInTimescale:W,fTimescale:re,mediaUrl:ve,mediaRange:ue,index:Me,tManifest:k.tManifest,totalNumberOfPartialSegments:oe,subNumberOfPartialSegmentToRequest:ne})})({segmentBase:x,segmentURL:U,sElementCounter:z,currentSElement:K,mediaTime:L,durationInTimescale:J,fTimescale:v,requiredMediaTimeInTimescaleUnits:N,sElementCounterIncludingRepeats:q}),!0)})(parseFloat((M*u).toPrecision(15)),m)})),b}function D(R,d,b,M,m){let u;if(d&&d.hasOwnProperty("t"))u=d.t/M;else try{let N=0;if(isNaN(R.adaptation.period.start)||isNaN(R.adaptation.period.duration)||!isFinite(R.adaptation.period.duration)){const O=l.getCurrentDVRInfo();N=isNaN(O.end)?0:O.end}else N=R.adaptation.period.start+R.adaptation.period.duration;u=t.calcMediaTimeFromPresentationTime(N,R),R.segmentDuration=b.d/M}catch{u=0}return Math.max(Math.ceil((u-m)/(b.d/M))-1,0)}return c={getMediaFinishedInformation:function(R){if(!R)return 0;const d=(R.adaptation.period.mpd.manifest.Period[R.adaptation.period.index].AdaptationSet[R.adaptation.index].Representation[R.index].SegmentTemplate||R.adaptation.period.mpd.manifest.Period[R.adaptation.period.index].AdaptationSet[R.adaptation.index].Representation[R.index].SegmentList).SegmentTimeline;let b,M,m,u,N,O,L=0,x=0,U=0;O=R.timescale,b=d.S;const K=b.length;for(m=0;m<K;m++)for(M=b[m],N=0,M.hasOwnProperty("r")&&(N=M.r),M.hasOwnProperty("t")&&(L=M.t,x=L/O),N<0&&(N=D(R,b[m+1],M,O,x)),u=0;u<=N;u++)U++,L+=M.d,x=L/O;return{numberOfSegments:U,mediaTimeOfLastSignaledSegment:x}},getSegmentByIndex:function(R,d){return R?T(R,d&&!isNaN(d.presentationStartTime)?d.presentationStartTime+d.duration+.01:0):null},getSegmentByTime:T},c}Ga.__dashjs_factory_name="TimelineSegmentsGetter";var Go=F.default.getClassFactory(Ga);function Ha(n,e){const t=(n=n||{}).timelineConverter;let l;function c(D,R,d){if(!D)return null;const b=T(D),M=Li(b);M!==void 0&&M>=0&&(d=d!==void 0&&d<M?d:0);const m=Ua({index:R=Math.max(R,0),isDynamic:e,mediaTime:Math.round(R*D.segmentDuration*D.timescale,10),mediaUrl:b.media,representation:D,subNumberOfPartialSegmentToRequest:d,timelineConverter:t,totalNumberOfPartialSegments:M});return m&&D.endNumber&&m.replacementNumber>D.endNumber?null:m}function T(D){return D.adaptation.period.mpd.manifest.Period[D.adaptation.period.index].AdaptationSet[D.adaptation.index].Representation[D.index].SegmentTemplate}return l={getMediaFinishedInformation:function(D){const R={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!D)return R;const d=D.segmentDuration;return isNaN(d)?R.numberOfSegments=1:R.numberOfSegments=Math.ceil(D.adaptation.period.duration/d),R},getSegmentByIndex:c,getSegmentByTime:function(D,R){if(!D)return null;const d=D.segmentDuration;if(isNaN(d))return null;let b=t.calcPeriodRelativeTimeFromMpdRelativeTime(D,R);const M=T(D),m=Math.floor(b/d),u=(function(N){if(!N||N.totalNumberOfPartialSegments===void 0||isNaN(N.totalNumberOfPartialSegments)||N.totalNumberOfPartialSegments<1)return;const{totalNumberOfPartialSegments:O,representation:L,requestedTimeRelativeToPeriodStart:x,indexWithoutStartNumber:U}=N,K=U*L.segmentDuration,q=L.segmentDuration/O,z=x-K;let J=Math.floor(z/q);return J=Math.max(0,Math.min(J,O-1)),J})({totalNumberOfPartialSegments:Li(M),representation:D,requestedTimeRelativeToPeriodStart:b,indexWithoutStartNumber:m});return c(D,m,u)}},l}Ha.__dashjs_factory_name="TemplateSegmentsGetter";var Ho=F.default.getClassFactory(Ha);function Ya(n,e){const t=(n=n||{}).timelineConverter;let l;function c(){if(!t||!t.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(r.default.MISSING_CONFIG_ERROR)}function T(D,R){if(c(),!D)return null;const d=D.adaptation.period.mpd.manifest.Period[D.adaptation.period.index].AdaptationSet[D.adaptation.index].Representation[D.index].SegmentList,b=d.SegmentURL.length,M=D&&!isNaN(D.startNumber)?D.startNumber:1,m=Math.max(M-1,0),u=Math.max(R-m,0);let N=null;if(u<b){const O=d.SegmentURL[u];N=Ua({index:R,isDynamic:e,mediaRange:O.mediaRange,mediaTime:(M+R-1)*D.segmentDuration,representation:D,timelineConverter:t}),N&&(N.media=O.media?O.media:"",N.indexRange=O.indexRange)}return N}return l={getSegmentByIndex:T,getSegmentByTime:function(D,R){if(c(),!D)return null;const d=D.segmentDuration;if(isNaN(d))return null;const b=t.calcPeriodRelativeTimeFromMpdRelativeTime(D,R);return T(D,Math.floor(b/d))},getMediaFinishedInformation:function(D){const R={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!D)return R;const d=D.adaptation.period.mpd.manifest.Period[D.adaptation.period.index].AdaptationSet[D.adaptation.index].Representation[D.index].SegmentList,b=D&&!isNaN(D.startNumber)?D.startNumber:1,M=Math.max(b-1,0);return R.numberOfSegments=M+d.SegmentURL.length,R}},l}Ya.__dashjs_factory_name="ListSegmentsGetter";var Yo=F.default.getClassFactory(Ya);function Va(n){const e=(n=n||{}).timelineConverter;let t;function l(){if(!e||!e.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(r.default.MISSING_CONFIG_ERROR)}function c(T,D){if(l(),!T)return null;const R=T.segments?T.segments.length:-1;let d;if(D<R&&(d=T.segments[D],d&&d.index===D))return d;for(let b=0;b<R;b++)if(d=T.segments[b],d&&d.index===D)return d;return null}return t={getSegmentByIndex:c,getSegmentByTime:function(T,D){l();const R=(function(d,b){if(!d)return-1;const M=d.segments,m=M?M.length:null;let u,N,O,L,x,U=-1;if(M&&m>0){for(x=0;x<m;x++)if(N=M[x],O=N.presentationStartTime,L=N.duration,u=L/2,b+u>=O&&b-u<O+L){U=N.index;break}}return U})(T,D);return c(T,R)},getMediaFinishedInformation:function(T){const D={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};return T&&T.segments&&(D.numberOfSegments=T.segments.length),D}},t}Va.__dashjs_factory_name="SegmentBaseGetter";var Vo=F.default.getClassFactory(Va);function qa(n){n=n||{};const e=this.context,t=n.dashConstants,l=n.type,c=n.segmentBaseController;let T,D;function R(d){return d?d.segments?D[t.SEGMENT_BASE]:D[d.segmentInfoType]:null}return T={initialize:function(d){D[t.SEGMENT_TIMELINE]=Go(e).create(n,d),D[t.SEGMENT_TEMPLATE]=Ho(e).create(n,d),D[t.SEGMENT_LIST]=Yo(e).create(n,d),D[t.SEGMENT_BASE]=Vo(e).create(n,d)},updateInitData:function(d,b){return b?Promise.resolve():c.getSegmentBaseInitSegment({representation:d,mediaType:l})},updateSegmentData:function(d,b){return b?Promise.resolve():c.getSegmentList({mimeType:d.mimeType,representation:d,mediaType:l})},getSegmentByIndex:function(d,b,M,m){const u=R(d);return u?d.segmentInfoType?d.segmentInfoType===t.SEGMENT_TIMELINE?u.getSegmentByIndex(d,m):d.segmentInfoType===t.SEGMENT_TEMPLATE?u.getSegmentByIndex(d,b,M):u.getSegmentByIndex(d,b):u.getSegmentByIndex(d,b):null},getSegmentByTime:function(d,b){const M=R(d);return M?M.getSegmentByTime(d,b):null},getMediaFinishedInformation:function(d){const b=R(d);return b?b.getMediaFinishedInformation(d):{numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN}}},D={},T}qa.__dashjs_factory_name="SegmentsController";var Ka=F.default.getClassFactory(qa);function ja(){let n;return n={ntpToUTC:function(e){const t=new Date(Date.UTC(1900,0,1,0,0,0));return new Date(t.getTime()+e).getTime()}},n}ja.__dashjs_factory_name="TimeUtils";var qo=F.default.getSingletonFactory(ja);function Wa(n){n=n||{};let e,t,l,c,T,D,R,d,b,M,m,u,N,O,L,x,U,K,q=this.context,z=(0,g.default)(q).getInstance(),J=n.abrController,v=n.adapter,A=n.boxParser,y=n.capabilities,C=n.dashMetrics,ee=n.errHandler,k=n.fragmentModel,Q=n.manifestModel,W=n.mediaController,re=n.mediaPlayerModel,Ce=n.mimeType,Me=n.playbackController,ve=n.segmentBlacklistController,ue=n.settings,oe=n.streamInfo,ne=n.textController,pe=n.timelineConverter,Ee=n.type;function te(){return oe.id}function se(){return Ee}function Ae(){M=[],c=null,t=0,U=!1,x=!1,u=!1,D=null,K=!1,bn()}function ge(Qe){return!isNaN(Qe)&&!isNaN(oe.duration)&&isFinite(oe.duration)&&Qe>=oe.start+oe.duration}function we(Qe,Yt=!0){if(Qe.sender){if(Me.getIsManifestUpdateInProgress())Je();else if((!c.isText||ne.isTextEnabled())&&e&&Qe.representationId&&!e.appendInitSegmentFromCache(Qe.representationId)){const pn=N.getCurrentRepresentation();if(pn.range===0)return void Ve();const Mn=T?T.getInitRequest(c,pn):null;Mn?k.executeRequest(Mn):Yt&&(O.setInitSegmentRequired(!0),Je())}}}function Ve(Qe,Yt=!0){if(Me.getIsManifestUpdateInProgress()||e.getIsPruningInProgress())return void Je();let pn=(function(){let Mn;if(isNaN(t)||se()===r.default.TEXT&&!ne.isTextEnabled())return null;if(T){const Ln=bt();Mn=U?T.getSegmentRequestForTime(c,Ln,t):x?T.repeatSegmentRequest(c,Ln):T.getNextSegmentRequest(c,Ln)}return Mn})();pn?(U=!1,x=!1,(function(Mn){isNaN(Mn.startTime+Mn.duration)||(t=Mn.startTime+Mn.duration),Mn.delayLoadingTime=new Date().getTime()+O.getTimeToLoadDelay(),O.setTimeToLoadDelay(0),(function(Ln){let Dn=Ln.url;return Ln.range&&(Dn=Dn.concat("_",Ln.range)),ve.contains(Dn)})(Mn)?(b.warn(`Fragment request url ${Mn.url} for stream id ${oe.id} and media type ${Ee} is on the ignore list and will be skipped`),Je()):(b.debug(`Next fragment request url for stream id ${oe.id} and media type ${Ee} is ${Mn.url} with request range ${Mn.range}`),k.executeRequest(Mn))})(pn)):(function(Mn){const Ln=N.getCurrentRepresentation();if(!$e()){try{if(ue.get().streaming.gaps.enableSeekFix&&(U||Me.getTime()===0)){let Dn;if(d?d&&Ln.segmentInfoType===fe.default.SEGMENT_TIMELINE&&(Dn=(function(jn){return T.getValidTimeAheadOfTargetTime(t,c,jn,ue.get().streaming.gaps.threshold)})(Ln)):Dn=(function(jn){let zn=T.getValidTimeAheadOfTargetTime(t,c,jn,ue.get().streaming.gaps.threshold);if(isNaN(zn)){const Er=jn.adaptation.period,pr=Er.start+Er.duration;oe.isLast&&isFinite(pr)&&t<=pr&&t>=pr-jn.segmentDuration&&(zn=Math.max(Er.start,t-.1))}return zn})(Ln),!isNaN(Dn)&&Dn!==t)return void(function(jn,zn){Me.isSeeking()||Me.getTime()===0?(b.warn(`Adjusting playback time ${jn} because of gap in the manifest. Seeking by ${jn-t}`),Me.seek(jn,!1,!1)):(b.warn(`Adjusting buffering time ${jn} because of gap in the manifest. Adjusting time by ${jn-t}`),nt(jn),zn&&Je())})(Dn,Mn)}}catch(Dn){b.error(Dn)}Mn&&Je()}})(Yt)}function $e(){const Qe=N.getCurrentRepresentation(),Yt=T.isLastSegmentRequested(Qe,t);if(Yt){const pn=T.getCurrentIndex();b.debug(`Segment requesting for stream ${oe.id} has finished`),z.trigger(h.default.STREAM_REQUESTING_COMPLETED,{segmentIndex:pn},{streamId:oe.id,mediaType:Ee}),e.segmentRequestingCompleted(pn),Ze()}return Yt}function Je(){const Qe=re.getScheduleTimeout();O.startScheduleTimer(Qe)}function gt(Qe){C.addBufferState(Ee,Qe.state,O.getBufferTarget()),Qe.state!==o.BUFFER_EMPTY||Me.isSeeking()||(b.info("Buffer is empty! Stalling!"),C.pushPlayListTraceMetrics(new Date,fr.REBUFFERING_REASON))}function Et(Qe){k.syncExecutedRequestsWithBufferedRange(e.getBuffer().getAllBufferRanges(),oe.duration),Qe.quotaExceeded&&Qe.from>Me.getTime()&&nt(Qe.from),Qe.hasEnoughSpaceToAppend&&Qe.quotaExceeded&&O.startScheduleTimer()}function Jt(Qe){if(!Qe||!Qe.lastRequestAppended||!Qe.lastRequestAppended.url)return;let Yt=Qe.lastRequestAppended.url;Qe.lastRequestAppended.range&&(Yt=Yt.concat("_",Qe.lastRequestAppended.range)),b.warn(`Blacklisting segment with url ${Yt}`),ve.add(Yt)}function fn(Qe){if(b.debug(`Appended bytes for ${Qe.mediaType} and stream id ${Qe.streamId}`),Qe.segmentType===Ge.HTTPRequest.INIT_SEGMENT_TYPE){const Yt=Qe.representationId;O.setLastInitializedRepresentationId(Yt),b.info("["+Ee+"] lastInitializedRepresentationId changed to "+Yt)}m&&m.enabled?Mt(m.newRepresentation,m.oldRepresentation):K||O.startScheduleTimer(0)}function bn(){m={newRepresentation:null,oldRepresentation:null,enabled:!1}}function kn(Qe){return new Promise((Yt=>{if(!N)return Promise.resolve();let pn=null;var Mn;pn=Qe.newRepresentation?{selectedRepresentation:(Mn=Qe).newRepresentation,currentMediaInfo:Mn.newMediaInfo}:c!==null&&v.areMediaInfosEqual(c,Qe.newMediaInfo)?(function(Dn){return{currentMediaInfo:Dn.newMediaInfo,selectedRepresentation:N.getCurrentRepresentation()}})(Qe):(function(Dn){let jn=NaN;return jn=!ue.get().streaming.abr.autoSwitchBitrate[Dn.newMediaInfo.type]&&Dn.previouslySelectedRepresentation?Dn.previouslySelectedRepresentation.bitrateInKbit:J.getInitialBitrateFor(Ee),{selectedRepresentation:J.getOptimalRepresentationForBitrate(Dn.newMediaInfo,jn,!1),currentMediaInfo:Dn.newMediaInfo}})(Qe),Kn(pn.currentMediaInfo),z.trigger(),(function(Dn){D&&Dn.selectedRepresentation.dependentRepresentation&&(b.info("["+Ee+"] selectMediaInfo : call selectMediaInfo on enhancementStreamProcessor for index = "+Dn.selectedRepresentation.absoluteIndex),D.selectMediaInfo(new Lr({newMediaInfo:Dn.selectedRepresentation.mediaInfo,newRepresentation:Dn.selectedRepresentation})))})(pn);const Ln=J.getPossibleVoRepresentations(c,!1);return N.updateData(Ln,c.isFragmented,pn.selectedRepresentation.id).then((()=>{(function(){if(!e||!N)return;const Dn=N.getCurrentCompositeRepresentation();e.getIsBufferingCompleted()||e.updateBufferTimestampOffset(Dn)})(),Yt()})).catch((Dn=>{b.error(Dn),Yt()}))}))}function Kn(Qe){v.areMediaInfosEqual(c,Qe)||z.trigger(H.default.NEW_TRACK_SELECTED,{value:Qe}),c=Qe,J.handleNewMediaInfo(c),z.trigger(h.default.MEDIAINFO_UPDATED,{mediaType:Ee,streamId:oe.id,currentMediaInfo:c})}function Un(Qe){const Yt=Qe.newRepresentation,pn=Qe.oldRepresentation,Mn=Kt();Yt&&pn||b.warn("_handleDifferentSwitchTypes() is missing the target representations"),Qe.reason&&Qe.reason.forceReplace?(function(Ln,Dn){k.abortRequests(),z.trigger(h.default.BUFFER_REPLACEMENT_STARTED,{mediaType:Ee,streamId:oe.id},{mediaType:Ee,streamId:oe.id}),O.setShouldCheckPlaybackQuality(!1),e.prepareForForceReplacementQualitySwitch(Ln,Dn).then((()=>{Bn()})).catch((()=>{Bn()}))})(Yt,pn):Qe&&Qe.reason&&Qe.reason.forceAbandon?(function(Ln,Dn){e.prepareForAbandonQualitySwitch(Ln,Dn).then((()=>{xn()})).catch((()=>{xn()}))})(Yt,pn):!re.getFastSwitchEnabled()||Mn&&Mn.isPartialSegment?Mt(Yt,pn):(function(Ln,Dn){const jn=Me.getTime();let zn=1.5*(isNaN(Ln.fragmentDuration)?1:Ln.fragmentDuration);const Er=k.getRequests({state:Ue.FRAGMENT_MODEL_EXECUTED,time:jn+zn,threshold:0})[0];if(Er&&!c.isText){const pr=e.getBufferLevel(),vr=J.getAbandonmentStateFor(oe.id,Ee),Ur=Ee===r.default.VIDEO&&Ln.dependentRepresentation?Ln.dependentRepresentation.bandwidth:Ln.bandwidth;Er.bandwidth<Ur&&pr>=zn&&vr===o.ALLOW_LOAD?e.prepareForFastQualitySwitch(Ln,Dn).then((()=>{rt(jn,zn)})).catch((()=>{rt(jn,zn)})):Mt(Ln,Dn)}else Mt(Ln,Dn)})(Yt,pn),C.pushPlayListTraceMetrics(new Date,fr.REPRESENTATION_SWITCH_STOP_REASON),C.createPlaylistTraceMetrics(Yt.id,1e3*Me.getTime(),Me.getPlaybackRate())}function Bn(){sn(),bn(),u=!1}function xn(){k.abortRequests(),x=!0,O.setShouldCheckPlaybackQuality(!1),O.startScheduleTimer(),u=!1}function rt(Qe,Yt){k.abortRequests(),nt(Qe+Yt),O.setShouldCheckPlaybackQuality(!1),O.startScheduleTimer(),u=!1}function Mt(Qe,Yt){const pn=k.getRequests({state:Ue.FRAGMENT_MODEL_LOADING});if(pn&&pn.length>0)return b.debug("Preparing for default quality switch: Waiting for ongoing segment request to be finished before applying switch."),m.newRepresentation=Qe,m.oldRepresentation=Yt,void(m.enabled=!0);e.prepareForDefaultQualitySwitch(Qe,Yt).then((()=>{St()})).catch((()=>{St()}))}function St(){O.setShouldCheckPlaybackQuality(!1),c.segmentAlignment||c.subSegmentAlignment?O.startScheduleTimer():wn(),bn(),u=!1}function Gt(Qe){b.info("onFragmentLoadingAbandoned request: "+Qe.request.url+" has been aborted"),Me.isSeeking()||O.getSwitchTrack()||u||(b.info("onFragmentLoadingAbandoned request: "+Qe.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),Qe.request&&Qe.request.isInitializationRequest()?O.setInitSegmentRequired(!0):nt(Qe.request.startTime+Qe.request.duration/2),O.startScheduleTimer(0))}function cn(Qe){b.info("OnFragmentLoadingCompleted for stream id "+oe.id+" and media type "+Ee+" - Url:",Qe.request?Qe.request.url:"undefined",Qe.request.range?", Range:"+Qe.request.range:""),c.isText&&O.startScheduleTimer(0),Qe.error&&Qe.request.serviceLocation&&(function(Yt){b.info("Fragment loading completed with an error"),Yt&&Yt.request&&Yt.request.type&&(Yt.request.type===Ge.HTTPRequest.INIT_SEGMENT_TYPE?we({representationId:Yt.request.representation.id,sender:{}},!1):Yt.request.type===Ge.HTTPRequest.MEDIA_SEGMENT_TYPE&&(nt(Yt.request.startTime+Yt.request.duration/2),Ve(0,!1)))})(Qe)}function Nn(){nt(Me.getTime()),xe().startScheduleTimer()}function lt(Qe){const Yt=Qe.currentTrackInfo;if(!Yt)return;const pn=M.find((Mn=>Mn.index===Yt.index&&Mn.lang===Yt.lang));pn&&kn(new Lr({newMediaInfo:pn})).then((()=>{e.setIsBufferingCompleted(!1),nt(Me.getTime()),O.setInitSegmentRequired(!0),O.startScheduleTimer()}))}function Lt(Qe){nt(Qe.quotaExceededTime),Ze()}function jt(){return e?e.getBuffer():null}function xe(){return O}function Ze(){O&&O.clearScheduleTimer()}function bt(Qe=NaN){let Yt;return isNaN(Qe)?Yt=N?N.getCurrentRepresentation():null:((0,yn.checkInteger)(Qe),Yt=N?N.getRepresentationById(Qe):null),Yt}function Xe(){return!!e&&e.getIsBufferingCompleted()}function qt(Qe){if(!ue.get().streaming.enableManifestTimescaleMismatchFix)return;const Yt=Qe.chunk,pn=Yt.bytes,Mn=bt(Yt.representation.id);Mn&&(Mn.timescale=A.getMediaTimescaleFromMoov(pn))}function Xt(Qe){const Yt=Qe.chunk,pn=Yt.bytes,Mn=bt(Yt.representation.id);if(Mn){let Ln;if(ue.get().streaming.parseInbandPrft&&Qe.request.type===Ge.HTTPRequest.MEDIA_SEGMENT_TYPE){Ln=Ln||A.parse(pn);const zn=(function(Er,pr){const vr=Er.getBoxes("prft"),Ur=[];return vr.forEach((ai=>{Ur.push((function(Ir,Vr){let yr="unknown";switch(Ir.flags){case 0:yr=fe.default.PRODUCER_REFERENCE_TIME_TYPE.ENCODER;break;case 16:yr=fe.default.PRODUCER_REFERENCE_TIME_TYPE.APPLICATION;break;case 24:yr=fe.default.PRODUCER_REFERENCE_TIME_TYPE.CAPTURED}let Rr=1e3*Ir.ntp_timestamp_sec+Ir.ntp_timestamp_frac/2**32*1e3;return Rr=qo(q).getInstance().ntpToUTC(Rr),{type:yr,ntpTimestamp:Rr,mediaTime:Ir.media_time/Vr}})(ai,pr))})),Ur})(Ln,Mn.timescale);zn&&zn.length&&z.trigger(H.default.INBAND_PRFT,{data:zn},{streamId:oe.id,mediaType:Ee})}const Dn=v.getEventsFor(Mn.mediaInfo,null,oe),jn=v.getEventsFor(Mn,Mn,oe);if(Dn&&Dn.length>0||jn&&jn.length>0){const zn=Qe.request;Ln=Ln||A.parse(pn);const Er=(function(pr,vr,Ur,ai){try{const Ir={},Vr=[],yr=Ur.concat(ai);for(let Sr=0,wr=yr.length;Sr<wr;Sr++)Ir[yr[Sr].schemeIdUri+"/"+yr[Sr].value]=yr[Sr];const Rr=pr.getBoxes("emsg");if(!Rr||Rr.length===0)return Vr;const Mr=pr.getBox("sidx"),ui=!Mr||isNaN(Mr.earliest_presentation_time)||isNaN(Mr.timescale)?vr&&!isNaN(vr.mediaStartTime)?vr.mediaStartTime:0:Mr.earliest_presentation_time/Mr.timescale,Ei=Math.max(ui,0),Ti=N.getCurrentRepresentation();for(let Sr=0,wr=Rr.length;Sr<wr;Sr++){const $r=v.getEvent(Rr[Sr],Ir,Ei,Ti);$r&&Vr.push($r)}return Vr}catch{return[]}})(Ln,zn,Dn,jn);z.trigger(h.default.INBAND_EVENTS,{events:Er},{streamId:oe.id})}}}function sn(){const Qe=Me.getTime();ue.get().streaming.buffer.flushBufferAtTrackSwitch&&Me.seek(Qe+.001,!1,!0),nt(Qe),e.setSeekTarget(Qe),O.startScheduleTimer()}function wn(){const Qe=Me.getTime(),Yt=e.getContinuousBufferTimeForTargetTime(Qe);nt(isNaN(Yt)?Qe:Yt),O.startScheduleTimer()}function Te(Qe){Qe&&!isNaN(Qe.time)&&(nt(Qe.time),e.setSeekTarget(Qe.time))}function nt(Qe){t=Qe,U=!0}function Kt(){return T.getLastSegment()}return R={checkAndHandleCompletedBuffering:$e,clearScheduleTimer:Ze,createBufferSinks:function(Qe,Yt){const pn=jt();return pn?Promise.resolve(pn):e?e.createBufferSink(c,Qe,Yt):Promise.resolve(null)},dischargePreBuffer:function(){e.dischargePreBuffer()},finalisePlayList:function(Qe,Yt){C.pushPlayListTraceMetrics(Qe,Yt)},getAllMediaInfos:function(){return M},getBuffer:jt,getBufferController:function(){return e},getBufferLevel:function(){return e?e.getBufferLevel():0},getFragmentModel:function(){return k},getLastSegment:Kt,getMediaInfo:function(){return c},getMediaSource:function(){return e.getMediaSource()},getRepresentation:bt,getRepresentationController:function(){return N},getScheduleController:xe,getStreamId:te,getStreamInfo:function(){return oe},getType:se,initialize:function(Qe,Yt,pn){L=Ka(q).create({events:h.default,eventBus:z,streamInfo:oe,timelineConverter:pe,dashConstants:fe.default,segmentBaseController:n.segmentBaseController,type:Ee}),T=ka(q).create({baseURLController:n.baseURLController,boxParser:A,constants:r.default,dashConstants:fe.default,dashMetrics:C,debug:(0,p.default)(q).getInstance(),errHandler:ee,errors:Pn.default,eventBus:z,events:h.default,mediaPlayerModel:re,segmentsController:L,settings:ue,streamInfo:oe,timelineConverter:pe,type:Ee,urlUtils:(0,Ht.default)(q).getInstance()}),d=oe.manifestInfo.isDynamic,T.initialize(d),J.registerStreamType(Ee,R),N=ko(q).create({abrController:J,adapter:v,dashConstants:fe.default,dashMetrics:C,errors:Pn.default,eventBus:z,events:h.default,isDynamic:d,playbackController:Me,segmentsController:L,streamInfo:oe,timelineConverter:pe,type:Ee}),e=(function(Mn,Ln){let Dn=null;return Mn?(Dn=Mn!==r.default.TEXT||Ln?Lo(q).create({abrController:J,capabilities:y,errHandler:ee,fragmentModel:k,manifestModel:Q,mediaController:W,mediaPlayerModel:re,playbackController:Me,representationController:N,settings:ue,streamInfo:oe,textController:ne,type:Mn}):Fo(q).create({errHandler:ee,fragmentModel:k,mimeType:Ce,settings:ue,streamInfo:oe,textController:ne,type:Mn}),Dn):(ee.error(new un.default(Pn.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,Pn.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+"not properly defined")),null)})(Ee,pn),e&&e.initialize(Qe),O=Uo(q).create({abrController:J,adapter:v,bufferController:e,dashMetrics:C,fragmentModel:k,mediaController:W,mediaPlayerModel:re,mimeType:Ce,playbackController:Me,representationController:N,settings:ue,streamInfo:oe,textController:ne,type:Ee}),l=Yt,O.initialize(Yt),t=0,U=!1,x=!1},isBufferingCompleted:Xe,prepareInnerPeriodPlaybackSeeking:function(Qe){return new Promise((Yt=>{if(e.hasBufferAtTime(Qe.seekTime))return e.pruneBuffer(),ge(e.getContinuousBufferTimeForTargetTime(Qe.seekTime))&&e.setIsBufferingCompleted(!0),void Yt();Ze(),k.abortRequests(),e.prepareForPlaybackSeek().then((()=>{const pn=e.getAllRangesWithSafetyFactor(Qe.seekTime);return e.clearBuffers(pn)})).then((()=>{const pn=e.getContinuousBufferTimeForTargetTime(Qe.seekTime);if(ge(pn))e.setIsBufferingCompleted(!0),Yt();else{const Mn=isNaN(pn)?Qe.seekTime:pn;nt(Mn),e.setSeekTarget(Mn);const Ln=[];Ln.push(e.updateAppendWindow());const Dn=bt();Ln.push(e.updateBufferTimestampOffset(Dn)),Promise.all(Ln).then((()=>{O.setInitSegmentRequired(!0),O.setShouldCheckPlaybackQuality(!1),O.startScheduleTimer(),Yt()}))}})).catch((pn=>{b.error(pn)}))}))},prepareOuterPeriodPlaybackSeeking:function(){return new Promise(((Qe,Yt)=>{try{Ze(),k.abortRequests(),e.prepareForPlaybackSeek().then((()=>e.pruneAllSafely())).then((()=>{Qe()}))}catch(pn){Yt(pn)}}))},prepareQualityChange:function(Qe){Qe.newRepresentation&&((function(Yt){if(D)D.prepareQualityChange(Yt);else if(Ee===r.default.ENHANCEMENT){const pn=Yt.oldRepresentation.mediaInfo.type,Mn=Yt.newRepresentation.mediaInfo.type;if(pn===r.default.ENHANCEMENT&&Mn===r.default.VIDEO)return b.info("Stop "+Ee+" stream processor"),O.reset(),!0;if(pn===r.default.VIDEO&&Mn===r.default.ENHANCEMENT)return b.info("Start "+Ee+" stream processor"),kn(new Lr({newMediaInfo:Yt.newRepresentation.mediaInfo,newRepresentation:Yt.newRepresentation})).then((()=>{O.setup(),O.initialize(l),O.startScheduleTimer()})),!0}return!1})(Qe)||(m&&m.enabled&&b.warn(`Canceling queued representation switch to ${m.newRepresentation.id} for ${Ee}`),Qe.isAdaptationSetSwitch?(b.debug(`Preparing quality switch to different AdaptationSet for type ${Ee} from representation id ${Qe.oldRepresentation.id} to ${Qe.newRepresentation.id}`),(function(Yt){const pn=Yt.newRepresentation;u=!0,Ze(),O.setSwitchTrack(!0);const Mn=pn.mediaInfo;Kn(Mn),kn(new Lr({newMediaInfo:Mn,newRepresentation:pn})).then((()=>{Un(Yt)}))})(Qe)):(b.debug(`Preparing quality within the same AdaptationSet for type ${Ee} from representation id ${Qe.oldRepresentation.id} to ${Qe.newRepresentation.id}`),(function(Yt){const pn=Yt.newRepresentation;u=!0,Ze(),N.prepareQualityChange(pn),Un(Yt)})(Qe))))},prepareTrackSwitch:function(Qe,Yt=!1){return new Promise((pn=>{b.debug(`Preparing track switch for type ${Ee}`);const Mn=Ee===r.default.TEXT||Yt||ue.get().streaming.trackSwitchMode[Ee]===r.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&Me.getTimeToStreamEnd(oe)>ue.get().streaming.buffer.stallThreshold;e.getIsBufferingCompleted()&&!Mn?(function(Ln){return new Promise((Dn=>{const jn=N.getCurrentRepresentation();e.prepareForNonReplacementTrackSwitch(jn,Ln).then((()=>{z.trigger(h.default.BUFFERING_COMPLETED,{},{streamId:oe.id,mediaType:Ee}),Dn()})).catch((()=>{z.trigger(h.default.BUFFERING_COMPLETED,{},{streamId:oe.id,mediaType:Ee}),Dn()}))}))})(Qe).then((()=>{pn()})):(O.setSwitchTrack(!0),Mn?(function(Ln){return new Promise((Dn=>{z.trigger(h.default.BUFFER_REPLACEMENT_STARTED,{mediaType:Ee,streamId:oe.id},{mediaType:Ee,streamId:oe.id}),k.abortRequests();const jn=bt();e.prepareForReplacementTrackSwitch(jn,Ln).then((()=>{sn(),Dn()})).catch((()=>{sn(),Dn()}))}))})(Qe).then((()=>{pn()})):(function(Ln){return new Promise((Dn=>{const jn=()=>{const zn=k.getRequests({state:Ue.FRAGMENT_MODEL_LOADING});if(zn&&zn.length!==0)z.once(H.default.FRAGMENT_LOADING_COMPLETED,jn,R);else{const Er=bt();e.prepareForNonReplacementTrackSwitch(Er,Ln).then((()=>{wn(),Dn()})).catch((pr=>{b.error(pr),wn(),Dn()}))}};jn()}))})(Qe).then((()=>{pn()})))}))},probeNextRequest:function(){const Qe=bt();return T.getNextSegmentRequestIdempotent(c,Qe)},reset:function(Qe,Yt){T&&T.reset(),e&&(e.reset(Qe,Yt),e=null),O&&(O.reset(),O=null),N&&(N.reset(),N=null),L&&(L=null),J&&J.unRegisterStreamType(te(),Ee),z.off(h.default.BUFFER_CLEARED,Et,R),z.off(h.default.BUFFER_LEVEL_STATE_CHANGED,gt,R),z.off(h.default.BYTES_APPENDED_END_FRAGMENT,fn,R),z.off(h.default.FRAGMENT_LOADING_ABANDONED,Gt,R),z.off(h.default.FRAGMENT_LOADING_COMPLETED,cn,R),z.off(h.default.INIT_FRAGMENT_LOADED,qt,R),z.off(h.default.INIT_FRAGMENT_NEEDED,we,R),z.off(h.default.MEDIA_FRAGMENT_LOADED,Xt,R),z.off(h.default.MEDIA_FRAGMENT_NEEDED,Ve,R),z.off(h.default.QUOTA_EXCEEDED,Lt,R),z.off(h.default.SEEK_TARGET,Te,R),z.off(h.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,Nn,R),z.off(h.default.SET_NON_FRAGMENTED_TEXT,lt,R),z.off(h.default.SOURCE_BUFFER_ERROR,Jt,R),Ae(),Ee=null,oe=null},selectMediaInfo:kn,setEnhancementStreamProcessor:function(Qe){D=Qe,b.info("enhancementStreamProcessor = "+D)},setExplicitBufferingTime:nt,setMediaInfoArray:function(Qe){M=Qe},setMediaSource:function(Qe){return e.setMediaSource(Qe,c)},setTrackSwitchInProgress:function(Qe){K=Qe},updateStreamInfo:function(Qe){return oe=Qe,oe.manifestInfo.isDynamic!==d&&(d=oe.manifestInfo.isDynamic,T.initialize(d),N.setIsDynamic(d)),Xe()?Promise.resolve():e.updateAppendWindow()}},b=(0,p.default)(q).getInstance().getLogger(R),Ae(),z.on(h.default.BUFFER_CLEARED,Et,R),z.on(h.default.BUFFER_LEVEL_STATE_CHANGED,gt,R),z.on(h.default.BYTES_APPENDED_END_FRAGMENT,fn,R),z.on(h.default.FRAGMENT_LOADING_ABANDONED,Gt,R),z.on(h.default.FRAGMENT_LOADING_COMPLETED,cn,R),z.on(h.default.INIT_FRAGMENT_LOADED,qt,R),z.on(h.default.INIT_FRAGMENT_NEEDED,we,R),z.on(h.default.MEDIA_FRAGMENT_LOADED,Xt,R),z.on(h.default.MEDIA_FRAGMENT_NEEDED,Ve,R),z.on(h.default.QUOTA_EXCEEDED,Lt,R),z.on(h.default.SEEK_TARGET,Te,R),z.on(h.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,Nn,R),z.on(h.default.SET_NON_FRAGMENTED_TEXT,lt,R),z.on(h.default.SOURCE_BUFFER_ERROR,Jt,R),R}Wa.__dashjs_factory_name="StreamProcessor";var Ko=F.default.getClassFactory(Wa),jo=class{constructor(){this.url=null,this.width=null,this.height=null,this.x=null,this.y=null}},Wo=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=""}},za=P(9838),$a=P(447),Qa=P(5099);function Xa(n){const e=this.context,t=n.adapter,l=n.baseURLController,c=n.streamInfo,T=n.timelineConverter,D=n.debug,R=n.eventBus,d=n.events,b=n.dashConstants,M=(0,Ht.default)(e).getInstance();let m,u,N,O,L,x,U,K,q;function z(v,A){const y=new Wo;y.id=v.id,y.bitrate=v.bandwidth,y.width=v.width,y.height=v.height,y.tilesHor=1,y.tilesVert=1,v.essentialProperties&&v.essentialProperties.forEach((C=>{if(r.default.THUMBNAILS_SCHEME_ID_URIS.indexOf(C.schemeIdUri)>=0&&C.value){const ee=C.value.split("x");ee.length!==2||isNaN(ee[0])||isNaN(ee[1])||(y.tilesHor=parseInt(ee[0],10),y.tilesVert=parseInt(ee[1],10))}})),A?U.updateSegmentData(v).then((C=>{(function(ee,k,Q){let W=[];const re=(function(Ce,Me){const ve=[];let ue,oe,ne,pe,Ee=0;for(ue=0,oe=Ce.segments.length;ue<oe;ue++)ne=Ce.segments[ue],pe=Oi({durationInTimescale:ne.duration,fTimescale:ne.timescale,index:Ee,isDynamic:t.getIsDynamic(),mediaRange:ne.mediaRange,mediaTime:ne.startTime,mediaUrl:ne.media,representation:Me,timelineConverter:T}),pe&&(ve.push(pe),pe=null,Ee++);return ve})(Q,k);k.segments=re,k.fragmentDuration=k.segmentDuration||(k.segments&&k.segments.length>0?k.segments[0].duration:NaN),ee.segmentDuration=k.segments[0].duration,ee.readThumbnail=function(Ce,Me){let ve=null;W.some((ue=>{if(ue.start<=Ce&&ue.end>Ce)return ve=ue.url,!0})),ve?Me(ve):k.segments.some((ue=>{if(ue.mediaStartTime<=Ce&&ue.mediaStartTime+ue.duration>Ce){const oe=l.resolve(k.path),ne=new $a.default({method:"get",url:oe.url,responseType:"arraybuffer",customData:{request:{range:ue.mediaRange},onloadend:function(Ee){let te=q.getSamplesInfo(Ee.target.response),se=new Blob([Ee.target.response.slice(te.sampleList[0].offset,te.sampleList[0].offset+te.sampleList[0].size)],{type:"image/jpeg"}),Ae=window.URL.createObjectURL(se);W.push({start:ue.mediaStartTime,end:ue.mediaStartTime+ue.duration,url:Ae}),Me&&Me(Ae)}}}),pe=new Qa.default({request:ne});return K.load(ne,pe),!0}}))}})(y,v,C)})):(y.startNumber=v.startNumber,y.segmentDuration=v.segmentDuration,y.timescale=v.timescale,y.templateUrl=(function(C){const ee=M.isRelative(C.media)?M.resolve(C.media,l.resolve(C.path).url):C.media;return ee?li(ee,C.id):""})(v)),y.tilesHor>0&&y.tilesVert>0&&(y.widthPerTile=y.width/y.tilesHor,y.heightPerTile=y.height/y.tilesVert,u.push(y))}function J(){u=[],N=[],L=-1,x=null,O&&(O.reset(),O=null)}return m={addTracks:function(){if(!c||!t||(x=t.getMediaInfoForType(c,r.default.IMAGE),!x))return;const v=t.getVoRepresentations(x);v&&v.length>0&&v.forEach((A=>{(A.segmentInfoType===fe.default.SEGMENT_TEMPLATE&&A.segmentDuration>0&&A.media||A.segmentInfoType===fe.default.SEGMENT_TIMELINE)&&z(A),A.segmentInfoType===fe.default.SEGMENT_BASE&&z(A,!0),N.push(A)})),u.length>0&&u.sort(((A,y)=>A.bitrate-y.bitrate))},getCurrentTrack:function(){return L<0?null:u[L]},getCurrentTrackIndex:function(){return L},getRepresentations:function(){return N},getThumbnailRequestForTime:function(v){let A;const y=t.getVoRepresentations(x);for(let C=0;C<y.length;C++)if(u[L].id===y[C].id){A=y[C];break}return O.getSegmentRequestForTime(x,A,v)},getTracks:function(){return u},reset:J,setTrackById:function(v){if(!u||u.length===0)return;const A=u.findIndex((y=>y.id===v));A!==-1&&(L=A)},setTrackByIndex:function(v){u&&u.length!==0&&(v>=u.length&&(v=u.length-1),L=v)}},J(),K=(0,za.default)(e).create({}),q=ar(e).getInstance(),U=Ka(e).create({events:d,eventBus:R,streamInfo:c,timelineConverter:T,dashConstants:b,dashMetrics:n.dashMetrics,segmentBaseController:n.segmentBaseController,type:r.default.IMAGE}),O=ka(e).create({streamInfo:c,type:r.default.IMAGE,timelineConverter:T,segmentsController:U,baseURLController:l,debug:D,eventBus:R,events:d,dashConstants:b,urlUtils:M}),O.initialize(!!t&&t.getIsDynamic()),m}Xa.__dashjs_factory_name="ThumbnailTracks";var zo=F.default.getClassFactory(Xa);function Za(n){const e=this.context,t=n.streamInfo;let l,c;function T(R){c.setTrackByIndex(R)}function D(){c&&c.reset()}return l={getCurrentTrack:function(){return c.getCurrentTrack()},getCurrentTrackIndex:function(){return c.getCurrentTrackIndex()},getPossibleVoRepresentations:function(){return c.getRepresentations()},getStreamId:function(){return t.id},initialize:function(){c.addTracks();const R=c.getTracks();R&&R.length>0&&T(0)},provide:function(R,d){if(typeof d!="function")return;const b=c.getCurrentTrack();let M,m;if(!b||b.segmentDuration<=0||R==null)return void d(null);m=c.getThumbnailRequestForTime(R),m&&(b.segmentDuration=m.duration),M=R%b.segmentDuration;const u=Math.floor(M*b.tilesHor*b.tilesVert/b.segmentDuration),N=new jo;if(N.width=Math.floor(b.widthPerTile),N.height=Math.floor(b.heightPerTile),N.x=Math.floor(u%b.tilesHor)*b.widthPerTile,N.y=Math.floor(u/b.tilesHor)*b.heightPerTile,"readThumbnail"in b)return b.readThumbnail(R,(O=>{N.url=O,d(N)}));if(m)N.url=m.url,b.segmentDuration=NaN;else{const O=Math.floor(R/b.segmentDuration);N.url=(function(L,x){const U=x+L.startNumber;return li(L.templateUrl,void 0,U,void 0,L.bandwidth,(U-1)*L.segmentDuration*L.timescale)})(b,O)}d(N)},reset:D,setTrackByIndex:T,setTrackById:function(R){c.setTrackById(R)}},D(),c=zo(e).create({streamInfo:t,adapter:n.adapter,baseURLController:n.baseURLController,timelineConverter:n.timelineConverter,debug:n.debug,eventBus:n.eventBus,events:n.events,dashConstants:n.dashConstants,dashMetrics:n.dashMetrics,segmentBaseController:n.segmentBaseController}),l}Za.__dashjs_factory_name="ThumbnailController";var $o=F.default.getClassFactory(Za);const Qo=[r.default.VIDEO,r.default.AUDIO,r.default.TEXT,r.default.MUXED,r.default.IMAGE];function Ja(n){n=n||{};const e=this.context,t=(0,g.default)(e).getInstance(),l=(0,Ht.default)(e).getInstance(),c=n.manifestModel,T=n.mediaPlayerModel,D=n.dashMetrics,R=n.manifestUpdater,d=n.adapter,b=n.timelineConverter,M=n.capabilities,m=n.errHandler,u=n.abrController,N=n.playbackController,O=n.throughputController,L=n.eventController,x=n.mediaController,U=n.protectionController,K=n.textController,q=n.videoModel;let z=n.streamInfo;const J=n.settings;let v,A,y,C,ee,k,Q,W,re,Ce,Me,ve,ue,oe,ne,pe;function Ee(lt,Lt,jt){return new Promise(((xe,Ze)=>{gt(),Jt();let bt=q.getElement();const Xe=[];Qo.forEach((qt=>{if((qt!==r.default.TEXT||lt)&&(qt!==r.default.VIDEO||!bt||bt&&/^VIDEO$/i.test(bt.nodeName))){const Xt=jt.find((sn=>sn.mediaInfo.type===qt));Xe.push(te(qt,lt,Xt))}})),Promise.all(Xe).then((()=>(function(qt,Xt){return new Promise((sn=>{const wn={},Te=oe.map((nt=>{const Kt=nt.getRepresentation(),Qe=Xt.find((Yt=>Yt.mediaInfo.type===Kt.mediaInfo.type));return nt.createBufferSinks(qt,Qe)}));Promise.all(Te).then((nt=>{nt.forEach((Kt=>{Kt&&(wn[Kt.getType()]=Kt)})),sn(wn)})).catch((()=>{sn(wn)}))}))})(Lt,jt))).then((qt=>{if(oe.length===0){const Xt="No streams to play.";m.error(new un.default(Pn.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,Xt,c.getValue())),Me.fatal(Xt)}else Gt();lt&&K.createTracks(z),xe(qt)})).catch((qt=>{Ze(qt)}))}))}function te(lt,Lt,jt){let xe,Ze=d.getAllMediaInfoForType(z,lt),bt=[],Xe=null,qt=-1;if(!Ze||Ze.length===0)return Me.info("No "+lt+" data."),Promise.resolve();lt===r.default.VIDEO&&(k=!0),lt===r.default.AUDIO&&(C=!0);for(let sn=0,wn=Ze.length;sn<wn;sn++)Xe=Ze[sn],lt===r.default.TEXT&&Xe.isEmbedded&&(K.addEmbeddedTrack(z,Xe),bt.push(Xe)),se(Xe)&&x.addTrack(Xe),Xe.type===r.default.ENHANCEMENT&&(qt=sn);if(bt.length>0&&(x.setInitialMediaSettingsForType(lt,z),K.addMediaInfosToBuffer(z,lt,bt)),Ze=Ze.filter((sn=>!sn.isEmbedded)),Ze.length===0)return Promise.resolve();if(lt===r.default.IMAGE)return ne=$o(e).create({streamInfo:z,adapter:d,baseURLController:n.baseURLController,timelineConverter:n.timelineConverter,debug:A,eventBus:t,events:h.default,dashConstants:fe.default,dashMetrics:n.dashMetrics,segmentBaseController:n.segmentBaseController}),ne.initialize(),Promise.resolve();t.trigger(h.default.STREAM_INITIALIZING,{streamInfo:z,mediaInfo:Xe}),x.setInitialMediaSettingsForType(lt,z);let Xt=Ae(Ze,Lt,lt);if(qt>=0){let sn=new bo(t);sn.open(),sn.duration=z.manifestInfo.duration;let wn=Ae(Ze,sn,r.default.ENHANCEMENT);wn.selectMediaInfo(new Lr({newMediaInfo:Ze[qt]})),Xt.setEnhancementStreamProcessor(wn)}if(xe=x.getCurrentTrackFor(lt,z.id),xe){const sn=lt===r.default.TEXT&&xe.isEmbedded?Ze[0]:xe,wn=new Lr({newMediaInfo:sn,previouslySelectedRepresentation:jt});return Xt.selectMediaInfo(wn)}return Promise.resolve()}function se(lt){const Lt=lt?lt.type:null;let jt;return Lt===r.default.MUXED?(jt="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",Me.fatal(jt),m.error(new un.default(Pn.default.MANIFEST_ERROR_ID_MULTIPLEXED_CODE,jt,c.getValue())),!1):!(Lt!==r.default.TEXT&&Lt!==r.default.IMAGE&&lt.contentProtection&&lt.contentProtection.length>0&&!M.supportsEncryptedMedia()&&(m.error(new un.default(Pn.default.CAPABILITY_MEDIAKEYS_ERROR_CODE,Pn.default.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE)),1))}function Ae(lt,Lt,jt){const xe=lt&&lt.length>0?lt.filter((sn=>sn.type===jt))[0]:null;let Ze=y.getModel(xe?xe.type:null);const bt=xe?xe.type:null,Xe=xe?xe.mimeType:null,qt=xe?xe.isFragmented:null;let Xt=Ko(e).create({abrController:u,adapter:d,baseURLController:n.baseURLController,boxParser:v,capabilities:M,dashMetrics:n.dashMetrics,errHandler:m,fragmentModel:Ze,manifestModel:c,mediaController:x,mediaPlayerModel:T,mimeType:Xe,playbackController:N,segmentBaseController:n.segmentBaseController,segmentBlacklistController:ue,settings:J,streamInfo:z,textController:K,throughputController:O,timelineConverter:b,type:bt});return Xt.initialize(Lt,k,qt),oe.push(Xt),Xt.setMediaInfoArray(lt),bt===r.default.TEXT&&K.addMediaInfosToBuffer(z,bt,lt,Ze),Xt}function ge(lt){let Lt=oe?oe.length:0;for(let jt=0;jt<Lt;jt++){let xe=oe[jt].getFragmentModel();xe.abortRequests(),xe.resetInitialSettings(),oe[jt].reset(!1,lt)}K&&K.deactivateStream(z),ne&&(ne.reset(),ne=null),oe=[],W=!1,ee=!1,cn(!1),Ve(!1),t.trigger(h.default.STREAM_DEACTIVATED,{streamInfo:z})}function we(lt){ge(lt),Ce=!1,k=!1,C=!1,re=!1,pe=[]}function Ve(lt){re=lt}function $e(){return z?z.start:NaN}function Je(){return z?z.id:null}function gt(){if(!q||!u)throw new Error(r.default.MISSING_CONFIG_ERROR)}function Et(lt){lt.error&&(m.error(lt.error),Me.fatal(lt.error.message))}function Jt(){if(L){const lt=d.getEventsFor(z);lt&&lt.length>0&&L.addInlineEvents(lt,z.id)}}function fn(lt){let Lt=bn(lt);return Lt?Lt.getMediaInfo():null}function bn(lt){return lt?oe.find((Lt=>Lt.getType()===lt)):null}function kn(){let lt=Mt();const Lt=lt.length;if(Lt!==0){for(let jt=0;jt<Lt;jt++)if(!lt[jt].isBufferingCompleted()&&(lt[jt].getType()===r.default.AUDIO||lt[jt].getType()===r.default.VIDEO))return void Me.debug("onBufferingCompleted - One streamProcessor has finished but",lt[jt].getType(),"one is not buffering completed");Me.debug("onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED"),ee=!0,t.trigger(h.default.STREAM_BUFFERING_COMPLETED,{streamInfo:z},{streamInfo:z})}else Me.warn("onBufferingCompleted - can't trigger STREAM_BUFFERING_COMPLETED because no streamProcessor is defined")}function Kn(lt){L&&L.addInbandEvents(lt.events,z.id)}function Un(){Gt()}function Bn(){Jt()}function xn(lt){return lt&&lt.type?rt(lt.type):null}function rt(lt){return lt?Mt().filter((function(Lt){return Lt.getType()===lt}))[0]:null}function Mt(){let lt,Lt,jt=[];for(let xe=0;xe<oe.length;xe++)Lt=oe[xe],lt=Lt.getType(),lt!==r.default.AUDIO&&lt!==r.default.VIDEO&&lt!==r.default.TEXT&&lt!==r.default.ENHANCEMENT||jt.push(Lt);return jt}function St(){const lt=oe.length;for(let Lt=0;Lt<lt&&oe[Lt];Lt++)oe[Lt].getScheduleController().startScheduleTimer()}function Gt(){const lt=oe.length;if(U){U.clearMediaInfoArray();for(let Lt=0;Lt<lt&&oe[Lt];Lt++){const jt=oe[Lt].getType(),xe=oe[Lt].getMediaInfo();if(jt===r.default.AUDIO||jt===r.default.VIDEO||jt===r.default.TEXT&&xe&&xe.isFragmented){let Ze=oe[Lt].getMediaInfo();Ze&&U.initializeForMedia(Ze)}}U.handleKeySystemFromManifest()}Ce||(Ce=!0,q.waitForReadyState(r.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,(()=>{t.trigger(h.default.STREAM_INITIALIZED,{streamInfo:z})})))}function cn(lt){ve=lt}function Nn(){return ve}return Q={activate:function(lt,Lt,jt=[]){return new Promise(((xe,Ze)=>{if(!W)return Nn()?(W=!0,t.trigger(h.default.STREAM_ACTIVATED,{streamInfo:z}),void xe()):void(function(bt,Xe,qt=[]){return Ee(bt,Xe,qt)})(lt,Lt,jt).then((()=>{W=!0,jt&&jt.length>0&&St(),t.trigger(h.default.STREAM_ACTIVATED,{streamInfo:z}),xe()})).catch((bt=>{Ze(bt)}));xe()}))},checkAndHandleCompletedBuffering:function(){ee||oe.forEach((lt=>{lt.checkAndHandleCompletedBuffering()}))},deactivate:ge,getAdapter:function(){return d},getCurrentMediaInfoForType:function(lt){const Lt=rt(lt);return Lt?Lt.getMediaInfo():null},getCurrentRepresentationForType:function(lt){const Lt=rt(lt);return Lt?Lt.getRepresentation():null},getDuration:function(){return z?z.duration:NaN},getHasAudioTrack:function(){return C},getHasFinishedBuffering:function(){return ee},getHasVideoTrack:function(){return k},getId:Je,getIsActive:function(){return W},getIsEndedEventSignaled:function(){return re},getPreloaded:Nn,getRepresentationForTypeById:function(lt,Lt){let jt;if(lt===r.default.IMAGE){if(!ne)return null;jt=ne.getPossibleVoRepresentations()}else jt=(function(bt){let Xe=bn(bt);return Xe?Xe.getAllMediaInfos():[]})(lt).flatMap((bt=>u.getPossibleVoRepresentationsFilteredBySettings(bt,!0)));if(!jt||jt.length===0)return null;const xe=jt.filter((Ze=>Ze.id===Lt));return xe&&xe.length>0?xe[0]:null},getRepresentationForTypeByIndex:function(lt,Lt){let jt;if(lt===r.default.IMAGE){if(!ne)return null;jt=ne.getPossibleVoRepresentations()}else{const xe=fn(lt);jt=u.getPossibleVoRepresentationsFilteredBySettings(xe,!0)}return jt[Lt=Math.max(Math.min(Lt,jt.length-1),0)]},getRepresentationsByType:function(lt,Lt=!0){if(gt(),lt===r.default.IMAGE)return ne?ne.getPossibleVoRepresentations():[];const jt=fn(lt);return Lt?u.getPossibleVoRepresentationsFilteredBySettings(jt,!0):u.getPossibleVoRepresentations(jt,!0)},getStartTime:$e,getStreamId:function(){return z?z.id:null},getStreamInfo:function(){return z},getStreamProcessors:Mt,getThumbnailController:function(){return ne},initialize:function(){ue.initialize(),t.on(h.default.BUFFERING_COMPLETED,kn,Q),t.on(h.default.INBAND_EVENTS,Kn,Q),t.on(h.default.DATA_UPDATE_COMPLETED,Un,Q),t.on(H.default.PLAYBACK_SEEKED,Bn,Q),U&&(t.on(h.default.KEY_ERROR,Et,Q),t.on(h.default.SERVER_CERTIFICATE_UPDATED,Et,Q),t.on(h.default.LICENSE_REQUEST_COMPLETE,Et,Q),t.on(h.default.KEY_SYSTEM_SELECTED,Et,Q),t.on(h.default.KEY_SESSION_CREATED,Et,Q)),K.initializeForStream(z),t.trigger(h.default.STREAM_UPDATED,{streamInfo:z})},initializeForTextWithMediaSource:function(lt){return new Promise(((Lt,jt)=>{te(r.default.TEXT,lt,null).then((()=>(function(){const xe=rt(r.default.TEXT);return xe?xe.createBufferSinks():Promise.resolve()})())).then((()=>{K.createTracks(z),Lt()})).catch((xe=>{jt(xe)}))}))},prepareQualityChange:function(lt){const Lt=rt(lt.mediaType);Lt&&Lt.prepareQualityChange(lt)},prepareTrackChange:function(lt){if(!W||!z)return;ee=!1;let Lt=lt.newMediaInfo,jt=c.getValue(),xe=xn(Lt);if(!xe)return;let Ze=N.getTime();if(Me.info("Stream - Process track changed at current time "+Ze),jt.refreshManifestOnSwitchTrack)pe.push(lt),R.getIsUpdating()||(Me.debug("Stream - Refreshing manifest for switch track"),R.refreshManifest());else{xe.clearScheduleTimer(),xe.setTrackSwitchInProgress(!0);const bt=xe.getRepresentation();xe.selectMediaInfo(new Lr({newMediaInfo:Lt})).then((()=>{const Xe=!!(lt&&lt.options&&lt.options.hasOwnProperty("replaceBuffer"))&&lt.options.replaceBuffer;return xe.prepareTrackSwitch(bt,Xe)})).then((()=>{xe.setTrackSwitchInProgress(!1)}))}},reset:function(lt){y&&(y.reset(),y=null),u&&z&&u.clearDataForStream(z.id),ue&&(ue.reset(),ue=null),K&&z&&K.clearDataForStream(z.id),x&&z&&x.clearDataForStream(z.id),we(lt),z=null,t.off(h.default.BUFFERING_COMPLETED,kn,Q),t.off(h.default.INBAND_EVENTS,Kn,Q),t.off(h.default.DATA_UPDATE_COMPLETED,Un,Q),t.off(H.default.PLAYBACK_SEEKED,Bn,Q),U&&(t.off(h.default.KEY_ERROR,Et,Q),t.off(h.default.SERVER_CERTIFICATE_UPDATED,Et,Q),t.off(h.default.LICENSE_REQUEST_COMPLETE,Et,Q),t.off(h.default.KEY_SYSTEM_SELECTED,Et,Q),t.off(h.default.KEY_SESSION_CREATED,Et,Q))},setIsEndedEventSignaled:Ve,setMediaSource:function(lt){return new Promise(((Lt,jt)=>{const xe=[];for(let Ze=0;Ze<oe.length;)se(oe[Ze].getMediaInfo())?(xe.push(oe[Ze].setMediaSource(lt)),Ze++):(oe[Ze].reset(),oe.splice(Ze,1));Promise.all(xe).then((()=>{for(let Ze=0;Ze<oe.length;Ze++)oe[Ze].dischargePreBuffer();if(oe.length===0){const Ze="No streams to play.";m.error(new un.default(Pn.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,Ze+"nostreams",c.getValue())),Me.fatal(Ze)}Lt()})).catch((Ze=>{Me.error(Ze),jt(Ze)}))}))},startPreloading:function(lt,Lt,jt=[]){return new Promise(((xe,Ze)=>{Nn()?Ze():(Me.info(`[startPreloading] Preloading next stream with id ${Je()}`),cn(!0),Ee(lt,Lt,jt).then((()=>{for(let bt=0;bt<oe.length&&oe[bt];bt++)oe[bt].setExplicitBufferingTime($e()),oe[bt].getScheduleController().startScheduleTimer();xe()})).catch((()=>{cn(!1),Ze()})))}))},startScheduleControllers:St,triggerProtectionError:function(lt){Et(lt)},updateData:function(lt){return new Promise((Lt=>{z=lt,L&&Jt();let jt,xe=[];for(let Ze=0,bt=oe.length;Ze<bt;Ze++){let Xe=oe[Ze];const qt=Xe.getMediaInfo();xe.push(Xe.updateStreamInfo(z));let Xt=d.getAllMediaInfoForType(z,Xe.getType());if(Xt=Xt.filter((sn=>!sn.isEmbedded)),Xe.setMediaInfoArray(Xt),Xt)for(let sn=0;sn<Xt.length;sn++)d.areMediaInfosEqual(qt,Xt[sn])&&xe.push(Xe.selectMediaInfo(new Lr({newMediaInfo:Xt[sn]})))}Promise.all(xe).then((()=>{let Ze=[];for(;pe.length>0;){let bt=pe.pop(),Xe=bt.newMediaInfo;if(jt=xn(bt.oldMediaInfo),!jt)return;const qt=jt.getRepresentation();jt.setTrackSwitchInProgress(!0),Ze.push(jt.prepareTrackSwitch(qt)),Ze.push(jt.selectMediaInfo(new Lr({newMediaInfo:Xe})))}return Promise.all(Ze)})).then((()=>{Gt(),jt&&jt.setTrackSwitchInProgress(!1),t.trigger(h.default.STREAM_UPDATED,{streamInfo:z}),Lt()})).catch((Ze=>{m.error(Ze)}))}))}},(function(){try{A=(0,p.default)(e).getInstance(),Me=A.getLogger(Q),we(),v=ar(e).getInstance(),ue=Fn(e).create({updateEventName:h.default.SEGMENT_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:h.default.SEGMENT_LOCATION_BLACKLIST_ADD,enableExpiry:!1}),y=Po(e).create({streamInfo:z,mediaPlayerModel:T,dashMetrics:D,errHandler:m,settings:J,boxParser:v,dashConstants:fe.default,urlUtils:l})}catch(lt){throw lt}})(),Q}Ja.__dashjs_factory_name="Stream";var Xo=F.default.getClassFactory(Ja);function Fi(){const n=this.context,e=(0,g.default)(n).getInstance(),t=(0,Ht.default)(n).getInstance();let l,c,T,D,R,d,b,M,m,u,N,O,L,x,U,K;function q(){M=[],m=[],u=null,N=null,L=null,O=NaN,T=!1,D=!1,x=R.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function z(){R.get().streaming.utcSynchronization.enabled&&!T&&!D&&L&&L.value&&L.schemeIdUri&&!isNaN(O)&&!isNaN(R.get().streaming.utcSynchronization.backgroundAttempts)&&(N&&(Date.now()-N)/1e3<30||(M=[],D=!0,J(isNaN(R.get().streaming.utcSynchronization.backgroundAttempts)?2:R.get().streaming.utcSynchronization.backgroundAttempts)))}function J(oe){try{if(oe<=0)return void ve();const ne=Date.now();d[L.schemeIdUri](L.value,(function(pe){const Ee=Date.now(),te=A(ne,Ee,pe);M.push(te),J(oe-1)}),(function(){ve()}))}catch{ve()}}function v(oe=null){let ne=oe||0;if(!m||m.length===0||ne>=m.length)return void y();let pe=m[ne];if(pe)if(d.hasOwnProperty(pe.schemeIdUri)){const Ee=new Date().getTime();d[pe.schemeIdUri](pe.value,(function(te){const se=new Date().getTime(),Ae=A(Ee,se,te);L=pe,y(Ae)}),(function(){v(ne+1)}))}else v(ne+1);else y()}function A(oe,ne,pe){return pe-(ne-(ne-oe)/2)}function y(oe=NaN){let ne=isNaN(oe);ne&&R.get().streaming.utcSynchronization.useManifestDateHeaderTimeSource?(function(){let pe=b.getLatestMPDRequestHeaderValueByID("Date"),Ee=pe!==null?new Date(pe).getTime():Number.NaN;isNaN(Ee)?Me(!0):Me(!1,Ee-Date.now())})():Me(ne,oe)}function C(oe){let ne=Date.parse(oe);return isNaN(ne)&&(ne=(function(pe){let Ee,te,se=/^([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(pe);return Ee=Date.UTC(parseInt(se[1],10),parseInt(se[2],10)-1,parseInt(se[3],10),parseInt(se[4],10),parseInt(se[5],10),se[6]&&(parseInt(se[6],10)||0),se[7]&&1e3*parseFloat(se[7])||0),se[9]&&se[10]&&(te=60*parseInt(se[9],10)+parseInt(se[10],10),Ee+=(se[8]==="+"?-1:1)*te*60*1e3),new Date(Ee).getTime()})(oe)),ne}function ee(oe){return Date.parse(oe)}function k(oe){return Date.parse(oe)}function Q(oe,ne,pe){pe()}function W(oe,ne,pe){let Ee=C(oe);isNaN(Ee)?pe():ne(Ee)}function re(oe,ne,pe,Ee,te){let se,Ae,ge=!1,we=new XMLHttpRequest,Ve=te?Ge.HTTPRequest.HEAD:Ge.HTTPRequest.GET,$e=ne.match(/\S+/g);if(ne=$e.shift(),se=function(){ge||(ge=!0,$e.length?re(oe,$e.join(" "),pe,Ee,te):Ee())},Ae=function(){let Je,gt;we.status===200&&(Je=te?we.getResponseHeader("Date"):we.response,gt=oe(Je),isNaN(gt)||(pe(gt),ge=!0))},t.isRelative(ne)){const Je=K.resolve();Je&&(ne=t.resolve(ne,Je.url))}we.open(Ve,ne),we.timeout=5e3,we.onload=Ae,we.onloadend=se,we.send()}function Ce(oe,ne,pe){re(k,oe,ne,pe,!0)}function Me(oe,ne){if(isNaN(O)||isNaN(ne)||oe||(function(Ee){try{const te=ue(Ee),se=isNaN(x)?30:x,Ae=isNaN(R.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:R.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,ge=isNaN(R.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:R.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,we=isNaN(R.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:R.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts;let Ve;te?(Ve=Math.min(se*Ae,ge),c.debug(`Increasing timeBetweenSyncAttempts to ${Ve}`)):(Ve=Math.max(se/Ae,we),c.debug(`Decreasing timeBetweenSyncAttempts to ${Ve}`)),x=Ve}catch{}})(ne),!oe&&!isNaN(ne)){u=Date.now(),T=!1;const Ee=isNaN(O);O=ne,Ee&&z(),c.debug(`Completed UTC sync. Setting client - server offset to ${ne}`)}oe&&(L=null,T=!1,U.error(new un.default(Pn.default.TIME_SYNC_FAILED_ERROR_CODE,Pn.default.TIME_SYNC_FAILED_ERROR_MESSAGE)));const pe=R.get().streaming.utcSynchronization.artificialTimeOffsetToApply;e.trigger(h.default.UPDATE_TIME_SYNC_OFFSET,{offset:ne+pe}),e.trigger(h.default.TIME_SYNCHRONIZATION_COMPLETED)}function ve(){if(!M||M.length===0)return;const oe=M.reduce(((ne,pe)=>ne+pe),0)/M.length;ue(oe)?c.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(c.debug(`Completed background UTC sync. Setting client - server offset to ${oe}`),O=oe,e.trigger(h.default.UPDATE_TIME_SYNC_OFFSET,{offset:O})),D=!1,N=Date.now()}function ue(oe){try{if(isNaN(O))return!0;const ne=R.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(R.get().streaming.utcSynchronization.maximumAllowedDrift)?R.get().streaming.utcSynchronization.maximumAllowedDrift:100;return oe>=O-ne&&oe<=O+ne}catch{return!0}}return l={initialize:function(){q(),d={"urn:mpeg:dash:utc:http-head:2014":Ce,"urn:mpeg:dash:utc:http-xsdate:2014":re.bind(null,C),"urn:mpeg:dash:utc:http-iso:2014":re.bind(null,ee),"urn:mpeg:dash:utc:direct:2014":W,"urn:mpeg:dash:utc:http-head:2012":Ce,"urn:mpeg:dash:utc:http-xsdate:2012":re.bind(null,C),"urn:mpeg:dash:utc:http-iso:2012":re.bind(null,ee),"urn:mpeg:dash:utc:direct:2012":W,"urn:mpeg:dash:utc:http-ntp:2014":Q,"urn:mpeg:dash:utc:ntp:2014":Q,"urn:mpeg:dash:utc:sntp:2014":Q}},attemptSync:function(oe,ne){m=oe,T||((function(pe){try{if(!pe||!R.get().streaming.utcSynchronization.enabled)return!1;const Ee=isNaN(x)?30:x;return!(u&&Ee&&!isNaN(Ee))||(Date.now()-u)/1e3>=Ee}catch{return!0}})(ne)?(T=!0,v()):e.trigger(h.default.TIME_SYNCHRONIZATION_COMPLETED))},setConfig:function(oe){oe&&(oe.dashMetrics&&(b=oe.dashMetrics),oe.baseURLController&&(K=oe.baseURLController),oe.errHandler&&(U=oe.errHandler),oe.settings&&(R=oe.settings))},reset:function(){q(),e.off(h.default.ATTEMPT_BACKGROUND_SYNC,z,l)}},c=(0,p.default)(n).getInstance().getLogger(l),e.on(h.default.ATTEMPT_BACKGROUND_SYNC,z,l),l}Fi.__dashjs_factory_name="TimeSyncController";const Ui=F.default.getSingletonFactory(Fi);Ui.HTTP_TIMEOUT_MS=5e3,F.default.updateSingletonFactory(Fi.__dashjs_factory_name,Ui);var Zo=Ui;function es(){let n,e,t,l,c;const T=this.context,D=(0,g.default)(T).getInstance();return n={attachMediaSource:function(R){let d=window.URL.createObjectURL(e);return R.setSource(d),l==="managedMediaSource"&&(R.setDisableRemotePlayback(!0),e.addEventListener("startstreaming",(()=>{D.trigger(H.default.MANAGED_MEDIA_SOURCE_START_STREAMING)})),e.addEventListener("endstreaming",(()=>{D.trigger(H.default.MANAGED_MEDIA_SOURCE_END_STREAMING)}))),d},clearSeekableRange:function(){e&&typeof e.clearLiveSeekableRange=="function"&&e.readyState==="open"&&e.clearLiveSeekableRange()},createMediaSource:function(){let R="WebKitMediaSource"in window,d="MediaSource"in window;return"ManagedMediaSource"in window?(e=new ManagedMediaSource,l="managedMediaSource",c.info("Created ManagedMediaSource")):d?(e=new MediaSource,l="mediaSource",c.info("Created MediaSource")):R&&(e=new WebKitMediaSource,c.info("Created WebkitMediaSource")),e},detachMediaSource:function(R){R.setSource(null)},setConfig:function(R){R&&R.settings&&(t=R.settings)},setDuration:function R(d){if(e&&e.readyState==="open"&&d!==null&&!isNaN(d)&&e.duration!==d)if(d!==1/0||t.get().streaming.buffer.mediaSourceDurationInfinity||(d=Math.pow(2,32)),(function(b){let M=b.sourceBuffers;for(let m=0;m<M.length;m++)if(M[m].updating)return!0;return!1})(e))setTimeout(R.bind(null,d),50);else{const b=(function(M){let m=NaN;const u=M.sourceBuffers;for(let N=0;N<u.length;N++){const O=u[N].buffered;if(O&&O.length>0){const L=O.end(O.length-1);(isNaN(m)||L>m)&&(m=L)}}return m})(e);b>d&&(d=b),c.info("Set MediaSource duration:"+d),e.duration=d}},setSeekable:function(R,d){e&&typeof e.setLiveSeekableRange=="function"&&typeof e.clearLiveSeekableRange=="function"&&e.readyState==="open"&&R>=0&&R<d&&(e.clearLiveSeekableRange(),e.setLiveSeekableRange(R,d))},signalEndOfStream:function(R){if(!R||R.readyState!=="open")return void c.debug(`signalEndOfStream: not applicable, MediaSource readyState is ${R?R.readyState:"unavailable"}`);let d=R.sourceBuffers;for(let b=0;b<d.length;b++){if(d[b].updating)return void c.debug("signalEndOfStream: not applicable, a SourceBuffer is still updating");if(d[b].buffered.length===0)return void c.debug("signalEndOfStream: not applicable, a SourceBuffer holds no data")}c.info("call to mediaSource endOfStream"),R.endOfStream()}},c=(0,p.default)(T).getInstance().getLogger(n),n}es.__dashjs_factory_name="MediaSourceController";var Jo=F.default.getSingletonFactory(es);function ts(){const n="urn:mpeg:dash:event:2012",t="urn:mpeg:dash:event:callback:2015",T="discarded",D="updated",R="added";function d(ve){for(const ue in ve)if(Object.prototype.hasOwnProperty.call(ve,ue))return!1;return!0}const b=this.context,M=(0,g.default)(b).getInstance();let m,u,N,O,L,x,U,K,q,z,J;function v(){if(!U||!K)throw new Error("setConfig function has to be called previously")}function A(){J=!1,N={},O={},L=null,z=!1,x=Date.now()/1e3}function y(){try{if(!z){z=!0;const ve=K.getTime();let ue=ve-x;ue=x>0?Math.max(0,ue):0,C(O,ue,ve),C(N,ue,ve),ee(O),ee(N),x=ve,z=!1}}catch(ve){z=!1,u.error(ve)}}function C(ve,ue,oe){try{re(ve,function(pe){if(pe!==void 0){const Ee=isNaN(pe.duration)?0:pe.duration;pe.calculatedPresentationTime<=oe&&pe.calculatedPresentationTime+ue+Ee>=oe?Me(pe,H.default.EVENT_MODE_ON_START):(Ce(oe,Ee+ue,pe.calculatedPresentationTime)||(function(te){try{const se=te.eventStream.period.start+te.eventStream.period.duration;return te.calculatedPresentationTime>se}catch(se){return u.error(se),!1}})(pe))&&(u.debug(`Removing event ${pe.id} from period ${pe.eventStream.period.id} as it is expired or invalid`),(function(te,se){try{const Ae=se.eventStream.schemeIdUri,ge=se.eventStream.period.id,we=se.eventStream.value,Ve=se.id;te[ge][Ae]=te[ge][Ae].filter(($e=>we&&$e.eventStream.value&&$e.eventStream.value!==we||$e.id!==Ve)),te[ge][Ae].length===0&&delete te[ge][Ae]}catch(Ae){u.error(Ae)}})(ve,pe))}})}catch(ne){u.error(ne)}}function ee(ve){try{for(const ue in ve)Object.prototype.hasOwnProperty.call(ve,ue)&&d(ve[ue])&&delete ve[ue]}catch(ue){u.error(ue)}}function k(ve,ue,oe=!1){const ne=ve.eventStream.schemeIdUri,pe=ve.eventStream.value,Ee=ve.id;let te=T;ue[ne]||(ue[ne]=[]);const se=ue[ne].findIndex((Ae=>(!pe||Ae.eventStream.value&&Ae.eventStream.value===pe)&&Ae.id===Ee));if(se===-1)ue[ne].push(ve),ve.triggeredReceivedEvent=!1,ve.triggeredStartEvent=!1,te=R;else if(oe){const Ae=ue[ne][se];ve.triggeredReceivedEvent=Ae.triggeredReceivedEvent,ve.triggeredStartEvent=Ae.triggeredStartEvent,ue[ne][se]=ve,te=D}return te}function Q(ve){try{if(ve.eventStream.value==1){const ue=ve.calculatedPresentationTime;let oe;oe=ve.calculatedPresentationTime==4294967295?NaN:ve.calculatedPresentationTime+ve.duration,M.trigger(H.default.MANIFEST_VALIDITY_CHANGED,{id:ve.id,validUntil:ue,newDuration:oe,newManifestValidAfter:NaN},{mode:H.default.EVENT_MODE_ON_START})}}catch(ue){u.error(ue)}}function W(ve){try{const ue=K.getTime();re(ve,(function(oe){const ne=oe.eventStream&&oe.eventStream.period&&!isNaN(oe.eventStream.period.duration)?oe.eventStream.period.duration:NaN,pe=oe.eventStream&&oe.eventStream.period&&!isNaN(oe.eventStream.period.start)?oe.eventStream.period.start:NaN;if(isNaN(ne)||isNaN(pe))return;const Ee=oe.calculatedPresentationTime;Math.abs(Ee-ue)<300&&Me(oe,H.default.EVENT_MODE_ON_START)}))}catch(ue){u.error(ue)}}function re(ve,ue){try{if(ve)for(const oe in ve){const ne=ve[oe];for(const pe in ne){const Ee=ne[pe];for(let te=0;te<Ee.length;te++){const se=Ee[te];se!==void 0&&ue(se)}}}}catch(oe){u.error(oe)}}function Ce(ve,ue,oe){try{return ve-ue>oe}catch(ne){return u.error(ne),!1}}function Me(ve,ue){try{const oe=K.getTime(),ne=ve.id;if(ue===H.default.EVENT_MODE_ON_RECEIVE&&!ve.triggeredReceivedEvent)return u.debug(`Received event ${ne}`),ve.triggeredReceivedEvent=!0,void M.trigger(ve.eventStream.schemeIdUri,{event:ve},{mode:ue});ve.triggeredStartEvent||(ve.eventStream.schemeIdUri===n&&ve.eventStream.value==1?ve.duration===0&&ve.presentationTimeDelta===0||(u.debug(`Starting manifest refresh event ${ne} at ${oe}`),(function(){try{v(),U.refreshManifest()}catch(pe){u.error(pe)}})()):ve.eventStream.schemeIdUri===t&&ve.eventStream.value==1?(u.debug(`Starting callback event ${ne} at ${oe}`),(function(pe){try{let Ee=(0,za.default)(b).create({});const te=new $a.default({method:"get",url:pe,responseType:"arraybuffer",customData:{}}),se=new Qa.default({request:te});Ee.load(te,se)}catch(Ee){u.error(Ee)}})(ve.messageData instanceof Uint8Array?rn.default.uint8ArrayToString(ve.messageData):ve.messageData)):(u.debug(`Starting event ${ne} from period ${ve.eventStream.period.id} at ${oe}`),M.trigger(ve.eventStream.schemeIdUri,{event:ve},{mode:ue}),q.get().streaming.events.deleteEventMessageDataTimeout>-1&&setTimeout((()=>{delete ve.messageData,delete ve.parsedMessageData}),q.get().streaming.events.deleteEventMessageDataTimeout)),ve.triggeredStartEvent=!0)}catch(oe){u.error(oe)}}return m={addInlineEvents:function(ve,ue){try{if(v(),N[ue]||(N[ue]={}),ve)for(let oe=0;oe<ve.length;oe++){let ne=ve[oe];if(!Ce(K.getTime(),isNaN(ne.duration)?0:ne.duration,ne.calculatedPresentationTime)){let pe=k(ne,N[ue],!0);pe===R?(u.debug(`Added inline event with id ${ne.id} from period ${ue}`),Me(ne,H.default.EVENT_MODE_ON_RECEIVE)):pe===D&&u.debug(`Updated inline event with id ${ne.id} from period ${ue}`)}}}catch(oe){throw oe}},addInbandEvents:function(ve,ue){try{v(),O[ue]||(O[ue]={});for(let oe=0;oe<ve.length;oe++){let ne=ve[oe];Ce(K.getTime(),isNaN(ne.duration)?0:ne.duration,ne.calculatedPresentationTime)||(k(ne,O[ue],!1)===R?(ne.eventStream.schemeIdUri===n&&Q(ne),u.debug(`Added inband event with id ${ne.id} from period ${ue}`),Me(ne,H.default.EVENT_MODE_ON_RECEIVE)):u.debug(`Inband event with scheme_id_uri ${ne.eventStream.schemeIdUri}, value ${ne.eventStream.value}, period id ${ue} and event id ${ne.id} was ignored because it has been added before.`))}y()}catch(oe){throw oe}},getInbandEvents:function(){return O},getInlineEvents:function(){return N},start:function(){try{v(),u.debug("Start Event Controller");const ve=q.get().streaming.events.eventControllerRefreshDelay;J||isNaN(ve)||(J=!0,L=setInterval(y,ve))}catch(ve){throw ve}},setConfig:function(ve){try{if(!ve)return;ve.manifestUpdater&&(U=ve.manifestUpdater),ve.playbackController&&(K=ve.playbackController),ve.settings&&(q=ve.settings)}catch(ue){throw ue}},reset:function(){(function(){try{L!==null&&J&&(clearInterval(L),L=null,J=!1,(function(){try{W(O),W(N)}catch(ve){u.error(ve)}})())}catch(ve){throw ve}})(),A()}},u=(0,p.default)(b).getInstance().getLogger(m),A(),m}ts.__dashjs_factory_name="EventController";var el=F.default.getSingletonFactory(ts),ii={LEVELS:{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."}}},tl=P(5313),ns=P(445),rs=P(1923);function is(){const n=this.context,e=(0,g.default)(n).getInstance();let t,l,c,T,D,R,d,b,M,m,u,N,O,L,x,U,K,q,z,J,v,A,y,C,ee,k,Q,W,re,Ce,Me,ve,ue,oe,ne,pe,Ee,te,se,Ae,ge,we,Ve,$e,Je,gt,Et,Jt,fn;function bn(){if(!(R&&R.hasOwnProperty("load")&&A&&A.hasOwnProperty("initialize")&&A.hasOwnProperty("reset")&&A.hasOwnProperty("getClientTimeOffset")&&d&&v&&M&&ne))throw new Error(r.default.MISSING_CONFIG_ERROR)}function kn(){(function(){try{const We=b.getStreamsInfo();if(!C&&We.length===0)throw new Error("There are no periods in the MPD");C&&We.length>0&&M.updateManifestUpdateInfo({currentTime:ne.getTime(),buffered:oe.getBufferRange(),presentationStartTime:We[0].start,clientTimeOffset:A.getClientTimeOffset()}),y.length>0&&(function(on){on.length!==0?y=y.filter((Rn=>{const Hn=on.filter((Vn=>Vn.id===Rn.getId())).length>0||Rn.getId()===C.getId();return Hn||(l.debug(`Removing stream ${Rn.getId()}`),Rn.reset(!0),Rn=null),Hn})):l.warn("No periods included in the current manifest. Skipping the filtering of outdated stream objects.")})(We);const Dt=[];for(let on=0,Rn=We.length;on<Rn;on++){const Hn=We[on];Dt.push(Bn(Hn)),M.addManifestUpdateStreamInfo(Hn)}Promise.all(Dt).then((()=>new Promise(((on,Rn)=>{C?on():xn(We,on,Rn)})))).then((()=>{e.trigger(h.default.STREAMS_COMPOSED),fn&&!b.getIsDynamic()&&ue&&(fn=!1,zn(),Xt(),m.clearSeekableRange()),pn()})).catch((on=>{throw on}))}catch(We){v.error(new un.default(Pn.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,We.message+" nostreamscomposed",d.getValue())),ve=!0,_i()}})()}function Kn(){Je=!0}function Un(){$e.get().streaming.ignoreFinalStaticManifestOnDynamicToStaticTransition||(fn=!0)}function Bn(We){let Dt=$r(We.id);return Dt?Dt.updateData(We):(Dt=Xo(n).create({manifestModel:d,mediaPlayerModel:Ee,dashMetrics:M,manifestUpdater:D,adapter:b,timelineConverter:A,capabilities:c,capabilitiesFilter:T,errHandler:v,baseURLController:O,segmentBaseController:L,textController:k,abrController:U,playbackController:ne,throughputController:K,eventController:z,mediaController:q,protectionController:ee,videoModel:oe,streamInfo:We,settings:$e}),y.push(Dt),Dt.initialize(),Promise.resolve())}function xn(We,Dt,on){try{Xt();const Rn=M.getCurrentDVRInfo().range;if(Rn.end<Rn.start)return void(function(Vn,ir,xr,ci){gt&&clearTimeout(gt);const si=Math.min(1e3*(-1*(Vn.end-Vn.start)+2),2147483647);l.debug(`Waiting for ${si} ms before playback can start`),e.trigger(h.default.AST_IN_FUTURE,{delay:si}),gt=setTimeout((()=>{xn(ir,xr,ci)}),si)})(Rn,We,Dt,on);$e.get().streaming.applyProducerReferenceTime&&pe.calculateProducerReferenceTimeOffsets(We);const Hn=We[0].manifestInfo;if($e.get().streaming.applyServiceDescription&&pe.applyServiceDescription(Hn),b.getIsDynamic()){const Vn=ai(Hn);ne.computeAndSetLiveDelay(Vn,Hn)}($e.get().streaming.applyContentSteering&&N.shouldQueryBeforeStart()?N.loadSteeringData():Promise.resolve()).then((()=>{const Vn=d.getValue();Vn&&O.update(Vn),rt(),Dt()})).catch((Vn=>{l.error(Vn),rt(),Dt()}))}catch(Rn){on(Rn)}}function rt(){const We={seekTime:Er()};let Dt=qt(We.seekTime);Dt||(Dt=Lt(We));const on=We.seekTime,Rn=Dt!==null?Dt:y[0];e.trigger(h.default.INITIAL_STREAM_SWITCH,{startTime:on}),Mt(Rn,null,on),Mn()}function Mt(We,Dt,on){try{if(Ce||!We||Dt===We&&We.getIsActive())return;Ce=!0,e.trigger(h.default.PERIOD_SWITCH_STARTED,{fromStreamInfo:Dt?Dt.getStreamInfo():null,toStreamInfo:We.getStreamInfo()});let Rn=!1,Hn=[],Vn=new Map;C=We,Dt&&(Rn=bt(We,Dt),Rn&&(Vn=Nn(Dt)),Hn=cn(Dt),Dt.deactivate(Rn)),on=isNaN(on)?!Rn&&Dt?We.getStreamInfo().start:NaN:on,l.info(`Switch to stream ${We.getId()}. Seektime is ${on}, current playback time is ${ne.getTime()}. Seamless period switch is set to ${Rn}`),Ve=Ve.filter((ir=>ir.getId()!==C.getId())),ne.initialize(wr(),!!Dt),oe.getElement()?St({seekTime:on,keepBuffers:Rn,sourceBufferSinksFromPreviousPeriod:Vn,streamActivated:!1,representationsFromPreviousPeriod:Hn}):Gt({seekTime:on,keepBuffers:Rn,sourceBufferSinksFromPreviousPeriod:Vn})}catch{Ce=!1}}function St(We){let Dt;function on(){if(!ue||ue.readyState!=="open")return;l.debug("MediaSource is open!"),window.URL.revokeObjectURL(Dt),ue.removeEventListener("sourceopen",on),ue.removeEventListener("webkitsourceopen",on),zn();const Hn=M.getCurrentDVRInfo();m.setSeekable(Hn.range.start,Hn.range.end),We.streamActivated?(isNaN(We.seekTime)||ne.seek(We.seekTime,!0,!0),C.setMediaSource(ue).then((()=>{C.initializeForTextWithMediaSource(ue)}))):Gt(We)}function Rn(){ue.addEventListener("sourceopen",on,!1),ue.addEventListener("webkitsourceopen",on,!1),Dt=m.attachMediaSource(oe),l.debug("MediaSource attached to element. Waiting on open...")}ue?We.keepBuffers?Gt(We):(m.detachMediaSource(oe),Rn()):(ue=m.createMediaSource(),Rn())}function Gt(We){const Dt=We.representationsFromPreviousPeriod||[];C.activate(ue,We.sourceBufferSinksFromPreviousPeriod,Dt).then((()=>{isNaN(We.seekTime)||(e.trigger(h.default.SEEK_TARGET,{time:We.seekTime},{streamId:C.getId()}),ne.seek(We.seekTime,!1,!0),C.startScheduleControllers()),Ce=!1,e.trigger(h.default.PERIOD_SWITCH_COMPLETED,{toStreamInfo:wr()})}))}function cn(We){return(We?We.getStreamProcessors():[]).map((Dt=>Dt.getRepresentation()))}function Nn(We){const Dt=new Map;return We&&(We?We.getStreamProcessors():[]).forEach((on=>{const Rn=on.getBuffer();Rn&&Dt.set(Rn.getType(),Rn)})),Dt}function lt(We){let Dt=qt(We.seekTime);Dt||(Dt=Lt(We)),Dt&&Dt!==C?Dt&&Dt!==C&&(jt(Dt),(function(on,Rn){const Hn=on&&!isNaN(on.seekTime)?on.seekTime:NaN,Vn=C.getStreamProcessors().map((ir=>ir.prepareOuterPeriodPlaybackSeeking(on)));Promise.all(Vn).then((()=>{Mt(Rn,C,Hn)})).catch((ir=>{v.error(ir)}))})(We,Dt)):(jt(),(function(on){C.getStreamProcessors().forEach((Rn=>Rn.prepareInnerPeriodPlaybackSeeking(on))),Mr(fr.USER_REQUEST_STOP_REASON)})(We)),Mn(),ui(Yr.SEEK_START_REASON)}function Lt(We){if(isNaN(We.seekTime)||y.length===0||b.getIsDynamic())return null;const Dt=y[y.length-1],on=parseFloat((Dt.getStartTime()+Dt.getDuration()).toFixed(5));if(We.seekTime<on)return null;const Rn=isNaN($e.get().streaming.seekDurationBackoff)?0:$e.get().streaming.seekDurationBackoff;return We.seekTime=Math.max(Dt.getStartTime(),on-Rn),ne.seek(We.seekTime,!1,!0),Dt}function jt(We=null){xe()}function xe(){Ve&&Ve.length>0&&(Ve.forEach((We=>{We.deactivate(!0)})),Ve=[])}function Ze(We){if(We.newMediaInfo.streamInfo.id===C.getId()){if(xe(),$e.get().streaming.buffer.resetSourceBuffersForTrackSwitch&&We.oldMediaInfo&&We.oldMediaInfo.codec!==We.newMediaInfo.codec){const Dt=ne.getTime();return C.deactivate(!1),void St({seekTime:Dt,keepBuffers:!1,streamActivated:!1})}C.prepareTrackChange(We)}}function bt(We,Dt){try{return $e.get().streaming.buffer.reuseExistingSourceBuffers&&(c.isProtectionCompatible(Dt.getStreamInfo(),We.getStreamInfo())||Je)&&c.supportsChangeType()&&$e.get().streaming.buffer.useChangeType}catch{return!1}}function Xe(We,Dt=null){if(!ue||We.getPreloaded()||!bt(We,Dt))return;const on=cn(Dt),Rn=Nn(Dt);We.startPreloading(ue,Rn,on).then((()=>{Ve.push(We)}))}function qt(We){if(isNaN(We))return null;const Dt=y.length;for(let on=0;on<Dt;on++){const Rn=y[on];if(We<parseFloat((Rn.getStartTime()+Rn.getDuration()).toFixed(5)))return Rn}return null}function Xt(){try{const We=b.getIsDynamic(),Dt=b.getStreamsInfo()[0].manifestInfo,on=ne.getTime(),Rn=A.calcTimeShiftBufferWindow(y,We),Hn=Dn();if(Rn.start===void 0||Rn.end===void 0)return;Hn&&Hn.length!==0?Hn.forEach((Vn=>{M.addDVRInfo(Vn.getType(),on,Dt,Rn)})):M.addDVRInfo(r.default.VIDEO,on,Dt,Rn)}catch{}}function sn(We){if(Ae&&re){const Dt=Ee.getInitialBufferLevel(),on=[r.default.TEXT];(isNaN(Dt)||Dt<=ne.getBufferLevel(on)||b.getIsDynamic()&&Dt>ne.getLiveDelay())&&(Ae=!1,ui(Yr.INITIAL_PLAYOUT_START_REASON),ne.play())}We&&We.mediaType&&M.addBufferLevel(We.mediaType,new Date,1e3*We.bufferLevel)}function wn(We){We.streamInfo.id===C.getId()&&xe(),$r(We.streamInfo.id).prepareQualityChange(We)}function Te(){if(b.getIsDynamic()&&ne.getOriginalLiveDelay()!==0&&C){const We=b.getStreamsInfo();if(We.length>0){const Dt=We[0].manifestInfo,on=ai(Dt);ne.computeAndSetLiveDelay(on,Dt)}}}function nt(){if(yr()){const We=oe.getPlaybackQuality();We&&M.addDroppedFrames(We)}}function Kt(){l.debug("[onPlaybackStarted]"),!Ae&&se&&ui(Yr.RESUME_FROM_PAUSE_START_REASON),Ae&&(Ae=!1),ge&&(ge=!1,$e.get().streaming.applyContentSteering&&!N.shouldQueryBeforeStart()&&N.loadSteeringData()),se=!1}function Qe(We){l.debug("[onPlaybackPaused]"),We.ended||(se=!0,Mr(fr.USER_REQUEST_STOP_REASON))}function Yt(We){l.debug(`Stream with id ${We.streamInfo.id} finished buffering`);const Dt=We.streamInfo.isLast;ue&&Dt?(l.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),m.signalEndOfStream(ue)):pn()}function pn(){if(!C)return;if(!C.getHasFinishedBuffering())return void C.checkAndHandleCompletedBuffering();const We=(function(on=null){try{const Rn=on||C||null;if(Rn){const Hn=Rn.getStreamInfo();return y.filter((function(Vn){const ir=Vn.getStreamInfo();return ir.start>Hn.start&&Hn.id!==ir.id}))}}catch{return[]}})(C);let Dt=0;for(;Dt<We.length;){const on=We[Dt],Rn=Dt===0?C:We[Dt-1];!on.getPreloaded()&&Rn.getHasFinishedBuffering()&&Xe(on,Rn),Dt+=1}}function Mn(){we||(we=setInterval((function(){!Ce&&ne.getTimeToStreamEnd()<=0&&!ne.isSeeking()&&e.trigger(h.default.PLAYBACK_ENDED,{isLast:wr().isLast})}),200))}function Ln(){we&&(clearInterval(we),we=null)}function Dn(){return C?C.getStreamProcessors():[]}function jn(We){if(C&&!C.getIsEndedEventSignaled()){C.setIsEndedEventSignaled(!0);const Dt=(function(on=null){const Rn=on||C||null;if(!Rn)return null;const Hn=Rn.getStreamInfo(),Vn=Hn.start;let ir=0,xr=-1,ci=NaN;for(;ir<y.length;){const si=y[ir].getStreamInfo(),Gi=si.start-Vn;Gi>0&&(isNaN(ci)||Gi<ci)&&Hn.id!==si.id&&(ci=Gi,xr=ir),ir+=1}return xr>=0?y[xr]:null})();Dt?(l.debug(`StreamController onEnded, found next stream with id ${Dt.getStreamInfo().id}. Switching from ${C.getStreamInfo().id} to ${Dt.getStreamInfo().id}`),Mt(Dt,C,NaN)):(l.debug("StreamController no next stream found"),C.setIsEndedEventSignaled(!1)),Mr(Dt?fr.END_OF_PERIOD_STOP_REASON:fr.END_OF_CONTENT_STOP_REASON)}We&&We.isLast&&(Ln(),N.stopSteeringRequestTimer())}function zn(We){const Dt=We||wr().manifestInfo.duration;m.setDuration(Dt)}function Er(){let We;return We=b.getIsDynamic()?(function(){let Dt;const on=M.getCurrentDVRInfo();Dt=(on&&on.range?on.range.end:0)-ne.getOriginalLiveDelay();const Rn=on?on.range:null;if(Rn){if(isNaN(Et)&&Et.toString().indexOf("posix:")===-1){const Vn=pr(!0);isNaN(Vn)||(l.info(`Start time from URI parameters: ${Vn}`),Dt=Math.min(Dt,Vn))}else{l.info(`Start time provided by the app: ${Et}`);const Vn=vr(!0,Et);isNaN(Vn)||(Dt=Math.min(Dt,Vn))}const Hn=$e.get().streaming.timeShiftBuffer.calcFromSegmentTimeline?.1:0;Dt=Math.max(Dt,Rn.start+Hn)}return Dt})():(function(){let Dt=yi()[0].getStreamInfo().start;if(isNaN(Et)){const on=pr(!1);isNaN(on)||(l.info(`Start time from URI parameters: ${on}`),Dt=Math.max(Dt,on))}else{l.info(`Start time provided by the app: ${Et}`);const on=vr(!1,Et);isNaN(on)||(Dt=Math.max(Dt,on))}return Dt})(),We}function pr(We){const Dt=x.getURIFragmentData();if(!Dt||!Dt.t)return NaN;const on=yi()[0].getStreamInfo().start;return Dt.t=Dt.t.split(",")[0],Ur(We,Dt.t,on)}function vr(We,Dt){let on=0;return We||(on=yi()[0].getStreamInfo().start),Ur(We,Dt,on)}function Ur(We,Dt,on){const Rn=b.getRegularPeriods()[0],Hn=Dt.toString(),Vn=Hn.indexOf("posix:")!==-1?Hn.substring(6)==="now"?Date.now()/1e3:parseFloat(Hn.substring(6)):NaN;return We&&!isNaN(Vn)?A.calcPresentationTimeFromWallTime(new Date(1e3*Vn),Rn):parseFloat(Hn)+on}function ai(We){try{return We&&Number.isFinite(We.maxFragmentDuration)?We.maxFragmentDuration:NaN}catch{return NaN}}function Ir(){const We=d.getValue();O.initialize(We)}function Vr(We){if(We.error)ve=!0,_i();else{l.info("Manifest updated... updating data system wide.");const Dt=We.manifest;b.updatePeriods(Dt),T.filterUnsupportedFeatures(Dt).then((()=>{O.initialize(Dt);let on=b.getUTCTimingSources();!b.getIsDynamic()||on&&on.length!==0||e.trigger(H.default.CONFORMANCE_VIOLATION,{level:ii.LEVELS.WARNING,event:ii.EVENTS.NO_UTC_TIMING_ELEMENT});let Rn=b.getIsDynamic()?on.concat(te.getUTCTimingSources()):on;u.attemptSync(Rn,b.getIsDynamic()),W.createFinalQueryStrings(Dt)}))}}function yr(){return!!C&&C.getHasVideoTrack()}function Rr(){return!!C&&C.getHasAudioTrack()}function Mr(We,Dt){Dt=Dt||new Date,Dn().forEach((on=>{on.finalisePlayList(Dt,We)})),M.addPlayList()}function ui(We){M.createPlaylistMetrics(1e3*ne.getTime(),We)}function Ei(We){ee.updateKeyStatusesMap(We),(function(){const Dt=Dn();let on=!1;Dt.forEach((Rn=>{const Hn=Rn.getMediaInfo();!Hn||c.areKeyIdsUsable(Hn)?Hn&&c.areKeyIdsExpired(Hn)&&(function(Vn){const ir=$r(Vn.getStreamId());ir&&ir.triggerProtectionError({error:new un.default(rs.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,rs.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)})})(Rn):(on=!0,(function(Vn){const ir=Vn.getAllMediaInfos().filter((xr=>c.areKeyIdsUsable(xr)));if(ir&&ir.length!==0)q.setTrack(ir[0],{replaceBuffer:!0});else{const xr=Vn.getType();v.error(new un.default(Pn.default.NO_SUPPORTED_KEY_IDS,`Type: ${xr}: ${Pn.default.NO_SUPPORTED_KEY_IDS_MESSAGE}`))}})(Rn))})),on&&(ne.getTime()===0?e.once(H.default.FRAGMENT_LOADING_COMPLETED,(()=>{Ti()}),t):ne.isProgressing(500).then((Rn=>{Rn||Ti()})))})()}function Ti(){const We=ne.getTime();ne.seek(We+.01,!1,!1)}function Sr(We){if(!We.error)return;let Dt;switch(We.error.code){case 1:Dt="MEDIA_ERR_ABORTED";break;case 2:Dt="MEDIA_ERR_NETWORK";break;case 3:Dt="MEDIA_ERR_DECODE",Jt.counts.mediaErrorDecode+=1;break;case 4:Dt="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:Dt="MEDIA_ERR_ENCRYPTED";break;default:Dt="UNKNOWN"}Dt==="MEDIA_ERR_DECODE"&&$e.get().errors.recoverAttempts.mediaErrorDecode>=Jt.counts.mediaErrorDecode?(function(){l.error("A MEDIA_ERR_DECODE occured: Resetting the MediaSource");const on=ne.getTime();C.deactivate(!1),l.info(`MediaSource has been resetted. Resuming playback from time ${on}`),St({seekTime:on,keepBuffers:!1,streamActivated:!1})})():(Me=!0,We.error.message&&(Dt+=" ("+We.error.message+")"),We.error.msExtendedCode&&(Dt+=" (0x"+(We.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),l.fatal("Video Element Error: "+Dt),We.error&&l.fatal(We.error),v.error(new un.default(We.error.code,Dt)),_i())}function wr(){return C?C.getStreamInfo():null}function $r(We){for(let Dt=0,on=y.length;Dt<on;Dt++)if(y[Dt].getId()===We)return y[Dt];return null}function As(We){isNaN(We.newDuration)||zn(We.newDuration)}function Ns(){y=[],Et=NaN,ee=null,Ce=!1,C=null,Me=!1,ve=!1,Ae=!0,ge=!0,se=!1,re=!0,we=null,fn=!1,Je=!1,Ve=[],gt=null,Jt={counts:{mediaErrorDecode:0}}}function _i(){bn(),u.reset(),Mr(Me||ve?fr.FAILURE_STOP_REASON:fr.USER_REQUEST_STOP_REASON);for(let We=0,Dt=y?y.length:0;We<Dt;We++)y[We].reset(Me);e.off(H.default.PLAYBACK_TIME_UPDATED,nt,t),e.off(H.default.PLAYBACK_SEEKING,lt,t),e.off(H.default.PLAYBACK_ERROR,Sr,t),e.off(H.default.PLAYBACK_STARTED,Kt,t),e.off(H.default.PLAYBACK_PAUSED,Qe,t),e.off(H.default.PLAYBACK_ENDED,jn,t),e.off(H.default.METRIC_ADDED,Cs,t),e.off(H.default.MANIFEST_VALIDITY_CHANGED,As,t),e.off(H.default.BUFFER_LEVEL_UPDATED,sn,t),e.off(H.default.QUALITY_CHANGE_REQUESTED,wn,t),e.off(H.default.CONTENT_STEERING_REQUEST_COMPLETED,Ir,t),e.off(H.default.DYNAMIC_TO_STATIC,Un,t),h.default.KEY_SESSION_UPDATED&&e.off(h.default.KEY_SESSION_UPDATED,Kn,t),e.off(h.default.MANIFEST_UPDATED,Vr,t),e.off(h.default.STREAM_BUFFERING_COMPLETED,Yt,t),e.off(h.default.TIME_SYNCHRONIZATION_COMPLETED,kn,t),e.off(h.default.CURRENT_TRACK_CHANGED,Ze,t),e.off(h.default.SETTING_UPDATED_LIVE_DELAY,Te,t),e.off(h.default.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,Te,t),e.off(ns.default.INTERNAL_KEY_STATUSES_CHANGED,Ei,t),O.reset(),D.reset(),z.reset(),M.clearAllCurrentMetrics(),d.setValue(null),R.reset(),A.reset(),J.reset(),ue&&(m.detachMediaSource(oe),ue=null),oe=null,ee&&(ee=null,Q=null,d.getValue()&&e.trigger(h.default.PROTECTION_DESTROYED,{data:d.getValue().url})),Ln(),e.trigger(h.default.STREAM_TEARDOWN_COMPLETE),Ns()}function Cs(We){if(We.metric===o.DVR_INFO){const Dt=Rr()?r.default.AUDIO:r.default.VIDEO;We.mediaType===Dt&&m.setSeekable(We.value.range.start,We.value.range.end)}}function yi(){return y}return t={addDVRMetric:Xt,getActiveStream:function(){return C},getActiveStreamInfo:wr,getActiveStreamProcessors:Dn,getAutoPlay:function(){return re},getHasMediaOrInitialisationError:function(){return Me||ve},getInitialPlayback:function(){return Ae},getIsStreamSwitchInProgress:function(){return Ce},getProtectionData:function(){return ee?ee.getProtectionData():null},getStreamById:$r,getStreamForTime:qt,getStreams:yi,getTimeRelativeToStreamId:function(We,Dt){let on=null,Rn=0,Hn=0,Vn=null;for(let ir=0;ir<y.length;ir++){if(on=y[ir],Hn=on.getStartTime(),Vn=on.getDuration(),Number.isFinite(Hn)&&(Rn=Hn),on.getId()===Dt)return We-Rn;Number.isFinite(Vn)&&(Rn+=Vn)}return null},hasAudioTrack:Rr,hasVideoTrack:yr,initialize:function(We,Dt){bn(),re=We,Q=Dt,A.initialize(),D=sa(n).create(),D.setConfig({manifestModel:d,adapter:b,manifestLoader:R,errHandler:v,settings:$e,contentSteeringController:N}),D.initialize(),z=el(n).getInstance(),z.setConfig({manifestUpdater:D,playbackController:ne,settings:$e}),z.start(),W=(0,tl.default)(n).getInstance(),u.setConfig({dashMetrics:M,baseURLController:O,errHandler:v,settings:$e}),u.initialize(),m.setConfig({settings:$e}),ee&&(e.trigger(h.default.PROTECTION_CREATED,{controller:ee}),ee.setMediaElement(oe.getElement()),Q&&ee.setProtectionData(Q)),e.on(H.default.PLAYBACK_TIME_UPDATED,nt,t),e.on(H.default.PLAYBACK_SEEKING,lt,t),e.on(H.default.PLAYBACK_ERROR,Sr,t),e.on(H.default.PLAYBACK_STARTED,Kt,t),e.on(H.default.PLAYBACK_PAUSED,Qe,t),e.on(H.default.PLAYBACK_ENDED,jn,t),e.on(H.default.METRIC_ADDED,Cs,t),e.on(H.default.MANIFEST_VALIDITY_CHANGED,As,t),e.on(H.default.BUFFER_LEVEL_UPDATED,sn,t),e.on(H.default.QUALITY_CHANGE_REQUESTED,wn,t),e.on(H.default.CONTENT_STEERING_REQUEST_COMPLETED,Ir,t),e.on(H.default.DYNAMIC_TO_STATIC,Un,t),h.default.KEY_SESSION_UPDATED&&e.on(h.default.KEY_SESSION_UPDATED,Kn,t),e.on(h.default.MANIFEST_UPDATED,Vr,t),e.on(h.default.STREAM_BUFFERING_COMPLETED,Yt,t),e.on(h.default.TIME_SYNCHRONIZATION_COMPLETED,kn,t),e.on(h.default.CURRENT_TRACK_CHANGED,Ze,t),e.on(h.default.SETTING_UPDATED_LIVE_DELAY,Te,t),e.on(h.default.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,Te,t),e.on(ns.default.INTERNAL_KEY_STATUSES_CHANGED,Ei,t)},load:function(We,Dt=NaN){bn(),Et=Dt,R.load(We)},loadWithManifest:function(We,Dt=NaN){(function(){if(!D||!D.hasOwnProperty("setManifest"))throw new Error("initialize function has to be called previously")})(),Et=Dt,D.setManifest(We)},refreshManifest:function(){D.getIsUpdating()||D.refreshManifest()},reset:_i,setConfig:function(We){We&&(We.capabilities&&(c=We.capabilities),We.capabilitiesFilter&&(T=We.capabilitiesFilter),We.manifestLoader&&(R=We.manifestLoader),We.manifestModel&&(d=We.manifestModel),We.mediaPlayerModel&&(Ee=We.mediaPlayerModel),We.customParametersModel&&(te=We.customParametersModel),We.protectionController&&(ee=We.protectionController),We.adapter&&(b=We.adapter),We.dashMetrics&&(M=We.dashMetrics),We.errHandler&&(v=We.errHandler),We.timelineConverter&&(A=We.timelineConverter),We.videoModel&&(oe=We.videoModel),We.playbackController&&(ne=We.playbackController),We.throughputController&&(K=We.throughputController),We.serviceDescriptionController&&(pe=We.serviceDescriptionController),We.contentSteeringController&&(N=We.contentSteeringController),We.textController&&(k=We.textController),We.abrController&&(U=We.abrController),We.mediaController&&(q=We.mediaController),We.settings&&($e=We.settings),We.baseURLController&&(O=We.baseURLController),We.uriFragmentModel&&(x=We.uriFragmentModel),We.segmentBaseController&&(L=We.segmentBaseController),We.manifestUpdater&&(D=We.manifestUpdater))},setProtectionData:function(We){Q=We,ee&&ee.setProtectionData(Q)},switchToVideoElement:function(We){C&&(ne.initialize(wr()),St({seekTime:We,keepBuffers:!1,streamActivated:!0}))}},l=(0,p.default)(n).getInstance().getLogger(t),u=Zo(n).getInstance(),m=Jo(n).getInstance(),J=ct(n).getInstance(),Ns(),t}is.__dashjs_factory_name="StreamController";var as=F.default.getSingletonFactory(is),nl=class extends Ot{constructor(){super(),this.captionData=null,this.label=null,this.defaultTrack=!1,this.kind=null,this.isFragmented=!1,this.isEmbedded=!1,this.isTTML=null}},rl=P(7377);function ss(){let n,e=0;function t(d){let b="";for(let M=0;M<d.length;++M)b+=d[M].uchar;return b.length-b.replace(/^\s+/,"").length}function l(d){return"left: "+3.125*d.x+"%; top: "+6.66*d.y1+"%; width: "+(100-3.125*d.x)+"%; height: "+6.66*Math.max(d.y2-1-d.y1,1)+"%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;"}function c(d){return d==="red"?"rgb(255, 0, 0)":d==="green"?"rgb(0, 255, 0)":d==="blue"?"rgb(0, 0, 255)":d==="cyan"?"rgb(0, 255, 255)":d==="magenta"?"rgb(255, 0, 255)":d==="yellow"?"rgb(255, 255, 0)":d==="white"?"rgb(255, 255, 255)":d==="black"?"rgb(0, 0, 0)":d}function T(d,b){const M=d.videoHeight/15;return b?"font-size: "+M+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: "+(b.foreground?c(b.foreground):"rgb(255, 255, 255)")+"; font-style: "+(b.italics?"italic":"normal")+"; text-decoration: "+(b.underline?"underline":"none")+"; white-space: pre; background-color: "+(b.background?c(b.background):"transparent")+";":"font-size: "+M+"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 D(d){return d.replace(/^\s+/g,"")}function R(d){return d.replace(/\s+$/g,"")}return n={createHTMLCaptionsFromScreen:function(d,b,M,m){let u=null,N=null,O=!1,L=-1,x={start:b,end:M,spans:[]},U="style_cea608_white_black";const K={},q={},z=[];let J,v;for(J=0;J<15;++J){const y=m.rows[J];let C="",ee=null;if(y.isEmpty()===!1){const k=t(y.chars);u===null&&(u={x:k,y1:J,y2:J+1,p:[]}),k!==L&&O&&(u.p.push(x),x={start:b,end:M,spans:[]},u.y2=J,u.name="region_"+u.x+"_"+u.y1+"_"+u.y2,K.hasOwnProperty(u.name)===!1?(z.push(u),K[u.name]=u):(N=K[u.name],N.p.contat(u.p)),u={x:k,y1:J,y2:J+1,p:[]});for(let Q=0;Q<y.chars.length;++Q){const W=y.chars[Q],re=W.penState;if(ee===null||!re.equals(ee)){C.trim().length>0&&(x.spans.push({name:U,line:C,row:J}),C="");let Ce="style_cea608_"+re.foreground+"_"+re.background;re.underline&&(Ce+="_underline"),re.italics&&(Ce+="_italics"),q.hasOwnProperty(Ce)||(q[Ce]=JSON.parse(JSON.stringify(re))),ee=re,U=Ce}C+=W.uchar}C.trim().length>0&&x.spans.push({name:U,line:C,row:J}),O=!0,L=k}else O=!1,L=-1,u&&(u.p.push(x),x={start:b,end:M,spans:[]},u.y2=J,u.name="region_"+u.x+"_"+u.y1+"_"+u.y2,K.hasOwnProperty(u.name)===!1?(z.push(u),K[u.name]=u):(N=K[u.name],N.p.contat(u.p)),u=null)}u&&(u.p.push(x),u.y2=J+1,u.name="region_"+u.x+"_"+u.y1+"_"+u.y2,K.hasOwnProperty(u.name)===!1?(z.push(u),K[u.name]=u):(N=K[u.name],N.p.contat(u.p)),u=null);const A=[];for(J=0;J<z.length;++J){const y=z[J],C="sub_cea608_"+e++,ee=document.createElement("div");ee.id=C;const k=l(y);ee.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+k;const Q=document.createElement("div");Q.className="paragraph bodyStyle",Q.style.cssText=T(d);const W=document.createElement("div");W.className="cueUniWrapper",W.style.cssText="unicode-bidi: normal; direction: ltr;";for(let Ce=0;Ce<y.p.length;++Ce){const Me=y.p[Ce];let ve=0;for(v=0;v<Me.spans.length;++v){let ue=Me.spans[v];if(ue.line.length>0){if(v!==0&&ve!=ue.row){const Ee=document.createElement("br");Ee.className="lineBreak",W.appendChild(Ee)}let oe=!1;ve===ue.row&&(oe=!0),ve=ue.row;const ne=q[ue.name],pe=document.createElement("span");pe.className="spanPadding "+ue.name+" customSpanColor",pe.style.cssText=T(d,ne),v!==0&&oe?v===Me.spans.length-1?pe.textContent=R(ue.line):pe.textContent=ue.line:Me.spans.length>1&&v<Me.spans.length-1&&ue.row===Me.spans[v+1].row?pe.textContent=D(ue.line):pe.textContent=ue.line.trim(),W.appendChild(pe)}}}Q.appendChild(W),ee.appendChild(Q);const re={bodyStyle:["%",90]};for(const Ce in q)q.hasOwnProperty(Ce)&&(re[Ce]=["%",90]);A.push({type:"html",start:b,end:M,cueHTMLElement:ee,cueID:C,cellResolution:[32,15],isFromCEA608:!0,fontSize:re,lineHeight:{},linePadding:{}})}return A}},n}ss.__dashjs_factory_name="EmbeddedTextHtmlRender";var il=F.default.getSingletonFactory(ss),hi=class{constructor(){this.time=null,this.verboseLevel=0}log(n,e){if(this.verboseLevel>=n){const t=typeof e=="function"?e():e;console.log(`${this.time} [${n}] ${t}`)}}},os=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(n){for(const e of["foreground","underline","italics","background","flash"])Object.prototype.hasOwnProperty.call(n,e)&&(this[e]=n[e])}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(n){return this.foreground===n.foreground&&this.underline===n.underline&&this.italics===n.italics&&this.background===n.background&&this.flash===n.flash}copy(n){this.foreground=n.foreground,this.underline=n.underline,this.italics=n.italics,this.background=n.background,this.flash=n.flash}},al=class{constructor(){this.uchar=" ",this.penState=new os}reset(){this.uchar=" ",this.penState.reset()}setChar(n,e){this.uchar=n,this.penState.copy(e)}setPenState(n){this.penState.copy(n)}equals(n){return this.uchar===n.uchar&&this.penState.equals(n.penState)}copy(n){this.uchar=n.uchar,this.penState.copy(n.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}};const Fr=100,sl={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 ls(n){return String.fromCharCode(sl[n]||n)}var ol=class{constructor(n=new hi){this.chars=[],this.cueStartTime=null,this.pos=0,this.currPenState=new os;for(let e=0;e<Fr;e++)this.chars.push(new al);this.logger=n}equals(n){for(let e=0;e<Fr;e++)if(!this.chars[e].equals(n.chars[e]))return!1;return!0}copy(n){for(let e=0;e<Fr;e++)this.chars[e].copy(n.chars[e])}isEmpty(){let n=!0;for(let e=0;e<Fr;e++)if(!this.chars[e].isEmpty()){n=!1;break}return n}setCursor(n){this.pos!==n&&(this.pos=n),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>Fr&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Fr)}moveCursor(n){const e=this.pos+n;if(n>1)for(let t=this.pos+1;t<e+1;t++)this.chars[t].setPenState(this.currPenState);this.setCursor(e)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(n){n>=144&&this.backSpace();const e=ls(n);this.pos>=Fr?this.logger.log(0,(()=>"Cannot insert "+n.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!")):(this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1))}clearFromPos(n){let e;for(e=n;e<Fr;e++)this.chars[e].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const n=[];let e=!0;for(let t=0;t<Fr;t++){const l=this.chars[t].uchar;l!==" "&&(e=!1),n.push(l)}return e?"":n.join("")}setPenStyles(n){this.currPenState.setStyles(n),this.chars[this.pos].setPenState(this.currPenState)}};const Wr=15;var xi=class{constructor(n=new hi){this.rows=[],this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null;for(let e=0;e<Wr;e++)this.rows.push(new ol(n));this.logger=n}reset(){for(let n=0;n<Wr;n++)this.rows[n].clear();this.currRow=14}equals(n){let e=!0;for(let t=0;t<Wr;t++)if(!this.rows[t].equals(n.rows[t])){e=!1;break}return e}copy(n){for(let e=0;e<Wr;e++)this.rows[e].copy(n.rows[e])}isEmpty(){let n=!0;for(let e=0;e<Wr;e++)if(!this.rows[e].isEmpty()){n=!1;break}return n}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(n){this.rows[this.currRow].insertChar(n)}setPen(n){this.rows[this.currRow].setPenStyles(n)}moveCursor(n){this.rows[this.currRow].moveCursor(n)}setCursor(n){this.logger.log(2,"setCursor: "+n),this.rows[this.currRow].setCursor(n)}setPAC(n){this.logger.log(2,(()=>"pacData = "+JSON.stringify(n)));let e=n.row-1;if(this.nrRollUpRows&&e<this.nrRollUpRows-1&&(e=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==e){for(let D=0;D<Wr;D++)this.rows[D].clear();const c=this.currRow+1-this.nrRollUpRows,T=this.lastOutputScreen;if(T){const D=T.rows[c].cueStartTime,R=this.logger.time;if(D!==null&&R!==null&&D<R)for(let d=0;d<this.nrRollUpRows;d++)this.rows[e-this.nrRollUpRows+d+1].copy(T.rows[c+d])}}this.currRow=e;const t=this.rows[this.currRow];if(n.indent!==null){const c=n.indent,T=Math.max(c-1,0);t.setCursor(n.indent),n.color=t.chars[T].penState.foreground}const l={foreground:n.color,underline:n.underline,italics:n.italics,background:"black",flash:!1};this.setPen(l)}setBkgData(n){this.logger.log(2,(()=>"bkgData = "+JSON.stringify(n))),this.backSpace(),this.setPen(n),this.insertChar(32)}setRollUpRows(n){this.nrRollUpRows=n}rollUp(){if(this.nrRollUpRows===null)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,(()=>this.getDisplayText()));const n=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(n,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),this.logger.log(2,"Rolling up")}getDisplayText(n){n=n||!1;const e=[];let t="",l=-1;for(let c=0;c<Wr;c++){const T=this.rows[c].getTextString();T&&(l=c+1,n?e.push("Row "+l+": '"+T+"'"):e.push(T.trim()))}return e.length>0&&(t=n?"["+e.join(" | ")+"]":e.join(`
`)),t}getTextAndFormat(){return this.rows}},us=class{constructor(n,e,t=new hi){this.chNr=n,this.outputFilter=e,this.mode=null,this.displayedMemory=new xi(t),this.nonDisplayedMemory=new xi(t),this.lastOutputScreen=new xi(t),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=t,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(n){this.outputFilter=n}setPAC(n){this.writeScreen.setPAC(n)}setBkgData(n){this.writeScreen.setBkgData(n)}setMode(n){n!==this.mode&&(this.mode=n,this.logger.log(2,(()=>"MODE="+n)),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.setRollUpRows(null),this.nonDisplayedMemory.setRollUpRows(null)),this.mode=n)}insertChars(n){for(const t of n)this.writeScreen.insertChar(t);const e=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,(()=>e+": "+this.writeScreen.getDisplayText(!0))),this.mode!=="MODE_PAINT-ON"&&this.mode!=="MODE_ROLL-UP"||(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"),this.mode!=="MODE_TEXT"&&(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(n){this.logger.log(2,"RU("+n+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(n)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){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"),this.mode==="MODE_POP-ON"){const n=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=n,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,(()=>"DISP: "+this.displayedMemory.getDisplayText()))}this.outputDataUpdate(!0)}ccTO(n){this.logger.log(2,"TO("+n+") - Tab Offset"),this.writeScreen.moveCursor(n)}ccMIDROW(n){const e={flash:!1};e.underline=n%2==1,e.italics=n>=46,e.italics?e.foreground="white":e.foreground=["white","green","blue","cyan","red","yellow","magenta"][Math.floor(n/2)-16],this.logger.log(2,"MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)}outputDataUpdate(n=!1){const e=this.logger.time;e!==null&&this.outputFilter&&(this.cueStartTime!==null||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),n&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(n){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,n,this.displayedMemory),this.cueStartTime=n))}};const ll=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];function ul(n,e,t){return t.a===n&&t.b===e}function zr(n){const e=[];for(const t of n)e.push(t.toString(16));return e}const cl={17:2,18:4,21:6,22:8,23:10,19:13,20:15},fl={25:2,26:4,29:6,30:8,31:10,27:13,28:15},dl={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},gl={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14};function pi(n,e,t){t.a=n,t.b=e}var cs=class{constructor(n,e,t){this.currentChannel=0,this.cmdHistory={a:null,b:null},this.lastTime=null;const l=this.logger=new hi;this.channels=[null,new us(n,e,l),new us(n+1,t,l)]}addData(n,e){this.lastTime=n,this.logger.time=n;for(let t=0;t<e.length;t+=2){const l=127&e[t],c=127&e[t+1];let T=!1,D=null;if(this.lastTime!==null&&(n=this.lastTime+.5*t*1001/3e4,this.logger.time=n),l===0&&c===0)continue;this.logger.log(3,(()=>"["+zr([e[t],e[t+1]])+"] -> ("+zr([l,c])+")"));const R=this.cmdHistory;if(l>=16&&l<=31){if(ul(l,c,R)){pi(null,null,R),this.logger.log(3,(()=>"Repeated command ("+zr([l,c])+") is dropped"));continue}pi(l,c,this.cmdHistory),T=this.parseCmd(l,c),T||(T=this.parseMidrow(l,c)),T||(T=this.parsePAC(l,c)),T||(T=this.parseBackgroundAttributes(l,c))}else pi(null,null,R);if(!T&&(D=this.parseChars(l,c),D.length)){const d=this.currentChannel;d&&d>0?this.channels[d].insertChars(D):this.logger.log(2,"No channel found yet. TEXT-MODE?")}T||D||this.logger.log(2,(()=>"Couldn't parse cleaned data "+zr([l,c])+" orig: "+zr([e[t],e[t+1]])))}}parseCmd(n,e){if(!((n===20||n===28||n===21||n===29)&&e>=32&&e<=47||(n===23||n===31)&&e>=33&&e<=35))return!1;const t=n===20||n===21||n===23?1:2,l=this.channels[t];return n===20||n===21||n===28||n===29?e===32?l.ccRCL():e===33?l.ccBS():e===34?l.ccAOF():e===35?l.ccAON():e===36?l.ccDER():e===37?l.ccRU(2):e===38?l.ccRU(3):e===39?l.ccRU(4):e===40?l.ccFON():e===41?l.ccRDC():e===42?l.ccTR():e===43?l.ccRTD():e===44?l.ccEDM():e===45?l.ccCR():e===46?l.ccENM():e===47&&l.ccEOC():l.ccTO(e-32),this.currentChannel=t,!0}parseMidrow(n,e){let t=0;if((n===17||n===25)&&e>=32&&e<=47){if(t=n===17?1:2,t!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const l=this.channels[t];return!!l&&(l.ccMIDROW(e),this.logger.log(3,(()=>"MIDROW ("+zr([n,e])+")")),!0)}return!1}parsePAC(n,e){let t;if(!((n>=17&&n<=23||n>=25&&n<=31)&&e>=64&&e<=127||(n===16||n===24)&&e>=64&&e<=95))return!1;const l=n<=23?1:2;t=e>=64&&e<=95?l===1?dl[n]:gl[n]:l===1?cl[n]:fl[n];const c=this.channels[l];return!!c&&(c.setPAC(this.interpretPAC(t,e)),this.currentChannel=l,!0)}interpretPAC(n,e){let t;const l={color:null,italics:!1,indent:null,underline:!1,row:n};return t=e>95?e-96:e-64,l.underline=!(1&~t),t<=13?l.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(t/2)]:t<=15?(l.italics=!0,l.color="white"):l.indent=4*Math.floor((t-16)/2),l}parseChars(n,e){let t,l=[],c=null;if(n>=25?(t=2,c=n-8):(t=1,c=n),c>=17&&c<=19){let T;T=c===17?e+80:c===18?e+112:e+144,this.logger.log(2,(()=>"Special char '"+ls(T)+"' in channel "+t)),l=[T]}else n>=32&&n<=127&&(l=e===0?[n]:[n,e]);return l&&this.logger.log(3,(()=>"Char codes = "+zr(l).join(","))),l}parseBackgroundAttributes(n,e){if(!((n===16||n===24)&&e>=32&&e<=47||(n===23||n===31)&&e>=45&&e<=47))return!1;let t;const l={};n===16||n===24?(t=Math.floor((e-32)/2),l.background=ll[t],e%2==1&&(l.background=l.background+"_semi")):e===45?l.background="transparent":(l.foreground="black",e===47&&(l.underline=!0));const c=n<=23?1:2;return this.channels[c].setBkgData(l),!0}reset(){for(let n=0;n<Object.keys(this.channels).length;n++){const e=this.channels[n];e&&e.reset()}pi(null,null,this.cmdHistory)}cueSplitAtTime(n){for(const e of this.channels)e&&e.cueSplitAtTime(n)}};function hl(n,e,t){const l=[];for(let c=e;c<t;c++)c+2<t&&n.getUint8(c)===0&&n.getUint8(c+1)===0&&n.getUint8(c+2)===3?(l.push(0),l.push(0),c+=2):l.push(n.getUint8(c));return new DataView(new Uint8Array(l).buffer)}function pl(n,e,t,l){return!(n!==4||e<8)&&t.getUint8(l)===181&&t.getUint16(l+1)===49&&t.getUint32(l+3)===1195456820&&t.getUint8(l+7)===3}function ml(n,e){return(127&n)>0||(127&e)>0}const El=6,Tl=39,_l=40,yl=23,Sl=24;function Il(n,e){const t=n.getUint8(e),l=31&t;if(l===El)return{nalType:l,headerSize:1};const c=t>>1&63;if(c===Tl||c===_l)return{nalType:c,headerSize:2};if(e+1>=n.byteLength)return null;const T=n.getUint8(e+1)>>3&31;return T===yl||T===Sl?{nalType:T,headerSize:2}:null}function Rl(n,e){let t=0;for(;t<n.byteLength-1;){let c,T=0,D=0;do T+=c=n.getUint8(t++);while(c===255);do D+=c=n.getUint8(t++);while(c===255);if(pl(T,D,n,t)){const R=t+10,d=R+3*(31&n.getUint8(R-2));for(let b=R;b<d;b+=3){const M=n.getUint8(b);if(4&M){const m=3&M;if((l=m)===0||l===1){const u=n.getUint8(b+1),N=n.getUint8(b+2);ml(u,N)&&e[m].push(u,N)}}}}t+=D}var l}function Al(n,e,t){let l=0;const c=[[],[]];for(let T=e;T<e+t-6;T++){l=n.getUint32(T);const D=T+4+l;if(D>e+t)break;const R=Il(n,T+4);if(R){const d=T+4+R.headerSize;D<=n.byteLength&&Rl(hl(n,d,D),c)}T+=l+3}return c}function fs(n){const e=n.errHandler,t=n.manifestModel,l=n.mediaController,c=n.videoModel,T=n.textTracks,D=n.vttParser,R=n.vttCustomRenderingParser,d=n.ttmlParser,b=n.streamInfo,M=n.settings,m=this.context,u=(0,g.default)(m).getInstance();let N,O,L,x,U,K,q,z,J,v,A,y,C,ee,k,Q,W=!1;function re(){K=null,z=NaN,J=[],q=!1,U=[],x=null}function Ce(se){const Ae={};Ae[fe.default.SUBTITLE]="subtitles",Ae[fe.default.CAPTION]="captions",Ae[fe.default.FORCED_SUBTITLE]="subtitles";const ge=new nl;for(let we in se)ge[we]=se[we];ge.defaultTrack=(function(we){let Ve=!1;return A.length>1&&we.isEmbedded?Ve=we.id&&we.id===r.default.CC1:A.length===1?we.id&&typeof we.id=="string"&&we.id.substring(0,2)==="CC"&&(Ve=!0):A.length===0&&(Ve=we.index===U[0].index),Ve})(se),ge.isTTML=(function(we){return we.codec&&we.codec.search(r.default.STPP)>=0||we.mimeType&&we.mimeType.search(r.default.TTML)>=0})(se),ge.kind=(function(we,Ve){let $e=we.roles&&we.roles.length>0?Ve[we.roles[0].value]:Ve.caption;return $e=Object.values(Ve).includes($e)?$e:Ve.caption,$e})(se,Ae),T.addTextTrackInfo(ge)}function Me(se){const Ae=se.chunk;Ae.representation.mediaInfo.embeddedCaptions&&ue(Ae.bytes,Ae)}function ve(se){v=se}function ue(se,Ae){const ge=Ae.representation.mediaInfo,we=ge.type,Ve=ge.mimeType,$e=ge.codec||Ve;$e?ge.codec.indexOf("application/mp4")!==-1?(function(Je,gt,Et){let Jt,fn;if(gt.segmentType==="InitializationSegment")q=!0,z=L.getMediaTimescaleFromMoov(Je);else{if(!q)return;fn=L.getSamplesInfo(Je),Jt=fn.sampleList,Et.search(r.default.STPP)>=0?(function(bn,kn,Kn){let Un,Bn;for(x=x!==null?x:pe(Kn),Un=0;Un<kn.length;Un++){const xn=kn[Un],rt=xn.cts,Mt=ne(),St=Mt+rt/z,Gt=St+xn.duration/z;N.buffered.add(St,Gt);const cn=new DataView(bn,xn.offset,xn.subSizes[0]);let Nn=qn.Utils.dataViewToString(cn,r.default.UTF8);const lt=[];let Lt=xn.offset+xn.subSizes[0];for(Bn=1;Bn<xn.subSizes.length;Bn++){const jt=new Uint8Array(bn,Lt,xn.subSizes[Bn]),xe=String.fromCharCode.apply(null,jt);lt.push(xe),Lt+=xn.subSizes[Bn]}try{const jt=t.getValue().ttmlTimeIsRelative?rt/z:0,xe=x.parse(Nn,jt,rt/z,(rt+xn.duration)/z,lt);T.addCaptions(v,Mt,xe)}catch(jt){K.removeExecutedRequestsBeforeTime(),Ee(),O.error("TTML parser error: "+jt)}}})(Je,Jt,Et):(function(bn,kn){let Kn,Un,Bn;const xn=[],rt=ne();for(Kn=0;Kn<kn.length;Kn++){const Mt=kn[Kn],St=rt+Mt.cts/z,Gt=St+Mt.duration/z;N.buffered.add(St,Gt);const cn=bn.slice(Mt.offset,Mt.offset+Mt.size),Nn=qn.parseBuffer(cn);for(Un=0;Un<Nn.boxes.length;Un++){const lt=Nn.boxes[Un];if(O.debug("VTT box1: "+lt.type),lt.type!=="vtte"&&lt.type==="vttc"){O.debug("VTT vttc boxes.length = "+lt.boxes.length);let Lt={styles:{}};for(Bn=0;Bn<lt.boxes.length;Bn++){const jt=lt.boxes[Bn];if(O.debug("VTT box2: "+jt.type),jt.type==="payl")Lt.start=Mt.cts/z,Lt.end=(Mt.cts+Mt.duration)/z,Lt.data=jt.cue_text;else if(jt.type==="sttg"&&jt.settings&&jt.settings!=="")try{const xe=jt.settings.split(" ");Lt.styles=D.getCaptionStyles(xe)}catch{}}Lt&&Lt.data&&(xn.push(Lt),O.debug(`VTT ${Lt.start} - ${Lt.end} : ${Lt.data}`))}}}xn.length>0&&T.addCaptions(v,rt,xn)})(Je,Jt)}})(se,Ae,$e):we===r.default.VIDEO?(function(Je,gt){let Et,Jt;if(gt.segmentType===Ge.HTTPRequest.INIT_SEGMENT_TYPE)y===0&&(y=L.getMediaTimescaleFromMoov(Je));else if(gt.segmentType===Ge.HTTPRequest.MEDIA_SEGMENT_TYPE){if(y===0)return void O.warn("CEA-608: No timescale for embeddedTextTrack yet");Jt=L.getSamplesInfo(Je);const fn=Jt.lastSequenceNumber,bn=Math.trunc(gt.start),kn=Math.trunc(gt.end);if(k[0]||k[1]||(function(){let Kn;for(let Un=0;Un<A.length;Un++){if(Kn=T.getTrackIdxForId(A[Un].id),Kn===-1)return void O.warn("CEA-608: data before track is ready.");const Bn=oe(Kn);k[Un]=new cs(Un+1,{newCue:Bn},null)}})(),y){if((function(Un,Bn,xn,rt,Mt){return Un!==null&&Bn!==null&&rt!==null&&Mt!==null&&(Bn===Un?rt!==Mt:Bn!==Un+xn)})(C,fn,Jt.numSequences,ee,bn))for(Et=0;Et<k.length;Et++)k[Et]&&k[Et].reset();const Kn=(function(Un,Bn){if(Bn.length===0)return null;const xn={splits:[],fields:[[],[]]},rt=new DataView(Un);for(let Mt=0;Mt<Bn.length;Mt++){const St=Bn[Mt],Gt=Al(rt,St.offset,St.size);let cn=null,Nn=0;for(let lt=0;lt<2;lt++)if(Gt[lt].length>0){St.cts!==cn?Nn=0:Nn+=1;const Lt=ne();xn.fields[lt].push([St.cts+Lt*y,Gt[lt],Nn]),cn=St.cts}}return xn.fields.forEach((function(Mt){Mt.sort((function(St,Gt){return St[0]===Gt[0]?St[2]-Gt[2]:St[0]-Gt[0]}))})),xn})(Je,Jt.sampleList);for(let Un=0;Un<k.length;Un++){const Bn=Kn.fields[Un],xn=k[Un];if(xn)for(Et=0;Et<Bn.length;Et++)xn.addData(Bn[Et][0]/y,Bn[Et][1])}C=fn,ee=kn}}})(se,Ae):(function(Je,gt,Et){let Jt,fn;const bn=new DataView(Je,0,Je.byteLength);fn=qn.Utils.dataViewToString(bn,r.default.UTF8);try{Jt=pe(Et).parse(fn,0),T.addCaptions(T.getCurrentTrackIdx(),0,Jt),N.buffered&&N.buffered.add(gt.start,gt.end)}catch(kn){e.error(new un.default(Pn.default.TIMED_TEXT_ERROR_ID_PARSE_CODE,Pn.default.TIMED_TEXT_ERROR_MESSAGE_PARSE+kn.message,fn))}})(se,Ae,$e):O.error("No text type defined")}function oe(se){return function(Ae,ge,we){let Ve;Ve=c.getTTMLRenderingDiv()?Q.createHTMLCaptionsFromScreen(c.getElement(),Ae,ge,we):[{start:Ae,end:ge,data:we.getDisplayText(),styles:{}}],Ve&&T.addCaptions(se,0,Ve)}}function ne(){return isNaN(N.timestampOffset)?0:N.timestampOffset}function pe(se){let Ae;return se.search(r.default.VTT)>=0?Ae=M.get().streaming.text.webvtt.customRenderingEnabled&&R?R:D:(se.search(r.default.TTML)>=0||se.search(r.default.STPP)>=0)&&(Ae=d),Ae}function Ee(se,Ae){se===void 0&&se===Ae&&(se=N.buffered.start(0),Ae=N.buffered.end(N.buffered.length-1)),N.buffered.remove(se,Ae),T.deleteCuesFromTrackIdx(v,se,Ae)}function te(se){A.forEach((function(Ae){const ge=T.getTrackIdxForId(Ae.id);ge>=0&&T.deleteCuesFromTrackIdx(ge,se.from,se.to)}))}return N={abort:function(){},addEmbeddedTrack:function(se){if(W&&se)if(se.id===r.default.CC1||se.id===r.default.CC3){for(let Ae=0;Ae<A.length;Ae++)if(A[Ae].id===se.id)return;A.push(se)}else O.warn("Embedded track "+se.id+" not supported!")},addMediaInfos:function(se,Ae,ge){if(U=U.concat(Ae),se===r.default.TEXT&&Ae[0].isFragmented&&!Ae[0].isEmbedded){K=ge,N.buffered=(0,rl.default)(m).create(),J=l.getTracksFor(r.default.TEXT,b.id).filter((Ve=>Ve.isFragmented));const we=l.getCurrentTrackFor(r.default.TEXT,b.id);for(let Ve=0;Ve<J.length;Ve++)if(J[Ve]===we){ve(Ve);break}}for(let we=0;we<Ae.length;we++)Ce(Ae[we])},append:ue,getConfig:function(){return{fragmentModel:K,fragmentedTracks:J,videoModel:c}},getStreamId:function(){return b.id},initialize:function(){W||(A=[],v=null,y=0,k=[],C=null,ee=null,W=!0,Q=il(m).getInstance(),u.on(h.default.VIDEO_CHUNK_RECEIVED,Me,N),u.on(h.default.BUFFER_CLEARED,te,N))},remove:Ee,reset:function(){re(),U=[],L=null},resetEmbedded:function(){u.off(h.default.VIDEO_CHUNK_RECEIVED,Me,N),u.off(h.default.BUFFER_CLEARED,te,N),T&&T.deleteAllTextTracks(),W=!1,A=[],k=[null,null],C=null,ee=null},resetMediaInfos:function(){U=[]},setCurrentFragmentedTrackIdx:ve},O=(0,p.default)(m).getInstance().getLogger(N),L=ar(m).getInstance(),re(),N}fs.__dashjs_factory_name="TextSourceBuffer";var Nl=F.default.getClassFactory(fs);class Cl{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},[l,c]=this._insert(t,this.root);this.root=l,c&&this.size++}removeCue(e){const[t,l]=this._remove(e,this.root);return this.root=t,l&&this.size--,l}findCuesInRange(e,t){const l=[];return this._searchRange(this.root,e,t,l),l}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:typeof VTTCue<"u"&&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 l=this._compareIntervals(e,t);if(l<0){const[T]=this._insert(e,t.left);t.left=T}else{if(!(l>0))return[t,!1];{const[T]=this._insert(e,t.right);t.right=T}}t.height=1+Math.max(this._getHeight(t.left),this._getHeight(t.right)),t.maxEnd=Math.max(t.maxEnd,e.maxEnd);const c=this._getBalance(t);return c>1?(this._compareIntervals(e,t.left)<0||(t.left=this._leftRotate(t.left)),[this._rightRotate(t),!0]):c<-1?(this._compareIntervals(e,t.right)>0||(t.right=this._rightRotate(t.right)),[this._leftRotate(t),!0]):[t,!0]}_searchRange(e,t,l,c){e&&(this._overlaps(e,t,l)&&c.push(e.cue),e.left&&e.left.maxEnd>=t&&this._searchRange(e.left,t,l,c),e.right&&e.start<=l&&this._searchRange(e.right,t,l,c))}_inorderTraversal(e,t){e&&(this._inorderTraversal(e.left,t),t.push(e.cue),this._inorderTraversal(e.right,t))}_overlaps(e,t,l){if(l===t){const c=t;return e.start<=c&&c<e.end}return e.start<l&&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,l=t.left;return t.left=e,e.right=l,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,l=t.right;return t.right=e,e.left=l,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 l=this._compareCues(e,t.cue);if(l<0){const[c,T]=this._remove(e,t.left);return t.left=c,T&&this._updateNode(t),[t,T]}if(l>0){const[c,T]=this._remove(e,t.right);return t.right=c,T&&this._updateNode(t),[t,T]}if(t.left||t.right){if(t.left){if(t.right){const c=this._findMin(t.right);t.cue=c.cue,t.start=c.start,t.end=c.end;const[T]=this._remove(c.cue,t.right);return t.right=T,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 Bi=P(7640);const ds=["text","align","fontSize","id","isd","line","lineAlign","lineHeight","linePadding","position","positionAlign","region","size","snapToLines","vertical"];function gs(n){const e=this.context,t=(0,g.default)(e).getInstance(),l=n.videoModel,c=n.streamInfo,T=n.settings;let D,R,d,b,M,m,u,N,O,L,x,U,K,q,z,J,v,A,y,C;const ee=new Map;function k(rt){const Mt=rt.kind,St=rt.id!==void 0?rt.id:rt.lang,Gt=rt.lang,cn=rt.isTTML,Nn=rt.isEmbedded;return l.addTextTrack(Mt,St,Gt,cn,Nn)}function Q(rt,Mt,St,Gt,cn,Nn){let lt=0,Lt=0;rt/Mt>St/Gt?(Lt=Mt,lt=Lt/Gt*St):(lt=rt,Lt=lt/St*Gt);let jt=0,xe=0,Ze=0,bt=0;return lt/Lt>cn?(bt=Lt,Ze=Lt*cn):(Ze=lt,bt=lt/cn),jt=(rt-Ze)/2,xe=(Mt-bt)/2,Nn?{x:jt+.1*Ze,y:xe+.1*bt,w:.8*Ze,h:.8*bt}:{x:jt,y:xe,w:Ze,h:bt}}function W(rt,Mt){const St=l.getClientWidth(),Gt=l.getClientHeight(),cn=l.getVideoWidth(),Nn=l.getVideoHeight(),lt=l.getVideoRelativeOffsetTop(),Lt=l.getVideoRelativeOffsetLeft();if(cn!==0&&Nn!==0){let jt=cn/Nn,xe=!1;rt.isFromCEA608&&(jt=1.1666666666666667,xe=!0);const Ze=Q.call(this,St,Gt,cn,Nn,jt,xe),bt=Ze.w,Xe=Ze.h,qt=Ze.x,Xt=Ze.y;if(bt!=O||Xe!=L||qt!=u||Xt!=N||Mt){if(u=qt+Lt,N=Xt+lt,O=bt,L=Xe,x){const wn=x.style;wn&&(wn.left=u+"px",wn.top=N+"px",wn.width=O+"px",wn.height=L+"px",wn.zIndex=q&&document[q]||z?v:null,t.trigger(H.default.CAPTION_CONTAINER_RESIZE))}const sn=rt.activeCues;if(sn){const wn=sn.length;for(let Te=0;Te<wn;++Te){const nt=sn[Te];nt.scaleCue(nt)}}}}}function re(rt){const Mt=O,St=L;let Gt,cn,Nn,lt,Lt;if(rt.cellResolution){const jt=[Mt/rt.cellResolution[0],St/rt.cellResolution[1]];if(rt.linePadding){for(Gt in rt.linePadding)if(rt.linePadding.hasOwnProperty(Gt)){cn=(rt.linePadding[Gt]*jt[0]).toString();const xe=document.getElementsByClassName("spanPadding");for(let Ze=0;Ze<xe.length;Ze++)xe[Ze].style.cssText=xe[Ze].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+cn),xe[Ze].style.cssText=xe[Ze].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+cn)}}if(rt.fontSize){for(Gt in rt.fontSize)if(rt.fontSize.hasOwnProperty(Gt)){rt.fontSize[Gt][0]==="%"?Nn=rt.fontSize[Gt][1]/100:rt.fontSize[Gt][0]==="c"&&(Nn=rt.fontSize[Gt][1]),cn=(Nn*jt[1]).toString(),Lt=Gt!=="defaultFontSize"?document.getElementsByClassName(Gt):document.getElementsByClassName("paragraph");for(let xe=0;xe<Lt.length;xe++)Lt[xe].style.cssText=Lt[xe].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+cn)}if(rt.lineHeight){for(Gt in rt.lineHeight)if(rt.lineHeight.hasOwnProperty(Gt)){rt.lineHeight[Gt][0]==="%"?lt=rt.lineHeight[Gt][1]/100:rt.fontSize[Gt][0]==="c"&&(lt=rt.lineHeight[Gt][1]),cn=(lt*jt[1]).toString(),Lt=document.getElementsByClassName(Gt);for(let xe=0;xe<Lt.length;xe++)Lt[xe].style.cssText=Lt[xe].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+cn)}}}}if(rt.isd){let jt=document.getElementById(rt.cueID);jt&&x.removeChild(jt),Me(rt)}}function Ce(rt,Mt){const St=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/,Gt=/^#(.*)$/;if(St.test(Mt)){const cn=St.exec(Mt),Nn=parseInt(cn[4],10)-1;return"data:image/png;base64,"+btoa(rt.images[Nn])}if(Gt.test(Mt)){const cn=Gt.exec(Mt)[1];return"data:image/png;base64,"+rt.embeddedImages[cn]}return Mt}function Me(rt){if(x){Bn.call(this);const Mt=document.createElement("div");x.appendChild(Mt),J=(0,Bi.renderHTML)(rt.isd,Mt,(function(St){return Ce(rt,St)}),x.clientHeight,x.clientWidth,T.get().streaming.text.imsc.displayForcedOnlyMode,(function(St){R.info("renderCaption :",St)}),J,T.get().streaming.text.imsc.enableRollUp),Mt.id=rt.cueID,t.trigger(H.default.CAPTION_RENDERED,{captionDiv:Mt,currentTrackIdx:m})}}function ve(rt,Mt){const St=Mt.findCuesInRange(rt.startTime-.1,rt.endTime+.1);for(const Gt of St)if(ue(rt,Gt)&&oe(rt,Gt,ds)||ue(Gt,rt)&&oe(rt,Gt,ds))return Gt;return null}function ue(rt,Mt){return!!Mt&&Mt.endTime>=rt.startTime}function oe(rt,Mt,St){for(let Gt=0;Gt<St.length;Gt++){const cn=St[Gt];if(JSON.stringify(rt[cn])!==JSON.stringify(Mt[cn]))return!1}return!0}function ne(rt,Mt){Mt&&Mt.forEach((St=>{St.kind&&St.kind==="image"&&(St.src=Ce(rt,St.src)),ne(rt,St.contents)}))}function pe(rt,Mt,St){const Gt=gt(rt),cn=ee.get(Gt),Nn=T.get().streaming.text.dispatchForManualRendering;if(Gt&&cn&&Array.isArray(St)&&St.length!==0){for(let jt=0;jt<St.length;jt++){let xe=null;const Ze=St[jt];if(Gt.cellResolution=Ze.cellResolution,Gt.isFromCEA608=Ze.isFromCEA608,isNaN(Ze.start)||isNaN(Ze.end)||(Nn?xe=Ee(Ze,Mt):we(Ze)&&x?xe=Ae(Ze,Mt,Gt):Ze.data&&(xe=ge(Ze,Mt,Gt))),xe){if(T.get().streaming.text.extendSegmentedCues){const bt=ve(xe,cn.allCues);bt&&(cn.allCues.removeCue(bt),Lt=xe,(lt=bt).startTime=Math.min(lt.startTime,Lt.startTime),lt.endTime=Math.max(lt.endTime,Lt.endTime),xe=lt)}cn.allCues.addCue(xe)}else R.error("Impossible to display subtitles. You might have missed setting a TTML rendering div via player.attachTTMLRenderingDiv(TTMLRenderingDiv)")}var lt,Lt;kn()}}function Ee(rt,Mt){let St=Ve(rt,Mt);return St.onenter=function(){we(rt)&&C&&C.cueID!==St.cueID&&se(C),delete St.type,C=St,te(St)},St.onexit=function(){se(St),C=null},St}function te(rt){t.trigger(H.default.CUE_ENTER,rt)}function se(rt){t.trigger(H.default.CUE_EXIT,{cueID:rt.cueID})}function Ae(rt,Mt,St){const Gt=this;let cn=Ve(rt,Mt);return x.style.left=u+"px",x.style.top=N+"px",x.style.width=O+"px",x.style.height=L+"px",cn.onenter=function(){St.mode===r.default.TEXT_SHOWING&&(this.isd?(y?requestAnimationFrame((()=>Me(this))):Me(this),R.debug("Cue enter id:"+this.cueID)):(x.appendChild(this.cueHTMLElement),re.call(Gt,this),t.trigger(H.default.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:m})))},cn.onexit=function(){if(x){const Nn=x.childNodes;for(let lt=0;lt<Nn.length;++lt)Nn[lt].id===this.cueID&&(R.debug("Cue exit id:"+Nn[lt].id),x.removeChild(Nn[lt]),--lt)}},cn}function ge(rt,Mt,St){let Gt=Ve(rt,Mt);if(rt.styles)try{rt.styles.align!==void 0&&"align"in Gt&&(Gt.align=rt.styles.align),rt.styles.line!==void 0&&"line"in Gt&&(Gt.line=rt.styles.line),rt.styles.lineAlign!==void 0&&(Gt.lineAlign=rt.styles.lineAlign),rt.styles.snapToLines!==void 0&&"snapToLines"in Gt&&(Gt.snapToLines=rt.styles.snapToLines),rt.styles.position!==void 0&&"position"in Gt&&(Gt.position=rt.styles.position),rt.styles.positionAlign!==void 0&&(Gt.positionAlign=rt.styles.positionAlign),rt.styles.size!==void 0&&"size"in Gt&&(Gt.size=rt.styles.size)}catch(cn){R.error(cn)}return Gt.onenter=function(){St.mode===r.default.TEXT_SHOWING&&t.trigger(H.default.CAPTION_RENDERED,{currentTrackIdx:m})},Gt}function we(rt){return rt.type==="html"}function Ve(rt,Mt){return we(rt)?(function(St,Gt){let cn=new d(St.start+Gt,St.end+Gt,"");return cn.cueHTMLElement=St.cueHTMLElement,cn.isd=St.isd,cn.images=St.images,cn.embeddedImages=St.embeddedImages,cn.cueID=St.cueID,cn.scaleCue=re.bind(self),cn.cellResolution=St.cellResolution,cn.lineHeight=St.lineHeight,cn.linePadding=St.linePadding,cn.fontSize=St.fontSize,cn.isd&&ne(cn,cn.isd.contents),cn})(rt,Mt):(function(St,Gt){let cn=new d(St.start+Gt,St.end+Gt,St.data);return cn.cueID=rn.default.generateUuid(),cn})(rt,Mt)}function $e(rt){if(U){const Mt=U.childNodes;for(let St=0;St<Mt.length;++St)Mt[St].id===rt.cueID&&(U.removeChild(Mt[St]),--St)}}function Je(){const rt=l.getTextTracks(),Mt=[];for(const St of rt)St.manualMode===r.default.TEXT_SHOWING&&Mt.push(St);return Mt}function gt(rt){return rt>=0&&b[rt]?l.getTextTrack(b[rt].kind,b[rt].id,b[rt].lang,b[rt].isTTML,b[rt].isEmbedded):null}function Et(rt){if(rt===m)return;m=rt;const Mt=gt(m);Jt.call(this,Mt),K&&(clearInterval(K),K=null),Mt&&Mt.renderingType==="html"&&(W.call(this,Mt,!0),window.ResizeObserver?(A=new window.ResizeObserver((()=>{W.call(this,Mt,!0)})),A.observe(l.getElement())):K=setInterval(W.bind(this,Mt),500))}function Jt(rt){Bn.call(this),rt&&rt.renderingType==="html"?Kn.call(this):Un.call(this)}function fn(rt,Mt,St,Gt=!0){return!!rt&&(isNaN(Mt)||(Gt?rt.startTime:rt.endTime)>=Mt)&&(isNaN(St)||(Gt?rt.endTime:rt.startTime)<=St)}function bn(rt,Mt,St,Gt=!0){if(!rt)return;if(rt.cues&&rt.cues.length>0)for(let Nn=rt.cues.length-1;Nn>=0;Nn--)fn(rt.cues[Nn],Mt,St,Gt)&&(rt.cues[Nn].onexit&&rt.cues[Nn].onexit(),rt.removeCue(rt.cues[Nn]));const cn=ee.get(rt);if(cn){const Nn=cn.activeCues,lt=Nn.filter((Lt=>Lt.startTime>=Mt&&Lt.endTime<=St));lt.forEach((Lt=>{T.get().streaming.text.dispatchForManualRendering?se(Lt):$e(Lt)})),cn.activeCues=Nn.filter((Lt=>!lt.includes(Lt)))}}function kn(){for(const rt of ee.values())rt.lastCueWindowUpdate=-1/0}function Kn(){let rt=document.getElementById("native-cue-style");if(rt)return;rt=document.createElement("style"),rt.id="native-cue-style",document.head.appendChild(rt);const Mt=rt.sheet,St=l.getElement();try{St&&(St.id?Mt.insertRule("#"+St.id+"::cue {background: transparent}",0):St.classList.length!==0?Mt.insertRule("."+St.className+"::cue {background: transparent}",0):Mt.insertRule("video::cue {background: transparent}",0))}catch(Gt){R.info(""+Gt.message)}}function Un(){const rt=document.getElementById("native-cue-style");rt&&document.head.removeChild(rt)}function Bn(){if(x)for(;x.firstChild;)x.removeChild(x.firstChild)}function xn(){return b}return D={addCaptions:pe,addTextTrackInfo:function(rt){b.push(rt)},createTracks:function(){b.sort((function(Mt,St){return Mt.index-St.index})),x=l.getTTMLRenderingDiv(),U=l.getVttRenderingDiv();let rt=-1;for(let Mt=0;Mt<b.length;Mt++){const St=k(b[Mt]);M.push(St),b[Mt].defaultTrack&&(St.default=!0,rt=Mt);const Gt=gt(Mt);Gt&&(Gt.mode=r.default.TEXT_SHOWING,x&&(b[Mt].isTTML||b[Mt].isEmbedded)?Gt.renderingType="html":Gt.renderingType="default",ee.set(Gt,{allCues:new Cl,lastCueWindowUpdate:-1/0,activeCues:[]})),pe(Mt,0,b[Mt].captionData),t.trigger(H.default.TEXT_TRACK_ADDED)}if(Et.call(this,rt),rt>=0){let Mt=function(){const St=gt(rt);St&&St.renderingType==="html"&&W.call(this,St,!0),t.off(H.default.PLAYBACK_METADATA_LOADED,Mt,this)};t.on(H.default.PLAYBACK_METADATA_LOADED,Mt,this);for(let St=0;St<b.length;St++){const Gt=gt(St);if(Gt){const cn=T.get().streaming.text.dispatchForManualRendering;Gt.mode=St!==rt||cn?r.default.TEXT_HIDDEN:r.default.TEXT_SHOWING,Gt.manualMode=St===rt?r.default.TEXT_SHOWING:r.default.TEXT_HIDDEN}}}t.trigger(h.default.TEXT_TRACKS_QUEUE_INITIALIZED,{index:m,tracks:b,streamId:c.id})},deleteAllTextTracks:function(){const rt=M?M.length:0;for(let Mt=0;Mt<rt;Mt++){const St=gt(Mt);St&&bn.call(this,St,c.start,c.start+c.duration,!1)}M=[],b=[],K&&(clearInterval(K),K=null),A&&l&&(A.unobserve(l.getElement()),A=null),m=-1,Bn.call(this),ee.clear()},deleteCuesFromTrackIdx:function(rt,Mt,St){const Gt=gt(rt);Gt&&bn(Gt,Mt,St)},disableManualTracks:function(){const rt=Je();if(rt&&rt.length>0){const Mt=rt[0],St=ee.get(Mt);if(!St)return;St.activeCues.forEach((Gt=>{T.get().streaming.text.dispatchForManualRendering?se(Gt):$e(Gt)})),St.activeCues=[]}},getCurrentTrackIdx:function(){return m},getCurrentTextTrackInfo:function(){return b[m]},getStreamId:function(){return c.id},getTextTrackInfos:xn,getTrackIdxForId:function(rt){let Mt=-1;for(let St=0;St<b.length;St++)if(b[St].id===rt){Mt=St;break}return Mt},initialize:function(){typeof window<"u"&&typeof navigator<"u"&&(d=window.VTTCue||window.TextTrackCue,b=[],M=[],m=-1,u=0,N=0,O=0,L=0,x=null,U=null,K=null,z=!1,v=2147483647,J=null,y="requestAnimationFrame"in window,ee.clear(),document.fullscreenElement!==void 0?q="fullscreenElement":document.webkitIsFullScreen!==void 0?q="webkitIsFullScreen":document.msFullscreenElement?q="msFullscreenElement":document.mozFullScreen&&(q="mozFullScreen"))},manualCueProcessing:function(rt){const Mt=Je();if(Mt&&Mt.length>0){const St=Mt[0],Gt=ee.get(St);if(!Gt)return;const cn=Gt.activeCues,Nn=Gt.allCues.findCuesAtTime(rt),lt=cn.filter((jt=>!Nn.includes(jt))),Lt=Nn.filter((jt=>!cn.includes(jt)));lt.forEach((jt=>{T.get().streaming.text.dispatchForManualRendering?se(jt):$e(jt)})),Lt.forEach((jt=>{T.get().streaming.text.dispatchForManualRendering?te(jt):WebVTT.processCues(window,[jt],U,jt.cueID)})),Gt.activeCues=Nn}},setCurrentTrackIdx:Et,setModeForTrackIdx:function(rt,Mt){const St=gt(rt);St&&St.mode!==Mt&&(St.mode=Mt),St&&St.manualMode!==Mt&&(St.manualMode=Mt)},updateTextTrackWindow:function(rt,Mt=!1){const St=xn(),Gt=T.get().streaming.text.webvtt.customRenderingEnabled;for(let cn=0;cn<St.length;cn++){const Nn=St[cn],lt=gt(cn),Lt=ee.get(lt);if(!lt||!Lt||!Nn.isEmbedded&&Gt)continue;const{bufferToKeep:jt,bufferPruningInterval:xe}=T.get().streaming.buffer,Ze=Date.now();if((Ze-Lt.lastCueWindowUpdate)/1e3<xe&&!Mt)continue;const bt=l.getPlaybackRate()||1,Xe=Math.max(0,rt-jt/bt),qt=rt+2*xe/bt;if(lt.cues)for(;lt.cues.length>0;)lt.removeCue(lt.cues[0]);lt.mode!==r.default.TEXT_DISABLED&&Lt.allCues.findCuesInRange(Xe,qt).forEach((Xt=>{lt.addCue(Xt)})),Lt.lastCueWindowUpdate=Ze}},invalidateCueWindow:kn},R=(0,p.default)(e).getInstance().getLogger(D),D}gs.__dashjs_factory_name="TextTracks";var bl=F.default.getClassFactory(gs);function hs(){const n=this.context;let e,t,l,c,T,D;function R(m){const u=m.split(":"),N=u.length-1;return m=60*parseInt(u[N-1],10)+parseFloat(u[N]),N===2&&(m+=3600*parseInt(u[0],10)),m}function d(m){const u=m.split(c),N=u[1].split(D);return N.shift(),u[1]=N[0],N.shift(),{cuePoints:u,styles:b(N)}}function b(m){const u={};return m.forEach((function(N){const O=N.split(":");if(O.length>1){const[L,x]=O;switch(L){case"align":case"A":u.align=x;break;case"line":case"L":const[U,K]=x.split(","),q=U.endsWith("%");u.line=U==="auto"?U:parseInt(U,10),q&&(u.snapToLines=!1),K&&(u.lineAlign=K);break;case"position":case"P":const[z,J]=x.split(",");u.position=parseInt(z,10),J&&(u.positionAlign=J);break;case"size":case"S":u.size=parseInt(x,10)}}})),u}function M(m,u){let N,O=u,L="",x="";for(;m[O]!==""&&O<m.length;)O++;if(N=O-u,N>1)for(let U=0;U<N;U++){if(x=m[u+U],x.match(c)){L="";break}L+=x,U!==N-1&&(L+=`
`)}else x=m[u],x.match(c)||(L=x);return L}return e={parse:function(m){const u=[];let N,O;if(!m)return u;N=(m=m.split(l)).length,O=-1;for(let L=0;L<N;L++){let x=m[L];if(x.length>0&&x!=="WEBVTT"&&x.match(c)){const U=d(x),K=U.cuePoints,q=U.styles,z=M(m,L+1),J=R(K[0].replace(T,"")),v=R(K[1].replace(T,""));!isNaN(J)&&!isNaN(v)&&J>=O&&v>J?z!==""?(O=J,u.push({start:J,end:v,data:z,styles:q})):t.error("Skipping cue due to empty/malformed cue text"):t.error("Skipping cue due to incorrect cue timing")}}return u},getCaptionStyles:b},t=(0,p.default)(n).getInstance().getLogger(e),l=/(?:\r\n|\r|\n)/gm,c=/-->/,T=/(^[\s]+|[\s]+$)/g,D=/\s\b/g,e}hs.__dashjs_factory_name="VTTParser";var Dl=F.default.getSingletonFactory(hs);function ps(){let n,e;return n={parse:function(t){let l=[];return e.oncue=function(c){c.start=c.startTime,c.end=c.endTime,c.data=c.text,c.styles={align:c.align,line:c.line,position:c.position,size:c.size},l.push(c)},e.parse(t),l}},(function(){try{window&&window.WebVTT&&window.WebVTT.Parser&&(e=new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder()))}catch{}})(),n}ps.__dashjs_factory_name="VttCustomRenderingParser";var vl=F.default.getSingletonFactory(ps);function ms(){const n=this.context,e=(0,g.default)(n).getInstance();let t,l,c=0;function T(){const D="cue_TTML_"+c;return c++,D}return t={parse:function(D,R,d,b,M){let m="";const u=[];let N,O,L;const x={},U={};let K="",q="",z={onOpenTag:function(A,y,C){if(C[" imagetype"]&&!C[" imageType"]&&(e.trigger(H.default.CONFORMANCE_VIOLATION,{level:ii.LEVELS.ERROR,event:ii.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),C[" imageType"]=C[" imagetype"]),y==="image"&&(A==="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"||A==="http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt")){if(!C[" imageType"]||C[" imageType"].value!=="PNG")return void l.warn("smpte-tt imageType != PNG. Discarded");K=C["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){K&&(U[K]=q.trim()),q="",K=""},onText:function(A){K&&(q+=A)}};if(!D)throw m="no ttml data to parse",new Error(m);x.data=D,e.trigger(h.default.TTML_TO_PARSE,x);let J=(0,Bi.fromXML)(x.data,(function(A){m=A}),z);e.trigger(h.default.TTML_PARSED,{ttmlString:x.data,ttmlDoc:J});const v=J.getMediaTimeEvents();for(L=0;L<v.length;L++){let A=(0,Bi.generateISD)(J,v[L],(function(y){m=y}));A.contents.some((y=>y.contents.length))&&(N=v[L]+R,O=L+1<v.length?v[L+1]+R:b,N<O&&u.push({start:N,end:O,type:"html",cueID:T(),isd:A,images:M,embeddedImages:U}))}if(m!=="")throw l.error(m),new Error(m);return u}},l=(0,p.default)(n).getInstance().getLogger(t),t}ms.__dashjs_factory_name="TTMLParser";var Ml=F.default.getSingletonFactory(ms);function Es(n){let e=this.context;const t=(0,g.default)(e).getInstance(),l=(0,Ht.default)(e).getInstance(),c=n.adapter,T=n.baseURLController,D="error",R="loaded",d="unloaded";let b,M,m;function u(L,x){let U,K,q=!1;if(T.resolve()){const v=c.getVoRepresentations(L);v&&v.length>0&&(U=T.resolve(v[0].path).url)}const z=L.essentialProperties.filter((v=>v.schemeIdUri&&v.schemeIdUri===r.default.FONT_DOWNLOAD_DVB_SCHEME)),J=L.supplementalProperties.filter((v=>v.schemeIdUri&&v.schemeIdUri===r.default.FONT_DOWNLOAD_DVB_SCHEME));z.length>0?(q=!0,K=z):K=J,K.forEach((v=>{if((function(C){return!(!(C.value&&parseInt(C.value)===1&&C.dvbUrl&&C.dvbUrl.length>0&&C.dvbFontFamily&&C.dvbFontFamily.length>0&&C.dvbMimeType)||C.dvbMimeType!==r.default.OFF_MIMETYPE&&C.dvbMimeType!==r.default.WOFF_MIMETYPE)})(v)){let C=(A=v.dvbUrl,y=U,l.isPathAbsolute(A)?A:l.isRelative(A)?y?l.resolve(A,y):l.resolve(A):A);m.push({fontFamily:v.dvbFontFamily,url:C,mimeType:v.dvbMimeType,trackId:L.id,streamId:x,isEssential:q,status:d,fontFace:new FontFace(v.dvbFontFamily,`url(${C})`,{display:"swap"})})}var A,y}))}function N(L,x){const U=m[L];m[L]={...U,status:x}}function O(){m=[]}return b={addFontsFromTracks:function(L,x){if(L&&Array.isArray(L)&&x)for(let U=0;U<L.length;U++)u(L[U],x)},downloadFonts:function(){for(let L=0;L<m.length;L++){let x=m[L];document.fonts.add(x.fontFace),t.trigger(H.default.DVB_FONT_DOWNLOAD_ADDED,x),x.fontFace.load().then((()=>{N(L,R),t.trigger(H.default.DVB_FONT_DOWNLOAD_COMPLETE,x)}),(U=>{N(L,D),M.debug("Font download error: ",U),t.trigger(H.default.DVB_FONT_DOWNLOAD_FAILED,x)}))}},getFonts:function(){return m},getFontsForTrackId:function(L){return m.filter((x=>x.trackId&&x.trackId===L))},reset:function(){(function(){for(const L of m){let x=document.fonts.delete(L.fontFace);M.debug(`Removal of fontFamily: ${L.fontFamily} was ${x?"successful":"unsuccessful"}`)}})(),O()}},M=(0,p.default)(e).getInstance().getLogger(b),O(),b}Es.__dashjs_factory_name="DVBFonts";var wl=F.default.getClassFactory(Es);function Ts(n){let e=this.context;const t=n.adapter,l=n.errHandler,c=n.manifestModel,T=n.mediaController,D=n.baseURLController,R=n.videoModel,d=n.settings;let b,M,m,u,N,O,L,x,U,K,q,z,J,v;function A(ne){if(v.error(`Could not download ${ne.isEssential?"an essential":"a"} font - fontFamily: ${ne.fontFamily}, url: ${ne.url}`),ne.isEssential){let pe=u[ne.streamId].getTrackIdxForId(ne.trackId);u[ne.streamId].setModeForTrackIdx(pe,r.default.TEXT_DISABLED)}}function y(ne){if(v.debug(`Successfully downloaded ${ne.isEssential?"an essential":"a"} font - fontFamily: ${ne.fontFamily}, url: ${ne.url}`),ne.isEssential){let pe=u[ne.streamId].getTrackIdxForId(ne.trackId);pe===u[ne.streamId].getCurrentTrackIdx()?u[ne.streamId].setModeForTrackIdx(pe,r.default.TEXT_SHOWING):u[ne.streamId].setModeForTrackIdx(pe,r.default.TEXT_HIDDEN)}}function C(ne){let pe=ne.tracks,Ee=ne.index;const te=ne.streamId;if(d.get().streaming.text.defaultEnabled===!1&&!re()||z)Ce(te,-1);else{const se=T.getCurrentTrackFor(r.default.TEXT,te);if(se){const Ae={lang:se.lang,role:se.roles[0],index:se.index,codec:se.codec,accessibility:se.accessibility[0]};pe.some(((ge,we)=>{if(T.matchSettings(Ae,ge))return Ce(te,we),Ee=we,!0}))}U=!1}M[te].lastEnabledIndex=Ee,x.trigger(H.default.TEXT_TRACKS_ADDED,{enabled:re(),index:Ee,tracks:pe,streamId:te}),q=!0,J.addFontsFromTracks(pe,te),J.getFonts().forEach((se=>{if(se.isEssential){let Ae=u[se.streamId].getTrackIdxForId(se.trackId);u[se.streamId].setModeForTrackIdx(Ae,r.default.TEXT_DISABLED)}})),J.downloadFonts()}function ee(ne){try{const pe=ne.streamId,Ee=u[pe];if(!Ee||isNaN(ne.time))return;Ee.updateTextTrackWindow(ne.time),d.get().streaming.text.webvtt.customRenderingEnabled&&Ee.manualCueProcessing(ne.time)}catch{}}function k(ne){try{const pe=ne.streamId;if(!u[pe])return;u[pe].disableManualTracks()}catch{}}function Q(ne){try{const pe=u[ne.streamId];if(!pe)return;const Ee=R.getTime()||0;pe.updateTextTrackWindow(Ee,!0)}catch(pe){v.error(pe)}}function W(ne){try{if(!ne||!ne.mediaType||ne.mediaType!==r.default.AUDIO||!ne.currentMediaInfo)return;const pe=u[ne.streamId].getCurrentTextTrackInfo();let Ee=NaN;U?Ee=Me(ne.streamId):ve(pe)&&ne.currentMediaInfo.lang&&ne.currentMediaInfo.lang!==pe.lang&&(Ee=Me(ne.streamId),isNaN(Ee)&&(Ee=-1)),isNaN(Ee)||Ce(ne.streamId,Ee)}catch(pe){v.error(pe)}}function re(){let ne=!0;return U&&!K&&(ne=!1),ne}function Ce(ne,pe){U=pe===-1,U&&x.trigger(h.default.BUFFER_LEVEL_UPDATED,{mediaType:r.default.TEXT,bufferLevel:-1},{streamId:ne,mediaType:r.default.TEXT}),U&&T&&T.saveTextSettingsDisabled();let Ee=ue(ne);if(Ee===pe||!u[ne])return;u[ne].disableManualTracks(),u[ne].invalidateCueWindow();let te=u[ne].getCurrentTextTrackInfo(),se=te?R.getTextTrack(te.kind,te.id,te.lang,te.isTTML,te.isEmbedded):null;se&&se.mode!==r.default.TEXT_DISABLED&&u[ne].setModeForTrackIdx(Ee,r.default.TEXT_HIDDEN),u[ne].setCurrentTrackIdx(pe),te=u[ne].getCurrentTextTrackInfo();const Ae=d.get().streaming.text.dispatchForManualRendering;if(te&&!Ae&&te.mode!==r.default.TEXT_DISABLED&&u[ne].setModeForTrackIdx(pe,r.default.TEXT_SHOWING),te&&te.isFragmented&&!te.isEmbedded)(function(ge,we,Ve){if(!m[ge])return;let $e=m[ge].getConfig().fragmentedTracks;for(let Je=0;Je<$e.length;Je++){let gt=$e[Je];if(we.lang===gt.lang&&(gt.id?we.id===gt.id:we.index===gt.index)){let Et=T.getCurrentTrackFor(r.default.TEXT,ge);(gt.id?Et.id!==gt.id:Et.index!==gt.index)?(u[ge].deleteCuesFromTrackIdx(Ve),m[ge].setCurrentFragmentedTrackIdx(Je)):Ve===-1&&x.trigger(h.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,{},{streamId:ge,mediaType:r.default.TEXT})}}})(ne,te,Ee);else if(te&&!te.isFragmented)(function(ge,we){x.trigger(h.default.SET_NON_FRAGMENTED_TEXT,{currentTrackInfo:we},{streamId:ge,mediaType:r.default.TEXT})})(ne,te);else if(!te&&U){const ge=Me(ne);return void(isNaN(ge)||Ce(ne,ge))}T.setTrack(te)}function Me(ne){const pe=(function(se){return u[se].getTextTrackInfos().filter(((Ae,ge)=>(Ae._indexToSelect=ge,!!(Ae&&Ae.roles&&Ae.roles.length>0)&&ve(Ae))))})(ne);if(!pe||pe.length<=0)return NaN;const Ee=T.getCurrentTrackFor(r.default.AUDIO,ne);if(!Ee)return NaN;const te=pe.find((se=>Ee.lang===se.lang));return te?te._indexToSelect:NaN}function ve(ne){return!(!ne||!ne.roles||ne.roles.length===0)&&ne.roles.some((pe=>pe.schemeIdUri===r.default.DASH_ROLE_SCHEME_ID&&pe.value===fe.default.FORCED_SUBTITLE))}function ue(ne){return u[ne].getCurrentTrackIdx()}function oe(){m={},u={},M={},U=!0,q=!1,z=!1}return b={addEmbeddedTrack:function(ne,pe){const Ee=ne.id;m[Ee]&&m[Ee].addEmbeddedTrack(pe)},addMediaInfosToBuffer:function(ne,pe,Ee,te=null){const se=ne.id;m[se]&&m[se].addMediaInfos(pe,Ee,te)},createTracks:function(ne){const pe=ne.id;u[pe]&&u[pe].createTracks()},deactivateStream:function(ne){if(!ne)return;const pe=ne.id;m[pe]&&m[pe].resetMediaInfos(),u[pe]&&u[pe].deleteAllTextTracks()},enableForcedTextStreaming:function(ne){return(0,yn.checkParameterType)(ne,"boolean"),K=ne,!0},enableText:function(ne,pe){return(0,yn.checkParameterType)(pe,"boolean"),re()!==pe&&(pe&&Ce(ne,M[ne].lastEnabledIndex),pe||(M[ne].lastEnabledIndex=ue(ne),q?Ce(ne,-1):z=!0)),!0},getAllTracksAreDisabled:function(){return U},getCurrentTrackIdx:ue,getTextSourceBuffer:function(ne){const pe=ne.id;if(m&&m[pe])return m[pe]},initialize:function(){J=wl(e).create({adapter:t,baseURLController:D}),x.on(h.default.TEXT_TRACKS_QUEUE_INITIALIZED,C,b),x.on(h.default.DVB_FONT_DOWNLOAD_FAILED,A,b),x.on(h.default.DVB_FONT_DOWNLOAD_COMPLETE,y,b),x.on(h.default.MEDIAINFO_UPDATED,W,b),x.on(h.default.PLAYBACK_TIME_UPDATED,ee,b),d.get().streaming.text.webvtt.customRenderingEnabled&&x.on(h.default.PLAYBACK_SEEKING,k,b),x.on(h.default.PLAYBACK_SEEKED,Q,b)},initializeForStream:function(ne){const pe=ne.id,Ee=bl(e).create({videoModel:R,settings:d,streamInfo:ne});Ee.initialize(),u[pe]=Ee;const te=Nl(e).create({errHandler:l,adapter:t,dvbFonts:J,manifestModel:c,mediaController:T,videoModel:R,textTracks:Ee,vttParser:N,vttCustomRenderingParser:O,ttmlParser:L,streamInfo:ne,settings:d});te.initialize(),m[pe]=te,M[pe]={},M[pe].lastEnabledIndex=-1},isTextEnabled:re,reset:function(){Object.keys(m).forEach((ne=>{m[ne].resetEmbedded(),m[ne].reset()})),J.reset(),oe(),x.off(h.default.TEXT_TRACKS_QUEUE_INITIALIZED,C,b),x.off(h.default.DVB_FONT_DOWNLOAD_FAILED,A,b),x.off(h.default.DVB_FONT_DOWNLOAD_COMPLETE,y,b),x.off(h.default.MEDIAINFO_UPDATED,W,b),x.off(h.default.PLAYBACK_TIME_UPDATED,ee,b),d.get().streaming.text.webvtt.customRenderingEnabled&&x.off(h.default.PLAYBACK_SEEKING,k,b),x.off(h.default.PLAYBACK_SEEKED,Q,b)},setTextTrack:Ce,clearDataForStream:function(ne){m[ne]&&(m[ne].resetEmbedded(),m[ne].reset(),delete m[ne]),u[ne]&&(u[ne].deleteAllTextTracks(),delete u[ne]),M[ne]&&delete M[ne]}},K=!1,q=!1,z=!1,N=Dl(e).getInstance(),O=vl(e).getInstance(),L=Ml(e).getInstance(),x=(0,g.default)(e).getInstance(),v=(0,p.default)(e).getInstance().getLogger(b),oe(),b}Ts.__dashjs_factory_name="TextController";var Pl=F.default.getClassFactory(Ts);function _s(n){n=n||{};const e=this.context,t=(0,p.default)(e).getInstance(),l=n.settings,c=(0,g.default)(e).getInstance();let T,D,R,d,b,M;function m(){return navigator&&navigator.connection&&!isNaN(navigator.connection.downlink)&&navigator.connection.downlink>0?1e3*navigator.connection.downlink:NaN}function u(L,x,U,K){const q=Math.pow(.5,U/K.fast);L.fastEstimate=(1-q)*x+q*L.fastEstimate;const z=Math.pow(.5,U/K.slow);L.slowEstimate=(1-z)*x+z*L.slowEstimate,L.totalWeight+=U}function N(){T={},D={},R={},d={}}const O={addEntry:function(L,x){try{if(!(L&&x&&x.trace&&x.trace.length))return;(function(q){T[q]=T[q]||[],D[q]=D[q]||[],R[q]=R[q]||{fastEstimate:0,slowEstimate:0,totalWeight:0},d[q]=d[q]||{fastEstimate:0,slowEstimate:0,totalWeight:0}})(L);const U=x.tresponse.getTime()-x.trequest.getTime()||1;let K=(function(q,z){return q._fileLoaderType&&q._fileLoaderType===r.default.FILE_LOADER_TYPES.FETCH?(function(J){const v=J.trace.reduce(((C,ee)=>C+ee.b[0]),0),A=J.trace.reduce(((C,ee)=>C+ee.d),0);let y=NaN;return l.get().streaming.abr.throughput.useNetworkInformationApi.fetch&&(y=m()),isNaN(y)&&(y=Math.round(8*v/A)),{downloadedBytes:v,value:y,downloadTimeInMs:A}})(q):(function(J,v){let A=NaN,y=NaN,C=!1;if(l.get().streaming.abr.throughput.useResourceTimingApi&&J._resourceTimingValues)A=J._resourceTimingValues.transferSize,y=J._resourceTimingValues.responseEnd-J._resourceTimingValues.responseStart,C=!0;else{if(J.trace.length<=1)return{throughput:NaN,downloadTimeInMs:NaN};A=J.trace.reduce(((k,Q)=>k+Q.b[0]),0)-J.trace[0].b[0],y=Math.max(J.trace.reduce(((k,Q)=>k+Q.d),0)-J.trace[0].d,1)}let ee=NaN;if(!C&&l.get().streaming.abr.throughput.useNetworkInformationApi.xhr&&(ee=m()),isNaN(ee)){const k=l.get().streaming.abr.throughput.useDeadTimeLatency?y:y+v;ee=Math.round(8*A/k)}return{downloadedBytes:A,value:ee,downloadTimeInMs:y}})(q,z)})(x,U);if(K.latencyInMs=U,isNaN(K.value)||!isFinite(K.value))return;if(x.cmsd){const q=x.cmsd.dynamic&&x.cmsd.dynamic.etp?x.cmsd.dynamic.etp:null;if(q){const z=l.get().streaming.cmsd.abr.etpWeightRatio;z>0&&z<=1&&(K.value=K.value*(1-z)+q*z)}}if((function(q,z,J){return l.get().streaming.abr.throughput.useResourceTimingApi&&J._resourceTimingValues?J._resourceTimingValues.transferSize===0&&J._resourceTimingValues.decodedBodySize>0:!isNaN(z)&&(q===r.default.VIDEO?z<l.get().streaming.cacheLoadThresholds[r.default.VIDEO]:q===r.default.AUDIO?z<l.get().streaming.cacheLoadThresholds[r.default.AUDIO]:void 0)})(L,x._tfinish.getTime()-x.trequest.getTime(),x))return void M.debug(`${L} Assuming segment ${x.url} came from cache, ignoring it for throughput calculation`);M.debug(`Added throughput entry for ${L}: ${K.value} kbit/s`),K.serviceLocation=x._serviceLocation,T[L].push(K),D[L].push({value:U}),(function(q){T[q].length>l.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep&&T[q].shift(),D[q].length>l.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep&&D[q].shift()})(L),c.trigger(H.default.THROUGHPUT_MEASUREMENT_STORED,{throughputValues:K}),x.type!==Ge.HTTPRequest.MPD_TYPE&&(u(R[L],K.value,l.get().streaming.abr.throughput.ewma.weightDownloadTimeMultiplicationFactor*K.downloadTimeInMs,b.bandwidthHalfLife),u(d[L],U,1,b.latencyHalfLife))}catch(U){M.error(U)}},getThroughputDict:function(L){return L?T[L]:T},getEwmaThroughputDict:function(L){return L?R[L]:R},getEwmaLatencyDict:function(L){return L?d[L]:d},getEwmaHalfLife:function(){return b},getLatencyDict:function(L){return L?D[L]:D},reset:N};return M=t.getLogger(O),b={bandwidthHalfLife:{fast:l.get().streaming.abr.throughput.ewma.throughputFastHalfLifeSeconds,slow:l.get().streaming.abr.throughput.ewma.throughputSlowHalfLifeSeconds},latencyHalfLife:{fast:l.get().streaming.abr.throughput.ewma.latencyFastHalfLifeCount,slow:l.get().streaming.abr.throughput.ewma.latencySlowHalfLifeCount}},N(),O}_s.__dashjs_factory_name="ThroughputModel";var Ol=F.default.getClassFactory(_s);function ys(){const n=this.context,e=(0,g.default)(n).getInstance();let t,l,c;function T(){performance.clearResourceTimings()}function D(q){q.metric!==o.HTTP_REQUEST||!q.value||q.value.type!==Ge.HTTPRequest.MPD_TYPE&&(q.value.type!==Ge.HTTPRequest.MEDIA_SEGMENT_TYPE||q.mediaType!==r.default.AUDIO&&q.mediaType!==r.default.VIDEO)||t.addEntry(q.mediaType,q.value)}function R(q,z,J=null,v=NaN){let A,y=null,C=t.getEwmaHalfLife(),ee=null,k=!0;switch(J||(J=c.get().streaming.abr.throughput.averageCalculationMode),q){case r.default.THROUGHPUT_TYPES.BANDWIDTH:y=J===r.default.THROUGHPUT_CALCULATION_MODES.EWMA?t.getEwmaThroughputDict(z):t.getThroughputDict(z),ee=C.bandwidthHalfLife,k=!0,v=isNaN(v)?l.getIsDynamic()?c.get().streaming.abr.throughput.sampleSettings.live:c.get().streaming.abr.throughput.sampleSettings.vod:v;break;case r.default.THROUGHPUT_TYPES.LATENCY:y=J===r.default.THROUGHPUT_CALCULATION_MODES.EWMA?t.getEwmaLatencyDict(z):t.getLatencyDict(z),ee=C.latencyHalfLife,k=!1,v=isNaN(v)?c.get().streaming.abr.throughput.sampleSettings.averageLatencySampleAmount:v}if(!y||y.length===0)return NaN;switch(J){case r.default.THROUGHPUT_CALCULATION_MODES.ARITHMETIC_MEAN:return A=d(y,v,q),b(y,A);case r.default.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_ARITHMETIC_MEAN:return A=d(y,v,q),M(y,A);case r.default.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_ARITHMETIC_MEAN:return A=d(y,v,q),m(y,A);case r.default.THROUGHPUT_CALCULATION_MODES.HARMONIC_MEAN:return A=d(y,v,q),u(y,A);case r.default.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_HARMONIC_MEAN:return A=d(y,v,q),N(y,A);case r.default.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_HARMONIC_MEAN:return A=d(y,v,q),O(y,A);case r.default.THROUGHPUT_CALCULATION_MODES.EWMA:return L(y,ee,k);case r.default.THROUGHPUT_CALCULATION_MODES.ZLEMA:return A=d(y,v,q),x(y,A)}}function d(q,z,J){if(q){if(z>=q.length)z=q.length;else if(J===r.default.THROUGHPUT_TYPES.BANDWIDTH&&c.get().streaming.abr.throughput.sampleSettings.enableSampleSizeAdjustment)for(let v=1;v<z;++v){const A=q[q.length-v].value/q[q.length-v-1].value;if((A>=c.get().streaming.abr.throughput.sampleSettings.increaseScale||A<=c.get().streaming.abr.throughput.sampleSettings.decreaseScale)&&(z+=1)===q.length)break}}else z=0;return z}function b(q,z){let J=q;return z!==0&&J&&J.length!==0?(J=J.slice(-z),J.reduce(((v,A)=>v+A.value),0)/J.length):NaN}function M(q,z){let J=q;if(z===0||!J||J.length===0)return NaN;J=J.slice(-z);let v=0;return J.reduce(((A,y)=>{let C=Math.sqrt(y.downloadedBytes);return v+=C,A+y.value*C}),0)/v}function m(q,z){let J=q;if(z===0||!J||J.length===0)return NaN;J=J.slice(-z);let v=0;return J.reduce(((A,y,C)=>{let ee=C+1;return v+=ee,A+y.value*ee}),0)/v}function u(q,z){let J=q;if(z===0||!J||J.length===0)return NaN;J=J.slice(-z);const v=J.reduce(((A,y)=>A+1/y.value),0);return J.length/v}function N(q,z){let J=q;if(z===0||!J||J.length===0)return NaN;J=J.slice(-z);let v=0;const A=J.reduce(((y,C)=>{let ee=Math.sqrt(C.downloadedBytes);return v+=ee,y+1/C.value*ee}),0);return v/A}function O(q,z){let J=q;if(z===0||!J||J.length===0)return NaN;J=J.slice(-z);let v=0;const A=J.reduce(((y,C,ee)=>{let k=ee+1;return v+=k,y+1/C.value*k}),0);return v/A}function L(q,z,J=!0){if(!q||q.totalWeight<=0)return NaN;const v=q.fastEstimate/(1-Math.pow(.5,q.totalWeight/z.fast)),A=q.slowEstimate/(1-Math.pow(.5,q.totalWeight/z.slow));return J?Math.min(v,A):Math.max(v,A)}function x(q,z){if(z===0||!q||q.length===0)return NaN;let J=q.slice(-z).map((C=>C.value)),v=2/(J.length+1),A=J[J.length-1],y=J[J.length-1];for(let C=0;C<J.length;C++)A=v*J[C]+(1-v)*A,y=v*A+(1-v)*y;return y}function U(q,z=null,J=NaN){const v=R(r.default.THROUGHPUT_TYPES.BANDWIDTH,q,z,J);return Math.round(v)}const K={getArithmeticMean:b,getAverageLatency:function(q,z=null,J=NaN){const v=R(r.default.THROUGHPUT_TYPES.LATENCY,q,z,J);return Math.round(v)},getAverageThroughput:U,getByteSizeWeightedArithmeticMean:M,getByteSizeWeightedHarmonicMean:N,getDateWeightedArithmeticMean:m,getDateWeightedHarmonicMean:O,getEwma:L,getHarmonicMean:u,getRawThroughputData:function(q){return q?t.getThroughputDict(q):[]},getSafeAverageThroughput:function(q,z=null,J=NaN){let v=U(q,z,J);return isNaN(v)||(v*=c.get().streaming.abr.throughput.bandwidthSafetyFactor),v},getZlema:x,initialize:function(){t=Ol(n).create({settings:c}),e.on(H.default.METRIC_ADDED,D,K),window.performance?.addEventListener?.("resourcetimingbufferfull",T)},reset:function(){t.reset(),e.off(H.default.METRIC_ADDED,D,K),window.performance?.removeEventListener?.("resourcetimingbufferfull",T)},setConfig:function(q){q.settings&&(c=q.settings),q.playbackController&&(l=q.playbackController)}};return K}ys.__dashjs_factory_name="ThroughputController";var Ll=F.default.getSingletonFactory(ys);function Ss(){const n=this.context,e=(0,g.default)(n).getInstance(),t=(0,E.default)(n).getInstance();let l,c,T,D;function R(U){D=U}function d(U,K,q,z){let J,v=K.adaptation.period.mpd;const A=v.availabilityStartTime;if(z)J=q&&v.timeShiftBufferDepth!==Number.POSITIVE_INFINITY?new Date(A.getTime()+1e3*(U+v.timeShiftBufferDepth)):v.availabilityEndTime;else if(q){const y=K.availabilityTimeOffset;J=new Date(A.getTime()+1e3*(U-y))}else J=A;return J}function b(U,K){return(U.getTime()-K.mpd.availabilityStartTime.getTime()+1e3*D)/1e3}function M(U,K){return U+(K.adaptation.period.start-K.presentationTimeOffset)}function m(U){const K={start:NaN,end:NaN},q=U[0].getAdapter().getRegularPeriods()[0],z=b(new Date,q);if(!U||U.length===0)return{range:K,now:z};U.forEach((v=>{let A=v.getCurrentRepresentationForType(r.default.VIDEO);if(A||(A=v.getCurrentRepresentationForType(r.default.AUDIO)),!A){const C=v.getAdapter(),ee=C.getMediaInfoForType(v.getStreamInfo(),r.default.VIDEO)||C.getMediaInfoForType(v.getStreamInfo(),r.default.AUDIO);A=C.getVoRepresentations(ee)[0]}let y={start:NaN,end:NaN};if(A)if(A.segmentInfoType===fe.default.SEGMENT_TIMELINE)y=(function(C){const ee=C.adaptation.period.mpd.manifest.Period[C.adaptation.period.index].AdaptationSet[C.adaptation.index],k=c.getRepresentationFor(C.index,ee),Q=k.SegmentTemplate||k.SegmentList,W=Q.SegmentTimeline,re=Q.timescale,Ce=W.S,Me={start:0,end:0},ve=Ce[0].t,ue=!isNaN(ve),oe=ue?ve:0;let ne,pe,Ee,te,se=0;for(ue&&(Me.start=M(oe/re,C)),Ee=0,te=Ce.length;Ee<te;Ee++)ne=Ce[Ee],pe=0,ne.hasOwnProperty("r")&&(pe=ne.r),se+=ne.d*(1+pe);return Me.end=M((oe+se)/re,C),Me})(A);else{const C=A.adaptation.period;y.start=C.start,y.end=Math.max(z,C.start+C.duration)}!isNaN(y.start)&&(isNaN(K.start)||K.start>y.start)&&(K.start=y.start),!isNaN(y.end)&&(isNaN(K.end)||K.end<y.end)&&(K.end=y.end)})),K.end=Math.min(z,K.end);const J=N(U,K.end,!0);return K.end=isNaN(J)?K.end:J,K.start=q&&q.mpd&&q.mpd.timeShiftBufferDepth&&!isNaN(q.mpd.timeShiftBufferDepth)&&!isNaN(K.end)?Math.max(K.end-q.mpd.timeShiftBufferDepth,K.start):K.start,K.start=N(U,K.start),{range:K,now:z}}function u(U,K){T=U-K.end}function N(U,K,q=!1){try{let z=0,J=!1,v=NaN;for(;!J&&z<U.length;){const A=U[z].getStreamInfo();A.start<=K&&(!isFinite(A.duration)||A.start+A.duration>=K)?(v=K,J=!0):!q&&A.start>K&&(isNaN(v)||A.start<v)?v=A.start:q&&A.start+A.duration<K&&(isNaN(v)||A.start+A.duration>v)&&(v=A.start+A.duration),z+=1}return v}catch{return K}}function O(U){U.offset===void 0||isNaN(U.offset)||R(U.offset/1e3)}function L(){D=0,T=0}function x(){e.off(h.default.UPDATE_TIME_SYNC_OFFSET,O,this),L()}return l={calcAvailabilityEndTimeFromPresentationTime:function(U,K,q){return d(U,K,q,!0)},calcAvailabilityStartTimeFromPresentationTime:function(U,K,q){return d(U,K,q)},calcMediaTimeFromPresentationTime:function(U,K){return U-K.adaptation.period.start+K.presentationTimeOffset},calcPeriodRelativeTimeFromMpdRelativeTime:function(U,K){return K-U.adaptation.period.start},calcPresentationTimeFromMediaTime:M,calcPresentationTimeFromWallTime:b,calcTimeShiftBufferWindow:function(U,K){if(!K)return(function(q){const z={start:NaN,end:NaN};let J=NaN,v=NaN;return q.forEach((A=>{const y=A.getStreamInfo();(isNaN(J)||y.start<J)&&(J=y.start);const C=y.start+y.duration;(isNaN(v)||C>v)&&(v=C)})),z.start=J,z.end=v,z})(U);if(t.get().streaming.timeShiftBuffer.calcFromSegmentTimeline){const q=m(U);return u(q.now,q.range),q.range}return(function(q){const z={start:NaN,end:NaN};if(!q||q.length===0)return z;const J=q[0].getAdapter().getRegularPeriods()[0],v=b(new Date,J),A=J.mpd.timeShiftBufferDepth,y=isNaN(A)?0:v-A;if(z.start=N(q,y),z.end=!isNaN(z.start)&&v<z.start?v:N(q,v,!0),!isNaN(A)&&z.end<v-A&&(z.end=NaN),t.get().streaming.timeShiftBuffer.fallbackToSegmentTimeline){const C=m(q);if(C.range.end<z.start)return e.trigger(H.default.CONFORMANCE_VIOLATION,{level:ii.LEVELS.WARNING,event:ii.EVENTS.INVALID_DVR_WINDOW}),u(C.now,C.range),C.range}return z})(U)},calcWallTimeForSegment:function(U,K){let q,z,J;return K&&(q=U.representation.adaptation.period.mpd.suggestedPresentationDelay,z=U.presentationStartTime+q,J=new Date(U.availabilityStartTime.getTime()+1e3*z)),J},getClientReferenceTime:function(){return Date.now()-1e3*T+1e3*D},getClientTimeOffset:function(){return D},initialize:function(){L(),e.on(h.default.UPDATE_TIME_SYNC_OFFSET,O,this)},reset:x,setClientTimeOffset:R,setConfig:function(U){U&&U.dashManifestModel&&(c=U.dashManifestModel)}},c=(0,Gn.default)(n).getInstance(),x(),l}Ss.__dashjs_factory_name="TimelineConverter";var Fl=F.default.getSingletonFactory(Ss),Ul=class{constructor(){this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null}};function Is(){let n,e;return n={initialize:function(t){if(e=new Ul,!t)return null;const l=t.indexOf("#");if(l!==-1){const c=t.substr(l+1).split("&");for(let T=0,D=c.length;T<D;++T){const R=c[T],d=R.indexOf("=");if(d!==-1){const b=R.substring(0,d);e.hasOwnProperty(b)&&(e[b]=R.substr(d+1))}}}},getURIFragmentData:function(){return e}},n}Is.__dashjs_factory_name="URIFragmentModel";var xl=F.default.getSingletonFactory(Is);const Bl=new Map([[r.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,"loadedmetadata"],[r.default.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA,"loadeddata"],[r.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,"canplay"],[r.default.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA,"canplaythrough"]]);function Rs(){let n,e,t,l,c,T,D,R,d,b,M,m;const u=this.context,N=(0,g.default)(u).getInstance(),O=[];function L(){clearTimeout(M),N.off(h.default.PLAYBACK_PLAYING,q,this),O.length=0,(function(){try{D&&t&&D.unobserve(t),D&&(D.disconnect(),D=null)}catch{}})()}function x(Q,W=!1){t&&(W?t.playbackRate=Q:k(r.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,(()=>{t.playbackRate=Q})))}function U(){return O.length>0}function K(Q){let W=O.indexOf(Q);if(Q!==null&&(W!==-1&&O.splice(W,1),b.get().streaming.buffer.syntheticStallEvents.enabled&&t&&!U())){const re=()=>{if(x(T||1,b.get().streaming.buffer.syntheticStallEvents.ignoreReadyState),!t.paused){const Ce=document.createEvent("Event");Ce.initEvent("playing",!0,!1),t.dispatchEvent(Ce)}};b.get().streaming.buffer.syntheticStallEvents.ignoreReadyState?re():(R&&R.func&&R.event&&J(R.event,R.func),R=k(r.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,re))}}function q(){if(t&&U()&&t.playbackRate===0){const Q=document.createEvent("Event");Q.initEvent("waiting",!0,!1),t.dispatchEvent(Q)}}function z(Q,W){t&&t.addEventListener(Q,W)}function J(Q,W){t&&t.removeEventListener(Q,W)}function v(){return t?t.readyState:NaN}function A(){return t?t.buffered:null}function y(){return t?t.clientWidth:NaN}function C(){return t?t.clientHeight:NaN}function ee(Q,W,re,Ce,Me){if(t){for(let ve=0;ve<t.textTracks.length;ve++)if(t.textTracks[ve].kind===Q&&(!W||t.textTracks[ve].label==W)&&t.textTracks[ve].language===re&&t.textTracks[ve].isTTML===Ce&&t.textTracks[ve].isEmbedded===Me)return t.textTracks[ve]}return null}function k(Q,W){return Q===r.default.VIDEO_ELEMENT_READY_STATES.HAVE_NOTHING||v()>=Q?(W(),null):(function(re,Ce){const Me=()=>{J(re,Me),Ce(re)};return z(re,Me),{func:Me,event:re}})(Bl.get(Q),W)}return l={addEventListener:z,addTextTrack:function(Q,W,re,Ce,Me){if(!t)return null;let ve=ee(Q,W,re,Ce,Me);return ve||(ve=t.addTextTrack(Q,W,re),ve.isEmbedded=Me,ve.isTTML=Ce),ve},appendChild:function(Q){t&&(t.appendChild(Q),Q.isTTML!==void 0&&(t.textTracks[t.textTracks.length-1].isTTML=Q.isTTML,t.textTracks[t.textTracks.length-1].isEmbedded=Q.isEmbedded))},destroy:function(){L(),t=null,n=null,m=null},getBufferRange:A,getClientHeight:C,getClientWidth:y,getElement:function(){return t},getEnded:function(){return t?t.ended:null},getPlaybackQuality:function(){if(!t)return null;let Q="webkitDroppedFrameCount"in t&&"webkitDecodedFrameCount"in t,W=null;return"getVideoPlaybackQuality"in t?W=t.getVideoPlaybackQuality():Q&&(W={droppedVideoFrames:t.webkitDroppedFrameCount,totalVideoFrames:t.webkitDroppedFrameCount+t.webkitDecodedFrameCount,creationTime:new Date}),W},getPlaybackRate:function(){return t?t.playbackRate:null},getPlayedRanges:function(){return t?t.played:null},getReadyState:v,getSource:function(){return t?t.src:null},getTTMLRenderingDiv:function(){return n},getTextTrack:ee,getTextTracks:function(){return t?t.textTracks:[]},getTime:function(){return t?isNaN(e)?t.currentTime:e:null},getVideoElementSize:function(){const Q=b.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;return{elementWidth:y()*Q,elementHeight:C()*Q}},getVideoHeight:function(){return t?t.videoHeight:NaN},getVideoRelativeOffsetLeft:function(){if(t){const Q=t.parentNode.host||t.parentNode;return Q?t.getBoundingClientRect().left-Q.getBoundingClientRect().left:NaN}return NaN},getVideoRelativeOffsetTop:function(){if(t){const Q=t.parentNode.host||t.parentNode;return Q?t.getBoundingClientRect().top-Q.getBoundingClientRect().top:NaN}return NaN},getVideoWidth:function(){return t?t.videoWidth:NaN},getVttRenderingDiv:function(){return m},initialize:function(){N.on(h.default.PLAYBACK_PLAYING,q,this)},isPaused:function(){return t?t.paused:null},isSeeking:function(){return t?t.seeking||!isNaN(e):null},isStalled:U,pause:function(){t&&(t.pause(),t.autoplay=!1)},play:function(){if(t){t.autoplay=!0;const Q=t.play();Q&&Q.catch&&typeof Promise<"u"&&Q.catch((W=>{W.name==="NotAllowedError"&&N.trigger(h.default.PLAYBACK_NOT_ALLOWED),c.warn(`Caught pending play exception - continuing (${W})`)}))}},removeChild:function(Q){t&&t.removeChild(Q)},removeEventListener:J,reset:L,setConfig:function(Q){Q&&Q.settings&&(b=Q.settings)},setCurrentTime:function(Q,W){t&&(d&&d.func&&d.event&&J(d.event,d.func),e=Q,d=k(r.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,(()=>{if(t)if(t.currentTime!==e)try{e=W?(function(re){const Ce=A();let Me=re,ve=9999999999;if(Ce)for(let ue=0;ue<Ce.length;ue++){const oe=Ce.start(ue),ne=Ce.end(ue),pe=Math.abs(oe-re),Ee=Math.abs(ne-re);if(re>=oe&&re<=ne)return re;pe<ve&&(ve=pe,Me=oe),Ee<ve&&(ve=Ee,Me=ne)}return Me})(e):e,isNaN(e)||(t.currentTime=e),e=NaN}catch(re){t.readyState===0&&re.code===re.INVALID_STATE_ERR&&(M=setTimeout((function(){t.currentTime=e,e=NaN}),400))}else e=NaN})))},setDisableRemotePlayback:function(Q){t&&(t.disableRemotePlayback=Q)},setElement:function(Q){if((!t||t!==Q)&&((function(W){try{if(!D||!W)return;D.unobserve(W)}catch{}})(t),t=Q,Q!=null)){if(!Q||!/^(VIDEO|AUDIO)$/i.test(Q.nodeName))throw"element is not video or audio DOM type!";(function(W){try{if(!D||!W)return;D.observe(W)}catch{}})(t)}},setPlaybackRate:x,setSource:function(Q){t&&(Q?t.src=Q:(t.removeAttribute("src"),t.load()))},setStallState:function(Q,W){(function(re,Ce){Ce?(function(Me){if(Me!==null&&t&&!t.seeking&&O.indexOf(Me)===-1&&(O.push(Me),b.get().streaming.buffer.syntheticStallEvents.enabled&&t&&O.length===1&&(b.get().streaming.buffer.syntheticStallEvents.ignoreReadyState||v()>=r.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA))){T=t.playbackRate,x(0,!0);const ve=document.createEvent("Event");ve.initEvent("waiting",!0,!1),t.dispatchEvent(ve)}})(re):K(re)})(Q,W)},setTTMLRenderingDiv:function(Q){n=Q,n.style.position="absolute",n.style.display="flex",n.style.overflow="hidden",n.style.pointerEvents="none",n.style.top=0,n.style.left=0},setVttRenderingDiv:function(Q){m=Q},waitForReadyState:k},c=(0,p.default)(u).getInstance().getLogger(l),b=(0,E.default)(u).getInstance(),e=NaN,(function(){try{D=new ResizeObserver((()=>{N.trigger(h.default.VIDEO_ELEMENT_RESIZED)}))}catch{}})(),l}Rs.__dashjs_factory_name="VideoModel";var kl=F.default.getSingletonFactory(Rs),Gl=P(8986);function ki(){const n="You must first call initialize() and set a source before calling this method",e="You must first call initialize() and set a valid source and view before calling this method",t="You must first call attachView() to set the video element before calling this method",l="You must first call attachSource() with a valid source before calling this method",c="MediaPlayer not initialized!",T=this.context,D=(0,g.default)(T).getInstance();let R=(0,E.default)(T).getInstance();const d=(0,p.default)(T).getInstance({settings:R});let b,M,m,u,N,O,L,x,U,K,q,z,J,v,A,y,C,ee,k,Q,W,re,Ce,Me,ve,ue,oe,ne,pe,Ee,te,se,Ae,ge,we,Ve,$e,Je,gt,Et,Jt,fn;function bn(){xe(null),lt(null),u=null,A&&(A.reset(),A=null),y&&(y.reset(),y=null),W&&W.reset(),R.reset(),ee&&(ee.reset(),ee=null),fn&&(fn.resetLoader(),fn=null)}function kn(){return!!m&&!!$e.getElement()}function Kn(){return(0,Gl.getVersionString)()}function Un(){if(!L)throw e;return pe.isPaused()}function Bn(){if(!L)throw e;return pe.getIsDynamic()}function xn(Te){const nt=ue&&ue.hasVideoTrack()?r.default.VIDEO:r.default.AUDIO;let Kt=Ae.getCurrentDVRInfo(nt);return Kt?rt(Kt.range.start+Te,Kt):0}function rt(Te,nt){let Kt=pe.getOriginalLiveDelay();return Te>nt.range.end-Kt&&(Te=nt.range.end-Kt),Te}function Mt(Te=""){if(!L)throw e;let nt=Nn().currentTime;return Te!==""&&(nt=ue.getTimeRelativeToStreamId(nt,Te)),nt}function St(Te){(0,yn.checkParameterType)(Te,"boolean"),x=Te}function Gt(){W.restoreDefaultUTCTimingSources()}function cn(){return Ae}function Nn(){if(!$e.getElement())throw t;return $e.getElement()}function lt(Te){if(!N)throw c;$e.setElement(Te),Te&&(Xt(),(function(){if(y||typeof dashjs>"u")return;let nt=dashjs.MetricsReporting;typeof nt=="function"&&(y=nt(T).create().createMetricsReporting({debug:d,eventBus:D,mediaElement:Nn(),adapter:k,dashMetrics:Ae,mediaPlayerModel:Q,events:h.default,constants:r.default,metricsConstants:o}))})(),(function(){if(C||typeof dashjs>"u")return;let nt=dashjs.MssHandler;typeof nt=="function"&&(Pn.default.extend(nt.errors),C=nt(T).create({eventBus:D,mediaPlayerModel:Q,dashMetrics:Ae,manifestModel:ge,playbackController:pe,streamController:ue,protectionController:A,baseURLController:Ce,errHandler:re,events:h.default,constants:r.default,debug:d,initSegmentType:Ge.HTTPRequest.INIT_SEGMENT_TYPE,BASE64:Zt,ISOBoxer:qn,settings:R}))})(),ue&&ue.switchToVideoElement(U)),L&&(bt(),Xe()),wn(U)}function Lt(Te,nt,Kt=!0){if(!O)throw n;let Qe=nt?ue.getStreamById(nt):Ze();return Qe?Qe.getRepresentationsByType(Te,Kt):[]}function jt(Te){if(!O)throw n;let nt=ue.getActiveStreamInfo();return nt?v.getTracksFor(Te,nt.id).filter((Kt=>!A||A.areKeyIdsUsable(Kt.normalizedKeyIds))):[]}function xe(Te,nt=NaN){if(!N)throw c;typeof Te=="string"&&Je.initialize(Te),nt==null&&(nt=NaN),isNaN(nt)||(nt=Math.max(0,nt)),U=nt,m=Te,(O||L)&&(bt(),Xe()),kn()&&wn(U)}function Ze(){if(!O)throw n;let Te=ue.getActiveStreamInfo();return Te?ue.getStreamById(Te.id):null}function bt(){L=!1,O=!1,k.reset(),ue.reset(),ne.reset(),se.reset(),pe.reset(),Ee.reset(),te.reset(),K.reset(),q.reset(),v.reset(),Et.reset(),A&&(R.get().streaming.protection.keepProtectionMediaKeys?A.stop():(A.reset(),A=null,Xt())),oe.reset(),we.reset(),Ve.reset()}function Xe(){W.resetPlaybackSessionSpecificSettings()}function qt(){return go(T).create({debug:d,errHandler:re,dashMetrics:Ae,mediaPlayerModel:Q,mssHandler:C,settings:R})}function Xt(){if(A)return A;if(typeof dashjs>"u")return null;let Te=dashjs.Protection;if(typeof Te=="function"){let nt=Te(T).create();return h.default.extend(Te.events),H.default.extend(Te.events,{publicOnly:!0}),Pn.default.extend(Te.errors),A=nt.createProtectionSystem({debug:d,errHandler:re,videoModel:$e,customParametersModel:W,capabilities:Me,eventBus:D,events:h.default,BASE64:Zt,constants:r.default,cmcdController:we,settings:R}),Me||(Me=(0,dr.default)(T).getInstance()),Me.setProtectionController(A),A}return null}function sn(){if(!N)throw c;if(ee)return ee;if(typeof dashjs>"u")return null;let Te=dashjs.OfflineController;if(typeof Te=="function"){h.default.extend(Te.events),H.default.extend(Te.events,{publicOnly:!0}),Pn.default.extend(Te.errors);const nt=qt(),Kt=sa(T).create();return Kt.setConfig({manifestModel:ge,adapter:k,manifestLoader:nt,errHandler:re,contentSteeringController:te}),ee=Te(T).create({debug:d,manifestUpdater:Kt,baseURLController:Ce,manifestLoader:nt,manifestModel:ge,mediaPlayerModel:Q,abrController:K,playbackController:pe,adapter:k,errHandler:re,dashMetrics:Ae,timelineConverter:J,segmentBaseController:Et,schemeLoaderFactory:z,eventBus:D,events:h.default,errors:Pn.default,constants:r.default,settings:R,dashConstants:fe.default,urlUtils:(0,Ht.default)(T).getInstance()}),ee}return null}function wn(Te=NaN){ee&&ee.resetRecords(),!O&&m&&(O=!0,M.info("Streaming Initialized"),(function(){const nt=qt();ue||(ue=as(T).getInstance()),oe||(oe=Pl(T).create({adapter:k,baseURLController:Ce,errHandler:re,manifestModel:ge,mediaController:v,settings:R,videoModel:$e})),ve.setConfig({adapter:k,capabilities:Me,customParametersModel:W,errHandler:re,manifestModel:ge,protectionController:A,settings:R}),ue.setConfig({abrController:K,adapter:k,baseURLController:Ce,capabilities:Me,capabilitiesFilter:ve,contentSteeringController:te,customParametersModel:W,dashMetrics:Ae,errHandler:re,manifestLoader:nt,manifestModel:ge,mediaController:v,mediaPlayerModel:Q,playbackController:pe,protectionController:A,segmentBaseController:Et,serviceDescriptionController:Ee,settings:R,textController:oe,throughputController:q,timelineConverter:J,uriFragmentModel:Je,videoModel:$e}),ne.setConfig({adapter:k,playbackController:pe,settings:R,streamController:ue,timelineConverter:J,videoModel:$e}),pe.setConfig({adapter:k,dashMetrics:Ae,serviceDescriptionController:Ee,settings:R,streamController:ue,timelineConverter:J,videoModel:$e}),se.setConfig({mediaPlayerModel:Q,playbackController:pe,settings:R,streamController:ue,videoModel:$e}),q.setConfig({settings:R,playbackController:pe}),K.setConfig({adapter:k,capabilities:Me,cmsdModel:Ve,customParametersModel:W,dashMetrics:Ae,domStorage:gt,mediaPlayerModel:Q,settings:R,streamController:ue,throughputController:q,videoModel:$e}),we.setConfig({abrController:K,dashMetrics:Ae,errHandler:re,mediaPlayerModel:Q,playbackController:pe,serviceDescriptionController:Ee,throughputController:q}),Jt.setConfig({serviceDescriptionController:Ee}),Ve.setConfig({}),v.initialize(),q.initialize(),K.initialize(),ue.initialize(x,u),oe.initialize(),ne.initialize(),se.initialize(),we.initialize(x),Ve.initialize(),te.initialize(),Et.initialize()})(),typeof m=="string"?ue.load(m,Te):ue.loadWithManifest(m,Te)),!L&&kn()&&(L=!0,D.trigger(H.default.PLAYBACK_INITIALIZED),M.info("Playback Initialized"))}return b={addABRCustomRule:function(Te,nt,Kt){W.addAbrCustomRule(Te,nt,Kt)},addExternalSubtitle:function(Te){Te instanceof Ks.default||M.error("Invalid external subtitle object. Must be an instance of dashjs.ExternalSubtitle"),W.addExternalSubtitle(Te)},addRequestInterceptor:function(Te){W.addRequestInterceptor(Te)},addResponseInterceptor:function(Te){W.addResponseInterceptor(Te)},addUTCTimingSource:function(Te,nt){W.addUTCTimingSource(Te,nt)},attachProtectionController:function(Te){A=Te},attachSource:xe,attachTTMLRenderingDiv:function(Te){if(!$e.getElement())throw t;$e.setTTMLRenderingDiv(Te)},attachView:lt,attachVttRenderingDiv:function(Te){if(!$e.getElement())throw t;$e.setVttRenderingDiv(Te)},clearDefaultUTCTimingSources:function(){W.clearDefaultUTCTimingSources()},convertToTimeCode:function(Te){Te=Math.max(Te,0);let nt=Math.floor(Te/3600),Kt=Math.floor(Te%3600/60),Qe=Math.floor(Te%3600%60);return(nt===0?"":nt<10?"0"+nt.toString()+":":nt.toString()+":")+(Kt<10?"0"+Kt.toString():Kt.toString())+":"+(Qe<10?"0"+Qe.toString():Qe.toString())},destroy:function(){bn(),$e&&($e.destroy(),$e=null),k&&k.destroy(),F.default.deleteSingletonInstances(T)},duration:function(){if(!L)throw e;let Te=Nn().duration;if(pe.getIsDynamic()){const nt=ue&&ue.hasVideoTrack()?r.default.VIDEO:r.default.AUDIO;let Kt=Ae.getCurrentDVRInfo(nt);Te=Kt?Kt.range.end-Kt.range.start:0}return Te},enableForcedTextStreaming:function(Te){return!(!ue.getActiveStreamInfo()||!oe)&&oe.enableForcedTextStreaming(Te)},enableText:function(Te){const nt=ue.getActiveStreamInfo();return!(!nt||!oe)&&oe.enableText(nt.id,Te)},extend:function(Te,nt,Kt){F.default.extend(Te,nt,Kt,T)},formatUTC:function(Te,nt,Kt,Qe=!1){const Yt=new Date(1e3*Te),pn=Yt.toLocaleDateString(nt),Mn=Yt.toLocaleTimeString(nt,{hour12:Kt});return Qe?Mn+" "+pn:Mn},getABRCustomRules:function(){return W.getAbrCustomRules()},getActiveStream:Ze,getAutoPlay:function(){return x},getAvailableBaseUrls:function(){const Te=ge.getValue();return Te?Ce.getBaseUrls(Te):[]},getAvailableLocations:function(){const Te=ge.getValue();if(!Te)return[];const nt=k.getLocation(Te),Kt=te.getSynthesizedLocationElements(nt);return nt.concat(Kt)},getAverageLatency:function(Te=r.default.VIDEO,nt=null,Kt=NaN){return q?q.getAverageLatency(Te,nt,Kt):0},getAverageThroughput:function(Te=r.default.VIDEO,nt=null,Kt=NaN){return q?q.getAverageThroughput(Te,nt,Kt):0},getBufferLength:function(Te){const nt=[r.default.VIDEO,r.default.AUDIO,r.default.TEXT];if(Te)return nt.indexOf(Te)!==-1?cn().getCurrentBufferLevel(Te)||NaN:(M.warn("getBufferLength requested for invalid type"),NaN);{const Kt=nt.map((Qe=>jt(Qe).length>0?cn().getCurrentBufferLevel(Qe):Number.MAX_VALUE)).reduce(((Qe,Yt)=>Math.min(Qe,Yt)));return Kt===Number.MAX_VALUE?NaN:Kt}},getCurrentLiveLatency:function(){if(!N)throw c;return L?pe.getCurrentLiveLatency():NaN},getCurrentRepresentationForType:function(Te){if(!O)throw n;if(Te!==r.default.IMAGE&&Te!==r.default.VIDEO&&Te!==r.default.AUDIO)return null;const nt=Ze();if(!nt)return null;if(Te===r.default.IMAGE){const Kt=nt.getThumbnailController();return Kt?Kt.getCurrentTrack():-1}return nt.getCurrentRepresentationForType(Te)},getCurrentSteeringResponseData:function(){if(te)return te.getCurrentSteeringResponseData()},getCurrentTextTrackIndex:function(){let Te=NaN;const nt=ue.getActiveStreamInfo();if(nt&&oe)return Te=oe.getCurrentTrackIdx(nt.id),Te},getCurrentTrackFor:function(Te){if(!O)throw n;let nt=ue.getActiveStreamInfo();return nt?v.getCurrentTrackFor(Te,nt.id):null},getDashAdapter:function(){return k},getDashMetrics:cn,getDebug:function(){return d},getDvrSeekOffset:xn,getDvrWindow:function(){if(!L)throw e;const Te=ue&&ue.hasVideoTrack()?r.default.VIDEO:r.default.AUDIO;let nt=Ae.getCurrentDVRInfo(Te);if(!nt)return{};let Kt=0;const Qe=pe.getIsDynamic();return Qe&&(Kt=nt.manifestInfo.availableFrom.getTime()/1e3),{start:nt.range.start,end:nt.range.end,startAsUtc:Qe?Kt+nt.range.start:NaN,endAsUtc:Qe?Kt+nt.range.end:NaN,size:nt.range.end-nt.range.start}},getExternalSubtitles:function(){W.getExternalSubtitles()},getInitCache:function(){return ct(T).getInstance()},getInitialMediaSettingsFor:function(Te){if(!N)throw c;return v.getInitialSettings(Te)},getLowLatencyModeEnabled:function(){if(!L)throw e;return pe.getLowLatencyModeEnabled()},getManifest:function(){return ge.getValue()},getOfflineController:function(){return sn()},getPlaybackRate:function(){return Nn().playbackRate},getProtectionController:function(){return Xt()},getProtectionData:function(){return ue?ue.getProtectionData():null},getRawThroughputData:function(Te=r.default.VIDEO){return q?q.getRawThroughputData(Te):[]},getRepresentationsByType:function(Te,nt=null){return Lt(Te,nt,!0)},getRepresentationsByTypeUnfiltered:function(Te,nt=null){return Lt(Te,nt,!1)},getSafeAverageThroughput:function(Te=r.default.VIDEO,nt=null,Kt=NaN){return q?q.getSafeAverageThroughput(Te,nt,Kt):0},getSettings:function(){return R.get()},getSource:function(){if(!m)throw l;return m},getStreamsFromManifest:function(Te){if(!O)throw n;return k.getStreamsInfo(Te)},getTTMLRenderingDiv:function(){return $e?$e.getTTMLRenderingDiv():null},getTargetLiveDelay:function(){if(!L)throw e;return pe.getOriginalLiveDelay()},getTracksFor:jt,getTracksForTypeFromManifest:function(Te,nt,Kt){if(!O)throw n;return(Kt=Kt||k.getStreamsInfo(nt,1)[0])?k.getAllMediaInfoForType(Kt,Te,nt):[]},getVersion:Kn,getVideoElement:Nn,getVolume:function(){return Nn().volume},getXHRWithCredentialsForType:function(Te){return W.getXHRWithCredentialsForType(Te)},initialize:function(Te,nt,Kt,Qe=NaN){Me||(Me=(0,dr.default)(T).getInstance(),Me.setConfig({settings:R,protectionController:A})),re||(re=qs(T).getInstance()),Me.supportsMediaSource()?(N||(N=!0,J=Fl(T).getInstance(),q||(q=Ll(T).getInstance()),K||(K=at(T).getInstance()),z||(z=(0,yo.default)(T).getInstance()),pe||(pe=_o(T).getInstance()),v||(v=Eo(T).getInstance()),ue||(ue=as(T).getInstance()),ne||(ne=js(T).getInstance()),se||(se=Xr(T).getInstance()),Ee||(Ee=No(T).getInstance()),te||(te=ft(T).getInstance()),ve||(ve=qr(T).getInstance()),k=ti(T).getInstance(),ge=ho(T).getInstance(),we=(0,Qr.default)(T).getInstance(),Ve=(0,Zr.default)(T).getInstance(),Jt=Kr(T).getInstance(),Ae=Vs(T).getInstance({settings:R}),gt=yt(T).getInstance({settings:R}),k.setConfig({constants:r.default,cea608parser:new cs,errHandler:re,BASE64:Zt}),Ce||(Ce=Cn(T).create()),Ce.setConfig({adapter:k,contentSteeringController:te}),Ee.setConfig({adapter:k}),Et||(Et=Ro(T).getInstance({dashMetrics:Ae,mediaPlayerModel:Q,errHandler:re,baseURLController:Ce,events:h.default,eventBus:D,debug:d,boxParser:ar(T).getInstance(),errors:Pn.default})),v.setConfig({domStorage:gt,settings:R,mediaPlayerModel:Q,customParametersModel:W,videoModel:$e}),Q.setConfig({playbackController:pe,serviceDescriptionController:Ee}),te.setConfig({adapter:k,errHandler:re,dashMetrics:Ae,mediaPlayerModel:Q,manifestModel:ge,serviceDescriptionController:Ee,throughputController:q,eventBus:D}),Gt(),St(Kt===void 0||Kt),sn()),Te&&lt(Te),nt&&xe(nt,Qe),M.info("[dash.js "+Kn()+"] MediaPlayer has been initialized")):re.error(new un.default(Pn.default.CAPABILITY_MEDIASOURCE_ERROR_CODE,Pn.default.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},isDynamic:Bn,isMuted:function(){return Nn().muted},isPaused:Un,isReady:kn,isSeeking:function(){if(!L)throw e;return pe.isSeeking()},isTextEnabled:function(){const Te=ue.getActiveStreamInfo();return!(!Te||!oe)&&oe.isTextEnabled(Te)},off:function(Te,nt,Kt){D.off(Te,nt,Kt)},on:function(Te,nt,Kt,Qe){D.on(Te,nt,Kt,Qe)},pause:function(){if(!L)throw e;pe.pause()},play:function(){if(!L)throw e;(!x||Un()&&L)&&pe.play(!0)},preload:function(){if(!$e.getElement()&&!O){if(!m)throw l;wn(U)}},provideThumbnail:function(Te,nt){if(typeof nt!="function")return;if(Te<0)return void nt(null);const Kt=pe.getIsDynamic()?xn(Te):Te,Qe=ue.getStreamForTime(Kt);if(Qe===null)return void nt(null);const Yt=Qe.getThumbnailController();if(Yt)return Yt.provide(Kt,nt);nt(null)},refreshManifest:function(Te){if(!N)throw c;if(!kn())return Te(null,l);let nt=this;if(typeof Te=="function"){const Kt=function(Qe){D.off(h.default.INTERNAL_MANIFEST_LOADED,Kt,nt),Qe.error?Te(null,Qe.error):Te(Qe.manifest)};D.on(h.default.INTERNAL_MANIFEST_LOADED,Kt,nt)}ue.refreshManifest()},registerCertificateRequestFilter:function(Te){W.registerCertificateRequestFilter(Te)},registerCertificateResponseFilter:function(Te){W.registerCertificateResponseFilter(Te)},registerCustomCapabilitiesFilter:function(Te){W.registerCustomCapabilitiesFilter(Te)},registerLicenseRequestFilter:function(Te){W.registerLicenseRequestFilter(Te)},registerLicenseResponseFilter:function(Te){W.registerLicenseResponseFilter(Te)},removeABRCustomRule:function(Te){W.removeAbrCustomRule(Te)},removeAllABRCustomRule:function(){W.removeAllAbrCustomRule()},removeExternalSubtitleById:function(Te){W.removeExternalSubtitleById(Te)},removeExternalSubtitleByUrl:function(Te){W.removeExternalSubtitleByUrl(Te)},removeRequestInterceptor:function(Te){W.removeRequestInterceptor(Te)},removeResponseInterceptor:function(Te){W.removeResponseInterceptor(Te)},removeUTCTimingSource:function(Te,nt){W.removeUTCTimingSource(Te,nt)},reset:bn,resetCustomInitialTrackSelectionFunction:function(){W.resetCustomInitialTrackSelectionFunction(null)},resetSettings:function(){R.reset()},restoreDefaultUTCTimingSources:Gt,retrieveManifest:function(Te,nt){fn&&fn.resetLoader();const Kt=qt(),Qe=()=>{D.off(h.default.INTERNAL_MANIFEST_LOADED,Yt,this),Kt.reset(),fn=null};fn={manifestLoader:Kt,resetLoader:Qe};const Yt=pn=>{typeof nt=="function"&&(pn.error?nt(null,pn.error):nt(pn.manifest)),Qe()};D.on(h.default.INTERNAL_MANIFEST_LOADED,Yt,this),Je.initialize(Te),Kt.load(Te)},seek:function(Te){if(!L)throw e;if((0,yn.checkParameterType)(Te,"number"),isNaN(Te))throw r.default.BAD_ARGUMENT_ERROR;Te<0&&(Te=0);let nt=pe.getIsDynamic()?xn(Te):Te;const Kt=Nn();!pe.getIsDynamic()&&Kt.duration&&(nt=Math.min(Kt.duration,nt)),pe.seek(nt,!1,!1,!0)},seekToOriginalLive:function(){L&&Bn()&&pe.seekToOriginalLive()},seekToPresentationTime:function(Te){if(!L)throw e;if((0,yn.checkParameterType)(Te,"number"),isNaN(Te))throw r.default.BAD_ARGUMENT_ERROR;Te<0&&(Te=0);const nt=Nn();if(!pe.getIsDynamic()&&nt.duration&&(Te=Math.min(nt.duration,Te)),pe.getIsDynamic()){const Kt=ue&&ue.hasVideoTrack()?r.default.VIDEO:r.default.AUDIO;let Qe=Ae.getCurrentDVRInfo(Kt);if(!Qe)return;(Te=rt(Te,Qe))<Qe.range.start&&(Te=Qe.range.start)}pe.seek(Te,!1,!1,!0)},setAutoPlay:St,setConfig:function(Te){Te&&(Te.capabilities&&(Me=Te.capabilities),Te.capabilitiesFilter&&(ve=Te.capabilitiesFilter),Te.streamController&&(ue=Te.streamController),Te.textController&&(oe=Te.textController),Te.gapController&&(ne=Te.gapController),Te.throughputController&&(q=Te.throughputController),Te.playbackController&&(pe=Te.playbackController),Te.serviceDescriptionController&&(Ee=Te.serviceDescriptionController),Te.contentSteeringController&&(te=Te.contentSteeringController),Te.clientDataReportingController&&(Jt=Te.clientDataReportingController),Te.catchupController&&(se=Te.catchupController),Te.mediaPlayerModel&&(Q=Te.mediaPlayerModel),Te.customParametersModel&&(W=Te.customParametersModel),Te.abrController&&(K=Te.abrController),Te.schemeLoaderFactory&&(z=Te.schemeLoaderFactory),Te.mediaController&&(v=Te.mediaController),Te.settings&&(R=Te.settings),Te.dashMetrics&&(Ae=Te.dashMetrics))},setCurrentTrack:function(Te,nt=!1){if(!O)throw n;!A||A.areKeyIdsUsable(Te.normalizedKeyIds)?v.setTrack(Te,{noSettingsSave:nt}):M.error(`Can not switch to track with index ${Te.index} because key is not usable`)},setCustomInitialTrackSelectionFunction:function(Te){W.setCustomInitialTrackSelectionFunction(Te)},setInitialMediaSettingsFor:function(Te,nt){if(!N)throw c;let Kt=(function(Qe){const Yt=R.get().streaming.defaultSchemeIdUri;let pn={};function Mn(Ln,Dn,jn){let zn={};if(Dn){if(Dn instanceof Array)throw"Array type not supported for settings!";return Dn instanceof Object?(zn.schemeIdUri=Dn.schemeIdUri?Dn.schemeIdUri:"",zn.value=Dn.value?Dn.value:""):(zn.schemeIdUri=jn,zn.value=Dn,M.warn("No schemeIdUri provided for "+Ln+', using default "'+jn+'"')),zn}return null}return Qe.id!==void 0&&(pn.id=Qe.id),Qe.lang!==void 0&&(pn.lang=Qe.lang),isNaN(Qe.index)||(pn.index=Qe.index),Qe.viewpoint!==void 0&&(pn.viewpoint=Mn("viewpoint",Qe.viewpoint,Yt.viewpoint)),Qe.audioChannelConfiguration!==void 0&&(pn.audioChannelConfiguration=Mn("audioChannelConfiguration",Qe.audioChannelConfiguration,Yt.audioChannelConfiguration)),Qe.role!==void 0&&Qe.role!==null&&(pn.role=Mn("role",Qe.role,Yt.role),pn.role.schemeIdUri===r.default.DASH_ROLE_SCHEME_ID&&pn.role.value==="Main"&&(pn.role.value=fe.default.MAIN)),Qe.accessibility!==void 0&&(pn.accessibility=Mn("accessibility",Qe.accessibility,Yt.accessibility)),Qe.codec!==void 0&&(pn.codec=Qe.codec),pn})(nt);v.setInitialSettings(Te,Kt)},setMute:function(Te){(0,yn.checkParameterType)(Te,"boolean"),Nn().muted=Te},setPlaybackRate:function(Te){Nn().playbackRate=Te},setProtectionData:function(Te){u=Te,ue&&ue.setProtectionData(u)},setRepresentationForTypeById:function(Te,nt,Kt=!1){if(Te!==r.default.IMAGE&&Te!==r.default.VIDEO&&Te!==r.default.AUDIO)return;if(!O)throw n;const Qe=Ze();if(Qe)if(Te===r.default.IMAGE){const Yt=Qe.getThumbnailController();Yt&&Yt.setTrackById(nt)}else{const Yt=Qe.getRepresentationForTypeById(Te,nt);Yt&&K.manuallySetPlaybackQuality(Te,ue.getActiveStreamInfo(),Yt,{forceReplace:Kt})}},setRepresentationForTypeByIndex:function(Te,nt,Kt=!1){if(Te!==r.default.IMAGE&&Te!==r.default.VIDEO&&Te!==r.default.AUDIO)return;if(!O)throw n;const Qe=Ze();if(Qe)if(Te===r.default.IMAGE){const Yt=Qe.getThumbnailController();Yt&&Yt.setTrackByIndex(nt)}else{const Yt=Qe.getRepresentationForTypeByIndex(Te,nt);Yt&&K.manuallySetPlaybackQuality(Te,ue.getActiveStreamInfo(),Yt,{forceReplace:Kt})}},setTextTrack:function(Te){if(!L)throw e;const nt=ue.getActiveStreamInfo();nt&&oe&&oe.setTextTrack(nt.id,Te)},setVolume:function(Te){if(typeof Te!="number"||isNaN(Te)||Te<0||Te>1)throw r.default.BAD_ARGUMENT_ERROR;Nn().volume=Te},setXHRWithCredentialsForType:function(Te,nt){W.setXHRWithCredentialsForType(Te,nt)},time:Mt,timeAsUTC:function(){if(!L)throw e;if(!pe.getIsDynamic()||Mt()<0)return NaN;const Te=ue&&ue.hasVideoTrack()?r.default.VIDEO:r.default.AUDIO;let nt,Kt,Qe=Ae.getCurrentDVRInfo(Te);return Qe?(nt=Qe.manifestInfo.availableFrom.getTime()/1e3,Kt=nt+Mt(),Kt):0},timeInDvrWindow:function(){if(!L)throw e;if(!pe.getIsDynamic())return Mt();let Te=Nn().currentTime;const nt=ue&&ue.hasVideoTrack()?r.default.VIDEO:r.default.AUDIO;let Kt=Ae.getCurrentDVRInfo(nt);return Te=Kt===null||Te===0?0:Math.max(0,Te-Kt.range.start),Te},trigger:function(Te,nt,Kt){D.trigger(Te,nt,Kt)},triggerSteeringRequest:function(){if(te)return te.loadSteeringData()},unregisterCertificateRequestFilter:function(Te){W.unregisterCertificateRequestFilter(Te)},unregisterCertificateResponseFilter:function(Te){W.unregisterCertificateResponseFilter(Te)},unregisterCustomCapabilitiesFilter:function(Te){W.unregisterCustomCapabilitiesFilter(Te)},unregisterLicenseRequestFilter:function(Te){W.unregisterLicenseRequestFilter(Te)},unregisterLicenseResponseFilter:function(Te){W.unregisterLicenseResponseFilter(Te)},updateSettings:function(Te){R.update(Te)},updateSource:function(Te){m=Te,ue.load(m)}},M=d.getLogger(b),N=!1,L=!1,O=!1,x=!0,U=NaN,A=null,ee=null,u=null,k=null,Et=null,h.default.extend(H.default),Q=To(T).getInstance(),W=(0,Cr.default)(T).getInstance(),$e=kl(T).getInstance(),Je=xl(T).getInstance(),b}ki.__dashjs_factory_name="MediaPlayer";const mi=F.default.getClassFactory(ki);mi.events=H.default,mi.errors=Pn.default,F.default.updateClassFactory(ki.__dashjs_factory_name,mi);var Hl=mi},1191:function(wt,me,P){P.r(me);var F=P(7252);class f extends F.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 o=new f;me.default=o},6882:function(wt,me,P){P.r(me);var F=P(138),f=P(3346),o=P(8261),p=P(5212);function E(){let _,w,g,h;const r=this.context;function H(){const ce=(function(){if(typeof h!="function")return null;try{return h()}catch{return null}})();return ce&&Object.keys(ce).length>0?ce:g}function G(){const ce=H();if(ce&&ce.version)return parseInt(ce.version,10);const Le=w.get().streaming.cmcd;return Le&&Le.version?parseInt(Le.version,10):p.default.CMCD_DEFAULT_VERSION}function le(ce,Le,Be={}){if(!ce||!Le)return;let ot=Le;for(const[Z,Se]of Object.entries(Be))ot=ot.replace(`{${Z}}`,Se);const Ge=ot.split(".");let X=ce;for(let Z=0;Z<Ge.length;Z++){const Se=Ge[Z];if(X==null)return;const Ne=Se.match(/^([^\[]+)\[(\d+)\]$/);if(Ne){const[,ke,ht]=Ne;if(X=X[ke],!Array.isArray(X))return;X=X[parseInt(ht,10)]}else X=X[Se]}return X}function de(ce,Le={}){const Be=f.default[ce];if(!Be)return Le.defaultValue!==void 0?Le.defaultValue:void 0;const ot=G(),Ge={settings:w.get(),manifestParams:H()||{}};if(Be.version&&!Be.version.includes(ot))return Le.defaultValue!==void 0?Le.defaultValue:void 0;const X={};Le.targetIndex!==void 0&&(X.targetIndex=Le.targetIndex);const Z=ce==="applyParametersFromMpd"||(Ge.settings?.streaming?.cmcd?.applyParametersFromMpd??!0),Se=[...Be.sources].sort(((Ne,ke)=>Ne.priority-ke.priority));for(const Ne of Se){if(!Z&&Ne.path.startsWith("manifestParams"))continue;const ke=le(Ge,Ne.path,X);if(ke!=null)return typeof Ne.transform=="function"?Ne.transform(ke):ke}for(const Ne of Se)if((Z||!Ne.path.startsWith("manifestParams"))&&Ne.default!==void 0)return Ne.default;return Le.defaultValue!==void 0?Le.defaultValue:void 0}function De(){if(G()!==2)return[];const ce=de("eventTargets");return Array.isArray(ce)?ce:[]}return _={get:de,getEventTarget:function(ce){const Le=De();return ce<0||ce>=Le.length?null:{get:Be=>de(Be,{targetIndex:ce}),has:Be=>de(Be,{targetIndex:ce})!=null,index:ce,raw:Le[ce]}},getEventTargets:De,getVersion:function(){return G()},has:function(ce){return de(ce)!=null},hasManifestParams:function(){const ce=H();return!(!ce||!ce.version)},isEnabled:function(){const ce=w.get().streaming.cmcd;if(ce?.applyParametersFromMpd??1){const Le=H();if(Le&&Le.version)return!0}return(!ce||ce.enabled!==!1)&&de("enabled")===!0},reset:function(){g=null,h=null},setManifestParams:function(ce){g=ce},setManifestParamsProviderFunction:function(ce){h=ce}},w=(0,o.default)(r).getInstance(),g=null,h=null,_}E.__dashjs_factory_name="CmcdConfigAccessor",me.default=F.default.getSingletonFactory(E)},3346:function(wt,me,P){P.r(me);var F=P(5212);const f={version:{version:[1,2],sources:[{path:"manifestParams.version",priority:1,type:"number"},{path:"settings.streaming.cmcd.version",priority:2,type:"number",default:F.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:F.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:o=>typeof o=="string"?o.split(" "):o},{path:"settings.streaming.cmcd.enabledKeys",priority:2,type:"array",default:F.default.CMCD_KEYS}]},includeInRequests:{version:[1,2],sources:[{path:"manifestParams.includeInRequests",priority:1,type:"array",transform:o=>typeof o=="string"?o.split(" "):o},{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:F.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"]}]}};me.default=f},5212:function(wt,me,P){P.r(me);var F=P(8735);me.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:F.CMCD_PARAM,CMCD_MODE_QUERY:F.CmcdTransmissionMode.QUERY,CMCD_MODE_HEADERS:F.CmcdTransmissionMode.HEADERS,CMCD_MODE_BODY:"body",CMCD_AVAILABLE_REQUESTS:["segment","mpd","xlink","steering","other"],CMCD_DEFAULT_TIME_INTERVAL:F.CMCD_DEFAULT_TIME_INTERVAL,CMCD_REPORTING_MODE:F.CmcdReportingMode,CMCD_KEYS:F.CMCD_KEYS,CMCD_REPORTING_EVENTS:F.CmcdEventType,CMCD_PLAYER_STATES:F.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(wt,me,P){P.r(me),me.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(wt,me,P){P.r(me);var F=P(8850),f=P(913),o=P(138),p=P(1191),E=P(5212),_=P(7568),w=P(8735),g=P(649),h=P(1613),r=P(3773),H=P(8898),G=P(893),le=P(6882);function de(){let De,ce,Le,Be,ot,Ge,X,Z,Se,Ne,ke=this.context,ht=(0,F.default)(ke).getInstance(),ye=(0,g.default)(ke).getInstance();const pt={[p.default.PLAYBACK_INITIALIZED]:E.default.CMCD_PLAYER_STATES.STARTING,[p.default.PLAYBACK_PAUSED]:E.default.CMCD_PLAYER_STATES.PAUSED,[p.default.PLAYBACK_ERROR]:E.default.CMCD_PLAYER_STATES.FATAL_ERROR,[p.default.PLAYBACK_ENDED]:E.default.CMCD_PLAYER_STATES.ENDED};let He={};function Fe(_e){Le&&Le.update({sta:_e}),En(E.default.CMCD_REPORTING_EVENTS.PLAY_STATE)}function Ke(){const _e={version:De.getVersion(),transmissionMode:De.get("mode")===E.default.CMCD_MODE_HEADERS?w.CMCD_HEADERS:w.CMCD_QUERY,enabledKeys:De.get("keys"),eventTargets:De.getEventTargets().reduce(((S,I,$)=>{if(!Ie($))return S;const ie=De.getEventTarget($);return S.push({url:ie.get("targetUrl"),events:ie.get("targetEvents"),interval:ie.get("targetInterval")??E.default.CMCD_DEFAULT_TIME_INTERVAL,batchSize:ie.get("targetBatchSize")||1,enabledKeys:ie.get("targetKeys")}),S}),[])},Ue=De.get("sessionID");Ue&&(_e.sid=Ue);const i=De.get("contentID");return i&&(_e.cid=i),new w.CmcdReporter(_e,Pt)}function Pt(_e){return new Promise((Ue=>{const i=new h.default;i.url=_e.url,i.method=_e.method,i.headers=_e.headers,i.body=_e.body,i.type=_.HTTPRequest.CMCD_EVENT,Ne.load({request:i,success:()=>Ue({status:200}),error:S=>Ue({status:S?.status||500})})}))}function Nt(){ce.onPeriodSwitchComplete()}function kt(){ce.onPlaybackStarted()}function Ut(){ce.onPlaybackPlaying(),Fe(E.default.CMCD_PLAYER_STATES.PLAYING)}function ln(_e){if(_e.error?.data?.request?.type!==_.HTTPRequest.CMCD_EVENT){if(Le){const Ue=_e.error?.code||_e.error?.data?.code;Ue&&Le.update({ec:Ue})}En(E.default.CMCD_REPORTING_EVENTS.ERROR)}}function an(){Se&&Le&&(De.get("applyParametersFromMpd")??1)&&De.hasManifestParams()&&(Se=!1,Le.stop(!0),Le=Ke(),Le.start())}function En(_e){if(!Le)return;an();const Ue=ce.getEventModeData(),i=ce.calculateMsd();i.msd!==void 0&&Le.update(i),Le.recordEvent(_e,Ue)}function Oe(_e){if(Le&&Ie()){an();try{const Ue=ce.deriveCmcdDataForRequest(_e),i=ce.calculateMsd();i.msd!==void 0&&Le.update(i);const S=Le.createRequestReport(_e,Ue);_e.url=S.url,_e.headers=S.headers,_e.cmcd=S.customData?.cmcd||{},(function(I){const $=De.get("mode"),ie={url:I.url,mediaType:I.mediaType,requestType:I.type,cmcdData:I.cmcd,mode:$};if($===E.default.CMCD_MODE_HEADERS)ie.headers=I.headers;else try{const be=new URL(I.url);ie.cmcdString=be.searchParams.get(w.CMCD_PARAM)||""}catch{ie.cmcdString=""}ht.trigger(f.default.CMCD_DATA_GENERATED,ie)})(_e)}catch(Ue){return X.warn(Ue),null}}}function Ie(_e=null){return _e!==null?(function(Ue){if(De.getVersion()!==2)return X.warn("CMCD version 2 is required for target configuration"),!1;const i=De.getEventTarget(Ue),S=i.get("targetEnabled"),I=i.get("targetUrl");return I?S&&I:(X.warn("Target URL is not configured"),!1)})(_e)&&(function(Ue){let i=De.getEventTarget(Ue).get("targetIncludeInRequests");if(!i)return!0;const S=E.default.CMCD_AVAILABLE_REQUESTS,I=i.filter(($=>!S.includes($)));return I.length===i.length?(X.error("None of the request types are supported."),!1):(I.forEach(($=>{X.warn(`request type ${$} is not supported.`)})),!0)})(_e):(function(){const Ue=De.getVersion();return Ue!==1&&Ue!==2?(X.error(`version parameter must be 1 or 2, got ${Ue}.`),!1):De.isEnabled()})()&&(function(){if(De.getVersion()===2)return!0;const Ue=De.get("includeInRequests"),i=E.default.CMCD_AVAILABLE_REQUESTS,S=Ue.filter((I=>!i.includes(I)));return S.length===Ue.length?(X.error("None of the request types are supported."),!1):(S.forEach((I=>{X.warn(`request type ${I} is not supported.`)})),!0)})()}function mt(_e){const Ue=ce.onPlaybackRateChanged(_e);Le&&Ue&&Le.update(Ue)}function It(_e){if(ce.updateCmcdManifestParamsInCmcdConfigAccessor(),Se=!0,Le){const Ue=ce.onManifestLoaded(_e);Le.update(Ue)}}function Ye(_e){ce.onBufferLevelStateChanged(_e)}function V(){ce.onPlaybackSeeking(),Fe(E.default.CMCD_PLAYER_STATES.SEEKING)}function B(){ce.onPlaybackSeeked()}function Pe(){if(ce.wasPlaying()){const _e=ce.getLastMediaTypeRequest();ce.onRebufferingStarted(_e),Fe(E.default.CMCD_PLAYER_STATES.REBUFFERING)}else Fe(E.default.CMCD_PLAYER_STATES.WAITING)}function j(_e){const Ue=_e.customData.request.type;if(!Le||!Ie()||!ce.isIncludedInRequestFilter(Ue))return _e.cmcd=_e.customData.request.cmcd,_e;let i=_e.customData.request;return Oe(i),{..._e,url:i.url,headers:i.headers,cmcd:i.cmcd,customData:{..._e.customData,cmcd:i.cmcd}}}function qe(_e){return _e.request?.customData?.request?.type===_.HTTPRequest.CMCD_EVENT||(function(i){if(!Le)return;an();const S=ce.getEventModeData(),I=ce.calculateMsd();I.msd!==void 0&&Le.update(I);const $={};if(i.headers)try{const ie=i.headers["cmsd-static"];ie&&($.cmsds=btoa(ie));const be=i.headers["cmsd-dynamic"];be&&($.cmsdd=btoa(be))}catch(ie){X.warn("Failed to base64 encode CMSD headers, ignoring.",ie)}try{Le.recordResponseReceived(i,{...S,...$})}catch(ie){X.warn("Failed to record response received in CMCD reporter.",ie)}})(_e),_e}function it(){ht.off(p.default.PLAYBACK_RATE_CHANGED,mt,Ge),ht.off(p.default.MANIFEST_LOADED,It,Ge),ht.off(p.default.BUFFER_LEVEL_STATE_CHANGED,Ye,Ge),ht.off(p.default.PLAYBACK_SEEKED,B,Ge),ht.off(p.default.PERIOD_SWITCH_COMPLETED,Nt,Ge),ht.off(p.default.PLAYBACK_STARTED,kt,Ge),ht.off(p.default.MANIFEST_LOADING_STARTED,kt,Ge),ht.off(p.default.ERROR,ln,Ge),ht.off(p.default.PLAYBACK_PLAYING,Ut,Ge),ht.off(p.default.PLAYBACK_SEEKING,V,Ge),ht.off(p.default.PLAYBACK_WAITING,Pe,Ge),Object.keys(pt).forEach((_e=>{ht.off(_e,He[_e],Ge)})),Le&&(Le.stop(!0),Le=null),ce.resetInitialSettings()}return ce=(0,H.default)(ke).getInstance(),De=(0,le.default)(ke).getInstance(),Ge={applyCmcdToRequest:Oe,getCmcdRequestInterceptors:function(){return[j]},getCmcdResponseReceivedInterceptors:function(){return[qe]},getCmcdParametersFromManifest:function(){return ce.getCmcdParametersFromManifest()},initialize:function(_e){Se=!1,(function(Ue){ht.on(p.default.PLAYBACK_RATE_CHANGED,mt,Ge),ht.on(p.default.MANIFEST_LOADED,It,Ge),ht.on(p.default.BUFFER_LEVEL_STATE_CHANGED,Ye,Ge),ht.on(p.default.PLAYBACK_SEEKED,B,Ge),ht.on(p.default.PERIOD_SWITCH_COMPLETED,Nt,Ge),Ue?ht.on(p.default.MANIFEST_LOADING_STARTED,kt,Ge):ht.on(p.default.PLAYBACK_STARTED,kt,Ge),ht.on(p.default.ERROR,ln,Ge)})(_e),Ne||(Ne=(0,r.default)(ke).create({errHandler:ot,mediaPlayerModel:Z,errors:G.default,dashMetrics:Be})),Le=Ke(),Le.start(),ht.on(p.default.PLAYBACK_PLAYING,Ut,Ge),ht.on(p.default.PLAYBACK_SEEKING,V,Ge),ht.on(p.default.PLAYBACK_WAITING,Pe,Ge),Object.entries(pt).forEach((([Ue,i])=>{He[Ue]||(He[Ue]=()=>Fe(i)),ht.on(Ue,He[Ue],Ge)}))},isCmcdEnabled:Ie,reset:it,setConfig:function(_e){_e&&(_e.dashMetrics&&(Be=_e.dashMetrics),_e.mediaPlayerModel&&(Z=_e.mediaPlayerModel),_e.errHandler&&(ot=_e.errHandler),_e.urlLoader&&(Ne=_e.urlLoader),_e.serviceDescriptionController&&De.setManifestParamsProviderFunction((()=>_e.serviceDescriptionController.getServiceDescriptionSettings()?.clientDataReporting?.cmcdParameters||null)),ce.setConfig(_e))}},X=ye.getLogger(Ge),it(),Ge}de.__dashjs_factory_name="CmcdController",me.default=o.default.getSingletonFactory(de)},2473:function(wt,me,P){P.r(me);var F=P(138),f=P(5212),o=P(7263);function p(){let E,_;function w(){_={}}return E={reset:function(){w()},processResponseHeaders:function(g){if(!(g&&g.headers&&g.request&&g.request.url))return;const h=g.headers[f.default.COMMON_ACCESS_TOKEN_HEADER];if(h){const r=o.default.getHostFromUrl(g.request.url);r&&(_[r]=h)}},getCommonAccessTokenForUrl:function(g){if(!g)return null;const h=o.default.getHostFromUrl(g);return h?_[h]?_[h]:null:void 0}},w(),E}p.__dashjs_factory_name="CommonAccessTokenController",me.default=F.default.getSingletonFactory(p)},5313:function(wt,me,P){P.r(me);var F=P(138),f=P(7263),o=P(8854),p=P(5212),E=P(7568),_=P(649);function w(){let g,h,r;const H=this.context;function G(le,de,De,ce,Le){const Be=(function(ot,Ge){let X=[];return X=Ge===o.default.PERIOD?ot[o.default.SUPPLEMENTAL_PROPERTY]||[]:[...ot[o.default.ESSENTIAL_PROPERTY]||[],...ot[o.default.SUPPLEMENTAL_PROPERTY]||[]],X.find((Z=>Z.schemeIdUri===p.default.URL_QUERY_INFO_SCHEME&&Z.UrlQueryInfo||Z.schemeIdUri===p.default.EXT_URL_QUERY_INFO_SCHEME&&Z.ExtUrlQueryInfo))})(de,Le);(function(ot,Ge,X,Z){X.initialQueryString="";let Se="";const Ne=ot?.ExtUrlQueryInfo||ot?.UrlQueryInfo;Se=Ne&&Ne.queryString?Ge&&Ge.length>0?Ge+"&"+Ne.queryString:Ne.queryString:Ge,Ne?.useMPDUrlQuery==="true"&&Z&&(Se=Se?Se+"&"+Z:Z),X.initialQueryString=Se})(Be,ce.initialQueryString,le,De),(function(ot,Ge,X){if(!ot)return void(Ge.finalQueryString=X);const Z=ot?.ExtUrlQueryInfo?.queryTemplate||ot?.UrlQueryInfo?.queryTemplate||"";Ge.finalQueryString=Z===o.default.QUERY_PART?Ge?.initialQueryString:""})(Be,le,ce.finalQueryString),le.sameOriginOnly=Be?.ExtUrlQueryInfo?.sameOriginOnly,le.queryParams=f.default.parseQueryParams(le?.finalQueryString),le.includeInRequests=(function(ot,Ge){return ot?ot.ExtUrlQueryInfo?.includeInRequests?ot.ExtUrlQueryInfo.includeInRequests.split(" "):[o.default.SEGMENT_TYPE]:Ge})(Be,ce.includeInRequests)}return h=(0,_.default)(H).getInstance().getLogger(g),g={getFinalQueryString:function(le){try{if(!r)return null;if(le.type===E.HTTPRequest.MEDIA_SEGMENT_TYPE||le.type===E.HTTPRequest.INIT_SEGMENT_TYPE){const de=le.representation;if(!de)return null;const De=de.adaptation,ce=De.period,Le=r.period[ce.index].adaptation[De.index].representation[de.index],Be=new URL(le.url),ot=!Le.sameOriginOnly||r.origin===Be.origin;if(Le.includeInRequests.includes(o.default.SEGMENT_TYPE)&&ot)return Le.queryParams}else if(le.type===E.HTTPRequest.MPD_TYPE){if([o.default.MPD_TYPE,o.default.MPD_PATCH_TYPE].some((de=>r.includeInRequests.includes(de))))return r.queryParams}else if(le.type===E.HTTPRequest.CONTENT_STEERING_TYPE&&r.includeInRequests.includes(o.default.STEERING_TYPE))return r.queryParams}catch(de){return h.error(de),null}},createFinalQueryStrings:function(le){r={origin:new URL(le.url).origin,period:[]};const de=le.url.split("?")[1];G(r,le,de,{initialQueryString:"",includeInRequests:[]},o.default.MPD),le.Period.forEach((De=>{const ce={adaptation:[]};G(ce,De,de,r,o.default.PERIOD),De.AdaptationSet.forEach((Le=>{const Be={representation:[]};G(Be,Le,de,ce,o.default.ADAPTATION_SET),Le.Representation.forEach((ot=>{const Ge={};G(Ge,ot,de,Be,o.default.REPRESENTATION),Be.representation.push(Ge)})),ce.adaptation.push(Be)})),r.period.push(ce)}))}},g}w.__dashjs_factory_name="ExtUrlQueryInfoController",me.default=F.default.getSingletonFactory(w)},4469:function(wt,me,P){P.r(me),P.d(me,{default:function(){return Pe}});class F{constructor(){this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null}}F.SSL_CONNECTION_FAILED_PREFIX="SSL",F.DNS_RESOLUTION_FAILED="C00",F.HOST_UNREACHABLE="C01",F.CONNECTION_REFUSED="C02",F.CONNECTION_ERROR="C03",F.CORRUPT_MEDIA_ISOBMFF="M00",F.CORRUPT_MEDIA_OTHER="M01",F.BASE_URL_CHANGED="F00",F.BECAME_REPORTER="S00";var f=F,o=P(913),p=P(138);function E(j){let qe,it;const _e=(j=j||{}).eventBus,Ue=j.dashMetrics,i=j.metricsConstants,S=j.events;function I(ze){let je=new f;if(it){for(const Y in ze)ze.hasOwnProperty(Y)&&(je[Y]=ze[Y]);je.mpdurl||(je.mpdurl=it.originalUrl||it.url),je.terror||(je.terror=new Date),Ue.addDVBErrors(je)}}function $(ze){ze.error||(it=ze.manifest)}function ie(ze){I({errorcode:f.BASE_URL_CHANGED,servicelocation:ze.entry})}function be(){I({errorcode:f.BECAME_REPORTER})}function tt(ze){var je;ze.metric===i.HTTP_REQUEST&&((je=ze.value).responsecode===0||je.responsecode==null||je.responsecode>=400||je.responsecode<100||je.responsecode>=600)&&I({errorcode:je.responsecode||f.CONNECTION_ERROR,url:je.url,terror:je.tresponse,servicelocation:je._serviceLocation})}function ae(ze){let je;switch(ze.error?ze.error.code:0){case MediaError.MEDIA_ERR_NETWORK:je=f.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:je=f.CORRUPT_MEDIA_OTHER;break;default:return}I({errorcode:je})}return qe={initialize:function(){_e.on(S.MANIFEST_UPDATED,$,qe),_e.on(S.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,ie,qe),_e.on(S.METRIC_ADDED,tt,qe),_e.on(S.METRIC_UPDATED,tt,qe),_e.on(S.PLAYBACK_ERROR,ae,qe),_e.on(o.default.BECAME_REPORTING_PLAYER,be,qe)},reset:function(){_e.off(S.MANIFEST_UPDATED,$,qe),_e.off(S.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,ie,qe),_e.off(S.METRIC_ADDED,tt,qe),_e.off(S.METRIC_UPDATED,tt,qe),_e.off(S.PLAYBACK_ERROR,ae,qe),_e.off(o.default.BECAME_REPORTING_PLAYER,be,qe)}},qe}E.__dashjs_factory_name="DVBErrorsTranslator";var _=p.default.getSingletonFactory(E),w=P(7377);function g(j){j=j||{};let qe,it,_e=!1,Ue=this.context,i=j.mediaElement;return qe={initialize:function(S){S&&S.length&&(S.forEach((I=>{let $=I.starttime,ie=$+I.duration;it.add($,ie)})),_e=!!S[0]._useWallClockTime)},reset:function(){it.clear()},isEnabled:function(){let S,I=it.length;if(!I)return!0;S=_e?new Date().getTime()/1e3:i.currentTime;for(let $=0;$<I;$+=1){let ie=it.start($),be=it.end($);if(ie<=S&&S<be)return!0}return!1}},it=(0,w.default)(Ue).create(),qe}g.__dashjs_factory_name="RangeController";var h=p.default.getClassFactory(g);function r(){return{serialise:function j(qe){let it,_e,Ue=[],i=[];for(it in qe)if(qe.hasOwnProperty(it)&&it.indexOf("_")!==0){if(_e=qe[it],_e==null&&(_e=""),Array.isArray(_e)){if(!_e.length)continue;i=[],_e.forEach((function(S){let I=Object.prototype.toString.call(S).slice(8,-1)!=="Object";i.push(I?S:j(S))})),_e=i.map(encodeURIComponent).join(",")}else typeof _e=="string"?_e=encodeURIComponent(_e):_e instanceof Date?_e=_e.toISOString():typeof _e=="number"&&(_e=Math.round(_e));Ue.push(it+"="+_e)}return Ue.join("&")}}}r.__dashjs_factory_name="MetricSerialiser";var H=p.default.getSingletonFactory(r);function G(){let j,qe,it,_e=window.crypto||window.msCrypto,Ue=Uint32Array,i=Math.pow(2,8*Ue.BYTES_PER_ELEMENT)-1;function S(){_e&&(j||(j=new Ue(10)),_e.getRandomValues(j),qe=0)}return it={random:function(I,$){let ie;return I||(I=0),$||($=1),_e?(qe===j.length&&S(),ie=j[qe]/i,qe+=1):ie=Math.random(),ie*($-I)+I}},S(),it}G.__dashjs_factory_name="RNG";var le=p.default.getSingletonFactory(G),de=P(1926),De=P(8261);function ce(j){let qe;j=j||{};let it,_e,Ue,i,S,I,$,ie=this.context,be=(0,De.default)(ie).getInstance(),tt=[];const ae=j.metricsConstants;function ze(){i=!1,S=!1,I=null,$=null}return qe={report:function(je,Y){Array.isArray(Y)||(Y=[Y]),S&&$.isEnabled()&&Y.forEach((function(he){let et=it.serialise(he);je!==ae.DVB_ERRORS&&(et=`metricname=${je}&${et}`),et=`${I}?${et}`,(function(at,Tt,st){let _t=new XMLHttpRequest;_t.withCredentials=_e.getXHRWithCredentialsForType(ae.HTTP_REQUEST_DVB_REPORTING_TYPE);const Zt=function(){let In=tt.indexOf(_t);In!==-1&&(tt.splice(In,1),!(_t.status>=200&&_t.status<300)&&st&&st())};tt.push(_t);try{_t.open("GET",at),_t.onloadend=Zt,_t.onerror=Zt,_t.send()}catch{_t.onerror()}})(et,0,(function(){S=!1}))}))},initialize:function(je,Y){let he;if($=Y,I=be.get().streaming.dvbReporting.reportingUrl||je.dvbReportingUrl,!I)throw new Error('MPD parameter missing "dvb:reportingUrl" or URL not provided in player settings');i||(he=je.dvbProbability,he&&(he===1e3||he/1e3>=Ue.random())&&(S=!0),i=!0)},reset:function(){ze()}},it=H(ie).getInstance(),Ue=le(ie).getInstance(),_e=(0,de.default)(ie).getInstance(),ze(),qe}ce.__dashjs_factory_name="DVBReporting";var Le=p.default.getClassFactory(ce);function Be(j){j=j||{};const qe={"urn:dvb:dash:reporting:2014":Le},it=this.context;let _e;const Ue=j.debug?j.debug.getLogger(_e):{},i=j.metricsConstants,S=j.mediaPlayerModel||{};return _e={create:function(I,$){let ie;try{ie=qe[I.schemeIdUri](it).create({metricsConstants:i,mediaPlayerModel:S}),ie.initialize(I,$)}catch(be){ie=null,Ue.error(`ReportingFactory: could not create Reporting with schemeIdUri ${I.schemeIdUri} (${be.message})`)}return ie},register:function(I,$){qe[I]=$},unregister:function(I){delete qe[I]}},_e}Be.__dashjs_factory_name="ReportingFactory";var ot=p.default.getSingletonFactory(Be);function Ge(j){let qe,it=[];const _e=ot(this.context).getInstance(j);return qe={initialize:function(Ue,i){Ue.some((S=>{let I=_e.create(S,i);if(I)return it.push(I),!0}))},reset:function(){it.forEach((Ue=>Ue.reset())),it=[]},report:function(Ue,i){it.forEach((S=>S.report(Ue,i)))}},qe}Ge.__dashjs_factory_name="ReportingController";var X=p.default.getClassFactory(Ge);function Z(){return{reconstructFullMetricName:function(j,qe,it){let _e=j;return qe&&(_e+="("+qe,it&&it.length&&(_e+=","+it),_e+=")"),_e},validateN:function(j){if(!j)throw new Error("missing n");if(isNaN(j))throw new Error("n is NaN");if(j<0)throw new Error("n must be positive");return j}}}Z.__dashjs_factory_name="HandlerHelpers";var Se=p.default.getSingletonFactory(Z);function Ne(j){let qe,it,_e,Ue,i,S;j=j||{};let I=this.context,$=Se(I).getInstance(),ie=[];const be=j.metricsConstants;function tt(){let ae=(function(){try{return Object.keys(ie).map((ze=>ie[ze])).reduce(((ze,je)=>ze.level<je.level?ze:je))}catch{return}})();ae&&S!==ae.t&&(S=ae.t,it.report(Ue,ae))}return qe={initialize:function(ae,ze,je){ze&&(_e=$.validateN(je),it=ze,Ue=$.reconstructFullMetricName(ae,je),i=setInterval(tt,_e))},reset:function(){clearInterval(i),i=null,_e=0,it=null,S=null},handleNewMetric:function(ae,ze,je){ae===be.BUFFER_LEVEL&&(ze.level<0?delete ie[je]:ie[je]=ze)}},qe}Ne.__dashjs_factory_name="BufferLevelHandler";var ke=p.default.getClassFactory(Ne),ht=p.default.getClassFactory((function(j){let qe,it,_e=(j=j||{}).eventBus;const Ue=j.metricsConstants;function i(){_e.off(o.default.METRICS_INITIALISATION_COMPLETE,i,this),_e.trigger(o.default.BECAME_REPORTING_PLAYER)}return qe={initialize:function(S,I){I&&(it=I,_e.on(o.default.METRICS_INITIALISATION_COMPLETE,i,this))},reset:function(){it=null},handleNewMetric:function(S,I){S===Ue.DVB_ERRORS&&it&&it.report(S,I)}},qe}));function ye(j){let qe,it,_e,Ue,i,S;j=j||{};let I=[],$=Se(this.context).getInstance();const ie=j.metricsConstants;function be(){var tt=I;tt.length&&it&&it.report(i,tt),I=[]}return qe={initialize:function(tt,ae,ze,je){ae&&(_e=$.validateN(ze),it=ae,je&&je.length&&(Ue=je),i=$.reconstructFullMetricName(tt,ze,je),S=setInterval(be,_e))},reset:function(){clearInterval(S),S=null,_e=null,Ue=null,I=[],it=null},handleNewMetric:function(tt,ae){tt===ie.HTTP_REQUEST&&(Ue&&Ue!==ae.type||I.push(ae))}},qe}ye.__dashjs_factory_name="HttpListHandler";var pt=p.default.getClassFactory(ye);function He(){let j,qe,it;return j={initialize:function(_e,Ue){qe=_e,it=Ue},reset:function(){it=null,qe=void 0},handleNewMetric:function(_e,Ue){_e===qe&&it&&it.report(qe,Ue)}},j}He.__dashjs_factory_name="GenericMetricHandler";var Fe=p.default.getClassFactory(He);function Ke(j){let qe;const it=(j=j||{}).debug?j.debug.getLogger(qe):{};let _e=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/;const Ue=this.context;let i={BufferLevel:ke,DVBErrors:ht,HttpList:pt,PlayList:Fe,RepSwitchList:Fe,TcpList:Fe};return qe={create:function(S,I){var $,ie=S.match(_e);if(ie){try{($=i[ie[1]](Ue).create({eventBus:j.eventBus,metricsConstants:j.metricsConstants})).initialize(ie[1],I,ie[3],ie[5])}catch(be){$=null,it.error(`MetricsHandlerFactory: Could not create handler for type ${ie[1]} with args ${ie[3]}, ${ie[5]} (${be.message})`)}return $}},register:function(S,I){i[S]=I},unregister:function(S){delete i[S]}},qe}Ke.__dashjs_factory_name="MetricsHandlerFactory";var Pt=p.default.getSingletonFactory(Ke);function Nt(j){j=j||{};let qe,it=[];const _e=this.context,Ue=j.eventBus,i=j.events;let S=Pt(_e).getInstance({debug:j.debug,eventBus:j.eventBus,metricsConstants:j.metricsConstants});function I($){it.forEach((ie=>{ie.handleNewMetric($.metric,$.value,$.mediaType)}))}return qe={initialize:function($,ie){$.split(",").forEach(((be,tt,ae)=>{let ze;if(be.indexOf("(")!==-1&&be.indexOf(")")===-1){let je=ae[tt+1];je&&je.indexOf("(")===-1&&je.indexOf(")")!==-1&&(be+=","+je,delete ae[tt+1])}ze=S.create(be,ie),ze&&it.push(ze)})),Ue.on(i.METRIC_ADDED,I,qe),Ue.on(i.METRIC_UPDATED,I,qe)},reset:function(){Ue.off(i.METRIC_ADDED,I,qe),Ue.off(i.METRIC_UPDATED,I,qe),it.forEach(($=>$.reset())),it=[]}},qe}Nt.__dashjs_factory_name="MetricsHandlersController";var kt=p.default.getClassFactory(Nt);function Ut(j){let qe,it,_e,Ue;j=j||{};let i=this.context;function S(){qe&&qe.reset(),it&&it.reset(),_e&&_e.reset()}return Ue={initialize:function(I){try{_e=h(i).create({mediaElement:j.mediaElement}),_e.initialize(I.Range),it=X(i).create({debug:j.debug,metricsConstants:j.metricsConstants,mediaPlayerModel:j.mediaPlayerModel}),it.initialize(I.Reporting,_e),qe=kt(i).create({debug:j.debug,eventBus:j.eventBus,metricsConstants:j.metricsConstants,events:j.events}),qe.initialize(I.metrics,it)}catch($){throw S(),$}},reset:S},Ue}Ut.__dashjs_factory_name="MetricsController";var ln=p.default.getClassFactory(Ut),an=class{constructor(){this.metrics="",this.Range=[],this.Reporting=[]}},En=class{constructor(){this.starttime=0,this.duration=1/0,this._useWallClockTime=!1}},Oe=class{constructor(){this.schemeIdUri="",this.value="",this.dvbReportingUrl="",this.dvbProbability=1e3}};function Ie(j){let qe,it=(j=j||{}).adapter;const _e=j.constants;return qe={getMetrics:function(Ue){let i=[];return Ue&&Ue.Metrics&&Ue.Metrics.forEach((S=>{var I=new an,$=it.getIsDynamic(Ue);S.hasOwnProperty("metrics")&&(I.metrics=S.metrics,S.Range&&S.Range.forEach((ie=>{var be=new En;be.starttime=(function(tt,ae,ze){let je,Y,he=0;return ae?he=it.getAvailabilityStartTime(tt)/1e3:(je=it.getRegularPeriods(tt),je.length&&(he=je[0].start)),Y=he,ze&&ze.hasOwnProperty(_e.START_TIME)&&(Y+=ze.starttime),Y})(Ue,$,ie),ie.hasOwnProperty("duration")?be.duration=ie.duration:be.duration=it.getDuration(Ue),be._useWallClockTime=$,I.Range.push(be)})),S.Reporting&&(S.Reporting.forEach((ie=>{var be=new Oe;ie.hasOwnProperty(_e.SCHEME_ID_URI)&&(be.schemeIdUri=ie.schemeIdUri,ie.hasOwnProperty("value")&&(be.value=ie.value),ie.hasOwnProperty(_e.DVB_REPORTING_URL)&&(be.dvbReportingUrl=ie[_e.DVB_REPORTING_URL]),ie.hasOwnProperty(_e.DVB_PROBABILITY)&&(be.dvbProbability=ie[_e.DVB_PROBABILITY]),I.Reporting.push(be))})),i.push(I)))})),i}},qe}Ie.__dashjs_factory_name="ManifestParsing";var mt=p.default.getSingletonFactory(Ie);function It(j){let qe;j=j||{};let it={},_e=this.context,Ue=j.eventBus;const i=j.events;function S($){if($.error)return;let ie=Object.keys(it);mt(_e).getInstance({adapter:j.adapter,constants:j.constants}).getMetrics($.manifest).forEach((be=>{const tt=JSON.stringify(be);if(it.hasOwnProperty(tt))ie.splice(tt,1);else try{let ae=ln(_e).create(j);ae.initialize(be),it[tt]=ae}catch{}})),ie.forEach((be=>{it[be].reset(),delete it[be]})),Ue.trigger(o.default.METRICS_INITIALISATION_COMPLETE)}function I(){Object.keys(it).forEach(($=>{it[$].reset()})),it={}}return qe={reset:function(){Ue.off(i.MANIFEST_UPDATED,S,qe),Ue.off(i.STREAM_TEARDOWN_COMPLETE,I,qe)}},Ue.on(i.MANIFEST_UPDATED,S,qe),Ue.on(i.STREAM_TEARDOWN_COMPLETE,I,qe),qe}It.__dashjs_factory_name="MetricsCollectionController";var Ye=p.default.getClassFactory(It);function V(){let j,qe,it=this.context;return j={createMetricsReporting:function(_e){return qe=_(it).getInstance({eventBus:_e.eventBus,dashMetrics:_e.dashMetrics,metricsConstants:_e.metricsConstants,events:_e.events}),qe.initialize(),Ye(it).create(_e)},getReportingFactory:function(){return ot(it).getInstance()},getMetricsHandlerFactory:function(){return Pt(it).getInstance()}},j}V.__dashjs_factory_name="MetricsReporting";const B=p.default.getClassFactory(V);B.events=o.default,p.default.updateClassFactory(V.__dashjs_factory_name,B);var Pe=B},913:function(wt,me,P){P.r(me);var F=P(7252);class f extends F.default{constructor(){super(),this.METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",this.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",this.CMCD_DATA_GENERATED="cmcdDataGenerated"}}let o=new f;me.default=o},8898:function(wt,me,P){P.r(me);var F=P(8735),f=P(7568),o=P(1191),p=P(7263),E=P(5212),_=P(138),w=P(9302),g=P(6882);const h={[f.HTTPRequest.INIT_SEGMENT_TYPE]:"segment",[f.HTTPRequest.MEDIA_SEGMENT_TYPE]:"segment",[f.HTTPRequest.XLINK_EXPANSION_TYPE]:"xlink",[f.HTTPRequest.MPD_TYPE]:"mpd",[f.HTTPRequest.CONTENT_STEERING_TYPE]:"steering",[f.HTTPRequest.OTHER_TYPE]:"other"};function r(){let H,G,le,de,De,ce,Le,Be,ot,Ge,X,Z,Se,Ne,ke,ht,ye,pt={},He={},Fe=this.context;function Ke(){Le=(0,g.default)(Fe).getInstance(),it()}function Pt(I){return I!=null&&!isNaN(I)&&isFinite(I)}function Nt(I,$){const ie=[];return Pt(I)&&ie.push((0,F.toCmcdValue)(I,{v:!0})),Pt($)&&ie.push((0,F.toCmcdValue)($,{a:!0})),ie.length>0?ie:null}function kt(I,$){Ut($);const ie=qe($),be=(function(_t){try{return parseInt(_t.bandwidth/1e3)}catch{return null}})(I),tt=(function(_t){try{return isNaN(_t.duration)?NaN:Math.round(1e3*_t.duration)}catch{return null}})(I),ae=Ye($),ze=(function(_t){try{const Zt=de?de.getPlaybackRate():1,In=G.getCurrentBufferLevel(_t);return isNaN(Zt)||isNaN(In)?null:100*parseInt(In/Zt*10)}catch{return null}})($),je=B($),Y=an(I.representation?.mediaInfo),he=It($),et=En($),at=(function(_t){if(Ne&&Ne.length!==0){for(let Zt of Ne)if(Zt.getType()===_t)return Zt.probeNextRequest()}})($);let Tt;$===E.default.VIDEO&&(Tt=F.CmcdObjectType.VIDEO),$===E.default.AUDIO&&(Tt=F.CmcdObjectType.AUDIO),I.mediaType===E.default.ENHANCEMENT&&(Tt=F.CmcdObjectType.OTHER),$===E.default.TEXT&&(Tt=I.representation.mediaInfo.mimeType==="application/mp4"?F.CmcdObjectType.TIMED_TEXT:F.CmcdObjectType.CAPTION);const st=Le.has("rtp")?Le.get("rtp"):(function(_t){try{let Zt=de.getPlaybackRate();Zt||(Zt=1);let{bandwidth:In,mediaType:Vt,representation:_n,duration:gn}=_t;if(!_n.mediaInfo)return NaN;let Jn=B(Vt);Jn===0&&(Jn=500);let Pn=In*gn/1e3/(Jn/Zt/1e3);const xt=Le.get("rtpSafetyFactor",{defaultValue:5});return 100*(parseInt(Pn*xt/100)+1)}catch{return NaN}})(I);if(isNaN(st)||(ie.rtp=st),at&&I.url!==at.url){const _t=p.default.getRelativeUrl(I.url,at.url),Zt=at.range?{r:at.range}:void 0;ie.nor=[(0,F.toCmcdValue)(_t,Zt)]}if(be){const _t=$===E.default.VIDEO?be:null,Zt=$===E.default.AUDIO?be:null;ie.br=Nt(_t,Zt)||[(0,F.toCmcdValue)(be,{})]}if(Tt&&(ie.ot=Tt),isNaN(tt)||(ie.d=tt),!isNaN(ae)){const _t=$===E.default.VIDEO?ae:null,Zt=$===E.default.AUDIO?ae:null;ie.mtp=Nt(_t,Zt)||[(0,F.toCmcdValue)(ae,{})]}if(isNaN(ze)||(ie.dl=ze),!isNaN(je)){const _t=$===E.default.VIDEO?je:null,Zt=$===E.default.AUDIO?je:null;ie.bl=Nt(_t,Zt)||[(0,F.toCmcdValue)(je,{})]}if(!isNaN(Y)&&isFinite(Y)){const _t=$===E.default.VIDEO?Y:null,Zt=$===E.default.AUDIO?Y:null;ie.tb=Nt(_t,Zt)||[(0,F.toCmcdValue)(Y,{})]}if(he!==null&&!isNaN(he)){const _t=$===E.default.VIDEO?he:null,Zt=$===E.default.AUDIO?he:null;ie.tpb=Nt(_t,Zt)||[(0,F.toCmcdValue)(he,{})]}if(et!==null&&!isNaN(et)){const _t=$===E.default.VIDEO?et:null,Zt=$===E.default.AUDIO?et:null;ie.pb=Nt(_t,Zt)||[(0,F.toCmcdValue)(et,{})]}if(Ge[$]&&(ie.bs=!0,Ge[$]=!1),He[$]){const _t=$===E.default.VIDEO?He[$]:null,Zt=$===E.default.AUDIO?He[$]:null;ie.bsd=Nt(_t,Zt)||[(0,F.toCmcdValue)(He[$],{})],delete He[$]}return!ot[$]&&X[$]||(ie.su=!0,ot[$]=!1,X[$]=!0),Object.assign(ie,S()),ie}function Ut(I){X.hasOwnProperty(I)||(X[I]=!1),ot.hasOwnProperty(I)||(ot[I]=!1),Ge.hasOwnProperty(I)||(Ge[I]=!1)}function ln(){const I={},$=de.getStreamController()?.getActiveStream();if(!$)return I;const ie=$.getCurrentRepresentationForType(E.default.VIDEO),be=$.getCurrentRepresentationForType(E.default.AUDIO),tt=Nt(ie?Math.round(ie.bitrateInKbit):null,be?Math.round(be.bitrateInKbit):null);return tt&&(I.br=tt),I}function an(I){try{if(ye&&ye.has(I))return ye.get(I);const $=De.getPossibleVoRepresentationsFilteredBySettings(I).map((be=>be.bitrateInKbit)),ie=Math.max(...$);return ye&&ye.set(I,ie),ie}catch{return null}}function En(I){try{if(!Ne||Ne.length===0)return null;const $=Ne.find((be=>be.getType()===I)),ie=$?.getRepresentationController()?.getCurrentRepresentation()?.bitrateInKbit;return ie===void 0||isNaN(ie)?null:Math.round(ie)}catch{return null}}function Oe(){const I={},$=Nt(En(E.default.VIDEO),En(E.default.AUDIO));return $&&(I.pb=$),I}function Ie(I){if(!Ne||Ne.length===0)return null;const $=Ne.find((be=>be.getType()===I));if(!$)return null;const ie=an($.getMediaInfo());return isFinite(ie)&&ie>0?ie:null}function mt(){const I={},$=Nt(Ie(E.default.VIDEO),Ie(E.default.AUDIO));$&&(I.tb=$);const ie=Nt(It(E.default.VIDEO),It(E.default.AUDIO));return ie&&(I.tpb=ie),I}function It(I){try{if(!Ne||Ne.length===0)return null;const $=Ne.find((ie=>ie.getType()===I));if($){const ie=an($.getMediaInfo());return isFinite(ie)&&ie>0?ie:null}return null}catch{return null}}function Ye(I){try{return 100*parseInt(ce.getSafeAverageThroughput(I)/100)}catch{return null}}function V(){const I={},$=Nt(Ye(E.default.VIDEO),Ye(E.default.AUDIO));return $&&(I.mtp=$),I}function B(I){try{const $=G.getCurrentBufferLevel(I);return isNaN($)?null:100*parseInt(10*$)}catch{return null}}function Pe(){const I={},$=Nt(B(E.default.VIDEO),B(E.default.AUDIO));return $&&(I.bl=$),I}function j(I){pt[I]!=null&&(He[I]=Date.now()-pt[I],delete pt[I])}function qe(I){const $={};let ie=1e3*de.getCurrentLiveLatency();if(isNaN(ie)||($.ltc=ie),typeof document<"u"&&document.hidden&&($.bg=!0),I&&(function(be){return be===E.default.VIDEO||be===E.default.AUDIO||be===E.default.OTHER})(I)){const be=G.getCurrentDroppedFrames()?.droppedFrames;be>0&&($.df=be)}return $}function it(){Ge={},ot={},X={},Se=!1,Be=void 0,Z=void 0,pt={},He={},ke=void 0,ht=void 0,_e()}function _e(){if(!de)return;const I=de.getStreamController();if(!I||typeof I.getActiveStream!="function")return;const $=I.getActiveStream();$&&(Ne=$.getStreamProcessors())}function Ue(){let I={};if(le){const $=le.getServiceDescriptionSettings();$.clientDataReporting&&$.clientDataReporting.cmcdParameters&&(I=$.clientDataReporting.cmcdParameters)}return I}function i(I,$){const ie=$??Le.get("includeInRequests"),be=h[I];return be!==void 0&&ie.includes(be)}function S(){const I={},$=de.getStreamController()?.getActiveStream();if(!$)return I;const ie=$.getCurrentRepresentationForType(E.default.VIDEO),be=$.getCurrentRepresentationForType(E.default.AUDIO),tt=ie?ie.bitrateInKbit:0,ae=be?be.bitrateInKbit:0,ze=Nt(tt>0?Math.round(tt):null,ae>0?Math.round(ae):null);ze&&(I.ab=ze);const je=$.getRepresentationsByType(E.default.VIDEO)||[],Y=$.getRepresentationsByType(E.default.AUDIO)||[],he=je.reduce(((Zt,In)=>Math.max(Zt,In.bitrateInKbit)),0),et=Y.reduce(((Zt,In)=>Math.max(Zt,In.bitrateInKbit)),0),at=Nt(he>0?Math.round(he):null,et>0?Math.round(et):null);at&&(I.tab=at);const Tt=je.length>0?Math.min(...je.map((Zt=>Zt.bitrateInKbit))):0,st=Y.length>0?Math.min(...Y.map((Zt=>Zt.bitrateInKbit))):0,_t=Nt(Tt>0?Math.round(Tt):null,st>0?Math.round(st):null);return _t&&(I.lab=_t),I}return H={calculateMsd:function(){const I={},$=Z?Date.now()-Z:null;return $===null||isNaN($)||(I.msd=$),I},deriveCmcdDataForRequest:function(I){ye=new Map;try{I.type,($=I.mediaType)!==E.default.VIDEO&&$!==E.default.AUDIO||Be&&Be!==E.default.AUDIO||(Be=$);let ie={};if(i(I.type)){if(I.type===f.HTTPRequest.MPD_TYPE)return(function(){const be=qe();return be.ot=F.CmcdObjectType.MANIFEST,be})();if(I.type===f.HTTPRequest.MEDIA_SEGMENT_TYPE)return Ut(I.mediaType),kt(I,I.mediaType);if(I.type===f.HTTPRequest.INIT_SEGMENT_TYPE)return(function(){const be=qe();return be.ot=F.CmcdObjectType.INIT,be.su=!0,be})();if(I.type===f.HTTPRequest.OTHER_TYPE||I.type===f.HTTPRequest.XLINK_EXPANSION_TYPE)return(function(){const be=qe();return be.ot=F.CmcdObjectType.OTHER,be})();if(I.type===f.HTTPRequest.LICENSE)return(function(){const be=qe();return be.ot=F.CmcdObjectType.KEY,be})();if(I.type===f.HTTPRequest.CONTENT_STEERING_TYPE)return(function(be){const tt=Be?kt(be,Be):qe();return tt.ot=F.CmcdObjectType.OTHER,tt})(I)}return ie}catch{return null}finally{ye=null}var $},getCmcdParametersFromManifest:Ue,getEventModeData:function(){return{...qe(),...S(),...ln(),...Pe(),...V(),...Oe(),...mt()}},getLastMediaTypeRequest:function(){return Be},isIncludedInRequestFilter:i,onBufferLevelStateChanged:function(I){try{I.state&&I.mediaType&&I.state===o.default.BUFFER_EMPTY&&(Ge[I.mediaType]||(Ge[I.mediaType]=!0),ot[I.mediaType]||(ot[I.mediaType]=!0))}catch{}},onManifestLoaded:function(I){try{return ke=(0,w.default)(Fe).getInstance().getIsDynamic(I.data)?`${F.CmcdStreamType.LIVE}`:`${F.CmcdStreamType.VOD}`,ht=I.protocol&&I.protocol==="MSS"?`${F.CmcdStreamingFormat.SMOOTH}`:`${F.CmcdStreamingFormat.DASH}`,{st:ke,sf:ht}}catch{return{}}},onPeriodSwitchComplete:function(){_e()},onPlaybackPlaying:function(){for(const I in pt)pt.hasOwnProperty(I)&&j(I)},onPlaybackRateChanged:function(I){return I.playbackRate!==void 0?{pr:I.playbackRate}:null},onPlaybackSeeked:function(){Se=!1;for(let I in Ge)Ge.hasOwnProperty(I)&&(Ge[I]=!0);for(let I in ot)ot.hasOwnProperty(I)&&(ot[I]=!0)},onPlaybackSeeking:function(){Se=!0},onPlaybackStarted:function(){Z||(Z=Date.now())},onRebufferingCompleted:j,onRebufferingStarted:function(I){I&&!pt[I]&&(pt[I]=Date.now())},reset:function(){it()},resetInitialSettings:it,setConfig:function(I){I&&(I.abrController&&(De=I.abrController),I.dashMetrics&&(G=I.dashMetrics),I.playbackController&&(de=I.playbackController),I.throughputController&&(ce=I.throughputController),I.serviceDescriptionController&&(le=I.serviceDescriptionController))},setup:Ke,updateCmcdManifestParamsInCmcdConfigAccessor:function(){const I=Ue();Le&&Object.keys(I).length>0?Le.setManifestParams(I):Le&&Le.setManifestParams(null)},wasPlaying:function(){return!Se&&Z}},Ke(),H}r.__dashjs_factory_name="CmcdModel",me.default=_.default.getSingletonFactory(r)},6066:function(wt,me,P){P.r(me);var F=P(138),f=P(8850),o=P(3621),p=P(649),E=P(1103);const _=E.CMSD_STATIC.toLowerCase(),w=E.CMSD_DYNAMIC.toLowerCase(),g=["mb","st","sf","v"],h="stream",r={video:E.CmsdObjectType.VIDEO,audio:E.CmsdObjectType.AUDIO,text:E.CmsdObjectType.TIMED_TEXT,stream:h};function H(){const G=this.context,le=(0,f.default)(G).getInstance();let de,De,ce,Le;function Be(){ce={},Le={}}function ot(Ne){Ne&&Object.keys(Ne).forEach((ke=>{g.includes(ke)||delete Ne[ke]}))}function Ge(Ne){try{return(0,E.decodeCmsdStatic)(Ne)}catch(ke){De.error("Failed to parse CMSD-Static response header value:",ke)}}function X(Ne){try{const ke=(0,E.decodeCmsdDynamic)(Ne);return ke[ke.length-1]?.params||{}}catch(ke){return De.error("Failed to parse CMSD-Dynamic response header value:",ke),{}}}function Z(Ne){return r[Ne]||E.CmsdObjectType.OTHER}function Se(Ne,ke,ht){const ye=Ne===E.CMSD_STATIC?ce:Le,pt=ye[ke]||{},He=ye[h]||{};return pt[ht]||He[ht]}return de={setConfig:function(){},initialize:function(){},reset:function(){Be()},parseResponseHeaders:function(Ne,ke){let ht=null,ye=null;for(const He in Ne){const Fe=Ne[He];switch(He){case _:ht=Ge(Fe),le.trigger(o.default.CMSD_STATIC_HEADER,ht);break;case w:ye||(ye=X(Fe))}}let pt=h;return ht&&ht.ot?pt=ht.ot:ke&&(pt=Z(ke)),ot(ce[pt]),ot(Le[pt]),ht&&(ce[pt]=Object.assign(ce[pt]||{},ht)),ye&&(Le[pt]=Object.assign(Le[pt]||{},ye)),{static:ht,dynamic:ye}},getMaxBitrate:function(Ne){let ke=Z(Ne);return Se(E.CMSD_DYNAMIC,ke,"mb")||-1},getEstimatedThroughput:function(Ne){let ke=Z(Ne);return Se(E.CMSD_DYNAMIC,ke,"etp")||null},getResponseDelay:function(Ne){let ke=Z(Ne);return Se(E.CMSD_DYNAMIC,ke,"rd")||null},getRoundTripTime:function(Ne){let ke=Z(Ne);return Se(E.CMSD_DYNAMIC,ke,"rtt")||null}},De=(0,p.default)(G).getInstance().getLogger(de),Be(),de}H.__dashjs_factory_name="CmsdModel",me.default=F.default.getSingletonFactory(H)},1926:function(wt,me,P){P.r(me);var F=P(5717),f=P(138),o=P(8261),p=P(656),E=P(5212),_=P(1234),w=P(5560);function g(){let h,r,H,G,le,de,De,ce,Le,Be,ot,Ge,X,Z;const Se=this.context,Ne=(0,o.default)(Se).getInstance();function ke(){de=[],Le=[],De=[],ce=[],Be=[],X=[],ot=null,r=[],G=Z.getCmcdRequestInterceptors(),le=Z.getCmcdResponseReceivedInterceptors(),Ge=new Set}function ht(Ke,Pt){let Nt=-1;Ke.some(((kt,Ut)=>{if(kt===Pt)return Nt=Ut,!0})),Nt<0||Ke.splice(Nt,1)}function ye(Ke){let Pt;for(Pt=0;Pt<X.length;Pt++)if(X[Pt].rulename===Ke)return Pt;return-1}function pt(Ke,Pt){let Nt=!1;return Ge.forEach((kt=>{kt[Ke]===Pt&&(Nt=!0)})),Nt}function He(Ke,Pt){Fe(Ke,Pt);let Nt=new F.default;Nt.schemeIdUri=Ke,Nt.value=Pt,r.push(Nt)}function Fe(Ke,Pt){(0,p.checkParameterType)(Ke,"string"),(0,p.checkParameterType)(Pt,"string"),r.forEach((function(Nt,kt){Nt.schemeIdUri===Ke&&Nt.value===Pt&&r.splice(kt,1)}))}return h={addAbrCustomRule:function(Ke,Pt,Nt){if(typeof Ke!="string"||Ke!==E.default.RULES_TYPES.ABANDON_FRAGMENT_RULES&&Ke!==E.default.RULES_TYPES.QUALITY_SWITCH_RULES||typeof Pt!="string")throw E.default.BAD_ARGUMENT_ERROR;let kt=ye(Pt);kt===-1?X.push({type:Ke,rulename:Pt,rule:Nt}):(X[kt].type=Ke,X[kt].rule=Nt)},addExternalSubtitle:function(Ke){if(!(Ke&&Ke.id!==void 0&&Ke.url&&Ke.language&&Ke.mimeType&&Ke.bandwidth!==void 0))return;const Pt=new w.default(Ke);pt("url",Pt.url)||pt("id",Pt.id)||Ge.add(Pt)},addRequestInterceptor:function(Ke){G.push(Ke)},addResponseInterceptor:function(Ke){le.push(Ke)},addUTCTimingSource:He,clearDefaultUTCTimingSources:function(){r=[]},getAbrCustomRules:function(){return X},getCertificateRequestFilters:function(){return De},getCertificateResponseFilters:function(){return ce},getCustomCapabilitiesFilters:function(){return Be},getCustomInitialTrackSelectionFunction:function(){return ot},getExternalSubtitles:function(){return Ge},getLicenseRequestFilters:function(){return de},getLicenseResponseFilters:function(){return Le},getRequestInterceptors:function(){return G},getResponseInterceptors:function(){return le},getUTCTimingSources:function(){return r},getXHRWithCredentialsForType:function(Ke){const Pt=H[Ke];return Pt===void 0?H.default:Pt},registerCertificateRequestFilter:function(Ke){De.push(Ke)},registerCertificateResponseFilter:function(Ke){ce.push(Ke)},registerCustomCapabilitiesFilter:function(Ke){Be.push(Ke)},registerLicenseRequestFilter:function(Ke){de.push(Ke)},registerLicenseResponseFilter:function(Ke){Le.push(Ke)},removeAbrCustomRule:function(Ke){if(Ke){let Pt=ye(Ke);Pt!==-1&&X.splice(Pt,1)}else X=[]},removeAllAbrCustomRule:function(){X=[]},removeExternalSubtitleById:function(Ke){Ge.forEach((Pt=>{Pt.id===Ke&&Ge.delete(Pt)}))},removeExternalSubtitleByUrl:function(Ke){Ge.forEach((Pt=>{Pt.url===Ke&&Ge.delete(Pt)}))},removeRequestInterceptor:function(Ke){ht(G,Ke)},removeResponseInterceptor:function(Ke){ht(le,Ke)},removeUTCTimingSource:Fe,reset:function(){ke()},resetCustomInitialTrackSelectionFunction:function(){ot=null},resetPlaybackSessionSpecificSettings:function(){Ge=new Set},restoreDefaultUTCTimingSources:function(){let Ke=Ne.get().streaming.utcSynchronization.defaultTimingSource;He(Ke.scheme,Ke.value)},setConfig:function(){},setCustomInitialTrackSelectionFunction:function(Ke){ot=Ke},setXHRWithCredentialsForType:function Ke(Pt,Nt){Pt?H[Pt]=!!Nt:Object.keys(H).forEach((kt=>{Ke(kt,Nt)}))},unregisterCertificateRequestFilter:function(Ke){ht(De,Ke)},unregisterCertificateResponseFilter:function(Ke){ht(ce,Ke)},unregisterCustomCapabilitiesFilter:function(Ke){ht(Be,Ke)},unregisterLicenseRequestFilter:function(Ke){ht(de,Ke)},unregisterLicenseResponseFilter:function(Ke){ht(Le,Ke)}},H={default:!1},Z=(0,_.default)(Se).getInstance(),ke(),h}g.__dashjs_factory_name="CustomParametersModel",me.default=f.default.getSingletonFactory(g)},1244:function(wt,me,P){P.r(me);var F=P(138),f=P(8261),o=P(5212),p=P(649);function E(){const w=this.context,g=(0,f.default)(w).getInstance();let h,r,H;function G(Be,ot,Ge){Be.customData.reader.read().then(Ge).catch((function(){le(Be)}))}function le(Be){Be.customData.onloadend&&Be.customData.onloadend()}function de(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function De(){if(this.customData.abortController)this.customData.abortController.abort();else if(this.customData.reader)try{this.customData.reader.cancel(),this.onabort()}catch{}}function ce(Be,ot){try{if((Be=Be.filter((Ge=>Ge.bytes>ot/4/Be.length))).length>1){let Ge=0;const X=(Be[Be.length-1].timestamp-Be[0].timestamp)/Be.length;return Be.forEach(((Z,Se)=>{const Ne=Be[Se+1];if(Ne){const ke=Ne.timestamp-Z.timestamp;Ge+=ke<X?ke:0}})),Ge}return null}catch{return null}}function Le(Be,ot){return 8*Be/ot}return H=(0,p.default)(w).getInstance().getLogger(h),h={abort:De,calculateDownloadedTime:ce,load:function(Be,ot){const Ge=(function(Se){const Ne=new Headers;if(Se.headers)for(let ke in Se.headers){let ht=Se.headers[ke];ht&&Ne.append(ke,ht)}return Ne})(Be),X=(function(Se){let Ne;return typeof window.AbortController=="function"&&(Ne=new AbortController,Se.customData.abortController=Ne,Ne.signal.onabort=Se.customData.onabort),Se.customData.abort=De.bind(Se),Ne})(Be),Z=(function(Se,Ne,ke){return new Request(Se.url,{method:Se.method,headers:Ne,credentials:Se.credentials,signal:ke?ke.signal:void 0})})(Be,Ge,X);fetch(Z).then((Se=>{(function(Ne,ke,ht){(function(an,En){an.status=En.status,an.statusText=En.statusText,an.url=En.url;const Oe={};for(const Ie of En.headers.keys())Oe[Ie]=En.headers.get(Ie);an.headers=Oe})(ht,Ne);let ye=0,pt=!1,He=new Uint8Array,Fe=0;ke.customData.reader=Ne.body.getReader();let Ke=[],Pt=[],Nt=[],kt=!0;const Ut=g.get().streaming.abr.throughput.lowLatencyDownloadTimeCalculationMode,ln=({value:an,done:En})=>{En?(function(){if(He){const Oe=(function(){let Ie=null;return Ut===o.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING?Ie=(function(){const mt=(function(It,Ye){try{let V,B;if(V=It.slice(0,-1),B=Ye.slice(0,-1),V.length!==B.length&&H.warn(`[FetchLoader] Moof and Mdat data arrays have different lengths. Moof: ${V.length}, Mdat: ${B.length}`),V.length<=1)return null;let Pe=[],j=0,qe=0;for(let it=0;it<V.length;it++)if(V[it]&&B[it]){let _e=B[it].timestamp-V[it].timestamp;if(_e>1){const Ue=Le(B[it].bytes,_e);Pe.push(Ue),qe=0}else{qe===0&&(qe=V[it].timestamp,j=0);let Ue=B[it].timestamp-qe;if(Ue>1){j+=B[it].bytes;const i=Le(j,Ue);Pe.push(i),qe=0}else j+=B[it].bytes}}return Pe.length>0?Pe.reduce(((it,_e)=>it+_e),0)/Pe.length:null}catch{return null}})(Pt,Nt);return mt?8*ye/mt:null})():Ut===o.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.DOWNLOADED_DATA&&(Ie=ce(Ke,ye)),Ie})();ke.customData.onprogress({loaded:ye,total:ye,lengthComputable:!0,time:Oe}),ht.data=He.buffer}ke.customData.onloadend()})():(an&&an.length>0&&(function(Oe){He=(function(mt,It){if(mt.length===0)return It;const Ye=new Uint8Array(mt.length+It.length);return Ye.set(mt),Ye.set(It,mt.length),Ye})(He,Oe),ye+=Oe.length,Ke.push({timestamp:de(),bytes:Oe.length}),Ut===o.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING&&kt&&r.findLastTopIsoBoxCompleted(["moof"],He,Fe).found&&(kt=!1,Pt.push({timestamp:de()}));const Ie=r.findLastTopIsoBoxCompleted(["moov","mdat"],He,Fe);Ie.found?(function(mt){const It=(function(Ye){let V;return Ye===He.length?(V=He,He=new Uint8Array):(V=new Uint8Array(He.subarray(0,Ye)),He=He.subarray(Ye)),V})(mt.startOffsetOfLastFoundTargetBox+mt.sizeOfLastFoundTargetBox);Ut!==o.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING||kt||(kt=!0,Nt.push({timestamp:de(),bytes:It.length})),ke.customData.onprogress({data:It.buffer,lengthComputable:!1,noTrace:!0}),Fe=0})(Ie):(function(mt){Fe=mt.startOffsetOfLastCompletedBox+mt.sizeOfLastCompletedBox,pt||(ke.customData.onprogress({lengthComputable:!1,noTrace:!0}),pt=!0)})(Ie)})(an),G(ke,0,ln))};G(ke,0,ln)})(Se,Be,ot)})).catch((()=>{le(Be)}))},reset:function(){},setConfig:function(Be){r=Be.boxParser}},h}E.__dashjs_factory_name="FetchLoader";const _=F.default.getClassFactory(E);me.default=_},868:function(wt,me,P){P.r(me);var F=P(9838),f=P(1244),o=P(7568),p=P(138),E=P(1944),_=P(6066),w=P(7263),g=P(649),h=P(8850),r=P(3621),H=P(8261),G=P(5212),le=P(1926),de=P(2473),De=P(5313),ce=P(447),Le=P(5099);function Be(Ge){Ge=Ge||{};const X=this.context,Z=Ge.errHandler,Se=Ge.dashMetrics,Ne=Ge.mediaPlayerModel,ke=Ge.boxParser,ht=Ge.errors,ye=(0,h.default)(X).getInstance(),pt=(0,H.default)(X).getInstance();let He,Fe,Ke,Pt,Nt,kt,Ut,ln,an,En,Oe,Ie;function mt(It,Ye){const V=function(){qe()},B=function(st){const _t=new Date;$&&($=!1,(!st.lengthComputable||st.lengthComputable&&st.total!==st.loaded)&&(S.firstByteDate=_t,je.resourceTiming.responseStart=_t.getTime())),st.lengthComputable&&(S.bytesLoaded=je.length=st.loaded,S.bytesTotal=je.resourceTiming.encodedBodySize=st.total,je.length=st.total,je.resourceTiming.encodedBodySize=st.loaded),st.noTrace||(I.push({s:be,d:st.time?st.time:_t.getTime()-be.getTime(),b:[st.loaded?st.loaded-tt:0],t:st.throughput}),S.traces=I,be=_t,tt=st.loaded),ae&&(clearTimeout(ae),ae=null),pt.get().streaming.fragmentRequestProgressTimeout>0&&(ae=setTimeout((function(){Ie.warn("Abort request "+ze.url+" due to progress timeout"),he.abort(ze),V()}),pt.get().streaming.fragmentRequestProgressTimeout)),It.progress&&st&&It.progress(st)},Pe=function(){qe(!0)},j=function(st){let _t;if(st.lengthComputable){let Zt=st.loaded/st.total*100;_t="Request timeout: loaded: "+st.loaded+", out of: "+st.total+" : "+Zt.toFixed(3)+"% Completed"}else _t="Request timeout: non-computable download size";Ie.warn(_t)},qe=function(st=!1){Fe.indexOf(ze)!==-1&&Fe.splice(Fe.indexOf(ze),1),ae&&(clearTimeout(ae),ae=null),En.processResponseHeaders(je),it(),_e(),(function(_t){const Zt=an.getResponseInterceptors();return Zt?Zt.reduce(((In,Vt)=>In.then((_n=>Vt(_n)))),Promise.resolve(_t)):Promise.resolve(_t)})(je).then((_t=>{if(je=_t,(function(In,Vt,_n){const gn=In.customData.request,Jn=pt.get().streaming.cmsd&&pt.get().streaming.cmsd.enabled?kt.parseResponseHeaders(Vt.headers,gn.mediaType):null;Se.addHttpRequest(gn,Vt.url,Vt.status,Vt.headers,_n,Jn)})(ze,je,I),st)return void(It.abort&&It.abort(S));S.type===o.HTTPRequest.MPD_TYPE&&(Se.addManifestUpdate(S),ye.trigger(r.default.MANIFEST_LOADING_FINISHED,{requestObject:S}));const Zt=!!je.data||S.method===o.HTTPRequest.POST;if(je.status>=200&&je.status<=299&&Zt)It.success&&It.success(je.data,je.statusText,je.url),It.complete&&It.complete(S,je.statusText);else{try{je.status===404&&pt.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&S.type===o.HTTPRequest.MEDIA_SEGMENT_TYPE&&Ne.getRetryAttemptsForType(o.HTTPRequest.MEDIA_SEGMENT_TYPE)===Ye&&ye.trigger(r.default.ATTEMPT_BACKGROUND_SYNC)}catch{}i()}}))},it=function(){S.startDate=ie,S.endDate=new Date,S.firstByteDate=S.firstByteDate||ie},_e=function(){je.resourceTiming.responseEnd=performance.now(),je.resourceTiming.duration=je.resourceTiming.responseEnd-je.resourceTiming.startTime,(function(st,_t){if(!pt.get().streaming.abr.throughput.useResourceTimingApi||typeof performance>"u"||st.range)return;const Zt=performance.getEntriesByType?.("resource");if(Zt===void 0||Zt.length<=0)return;let In=0,Vt=null;for(;In<Zt.length;){if(Zt[In].name===st.url){Vt=Zt[In];break}In+=1}(function(_n){return _n&&!isNaN(_n.responseStart)&&_n.responseStart>0&&!isNaN(_n.responseEnd)&&_n.responseEnd>0&&!isNaN(_n.transferSize)&&_n.transferSize>0})(Vt)&&(st.customData.request.resourceTimingValues=Vt,_t.resourceTiming.startTime=Vt.startTime,_t.resourceTiming.encodedBodySize=Vt.encodedBodySize,_t.resourceTiming.responseStart=Vt.responseStart,_t.resourceTiming.responseEnd=Vt.responseEnd,_t.resourceTiming.duration=Vt.duration)})(ze,je)},Ue=function(st,_t,Zt){return new Promise((In=>{(function(Vt){const _n=an.getRequestInterceptors();return _n?_n.reduce(((gn,Jn)=>gn.then((Pn=>Jn(Pn)))),Promise.resolve(Vt)):Promise.resolve(Vt)})(_t).then((Vt=>{_t=Vt,Zt.request=_t,_t.customData.onloadend=V,_t.customData.onprogress=B,_t.customData.onabort=Pe,_t.customData.ontimeout=j,Zt.resourceTiming.startTime=performance.now(),st.load(_t,Zt),In()}))}))},i=function(){if(Ye>0){Ye--,It&&It.request&&(It.request.retryAttempts+=1);let st={config:It};Pt.push(st),st.timeout=setTimeout((function(){Pt.indexOf(st)!==-1&&(Pt.splice(Pt.indexOf(st),1),mt(It,Ye))}),Ne.getRetryIntervalsForType(S.type))}else{if(S.type===o.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;Z.error(new E.default(Nt[S.type],S.url+" is not available",{request:S,response:je})),It.error&&It.error(S,"error",je.statusText,je),It.complete&&It.complete(S,je.statusText)}},S=It.request,I=[];let $,ie,be,tt,ae,ze,je;if(S.bytesLoaded=NaN,S.bytesTotal=NaN,S.firstByteDate=null,S.traces=[],$=!0,ie=new Date,be=ie,tt=0,ae=null,!Se||!Z)throw new Error("config object is not correct or missing");const Y=(function(st){let _t,Zt;return!st.isPartialSegmentRequest&&st.hasOwnProperty("availabilityTimeComplete")&&st.availabilityTimeComplete===!1&&window.fetch&&st.responseType==="arraybuffer"&&st.type===o.HTTPRequest.MEDIA_SEGMENT_TYPE?(ln||(ln=(0,f.default)(X).create(),ln.setConfig({dashMetrics:Se,boxParser:ke})),_t=ln,Zt=G.default.FILE_LOADER_TYPES.FETCH):(Ut||(Ut=(0,F.default)(X).create()),_t=Ut,Zt=G.default.FILE_LOADER_TYPES.XHR),{loader:_t,fileLoaderType:Zt}})(S),he=Y.loader;var et;S.fileLoaderType=Y.fileLoaderType,S.headers=S.headers||{},(et=S).retryAttempts===0&&(function(st){let _t=Oe.getFinalQueryString(st);_t&&(st.url=w.default.addAdditionalQueryParameterToUrl(st.url,_t))})(et),(function(st){if(st.queryParams){const _t=[];for(const Zt in st.queryParams)_t.push({key:Zt,value:st.queryParams[Zt]});st.url=w.default.addAdditionalQueryParameterToUrl(st.url,_t)}})(et),(function(st){const _t=En.getCommonAccessTokenForUrl(st.url);_t&&(st.headers[G.default.COMMON_ACCESS_TOKEN_HEADER]=_t)})(et),S.range&&(S.headers.Range="bytes="+S.range);const at=an.getXHRWithCredentialsForType(S.type);ze=new ce.default({url:S.url,method:S.method||o.HTTPRequest.GET,responseType:S.responseType,headers:S.headers,credentials:at?"include":"omit",timeout:(function(st){return st.type===o.HTTPRequest.MPD_TYPE?pt.get().streaming.manifestRequestTimeout||0:((_t=st)&&_t.type===o.HTTPRequest.INIT_SEGMENT_TYPE||_t.type===o.HTTPRequest.INDEX_SEGMENT_TYPE||_t.type===o.HTTPRequest.MEDIA_SEGMENT_TYPE||_t.type===o.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE||_t.type===o.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE)&&pt.get().streaming.fragmentRequestTimeout||0;var _t})(S),body:S.body,customData:{request:S}}),je=new Le.default({request:ze,resourceTiming:{startTime:performance.now(),encodedBodySize:0},status:0});let Tt=new Date().getTime();if(isNaN(S.delayLoadingTime)||Tt>=S.delayLoadingTime)return Fe.push(ze),Ue(he,ze,je);{let st={httpRequest:ze,httpResponse:je};return Ke.push(st),st.delayTimeout=setTimeout((function(){if(Ke.indexOf(st)!==-1){Ke.splice(Ke.indexOf(st),1);try{ie=new Date,be=ie,Fe.push(st.httpRequest),Ue(he,st.httpRequest,st.httpResponse)}catch{st.httpRequest.onloadend()}}}),S.delayLoadingTime-Tt),Promise.resolve()}}return He={abort:function(){Pt.forEach((It=>{clearTimeout(It.timeout),It.config.request&&It.config.abort&&It.config.abort(It.config.request)})),Pt=[],Ke.forEach((It=>clearTimeout(It.delayTimeout))),Ke=[],Fe.forEach((It=>{const Ye=It.customData;Ye&&(Ye.request&&Ye.request.type===o.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE||(Ye.onloadend=Ye.onprogress=void 0,Ye.abort&&Ye.abort()))})),Fe=[]},load:function(It){return It.request?mt(It,Ne.getRetryAttemptsForType(It.request.type)):(It.error&&It.error(It.request,"error"),Promise.resolve())},reset:function(){Fe=[],Ke=[],Pt=[],Ut&&Ut.reset(),ln&&ln.reset(),Ut=null,ln=null},resetInitialSettings:function(){Ut&&Ut.resetInitialSettings()},setConfig:function(It){It&&(It.commonAccessTokenController&&(En=It.commonAccessTokenController),It.extUrlQueryInfoController&&(Oe=It.extUrlQueryInfoController))}},Ie=(0,g.default)(X).getInstance().getLogger(He),Fe=[],Ke=[],Pt=[],kt=(0,_.default)(X).getInstance(),an=(0,le.default)(X).getInstance(),En=(0,de.default)(X).getInstance(),Oe=(0,De.default)(X).getInstance(),Nt={[o.HTTPRequest.MPD_TYPE]:ht.DOWNLOAD_ERROR_ID_MANIFEST_CODE,[o.HTTPRequest.XLINK_EXPANSION_TYPE]:ht.DOWNLOAD_ERROR_ID_XLINK_CODE,[o.HTTPRequest.INIT_SEGMENT_TYPE]:ht.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE,[o.HTTPRequest.MEDIA_SEGMENT_TYPE]:ht.DOWNLOAD_ERROR_ID_CONTENT_CODE,[o.HTTPRequest.INDEX_SEGMENT_TYPE]:ht.DOWNLOAD_ERROR_ID_CONTENT_CODE,[o.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE]:ht.DOWNLOAD_ERROR_ID_CONTENT_CODE,[o.HTTPRequest.OTHER_TYPE]:ht.DOWNLOAD_ERROR_ID_CONTENT_CODE},He}Be.__dashjs_factory_name="HTTPLoader";const ot=p.default.getClassFactory(Be);me.default=ot},1721:function(wt,me,P){P.r(me);var F=P(138),f=P(868);function o(){let E,_;function w(){_={}}function g(){w()}return g(),E={getLoader:function(h){for(var r in _)if(_.hasOwnProperty(r)&&h.startsWith(r))return _[r];return f.default},registerLoader:function(h,r){_[h]=r},unregisterLoader:function(h){_[h]&&delete _[h]},unregisterAllLoader:w,reset:g},E}o.__dashjs_factory_name="SchemeLoaderFactory";const p=F.default.getSingletonFactory(o);me.default=p},3773:function(wt,me,P){P.r(me);var F=P(138),f=P(1721);function o(E){E=E||{};const _=this.context;let w,g,h;return g=(0,f.default)(_).getInstance(),w={abort:function(){h&&h.abort()},load:function(r){h||(h=g.getLoader(r&&r.request?r.request.url:null)(_).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})),h.load(r)},reset:function(){g&&(g.reset(),g=null),h&&typeof h.reset=="function"&&h.reset(),h=null},resetInitialSettings:function(){h&&typeof h.resetInitialSettings=="function"&&h.resetInitialSettings()}},w}o.__dashjs_factory_name="URLLoader";const p=F.default.getClassFactory(o);me.default=p},9838:function(wt,me,P){P.r(me);var F=P(138),f=P(7263);function o(){let E,_;function w(){_&&(_.onloadend=_.onerror=_.onprogress=_.onload=null,_.abort(),_.onabort=_.ontimeout=null,_=null)}return E={load:function(g,h){if(_=null,_=new XMLHttpRequest,_.open(g.method,g.url,!0),g.responseType&&(_.responseType=g.responseType),g.headers)for(let H in g.headers){let G=g.headers[H];G&&_.setRequestHeader(H,G)}_.withCredentials=g.credentials==="include",_.timeout=g.timeout,_.onload=function(){h.url=this.responseURL,h.status=this.status,h.statusText=this.statusText,h.headers=f.default.parseHttpHeaders(this.getAllResponseHeaders()),h.data=this.response},g.customData&&(_.onloadend=g.customData.onloadend,_.onprogress=g.customData.onprogress,_.onabort=g.customData.onabort,_.ontimeout=g.customData.ontimeout);let r=g.body||null;return _.send(r),g.customData.abort=w.bind(this),!0},abort:w,getXhr:function(){return _},reset:function(){w(),E=null},resetInitialSettings:function(){w()}},E}o.__dashjs_factory_name="XHRLoader";const p=F.default.getClassFactory(o);me.default=p},7037:function(wt,me,P){P.r(me),P.d(me,{default:function(){return Pn}});var F=P(8854),f=P(2861);const o={prefixes:["clearkey","dashif","ck"]};class p{static findMp4ProtectionElement(Ft){let Rt=null;for(let fe=0;fe<Ft.length;++fe){let Ht=Ft[fe];Ht.schemeIdUri&&Ht.schemeIdUri.toLowerCase()===F.default.MP4_PROTECTION_SCHEME&&Ht.value&&(Ht.value.toLowerCase()===f.default.ENCRYPTION_SCHEME_CENC||Ht.value.toLowerCase()===f.default.ENCRYPTION_SCHEME_CBCS)&&(Rt=Ht)}return Rt}static getPSSHData(Ft){let Rt=8,fe=new DataView(Ft),Ht=fe.getUint8(Rt);return Rt+=20,Ht>0&&(Rt+=4+16*fe.getUint32(Rt)),Rt+=4,Ft.slice(Rt)}static getPSSHForKeySystem(Ft,Rt){let fe=p.parsePSSHList(Rt);return Ft&&fe.hasOwnProperty(Ft.uuid.toLowerCase())?fe[Ft.uuid.toLowerCase()]:null}static parseInitDataFromContentProtection(Ft,Rt){return"pssh"in Ft&&Ft.pssh?(Ft.pssh.__text=Ft.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),Rt.decodeArray(Ft.pssh.__text).buffer):null}static parsePSSHList(Ft){if(Ft==null)return[];let Rt=new DataView(Ft.buffer||Ft),fe={},Ht=0;for(;;){let zt,tn,rn,Bt,ft,Qt,Fn=Ht;if(Ht>=Rt.buffer.byteLength)break;if(zt=Rt.getUint32(Ht),tn=Ht+zt,Ht+=4,Rt.getUint32(Ht)===1886614376)if(Ht+=4,rn=Rt.getUint8(Ht),rn===0||rn===1){for(Ht++,Ht+=3,Bt="",ft=0;ft<4;ft++)Qt=Rt.getUint8(Ht+ft).toString(16),Bt+=Qt.length===1?"0"+Qt:Qt;for(Ht+=4,Bt+="-",ft=0;ft<2;ft++)Qt=Rt.getUint8(Ht+ft).toString(16),Bt+=Qt.length===1?"0"+Qt:Qt;for(Ht+=2,Bt+="-",ft=0;ft<2;ft++)Qt=Rt.getUint8(Ht+ft).toString(16),Bt+=Qt.length===1?"0"+Qt:Qt;for(Ht+=2,Bt+="-",ft=0;ft<2;ft++)Qt=Rt.getUint8(Ht+ft).toString(16),Bt+=Qt.length===1?"0"+Qt:Qt;for(Ht+=2,Bt+="-",ft=0;ft<6;ft++)Qt=Rt.getUint8(Ht+ft).toString(16),Bt+=Qt.length===1?"0"+Qt:Qt;Ht+=6,Bt=Bt.toLowerCase(),Ht+=4,fe[Bt]=Rt.buffer.slice(Fn,tn),Ht=tn}else Ht=tn;else Ht=tn}return fe}static getLicenseServerUrlFromMediaInfo(Ft,Rt){try{if(!Ft||Ft.length===0)return null;let fe=0,Ht=null;for(;fe<Ft.length&&!Ht;){const zt=Ft[fe];if(zt&&zt.contentProtection&&zt.contentProtection.length>0){const tn=zt.contentProtection.filter((rn=>rn.schemeIdUri&&rn.schemeIdUri===Rt));if(tn&&tn.length>0){let rn=0;for(;rn<tn.length&&!Ht;){const Bt=tn[rn];Bt.laUrl&&Bt.laUrl.__prefix&&o.prefixes.includes(Bt.laUrl.__prefix)&&Bt.laUrl.__text&&(Ht=Bt.laUrl.__text),rn+=1}}}fe+=1}return Ht}catch{return null}}static hexKidToBufferSource(Ft){const Rt=Ft.replace(/-/g,"");return new Uint8Array(Rt.match(/[\da-f]{2}/gi).map((function(fe){return parseInt(fe,16)}))).buffer}}var E=p,_=class{constructor(xt,Ft,Rt=null){this.contentType=xt,this.robustness=Ft,this.encryptionScheme=Rt}},w=class{constructor(xt,Ft,Rt,fe,Ht,zt){this.initDataTypes=zt&&zt.length>0?zt:[f.default.INITIALIZATION_DATA_TYPE_CENC],xt&&xt.length&&(this.audioCapabilities=xt),Ft&&Ft.length&&(this.videoCapabilities=Ft),this.distinctiveIdentifier=Rt,this.persistentState=fe,this.sessionTypes=Ht}},g=P(1923),h=P(1944),r=class{constructor(xt,Ft,Rt,fe,Ht,zt,tn,rn){this.url=xt,this.method=Ft,this.responseType=Rt,this.headers=fe,this.withCredentials=Ht,this.messageType=zt,this.sessionId=tn,this.data=rn}},H=class{constructor(xt,Ft,Rt){this.url=xt,this.headers=Ft,this.data=Rt}},G=P(7568),le=P(1349),de=P(7263),De=P(138),ce=class{constructor(xt,Ft,Rt){this.url=xt,this.method="GET",this.responseType="arraybuffer",this.headers=Ft,this.body=null,this.withCredentials=Rt}},Le=class{constructor(xt,Ft,Rt){this.url=xt,this.headers=Ft,this.data=Rt}};function Be(xt){const Ft=(xt=xt||{}).BASE64,Rt=xt.cmcdController,fe=xt.constants,Ht=xt.customParametersModel,zt=xt.debug,tn=xt.eventBus,rn=xt.events,Bt=xt.protectionKeyController,ft=xt.settings;let Qt,Fn,vn,en,mn,On,un,yn,hn,Ct,dt,Wt,$t,Cn,An=xt.protectionModel,Wn=[];function er(){if(!(tn&&tn.hasOwnProperty("on")&&Bt&&Bt.hasOwnProperty("getSupportedKeySystemMetadataFromContentProtection")))throw new Error("Missing config parameter(s)")}function Qn(vt,nn){$t||mn?$t&&(Ct?Ct.then((()=>{ar()})):ar()):(function(Sn,Re){if(mn)return;var ut;mn=!0;const yt=(function(ct){const Ot=[];for(let dn=0;dn<ct.length;dn++){const Tn=dr(ct[dn]);Ot.push({ks:ct[dn].ks,configs:[Tn],protData:ct[dn].protData})}return Ot})(Sn=(ut=Sn).sort(((ct,Ot)=>(Qt&&Qt[ct.ks.systemString]&&Qt[ct.ks.systemString].priority>=0?Qt[ct.ks.systemString].priority:ut.length)-(Qt&&Qt[Ot.ks.systemString]&&Qt[Ot.ks.systemString].priority>=0?Qt[Ot.ks.systemString].priority:ut.length))));let At;An.requestKeySystemAccess(yt).then((ct=>(At=ct.data,(function(Ot){let dn=Ot&&Ot.selectedSystemString?Ot.selectedSystemString:Ot.keySystem.systemString;return yn.info("DRM: KeySystem Access Granted for system string ("+dn+")! Selecting key system..."),An.selectKeySystem(Ot)})(At)))).then((ct=>{(function(Ot,dn){try{$t=Ot,mn=!1,tn.trigger(rn.KEY_SYSTEM_SELECTED,{data:dn});const Tn=hr($t);Tn&&Tn.serverCertificate&&Tn.serverCertificate.length>0&&An.setServerCertificate(Ft.decodeArray(Tn.serverCertificate).buffer),$t.systemString===f.default.FAIRPLAY_KEYSTEM_STRING?Ct=qn().then((()=>{Ct=null,ar()})).catch((Yn=>{yn.warn("DRM: Certificate acquisition failed for FairPlay: "+(Yn&&Yn.message?Yn.message:Yn)+". Proceeding anyway."),Ct=null,ar()})):(qn().catch((Yn=>{yn.error(Yn)})),ar())}catch(Tn){yn.error(Tn)}})(ct,At)})).catch((ct=>{(function(Ot,dn){$t=null,mn=!1,dn||tn.trigger(rn.KEY_SYSTEM_SELECTED,{data:null,error:new h.default(g.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,g.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+Ot.error)})})(ct,Re)}))})(vt,nn)}function qn(){if(!$t)return Promise.resolve();const vt=$t.systemString,nn=Fn.get(vt);if(nn&&(nn.applied||nn.inProgress))return Promise.resolve();const Sn=(function(){const yt=[],At=hr($t);return At&&Array.isArray(At.certUrls)&&At.certUrls.length&&At.certUrls.forEach((ct=>{yt.push(ct)})),hn.forEach((ct=>{ct&&ct.contentProtection&&ct.contentProtection.forEach((Ot=>{Ot&&Array.isArray(Ot.certUrls)&&Ot.certUrls.length&&Ot.schemeIdUri.toLowerCase()===$t.schemeIdURI&&Ot.certUrls.forEach((dn=>{yt.push(dn)}))}))})),le.default.dedupeCertUrls(yt)})();if(!Sn.length)return yn.debug("DRM: No Certificate Server URLs found for "+vt+". Skipping certificate acquisition."),Promise.resolve();yn.debug("DRM: Found "+Sn.length+" certificate candidate(s) for "+vt+". Starting acquisition.");const Re=hr($t)||{},ut=nn||{applied:!1,inProgress:!0,attempts:0};return ut.inProgress=!0,Fn.set(vt,ut),tr(Sn,0,Re,vt,ut)}function tr(vt,nn,Sn,Re,ut){if(nn>=vt.length)return(function(ct,Ot){return ct.inProgress=!1,ct.error=ct.error||"All certificate candidates failed",yn.warn("DRM: All certificate candidates failed for "+Ot+"."),Promise.reject(new Error(ct.error))})(ut,Re);const yt=vt[nn],At=isNaN(ft.get().streaming.retryAttempts[G.HTTPRequest.LICENSE_CERTIFICATE])?3:ft.get().streaming.retryAttempts[G.HTTPRequest.LICENSE_CERTIFICATE];return yn.debug("DRM: Attempting certificate download ("+(nn+1)+"/"+vt.length+") url="+yt.url),(function(ct,Ot){const dn=Ht.getCertificateRequestFilters();let Tn=!1;Ot&&typeof Ot.withCredentials=="boolean"&&(Tn=Ot.withCredentials);const Yn={};Ot&&Kr(Yn,Ot.httpRequestHeaders);const Gn=new ce(ct.url,Yn,Tn);return Cr(dn,Gn).then((()=>Gn))})(yt,Sn).then((ct=>Zn(ct,Sn,At))).then((ct=>(function(Ot,dn,Tn,Yn){if(!Ot||!Ot.byteLength)throw new Error("Empty certificate response");return Yn.urlUsed=dn.url,Yn.buffer=Ot,(function(Gn,sr,$n){return new Promise(((nr,ur)=>{try{const or=An.setServerCertificate(Gn);or&&typeof or.then=="function"?or.then((lr=>{nr(typeof lr!="boolean"||lr)})).catch((lr=>{$n.error=lr&&lr.message?lr.message:lr,ur(lr)})):nr(!0)}catch(or){$n.error=or&&or.message?or.message:or,yn.warn("DRM: setServerCertificate threw for "+sr+": "+$n.error),ur(or)}}))})(Ot,Tn,Yn).then((Gn=>{if(!Gn)throw new Error("CDM rejected certificate");Yn.applied=!0,Yn.inProgress=!1}))})(ct,yt,Re,ut))).then((()=>{(function(ct,Ot,dn){const Tn=ct.certType?" certType="+ct.certType:"";yn.info("DRM: Server certificate applied successfully from "+dn.urlUsed+Tn+" for "+Ot+".")})(yt,Re,ut)})).catch((ct=>(ut.attempts++,ut.lastError=ct&&ct.message?ct.message:ct,yn.warn("DRM: Certificate attempt failed ("+yt.url+"): "+ut.lastError),tr(vt,nn+1,Sn,Re,ut))))}function Zn(vt,nn,Sn){return new Promise(((Re,ut)=>{const yt=new XMLHttpRequest;yt.open(vt.method,vt.url,!0),yt.responseType=vt.responseType;const At=nn&&!isNaN(nn.httpTimeout)?nn.httpTimeout:8e3;At>0&&(yt.timeout=At),yt.withCredentials=vt.withCredentials;for(const Ot of Object.keys(vt.headers))yt.setRequestHeader(Ot,vt.headers[Ot]);const ct=Ot=>{if(Sn>0){const dn=Sn-1,Tn=isNaN(ft.get().streaming.retryIntervals[G.HTTPRequest.LICENSE_CERTIFICATE])?500:ft.get().streaming.retryIntervals[G.HTTPRequest.LICENSE_CERTIFICATE];yn.debug("DRM: Certificate request failed ("+Ot+"). Retrying... remaining="+dn),setTimeout((()=>{Zn(vt,nn,dn).then(Re).catch(ut)}),Tn)}else ut(new Error(Ot))};yt.onload=function(){if(this.status>=200&&this.status<=299){const Ot=de.default.parseHttpHeaders(yt.getAllResponseHeaders?yt.getAllResponseHeaders():null);Cr(Ht.getCertificateResponseFilters(),new Le(yt.responseURL,Ot,this.response)).then((()=>{Re(this.response)})).catch((()=>{Re(this.response)}))}else ct("HTTP "+this.status)},yt.onerror=function(){ct("network error")},yt.ontimeout=function(){ct("timeout")},yt.onabort=function(){ct("aborted")};try{yt.send(vt.body)}catch(Ot){ut(Ot)}}))}function ar(){let vt;for(let Sn=0;Sn<dt.length;Sn++)for(vt=0;vt<dt[Sn].length;vt++)if($t===dt[Sn][vt].ks){nn=dt[Sn][vt],Bt.isClearKey($t)&&(function(Re){if(Re.protData&&Re.protData.hasOwnProperty("clearkeys")&&Object.keys(Re.protData.clearkeys).length!==0){const ut={kids:Object.keys(Re.protData.clearkeys)};Re.initData=new TextEncoder().encode(JSON.stringify(ut))}})(nn),nn.sessionId?Xn(nn):nn.initData!==null&&gr(nn);break}var nn;dt=[]}function dr(vt){const nn=vt.protData,Sn=[],Re=[];let ut=f.default.INITIALIZATION_DATA_TYPE_CENC;vt.ks&&vt.ks.systemString===f.default.FAIRPLAY_KEYSTEM_STRING&&(ut=f.default.INITIALIZATION_DATA_TYPE_SINF);const yt=nn&&nn.initDataTypes&&nn.initDataTypes.length>0?nn.initDataTypes:[ut],At=nn&&nn.audioRobustness&&nn.audioRobustness.length>0?nn.audioRobustness:Wt,ct=nn&&nn.videoRobustness&&nn.videoRobustness.length>0?nn.videoRobustness:Wt,Ot=vt.sessionType,dn=nn&&nn.distinctiveIdentifier?nn.distinctiveIdentifier:"optional",Tn=nn&&nn.persistentState?nn.persistentState:Ot==="temporary"?"optional":"required",Yn=vt.ks&&vt.ks.systemString===f.default.FAIRPLAY_KEYSTEM_STRING?f.default.ENCRYPTION_SCHEME_CBCS:void 0;return hn.forEach((Gn=>{Gn.type===fe.AUDIO?Sn.push(new _(Gn.codec,At,Yn)):Gn.type===fe.VIDEO&&Re.push(new _(Gn.codec,ct,Yn))})),new w(Sn,Re,dn,Tn,[Ot],yt)}function Xn(vt){er(),An.loadKeySession(vt)}function gr(vt){if(vt&&(function(Sn){if(!Sn)return!1;try{const Re=An.getSessionTokens();for(let ut=0;ut<Re.length;ut++)if(Re[ut].getKeyId()===Sn)return!0;return!1}catch{return!1}})(vt.keyId))return;(function(){if(!ft)return;const Sn=ft.get().streaming.protection.keepProtectionMediaKeys,Re=ft.get().streaming.protection.keepProtectionMediaKeysMaximumOpenSessions;if(typeof Re!="number"||Re<=0)return;if(!Sn)return void yn.warn("DRM: keepProtectionMediaKeysMaximumOpenSessions is set to "+Re+", but keepProtectionMediaKeys is not enabled. Therefore, keepProtectionMediaKeysMaximumOpenSessions will be ignored.");if(!An||typeof An.getSessionTokens!="function")return;const ut=An.getSessionTokens()||[];if(ut.length<Re)return;const yt=ut[0];yt&&(yn.info("DRM: Maximum number of open MediaKeySessions reached ("+Re+"), closing oldest session."),Pr(yt))})();const nn=E.getPSSHForKeySystem($t,vt?vt.initData:null);if(nn){if(kr(nn))return;try{vt.initData=nn,An.createKeySession(vt)}catch(Sn){tn.trigger(rn.KEY_SESSION_CREATED,{data:null,error:new h.default(g.default.KEY_SESSION_CREATED_ERROR_CODE,g.default.KEY_SESSION_CREATED_ERROR_MESSAGE+Sn.message)})}}else vt&&vt.initData?An.createKeySession(vt):tn.trigger(rn.KEY_SESSION_CREATED,{data:null,error:new h.default(g.default.KEY_SESSION_CREATED_ERROR_CODE,g.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+($t?$t.systemString:null)+". needkey/encrypted event contains no initData corresponding to that key system!")})}function hr(vt){if(vt){const nn=vt.systemString;if(Qt)return nn in Qt?Qt[nn]:null}return null}function kr(vt){if(!vt)return!1;try{const nn=An.getAllInitData();for(let Sn=0;Sn<nn.length;Sn++)if(Bt.initDataEquals(vt,nn[Sn]))return yn.debug("DRM: Ignoring initData because we have already seen it!"),!0;return!1}catch{return!1}}function Pr(vt){er(),An.closeKeySession(vt)}function qr(vt){er(),vt?(An.setMediaElement(vt),tn.on(rn.NEED_KEY,br,vn)):vt===null&&(An.setMediaElement(vt),tn.off(rn.NEED_KEY,br,vn))}function Qr(vt){yn.debug("DRM: onKeyMessage");const nn=vt.data;tn.trigger(rn.KEY_MESSAGE,{data:nn});const Sn=nn.messageType?nn.messageType:f.default.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST,Re=nn.message,ut=nn.sessionToken,yt=hr($t),At=Bt.getLicenseServerModelInstance($t,yt,Sn),ct={sessionToken:ut,messageType:Sn};if(Re&&Re.byteLength!==0){if(!At)return yn.debug("DRM: License server request not required for this message (type = "+vt.data.messageType+"). Session ID = "+ut.getSessionId()),void mr(ct);if(Bt.isClearKey($t)){const Ot=Bt.processClearKeyLicenseRequest($t,yt,Re);if(Ot&&Ot.keyPairs&&Ot.keyPairs.length>0)return yn.debug("DRM: ClearKey license request handled by application!"),mr(ct),void An.updateKeySession(ut,Ot)}(function(Ot,dn,Tn){const Yn=Ot.sessionToken,Gn=Ot.messageType?Ot.messageType:f.default.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST,sr={sessionToken:Yn,messageType:Gn},$n=$t?$t.systemString:null;let nr=(function(rr,Hr,ti,jr,Ni){let Tr=null;const Ci=jr.message;if(rr&&rr.serverURL){const Dr=rr.serverURL;typeof Dr=="string"&&Dr!==""?Tr=Dr:typeof Dr=="object"&&Dr.hasOwnProperty(Hr)&&(Tr=Dr[Hr])}else if(rr&&rr.laURL&&rr.laURL!=="")Tr=rr.laURL;else if(Tr=E.getLicenseServerUrlFromMediaInfo(hn,$t.schemeIdURI),!Tr&&!Bt.isClearKey($t)){const Dr=E.getPSSHData(ti.initData);Tr=$t.getLicenseServerURLFromInitData(Dr),Tr||(Tr=jr.laURL)}return Tr=Ni.getServerURLFromMessage(Tr,Ci,Hr),Tr})(Tn,Gn,Yn,Ot,dn);if(!nr)return void mr(sr,new h.default(g.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,g.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE));const ur={};let or=!1;Tn&&Kr(ur,Tn.httpRequestHeaders);const lr=Ot.message;Kr(ur,$t.getRequestHeadersFromMessage(lr)),Object.keys(ur).forEach((rr=>{rr.toLowerCase()==="authorization"&&(or=!0)})),Tn&&typeof Tn.withCredentials=="boolean"&&(or=Tn.withCredentials);const Jr=function(rr){if(An)if(rr.status>=200&&rr.status<=299){const Hr=de.default.parseHttpHeaders(rr.getAllResponseHeaders?rr.getAllResponseHeaders():null);let ti=new H(rr.responseURL,Hr,rr.response);Cr(Ht.getLicenseResponseFilters(),ti).then((()=>{const jr=dn.getLicenseMessage(ti.data,$n,Gn);jr!==null?(mr(sr),An.updateKeySession(Yn,jr)):Zr(rr,sr,$n,Gn,dn)}))}else Zr(rr,sr,$n,Gn,dn)},Or=function(rr){mr(sr,new h.default(g.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,g.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+$n+' update, XHR aborted. status is "'+rr.statusText+'" ('+rr.status+"), readyState is "+rr.readyState))},Ii=function(rr){mr(sr,new h.default(g.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,g.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+$n+' update, XHR error. status is "'+rr.statusText+'" ('+rr.status+"), readyState is "+rr.readyState))},fi=$t.getLicenseRequestFromMessage(lr),Ri=dn.getHTTPMethod(Gn),oi=dn.getResponseType($n,Gn),_r=Tn&&!isNaN(Tn.httpTimeout)?Tn.httpTimeout:8e3,Ai=Yn.getSessionId()||null;let di=new r(nr,Ri,oi,ur,or,Gn,Ai,fi);const ei=isNaN(ft.get().streaming.retryAttempts[G.HTTPRequest.LICENSE])?3:ft.get().streaming.retryAttempts[G.HTTPRequest.LICENSE];Cr(Ht.getLicenseRequestFilters(),di).then((()=>{Xr(di,ei,_r,Jr,Or,Ii)}))})(nn,At,yt)}else mr(ct,new h.default(g.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,g.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function mr(vt,nn=null){tn.trigger(rn.LICENSE_REQUEST_COMPLETE,{data:vt,error:nn})}function Xr(vt,nn,Sn,Re,ut,yt){const At=new XMLHttpRequest,ct={url:vt.url,type:G.HTTPRequest.LICENSE,method:vt.method,headers:vt.headers||{}};Rt.applyCmcdToRequest(ct),vt.url=ct.url,vt.headers=ct.headers,At.open(vt.method,vt.url,!0),At.responseType=vt.responseType,At.withCredentials=vt.withCredentials,Sn>0&&(At.timeout=Sn);for(const dn in vt.headers)At.setRequestHeader(dn,vt.headers[dn]);const Ot=function(){nn--;const dn=isNaN(ft.get().streaming.retryIntervals[G.HTTPRequest.LICENSE])?1e3:ft.get().streaming.retryIntervals[G.HTTPRequest.LICENSE];On=setTimeout((function(){Xr(vt,nn,Sn,Re,ut,yt)}),dn)};At.onload=function(){un=null,this.status>=200&&this.status<=299||nn<=0?Re(this):(yn.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+nn),Ot())},At.ontimeout=At.onerror=function(){un=null,nn<=0?yt(this):(yn.warn("License request network request failed . Retrying it... Pending retries: "+nn),Ot())},At.onabort=function(){ut(this)},tn.trigger(rn.LICENSE_REQUEST_SENDING,{url:vt.url,headers:vt.headers,payload:vt.data,sessionId:vt.sessionId}),un=At,At.send(vt.data)}function Nr(){un&&(un.onloadend=un.onerror=un.onprogress=void 0,un.abort(),un=null),On&&(clearTimeout(On),On=null)}function Kr(vt,nn){if(nn)for(const Sn in nn)vt[Sn]=nn[Sn]}function Zr(vt,nn,Sn,Re,ut){let yt="NONE",At=null;vt.response&&(yt=ut.getErrorResponse(vt.response,Sn,Re),At={serverResponse:vt.response||null,responseCode:vt.status||null,responseText:vt.statusText||null}),mr(nn,new h.default(g.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,g.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+Sn+' update, XHR complete. status is "'+vt.statusText+'" ('+vt.status+"), readyState is "+vt.readyState+". Response is "+yt,At))}function Cr(vt,nn){return vt?vt.reduce(((Sn,Re)=>Sn.then((()=>Re(nn)))),Promise.resolve()):Promise.resolve()}function br(vt,nn){if(ft.get().streaming.protection.ignoreEmeEncryptedEvent)return;if(yn.debug("DRM: onNeedKey"),vt.key.initDataType!==f.default.INITIALIZATION_DATA_TYPE_CENC&&vt.key.initDataType!==f.default.INITIALIZATION_DATA_TYPE_SINF)return void yn.warn("DRM: Only 'cenc' and 'sinf' initData are supported! Ignoring initData of type: "+vt.key.initDataType);if(hn.length===0&&(yn.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(nn=nn===void 0?1:nn+1)<5))return void Wn.push(setTimeout((()=>{br(vt,nn)}),500));let Sn=vt.key.initData;ArrayBuffer.isView(Sn)&&(Sn=Sn.buffer);const Re=vt.key.initDataType===f.default.INITIALIZATION_DATA_TYPE_SINF;if($t){const yt=Re?Sn:E.getPSSHForKeySystem($t,Sn);if(yt&&kr(yt))return}let ut;yn.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(Sn))),ut=Re?Bt.getSupportedKeySystemMetadataForSinf(Sn,Qt,Cn):Bt.getSupportedKeySystemMetadataFromSegmentPssh(Sn,Qt,Cn),ut.length!==0?(function(yt){dt.push(yt),Qn(yt,!1)})(ut):yn.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!")}function Gr(vt,nn){if(vt.size<=0)return!1;if(nn.size>0&&[...vt].every((Re=>{const ut=nn.get(Re);return ut!==void 0&&ut!==""})))return!0;const Sn=An.getSessionTokens();if(Sn&&Sn.length>0){const Re=Sn.filter((ut=>[...vt].includes(ut.normalizedKeyId)));if(Re.some((ut=>!ut.hasTriggeredKeyStatusMapUpdate))||Re.length===0)return!1}return!ft.get().streaming.protection.ignoreKeyStatuses&&vt&&vt.size>0&&nn&&nn.size>0}return vn={areKeyIdsExpired:function(vt){try{return!!Gr(vt,en)&&[...vt].every((nn=>en.get(nn)===f.default.MEDIA_KEY_STATUSES.EXPIRED))}catch(nn){return yn.error(nn),!1}},areKeyIdsUsable:function(vt){try{return!Gr(vt,en)||[...vt].some((nn=>{const Sn=en.get(nn);return Sn&&Sn!==f.default.MEDIA_KEY_STATUSES.INTERNAL_ERROR&&Sn!==f.default.MEDIA_KEY_STATUSES.OUTPUT_RESTRICTED}))}catch(nn){return yn.error(nn),!0}},clearMediaInfoArray:function(){hn=[]},closeKeySession:Pr,createKeySession:gr,getKeySystems:function(){return Bt?Bt.getKeySystems():[]},getProtectionData:function(){return Qt},getSupportedKeySystemMetadataFromContentProtection:function(vt){return er(),Bt.getSupportedKeySystemMetadataFromContentProtection(vt,Qt,Cn)},handleKeySystemFromManifest:function(){if(!hn||hn.length===0)return;let vt=[];hn.forEach((nn=>{const Sn=Bt.getSupportedKeySystemMetadataFromContentProtection(nn.contentProtection,Qt,Cn);Sn.length>0&&(vt.length===0&&(vt=Sn),dt.push(Sn))})),vt&&vt.length>0&&Qn(vt,!0)},initializeForMedia:function(vt){if(!vt)throw new Error("mediaInfo can not be null or undefined");er(),hn.push(vt)},loadKeySession:Xn,removeKeySession:function(vt){er(),An.removeKeySession(vt)},reset:function(){tn.off(rn.INTERNAL_KEY_MESSAGE,Qr,vn),er(),Nr(),qr(null),$t=null,mn=!1,en=new Map,Fn=new Map,An&&(An.reset(),An=null),Wn.forEach((vt=>clearTimeout(vt))),Wn=[],hn=[],dt=[]},setKeySystems:function(vt){Bt&&Bt.setKeySystems(vt)},setMediaElement:qr,setProtectionData:function(vt){Qt=le.default.sanitizeProtectionDataCertUrls(vt),Bt.setProtectionData(Qt)},setRobustnessLevel:function(vt){Wt=vt},setServerCertificate:function(vt){return er(),An.setServerCertificate(vt)},setSessionType:function(vt){Cn=vt},stop:function(){Nr(),An&&An.stop()},updateKeyStatusesMap:function(vt){try{if(!vt||!vt.sessionToken||!vt.parsedKeyStatuses)return;vt.sessionToken.hasTriggeredKeyStatusMapUpdate=!0;const nn=vt.parsedKeyStatuses,Sn=de.default.parseUserAgent(),Re=Sn&&Sn.browser&&Sn.browser.name&&Sn.browser.name.toLowerCase()==="edge";nn.forEach((ut=>{Re&&$t.uuid===f.default.PLAYREADY_UUID&&ut.keyId&&ut.keyId.byteLength===16&&(function(At){const ct=de.default.bufferSourceToDataView(At),Ot=ct.getUint32(0,!0),dn=ct.getUint16(4,!0),Tn=ct.getUint16(6,!0);ct.setUint32(0,Ot,!1),ct.setUint16(4,dn,!1),ct.setUint16(6,Tn,!1)})(ut.keyId);const yt=de.default.bufferSourceToHex(ut.keyId).slice(0,32);yt&&yt!==""&&en.set(yt,ut.status)})),tn.trigger(rn.KEY_STATUSES_MAP_UPDATED,{keyStatusMap:en})}catch(nn){yn.error(nn)}}},yn=zt.getLogger(vn),dt=[],hn=[],Cn="temporary",Wt="",un=null,On=null,en=new Map,Fn=new Map,Ct=null,tn.on(rn.INTERNAL_KEY_MESSAGE,Qr,vn),vn}Be.__dashjs_factory_name="ProtectionController";var ot=De.default.getClassFactory(Be),Ge=class{constructor(xt,Ft){this.keyID=xt,this.key=Ft}},X=class{constructor(xt,Ft){if(Ft&&Ft!=="persistent"&&Ft!=="temporary")throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'");this.keyPairs=xt,this.type=Ft}toJWK(){let xt,Ft=this.keyPairs.length,Rt={keys:[]};for(xt=0;xt<Ft;xt++){let rn={kty:"oct",alg:"A128KW",kid:this.keyPairs[xt].keyID,k:this.keyPairs[xt].key};Rt.keys.push(rn)}this.type&&(Rt.type=this.type);let fe=JSON.stringify(Rt);const Ht=fe.length;let zt=new ArrayBuffer(Ht),tn=new Uint8Array(zt);for(xt=0;xt<Ht;xt++)tn[xt]=fe.charCodeAt(xt);return zt}};const Z=f.default.CLEARKEY_UUID,Se=f.default.CLEARKEY_KEYSTEM_STRING,Ne="urn:uuid:"+Z;function ke(xt){let Ft;const Rt=(xt=xt||{}).BASE64;return Ft={uuid:Z,schemeIdURI:Ne,systemString:Se,getInitData:function(fe,Ht){try{let zt=E.parseInitDataFromContentProtection(fe,Rt);if(!zt&&Ht){const tn={kids:[(function(rn){try{let Bt=rn.replace(/-/g,"");return Bt=btoa(Bt.match(/\w{2}/g).map((ft=>String.fromCharCode(parseInt(ft,16)))).join("")),Bt.replace(/=/g,"").replace(/\//g,"_").replace(/\+/g,"-")}catch{return null}})(Ht.cencDefaultKid)]};zt=new TextEncoder().encode(JSON.stringify(tn))}return zt}catch{return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(fe){return JSON.stringify(JSON.parse(String.fromCharCode.apply(null,new Uint8Array(fe))))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(fe,Ht){let zt=null;if(fe){const tn=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(Ht))),rn=[];for(let Bt=0;Bt<tn.kids.length;Bt++){const ft=tn.kids[Bt],Qt=fe.clearkeys&&fe.clearkeys.hasOwnProperty(ft)?fe.clearkeys[ft]:null;if(!Qt)throw new Error("DRM: ClearKey keyID ("+ft+") is not known!");rn.push(new Ge(ft,Qt))}zt=new X(rn)}return zt}},Ft}ke.__dashjs_factory_name="KeySystemClearKey";var ht=De.default.getSingletonFactory(ke);const ye=f.default.W3C_CLEARKEY_UUID,pt=f.default.CLEARKEY_KEYSTEM_STRING,He="urn:uuid:"+ye;function Fe(xt){let Ft;const Rt=xt.BASE64,fe=xt.debug.getLogger(Ft);return Ft={uuid:ye,schemeIdURI:He,systemString:pt,getInitData:function(Ht){return E.parseInitDataFromContentProtection(Ht,Rt)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(Ht){return new Uint8Array(Ht)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(Ht,zt){let tn=null;if(Ht){const rn=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(zt))),Bt=[];for(let ft=0;ft<rn.kids.length;ft++){const Qt=rn.kids[ft],Fn=Ht.clearkeys&&Ht.clearkeys.hasOwnProperty(Qt)?Ht.clearkeys[Qt]:null;if(!Fn)throw new Error("DRM: ClearKey keyID ("+Qt+") is not known!");Bt.push(new Ge(Qt,Fn))}tn=new X(Bt),fe.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 tn}},Ft}Fe.__dashjs_factory_name="KeySystemW3CClearKey";var Ke=De.default.getSingletonFactory(Fe);const Pt=f.default.WIDEVINE_UUID,Nt=f.default.WIDEVINE_KEYSTEM_STRING,kt="urn:uuid:"+Pt;function Ut(xt){let Ft;const Rt=(xt=xt||{}).BASE64;return Ft={uuid:Pt,schemeIdURI:kt,systemString:Nt,getInitData:function(fe){return E.parseInitDataFromContentProtection(fe,Rt)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(fe){return new Uint8Array(fe)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}},Ft}Ut.__dashjs_factory_name="KeySystemWidevine";var ln=De.default.getSingletonFactory(Ut);const an=f.default.PLAYREADY_UUID,En=f.default.PLAYREADY_KEYSTEM_STRING,Oe="urn:uuid:"+an;function Ie(xt){let Ft,Rt="utf-16";const fe=(xt=xt||{}).BASE64,Ht=xt.settings;function zt(){if(!fe||!fe.hasOwnProperty("decodeArray")||!fe.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}return Ft={uuid:an,schemeIdURI:Oe,systemString:En,getInitData:function(tn){const rn=new Uint8Array([112,115,115,104,0,0,0,0]),Bt=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);let ft,Qt,Fn,vn,en,mn=0,On=null;if(zt(),!tn)return null;if("pssh"in tn&&tn.pssh)return E.parseInitDataFromContentProtection(tn,fe);if("pro"in tn&&tn.pro)On=fe.decodeArray(tn.pro.__text);else{if(!("prheader"in tn)||!tn.prheader)return null;On=fe.decodeArray(tn.prheader.__text)}return ft=On.length,Qt=4+rn.length+Bt.length+4+ft,Fn=new ArrayBuffer(Qt),vn=new Uint8Array(Fn),en=new DataView(Fn),en.setUint32(mn,Qt),mn+=4,vn.set(rn,mn),mn+=rn.length,vn.set(Bt,mn),mn+=Bt.length,en.setUint32(mn,ft),mn+=4,vn.set(On,mn),mn+=ft,vn.buffer},getRequestHeadersFromMessage:function(tn){let rn,Bt;const ft={},Qt=new DOMParser;if(Ht&&Ht.get().streaming.protection.detectPlayreadyMessageFormat&&Rt==="utf-16"&&tn&&tn.byteLength%2==1)return ft["Content-Type"]="text/xml; charset=utf-8",ft;const Fn=Rt==="utf-16"?new Uint16Array(tn):new Uint8Array(tn);rn=String.fromCharCode.apply(null,Fn),Bt=Qt.parseFromString(rn,"application/xml");const vn=Bt.getElementsByTagName("name"),en=Bt.getElementsByTagName("value");for(let mn=0;mn<vn.length;mn++)ft[vn[mn].childNodes[0].nodeValue]=en[mn].childNodes[0].nodeValue;return ft.hasOwnProperty("Content")&&(ft["Content-Type"]=ft.Content,delete ft.Content),ft.hasOwnProperty("Content-Type")||(ft["Content-Type"]="text/xml; charset=utf-8"),ft},getLicenseRequestFromMessage:function(tn){let rn=null;const Bt=new DOMParser;if(Ht&&Ht.get().streaming.protection.detectPlayreadyMessageFormat&&Rt==="utf-16"&&tn&&tn.byteLength%2==1)return tn;const ft=Rt==="utf-16"?new Uint16Array(tn):new Uint8Array(tn);zt();const Qt=String.fromCharCode.apply(null,ft),Fn=Bt.parseFromString(Qt,"application/xml");if(!Fn.getElementsByTagName("PlayReadyKeyMessage")[0])return tn;{const vn=Fn.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;vn&&(rn=fe.decode(vn))}return rn},getLicenseServerURLFromInitData:function(tn){if(tn){const rn=new DataView(tn),Bt=rn.getUint16(4,!0);let ft=6;const Qt=new DOMParser;for(let Fn=0;Fn<Bt;Fn++){const vn=rn.getUint16(ft,!0);ft+=2;const en=rn.getUint16(ft,!0);if(ft+=2,vn!==1){ft+=en;continue}const mn=tn.slice(ft,ft+en),On=String.fromCharCode.apply(null,new Uint16Array(mn)),un=Qt.parseFromString(On,"application/xml");if(un.getElementsByTagName("LA_URL")[0]){const yn=un.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(yn)return yn}if(un.getElementsByTagName("LUI_URL")[0]){const yn=un.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(yn)return yn}}}return null},getCDMData:function(tn){let rn,Bt,ft,Qt;if(zt(),!tn)return null;for(rn=[],Qt=0;Qt<tn.length;++Qt)rn.push(tn.charCodeAt(Qt)),rn.push(0);for(rn=String.fromCharCode.apply(null,rn),rn=fe.encode(rn),Bt='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>'.replace("%CUSTOMDATA%",rn),ft=[],Qt=0;Qt<Bt.length;++Qt)ft.push(Bt.charCodeAt(Qt)),ft.push(0);return new Uint8Array(ft).buffer},setPlayReadyMessageFormat:function(tn){if(tn!=="utf-8"&&tn!=="utf-16")throw new Error('Specified message format is not one of "utf-8" or "utf-16"');Rt=tn}},Ft}Ie.__dashjs_factory_name="KeySystemPlayReady";var mt=De.default.getSingletonFactory(Ie);const It=f.default.FAIRPLAY_UUID,Ye=f.default.FAIRPLAY_KEYSTEM_STRING,V="urn:uuid:"+It;function B(){let xt;return xt={uuid:It,schemeIdURI:V,systemString:Ye,getInitData:function(){return null},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/octet-stream"}},getLicenseRequestFromMessage:function(Ft){return new Uint8Array(Ft)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}},xt}B.__dashjs_factory_name="KeySystemFairPlay";var Pe=De.default.getSingletonFactory(B);function j(xt){const Ft=(xt=xt||{}).BASE64,Rt={};let fe;return Rt[f.default.WIDEVINE_KEYSTEM_STRING]={responseType:"json",getLicenseMessage:function(Ht){return Ft.decodeArray(Ht.license)},getErrorResponse:function(Ht){return Ht}},Rt[f.default.PLAYREADY_KEYSTEM_STRING]={responseType:"arraybuffer",getLicenseMessage:function(Ht){return Ht},getErrorResponse:function(Ht){return String.fromCharCode.apply(null,new Uint8Array(Ht))}},fe={getServerURLFromMessage:function(Ht){return Ht},getHTTPMethod:function(){return"POST"},getResponseType:function(Ht){return Rt[Ht].responseType},getLicenseMessage:function(Ht,zt){return(function(){if(!Ft||!Ft.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")})(),Rt[zt].getLicenseMessage(Ht)},getErrorResponse:function(Ht,zt){return Rt[zt].getErrorResponse(Ht)}},fe}j.__dashjs_factory_name="DRMToday";var qe=De.default.getSingletonFactory(j);function it(){let xt;const Ft="http://schemas.xmlsoap.org/soap/envelope/";function Rt(zt){const tn=String.fromCharCode.apply(null,new Uint8Array(zt));return decodeURIComponent(escape(tn))}function fe(zt){if(window.DOMParser){const tn=Rt(zt),rn=new window.DOMParser().parseFromString(tn,"text/xml"),Bt=rn?rn.getElementsByTagNameNS(Ft,"Envelope")[0]:null,ft=Bt?Bt.getElementsByTagNameNS(Ft,"Body")[0]:null;if(ft&&ft.getElementsByTagNameNS(Ft,"Fault")[0])return null}return zt}function Ht(zt){let tn="",rn="",Bt="",ft=-1,Qt=-1;if(window.DOMParser){const vn=Rt(zt),en=new window.DOMParser().parseFromString(vn,"text/xml"),mn=en?en.getElementsByTagNameNS(Ft,"Envelope")[0]:null,On=mn?mn.getElementsByTagNameNS(Ft,"Body")[0]:null,un=On?On.getElementsByTagNameNS(Ft,"Fault")[0]:null,yn=un?un.getElementsByTagName("detail")[0]:null,hn=yn?yn.getElementsByTagName("Exception")[0]:null;let Ct=null;if(un===null)return vn;Ct=un.getElementsByTagName("faultstring")[0].firstChild,tn=Ct?Ct.nodeValue:null,hn!==null&&(Ct=hn.getElementsByTagName("StatusCode")[0],rn=Ct?Ct.firstChild.nodeValue:null,Ct=hn.getElementsByTagName("Message")[0],Bt=Ct?Ct.firstChild.nodeValue:null,ft=Bt?Bt.lastIndexOf("[")+1:-1,Qt=Bt?Bt.indexOf("]"):-1,Bt=Bt?Bt.substring(ft,Qt):"")}let Fn=`code: ${rn}, name: ${tn}`;return Bt&&(Fn+=`, message: ${Bt}`),Fn}return xt={getServerURLFromMessage:function(zt){return zt},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(zt){return fe.call(this,zt)},getErrorResponse:function(zt){return Ht.call(this,zt)}},xt}it.__dashjs_factory_name="PlayReady";var _e=De.default.getSingletonFactory(it);function Ue(){let xt;return xt={getServerURLFromMessage:function(Ft){return Ft},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(Ft){return Ft},getErrorResponse:function(Ft){return String.fromCharCode.apply(null,new Uint8Array(Ft))}},xt}Ue.__dashjs_factory_name="Widevine";var i=De.default.getSingletonFactory(Ue);function S(){let xt;function Ft(Rt){const fe=atob(Rt),Ht=new Uint8Array(fe.length);for(let zt=0;zt<fe.length;zt++)Ht[zt]=fe.charCodeAt(zt);return Ht.buffer}return xt={getErrorResponse:function(Rt){return String.fromCharCode.apply(null,new Uint8Array(Rt))},getHTTPMethod:function(){return"POST"},getLicenseMessage:function(Rt){if(!Rt||!Rt.byteLength)return Rt;let fe;try{fe=String.fromCharCode.apply(null,new Uint8Array(Rt))}catch{const zt=new Uint8Array(Rt);let tn="";for(let rn=0;rn<zt.length;rn++)tn+=String.fromCharCode(zt[rn]);fe=tn}if(!fe)return Rt;if(fe=fe.trim(),fe.substr(0,5)==="<ckc>"&&fe.substr(-6)==="</ckc>")return Ft(fe.slice(5,-6));try{const Ht=JSON.parse(fe),zt=Ht.ckc||Ht.CkcMessage||Ht.License;if(zt)return Ft(zt)}catch{}return/^[A-Za-z0-9+/\r\n]+=*$/.test(fe)&&fe.length>0?Ft(fe):Rt},getResponseType:function(){return"arraybuffer"},getServerURLFromMessage:function(Rt){return Rt}},xt}S.__dashjs_factory_name="FairPlay";var I=De.default.getSingletonFactory(S);function $(){let xt;return xt={getServerURLFromMessage:function(Ft){return Ft},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"json"},getLicenseMessage:function(Ft){if(!Ft.hasOwnProperty("keys"))return null;let Rt=[];for(let fe=0;fe<Ft.keys.length;fe++){let Ht=Ft.keys[fe],zt=Ht.kid.replace(/=/g,""),tn=Ht.k.replace(/=/g,"");Rt.push(new Ge(zt,tn))}return new X(Rt)},getErrorResponse:function(Ft){return String.fromCharCode.apply(null,new Uint8Array(Ft))}},xt}$.__dashjs_factory_name="ClearKey";var ie=De.default.getSingletonFactory($),be=class{constructor(xt){this.ks=xt.ks,this.keyId=xt.keyId,this.initData=xt.initData,this.protData=xt.protData,this.cdmData=xt.cdmData,this.sessionId=xt.sessionId,this.sessionType=xt.sessionType}};function tt(){let xt,Ft,Rt,fe,Ht,zt,tn,rn,Bt=this.context;function ft(en){for(let mn=0;mn<fe.length;mn++)if(fe[mn].systemString===en)return fe[mn];return null}function Qt(en,mn){return mn&&en in mn?mn[en]:null}function Fn(en,mn){return en&&en.sessionId?en.sessionId:mn&&mn.sessionId?mn.sessionId:null}function vn(en,mn){return en&&en.sessionType?en.sessionType:mn}return xt={getKeySystemBySystemString:ft,getKeySystems:function(){return fe},getLicenseServerModelInstance:function(en,mn,On){if(On===f.default.MEDIA_KEY_MESSAGE_TYPES.LICENSE_RELEASE||On===f.default.MEDIA_KEY_MESSAGE_TYPES.INDIVIDUALIZATION_REQUEST)return null;let un=null;return mn&&mn.hasOwnProperty("drmtoday")?un=qe(Bt).getInstance({BASE64:Ht}):en.systemString===f.default.WIDEVINE_KEYSTEM_STRING?un=i(Bt).getInstance():en.systemString===f.default.FAIRPLAY_KEYSTEM_STRING?un=I(Bt).getInstance():en.systemString===f.default.PLAYREADY_KEYSTEM_STRING?un=_e(Bt).getInstance():en.systemString===f.default.CLEARKEY_KEYSTEM_STRING&&(un=ie(Bt).getInstance()),un},getSupportedKeySystemMetadataForSinf:function(en,mn,On){const un=ft(f.default.FAIRPLAY_KEYSTEM_STRING);if(!un)return[];const yn=(function(Ct){if(!Ct||Ct.byteLength<12)return null;let dt;try{const Wt=String.fromCharCode.apply(null,new Uint8Array(Ct)),$t=JSON.parse(Wt);if($t.sinf&&$t.sinf.length>0){const Cn=atob($t.sinf[0]);dt=new Uint8Array(Cn.length);for(let An=0;An<Cn.length;An++)dt[An]=Cn.charCodeAt(An)}}catch{dt=new Uint8Array(Ct)}if(!dt||dt.length<12)return null;for(let Wt=0;Wt<dt.length-28;Wt++)if(dt[Wt]===116&&dt[Wt+1]===101&&dt[Wt+2]===110&&dt[Wt+3]===99){const $t=Wt+12;if($t+16>dt.length)return null;const Cn=dt.subarray($t,$t+16),An=Array.from(Cn).map((Wn=>Wn.toString(16).padStart(2,"0"))).join("");return An.slice(0,8)+"-"+An.slice(8,12)+"-"+An.slice(12,16)+"-"+An.slice(16,20)+"-"+An.slice(20,32)}return null})(en),hn=mn&&mn[f.default.FAIRPLAY_KEYSTEM_STRING]||null;return[{ks:un,keyId:yn,initData:en,protData:hn,cdmData:un.getCDMData(hn?hn.cdmData:null),sessionType:On}]},getSupportedKeySystemMetadataFromContentProtection:function(en,mn,On){let un,yn,hn,Ct,dt=[];if(!en||!en.length)return dt;const Wt=E.findMp4ProtectionElement(en);for(hn=0;hn<fe.length;hn++){yn=fe[hn];const $t=Qt(yn.systemString,mn);for(Ct=0;Ct<en.length;Ct++)if(un=en[Ct],un.schemeIdUri.toLowerCase()===yn.schemeIdURI){let Cn=yn.getInitData(un,Wt);const An=new be({ks:fe[hn],keyId:un.keyId,initData:Cn,protData:$t,cdmData:yn.getCDMData($t?$t.cdmData:null),sessionId:Fn($t,un),sessionType:vn($t,On)});$t?dt.unshift(An):dt.push(An)}}return dt},getSupportedKeySystemMetadataFromSegmentPssh:function(en,mn,On){let un,yn,hn=[],Ct=E.parsePSSHList(en);for(let dt=0;dt<fe.length;++dt){un=fe[dt],yn=un.systemString;const Wt=Qt(yn,mn);un.uuid in Ct&&hn.push({ks:un,initData:Ct[un.uuid],protData:Wt,cdmData:un.getCDMData(Wt?Wt.cdmData:null),sessionId:Fn(Wt),sessionType:vn(Wt,On)})}return hn},initDataEquals:function(en,mn){if(en.byteLength===mn.byteLength){let On=new Uint8Array(en),un=new Uint8Array(mn);for(let yn=0;yn<On.length;yn++)if(On[yn]!==un[yn])return!1;return!0}return!1},initialize:function(){let en;fe=[],en=mt(Bt).getInstance({BASE64:Ht,settings:zt}),fe.push(en),en=ln(Bt).getInstance({BASE64:Ht}),fe.push(en),en=Pe(Bt).getInstance(),fe.push(en),en=ht(Bt).getInstance({BASE64:Ht}),fe.push(en),tn=en,en=Ke(Bt).getInstance({BASE64:Ht,debug:Ft}),fe.push(en),rn=en},isClearKey:function(en){return en===tn||en===rn},processClearKeyLicenseRequest:function(en,mn,On){try{return en.getClearKeysFromProtectionData(mn,On)}catch{return Rt.error("Failed to retrieve clearkeys from ProtectionData"),null}},setConfig:function(en){en&&(en.debug&&(Ft=en.debug,Rt=Ft.getLogger(xt)),en.BASE64&&(Ht=en.BASE64),en.settings&&(zt=en.settings))},setKeySystems:function(en){fe=en},setProtectionData:function(en){for(var mn,On,un=0;un<fe.length;un++){var yn=fe[un];yn.hasOwnProperty("init")&&yn.init((mn=yn.systemString,On=void 0,On=null,en&&(On=mn in en?en[mn]:null),On))}}},xt}tt.__dashjs_factory_name="ProtectionKeyController";var ae=De.default.getSingletonFactory(tt),ze=P(445),je=class{constructor(xt,Ft){this.initData=xt,this.initDataType=Ft}},Y=class{constructor(xt,Ft,Rt,fe){this.sessionToken=xt,this.message=Ft,this.defaultURL=Rt,this.messageType=fe||f.default.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST}},he=class{constructor(xt,Ft){this.keySystem=xt,this.ksConfiguration=Ft,this.nativeMediaKeySystemAccessObject=null,this.selectedSystemString=null}};const et={};function at(xt){xt=xt||{};const Ft=this.context,Rt=xt.eventBus,fe=xt.events,Ht=xt.debug;let zt,tn,rn,Bt,ft,Qt,Fn,vn;function en(Ct,dt,Wt,$t){if(navigator.requestMediaKeySystemAccess===void 0||typeof navigator.requestMediaKeySystemAccess!="function"){const Qn="Insecure origins are not allowed";return Rt.trigger(fe.KEY_SYSTEM_ACCESS_COMPLETE,{error:Qn}),void $t({error:Qn})}const Cn=Ct[dt].protData&&Ct[dt].protData.systemStringPriority?Ct[dt].protData.systemStringPriority:null,An=Ct[dt].configs,Wn=Ct[dt].ks;let er=Wn.systemString;(function(Qn,qn){return new Promise(((tr,Zn)=>{mn(Qn,qn,0,tr,Zn)}))})(Cn||(et[er]?et[er]:[er]),An).then((Qn=>{const qn=Qn&&Qn.nativeMediaKeySystemAccessObject&&typeof Qn.nativeMediaKeySystemAccessObject.getConfiguration=="function"?Qn.nativeMediaKeySystemAccessObject.getConfiguration():null,tr=new he(Wn,qn);tr.selectedSystemString=Qn.selectedSystemString,tr.nativeMediaKeySystemAccessObject=Qn.nativeMediaKeySystemAccessObject,Rt.trigger(fe.KEY_SYSTEM_ACCESS_COMPLETE,{data:tr}),Wt({data:tr})})).catch((Qn=>{if(dt+1<Ct.length)en(Ct,dt+1,Wt,$t);else{const qn="Key system access denied! ";Rt.trigger(fe.KEY_SYSTEM_ACCESS_COMPLETE,{error:qn+Qn.message}),$t({error:qn+Qn.message})}}))}function mn(Ct,dt,Wt,$t,Cn){const An=Ct[Wt];tn.debug(`Requesting key system access for system string ${An}`),navigator.requestMediaKeySystemAccess(An,dt).then((Wn=>{$t({nativeMediaKeySystemAccessObject:Wn,selectedSystemString:An})})).catch((Wn=>{Wt+1<Ct.length?mn(Ct,dt,Wt+1,$t,Cn):Cn(Wn)}))}function On(Ct){if(!Ct||!Ct.session)return Promise.resolve;const dt=Ct.session;return dt.removeEventListener("keystatuseschange",Ct),dt.removeEventListener("message",Ct),dt.close()}function un(Ct){for(let dt=0;dt<Qt.length;dt++)if(Qt[dt]===Ct){Qt.splice(dt,1);break}}function yn(Ct,dt){const Wt={session:Ct,keyId:dt.keyId,normalizedKeyId:dt&&dt.keyId&&typeof dt.keyId=="string"?dt.keyId.replace(/-/g,"").toLowerCase():"",initData:dt.initData,sessionId:dt.sessionId,sessionType:dt.sessionType,hasTriggeredKeyStatusMapUpdate:!1,handleEvent:function($t){switch($t.type){case"keystatuseschange":this._onKeyStatusesChange($t);break;case"message":this._onKeyMessage($t)}},_onKeyStatusesChange:function($t){Rt.trigger(fe.KEY_STATUSES_CHANGED,{data:this});const Cn=[];$t.target.keyStatuses.forEach((function(){Cn.push(hn(arguments))})),Rt.trigger(fe.INTERNAL_KEY_STATUSES_CHANGED,{parsedKeyStatuses:Cn,sessionToken:Wt})},_onKeyMessage:function($t){let Cn=ArrayBuffer.isView($t.message)?$t.message.buffer:$t.message;Rt.trigger(fe.INTERNAL_KEY_MESSAGE,{data:new Y(this,Cn,void 0,$t.messageType)})},getKeyId:function(){return this.keyId},getSessionId:function(){return Ct.sessionId},getSessionType:function(){return this.sessionType},getExpirationTime:function(){return Ct.expiration},getKeyStatuses:function(){return Ct.keyStatuses},getUsable:function(){let $t=!1;return Ct.keyStatuses.forEach((function(){hn(arguments).status===f.default.MEDIA_KEY_STATUSES.USABLE&&($t=!0)})),$t}};return Ct.addEventListener("keystatuseschange",Wt),Ct.addEventListener("message",Wt),Ct.closed.then((()=>{un(Wt),tn.debug("DRM: Session closed. SessionID = "+Wt.getSessionId()),Rt.trigger(fe.KEY_SESSION_CLOSED,{data:Wt.getSessionId()})})),Qt.push(Wt),Wt}function hn(Ct){let dt,Wt;return Ct&&Ct.length>0&&(Ct[0]&&(typeof Ct[0]=="string"?dt=Ct[0]:Wt=Ct[0]),Ct[1]&&(typeof Ct[1]=="string"?dt=Ct[1]:Wt=Ct[1])),{status:dt,keyId:Wt}}return zt={closeKeySession:function(Ct){On(Ct).catch((function(dt){un(Ct),Rt.trigger(fe.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+Ct.getSessionId()+") "+dt.name})}))},createKeySession:function(Ct){if(!rn||!ft)throw new Error("Can not create sessions until you have selected a key system");const dt=ft.createSession(Ct.sessionType),Wt=yn(dt,Ct);let $t;$t=rn.systemString===f.default.CLEARKEY_KEYSTEM_STRING&&(Ct.initData||Ct.protData&&Ct.protData.clearkeys)?f.default.INITIALIZATION_DATA_TYPE_KEYIDS:rn.systemString===f.default.FAIRPLAY_KEYSTEM_STRING?f.default.INITIALIZATION_DATA_TYPE_SINF:f.default.INITIALIZATION_DATA_TYPE_CENC,dt.generateRequest($t,Ct.initData).then((function(){tn.debug("DRM: Session created. SessionID = "+Wt.getSessionId()),Rt.trigger(fe.KEY_SESSION_CREATED,{data:Wt})})).catch((function(Cn){un(Wt),Rt.trigger(fe.KEY_SESSION_CREATED,{data:null,error:new h.default(g.default.KEY_SESSION_CREATED_ERROR_CODE,g.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+Cn.name)})}))},getAllInitData:function(){const Ct=[];for(let dt=0;dt<Qt.length;dt++)Qt[dt].initData&&Ct.push(Qt[dt].initData);return Ct},getSessionTokens:function(){return Qt},loadKeySession:function(Ct){if(!rn||!ft)throw new Error("Can not load sessions until you have selected a key system");const dt=Ct.sessionId;for(let Cn=0;Cn<Qt.length;Cn++)if(dt===Qt[Cn].sessionId)return void tn.warn("DRM: Ignoring session ID because we have already seen it!");const Wt=ft.createSession(Ct.sessionType),$t=yn(Wt,Ct);$t.hasTriggeredKeyStatusMapUpdate=!0,Wt.load(dt).then((function(Cn){Cn?(tn.debug("DRM: Session loaded. SessionID = "+$t.getSessionId()),Rt.trigger(fe.KEY_SESSION_CREATED,{data:$t})):(un($t),Rt.trigger(fe.KEY_SESSION_CREATED,{data:null,error:new h.default(g.default.KEY_SESSION_CREATED_ERROR_CODE,g.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+dt+")")}))})).catch((function(Cn){un($t),Rt.trigger(fe.KEY_SESSION_CREATED,{data:null,error:new h.default(g.default.KEY_SESSION_CREATED_ERROR_CODE,g.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+dt+")! "+Cn.name)})}))},removeKeySession:function(Ct){Ct.session.remove().then((function(){tn.debug("DRM: Session removed. SessionID = "+Ct.getSessionId()),Rt.trigger(fe.KEY_SESSION_REMOVED,{data:Ct.getSessionId()})}),(function(dt){Rt.trigger(fe.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+Ct.getSessionId()+"). "+dt.name})}))},requestKeySystemAccess:function(Ct){return new Promise(((dt,Wt)=>{en(Ct,0,dt,Wt)}))},reset:function(){const Ct=Qt.length;let dt;if(Ct!==0){const Wt=function($t){un($t),Qt.length===0&&(Bt?(Bt.removeEventListener("encrypted",Fn),Bt.setMediaKeys(null).then((function(){Rt.trigger(fe.TEARDOWN_COMPLETE)}))):Rt.trigger(fe.TEARDOWN_COMPLETE))};for(let $t=0;$t<Ct;$t++)dt=Qt[$t],(function(Cn){On(dt),Wt(Cn)})(dt)}else Rt.trigger(fe.TEARDOWN_COMPLETE)},selectKeySystem:function(Ct){return new Promise(((dt,Wt)=>{Ct.nativeMediaKeySystemAccessObject.createMediaKeys().then(($t=>(rn=Ct.keySystem,ft=$t,Bt?Bt.setMediaKeys(ft):Promise.resolve()))).then((()=>{dt(rn)})).catch((function(){Wt({error:"Error selecting keys system ("+Ct.keySystem.systemString+")! Could not create MediaKeys -- TODO"})}))}))},setMediaElement:function(Ct){Bt!==Ct&&(Bt&&(Bt.removeEventListener("encrypted",Fn),Bt.setMediaKeys&&Bt.setMediaKeys(null)),Bt=Ct,Bt&&(Bt.addEventListener("encrypted",Fn),Bt.setMediaKeys&&ft&&Bt.setMediaKeys(ft)))},setServerCertificate:function(Ct){return new Promise(((dt,Wt)=>{ft.setServerCertificate(Ct).then((function(){tn.info("DRM: License server certificate successfully updated."),Rt.trigger(fe.SERVER_CERTIFICATE_UPDATED),dt()})).catch(($t=>{Wt($t),Rt.trigger(fe.SERVER_CERTIFICATE_UPDATED,{error:new h.default(g.default.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,g.default.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+$t.name)})}))}))},stop:function(){let Ct;for(let dt=0;dt<Qt.length;dt++)Ct=Qt[dt],Ct.getUsable()||(On(Ct),un(Ct))},updateKeySession:function(Ct,dt){const Wt=Ct.session;vn.isClearKey(rn)&&(dt=dt.toJWK()),Wt.update(dt).then((()=>{Rt.trigger(fe.KEY_SESSION_UPDATED)})).catch((function($t){Rt.trigger(fe.KEY_ERROR,{error:new h.default(g.default.MEDIA_KEYERR_CODE,"Error sending update() message! "+$t.name,Ct)})}))}},tn=Ht.getLogger(zt),rn=null,Bt=null,ft=null,Qt=[],vn=ae(Ft).getInstance(),Fn={handleEvent:function(Ct){if(Ct.type==="encrypted"&&Ct.initData){let dt=ArrayBuffer.isView(Ct.initData)?Ct.initData.buffer:Ct.initData;Rt.trigger(fe.NEED_KEY,{key:new je(dt,Ct.initDataType)})}}},zt}et[f.default.PLAYREADY_KEYSTEM_STRING]=[f.default.PLAYREADY_KEYSTEM_STRING,f.default.PLAYREADY_RECOMMENDATION_KEYSTEM_STRING],et[f.default.WIDEVINE_KEYSTEM_STRING]=[f.default.WIDEVINE_KEYSTEM_STRING],et[f.default.FAIRPLAY_KEYSTEM_STRING]=[f.default.FAIRPLAY_KEYSTEM_STRING],et[f.default.CLEARKEY_KEYSTEM_STRING]=[f.default.CLEARKEY_KEYSTEM_STRING],at.__dashjs_factory_name="DefaultProtectionModel";var Tt=De.default.getClassFactory(at);function st(xt){xt=xt||{};const Ft=this.context,Rt=xt.eventBus,fe=xt.events,Ht=xt.debug,zt=xt.api;let tn,rn,Bt,ft,Qt,Fn,vn,en,mn;function On(){try{for(let hn=0;hn<vn.length;hn++)un(vn[hn]);Bt&&Bt.removeEventListener(zt.needkey,en),Rt.trigger(fe.TEARDOWN_COMPLETE)}catch(hn){Rt.trigger(fe.TEARDOWN_COMPLETE,{error:"Error tearing down key sessions and MediaKeys! -- "+hn.message})}}function un(hn){const Ct=hn.session;Ct.removeEventListener(zt.error,hn),Ct.removeEventListener(zt.message,hn),Ct.removeEventListener(zt.ready,hn),Ct.removeEventListener(zt.close,hn);for(let dt=0;dt<vn.length;dt++)if(vn[dt]===hn){vn.splice(dt,1);break}Ct[zt.release]()}function yn(){let hn=null;const Ct=function(){Bt.removeEventListener("loadedmetadata",hn),Bt[zt.setMediaKeys](Qt),Rt.trigger(fe.VIDEO_ELEMENT_SELECTED)};Bt.readyState>=1?Ct():(hn=Ct.bind(this),Bt.addEventListener("loadedmetadata",hn))}return tn={getAllInitData:function(){const hn=[];for(let Ct=0;Ct<vn.length;Ct++)hn.push(vn[Ct].initData);return hn},getSessionTokens:function(){return vn},requestKeySystemAccess:function(hn){return new Promise(((Ct,dt)=>{let Wt=!1;for(let $t=0;$t<hn.length;$t++){const Cn=hn[$t].ks.systemString,An=hn[$t].configs;let Wn=null,er=null;for(let Qn=0;Qn<An.length;Qn++){const qn=An[Qn].audioCapabilities,tr=An[Qn].videoCapabilities;if(qn&&qn.length!==0){Wn=[];for(let Xn=0;Xn<qn.length;Xn++)window[zt.MediaKeys].isTypeSupported(Cn,qn[Xn].contentType)&&Wn.push(qn[Xn])}if(tr&&tr.length!==0){er=[];for(let Xn=0;Xn<tr.length;Xn++)window[zt.MediaKeys].isTypeSupported(Cn,tr[Xn].contentType)&&er.push(tr[Xn])}if(!Wn&&!er||Wn&&Wn.length===0||er&&er.length===0)continue;Wt=!0;const Zn=new w(Wn,er),ar=mn.getKeySystemBySystemString(Cn),dr=new he(ar,Zn);Rt.trigger(fe.KEY_SYSTEM_ACCESS_COMPLETE,{data:dr}),Ct({data:dr});break}}if(!Wt){const $t="Key system access denied! -- No valid audio/video content configurations detected!";Rt.trigger(fe.KEY_SYSTEM_ACCESS_COMPLETE,{error:$t}),dt({error:$t})}}))},selectKeySystem:function(hn){return new Promise(((Ct,dt)=>{try{Qt=hn.mediaKeys=new window[zt.MediaKeys](hn.keySystem.systemString),ft=hn.keySystem,Fn=hn,Bt&&yn(),Ct(ft)}catch{dt({error:"Error selecting keys system ("+ft.systemString+")! Could not create MediaKeys -- TODO"})}}))},setMediaElement:function(hn){Bt!==hn&&(Bt&&Bt.removeEventListener(zt.needkey,en),Bt=hn,Bt&&(Bt.addEventListener(zt.needkey,en),Qt&&yn()))},createKeySession:function(hn){if(!ft||!Qt||!Fn)throw new Error("Can not create sessions until you have selected a key system");let Ct=null;if(Fn.ksConfiguration.videoCapabilities&&Fn.ksConfiguration.videoCapabilities.length>0&&(Ct=Fn.ksConfiguration.videoCapabilities[0]),Ct===null&&Fn.ksConfiguration.audioCapabilities&&Fn.ksConfiguration.audioCapabilities.length>0&&(Ct=Fn.ksConfiguration.audioCapabilities[0]),Ct===null)throw new Error("Can not create sessions for unknown content types.");const dt=Ct.contentType,Wt=Qt.createSession(dt,new Uint8Array(hn.initData),hn.cdmData?new Uint8Array(hn.cdmData):null),$t=(function(Cn,An){return{session:Cn,keyId:An.keyId,normalizedKeyId:An&&An.keyId&&typeof An.keyId=="string"?An.keyId.replace(/-/g,"").toLowerCase():"",initData:An.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(Wn){switch(Wn.type){case zt.error:let er="KeyError";Rt.trigger(fe.KEY_ERROR,{error:new h.default(g.default.MEDIA_KEYERR_CODE,er,this)});break;case zt.message:let Qn=ArrayBuffer.isView(Wn.message)?Wn.message.buffer:Wn.message;Rt.trigger(fe.INTERNAL_KEY_MESSAGE,{data:new Y(this,Qn,Wn.destinationURL)});break;case zt.ready:rn.debug("DRM: Key added."),Rt.trigger(fe.KEY_ADDED);break;case zt.close:rn.debug("DRM: Session closed. SessionID = "+this.getSessionId()),Rt.trigger(fe.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}})(Wt,hn);Wt.addEventListener(zt.error,$t),Wt.addEventListener(zt.message,$t),Wt.addEventListener(zt.ready,$t),Wt.addEventListener(zt.close,$t),vn.push($t),rn.debug("DRM: Session created. SessionID = "+$t.getSessionId()),Rt.trigger(fe.KEY_SESSION_CREATED,{data:$t})},updateKeySession:function(hn,Ct){const dt=hn.session;mn.isClearKey(ft)?dt.update(new Uint8Array(Ct.toJWK())):dt.update(new Uint8Array(Ct)),Rt.trigger(fe.KEY_SESSION_UPDATED)},closeKeySession:un,setServerCertificate:function(){return Promise.resolve()},loadKeySession:function(){},removeKeySession:function(){},stop:On,reset:On},rn=Ht.getLogger(tn),Bt=null,ft=null,Qt=null,Fn=null,vn=[],mn=ae(Ft).getInstance(),en={handleEvent:function(hn){if(hn.type===zt.needkey&&hn.initData){const Ct=ArrayBuffer.isView(hn.initData)?hn.initData.buffer:hn.initData;Rt.trigger(fe.NEED_KEY,{key:new je(Ct,f.default.INITIALIZATION_DATA_TYPE_CENC)})}}},tn}st.__dashjs_factory_name="ProtectionModel_3Feb2014";var _t=De.default.getClassFactory(st);function Zt(xt){xt=xt||{};const Ft=this.context,Rt=xt.eventBus,fe=xt.events,Ht=xt.debug,zt=xt.api,tn=xt.errHandler;let rn,Bt,ft,Qt,Fn,vn,en,mn,On;function un(){ft&&Ct();for(let dt=0;dt<en.length;dt++)yn(en[dt]);Rt.trigger(fe.TEARDOWN_COMPLETE)}function yn(dt){try{ft[zt.cancelKeyRequest](Qt.systemString,dt.sessionId)}catch(Wt){Rt.trigger(fe.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+dt.sessionId+") "+Wt.message})}}function hn(dt,Wt){if(Wt&&dt){const $t=dt.length;for(let Cn=0;Cn<$t;Cn++)if(dt[Cn].sessionId==Wt)return dt[Cn];return null}return null}function Ct(){ft.removeEventListener(zt.keyerror,On),ft.removeEventListener(zt.needkey,On),ft.removeEventListener(zt.keymessage,On),ft.removeEventListener(zt.keyadded,On)}return rn={getAllInitData:function(){const dt=[];for(let Wt=0;Wt<vn.length;Wt++)dt.push(vn[Wt].initData);for(let Wt=0;Wt<en.length;Wt++)dt.push(en[Wt].initData);return dt},getSessionTokens:function(){return en.concat(vn)},requestKeySystemAccess:function(dt){return new Promise(((Wt,$t)=>{let Cn=ft;Cn||(Cn=document.createElement("video"));let An=!1;for(let Wn=0;Wn<dt.length;Wn++){const er=dt[Wn].ks.systemString,Qn=dt[Wn].configs;let qn=null,tr=null;for(let Zn=0;Zn<Qn.length;Zn++){const ar=Qn[Zn].videoCapabilities;if(ar&&ar.length!==0){tr=[];for(let hr=0;hr<ar.length;hr++)Cn.canPlayType(ar[hr].contentType,er)!==""&&tr.push(ar[hr])}if(!tr||qn||tr&&tr.length===0)continue;An=!0;const dr=new w(qn,tr),Xn=Fn.getKeySystemBySystemString(er),gr=new he(Xn,dr);Rt.trigger(fe.KEY_SYSTEM_ACCESS_COMPLETE,{data:gr}),Wt({data:gr});break}}if(!An){const Wn="Key system access denied! -- No valid audio/video content configurations detected!";Rt.trigger(fe.KEY_SYSTEM_ACCESS_COMPLETE,{error:Wn}),$t({error:Wn})}}))},selectKeySystem:function(dt){return Qt=dt.keySystem,Promise.resolve(Qt)},setMediaElement:function(dt){if(ft!==dt){if(ft){Ct();for(var Wt=0;Wt<en.length;Wt++)yn(en[Wt]);en=[]}ft=dt,ft&&(ft.addEventListener(zt.keyerror,On),ft.addEventListener(zt.needkey,On),ft.addEventListener(zt.keymessage,On),ft.addEventListener(zt.keyadded,On),Rt.trigger(fe.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(dt){if(!Qt)throw new Error("Can not create sessions until you have selected a key system");if(mn||en.length===0){const Wt={sessionId:null,keyId:dt.keyId,normalizedKeyId:dt&&dt.keyId&&typeof dt.keyId=="string"?dt.keyId.replace(/-/g,"").toLowerCase():"",initData:dt.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 vn.push(Wt),ft[zt.generateKeyRequest](Qt.systemString,new Uint8Array(dt.initData)),Wt}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(dt,Wt){const $t=dt.sessionId;if(Fn.isClearKey(Qt))for(let Cn=0;Cn<Wt.keyPairs.length;Cn++)ft[zt.addKey](Qt.systemString,Wt.keyPairs[Cn].key,Wt.keyPairs[Cn].keyID,$t);else ft[zt.addKey](Qt.systemString,new Uint8Array(Wt),new Uint8Array(dt.initData),$t);Rt.trigger(fe.KEY_SESSION_UPDATED)},closeKeySession:yn,setServerCertificate:function(){return Promise.resolve()},loadKeySession:function(){},removeKeySession:function(){},stop:un,reset:un},Bt=Ht.getLogger(rn),ft=null,Qt=null,vn=[],en=[],Fn=ae(Ft).getInstance(),On={handleEvent:function(dt){let Wt=null;switch(dt.type){case zt.needkey:let $t=ArrayBuffer.isView(dt.initData)?dt.initData.buffer:dt.initData;Rt.trigger(fe.NEED_KEY,{key:new je($t,f.default.INITIALIZATION_DATA_TYPE_CENC)});break;case zt.keyerror:if(Wt=hn(en,dt.sessionId),Wt||(Wt=hn(vn,dt.sessionId)),Wt){let Cn=g.default.MEDIA_KEYERR_CODE,An="";switch(dt.errorCode.code){case 1:Cn=g.default.MEDIA_KEYERR_UNKNOWN_CODE,An+="MEDIA_KEYERR_UNKNOWN - "+g.default.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:Cn=g.default.MEDIA_KEYERR_CLIENT_CODE,An+="MEDIA_KEYERR_CLIENT - "+g.default.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:Cn=g.default.MEDIA_KEYERR_SERVICE_CODE,An+="MEDIA_KEYERR_SERVICE - "+g.default.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:Cn=g.default.MEDIA_KEYERR_OUTPUT_CODE,An+="MEDIA_KEYERR_OUTPUT - "+g.default.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:Cn=g.default.MEDIA_KEYERR_HARDWARECHANGE_CODE,An+="MEDIA_KEYERR_HARDWARECHANGE - "+g.default.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:Cn=g.default.MEDIA_KEYERR_DOMAIN_CODE,An+="MEDIA_KEYERR_DOMAIN - "+g.default.MEDIA_KEYERR_DOMAIN_MESSAGE}An+=" System Code = "+dt.systemCode,Rt.trigger(fe.KEY_ERROR,{error:new h.default(Cn,An,Wt)})}else Bt.error("No session token found for key error");break;case zt.keyadded:Wt=hn(en,dt.sessionId),Wt||(Wt=hn(vn,dt.sessionId)),Wt?(Bt.debug("DRM: Key added."),Rt.trigger(fe.KEY_ADDED,{data:Wt})):Bt.debug("No session token found for key added");break;case zt.keymessage:if(mn=dt.sessionId!==null&&dt.sessionId!==void 0,mn?(Wt=hn(en,dt.sessionId),!Wt&&vn.length>0&&(Wt=vn.shift(),en.push(Wt),Wt.sessionId=dt.sessionId,Rt.trigger(fe.KEY_SESSION_CREATED,{data:Wt}))):vn.length>0&&(Wt=vn.shift(),en.push(Wt),vn.length!==0&&tn.error(new h.default(g.default.MEDIA_KEY_MESSAGE_ERROR_CODE,g.default.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),Wt){let Cn=ArrayBuffer.isView(dt.message)?dt.message.buffer:dt.message;Wt.keyMessage=Cn,Rt.trigger(fe.INTERNAL_KEY_MESSAGE,{data:new Y(Wt,Cn,dt.defaultURL)})}else Bt.warn("No session token found for key message")}}},rn}Zt.__dashjs_factory_name="ProtectionModel_01b";var In=De.default.getClassFactory(Zt);const Vt=[{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"}],_n=[{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 gn(){let xt;const Ft=this.context;function Rt(fe,Ht){for(let zt=0;zt<Ht.length;zt++){const tn=Ht[zt];if(typeof fe[tn[Object.keys(tn)[0]]]=="function")return tn}return null}return xt={createProtectionSystem:function(fe){let Ht=null;const zt=ae(Ft).getInstance();zt.setConfig({debug:fe.debug,BASE64:fe.BASE64,settings:fe.settings}),zt.initialize();let tn=(function(rn){const Bt=rn.debug,ft=Bt.getLogger(xt),Qt=rn.eventBus,Fn=rn.errHandler,vn=rn.videoModel?rn.videoModel.getElement():null;return vn&&vn.onencrypted===void 0||vn&&vn.mediaKeys===void 0?Rt(vn,_n)?(ft.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"),_t(Ft).create({debug:Bt,eventBus:Qt,events:rn.events,api:Rt(vn,_n)})):Rt(vn,Vt)?(ft.info("EME detected on this user agent! (ProtectionModel_01b)"),In(Ft).create({debug:Bt,eventBus:Qt,errHandler:Fn,events:rn.events,api:Rt(vn,Vt)})):(ft.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null):(ft.info("EME detected on this user agent! (DefaultProtectionModel"),Tt(Ft).create({debug:Bt,eventBus:Qt,events:rn.events}))})(fe);return tn&&(Ht=ot(Ft).create({BASE64:fe.BASE64,cmcdController:fe.cmcdController,constants:fe.constants,customParametersModel:fe.customParametersModel,debug:fe.debug,eventBus:fe.eventBus,events:fe.events,protectionKeyController:zt,protectionModel:tn,settings:fe.settings}),fe.capabilities.setEncryptedMediaSupported(!0)),Ht}},xt}gn.__dashjs_factory_name="Protection";const Jn=De.default.getClassFactory(gn);Jn.events=ze.default,Jn.errors=g.default,De.default.updateClassFactory(gn.__dashjs_factory_name,Jn);var Pn=Jn},445:function(wt,me,P){P.r(me);var F=P(7252);class f extends F.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 o=new f;me.default=o},1923:function(wt,me,P){P.r(me);var F=P(8748);class f extends F.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 o=new f;me.default=o},4246:function(wt,me,P){P.r(me);var F=P(138);const f={DEFAULT:.5,STRONG:1,WEAK:0};function o(E,_,w,g){let h,r,H,G,le;return r=E===void 0?null:E,H=(function(de){let De=f.DEFAULT;return de!==f.DEFAULT&&de!==f.STRONG&&de!==f.WEAK||(De=de),De})(w),G=_===void 0?null:_,le=g===void 0?null:g,h={representation:r,reason:G,rule:le,priority:H},h}o.__dashjs_factory_name="SwitchRequest";const p=F.default.getClassFactory(o);p.NO_CHANGE=null,p.PRIORITY=f,F.default.updateClassFactory(o.__dashjs_factory_name,p),me.default=p},559:function(wt,me,P){P.r(me),P.d(me,{supportsMediaSource:function(){return _}});var F=P(138),f=P(5212),o=P(2861),p=P(7393),E=P(649);function _(){let g="ManagedMediaSource"in window,h="WebKitMediaSource"in window,r="MediaSource"in window;return g||h||r}function w(){let g,h,r,H,G,le;const de=this.context,De=(0,p.default)(de).getInstance();function ce(X,Z){let Se;Z===f.default.VIDEO?Se=(function(ke){const ht={video:{}};return ke&&(ke.width&&(ht.video.width=ke.width),ke.height&&(ht.video.height=ke.height),ke.framerate&&(ht.video.framerate=parseFloat(ke.framerate)),ke.hdrMetadataType&&(ht.video.hdrMetadataType=ke.hdrMetadataType),ke.colorGamut&&(ht.video.colorGamut=ke.colorGamut),ke.transferFunction&&(ht.video.transferFunction=ke.transferFunction)),ht})(X):Z===f.default.AUDIO&&(Se=(function(ke){const ht={audio:{}};return ke.samplerate&&(ht.audio.samplerate=ke.samplerate),ke.channels&&(ht.audio.channels=ke.channels),ht})(X)),Se[Z].contentType=X.codec,Se[Z].bitrate=parseInt(X.bitrate),Se.type="media-source";let Ne=X.codec;return X.width&&X.height&&(Ne+=';width="'+X.width+'";height="'+X.height+'"'),Se.mediaSourceCodecString=Ne,(function(ke,ht,ye){if(!ht||!ht.keySystemsMetadata||ht.keySystemsMetadata.length===0)return[ke];const pt=[];return ht.keySystemsMetadata.forEach((He=>{if(!He.ks)return void pt.push({...ke});const Fe=He.protData&&He.protData.systemStringPriority?He.protData.systemStringPriority:null;let Ke=He.ks.systemString;(Fe||[Ke]).forEach((Pt=>{const Nt={...ke};Nt.keySystemConfiguration={},Pt&&(Nt.keySystemConfiguration.keySystem=Pt);let kt="";He.ks.systemString===o.default.WIDEVINE_KEYSTEM_STRING&&(kt=o.default.ROBUSTNESS_STRINGS.WIDEVINE.SW_SECURE_CRYPTO);const Ut=He.protData,ln=Ut&&Ut.audioRobustness&&Ut.audioRobustness.length>0?Ut.audioRobustness:kt,an=Ut&&Ut.videoRobustness&&Ut.videoRobustness.length>0?Ut.videoRobustness:kt;ye===f.default.AUDIO?Nt.keySystemConfiguration[ye]={robustness:ln}:ye===f.default.VIDEO&&(Nt.keySystemConfiguration[ye]={robustness:an}),pt.push(Nt)}))})),pt})(Se,X,Z)}function Le(X){return h.get().streaming.enhancement.codecs.some((Z=>X.includes(Z)))}function Be(X){if(H&&H.length!==0&&X)return H.find((Z=>{const Se=ot(X,Z,f.default.AUDIO),Ne=ot(X,Z,f.default.VIDEO),ke=ot(X,Z,"keySystemConfiguration");return Se&&Ne&&ke}))}function ot(X,Z,Se){return!X[Se]&&!Z[Se]||!(!X[Se]||!Z[Se])&&De.areEqual(X[Se],Z[Se])}function Ge(X,Z){return(X=X.filter((Se=>!(Se.schemeIdUri&&Z.some((Ne=>Ne.schemeIdUri===Se.schemeIdUri)))))).push(...Z),X}return g={areKeyIdsExpired:function(X){return!!(r&&X&&X.normalizedKeyIds&&X.normalizedKeyIds.size!==0)&&r.areKeyIdsExpired(X.normalizedKeyIds)},areKeyIdsUsable:function(X){return!(r&&X&&X.normalizedKeyIds&&X.normalizedKeyIds.size!==0)||r.areKeyIdsUsable(X.normalizedKeyIds)},isCodecSupportedBasedOnTestedConfigurations:function(X,Z){if(!X||!X.codec||X.isSupported===!1)return!1;const Se=ce(X,Z).map((Ne=>Be(Ne))).filter((Ne=>Ne!=null));return!(Se&&Se.length>0)||(function(Ne){return Ne.some((ke=>ke&&ke.decodingInfo&&ke.decodingInfo.supported))})(Se)},isProtectionCompatible:function(X,Z){return!Z||!(!X.isEncrypted&&Z.isEncrypted)},runCodecSupportCheck:function(X,Z){if(Z!==f.default.AUDIO&&Z!==f.default.VIDEO)return Promise.resolve();if(h.get().streaming.enhancement.enabled&&Le(X.codec))return H=H.filter((Ne=>!Le(Ne.mediaSourceCodecString))),Promise.resolve(!0);const Se=ce(X,Z);return(function(Ne,ke){return h.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(Ne.codec&&ke===f.default.AUDIO||ke===f.default.VIDEO&&Ne.codec&&Ne.width&&Ne.height&&Ne.bitrate&&Ne.framerate)})(X,Z)?(function(Ne){return new Promise((ke=>{if(!Ne||Ne.length===0)return void ke();const ht=Ne.map((ye=>(function(pt){return new Promise((He=>{Be(pt)?He():navigator.mediaCapabilities.decodingInfo(pt).then((Fe=>{pt.decodingInfo=Fe,H.push(pt),He()})).catch((Fe=>{pt.decodingInfo={supported:!1},H.push(pt),le.error(Fe),He()}))}))})(ye)));Promise.allSettled(ht).then((()=>{ke()})).catch((ye=>{le.error(ye),ke()}))}))})(Se):((function(Ne){if(!Ne||!Ne.length)return;const ke=Ne[0];if(Be(ke))return;let ht={supported:!1};("ManagedMediaSource"in window&&ManagedMediaSource.isTypeSupported(ke.mediaSourceCodecString)||"MediaSource"in window&&MediaSource.isTypeSupported(ke.mediaSourceCodecString)||"WebKitMediaSource"in window&&WebKitMediaSource.isTypeSupported(ke.mediaSourceCodecString))&&(ht.supported=!0),ke.decodingInfo=ht,H.push(ke)})(Se),Promise.resolve())},setConfig:function(X){X&&(X.settings&&(h=X.settings),X.protectionController&&(r=X.protectionController))},setEncryptedMediaSupported:function(X){G=X},setProtectionController:function(X){r=X},supportsChangeType:function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType},supportsEncryptedMedia:function(){return G},supportsEssentialProperty:function(X){let Z=h.get().streaming.capabilities.supportedEssentialProperties;h.get().streaming.capabilities.useMediaCapabilitiesApi&&h.get().streaming.capabilities.filterVideoColorimetryEssentialProperties&&(Z=Ge(Z,[{schemeIdUri:f.default.COLOUR_PRIMARIES_SCHEME_ID_URI},{schemeIdUri:f.default.MATRIX_COEFFICIENTS_SCHEME_ID_URI},{schemeIdUri:f.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI}])),h.get().streaming.capabilities.useMediaCapabilitiesApi&&h.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties&&(Z=Ge(Z,[{schemeIdUri:f.default.HDR_METADATA_FORMAT_SCHEME_ID_URI}]));try{return X.inArray(Z)}catch{return!0}},supportsMediaSource:_},G=!1,H=[],le=(0,E.default)(de).getInstance().getLogger(g),g}w.__dashjs_factory_name="Capabilities",me.default=F.default.getSingletonFactory(w)},1349:function(wt,me,P){function F(o){return o?(Array.isArray(o)?o:[o]).map((p=>{if(!p)return null;if(typeof p=="string"){const E=p.trim();return E?{url:E,certType:null}:null}if(typeof p=="object"){let E=(p.__text||p.text||"").trim();E||typeof p.url!="string"||(E=p.url.trim());let _=p.certType||p["@certType"]||null;return _&&typeof _=="string"?(_=_.trim(),_===""&&(_=null)):_=null,E?{url:E,certType:_}:null}return null})).filter(Boolean):[]}function f(o){if(!Array.isArray(o)||o.length===0)return[];const p=new Set,E=[];for(let _=0;_<o.length;_++){const w=o[_];if(!w||!w.url)continue;const g=w.url+"||"+(w.certType||"");p.has(g)||(p.add(g),E.push(w))}return E}P.r(me),me.default={normalizeCertUrls:F,dedupeCertUrls:f,sanitizeProtectionDataCertUrls:function(o){return o&&typeof o=="object"&&Object.keys(o).forEach((p=>{const E=o[p];E&&Array.isArray(E.certUrls)&&(E.certUrls=f(F(E.certUrls)))})),o}}},7377:function(wt,me,P){P.r(me);var F=P(138),f=P(656);function o(){return{customTimeRangeArray:[],length:0,add:function(p,E){let _;for(_=0;_<this.customTimeRangeArray.length&&p>this.customTimeRangeArray[_].start;_++);for(this.customTimeRangeArray.splice(_,0,{start:p,end:E}),_=0;_<this.customTimeRangeArray.length-1;_++)this.mergeRanges(_,_+1)&&_--;this.length=this.customTimeRangeArray.length},clear:function(){this.customTimeRangeArray=[],this.length=0},remove:function(p,E){for(let _=0;_<this.customTimeRangeArray.length;_++)if(p<=this.customTimeRangeArray[_].start&&E>=this.customTimeRangeArray[_].end)this.customTimeRangeArray.splice(_,1),_--;else{if(p>this.customTimeRangeArray[_].start&&E<this.customTimeRangeArray[_].end){this.customTimeRangeArray.splice(_+1,0,{start:E,end:this.customTimeRangeArray[_].end}),this.customTimeRangeArray[_].end=p;break}p>this.customTimeRangeArray[_].start&&p<this.customTimeRangeArray[_].end?this.customTimeRangeArray[_].end=p:E>this.customTimeRangeArray[_].start&&E<this.customTimeRangeArray[_].end&&(this.customTimeRangeArray[_].start=E)}this.length=this.customTimeRangeArray.length},mergeRanges:function(p,E){let _=this.customTimeRangeArray[p],w=this.customTimeRangeArray[E];return _.start<=w.start&&w.start<=_.end&&_.end<=w.end?(_.end=w.end,this.customTimeRangeArray.splice(E,1),!0):w.start<=_.start&&_.start<=w.end&&w.end<=_.end?(_.start=w.start,this.customTimeRangeArray.splice(E,1),!0):w.start<=_.start&&_.start<=w.end&&_.end<=w.end?(this.customTimeRangeArray.splice(p,1),!0):_.start<=w.start&&w.start<=_.end&&w.end<=_.end&&(this.customTimeRangeArray.splice(E,1),!0)},start:function(p){return(0,f.checkInteger)(p),p>=this.customTimeRangeArray.length||p<0?NaN:this.customTimeRangeArray[p].start},end:function(p){return(0,f.checkInteger)(p),p>=this.customTimeRangeArray.length||p<0?NaN:this.customTimeRangeArray[p].end}}}o.__dashjs_factory_name="CustomTimeRanges",me.default=F.default.getClassFactory(o)},9026:function(wt,me,P){P.r(me);var F=P(138);function f(){let o;const p=/^[a-z][a-z0-9+\-_.]*:/i,E=/^https?:\/\//i,_=/^https:\/\//i,w=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i,g=(ce,Le)=>{try{return new window.URL(ce,Le).toString()}catch{return ce}},h=(ce,Le)=>{let Be=r;if(!Le||!le(ce))return ce;de(ce)&&(Be=H),De(ce)&&(Be=G);const ot=Be(Le),Ge=ot.charAt(ot.length-1)!=="/"&&ce.charAt(0)!=="/"?"/":"";return[ot,ce].join(Ge)};function r(ce){const Le=ce.indexOf("/"),Be=ce.lastIndexOf("/");return Le!==-1?Be===Le+1?ce:(ce.indexOf("?")!==-1&&(ce=ce.substring(0,ce.indexOf("?"))),ce.substring(0,Be+1)):""}function H(ce){const Le=ce.match(w);return Le?Le[1]:""}function G(ce){const Le=ce.match(p);return Le?Le[0]:""}function le(ce){return!p.test(ce)}function de(ce){return le(ce)&&ce.charAt(0)==="/"}function De(ce){return ce.indexOf("//")===0}return(function(){try{new window.URL("x","http://y"),o=g}catch{}finally{o=o||h}})(),{parseBaseUrl:r,parseOrigin:H,parseScheme:G,isRelative:le,isPathAbsolute:de,isSchemeRelative:De,isHTTPURL:function(ce){return E.test(ce)},isHTTPS:function(ce){return _.test(ce)},removeHostname:function(ce){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(ce)[2].substring(1)},resolve:function(ce,Le){return o(ce,Le)}}}f.__dashjs_factory_name="DefaultURLUtils",me.default=F.default.getSingletonFactory(f)},7393:function(wt,me,P){P.r(me);var F=P(138),f=P(7316);function o(){let p;return p={areEqual:function(E,_){return f(E,_)}},p}o.__dashjs_factory_name="ObjectUtils",me.default=F.default.getSingletonFactory(o)},656:function(wt,me,P){P.r(me),P.d(me,{checkInteger:function(){return o},checkIsVideoOrAudioType:function(){return E},checkParameterType:function(){return f},checkRange:function(){return p}});var F=P(5212);function f(_,w){if(typeof _!==w)throw F.default.BAD_ARGUMENT_ERROR}function o(_){if(_===null||isNaN(_)||_%1!=0)throw F.default.BAD_ARGUMENT_ERROR+" : argument is not an integer"}function p(_,w,g){if(_<w||_>g)throw F.default.BAD_ARGUMENT_ERROR+" : argument out of range"}function E(_){if(typeof _!="string"||_!==F.default.AUDIO&&_!==F.default.VIDEO)throw F.default.BAD_ARGUMENT_ERROR}},6503:function(wt,me,P){P.r(me);var F=P(138),f=P(9026);function o(){let E,_,w=[];const g=this.context;function h(r,H,G){let le=(function(de){let De;for(De=0;De<w.length;De++)if(w[De].regex.test(de))return w[De].utils;return _})(G||H);return le&&typeof le[r]=="function"?le[r](H,G):_[r](H,G)}return _=(0,f.default)(g).getInstance(),E={registerUrlRegex:function(r,H){w.push({regex:r,utils:H})},parseBaseUrl:function(r){return h("parseBaseUrl",r)},parseOrigin:function(r){return h("parseOrigin",r)},parseScheme:function(r){return h("parseScheme",r)},isRelative:function(r){return h("isRelative",r)},isPathAbsolute:function(r){return h("isPathAbsolute",r)},isSchemeRelative:function(r){return h("isSchemeRelative",r)},isHTTPURL:function(r){return h("isHTTPURL",r)},isHTTPS:function(r){return h("isHTTPS",r)},removeHostname:function(r){return h("removeHostname",r)},resolve:function(r,H){return h("resolve",r,H)}},E}o.__dashjs_factory_name="URLUtils";const p=F.default.getSingletonFactory(o);me.default=p},1613:function(wt,me,P){P.r(me);var F=P(2842);class f extends F.default{constructor(p){super(),this.method=p||null}}me.default=f},447:function(wt,me,P){P.r(me),me.default=class{constructor(F){this.url=F.url,this.method=F.method,this.body=F.body!==void 0?F.body:null,this.responseType=F.responseType!==void 0?F.responseType:null,this.headers=F.headers!==void 0?F.headers:{},this.credentials=F.credentials!==void 0?F.credentials:null,this.mode=F.mode!==void 0?F.mode:null,this.timeout=F.timeout!==void 0?F.timeout:0,this.customData=F.customData!==void 0?F.customData:{}}}},5099:function(wt,me,P){P.r(me),me.default=class{constructor(F){this.request=F.request,this.url=F.url!==void 0?F.url:null,this.redirected=F.redirected!==void 0&&F.redirected,this.status=F.status!==void 0?F.status:null,this.statusText=F.statusText!==void 0?F.statusText:"",this.type=F.type!==void 0?F.type:"",this.headers=F.headers!==void 0?F.headers:{},this.data=F.data!==void 0?F.data:null,this.resourceTiming=F.resourceTiming!==void 0?F.resourceTiming:null}}},1944:function(wt,me,P){P.r(me),me.default=class{constructor(F,f,o){this.code=F||null,this.message=f||null,this.data=o||null}}},5560:function(wt,me,P){P.r(me);var F=P(8854);me.default=class{constructor(f){this.id=f.id,this.url=f.url,this.language=f.language,this.mimeType=f.mimeType,this.bandwidth=f.bandwidth,this.periodId=f.periodId||null}serializeToMpdParserFormat(){return{tagName:F.default.ADAPTATION_SET,mimeType:this.mimeType,lang:this.language,Representation:[{tagName:F.default.REPRESENTATION,id:this.id,bandwidth:this.bandwidth,BaseURL:[{tagName:F.default.BASE_URL,__text:this.url}],mimeType:this.mimeType}]}}}},2842:function(wt,me,P){P.r(me);var F=P(7568);class f{constructor(p){this.action=f.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=p||null,this.wallStartTime=null}isInitializationRequest(){return this.type&&this.type===F.HTTPRequest.INIT_SEGMENT_TYPE}setInfo(p){this.type=p&&p.init?F.HTTPRequest.INIT_SEGMENT_TYPE:F.HTTPRequest.MEDIA_SEGMENT_TYPE,this.url=p&&p.url?p.url:null,this.range=p&&p.range?p.range.start+"-"+p.range.end:null,this.mediaType=p&&p.mediaType?p.mediaType:null,this.representation=p&&p.representation?p.representation:null}}f.ACTION_DOWNLOAD="download",f.ACTION_COMPLETE="complete",me.default=f},7568:function(wt,me,P){P.r(me),P.d(me,{HTTPRequest:function(){return F},HTTPRequestTrace:function(){return f}});class F{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 f{constructor(){this.s=null,this.d=null,this.b=[]}}F.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",F.CONTENT_STEERING_TYPE="ContentSteering",F.DVB_REPORTING_TYPE="DVBReporting",F.GET="GET",F.POST="POST",F.HEAD="HEAD",F.INDEX_SEGMENT_TYPE="IndexSegment",F.INIT_SEGMENT_TYPE="InitializationSegment",F.LICENSE="license",F.LICENSE_CERTIFICATE="licenseCertificate",F.MEDIA_SEGMENT_TYPE="MediaSegment",F.MPD_TYPE="MPD",F.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",F.CMCD_EVENT="CmcdEvent",F.OTHER_TYPE="other",F.XLINK_EXPANSION_TYPE="XLinkExpansion"}},bs={};function cr(wt){var me=bs[wt];if(me!==void 0)return me.exports;var P=bs[wt]={exports:{}};return Yl[wt](P,P.exports,cr),P.exports}cr.d=function(wt,me){for(var P in me)cr.o(me,P)&&!cr.o(wt,P)&&Object.defineProperty(wt,P,{enumerable:!0,get:me[P]})},cr.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})(),cr.o=function(wt,me){return Object.prototype.hasOwnProperty.call(wt,me)},cr.r=function(wt){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(wt,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(wt,"__esModule",{value:!0})};var Ar={};cr.r(Ar),cr.d(Ar,{Constants:function(){return Ps.default},Debug:function(){return ws.default},ExternalSubtitle:function(){return Ls.default},MediaPlayer:function(){return Br.MediaPlayer},MediaPlayerFactory:function(){return Ms},MetricsReporting:function(){return Ds.default},Protection:function(){return vs.default},default:function(){return ql},supportsMediaSource:function(){return Os.supportsMediaSource}});var Br=cr(5393),Ds=cr(4469),vs=cr(7037),Vl=cr(9839);let Si=(function(){const wt="application/dash+xml";let me;function P(f,o,p){if(!f||!/^VIDEO$/i.test(f.nodeName))return null;if(f._dashjs_player)return f._dashjs_player;let E,_=f.id||f.name||"video element";if(!(o=o||[].slice.call(f.querySelectorAll("source")).filter((function(w){return w.type==wt}))[0])&&f.src)(o=document.createElement("source")).src=f.src;else if(!o&&!f.src)return null;return p=p||{},E=(0,Vl.default)(p).create(),E.initialize(f,o.src,f.autoplay),me||(me=E.getDebug().getLogger()),me.debug("Converted "+_+" to dash.js player and added content: "+o.src),f._dashjs_player=E,E}function F(f){return/^VIDEO$/i.test(f.nodeName)?f:F(f.parentNode)}return{create:P,createAll:function(f,o){let p=[];f=f||"[data-dashjs-player]";let E=(o=o||document).querySelectorAll(f);for(let w=0;w<E.length;w++){let g=P(E[w],null);p.push(g)}let _=o.querySelectorAll('source[type="'+wt+'"]');for(let w=0;w<_.length;w++){let g=P(F(_[w]),null);p.push(g)}return p}}})();if(typeof window<"u"&&window){let me=function(){window.removeEventListener("load",me),Si.createAll()},P=function(){window.dashjs&&(window.clearInterval(wt),Si.createAll())},wt;(!window.dashjs||!window.dashjs.skipAutoCreate)&&window.addEventListener&&(window.document.readyState==="complete"?window.dashjs?Si.createAll():wt=window.setInterval(P,500):window.addEventListener("load",me))}var Ms=Si,ws=cr(649),Ps=cr(5212),Os=cr(559),Ls=cr(5560);Br.default.Protection=vs.default,Br.default.MetricsReporting=Ds.default,Br.default.MediaPlayerFactory=Ms,Br.default.Debug=ws.default,Br.default.supportsMediaSource=Os.supportsMediaSource,Br.default.Constants=Ps.default,Br.default.ExternalSubtitle=Ls.default;var ql=Br.default,Kl=Ar.Constants,jl=Ar.Debug,Wl=Ar.ExternalSubtitle,zl=Ar.MediaPlayer,$l=Ar.MediaPlayerFactory,Ql=Ar.MetricsReporting,Xl=Ar.Protection,Zl=Ar.default,Jl=Ar.supportsMediaSource;export{Kl as Constants,jl as Debug,Wl as ExternalSubtitle,zl as MediaPlayer,$l as MediaPlayerFactory,Ql as MetricsReporting,Xl as Protection,Zl as default,Jl as supportsMediaSource};
//# sourceMappingURL=dash.all.min-C9gxBrL1.js.map