diff --git "a/assets/dashjs-Cg4q_uGU.js" "b/assets/dashjs-Cg4q_uGU.js" new file mode 100644--- /dev/null +++ "b/assets/dashjs-Cg4q_uGU.js" @@ -0,0 +1,21 @@ +/*! For license information please see dash.all.min.js.LICENSE.txt */var cd={7267:function(Nt,Fe){Fe.byteLength=function(q){var oe=re(q),ee=oe[0],W=oe[1];return 3*(ee+W)/4-W},Fe.toByteArray=function(q){var oe,ee,W=re(q),le=W[0],D=W[1],ce=new z(function(we,De,Be){return 3*(De+Be)/4-Be}(0,le,D)),Ee=0,Ae=D>0?le-4:le;for(ee=0;ee>16&255,ce[Ee++]=oe>>8&255,ce[Ee++]=255&oe;return D===2&&(oe=be[q.charCodeAt(ee)]<<2|be[q.charCodeAt(ee+1)]>>4,ce[Ee++]=255&oe),D===1&&(oe=be[q.charCodeAt(ee)]<<10|be[q.charCodeAt(ee+1)]<<4|be[q.charCodeAt(ee+2)]>>2,ce[Ee++]=oe>>8&255,ce[Ee++]=255&oe),ce},Fe.fromByteArray=function(q){for(var oe,ee=q.length,W=ee%3,le=[],D=16383,ce=0,Ee=ee-W;ceEe?Ee:ce+D));return W===1?(oe=q[ee-1],le.push(de[oe>>2]+de[oe<<4&63]+"==")):W===2&&(oe=(q[ee-2]<<8)+q[ee-1],le.push(de[oe>>10]+de[oe>>4&63]+de[oe<<2&63]+"=")),le.join("")};for(var de=[],be=[],z=typeof Uint8Array<"u"?Uint8Array:Array,T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",O=0;O<64;++O)de[O]=T[O],be[T.charCodeAt(O)]=O;function re(q){var oe=q.length;if(oe%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var ee=q.indexOf("=");return ee===-1&&(ee=oe),[ee,ee===oe?0:4-ee%4]}function F(q,oe,ee){for(var W,le,D=[],ce=oe;ce>18&63]+de[le>>12&63]+de[le>>6&63]+de[63&le]);return D.join("")}be[45]=62,be[95]=63},44:function(Nt,Fe,de){var be=de(7267),z=de(7986),T=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Fe.Buffer=F,Fe.SlowBuffer=function(I){return+I!=I&&(I=0),F.alloc(+I)},Fe.INSPECT_MAX_BYTES=50;var O=2147483647;function re(I){if(I>O)throw new RangeError('The value "'+I+'" is invalid for option "size"');var R=new Uint8Array(I);return Object.setPrototypeOf(R,F.prototype),R}function F(I,R,d){if(typeof I=="number"){if(typeof R=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ee(I)}return q(I,R,d)}function q(I,R,d){if(typeof I=="string")return function(x,Te){if(typeof Te=="string"&&Te!==""||(Te="utf8"),!F.isEncoding(Te))throw new TypeError("Unknown encoding: "+Te);var Le=0|ce(x,Te),Re=re(Le),ze=Re.write(x,Te);return ze!==Le&&(Re=Re.slice(0,ze)),Re}(I,R);if(ArrayBuffer.isView(I))return function(x){if(ye(x,Uint8Array)){var Te=new Uint8Array(x);return le(Te.buffer,Te.byteOffset,Te.byteLength)}return W(x)}(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(ye(I,ArrayBuffer)||I&&ye(I.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ye(I,SharedArrayBuffer)||I&&ye(I.buffer,SharedArrayBuffer)))return le(I,R,d);if(typeof I=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var y=I.valueOf&&I.valueOf();if(y!=null&&y!==I)return F.from(y,R,d);var X=function(x){if(F.isBuffer(x)){var Te=0|D(x.length),Le=re(Te);return Le.length===0||x.copy(Le,0,0,Te),Le}return x.length!==void 0?typeof x.length!="number"||_e(x.length)?re(0):W(x):x.type==="Buffer"&&Array.isArray(x.data)?W(x.data):void 0}(I);if(X)return X;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof I[Symbol.toPrimitive]=="function")return F.from(I[Symbol.toPrimitive]("string"),R,d);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I)}function oe(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 ee(I){return oe(I),re(I<0?0:0|D(I))}function W(I){for(var R=I.length<0?0:0|D(I.length),d=re(R),y=0;y=O)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+O.toString(16)+" bytes");return 0|I}function ce(I,R){if(F.isBuffer(I))return I.length;if(ArrayBuffer.isView(I)||ye(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);var d=I.length,y=arguments.length>2&&arguments[2]===!0;if(!y&&d===0)return 0;for(var X=!1;;)switch(R){case"ascii":case"latin1":case"binary":return d;case"utf8":case"utf-8":return cn(I).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*d;case"hex":return d>>>1;case"base64":return sn(I).length;default:if(X)return y?-1:cn(I).length;R=(""+R).toLowerCase(),X=!0}}function Ee(I,R,d){var y=!1;if((R===void 0||R<0)&&(R=0),R>this.length||((d===void 0||d>this.length)&&(d=this.length),d<=0)||(d>>>=0)<=(R>>>=0))return"";for(I||(I="utf8");;)switch(I){case"hex":return Ut(this,R,d);case"utf8":case"utf-8":return L(this,R,d);case"ascii":return Ze(this,R,d);case"latin1":case"binary":return se(this,R,d);case"base64":return me(this,R,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $e(this,R,d);default:if(y)throw new TypeError("Unknown encoding: "+I);I=(I+"").toLowerCase(),y=!0}}function Ae(I,R,d){var y=I[R];I[R]=I[d],I[d]=y}function we(I,R,d,y,X){if(I.length===0)return-1;if(typeof d=="string"?(y=d,d=0):d>2147483647?d=2147483647:d<-2147483648&&(d=-2147483648),_e(d=+d)&&(d=X?0:I.length-1),d<0&&(d=I.length+d),d>=I.length){if(X)return-1;d=I.length-1}else if(d<0){if(!X)return-1;d=0}if(typeof R=="string"&&(R=F.from(R,y)),F.isBuffer(R))return R.length===0?-1:De(I,R,d,y,X);if(typeof R=="number")return R&=255,typeof Uint8Array.prototype.indexOf=="function"?X?Uint8Array.prototype.indexOf.call(I,R,d):Uint8Array.prototype.lastIndexOf.call(I,R,d):De(I,[R],d,y,X);throw new TypeError("val must be string, number or Buffer")}function De(I,R,d,y,X){var x,Te=1,Le=I.length,Re=R.length;if(y!==void 0&&((y=String(y).toLowerCase())==="ucs2"||y==="ucs-2"||y==="utf16le"||y==="utf-16le")){if(I.length<2||R.length<2)return-1;Te=2,Le/=2,Re/=2,d/=2}function ze(qe,at){return Te===1?qe[at]:qe.readUInt16BE(at*Te)}if(X){var ve=-1;for(x=d;xLe&&(d=Le-Re),x=d;x>=0;x--){for(var Pe=!0,Xe=0;XeX&&(y=X):y=X;var x=R.length;y>x/2&&(y=x/2);for(var Te=0;Te>8,Re=Te%256,ze.push(Re),ze.push(Le);return ze}(R,I.length-d),I,d,y)}function me(I,R,d){return R===0&&d===I.length?be.fromByteArray(I):be.fromByteArray(I.slice(R,d))}function L(I,R,d){d=Math.min(I.length,d);for(var y=[],X=R;X239?4:ze>223?3:ze>191?2:1;if(X+Pe<=d)switch(Pe){case 1:ze<128&&(ve=ze);break;case 2:(192&(x=I[X+1]))==128&&(Re=(31&ze)<<6|63&x)>127&&(ve=Re);break;case 3:x=I[X+1],Te=I[X+2],(192&x)==128&&(192&Te)==128&&(Re=(15&ze)<<12|(63&x)<<6|63&Te)>2047&&(Re<55296||Re>57343)&&(ve=Re);break;case 4:x=I[X+1],Te=I[X+2],Le=I[X+3],(192&x)==128&&(192&Te)==128&&(192&Le)==128&&(Re=(15&ze)<<18|(63&x)<<12|(63&Te)<<6|63&Le)>65535&&Re<1114112&&(ve=Re)}ve===null?(ve=65533,Pe=1):ve>65535&&(ve-=65536,y.push(ve>>>10&1023|55296),ve=56320|1023&ve),y.push(ve),X+=Pe}return function(Xe){var qe=Xe.length;if(qe<=pe)return String.fromCharCode.apply(String,Xe);for(var at="",Bt=0;Bt"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(F.prototype,"parent",{enumerable:!0,get:function(){if(F.isBuffer(this))return this.buffer}}),Object.defineProperty(F.prototype,"offset",{enumerable:!0,get:function(){if(F.isBuffer(this))return this.byteOffset}}),F.poolSize=8192,F.from=function(I,R,d){return q(I,R,d)},Object.setPrototypeOf(F.prototype,Uint8Array.prototype),Object.setPrototypeOf(F,Uint8Array),F.alloc=function(I,R,d){return function(y,X,x){return oe(y),y<=0?re(y):X!==void 0?typeof x=="string"?re(y).fill(X,x):re(y).fill(X):re(y)}(I,R,d)},F.allocUnsafe=function(I){return ee(I)},F.allocUnsafeSlow=function(I){return ee(I)},F.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==F.prototype},F.compare=function(I,R){if(ye(I,Uint8Array)&&(I=F.from(I,I.offset,I.byteLength)),ye(R,Uint8Array)&&(R=F.from(R,R.offset,R.byteLength)),!F.isBuffer(I)||!F.isBuffer(R))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===R)return 0;for(var d=I.length,y=R.length,X=0,x=Math.min(d,y);Xy.length?F.from(x).copy(y,X):Uint8Array.prototype.set.call(y,x,X);else{if(!F.isBuffer(x))throw new TypeError('"list" argument must be an Array of Buffers');x.copy(y,X)}X+=x.length}return y},F.byteLength=ce,F.prototype._isBuffer=!0,F.prototype.swap16=function(){var I=this.length;if(I%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var R=0;RR&&(I+=" ... "),""},T&&(F.prototype[T]=F.prototype.inspect),F.prototype.compare=function(I,R,d,y,X){if(ye(I,Uint8Array)&&(I=F.from(I,I.offset,I.byteLength)),!F.isBuffer(I))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(R===void 0&&(R=0),d===void 0&&(d=I?I.length:0),y===void 0&&(y=0),X===void 0&&(X=this.length),R<0||d>I.length||y<0||X>this.length)throw new RangeError("out of range index");if(y>=X&&R>=d)return 0;if(y>=X)return-1;if(R>=d)return 1;if(this===I)return 0;for(var x=(X>>>=0)-(y>>>=0),Te=(d>>>=0)-(R>>>=0),Le=Math.min(x,Te),Re=this.slice(y,X),ze=I.slice(R,d),ve=0;ve>>=0,isFinite(d)?(d>>>=0,y===void 0&&(y="utf8")):(y=d,d=void 0)}var X=this.length-R;if((d===void 0||d>X)&&(d=X),I.length>0&&(d<0||R<0)||R>this.length)throw new RangeError("Attempt to write outside buffer bounds");y||(y="utf8");for(var x=!1;;)switch(y){case"hex":return Be(this,I,R,d);case"utf8":case"utf-8":return ct(this,I,R,d);case"ascii":case"latin1":case"binary":return B(this,I,R,d);case"base64":return p(this,I,R,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,I,R,d);default:if(x)throw new TypeError("Unknown encoding: "+y);y=(""+y).toLowerCase(),x=!0}},F.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var pe=4096;function Ze(I,R,d){var y="";d=Math.min(I.length,d);for(var X=R;Xy)&&(d=y);for(var X="",x=R;xd)throw new RangeError("Trying to access beyond buffer length")}function Tt(I,R,d,y,X,x){if(!F.isBuffer(I))throw new TypeError('"buffer" argument must be a Buffer instance');if(R>X||RI.length)throw new RangeError("Index out of range")}function Kt(I,R,d,y,X,x){if(d+y>I.length)throw new RangeError("Index out of range");if(d<0)throw new RangeError("Index out of range")}function zt(I,R,d,y,X){return R=+R,d>>>=0,X||Kt(I,0,d,4),z.write(I,R,d,y,23,4),d+4}function Wt(I,R,d,y,X){return R=+R,d>>>=0,X||Kt(I,0,d,8),z.write(I,R,d,y,52,8),d+8}F.prototype.slice=function(I,R){var d=this.length;(I=~~I)<0?(I+=d)<0&&(I=0):I>d&&(I=d),(R=R===void 0?d:~~R)<0?(R+=d)<0&&(R=0):R>d&&(R=d),R>>=0,R>>>=0,d||Se(I,R,this.length);for(var y=this[I],X=1,x=0;++x>>=0,R>>>=0,d||Se(I,R,this.length);for(var y=this[I+--R],X=1;R>0&&(X*=256);)y+=this[I+--R]*X;return y},F.prototype.readUint8=F.prototype.readUInt8=function(I,R){return I>>>=0,R||Se(I,1,this.length),this[I]},F.prototype.readUint16LE=F.prototype.readUInt16LE=function(I,R){return I>>>=0,R||Se(I,2,this.length),this[I]|this[I+1]<<8},F.prototype.readUint16BE=F.prototype.readUInt16BE=function(I,R){return I>>>=0,R||Se(I,2,this.length),this[I]<<8|this[I+1]},F.prototype.readUint32LE=F.prototype.readUInt32LE=function(I,R){return I>>>=0,R||Se(I,4,this.length),(this[I]|this[I+1]<<8|this[I+2]<<16)+16777216*this[I+3]},F.prototype.readUint32BE=F.prototype.readUInt32BE=function(I,R){return I>>>=0,R||Se(I,4,this.length),16777216*this[I]+(this[I+1]<<16|this[I+2]<<8|this[I+3])},F.prototype.readIntLE=function(I,R,d){I>>>=0,R>>>=0,d||Se(I,R,this.length);for(var y=this[I],X=1,x=0;++x=(X*=128)&&(y-=Math.pow(2,8*R)),y},F.prototype.readIntBE=function(I,R,d){I>>>=0,R>>>=0,d||Se(I,R,this.length);for(var y=R,X=1,x=this[I+--y];y>0&&(X*=256);)x+=this[I+--y]*X;return x>=(X*=128)&&(x-=Math.pow(2,8*R)),x},F.prototype.readInt8=function(I,R){return I>>>=0,R||Se(I,1,this.length),128&this[I]?-1*(255-this[I]+1):this[I]},F.prototype.readInt16LE=function(I,R){I>>>=0,R||Se(I,2,this.length);var d=this[I]|this[I+1]<<8;return 32768&d?4294901760|d:d},F.prototype.readInt16BE=function(I,R){I>>>=0,R||Se(I,2,this.length);var d=this[I+1]|this[I]<<8;return 32768&d?4294901760|d:d},F.prototype.readInt32LE=function(I,R){return I>>>=0,R||Se(I,4,this.length),this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24},F.prototype.readInt32BE=function(I,R){return I>>>=0,R||Se(I,4,this.length),this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]},F.prototype.readFloatLE=function(I,R){return I>>>=0,R||Se(I,4,this.length),z.read(this,I,!0,23,4)},F.prototype.readFloatBE=function(I,R){return I>>>=0,R||Se(I,4,this.length),z.read(this,I,!1,23,4)},F.prototype.readDoubleLE=function(I,R){return I>>>=0,R||Se(I,8,this.length),z.read(this,I,!0,52,8)},F.prototype.readDoubleBE=function(I,R){return I>>>=0,R||Se(I,8,this.length),z.read(this,I,!1,52,8)},F.prototype.writeUintLE=F.prototype.writeUIntLE=function(I,R,d,y){I=+I,R>>>=0,d>>>=0,y||Tt(this,I,R,d,Math.pow(2,8*d)-1,0);var X=1,x=0;for(this[R]=255&I;++x>>=0,d>>>=0,y||Tt(this,I,R,d,Math.pow(2,8*d)-1,0);var X=d-1,x=1;for(this[R+X]=255&I;--X>=0&&(x*=256);)this[R+X]=I/x&255;return R+d},F.prototype.writeUint8=F.prototype.writeUInt8=function(I,R,d){return I=+I,R>>>=0,d||Tt(this,I,R,1,255,0),this[R]=255&I,R+1},F.prototype.writeUint16LE=F.prototype.writeUInt16LE=function(I,R,d){return I=+I,R>>>=0,d||Tt(this,I,R,2,65535,0),this[R]=255&I,this[R+1]=I>>>8,R+2},F.prototype.writeUint16BE=F.prototype.writeUInt16BE=function(I,R,d){return I=+I,R>>>=0,d||Tt(this,I,R,2,65535,0),this[R]=I>>>8,this[R+1]=255&I,R+2},F.prototype.writeUint32LE=F.prototype.writeUInt32LE=function(I,R,d){return I=+I,R>>>=0,d||Tt(this,I,R,4,4294967295,0),this[R+3]=I>>>24,this[R+2]=I>>>16,this[R+1]=I>>>8,this[R]=255&I,R+4},F.prototype.writeUint32BE=F.prototype.writeUInt32BE=function(I,R,d){return I=+I,R>>>=0,d||Tt(this,I,R,4,4294967295,0),this[R]=I>>>24,this[R+1]=I>>>16,this[R+2]=I>>>8,this[R+3]=255&I,R+4},F.prototype.writeIntLE=function(I,R,d,y){if(I=+I,R>>>=0,!y){var X=Math.pow(2,8*d-1);Tt(this,I,R,d,X-1,-X)}var x=0,Te=1,Le=0;for(this[R]=255&I;++x>>=0,!y){var X=Math.pow(2,8*d-1);Tt(this,I,R,d,X-1,-X)}var x=d-1,Te=1,Le=0;for(this[R+x]=255&I;--x>=0&&(Te*=256);)I<0&&Le===0&&this[R+x+1]!==0&&(Le=1),this[R+x]=(I/Te|0)-Le&255;return R+d},F.prototype.writeInt8=function(I,R,d){return I=+I,R>>>=0,d||Tt(this,I,R,1,127,-128),I<0&&(I=255+I+1),this[R]=255&I,R+1},F.prototype.writeInt16LE=function(I,R,d){return I=+I,R>>>=0,d||Tt(this,I,R,2,32767,-32768),this[R]=255&I,this[R+1]=I>>>8,R+2},F.prototype.writeInt16BE=function(I,R,d){return I=+I,R>>>=0,d||Tt(this,I,R,2,32767,-32768),this[R]=I>>>8,this[R+1]=255&I,R+2},F.prototype.writeInt32LE=function(I,R,d){return I=+I,R>>>=0,d||Tt(this,I,R,4,2147483647,-2147483648),this[R]=255&I,this[R+1]=I>>>8,this[R+2]=I>>>16,this[R+3]=I>>>24,R+4},F.prototype.writeInt32BE=function(I,R,d){return I=+I,R>>>=0,d||Tt(this,I,R,4,2147483647,-2147483648),I<0&&(I=4294967295+I+1),this[R]=I>>>24,this[R+1]=I>>>16,this[R+2]=I>>>8,this[R+3]=255&I,R+4},F.prototype.writeFloatLE=function(I,R,d){return zt(this,I,R,!0,d)},F.prototype.writeFloatBE=function(I,R,d){return zt(this,I,R,!1,d)},F.prototype.writeDoubleLE=function(I,R,d){return Wt(this,I,R,!0,d)},F.prototype.writeDoubleBE=function(I,R,d){return Wt(this,I,R,!1,d)},F.prototype.copy=function(I,R,d,y){if(!F.isBuffer(I))throw new TypeError("argument should be a Buffer");if(d||(d=0),y||y===0||(y=this.length),R>=I.length&&(R=I.length),R||(R=0),y>0&&y=this.length)throw new RangeError("Index out of range");if(y<0)throw new RangeError("sourceEnd out of bounds");y>this.length&&(y=this.length),I.length-R>>=0,d=d===void 0?this.length:d>>>0,I||(I=0),typeof I=="number")for(x=R;x55295&&d<57344){if(!X){if(d>56319){(R-=3)>-1&&x.push(239,191,189);continue}if(Te+1===y){(R-=3)>-1&&x.push(239,191,189);continue}X=d;continue}if(d<56320){(R-=3)>-1&&x.push(239,191,189),X=d;continue}d=65536+(X-55296<<10|d-56320)}else X&&(R-=3)>-1&&x.push(239,191,189);if(X=null,d<128){if((R-=1)<0)break;x.push(d)}else if(d<2048){if((R-=2)<0)break;x.push(d>>6|192,63&d|128)}else if(d<65536){if((R-=3)<0)break;x.push(d>>12|224,d>>6&63|128,63&d|128)}else{if(!(d<1114112))throw new Error("Invalid code point");if((R-=4)<0)break;x.push(d>>18|240,d>>12&63|128,d>>6&63|128,63&d|128)}}return x}function sn(I){return be.toByteArray(function(R){if((R=(R=R.split("=")[0]).trim().replace(Ht,"")).length<2)return"";for(;R.length%4!=0;)R+="=";return R}(I))}function un(I,R,d,y){for(var X=0;X=R.length||X>=I.length);++X)R[X+d]=I[X];return X}function ye(I,R){return I instanceof R||I!=null&&I.constructor!=null&&I.constructor.name!=null&&I.constructor.name===R.name}function _e(I){return I!=I}var rt=function(){for(var I="0123456789abcdef",R=new Array(256),d=0;d<16;++d)for(var y=16*d,X=0;X<16;++X)R[y+X]=I[d]+I[X];return R}()},6877:function(Nt,Fe){var de={parseBuffer:function(T){return new be(T).parse()},addBoxProcessor:function(T,O){typeof T=="string"&&typeof O=="function"&&(z.prototype._boxProcessors[T]=O)},createFile:function(){return new be},createBox:function(T,O,re){var F=z.create(T);return O&&O.append(F,re),F},createFullBox:function(T,O,re){var F=de.createBox(T,O,re);return F.version=0,F.flags=0,F},Utils:{}};de.Utils.dataViewToString=function(T,O){var re=O||"utf-8";if(typeof TextDecoder<"u")return new TextDecoder(re).decode(T);var F=[],q=0;if(re==="utf-8")for(;q>6),O.push(128|63&F)):F<65536?(O.push(224|F>>12),O.push(128|63&F>>6),O.push(128|63&F)):(O.push(240|F>>18),O.push(128|63&F>>12),O.push(128|63&F>>6),O.push(128|63&F))}return O},de.Utils.appendBox=function(T,O,re){if(O._offset=T._cursor.offset,O._root=T._root?T._root:T,O._raw=T._raw,O._parent=T,re!==-1)if(re!=null){var F,q=-1;if(typeof re=="number")q=re;else{if(typeof re=="string")F=re;else{if(typeof re!="object"||!re.type)return void T.boxes.push(O);F=re.type}for(var oe=0;oe>3,O},z.prototype._readUint=function(T){var O,re,F=null,q=this._cursor.offset-this._raw.byteOffset;switch(T){case 8:F=this._raw.getUint8(q);break;case 16:F=this._raw.getUint16(q);break;case 24:F=((O=this._raw.getUint16(q))<<8)+(re=this._raw.getUint8(q+2));break;case 32:F=this._raw.getUint32(q);break;case 64:O=this._raw.getUint32(q),re=this._raw.getUint32(q+4),F=O*Math.pow(2,32)+re}return this._cursor.offset+=T>>3,F},z.prototype._readString=function(T){for(var O="",re=0;re0?T:this._raw.byteLength-(this._cursor.offset-this._offset);if(O>0){var re=new Uint8Array(this._raw.buffer,this._cursor.offset,O);return this._cursor.offset+=O,re}return null},z.prototype._readUTF8String=function(){var T=this._raw.byteLength-(this._cursor.offset-this._offset),O=null;return T>0&&(O=new DataView(this._raw.buffer,this._cursor.offset,T),this._cursor.offset+=T),O&&de.Utils.dataViewToString(O)},z.prototype._readUTF8TerminatedString=function(){var T=this._raw.byteLength-(this._cursor.offset-this._offset),O=null;if(T>0){var re;for(O=new DataView(this._raw.buffer,this._cursor.offset,T),re=0;rethis._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())}},z.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},z.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset>3}else this.size+=T>>3},z.prototype._writeUint=function(T,O){if(this._rawo){var re,F,q=this._cursor.offset-this._rawo.byteOffset;switch(T){case 8:this._rawo.setUint8(q,O);break;case 16:this._rawo.setUint16(q,O);break;case 24:re=(16776960&O)>>8,F=255&O,this._rawo.setUint16(q,re),this._rawo.setUint8(q+2,F);break;case 32:this._rawo.setUint32(q,O);break;case 64:F=O-(re=Math.floor(O/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(q,re),this._rawo.setUint32(q+4,F)}this._cursor.offset+=T>>3}else this.size+=T>>3},z.prototype._writeString=function(T,O){for(var re=0;re>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},z.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",this.version==1?64:32)},z.prototype._boxProcessors.meta=function(){this._procFullBox()},z.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},z.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},z.prototype._boxProcessors.mp4a=z.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)},z.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)},z.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},z.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)},z.prototype._boxProcessors.prsl=function(){this._procFullBox(),this._procField("group_id","uint",32),this._procField("num_entities_in_group","uint",32),this._procEntries("entities",this.num_entities_in_group,function(T){this._procEntryField(T,"entity_id","uint",32)}),4096&this.flags&&this._procField("preselection_tag","utf8string"),8192&this.flags&&this._procField("selection_priority","uint",8),16384&this.flags&&this._procField("interleaving_tag","utf8string")},z.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},z.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)},z.prototype._boxProcessors.sdtp=function(){this._procFullBox();var T=-1;this._parsing&&(T=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",T,"uint",8)},z.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(T){this._parsing||(T.reference=(1&T.reference_type)<<31,T.reference|=2147483647&T.referenced_size,T.sap=(1&T.starts_with_SAP)<<31,T.sap|=(3&T.SAP_type)<<28,T.sap|=268435455&T.SAP_delta_time),this._procEntryField(T,"reference","uint",32),this._procEntryField(T,"subsegment_duration","uint",32),this._procEntryField(T,"sap","uint",32),this._parsing&&(T.reference_type=T.reference>>31&1,T.referenced_size=2147483647&T.reference,T.starts_with_SAP=T.sap>>31&1,T.SAP_type=T.sap>>28&7,T.SAP_delta_time=268435455&T.sap)})},z.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},z.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,function(T){this._procEntryField(T,"ranges_count","uint",32),this._procSubEntries(T,"ranges",T.ranges_count,function(O){this._procEntryField(O,"level","uint",8),this._procEntryField(O,"range_size","uint",24)})})},z.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},z.prototype._boxProcessors.sttg=function(){this._procField("settings","utf8")},z.prototype._boxProcessors.stts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,function(T){this._procEntryField(T,"sample_count","uint",32),this._procEntryField(T,"sample_delta","uint",32)})},z.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,function(T){this._procEntryField(T,"sample_delta","uint",32),this._procEntryField(T,"subsample_count","uint",16),this._procSubEntries(T,"subsamples",T.subsample_count,function(O){this._procEntryField(O,"subsample_size","uint",this.version===1?32:16),this._procEntryField(O,"subsample_priority","uint",8),this._procEntryField(O,"discardable","uint",8),this._procEntryField(O,"codec_specific_parameters","uint",32)})})},z.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)},z.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",this.version==1?64:32)},z.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)},z.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,function(T){this._procEntryField(T,"time","uint",this.version===1?64:32),this._procEntryField(T,"moof_offset","uint",this.version===1?64:32),this._procEntryField(T,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(T,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(T,"sample_number","uint",8*(this.length_size_of_sample_num+1))})},z.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)},z.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)},z.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,function(T){256&this.flags&&this._procEntryField(T,"sample_duration","uint",32),512&this.flags&&this._procEntryField(T,"sample_size","uint",32),1024&this.flags&&this._procEntryField(T,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(T,"sample_composition_time_offset",this.version===1?"int":"uint",32)})},z.prototype._boxProcessors["url "]=z.prototype._boxProcessors["urn "]=function(){this._procFullBox(),this.type==="urn "&&this._procField("name","string",-1),this._procField("location","string",-1)},z.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},z.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},z.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},z.prototype._boxProcessors.vtte=function(){}},9826:function(Nt){var Fe,de=typeof Reflect=="object"?Reflect:null,be=de&&typeof de.apply=="function"?de.apply:function(Ee,Ae,we){return Function.prototype.apply.call(Ee,Ae,we)};Fe=de&&typeof de.ownKeys=="function"?de.ownKeys:Object.getOwnPropertySymbols?function(Ee){return Object.getOwnPropertyNames(Ee).concat(Object.getOwnPropertySymbols(Ee))}:function(Ee){return Object.getOwnPropertyNames(Ee)};var z=Number.isNaN||function(Ee){return Ee!=Ee};function T(){T.init.call(this)}Nt.exports=T,Nt.exports.once=function(Ee,Ae){return new Promise(function(we,De){function Be(B){Ee.removeListener(Ae,ct),De(B)}function ct(){typeof Ee.removeListener=="function"&&Ee.removeListener("error",Be),we([].slice.call(arguments))}ce(Ee,Ae,ct,{once:!0}),Ae!=="error"&&function(B,p){typeof B.on=="function"&&ce(B,"error",p,{once:!0})}(Ee,Be)})},T.EventEmitter=T,T.prototype._events=void 0,T.prototype._eventsCount=0,T.prototype._maxListeners=void 0;var O=10;function re(Ee){if(typeof Ee!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof Ee)}function F(Ee){return Ee._maxListeners===void 0?T.defaultMaxListeners:Ee._maxListeners}function q(Ee,Ae,we,De){var Be,ct,B,p;if(re(we),(ct=Ee._events)===void 0?(ct=Ee._events=Object.create(null),Ee._eventsCount=0):(ct.newListener!==void 0&&(Ee.emit("newListener",Ae,we.listener?we.listener:we),ct=Ee._events),B=ct[Ae]),B===void 0)B=ct[Ae]=we,++Ee._eventsCount;else if(typeof B=="function"?B=ct[Ae]=De?[we,B]:[B,we]:De?B.unshift(we):B.push(we),(Be=F(Ee))>0&&B.length>Be&&!B.warned){B.warned=!0;var ie=new Error("Possible EventEmitter memory leak detected. "+B.length+" "+String(Ae)+" listeners added. Use emitter.setMaxListeners() to increase limit");ie.name="MaxListenersExceededWarning",ie.emitter=Ee,ie.type=Ae,ie.count=B.length,p=ie,console&&console.warn&&console.warn(p)}return Ee}function oe(){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 ee(Ee,Ae,we){var De={fired:!1,wrapFn:void 0,target:Ee,type:Ae,listener:we},Be=oe.bind(De);return Be.listener=we,De.wrapFn=Be,Be}function W(Ee,Ae,we){var De=Ee._events;if(De===void 0)return[];var Be=De[Ae];return Be===void 0?[]:typeof Be=="function"?we?[Be.listener||Be]:[Be]:we?function(ct){for(var B=new Array(ct.length),p=0;p0&&(ct=Ae[0]),ct instanceof Error)throw ct;var B=new Error("Unhandled error."+(ct?" ("+ct.message+")":""));throw B.context=ct,B}var p=Be[Ee];if(p===void 0)return!1;if(typeof p=="function")be(p,this,Ae);else{var ie=p.length,me=D(p,ie);for(we=0;we=0;ct--)if(we[ct]===Ae||we[ct].listener===Ae){B=we[ct].listener,Be=ct;break}if(Be<0)return this;Be===0?we.shift():function(p,ie){for(;ie+1=0;De--)this.removeListener(Ee,Ae[De]);return this},T.prototype.listeners=function(Ee){return W(this,Ee,!0)},T.prototype.rawListeners=function(Ee){return W(this,Ee,!1)},T.listenerCount=function(Ee,Ae){return typeof Ee.listenerCount=="function"?Ee.listenerCount(Ae):le.call(Ee,Ae)},T.prototype.listenerCount=le,T.prototype.eventNames=function(){return this._eventsCount>0?Fe(this._events):[]}},7316:function(Nt){Nt.exports=function Fe(de,be){if(de===be)return!0;if(de&&be&&typeof de=="object"&&typeof be=="object"){if(de.constructor!==be.constructor)return!1;var z,T,O;if(Array.isArray(de)){if((z=de.length)!=be.length)return!1;for(T=z;T--!=0;)if(!Fe(de[T],be[T]))return!1;return!0}if(de.constructor===RegExp)return de.source===be.source&&de.flags===be.flags;if(de.valueOf!==Object.prototype.valueOf)return de.valueOf()===be.valueOf();if(de.toString!==Object.prototype.toString)return de.toString()===be.toString();if((z=(O=Object.keys(de)).length)!==Object.keys(be).length)return!1;for(T=z;T--!=0;)if(!Object.prototype.hasOwnProperty.call(be,O[T]))return!1;for(T=z;T--!=0;){var re=O[T];if(!Fe(de[re],be[re]))return!1}return!0}return de!=de&&be!=be}},7986:function(Nt,Fe){Fe.read=function(de,be,z,T,O){var re,F,q=8*O-T-1,oe=(1<>1,W=-7,le=z?O-1:0,D=z?-1:1,ce=de[be+le];for(le+=D,re=ce&(1<<-W)-1,ce>>=-W,W+=q;W>0;re=256*re+de[be+le],le+=D,W-=8);for(F=re&(1<<-W)-1,re>>=-W,W+=T;W>0;F=256*F+de[be+le],le+=D,W-=8);if(re===0)re=1-ee;else{if(re===oe)return F?NaN:1/0*(ce?-1:1);F+=Math.pow(2,T),re-=ee}return(ce?-1:1)*F*Math.pow(2,re-T)},Fe.write=function(de,be,z,T,O,re){var F,q,oe,ee=8*re-O-1,W=(1<>1,D=O===23?Math.pow(2,-24)-Math.pow(2,-77):0,ce=T?0:re-1,Ee=T?1:-1,Ae=be<0||be===0&&1/be<0?1:0;for(be=Math.abs(be),isNaN(be)||be===1/0?(q=isNaN(be)?1:0,F=W):(F=Math.floor(Math.log(be)/Math.LN2),be*(oe=Math.pow(2,-F))<1&&(F--,oe*=2),(be+=F+le>=1?D/oe:D*Math.pow(2,1-le))*oe>=2&&(F++,oe/=2),F+le>=W?(q=0,F=W):F+le>=1?(q=(be*oe-1)*Math.pow(2,O),F+=le):(q=be*Math.pow(2,le-1)*Math.pow(2,O),F=0));O>=8;de[z+ce]=255&q,ce+=Ee,q/=256,O-=8);for(F=F<0;de[z+ce]=255&F,ce+=Ee,F/=256,ee-=8);de[z+ce-Ee]|=128*Ae}},5474:function(Nt,Fe,de){(function(be){be.parser=function(d,y){return new O(d,y)},be.SAXParser=O,be.SAXStream=F,be.createStream=function(d,y){return new F(d,y)},be.MAX_BUFFER_LENGTH=65536;var z,T=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function O(d,y){if(!(this instanceof O))return new O(d,y);var X=this;(function(x){for(var Te=0,Le=T.length;Te"?(Se(y,"onsgmldeclaration",y.sgmlDecl),y.sgmlDecl="",y.state=se.TEXT):(ie(W,x)&&(y.state=se.SGML_DECL_QUOTED),y.sgmlDecl+=x);continue;case se.SGML_DECL_QUOTED:x===y.q&&(y.state=se.SGML_DECL,y.q=""),y.sgmlDecl+=x;continue;case se.DOCTYPE:x===">"?(y.state=se.TEXT,Se(y,"ondoctype",y.doctype),y.doctype=!0):(y.doctype+=x,x==="["?y.state=se.DOCTYPE_DTD:ie(W,x)&&(y.state=se.DOCTYPE_QUOTED,y.q=x));continue;case se.DOCTYPE_QUOTED:y.doctype+=x,x===y.q&&(y.q="",y.state=se.DOCTYPE);continue;case se.DOCTYPE_DTD:y.doctype+=x,x==="]"?y.state=se.DOCTYPE:ie(W,x)&&(y.state=se.DOCTYPE_DTD_QUOTED,y.q=x);continue;case se.DOCTYPE_DTD_QUOTED:y.doctype+=x,x===y.q&&(y.state=se.DOCTYPE_DTD,y.q="");continue;case se.COMMENT:x==="-"?y.state=se.COMMENT_ENDING:y.comment+=x;continue;case se.COMMENT_ENDING:x==="-"?(y.state=se.COMMENT_ENDED,y.comment=Kt(y.opt,y.comment),y.comment&&Se(y,"oncomment",y.comment),y.comment=""):(y.comment+="-"+x,y.state=se.COMMENT);continue;case se.COMMENT_ENDED:x!==">"?(Ht(y,"Malformed comment"),y.comment+="--"+x,y.state=se.COMMENT):y.state=se.TEXT;continue;case se.CDATA:x==="]"?y.state=se.CDATA_ENDING:y.cdata+=x;continue;case se.CDATA_ENDING:x==="]"?y.state=se.CDATA_ENDING_2:(y.cdata+="]"+x,y.state=se.CDATA);continue;case se.CDATA_ENDING_2:x===">"?(y.cdata&&Se(y,"oncdata",y.cdata),Se(y,"onclosecdata"),y.cdata="",y.state=se.TEXT):x==="]"?y.cdata+="]":(y.cdata+="]]"+x,y.state=se.CDATA);continue;case se.PROC_INST:x==="?"?y.state=se.PROC_INST_ENDING:ie(q,x)?y.state=se.PROC_INST_BODY:y.procInstName+=x;continue;case se.PROC_INST_BODY:if(!y.procInstBody&&ie(q,x))continue;x==="?"?y.state=se.PROC_INST_ENDING:y.procInstBody+=x;continue;case se.PROC_INST_ENDING:x===">"?(Se(y,"onprocessinginstruction",{name:y.procInstName,body:y.procInstBody}),y.procInstName=y.procInstBody="",y.state=se.TEXT):(y.procInstBody+="?"+x,y.state=se.PROC_INST_BODY);continue;case se.OPEN_TAG:ie(Be,x)?y.tagName+=x:(cn(y),x===">"?ye(y):x==="/"?y.state=se.OPEN_TAG_SLASH:(me(q,x)&&Ht(y,"Invalid character in tag name"),y.state=se.ATTRIB));continue;case se.OPEN_TAG_SLASH:x===">"?(ye(y,!0),_e(y)):(Ht(y,"Forward-slash in opening tag not followed by >"),y.state=se.ATTRIB);continue;case se.ATTRIB:if(ie(q,x))continue;x===">"?ye(y):x==="/"?y.state=se.OPEN_TAG_SLASH:ie(De,x)?(y.attribName=x,y.attribValue="",y.state=se.ATTRIB_NAME):Ht(y,"Invalid attribute name");continue;case se.ATTRIB_NAME:x==="="?y.state=se.ATTRIB_VALUE:x===">"?(Ht(y,"Attribute without value"),y.attribValue=y.attribName,un(y),ye(y)):ie(q,x)?y.state=se.ATTRIB_NAME_SAW_WHITE:ie(Be,x)?y.attribName+=x:Ht(y,"Invalid attribute name");continue;case se.ATTRIB_NAME_SAW_WHITE:if(x==="=")y.state=se.ATTRIB_VALUE;else{if(ie(q,x))continue;Ht(y,"Attribute without value"),y.tag.attributes[y.attribName]="",y.attribValue="",Se(y,"onattribute",{name:y.attribName,value:""}),y.attribName="",x===">"?ye(y):ie(De,x)?(y.attribName=x,y.state=se.ATTRIB_NAME):(Ht(y,"Invalid attribute name"),y.state=se.ATTRIB)}continue;case se.ATTRIB_VALUE:if(ie(q,x))continue;ie(W,x)?(y.q=x,y.state=se.ATTRIB_VALUE_QUOTED):(Ht(y,"Unquoted attribute value"),y.state=se.ATTRIB_VALUE_UNQUOTED,y.attribValue=x);continue;case se.ATTRIB_VALUE_QUOTED:if(x!==y.q){x==="&"?y.state=se.ATTRIB_VALUE_ENTITY_Q:y.attribValue+=x;continue}un(y),y.q="",y.state=se.ATTRIB_VALUE_CLOSED;continue;case se.ATTRIB_VALUE_CLOSED:ie(q,x)?y.state=se.ATTRIB:x===">"?ye(y):x==="/"?y.state=se.OPEN_TAG_SLASH:ie(De,x)?(Ht(y,"No whitespace between attributes"),y.attribName=x,y.attribValue="",y.state=se.ATTRIB_NAME):Ht(y,"Invalid attribute name");continue;case se.ATTRIB_VALUE_UNQUOTED:if(me(le,x)){x==="&"?y.state=se.ATTRIB_VALUE_ENTITY_U:y.attribValue+=x;continue}un(y),x===">"?ye(y):y.state=se.ATTRIB;continue;case se.CLOSE_TAG:if(y.tagName)x===">"?_e(y):ie(Be,x)?y.tagName+=x:y.script?(y.script+=""?_e(y):Ht(y,"Invalid characters in closing tag");continue;case se.TEXT_ENTITY:case se.ATTRIB_VALUE_ENTITY_Q:case se.ATTRIB_VALUE_ENTITY_U:var Re,ze;switch(y.state){case se.TEXT_ENTITY:Re=se.TEXT,ze="textNode";break;case se.ATTRIB_VALUE_ENTITY_Q:Re=se.ATTRIB_VALUE_QUOTED,ze="attribValue";break;case se.ATTRIB_VALUE_ENTITY_U:Re=se.ATTRIB_VALUE_UNQUOTED,ze="attribValue"}x===";"?(y[ze]+=rt(y),y.entity="",y.state=Re):ie(y.entity.length?B:ct,x)?y.entity+=x:(Ht(y,"Invalid character in entity name"),y[ze]+="&"+y.entity+x,y.entity="",y.state=Re);continue;default:throw new Error(y,"Unknown state: "+y.state)}return y.position>=y.bufferCheckPosition&&function(ve){for(var Pe=Math.max(be.MAX_BUFFER_LENGTH,10),Xe=0,qe=0,at=T.length;qePe)switch(T[qe]){case"textNode":Tt(ve);break;case"cdata":Se(ve,"oncdata",ve.cdata),ve.cdata="";break;case"script":Se(ve,"onscript",ve.script),ve.script="";break;default:zt(ve,"Max buffer length exceeded: "+T[qe])}Xe=Math.max(Xe,Bt)}var St=be.MAX_BUFFER_LENGTH-Xe;ve.bufferCheckPosition=St+ve.position}(y),y},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var d;Tt(d=this),d.cdata!==""&&(Se(d,"oncdata",d.cdata),d.cdata=""),d.script!==""&&(Se(d,"onscript",d.script),d.script="")}};try{z=de(3515).Stream}catch{z=function(){}}var re=be.EVENTS.filter(function(d){return d!=="error"&&d!=="end"});function F(d,y){if(!(this instanceof F))return new F(d,y);z.apply(this),this._parser=new O(d,y),this.writable=!0,this.readable=!0;var X=this;this._parser.onend=function(){X.emit("end")},this._parser.onerror=function(x){X.emit("error",x),X._parser.error=null},this._decoder=null,re.forEach(function(x){Object.defineProperty(X,"on"+x,{get:function(){return X._parser["on"+x]},set:function(Te){if(!Te)return X.removeAllListeners(x),X._parser["on"+x]=Te,Te;X.on(x,Te)},enumerable:!0,configurable:!1})})}F.prototype=Object.create(z.prototype,{constructor:{value:F}}),F.prototype.write=function(d){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(d)){if(!this._decoder){var y=de(748).StringDecoder;this._decoder=new y("utf8")}d=this._decoder.write(d)}return this._parser.write(d.toString()),this.emit("data",d),!0},F.prototype.end=function(d){return d&&d.length&&this.write(d),this._parser.end(),!0},F.prototype.on=function(d,y){var X=this;return X._parser["on"+d]||re.indexOf(d)===-1||(X._parser["on"+d]=function(){var x=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);x.splice(0,0,d),X.emit.apply(X,x)}),z.prototype.on.call(X,d,y)};var q=`\r + `,oe="0124356789",ee="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",W=`'"`,le=q+">",D="[CDATA[",ce="DOCTYPE",Ee="http://www.w3.org/XML/1998/namespace",Ae="http://www.w3.org/2000/xmlns/",we={xml:Ee,xmlns:Ae};q=p(q),oe=p(oe),ee=p(ee);var De=/[:_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-]/,ct=/[#:_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]/,B=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;function p(d){return d.split("").reduce(function(y,X){return y[X]=!0,y},{})}function ie(d,y){return function(X){return Object.prototype.toString.call(X)==="[object RegExp]"}(d)?!!y.match(d):d[y]}function me(d,y){return!ie(d,y)}W=p(W),le=p(le);var L,pe,Ze,se=0;for(var Ut in be.STATE={BEGIN:se++,BEGIN_WHITESPACE:se++,TEXT:se++,TEXT_ENTITY:se++,OPEN_WAKA:se++,SGML_DECL:se++,SGML_DECL_QUOTED:se++,DOCTYPE:se++,DOCTYPE_QUOTED:se++,DOCTYPE_DTD:se++,DOCTYPE_DTD_QUOTED:se++,COMMENT_STARTING:se++,COMMENT:se++,COMMENT_ENDING:se++,COMMENT_ENDED:se++,CDATA:se++,CDATA_ENDING:se++,CDATA_ENDING_2:se++,PROC_INST:se++,PROC_INST_BODY:se++,PROC_INST_ENDING:se++,OPEN_TAG:se++,OPEN_TAG_SLASH:se++,ATTRIB:se++,ATTRIB_NAME:se++,ATTRIB_NAME_SAW_WHITE:se++,ATTRIB_VALUE:se++,ATTRIB_VALUE_QUOTED:se++,ATTRIB_VALUE_CLOSED:se++,ATTRIB_VALUE_UNQUOTED:se++,ATTRIB_VALUE_ENTITY_Q:se++,ATTRIB_VALUE_ENTITY_U:se++,CLOSE_TAG:se++,CLOSE_TAG_SAW_WHITE:se++,SCRIPT:se++,SCRIPT_ENDING:se++},be.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},be.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(be.ENTITIES).forEach(function(d){var y=be.ENTITIES[d],X=typeof y=="number"?String.fromCharCode(y):y;be.ENTITIES[d]=X}),be.STATE)be.STATE[be.STATE[Ut]]=Ut;function $e(d,y,X){d[y]&&d[y](X)}function Se(d,y,X){d.textNode&&Tt(d),$e(d,y,X)}function Tt(d){d.textNode=Kt(d.opt,d.textNode),d.textNode&&$e(d,"ontext",d.textNode),d.textNode=""}function Kt(d,y){return d.trim&&(y=y.trim()),d.normalize&&(y=y.replace(/\s+/g," ")),y}function zt(d,y){return Tt(d),d.trackPosition&&(y+=` +Line: `+d.line+` +Column: `+d.column+` +Char: `+d.c),y=new Error(y),d.error=y,$e(d,"onerror",y),d}function Wt(d){return d.sawRoot&&!d.closedRoot&&Ht(d,"Unclosed root tag"),d.state!==se.BEGIN&&d.state!==se.BEGIN_WHITESPACE&&d.state!==se.TEXT&&zt(d,"Unexpected end"),Tt(d),d.c="",d.closed=!0,$e(d,"onend"),O.call(d,d.strict,d.opt),d}function Ht(d,y){if(typeof d!="object"||!(d instanceof O))throw new Error("bad call to strictFail");d.strict&&zt(d,y)}function cn(d){d.strict||(d.tagName=d.tagName[d.looseCase]());var y=d.tags[d.tags.length-1]||d,X=d.tag={name:d.tagName,attributes:{}};d.opt.xmlns&&(X.ns=y.ns),d.attribList.length=0,Se(d,"onopentagstart",X)}function sn(d,y){var X=d.indexOf(":")<0?["",d]:d.split(":"),x=X[0],Te=X[1];return y&&d==="xmlns"&&(x="xmlns",Te=""),{prefix:x,local:Te}}function un(d){if(d.strict||(d.attribName=d.attribName[d.looseCase]()),d.attribList.indexOf(d.attribName)!==-1||d.tag.attributes.hasOwnProperty(d.attribName))d.attribName=d.attribValue="";else{if(d.opt.xmlns){var y=sn(d.attribName,!0),X=y.prefix,x=y.local;if(X==="xmlns")if(x==="xml"&&d.attribValue!==Ee)Ht(d,"xml: prefix must be bound to "+Ee+` +Actual: `+d.attribValue);else if(x==="xmlns"&&d.attribValue!==Ae)Ht(d,"xmlns: prefix must be bound to "+Ae+` +Actual: `+d.attribValue);else{var Te=d.tag,Le=d.tags[d.tags.length-1]||d;Te.ns===Le.ns&&(Te.ns=Object.create(Le.ns)),Te.ns[x]=d.attribValue}d.attribList.push([d.attribName,d.attribValue])}else d.tag.attributes[d.attribName]=d.attribValue,Se(d,"onattribute",{name:d.attribName,value:d.attribValue});d.attribName=d.attribValue=""}}function ye(d,y){if(d.opt.xmlns){var X=d.tag,x=sn(d.tagName);X.prefix=x.prefix,X.local=x.local,X.uri=X.ns[x.prefix]||"",X.prefix&&!X.uri&&(Ht(d,"Unbound namespace prefix: "+JSON.stringify(d.tagName)),X.uri=x.prefix);var Te=d.tags[d.tags.length-1]||d;X.ns&&Te.ns!==X.ns&&Object.keys(X.ns).forEach(function(Ct){Se(d,"onopennamespace",{prefix:Ct,uri:X.ns[Ct]})});for(var Le=0,Re=d.attribList.length;Le",d.tagName="",void(d.state=se.SCRIPT);Se(d,"onscript",d.script),d.script=""}var y=d.tags.length,X=d.tagName;d.strict||(X=X[d.looseCase]());for(var x=X;y--&&d.tags[y].name!==x;)Ht(d,"Unexpected close tag");if(y<0)return Ht(d,"Unmatched closing tag: "+d.tagName),d.textNode+="",void(d.state=se.TEXT);d.tagName=X;for(var Te=d.tags.length;Te-- >y;){var Le=d.tag=d.tags.pop();d.tagName=d.tag.name,Se(d,"onclosetag",d.tagName);var Re={};for(var ze in Le.ns)Re[ze]=Le.ns[ze];var ve=d.tags[d.tags.length-1]||d;d.opt.xmlns&&Le.ns!==ve.ns&&Object.keys(Le.ns).forEach(function(Pe){var Xe=Le.ns[Pe];Se(d,"onclosenamespace",{prefix:Pe,uri:Xe})})}y===0&&(d.closedRoot=!0),d.tagName=d.attribValue=d.attribName="",d.attribList.length=0,d.state=se.TEXT}function rt(d){var y,X=d.entity,x=X.toLowerCase(),Te="";return d.ENTITIES[X]?d.ENTITIES[X]:d.ENTITIES[x]?d.ENTITIES[x]:((X=x).charAt(0)==="#"&&(X.charAt(1)==="x"?(X=X.slice(2),Te=(y=parseInt(X,16)).toString(16)):(X=X.slice(1),Te=(y=parseInt(X,10)).toString(10))),X=X.replace(/^0+/,""),Te.toLowerCase()!==X?(Ht(d,"Invalid character entity"),"&"+d.entity+";"):String.fromCodePoint(y))}function I(d,y){y==="<"?(d.state=se.OPEN_WAKA,d.startTagPosition=d.position):me(q,y)&&(Ht(d,"Non-whitespace before first tag."),d.textNode=y,d.state=se.TEXT)}function R(d,y){var X="";return y1114111||pe(Re)!==Re)throw RangeError("Invalid code point: "+Re);Re<=65535?X.push(Re):(d=55296+((Re-=65536)>>10),y=Re%1024+56320,X.push(d,y)),(x+1===Te||X.length>16384)&&(Le+=L.apply(null,X),X.length=0)}return Le},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:Ze,configurable:!0,writable:!0}):String.fromCodePoint=Ze)})(Fe)},6739:function(Nt,Fe,de){(function(be,z,T,O,re){function F(R){if("contents"in R)for(var d=("styleAttrs"in R)?R.styleAttrs[O.byName.ruby.qname]:null,y=R.kind==="span"&&(d==="container"||d==="textContainer"||d==="baseContainer"),X=R.contents.length-1;X>=0;X--)!y||"styleAttrs"in R.contents[X]&&O.byName.ruby.qname in R.contents[X].styleAttrs?F(R.contents[X]):delete R.contents[X]}function q(R,d,y,X){var x=X&&X.timeContainer==="seq",Te=0;X&&(Te=x&&y?y.end:X.begin),d.begin=d.explicit_begin?d.explicit_begin+Te:Te;var Le=d.begin,Re=null;if("sets"in d)for(var ze=0;ze "+R.attributes[X].value)}}return y}function Wt(R,d,y){for(var X in R.attributes)if(R.attributes[X].uri===d&&R.attributes[X].local===y)return R.attributes[X].value;return null}function Ht(R,d,y){var X,x=null;return(X=/^(\d+(?:\.\d+)?)f$/.exec(y))!==null?d!==null&&(x=parseFloat(X[1])/d):(X=/^(\d+(?:\.\d+)?)t$/.exec(y))!==null?R!==null&&(x=parseFloat(X[1])/R):(X=/^(\d+(?:\.\d+)?)ms$/.exec(y))!==null?x=parseFloat(X[1])/1e3:(X=/^(\d+(?:\.\d+)?)s$/.exec(y))!==null?x=parseFloat(X[1]):(X=/^(\d+(?:\.\d+)?)h$/.exec(y))!==null?x=3600*parseFloat(X[1]):(X=/^(\d+(?:\.\d+)?)m$/.exec(y))!==null?x=60*parseFloat(X[1]):(X=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(y))!==null?x=3600*parseInt(X[1])+60*parseInt(X[2])+parseFloat(X[3]):(X=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(y))!==null&&d!==null&&(x=3600*parseInt(X[1])+60*parseInt(X[2])+parseInt(X[3])+(X[4]===null?0:parseInt(X[4])/d)),x}function cn(R,d,y){for(;d.styleRefs.length>0;){var X=d.styleRefs.pop();X in R.styles?(cn(R,R.styles[X],y),un(R.styles[X].styleAttrs,d.styleAttrs)):_e(y,"Non-existant style id referenced")}}function sn(R,d,y,X){for(var x=d.length-1;x>=0;x--){var Te=d[x];Te in R.styles?un(R.styles[Te].styleAttrs,y):_e(X,"Non-existant style id referenced")}}function un(R,d){for(var y in R)R.hasOwnProperty(y)&&(y in d||(d[y]=R[y]))}function ye(R,d){if(R&&R.warn&&R.warn(d))throw d}function _e(R,d){if(R&&R.error&&R.error(d))throw d}function rt(R,d){throw R&&R.fatal&&R.fatal(d),d}function I(R,d){for(var y,X=0,x=R.length-1;X<=x;){var Te=R[y=Math.floor((X+x)/2)];if(Ted))return{found:!0,index:y};x=y-1}}return{found:!1,index:X}}be.fromXML=function(R,d,y){var X=z.parser(!0,{xmlns:!0}),x=[],Te=[],Le=[],Re=0,ze=null;X.onclosetag=function(at){if(x[0]instanceof $e)ze.head!==null&&ze.head.styling!==null&&sn(ze.head.styling,x[0].styleRefs,x[0].styleAttrs,d),delete x[0].styleRefs;else if(x[0]instanceof le)for(var Bt in x[0].styles)x[0].styles.hasOwnProperty(Bt)&&cn(x[0],x[0].styles[Bt],d);else if(x[0]instanceof pe||x[0]instanceof Ze){if(x[0].contents.length>1){var St,Ct=[x[0].contents[0]];for(St=1;St0&&y&&"onCloseTag"in y&&y.onCloseTag());Le.shift(),Te.shift(),x.shift()},X.ontext=function(at){if(x[0]!==void 0)if(x[0]instanceof Ze||x[0]instanceof pe){if(x[0]instanceof Ze){var Bt=x[0].styleAttrs[O.byName.ruby.qname];if(Bt==="container"||Bt==="textContainer"||Bt==="baseContainer")return}var St=new se;St.initFromText(ze,x[0],at,Te[0],Le[0],d),x[0].contents.push(St)}else x[0]instanceof oe&&Re>0&&y&&"onText"in y&&y.onText(at)},X.onopentag=function(at){var Bt=at.attributes["xml:space"];Bt?Le.unshift(Bt.value):Le.length===0?Le.unshift("default"):Le.unshift(Le[0]);var St=at.attributes["xml:lang"];if(St?Te.unshift(St.value):Te.length===0?Te.unshift(""):Te.unshift(Te[0]),at.uri===T.ns_tt)if(at.local==="tt")ze!==null&&rt(d,"Two elements at ("+this.line+","+this.column+")"),(ze=new ee).initFromNode(at,Te[0],d),x.unshift(ze);else if(at.local==="head")x[0]instanceof ee||rt(d,"Parent of element is not at ("+this.line+","+this.column+")"),x.unshift(ze.head);else if(at.local==="styling")x[0]instanceof W||rt(d,"Parent of element is not at ("+this.line+","+this.column+")"),x.unshift(ze.head.styling);else if(at.local==="style"){var Ct;x[0]instanceof le?((Ct=new D).initFromNode(at,d),Ct.id?ze.head.styling.styles[Ct.id]=Ct:_e(d,"",n),$=[t.slice(V,n)],n+=8):h.indexOf(Z)===-1?(n++,$=M(Z,J)):n++;else n++;return J.__children=$,J}var w,Y=null;if(e.attrValue!==void 0)for(e.attrName=e.attrName||"id",Y=[];w=new RegExp("\\s"+e.attrName+`\\s*=['"]`+e.attrValue+`['"]`).exec(t),(n=w?w.index:-1)!==-1;)(n=t.lastIndexOf("<",n))!==-1&&Y.push(v()),t=t.substr(n),n=0;else Y=e.parseNode?v():M("");return e.filter&&(Y=Il(Y,e.filter)),e.simplify?Sl(Array.isArray(Y)?Y:[Y]):(e.setPos&&(Y.pos=n),Y)}function Sl(t){var e={};if(!t.length)return"";if(t.length===1&&typeof t[0]=="string")return t[0];for(var n in t.forEach(function(r){if(typeof r=="object"){e[r.tagName]||(e[r.tagName]=[]);var i=Sl(r.children);e[r.tagName].push(i),Object.keys(r.attributes).length&&typeof i!="string"&&(i._attributes=r.attributes)}}),e)e[n].length==1&&(e[n]=e[n][0]);return e}function Il(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";var i=[];return t.forEach(function(o,f){if(typeof o=="object"&&e(o,f,n,r)&&i.push(o),o.children){var g=Il(o.children,e,n+1,(r?r+".":"")+f+"."+o.tagName);i=i.concat(g)}}),i}const Hs=[p.default.PERIOD,p.default.BASE_URL,p.default.ADAPTATION_SET,p.default.REPRESENTATION,p.default.CONTENT_PROTECTION,p.default.ROLE,p.default.ACCESSIBILITY,p.default.AUDIO_CHANNEL_CONFIGURATION,p.default.CONTENT_COMPONENT,p.default.ESSENTIAL_PROPERTY,p.default.LABEL,p.default.S,p.default.SEGMENT_URL,p.default.EVENT,p.default.EVENT_STREAM,p.default.LOCATION,p.default.SERVICE_DESCRIPTION,p.default.SUPPLEMENTAL_PROPERTY,p.default.METRICS,p.default.REPORTING,p.default.PATCH_LOCATION,p.default.REPLACE,p.default.ADD,p.default.REMOVE,p.default.UTC_TIMING,p.default.INBAND_EVENT_STREAM,p.default.PRODUCER_REFERENCE_TIME,p.default.CONTENT_STEERING];function kl(t){t=t||{};const e=this.context,n=t.debug;let r,i,o,f;function g(l){try{let _=Gs(l,{parseNode:!0,attrMatchers:o,nodesAsArray:Hs}),b={};if(_.tagName.toLowerCase().indexOf("xml")!==-1)for(let u in _){if(Array.isArray(_[u])){b[u]=_[u][0];break}if(typeof _[u]=="object"){b[u]=_[u];break}}else b[_.tagName]=_,delete _.tagName;return b}catch{return null}}return r={getIron:function(){return f},parseXml:g,parse:function(l){let _;const b=window.performance.now();if(_=g(l),!_)throw new Error("failed to parse the manifest");_.Patch?(_=_.Patch,_.add&&_.add.forEach(c=>f.run(c)),_.replace&&_.replace.forEach(c=>f.run(c))):(_=_.MPD,f.run(_));const u=window.performance.now();return i.info("Parsing complete: "+(u-b).toPrecision(3)+"ms"),_.protocol="DASH",_}},i=n.getLogger(r),o=[new zs,new Os,new Fs,new Us],f=Ms(e).create({adaptationset:new qs,period:new Bs}),r}kl.__dashjs_factory_name="DashParser";var Ys=pe.default.getClassFactory(kl);function Al(t){t=t||{};const e=this.context,n=t.debug,r=t.settings,i=(0,me.default)(e).getInstance(),o=it(e).getInstance();let f,g,l,_,b,u=t.mssHandler,c=t.errHandler;function m(A){i.trigger(L.default.INTERNAL_MANIFEST_LOADED,{manifest:A.manifest})}return f={load:function(A){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;const C=new Date,M=new pl(A,Se.HTTPRequest.MPD_TYPE);N&&(M.serviceLocation=N),P&&(M.queryParams=P),M.startDate||(M.startDate=C),i.trigger(L.default.MANIFEST_LOADING_STARTED,{request:M}),l.load({request:M,success:function(G,ne,k){if(!_)return;let h,v,w;if(k&&k!==A?(v=o.parseBaseUrl(k),h=k):(o.isRelative(A)&&(A=o.resolve(A,window.location.href)),v=o.parseBaseUrl(A)),ne!="No Content")if(b===null&&(b=function(Y){let Z=null;return Y.indexOf("SmoothStreamingMedia")>-1?(u&&(Z=u.createMssParser(),u.createMssFragmentProcessor(),u.registerEvents()),Z):Y.indexOf("MPD")>-1||Y.indexOf("Patch")>-1?Ys(e).create({debug:n}):Z}(G)),b!==null){_.setParser(b);try{w=b.parse(G)}catch{return void i.trigger(L.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new ye.default(I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${A}`)})}if(w){if(w.url=h||A,w.originalUrl||(w.originalUrl=w.url),r&&r.get().streaming.enableManifestDurationMismatchFix&&w.mediaPresentationDuration&&w.Period.length>1){const Y=w.Period.reduce((Z,$)=>Z+$.duration,0);!isNaN(Y)&&w.mediaPresentationDuration>Y&&(g.warn("Media presentation duration greater than duration of all periods. Setting duration to total period duration"),w.mediaPresentationDuration=Y)}w.baseUri=v,w.loadedTime=new Date,_.resolveManifestOnLoad(w),i.trigger(L.default.ORIGINAL_MANIFEST_LOADED,{originalManifest:G})}else i.trigger(L.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new ye.default(I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${A}`)})}else i.trigger(L.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new ye.default(I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${A}`)});else i.trigger(L.default.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(G,ne,k){i.trigger(L.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new ye.default(I.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,I.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+`${A}, ${k}`)})}})},reset:function(){i.off(L.default.XLINK_READY,m,f),u&&u.reset(),_&&(_.reset(),_=null),l&&(l.abort(),l=null)}},g=n.getLogger(f),i.on(L.default.XLINK_READY,m,f),l=Oa(e).create({errHandler:t.errHandler,dashMetrics:t.dashMetrics,mediaPlayerModel:t.mediaPlayerModel,urlUtils:o,constants:B.default,dashConstants:p.default,errors:I,requestTimeout:t.settings.get().streaming.manifestRequestTimeout}),_=xs(e).create({errHandler:c,dashMetrics:t.dashMetrics,mediaPlayerModel:t.mediaPlayerModel,settings:t.settings}),b=null,f}Al.__dashjs_factory_name="ManifestLoader";var Vs=pe.default.getClassFactory(Al);function Rl(){let t;const e=this.context,n=(0,me.default)(e).getInstance();return t={error:function(r){n.trigger(L.default.ERROR,{error:r})}},t}Rl.__dashjs_factory_name="ErrorHandler";var Ks=pe.default.getSingletonFactory(Rl),Nl=de(559);function Cl(){const t=this.context,e=(0,me.default)(t).getInstance();let n,r,i,o,f,g,l;function _(m,A,N){const P=u(m,A,N);return i.isCodecSupportedBasedOnTestedConfigurations(P,m)}function b(m,A,N,P,C){const M=u(m,A,N),G=JSON.stringify(M);P.has(G)||(P.add(G),C.push(M))}function u(m,A,N){let P=null;switch(m){case B.default.VIDEO:P=function(C,M){let G={codec:M,width:C.width||null,height:C.height||null,framerate:C.frameRate||null,bitrate:C.bandwidth||null,isSupported:!0};o.get().streaming.capabilities.filterVideoColorimetryEssentialProperties&&Object.assign(G,function(h){let v={colorGamut:null,transferFunction:null,isSupported:!0};for(const w of h.EssentialProperty||[])w.schemeIdUri===B.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&["1","5","6","7"].includes(w.value.toString())?v.colorGamut=B.default.MEDIA_CAPABILITIES_API.COLORGAMUT.SRGB:w.schemeIdUri===B.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&["11","12"].includes(w.value.toString())?v.colorGamut=B.default.MEDIA_CAPABILITIES_API.COLORGAMUT.P3:w.schemeIdUri===B.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&["9"].includes(w.value.toString())?v.colorGamut=B.default.MEDIA_CAPABILITIES_API.COLORGAMUT.REC2020:w.schemeIdUri===B.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&["2"].includes(w.value.toString())?v.colorGamut=null:w.schemeIdUri===B.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&(v.isSupported=!1),w.schemeIdUri===B.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["1","6","13","14","15"].includes(w.value.toString())?v.transferFunction=B.default.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.SRGB:w.schemeIdUri===B.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["16"].includes(w.value.toString())?v.transferFunction=B.default.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.PQ:w.schemeIdUri===B.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["18"].includes(w.value.toString())?v.transferFunction=B.default.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.HLG:w.schemeIdUri===B.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&["2"].includes(w.value.toString())?v.transferFunction=null:w.schemeIdUri===B.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&(v.isSupported=!1);return v}(C));let ne=G.isSupported;o.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties&&Object.assign(G,function(h){let v={isSupported:!0,hdrMetadataType:null};for(const w of h.EssentialProperty||[])w.schemeIdUri===B.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&w.value===B.default.HDR_METADATA_FORMAT_VALUES.ST2094_10?v.hdrMetadataType=B.default.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_10:w.schemeIdUri===B.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&w.value===B.default.HDR_METADATA_FORMAT_VALUES.SL_HDR2?v.hdrMetadataType=B.default.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SLHDR2:w.schemeIdUri===B.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&w.value===B.default.HDR_METADATA_FORMAT_VALUES.ST2094_40?v.hdrMetadataType=B.default.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_40:w.schemeIdUri===B.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&(v.isSupported=!1);return v}(C));let k=G.isSupported;return ne&&k||(G.isSupported=!1),G}(A,N);break;case B.default.AUDIO:P=function(C,M){const G=C.audioSamplingRate||null;return{codec:M,bitrate:C.bandwidth||null,samplerate:G,isSupported:!0}}(A,N);break;default:return P}return function(C,M){return C&&C[p.default.CONTENT_PROTECTION]&&C[p.default.CONTENT_PROTECTION].length>0&&(M.keySystemsMetadata=g.getSupportedKeySystemMetadataFromContentProtection(C[p.default.CONTENT_PROTECTION])),M}(A,P)}function c(m){if(!m||m.length===0)return!0;let A=0;for(;A{const N=[B.default.VIDEO,B.default.AUDIO],P=[];N.forEach(C=>{(function(G,ne){if(!G||!G.Period||G.Period.length===0)return[];const k=new Set,h=[];return G.Period.forEach(v=>{v.AdaptationSet.forEach(w=>{r.getIsTypeOf(w,ne)&&w.Representation.forEach((Y,Z)=>{const $=r.getCodec(w,Z,!1);b(ne,Y,$,k,h);const J=r.getSupplementalCodecs(Y);J.length>0&&b(ne,Y,J[0],k,h)})})}),h})(m,C).forEach(G=>{P.push(i.runCodecSupportCheck(G,C))})}),Promise.allSettled(P).then(()=>(N.forEach(C=>{(function(M,G){G&&G.Period&&G.Period.length!==0&&G.Period.forEach(ne=>{(function(k,h){k&&k.AdaptationSet&&k.AdaptationSet.length!==0&&(k.AdaptationSet=k.AdaptationSet.filter(v=>{r.getIsTypeOf(v,h)&&function(Y,Z){Y.Representation&&Y.Representation.length!==0&&(Y.Representation=Y.Representation.filter(($,J)=>{const fe=r.getCodec(Y,J,!1),E=_(Z,$,fe);let Q=function(j,te){let K=!1;const H=r.getSupplementalCodecs(j);return H.length>0&&(H.length>1&&l.warn("[CapabilitiesFilter] Multiple supplemental codecs not supported; using the first in list"),K=_(te,j,H[0])),K}($,Z);return Q&&(l.debug(`[CapabilitiesFilter] Codec supported. Upgrading codecs string of Representation with ID ${$.id}`),$.codecs=$[p.default.SUPPLEMENTAL_CODECS]),E||Q||l.warn(`[CapabilitiesFilter] Codec ${fe} not supported. Removing Representation with ID ${$.id}`),E||Q}))}(v,h);const w=v.Representation&&v.Representation.length>0;return w||(e.trigger(L.default.ADAPTATION_SET_REMOVED_NO_CAPABILITIES,{adaptationSet:v}),l.warn(`[CapabilitiesFilter] AdaptationSet with ID ${v.id?v.id:"undefined"} and codec ${v.codecs?v.codecs:"undefined"} has been removed because of no supported Representation`)),w}))})(ne,M)})})(C,m)}),o.get().streaming.capabilities.filterUnsupportedEssentialProperties&&function(C){C&&C.Period&&C.Period.length!==0&&C.Period.forEach(M=>{M.AdaptationSet=M.AdaptationSet.filter(G=>!G.Representation||G.Representation.length===0||!!c(r.getEssentialPropertiesForAdaptationSet(G))&&(G.Representation=G.Representation.filter(ne=>c(r.getEssentialPropertiesForRepresentation(ne))),G.Representation&&G.Representation.length>0))})}(m),function(C){if(!C||!C.Period||C.Period.length===0)return Promise.resolve();const M=[];return C.Period.forEach(G=>{M.push(function(ne){return new Promise(k=>{if(!ne||!ne.AdaptationSet||ne.AdaptationSet.length===0)return void k();const h=[];ne.AdaptationSet.forEach(v=>{h.push(function(w){return new Promise(Y=>{if(!w.Representation||w.Representation.length===0)return void Y();const Z=[];w.Representation.forEach($=>{Z.push(function(J){const fe=[],E=f.getCustomCapabilitiesFilters();return E&&E.length!==0?E.forEach(Q=>{fe.push(new Promise(j=>j(Q(J))))}):fe.push(Promise.resolve(!0)),Promise.all(fe)}($))}),Promise.all(Z).then($=>{w.Representation=w.Representation.filter((J,fe)=>{let E=$[fe].every(Q=>Q);return E||l.debug("[Stream] Representation "+J.id+" has been removed because of unsupported CustomFilter"),E}),Y()}).catch($=>{l.warn("[Stream] at least one promise rejected in CustomFilter with error: ",$),Y()})})}(v))}),Promise.all(h).then(()=>{ne.AdaptationSet=ne.AdaptationSet.filter(v=>v.Representation&&v.Representation.length>0),k()}).catch(()=>{k()})})}(G))}),Promise.all(M)}(m))).then(()=>{A()}).catch(C=>{l.error(C),A()})})}},l=(0,Ze.default)(t).getInstance().getLogger(n),n}Cl.__dashjs_factory_name="CapabilitiesFilter";var Ws=pe.default.getSingletonFactory(Cl),$s=class{constructor(){this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null}};function Dl(){let t,e;return t={initialize:function(n){if(e=new $s,!n)return null;const r=n.indexOf("#");if(r!==-1){const i=n.substr(r+1).split("&");for(let o=0,f=i.length;o0?(c&&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?(c&&e.warn("Supplied minimum playback rate is out of range and will be limited to -0.5: -50% playback speed."),-.5):u}function g(u,c){return isNaN(u)?0:u<0?(c&&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?(c&&e.warn("Supplied maximum playback rate is out of range and will be limited to 1: 200% playback speed."),1):u}function l(){const u=_(),c=n.getLiveDelay();return!isNaN(c)&&c>0?Math.min(u,c):u}function _(){return o.get().streaming.buffer.bufferTimeDefault>0?o.get().streaming.buffer.bufferTimeDefault:b()?20:12}function b(){return o.get().streaming.buffer.fastSwitchEnabled!==null?o.get().streaming.buffer.fastSwitchEnabled:!n.getLowLatencyModeEnabled()}return t={getCatchupMaxDrift:function(){if(!isNaN(o.get().streaming.liveCatchup.maxDrift)&&o.get().streaming.liveCatchup.maxDrift>=0)return o.get().streaming.liveCatchup.maxDrift;const u=r.getServiceDescriptionSettings();return u&&u.liveCatchup&&!isNaN(u.liveCatchup.maxDrift)&&u.liveCatchup.maxDrift>=0?u.liveCatchup.maxDrift:12},getCatchupModeEnabled:function(){return o.get().streaming.liveCatchup.enabled!==null?o.get().streaming.liveCatchup.enabled:n.getInitialCatchupModeActivated()},getBufferTimeDefault:l,getBufferTimeDefaultUnadjusted:_,getFastSwitchEnabled:b,getInitialBufferLevel:function(){const u=o.get().streaming.buffer.initialBufferLevel;return isNaN(u)||u<0?0:Math.min(l(),u)},getRetryAttemptsForType:function(u){const c=isNaN(o.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:o.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return n.getLowLatencyModeEnabled()?o.get().streaming.retryAttempts[u]*c:o.get().streaming.retryAttempts[u]},getRetryIntervalsForType:function(u){const c=isNaN(o.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:o.get().streaming.retryIntervals.lowLatencyReductionFactor;return n.getLowLatencyModeEnabled()?o.get().streaming.retryIntervals[u]/c:o.get().streaming.retryIntervals[u]},getCatchupPlaybackRates:function(u){const c=o.get().streaming.liveCatchup.playbackRate;if(!isNaN(c.min)||!isNaN(c.max))return{min:f(c.min,u),max:g(c.max,u)};const m=r.getServiceDescriptionSettings();if(m&&m.liveCatchup&&(!isNaN(m.liveCatchup.playbackRate.min)||!isNaN(m.liveCatchup.playbackRate.max))){const A=m.liveCatchup.playbackRate;return{min:f(A.min,u),max:g(A.max,u)}}return{min:-.5,max:.5}},getAbrBitrateParameter:function(u,c){try{const m=o.get().streaming.abr[u][c];if(!isNaN(m)&&m!==-1)return m;const A=r.getServiceDescriptionSettings();return A&&A[u]&&!isNaN(A[u][c])?A[u][c]:-1}catch{return-1}},setConfig:function(u){u.playbackController&&(n=u.playbackController),u.serviceDescriptionController&&(r=u.serviceDescriptionController)},reset:function(){}},e=(0,Ze.default)(i).getInstance().getLogger(t),t}Ml.__dashjs_factory_name="MediaPlayerModel";var Zs=pe.default.getSingletonFactory(Ml);const er={DEFAULT:.5,STRONG:1,WEAK:0};function $r(t,e,n,r){let i,o,f,g,l;return o=t===void 0?null:t,f=function(_){let b=er.DEFAULT;return _!==er.DEFAULT&&_!==er.STRONG&&_!==er.WEAK||(b=_),b}(n),g=e===void 0?null:e,l=r===void 0?null:r,i={representation:o,reason:g,rule:l,priority:f},i}$r.__dashjs_factory_name="SwitchRequest";const vr=pe.default.getClassFactory($r);vr.NO_CHANGE=null,vr.PRIORITY=er,pe.default.updateClassFactory($r.__dashjs_factory_name,vr);var In=vr;function zl(t){t=t||{};const e=this.context,n=t.dashMetrics;let r,i;return r={getSwitchRequest:function(o){try{const f=In(e).create();f.rule=this.getClassName();const g=o.getMediaInfo(),l=o.getMediaType(),_=n.getCurrentBufferState(l),b=o.getScheduleController(),u=o.getAbrController(),c=o.getStreamInfo(),m=c?c.id:null,A=c&&c.manifestInfo?c.manifestInfo.isDynamic:null,N=o.getThroughputController(),P=N.getSafeAverageThroughput(l),C=N.getAverageLatency(l);return isNaN(P)||!_||u.getAbandonmentStateFor(m,l)===ie.ALLOW_LOAD&&(_.state===ie.BUFFER_LOADED||A)&&(f.representation=u.getOptimalRepresentationForBitrate(g,P,!0),f.reason={throughput:P,latency:C,message:`[ThroughputRule]: Switching to Representation with bitrate ${f.representation?f.representation.bitrateInKbit:"n/a"} kbit/s. Throughput: ${P}`},b.setTimeToLoadDelay(0)),f}catch(f){return i.error(f),In(e).create()}},reset:function(){}},i=(0,Ze.default)(e).getInstance().getLogger(r),r}zl.__dashjs_factory_name="ThroughputRule";var Ol=pe.default.getClassFactory(zl);function Pl(t){t=t||{};const e=this.context,n=(0,me.default)(e).getInstance(),r=t.dashMetrics,i=(0,R.default)(e).getInstance();let o,f,g;function l(){const u=i.get().streaming.abr.rules.insufficientBufferRule.parameters.segmentIgnoreCount;g={},g[B.default.VIDEO]={ignoreCount:u},g[B.default.AUDIO]={ignoreCount:u}}function _(){l()}function b(u){isNaN(u.startTime)||u.mediaType!==B.default.AUDIO&&u.mediaType!==B.default.VIDEO||g[u.mediaType].ignoreCount>0&&g[u.mediaType].ignoreCount--}return o={getSwitchRequest:function(u){const c=In(e).create();if(c.rule=this.getClassName(),!u||!u.hasOwnProperty("getMediaType"))return c;const m=u.getMediaType(),A=r.getCurrentBufferState(m),N=u.getRepresentation().fragmentDuration;if(!function(M,G,ne){return!M.getLowLatencyModeEnabled()&&g[G].ignoreCount<=0&&ne}(u.getScheduleController().getPlaybackController(),m,N))return c;const P=u.getMediaInfo(),C=u.getAbrController();if(A&&A.state===ie.BUFFER_EMPTY)f.debug("["+m+"] Switch to index 0; buffer is empty."),c.representation=C.getOptimalRepresentationForBitrate(P,0,!0),c.reason={message:"[InsufficientBufferRule]: Switching to lowest Representation because buffer is empty"};else{const M=u.getThroughputController(),G=r.getCurrentBufferLevel(m),ne=M.getAverageThroughput(m,null,NaN)*i.get().streaming.abr.rules.insufficientBufferRule.parameters.throughputSafetyFactor*G/N;if(isNaN(ne)||ne<=0)return c;c.representation=C.getOptimalRepresentationForBitrate(P,ne,!0),c.reason={message:"[InsufficientBufferRule]: Limiting maximum bitrate to avoid a buffer underrun.",bitrate:ne}}return c},reset:function(){l(),n.off(se.default.PLAYBACK_SEEKING,_,o),n.off(L.default.BYTES_APPENDED_END_FRAGMENT,b,o)}},f=(0,Ze.default)(e).getInstance().getLogger(o),l(),n.on(se.default.PLAYBACK_SEEKING,_,o),n.on(L.default.BYTES_APPENDED_END_FRAGMENT,b,o),o}Pl.__dashjs_factory_name="InsufficientBufferRule";var Js=pe.default.getClassFactory(Pl);function Ll(t){const e=(t=t||{}).mediaPlayerModel,n=t.dashMetrics,r=this.context,i=(0,R.default)(r).getInstance();let o,f,g;function l(){g={}}return o={shouldAbandon:function(_){const b=In(r).create();b.rule=this.getClassName();try{if(!_)return b;const u=_.getCurrentRequest();if(!isNaN(u.index)){if(u.firstByteDate===null||g.hasOwnProperty(u.index))return b;const c=e.getBufferTimeDefault(),m=_.getMediaType();if(n.getCurrentBufferLevel(m)>c)return b;const A=Date.now()-u.firstByteDate.getTime();if(u.traces.length>=i.get().streaming.abr.rules.abandonRequestsRule.parameters.minThroughputSamplesThreshold&&A>i.get().streaming.abr.rules.abandonRequestsRule.parameters.minSegmentDownloadTimeThresholdInMs&&u.bytesLoadedZ+$.b[0],0)-P.traces[0].b[0],k=Math.max(P.traces.reduce((Z,$)=>Z+$.d,0)-P.traces[0].d,1),h=Math.round(8*ne/k),v=Number(8*P.bytesTotal/h/1e3).toFixed(2),w=N.getRepresentation(),Y=N.getAbrController();if(vP.bytesTotal*J.bitrateInKbit/fe.bitrateInKbit&&(C.representation=J,C.reason={throughputInKbit:h,message:`[AbandonRequestRule][${G} is asking to abandon and switch to quality to ${J.absoluteIndex}. The measured bandwidth was ${h} kbit/s`},g[P.index]=!0)}return C}(_,u,b)}return b}catch(u){return f.error(u),b}},reset:l},f=(0,Ze.default)(r).getInstance().getLogger(o),l(),o}Ll.__dashjs_factory_name="AbandonRequestsRule";var eu=pe.default.getClassFactory(Ll);function Fl(){const t=this.context,e=(0,R.default)(t).getInstance();let n;return n={getSwitchRequest:function(r){const i=In(t).create();if(i.rule=this.getClassName(),!r||!r.hasOwnProperty("getDroppedFramesHistory"))return i;const o=r.getDroppedFramesHistory();if(!o)return i;const f=r.getStreamInfo().id,g=r.getMediaInfo(),l=r.getAbrController(),_=o.getFrameHistory(f);if(!_||Object.keys(_).length===0)return i;let b=0,u=0;const c=l.getPossibleVoRepresentationsFilteredBySettings(g,!0);let m=null;for(let A=1;Ae.get().streaming.abr.rules.droppedFramesRule.parameters.minimumSampleSize&&b/u>e.get().streaming.abr.rules.droppedFramesRule.parameters.droppedFramesPercentageThreshold)){m=c[A-1];break}}return m&&(i.representation=m,i.reason={droppedFrames:b,message:`[DroppedFramesRule]: Switching to index ${m.absoluteIndex}. Dropped Frames: ${b}, Total Frames: ${u}`}),i}},n}Fl.__dashjs_factory_name="DroppedFramesRule";var tu=pe.default.getClassFactory(Fl);function Ul(){const t=this.context,e=(0,R.default)(t).getInstance();let n;return n={getSwitchRequest:function(r){const i=In(t).create();if(i.rule=this.getClassName(),!r)return i;const o=r.getStreamInfo().id,f=r.getMediaType(),g=r?r.getSwitchRequestHistory():null,l=g?g.getSwitchRequests(o,f):{},_=r.getAbrController(),b=r.getMediaInfo(),u=_.getPossibleVoRepresentationsFilteredBySettings(b,!0);let c=0,m=0;for(let A=0;A=e.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize&&c/m>e.get().streaming.abr.rules.switchHistoryRule.parameters.switchPercentageThreshold)){i.representation=A>0&&l[N.id].drops>0?u[A-1]:N,i.reason={drops:c,noDrops:m,message:`[SwitchHistoryRule]: Switch to index: ${i.representation.absoluteIndex} samples: ${c+m} drops: ${c}`};break}}return i}},n}Ul.__dashjs_factory_name="SwitchHistoryRule";var nu=pe.default.getClassFactory(Ul);const wa="BOLA_STATE_ONE_BITRATE",wr="BOLA_STATE_STARTUP",Xr="BOLA_STATE_STEADY",ja=10;function jl(t){t=t||{};const e=this.context,n=t.dashMetrics,r=t.mediaPlayerModel,i=(0,me.default)(e).getInstance(),o=eo(e).getInstance();let f,g,l;function _(v){const w=v.mediaType,Y=v.streamId,Z=w===B.default.AUDIO?[B.default.AUDIO]:l[Y];for(const $ in Z)l[Y]&&l[Y].hasOwnProperty($)&&l[Y][$].state===Xr&&(l[Y][$].placeholderBuffer=0)}function b(v){const w=v.streamId;for(const Y in l[w])if(l[w].hasOwnProperty(Y)){const Z=l[w][Y];Z.state!==wa&&(Z.state=wr,u(Z))}}function u(v){v.placeholderBuffer=0,v.mostAdvancedSegmentStart=NaN,v.lastSegmentWasReplacement=!1,v.lastSegmentStart=NaN,v.lastSegmentDurationS=NaN,v.lastSegmentRequestTimeMs=NaN,v.lastSegmentFinishTimeMs=NaN}function c(v){try{if(v&&v.metric===ie.HTTP_REQUEST&&v.value&&v.value.type===Se.HTTPRequest.MEDIA_SEGMENT_TYPE&&v.value.trace&&v.value.trace.length){const w=l[v.value._streamId]&&l[v.value._streamId][v.mediaType]?l[v.value._streamId][v.mediaType]:null;w&&w.state!==wa&&(w.lastSegmentRequestTimeMs=v.value.trequest.getTime(),w.lastSegmentFinishTimeMs=v.value._tfinish.getTime(),m(w,v.mediaType))}}catch(w){g.error(w)}}function m(v,w){if(!isNaN(v.lastSegmentStart)&&!isNaN(v.lastSegmentRequestTimeMs)&&!isNaN(v.placeholderBuffer)){if(v.placeholderBuffer*=.99,!isNaN(v.lastSegmentFinishTimeMs)){const Y=n.getCurrentBufferLevel(w)+.001*(v.lastSegmentFinishTimeMs-v.lastSegmentRequestTimeMs),Z=C(v,v.currentRepresentation),$=Math.max(0,Z-Y);v.placeholderBuffer=Math.min($,v.placeholderBuffer)}v.lastSegmentWasReplacement&&!isNaN(v.lastSegmentDurationS)&&(v.placeholderBuffer+=v.lastSegmentDurationS),v.lastSegmentStart=NaN,v.lastSegmentRequestTimeMs=NaN}}function A(v){if(v&&l[v.streamId]&&l[v.streamId][v.mediaType]){const w=l[v.streamId][v.mediaType];w&&w.state!==wa&&(w.currentRepresentation=v.newRepresentation)}}function N(v,w,Y){const Z=Y.reduce((fe,E,Q)=>E>Y[fe]?Q:fe,0);if(Z===0)return null;const $=Math.max(v,ja+2*w.length),J=(Y[Z]-1)/($/ja-1);return{gp:J,Vp:ja/J}}function P(v,w){const Y=r.getBufferTimeDefault();if(v.bufferTimeDefault!==Y){const Z=N(Y,v.representations,v.utilities);if(Z.Vp!==v.Vp||Z.gp!==v.gp){const $=n.getCurrentBufferLevel(w);let J=$+v.placeholderBuffer;J-=ja,J*=Z.Vp/v.Vp,J+=ja,v.bufferTimeDefault=Y,v.Vp=Z.Vp,v.gp=Z.gp,v.placeholderBuffer=Math.max(0,J-$)}}}function C(v,w){return v.Vp*(v.utilities[w.absoluteIndex]+v.gp)}function M(v){if(v&&v.chunk&&v.chunk.representation.mediaInfo&&l[v.streamId]){const w=l[v.streamId][v.chunk.representation.mediaInfo.type];if(w&&w.state!==wa){const Y=v.chunk.start;isNaN(w.mostAdvancedSegmentStart)||Y>w.mostAdvancedSegmentStart?(w.mostAdvancedSegmentStart=Y,w.lastSegmentWasReplacement=!1):w.lastSegmentWasReplacement=!0,w.lastSegmentStart=Y,w.lastSegmentDurationS=v.chunk.duration,w.currentRepresentation=v.chunk.representation,m(w,v.chunk.representation.mediaInfo.type)}}}function G(){h()}function ne(v,w){const Y=w.absoluteIndex,Z=w.bandwidth,$=v.utilities[Y];let J=0;for(let fe=Y-1;fe>=0;--fe)if(v.utilities[fe]0?ne(w,w.currentRepresentation):ja;const $=Math.max(0,Z-Y);w.placeholderBuffer=Math.min(w.placeholderBuffer,$)}}}function h(){l={}}return f={getSwitchRequest:function(v){try{const w=In(e).create();v.getScheduleController().setTimeToLoadDelay(0),w.rule=this.getClassName(),w.reason=w.reason||{};const Y=function(Z){const $=Z.getMediaType(),J=Z.getStreamInfo().id;l[J]||(l={},l[J]={});let fe=l[J][$];return fe?fe.state!==wa&&P(fe,$):(fe=function(E){const Q={},j=E.getMediaInfo(),te=o.getPossibleVoRepresentationsFilteredBySettings(j,!0);let K=te.map(S=>S.bandwidth).map(S=>Math.log(S));K=K.map(S=>S-K[0]+1);const H=r.getBufferTimeDefault(),V=N(H,te,K);return V?(Q.state=wr,Q.representations=te,Q.utilities=K,Q.bufferTimeDefault=H,Q.Vp=V.Vp,Q.gp=V.gp,Q.currentRepresentation=null,u(Q)):Q.state=wa,Q}(Z),l[J][$]=fe),fe}(v);switch(w.reason.state=Y.state,Y.state){case wa:break;case wr:(function(Z,$,J){const fe=$.getMediaType(),E=$.getThroughputController().getSafeAverageThroughput(fe);if(isNaN(E))return;const Q=$.getMediaInfo(),j=o.getOptimalRepresentationForBitrate(Q,E,!0),te=n.getCurrentBufferLevel(fe);Z.representation=j,Z.reason.throughput=E,J.placeholderBuffer=Math.max(0,ne(J,j)-te),J.currentRepresentation=j,!isNaN(J.lastSegmentDurationS)&&te>=J.lastSegmentDurationS&&(J.state=Xr)})(w,v,Y);break;case Xr:(function(Z,$,J){const fe=$.getMediaType(),E=$.getThroughputController(),Q=$.getMediaInfo(),j=E.getSafeAverageThroughput(fe),te=$.getScheduleController();(function(U,ae){const ge=Date.now();if(isNaN(U.lastSegmentFinishTimeMs)){if(!isNaN(U.lastCallTimeMs)){const he=.001*(ge-U.lastCallTimeMs);U.placeholderBuffer+=Math.max(0,he)}}else{const he=.001*(ge-U.lastSegmentFinishTimeMs);U.placeholderBuffer+=Math.max(0,he)}U.lastCallTimeMs=ge,U.lastSegmentStart=NaN,U.lastSegmentRequestTimeMs=NaN,U.lastSegmentFinishTimeMs=NaN,P(U,ae)})(J,fe);const K=n.getCurrentBufferLevel(fe);let H=function(U,ae){const ge=U.representations.length;let he=NaN,Ue=NaN;for(let Ce=0;Ce=Ue)&&(Ue=He,he=Ce)}return U.representations[he]}(J,K+J.placeholderBuffer);const V=o.getOptimalRepresentationForBitrate(Q,j,!0);H.absoluteIndex>J.currentRepresentation.absoluteIndex&&H.absoluteIndex>V.absoluteIndex&&(H=V.absoluteIndex>J.currentRepresentation.absoluteIndex?V:J.currentRepresentation);let S=Math.max(0,K+J.placeholderBuffer-C(J,H));S<=J.placeholderBuffer?(J.placeholderBuffer-=S,S=0):(S-=J.placeholderBuffer,J.placeholderBuffer=0,o.isPlayingAtTopQuality(H)?S=0:te.setTimeToLoadDelay(1e3*S)),Z.representation=H,Z.reason.throughput=j,Z.reason.bufferLevel=K,Z.reason.placeholderBuffer=J.placeholderBuffer,Z.reason.delay=S,J.currentRepresentation=H})(w,v,Y);break;default:(function(Z,$,J){g.debug("BOLA ABR rule invoked in bad state.");const fe=$.getMediaInfo(),E=$.getMediaType(),Q=$.getThroughputController().getSafeAverageThroughput(E);Z.representation=o.getOptimalRepresentationForBitrate(fe,Q,!0),Z.reason.state=J.state,Z.reason.throughput=Q,J.state=wr,u(J)})(w,v,Y)}return w}catch(w){return g.error(w),In(e).create()}},handleNewMediaInfo:function(v){v&&v.streamInfo&&v.type&&l[v.streamInfo.id]&&l[v.streamInfo.id][v.type]&&delete l[v.streamInfo.id][v.type]},reset:function(){h(),i.off(se.default.BUFFER_EMPTY,_,f),i.off(se.default.PLAYBACK_SEEKING,b,f),i.off(se.default.METRIC_ADDED,c,f),i.off(se.default.QUALITY_CHANGE_REQUESTED,A,f),i.off(se.default.FRAGMENT_LOADING_ABANDONED,k,f),i.off(L.default.MEDIA_FRAGMENT_LOADED,M,f),i.off(L.default.SETTING_UPDATED_MAX_BITRATE,G,f),i.off(L.default.SETTING_UPDATED_MIN_BITRATE,G,f)}},g=(0,Ze.default)(e).getInstance().getLogger(f),h(),i.on(se.default.BUFFER_EMPTY,_,f),i.on(se.default.PLAYBACK_SEEKING,b,f),i.on(se.default.METRIC_ADDED,c,f),i.on(se.default.QUALITY_CHANGE_REQUESTED,A,f),i.on(se.default.FRAGMENT_LOADING_ABANDONED,k,f),i.on(L.default.MEDIA_FRAGMENT_LOADED,M,f),i.on(L.default.SETTING_UPDATED_MAX_BITRATE,G,f),i.on(L.default.SETTING_UPDATED_MIN_BITRATE,G,f),f}jl.__dashjs_factory_name="BolaRule";var ql=pe.default.getClassFactory(jl);const Sr="L2A_STATE_ONE_BITRATE",Ir="L2A_STATE_STARTUP",Bl="L2A_STATE_STEADY",kr=Math.pow(4,.99);function Gl(t){t=t||{};const e=this.context,n=t.dashMetrics,r=(0,me.default)(e).getInstance();let i,o,f,g;function l(N){N.placeholderBuffer=0,N.mostAdvancedSegmentStart=NaN,N.lastSegmentWasReplacement=!1,N.lastSegmentStart=NaN,N.lastSegmentDurationS=NaN,N.lastSegmentRequestTimeMs=NaN,N.lastSegmentFinishTimeMs=NaN,N.lastSegmentUrl=""}function _(){for(const N in o)if(o.hasOwnProperty(N)){const P=o[N];P.state!==Sr&&(P.state=Ir,l(P))}}function b(N){if(N&&N.chunk&&N.chunk.representation&&N.chunk.representation.mediaInfo){const P=o[N.chunk.representation.mediaInfo.type],C=f[N.chunk.representation.mediaInfo.type];if(P&&P.state!==Sr){const M=N.chunk.start;isNaN(P.mostAdvancedSegmentStart)||M>P.mostAdvancedSegmentStart?(P.mostAdvancedSegmentStart=M,P.lastSegmentWasReplacement=!1):P.lastSegmentWasReplacement=!0,P.lastSegmentStart=M,P.lastSegmentDurationS=N.chunk.duration,P.currentRepresentation=N.chunk.representation,c(P,C)}}}function u(N){if(N&&N.metric===ie.HTTP_REQUEST&&N.value&&N.value.type===Se.HTTPRequest.MEDIA_SEGMENT_TYPE&&N.value.trace&&N.value.trace.length){const P=o[N.mediaType],C=f[N.mediaType];P&&P.state!==Sr&&(P.lastSegmentRequestTimeMs=N.value.trequest.getTime(),P.lastSegmentFinishTimeMs=N.value._tfinish.getTime(),c(P,C))}}function c(N,P){isNaN(N.lastSegmentStart)||isNaN(N.lastSegmentRequestTimeMs)||(P.segment_request_start_s=.001*N.lastSegmentRequestTimeMs,P.segment_download_finish_s=.001*N.lastSegmentFinishTimeMs,N.lastSegmentStart=NaN,N.lastSegmentRequestTimeMs=NaN)}function m(N,P){if(N.length!==P.length)return-1;let C=0;for(let M=0;M=fe.B_target){h.state=Bl,fe.Q=kr;for(let Q=0;QZ&&(Q=-1),fe.w[ge]=fe.prev_w[ge]+Q*(E/(2*V))*((fe.Q+kr)*(H*he.bitrateInKbit/Z))}fe.w=function(ge){const he=ge.length;let Ue=!1,Ce=[];for(let Ot=0;Ot=He[Ot+1]){Ue=!0;break}Ue||(st=(ut+He[he-1]-1)/he);for(let Ot=0;Otge.bandwidth);fe.Q=Math.max(0,fe.Q-E+E*H*((m(S,fe.prev_w)+m(S,v))/Z));let U=[];for(let ge=0;geh.currentRepresentation.absoluteIndex&&S[h.currentRepresentation.absoluteIndex+1]<=Z&&(J=j.getRepresentationByAbsoluteIndex(h.currentRepresentation.absoluteIndex+1,te,!0)),J.bitrateInKbit>=Z&&(fe.Q=2*Math.max(kr,fe.Q)),h.lastSegmentUrl=$.url}k.representation=J,h.currentRepresentation=k.representation})(N,P,G);break;default:(function(ne,k,h){const v=ne.getAbrController(),w=ne.getMediaInfo(),Y=ne.getMediaType(),Z=ne.getThroughputController().getSafeAverageThroughput(Y);k.representation=v.getOptimalRepresentationForBitrate(w,Z,!0),k.reason.throughput=Z,h.state=Ir,l(h)})(N,P,G)}return P}catch(P){return g.error(P),In(e).create()}},reset:function(){A(),r.off(L.default.PLAYBACK_SEEKING,_,i),r.off(L.default.MEDIA_FRAGMENT_LOADED,b,i),r.off(L.default.METRIC_ADDED,u,i)}},g=(0,Ze.default)(e).getInstance().getLogger(i),A(),r.on(L.default.PLAYBACK_SEEKING,_,i),r.on(L.default.MEDIA_FRAGMENT_LOADED,b,i),r.on(L.default.METRIC_ADDED,u,i),i}Gl.__dashjs_factory_name="L2ARule";var au=pe.default.getClassFactory(Gl);function Hl(){const t=this.context;let e,n,r,i,o,f,g,l,_;function b(){r=null,i=1,o=100,f=0,g=null,l=null,_="dynamic_weight_selection"}function u(){let P=0;if(r)for(let C=0;CP&&(P=M.state.throughput)}return P}function c(P,C,M){let G=P.map((ne,k)=>M[k]*Math.pow(ne-C[k],2)).reduce((ne,k)=>ne+k);return(G<0?-1:1)*Math.sqrt(Math.abs(G))}function m(P,C){return c([P.state.throughput,P.state.latency,P.state.rebuffer,P.state.switch],[C.state.throughput,C.state.latency,C.state.rebuffer,C.state.switch],[1,1,1,1])}function A(P,C){for(let M=0;MU.bandwidth);f=Math.min(...S),i=function(U){const ae=U.map(ge=>Math.pow(ge,2)).reduce((ge,he)=>ge+he);return Math.sqrt(ae)}(S),V.forEach(U=>{let ae={representation:U,state:{throughput:U.bandwidth/i,latency:0,rebuffer:0,switch:0}};r.push(ae)}),l=function(U){let ae=[],ge=function(ut){let st=[];for(let xt=0;xtxt)&&(st=tn,xt=mt)}ae.push(st)}let Ue=null,Ce=null;for(let ut=0;utUe)&&(Ue=st,Ce=ut)}let He=[];for(He.push(ae[Ce]),ae.splice(Ce,1);ae.length>0;){let ut=null,st=null;for(let xt=0;xt1&&(Z=u()),G/=o;let $=r.find(K=>K.representation.id===h.id),J=$.representation.bandwidth*v.getSegmentDuration()/Y,fe=Math.max(0,J-ne);if(ne-JV&&H>ae.representation.bandwidth&&(V=ae.representation.bandwidth,S=ae)}return S}($,Y).representation;switch(_){case"manual_weight_selection":g=[.4,.4,.4,.4];break;case"random_weight_selection":g=function(K){let H=[],V=Math.sqrt(2/K);for(let S=0;S<4;S++)H.push(Math.random()*V);return g=H,g}(r.length);break;default:(function(K,H,V,S,U,ae){g||(g=l[l.length-1]);let ge=K.findWeightVector(r,H,V,S,U,ae);ge!==null&&ge!==-1&&(g=ge)})(v,w,ne,fe,Y,k)}let E=null,Q=null,j=null;for(let K=0;KM-1e4||ge)&&H.representation.bandwidth!==f&&(U[0]=100);let he=c(S,[Z,0,0,0],U);(E===null||hem?u-m:u+m-c,A}return e={getMinBuffer:function(){return f},getSegmentDuration:_,getNextBufferWithBitrate:function(u,c,m){return b(c,u*g/m)},getNextBuffer:b,findWeightVector:function(u,c,m,A,N,P){let C=null,M=null,G=null,ne=Math.abs(c-i);return u.forEach(k=>{r.forEach(h=>{h[0];let v,w=h[1],Y=h[2],Z=(h[3],k.representation.bandwidth*g/N),$=b(m,Z);v=Y===0?10:1/Y;let J=v*Math.max(1e-5,Z-$);v=w===0?10:1/w;let fe=v*k.state.latency,E=l.calculateSingleUseQoe(k.representation.bandwidth,J,fe,P);(C===null||E>C)&&function(Q,j,te){return!(Q>o+te)&&j>=f}(c,$,ne)&&(C=E,M=h,G=k.representation.bandwidth)})}),M===null&&G===null&&(M=-1),i=c,M}},n=[.2,.4,.6,.8,1],r=function(u){let c=u.map(function(A){return[A]}),m=function(A,N,P){if(P===N)return A;let C=A.length;for(let M=0;ME.bandwidth),h=g.getRepresentation().fragmentDuration,v=Math.min(...k)/1e3,w=Math.max(...k)/1e3,Y=c.bandwidth/1e3,Z=o.getCurrentHttpRequest(_,!0),$=(Z.tresponse.getTime()-Z.trequest.getTime())/1e3,J=$>h?$-h:0;i.setupPerSegmentQoe(h,w,v),i.logSegmentMetrics(Y,J,M,G);let fe=ou(f).create({targetLatency:1.5,bufferMin:.3,segmentDuration:h,qoeEvaluator:i});return l.representation=r.getNextQuality(b,m,1e3*ne,M,P,G,c,fe),l.reason={throughput:ne,latency:M},l.priority=In.PRIORITY.STRONG,N.setTimeToLoadDelay(0),l}catch(l){throw l}},reset:function(){r.reset(),i.reset()}},e=(0,Ze.default)(f).getInstance().getLogger(n),r=ru(f).create(),i=lu(f).create(),n}Kl.__dashjs_factory_name="LoLPRule";var su=pe.default.getClassFactory(Kl);function Qr(t){t=t||{};const e=this.context,n=t.mediaPlayerModel,r=t.customParametersModel,i=t.dashMetrics,o=t.settings,f=(0,me.default)(e).getInstance();let g,l,_,b;function u(){Object.values(B.default.QUALITY_SWITCH_RULES).forEach(C=>{l=c(C,l)});let P=Object.values(B.default.ABANDON_FRAGMENT_RULES);P.forEach(C=>{_=c(C,_)}),r.getAbrCustomRules().forEach(function(C){C.type===B.default.RULES_TYPES.QUALITY_SWITCH_RULES&&l.push(C.rule(e).create()),C.type===B.default.RULES_TYPES.ABANDON_FRAGMENT_RULES&&P.push(C.rule(e).create())}),l.length===0&&(l.push(ql(e).create({dashMetrics:i,mediaPlayerModel:n,settings:o})),l.push(Ol(e).create({dashMetrics:i})))}function c(P,C){const M=P.charAt(0).toLowerCase()+P.slice(1);return o.get().streaming.abr.rules[M].active&&!function(G,ne){return G.filter(k=>k.getClassName()===ne).length>0}(C,P)?(C.push(function(G){switch(G){case B.default.QUALITY_SWITCH_RULES.BOLA_RULE:return ql(e).create({dashMetrics:i,mediaPlayerModel:n,settings:o});case B.default.QUALITY_SWITCH_RULES.THROUGHPUT_RULE:return Ol(e).create({dashMetrics:i});case B.default.QUALITY_SWITCH_RULES.INSUFFICIENT_BUFFER_RULE:return Js(e).create({dashMetrics:i,settings:o});case B.default.QUALITY_SWITCH_RULES.SWITCH_HISTORY_RULE:return nu(e).create();case B.default.QUALITY_SWITCH_RULES.DROPPED_FRAMES_RULE:return tu(e).create();case B.default.QUALITY_SWITCH_RULES.LEARN_TO_ADAPT_RULE:return au(e).create({dashMetrics:i,settings:o});case B.default.QUALITY_SWITCH_RULES.LOL_PLUS_RULE:return su(e).create({dashMetrics:i});case B.default.ABANDON_FRAGMENT_RULES.ABANDON_REQUEST_RULE:return eu(e).create({dashMetrics:i,mediaPlayerModel:n,settings:o})}}(P)),C):o.get().streaming.abr.rules[M].active?C:function(G,ne){return G.filter(k=>k.getClassName()!==ne)}(C,P)}function m(P){return P.filter(C=>C.representation!==In.NO_CHANGE)}function A(P){const C={};let M,G,ne,k=null;if(P.length!==0){for(C[In.PRIORITY.STRONG]=null,C[In.PRIORITY.WEAK]=null,C[In.PRIORITY.DEFAULT]=null,M=0,G=P.length;M{C&&C.length&&C.forEach(M=>M.clearDataForStream&&typeof M.clearDataForStream=="function"&&M.clearDataForStream(P))})},getAbandonFragmentRules:function(){return _},getBestPossibleSwitchRequest:function(P){return P&&A(m(l.filter(C=>{const M=C.getClassName();if(M!==B.default.QUALITY_SWITCH_RULES.BOLA_RULE&&M!==B.default.QUALITY_SWITCH_RULES.THROUGHPUT_RULE)return!0;const G=P.getMediaType();return b[G]&&M===B.default.QUALITY_SWITCH_RULES.BOLA_RULE||!b[G]&&M===B.default.QUALITY_SWITCH_RULES.THROUGHPUT_RULE}).map(C=>C.getSwitchRequest(P))))||In(e).create()},getBolaState:function(P){return b[P]},getMinSwitchRequest:A,getQualitySwitchRules:function(){return l},handleNewMediaInfo:function(P){l.forEach(C=>C.handleNewMediaInfo&&C.handleNewMediaInfo(P)),_.forEach(C=>C.handleNewMediaInfo&&C.handleNewMediaInfo(P))},initialize:function(){l=[],_=[],b={},u(),f.on(L.default.SETTING_UPDATED_ABR_ACTIVE_RULES,N,g)},reset:function(){[l,_].forEach(P=>{P&&P.length&&P.forEach(C=>C.reset&&C.reset())}),l=[],_=[],b={},f.off(L.default.SETTING_UPDATED_ABR_ACTIVE_RULES,N,g)},setBolaState:function(P,C){b[P]=C},shouldAbandonFragment:function(P){if(!P)return In(e).create();const C=A(m(_.map(M=>M.shouldAbandon(P))));return C&&(C.reason.forceAbandon=!0),C||In(e).create()}},g}Qr.__dashjs_factory_name="ABRRulesCollection";const Wl=pe.default.getClassFactory(Qr);pe.default.updateSingletonFactory(Qr.__dashjs_factory_name,Wl);var uu=Wl;function $l(t){let e;const n=(t=t||{}).abrController,r=t.throughputController,i=t.switchRequestHistory,o=t.droppedFramesHistory,f=t.currentRequest,g=t.streamProcessor?t.streamProcessor.getScheduleController():null,l=t.streamProcessor?t.streamProcessor.getRepresentation():null,_=t.videoModel?t.videoModel:null;function b(){return l?l.mediaInfo:null}return e={getAbrController:function(){return n},getCurrentRequest:function(){return f},getDroppedFramesHistory:function(){return o},getMediaInfo:b,getMediaType:function(){const u=b();return u?u.type:null},getRepresentation:function(){return l},getScheduleController:function(){return g},getStreamInfo:function(){const u=b();return u?u.streamInfo:null},getSwitchRequestHistory:function(){return i},getThroughputController:function(){return r},getVideoModel:function(){return _}},e}$l.__dashjs_factory_name="RulesContext";var Xl=pe.default.getClassFactory($l);function Ql(){let t={},e={};const n=this.context,r=(0,R.default)(n).getInstance();return{clearForStream:function(i){delete t[i],delete e[i]},getSwitchRequests:function(i,o){return i!=null&&o!=null&&t[i]&&t[i][o]?t[i][o]:{}},push:function(i){const o=i.currentRepresentation,f=i.newRepresentation;if(o.mediaInfo.streamInfo.id!==f.mediaInfo.streamInfo.id||f.mediaInfo.id!==o.mediaInfo.id)return;const g=o.mediaInfo.streamInfo.id;t[g]||function(N){t[N]={},e[N]={}}(g);const l=o.mediaInfo.type;t[g][l]||function(N,P){t[N][P]={},e[N][P]=[]}(g,l);const _=i.currentRepresentation.id;t[g][l][_]||function(N,P,C){t[N][P][C]={noDrops:0,drops:0,dropSize:0}}(g,l,_);let b=i.newRepresentation.absoluteIndex-i.currentRepresentation.absoluteIndex,u=b<0?1:0,c=u?-b:0,m=u?0:1;t[g][l][i.currentRepresentation.id].drops+=u,t[g][l][i.currentRepresentation.id].dropSize+=c,t[g][l][i.currentRepresentation.id].noDrops+=m,e[g][l].push({id:i.currentRepresentation.id,noDrop:m,drop:u,dropSize:c});const A=function(N,P){return e[N][P].length>r.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize?e[N][P].shift():null}(g,l);A&&function(N,P,C){t[N][P][C.id].drops-=C.drop,t[N][P][C.id].dropSize-=C.dropSize,t[N][P][C.id].noDrops-=C.noDrop}(g,l,A)},reset:function(){t={},e={}}}}Ql.__dashjs_factory_name="SwitchRequestHistory";var du=pe.default.getClassFactory(Ql);function Zl(){let t={},e={},n={};return{clearForStream:function(r){delete t[r],delete e[r],delete n[r]},getFrameHistory:function(r){return t[r]},push:function(r,i,o){if(!i)return;t[r]||function(u){t[u]=[],e[u]=0,n[u]=0}(r);let f=o&&o.droppedVideoFrames?o.droppedVideoFrames:0,g=o&&o.totalVideoFrames?o.totalVideoFrames:0,l=f-e[r];e[r]=f;let _=g-n[r];n[r]=g;const b=t[r];b[i]?(b[i].droppedVideoFrames+=l,b[i].totalVideoFrames+=_):b[i]={droppedVideoFrames:l,totalVideoFrames:_}},reset:function(){t={},e={},n={}}}}Zl.__dashjs_factory_name="DroppedFramesHistory";var cu=pe.default.getClassFactory(Zl);function Zr(){const t=this.context,e=(0,Ze.default)(t).getInstance(),n=(0,me.default)(t).getInstance();let r,i,o,f,g,l,_,b,u,c,m,A,N,P,C,M,G,ne,k,h;function v(){_={},l={},G&&G.reset(),M&&M.reset(),C=void 0,G=void 0,M=void 0,clearTimeout(b),b=null}function w(j){let te=Y(j,!(arguments.length>1&&arguments[1]!==void 0)||arguments[1]);return te=function(K){try{return function(H){try{if(!h.get().streaming.cmsd.enabled||!h.get().streaming.cmsd.abr.applyMb)return H;const V=H.filter(S=>{const U=S.mediaInfo.type;let ae=N.getMaxBitrate(U);if(U!==B.default.VIDEO||ae<0)return!0;const ge=S.mediaInfo.streamInfo.id;return ae-=l[ge][B.default.AUDIO].getRepresentation().bitrateInKbit||0,S.bitrateInKbit<=ae});return V.length>0?V:H}catch(V){return i.error(V),H}}(K=function(H){try{if(!h.get().streaming.abr.limitBitrateByPortal)return H;const{elementWidth:V}=c.getVideoElementSize(),S=H.filter(U=>U.mediaInfo.type!==B.default.VIDEO||U.width<=V);return S.length>0?S:H}catch(V){return i.error(V),H}}(K=function(H){try{const V=H.filter(S=>{const U=S.mediaInfo.type,ae=S.bitrateInKbit,ge=m.getAbrBitrateParameter("maxBitrate",U),he=m.getAbrBitrateParameter("minBitrate",U);return!(ge>-1&&ae>ge||he>-1&&ae0?V:H}catch(V){return i.error(V),H}}(K)))}catch(H){return i.error(H),K}}(te),te}function Y(j,te){let K=[];return j&&(function(V){try{const S=[];if(V&&S.push(V),!h.get().streaming.abr.enableSupplementalPropertyAdaptationSetSwitching||!V.adaptationSetSwitchingCompatibleIds||V.adaptationSetSwitchingCompatibleIds.length===0)return S;const U=l[V.streamInfo.id][V.type].getAllMediaInfos().filter(ae=>V.adaptationSetSwitchingCompatibleIds.includes(ae.id));return S.concat(U)}catch{return[V]}}(j).forEach(V=>{let S=u.getVoRepresentations(V);S&&S.length>0&&(K=K.concat(S))}),K=function(V){return V=function(S){let U=null;return S.filter(ae=>(U||(U=ae.mediaInfo),!isNaN(ae.qualityRanking)&&u.areMediaInfosEqual(U,ae.mediaInfo))).length===S.length}(V)?function(S){return S.sort((U,ae)=>ae.qualityRanking-U.qualityRanking),S}(V):function(S){return S.sort((U,ae)=>u.areMediaInfosEqual(U.mediaInfo,ae.mediaInfo)?isNaN(U.pixelsPerSecond)||isNaN(ae.pixelsPerSecond)||U.pixelsPerSecond===ae.pixelsPerSecond?U.bandwidth-ae.bandwidth:U.pixelsPerSecond-ae.pixelsPerSecond:isNaN(U.pixelsPerSecond)||isNaN(ae.pixelsPerSecond)||U.pixelsPerSecond===ae.pixelsPerSecond?isNaN(U.bitsPerPixel)||isNaN(ae.bitsPerPixel)?U.bandwidth-ae.bandwidth:ae.bitsPerPixel-U.bitsPerPixel:U.pixelsPerSecond-ae.pixelsPerSecond),S}(V)}(K),K.forEach((V,S)=>{V.absoluteIndex=S}),K=K.filter(V=>{const S=!!te||u.areMediaInfosEqual(V.mediaInfo,j),U=!V||!V.mediaInfo||g.areKeyIdsUsable(V.mediaInfo);return S&&U})),K}function Z(j){const te=j.request.mediaType,K=j.streamId;if(!(te&&K&&l[K]&&h.get().streaming.abr.autoSwitchBitrate[te]))return;const H=l[K][te];if(!H)return;const V=Xl(t).create({abrController:r,streamProcessor:H,currentRequest:j.request,throughputController:ne,adapter:u,videoModel:c}),S=o.shouldAbandonFragment(V);S&&S.representation!==In.NO_CHANGE&&function(U,ae,ge,he,Ue){if(he.getFragmentModel().getRequests({state:un.FRAGMENT_MODEL_LOADING,index:U.request.index})[0]){const Ce=function(He,ut){return _[He]&&_[He][ut]?_[He][ut]:null}(ae,ge);Ce&&(Ce.state=ie.ABANDON_LOAD),M.reset(),fe(ge,f.getActiveStreamInfo(),Ue.representation,Ue.reason),clearTimeout(b),b=setTimeout(()=>{Ce&&(_[ae][ge].state=ie.ALLOW_LOAD),b=null},h.get().streaming.abandonLoadTimeout)}}(j,K,te,H,S)}function $(j){j.mediaType===B.default.VIDEO&&(C!==void 0&&G.push(j.streamId,C,c.getPlaybackQuality()),C=j.newRepresentation.id)}function J(j){!Q()||j.metric!==ie.BUFFER_LEVEL||j.mediaType!==B.default.AUDIO&&j.mediaType!==B.default.VIDEO||function(te,K){try{const H=m.getBufferTimeDefault(),V=H,S=.5*H,U=o.getBolaState(te),ae=K>=(U?S:V);o.setBolaState(te,ae),ae!==U&&(ae?i.info("["+te+"] switching from throughput to buffer occupancy ABR rule (buffer: "+K.toFixed(3)+")."):i.info("["+te+"] switching from buffer occupancy to throughput ABR rule (buffer: "+K.toFixed(3)+")."))}catch(H){i.error(H)}}(j.mediaType,.001*j.value.level)}function fe(j,te,K){let H=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(!(te&&te.id&&j&&l&&l[te.id]&&l[te.id][j]&&K))return;const V=l[te.id][j].getRepresentation();V&&K.id===V.id||E(V,K,H)}function E(j,te,K){const H=te.mediaInfo.streamInfo.id,V=te.mediaInfo.type;if(V&&l[H]&&l[H][V]){const S=l[H][V].getStreamInfo(),U=k.getCurrentBufferLevel(V),ae=j!==null&&!u.areMediaInfosEqual(j.mediaInfo,te.mediaInfo),ge=j?j.bitrateInKbit:0;i.info(`[AbrController]: Switching quality in period ${H} for media type ${V}. Switch from bitrate ${ge} to bitrate ${te.bitrateInKbit}. Current buffer level: ${U}. Reason:`+(K?JSON.stringify(K):"/")),n.trigger(L.default.QUALITY_CHANGE_REQUESTED,{oldRepresentation:j,newRepresentation:te,reason:K,streamInfo:S,mediaType:V,isAdaptationSetSwitch:ae},{streamId:S.id,mediaType:V});const he=ne.getAverageThroughput(V);isNaN(he)||P.setSavedBitrateSettings(V,he)}}function Q(){return h.get().streaming.abr.rules.bolaRule.active&&h.get().streaming.abr.rules.throughputRule.active}return r={checkPlaybackQuality:function(j,te){try{if(!(j&&l&&l[te]&&l[te][j]))return!1;if(G){const ae=c.getPlaybackQuality();ae&&G.push(te,C,ae)}if(!h.get().streaming.abr.autoSwitchBitrate[j])return!1;const K=l[te][j],H=K.getRepresentation(),V=Xl(t).create({abrController:r,throughputController:ne,switchRequestHistory:M,droppedFramesHistory:G,streamProcessor:K,adapter:u,videoModel:c}),S=o.getBestPossibleSwitchRequest(V);if(!S||!S.representation)return!1;let U=S.representation;return M.push({currentRepresentation:H,newRepresentation:U}),U.id!==H.id&&(_[te][j].state===ie.ALLOW_LOAD||U.absoluteIndex0)return te;let K=NaN;if(P&&P.hasOwnProperty("getSavedBitrateSettings")&&(K=P.getSavedBitrateSettings(j)),!isNaN(K))return K;const H=ne.getAverageThroughput(j);return!isNaN(H)&&H>0?H:j===B.default.VIDEO?1e3:100},getOptimalRepresentationForBitrate:function(j,te){const K=w(j,!(arguments.length>2&&arguments[2]!==void 0)||arguments[2]);if(!K||K.length===0)return null;const H=K.reduce((S,U)=>S.bandwidthS.bitrateInKbit<=te);return V&&V.length!==0?V.reduce((S,U)=>U.absoluteIndex>S.absoluteIndex?U:S):H},getPossibleVoRepresentations:function(j){return Y(j,!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])},getPossibleVoRepresentationsFilteredBySettings:w,getRepresentationByAbsoluteIndex:function(j,te){let K=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return isNaN(j)||j<0?null:w(te,K).find(H=>H.absoluteIndex===j)},handleNewMediaInfo:function(j){o.handleNewMediaInfo(j)},initialize:function(){G=cu(t).create(),M=du(t).create(),o=uu(t).create({dashMetrics:k,customParametersModel:A,mediaPlayerModel:m,settings:h}),o.initialize(),n.on(se.default.QUALITY_CHANGE_RENDERED,$,r),n.on(se.default.METRIC_ADDED,J,r),n.on(L.default.LOADING_PROGRESS,Z,r)},isPlayingAtLowestQuality:function(j){return w(j.mediaInfo,!0)[0].id===j.id},isPlayingAtTopQuality:function(j){if(!j)return!0;const te=w(j.mediaInfo,!0);return te[te.length-1].id===j.id},registerStreamType:function(j,te){const K=te.getStreamInfo().id;l[K]||(l[K]={}),l[K][j]=te,_[K]||(_[K]={}),_[K][j]={},_[K][j].state=ie.ALLOW_LOAD,o.getBolaState(j)===void 0&&o.setBolaState(j,h.get().streaming.abr.rules.bolaRule.active&&!Q())},reset:function(){v(),n.off(se.default.QUALITY_CHANGE_RENDERED,$,r),n.off(se.default.METRIC_ADDED,J,r),n.off(L.default.LOADING_PROGRESS,Z,r),o&&o.reset()},setConfig:function(j){j&&(j.streamController&&(f=j.streamController),j.throughputController&&(ne=j.throughputController),j.domStorage&&(P=j.domStorage),j.mediaPlayerModel&&(m=j.mediaPlayerModel),j.customParametersModel&&(A=j.customParametersModel),j.cmsdModel&&(N=j.cmsdModel),j.dashMetrics&&(k=j.dashMetrics),j.adapter&&(u=j.adapter),j.videoModel&&(c=j.videoModel),j.settings&&(h=j.settings),j.capabilities&&(g=j.capabilities))},setPlaybackQuality:fe,setWindowResizeEventCalled:function(j){},unRegisterStreamType:function(j,te){try{l[j]&&l[j][te]&&delete l[j][te],_[j]&&_[j][te]&&delete _[j][te]}catch{}}},i=e.getLogger(r),v(),r}Zr.__dashjs_factory_name="AbrController";const Jl=pe.default.getSingletonFactory(Zr);pe.default.updateSingletonFactory(Zr.__dashjs_factory_name,Jl);var eo=Jl;const fu=new Map([[B.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,"loadedmetadata"],[B.default.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA,"loadeddata"],[B.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,"canplay"],[B.default.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA,"canplaythrough"]]);function to(){let t,e,n,r,i,o,f,g,l,_,b;const u=this.context,c=(0,me.default)(u).getInstance(),m=[];function A(Z){r&&(arguments.length>1&&arguments[1]!==void 0&&arguments[1]?r.playbackRate=Z:Y(B.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,()=>{r.playbackRate=Z}))}function N(){return m.length>0}function P(Z){let $=m.indexOf(Z);if(Z!==null&&($!==-1&&m.splice($,1),n.get().streaming.buffer.syntheticStallEvents.enabled&&r&&!N())){const J=()=>{if(A(_||1,n.get().streaming.buffer.syntheticStallEvents.ignoreReadyState),!r.paused){const fe=document.createEvent("Event");fe.initEvent("playing",!0,!1),r.dispatchEvent(fe)}};n.get().streaming.buffer.syntheticStallEvents.ignoreReadyState?J():(f&&f.func&&f.event&&G(f.event,f.func),f=Y(B.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,J))}}function C(){if(r&&N()&&r.playbackRate===0){const Z=document.createEvent("Event");Z.initEvent("waiting",!0,!1),r.dispatchEvent(Z)}}function M(Z,$){r&&r.addEventListener(Z,$)}function G(Z,$){r&&r.removeEventListener(Z,$)}function ne(){return r?r.readyState:NaN}function k(){return r?r.buffered:null}function h(){return r?r.clientWidth:NaN}function v(){return r?r.clientHeight:NaN}function w(Z,$,J,fe,E){if(r){for(let Q=0;Q=Z?($(),null):function(J,fe){const E=()=>{G(J,E),fe(J)};return M(J,E),{func:E,event:J}}(fu.get(Z),$)}return t={addEventListener:M,addTextTrack:function(Z,$,J,fe,E){if(!r)return null;let Q=w(Z,$,J,fe,E);return Q||(Q=r.addTextTrack(Z,$,J),Q.isEmbedded=E,Q.isTTML=fe),Q},appendChild:function(Z){r&&(r.appendChild(Z),Z.isTTML!==void 0&&(r.textTracks[r.textTracks.length-1].isTTML=Z.isTTML,r.textTracks[r.textTracks.length-1].isEmbedded=Z.isEmbedded))},getBufferRange:k,getClientHeight:v,getClientWidth:h,getElement:function(){return r},getEnded:function(){return r?r.ended:null},getPlaybackQuality:function(){if(!r)return null;let Z="webkitDroppedFrameCount"in r&&"webkitDecodedFrameCount"in r,$=null;return"getVideoPlaybackQuality"in r?$=r.getVideoPlaybackQuality():Z&&($={droppedVideoFrames:r.webkitDroppedFrameCount,totalVideoFrames:r.webkitDroppedFrameCount+r.webkitDecodedFrameCount,creationTime:new Date}),$},getPlaybackRate:function(){return r?r.playbackRate:null},getPlayedRanges:function(){return r?r.played:null},getReadyState:ne,getSource:function(){return r?r.src:null},getTTMLRenderingDiv:function(){return g},getTextTrack:w,getTextTracks:function(){return r?r.textTracks:[]},getTime:function(){return r?isNaN(i)?r.currentTime:i:null},getVideoElementSize:function(){const Z=n.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;return{elementWidth:h()*Z,elementHeight:v()*Z}},getVideoHeight:function(){return r?r.videoHeight:NaN},getVideoRelativeOffsetLeft:function(){if(r){const Z=r.parentNode.host||r.parentNode;return Z?r.getBoundingClientRect().left-Z.getBoundingClientRect().left:NaN}return NaN},getVideoRelativeOffsetTop:function(){if(r){const Z=r.parentNode.host||r.parentNode;return Z?r.getBoundingClientRect().top-Z.getBoundingClientRect().top:NaN}return NaN},getVideoWidth:function(){return r?r.videoWidth:NaN},getVttRenderingDiv:function(){return l},initialize:function(){c.on(L.default.PLAYBACK_PLAYING,C,this)},isPaused:function(){return r?r.paused:null},isSeeking:function(){return r?r.seeking||!isNaN(i):null},isStalled:N,pause:function(){r&&(r.pause(),r.autoplay=!1)},play:function(){if(r){r.autoplay=!0;const Z=r.play();Z&&Z.catch&&typeof Promise<"u"&&Z.catch($=>{$.name==="NotAllowedError"&&c.trigger(L.default.PLAYBACK_NOT_ALLOWED),e.warn(`Caught pending play exception - continuing (${$})`)})}},removeChild:function(Z){r&&r.removeChild(Z)},removeEventListener:G,reset:function(){clearTimeout(b),c.off(L.default.PLAYBACK_PLAYING,C,this),m.length=0},setConfig:function(Z){Z&&Z.settings&&(n=Z.settings)},setCurrentTime:function(Z,$){r&&(o&&o.func&&o.event&&G(o.event,o.func),i=Z,o=Y(B.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,()=>{if(r)if(r.currentTime!==i)try{i=$?function(J){const fe=k();let E=J,Q=9999999999;if(fe)for(let j=0;j=te&&J<=K)return J;H=B.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA))){_=r.playbackRate,A(0,!0);const Q=document.createEvent("Event");Q.initEvent("waiting",!0,!1),r.dispatchEvent(Q)}}(J):P(J)})(Z,$)},setTTMLRenderingDiv:function(Z){g=Z,g.style.position="absolute",g.style.display="flex",g.style.overflow="hidden",g.style.pointerEvents="none",g.style.top=0,g.style.left=0},setVttRenderingDiv:function(Z){l=Z},waitForReadyState:Y},e=(0,Ze.default)(u).getInstance().getLogger(t),n=(0,R.default)(u).getInstance(),i=NaN,t}to.__dashjs_factory_name="VideoModel";var gu=pe.default.getSingletonFactory(to);const mu=[{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"}],no="dashjs_?_bitrate",ao="dashjs_?_settings",qa="localStorage",ro="lastBitrate",io="lastMediaSettings";function lo(t){t=t||{};const e=this.context,n=t.settings;let r,i,o;function f(b){if(o!==void 0)return o;let u;o=!1;try{typeof window<"u"&&(u=window[b])}catch(c){return i.warn("DOMStorage access denied: "+c.message),o}if(!u||b!==qa)return o;try{u.setItem("1","1"),u.removeItem("1"),o=!0}catch(c){i.warn("DOMStorage is supported, but cannot be used: "+c.message)}return o}function g(){return Math.round(new Date().getTime()/6e5)*6e5}function l(b,u){return f(b)&&n.get().streaming[u+"CachingInfo"].enabled}function _(){if(!n)throw new Error(B.default.MISSING_CONFIG_ERROR)}return r={getSavedBitrateSettings:function(b){if(_(),!n.get().streaming.lastBitrateCachingInfo.enabled)return NaN;let u=NaN;if(l(qa,ro)){const c=no.replace(/\?/,b);try{const m=JSON.parse(localStorage.getItem(c))||{},A=new Date().getTime()-parseInt(m.timestamp,10)>=n.get().streaming.lastBitrateCachingInfo.ttl||!1,N=parseFloat(m.bitrate);isNaN(N)||A?A&&localStorage.removeItem(c):(u=N,i.debug("Last saved bitrate for "+b+" was "+N))}catch{return null}}return u},setSavedBitrateSettings:function(b,u){if(l(qa,ro)&&u){const c=no.replace(/\?/,b);try{localStorage.setItem(c,JSON.stringify({bitrate:u.toFixed(3),timestamp:g()}))}catch(m){i.error(m.message)}}},getSavedMediaSettings:function(b){if(_(),!n.get().streaming.lastMediaSettingsCachingInfo.enabled)return null;let u=null;if(l(qa,io)){const c=ao.replace(/\?/,b);try{const m=JSON.parse(localStorage.getItem(c))||{},A=new Date().getTime()-parseInt(m.timestamp,10)>=n.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;u=m.settings,A&&(localStorage.removeItem(c),u=null)}catch{return null}}return u},setSavedMediaSettings:function(b,u){if(l(qa,io)){const c=ao.replace(/\?/,b);try{localStorage.setItem(c,JSON.stringify({settings:u,timestamp:g()}))}catch(m){i.error(m.message)}}}},i=(0,Ze.default)(e).getInstance().getLogger(r),f(qa)&&mu.forEach(b=>{const u=localStorage.getItem(b.oldKey);if(u){localStorage.removeItem(b.oldKey);try{localStorage.setItem(b.newKey,u)}catch(c){i.error(c.message)}}}),r}lo.__dashjs_factory_name="DOMStorage";var hu=pe.default.getSingletonFactory(lo),pu=de(8986);function oo(){const t=this.context;let e,n,r,i,o,f,g,l,_,b,u,c;function m(C,M,G,ne){let k=null;const h=C?c.resolve(C.path):null,v=ne||{init:!0,url:h?h.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:M,representation:C};n.debug("Start searching for initialization.");const w=P(v);g.load({request:w,success:function(Y){if(v.bytesLoaded=v.range.end,k=i.findInitRange(Y),!k)return v.range.end=v.bytesLoaded+v.bytesToLoad,m(C,M,G,v);C.range=k,G(C)},error:function(){G(C)}}),n.debug("Perform init search: "+v.url)}function A(C,M,G,ne,k,h){if(G&&(G.start===void 0||G.end===void 0)){const fe=G?G.toString().split("-"):null;G=fe?{start:parseFloat(fe[0]),end:parseFloat(fe[1])}:null}k=k||N;let v=null,w=null;const Y=!!G,Z=C?c.resolve(C.path):null,$={init:!1,url:Z?Z.url:void 0,range:Y?G:{start:0,end:1500},searching:!Y,bytesLoaded:h?h.bytesLoaded:0,bytesToLoad:1500,mediaType:M,representation:C},J=P($);g.load({request:J,success:function(fe){const E=$.bytesToLoad,Q=fe.byteLength;if($.bytesLoaded=$.range.end-$.range.start,v=i.parse(fe),w=v.getBox("sidx"),w&&w.isComplete){const j=w.references;let te,K;if(j!=null&&j.length>0&&(te=j[0].reference_type===1),te){let H,V,S,U,ae;n.debug("Initiate multiple SIDX load."),$.range.end=$.range.start+w.size;let ge=[],he=0,Ue=(w.offset||$.range.start)+w.size;const Ce=function(He){He?(ge=ge.concat(He),he++,he>=V&&(ge.sort(function(ut,st){return ut.startTime-st.startTime<0?-1:0}),k(ge,C,ne))):k(null,C,ne)};for(H=0,V=j.length;H{m(C,M,G)})},loadSegments:function(C,M,G){return new Promise(ne=>{A(C,M,G,ne)})},reset:function(){g&&(g.abort(),g=null)}},e}oo.__dashjs_factory_name="SegmentBaseLoader";var bu=pe.default.getSingletonFactory(oo);function so(t){let e;t=t||{};let n=new DataView(t.data),r=0;function i(f,g){let l,_,b=!0,u=0;if(g===void 0&&(g=!1),f.tag>16777215?(n.getUint32(r)!==f.tag&&(b=!1),u=4):f.tag>65535?(l=n.getUint16(r),_=n.getUint8(r+2),256*l+_!==f.tag&&(b=!1),u=3):f.tag>255?(n.getUint16(r)!==f.tag&&(b=!1),u=2):(n.getUint8(r)!==f.tag&&(b=!1),u=1),!b&&f.required&&!g)throw new Error("required tag not found");return b&&(r+=u),b}function o(f){let g=1,l=128,_=-1,b=0,u=n.getUint8(r),c=0;for(c=0;c<8;c+=1){if((u&l)===l){b=f===void 0?u&~l:u,_=c;break}l>>=1}for(c=0;c<_;c+=1,g+=1)b=b<<8|255&n.getUint8(r+g);return r+=g,b}return e={getPos:function(){return r},setPos:function(f){r=f},consumeTag:i,consumeTagAndSize:function(f,g){let l=i(f,g);return l&&o(),l},parseTag:function(f){let g;return i(f),g=o(),e[f.parse](g)},skipOverElement:function(f,g){let l,_=i(f,g);return _&&(l=o(),r+=l),_},getMatroskaCodedNum:o,getMatroskaFloat:function(f){let g;switch(f){case 4:g=n.getFloat32(r),r+=4;break;case 8:g=n.getFloat64(r),r+=8}return g},getMatroskaUint:function(f){if(f>4)return function(l){const _=Math.floor(Number.MAX_SAFE_INTEGER/256);let b=0;for(let u=0;u_)throw new Error("Value exceeds safe integer limit");b*=256;const c=n.getUint8(r+u);if(b>Number.MAX_SAFE_INTEGER-c)throw new Error("Value exceeds safe integer limit");b+=c}return r+=l,b}(f);let g=0;for(let l=0;l>>0},moreData:function(){return r{let A=null,N=u?_.resolve(u.path):null,P=u?u.range.split("-"):null,C={range:{start:P?parseFloat(P[0]):null,end:P?parseFloat(P[1]):null},request:A,url:N?N.url:void 0,init:!0,mediaType:c};n.info("Start loading initialization."),A=b(C),g.load({request:A,success:function(){m(u)},error:function(){m(u)}}),n.debug("Perform init load: "+C.url)})},loadSegments:function(u,c,m){return new Promise(A=>{let N=null,P=u?_.resolve(u.path):null,C=P?P.url:void 0;N=b({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:N,url:C,init:!1,mediaType:c,representation:u}),n.debug("Parsing ebml header"),g.load({request:N,success:function(M){(function(G,ne,k,h){if(!G||G.byteLength===0)return void h(null);let v,w,Y,Z,$=uo(t).create({data:G}),J=k?k.split("-"):null,fe=null,E={url:ne,range:{start:J?parseFloat(J[0]):null,end:J?parseFloat(J[1]):null},request:fe};for(n.debug("Parse EBML header: "+E.url),$.skipOverElement(r.EBML),$.consumeTag(r.Segment),Y=$.getMatroskaCodedNum(),Y+=$.getPos(),Z=$.getPos();$.moreData()&&!$.consumeTagAndSize(r.Segment.Info,!0);)if(!($.skipOverElement(r.Segment.SeekHead,!0)||$.skipOverElement(r.Segment.Tracks,!0)||$.skipOverElement(r.Segment.Cues,!0)||$.skipOverElement(r.Void,!0)))throw new Error("no valid top level element found");for(;v===void 0;){let Q=$.getMatroskaCodedNum(!0),j=$.getMatroskaCodedNum();Q===r.Segment.Info.Duration.tag?v=$[r.Segment.Info.Duration.parse](j):$.setPos($.getPos()+j)}fe=b(E),g.load({request:fe,success:function(Q){w=function(j,te,K,H){let V,S,U,ae,ge,he,Ue,Ce;for(S=function(He){let ut,st,xt=[],Ot=uo(t).create({data:He});for(Ot.consumeTagAndSize(r.Segment.Cues);Ot.moreData()&&Ot.consumeTagAndSize(r.Segment.Cues.CuePoint,!0);){for(ut={},ut.CueTime=Ot.parseTag(r.Segment.Cues.CuePoint.CueTime),ut.CueTracks=[];Ot.moreData()&&Ot.consumeTag(r.Segment.Cues.CuePoint.CueTrackPositions,!0);){const tn=Ot.getMatroskaCodedNum(),mt=Ot.getPos();if(st={},st.Track=Ot.parseTag(r.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),st.Track===0)throw new Error("Cue track cannot be 0");st.ClusterPosition=Ot.parseTag(r.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),ut.CueTracks.push(st),Ot.setPos(mt+tn)}if(ut.CueTracks.length===0)throw new Error("Mandatory cuetrack not found");xt.push(ut)}if(xt.length===0)throw new Error("mandatory cuepoint not found");return xt}(j),U=[],ge=0,he=S.length;gee.length!==0).map(e=>{let n={name:e},r=e.indexOf("[");if(r!=-1){n.name=e.substring(0,r);let i=e.substring(r+1,e.length-1);this.valid=this.valid&&i.indexOf("[")==-1;let o=i.indexOf("=");o!=-1?(n.attribute={name:i.substring(1,o),value:i.substring(o+1)},["'",'"'].indexOf(n.attribute.value[0])!=-1&&(n.attribute.value=n.attribute.value.substring(1,n.attribute.value.length-1))):n.position=parseInt(i,10)-1}return n})}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(t,e){let n=null,r=t,i=1,o="MPD";for(;i_[l.name]==l.value)[0]||null}else r=Array.isArray(g)?g[0]:g}i++}return r===null?null:o.startsWith("@")?{name:o.substring(1),leaf:r,target:r}:o==="text()"?{name:"__text",leaf:r,target:r}:{name:o,leaf:r,target:e?n:r}}},vu=class{constructor(t,e,n){this.action=t,this.xpath=e,this.value=n,this.position=null}getMpdTarget(t){let e=this.action==="remove"||this.action==="replace"||this.position==="before"||this.position==="after";return this.xpath.getMpdTarget(t,e)}};function mo(){let t,e;const n=this.context;return t={getIsPatch:function(r){return r&&r.hasOwnProperty(p.default.ORIGINAL_MPD_ID)||!1},getMpdId:function(r){return r&&r[p.default.ORIGINAL_MPD_ID]||null},getOriginalPublishTime:function(r){return r&&r.hasOwnProperty(p.default.ORIGINAL_PUBLISH_TIME)?new Date(r[p.default.ORIGINAL_PUBLISH_TIME]):null},getPatchOperations:function(r){return r?(r.__children||[]).map(i=>{const o=i.tagName;if(o!=="add"&&o!=="remove"&&o!=="replace")return e.warn(`Ignoring node of invalid action: ${o}`),null;let f=i.sel;if(o==="add"&&i.type){if(!i.type.startsWith("@"))return e.warn(`Ignoring add action for prefixed namespace declaration: ${i.type}=${i.__text}`),null;f=`${f}/${i.type}`}let g=new Tu(f);if(!g.isValid())return e.warn(`Ignoring action with invalid selector: ${o} - ${f}`),null;let l=null;g.findsAttribute()||g.findsTextReplace()?l=i.__text||"":o!=="remove"&&(l=i.__children.reduce((b,u)=>{let c=u.tagName;return c!=="#text"&&(b[c]=b[c]||[],b[c].push(u)),b},{}));let _=new vu(o,g,l);return o==="add"&&(_.position=i.pos),_}).filter(i=>!!i):[]},getPublishTime:function(r){return r&&r.hasOwnProperty(p.default.PUBLISH_TIME)?new Date(r[p.default.PUBLISH_TIME]):null}},e=(0,Ze.default)(n).getInstance().getLogger(t),t}mo.__dashjs_factory_name="PatchManifestModel";var wu=pe.default.getSingletonFactory(mo);function ma(t){let e=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(typeof TextDecoder<"u"){const l=new TextDecoder("utf-8").decode(t);if(e){const _=l.indexOf("\0");return _!==-1?l.substring(0,_):l}return l.replace(/\0/g,"")}const n=t.length;let r,i,o,f="",g=0;for(;g>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:f+=String.fromCharCode(r);break;case 12:case 13:i=t[g++],f+=String.fromCharCode((31&r)<<6|63&i);break;case 14:i=t[g++],o=t[g++],f+=String.fromCharCode((15&r)<<12|(63&i)<<6|63&o)}}return f}function ei(t){return function(e,n,r,i){const o=(f=e)instanceof ArrayBuffer?f:f.buffer;var f;let g=1;"BYTES_PER_ELEMENT"in i&&(g=i.BYTES_PER_ELEMENT);const l=(c=e)&&c.buffer instanceof ArrayBuffer&&c.byteLength!==void 0&&c.byteOffset!==void 0?e.byteOffset:0,_=(l+e.byteLength)/g,b=(l+n)/g,u=Math.floor(Math.max(0,Math.min(b,_)));var c;return new i(o,u,Math.floor(Math.min(u+Math.max(r,0),_))-u)}(t,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,Uint8Array)}function Su(t){return t.type==="PRIV"?function(e){if(e.size<2)return;const n=ma(e.data,!0),r=new Uint8Array(e.data.subarray(n.length+1));return{key:e.type,info:n,data:r.buffer}}(t):t.type[0]==="W"?function(e){if(e.type==="WXXX"){if(e.size<2)return;let r=1;const i=ma(e.data.subarray(r),!0);r+=i.length+1;const o=ma(e.data.subarray(r));return{key:e.type,info:i,data:o}}const n=ma(e.data);return{key:e.type,info:"",data:n}}(t):t.type==="APIC"?function(e){const n={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 r=e.data.subarray(1).indexOf(0);if(r===-1)return;const i=ma(ei(e.data,1,r)),o=e.data[2+r],f=e.data.subarray(3+r).indexOf(0);if(f===-1)return;const g=ma(ei(e.data,3+r,f));let l;return l=i==="-->"?ma(ei(e.data,4+r+f)):(_=e.data.subarray(4+r+f))instanceof ArrayBuffer?_:_.byteOffset==0&&_.byteLength==_.buffer.byteLength?_.buffer:new Uint8Array(_).buffer,n.mimeType=i,n.pictureType=o,n.description=g,n.data=l,n;var _}(t):function(e){if(e.size<2)return;if(e.type==="TXXX"){let r=1;const i=ma(e.data.subarray(r),!0);r+=i.length+1;const o=ma(e.data.subarray(r));return{key:e.type,info:i,data:o}}const n=ma(e.data.subarray(1));return{key:e.type,info:"",data:n}}(t)}function ho(t,e){let n=0;return n=(127&t[e])<<21,n|=(127&t[e+1])<<14,n|=(127&t[e+2])<<7,n|=127&t[e+3],n}function Iu(t){const e=String.fromCharCode(t[0],t[1],t[2],t[3]),n=ho(t,4);return{type:e,size:n,data:t.subarray(10,10+n)}}function ku(t,e){return e+10<=t.length&&t[e]===51&&t[e+1]===68&&t[e+2]===73&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128}function Au(t,e){return e+10<=t.length&&t[e]===73&&t[e+1]===68&&t[e+2]===51&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128}function po(){let t,e,n,r,i,o;const f=this.context;function g(k,h){const v=h?h.index:0,w=e.getAdaptationsForType(r[v].mpd.manifest,v,k);if(!w||w.length===0)return null;if(w.length>1&&h){for(let Z=0,$=w.length;Z<$;Z++)if(Y=w[Z],e.getRolesForAdaptation(Y).filter(function(J){return J.value===p.default.MAIN})[0])return w[Z]}var Y;return w[0]}function l(k,h,v,w,Y,Z){let $,J,fe,E,Q,j,te=[];if(!w||w.length===0)return[];const K=e.getAdaptationsForPeriod(h);for(E=0,j=w.length;E0?r[0].mpd.manifest:null)}function m(k){try{const h=A(k.streamInfo,r),v=e.getAdaptationsForPeriod(h);return k&&k.streamInfo&&k.streamInfo.id!==void 0&&v?v[k.index]:null}catch{return null}}function A(k,h){const v=h.length;for(let w=0;w=0&&o!==void 0)return!0})[0]&&(h.embeddedCaptions=!0),h.audioChannelConfiguration=e.getAudioChannelConfigurationForAdaptation(v),h.audioChannelConfiguration.length===0&&v.Representation&&v.Representation.length>0&&(h.audioChannelConfiguration=e.getAudioChannelConfigurationForRepresentation(v.Representation[0])),h.roles=e.getRolesForAdaptation(v),h.codec=e.getCodec(v),h.mimeType=e.getMimeType(v),h.contentProtection=e.getContentProtectionByAdaptation(v),h.bitrateList=e.getBitrateListForAdaptation(v),h.selectionPriority=e.getSelectionPriority(v),h.contentProtection&&h.contentProtection.length>0&&(h.contentProtection=function(w,Y){if(!w||!w.length||!Y)return w;const Z=e.getContentProtectionByManifest(Y);if(!Z||!Z.length)return w;const $=Z.reduce((J,fe)=>(fe.refId&&J.set(fe.refId,fe),J),new Map);return w.map(J=>{if(J.ref){const fe=$.get(J.ref);fe&&J.mergeAttributesFromReference(fe)}return J})}(h.contentProtection,k.period.mpd.manifest),h.contentProtection=function(w){const Y=w.map(Z=>Z.cencDefaultKid).filter(Z=>Z!==null);if(Y.length){const Z=Y[0];w.forEach($=>{$.keyId=Z})}return w}(h.contentProtection),h.normalizedKeyIds=function(w){const Y=new Set;return w.forEach(Z=>{Z.cencDefaultKid&&typeof Z.cencDefaultKid=="string"&&Y.add(Z.cencDefaultKid.replace(/-/g,"").toLowerCase())}),Y}(h.contentProtection)),h.isText=e.getIsText(v),h.essentialProperties=e.getCombinedEssentialPropertiesForAdaptationSet(v),h.supplementalProperties=e.getCombinedSupplementalPropertiesForAdaptationSet(v),h.isFragmented=e.getIsFragmented(v),h.isEmbedded=!1,h.adaptationSetSwitchingCompatibleIds=function(w){if(!w||!w.supplementalProperties)return[];let Y=[];const Z=w.supplementalProperties.filter($=>$.schemeIdUri===p.default.ADAPTATION_SET_SWITCHING_SCHEME_ID_URI);return Z&&Z.length>0&&(Y=Z[0].value.toString().split(",").map($=>$)),Y}(h),h}function P(k,h,v){k.id=h,k.index=100+parseInt(h.substring(2,3)),k.type=i.TEXT,k.codec="cea-608-in-SEI",k.isEmbedded=!0,k.isFragmented=!1,k.lang=Er(v),k.roles=[{schemeIdUri:"urn:mpeg:dash:role:2011",value:"caption"}]}function C(k){let h=new go;return h.id=k.id,h.index=k.index,h.start=k.start,h.duration=k.duration,h.manifestInfo=function(v){let w=new _u;return w.dvrWindowSize=v.timeShiftBufferDepth,w.loadedTime=v.manifest.loadedTime,w.availableFrom=v.availabilityStartTime,w.minBufferTime=v.manifest.minBufferTime,w.maxFragmentDuration=v.maxSegmentDuration,w.duration=e.getDuration(v.manifest),w.isDynamic=e.getIsDynamic(v.manifest),w.serviceDescriptions=e.getServiceDescriptions(v.manifest),w.protocol=v.manifest.protocol,w}(k.mpd),h.isLast=k.mpd.manifest.Period.length===1||Math.abs(h.start+h.duration-h.manifestInfo.duration)<1,h.isEncrypted=k.isEncrypted,h}function M(){if(!i)throw new Error("setConfig function has to be called previously")}function G(k){return r.length>0?r[0].mpd.manifest.Period[k]:null}function ne(k,h,v){let w,Y,Z,$,J,fe;if(k){for(Y=k.AdaptationSet,J=0;J{let w=v.getMpdTarget(k);if(w===null)return;let{name:Y,target:Z,leaf:$}=w;if(v.xpath.findsAttribute()||Y==="__text"){switch(v.action){case"add":case"replace":Z[Y]=v.value;break;case"remove":delete Z[Y]}return}let J=(Z[Y]||[]).indexOf($),fe=v.position==="prepend"||v.position==="before";if(v.action==="remove"||v.action==="replace")if(Array.isArray(Z[Y])){if(J!=-1){let E=Z[Y];E.splice(J,1),E.length>0?Z[Y]=E:delete Z[Y]}}else delete Z[Y];v.action!=="add"&&v.action!=="replace"||Object.keys(v.value).forEach(E=>{let Q=v.value[E],j=Z[E]||[];if(j.length===0&&Z[E]&&j.push(Z[E]),j.length===0)j=Q;else{let te=j.length;te=E==Y&&J!=-1?J+(fe?0:1)+(v.action==="replace"?-1:0):fe?0:j.length,j.splice.apply(j,[te,0].concat(Q))}Z[E]=j})})},areMediaInfosEqual:function(k,h){if(!k||!h)return!1;const v=k.id===h.id,w=k.codec===h.codec,Y=JSON.stringify(k.viewpoint)===JSON.stringify(h.viewpoint),Z=k.lang===h.lang,$=JSON.stringify(k.roles)===JSON.stringify(h.roles),J=JSON.stringify(k.accessibility)===JSON.stringify(h.accessibility),fe=JSON.stringify(k.audioChannelConfiguration)===JSON.stringify(h.audioChannelConfiguration);return v&&w&&Y&&Z&&$&&J&&fe},getAllMediaInfoForType:function(k,h,v){let w=r,Y=v,Z=[];if(Y)M(),w=_(Y);else{if(!(r.length>0))return Z;Y=r[0].mpd.manifest}const $=A(k,w);let J=e.getAdaptationsForType(Y,k?k.index:null,h);return Z=l(Y,$,k,J,h),h===i.TEXT&&(J=e.getAdaptationsForType(Y,k?k.index:null,i.VIDEO),Z=Z.concat(l(Y,$,k,J,h,!0))),Z},getAvailabilityStartTime:function(k){const h=b(k);return e.getAvailabilityStartTime(h)},getBandwidthForRepresentation:function(k,h){let v;return v=ne(G(h),k),v?v.bandwidth:null},getBaseURLsFromElement:function(k){return e.getBaseURLsFromElement(k)},getCodec:function(k,h,v){return e.getCodec(k,h,v)},getContentSteering:function(k){return e.getContentSteering(k)},getDuration:function(k){const h=c(k);return e.getDuration(h)},getEssentialPropertiesForAdaptationSet:function(k){try{return e.getEssentialPropertiesForRepresentation(k)}catch{return[]}},getEssentialPropertiesForRepresentation:function(k){try{return e.getEssentialPropertiesForRepresentation(k)}catch{return[]}},getEvent:function(k,h,v,w){try{if(!k||!h||isNaN(v)||!w)return null;const Y=k.scheme_id_uri,Z=k.value;if(!h[Y+"/"+Z])return null;const $=new bt,J=k.timescale||1,fe=w.adaptation.period.start,E=h[Y+"/"+Z],Q=isNaN(w.presentationTimeOffset)?isNaN(E.presentationTimeOffset)?0:E.presentationTimeOffset:w.presentationTimeOffset;let j,te=k.presentation_time_delta/J;j=k.version===0?fe+v-Q+te:fe-Q+te;const K=k.event_duration/J,H=k.id,V=k.message_data;return $.eventStream=E,$.eventStream.value=Z,$.eventStream.timescale=J,$.duration=K,$.id=H,$.calculatedPresentationTime=j,$.messageData=V,$.presentationTimeDelta=te,$.parsedMessageData=Y===B.default.ID3_SCHEME_ID_URI?function(S){let U=0;const ae=[];for(;Au(S,U);){const ge=ho(S,U+6);S[U+5]>>6&1&&(U+=10),U+=10;const he=U+ge;for(;U+100){const Y=r[0].mpd.manifest;if(k instanceof go){const Z=A(k,r);w=e.getEventsForPeriod(Z)}else if(k instanceof Jr){const Z=A(v,r);w=e.getEventStreamForAdaptationSet(Y,m(k),Z)}else if(k instanceof Tn){const Z=A(v,r);w=e.getEventStreamForRepresentation(Y,h,Z)}}return w},getIndexForRepresentation:function(k,h){return function(v,w){const Y=ne(v,w,!0);return Y!==null?Y:-1}(G(h),k)},getIsDVB:function(k){return e.hasProfile(k,"urn:dvb:dash:profile:dvb-dash:2014")},getIsDynamic:function(k){const h=c(k);return e.getIsDynamic(h)},getIsPatch:function(k){return n.getIsPatch(k)},getIsTextTrack:function(k){return e.getIsText(k)},getIsTypeOf:function(k,h){return e.getIsTypeOf(k,h)},getLocation:function(k){return e.getLocation(k)},getMainAdaptationForType:g,getManifestUpdatePeriod:function(k){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.getManifestUpdatePeriod(k,h)},getMediaInfoForType:function(k,h){if(r.length===0||!k)return null;let v=A(k,r);if(!v)return null;const w=e.getAdaptationsForPeriod(v);let Y=g(h,k);return Y?N(w[e.getIndexForAdaptation(Y,r[0].mpd.manifest,k.index)]):null},getMpd:b,getPatchLocation:function(k){const h=e.getPatchLocation(k),v=e.getPublishTime(k);return h&&h.length!==0&&v?h.filter(w=>isNaN(w.ttl)||v.getTime()+w.ttl>new Date().getTime()):[]},getPeriodById:function(k){if(!k||r.length===0)return null;const h=r.filter(v=>v.id===k);return h&&h.length>0?h[0]:null},getProducerReferenceTimes:function(k,h){let v,w;const Y=A(k,r);return v=h?h.id:null,r.length>0&&Y&&(w=v?e.getAdaptationForId(v,r[0].mpd.manifest,Y.index):e.getAdaptationForIndex(h?h.index:null,r[0].mpd.manifest,Y.index)),w?e.getProducerReferenceTimesForAdaptation(w):[]},getPublishTime:function(k){return e.getPublishTime(k)},getRealAdaptation:function(k,h){let v,w;const Y=A(k,r);return v=h?h.id:null,r.length>0&&Y&&(w=v?e.getAdaptationForId(v,r[0].mpd.manifest,Y.index):e.getAdaptationForIndex(h?h.index:null,r[0].mpd.manifest,Y.index)),w},getRealPeriodByIndex:function(k){return e.getRealPeriodForIndex(k,r[0].mpd.manifest)},getRegularPeriods:_,getRepresentationSortFunction:function(){return e.getRepresentationSortFunction()},getStreamsInfo:function(k,h){const v=[];let w=r;if(k&&(M(),w=_(k)),w.length>0){(!h||h>w.length)&&(h=w.length);for(let Y=0;Y0?r[0].mpd:null;return e.getSuggestedPresentationDelay(k)},getSupplementalCodecs:function(k){const h=k[p.default.SUPPLEMENTAL_CODECS];return h?h.split(" ").map(v=>k.mimeType+';codecs="'+v+'"'):[]},getUTCTimingSources:function(){const k=c();return e.getUTCTimingSources(k)},getVoRepresentations:function(k){let h;const v=m(k);return h=e.getRepresentationsForAdaptation(v,k),h},isPatchValid:function(k,h){let v=e.getId(k),w=n.getMpdId(h),Y=e.getPublishTime(k),Z=n.getPublishTime(h),$=n.getOriginalPublishTime(h);return!!(v&&w&&v==w&&Y&&$&&Y.getTime()==$.getTime()&&Z&&Y.getTime()e.get().streaming.metrics.maxListDepth&&P[A].shift())}function c(m,A,N){u(m,A,N),_(m,A,N)}return n={addBufferLevel:function(m,A,N){let P=new xu;P.t=A,P.level=N,c(m,ie.BUFFER_LEVEL,P)},addBufferState:function(m,A,N){let P=new Mu;P.target=N,P.state=A,c(m,ie.BUFFER_STATE,P)},addDVBErrors:function(m){c(B.default.STREAM,ie.DVB_ERRORS,m)},addDVRInfo:function(m,A,N,P){let C=new zu;C.time=A,C.range=P,C.manifestInfo=N,c(m,ie.DVR_INFO,C)},addDroppedFrames:function(m,A){let N=new Ou,P=b(m).DroppedFrames;A&&(N.time=A.creationTime,N.droppedFrames=A.droppedVideoFrames,P.length>0&&P[P.length-1]==N||c(m,ie.DROPPED_FRAMES,N))},addHttpRequest:function m(A,N,P,C){let M=new Se.HTTPRequest;N.url&&N.url!==A.url&&(m({mediaType:A.mediaType,type:A.type,url:A.url,quality:A.quality,serviceLocation:null,range:A.range,startDate:A.startDate,firstByteDate:null,endDate:null,duration:A.duration,fileLoaderType:A.fileLoaderType,resourceTimingValues:A.resourceTimingValues},{url:null,status:null,headers:null},null,C),M.actualurl=N.url),M.tcpid=null,M.type=A.type,M.url=A.url,M.range=A.range||null,M.trequest=A.startDate,M.tresponse=A.firstByteDate,M.responsecode=N.status,M.cmsd=C,M._tfinish=A.endDate,M._stream=A.mediaType,M._mediaduration=A.duration,M._quality=A.quality,M._responseHeaders="";for(const G in N.headers)M._responseHeaders+=G+": "+N.headers[G]+`\r +`;M._serviceLocation=A.serviceLocation||null,M._fileLoaderType=A.fileLoaderType,M._resourceTimingValues=A.resourceTimingValues,M._streamId=A&&A.representation&&A.representation.mediaInfo&&A.representation.mediaInfo.streamInfo?A.representation.mediaInfo.streamInfo.id:null,P?P.forEach(G=>{(function(ne,k,h,v){let w=new Se.HTTPRequestTrace;w.s=k,w.d=h,w.b=v,ne.trace.push(w),ne.interval||(ne.interval=0),ne.interval+=h})(M,G.s,G.d,G.b,G.t)}):(delete M.interval,delete M.trace),c(A.mediaType,ie.HTTP_REQUEST,M)},addManifestUpdate:function(m,A,N,P){let C=new Pu;C.mediaType=m,C.type=A,C.requestTime=N,C.fetchTime=P,u(B.default.STREAM,ie.MANIFEST_UPDATE,C),_(m,ie.MANIFEST_UPDATE,C)},addManifestUpdateRepresentationInfo:function(m,A,N){if(m&&m.representationInfo){const P=new Fu;P.id=A?A.id:null,P.index=A?A.index:null,P.mediaType=N,P.startNumber=A?A.startNumber:null,P.presentationTimeOffset=A?A.presentationTimeOffset:null,m.representationInfo.push(P),l(m.mediaType,ie.MANIFEST_UPDATE_TRACK_INFO,m)}},addManifestUpdateStreamInfo:function(m,A,N,P,C){if(m){let M=new Lu;M.id=A,M.index=N,M.start=P,M.duration=C,m.streamInfo.push(M),l(m.mediaType,ie.MANIFEST_UPDATE_STREAM_INFO,m)}},addPlayList:function(m){m.trace&&Array.isArray(m.trace)?m.trace.forEach(A=>{A.hasOwnProperty("subreplevel")&&!A.subreplevel&&delete A.subreplevel}):delete m.trace,c(B.default.STREAM,ie.PLAY_LIST,m)},addRepresentationSwitch:function(m,A,N,P,C){let M=new Du;M.t=A,M.mt=N,M.to=P,C?M.lto=C:delete M.lto,c(m,ie.TRACK_SWITCH,M)},addRequestsQueue:function(m,A,N){let P=new ju;P.loadingRequests=A,P.executedRequests=N,b(m).RequestsQueue=P,_(m,ie.REQUESTS_QUEUE,P)},addSchedulingInfo:function(m,A,N,P,C,M,G,ne,k){let h=new Uu;h.mediaType=m,h.t=A,h.type=N,h.startTime=P,h.availabilityStartTime=C,h.duration=M,h.bandwidth=G,h.range=ne,h.state=k,c(m,ie.SCHEDULING_INFO,h)},clearAllCurrentMetrics:function(){r={},f()},clearCurrentMetricsForType:function(m){delete r[m],g(m)},getMetricsFor:b,updateManifestUpdateInfo:function(m,A){if(m){for(let N in A)m[N]=A[N];l(m.mediaType,ie.MANIFEST_UPDATE,m)}}},r={},n}bo.__dashjs_factory_name="MetricsModel";var qu=pe.default.getSingletonFactory(bo);function yo(t){t=t||{};const e=this.context;let n,r,i,o,f=t.metricsModel;function g(b){const u=f.getMetricsFor(b,!0);if(!u)return null;const c=u.HttpList;let m,A=null;if(!c||c.length<=0)return null;for(m=c.length-1;m>=0;){if(c[m].responsecode){A=c[m];break}m--}return A}function l(b){const u=f.getMetricsFor(b,!0);return u&&u.HttpList?u.HttpList:[]}function _(b,u){if(!b)return null;const c=b[u];return c&&c.length!==0?c[c.length-1]:null}return n={getCurrentRepresentationSwitch:function(b){return _(f.getMetricsFor(b,!0),ie.TRACK_SWITCH)},getCurrentBufferState:function(b){return _(f.getMetricsFor(b,!0),ie.BUFFER_STATE)},getCurrentBufferLevel:function(b){const u=_(f.getMetricsFor(b,!0),ie.BUFFER_LEVEL);return u?Nu.round10(u.level/1e3,-3):0},getCurrentHttpRequest:g,getHttpRequests:l,getCurrentDroppedFrames:function(){return _(f.getMetricsFor(B.default.VIDEO,!0),ie.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(b){return _(f.getMetricsFor(b,!0),ie.SCHEDULING_INFO)},getCurrentDVRInfo:function(b){return _(b?f.getMetricsFor(b,!0):f.getMetricsFor(B.default.VIDEO,!0)||f.getMetricsFor(B.default.AUDIO,!0),ie.DVR_INFO)},getCurrentManifestUpdate:function(){return _(f.getMetricsFor(B.default.STREAM),ie.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(b,u){if(!u)return null;let c={},m=g(b);m&&(c=vn.default.parseHttpHeaders(m._responseHeaders));const A=c[u.toLowerCase()];return A===void 0?null:A},getLatestMPDRequestHeaderValueByID:function(b){if(!b)return null;let u,c,m,A={};for(u=l(B.default.STREAM),m=u.length-1;m>=0;m--)if(c=u[m],c.type===Se.HTTPRequest.MPD_TYPE){A=vn.default.parseHttpHeaders(c._responseHeaders);break}const N=A[b.toLowerCase()];return N===void 0?null:N},addRepresentationSwitch:function(b,u,c,m,A){f.addRepresentationSwitch(b,u,c,m,A)},addDVRInfo:function(b,u,c,m){f.addDVRInfo(b,u,c,m)},updateManifestUpdateInfo:function(b){const u=this.getCurrentManifestUpdate();f.updateManifestUpdateInfo(u,b)},addManifestUpdateStreamInfo:function(b){if(b){const u=this.getCurrentManifestUpdate();f.addManifestUpdateStreamInfo(u,b.id,b.index,b.start,b.duration)}},addManifestUpdateRepresentationInfo:function(b,u){if(b){const c=this.getCurrentManifestUpdate();f.addManifestUpdateRepresentationInfo(c,b,u)}},addManifestUpdate:function(b){f.addManifestUpdate(B.default.STREAM,b.type,b.startDate,b.endDate)},addHttpRequest:function(b,u,c,m,A,N){const P={status:c,headers:m,url:u};f.addHttpRequest(b,P,A,N)},addSchedulingInfo:function(b,u){f.addSchedulingInfo(b.mediaType,new Date,b.type,b.startTime,b.availabilityStartTime,b.duration,b.bandwidth,b.range,u)},addRequestsQueue:function(b,u,c){f.addRequestsQueue(b,u,c)},addBufferLevel:function(b,u,c){f.addBufferLevel(b,u,c)},addBufferState:function(b,u,c){f.addBufferState(b,u,c)},addDroppedFrames:function(b){f.addDroppedFrames(B.default.VIDEO,b)},addPlayList:function(){o&&(f.addPlayList(o),o=null)},addDVBErrors:function(b){f.addDVBErrors(b)},createPlaylistMetrics:function(b,u){o=new _t,o.start=new Date,o.mstart=b,o.starttype=u},createPlaylistTraceMetrics:function(b,u,c){r===!0&&(r=!1,i=new nn,i.representationid=b,i.start=new Date,i.mstart=u,i.playbackspeed=c!==null?c.toString():null)},updatePlayListTraceMetrics:function(b){if(i)for(let u in i)i[u]=b[u]},pushPlayListTraceMetrics:function(b,u){if(r===!1&&o&&i&&i.start){const c=i.start;i.duration=b.getTime()-c.getTime(),i.stopreason=u,o.trace.push(i),r=!0}},clearAllCurrentMetrics:function(){f.clearAllCurrentMetrics()}},f=f||qu(e).getInstance({settings:t.settings}),r=!0,i=null,o=null,n}yo.__dashjs_factory_name="DashMetrics";var Bu=pe.default.getSingletonFactory(yo);function Eo(){const t=this.context,e=(0,me.default)(t).getInstance(),n=(0,R.default)(t).getInstance();let r,i,o,f;function g(C){f=C}function l(C,M,G,ne){let k,h=M.adaptation.period.mpd;const v=h.availabilityStartTime;if(ne)k=G&&h.timeShiftBufferDepth!==Number.POSITIVE_INFINITY?new Date(v.getTime()+1e3*(C+h.timeShiftBufferDepth)):h.availabilityEndTime;else if(G){const w=M.availabilityTimeOffset;k=new Date(v.getTime()+1e3*(C-w))}else k=v;return k}function _(C,M){return(C.getTime()-M.mpd.availabilityStartTime.getTime()+1e3*f)/1e3}function b(C,M){return C+(M.adaptation.period.start-M.presentationTimeOffset)}function u(C){const M={start:NaN,end:NaN},G=C[0].getAdapter().getRegularPeriods()[0],ne=_(new Date,G);if(!C||C.length===0)return{range:M,now:ne};C.forEach(h=>{let v=h.getCurrentRepresentationForType(B.default.VIDEO);if(v||(v=h.getCurrentRepresentationForType(B.default.AUDIO)),!v){const Y=h.getAdapter(),Z=Y.getMediaInfoForType(h.getStreamInfo(),B.default.VIDEO)||Y.getMediaInfoForType(h.getStreamInfo(),B.default.AUDIO);v=Y.getVoRepresentations(Z)[0]}let w={start:NaN,end:NaN};if(v)if(v.segmentInfoType===p.default.SEGMENT_TIMELINE)w=function(Y){const Z=Y.adaptation.period.mpd.manifest.Period[Y.adaptation.period.index].AdaptationSet[Y.adaptation.index],$=i.getRepresentationFor(Y.index,Z),J=$.SegmentTemplate||$.SegmentList,fe=J.SegmentTimeline,E=J.timescale,Q=fe.S,j={start:0,end:0},te=Q[0].t,K=!isNaN(te),H=K?te:0;let V,S,U,ae,ge=0;for(K&&(j.start=b(H/E,Y)),U=0,ae=Q.length;Uw.start)&&(M.start=w.start),!isNaN(w.end)&&(isNaN(M.end)||M.end2&&arguments[2]!==void 0&&arguments[2];try{let ne=0,k=!1,h=NaN;for(;!k&&ne=M)?(h=M,k=!0):!G&&v.start>M&&(isNaN(h)||v.starth)&&(h=v.start+v.duration),ne+=1}return h}catch{return M}}function A(C){C.offset===void 0||isNaN(C.offset)||g(C.offset/1e3)}function N(){f=0,o=0}function P(){e.off(L.default.UPDATE_TIME_SYNC_OFFSET,A,this),N()}return r={initialize:function(){N(),e.on(L.default.UPDATE_TIME_SYNC_OFFSET,A,this)},getClientTimeOffset:function(){return f},setClientTimeOffset:g,getClientReferenceTime:function(){return Date.now()-1e3*o+1e3*f},calcAvailabilityStartTimeFromPresentationTime:function(C,M,G){return l(C,M,G)},calcAvailabilityEndTimeFromPresentationTime:function(C,M,G){return l(C,M,G,!0)},calcPresentationTimeFromWallTime:_,calcPresentationTimeFromMediaTime:b,calcPeriodRelativeTimeFromMpdRelativeTime:function(C,M){return M-C.adaptation.period.start},calcMediaTimeFromPresentationTime:function(C,M){return C-M.adaptation.period.start+M.presentationTimeOffset},calcWallTimeForSegment:function(C,M){let G,ne,k;return M&&(G=C.representation.adaptation.period.mpd.suggestedPresentationDelay,ne=C.presentationStartTime+G,k=new Date(C.availabilityStartTime.getTime()+1e3*ne)),k},calcTimeShiftBufferWindow:function(C,M){if(!M)return function(G){const ne={start:NaN,end:NaN};let k=0,h=NaN;return G.forEach(v=>{const w=v.getStreamInfo();k+=w.duration,(isNaN(h)||w.start>6),e.push(128|63&r)):r<65536?(e.push(224|r>>12),e.push(128|63&r>>6),e.push(128|63&r)):(e.push(240|r>>18),e.push(128|63&r>>12),e.push(128|63&r>>6),e.push(128|63&r))}return e},Yu=function(t){for(var e=[],n=0;n>18)),n.push(ua.charAt(63&i>>12)),n.push(ua.charAt(63&i>>6)),n.push(ua.charAt(63&i))}return t.length-e==2?(i=(t[e]<<16)+(t[e+1]<<8),n.push(ua.charAt(63&i>>18)),n.push(ua.charAt(63&i>>12)),n.push(ua.charAt(63&i>>6)),n.push("=")):t.length-e==1&&(i=t[e]<<16,n.push(ua.charAt(63&i>>18)),n.push(ua.charAt(63&i>>12)),n.push("==")),n.join("")},tr=function(){for(var t=[],e=0;e<64;++e)t[ua.charCodeAt(e)]=e;return t[61]=0,t}(),Ar=function(t){for(var e=0,n=[],r=0|t.length/4;0>16),n.push(255&i>>8),n.push(255&i),e+=4}return n&&(t.charAt(e-2)=="="?(n.pop(),n.pop()):t.charAt(e-1)=="="&&n.pop()),n},ni={encode:function(t){for(var e=[],n=0;n0&&(P.spans.push({name:C,line:Y,row:k}),Y="");let Q="style_cea608_"+E.foreground+"_"+E.background;E.underline&&(Q+="_underline"),E.italics&&(Q+="_italics"),G.hasOwnProperty(Q)||(G[Q]=JSON.parse(JSON.stringify(E))),Z=E,C=Q}Y+=fe.uchar}Y.trim().length>0&&P.spans.push({name:C,line:Y,row:k}),A=!0,N=$}else A=!1,N=-1,c&&(c.p.push(P),P={start:_,end:b,spans:[]},c.y2=k,c.name="region_"+c.x+"_"+c.y1+"_"+c.y2,M.hasOwnProperty(c.name)===!1?(ne.push(c),M[c.name]=c):(m=M[c.name],m.p.contat(c.p)),c=null)}c&&(c.p.push(P),c.y2=k+1,c.name="region_"+c.x+"_"+c.y1+"_"+c.y2,M.hasOwnProperty(c.name)===!1?(ne.push(c),M[c.name]=c):(m=M[c.name],m.p.contat(c.p)),c=null);const v=[];for(k=0;k0){if(h!==0&&te!=K.row){const U=document.createElement("br");U.className="lineBreak",fe.appendChild(U)}let H=!1;te===K.row&&(H=!0),te=K.row;const V=G[K.name],S=document.createElement("span");S.className="spanPadding "+K.name+" customSpanColor",S.style.cssText=o(l,V),h!==0&&H?h===j.spans.length-1?S.textContent=g(K.line):S.textContent=K.line:j.spans.length>1&&h0||(127&e)>0}function Zu(t,e){let n=0;for(;ne+n));f++)i===6&&f+5+r<=t.byteLength&&Zu($u(t,f+5,f+5+r),o),f+=r+3;return o}function To(t){const e=t.errHandler,n=t.manifestModel,r=t.mediaController,i=t.videoModel,o=t.textTracks,f=t.vttParser,g=t.vttCustomRenderingParser,l=t.ttmlParser,_=t.streamInfo,b=t.settings,u=this.context,c=(0,me.default)(u).getInstance();let m,A,N,P,C,M,G,ne,k,h,v,w,Y,Z,$,J,fe,E=!1;function Q(){M=null,ne=NaN,k=[],h=null,G=!1,C=[],P=null}function j(ge){const he={};he[p.default.SUBTITLE]="subtitles",he[p.default.CAPTION]="captions",he[p.default.FORCED_SUBTITLE]="subtitles";const Ue=new Vu;for(let Ce in ge)Ue[Ce]=ge[Ce];Ue.defaultTrack=function(Ce){let He=!1;return w.length>1&&Ce.isEmbedded?He=Ce.id&&Ce.id===B.default.CC1:w.length===1?Ce.id&&typeof Ce.id=="string"&&Ce.id.substring(0,2)==="CC"&&(He=!0):w.length===0&&(He=Ce.index===C[0].index),He}(ge),Ue.isTTML=function(Ce){return Ce.codec&&Ce.codec.search(B.default.STPP)>=0||Ce.mimeType&&Ce.mimeType.search(B.default.TTML)>=0}(ge),Ue.kind=function(Ce,He){let ut=Ce.roles&&Ce.roles.length>0?He[Ce.roles[0].value]:He.caption;return ut=Object.values(He).includes(ut)?ut:He.caption,ut}(ge,he),o.addTextTrackInfo(Ue)}function te(ge){const he=ge.chunk;he.representation.mediaInfo.embeddedCaptions&&H(he.bytes,he)}function K(ge){v=ge}function H(ge,he){const Ue=he.representation.mediaInfo,Ce=Ue.type,He=Ue.mimeType,ut=Ue.codec||He;ut?Ue.codec.indexOf("application/mp4")!==-1?function(st,xt,Ot){let tn,mt;if(xt.segmentType==="InitializationSegment")G=!0,ne=N.getMediaTimescaleFromMoov(st);else{if(!G)return;mt=N.getSamplesInfo(st),tn=mt.sampleList,tn.length>0&&(h=tn[0].cts-xt.start*ne),Ot.search(B.default.STPP)>=0?function(Pt,Vt,dn){let Zt,Jt;for(P=P!==null?P:U(dn),Zt=0;Zt0&&o.addCaptions(v,0,ke)}(st,tn)}}(ge,he,ut):Ce===B.default.VIDEO?function(st,xt){let Ot,tn;if(xt.segmentType===Se.HTTPRequest.INIT_SEGMENT_TYPE)Y===0&&(Y=N.getMediaTimescaleFromMoov(st));else if(xt.segmentType===Se.HTTPRequest.MEDIA_SEGMENT_TYPE){if(Y===0)return void A.warn("CEA-608: No timescale for embeddedTextTrack yet");tn=N.getSamplesInfo(st);const mt=tn.lastSequenceNumber,Pt=Math.trunc(xt.start),Vt=Math.trunc(xt.end);if(J[0]||J[1]||function(){let dn;for(let Zt=0;Zt0){Qe.cts!==tt?dt=0:dt+=1;const Dt=S();ke.fields[It].push([Qe.cts+Dt*Y,xe[It],dt]),tt=Qe.cts}}return ke.fields.forEach(function(Ge){Ge.sort(function(Qe,xe){return Qe[0]===xe[0]?Qe[2]-xe[2]:Qe[0]-xe[0]})}),ke}(st,tn.sampleList);for(let Zt=0;Zt=0?he=b.get().streaming.text.webvtt.customRenderingEnabled&&g?g:f:(ge.search(B.default.TTML)>=0||ge.search(B.default.STPP)>=0)&&(he=l),he}function ae(ge){w.forEach(function(he){const Ue=o.getTrackIdxForId(he.id);Ue>=0&&o.deleteCuesFromTrackIdx(Ue,ge.from,ge.to)})}return m={initialize:function(){E||(w=[],v=null,Y=0,J=[],Z=null,$=null,E=!0,fe=Wu(u).getInstance(),c.on(L.default.VIDEO_CHUNK_RECEIVED,te,m),c.on(L.default.BUFFER_CLEARED,ae,m))},addMediaInfos:function(ge,he,Ue){if(C=C.concat(he),ge===B.default.TEXT&&he[0].isFragmented&&!he[0].isEmbedded){M=Ue,m.buffered=(0,Ku.default)(u).create(),k=r.getTracksFor(B.default.TEXT,_.id).filter(He=>He.isFragmented);const Ce=r.getCurrentTrackFor(B.default.TEXT,_.id);for(let He=0;HeGe/Qe?(It=Ye,dt=It/Qe*Ge):(dt=ke,It=dt/Ge*Qe);let Dt=0,jt=0,Me=0,et=0;return dt/It>xe?(et=It,Me=It*xe):(Me=dt,et=dt/xe),Dt=(ke-Me)/2,jt=(Ye-et)/2,tt?{x:Dt+.1*Me,y:jt+.1*et,w:.8*Me,h:.8*et}:{x:Dt,y:jt,w:Me,h:et}}function J(ke,Ye){const Ge=r.getClientWidth(),Qe=r.getClientHeight(),xe=r.getVideoWidth(),tt=r.getVideoHeight(),dt=r.getVideoRelativeOffsetTop(),It=r.getVideoRelativeOffsetLeft();if(xe!==0&&tt!==0){let Dt=xe/tt,jt=!1;ke.isFromCEA608&&(Dt=1.1666666666666667,jt=!0);const Me=$.call(this,Ge,Qe,xe,tt,Dt,jt),et=Me.w,gt=Me.h,Mt=Me.x,Ve=Me.y;if(et!=A||gt!=N||Mt!=c||Ve!=m||Ye){if(c=Mt+It,m=Ve+dt,A=et,N=gt,P){const Ie=P.style;Ie&&(Ie.left=c+"px",Ie.top=m+"px",Ie.width=A+"px",Ie.height=N+"px",Ie.zIndex=G&&document[G]||ne?h:null,n.trigger(se.default.CAPTION_CONTAINER_RESIZE))}const ue=ke.activeCues;if(ue){const Ie=ue.length;for(let Ke=0;Ke=ke.startTime}function te(ke,Ye){return!!o.get().streaming.text.extendSegmentedCues&&!!function(Ge,Qe,xe){for(let tt=0;tt{Ge.kind&&Ge.kind==="image"&&(Ge.src=E(ke,Ge.src)),K(ke,Ge.contents)})}function H(ke,Ye,Ge){const Qe=ut(ke),xe=o.get().streaming.text.dispatchForManualRendering;if(Qe&&Array.isArray(Ge)&&Ge.length!==0)for(let tt=0;ttQ(this)):Q(this),g.debug("Cue enter id:"+this.cueID)):(P.appendChild(this.cueHTMLElement),fe.call(Qe,this),n.trigger(se.default.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:u})))},xe.onexit=function(){if(P){const tt=P.childNodes;for(let dt=0;dt=0&&_[ke]?r.getTextTrack(_[ke].kind,_[ke].id,_[ke].lang,_[ke].isTTML,_[ke].isEmbedded):null}function st(ke){if(ke===u)return;u=ke;const Ye=ut(u);xt.call(this,Ye),M&&(clearInterval(M),M=null),Ye&&Ye.renderingType==="html"&&(J.call(this,Ye,!0),window.ResizeObserver?(v=new window.ResizeObserver(()=>{J.call(this,Ye,!0)}),v.observe(r.getElement())):M=setInterval(J.bind(this,Ye),500))}function xt(ke){Jt.call(this),ke&&ke.renderingType==="html"?dn.call(this):Zt.call(this)}function Ot(ke,Ye){if(!ke.cues)return!1;for(let Ge=0;Ge3&&arguments[3]!==void 0)||arguments[3];return!!ke&&(isNaN(Ye)||(Qe?ke.startTime:ke.endTime)>=Ye)&&(isNaN(Ge)||(Qe?ke.endTime:ke.startTime)<=Ge)}function mt(ke,Ye,Ge){if(!(Ge0?"native":"custom",xe=Qe==="native"?ke.cues:ke.manualCueList;if(!xe||xe.length===0)return;for(let tt=xe.length-1;tt>=0;tt--)tn(xe[tt],Ye,Ge,!0)&&!Vt(xe[tt])&&(Qe==="native"?ke.removeCue(xe[tt]):(Ce(xe[tt]),delete ke.manualCueList[tt]))}}function Pt(ke,Ye,Ge){let Qe=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3];if(ke&&(ke.cues||ke.manualCueList)){const xe=ke.cues&&ke.cues.length>0?"native":"custom",tt=xe==="native"?ke.cues:ke.manualCueList;if(!tt||tt.length===0)return;for(let dt=tt.length-1;dt>=0;dt--)tn(tt[dt],Ye,Ge,Qe)&&(xe==="native"?(tt[dt].onexit&&tt[dt].onexit(),ke.removeCue(tt[dt])):(Ce(tt[dt]),delete ke.manualCueList[dt]))}}function Vt(ke){const Ye=r.getTime();return Ye>=ke.startTime&&Ye<=ke.endTime}function dn(){let ke=document.getElementById("native-cue-style");if(ke)return;ke=document.createElement("style"),ke.id="native-cue-style",document.head.appendChild(ke);const Ye=ke.sheet,Ge=r.getElement();try{Ge&&(Ge.id?Ye.insertRule("#"+Ge.id+"::cue {background: transparent}",0):Ge.classList.length!==0?Ye.insertRule("."+Ge.className+"::cue {background: transparent}",0):Ye.insertRule("video::cue {background: transparent}",0))}catch(Qe){g.info(""+Qe.message)}}function Zt(){const ke=document.getElementById("native-cue-style");ke&&document.head.removeChild(ke)}function Jt(){if(P)for(;P.firstChild;)P.removeChild(P.firstChild)}return f={addCaptions:H,addTextTrackInfo:function(ke){_.push(ke)},createTracks:function(){_.sort(function(Ye,Ge){return Ye.index-Ge.index}),P=r.getTTMLRenderingDiv(),C=r.getVttRenderingDiv();let ke=-1;for(let Ye=0;Ye<_.length;Ye++){const Ge=Z(_[Ye]);b.push(Ge),_[Ye].defaultTrack&&(Ge.default=!0,ke=Ye);const Qe=ut(Ye);Qe&&(Qe.mode=B.default.TEXT_SHOWING,P&&(_[Ye].isTTML||_[Ye].isEmbedded)?Qe.renderingType="html":Qe.renderingType="default"),H(Ye,0,_[Ye].captionData),n.trigger(se.default.TEXT_TRACK_ADDED)}if(st.call(this,ke),ke>=0){let Ye=function(){const Ge=ut(ke);Ge&&Ge.renderingType==="html"&&J.call(this,Ge,!0),n.off(se.default.PLAYBACK_METADATA_LOADED,Ye,this)};n.on(se.default.PLAYBACK_METADATA_LOADED,Ye,this);for(let Ge=0;Ge<_.length;Ge++){const Qe=ut(Ge);if(Qe){const xe=o.get().streaming.text.dispatchForManualRendering;Qe.mode=Ge!==ke||xe?B.default.TEXT_HIDDEN:B.default.TEXT_SHOWING,Qe.manualMode=Ge===ke?B.default.TEXT_SHOWING:B.default.TEXT_HIDDEN}}}n.trigger(L.default.TEXT_TRACKS_QUEUE_INITIALIZED,{index:u,tracks:_,streamId:i.id})},deleteAllTextTracks:function(){const ke=b?b.length:0;for(let Ye=0;Ye0){const Ye=ke[0].manualCueList;Ye&&Ye.length>0&&Ye.forEach(Ge=>{if(Ge.isActive){if(Ge.isActive=!1,o.get().streaming.text.dispatchForManualRendering)U(Ge);else if(C){const Qe=C.childNodes;for(let xe=0;xe0){const Ge=Ye[0].manualCueList;Ge&&Ge.length>0&&Ge.forEach(Qe=>{Qe.startTime<=ke&&Qe.endTime>=ke&&!Qe.isActive?(Qe.isActive=!0,o.get().streaming.text.dispatchForManualRendering?S(Qe):WebVTT.processCues(window,[Qe],C,Qe.cueID)):Qe.isActive&&(Qe.startTime>ke||Qe.endTime1){let A=m.split(/:/)[1],N=!1;A&&A.search(/%/)!=-1&&(N=!0,A=parseInt(A.replace(/%/,""),10)),(m.match(/align/)||m.match(/A/))&&(c.align=A),(m.match(/line/)||m.match(/L/))&&(c.line=A==="auto"?A:parseInt(A,10),N&&(c.snapToLines=!1)),(m.match(/position/)||m.match(/P/))&&(c.position=A),(m.match(/size/)||m.match(/S/))&&(c.size=A)}}),c}function b(u,c){let m,A=c,N="",P="";for(;u[A]!==""&&A1)for(let C=0;C0&&P!=="WEBVTT"&&P.match(i)){const C=l(P),M=C.cuePoints,G=C.styles,ne=b(u,N+1),k=g(M[0].replace(o,"")),h=g(M[1].replace(o,""));!isNaN(k)&&!isNaN(h)&&k>=A&&h>k?ne!==""?(A=k,c.push({start:k,end:h,data:ne,styles:G})):n.error("Skipping cue due to empty/malformed cue text"):n.error("Skipping cue due to incorrect cue timing")}}return c},getCaptionStyles:_},n=(0,Ze.default)(t).getInstance().getLogger(e),r=/(?:\r\n|\r|\n)/gm,i=/-->/,o=/(^[\s]+|[\s]+$)/g,f=/\s\b/g,e}wo.__dashjs_factory_name="VTTParser";var ad=pe.default.getSingletonFactory(wo);function So(){let t,e;return t={parse:function(n){let r=[];return e.oncue=function(i){i.start=i.startTime,i.end=i.endTime,i.data=i.text,i.styles={align:i.align,line:i.line,position:i.position,size:i.size},r.push(i)},e.parse(n),r}},function(){try{window&&window.WebVTT&&window.WebVTT.Parser&&(e=new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder()))}catch{}}(),t}So.__dashjs_factory_name="VttCustomRenderingParser";var rd=pe.default.getSingletonFactory(So);function Io(){const t=this.context,e=(0,me.default)(t).getInstance();let n,r,i=0;function o(){const f="cue_TTML_"+i;return i++,f}return n={parse:function(f,g,l,_,b){let u="";const c=[];let m,A,N;const P={},C={};let M="",G="",ne={onOpenTag:function(v,w,Y){if(Y[" imagetype"]&&!Y[" imageType"]&&(e.trigger(se.default.CONFORMANCE_VIOLATION,{level:Pa.LEVELS.ERROR,event:Pa.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),Y[" imageType"]=Y[" imagetype"]),w==="image"&&(v==="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"||v==="http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt")){if(!Y[" imageType"]||Y[" imageType"].value!=="PNG")return void r.warn("smpte-tt imageType != PNG. Discarded");M=Y["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){M&&(C[M]=G.trim()),G="",M=""},onText:function(v){M&&(G+=v)}};if(!f)throw u="no ttml data to parse",new Error(u);P.data=f,e.trigger(L.default.TTML_TO_PARSE,P);let k=(0,ri.fromXML)(P.data,function(v){u=v},ne);e.trigger(L.default.TTML_PARSED,{ttmlString:P.data,ttmlDoc:k});const h=k.getMediaTimeEvents();for(N=0;Nw.contents.length)&&(m=h[N]+g,A=h[N+1]+g,m0&&(C=o.resolve(h[0].path).url)}const ne=N.essentialProperties.filter(h=>h.schemeIdUri&&h.schemeIdUri===B.default.FONT_DOWNLOAD_DVB_SCHEME),k=N.supplementalProperties.filter(h=>h.schemeIdUri&&h.schemeIdUri===B.default.FONT_DOWNLOAD_DVB_SCHEME);ne.length>0?(G=!0,M=ne):M=k,M.forEach(h=>{if(function(Y){return!(!(Y.value&&parseInt(Y.value)===1&&Y.dvbUrl&&Y.dvbUrl.length>0&&Y.dvbFontFamily&&Y.dvbFontFamily.length>0&&Y.dvbMimeType)||Y.dvbMimeType!==B.default.OFF_MIMETYPE&&Y.dvbMimeType!==B.default.WOFF_MIMETYPE)}(h)){let Y=(v=h.dvbUrl,w=C,r.isPathAbsolute(v)?v:r.isRelative(v)?w?r.resolve(v,w):r.resolve(v):v);u.push({fontFamily:h.dvbFontFamily,url:Y,mimeType:h.dvbMimeType,trackId:N.id,streamId:P,isEssential:G,status:l,fontFace:new FontFace(h.dvbFontFamily,`url(${Y})`,{display:"swap"})})}var v,w})}function m(N,P){const C=u[N];u[N]={...C,status:P}}function A(){u=[]}return _={addFontsFromTracks:function(N,P){if(N&&Array.isArray(N)&&P)for(let C=0;C{m(N,g),n.trigger(se.default.DVB_FONT_DOWNLOAD_COMPLETE,P)},C=>{m(N,f),b.debug("Font download error: ",C),n.trigger(se.default.DVB_FONT_DOWNLOAD_FAILED,P)})}},getFonts:function(){return u},getFontsForTrackId:function(N){return u.filter(P=>P.trackId&&P.trackId===N)},reset:function(){(function(){for(const N of u){let P=document.fonts.delete(N.fontFace);b.debug(`Removal of fontFamily: ${N.fontFamily} was ${P?"successful":"unsuccessful"}`)}})(),A()}},b=(0,Ze.default)(e).getInstance().getLogger(_),A(),_}ko.__dashjs_factory_name="DVBFonts";var ld=pe.default.getClassFactory(ko);function Ao(t){let e=this.context;const n=t.adapter,r=t.errHandler,i=t.manifestModel,o=t.mediaController,f=t.baseURLController,g=t.videoModel,l=t.settings;let _,b,u,c,m,A,N,P,C,M,G,ne,k,h;function v(H){if(h.error(`Could not download ${H.isEssential?"an essential":"a"} font - fontFamily: ${H.fontFamily}, url: ${H.url}`),H.isEssential){let V=c[H.streamId].getTrackIdxForId(H.trackId);c[H.streamId].setModeForTrackIdx(V,B.default.TEXT_DISABLED)}}function w(H){if(h.debug(`Successfully downloaded ${H.isEssential?"an essential":"a"} font - fontFamily: ${H.fontFamily}, url: ${H.url}`),H.isEssential){let V=c[H.streamId].getTrackIdxForId(H.trackId);V===c[H.streamId].getCurrentTrackIdx()?c[H.streamId].setModeForTrackIdx(V,B.default.TEXT_SHOWING):c[H.streamId].setModeForTrackIdx(V,B.default.TEXT_HIDDEN)}}function Y(H){let V=H.tracks,S=H.index;const U=H.streamId;if(l.get().streaming.text.defaultEnabled===!1&&!fe()||ne)E(U,-1);else{const ae=o.getCurrentTrackFor(B.default.TEXT,U);if(ae){const ge={lang:ae.lang,role:ae.roles[0],index:ae.index,codec:ae.codec,accessibility:ae.accessibility[0]};V.some((he,Ue)=>{if(o.matchSettings(ge,he))return E(U,Ue),S=Ue,!0})}C=!1}b[U].lastEnabledIndex=S,P.trigger(se.default.TEXT_TRACKS_ADDED,{enabled:fe(),index:S,tracks:V,streamId:U}),G=!0,k.addFontsFromTracks(V,U),k.getFonts().forEach(ae=>{if(ae.isEssential){let ge=c[ae.streamId].getTrackIdxForId(ae.trackId);c[ae.streamId].setModeForTrackIdx(ge,B.default.TEXT_DISABLED)}}),k.downloadFonts()}function Z(H){try{const V=H.streamId;if(!c[V]||isNaN(H.time))return;c[V].manualCueProcessing(H.time)}catch{}}function $(H){try{const V=H.streamId;if(!c[V])return;c[V].disableManualTracks()}catch{}}function J(H){try{if(!H||!H.mediaType||H.mediaType!==B.default.AUDIO||!H.currentMediaInfo)return;const V=c[H.streamId].getCurrentTextTrackInfo();let S=NaN;C?S=Q(H.streamId):j(V)&&H.currentMediaInfo.lang&&H.currentMediaInfo.lang!==V.lang&&(S=Q(H.streamId),isNaN(S)&&(S=-1)),isNaN(S)||E(H.streamId,S)}catch(V){h.error(V)}}function fe(){let H=!0;return C&&!M&&(H=!1),H}function E(H,V){C=V===-1,C&&o&&o.saveTextSettingsDisabled();let S=te(H);if(S===V||!c[H])return;c[H].disableManualTracks();let U=c[H].getCurrentTextTrackInfo(),ae=U?g.getTextTrack(U.kind,U.id,U.lang,U.isTTML,U.isEmbedded):null;ae&&ae.mode!==B.default.TEXT_DISABLED&&c[H].setModeForTrackIdx(S,B.default.TEXT_HIDDEN),c[H].setCurrentTrackIdx(V),U=c[H].getCurrentTextTrackInfo();const ge=l.get().streaming.text.dispatchForManualRendering;if(U&&!ge&&U.mode!==B.default.TEXT_DISABLED&&c[H].setModeForTrackIdx(V,B.default.TEXT_SHOWING),U&&U.isFragmented&&!U.isEmbedded)(function(he,Ue,Ce){if(!u[he])return;let He=u[he].getConfig().fragmentedTracks;for(let ut=0;ut(ge._indexToSelect=he,!!(ge&&ge.roles&&ge.roles.length>0)&&j(ge)))}(H);if(!V||V.length<=0)return NaN;const S=o.getCurrentTrackFor(B.default.AUDIO,H);if(!S)return NaN;const U=V.find(ae=>S.lang===ae.lang);return U?U._indexToSelect:NaN}function j(H){return!(!H||!H.roles||H.roles.length===0)&&H.roles.some(V=>V.schemeIdUri===B.default.DASH_ROLE_SCHEME_ID&&V.value===p.default.FORCED_SUBTITLE)}function te(H){return c[H].getCurrentTrackIdx()}function K(){u={},c={},b={},C=!0,G=!1,ne=!1}return _={addEmbeddedTrack:function(H,V){const S=H.id;u[S]&&u[S].addEmbeddedTrack(V)},addMediaInfosToBuffer:function(H,V,S){let U=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;const ae=H.id;u[ae]&&u[ae].addMediaInfos(V,S,U)},createTracks:function(H){const V=H.id;c[V]&&c[V].createTracks()},deactivateStream:function(H){if(!H)return;const V=H.id;u[V]&&u[V].resetMediaInfos(),c[V]&&c[V].deleteAllTextTracks()},enableForcedTextStreaming:function(H){return(0,We.checkParameterType)(H,"boolean"),M=H,!0},enableText:function(H,V){return(0,We.checkParameterType)(V,"boolean"),fe()!==V&&(V&&E(H,b[H].lastEnabledIndex),V||(b[H].lastEnabledIndex=te(H),G?E(H,-1):ne=!0)),!0},getAllTracksAreDisabled:function(){return C},getCurrentTrackIdx:te,getTextSourceBuffer:function(H){const V=H.id;if(u&&u[V])return u[V]},initialize:function(){k=ld(e).create({adapter:n,baseURLController:f}),P.on(L.default.TEXT_TRACKS_QUEUE_INITIALIZED,Y,_),P.on(L.default.DVB_FONT_DOWNLOAD_FAILED,v,_),P.on(L.default.DVB_FONT_DOWNLOAD_COMPLETE,w,_),P.on(L.default.MEDIAINFO_UPDATED,J,_),l.get().streaming.text.webvtt.customRenderingEnabled&&(P.on(L.default.PLAYBACK_TIME_UPDATED,Z,_),P.on(L.default.PLAYBACK_SEEKING,$,_))},initializeForStream:function(H){const V=H.id,S=nd(e).create({videoModel:g,settings:l,streamInfo:H});S.initialize(),c[V]=S;const U=ed(e).create({errHandler:r,adapter:n,dvbFonts:k,manifestModel:i,mediaController:o,videoModel:g,textTracks:S,vttParser:m,vttCustomRenderingParser:A,ttmlParser:N,streamInfo:H,settings:l});U.initialize(),u[V]=U,b[V]={},b[V].lastEnabledIndex=-1},isTextEnabled:fe,reset:function(){Object.keys(u).forEach(H=>{u[H].resetEmbedded(),u[H].reset()}),k.reset(),K(),P.off(L.default.TEXT_TRACKS_QUEUE_INITIALIZED,Y,_),P.off(L.default.DVB_FONT_DOWNLOAD_FAILED,v,_),P.off(L.default.DVB_FONT_DOWNLOAD_COMPLETE,w,_),P.off(L.default.MEDIAINFO_UPDATED,J,_),l.get().streaming.text.webvtt.customRenderingEnabled&&(P.off(L.default.PLAYBACK_TIME_UPDATED,Z,_),P.off(L.default.PLAYBACK_SEEKING,$,_))},setTextTrack:E,clearDataForStream:function(H){u[H]&&(u[H].resetEmbedded(),u[H].reset(),delete u[H]),c[H]&&(c[H].deleteAllTextTracks(),delete c[H]),b[H]&&delete b[H]}},M=!1,G=!1,ne=!1,m=ad(e).getInstance(),A=rd(e).getInstance(),N=id(e).getInstance(),P=(0,me.default)(e).getInstance(),h=(0,Ze.default)(e).getInstance().getLogger(_),K(),_}Ao.__dashjs_factory_name="TextController";var od=pe.default.getClassFactory(Ao);function Ro(t){t=t||{};const e=this.context,n=(0,Ze.default)(e).getInstance(),r=t.settings,i=(0,me.default)(e).getInstance();let o,f,g,l,_,b;function u(){return navigator&&navigator.connection&&!isNaN(navigator.connection.downlink)&&navigator.connection.downlink>0?1e3*navigator.connection.downlink:NaN}function c(N,P,C,M){const G=Math.pow(.5,C/M.fast);N.fastEstimate=(1-G)*P+G*N.fastEstimate;const ne=Math.pow(.5,C/M.slow);N.slowEstimate=(1-ne)*P+ne*N.slowEstimate,N.totalWeight+=C}function m(){o={},f={},g={},l={}}const A={addEntry:function(N,P){try{if(!(N&&P&&P.trace&&P.trace.length))return;(function(G){o[G]=o[G]||[],f[G]=f[G]||[],g[G]=g[G]||{fastEstimate:0,slowEstimate:0,totalWeight:0},l[G]=l[G]||{fastEstimate:0,slowEstimate:0,totalWeight:0}})(N);const C=P.tresponse.getTime()-P.trequest.getTime()||1;let M=function(G,ne){return G._fileLoaderType&&G._fileLoaderType===B.default.FILE_LOADER_TYPES.FETCH?function(k){const h=k.trace.reduce((Y,Z)=>Y+Z.b[0],0),v=k.trace.reduce((Y,Z)=>Y+Z.d,0);let w=NaN;return r.get().streaming.abr.throughput.useNetworkInformationApi.fetch&&(w=u()),isNaN(w)&&(w=Math.round(8*h/v)),{downloadedBytes:h,value:w,downloadTimeInMs:v}}(G):function(k,h){let v=NaN,w=NaN,Y=!1;if(r.get().streaming.abr.throughput.useResourceTimingApi&&k._resourceTimingValues)v=k._resourceTimingValues.transferSize,w=k._resourceTimingValues.responseEnd-k._resourceTimingValues.responseStart,Y=!0;else{if(k.trace.length<=1)return{throughput:NaN,downloadTimeInMs:NaN};v=k.trace.reduce(($,J)=>$+J.b[0],0)-k.trace[0].b[0],w=Math.max(k.trace.reduce(($,J)=>$+J.d,0)-k.trace[0].d,1)}let Z=NaN;if(!Y&&r.get().streaming.abr.throughput.useNetworkInformationApi.xhr&&(Z=u()),isNaN(Z)){const $=r.get().streaming.abr.throughput.useDeadTimeLatency?w:w+h;Z=Math.round(8*v/$)}return{downloadedBytes:v,value:Z,downloadTimeInMs:w}}(G,ne)}(P,C);if(M.latencyInMs=C,isNaN(M.value)||!isFinite(M.value))return;if(P.cmsd){const G=P.cmsd.dynamic&&P.cmsd.dynamic.etp?P.cmsd.dynamic.etp:null;if(G){const ne=r.get().streaming.cmsd.abr.etpWeightRatio;ne>0&&ne<=1&&(M.value=M.value*(1-ne)+G*ne)}}if(function(G,ne,k){return r.get().streaming.abr.throughput.useResourceTimingApi&&k._resourceTimingValues?k._resourceTimingValues.transferSize===0&&k._resourceTimingValues.decodedBodySize>0:!isNaN(ne)&&(G===B.default.VIDEO?ner.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep&&o[G].shift(),f[G].length>r.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep&&f[G].shift()}(N),i.trigger(se.default.THROUGHPUT_MEASUREMENT_STORED,{throughputValues:M}),P.type!==Se.HTTPRequest.MPD_TYPE&&(c(g[N],M.value,r.get().streaming.abr.throughput.ewma.weightDownloadTimeMultiplicationFactor*M.downloadTimeInMs,_.bandwidthHalfLife),c(l[N],C,1,_.latencyHalfLife))}catch(C){b.error(C)}},getThroughputDict:function(N){return N?o[N]:o},getEwmaThroughputDict:function(N){return N?g[N]:g},getEwmaLatencyDict:function(N){return N?l[N]:l},getEwmaHalfLife:function(){return _},getLatencyDict:function(N){return N?f[N]:f},reset:m};return b=n.getLogger(A),_={bandwidthHalfLife:{fast:r.get().streaming.abr.throughput.ewma.throughputFastHalfLifeSeconds,slow:r.get().streaming.abr.throughput.ewma.throughputSlowHalfLifeSeconds},latencyHalfLife:{fast:r.get().streaming.abr.throughput.ewma.latencyFastHalfLifeCount,slow:r.get().streaming.abr.throughput.ewma.latencySlowHalfLifeCount}},m(),A}Ro.__dashjs_factory_name="ThroughputModel";var sd=pe.default.getClassFactory(Ro);function No(){const t=this.context,e=(0,me.default)(t).getInstance();let n,r,i;function o(){performance.clearResourceTimings()}function f(G){G.metric!==ie.HTTP_REQUEST||!G.value||G.value.type!==Se.HTTPRequest.MPD_TYPE&&(G.value.type!==Se.HTTPRequest.MEDIA_SEGMENT_TYPE||G.mediaType!==B.default.AUDIO&&G.mediaType!==B.default.VIDEO)||n.addEntry(G.mediaType,G.value)}function g(G,ne){let k,h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:NaN,w=null,Y=n.getEwmaHalfLife(),Z=null,$=!0;switch(h||(h=i.get().streaming.abr.throughput.averageCalculationMode),G){case B.default.THROUGHPUT_TYPES.BANDWIDTH:w=h===B.default.THROUGHPUT_CALCULATION_MODES.EWMA?n.getEwmaThroughputDict(ne):n.getThroughputDict(ne),Z=Y.bandwidthHalfLife,$=!0,v=isNaN(v)?r.getIsDynamic()?i.get().streaming.abr.throughput.sampleSettings.live:i.get().streaming.abr.throughput.sampleSettings.vod:v;break;case B.default.THROUGHPUT_TYPES.LATENCY:w=h===B.default.THROUGHPUT_CALCULATION_MODES.EWMA?n.getEwmaLatencyDict(ne):n.getLatencyDict(ne),Z=Y.latencyHalfLife,$=!1,v=isNaN(v)?i.get().streaming.abr.throughput.sampleSettings.averageLatencySampleAmount:v}if(!w||w.length===0)return NaN;switch(h){case B.default.THROUGHPUT_CALCULATION_MODES.ARITHMETIC_MEAN:return k=l(w,v,G),_(w,k);case B.default.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_ARITHMETIC_MEAN:return k=l(w,v,G),b(w,k);case B.default.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_ARITHMETIC_MEAN:return k=l(w,v,G),u(w,k);case B.default.THROUGHPUT_CALCULATION_MODES.HARMONIC_MEAN:return k=l(w,v,G),c(w,k);case B.default.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_HARMONIC_MEAN:return k=l(w,v,G),m(w,k);case B.default.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_HARMONIC_MEAN:return k=l(w,v,G),A(w,k);case B.default.THROUGHPUT_CALCULATION_MODES.EWMA:return N(w,Z,$);case B.default.THROUGHPUT_CALCULATION_MODES.ZLEMA:return k=l(w,v,G),P(w,k)}}function l(G,ne,k){if(G){if(ne>=G.length)ne=G.length;else if(k===B.default.THROUGHPUT_TYPES.BANDWIDTH&&i.get().streaming.abr.throughput.sampleSettings.enableSampleSizeAdjustment)for(let h=1;h=i.get().streaming.abr.throughput.sampleSettings.increaseScale||v<=i.get().streaming.abr.throughput.sampleSettings.decreaseScale)&&(ne+=1)===G.length)break}}else ne=0;return ne}function _(G,ne){let k=G;return ne!==0&&k&&k.length!==0?(k=k.slice(-ne),k.reduce((h,v)=>h+v.value,0)/k.length):NaN}function b(G,ne){let k=G;if(ne===0||!k||k.length===0)return NaN;k=k.slice(-ne);let h=0;return k.reduce((v,w)=>{let Y=Math.sqrt(w.downloadedBytes);return h+=Y,v+w.value*Y},0)/h}function u(G,ne){let k=G;if(ne===0||!k||k.length===0)return NaN;k=k.slice(-ne);let h=0;return k.reduce((v,w,Y)=>{let Z=Y+1;return h+=Z,v+w.value*Z},0)/h}function c(G,ne){let k=G;if(ne===0||!k||k.length===0)return NaN;k=k.slice(-ne);const h=k.reduce((v,w)=>v+1/w.value,0);return k.length/h}function m(G,ne){let k=G;if(ne===0||!k||k.length===0)return NaN;k=k.slice(-ne);let h=0;const v=k.reduce((w,Y)=>{let Z=Math.sqrt(Y.downloadedBytes);return h+=Z,w+1/Y.value*Z},0);return h/v}function A(G,ne){let k=G;if(ne===0||!k||k.length===0)return NaN;k=k.slice(-ne);let h=0;const v=k.reduce((w,Y,Z)=>{let $=Z+1;return h+=$,w+1/Y.value*$},0);return h/v}function N(G,ne){let k=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(!G||G.totalWeight<=0)return NaN;const h=G.fastEstimate/(1-Math.pow(.5,G.totalWeight/ne.fast)),v=G.slowEstimate/(1-Math.pow(.5,G.totalWeight/ne.slow));return k?Math.min(h,v):Math.max(h,v)}function P(G,ne){if(ne===0||!G||G.length===0)return NaN;let k=G.slice(-ne).map(Y=>Y.value),h=2/(k.length+1),v=k[k.length-1],w=k[k.length-1];for(let Y=0;Y1&&arguments[1]!==void 0?arguments[1]:null,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;const h=g(B.default.THROUGHPUT_TYPES.BANDWIDTH,G,ne,k);return Math.round(h)}const M={getArithmeticMean:_,getAverageLatency:function(G){let ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;const h=g(B.default.THROUGHPUT_TYPES.LATENCY,G,ne,k);return Math.round(h)},getAverageThroughput:C,getByteSizeWeightedArithmeticMean:b,getByteSizeWeightedHarmonicMean:m,getDateWeightedArithmeticMean:u,getDateWeightedHarmonicMean:A,getEwma:N,getHarmonicMean:c,getRawThroughputData:function(G){return G?n.getThroughputDict(G):[]},getSafeAverageThroughput:function(G){let ne=C(G,arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN);return isNaN(ne)||(ne*=i.get().streaming.abr.throughput.bandwidthSafetyFactor),ne},getZlema:P,initialize:function(){n=sd(t).create({settings:i}),e.on(se.default.METRIC_ADDED,f,M),performance&&performance.addEventListener("resourcetimingbufferfull",o)},reset:function(){n.reset(),e.off(se.default.METRIC_ADDED,f,M),performance&&performance.removeEventListener("resourcetimingbufferfull",o)},setConfig:function(G){G.settings&&(i=G.settings),G.playbackController&&(r=G.playbackController)}};return M}No.__dashjs_factory_name="ThroughputController";var ud=pe.default.getSingletonFactory(No);function ii(){const t="You must first call initialize() and set a source before calling this method",e="You must first call initialize() and set a valid source and view before calling this method",n="You must first call attachView() to set the video element before calling this method",r="You must first call attachSource() with a valid source before calling this method",i="MediaPlayer not initialized!",o=this.context,f=(0,me.default)(o).getInstance();let g=(0,R.default)(o).getInstance();const l=(0,Ze.default)(o).getInstance({settings:g});let _,b,u,c,m,A,N,P,C,M,G,ne,k,h,v,w,Y,Z,$,J,fe,E,Q,j,te,K,H,V,S,U,ae,ge,he,Ue,Ce,He,ut,st,xt,Ot,tn;function mt(){Dt(null),dt(null),c=null,v&&(v.reset(),v=null),w&&(w.reset(),w=null),fe&&fe.reset(),g.reset(),Z&&(Z.reset(),Z=null)}function Pt(){return!!u&&!!ut.getElement()}function Vt(){return(0,pu.getVersionString)()}function dn(){if(!N)throw e;return S.isPaused()}function Zt(){if(!N)throw e;return S.getIsDynamic()}function Jt(ue){const Ie=K&&K.hasVideoTrack()?B.default.VIDEO:B.default.AUDIO;let Ke=he.getCurrentDVRInfo(Ie);return Ke?ke(Ke.range.start+ue,Ke):0}function ke(ue,Ie){let Ke=S.getOriginalLiveDelay();return ue>Ie.range.end-Ke&&(ue=Ie.range.end-Ke),ue}function Ye(){let ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";if(!N)throw e;let Ie=tt().currentTime;return ue!==""&&(Ie=K.getTimeRelativeToStreamId(Ie,ue)),Ie}function Ge(ue){(0,We.checkParameterType)(ue,"boolean"),P=ue}function Qe(){fe.restoreDefaultUTCTimingSources()}function xe(){return he}function tt(){if(!ut.getElement())throw n;return ut.getElement()}function dt(ue){if(!m)throw i;ut.setElement(ue),ue&&(gt(),function(){if(w||typeof dashjs>"u")return;let Ie=dashjs.MetricsReporting;typeof Ie=="function"&&(w=Ie(o).create().createMetricsReporting({debug:l,eventBus:f,mediaElement:tt(),adapter:$,dashMetrics:he,mediaPlayerModel:J,events:L.default,constants:B.default,metricsConstants:ie}))}(),function(){if(Y||typeof dashjs>"u")return;let Ie=dashjs.MssHandler;typeof Ie=="function"&&(I.extend(Ie.errors),Y=Ie(o).create({eventBus:f,mediaPlayerModel:J,dashMetrics:he,manifestModel:Ue,playbackController:S,streamController:K,protectionController:v,baseURLController:Q,errHandler:E,events:L.default,constants:B.default,debug:l,initSegmentType:Se.HTTPRequest.INIT_SEGMENT_TYPE,BASE64:ai,ISOBoxer:Za,settings:g}))}(),K&&K.switchToVideoElement(C)),N&&Me(),Ve(C)}function It(ue){if(!A)throw t;let Ie=K.getActiveStreamInfo();return Ie?h.getTracksFor(ue,Ie.id).filter(Ke=>!v||v.areKeyIdsUsable(Ke.normalizedKeyIds)):[]}function Dt(ue){let Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NaN;if(!m)throw i;typeof ue=="string"&&st.initialize(ue),Ie==null&&(Ie=NaN),isNaN(Ie)||(Ie=Math.max(0,Ie)),C=Ie,u=ue,(A||N)&&Me(),Pt()&&Ve(C)}function jt(){if(!A)throw t;let ue=K.getActiveStreamInfo();return ue?K.getStreamById(ue.id):null}function Me(){N=!1,A=!1,$.reset(),K.reset(),V.reset(),ge.reset(),S.reset(),U.reset(),ae.reset(),M.reset(),G.reset(),h.reset(),Ot.reset(),v&&(g.get().streaming.protection.keepProtectionMediaKeys?v.stop():(v.reset(),v=null,gt())),H.reset(),Ce.reset(),He.reset()}function et(){return Vs(o).create({debug:l,errHandler:E,dashMetrics:he,mediaPlayerModel:J,mssHandler:Y,settings:g})}function gt(){if(v)return v;if(typeof dashjs>"u")return null;let ue=dashjs.Protection;if(typeof ue=="function"){let Ie=ue(o).create();return L.default.extend(ue.events),se.default.extend(ue.events,{publicOnly:!0}),I.extend(ue.errors),v=Ie.createProtectionSystem({debug:l,errHandler:E,videoModel:ut,customParametersModel:fe,capabilities:j,eventBus:f,events:L.default,BASE64:ai,constants:B.default,cmcdModel:Ce,settings:g}),j||(j=(0,Nl.default)(o).getInstance()),j.setProtectionController(v),v}return null}function Mt(){if(!m)throw i;if(Z)return Z;if(typeof dashjs>"u")return null;let ue=dashjs.OfflineController;if(typeof ue=="function"){L.default.extend(ue.events),se.default.extend(ue.events,{publicOnly:!0}),I.extend(ue.errors);const Ie=et(),Ke=Vi(o).create();return Ke.setConfig({manifestModel:Ue,adapter:$,manifestLoader:Ie,errHandler:E,contentSteeringController:ae}),Z=ue(o).create({debug:l,manifestUpdater:Ke,baseURLController:Q,manifestLoader:Ie,manifestModel:Ue,mediaPlayerModel:J,abrController:M,playbackController:S,adapter:$,errHandler:E,dashMetrics:he,timelineConverter:k,segmentBaseController:Ot,schemeLoaderFactory:ne,eventBus:f,events:L.default,errors:I,constants:B.default,settings:g,dashConstants:p.default,urlUtils:it(o).getInstance()}),Z}return null}function Ve(){let ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:NaN;Z&&Z.resetRecords(),!A&&u&&(A=!0,b.info("Streaming Initialized"),function(){const Ie=et();K||(K=Zi(o).getInstance()),H||(H=od(o).create({errHandler:E,manifestModel:Ue,adapter:$,mediaController:h,baseURLController:Q,videoModel:ut,settings:g})),te.setConfig({capabilities:j,customParametersModel:fe,adapter:$,settings:g,protectionController:v,manifestModel:Ue,errHandler:E}),K.setConfig({capabilities:j,capabilitiesFilter:te,manifestLoader:Ie,manifestModel:Ue,mediaPlayerModel:J,customParametersModel:fe,protectionController:v,textController:H,adapter:$,dashMetrics:he,errHandler:E,timelineConverter:k,videoModel:ut,playbackController:S,serviceDescriptionController:U,contentSteeringController:ae,abrController:M,throughputController:G,mediaController:h,settings:g,baseURLController:Q,uriFragmentModel:st,segmentBaseController:Ot}),V.setConfig({settings:g,playbackController:S,streamController:K,videoModel:ut,timelineConverter:k,adapter:$}),S.setConfig({streamController:K,serviceDescriptionController:U,dashMetrics:he,adapter:$,videoModel:ut,timelineConverter:k,settings:g}),ge.setConfig({streamController:K,playbackController:S,mediaPlayerModel:J,videoModel:ut,settings:g}),G.setConfig({settings:g,playbackController:S}),M.setConfig({streamController:K,capabilities:j,domStorage:xt,mediaPlayerModel:J,customParametersModel:fe,throughputController:G,cmsdModel:He,dashMetrics:he,adapter:$,videoModel:ut,settings:g}),Ce.setConfig({abrController:M,dashMetrics:he,playbackController:S,serviceDescriptionController:U,throughputController:G}),tn.setConfig({serviceDescriptionController:U}),He.setConfig({}),h.initialize(),G.initialize(),M.initialize(),K.initialize(P,c),H.initialize(),V.initialize(),ge.initialize(),Ce.initialize(P),He.initialize(),ae.initialize(),Ot.initialize()}(),typeof u=="string"?K.load(u,ue):K.loadWithManifest(u,ue)),!N&&Pt()&&(N=!0,f.trigger(se.default.PLAYBACK_INITIALIZED),b.info("Playback Initialized"))}return _={addABRCustomRule:function(ue,Ie,Ke){fe.addAbrCustomRule(ue,Ie,Ke)},addRequestInterceptor:function(ue){fe.addRequestInterceptor(ue)},addResponseInterceptor:function(ue){fe.addResponseInterceptor(ue)},addUTCTimingSource:function(ue,Ie){fe.addUTCTimingSource(ue,Ie)},attachProtectionController:function(ue){v=ue},attachSource:Dt,attachTTMLRenderingDiv:function(ue){if(!ut.getElement())throw n;ut.setTTMLRenderingDiv(ue)},attachView:dt,attachVttRenderingDiv:function(ue){if(!ut.getElement())throw n;ut.setVttRenderingDiv(ue)},clearDefaultUTCTimingSources:function(){fe.clearDefaultUTCTimingSources()},convertToTimeCode:function(ue){ue=Math.max(ue,0);let Ie=Math.floor(ue/3600),Ke=Math.floor(ue%3600/60),Ne=Math.floor(ue%3600%60);return(Ie===0?"":Ie<10?"0"+Ie.toString()+":":Ie.toString()+":")+(Ke<10?"0"+Ke.toString():Ke.toString())+":"+(Ne<10?"0"+Ne.toString():Ne.toString())},destroy:function(){mt(),pe.default.deleteSingletonInstances(o)},duration:function(){if(!N)throw e;let ue=tt().duration;if(S.getIsDynamic()){const Ie=K&&K.hasVideoTrack()?B.default.VIDEO:B.default.AUDIO;let Ke=he.getCurrentDVRInfo(Ie);ue=Ke?Ke.range.end-Ke.range.start:0}return ue},enableForcedTextStreaming:function(ue){return!(!K.getActiveStreamInfo()||!H)&&H.enableForcedTextStreaming(ue)},enableText:function(ue){const Ie=K.getActiveStreamInfo();return!(!Ie||!H)&&H.enableText(Ie.id,ue)},extend:function(ue,Ie,Ke){pe.default.extend(ue,Ie,Ke,o)},formatUTC:function(ue,Ie,Ke){let Ne=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const nt=new Date(1e3*ue),kt=nt.toLocaleDateString(Ie),Yt=nt.toLocaleTimeString(Ie,{hour12:Ke});return Ne?Yt+" "+kt:Yt},getABRCustomRules:function(){return fe.getAbrCustomRules()},getActiveStream:jt,getAutoPlay:function(){return P},getAvailableBaseUrls:function(){const ue=Ue.getValue();return ue?Q.getBaseUrls(ue):[]},getAvailableLocations:function(){const ue=Ue.getValue();if(!ue)return[];const Ie=$.getLocation(ue),Ke=ae.getSynthesizedLocationElements(Ie);return Ie.concat(Ke)},getAverageLatency:function(){let ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:B.default.VIDEO,Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,Ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;return G?G.getAverageLatency(ue,Ie,Ke):0},getAverageThroughput:function(){let ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:B.default.VIDEO,Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,Ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;return G?G.getAverageThroughput(ue,Ie,Ke):0},getBufferLength:function(ue){const Ie=[B.default.VIDEO,B.default.AUDIO,B.default.TEXT];if(ue)return Ie.indexOf(ue)!==-1?xe().getCurrentBufferLevel(ue)||NaN:(b.warn("getBufferLength requested for invalid type"),NaN);{const Ke=Ie.map(Ne=>It(Ne).length>0?xe().getCurrentBufferLevel(Ne):Number.MAX_VALUE).reduce((Ne,nt)=>Math.min(Ne,nt));return Ke===Number.MAX_VALUE?NaN:Ke}},getCurrentLiveLatency:function(){if(!m)throw i;return N?S.getCurrentLiveLatency():NaN},getCurrentRepresentationForType:function(ue){if(!A)throw t;if(ue!==B.default.IMAGE&&ue!==B.default.VIDEO&&ue!==B.default.AUDIO)return null;const Ie=jt();if(!Ie)return null;if(ue===B.default.IMAGE){const Ke=Ie.getThumbnailController();return Ke?Ke.getCurrentTrack():-1}return Ie.getCurrentRepresentationForType(ue)},getCurrentSteeringResponseData:function(){if(ae)return ae.getCurrentSteeringResponseData()},getCurrentTextTrackIndex:function(){let ue=NaN;const Ie=K.getActiveStreamInfo();if(Ie&&H)return ue=H.getCurrentTrackIdx(Ie.id),ue},getCurrentTrackFor:function(ue){if(!A)throw t;let Ie=K.getActiveStreamInfo();return Ie?h.getCurrentTrackFor(ue,Ie.id):null},getDashAdapter:function(){return $},getDashMetrics:xe,getDebug:function(){return l},getDvrSeekOffset:Jt,getDvrWindow:function(){if(!N)throw e;const ue=K&&K.hasVideoTrack()?B.default.VIDEO:B.default.AUDIO;let Ie=he.getCurrentDVRInfo(ue);if(!Ie)return{};let Ke=0;const Ne=S.getIsDynamic();return Ne&&(Ke=Ie.manifestInfo.availableFrom.getTime()/1e3),{start:Ie.range.start,end:Ie.range.end,startAsUtc:Ne?Ke+Ie.range.start:NaN,endAsUtc:Ne?Ke+Ie.range.end:NaN,size:Ie.range.end-Ie.range.start}},getInitialMediaSettingsFor:function(ue){if(!m)throw i;return h.getInitialSettings(ue)},getLowLatencyModeEnabled:function(){if(!N)throw e;return S.getLowLatencyModeEnabled()},getManifest:function(){return Ue.getValue()},getOfflineController:function(){return Mt()},getPlaybackRate:function(){return tt().playbackRate},getProtectionController:function(){return gt()},getRawThroughputData:function(){let ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:B.default.VIDEO;return G?G.getRawThroughputData(ue):[]},getRepresentationsByType:function(ue){let Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!A)throw t;let Ke=Ie?K.getStreamById(Ie):jt();return Ke?Ke.getRepresentationsByType(ue):[]},getSafeAverageThroughput:function(){let ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:B.default.VIDEO,Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,Ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;return G?G.getSafeAverageThroughput(ue,Ie,Ke):0},getSettings:function(){return g.get()},getSource:function(){if(!u)throw r;return u},getStreamsFromManifest:function(ue){if(!A)throw t;return $.getStreamsInfo(ue)},getTTMLRenderingDiv:function(){return ut?ut.getTTMLRenderingDiv():null},getTargetLiveDelay:function(){if(!N)throw e;return S.getOriginalLiveDelay()},getTracksFor:It,getTracksForTypeFromManifest:function(ue,Ie,Ke){if(!A)throw t;return(Ke=Ke||$.getStreamsInfo(Ie,1)[0])?$.getAllMediaInfoForType(Ke,ue,Ie):[]},getVersion:Vt,getVideoElement:tt,getVolume:function(){return tt().volume},getXHRWithCredentialsForType:function(ue){return fe.getXHRWithCredentialsForType(ue)},initialize:function(ue,Ie,Ke){let Ne=arguments.length>3&&arguments[3]!==void 0?arguments[3]:NaN;j||(j=(0,Nl.default)(o).getInstance(),j.setConfig({settings:g,protectionController:v})),E||(E=Ks(o).getInstance()),j.supportsMediaSource()?(m||(m=!0,k=Gu(o).getInstance(),G||(G=ud(o).getInstance()),M||(M=eo(o).getInstance()),ne||(ne=Mi(o).getInstance()),S||(S=$e(o).getInstance()),h||(h=Ss(o).getInstance()),K||(K=Zi(o).getInstance()),V||(V=hs(o).getInstance()),ge||(ge=ps(o).getInstance()),U||(U=ys(o).getInstance()),ae||(ae=Br(o).getInstance()),te||(te=Ws(o).getInstance()),$=Ru(o).getInstance(),Ue=Qs(o).getInstance(),Ce=mi(o).getInstance(),He=Si(o).getInstance(),tn=Ri(o).getInstance(),he=Bu(o).getInstance({settings:g}),xt=hu(o).getInstance({settings:g}),$.setConfig({constants:B.default,cea608parser:new ct,errHandler:E,BASE64:ai}),Q||(Q=Cs(o).create()),Q.setConfig({adapter:$,contentSteeringController:ae}),U.setConfig({adapter:$}),Ot||(Ot=Eu(o).getInstance({dashMetrics:he,mediaPlayerModel:J,errHandler:E,baseURLController:Q,events:L.default,eventBus:f,debug:l,boxParser:hr(o).getInstance(),errors:I})),h.setConfig({domStorage:xt,settings:g,mediaPlayerModel:J,customParametersModel:fe,videoModel:ut}),J.setConfig({playbackController:S,serviceDescriptionController:U}),ae.setConfig({adapter:$,errHandler:E,dashMetrics:he,mediaPlayerModel:J,manifestModel:Ue,serviceDescriptionController:U,throughputController:G,eventBus:f}),Qe(),Ge(Ke===void 0||Ke),Mt()),ue&&dt(ue),Ie&&Dt(Ie,Ne),b.info("[dash.js "+Vt()+"] MediaPlayer has been initialized")):E.error(new ye.default(I.CAPABILITY_MEDIASOURCE_ERROR_CODE,I.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},isDynamic:Zt,isMuted:function(){return tt().muted},isPaused:dn,isReady:Pt,isSeeking:function(){if(!N)throw e;return S.isSeeking()},isTextEnabled:function(){const ue=K.getActiveStreamInfo();return!(!ue||!H)&&H.isTextEnabled(ue)},off:function(ue,Ie,Ke){f.off(ue,Ie,Ke)},on:function(ue,Ie,Ke,Ne){f.on(ue,Ie,Ke,Ne)},pause:function(){if(!N)throw e;S.pause()},play:function(){if(!N)throw e;(!P||dn()&&N)&&S.play(!0)},preload:function(){if(!ut.getElement()&&!A){if(!u)throw r;Ve(C)}},provideThumbnail:function(ue,Ie){if(typeof Ie!="function")return;if(ue<0)return void Ie(null);const Ke=S.getIsDynamic()?Jt(ue):ue,Ne=K.getStreamForTime(Ke);if(Ne===null)return void Ie(null);const nt=Ne.getThumbnailController();if(nt)return nt.provide(Ke,Ie);Ie(null)},refreshManifest:function(ue){if(!m)throw i;if(!Pt())return ue(null,r);let Ie=this;if(typeof ue=="function"){const Ke=function(Ne){f.off(L.default.INTERNAL_MANIFEST_LOADED,Ke,Ie),Ne.error?ue(null,Ne.error):ue(Ne.manifest)};f.on(L.default.INTERNAL_MANIFEST_LOADED,Ke,Ie)}K.refreshManifest()},registerCustomCapabilitiesFilter:function(ue){fe.registerCustomCapabilitiesFilter(ue)},registerLicenseRequestFilter:function(ue){fe.registerLicenseRequestFilter(ue)},registerLicenseResponseFilter:function(ue){fe.registerLicenseResponseFilter(ue)},removeABRCustomRule:function(ue){fe.removeAbrCustomRule(ue)},removeAllABRCustomRule:function(){fe.removeAllAbrCustomRule()},removeRequestInterceptor:function(ue){fe.removeRequestInterceptor(ue)},removeResponseInterceptor:function(ue){fe.removeResponseInterceptor(ue)},removeUTCTimingSource:function(ue,Ie){fe.removeUTCTimingSource(ue,Ie)},reset:mt,resetCustomInitialTrackSelectionFunction:function(){fe.resetCustomInitialTrackSelectionFunction(null)},resetSettings:function(){g.reset()},restoreDefaultUTCTimingSources:Qe,retrieveManifest:function(ue,Ie){let Ke=et(),Ne=this;const nt=function(kt){kt.error?Ie(null,kt.error):Ie(kt.manifest),f.off(L.default.INTERNAL_MANIFEST_LOADED,nt,Ne),Ke.reset()};f.on(L.default.INTERNAL_MANIFEST_LOADED,nt,Ne),st.initialize(ue),Ke.load(ue)},seek:function(ue){if(!N)throw e;if((0,We.checkParameterType)(ue,"number"),isNaN(ue))throw B.default.BAD_ARGUMENT_ERROR;ue<0&&(ue=0);let Ie=S.getIsDynamic()?Jt(ue):ue;const Ke=tt();!S.getIsDynamic()&&Ke.duration&&(Ie=Math.min(Ke.duration,Ie)),S.seek(Ie,!1,!1,!0)},seekToOriginalLive:function(){N&&Zt()&&S.seekToOriginalLive()},seekToPresentationTime:function(ue){if(!N)throw e;if((0,We.checkParameterType)(ue,"number"),isNaN(ue))throw B.default.BAD_ARGUMENT_ERROR;ue<0&&(ue=0);const Ie=tt();if(!S.getIsDynamic()&&Ie.duration&&(ue=Math.min(Ie.duration,ue)),S.getIsDynamic()){const Ke=K&&K.hasVideoTrack()?B.default.VIDEO:B.default.AUDIO;let Ne=he.getCurrentDVRInfo(Ke);if(!Ne)return;(ue=ke(ue,Ne))1&&arguments[1]!==void 0&&arguments[1];if(!A)throw t;!v||v.areKeyIdsUsable(ue.normalizedKeyIds)?h.setTrack(ue,{noSettingsSave:Ie}):b.error(`Can not switch to track with index ${ue.index} because key is not usable`)},setCustomInitialTrackSelectionFunction:function(ue){fe.setCustomInitialTrackSelectionFunction(ue)},setInitialMediaSettingsFor:function(ue,Ie){if(!m)throw i;let Ke=function(Ne){const nt=g.get().streaming.defaultSchemeIdUri;let kt={};function Yt(rn,en,Rn){let Fn={};if(en){if(en instanceof Array)throw"Array type not supported for settings!";return en instanceof Object?(Fn.schemeIdUri=en.schemeIdUri?en.schemeIdUri:"",Fn.value=en.value?en.value:""):(Fn.schemeIdUri=Rn,Fn.value=en,b.warn("No schemeIdUri provided for "+rn+', using default "'+Rn+'"')),Fn}return null}return Ne.lang&&(kt.lang=Ne.lang),isNaN(Ne.index)||(kt.index=Ne.index),Ne.viewpoint&&(kt.viewpoint=Yt("viewpoint",Ne.viewpoint,nt.viewpoint)),Ne.audioChannelConfiguration&&(kt.audioChannelConfiguration=Yt("audioChannelConfiguration",Ne.audioChannelConfiguration,nt.audioChannelConfiguration)),Ne.role&&(kt.role=Yt("role",Ne.role,nt.role)),Ne.accessibility&&(kt.accessibility=Yt("accessibility",Ne.accessibility,nt.accessibility)),kt}(Ie);h.setInitialSettings(ue,Ke)},setMute:function(ue){(0,We.checkParameterType)(ue,"boolean"),tt().muted=ue},setPlaybackRate:function(ue){tt().playbackRate=ue},setProtectionData:function(ue){c=ue,K&&K.setProtectionData(c)},setRepresentationForTypeById:function(ue,Ie){let Ke=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(ue!==B.default.IMAGE&&ue!==B.default.VIDEO&&ue!==B.default.AUDIO)return;if(!A)throw t;const Ne=jt();if(Ne)if(ue===B.default.IMAGE){const nt=Ne.getThumbnailController();nt&&nt.setTrackById(Ie)}else{const nt=Ne.getRepresentationForTypeById(ue,Ie);nt&&M.setPlaybackQuality(ue,K.getActiveStreamInfo(),nt,{forceReplace:Ke})}},setRepresentationForTypeByIndex:function(ue,Ie){let Ke=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(ue!==B.default.IMAGE&&ue!==B.default.VIDEO&&ue!==B.default.AUDIO)return;if(!A)throw t;const Ne=jt();if(Ne)if(ue===B.default.IMAGE){const nt=Ne.getThumbnailController();nt&&nt.setTrackByIndex(Ie)}else{const nt=Ne.getRepresentationForTypeByIndex(ue,Ie);nt&&M.setPlaybackQuality(ue,K.getActiveStreamInfo(),nt,{forceReplace:Ke})}},setTextTrack:function(ue){if(!N)throw e;const Ie=K.getActiveStreamInfo();Ie&&H&&H.setTextTrack(Ie.id,ue)},setVolume:function(ue){if(typeof ue!="number"||isNaN(ue)||ue<0||ue>1)throw B.default.BAD_ARGUMENT_ERROR;tt().volume=ue},setXHRWithCredentialsForType:function(ue,Ie){fe.setXHRWithCredentialsForType(ue,Ie)},time:Ye,timeAsUTC:function(){if(!N)throw e;if(!S.getIsDynamic()||Ye()<0)return NaN;const ue=K&&K.hasVideoTrack()?B.default.VIDEO:B.default.AUDIO;let Ie,Ke,Ne=he.getCurrentDVRInfo(ue);return Ne?(Ie=Ne.manifestInfo.availableFrom.getTime()/1e3,Ke=Ie+Ye(),Ke):0},timeInDvrWindow:function(){if(!N)throw e;if(!S.getIsDynamic())return Ye();let ue=tt().currentTime;const Ie=K&&K.hasVideoTrack()?B.default.VIDEO:B.default.AUDIO;let Ke=he.getCurrentDVRInfo(Ie);return ue=Ke===null||ue===0?0:Math.max(0,ue-Ke.range.start),ue},trigger:function(ue,Ie,Ke){f.trigger(ue,Ie,Ke)},triggerSteeringRequest:function(){if(ae)return ae.loadSteeringData()},unregisterCustomCapabilitiesFilter:function(ue){fe.unregisterCustomCapabilitiesFilter(ue)},unregisterLicenseRequestFilter:function(ue){fe.unregisterLicenseRequestFilter(ue)},unregisterLicenseResponseFilter:function(ue){fe.unregisterLicenseResponseFilter(ue)},updateSettings:function(ue){g.update(ue)},updateSource:function(ue){u=ue,K.load(u)}},b=l.getLogger(_),m=!1,N=!1,A=!1,P=!0,C=NaN,v=null,Z=null,c=null,$=null,Ot=null,L.default.extend(se.default),J=Zs(o).getInstance(),fe=(0,Ii.default)(o).getInstance(),ut=gu(o).getInstance(),st=Xs(o).getInstance(),_}ii.__dashjs_factory_name="MediaPlayer";const Rr=pe.default.getClassFactory(ii);Rr.events=se.default,Rr.errors=I,pe.default.updateClassFactory(ii.__dashjs_factory_name,Rr);var dd=Rr},1191:function(Nt,Fe,de){de.r(Fe);var be=de(7252);class z extends be.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 T=new z;Fe.default=T},5212:function(Nt,Fe,de){de.r(Fe),Fe.default={STREAM:"stream",VIDEO:"video",AUDIO:"audio",TEXT:"text",MUXED:"muxed",IMAGE:"image",STPP:"stpp",TTML:"ttml",VTT:"vtt",WVTT:"wvtt",CONTENT_STEERING:"contentSteering",LIVE_CATCHUP_MODE_DEFAULT:"liveCatchupModeDefault",LIVE_CATCHUP_MODE_LOLP:"liveCatchupModeLoLP",MOVING_AVERAGE_SLIDING_WINDOW:"slidingWindow",MOVING_AVERAGE_EWMA:"ewma",BAD_ARGUMENT_ERROR:"Invalid Arguments",MISSING_CONFIG_ERROR:"Missing config parameter(s)",TRACK_SWITCH_MODE_ALWAYS_REPLACE:"alwaysReplace",TRACK_SWITCH_MODE_NEVER_REPLACE:"neverReplace",TRACK_SELECTION_MODE_FIRST_TRACK:"firstTrack",TRACK_SELECTION_MODE_HIGHEST_BITRATE:"highestBitrate",TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:"highestEfficiency",TRACK_SELECTION_MODE_WIDEST_RANGE:"widestRange",TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY:"highestSelectionPriority",CMCD_QUERY_KEY:"CMCD",CMCD_MODE_QUERY:"query",CMCD_MODE_HEADER:"header",CMCD_AVAILABLE_KEYS:["br","d","ot","tb","bl","dl","mtp","nor","nrr","su","bs","rtp","cid","pr","sf","sid","st","v"],CMCD_V2_AVAILABLE_KEYS:["msd","ltc"],CMCD_AVAILABLE_REQUESTS:["segment","mpd","xlink","steering","other"],INITIALIZE:"initialize",TEXT_SHOWING:"showing",TEXT_HIDDEN:"hidden",TEXT_DISABLED:"disabled",ACCESSIBILITY_CEA608_SCHEME:"urn:scte:dash:cc:cea-608:2015",CC1:"CC1",CC3:"CC3",UTF8:"utf-8",SCHEME_ID_URI:"schemeIdUri",START_TIME:"starttime",SERVICE_DESCRIPTION_DVB_LL_SCHEME:"urn:dvb:dash:lowlatency:scope:2019",SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME:"urn:dvb:dash:lowlatency:critical:2019",CTA_5004_2023_SCHEME:"urn:mpeg:dash:cta-5004:2023",THUMBNAILS_SCHEME_ID_URIS:["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"],FONT_DOWNLOAD_DVB_SCHEME:"urn:dvb:dash:fontdownload:2014",COLOUR_PRIMARIES_SCHEME_ID_URI:"urn:mpeg:mpegB:cicp:ColourPrimaries",URL_QUERY_INFO_SCHEME:"urn:mpeg:dash:urlparam:2014",EXT_URL_QUERY_INFO_SCHEME:"urn:mpeg:dash:urlparam:2016",MATRIX_COEFFICIENTS_SCHEME_ID_URI:"urn:mpeg:mpegB:cicp:MatrixCoefficients",TRANSFER_CHARACTERISTICS_SCHEME_ID_URI:"urn:mpeg:mpegB:cicp:TransferCharacteristics",HDR_METADATA_FORMAT_SCHEME_ID_URI:"urn:dvb:dash:hdr-dmi",HDR_METADATA_FORMAT_VALUES:{ST2094_10:"ST2094-10",SL_HDR2:"SL-HDR2",ST2094_40:"ST2094-40"},MEDIA_CAPABILITIES_API:{COLORGAMUT:{SRGB:"srgb",P3:"p3",REC2020:"rec2020"},TRANSFERFUNCTION:{SRGB:"srgb",PQ:"pq",HLG:"hlg"},HDR_METADATATYPE:{SMPTE_ST_2094_10:"smpteSt2094-10",SLHDR2:"slhdr2",SMPTE_ST_2094_40:"smpteSt2094-40"}},XML:"XML",ARRAY_BUFFER:"ArrayBuffer",DVB_REPORTING_URL:"dvb:reportingUrl",DVB_PROBABILITY:"dvb:probability",OFF_MIMETYPE:"application/font-sfnt",WOFF_MIMETYPE:"application/font-woff",VIDEO_ELEMENT_READY_STATES:{HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4},FILE_LOADER_TYPES:{FETCH:"fetch_loader",XHR:"xhr_loader"},THROUGHPUT_TYPES:{LATENCY:"throughput_type_latency",BANDWIDTH:"throughput_type_bandwidth"},THROUGHPUT_CALCULATION_MODES:{EWMA:"throughputCalculationModeEwma",ZLEMA:"throughputCalculationModeZlema",ARITHMETIC_MEAN:"throughputCalculationModeArithmeticMean",BYTE_SIZE_WEIGHTED_ARITHMETIC_MEAN:"throughputCalculationModeByteSizeWeightedArithmeticMean",DATE_WEIGHTED_ARITHMETIC_MEAN:"throughputCalculationModeDateWeightedArithmeticMean",HARMONIC_MEAN:"throughputCalculationModeHarmonicMean",BYTE_SIZE_WEIGHTED_HARMONIC_MEAN:"throughputCalculationModeByteSizeWeightedHarmonicMean",DATE_WEIGHTED_HARMONIC_MEAN:"throughputCalculationModeDateWeightedHarmonicMean"},LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE:{MOOF_PARSING:"lowLatencyDownloadTimeCalculationModeMoofParsing",DOWNLOADED_DATA:"lowLatencyDownloadTimeCalculationModeDownloadedData",AAST:"lowLatencyDownloadTimeCalculationModeAast"},RULES_TYPES:{QUALITY_SWITCH_RULES:"qualitySwitchRules",ABANDON_FRAGMENT_RULES:"abandonFragmentRules"},QUALITY_SWITCH_RULES:{BOLA_RULE:"BolaRule",THROUGHPUT_RULE:"ThroughputRule",INSUFFICIENT_BUFFER_RULE:"InsufficientBufferRule",SWITCH_HISTORY_RULE:"SwitchHistoryRule",DROPPED_FRAMES_RULE:"DroppedFramesRule",LEARN_TO_ADAPT_RULE:"L2ARule",LOL_PLUS_RULE:"LoLPRule"},ABANDON_FRAGMENT_RULES:{ABANDON_REQUEST_RULE:"AbandonRequestsRule"},ID3_SCHEME_ID_URI:"https://aomedia.org/emsg/ID3",COMMON_ACCESS_TOKEN_HEADER:"common-access-token",DASH_ROLE_SCHEME_ID:"urn:mpeg:dash:role:2011",CODEC_FAMILIES:{MP3:"mp3",AAC:"aac",AC3:"ac3",EC3:"ec3",DTSX:"dtsx",DTSC:"dtsc",AVC:"avc",HEVC:"hevc"}}},2861:function(Nt,Fe,de){de.r(Fe),Fe.default={CLEARKEY_KEYSTEM_STRING:"org.w3.clearkey",WIDEVINE_KEYSTEM_STRING:"com.widevine.alpha",PLAYREADY_KEYSTEM_STRING:"com.microsoft.playready",PLAYREADY_RECOMMENDATION_KEYSTEM_STRING:"com.microsoft.playready.recommendation",WIDEVINE_UUID:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",PLAYREADY_UUID:"9a04f079-9840-4286-ab92-e65be0885f95",CLEARKEY_UUID:"e2719d58-a985-b3c9-781a-b030af78d30e",W3C_CLEARKEY_UUID:"1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",INITIALIZATION_DATA_TYPE_CENC:"cenc",INITIALIZATION_DATA_TYPE_KEYIDS:"keyids",INITIALIZATION_DATA_TYPE_WEBM:"webm",ENCRYPTION_SCHEME_CENC:"cenc",ENCRYPTION_SCHEME_CBCS:"cbcs",MEDIA_KEY_MESSAGE_TYPES:{LICENSE_REQUEST:"license-request",LICENSE_RENEWAL:"license-renewal",LICENSE_RELEASE:"license-release",INDIVIDUALIZATION_REQUEST:"individualization-request"},ROBUSTNESS_STRINGS:{WIDEVINE:{SW_SECURE_CRYPTO:"SW_SECURE_CRYPTO",SW_SECURE_DECODE:"SW_SECURE_DECODE",HW_SECURE_CRYPTO:"HW_SECURE_CRYPTO",HW_SECURE_DECODE:"HW_SECURE_DECODE",HW_SECURE_ALL:"HW_SECURE_ALL"}},MEDIA_KEY_STATUSES:{USABLE:"usable",EXPIRED:"expired",RELEASED:"released",OUTPUT_RESTRICTED:"output-restricted",OUTPUT_DOWNSCALED:"output-downscaled",STATUS_PENDING:"status-pending",INTERNAL_ERROR:"internal-error"}}},4469:function(Nt,Fe,de){de.r(Fe),de.d(Fe,{default:function(){return y}});class be{constructor(){this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null}}be.SSL_CONNECTION_FAILED_PREFIX="SSL",be.DNS_RESOLUTION_FAILED="C00",be.HOST_UNREACHABLE="C01",be.CONNECTION_REFUSED="C02",be.CONNECTION_ERROR="C03",be.CORRUPT_MEDIA_ISOBMFF="M00",be.CORRUPT_MEDIA_OTHER="M01",be.BASE_URL_CHANGED="F00",be.BECAME_REPORTER="S00";var z=be,T=de(913),O=de(138);function re(X){let x,Te;const Le=(X=X||{}).eventBus,Re=X.dashMetrics,ze=X.metricsConstants,ve=X.events;function Pe(Ct){let ht=new z;if(Te){for(const hn in Ct)Ct.hasOwnProperty(hn)&&(ht[hn]=Ct[hn]);ht.mpdurl||(ht.mpdurl=Te.originalUrl||Te.url),ht.terror||(ht.terror=new Date),Re.addDVBErrors(ht)}}function Xe(Ct){Ct.error||(Te=Ct.manifest)}function qe(Ct){Pe({errorcode:z.BASE_URL_CHANGED,servicelocation:Ct.entry})}function at(){Pe({errorcode:z.BECAME_REPORTER})}function Bt(Ct){var ht;Ct.metric===ze.HTTP_REQUEST&&((ht=Ct.value).responsecode===0||ht.responsecode==null||ht.responsecode>=400||ht.responsecode<100||ht.responsecode>=600)&&Pe({errorcode:ht.responsecode||z.CONNECTION_ERROR,url:ht.url,terror:ht.tresponse,servicelocation:ht._serviceLocation})}function St(Ct){let ht;switch(Ct.error?Ct.error.code:0){case MediaError.MEDIA_ERR_NETWORK:ht=z.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:ht=z.CORRUPT_MEDIA_OTHER;break;default:return}Pe({errorcode:ht})}return x={initialize:function(){Le.on(ve.MANIFEST_UPDATED,Xe,x),Le.on(ve.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,qe,x),Le.on(ve.METRIC_ADDED,Bt,x),Le.on(ve.METRIC_UPDATED,Bt,x),Le.on(ve.PLAYBACK_ERROR,St,x),Le.on(T.default.BECAME_REPORTING_PLAYER,at,x)},reset:function(){Le.off(ve.MANIFEST_UPDATED,Xe,x),Le.off(ve.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,qe,x),Le.off(ve.METRIC_ADDED,Bt,x),Le.off(ve.METRIC_UPDATED,Bt,x),Le.off(ve.PLAYBACK_ERROR,St,x),Le.off(T.default.BECAME_REPORTING_PLAYER,at,x)}},x}re.__dashjs_factory_name="DVBErrorsTranslator";var F=O.default.getSingletonFactory(re),q=de(7377);function oe(X){X=X||{};let x,Te,Le=!1,Re=this.context,ze=X.mediaElement;return x={initialize:function(ve){ve&&ve.length&&(ve.forEach(Pe=>{let Xe=Pe.starttime,qe=Xe+Pe.duration;Te.add(Xe,qe)}),Le=!!ve[0]._useWallClockTime)},reset:function(){Te.clear()},isEnabled:function(){let ve,Pe=Te.length;if(!Pe)return!0;ve=Le?new Date().getTime()/1e3:ze.currentTime;for(let Xe=0;Xe=200&&jn.status<300)&&Qn&&Qn())};at.push(jn);try{jn.open("GET",Nn),jn.onloadend=Et,jn.onerror=Et,jn.send()}catch{jn.onerror()}}(Sn,0,function(){ve=!1})})},initialize:function(Ct,ht){let hn;if(Xe=ht,Pe=Ct.dvbReportingUrl,!Pe)throw new Error("required parameter missing (dvb:reportingUrl)");ze||(hn=Ct.dvbProbability,hn&&(hn===1e3||hn/1e3>=Re.random())&&(ve=!0),ze=!0)},reset:function(){St()}},Te=le(qe).getInstance(),Re=ce(qe).getInstance(),Le=(0,Ee.default)(qe).getInstance(),St(),x}Ae.__dashjs_factory_name="DVBReporting";var we=O.default.getClassFactory(Ae);function De(X){X=X||{};const x={"urn:dvb:dash:reporting:2014":we},Te=this.context;let Le;const Re=X.debug?X.debug.getLogger(Le):{},ze=X.metricsConstants,ve=X.mediaPlayerModel||{};return Le={create:function(Pe,Xe){let qe;try{qe=x[Pe.schemeIdUri](Te).create({metricsConstants:ze,mediaPlayerModel:ve}),qe.initialize(Pe,Xe)}catch(at){qe=null,Re.error(`ReportingFactory: could not create Reporting with schemeIdUri ${Pe.schemeIdUri} (${at.message})`)}return qe},register:function(Pe,Xe){x[Pe]=Xe},unregister:function(Pe){delete x[Pe]}},Le}De.__dashjs_factory_name="ReportingFactory";var Be=O.default.getSingletonFactory(De);function ct(X){let x,Te=[];const Le=Be(this.context).getInstance(X);return x={initialize:function(Re,ze){Re.some(ve=>{let Pe=Le.create(ve,ze);if(Pe)return Te.push(Pe),!0})},reset:function(){Te.forEach(Re=>Re.reset()),Te=[]},report:function(Re,ze){Te.forEach(ve=>ve.report(Re,ze))}},x}ct.__dashjs_factory_name="ReportingController";var B=O.default.getClassFactory(ct);function p(){return{reconstructFullMetricName:function(X,x,Te){let Le=X;return x&&(Le+="("+x,Te&&Te.length&&(Le+=","+Te),Le+=")"),Le},validateN:function(X){if(!X)throw new Error("missing n");if(isNaN(X))throw new Error("n is NaN");if(X<0)throw new Error("n must be positive");return X}}}p.__dashjs_factory_name="HandlerHelpers";var ie=O.default.getSingletonFactory(p);function me(X){let x,Te,Le,Re,ze,ve;X=X||{};let Pe=this.context,Xe=ie(Pe).getInstance(),qe=[];const at=X.metricsConstants;function Bt(){let St=function(){try{return Object.keys(qe).map(Ct=>qe[Ct]).reduce((Ct,ht)=>Ct.level{qe.handleNewMetric(Xe.metric,Xe.value,Xe.mediaType)})}return x={initialize:function(Xe,qe){Xe.split(",").forEach((at,Bt,St)=>{let Ct;if(at.indexOf("(")!==-1&&at.indexOf(")")===-1){let ht=St[Bt+1];ht&&ht.indexOf("(")===-1&&ht.indexOf(")")!==-1&&(at+=","+ht,delete St[Bt+1])}Ct=ve.create(at,qe),Ct&&Te.push(Ct)}),Re.on(ze.METRIC_ADDED,Pe,x),Re.on(ze.METRIC_UPDATED,Pe,x)},reset:function(){Re.off(ze.METRIC_ADDED,Pe,x),Re.off(ze.METRIC_UPDATED,Pe,x),Te.forEach(Xe=>Xe.reset()),Te=[]}},x}Kt.__dashjs_factory_name="MetricsHandlersController";var zt=O.default.getClassFactory(Kt);function Wt(X){let x,Te,Le,Re;X=X||{};let ze=this.context;function ve(){x&&x.reset(),Te&&Te.reset(),Le&&Le.reset()}return Re={initialize:function(Pe){try{Le=ee(ze).create({mediaElement:X.mediaElement}),Le.initialize(Pe.Range),Te=B(ze).create({debug:X.debug,metricsConstants:X.metricsConstants,mediaPlayerModel:X.mediaPlayerModel}),Te.initialize(Pe.Reporting,Le),x=zt(ze).create({debug:X.debug,eventBus:X.eventBus,metricsConstants:X.metricsConstants,events:X.events}),x.initialize(Pe.metrics,Te)}catch(Xe){throw ve(),Xe}},reset:ve},Re}Wt.__dashjs_factory_name="MetricsController";var Ht=O.default.getClassFactory(Wt),cn=class{constructor(){this.metrics="",this.Range=[],this.Reporting=[]}},sn=class{constructor(){this.starttime=0,this.duration=1/0,this._useWallClockTime=!1}},un=class{constructor(){this.schemeIdUri="",this.value="",this.dvbReportingUrl="",this.dvbProbability=1e3}};function ye(X){let x,Te=(X=X||{}).adapter;const Le=X.constants;return x={getMetrics:function(Re){let ze=[];return Re&&Re.Metrics&&Re.Metrics.forEach(ve=>{var Pe=new cn,Xe=Te.getIsDynamic(Re);ve.hasOwnProperty("metrics")&&(Pe.metrics=ve.metrics,ve.Range&&ve.Range.forEach(qe=>{var at=new sn;at.starttime=function(Bt,St,Ct){let ht,hn,Sn=0;return St?Sn=Te.getAvailabilityStartTime(Bt)/1e3:(ht=Te.getRegularPeriods(Bt),ht.length&&(Sn=ht[0].start)),hn=Sn,Ct&&Ct.hasOwnProperty(Le.START_TIME)&&(hn+=Ct.starttime),hn}(Re,Xe,qe),qe.hasOwnProperty("duration")?at.duration=qe.duration:at.duration=Te.getDuration(Re),at._useWallClockTime=Xe,Pe.Range.push(at)}),ve.Reporting&&(ve.Reporting.forEach(qe=>{var at=new un;qe.hasOwnProperty(Le.SCHEME_ID_URI)&&(at.schemeIdUri=qe.schemeIdUri,qe.hasOwnProperty("value")&&(at.value=qe.value),qe.hasOwnProperty(Le.DVB_REPORTING_URL)&&(at.dvbReportingUrl=qe[Le.DVB_REPORTING_URL]),qe.hasOwnProperty(Le.DVB_PROBABILITY)&&(at.dvbProbability=qe[Le.DVB_PROBABILITY]),Pe.Reporting.push(at))}),ze.push(Pe)))}),ze}},x}ye.__dashjs_factory_name="ManifestParsing";var _e=O.default.getSingletonFactory(ye);function rt(X){let x;X=X||{};let Te={},Le=this.context,Re=X.eventBus;const ze=X.events;function ve(Xe){if(Xe.error)return;let qe=Object.keys(Te);_e(Le).getInstance({adapter:X.adapter,constants:X.constants}).getMetrics(Xe.manifest).forEach(at=>{const Bt=JSON.stringify(at);if(Te.hasOwnProperty(Bt))qe.splice(Bt,1);else try{let St=Ht(Le).create(X);St.initialize(at),Te[Bt]=St}catch{}}),qe.forEach(at=>{Te[at].reset(),delete Te[at]}),Re.trigger(T.default.METRICS_INITIALISATION_COMPLETE)}function Pe(){Object.keys(Te).forEach(Xe=>{Te[Xe].reset()}),Te={}}return x={reset:function(){Re.off(ze.MANIFEST_UPDATED,ve,x),Re.off(ze.STREAM_TEARDOWN_COMPLETE,Pe,x)}},Re.on(ze.MANIFEST_UPDATED,ve,x),Re.on(ze.STREAM_TEARDOWN_COMPLETE,Pe,x),x}rt.__dashjs_factory_name="MetricsCollectionController";var I=O.default.getClassFactory(rt);function R(){let X,x,Te=this.context;return X={createMetricsReporting:function(Le){return x=F(Te).getInstance({eventBus:Le.eventBus,dashMetrics:Le.dashMetrics,metricsConstants:Le.metricsConstants,events:Le.events}),x.initialize(),I(Te).create(Le)},getReportingFactory:function(){return Be(Te).getInstance()},getMetricsHandlerFactory:function(){return Tt(Te).getInstance()}},X}R.__dashjs_factory_name="MetricsReporting";const d=dashjs.FactoryMaker.getClassFactory(R);d.events=T.default,dashjs.FactoryMaker.updateClassFactory(R.__dashjs_factory_name,d);var y=d},913:function(Nt,Fe,de){de.r(Fe);var be=de(7252);class z extends be.default{constructor(){super(),this.METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",this.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",this.CMCD_DATA_GENERATED="cmcdDataGenerated"}}let T=new z;Fe.default=T},1926:function(Nt,Fe,de){de.r(Fe);var be=de(5717),z=de(138),T=de(8261),O=de(656),re=de(5212);function F(){let q,oe,ee,W,le,D,ce,Ee,Ae,we;const De=this.context,Be=(0,T.default)(De).getInstance();function ct(){W=[],le=[],D=[],ce=[],Ee=[],we=[],Ae=null,oe=[]}function B(L,pe){let Ze=-1;L.some((se,Ut)=>{if(se===pe)return Ze=Ut,!0}),Ze<0||L.splice(Ze,1)}function p(L){let pe;for(pe=0;pe{L(se,Ze)})},unregisterCustomCapabilitiesFilter:function(L){B(Ee,L)},unregisterLicenseRequestFilter:function(L){B(D,L)},unregisterLicenseResponseFilter:function(L){B(ce,L)}},ee={default:!1},ct(),q}F.__dashjs_factory_name="CustomParametersModel",Fe.default=z.default.getSingletonFactory(F)},3888:function(Nt,Fe,de){de.r(Fe),de.d(Fe,{default:function(){return jn}});var be=de(8854),z=de(2861);const T={prefixes:["clearkey","dashif","ck"]};class O{static findMp4ProtectionElement(yt){let lt=null;for(let We=0;We0&&(lt+=4+16*We.getUint32(lt)),lt+=4,yt.slice(lt)}static getPSSHForKeySystem(yt,lt){let We=O.parsePSSHList(lt);return yt&&We.hasOwnProperty(yt.uuid.toLowerCase())?We[yt.uuid.toLowerCase()]:null}static parseInitDataFromContentProtection(yt,lt){return"pssh"in yt&&yt.pssh?(yt.pssh.__text=yt.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),lt.decodeArray(yt.pssh.__text).buffer):null}static parsePSSHList(yt){if(yt==null)return[];let lt=new DataView(yt.buffer||yt),We={},wt=0;for(;;){let vt,Rt,Lt,ot,it,_t,nn=wt;if(wt>=lt.buffer.byteLength)break;if(vt=lt.getUint32(wt),Rt=wt+vt,wt+=4,lt.getUint32(wt)===1886614376)if(wt+=4,Lt=lt.getUint8(wt),Lt===0||Lt===1){for(wt++,wt+=3,ot="",it=0;it<4;it++)_t=lt.getUint8(wt+it).toString(16),ot+=_t.length===1?"0"+_t:_t;for(wt+=4,ot+="-",it=0;it<2;it++)_t=lt.getUint8(wt+it).toString(16),ot+=_t.length===1?"0"+_t:_t;for(wt+=2,ot+="-",it=0;it<2;it++)_t=lt.getUint8(wt+it).toString(16),ot+=_t.length===1?"0"+_t:_t;for(wt+=2,ot+="-",it=0;it<2;it++)_t=lt.getUint8(wt+it).toString(16),ot+=_t.length===1?"0"+_t:_t;for(wt+=2,ot+="-",it=0;it<6;it++)_t=lt.getUint8(wt+it).toString(16),ot+=_t.length===1?"0"+_t:_t;wt+=6,ot=ot.toLowerCase(),wt+=4,We[ot]=lt.buffer.slice(nn,Rt),wt=Rt}else wt=Rt;else wt=Rt}return We}static getLicenseServerUrlFromMediaInfo(yt,lt){try{if(!yt||yt.length===0)return null;let We=0,wt=null;for(;We0){const Rt=vt.contentProtection.filter(Lt=>Lt.schemeIdUri&&Lt.schemeIdUri===lt);if(Rt&&Rt.length>0){let Lt=0;for(;Lt0?vt:[z.default.INITIALIZATION_DATA_TYPE_CENC],Et&&Et.length&&(this.audioCapabilities=Et),yt&&yt.length&&(this.videoCapabilities=yt),this.distinctiveIdentifier=lt,this.persistentState=We,this.sessionTypes=wt}},oe=de(1923),ee=de(1944),W=class{constructor(Et,yt,lt,We,wt,vt,Rt,Lt){this.url=Et,this.method=yt,this.responseType=lt,this.headers=We,this.withCredentials=wt,this.messageType=vt,this.sessionId=Rt,this.data=Lt}},le=class{constructor(Et,yt,lt){this.url=Et,this.headers=yt,this.data=lt}},D=de(7568),ce=de(7263),Ee=de(5212),Ae=de(138);function we(Et){const yt=(Et=Et||{}).BASE64,lt=Et.cmcdModel,We=Et.constants,wt=Et.customParametersModel,vt=Et.debug,Rt=Et.eventBus,Lt=Et.events,ot=Et.protectionKeyController,it=Et.settings;let _t,nn,pt,Qt,fn,an,ln,yn,$t,Je,je,At,Ft=Et.protectionModel,on=[];function pn(){if(!(Rt&&Rt.hasOwnProperty("on")&&ot&&ot.hasOwnProperty("getSupportedKeySystemMetadataFromContentProtection")))throw new Error("Missing config parameter(s)")}function kn(bt,Gt){je||Qt?je&&Un():function(gn,bn){if(Qt)return;var An;Qt=!0;const Ln=function(_n){const wn=[];for(let Tn=0;Tn<_n.length;Tn++){const Mn=xn(_n[Tn]);wn.push({ks:_n[Tn].ks,configs:[Mn],protData:_n[Tn].protData})}return wn}(gn=(An=gn).sort((_n,wn)=>(_t&&_t[_n.ks.systemString]&&_t[_n.ks.systemString].priority>=0?_t[_n.ks.systemString].priority:An.length)-(_t&&_t[wn.ks.systemString]&&_t[wn.ks.systemString].priority>=0?_t[wn.ks.systemString].priority:An.length)));let Cn;Ft.requestKeySystemAccess(Ln).then(_n=>(Cn=_n.data,function(wn){let Tn=wn&&wn.selectedSystemString?wn.selectedSystemString:wn.keySystem.systemString;return ln.info("DRM: KeySystem Access Granted for system string ("+Tn+")! Selecting key system..."),Ft.selectKeySystem(wn)}(Cn))).then(_n=>{(function(wn,Tn){je=wn,Qt=!1,Rt.trigger(Lt.KEY_SYSTEM_SELECTED,{data:Tn});const Mn=Kn(je);Mn&&Mn.serverCertificate&&Mn.serverCertificate.length>0&&Ft.setServerCertificate(yt.decodeArray(Mn.serverCertificate).buffer),Un()})(_n,Cn)}).catch(_n=>{(function(wn,Tn){je=null,Qt=!1,Tn||Rt.trigger(Lt.KEY_SYSTEM_SELECTED,{data:null,error:new ee.default(oe.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,oe.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+wn.error)})})(_n,bn)})}(bt,Gt)}function Un(){let bt;for(let gn=0;gn<$t.length;gn++)for(bt=0;bt<$t[gn].length;bt++)if(je===$t[gn][bt].ks){Gt=$t[gn][bt],ot.isClearKey(je)&&function(bn){if(bn.protData&&bn.protData.hasOwnProperty("clearkeys")&&Object.keys(bn.protData.clearkeys).length!==0){const An={kids:Object.keys(bn.protData.clearkeys)};bn.initData=new TextEncoder().encode(JSON.stringify(An))}}(Gt),Gt.sessionId?vn(Gt):Gt.initData!==null&&On(Gt);break}var Gt;$t=[]}function xn(bt){const Gt=bt.protData,gn=[],bn=[],An=Gt&&Gt.initDataTypes&&Gt.initDataTypes.length>0?Gt.initDataTypes:[z.default.INITIALIZATION_DATA_TYPE_CENC],Ln=Gt&&Gt.audioRobustness&&Gt.audioRobustness.length>0?Gt.audioRobustness:Je,Cn=Gt&&Gt.videoRobustness&&Gt.videoRobustness.length>0?Gt.videoRobustness:Je,_n=bt.sessionType,wn=Gt&&Gt.distinctiveIdentifier?Gt.distinctiveIdentifier:"optional",Tn=Gt&&Gt.persistentState?Gt.persistentState:_n==="temporary"?"optional":"required";return yn.forEach(Mn=>{Mn.type===We.AUDIO?gn.push(new F(Mn.codec,Ln)):Mn.type===We.VIDEO&&bn.push(new F(Mn.codec,Cn))}),new q(gn,bn,wn,Tn,[_n],An)}function vn(bt){pn(),Ft.loadKeySession(bt)}function On(bt){if(bt&&function(gn){if(!gn)return!1;try{const bn=Ft.getSessionTokens();for(let An=0;An{Dn.toLowerCase()==="authorization"&&(Va=!0)}),Mn&&typeof Mn.withCredentials=="boolean"&&(Va=Mn.withCredentials);const oa=function(Dn){if(Ft)if(Dn.status>=200&&Dn.status<=299){const Ea=ce.default.parseHttpHeaders(Dn.getAllResponseHeaders?Dn.getAllResponseHeaders():null);let Na=new le(Dn.responseURL,Ea,Dn.response);ar(wt.getLicenseResponseFilters(),Na).then(()=>{const Ca=Tn.getLicenseMessage(Na.data,Hn,na);Ca!==null?(Jn(ya),Ft.updateKeySession(ga,Ca)):nr(Dn,ya,Hn,na,Tn)})}else nr(Dn,ya,Hn,na,Tn)},Ra=function(Dn){Jn(ya,new ee.default(oe.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,oe.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+Hn+' update, XHR aborted. status is "'+Dn.statusText+'" ('+Dn.status+"), readyState is "+Dn.readyState))},or=function(Dn){Jn(ya,new ee.default(oe.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,oe.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+Hn+' update, XHR error. status is "'+Dn.statusText+'" ('+Dn.status+"), readyState is "+Dn.readyState))},aa=je.getLicenseRequestFromMessage(lr),sr=Tn.getHTTPMethod(na),Ka=Tn.getResponseType(Hn,na),Wa=Mn&&!isNaN(Mn.httpTimeout)?Mn.httpTimeout:8e3,$a=ga.getSessionId()||null;let Xa=new W(ir,sr,Ka,za,Va,na,$a,aa);const ur=isNaN(it.get().streaming.retryAttempts[D.HTTPRequest.LICENSE])?3:it.get().streaming.retryAttempts[D.HTTPRequest.LICENSE];ar(wt.getLicenseRequestFilters(),Xa).then(()=>{la(Xa,ur,Wa,oa,Ra,or)})})(Gt,Cn,Ln)}else Jn(_n,new ee.default(oe.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,oe.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function Jn(bt){let Gt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Rt.trigger(Lt.LICENSE_REQUEST_COMPLETE,{data:bt,error:Gt})}function la(bt,Gt,gn,bn,An,Ln){const Cn=new XMLHttpRequest,_n=lt.getCmcdParametersFromManifest();if(lt.isCmcdEnabled()&&(_n.mode?_n.mode:it.get().streaming.cmcd.mode)===Ee.default.CMCD_MODE_QUERY){const Tn=lt.getQueryParameter({url:bt.url,type:D.HTTPRequest.LICENSE});Tn&&(bt.url=ce.default.addAdditionalQueryParameterToUrl(bt.url,[Tn]))}Cn.open(bt.method,bt.url,!0),Cn.responseType=bt.responseType,Cn.withCredentials=bt.withCredentials,gn>0&&(Cn.timeout=gn);for(const Tn in bt.headers)Cn.setRequestHeader(Tn,bt.headers[Tn]);if(lt.isCmcdEnabled()&&(_n.mode?_n.mode:it.get().streaming.cmcd.mode)===Ee.default.CMCD_MODE_HEADER){const Tn=lt.getHeaderParameters({url:bt.url,type:D.HTTPRequest.LICENSE});if(Tn)for(const Mn in Tn){let ga=Tn[Mn];ga&&Cn.setRequestHeader(Mn,ga)}}const wn=function(){Gt--;const Tn=isNaN(it.get().streaming.retryIntervals[D.HTTPRequest.LICENSE])?1e3:it.get().streaming.retryIntervals[D.HTTPRequest.LICENSE];fn=setTimeout(function(){la(bt,Gt,gn,bn,An,Ln)},Tn)};Cn.onload=function(){an=null,this.status>=200&&this.status<=299||Gt<=0?bn(this):(ln.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+Gt),wn())},Cn.ontimeout=Cn.onerror=function(){an=null,Gt<=0?Ln(this):(ln.warn("License request network request failed . Retrying it... Pending retries: "+Gt),wn())},Cn.onabort=function(){An(this)},Rt.trigger(Lt.LICENSE_REQUEST_SENDING,{url:bt.url,headers:bt.headers,payload:bt.data,sessionId:bt.sessionId}),an=Cn,Cn.send(bt.data)}function Aa(){an&&(an.onloadend=an.onerror=an.onprogress=void 0,an.abort(),an=null),fn&&(clearTimeout(fn),fn=null)}function ta(bt,Gt){if(Gt)for(const gn in Gt)bt[gn]=Gt[gn]}function nr(bt,Gt,gn,bn,An){let Ln="NONE",Cn=null;bt.response&&(Ln=An.getErrorResponse(bt.response,gn,bn),Cn={serverResponse:bt.response||null,responseCode:bt.status||null,responseText:bt.statusText||null}),Jn(Gt,new ee.default(oe.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,oe.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+gn+' update, XHR complete. status is "'+bt.statusText+'" ('+bt.status+"), readyState is "+bt.readyState+". Response is "+Ln,Cn))}function ar(bt,Gt){return bt?bt.reduce((gn,bn)=>gn.then(()=>bn(Gt)),Promise.resolve()):Promise.resolve()}function Ya(bt,Gt){if(!it.get().streaming.protection.ignoreEmeEncryptedEvent){if(ln.debug("DRM: onNeedKey"),bt.key.initDataType!==z.default.INITIALIZATION_DATA_TYPE_CENC)return void ln.warn("DRM: Only 'cenc' initData is supported! Ignoring initData of type: "+bt.key.initDataType);if(yn.length===0&&(ln.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(Gt=Gt===void 0?1:Gt+1)<5))return void on.push(setTimeout(()=>{Ya(bt,Gt)},500));let bn=bt.key.initData;if(ArrayBuffer.isView(bn)&&(bn=bn.buffer),je){const Ln=re.getPSSHForKeySystem(je,bn);if(Ln&&Zn(Ln))return}ln.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(bn)));const An=ot.getSupportedKeySystemsFromSegmentPssh(bn,_t,At);if(An.length===0)return void ln.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!");gn=An,$t.push(gn),kn(gn,!1)}var gn}function rr(bt){const Gt=Ft.getSessionTokens();if(Gt&&Gt.length>0){const gn=Gt.filter(bn=>[...bt].includes(bn.normalizedKeyId));if(gn.some(bn=>!bn.hasTriggeredKeyStatusMapUpdate)||gn.length===0)return!1}return!it.get().streaming.protection.ignoreKeyStatuses&&bt&&bt.size>0&&pt&&pt.size>0}return nn={areKeyIdsExpired:function(bt){try{return!!rr(bt)&&[...bt].every(Gt=>pt.get(Gt)===z.default.MEDIA_KEY_STATUSES.EXPIRED)}catch(Gt){return ln.error(Gt),!1}},areKeyIdsUsable:function(bt){try{return!rr(bt)||[...bt].some(Gt=>{const gn=pt.get(Gt);return gn&&gn!==z.default.MEDIA_KEY_STATUSES.INTERNAL_ERROR&&gn!==z.default.MEDIA_KEY_STATUSES.OUTPUT_RESTRICTED})}catch(Gt){return ln.error(Gt),!0}},clearMediaInfoArray:function(){yn=[]},closeKeySession:function(bt){pn(),Ft.closeKeySession(bt)},createKeySession:On,getKeySystems:function(){return ot?ot.getKeySystems():[]},getSupportedKeySystemMetadataFromContentProtection:function(bt){return pn(),ot.getSupportedKeySystemMetadataFromContentProtection(bt,_t,At)},handleKeySystemFromManifest:function(){if(!yn||yn.length===0)return;let bt=[];yn.forEach(Gt=>{const gn=ot.getSupportedKeySystemMetadataFromContentProtection(Gt.contentProtection,_t,At);gn.length>0&&(bt.length===0&&(bt=gn),$t.push(gn))}),bt&&bt.length>0&&kn(bt,!0)},initializeForMedia:function(bt){if(!bt)throw new Error("mediaInfo can not be null or undefined");pn(),yn.push(bt)},loadKeySession:vn,removeKeySession:function(bt){pn(),Ft.removeKeySession(bt)},reset:function(){Rt.off(Lt.INTERNAL_KEY_MESSAGE,qn,nn),pn(),Aa(),ba(null),je=null,Qt=!1,pt=new Map,Ft&&(Ft.reset(),Ft=null),on.forEach(bt=>clearTimeout(bt)),on=[],yn=[],$t=[]},setKeySystems:function(bt){ot&&ot.setKeySystems(bt)},setMediaElement:ba,setProtectionData:function(bt){_t=bt,ot.setProtectionData(bt)},setRobustnessLevel:function(bt){Je=bt},setServerCertificate:function(bt){pn(),Ft.setServerCertificate(bt)},setSessionType:function(bt){At=bt},stop:function(){Aa(),Ft&&Ft.stop()},updateKeyStatusesMap:function(bt){try{if(!bt||!bt.sessionToken||!bt.parsedKeyStatuses)return;bt.sessionToken.hasTriggeredKeyStatusMapUpdate=!0;const Gt=bt.parsedKeyStatuses,gn=ce.default.parseUserAgent(),bn=gn&&gn.browser&&gn.browser.name&&gn.browser.name.toLowerCase()==="edge";Gt.forEach(An=>{bn&&je.uuid===z.default.PLAYREADY_UUID&&An.keyId&&An.keyId.byteLength===16&&function(Cn){const _n=ce.default.bufferSourceToDataView(Cn),wn=_n.getUint32(0,!0),Tn=_n.getUint16(4,!0),Mn=_n.getUint16(6,!0);_n.setUint32(0,wn,!1),_n.setUint16(4,Tn,!1),_n.setUint16(6,Mn,!1)}(An.keyId);const Ln=ce.default.bufferSourceToHex(An.keyId).slice(0,32);Ln&&Ln!==""&&pt.set(Ln,An.status)}),Rt.trigger(Lt.KEY_STATUSES_MAP_UPDATED,{keyStatusMap:pt})}catch(Gt){ln.error(Gt)}}},ln=vt.getLogger(nn),$t=[],yn=[],At="temporary",Je="",an=null,fn=null,pt=new Map,Rt.on(Lt.INTERNAL_KEY_MESSAGE,qn,nn),nn}we.__dashjs_factory_name="ProtectionController";var De=Ae.default.getClassFactory(we),Be=class{constructor(Et,yt){this.keyID=Et,this.key=yt}},ct=class{constructor(Et,yt){if(yt&&yt!=="persistent"&&yt!=="temporary")throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'");this.keyPairs=Et,this.type=yt}toJWK(){let Et,yt=this.keyPairs.length,lt={keys:[]};for(Et=0;EtString.fromCharCode(parseInt(it,16))).join("")),ot.replace(/=/g,"").replace(/\//g,"_").replace(/\+/g,"-")}catch{return null}}(wt.cencDefaultKid)]};vt=new TextEncoder().encode(JSON.stringify(Rt))}return vt}catch{return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(We){return JSON.stringify(JSON.parse(String.fromCharCode.apply(null,new Uint8Array(We))))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(We,wt){let vt=null;if(We){const Rt=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(wt))),Lt=[];for(let ot=0;ot%CUSTOMDATA%'.replace("%CUSTOMDATA%",Lt),it=[],_t=0;_t{fn(xn,vn,0,On,Kn)})})(on||(qe[Un]?qe[Un]:[Un]),pn).then(xn=>{const vn=xn&&xn.nativeMediaKeySystemAccessObject&&typeof xn.nativeMediaKeySystemAccessObject.getConfiguration=="function"?xn.nativeMediaKeySystemAccessObject.getConfiguration():null,On=new Xe(kn,vn);On.selectedSystemString=xn.selectedSystemString,On.nativeMediaKeySystemAccessObject=xn.nativeMediaKeySystemAccessObject,lt.trigger(We.KEY_SYSTEM_ACCESS_COMPLETE,{data:On}),At({data:On})}).catch(xn=>{if(je+1{Ft({nativeMediaKeySystemAccessObject:kn,selectedSystemString:pn})}).catch(kn=>{At+1{ln(At),Rt.debug("DRM: Session closed. SessionID = "+At.getSessionId()),lt.trigger(We.KEY_SESSION_CLOSED,{data:At.getSessionId()})}),_t.push(At),At}function $t(Je){let je,At;return Je&&Je.length>0&&(Je[0]&&(typeof Je[0]=="string"?je=Je[0]:At=Je[0]),Je[1]&&(typeof Je[1]=="string"?je=Je[1]:At=Je[1])),{status:je,keyId:At}}return vt={closeKeySession:function(Je){an(Je).catch(function(je){ln(Je),lt.trigger(We.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+Je.getSessionId()+") "+je.name})})},createKeySession:function(Je){if(!Lt||!it)throw new Error("Can not create sessions until you have selected a key system");const je=it.createSession(Je.sessionType),At=yn(je,Je),Ft=Lt.systemString===z.default.CLEARKEY_KEYSTEM_STRING&&(Je.initData||Je.protData&&Je.protData.clearkeys)?z.default.INITIALIZATION_DATA_TYPE_KEYIDS:z.default.INITIALIZATION_DATA_TYPE_CENC;je.generateRequest(Ft,Je.initData).then(function(){Rt.debug("DRM: Session created. SessionID = "+At.getSessionId()),lt.trigger(We.KEY_SESSION_CREATED,{data:At})}).catch(function(on){ln(At),lt.trigger(We.KEY_SESSION_CREATED,{data:null,error:new ee.default(oe.default.KEY_SESSION_CREATED_ERROR_CODE,oe.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+on.name)})})},getAllInitData:function(){const Je=[];for(let je=0;je<_t.length;je++)_t[je].initData&&Je.push(_t[je].initData);return Je},getSessionTokens:function(){return _t},loadKeySession:function(Je){if(!Lt||!it)throw new Error("Can not load sessions until you have selected a key system");const je=Je.sessionId;for(let on=0;on<_t.length;on++)if(je===_t[on].sessionId)return void Rt.warn("DRM: Ignoring session ID because we have already seen it!");const At=it.createSession(Je.sessionType),Ft=yn(At,Je);Ft.hasTriggeredKeyStatusMapUpdate=!0,At.load(je).then(function(on){on?(Rt.debug("DRM: Session loaded. SessionID = "+Ft.getSessionId()),lt.trigger(We.KEY_SESSION_CREATED,{data:Ft})):(ln(Ft),lt.trigger(We.KEY_SESSION_CREATED,{data:null,error:new ee.default(oe.default.KEY_SESSION_CREATED_ERROR_CODE,oe.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+je+")")}))}).catch(function(on){ln(Ft),lt.trigger(We.KEY_SESSION_CREATED,{data:null,error:new ee.default(oe.default.KEY_SESSION_CREATED_ERROR_CODE,oe.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+je+")! "+on.name)})})},removeKeySession:function(Je){Je.session.remove().then(function(){Rt.debug("DRM: Session removed. SessionID = "+Je.getSessionId()),lt.trigger(We.KEY_SESSION_REMOVED,{data:Je.getSessionId()})},function(je){lt.trigger(We.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+Je.getSessionId()+"). "+je.name})})},requestKeySystemAccess:function(Je){return new Promise((je,At)=>{Qt(Je,0,je,At)})},reset:function(){const Je=_t.length;let je;if(Je!==0){const At=function(Ft){ln(Ft),_t.length===0&&(ot?(ot.removeEventListener("encrypted",nn),ot.setMediaKeys(null).then(function(){lt.trigger(We.TEARDOWN_COMPLETE)})):lt.trigger(We.TEARDOWN_COMPLETE))};for(let Ft=0;Ft{Je.nativeMediaKeySystemAccessObject.createMediaKeys().then(Ft=>(Lt=Je.keySystem,it=Ft,ot?ot.setMediaKeys(it):Promise.resolve())).then(()=>{je(Lt)}).catch(function(){At({error:"Error selecting keys system ("+Je.keySystem.systemString+")! Could not create MediaKeys -- TODO"})})})},setMediaElement:function(Je){ot!==Je&&(ot&&(ot.removeEventListener("encrypted",nn),ot.setMediaKeys&&ot.setMediaKeys(null)),ot=Je,ot&&(ot.addEventListener("encrypted",nn),ot.setMediaKeys&&it&&ot.setMediaKeys(it)))},setServerCertificate:function(Je){return new Promise((je,At)=>{it.setServerCertificate(Je).then(function(){Rt.info("DRM: License server certificate successfully updated."),lt.trigger(We.SERVER_CERTIFICATE_UPDATED),je()}).catch(Ft=>{At(Ft),lt.trigger(We.SERVER_CERTIFICATE_UPDATED,{error:new ee.default(oe.default.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,oe.default.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+Ft.name)})})})},stop:function(){let Je;for(let je=0;je<_t.length;je++)Je=_t[je],Je.getUsable()||(an(Je),ln(Je))},updateKeySession:function(Je,je){const At=Je.session;pt.isClearKey(Lt)&&(je=je.toJWK()),At.update(je).then(()=>{lt.trigger(We.KEY_SESSION_UPDATED)}).catch(function(Ft){lt.trigger(We.KEY_ERROR,{error:new ee.default(oe.default.MEDIA_KEYERR_CODE,"Error sending update() message! "+Ft.name,Je)})})}},Rt=wt.getLogger(vt),Lt=null,ot=null,it=null,_t=[],pt=Re(yt).getInstance(),nn={handleEvent:function(Je){if(Je.type==="encrypted"&&Je.initData){let je=ArrayBuffer.isView(Je.initData)?Je.initData.buffer:Je.initData;lt.trigger(We.NEED_KEY,{key:new ve(je,Je.initDataType)})}}},vt}qe[z.default.PLAYREADY_KEYSTEM_STRING]=[z.default.PLAYREADY_KEYSTEM_STRING,z.default.PLAYREADY_RECOMMENDATION_KEYSTEM_STRING],qe[z.default.WIDEVINE_KEYSTEM_STRING]=[z.default.WIDEVINE_KEYSTEM_STRING],qe[z.default.CLEARKEY_KEYSTEM_STRING]=[z.default.CLEARKEY_KEYSTEM_STRING],at.__dashjs_factory_name="DefaultProtectionModel";var Bt=Ae.default.getClassFactory(at);function St(Et){Et=Et||{};const yt=this.context,lt=Et.eventBus,We=Et.events,wt=Et.debug,vt=Et.api;let Rt,Lt,ot,it,_t,nn,pt,Qt,fn;function an(){try{for(let $t=0;$t=1?Je():($t=Je.bind(this),ot.addEventListener("loadedmetadata",$t))}return Rt={getAllInitData:function(){const $t=[];for(let Je=0;Je{let At=!1;for(let Ft=0;Ft<$t.length;Ft++){const on=$t[Ft].ks.systemString,pn=$t[Ft].configs;let kn=null,Un=null;for(let xn=0;xn{try{_t=$t.mediaKeys=new window[vt.MediaKeys]($t.keySystem.systemString),it=$t.keySystem,nn=$t,ot&&yn(),Je(it)}catch{je({error:"Error selecting keys system ("+it.systemString+")! Could not create MediaKeys -- TODO"})}})},setMediaElement:function($t){ot!==$t&&(ot&&ot.removeEventListener(vt.needkey,Qt),ot=$t,ot&&(ot.addEventListener(vt.needkey,Qt),_t&&yn()))},createKeySession:function($t){if(!it||!_t||!nn)throw new Error("Can not create sessions until you have selected a key system");let Je=null;if(nn.ksConfiguration.videoCapabilities&&nn.ksConfiguration.videoCapabilities.length>0&&(Je=nn.ksConfiguration.videoCapabilities[0]),Je===null&&nn.ksConfiguration.audioCapabilities&&nn.ksConfiguration.audioCapabilities.length>0&&(Je=nn.ksConfiguration.audioCapabilities[0]),Je===null)throw new Error("Can not create sessions for unknown content types.");const je=Je.contentType,At=_t.createSession(je,new Uint8Array($t.initData),$t.cdmData?new Uint8Array($t.cdmData):null),Ft=function(on,pn){return{session:on,keyId:pn.keyId,normalizedKeyId:pn&&pn.keyId&&typeof pn.keyId=="string"?pn.keyId.replace(/-/g,"").toLowerCase():"",initData:pn.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(kn){switch(kn.type){case vt.error:let Un="KeyError";lt.trigger(We.KEY_ERROR,{error:new ee.default(oe.default.MEDIA_KEYERR_CODE,Un,this)});break;case vt.message:let xn=ArrayBuffer.isView(kn.message)?kn.message.buffer:kn.message;lt.trigger(We.INTERNAL_KEY_MESSAGE,{data:new Pe(this,xn,kn.destinationURL)});break;case vt.ready:Lt.debug("DRM: Key added."),lt.trigger(We.KEY_ADDED);break;case vt.close:Lt.debug("DRM: Session closed. SessionID = "+this.getSessionId()),lt.trigger(We.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}}(At,$t);At.addEventListener(vt.error,Ft),At.addEventListener(vt.message,Ft),At.addEventListener(vt.ready,Ft),At.addEventListener(vt.close,Ft),pt.push(Ft),Lt.debug("DRM: Session created. SessionID = "+Ft.getSessionId()),lt.trigger(We.KEY_SESSION_CREATED,{data:Ft})},updateKeySession:function($t,Je){const je=$t.session;fn.isClearKey(it)?je.update(new Uint8Array(Je.toJWK())):je.update(new Uint8Array(Je)),lt.trigger(We.KEY_SESSION_UPDATED)},closeKeySession:ln,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:an,reset:an},Lt=wt.getLogger(Rt),ot=null,it=null,_t=null,nn=null,pt=[],fn=Re(yt).getInstance(),Qt={handleEvent:function($t){if($t.type===vt.needkey&&$t.initData){const Je=ArrayBuffer.isView($t.initData)?$t.initData.buffer:$t.initData;lt.trigger(We.NEED_KEY,{key:new ve(Je,z.default.INITIALIZATION_DATA_TYPE_CENC)})}}},Rt}St.__dashjs_factory_name="ProtectionModel_3Feb2014";var Ct=Ae.default.getClassFactory(St);function ht(Et){Et=Et||{};const yt=this.context,lt=Et.eventBus,We=Et.events,wt=Et.debug,vt=Et.api,Rt=Et.errHandler;let Lt,ot,it,_t,nn,pt,Qt,fn,an;function ln(){it&&Je();for(let je=0;je{let on=it;on||(on=document.createElement("video"));let pn=!1;for(let kn=0;kn!1,get:()=>{}}}};return pt.push(At),it[vt.generateKeyRequest](_t.systemString,new Uint8Array(je.initData)),At}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(je,At){const Ft=je.sessionId;if(nn.isClearKey(_t))for(let on=0;on0&&(At=pt.shift(),Qt.push(At),At.sessionId=je.sessionId,lt.trigger(We.KEY_SESSION_CREATED,{data:At}))):pt.length>0&&(At=pt.shift(),Qt.push(At),pt.length!==0&&Rt.error(new ee.default(oe.default.MEDIA_KEY_MESSAGE_ERROR_CODE,oe.default.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),At){let on=ArrayBuffer.isView(je.message)?je.message.buffer:je.message;At.keyMessage=on,lt.trigger(We.INTERNAL_KEY_MESSAGE,{data:new Pe(At,on,je.defaultURL)})}else ot.warn("No session token found for key message")}}},Lt}ht.__dashjs_factory_name="ProtectionModel_01b";var hn=Ae.default.getClassFactory(ht);const Sn=[{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"}],Nn=[{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 Vn(){let Et;const yt=this.context;function lt(We,wt){for(let vt=0;vt{const Ut={...L};if(se.ks){Ut.keySystemConfiguration={},se.ks.systemString&&(Ut.keySystemConfiguration.keySystem=se.ks.systemString);let $e="";se.ks.systemString===T.default.WIDEVINE_KEYSTEM_STRING&&($e=T.default.ROBUSTNESS_STRINGS.WIDEVINE.SW_SECURE_CRYPTO);const Se=se.protData,Tt=Se&&Se.audioRobustness&&Se.audioRobustness.length>0?Se.audioRobustness:$e,Kt=Se&&Se.videoRobustness&&Se.videoRobustness.length>0?Se.videoRobustness:$e;Ze===z.default.AUDIO?Ut.keySystemConfiguration[Ze]={robustness:Tt}:Ze===z.default.VIDEO&&(Ut.keySystemConfiguration[Ze]={robustness:Kt})}return Ut}):[L]}(ie,B,p)}function De(B){if(le&&le.length!==0&&B)return le.find(p=>{const ie=Be(B,p,z.default.AUDIO),me=Be(B,p,z.default.VIDEO),L=Be(B,p,"keySystemConfiguration");return ie&&me&&L})}function Be(B,p,ie){return!B[ie]&&!p[ie]||!(!B[ie]||!p[ie])&&Ae.areEqual(B[ie],p[ie])}function ct(B,p){return(B=B.filter(ie=>!(ie.schemeIdUri&&p.some(me=>me.schemeIdUri===ie.schemeIdUri)))).push(...p),B}return oe={areKeyIdsExpired:function(B){return!!(W&&B&&B.normalizedKeyIds&&B.normalizedKeyIds.size!==0)&&W.areKeyIdsExpired(B.normalizedKeyIds)},areKeyIdsUsable:function(B){return!(W&&B&&B.normalizedKeyIds&&B.normalizedKeyIds.size!==0)||W.areKeyIdsUsable(B.normalizedKeyIds)},isCodecSupportedBasedOnTestedConfigurations:function(B,p){if(!B||!B.codec||B.isSupported===!1)return!1;const ie=we(B,p).map(me=>De(me)).filter(me=>me!=null);return!(ie&&ie.length>0)||function(me){return me.some(L=>L&&L.decodingInfo&&L.decodingInfo.supported)}(ie)},isProtectionCompatible:function(B,p){return!p||!(!B.isEncrypted&&p.isEncrypted)},runCodecSupportCheck:function(B,p){if(p!==z.default.AUDIO&&p!==z.default.VIDEO)return Promise.resolve();const ie=we(B,p);return function(me,L){return ee.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(me.codec&&L===z.default.AUDIO||L===z.default.VIDEO&&me.codec&&me.width&&me.height&&me.bitrate&&me.framerate)}(B,p)?function(me){return new Promise(L=>{if(!me||me.length===0)return void L();const pe=me.map(Ze=>function(se){return new Promise(Ut=>{De(se)?Ut():navigator.mediaCapabilities.decodingInfo(se).then($e=>{se.decodingInfo=$e,le.push(se),Ut()}).catch($e=>{se.decodingInfo={supported:!1},le.push(se),ce.error($e),Ut()})})}(Ze));Promise.allSettled(pe).then(()=>{L()}).catch(Ze=>{ce.error(Ze),L()})})}(ie):(function(me){if(!me||!me.length)return;const L=me[0];if(De(L))return;let pe={supported:!1};("ManagedMediaSource"in window&&ManagedMediaSource.isTypeSupported(L.mediaSourceCodecString)||"MediaSource"in window&&MediaSource.isTypeSupported(L.mediaSourceCodecString)||"WebKitMediaSource"in window&&WebKitMediaSource.isTypeSupported(L.mediaSourceCodecString))&&(pe.supported=!0),L.decodingInfo=pe,le.push(L)}(ie),Promise.resolve())},setConfig:function(B){B&&(B.settings&&(ee=B.settings),B.protectionController&&(W=B.protectionController))},setEncryptedMediaSupported:function(B){D=B},setProtectionController:function(B){W=B},supportsChangeType:function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType},supportsEncryptedMedia:function(){return D},supportsEssentialProperty:function(B){let p=ee.get().streaming.capabilities.supportedEssentialProperties;ee.get().streaming.capabilities.useMediaCapabilitiesApi&&ee.get().streaming.capabilities.filterVideoColorimetryEssentialProperties&&(p=ct(p,[{schemeIdUri:z.default.COLOUR_PRIMARIES_SCHEME_ID_URI},{schemeIdUri:z.default.MATRIX_COEFFICIENTS_SCHEME_ID_URI},{schemeIdUri:z.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI}])),ee.get().streaming.capabilities.useMediaCapabilitiesApi&&ee.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties&&(p=ct(p,[{schemeIdUri:z.default.HDR_METADATA_FORMAT_SCHEME_ID_URI}]));try{return B.inArray(p)}catch{return!0}},supportsMediaSource:F},D=!1,le=[],ce=(0,re.default)(Ee).getInstance().getLogger(oe),oe}q.__dashjs_factory_name="Capabilities",Fe.default=be.default.getSingletonFactory(q)},7377:function(Nt,Fe,de){de.r(Fe);var be=de(138),z=de(656);function T(){return{customTimeRangeArray:[],length:0,add:function(O,re){let F;for(F=0;Fthis.customTimeRangeArray[F].start;F++);for(this.customTimeRangeArray.splice(F,0,{start:O,end:re}),F=0;F=this.customTimeRangeArray[F].end)this.customTimeRangeArray.splice(F,1),F--;else{if(O>this.customTimeRangeArray[F].start&&rethis.customTimeRangeArray[F].start&&Othis.customTimeRangeArray[F].start&&re=this.customTimeRangeArray.length||O<0?NaN:this.customTimeRangeArray[O].start},end:function(O){return(0,z.checkInteger)(O),O>=this.customTimeRangeArray.length||O<0?NaN:this.customTimeRangeArray[O].end}}}T.__dashjs_factory_name="CustomTimeRanges",Fe.default=be.default.getClassFactory(T)},7393:function(Nt,Fe,de){de.r(Fe);var be=de(138),z=de(7316);function T(){let O;return O={areEqual:function(re,F){return z(re,F)}},O}T.__dashjs_factory_name="ObjectUtils",Fe.default=be.default.getSingletonFactory(T)},656:function(Nt,Fe,de){de.r(Fe),de.d(Fe,{checkInteger:function(){return T},checkIsVideoOrAudioType:function(){return re},checkParameterType:function(){return z},checkRange:function(){return O}});var be=de(5212);function z(F,q){if(typeof F!==q)throw be.default.BAD_ARGUMENT_ERROR}function T(F){if(F===null||isNaN(F)||F%1!=0)throw be.default.BAD_ARGUMENT_ERROR+" : argument is not an integer"}function O(F,q,oe){if(Foe)throw be.default.BAD_ARGUMENT_ERROR+" : argument out of range"}function re(F){if(typeof F!="string"||F!==be.default.AUDIO&&F!==be.default.VIDEO)throw be.default.BAD_ARGUMENT_ERROR}},1944:function(Nt,Fe,de){de.r(Fe),Fe.default=class{constructor(be,z,T){this.code=be||null,this.message=z||null,this.data=T||null}}},7568:function(Nt,Fe,de){de.r(Fe),de.d(Fe,{HTTPRequest:function(){return be},HTTPRequestTrace:function(){return z}});class be{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._quality=null,this._responseHeaders=null,this._serviceLocation=null,this._fileLoaderType=null,this._resourceTimingValues=null}}class z{constructor(){this.s=null,this.d=null,this.b=[]}}be.GET="GET",be.HEAD="HEAD",be.MPD_TYPE="MPD",be.XLINK_EXPANSION_TYPE="XLinkExpansion",be.INIT_SEGMENT_TYPE="InitializationSegment",be.INDEX_SEGMENT_TYPE="IndexSegment",be.MEDIA_SEGMENT_TYPE="MediaSegment",be.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",be.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",be.DVB_REPORTING_TYPE="DVBReporting",be.LICENSE="license",be.CONTENT_STEERING_TYPE="ContentSteering",be.OTHER_TYPE="other"}},xo={};function Gn(Nt){var Fe=xo[Nt];if(Fe!==void 0)return Fe.exports;var de=xo[Nt]={exports:{}};return cd[Nt].call(de.exports,de,de.exports,Gn),de.exports}Gn.amdO={},Gn.d=function(Nt,Fe){for(var de in Fe)Gn.o(Fe,de)&&!Gn.o(Nt,de)&&Object.defineProperty(Nt,de,{enumerable:!0,get:Fe[de]})},Gn.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),Gn.o=function(Nt,Fe){return Object.prototype.hasOwnProperty.call(Nt,Fe)},Gn.r=function(Nt){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(Nt,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Nt,"__esModule",{value:!0})};var fa={};Gn.r(fa),Gn.d(fa,{Constants:function(){return Fo.default},Debug:function(){return Lo.default},MediaPlayer:function(){return fd.MediaPlayer},MediaPlayerFactory:function(){return Po},MetricsReporting:function(){return zo.default},Protection:function(){return Oo.default},default:function(){return md},supportsMediaSource:function(){return Uo.supportsMediaSource}});var fd=Gn(5393),zo=Gn(4469),Oo=Gn(3888),gd=Gn(5849);let Mo,Dr=function(){const Nt="application/dash+xml";let Fe;function de(z,T,O){if(!z||!/^VIDEO$/i.test(z.nodeName))return null;if(z._dashjs_player)return z._dashjs_player;let re,F=z.id||z.name||"video element";if(!(T=T||[].slice.call(z.querySelectorAll("source")).filter(function(q){return q.type==Nt})[0])&&z.src)(T=document.createElement("source")).src=z.src;else if(!T&&!z.src)return null;return O=O||{},re=(0,gd.default)(O).create(),re.initialize(z,T.src,z.autoplay),Fe||(Fe=re.getDebug().getLogger()),Fe.debug("Converted "+F+" to dash.js player and added content: "+T.src),z._dashjs_player=re,re}function be(z){return/^VIDEO$/i.test(z.nodeName)?z:be(z.parentNode)}return{create:de,createAll:function(z,T){let O=[];z=z||"[data-dashjs-player]";let re=(T=T||document).querySelectorAll(z);for(let q=0;q