UNPKG

shaka-player

Version:
1,484 lines • 663 kB
/*
 @license
 Shaka Player
 Copyright 2016 Google LLC
 SPDX-License-Identifier: Apache-2.0
*/
(function(){var innerGlobal=typeof window!="undefined"?window:global;var exportTo={};(function(window,global,module){/*
 @license
 Shaka Player
 Copyright 2016 Google LLC
 SPDX-License-Identifier: Apache-2.0
*/
var r,aa=typeof Object.create=="function"?Object.create:function(a){function b(){}b.prototype=a;return new b},ba=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};
function ca(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var da=ca(this),fa="Int8 Uint8 Uint8Clamped Int16 Uint16 Int32 Uint32 Float32 Float64".split(" ");da.BigInt64Array&&(fa.push("BigInt64"),fa.push("BigUint64"));
function ia(a,b){if(b)for(var c=0;c<fa.length;c++)la(fa[c]+"Array.prototype."+a,b)}function na(a,b){b&&la(a,b)}function la(a,b){var c=da;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))return;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&b!=null&&ba(c,a,{configurable:!0,writable:!0,value:b})}var oa;
if(typeof Object.setPrototypeOf=="function")oa=Object.setPrototypeOf;else{var pa;a:{var qa={a:!0},ra={};try{ra.__proto__=qa;pa=ra.a;break a}catch(a){}pa=!1}oa=pa?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var sa=oa;
function ta(a,b){a.prototype=aa(b.prototype);a.prototype.constructor=a;if(sa)sa(a,b);else for(var c in b)if(c!="prototype")if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.Pm=b.prototype}function va(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}
function t(a){var b=typeof Symbol!="undefined"&&Symbol.iterator&&a[Symbol.iterator];if(b)return b.call(a);if(typeof a.length=="number")return{next:va(a)};throw Error(String(a)+" is not an iterable or ArrayLike");}function wa(a){if(!(a instanceof Array)){a=t(a);for(var b,c=[];!(b=a.next()).done;)c.push(b.value);a=c}return a}function xa(a){if(!(a instanceof Object))throw new TypeError("Iterator result "+a+" is not an object");}
function ya(){this.I=!1;this.D=null;this.j=void 0;this.i=1;this.C=this.H=0;this.M=this.B=null}function za(a){if(a.I)throw new TypeError("Generator is already running");a.I=!0}ya.prototype.L=function(a){this.j=a};function Ba(a,b){a.B={Fh:b,Th:!0};a.i=a.H||a.C}ya.prototype.getNextAddressJsc=function(){return this.i};ya.prototype.getYieldResultJsc=function(){return this.j};ya.prototype.return=function(a){this.B={return:a};this.i=this.C};ya.prototype["return"]=ya.prototype.return;
ya.prototype.O=function(a){this.B={A:a};this.i=this.C};ya.prototype.jumpThroughFinallyBlocks=ya.prototype.O;ya.prototype.h=function(a,b){this.i=b;return{value:a}};ya.prototype.yield=ya.prototype.h;ya.prototype.T=function(a,b){a=t(a);var c=a.next();xa(c);if(c.done)this.j=c.value,this.i=b;else return this.D=a,this.h(c.value,b)};ya.prototype.yieldAll=ya.prototype.T;ya.prototype.A=function(a){this.i=a};ya.prototype.jumpTo=ya.prototype.A;ya.prototype.l=function(){this.i=0};ya.prototype.jumpToEnd=ya.prototype.l;
ya.prototype.o=function(a,b){this.H=a;b!=void 0&&(this.C=b)};ya.prototype.setCatchFinallyBlocks=ya.prototype.o;ya.prototype.K=function(a){this.H=0;this.C=a||0};ya.prototype.setFinallyBlock=ya.prototype.K;ya.prototype.u=function(a,b){this.i=a;this.H=b||0};ya.prototype.leaveTryBlock=ya.prototype.u;ya.prototype.m=function(a){this.H=a||0;a=this.B.Fh;this.B=null;return a};ya.prototype.enterCatchBlock=ya.prototype.m;
ya.prototype.F=function(a,b,c){c?this.M[c]=this.B:this.M=[this.B];this.H=a||0;this.C=b||0};ya.prototype.enterFinallyBlock=ya.prototype.F;ya.prototype.G=function(a,b){b=this.M.splice(b||0)[0];(b=this.B=this.B||b)?b.Th?this.i=this.H||this.C:b.A!=void 0&&this.C<b.A?(this.i=b.A,this.B=null):this.i=this.C:this.i=a};ya.prototype.leaveFinallyBlock=ya.prototype.G;ya.prototype.N=function(a){return new Ca(a)};ya.prototype.forIn=ya.prototype.N;
function Ca(a){this.j=a;this.h=[];for(var b in a)this.h.push(b);this.h.reverse()}Ca.prototype.i=function(){for(;this.h.length>0;){var a=this.h.pop();if(a in this.j)return a}return null};Ca.prototype.getNext=Ca.prototype.i;function Da(a){this.h=new ya;this.i=a}function Ea(a,b){za(a.h);var c=a.h.D;if(c)return Fa(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.h.return);a.h.return(b);return Ga(a)}
function Fa(a,b,c,d){try{var e=b.call(a.h.D,c);xa(e);if(!e.done)return a.h.I=!1,e;var f=e.value}catch(g){return a.h.D=null,Ba(a.h,g),Ga(a)}a.h.D=null;d.call(a.h,f);return Ga(a)}function Ga(a){for(;a.h.i;)try{var b=a.i(a.h);if(b)return a.h.I=!1,{value:b.value,done:!1}}catch(c){a.h.j=void 0,Ba(a.h,c)}a.h.I=!1;if(a.h.B){b=a.h.B;a.h.B=null;if(b.Th)throw b.Fh;return{value:b.return,done:!0}}return{value:void 0,done:!0}}
function Ha(a){this.next=function(b){za(a.h);a.h.D?b=Fa(a,a.h.D.next,b,a.h.L):(a.h.L(b),b=Ga(a));return b};this.throw=function(b){za(a.h);a.h.D?b=Fa(a,a.h.D["throw"],b,a.h.L):(Ba(a.h,b),b=Ga(a));return b};this.return=function(b){return Ea(a,b)};this[Symbol.iterator]=function(){return this}}function Ia(a){function b(d){return a.next(d)}function c(d){return a.throw(d)}return new Promise(function(d,e){function f(g){g.done?d(g.value):Promise.resolve(g.value).then(b,c).then(f,e)}f(a.next())})}
function H(a){return Ia(new Ha(new Da(a)))}function Ja(){for(var a=Number(this),b=[],c=a;c<arguments.length;c++)b[c-a]=arguments[c];return b}na("Symbol",function(a){function b(f){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new c(d+(f||"")+"_"+e++,f)}function c(f,g){this.h=f;ba(this,"description",{configurable:!0,writable:!0,value:g})}if(a)return a;c.prototype.toString=function(){return this.h};var d="jscomp_symbol_"+(Math.random()*1E9>>>0)+"_",e=0;return b});
na("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");ba(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return Ka(va(this))}});return a});function Ka(a){a={next:a};a[Symbol.iterator]=function(){return this};return a}
na("Promise",function(a){function b(g){this.i=0;this.j=void 0;this.h=[];this.u=!1;var h=this.l();try{g(h.resolve,h.reject)}catch(k){h.reject(k)}}function c(){this.h=null}function d(g){return g instanceof b?g:new b(function(h){h(g)})}if(a)return a;c.prototype.i=function(g){if(this.h==null){this.h=[];var h=this;this.j(function(){h.m()})}this.h.push(g)};var e=da.setTimeout;c.prototype.j=function(g){e(g,0)};c.prototype.m=function(){for(;this.h&&this.h.length;){var g=this.h;this.h=[];for(var h=0;h<g.length;++h){var k=
g[h];g[h]=null;try{k()}catch(l){this.l(l)}}}this.h=null};c.prototype.l=function(g){this.j(function(){throw g;})};b.prototype.l=function(){function g(l){return function(m){k||(k=!0,l.call(h,m))}}var h=this,k=!1;return{resolve:g(this.G),reject:g(this.m)}};b.prototype.G=function(g){if(g===this)this.m(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof b)this.I(g);else{a:switch(typeof g){case "object":var h=g!=null;break a;case "function":h=!0;break a;default:h=!1}h?this.F(g):this.o(g)}};
b.prototype.F=function(g){var h=void 0;try{h=g.then}catch(k){this.m(k);return}typeof h=="function"?this.K(h,g):this.o(g)};b.prototype.m=function(g){this.B(2,g)};b.prototype.o=function(g){this.B(1,g)};b.prototype.B=function(g,h){if(this.i!=0)throw Error("Cannot settle("+g+", "+h+"): Promise already settled in state"+this.i);this.i=g;this.j=h;this.i===2&&this.H();this.C()};b.prototype.H=function(){var g=this;e(function(){if(g.D()){var h=da.console;typeof h!=="undefined"&&h.error(g.j)}},1)};b.prototype.D=
function(){if(this.u)return!1;var g=da.CustomEvent,h=da.Event,k=da.dispatchEvent;if(typeof k==="undefined")return!0;typeof g==="function"?g=new g("unhandledrejection",{cancelable:!0}):typeof h==="function"?g=new h("unhandledrejection",{cancelable:!0}):(g=da.document.createEvent("CustomEvent"),g.initCustomEvent("unhandledrejection",!1,!0,g));g.promise=this;g.reason=this.j;return k(g)};b.prototype.C=function(){if(this.h!=null){for(var g=0;g<this.h.length;++g)f.i(this.h[g]);this.h=null}};var f=new c;
b.prototype.I=function(g){var h=this.l();g.pe(h.resolve,h.reject)};b.prototype.K=function(g,h){var k=this.l();try{g.call(h,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(g,h){function k(p,u){return typeof p=="function"?function(q){try{l(p(q))}catch(v){m(v)}}:u}var l,m,n=new b(function(p,u){l=p;m=u});this.pe(k(g,l),k(h,m));return n};b.prototype.catch=function(g){return this.then(void 0,g)};b.prototype.pe=function(g,h){function k(){switch(l.i){case 1:g(l.j);break;case 2:h(l.j);
break;default:throw Error("Unexpected state: "+l.i);}}var l=this;this.h==null?f.i(k):this.h.push(k);this.u=!0};b.resolve=d;b.reject=function(g){return new b(function(h,k){k(g)})};b.race=function(g){return new b(function(h,k){for(var l=t(g),m=l.next();!m.done;m=l.next())d(m.value).pe(h,k)})};b.all=function(g){var h=t(g),k=h.next();return k.done?d([]):new b(function(l,m){function n(q){return function(v){p[q]=v;u--;u==0&&l(p)}}var p=[],u=0;do p.push(void 0),u++,d(k.value).pe(n(p.length-1),m),k=h.next();
while(!k.done)})};return b});function La(a,b){return Object.prototype.hasOwnProperty.call(a,b)}
na("WeakMap",function(a){function b(k){this.h=(h+=Math.random()+1).toString();if(k){k=t(k);for(var l;!(l=k.next()).done;)l=l.value,this.set(l[0],l[1])}}function c(){}function d(k){var l=typeof k;return l==="object"&&k!==null||l==="function"}function e(k){if(!La(k,g)){var l=new c;ba(k,g,{value:l})}}function f(k){var l=Object[k];l&&(Object[k]=function(m){if(m instanceof c)return m;Object.isExtensible(m)&&e(m);return l(m)})}if(function(){if(!a||!Object.seal)return!1;try{var k=Object.seal({}),l=Object.seal({}),
m=new a([[k,2],[l,3]]);if(m.get(k)!=2||m.get(l)!=3)return!1;m.delete(k);m.set(l,4);return!m.has(k)&&m.get(l)==4}catch(n){return!1}}())return a;var g="$jscomp_hidden_"+Math.random();f("freeze");f("preventExtensions");f("seal");var h=0;b.prototype.set=function(k,l){if(!d(k))throw Error("Invalid WeakMap key");e(k);if(!La(k,g))throw Error("WeakMap key fail: "+k);k[g][this.h]=l;return this};b.prototype.get=function(k){return d(k)&&La(k,g)?k[g][this.h]:void 0};b.prototype.has=function(k){return d(k)&&La(k,
g)&&La(k[g],this.h)};b.prototype.delete=function(k){return d(k)&&La(k,g)&&La(k[g],this.h)?delete k[g][this.h]:!1};return b});
na("Map",function(a){function b(){var h={};return h.Wb=h.next=h.head=h}function c(h,k){var l=h[1];return Ka(function(){if(l){for(;l.head!=h[1];)l=l.Wb;for(;l.next!=l.head;)return l=l.next,{done:!1,value:k(l)};l=null}return{done:!0,value:void 0}})}function d(h,k){var l=k&&typeof k;l=="object"||l=="function"?f.has(k)?l=f.get(k):(l=""+ ++g,f.set(k,l)):l="p_"+k;var m=h[0][l];if(m&&La(h[0],l))for(h=0;h<m.length;h++){var n=m[h];if(k!==k&&n.key!==n.key||k===n.key)return{id:l,list:m,index:h,entry:n}}return{id:l,
list:m,index:-1,entry:void 0}}function e(h){this[0]={};this[1]=b();this.size=0;if(h){h=t(h);for(var k;!(k=h.next()).done;)k=k.value,this.set(k[0],k[1])}}if(function(){if(!a||typeof a!="function"||!a.prototype.entries||typeof Object.seal!="function")return!1;try{var h=Object.seal({x:4}),k=new a(t([[h,"s"]]));if(k.get(h)!="s"||k.size!=1||k.get({x:4})||k.set({x:4},"t")!=k||k.size!=2)return!1;var l=k.entries(),m=l.next();if(m.done||m.value[0]!=h||m.value[1]!="s")return!1;m=l.next();return m.done||m.value[0].x!=
4||m.value[1]!="t"||!l.next().done?!1:!0}catch(n){return!1}}())return a;var f=new WeakMap;e.prototype.set=function(h,k){h=h===0?0:h;var l=d(this,h);l.list||(l.list=this[0][l.id]=[]);l.entry?l.entry.value=k:(l.entry={next:this[1],Wb:this[1].Wb,head:this[1],key:h,value:k},l.list.push(l.entry),this[1].Wb.next=l.entry,this[1].Wb=l.entry,this.size++);return this};e.prototype.delete=function(h){h=d(this,h);return h.entry&&h.list?(h.list.splice(h.index,1),h.list.length||delete this[0][h.id],h.entry.Wb.next=
h.entry.next,h.entry.next.Wb=h.entry.Wb,h.entry.head=null,this.size--,!0):!1};e.prototype.clear=function(){this[0]={};this[1]=this[1].Wb=b();this.size=0};e.prototype.has=function(h){return!!d(this,h).entry};e.prototype.get=function(h){return(h=d(this,h).entry)&&h.value};e.prototype.entries=function(){return c(this,function(h){return[h.key,h.value]})};e.prototype.keys=function(){return c(this,function(h){return h.key})};e.prototype.values=function(){return c(this,function(h){return h.value})};e.prototype.forEach=
function(h,k){for(var l=this.entries(),m;!(m=l.next()).done;)m=m.value,h.call(k,m[1],m[0],this)};e.prototype[Symbol.iterator]=e.prototype.entries;var g=0;return e});
na("Set",function(a){function b(c){this.h=new Map;if(c){c=t(c);for(var d;!(d=c.next()).done;)this.add(d.value)}this.size=this.h.size}if(function(){if(!a||typeof a!="function"||!a.prototype.entries||typeof Object.seal!="function")return!1;try{var c=Object.seal({x:4}),d=new a(t([c]));if(!d.has(c)||d.size!=1||d.add(c)!=d||d.size!=1||d.add({x:4})!=d||d.size!=2)return!1;var e=d.entries(),f=e.next();if(f.done||f.value[0]!=c||f.value[1]!=c)return!1;f=e.next();return f.done||f.value[0]==c||f.value[0].x!=
4||f.value[1]!=f.value[0]?!1:e.next().done}catch(g){return!1}}())return a;b.prototype.add=function(c){c=c===0?0:c;this.h.set(c,c);this.size=this.h.size;return this};b.prototype.delete=function(c){c=this.h.delete(c);this.size=this.h.size;return c};b.prototype.clear=function(){this.h.clear();this.size=0};b.prototype.has=function(c){return this.h.has(c)};b.prototype.entries=function(){return this.h.entries()};b.prototype.values=function(){return this.h.values()};b.prototype.keys=b.prototype.values;b.prototype[Symbol.iterator]=
b.prototype.values;b.prototype.forEach=function(c,d){var e=this;this.h.forEach(function(f){return c.call(d,f,f,e)})};return b});function Ma(a,b,c){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e<d;e++){var f=a[e];if(b.call(c,f,e,a))return{Ph:e,v:f}}return{Ph:-1,v:void 0}}na("Array.prototype.findIndex",function(a){return a?a:function(b,c){return Ma(this,b,c).Ph}});
function Na(a,b){a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e}na("Array.prototype.values",function(a){return a?a:function(){return Na(this,function(b,c){return c})}});
na("Array.from",function(a){return a?a:function(b,c,d){c=c!=null?c:function(h){return h};var e=[],f=typeof Symbol!="undefined"&&Symbol.iterator&&b[Symbol.iterator];if(typeof f=="function"){b=f.call(b);for(var g=0;!(f=b.next()).done;)e.push(c.call(d,f.value,g++))}else for(f=b.length,g=0;g<f;g++)e.push(c.call(d,b[g],g));return e}});na("Array.prototype.keys",function(a){return a?a:function(){return Na(this,function(b){return b})}});
na("Object.is",function(a){return a?a:function(b,c){return b===c?b!==0||1/b===1/c:b!==b&&c!==c}});na("Array.prototype.includes",function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length;c=c||0;for(c<0&&(c=Math.max(c+e,0));c<e;c++){var f=d[c];if(f===b||Object.is(f,b))return!0}return!1}});
function Oa(a,b,c){if(a==null)throw new TypeError("The 'this' value for String.prototype."+c+" must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype."+c+" must not be a regular expression");return a+""}na("String.prototype.includes",function(a){return a?a:function(b,c){return Oa(this,b,"includes").indexOf(b,c||0)!==-1}});
na("String.fromCodePoint",function(a){return a?a:function(b){for(var c="",d=0;d<arguments.length;d++){var e=Number(arguments[d]);if(e<0||e>1114111||e!==Math.floor(e))throw new RangeError("invalid_code_point "+e);e<=65535?c+=String.fromCharCode(e):(e-=65536,c+=String.fromCharCode(e>>>10&1023|55296),c+=String.fromCharCode(e&1023|56320))}return c}});
na("String.prototype.startsWith",function(a){return a?a:function(b,c){var d=Oa(this,b,"startsWith"),e=d.length,f=b.length;c=Math.max(0,Math.min(c|0,d.length));for(var g=0;g<f&&c<e;)if(d[c++]!=b[g++])return!1;return g>=f}});
na("WeakSet",function(a){function b(c){this.h=new WeakMap;if(c){c=t(c);for(var d;!(d=c.next()).done;)this.add(d.value)}}if(function(){if(!a||!Object.seal)return!1;try{var c=Object.seal({}),d=Object.seal({}),e=new a([c]);if(!e.has(c)||e.has(d))return!1;e.delete(c);e.add(d);return!e.has(c)&&e.has(d)}catch(f){return!1}}())return a;b.prototype.add=function(c){this.h.set(c,!0);return this};b.prototype.has=function(c){return this.h.has(c)};b.prototype.delete=function(c){return this.h.delete(c)};return b});
na("Array.prototype.find",function(a){return a?a:function(b,c){return Ma(this,b,c).v}});na("Object.entries",function(a){return a?a:function(b){var c=[],d;for(d in b)La(b,d)&&c.push([d,b[d]]);return c}});var Pa=typeof Object.assign=="function"?Object.assign:function(a,b){if(a==null)throw new TypeError("No nullish arg");a=Object(a);for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var e in d)La(d,e)&&(a[e]=d[e])}return a};na("Object.assign",function(a){return a||Pa});
na("Math.clz32",function(a){return a?a:function(b){b=Number(b)>>>0;if(b===0)return 32;var c=0;(b&4294901760)===0&&(b<<=16,c+=16);(b&4278190080)===0&&(b<<=8,c+=8);(b&4026531840)===0&&(b<<=4,c+=4);(b&3221225472)===0&&(b<<=2,c+=2);(b&2147483648)===0&&c++;return c}});na("String.prototype.repeat",function(a){return a?a:function(b){var c=Oa(this,null,"repeat");if(b<0||b>1342177279)throw new RangeError("Invalid count value");b|=0;for(var d="";b;)if(b&1&&(d+=c),b>>>=1)c+=c;return d}});
na("Array.prototype.entries",function(a){return a?a:function(){return Na(this,function(b,c){return[b,c]})}});na("Promise.withResolvers",function(a){return a?a:function(){var b,c;return{promise:new Promise(function(d,e){b=d;c=e}),resolve:b,reject:c}}});na("Promise.prototype.finally",function(a){return a?a:function(b){return this.then(function(c){return Promise.resolve(b()).then(function(){return c})},function(c){return Promise.resolve(b()).then(function(){throw c;})})}});
na("Number.isFinite",function(a){return a?a:function(b){return typeof b!=="number"?!1:!isNaN(b)&&b!==Infinity&&b!==-Infinity}});na("String.prototype.endsWith",function(a){return a?a:function(b,c){var d=Oa(this,b,"endsWith");c===void 0&&(c=d.length);c=Math.max(0,Math.min(c|0,d.length));for(var e=b.length;e>0&&c>0;)if(d[--c]!=b[--e])return!1;return e<=0}});
na("Math.trunc",function(a){return a?a:function(b){b=Number(b);if(isNaN(b)||b===Infinity||b===-Infinity||b===0)return b;var c=Math.floor(Math.abs(b));return b<0?-c:c}});na("Number.EPSILON",function(){return 2.220446049250313E-16});na("Number.MAX_SAFE_INTEGER",function(){return 9007199254740991});
na("Array.prototype.fill",function(a){return a?a:function(b,c,d){var e=this.length||0;c<0&&(c=Math.max(0,e+c));if(d==null||d>e)d=e;d=Number(d);d<0&&(d=Math.max(0,e+d));for(c=Number(c||0);c<d;c++)this[c]=b;return this}});ia("fill",function(a){return a?a:Array.prototype.fill});na("Number.isNaN",function(a){return a?a:function(b){return typeof b==="number"&&isNaN(b)}});na("String.prototype.trimLeft",function(a){function b(){return this.replace(/^[\s\xa0]+/,"")}return a||b});
na("String.prototype.trimStart",function(a){return a||String.prototype.trimLeft});na("Number.isInteger",function(a){return a?a:function(b){return Number.isFinite(b)?b===Math.floor(b):!1}});/*

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/
var Qa=this||self;function K(a,b){a=a.split(".");var c=Qa;a[0]in c||typeof c.execScript=="undefined"||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||b===void 0?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};var shaka={};function Ra(a){this.j=Math.log(.5);this.h=Math.exp(this.j/a);this.l=this.i=0}Ra.prototype.sample=function(a,b){var c=Math.pow(this.h,a);b=b*(1-c)+c*this.i;isNaN(b)||(this.i=b,this.l+=a)};function Sa(a){return a.i/(1-Math.pow(a.h,a.l))};function Ta(){this.i=new Ra(2);this.l=new Ra(5);this.h=0;this.j=128E3;this.m=16E3}Ta.prototype.configure=function(a){this.j=a.minTotalBytes;this.m=a.minBytes;var b=this.i;b.h=Math.exp(b.j/a.fastHalfLife);b=this.l;b.h=Math.exp(b.j/a.slowHalfLife)};Ta.prototype.sample=function(a,b){if(!(b<this.m)){var c=8E3*b/a;a/=1E3;this.h+=b;this.i.sample(a,c);this.l.sample(a,c)}};Ta.prototype.getBandwidthEstimate=function(a){return this.h<this.j?a:Math.min(Sa(this.i),Sa(this.l))};function Ua(){}function Va(){}function Wa(){}function Xa(a){var b=Ja.apply(1,arguments);Ya.has(a)||(Ya.add(a),Wa.apply(Ua,wa(b)))}function Za(){}function $a(){}function bb(){}var Ya=new Set;
self.console&&((new Map).set(1,function(){return console.error.apply(console,wa(Ja.apply(0,arguments)))}).set(2,function(){return console.warn.apply(console,wa(Ja.apply(0,arguments)))}).set(3,function(){return console.info.apply(console,wa(Ja.apply(0,arguments)))}).set(4,function(){return console.log.apply(console,wa(Ja.apply(0,arguments)))}).set(5,function(){return console.debug.apply(console,wa(Ja.apply(0,arguments)))}).set(6,function(){return console.debug.apply(console,wa(Ja.apply(0,arguments)))}),
Wa=function(){return console.warn.apply(console,wa(Ja.apply(0,arguments)))},Va=function(){console.error.apply(console,wa(Ja.apply(0,arguments)))});function cb(a,b){return typeof a==="number"&&typeof b==="number"&&isNaN(a)&&isNaN(b)?!0:a===b}function db(a,b){b=a.indexOf(b);b>-1&&a.splice(b,1)}function eb(a,b){var c;c||(c=cb);if(a.length!=b.length)return!1;b=b.slice();a=t(a);for(var d=a.next(),e={};!d.done;e={Wh:void 0},d=a.next()){e.Wh=d.value;d=b.findIndex(function(f){return function(g){return c(f.Wh,g)}}(e));if(d==-1)return!1;b[d]=b[b.length-1];b.pop()}return b.length==0}
function fb(a,b){for(var c=0,d=a.length;c<d;){var e=c+d>>>1;b(a[e])?c=e+1:d=e}return c}function gb(a,b,c){if(a===b)return!0;if(!a||!b)return a==b;c||(c=cb);if(a.length!=b.length)return!1;for(var d=0;d<a.length;d++)if(!c(a[d],b[d]))return!1;return!0};function hb(){this.h=new Map}r=hb.prototype;r.push=function(a,b){this.h.getOrInsertComputed(a,function(){return[]}).push(b)};r.get=function(a){return this.h.has(a)?this.h.get(a).slice():null};r.remove=function(a,b){if(this.h.has(a)){var c=this.h.get(a).filter(function(d){return d!=b});this.h.set(a,c);c.length||this.h.delete(a)}};r.forEach=function(a){this.h.forEach(function(b,c){a(c,b)})};r.size=function(){return this.h.size};r.keys=function(){return Array.from(this.h.keys())};function ib(){this.h=new hb}r=ib.prototype;r.release=function(){this.Ta();this.h=null};r.J=function(a,b,c,d){this.h&&(a=new jb(a,b,c,d),this.h.push(b,a))};r.Ra=function(a,b,c,d){function e(g){f.pb(a,b,e);c(g)}var f=this;this.J(a,b,e,d)};r.Jb=function(a,b,c,d){if(this.h){b=t(b);for(var e=b.next();!e.done;e=b.next())this.J(a,e.value,c,d)}};
r.vk=function(a,b,c,d){var e=this;if(this.h)for(var f=!1,g=function(l){if(!f){f=!0;for(var m=t(b),n=m.next();!n.done;n=m.next())e.pb(a,n.value,g);c(l)}},h=t(b),k=h.next();!k.done;k=h.next())this.J(a,k.value,g,d)};r.pb=function(a,b,c){if(this.h){var d=this.h.get(b)||[];d=t(d);for(var e=d.next();!e.done;e=d.next())e=e.value,e.target!=a||c!=e.listener&&c||(e.pb(),this.h.remove(b,e))}};r.xl=function(a,b,c){if(this.h){b=t(b);for(var d=b.next();!d.done;d=b.next())this.pb(a,d.value,c)}};
r.Ta=function(){if(this.h){for(var a=[],b=t(this.h.h.values()),c=b.next();!c.done;c=b.next())a.push.apply(a,wa(c.value));a=t(a);for(b=a.next();!b.done;b=a.next())b.value.pb();this.h.h.clear()}};K("shaka.util.EventManager",ib);ib.prototype.removeAll=ib.prototype.Ta;ib.prototype.unlistenMulti=ib.prototype.xl;ib.prototype.unlisten=ib.prototype.pb;ib.prototype.listenOnceMulti=ib.prototype.vk;ib.prototype.listenMulti=ib.prototype.Jb;ib.prototype.listenOnce=ib.prototype.Ra;ib.prototype.listen=ib.prototype.J;
ib.prototype.release=ib.prototype.release;function jb(a,b,c,d){this.target=a;this.type=b;this.listener=c;this.h=kb(a,d);this.target.addEventListener(b,c,this.h)}jb.prototype.pb=function(){this.target.removeEventListener(this.type,this.listener,this.h);this.listener=this.target=null;this.h=!1};function kb(a,b){if(b==void 0)return!1;if(typeof b=="boolean")return b;var c=new Set(["passive","capture"]);Object.keys(b).filter(function(d){return!c.has(d)});return lb(a)?b:b.capture||!1}
function lb(a){var b=mb;if(b==void 0){b=!1;try{var c={},d={get:function(){b=!0;return!1}};Object.defineProperty(c,"passive",d);Object.defineProperty(c,"capture",d);d=function(){};a.addEventListener("test",d,c);a.removeEventListener("test",d,c)}catch(e){b=!1}mb=b}return b||!1}var mb=void 0;function nb(a){this.i=a;this.h=void 0}nb.prototype.value=function(){this.h===void 0&&(this.h=this.i());return this.h};function ob(){return pb.value()}var rb=null,sb=null,pb=new nb(function(){var a=void 0;rb&&(a=rb());!a&&sb&&(a=sb());return a});function tb(){}function wb(a,b){if(a===b||!a&&!b)return!0;if(!a||!b||a.byteLength!==b.byteLength)return!1;var c=ArrayBuffer.isView(a)?a.buffer:a,d=ArrayBuffer.isView(b)?b.buffer:b,e,f=(e=a.byteOffset)!=null?e:0,g;b=(g=b.byteOffset)!=null?g:0;if(f===b&&c==d)return!0;c=new DataView(c,f);d=new DataView(d,b);f=Math.floor(a.byteLength/4);for(g=0;g<f;++g)if(c.getUint32(g*4)!==d.getUint32(g*4))return!1;for(f*=4;f<a.byteLength;++f)if(c.getUint8(f)!==d.getUint8(f))return!1;return!0}
function xb(a){return ArrayBuffer.isView(a)?a.byteOffset==0&&a.byteLength==a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer:a}function yb(a,b,c){c=c===void 0?Infinity:c;return zb(a,b===void 0?0:b,c,Uint8Array)}function Ab(a,b,c){c=c===void 0?Infinity:c;return zb(a,b===void 0?0:b,c,Uint16Array)}function Bb(a,b,c){c=c===void 0?Infinity:c;return zb(a,b===void 0?0:b,c,DataView)}
function zb(a,b,c,d){var e=ArrayBuffer.isView(a)?a.buffer:a,f=1;"BYTES_PER_ELEMENT"in d&&(f=d.BYTES_PER_ELEMENT);var g=((a.byteOffset||0)+a.byteLength)/f;a=Math.floor(Math.max(0,Math.min(((a.byteOffset||0)+b)/f,g)));return new d(e,a,Math.floor(Math.min(a+Math.max(c,0),g))-a)}K("shaka.util.BufferUtils",tb);tb.toDataView=Bb;tb.toUint16=Ab;tb.toUint8=yb;tb.toArrayBuffer=xb;tb.equal=wb;function L(a,b,c){var d=Ja.apply(3,arguments);this.severity=a;this.category=b;this.code=c;this.data=d;this.handled=!1;this.message="Shaka Error "+this.code;if(Cb)try{throw Error(this.message||"Shaka Error");}catch(e){this.stack=e.stack}}L.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null,"  ")};function Db(a){var b=a.code,c=a.msExtendedCode;c&&(c<0&&(c+=4294967296),c=c.toString(16));return{code:b,rj:c,message:a.message}}K("shaka.util.Error",L);var Cb=!0;
L.Severity={RECOVERABLE:1,CRITICAL:2};L.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10};
L.Code={UNSUPPORTED_SCHEME:1E3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,ATTEMPTS_EXHAUSTED:1010,SEGMENT_MISSING:1011,INVALID_TEXT_HEADER:2E3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,INVALID_MP4_CEA:2010,TEXT_COULD_NOT_GUESS_MIME_TYPE:2011,
CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS:2012,TEXT_ONLY_WEBVTT_SRC_EQUALS:2013,MISSING_TEXT_PLUGIN:2014,UNSUPPORTED_EXTERNAL_THUMBNAILS_URI:2017,BUFFER_READ_OUT_OF_BOUNDS:3E3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,
WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,CONTENT_TRANSFORMATION_FAILED:3019,TRANSMUXING_NO_VIDEO_DATA:3023,STREAMING_NOT_ALLOWED:3024,BUFFER_WRITE_OUT_OF_BOUNDS:3025,UNABLE_TO_GUESS_MANIFEST_TYPE:4E3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,
DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,RESTRICTIONS_CANNOT_BE_MET:4012,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,
DASH_XLINK_DEPTH_LIMIT:4028,CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,NO_VARIANTS:4036,PERIOD_FLATTENING_FAILED:4037,INCONSISTENT_DRM_ACROSS_PERIODS:4038,HLS_VARIABLE_NOT_FOUND:4039,HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED:4040,HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4041,NO_WEB_CRYPTO_API:4042,CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_LIVE_STREAM:4045,AES_128_INVALID_IV_LENGTH:4048,AES_128_INVALID_KEY_LENGTH:4049,DASH_CONFLICTING_AES_128:4050,DASH_UNSUPPORTED_AES_128:4051,
DASH_INVALID_PATCH:4052,HLS_EMPTY_MEDIA_PLAYLIST:4053,DASH_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4054,CANNOT_ADD_EXTERNAL_CHAPTERS_TO_LIVE_STREAM:4055,WEBTRANSPORT_NOT_AVAILABLE:4056,WEBTRANSPORT_INITIALIZATION_FAILED:4057,MSF_VOD_CONTENT_NOT_SUPPORTED:4058,HLS_INVALID_KEY_IV_FOR_GCM:4059,HLS_INVALID_GCM_SEGMENT:4060,DASH_UNSUPPORTED_ESSENTIAL_PROPERTY:4063,MSF_CATALOG_TIMEOUT:4064,MSF_CONNECTION_CLOSED:4065,MSF_SUBSCRIBE_FAILED:4066,MSF_UNSUPPORTED_COMPRESSION:4067,MSF_UNSUPPORTED_CATALOG_VERSION:4068,
MKV_INVALID_FILE:4069,MKV_MISSING_INDEX:4070,MKV_NO_SUPPORTED_TRACKS:4071,STREAMING_ENGINE_STARTUP_INVALID_STATE:5006,NO_RECOGNIZED_KEY_SYSTEMS:6E3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,
EXPIRED:6014,SERVER_CERTIFICATE_REQUIRED:6015,INIT_DATA_TRANSFORM_ERROR:6016,SERVER_CERTIFICATE_REQUEST_FAILED:6017,MIN_HDCP_VERSION_NOT_MATCH:6018,ERROR_CHECKING_HDCP_VERSION:6019,MISSING_EME_SUPPORT:6020,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,SRC_EQUALS_PRELOAD_NOT_SUPPORTED:7005,PRELOAD_DESTROYED:7006,QUEUE_INDEX_OUT_OF_BOUNDS:7007,CAST_API_UNAVAILABLE:8E3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,
CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9E3,INDEXED_DB_ERROR:9001,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,KEY_NOT_FOUND:9012,MISSING_STORAGE_CELL:9013,STORAGE_LIMIT_REACHED:9014,DOWNLOAD_SIZE_CALLBACK_ERROR:9015,MODIFY_OPERATION_NOT_SUPPORTED:9016,
INDEXED_DB_INIT_TIMED_OUT:9017,CS_IMA_SDK_MISSING:1E4,SS_IMA_SDK_MISSING:10002,CURRENT_DAI_REQUEST_NOT_FINISHED:10004,VAST_INVALID_XML:10007,CS_AD_CONTAINER_MISSING:10008,SS_AD_CONTAINER_MISSING:10009,MEDIATAILOR_REQUEST_FAILED:10010};function Eb(){}
function Fb(a){if(!a)return"";a=yb(a);a[0]==239&&a[1]==187&&a[2]==191&&(a=a.subarray(3));if(self.TextDecoder&&!ob().Ug())return a=(new TextDecoder).decode(a),a.includes("\ufffd")&&Va('Decoded string contains an "unknown character" codepoint.  That probably means the UTF8 encoding was incorrect!'),a;for(var b="",c=0;c<a.length;++c){var d=65533;(a[c]&128)==0?d=a[c]:a.length>=c+2&&(a[c]&224)==192&&(a[c+1]&192)==128?(d=(a[c]&31)<<6|a[c+1]&63,c+=1):a.length>=c+3&&(a[c]&240)==224&&(a[c+1]&192)==128&&(a[c+
2]&192)==128?(d=(a[c]&15)<<12|(a[c+1]&63)<<6|a[c+2]&63,c+=2):a.length>=c+4&&(a[c]&241)==240&&(a[c+1]&192)==128&&(a[c+2]&192)==128&&(a[c+3]&192)==128&&(d=(a[c]&7)<<18|(a[c+1]&63)<<12|(a[c+2]&63)<<6|a[c+3]&63,c+=3);if(d<=65535)b+=String.fromCharCode(d);else{d-=65536;var e=d&1023;b+=String.fromCharCode(55296+(d>>10));b+=String.fromCharCode(56320+e)}}return b}
function Gb(a,b,c){if(!a)return"";if(!c&&a.byteLength%2!=0)throw new L(2,2,2004);c=Math.floor(a.byteLength/2);var d=new Uint16Array(c);a=Bb(a);for(var e=0;e<c;e++)d[e]=a.getUint16(e*2,b);return Hb.value()(d)}
function Ib(a){function b(d){return c.byteLength<=d||c[d]>=9&&c[d]<=126}if(!a)return"";var c=yb(a);if(c[0]==239&&c[1]==187&&c[2]==191)return Fb(c);if(c[0]==254&&c[1]==255)return Gb(c.subarray(2),!1);if(c[0]==255&&c[1]==254)return Gb(c.subarray(2),!0);if(c[0]==0&&c[2]==0)return Gb(a,!1);if(c[1]==0&&c[3]==0)return Gb(a,!0);if(b(0)&&b(1)&&b(2)&&b(3))return Fb(a);throw new L(2,2,2003);}
function Jb(a){if(self.TextEncoder&&!ob().Ug()){var b=new TextEncoder;return xb(b.encode(a))}a=encodeURIComponent(a);a=unescape(a);b=new Uint8Array(a.length);for(var c=0;c<a.length;c++)b[c]=a[c].charCodeAt(0);return xb(b)}function Kb(a,b){for(var c=new ArrayBuffer(a.length*2),d=new DataView(c),e=0;e<a.length;++e)d.setUint16(e*2,a.charCodeAt(e),b);return c}
function Lb(a){var b={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&apos;":"'","&nbsp;":"\u00a0","&lrm;":"\u200e","&rlm;":"\u200f"},c=/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g,d=RegExp(c.source);return a&&d.test(a)?a.replace(c,function(e){return e[1]=="#"?(e=e[2]=="x"||e[2]=="X"?parseInt(e.substring(3),16):parseInt(e.substring(2),10),e>=0&&e<=1114111?String.fromCodePoint(e):""):b[e]||"'"}):a||""}K("shaka.util.StringUtils",Eb);Eb.resetFromCharCode=function(){Hb.h=void 0};
Eb.toUTF16=Kb;Eb.toUTF8=Jb;Eb.fromBytesAutoDetect=Ib;Eb.fromUTF16=Gb;Eb.fromUTF8=Fb;var Hb=new nb(function(){function a(c){try{var d=new Uint8Array(c);return String.fromCharCode.apply(null,d).length>0}catch(e){return!1}}for(var b={tc:65536};b.tc>0;b={tc:b.tc},b.tc/=2)if(a(b.tc))return function(c){return function(d){for(var e="",f=0;f<d.length;f+=c.tc)e+=String.fromCharCode.apply(null,d.subarray(f,f+c.tc));return e}}(b);return null});function Mb(){}function Nb(a){a=yb(a);return Uint8Array.prototype.toBase64?a.toBase64({alphabet:"base64",omitPadding:!1}):(a=Hb.value()(a),btoa(a))}function Ob(a,b){b=b==void 0?!0:b;return Uint8Array.prototype.toBase64?yb(a).toBase64({alphabet:"base64url",omitPadding:!b}):(a=Nb(a).replace(/\+/g,"-").replace(/\//g,"_"),b?a:a.replace(/[=]*$/,""))}
function Pb(a){if(!("fromBase64"in Uint8Array)){a=self.atob(a.replace(/-/g,"+").replace(/_/g,"/"));for(var b=new Uint8Array(a.length),c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}a=a.replace(/\s+/g,"");return Uint8Array.fromBase64(a,{alphabet:/[-_]/.test(a)?"base64url":"base64"})}function Qb(a){if(!("fromHex"in Uint8Array)){for(var b=a.length/2,c=new Uint8Array(b),d=0;d<b;d++)c[d]=parseInt(a.substr(d*2,2),16);return c}return Uint8Array.fromHex(a)}
function Rb(a){var b=yb(a);if(!Uint8Array.prototype.toHex){a="";b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,c=c.toString(16),c.length==1&&(c="0"+c),a+=c;return a}return b.toHex()}function Sb(){var a=Ja.apply(0,arguments);return Ub(a,0,a.length)}
function Ub(a,b,c){b=b===void 0?0:b;c=c===void 0?a.length:c;for(var d=0,e=b;e<c;++e)d+=a[e].byteLength;d=new Uint8Array(d);for(e=0;b<c;++b){var f=a[b];ArrayBuffer.isView(f)&&f.BYTES_PER_ELEMENT===1?d.set(f,e):d.set(yb(f),e);e+=f.byteLength}return d}function Vb(a){for(var b=new Uint8Array(a.length),c=0,d=0,e=0;e<a.length;e++){var f=a[e];c>=2&&f==3?c=0:(b[d++]=f,f==0?c++:c=0)}return b.subarray(0,d)}K("shaka.util.Uint8ArrayUtils",Mb);Mb.concat=Sb;Mb.toHex=Rb;Mb.fromHex=Qb;Mb.fromBase64=Pb;
Mb.toBase64=Ob;Mb.toStandardBase64=Nb;function Wb(a,b){if(a===b||!a.length||!b.length)return!0;a=t(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;if(Xb(c))return!0;for(var d=t(b),e=d.next();!e.done;e=d.next())if(e=e.value,c.keySystem===e.keySystem||Xb(e))return!0}return!1}
function Yb(a,b){if(!a.length)return b;if(!b.length)return a;var c=[];a=t(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;for(var e=t(b),f=e.next();!f.done;f=e.next())if(f=f.value,d.keySystem==f.keySystem){e=new Map;for(var g=t((d.initData||[]).concat(f.initData||[])),h=g.next();!h.done;h=g.next())h=h.value,e.set(h.keyId,h);e=Array.from(e.values());g=d.keyIds&&f.keyIds?new Set([].concat(wa(d.keyIds),wa(f.keyIds))):d.keyIds||f.keyIds;c.push({keySystem:d.keySystem,licenseServerUri:d.licenseServerUri||
f.licenseServerUri,distinctiveIdentifierRequired:d.distinctiveIdentifierRequired||f.distinctiveIdentifierRequired,persistentStateRequired:d.persistentStateRequired||f.persistentStateRequired,videoRobustness:d.videoRobustness||f.videoRobustness,audioRobustness:d.audioRobustness||f.audioRobustness,serverCertificate:d.serverCertificate||f.serverCertificate,serverCertificateUri:d.serverCertificateUri||f.serverCertificateUri,initData:e,keyIds:g});break}else Xb(d)?c.push(d):Xb(f)&&c.push(f)}return c}
function Zb(a){return a?a.keySystem:""}function $b(a){return a==="org.w3.clearkey"}function ac(a){return a?!!a.match(/^com\.widevine\.alpha/):!1}function bc(a){return a?!!a.match(/^com\.(microsoft|chromecast)\.playready/):!1}function cc(a){return a?!!a.match(/^com\.apple\.fps/):!1}function Xb(a){return(a=a.licenseServerUri)?a.startsWith("data:application/json;base64,"):!1}function dc(a,b,c,d){d=[].concat(wa(new Set(d))).sort().join("#");return a+"#"+b+"#"+c+"#"+d}
function ec(a,b){a=a===void 0?!1:a;b=b===void 0?!1:b;var c={"1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","e2719d58-a985-b3c9-781a-b030af78d30e":"org.w3.clearkey","edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready","94ce86fb-07ff-4f43-adb8-93d2fa968ca2":"com.apple.fps","3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c":"com.huawei.wiseplay"};if(!a&&!b)return c;var d=
{},e;for(e in c){var f=c[e],g=e;b?g="urn:uuid:"+e:a&&(g=e.replace(/-/g,""));d[g]=f}return d}function fc(a){return a.length===22?a:Ob(Qb(a),!1)}var hc=new nb(function(){return xb(new Uint8Array([0]))}),jc=new Map;function kc(){}function lc(a,b){a=mc(a);b=mc(b);return a.split("-")[0]==b.split("-")[0]}function nc(a,b){a=mc(a);b=mc(b);a=a.split("-");b=b.split("-");return a[0]==b[0]&&a.length==1&&b.length==2}function oc(a,b){a=mc(a);b=mc(b);a=a.split("-");b=b.split("-");return a.length==2&&b.length==2&&a[0]==b[0]}
function mc(a){a=t(a.split("-x-"));var b=a.next().value;b=b===void 0?"":b;a=a.next().value;a=a===void 0?"":a;var c=t(b.split("-"));b=c.next().value;b=b===void 0?"":b;c=c.next().value;c=c===void 0?"":c;a=a?"x-"+a:"";b=b.toLowerCase();b=pc.get(b)||b;c=c.toUpperCase();return(c?b+"-"+c:b)+(a?"-"+a:"")}function qc(a,b){a=mc(a);b=mc(b);return b==a?4:nc(b,a)?3:oc(b,a)?2:nc(a,b)?1:0}function rc(a){var b=a.indexOf("-");a=b>=0?a.substring(0,b):a;a=a.toLowerCase();return a=pc.get(a)||a}
function sc(a){return a.language?mc(a.language):a.audio&&a.audio.language?mc(a.audio.language):a.video&&a.video.language?mc(a.video.language):"und"}
function tc(a,b){a=mc(a);var c=new Set;b=t(b);for(var d=b.next();!d.done;d=b.next())c.add(mc(d.value));b=t(c);for(d=b.next();!d.done;d=b.next())if(d=d.value,d==a)return d;b=t(c);for(d=b.next();!d.done;d=b.next())if(d=d.value,nc(d,a))return d;b=t(c);for(d=b.next();!d.done;d=b.next())if(d=d.value,oc(d,a))return d;c=t(c);for(b=c.next();!b.done;b=c.next())if(b=b.value,nc(a,b))return b;return null}K("shaka.util.LanguageUtils",kc);kc.findClosestLocale=tc;kc.getLocaleForVariant=sc;
kc.getLocaleForText=function(a){return mc(a.language||"und")};kc.getBase=rc;kc.relatedness=qc;kc.areSiblings=function(a,b){var c=rc(a),d=rc(b);return a!=c&&b!=d&&c==d};kc.normalize=mc;kc.isSiblingOf=oc;kc.isParentOf=nc;kc.areLanguageCompatible=lc;kc.areLocaleCompatible=function(a,b){a=mc(a);b=mc(b);return a==b};
var pc=new Map([["aar","aa"],["abk","ab"],["afr","af"],["aka","ak"],["alb","sq"],["amh","am"],["ara","ar"],["arg","an"],["arm","hy"],["asm","as"],["ava","av"],["ave","ae"],["aym","ay"],["aze","az"],["bak","ba"],["bam","bm"],["baq","eu"],["bel","be"],["ben","bn"],["bih","bh"],["bis","bi"],["bod","bo"],["bos","bs"],["bre","br"],["bul","bg"],["bur","my"],["cat","ca"],["ces","cs"],["cha","ch"],["che","ce"],["chi","zh"],["chu","cu"],["chv","cv"],["cor","kw"],["cos","co"],["cre","cr"],["cym","cy"],["cze",
"cs"],["dan","da"],["deu","de"],["div","dv"],["dut","nl"],["dzo","dz"],["ell","el"],["eng","en"],["epo","eo"],["est","et"],["eus","eu"],["ewe","ee"],["fao","fo"],["fas","fa"],["fij","fj"],["fin","fi"],["fra","fr"],["fre","fr"],["fry","fy"],["ful","ff"],["geo","ka"],["ger","de"],["gla","gd"],["gle","ga"],["glg","gl"],["glv","gv"],["gre","el"],["grn","gn"],["guj","gu"],["hat","ht"],["hau","ha"],["heb","he"],["her","hz"],["hin","hi"],["hmo","ho"],["hrv","hr"],["hun","hu"],["hye","hy"],["ibo","ig"],["ice",
"is"],["ido","io"],["iii","ii"],["iku","iu"],["ile","ie"],["ina","ia"],["ind","id"],["ipk","ik"],["isl","is"],["ita","it"],["jav","jv"],["jpn","ja"],["kal","kl"],["kan","kn"],["kas","ks"],["kat","ka"],["kau","kr"],["kaz","kk"],["khm","km"],["kik","ki"],["kin","rw"],["kir","ky"],["kom","kv"],["kon","kg"],["kor","ko"],["kua","kj"],["kur","ku"],["lao","lo"],["lat","la"],["lav","lv"],["lim","li"],["lin","ln"],["lit","lt"],["ltz","lb"],["lub","lu"],["lug","lg"],["mac","mk"],["mah","mh"],["mal","ml"],["mao",
"mi"],["mar","mr"],["may","ms"],["mkd","mk"],["mlg","mg"],["mlt","mt"],["mon","mn"],["mri","mi"],["msa","ms"],["mya","my"],["nau","na"],["nav","nv"],["nbl","nr"],["nde","nd"],["ndo","ng"],["nep","ne"],["nld","nl"],["nno","nn"],["nob","nb"],["nor","no"],["nya","ny"],["oci","oc"],["oji","oj"],["ori","or"],["orm","om"],["oss","os"],["pan","pa"],["per","fa"],["pli","pi"],["pol","pl"],["por","pt"],["pus","ps"],["que","qu"],["roh","rm"],["ron","ro"],["rum","ro"],["run","rn"],["rus","ru"],["sag","sg"],["san",
"sa"],["sin","si"],["slk","sk"],["slo","sk"],["slv","sl"],["sme","se"],["smo","sm"],["sna","sn"],["snd","sd"],["som","so"],["sot","st"],["spa","es"],["sqi","sq"],["srd","sc"],["srp","sr"],["ssw","ss"],["sun","su"],["swa","sw"],["swe","sv"],["tah","ty"],["tam","ta"],["tat","tt"],["tel","te"],["tgk","tg"],["tgl","tl"],["tha","th"],["tib","bo"],["tir","ti"],["ton","to"],["tsn","tn"],["tso","ts"],["tuk","tk"],["tur","tr"],["twi","tw"],["uig","ug"],["ukr","uk"],["urd","ur"],["uzb","uz"],["ven","ve"],["vie",
"vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);function uc(a,b,c,d,e){b={keySystem:a,encryptionScheme:b,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:c||[],keyIds:new Set,mediaTypes:e};d&&(b.keySystemUris=new Set([d]));!c&&cc(a)&&b.initData.push({initDataType:"sinf",initData:new Uint8Array(0),keyId:null});return b}
function vc(a,b){b=b===void 0?"cenc":b;var c=[],d=[],e=[],f=new Map;a.forEach(function(h,k){var l=fc(k);h=fc(h);var m={kty:"oct",kid:l,k:h};c.push(m);d.push(m.kid);e.push(k);f.set(l,h)});a=JSON.stringify({keys:c});var g=JSON.stringify({kids:d});g=[{initData:yb(Jb(g)),initDataType:"keyids"}];return{keySystem:"org.w3.clearkey",encryptionScheme:b,licenseServerUri:"data:application/json;base64,"+window.btoa(a),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",
serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:g,keyIds:new Set(e),clearKeys:f}}function wc(a,b){if(b.length==1)return b[0];a=xc(a,b);if(a!=null)return a;throw new L(2,4,4025,b);}function xc(a,b){var c=yc.get(a);c=t(c);for(var d=c.next();!d.done;d=c.next()){d=d.value;for(var e=t(b),f=e.next();!f.done;f=e.next())if(f=f.value,d.test(f.trim()))return f.trim()}return a==zc?"":null}
function Ac(a,b){var c=[];a=yc.get(a);a=t(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;for(var e=t(b),f=e.next();!f.done;f=e.next())f=f.value,d.test(f.trim())&&c.push(f.trim())}return c}
var zc="text",Bc={qa:"video",$:"audio",Ua:zc,Wi:"image",Il:"application",Ui:"chapter"},yc=(new Map).set("audio",[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cehx]?$/,/^iamf/,/^mhm[12]/,/^ac3$/,/^eac3$/,/^apac$/]).set("video",[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av0[12]/,/^mp2v/,/^dvh/,/^dva/,/^dav/]).set("text",[/^vtt$/,/^wvtt/,/^stpp/]);function Cc(a,b,c,d){this.h=null;this.m=a;this.j=b;this.o=c;this.l=d;typeof libDPIModule==="undefined"&&Wa("Could not find LCEVC Library dependencies on this page");typeof LCEVCdec!=="undefined"?(this.i=LCEVCdec,typeof this.i.SupportObject==="undefined"?(Wa("Could not find LCEVC Library on this page"),a=!1):(this.i.SupportObject.SupportStatus||Wa(this.i.SupportObject.SupportError),a=typeof this.i!=="undefined"&&typeof libDPIModule!=="undefined"&&this.j instanceof HTMLCanvasElement&&this.i.SupportObject.SupportStatus)):
(Wa("Could not find LCEVC Library on this page"),a=!1);a&&!this.h&&this.i.SupportObject.webGLSupport(this.j)&&(this.j.classList.remove("shaka-hidden"),this.h=new this.i.LCEVCdec(this.m,this.j,this.o))}function Dc(a,b,c,d){d.type!=="video"||a.l&&!Ec(d)||a.h&&a.h.appendBuffer(b,"video",d.id,-c,!a.l)}function Fc(a){a.h&&a.j.classList.add("shaka-hidden")}Cc.prototype.release=function(){this.h&&(this.h.close(),this.h=null)};function Ec(a){return a&&typeof LCEVCdec!=="undefined"?a.codecs=="lvc1":!1}
K("shaka.lcevc.Dec",Cc);Cc.prototype.release=Cc.prototype.release;function Gc(){}function Hc(a,b){Ic.set(a,b)}function Jc(){var a={};ob();if(Lc())for(var b=t(Ic.keys()),c=b.next();!c.done;c=b.next())a[c.value]=!0;b=t(["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","audio/x-mpegurl"]);for(c=b.next();!c.done;c=b.next())c=c.value,a[c]=Lc()?Ic.has(c):Mc().canPlayType(c)!="";return a}function Nc(a,b){if(b){var c=Ic.get(b);if(c)return c}throw new L(2,4,4E3,a,b);}K("shaka.media.ManifestParser",Gc);Gc.unregisterParserByMime=function(a){Ic.delete(a)};
Gc.registerParserByMime=Hc;Gc.AccessibilityPurpose={qm:"visually impaired",Rl:"hard of hearing",jm:"spoken subtitles"};var Ic=new Map;function Oc(){}r=Oc.prototype;r.extract=function(){};r.extractRaw608=function(){};r.decode=function(){return[]};r.clear=function(){};r.getStreams=function(){return[]};function Qc(){}Qc.prototype.init=function(){};Qc.prototype.parse=function(){return[]};function Rc(a){this.i=new Map;this.j=0;this.l=new Qc;if(a=Sc(a.toLowerCase()))this.l=a();this.h=new Oc;if(a=Tc)this.h=a(),this.i.set(this.j,this.h)}Rc.prototype.init=function(a,b,c){b=b===void 0?!1:b;c=c===void 0?-1:c;c!=-1&&this.j!=c?Uc(this,c):b||this.h.clear();this.l.init(a);c!=-1&&(this.j=c)};
function Vc(a,b){b=a.l.parse(b);b=t(b);for(var c=b.next();!c.done;c=b.next()){c=c.value;var d=yb(c.packet);if(d.length>0)switch(c.format){case Wc:a.h.extract(d,c.pts);break;case Yc:a.h.extractRaw608(d,c.pts)}}return a.h.decode()}function Uc(a,b){a.i.set(a.j,a.h);a.h=a.i.getOrInsertComputed(b,function(){var c=Tc;return c?c():a.h})}
Rc.prototype.remove=function(a){a=a===void 0?[]:a;a=new Set(a);for(var b=t(this.i.keys()),c=b.next();!c.done;c=b.next())if(c=c.value,!a.has(c)){var d=this.i.get(c);d&&d.clear();this.i.delete(c)}};function Zc(a,b){$c.set(a,b)}function Sc(a){return $c.get(a)}K("shaka.media.ClosedCaptionParser",Rc);Rc.findDecoder=function(){return Tc};Rc.unregisterDecoder=function(){Tc=null};Rc.registerDecoder=function(a){Tc=a};Rc.findParser=Sc;Rc.unregisterParser=function(a){$c.delete(a)};Rc.registerParser=Zc;
var $c=new Map,Tc=null,Wc="sei",Yc="raw608";function ad(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=bd;this.scroll=ed;this.backgroundColor="";this.opacity=1;this.overflow=this.padding="";this.zIndex=null}
ad.prototype.clone=function(){var a=new ad;a.id=this.id;a.viewportAnchorX=this.viewportAnchorX;a.viewportAnchorY=this.viewportAnchorY;a.regionAnchorX=this.regionAnchorX;a.regionAnchorY=this.regionAnchorY;a.width=this.width;a.height=this.height;a.heightUnits=this.heightUnits;a.widthUnits=this.widthUnits;a.viewportAnchorUnits=this.viewportAnchorUnits;a.scroll=this.scroll;a.backgroundColor=this.backgroundColor;a.opacity=this.opacity;a.padding=this.padding;a.overflow=this.overflow;a.zIndex=this.zIndex;
return a};K("shaka.text.CueRegion",ad);ad.prototype.clone=ad.prototype.clone;var bd=1;ad.units={PX:0,PERCENTAGE:bd,LINES:2};var ed="";ad.scrollMode={NONE:ed,UP:"up"};function fd(a){this.i=a||"";this.h=0}function gd(a,b){for(var c=hd(a);c;)b(c),id(a,/[ \t]+/gm),c=hd(a)}function id(a,b){b.lastIndex=a.h;b=b.exec(a.i);b=b==null?null:{position:b.index,length:b[0].length,results:b};if(a.h==a.i.length||b==null||b.position!=a.h)return null;a.h+=b.length;return b.results}function hd(a){return a.h==a.i.length?null:(a=id(a,/[^ \t\n]*/gm))?a[0]:null}
function jd(a){a=id(a,kd);if(a==null)return null;var b=Number(a[2]),c=Number(a[3]);return b>59||c>59?null:(Number(a[6])||0)/1E3+c+b*60+(Number(a[1])||0)*3600}function ld(a){return a?jd(new fd(a)):null}var kd=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function md(){}function nd(a){function b(d){switch(typeof d){case "undefined":case "boolean":case "number":case "string":case "symbol":case "function":return d;default:if(!d||ArrayBuffer.isView(d))return d;if(c.has(d))return null;var e=Array.isArray(d);if(d.constructor!=Object&&!e)return null;c.add(d);var f=e?[]:{},g;for(g in d)f[g]=b(d[g]);e&&(f.length=d.length);return f}}var c=new WeakSet;return b(a)}function od(a){var b={},c;for(c in a)b[c]=a[c];return b}
function pd(a){if(Array.isArray(a)){for(var b=[],c=0;c<a.length;c++){var d=c.toString(),e=a[c];e!==void 0&&(e=pd(e))&&b.push(d+":"+e)}a="["+b.join(",")+"]"}else if(typeof a=="function")a="";else if(a instanceof Object){c=Object.keys(a);c.sort();b=[];c=t(c);for(d=c.next();!d.done;d=c.next())e=d.value,d=JSON.stringify(e),e=a[e],e!==void 0&&(e=pd(e))&&b.push(d+":"+e);a="{"+b.join(",")+"}"}else a=JSON.stringify(a);return a}K("shaka.util.ObjectUtils",md);md.alphabeticalKeyOrderStringify=pd;
md.shallowCloneObject=od;md.cloneObject=nd;/*
 @license
 tXml
 Copyright 2015 Tobias Nickel
 SPDX-License-Identifier: MIT
*/
function qd(a,b){a=sd(a,!1);if(!b&&a.length)return a[0];var c=b.split(",");return(b=a.find(function(d){return c.includes(d.tagName)}))?b:null}function td(a){return ud.has(a)?ud.get(a):""}
function sd(a,b){function c(h,k){k=k===void 0?!1:k;for(var l=[];a[e];)if(a.charCodeAt(e)==60){if(a.charCodeAt(e+1)===47){k=e+2;e=a.indexOf(">",e);k=a.substring(k,e);var m=k.indexOf(h);if(m==-1){var n=h.indexOf(".");n>0&&(m=k.indexOf(h.substring(0,n)))}if(m==-1)throw h=a.substring(0,e).split("\n"),Error("Unexpected close tag\nLine: "+(h.length-1)+"\nColumn: "+(h[h.length-1].length+1)+"\nChar: "+a[e]);e+1&&(e+=1);break}else if(a.charCodeAt(e+1)===33){if(a.charCodeAt(e+2)==45){for(;e!==-1&&(a.charCodeAt(e)!==
62||a.charCodeAt(e-1)!=45||a.charCodeAt(e-2)!=45||e==-1);)e=a.indexOf(">",e+1);e===-1&&(e=a.length)}else if(a.charCodeAt(e+2)===91&&a.charCodeAt(e+8)===91&&a.substr(e+3,5).toLowerCase()==="cdata"){m=a.indexOf("]]\x3e",e);m==-1?(l.push(a.substr(e+9)),e=a.length):(l.push(a.substring(e+9,m)),e=m+3);continue}e++;continue}if(f>512)throw Error("XML is too deeply nested");f++;a:{n=k;e++;var p=d(),u={};for(m=[];a.charCodeAt(e)!==62&&a[e];){var q=a.charCodeAt(e);if(q>64&&q<91||q>96&&q<123){q=d();for(var v=
a.charCodeAt(e);v&&v!==39&&v!==34&&!(v>64&&v<91||v>96&&v<123)&&v!==62;)e++,v=a.charCodeAt(e);var w=e+1;e=a.indexOf(a[e],w);w=(" "+a.slice(w,e)).slice(1);if(v===39||v===34){if(e===-1){n={tagName:p,attributes:u,children:m,parent:null};if(b)for(p=0;p<m.length;p++)typeof m[p]!=="string"&&(m[p].parent=n);m=n;break a}}else w=null,e--;if(q.startsWith("xmlns:")){v=w;var y=q.split(":")[1];ud.set(v,y);vd.set(y,v)}u[q]=w}e++}g.push(u);b:if(q=p,w=q.indexOf(":"),q=w<0?"":q.substring(0,w),q=="xml")q="http://www.w3.org/XML/1998/namespace";
else{w=q?"xmlns:"+q:"xmlns";for(v=g.length-1;v>=0;--v)if(y=g[v][w],y!=null){q=y||(q?null:"");break b}q=q?null:""}if(u["xml:space"]=="preserve"||u["xml:space"]=="default")n=u["xml:space"]=="preserve";a.charCodeAt(e-1)!==47?(e++,m=c(p,n)):e++;g.pop();n={tagName:p,attributes:u,children:m,parent:null};wd.set(n,q);p=m.length;for(u=0;u<p;u++)q=m[u],typeof q!=="string"?b&&(q.parent=n):u==p-1&&q=="\n"&&m.pop();m=n}f--;l.push(m);if(typeof m==="string")break;m.tagName[0]==="?"&&m.children&&(l.push.apply(l,
wa(m.children)),m.children=[])}else m=e,e=a.indexOf("<",e)-1,e===-2&&(e=a.length),m=(" "+a.slice(m,e+1)).slice(1),k?m.length>0&&l.push(m):l.length&&m.length==1&&m[0]=="\n"?l.push(m):m.trim().length>0&&l.push(m),e++;return l}function d(){for(var h=e;"\r\n\t>/= ".indexOf(a[e])===-1&&a[e];)e++;return(" "+a.slice(h,e)).slice(1)}var e=0,f=0,g=[];return c("")}function xd(a){return typeof a==="string"}
function yd(a){var b=[];if(!a.children)return[];a=t(a.children);for(var c=a.next();!c.done;c=a.next())c=c.value,typeof c!=="string"&&b.push(c);return b}function Cd(a){if(typeof a==="string")return Lb(a);var b=[];a=t(a.children);for(var c=a.next();!c.done;c=a.next())c=c.value,typeof c==="string"&&b.push(c);b=b.join("");return b===""?null:Lb(b)}
function Dd(a,b,c){c=c===void 0?[]:c;a.tagName===b&&c.push(a);if(a.children){a=t(a.children);for(var d=a.next();!d.done;d=a.next())Dd(d.value,b,c)}return c}function Ed(a,b,c,d){d=d===void 0?[]:d;Fd(a,b,c)&&d.push(a);a=t(yd(a));for(var e=a.next();!e.done;e=a.next())Ed(e.value,b,c,d);return d}
function Fd(a,b,c){if(typeof a=="string")return!1;var d=a.tagName.indexOf(":");if(a.tagName.substring(d+1)!=c)return!1;c=wd.get(a);if(c===void 0){for(var e=d<0?"xmlns":"xmlns:"+a.tagName.substring(0,d);a;a=a.parent)if(a.attributes[e]!=null){c=a.attributes[e];break}c===void 0&&(c=d<0?"":null);d>=0&&c==""&&(c=null)}return c!=null&&(typeof b=="string"?c==b:b.includes(c))}function Gd(a,b,c){b=td(b);return a.attributes[b+":"+c]||null}
function Hd(a,b){var c=Id;return yd(a).filter(function(d){return Fd(d,c,b)})}function Jd(a,b,c){b=t(b);for(var d=b.next();!d.done;d=b.next())if(d=Gd(a,d.value,c))return d;return null}function Kd(a){if(!a)return null;/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(a)&&(a+="Z");a=Date.parse(a);return isNaN(a)?null:a/1E3}var ud=new Map,vd=new Map,wd=new WeakMap;function Ld(a,b,c){this.startTime=a;this.endTime=b;this.payload=c;this.region=new ad;this.position=null;this.positionAlign=Md;this.size=0;this.textAlign=Nd;this.direction=Od;this.writingMode=Pd;this.lineInterpretation=Qd;this.line=null;this.lineHeight="";this.lineAlign=Rd;this.displayAlign=Sd;this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="";this.fontWeight=Td;this.fontStyle=Ud;this.linePadding=this.letterSpacing=this.fontFamily="";this.opacity=1;this.visibility=this.textCombineUpright=
"";this.textDecoration=[];this.textStrokeWidth=this.textStrokeColor=this.textShadow="";this.wrapLine=!0;this.id="";this.nestedCues=[];this.lineBreak=this.isContainer=!1;this.rubyTag=null;this.cellResolution={columns:32,rows:15}}function Vd(a,b){a=new Ld(a,b,"");a.lineBreak=!0;return a}
Ld.prototype.clone=function(){function a(d){if(d===null||typeof d!=="object")return d;if(Array.isArray(d))return d.map(a);if(d instanceof Ld)return d.clone();if(d instanceof ad)return d.clone();var e={},f;for(f in d)e[f]=a(d[f]);return e}var b=new Ld(0,0,""),c;for(c in this)b[c]=a(this[c]);return b};
function Wd(a,b){if(a.payload!=b.payload||!(Math.abs(a.startTime-b.startTime)<.001&&Math.abs(a.endTime-b.endTime)<.001))return!1;for(var c in a)if(c!="startTime"&&c!="endTime"&&c!="payload")if(c=="nestedCues"){if(!gb(a.nestedCues,b.nestedCues,Wd))return!1}else if(c=="region"||c=="cellResolution")for(var d in a[c]){if(a[c][d]!=b[c][d])return!1}else if(Array.isArray(a[c])){if(!gb(a[c],b[c]))return!1}else if(a[c]!=b[c])return!1;return!0}
function Xd(a,b){b=b===void 0?new Map:b;var c=a.payload;if(c.includes("<")){b.size===0&&Yd(b);var d=c;c=[];for(var e=-1,f=0;f<d.length;f++)d[f]==="<"?e=f+1:d[f]===">"&&e>0&&(e=d.substr(e,f-e),e.match(Zd)&&c.push(e),e=-1);c=t(c);for(f=c.next();!f.done;f=c.next())f=f.value,d=d.replace("<"+f+">",'<div time="'+f+'">'),d+="</div>";a:{f=d;e=[];var g=-1;c="";d=!1;for(var h=0;h<f.length;h++)if(f[h]==="/"){var k=f.indexOf(">",h);if(k===-1){c=f;break a}if((k=f.substring(h+1,k))&&k=="v"){d=!0;var l=null;e.length&&
(l=e[e.length-1]);if(l){if(l===k)c+="/"+k+">";else{if(!l.startsWith("v")){c+=f[h];continue}c+="/"+l+">"}h+=k.length+1}else c+=f[h]}else c+=f[h]}else f[h]==="<"?(g=h+1,f[g]!="v"&&(g=-1)):f[h]===">"&&g>0&&(e.push(f.substr(g,h-g)),g=-1),c+=f[h];f=t(e);for(e=f.next();!e.done;e=f.next())e=e.value,g=e.replace(" ",".voice-"),c=c.replace("<"+e+">","<"+g+">"),c=c.replace("</"+e+">","</"+g+">"),d||(c+="</"+g+">")}c=$d(c);a.payload="";d="<span>"+c.replace(/\n/g,"<br />")+"</span>";try{var m=qd(d,"span")}catch(n){}if(m)if(m=
m.children,m.length!=1||m[0].tagName)for(m=t(m),c=m.next();!c.done;c=m.next())ae(c.value,a,b);else a.payload=Lb(c);else a.payload=Lb(c)}else a.payload=Lb(c)}function Yd(a){for(var b=t(Object.entries(be)),c=b.next();!c.done;c=b.next()){var d=t(c.value);c=d.next().value;d=d.next().value;var e=new Ld(0,0,"");e.color=d;a.set("."+c,e)}b=t(Object.entries(ce));for(c=b.next();!c.done;c=b.next())d=t(c.value),c=d.next().value,d=d.next().value,e=new Ld(0,0,""),e.backgroundColor=d,a.set("."+c,e)}
function $d(a){var b={"< ":""," >":" &gt;"},c=/(< +>|<\s|\s>)/g,d=RegExp(c.source);return a&&d.test(a)?a.replace(c,function(e){return b[e]||""}):a||""}
function ae(a,b,c){var d=b.clone();d.nestedCues=[];d.payload="";d.rubyTag="";d.line=null;d.region=new ad;d.position=null;d.size=0;d.textAlign=Nd;if(a.tagName)for(var e=t(a.tagName.split(/(?=[ .])+/g)),f=e.next();!f.done;f=e.next()){var g=f=f.value;if(g.startsWith(".voice-")){var h=g.split("-").pop();g='v[voice="'+h+'"]';c.has(g)||(g="v[voice="+h+"]")}c.has(g)&&(h=d,g=c.get(g))&&(h.backgroundColor=g.backgroundColor||h.backgroundColor,h.color=g.color||h.color,h.fontFamily=g.fontFamily||h.fontFamily,
h.fontSize=g.fontSize||h.fontSize,h.textShadow=g.textShadow||h.textShadow,h.fontWeight=g.fontWeight,h.fontStyle=g.fontStyle,h.opacity=g.opacity,h.rubyTag=g.rubyTag,h.textCombineUpright=g.textCombineUpright,h.wrapLine=g.wrapLine);switch(f){case "br":d=Vd(d.startTime,d.endTime);b.nestedCues.push(d);return;case "b":d.fontWeight=de;break;case "i":d.fontStyle=ee;break;case "u":d.textDecoration.push(fe);break;case "font":if(f=a.attributes.color)d.color=f;break;case "div":f=a.attributes.time;if(!f)break;
if(f=ld(f))d.startTime=f;break;case "ruby":case "rp":case "rt":d.rubyTag=f}}e=a.children;if(xd(a)||e.length==1&&xd(e[0]))for(c=Cd(a).split("\n"),a=!0,c=t(c),e=c.next();!e.done;e=c.next())e=e.value,a||(a=Vd(d.startTime,d.endTime),b.nestedCues.push(a)),e.length>0&&(a=d.clone(),a.payload=Lb(e),b.nestedCues.push(a)),a=!1;else for(b.nestedCues.push(d),b=t(e),a=b.next();!a.done;a=b.next())ae(a.value,d,c)}K("shaka.text.Cue",Ld);Ld.parseCuePayload=Xd;Ld.equal=Wd;Ld.prototype.clone=Ld.prototype.clone;
var Md="auto";Ld.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:Md};var Nd="center",ge={LEFT:"left",RIGHT:"right",CENTER:Nd,START:"start",END:"end"};Ld.textAlign=ge;var Sd="after",he={BEFORE:"before",CENTER:"center",AFTER:Sd};Ld.displayAlign=he;var Od="ltr";Ld.direction={HORIZONTAL_LEFT_TO_RIGHT:Od,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var Pd="horizontal-tb";Ld.writingMode={HORIZONTAL_TOP_TO_BOTTOM:Pd,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};
var Qd=0;Ld.lineInterpretation={LINE_NUMBER:Qd,PERCENTAGE:1};var Rd="start",ie={CENTER:"center",START:Rd,END:"end"};Ld.lineAlign=ie;var be={white:"white",lime:"lime",cyan:"cyan",red:"red",yellow:"yellow",magenta:"magenta",blue:"blue",black:"black"};Ld.defaultTextColor=be;var ce={bg_white:"white",bg_lime:"lime",bg_cyan:"cyan",bg_red:"red",bg_yellow:"yellow",bg_magenta:"magenta",bg_blue:"blue",bg_black:"black"};Ld.defaultTextBackgroundColor=ce;var Td=400,de=700;Ld.fontWeight={NORMAL:Td,BOLD:de};
var Ud="normal",ee="italic",je={NORMAL:Ud,ITALIC:ee,OBLIQUE:"oblique"};Ld.fontStyle=je;var fe="underline";Ld.textDecoration={UNDERLINE:fe,LINE_THROUGH:"line-through",OVERLINE:"overline"};var Zd=/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;function ke(){}ke.prototype.destroy=function(){};function le(a,b,c){me.set(ne(a)+"-"+c,{priority:c,Ye:b})}function oe(a,b){for(var c=t(pe),d=c.next();!d.done;d=c.next()){a:{var e=a;d=d.value;d=d===void 0?null:d;e=ne(e);d=t(d!==null?[d]:pe);for(var f=d.next();!f.done;f=d.next())if(f=me.get(e+"-"+f.value)){e=f.Ye;break a}e=null}if(e){d=void 0;try{d=e()}catch(g){continue}f=!1;try{f=d.isSupported(a,b)}catch(g){}finally{d.destroy()}if(f)return e}}return null}
function qe(a,b){a=ne(a);for(var c=t(pe),d=c.next();!d.done;d=c.next()){d=d.value;var e=me.get(a+"-"+d);if(e&&e.Ye===b)return d}return null}function ne(a){return a.toLowerCase().split(";")[0]}K("shaka.transmuxer.TransmuxerEngine",ke);ke.findTransmuxer=oe;ke.unregisterTransmuxer=function(a,b){me.delete(ne(a)+"-"+b)};ke.registerTransmuxer=le;ke.prototype.destroy=ke.prototype.destroy;var me=new Map;ke.PluginPriority={FALLBACK:1,PREFERRED_SECONDARY:2,PREFERRED:3,APPLICATION:4};var pe=[4,3,2,1];function re(){}function ve(a,b){var c=a;b&&!we.includes(a)&&(c+='; codecs="'+b+'"');return c}function xe(a,b){b&&(a+='; codecs="'+b+'"');return a}function ye(a,b,c){var d=ve(a,b);b=xe(a,b);oe(b)?(a=oe(b))?(a=a(),c=a.convertCodecs(c,b),a.destroy()):c=b:c=a!="video/mp2t"&&c=="audio"?d.replace("video","audio"):d;return c}function ze(a){return a.split(";")[0].split("/")[1]}
function Ae(a){var b=Be(a);a=b[0].toLowerCase();b=b[1].toLowerCase();switch(!0){case a==="mp4a"&&b==="69":case a==="mp4a"&&b==="6b":case a==="mp4a"&&b==="40.34":return"mp3";case a==="mp4a"&&b==="66":case a==="mp4a"&&b==="67":case a==="mp4a"&&b==="68":case a==="mp4a"&&b==="40.2":case a==="mp4a"&&b==="40.02":case a==="mp4a"&&b==="40.5":case a==="mp4a"&&b==="40.05":case a==="mp4a"&&b==="40.29":case a==="mp4a"&&b==="40.42":return"aac";case a==="mp4a"&&b==="a5":case a==="ac3":case a==="ac-3":return"ac-3";
case a==="mp4a"&&b==="a6":case a==="eac3":case a==="ec-3":return"ec-3";case a==="ac-4":return"ac-4";case a==="mp4a"&&b==="b2":return"dtsx";case a==="mp4a"&&b==="a9":return"dtsc";case a==="vp09":case a==="vp9":return"vp9";case a==="avc1":case a==="avc3":return"avc";case a==="hvc1":case a==="hev1":return"hevc";case a==="vvc1":case a==="vvi1":return"vvc";case a==="dvh1":case a==="dvhe":return b&&b.startsWith("05")?"dovi-p5":"dovi-hevc";case a==="dvav":case a==="dva1":return"dovi-avc";case a==="dav1":return"dovi-av1";
case a==="dvc1":case a==="dvi1":return"dovi-vvc";case a==="lvc1":return"lcevc"}return a}function Ce(a){var b=[];a=t(a.split(","));for(var c=a.next();!c.done;c=a.next())c=Be(c.value),b.push(c[0]);return b.sort().join(",")}function De(a){return a.split(";")[0]}function Ee(a){a=a.split(/ *; */);a.shift();return(a=a.find(function(b){return b.startsWith("codecs=")}))?a.split("=")[1].replace(/^"|"$/g,""):""}
function Fe(a){return a==="application/x-mpegurl"||a==="application/vnd.apple.mpegurl"||a==="audio/x-mpegurl"}function Ge(a,b){var c=ob(),d=a.toLowerCase();return d=="flac"?c.Ea()!="WEBKIT"?"flac":"fLaC":d==="opus"?c.Ea()!="WEBKIT"?"opus":ze(b)=="mp4"?"Opus":"opus":d=="ac-3"&&c.Td()?"ec-3":a}function He(a,b){a=a.split(",").map(function(d){return d.trim()});var c=xc("audio",a);return a.map(function(d){return d==c?Ge(d,b):Ie(d)}).join(",")}
function Ie(a){if(a.includes("avc1")){var b=a.split(".");if(b.length==3)return a=b.shift()+".",a+=parseInt(b.shift(),10).toString(16),a+=("000"+parseInt(b.shift(),10).toString(16)).slice(-4)}else if(a=="vp9")return"vp09.00.41.08";return a}function Be(a){a=a.split(".");var b=a[0];a.shift();return[b,a.join(".")]}K("shaka.util.MimeUtils",re);re.getFullTypeWithAllCodecs=xe;re.getFullType=ve;
(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");var Je="application/cea-608",Ke="application/cea-708",we=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"];function Le(a,b){this.m=null;this.l=a;this.F=b===void 0?"UNKNOWN":b;this.D=this.K=this.I=!1;this.u=new Map;this.j=new Map;this.B=0;this.C=Infinity;this.i=this.h=null;this.H="";this.G=function(){};this.o=new Map}function Me(a,b){Ne.set(a,b)}function Oe(a){return Ne.get(a)}function Pe(a){return Ne.has(a)?!0:a==Je||a==Ke?!!Tc:!1}Le.prototype.destroy=function(){this.l=this.m=null;this.u.clear();this.j.clear();this.o.clear();return Promise.resolve()};
function Qe(a,b,c,d,e,f){f=f===void 0?-1:f;var g,h,k,l,m,n,p,u,q;return H(function(v){if(v.i==1)return a.D||a.u.has(f)?v.h(Promise.resolve(),2):(g=a.j.get(f)||[],g.push({buffer:b,startTime:c,endTime:d,uri:e,pj:f}),a.j.set(f,g),v.return());if(!a.m||!a.l)return v.return();if(c==null||d==null)return a.m.parseInit(yb(b)),v.return();h=a.D?0:a.u.get(f);k=a.I||a.D?c:a.u.get(f);l={periodStart:h,segmentStart:c,segmentEnd:d,vttOffset:k,isMpegTs:a.K};m=a.m.parseMedia(yb(b),l,e,[]);n=t(m);for(p=n.next();!p.done;p=
n.next())u=p.value,a.G(u,e||null,l);q=m.filter(function(w){return w.startTime>=a.B&&w.startTime<a.C});a.l.append(q);a.h==null&&(a.h=Math.max(c,a.B));a.i=Math.min(d,a.C);v.l()})}
Le.prototype.remove=function(a,b,c){c=c===void 0?!1:c;var d=this,e,f,g,h,k,l,m,n;return H(function(p){if(p.i==1)return p.h(Promise.resolve(),2);if(a>=b||c&&(Re(d,a,b),d.H===""))return p.return();e=function(u){return u.startTime<b&&u.endTime>a};f=t(d.j.keys());for(g=f.next();!g.done;g=f.next()){h=g.value;k=d.j.get(h);l=[];for(m=0;m<k.length;m++)n=k[m],e(n)||l.push(n);d.j.set(h,l)}d.l&&d.l.remove(a,b)&&d.h!=null&&(b<=d.h||a>=d.i||(a<=d.h&&b>=d.i?d.h=d.i=null:a<=d.h&&b<d.i?d.h=b:a>d.h&&b>=d.i&&(d.i=
a)),Se(d));p.l()})};function Ue(a,b,c){c=c===void 0?-1:c;(!a.u.has(c)||a.F!=="HLS"||a.F==="HLS"&&c===-1&&a.u.get(c)===0)&&a.u.set(c,b);b=a.j.get(c)||[];for(var d=0;d<b.length;d++){var e=b[d];Qe(a,e.buffer,e.startTime,e.endTime,e.uri,e.pj)}a.j.set(c,[])}function Ve(a,b){a.K=b}function We(a,b,c){a.B=b;a.C=c}function Xe(a,b,c){a.H=b;if(b=a.o.get(b))b=b.filter(function(d){return d.endTime<=c}),b.length&&a.l.append(b)}
function Ye(a,b,c){b.startTime+=c;b.endTime+=c;b=t(b.nestedCues);for(var d=b.next();!d.done;d=b.next())Ye(a,d.value,c)}
function Ze(a,b,c){var d=new Map;b=t(b);for(var e=b.next();!e.done;e=b.next()){var f=e.value;e=f.stream;f=f.cue;d.getOrInsert(e,[]);Ye(a,f,c);f.startTime>=a.B&&f.startTime<a.C&&(d.get(e).push(f),e==a.H&&a.l.append([f]))}c=t(d.keys());for(b=c.next();!b.done;b=c.next())for(e=b.value,b=a.o.getOrInsertComputed(e,function(){return[]}),e=t(d.get(e)),f=e.next();!f.done;f=e.next())b.push(f.value);Se(a)}
function Re(a,b,c){for(var d=t(a.o.keys()),e=d.next();!e.done;e=d.next()){e=e.value;var f=a.o.get(e);f=f.filter(function(g){return g.startTime<b||g.endTime>=c});a.o.set(e,f)}}
function Se(a){for(var b=Infinity,c=-Infinity,d=t(a.o.values()),e=d.next();!e.done;e=d.next()){e=t(e.value);for(var f=e.next();!f.done;f=e.next())f=f.value,b=Math.min(b,f.startTime),c=Math.max(c,f.endTime)}b!==Infinity&&c!==-Infinity&&(a.h=a.h==null?Math.max(b,a.B):Math.min(a.h,Math.max(b,a.B)),a.i=Math.max(a.i,Math.min(c,a.C)))}K("shaka.text.TextEngine",Le);Le.prototype.destroy=Le.prototype.destroy;Le.findParser=Oe;Le.unregisterParser=function(a){Ne.delete(a)};Le.registerParser=Me;var Ne=new Map;function $e(a){this.i=a;this.h=null}$e.prototype.hb=function(){this.stop();this.i();return this};$e.prototype.ha=function(a){var b=this;this.stop();af(this,function(){b.i()},a);return this};$e.prototype.La=function(a){this.stop();bf(this,a);return this};$e.prototype.stop=function(){var a;(a=this.h)==null||a.call(this);this.h=null};function af(a,b,c){var d=!0,e=null;a.h=function(){clearTimeout(e);d=!1};e=setTimeout(function(){d&&b()},c*1E3)}function bf(a,b){af(a,function(){bf(a,b);a.i()},b)}
K("shaka.util.Timer",$e);$e.prototype.stop=$e.prototype.stop;$e.prototype.tickEvery=$e.prototype.La;$e.prototype.tickAfter=$e.prototype.ha;$e.prototype.tickNow=$e.prototype.hb;function cf(a){return a!=null}function df(a,b){return Promise.race([b,new Promise(function(c,d){(new $e(d)).ha(a)})])}function ef(a){return new Promise(function(b){(new $e(b)).ha(a)})};function ff(){}
function gf(a,b,c,d,e){if(e.length){var f=a.textStreams;e=t(e);for(var g=e.next(),h={};!g.done;h={ah:void 0},g=e.next())if(h.ah=g.value,g=f.filter(function(q){return function(v){return v.codecs.startsWith(q.ah)||v.mimeType.startsWith(q.ah)?!0:!1}}(h)),g.length){f=g;break}a.textStreams=f}f=a.variants;if(b.length||c.length)f=hf(f,b,c);if(d.length){b=new hb;f=t(f);for(c=f.next();!c.done;c=f.next())c=c.value,b.push(String(c.video.width||0),c);var k=[];b.forEach(function(q,v){q=0;var w=[];v=t(v);for(var y=
v.next(),x={};!y.done;x={nf:void 0},y=v.next())x.nf=y.value,y=d.filter(function(z){return function(D){return z.nf.decodingInfos[0][D]}}(x)).length,y>q?(q=y,w=[x.nf]):y==q&&w.push(x.nf);k.push.apply(k,wa(w))});f=k}b=new Set;c=t(f);for(e=c.next();!e.done;e=c.next())e=e.value,e.video&&b.add(e.video);if(b.size){var l={vp8:1,avc:1,"dovi-avc":.95,vp9:.9,vp09:.9,hevc:.85,"dovi-hevc":.8,"dovi-p5":.75,av01:.7,"dovi-av1":.65,vvc:.6};e=Array.from(b).sort(function(q,v){return q.bandwidth&&v.bandwidth&&q.bandwidth!=
v.bandwidth?q.bandwidth-v.bandwidth:q.width!=v.width?q.width-v.width:q.codecs&&v.codecs?(q=Ae(q.codecs),v=Ae(v.codecs),(l[q]||1)-(l[v]||1)):0});var m=[];b=new Map;c=function(q){var v=[String(q.width||""),String(q.height||""),String(Math.round(q.frameRate||0)),q.hdr||"",q.fastSwitching];q.dependencyStream&&v.push(q.dependencyStream.baseOriginalId||"");q.roles&&v.push(q.roles.sort().join("_"));return v.join(";")};e=t(e);for(g=e.next();!g.done;g=e.next()){g=g.value;h=c(g);var n=b.get(h)||[];if(n.length){var p=
Ae(n[n.length-1].codecs),u=Ae(g.codecs);p==u&&(n.push(g),m.push(g.id))}else n.push(g),m.push(g.id);b.set(h,n)}a.variants=f.filter(function(q){return(q=q.video)&&!m.includes(q.id)?!1:!0})}else a.variants=f}
function hf(a,b,c){b=t(b);for(var d=b.next(),e={};!d.done;e={Ri:void 0},d=b.next())if(e.Ri=d.value,d=a.filter(function(f){return function(g){return g.video&&g.video.codecs.startsWith(f.Ri)}}(e)),d.length){a=d;break}c=t(c);b=c.next();for(d={};!b.done;d={sh:void 0},b=c.next())if(d.sh=b.value,b=a.filter(function(f){return function(g){return g.audio&&g.audio.codecs.startsWith(f.sh)}}(d)),b.length){a=b;break}return a}
function of(a,b,c){function d(g,h,k){return g>=h&&g<=k}if(a&&a.video&&a.video.width&&a.video.height){var e=a.video.width,f=a.video.height;f>e&&(f=t([f,e]),e=f.next().value,f=f.next().value);if(!d(e,b.minWidth,Math.min(b.maxWidth,c.width))||!d(f,b.minHeight,Math.min(b.maxHeight,c.height))||!d(e*f,b.minPixels,b.maxPixels))return!1}return a&&a.video&&a.video.frameRate&&!d(a.video.frameRate,b.minFrameRate,b.maxFrameRate)||a&&a.audio&&a.audio.channelsCount&&!d(a.audio.channelsCount,b.minChannelsCount,
b.maxChannelsCount)||!d(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!1:!0}function pf(a,b,c,d){c=c===void 0?[]:c;d=d===void 0?{}:d;return H(function(e){if(e.i==1)return e.h(qf(a,b,b.offlineSessionIds.length>0,c,d),2);rf(b);return e.h(sf(b),0)})}
function qf(a,b,c,d,e){var f,g;return H(function(h){if(h.i==1)return ob().Ii()&&tf(b.variants),h.h(uf(b.variants,c,!1,d),2);f=null;a&&(g=a.Sb())&&(f=g.keySystem);b.variants=b.variants.filter(function(k){var l=vf(k,f,e);if(!l){var m=[];k.audio&&m.push(wf(k.audio));k.video&&m.push(wf(k.video))}return l});h.l()})}
function tf(a){var b=(new Map).set("dvav","avc3").set("dva1","avc1").set("dvhe","hev1").set("dvh1","hvc1").set("dvc1","vvc1").set("dvi1","vvi1"),c=new Set;a=t(a);for(var d=a.next();!d.done;d=a.next())d=d.value,d.video&&c.add(d.video);c=t(c);for(a=c.next();!a.done;a=c.next()){a=a.value;d=t(b);for(var e=d.next();!e.done;e=d.next()){var f=t(e.value);e=f.next().value;f=f.next().value;if(a.codecs.includes(e)){a.codecs=a.codecs.replace(e,f);break}}}}
function vf(a,b,c){if(!a.decodingInfos.some(function(k){return!k.supported||b&&(k=k.keySystemAccess)&&(c[k.keySystem]||k.keySystem)!=b?!1:!0}))return!1;var d=ob(),e=d.kb()==="Xbox";d=d.Ka()==="MOBILE"&&d.Ea()==="GECKO";var f=a.video,g=f&&f.width||0,h=f&&f.height||0;if(e&&f&&(g>1920||h>1080)&&(f.codecs.includes("avc1.")||f.codecs.includes("avc3."))||(e=f&&f.dependencyStream)&&!Ec(e))return!1;a=a.audio;return d&&a&&a.encrypted&&a.codecs.toLowerCase().includes("opus")||a&&a.dependencyStream?!1:!0}
function xf(a,b){var c,d,e,f,g,h,k;return H(function(l){if(l.i==1){c=function(m,n){if(m){var p=od(m);p.supported=m.supported&&n.supported;p.powerEfficient=m.powerEfficient&&n.powerEfficient;p.smooth=m.smooth&&n.smooth;n.keySystemAccess&&!p.keySystemAccess&&(p.keySystemAccess=n.keySystemAccess);return p}return n};d=null;e=[];f=t(b);g=f.next();for(h={};!g.done;h={cache:void 0,oe:void 0},g=f.next())k=g.value,h.oe=pd(k),h.cache=yf,h.cache.has(h.oe)?d=c(d,h.cache.get(h.oe)):e.push(zf(k).then(function(m){return function(n){var p=
null;n=t(n||[]);for(var u=n.next();!u.done;u=n.next())p=c(p,u.value);p&&(m.cache.set(m.oe,p),d=c(d,p))}}(h)));return l.h(Promise.all(e),2)}d&&a.decodingInfos.push(d);l.l()})}
function zf(a){var b=[""];a.video&&(b=Ee(a.video.contentType).split(","));var c=[""];a.audio&&(c=Ee(a.audio.contentType).split(","));var d=[];b=t(b);for(var e=b.next();!e.done;e=b.next()){e=e.value;for(var f=t(c),g=f.next(),h={};!g.done;h={vc:void 0},g=f.next())g=g.value,h.vc=nd(a),a.video&&(h.vc.video.contentType=ve(De(h.vc.video.contentType),e)),a.audio&&(h.vc.audio.contentType=ve(De(h.vc.audio.contentType),g)),d.push(new Promise(function(k){return function(l,m){(ob().Ka()=="MOBILE"?df(5,navigator.mediaCapabilities.decodingInfo(k.vc)):
navigator.mediaCapabilities.decodingInfo(k.vc)).then(function(n){l(n)}).catch(m)}}(h)))}return Promise.all(d).catch(function(){JSON.stringify(a);return null})}
function uf(a,b,c,d){var e,f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D,B,A;return H(function(E){switch(E.i){case 1:if(e=a.some(function(C){return C.decodingInfos.length}))return E.return();f=t(d);g=f.next();h={};case 2:if(g.done){E.A(4);break}h.ni=g.value;k=!1;l=t(a);m=l.next();case 5:if(m.done){E.A(7);break}n=m.value;p=Af(n,b,c).filter(function(C){return function(F){F=F[0];F=F.keySystemConfiguration&&F.keySystemConfiguration.keySystem;return!F||F===C.ni}}(h));u=t(p);q=u.next();case 8:if(q.done){E.A(10);break}v=
q.value;return E.h(xf(n,v),9);case 9:q=u.next();E.A(8);break;case 10:n.decodingInfos.some(function(C){return C.supported})&&(k=!0);m=l.next();E.A(5);break;case 7:if(k)return E.return();h={ni:void 0};g=f.next();E.A(2);break;case 4:w=t(a),y=w.next();case 12:if(y.done){E.A(0);break}x=y.value;z=Af(x,b,c).filter(function(C){C=C[0];C=C.keySystemConfiguration&&C.keySystemConfiguration.keySystem;return!C||!d.includes(C)});D=t(z);B=D.next();case 15:if(B.done){y=w.next();E.A(12);break}A=B.value;return E.h(xf(x,
A),16);case 16:B=D.next(),E.A(15)}})}
function Af(a,b,c){var d=a.audio,e=a.video,f=[],g=[];if(e)for(var h=t(e.fullMimeTypes),k=h.next();!k.done;k=h.next()){k=k.value;var l=Ee(k);if(l.includes(",")&&!d){var m=l.split(","),n=De(k);l=wc("video",m);m=wc("audio",m);m=Ge(m,n);n=ye(n,m,"audio");g.push({contentType:n,channels:2,bitrate:a.bandwidth||1,samplerate:1,spatialRendering:!1})}l=Ie(l);k={contentType:ye(De(k),l,"video"),width:e.width||64,height:e.height||64,bitrate:e.bandwidth||a.bandwidth||1,framerate:e.frameRate||30};if(e.hdr)switch(e.hdr){case "PQ":k.transferFunction=
"pq";break;case "HLG":k.transferFunction="hlg"}e.colorGamut&&(k.colorGamut=e.colorGamut);f.push(k)}if(d)for(h=t(d.fullMimeTypes),k=h.next();!k.done;k=h.next())l=k.value,k=De(l),l=Ge(Ee(l),k),k=ye(k,l,"audio"),g.push({contentType:k,channels:d.channelsCount||2,bitrate:d.bandwidth||a.bandwidth||1,samplerate:d.audioSamplingRate||1,spatialRendering:d.spatialAudio});h=[];f.length==0&&f.push(null);g.length==0&&g.push(null);f=t(f);for(k=f.next();!k.done;k=f.next())for(k=k.value,l=t(g),n=l.next();!n.done;n=
l.next())n=n.value,m={type:c?"file":"media-source"},k&&(m.video=k),n&&(m.audio=n),h.push(m);g=(a.video?a.video.drmInfos:[]).concat(a.audio?a.audio.drmInfos:[]);if(!g.length)return[h];a=[];c=new Map;g=t(g);for(f=g.next();!f.done;f=g.next())f=f.value,c.get(f.keySystem)||c.set(f.keySystem,[]),c.get(f.keySystem).push(f);g=b?"required":"optional";b=b?["persistent-license"]:["temporary"];f=t(c.keys());for(k=f.next();!k.done;k=f.next()){k=k.value;n=c.get(k);l=new Map;n=t(n);for(m=n.next();!m.done;m=n.next()){m=
m.value;var p=m.videoRobustness+","+m.audioRobustness;l.get(p)||l.set(p,[]);l.get(p).push(m)}l=t(l.values());for(n=l.next();!n.done;n=l.next()){n=n.value;m=[];p=t(h);for(var u=p.next();!u.done;u=p.next()){u=Object.assign({},u.value);for(var q={keySystem:k,initDataType:"cenc",persistentState:g,distinctiveIdentifier:"optional",sessionTypes:b},v=t(n),w=v.next();!w.done;w=v.next()){w=w.value;if(w.initData&&w.initData.length){for(var y=new Set,x=t(w.initData),z=x.next();!z.done;z=x.next())y.add(z.value.initDataType);
q.initDataType=w.initData[0].initDataType}w.distinctiveIdentifierRequired&&(q.distinctiveIdentifier="required");w.persistentStateRequired&&(q.persistentState="required");w.sessionType&&(q.sessionTypes=[w.sessionType]);d&&(q.audio?(w.encryptionScheme&&(q.audio.encryptionScheme=q.audio.encryptionScheme||w.encryptionScheme),q.audio.robustness=q.audio.robustness||w.audioRobustness):(q.audio={robustness:w.audioRobustness},w.encryptionScheme&&(q.audio.encryptionScheme=w.encryptionScheme)),q.audio.robustness==
""&&delete q.audio.robustness);e&&(q.video?(w.encryptionScheme&&(q.video.encryptionScheme=q.video.encryptionScheme||w.encryptionScheme),q.video.robustness=q.video.robustness||w.videoRobustness):(q.video={robustness:w.videoRobustness},w.encryptionScheme&&(q.video.encryptionScheme=w.encryptionScheme)),q.video.robustness==""&&delete q.video.robustness)}u.keySystemConfiguration=q;m.push(u)}a.push(m)}}return a}
function rf(a){a.textStreams=a.textStreams.filter(function(b){b=ve(b.mimeType,b.codecs);return Pe(b)})}
function sf(a){var b,c,d,e,f,g,h,k;return H(function(l){switch(l.i){case 1:b=[],c=t(a.imageStreams),d=c.next();case 2:if(d.done){l.A(4);break}e=d.value;f=e.mimeType;f=="application/mp4"&&e.codecs=="mjpg"&&(f="image/jpg");if(Bf.has(f)){l.A(5);break}g=Cf.get(f);if(!g){Bf.set(f,!1);l.A(5);break}return l.h(Df(g),7);case 7:h=l.j,Bf.set(f,h);case 5:(k=Bf.get(f))&&b.push(e);d=c.next();l.A(2);break;case 4:a.imageStreams=b,l.l()}})}
function Df(a){return new Promise(function(b){var c=new Image;c.src=a;"decode"in c?c.decode().then(function(){b(!0)}).catch(function(){b(!1)}):c.onload=c.onerror=function(){b(c.height===2)}})}
function Ef(a){var b=a.audio,c=a.video,d=b?b.mimeType:null,e=c?c.mimeType:null,f=b?b.codecs:null,g=c?c.codecs:null,h=b?b.groupId:null,k=[];c&&k.push(c.mimeType);b&&k.push(b.mimeType);k=k[0]||null;var l=[];b&&l.push(b.kind);c&&l.push(c.kind);l=l[0]||null;var m=new Set;if(b)for(var n=t(b.roles),p=n.next();!p.done;p=n.next())m.add(p.value);if(c)for(n=t(c.roles),p=n.next();!p.done;p=n.next())m.add(p.value);a={id:a.id,active:!1,type:"variant",bandwidth:a.bandwidth,language:a.language,label:null,videoLabel:null,
kind:l,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:k,audioMimeType:d,videoMimeType:e,codecs:"",audioCodec:f,videoCodec:g,primary:a.primary,roles:Array.from(m),audioRoles:null,videoRoles:null,audioLanguage:null,videoLanguage:null,forced:!1,videoId:null,audioId:null,audioGroupId:h,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,
originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:null};if(c){a.videoId=c.id;a.originalVideoId=c.originalId;a.width=c.width||null;a.height=c.height||null;a.frameRate=c.frameRate||null;a.pixelAspectRatio=c.pixelAspectRatio||null;a.videoBandwidth=c.bandwidth||null;a.hdr=c.hdr||null;a.colorGamut=c.colorGamut||null;a.videoLayout=c.videoLayout||null;a.videoRoles=c.roles;a.videoLanguage=c.language||null;a.videoLabel=c.label;if(d=c.dependencyStream)a.width=d.width||a.width,
a.height=d.height||a.height,a.videoCodec=d.codecs||a.videoCodec,a.pixelAspectRatio=d.pixelAspectRatio||a.pixelAspectRatio,a.videoBandwidth&&d.bandwidth&&(a.videoBandwidth+=d.bandwidth);if(g.includes(",")){a.channelsCount=c.channelsCount;a.audioSamplingRate=c.audioSamplingRate;a.spatialAudio=c.spatialAudio;a.originalLanguage=c.originalLanguage;a.audioMimeType=e;e=g.split(",");try{a.videoCodec=wc("video",e),a.audioCodec=wc("audio",e)}catch(u){}}}b&&(a.audioId=b.id,a.originalAudioId=b.originalId,a.channelsCount=
b.channelsCount,a.audioSamplingRate=b.audioSamplingRate,a.audioBandwidth=b.bandwidth||null,a.spatialAudio=b.spatialAudio,a.label=b.label,a.audioRoles=b.roles,a.audioLanguage=b.language||null,a.accessibilityPurpose=b.accessibilityPurpose,a.originalLanguage=b.originalLanguage,e=b.dependencyStream)&&(a.audioCodec=e.codecs||a.audioCodec,a.audioBandwidth&&e.bandwidth&&(a.audioBandwidth+=e.bandwidth));c&&!a.videoBandwidth&&(b?a.audioBandwidth&&(a.videoBandwidth=a.bandwidth-a.audioBandwidth):a.videoBandwidth=
a.bandwidth);b&&!a.audioBandwidth&&(c?a.videoBandwidth&&(a.audioBandwidth=a.bandwidth-a.videoBandwidth):a.audioBandwidth=a.bandwidth);b=[];a.videoCodec&&b.push(a.videoCodec);a.audioCodec&&b.push(a.audioCodec);a.codecs=b.join(", ");return a}
function Ff(a){return{id:a.id,active:!1,type:zc,bandwidth:a.bandwidth||0,language:a.language,label:a.label,kind:a.kind||null,mimeType:a.mimeType,codecs:a.codecs||null,primary:a.primary,roles:a.roles,accessibilityPurpose:a.accessibilityPurpose,forced:a.forced,originalTextId:a.originalId,originalLanguage:a.originalLanguage}}
function Gf(a){var b=a.width||null,c=a.height||null,d=null;a.segmentIndex&&(d=Hf(a.segmentIndex));var e=a.tilesLayout;d&&(e=d.tilesLayout||e);e&&b!=null&&(b/=Number(e.split("x")[0]));e&&c!=null&&(c/=Number(e.split("x")[1]));return{id:a.id,type:"image",bandwidth:a.bandwidth||0,width:b,height:c,mimeType:a.mimeType,codecs:a.codecs||null,tilesLayout:e||null,originalImageId:a.originalId}}function If(a){return{id:a.id,type:"chapter",bandwidth:a.bandwidth||0,language:a.language}}
function Jf(a){a.__shaka_id==void 0&&(a.__shaka_id=Kf++);return a.__shaka_id}function Lf(a,b){b=b===void 0?!1:b;b={id:Jf(a),active:b&&a.mode!="disabled",type:zc,bandwidth:0,language:mc(a.language||"und"),label:a.label,kind:a.kind,mimeType:null,codecs:null,primary:!1,roles:[],accessibilityPurpose:null,forced:a.kind=="forced",originalTextId:a.id,originalLanguage:a.language};a.kind=="captions"&&(b.mimeType="unknown");a.kind=="subtitles"&&(b.mimeType="text/vtt");a.kind&&(b.roles=[a.kind]);return b}
function Mf(a,b){var c=a?a.language:null;c={id:Jf(a||b),active:a?a.enabled:b.selected,type:"variant",bandwidth:0,language:mc(c||"und"),label:a?a.label:null,videoLabel:null,kind:a?a.kind:null,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:null,audioMimeType:null,videoMimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:a?a.kind=="main":!1,roles:[],forced:!1,audioRoles:null,videoRoles:null,audioLanguage:a?mc(a.language||"und"):
null,videoLanguage:b?mc(b.language||"und"):null,videoId:null,audioId:null,audioGroupId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:b?b.id:null,originalAudioId:a?a.id:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:c};a&&a.kind&&(c.roles=[a.kind],c.audioRoles=[a.kind]);a&&a.configuration&&(a.configuration.codec&&(c.audioCodec=a.configuration.codec,c.codecs=c.audioCodec),
a.configuration.bitrate&&(c.audioBandwidth=a.configuration.bitrate,c.bandwidth+=c.audioBandwidth),a.configuration.sampleRate&&(c.audioSamplingRate=a.configuration.sampleRate),a.configuration.numberOfChannels&&(c.channelsCount=a.configuration.numberOfChannels));if(b&&b.configuration&&(b.configuration.codec&&(c.videoCodec=b.configuration.codec,c.codecs=c.codecs?c.codecs+(","+c.videoCodec):c.videoCodec),b.configuration.bitrate&&(c.videoBandwidth=b.configuration.bitrate,c.bandwidth+=c.videoBandwidth),
b.configuration.framerate&&(c.frameRate=b.configuration.framerate),b.configuration.width&&(c.width=b.configuration.width),b.configuration.height&&(c.height=b.configuration.height),b.configuration.colorSpace&&b.configuration.colorSpace.transfer))switch(b.configuration.colorSpace.transfer){case "pq":c.hdr="PQ";break;case "hlg":c.hdr="HLG";break;case "bt709":c.hdr="SDR"}return c}function Nf(a){return a.allowedByApplication&&a.allowedByKeySystem&&a.disabledUntilTime==0}
function Of(a){return a.filter(function(b){return Nf(b)})}
function Pf(a,b,c,d){if(!b)return[];var e=a,f=a.filter(function(k){return k.primary});f.length&&(e=f);var g=e.length?e[0].language:"";e=e.filter(function(k){return k.language==g});if(b){var h=tc(mc(b),a.map(function(k){return k.language}));if(h)e=a.filter(function(k){return mc(k.language)==h});else return[]}e=e.filter(function(k){return k.forced==d});if(c)return Qf(e,c);a=e.filter(function(k){return k.roles.length==0});if(a.length)return a;a=e.map(function(k){return k.roles}).reduce(function(k,l){return k.concat(l)},
[]);return a.length?Qf(e,a[0]):e}function Rf(a,b){b=t(b);for(var c=b.next();!c.done;c=b.next())if(c=c.value,c.language&&(c=Pf(a,c.language,c.role||"",c.forced||!1),c.length))return c;return[]}function Qf(a,b){return a.filter(function(c){return c.roles.includes(b)})}function Sf(a){var b=[];a.audio&&b.push(a.audio);a.video&&b.push(a.video);return b}
function Tf(a,b){b.length&&(b=b.filter(function(c){return Ae(a.codecs)==Ae(c.codecs)}).sort(function(c,d){return c.bandwidth&&d.bandwidth&&c.bandwidth!=d.bandwidth?c.bandwidth-d.bandwidth:(c.width||0)-(d.width||0)}),a.trickModeVideo=b[0],b.length>1&&(b=b.find(function(c){return a.width==c.width&&a.height==c.height})))&&(a.trickModeVideo=b)}
function wf(a){return a.type=="audio"?"type=audio codecs="+a.codecs+" bandwidth="+a.bandwidth+" channelsCount="+a.channelsCount+" audioSamplingRate="+a.audioSamplingRate:a.type=="video"?"type=video codecs="+a.codecs+" bandwidth="+a.bandwidth+" frameRate="+a.frameRate+" width="+a.width+" height="+a.height:"unexpected stream type"}
function Uf(a){var b={id:0,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:"",codecs:"",supplementalCodecs:"",encrypted:!1,drmInfos:[],keyIds:new Set,language:"",originalLanguage:null,label:null,type:"",primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],accessibilityPurpose:null,forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,external:!1,fastSwitching:!1,fullMimeTypes:new Set,
isAudioMuxedInVideo:!1,baseOriginalId:null,isIframe:!1,preselection:null};Object.assign(b,a);b.mimeType&&b.fullMimeTypes.add(ve(b.mimeType,b.codecs));return b}
function Vf(a){var b={id:0,language:"und",disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]};a=t(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=Uf({mimeType:c?De(c):"",codecs:c?Ee(c):"",encrypted:!0,language:"und",type:"video"});c.startsWith("audio/")?(d.type="audio",b.audio=d):b.video=d}return b}K("shaka.util.StreamUtils",ff);ff.meetsRestrictions=of;
var yf=new Map,Kf=0,Bf=(new Map).set("image/svg+xml",!0).set("image/png",!0).set("image/jpeg",!0).set("image/jpg",!0),Cf=(new Map).set("image/webp","data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA").set("image/avif","data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=");function Wf(){var a=this;this.M=this.H=null;this.u=!1;this.B=new Ta;this.j=new ib;navigator.connection&&navigator.connection.addEventListener&&this.j.J(navigator.connection,"change",function(){a.h.useNetworkInformation&&navigator.onLine&&(a.B=new Ta,a.h&&a.B.configure(a.h.advanced),a.trySuggestStreams())});this.o=[];this.I=1;this.O=!1;this.m=this.i=this.h=this.C=null;this.D=new $e(function(){if(a.u&&(a.h.restrictToElementSize||a.h.restrictToScreenSize)){var b=a.chooseVariant();b&&a.H&&a.H(b,a.h.clearBufferSwitch,
a.h.safeMarginSwitch)}});this.F=window;"documentPictureInPicture"in window&&this.j.J(window.documentPictureInPicture,"enter",function(){a.F=window.documentPictureInPicture.window;a.D&&a.D.hb();a.j.Ra(a.F,"pagehide",function(){a.F=window;a.D&&a.D.hb()})});this.N=this.G=this.l=null;this.L=this.K=0}r=Wf.prototype;r.stop=function(){this.H=null;this.u=!1;this.o=[];this.I=1;this.i=this.C=null;var a;(a=this.m)==null||a.disconnect();this.m=null;var b;(b=this.D)==null||b.stop();this.G=this.l=null;Xf(this)};
r.release=function(){this.stop();this.j.release();this.D=null};r.init=function(a,b){this.H=a;this.M=b};
r.chooseVariant=function(a){a=a===void 0?!1:a;var b=Infinity,c=Infinity;this.h.restrictToScreenSize&&(c=this.h.ignoreDevicePixelRatio?1:this.F.devicePixelRatio,b=this.F.screen.height*c,c*=this.F.screen.width);if(this.m&&this.h.restrictToElementSize){var d=this.h.ignoreDevicePixelRatio?1:this.F.devicePixelRatio,e=this.i.clientHeight,f=this.i.clientWidth;this.l&&document.pictureInPictureElement&&document.pictureInPictureElement==this.i&&(e=this.l.height,f=this.l.width);b=Math.min(b,e*d);c=Math.min(c,
f*d)}e=this.o.filter(function(l){return l&&!(l.audio&&l.audio.fastSwitching||l.video&&l.video.fastSwitching)});e.length||(e=this.o);d=e;a&&e.length!=this.o.length&&(d=this.o.filter(function(l){return l&&(l.audio&&l.audio.fastSwitching||l.video&&l.video.fastSwitching?!0:!1)}));a=Yf(this,this.h.restrictions,d,Infinity,Infinity);if(b!=Infinity||c!=Infinity){a=Zf(a);a=t(a);for(e=a.next();!e.done;e=a.next())if(e=e.value,e.height>=b&&e.width>=c){b=e.height;c=e.width;break}a=Yf(this,this.h.restrictions,
d,b,c)}b=this.getBandwidthEstimate();d.length&&!a.length&&(a=Yf(this,null,d,Infinity,Infinity),a=[a[0]]);c=a[0]||null;for(d=0;d<a.length;d++){e=a[d];var g=isNaN(this.I)?1:Math.abs(this.I);f=g*e.bandwidth/this.h.bandwidthDowngradeTarget;for(var h={bandwidth:Infinity},k=d+1;k<a.length;k++)if(e.bandwidth!=a[k].bandwidth){h=a[k];break}g=g*h.bandwidth/this.h.bandwidthUpgradeTarget;c&&e&&b>=f&&b<=g&&(c.bandwidth!=e.bandwidth||c.bandwidth==e.bandwidth&&c.video&&e.video&&(c.video.width<e.video.width||c.video.height<
e.video.height))&&(c=e)}this.C=Date.now();return c};r.enable=function(){this.u=!0;$f(this);this.o.length&&this.trySuggestStreams()};r.disable=function(){this.u=!1};r.segmentDownloaded=function(a,b,c){a>=this.h.cacheLoadThreshold&&this.B.sample(a,b);c&&this.C!=null&&this.u&&ag(this)};r.trySuggestStreams=function(){this.u&&(this.C=Date.now(),ag(this,!0))};
r.getBandwidthEstimate=function(){var a=this.h.defaultBandwidthEstimate;navigator.connection&&navigator.connection.downlink&&this.h.useNetworkInformation&&(a=navigator.connection.downlink*1E6);if(navigator.connection&&navigator.connection.downlink&&this.h.useNetworkInformation&&this.h.preferNetworkInformationBandwidth)return a;a=this.B.getBandwidthEstimate(a);return this.G?this.G.getBandwidthEstimate(a):a};r.setVariants=function(a){if(eb(a,this.o))return!1;this.o=a;return!0};
r.playbackRateChanged=function(a){this.I=a};r.setMediaElement=function(a){function b(){c.D.ha(bg)}var c=this;this.i=a;this.m&&(this.m.disconnect(),this.m=null);this.i&&"ResizeObserver"in window&&(this.m=new ResizeObserver(b),this.m.observe(this.i));this.j.J(a,"enterpictureinpicture",function(d){d.pictureInPictureWindow&&(c.l=d.pictureInPictureWindow,c.j.J(c.l,"resize",b))});this.j.J(a,"leavepictureinpicture",function(){c.l&&c.j.pb(c.l,"resize",b);c.l=null});dg(this)};
r.setCmsdManager=function(a){this.G=a};r.configure=function(a){this.h=a;this.B&&this.h&&this.B.configure(this.h.advanced);dg(this)};function ag(a,b){if(b===void 0||!b){if(!a.O){b=a.B;if(!(b.h>=b.j))return;a.O=!0;a.C-=(a.h.switchInterval-a.h.minTimeToSwitch)*1E3}if(Date.now()-a.C<a.h.switchInterval*1E3)return}b=a.chooseVariant();a.getBandwidthEstimate();b&&a.H&&(a.H(b,a.h.clearBufferSwitch,a.h.safeMarginSwitch),$f(a))}
function Yf(a,b,c,d,e){if(a.G){var f=a.G.Kh();f&&(c=c.filter(function(g){return g.bandwidth&&f?g.bandwidth<=f:!0}))}b&&(c=c.filter(function(g){return of(g,b,{width:e,height:d})}));return c.sort(function(g,h){return g.bandwidth-h.bandwidth})}function Zf(a){var b=[];a=t(a);for(var c=a.next();!c.done;c=a.next())(c=c.value)&&(c=c.video)&&c.height&&c.width&&b.push({height:c.height,width:c.width});return b.sort(function(d,e){return d.width-e.width})}
function dg(a){Xf(a);var b=a.i;a.h.droppedFrames&&b!=null&&b.getVideoPlaybackQuality&&($f(a),eg(a),a.N=(new $e(function(){if(!a.i.paused&&a.u&&a.h.droppedFrames){var c=a.i.getVideoPlaybackQuality(),d=c.droppedVideoFrames;c=c.totalVideoFrames;if((isNaN(a.I)?1:Math.abs(a.I))>1||!c)a.K=d,a.L=c;else{var e=d-a.K,f=c-a.L;a.K=d;a.L=c;e/f>=a.h.advanced.droppedFramesThreshold&&a.M&&a.M("video",a.h.advanced.droppedFramesBanDuration)}}})).La(a.h.advanced.droppedFramesInterval))}
function Xf(a){a.j.pb(a.i,"resize");var b;(b=a.N)==null||b.stop();a.N=null}function $f(a){var b=a.i;a.h.droppedFrames&&(b==null?0:b.getVideoPlaybackQuality)&&(b=b.getVideoPlaybackQuality(),a.K=b.droppedVideoFrames,a.L=b.totalVideoFrames)}function eg(a){a.j.J(a.i,"resize",function(){$f(a)})}K("shaka.abr.SimpleAbrManager",Wf);Wf.prototype.configure=Wf.prototype.configure;Wf.prototype.setCmsdManager=Wf.prototype.setCmsdManager;Wf.prototype.setMediaElement=Wf.prototype.setMediaElement;
Wf.prototype.playbackRateChanged=Wf.prototype.playbackRateChanged;Wf.prototype.setVariants=Wf.prototype.setVariants;Wf.prototype.getBandwidthEstimate=Wf.prototype.getBandwidthEstimate;Wf.prototype.trySuggestStreams=Wf.prototype.trySuggestStreams;Wf.prototype.segmentDownloaded=Wf.prototype.segmentDownloaded;Wf.prototype.disable=Wf.prototype.disable;Wf.prototype.enable=Wf.prototype.enable;Wf.prototype.chooseVariant=Wf.prototype.chooseVariant;Wf.prototype.init=Wf.prototype.init;
Wf.prototype.release=Wf.prototype.release;Wf.prototype.stop=Wf.prototype.stop;var bg=1;function fg(a,b,c,d,e,f){f=f===void 0?!1:f;if(d>=e)return null;for(var g=-1,h=-1,k=0;k<c.length;k++)c[k].some(function(E){return E!=null&&E.h.trim()!=""})&&(g===-1&&(g=k),h=k);if(g===-1||h===-1)return null;for(var l=k=!1,m="white",n="black",p=d,u=gg(d,e,k,l,m,n);g<=h;g++){for(var q=c[g],v=-1,w=-1,y=0;y<q.length;y++)q[y]!=null&&q[y].h.trim()!==""&&(v===-1&&(v=y),w=y);if(v===-1||w===-1)q=hg(d,e),a.nestedCues.push(q);else{for(;v<=w;v++)if(y=q[v]){var x=y.m,z=y.j,D=y.l,B=y.i,A=y.o;A=f&&A!=null&&A>d?A:
d;if(x!=k||z!=l||D!=m||B!=n||A!=p)u.payload&&a.nestedCues.push(u),u=gg(A,e,x,z,D,B),k=x,l=z,m=D,n=B,p=A;u.payload+=y.h}else u.payload+=" ";u.payload&&a.nestedCues.push(u);g!==h&&(p=hg(d,e),a.nestedCues.push(p));p=d;u=gg(d,e,k,l,m,n)}}return a.nestedCues.length?{cue:a,stream:b}:null}function gg(a,b,c,d,e,f){a=new Ld(a,b,"");c&&a.textDecoration.push(fe);d&&(a.fontStyle=ee);a.color=e;a.backgroundColor=f;return a}function hg(a,b){a=new Ld(a,b,"");a.lineBreak=!0;return a}
function ig(a,b){switch(a){case jg:return b==6;case kg:return b==39||b==40;case lg:return b==23||b==24;default:return!1}}var jg=0,kg=1,lg=2;function mg(a,b,c,d,e,f){this.h=a;this.m=b;this.j=c;this.i=d;this.l=e;this.o=f===void 0?null:f};function ng(a,b){this.j=[];this.h=1;this.i=0;this.F=a;this.D=b;this.m=this.u=!1;this.o="white";this.C="black";this.B=this.l=null;og(this)}function pg(a,b,c,d){d=d===void 0?!1:d;var e="CC"+((a.F<<1|a.D)+1),f=new Ld(b,c,"");f.lineInterpretation=1;var g=a.j.findIndex(function(h){return h.some(function(k){return k.h.trim()!=""})});if(g=qg.get(g))f.line=g;a.B!=null&&a.l!=null&&(f.position=10+Math.min(70,a.B*10)+a.l*2.5);return fg(f,e,a.j,b,c,d)}function og(a){rg(a,0,15);a.h=1;a.l=null;a.B=null}
function sg(a,b,c,d){d=d===void 0?null:d;if(!(c<32||c>127)){var e="";switch(b){case 0:e=tg.has(c)?tg.get(c):String.fromCharCode(c);break;case 1:e=ug.get(c);break;case 2:a.j[a.h].pop();e=vg.get(c);break;case 3:a.j[a.h].pop(),e=wg.get(c)}e&&a.j[a.h].push(new mg(e,a.u,a.m,a.C,a.o,d))}}function xg(a,b,c,d){if(!(c<0||b<0))if(b>=c)for(--d;d>=0;d--)a.j[b+d]=a.j[c+d].map(function(f){return f});else for(var e=0;e<d;e++)a.j[b+e]=a.j[c+e].map(function(f){return f})}
function rg(a,b,c){for(var d=0;d<=c;d++)a.j[b+d]=[]}
var tg=new Map([[39,"\u2019"],[42,"\u00e1"],[92,"\u00e9"],[94,"\u00ed"],[95,"\u00f3"],[96,"\u00fa"],[123,"\u00e7"],[124,"\u00f7"],[125,"\u00d1"],[126,"\u00f1"],[127,"\u2588"]]),ug=new Map([[48,"\u00ae"],[49,"\u00b0"],[50,"\u00bd"],[51,"\u00bf"],[52,"\u2122"],[53,"\u00a2"],[54,"\u00a3"],[55,"\u266a"],[56,"\u00e0"],[57," "],[58,"\u00e8"],[59,"\u00e2"],[60,"\u00ea"],[61,"\u00ee"],[62,"\u00f4"],[63,"\u00fb"]]),vg=new Map([[32,"\u00c1"],[33,"\u00c9"],[34,"\u00d3"],[35,"\u00da"],[36,"\u00dc"],[37,"\u00fc"],
[38,"\u2018"],[39,"\u00a1"],[40,"*"],[41,"'"],[42,"\u2500"],[43,"\u00a9"],[44,"\u2120"],[45,"\u00b7"],[46,"\u201c"],[47,"\u201d"],[48,"\u00c0"],[49,"\u00c2"],[50,"\u00c7"],[51,"\u00c8"],[52,"\u00ca"],[53,"\u00cb"],[54,"\u00eb"],[55,"\u00ce"],[56,"\u00cf"],[57,"\u00ef"],[58,"\u00d4"],[59,"\u00d9"],[60,"\u00f9"],[61,"\u00db"],[62,"\u00ab"],[63,"\u00bb"]]),wg=new Map([[32,"\u00c3"],[33,"\u00e3"],[34,"\u00cd"],[35,"\u00cc"],[36,"\u00ec"],[37,"\u00d2"],[38,"\u00f2"],[39,"\u00d5"],[40,"\u00f5"],[41,"{"],
[42,"}"],[43,"\\"],[44,"^"],[45,"_"],[46,"|"],[47,"~"],[48,"\u00c4"],[49,"\u00e4"],[50,"\u00d6"],[51,"\u00f6"],[52,"\u00df"],[53,"\u00a5"],[54,"\u00a4"],[55,"\u2502"],[56,"\u00c5"],[57,"\u00e5"],[58,"\u00d8"],[59,"\u00f8"],[60,"\u250c"],[61,"\u2510"],[62,"\u2514"],[63,"\u2518"]]),qg=new Map([[1,10],[2,15.33],[3,20.66],[4,26],[5,31.33],[6,36.66],[7,42],[8,47.33],[9,52.66],[10,58],[11,63.33],[12,68.66],[13,74],[14,79.33],[15,84.66]]);function yg(a,b){this.i=0;this.u=new ng(a,b);this.j=new ng(a,b);this.h=this.l=new ng(a,b);this.m=0;this.o=null}function zg(a,b,c){a.h=a.j;var d=a.h,e=null;a.i!==3&&a.i!==4&&(e=pg(d,a.m,c,a.i===2),c=a.j,c.h=c.i>0?c.i:0,rg(c,0,15),c=a.l,c.h=c.i>0?c.i:0,rg(c,0,15),d.h=15);a.i=3;d.i=b;return e}function Ag(a){a.i=1;a.h=a.l;a.h.i=0}function Bg(a){Xa("Cea608DataChannel","CEA-608 text mode entered, but is unsupported");a.h=a.u;a.i=4}var Cg="black green blue cyan red yellow magenta black".split(" "),Dg="white green blue cyan red yellow magenta white_italics".split(" ");function Eg(a,b){this.K=b;this.N=a;this.L=this.m=!1;this.o=this.u=this.H=this.M=this.I=0;this.G=2;this.j=[];this.h=this.i=this.l=0;this.F=this.C=!1;this.D="white";this.B="black";Fg(this)}function Fg(a){a.j=[];for(var b=0;b<16;b++)a.j.push(Gg())}function Gg(){for(var a=[],b=0;b<42;b++)a.push(null);return a}function Hg(a,b){Ig(a)&&(a.j[a.i][a.h]=new mg(b,a.F,a.C,a.B,a.D),a.h++)}function Ig(a){var b=a.h<a.o&&a.h>=0;return a.i<a.u&&a.i>=0&&b}Eg.prototype.isVisible=function(){return this.m};
function Jg(a,b,c){var d=new Ld(a.l,b,"");d.textAlign=a.G===0?"left":a.G===1?"right":Nd;var e=d.region;a.K&&(e.id+="svc"+a.K);e.id+="win"+a.N;e.height=a.u;e.width=a.o;e.heightUnits=2;e.widthUnits=2;e.viewportAnchorX=a.I;e.viewportAnchorY=a.M;e.viewportAnchorUnits=a.L?bd:2;switch(a.H){case 0:e.regionAnchorX=0;e.regionAnchorY=0;break;case 1:e.regionAnchorX=50;e.regionAnchorY=0;break;case 2:e.regionAnchorX=100;e.regionAnchorY=0;break;case 3:e.regionAnchorX=0;e.regionAnchorY=50;break;case 4:e.regionAnchorX=
50;e.regionAnchorY=50;break;case 5:e.regionAnchorX=100;e.regionAnchorY=50;break;case 6:e.regionAnchorX=0;e.regionAnchorY=100;break;case 7:e.regionAnchorX=50;e.regionAnchorY=100;break;case 8:e.regionAnchorX=100,e.regionAnchorY=100}if(c=fg(d,"svc"+c,a.j,a.l,b))a.l=b;return c}Eg.prototype.display=function(){this.m=!0};function Kg(){this.j=[];this.i=null;this.h=0}function Lg(a,b){b.type===3?(a.h=(b.value&63)*2-1,a.i=[]):a.i&&(a.h>0&&(a.i.push(b),a.h--),a.h===0&&(a.j.push(new Og(a.i)),a.i=null,a.h=0))}function Og(a){this.h=0;this.i=a}Og.prototype.Wa=function(){return this.h<this.i.length};Og.prototype.Ia=function(){return this.h};function Pg(a){if(!a.Wa())throw new L(2,2,3E3);return a.i[a.h++]}Og.prototype.skip=function(a){if(this.h+a>this.i.length)throw new L(2,2,3E3);this.h+=a};
Og.prototype.ui=function(a){if(this.h-a<0)throw new L(2,2,3E3);this.h-=a};function Qg(a){this.j=a;this.i=[null,null,null,null,null,null,null,null];this.h=null}
function Rg(a,b){var c=Pg(b),d=c.value;c=c.pts;if(d===16){var e=Pg(b);d=d<<16|e.value}if(d>=0&&d<=31){e=d;if(e==24)c=Pg(b).value,b=Pg(b).value,a.h&&Hg(a.h,String.fromCharCode(c<<8|b)),a=[];else if(a.h){b=a.h;d=null;switch(e){case 8:!Ig(b)||b.h<=0&&b.i<=0||(b.h<=0?(b.h=b.o-1,b.i--):b.h--,b.j[b.i][b.h]=null);break;case 13:b.isVisible()&&(d=Jg(b,c,a.j));if(b.i+1>=b.u){a=0;for(c=1;c<16;c++,a++)b.j[a]=b.j[c];for(c=0;c<1;c++,a++)b.j[a]=Gg()}else b.i++;b.h=0;break;case 14:b.isVisible()&&(d=Jg(b,c,a.j));
b.j[b.i]=Gg();b.h=0;break;case 12:b.isVisible()&&(d=Jg(b,c,a.j)),Fg(b),b.i=0,b.h=0}a=d?[d]:[]}else a=[];return a}if(d>=128&&d<=159)return Sg(a,b,d,c);d>=4096&&d<=4127?(a=d&255,a>=8&&a<=15?b.skip(1):a>=16&&a<=23?b.skip(2):a>=24&&a<=31&&b.skip(3)):d>=4224&&d<=4255?(a=d&255,a>=128&&a<=135?b.skip(4):a>=136&&a<=143&&b.skip(5)):d>=32&&d<=127?(b=d,a.h&&(b===127?Hg(a.h,"\u266a"):Hg(a.h,String.fromCharCode(b)))):d>=160&&d<=255?a.h&&Hg(a.h,String.fromCharCode(d)):d>=4128&&d<=4223?(b=d&255,a.h&&(Tg.has(b)?(b=
Tg.get(b),Hg(a.h,b)):Hg(a.h,"_"))):d>=4256&&d<=4351&&a.h&&((d&255)!=160?Hg(a.h,"_"):Hg(a.h,"[CC]"));return[]}
function Sg(a,b,c,d){if(c>=128&&c<=135)d=c&7,a.i[d]&&(a.h=a.i[d]);else{if(c===136){c=Pg(b).value;b=[];c=t(Ug(a,c));for(var e=c.next();!e.done;e=c.next()){e=a.i[e.value];if(e.isVisible()){var f=Jg(e,d,a.j);f&&b.push(f)}Fg(e)}return b}if(c===137)for(b=Pg(b).value,b=t(Ug(a,b)),c=b.next();!c.done;c=b.next())c=a.i[c.value],c.isVisible()||(c.l=d),c.display();else{if(c===138){c=Pg(b).value;b=null;c=t(Ug(a,c));for(e=c.next();!e.done;e=c.next())e=a.i[e.value],e.isVisible()&&(b=Jg(e,d,a.j)),e.m=!1;return b?
[b]:[]}if(c===139){c=Pg(b).value;b=null;c=t(Ug(a,c));for(e=c.next();!e.done;e=c.next())e=a.i[e.value],e.isVisible()?b=Jg(e,d,a.j):e.l=d,e.m=!e.m;return b?[b]:[]}if(c===140)return b=Pg(b).value,Vg(a,b,d);if(c===143)return d=Vg(a,255,d),Wg(a),d;if(c===144)b.skip(1),d=Pg(b).value,a.h&&(a.h.C=(d&128)>0,a.h.F=(d&64)>0);else if(c===145)d=Pg(b).value,c=Pg(b).value,b.skip(1),a.h&&(b=Xg((c&48)>>4,(c&12)>>2,c&3,c>>6),a.h.D=Xg((d&48)>>4,(d&12)>>2,d&3,d>>6),a.h.B=b);else if(c===146)d=Pg(b).value,b=Pg(b).value,
a.h&&(a=a.h,a.i=d&15,a.h=b&63);else if(c===151)b.skip(1),b.skip(1),d=Pg(b).value,b.skip(1),a.h&&(a.h.G=d&3);else if(c>=152&&c<=159){c=(c&15)-8;e=a.i[c]!==null;e||(f=new Eg(c,a.j),f.l=d,a.i[c]=f);d=Pg(b).value;f=Pg(b).value;var g=Pg(b).value,h=Pg(b).value,k=Pg(b).value;b=Pg(b).value;e&&(b&7)===0||(b=a.i[c],b.i=0,b.h=0,b.F=!1,b.C=!1,b.D="white",b.B="black");b=a.i[c];b.m=(d&32)>0;b.M=f&127;b.I=g;b.H=(h&240)>>4;b.L=(f&128)>0;b.u=(h&15)+1;b.o=(k&63)+1;a.h=a.i[c]}}}return[]}
function Ug(a,b){for(var c=[],d=0;d<8;d++)(b&1)===1&&a.i[d]&&c.push(d),b>>=1;return c}function Vg(a,b,c){var d=[];b=t(Ug(a,b));for(var e=b.next();!e.done;e=b.next()){e=e.value;var f=a.i[e];f.isVisible()&&(f=Jg(f,c,a.j))&&d.push(f);a.i[e]=null}return d}function Wg(a){a.h=null;a.i=[null,null,null,null,null,null,null,null]}function Xg(a,b,c,d){d=d===void 0?0:d;return d===3?"rgba(0, 0, 0, 0)":d===2?"rgba("+(a>>1)*255+", "+(b>>1)*255+", "+((c>>1)*255+", 0.5)"):Yg[a>>1<<2|b>>1<<1|c>>1]}
var Tg=new Map([[32," "],[33,"\u00a0"],[37,"\u2026"],[42,"\u0160"],[44,"\u0152"],[48,"\u2588"],[49,"\u2018"],[50,"\u2019"],[51,"\u201c"],[52,"\u201d"],[53,"\u2022"],[57,"\u2122"],[58,"\u0161"],[60,"\u0153"],[61,"\u2120"],[63,"\u0178"],[118,"\u215b"],[119,"\u215c"],[120,"\u215d"],[121,"\u215e"],[122,"\u2502"],[123,"\u2510"],[124,"\u2514"],[125,"\u2500"],[126,"\u2518"],[127,"\u250c"]]),Yg="black blue green cyan red magenta yellow white".split(" ");function Zg(a,b){this.i=Bb(a);this.j=b==$g;this.h=0}r=Zg.prototype;r.Wa=function(){return this.h<this.i.byteLength};r.Ia=function(){return this.h};r.Na=function(){return this.i.byteLength};r.X=function(){try{var a=this.i.getUint8(this.h);this.h+=1;return a}catch(b){throw ah();}};r.xa=function(){try{var a=this.i.getUint16(this.h,this.j);this.h+=2;return a}catch(b){throw ah();}};r.R=function(){try{var a=this.i.getUint32(this.h,this.j);this.h+=4;return a}catch(b){throw ah();}};
r.Gg=function(){try{var a=this.i.getInt32(this.h,this.j);this.h+=4;return a}catch(b){throw ah();}};r.Ze=function(){try{if(this.j){var a=this.i.getUint32(this.h,!0);var b=this.i.getUint32(this.h+4,!0)}else b=this.i.getUint32(this.h,!1),a=this.i.getUint32(this.h+4,!1)}catch(c){throw ah();}if(b>2097151)throw new L(2,3,3001);this.h+=8;return b*4294967296+a};r.wa=function(a,b){if(this.h+a>this.i.byteLength)throw ah();var c=yb(this.i,this.h,a);this.h+=a;return b?new Uint8Array(c):c};
r.skip=function(a){if(a<0||this.h+a>this.i.byteLength)throw ah();this.h+=a};r.ui=function(a){if(a<0||this.h<a)throw ah();this.h-=a};r.seek=function(a){if(a<0||a>this.i.byteLength)throw ah();this.h=a};r.gd=function(){for(var a=this.h;this.Wa()&&this.i.getUint8(this.h)!=0;)this.h+=1;a=yb(this.i,a,this.h-a);this.h+=1;return Fb(a)};function ah(){return new L(2,3,3E3)}K("shaka.util.DataViewReader",Zg);Zg.prototype.readTerminatedString=Zg.prototype.gd;Zg.prototype.seek=Zg.prototype.seek;
Zg.prototype.rewind=Zg.prototype.ui;Zg.prototype.skip=Zg.prototype.skip;Zg.prototype.readBytes=Zg.prototype.wa;Zg.prototype.readUint64=Zg.prototype.Ze;Zg.prototype.readInt32=Zg.prototype.Gg;Zg.prototype.readUint32=Zg.prototype.R;Zg.prototype.readUint16=Zg.prototype.xa;Zg.prototype.readUint8=Zg.prototype.X;Zg.prototype.getLength=Zg.prototype.Na;Zg.prototype.getPosition=Zg.prototype.Ia;Zg.prototype.hasMoreData=Zg.prototype.Wa;var $g=1;Zg.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:$g};function bh(){this.h=[];this.i=[];this.j=new Kg;this.l=0;this.m=new Map([["CC1",new yg(0,0)],["CC2",new yg(0,1)],["CC3",new yg(1,0)],["CC4",new yg(1,1)]]);this.u=this.o=0;this.D=new Map;this.C=!0;this.B=new Set;ch(this)}r=bh.prototype;r.clear=function(){this.l=0;this.h=[];this.i=[];var a=this.j;a.j=[];a.i=null;a.h=0;ch(this);a=t(this.D.values());for(var b=a.next();!b.done;b=a.next())Wg(b.value)};
function ch(a){a.o=0;a.u=0;for(var b=t(a.m.values()),c=b.next();!c.done;c=b.next())c=c.value,c.i=0,c.h=c.l,c.o=null,og(c.j),og(c.l),og(c.u);a.C=!0}
r.extract=function(a,b){if(this.C){for(var c=t(this.m.values()),d=c.next();!d.done;d=c.next())d.value.m=b;this.C=!1}a=new Zg(a,0);if(!(a.Na()<8)&&a.X()===181&&a.xa()===49&&a.R()===1195456820&&a.X()===3&&(c=a.X(),(c&64)!==0))for(c&=31,a.skip(1),d=0;d<c;d++){var e=a.X(),f=(e&4)>>2,g=a.X(),h=a.X();f&&(e&=3,e===0||e===1?this.h.push({pts:b,type:e,ib:g,Db:h,order:this.h.length}):(this.i.push({pts:b,type:e,value:g,order:this.i.length}),this.i.push({pts:b,type:2,value:h,order:this.i.length})))}};
r.extractRaw608=function(a,b){for(var c=0;c+1<a.length;c+=2)this.h.push({pts:b,type:0,ib:a[c],Db:a[c+1],order:this.h.length})};
r.decode=function(){function a(e,f){return e.pts-f.pts||e.order-f.order}var b=[];this.h.sort(a);this.i.sort(a);for(var c=t(this.h),d=c.next();!d.done;d=c.next())(d=dh(this,d.value))&&b.push(d);c=t(this.i);for(d=c.next();!d.done;d=c.next())Lg(this.j,d.value);c=t(this.j.j);for(d=c.next();!d.done;d=c.next())d=eh(this,d.value),b.push.apply(b,wa(d));this.j.j=[];this.h=[];this.i=[];return b};
function dh(a,b){var c=b.type;if((b.ib&112)===16){var d=b.ib>>3&1;c===0?a.o=d:a.u=d}var e="CC"+((c<<1|(c?a.u:a.o))+1);c=a.m.get(e);if(b.ib===255&&b.Db===255||!b.ib&&!b.Db||!fh(b.ib)||!fh(b.Db))return++a.l>=45&&ch(a),null;a.l=0;b.ib&=127;b.Db&=127;d=b.ib;if(d>=1&&d<=15||!b.ib&&!b.Db)return null;d=null;if((b.ib&112)===16)a:{a.B.add(e),d=b.ib;a=b.Db;e=b.pts;if(c.o===(d<<8|a))c.o=null;else if(c.o=d<<8|a,(d&240)===16&&(a&192)===64){b=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(d&7)<<1|a>>5&1];d="white";
e=!1;var f=null;var g=a>95?a-96:a-64;g<=13?d=Dg[Math.floor(g/2)]:g<=15?e=!0:f=Math.floor((g-16)/2);a=(a&1)===1;c.i!==4&&(g=c.h,c.i===3&&b!==g.h&&(c=1+b-g.i,xg(g,c,1+g.h-g.i,g.i),rg(g,0,c-1),rg(g,b+1,15-b)),g.h=b,g.u=a,g.m=e,g.o=d,g.B=f,g.l=null,g.C="black")}else if((d&247)===17&&(a&240)===32)c.h.u=!1,c.h.m=!1,c.h.o="white",sg(c.h,0,32,e),b=!1,d=Dg[(a&14)>>1],d==="white_italics"&&(d="white",b=!0),c.h.u=(a&1)===1,c.h.m=b,c.h.o=d;else if((d&247)===16&&(a&240)===32||(d&247)===23&&(a&255)===45)b="black",
(d&7)===0&&(b=Cg[(a&14)>>1]),c.h.C=b;else if((d&247)===17&&(a&240)===48)sg(c.h,1,a,e);else if((d&246)===18&&(a&224)===32)sg(c.h,d&1?3:2,a,e);else{if((d&246)===20&&(a&240)===32){a=b.pts;d=null;switch(b.Db){case 32:Ag(c);break;case 33:c=c.h;c.j[c.h].pop();break;case 37:d=zg(c,2,a);break;case 38:d=zg(c,3,a);break;case 39:d=zg(c,4,a);break;case 40:sg(c.h,0,32,a);break;case 41:c.i=2;c.h=c.j;c.h.i=0;c.m=a;break;case 42:og(c.u);Bg(c);break;case 43:Bg(c);break;case 44:b=c.j;d=null;c.i!==4&&(d=pg(b,c.m,a,
c.i===2||c.i===3));rg(b,0,15);break;case 45:b=c.h;c.i!==3?d=null:(d=pg(b,c.m,a,!0),e=b.h-b.i+1,xg(b,e-1,e,b.i),rg(b,0,e-1),rg(b,b.h,15-b.h),c.m=a);break;case 46:rg(c.l,0,15);break;case 47:b=null,c.i!==4&&(b=pg(c.j,c.m,a,c.i===2||c.i===3)),d=c.l,c.l=c.j,c.j=d,Ag(c),c.m=a,d=b}break a}(d==23||d==31)&&a>=33&&a<=35&&(c.h.l=a-32)}d=null}else a=b.Db,e=b.pts,sg(c.h,0,b.ib,e),sg(c.h,0,a,e);return d}
function eh(a,b){var c=[];try{for(;b.Wa();){var d=Pg(b).value,e=(d&224)>>5,f=d&31;e===7&&f!=0&&(e=Pg(b).value&63);if(e!=0){a.B.add("svc"+e);for(var g=a.D.getOrInsertComputed(e,function(l){return new Qg(l)}),h=b.Ia();b.Ia()-h<f;){var k=Rg(g,b);c.push.apply(c,wa(k))}}}}catch(l){if(l instanceof L&&l.code===3E3)Xa("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.");else throw l;}return c}function fh(a){for(var b=0;a;)b^=a&1,a>>=1;return b===1}r.getStreams=function(){return Array.from(this.B)};
K("shaka.cea.CeaDecoder",bh);Tc=function(){return new bh};function gh(a){var b=[];a=Vb(a);for(var c=0;c<a.length;){for(var d=0;a[c]==255;)d+=255,c++;d+=a[c++];for(var e=0;a[c]==255;)e+=255,c++;e+=a[c++];d==4&&b.push(a.subarray(c,c+e));c+=e}return b};function hh(){this.j=new Map;this.i=new Map;this.h=!1}r=hh.prototype;r.box=function(a,b){a=ih(a);this.j.set(a,jh);this.i.set(a,b);return this};r.ma=function(a,b){a=t(a);for(var c=a.next();!c.done;c=a.next())this.box(c.value,b);return this};r.P=function(a,b){a=ih(a);this.j.set(a,kh);this.i.set(a,b);return this};r.Gh=function(a,b){a=t(a);for(var c=a.next();!c.done;c=a.next())this.P(c.value,b);return this};r.stop=function(){this.h=!0};
r.parse=function(a,b,c){a=new Zg(a,0);for(this.h=!1;a.Wa()&&!this.h;)this.ed(0,a,b,c)};
r.ed=function(a,b,c,d){var e=b.Ia();if(d&&e+8>b.Na())this.h=!0;else{var f=b.R(),g=b.R(),h=lh(g),k=!1;switch(f){case 0:f=b.Na()-e;break;case 1:if(d&&b.Ia()+8>b.Na()){this.h=!0;return}f=b.Ze();k=!0}var l=this.i.get(g);if(l){var m=null,n=null;if(this.j.get(g)==kh){if(d&&b.Ia()+4>b.Na()){this.h=!0;return}n=b.R();m=n>>>24;n&=16777215}g=e+f;c&&g>b.Na()&&(g=b.Na());d&&g>b.Na()?this.h=!0:(g-=b.Ia(),b=g>0?b.wa(g,!1):new Uint8Array(0),b=new Zg(b,0),l({name:h,parser:this,partialOkay:c||!1,stopOnPartial:d||!1,
version:m,flags:n,reader:b,size:f,start:e+a,has64BitSize:k}))}else b.skip(Math.max(0,Math.min(e+f-b.Ia(),b.Na()-b.Ia())))}};function mh(a){for(var b=nh(a);a.reader.Wa()&&!a.parser.h;)a.parser.ed(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function oh(a){for(var b=nh(a),c=a.reader.R(),d=0;d<c&&(a.parser.ed(a.start+b,a.reader,a.partialOkay,a.stopOnPartial),!a.parser.h);d++);}
function ph(a){var b=nh(a);for(a.reader.skip(78);a.reader.Wa()&&!a.parser.h;)a.parser.ed(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function qh(a){var b=nh(a);a.reader.skip(8);var c=a.reader.xa();a.reader.skip(6);c==2?a.reader.skip(48):a.reader.skip(12);for(c==1&&a.reader.skip(16);a.reader.Wa()&&!a.parser.h;)a.parser.ed(a.start+b,a.reader,a.partialOkay,a.stopOnPartial)}function rh(a,b){return function(c){a(c.reader.wa(c.reader.Na()-c.reader.Ia(),b))}}
function ih(a){var b=0;a=t(a);for(var c=a.next();!c.done;c=a.next())b=b<<8|c.value.charCodeAt(0);return b}function lh(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}function nh(a){return 8+(a.has64BitSize?8:0)+(a.flags!=null?4:0)}K("shaka.util.Mp4Parser",hh);hh.headerSize=nh;hh.typeToString=lh;hh.allData=rh;hh.audioSampleEntry=qh;hh.visualSampleEntry=ph;hh.sampleDescription=oh;hh.children=mh;hh.prototype.parseNext=hh.prototype.ed;hh.prototype.parse=hh.prototype.parse;
hh.prototype.stop=hh.prototype.stop;hh.prototype.fullBoxes=hh.prototype.Gh;hh.prototype.fullBox=hh.prototype.P;hh.prototype.boxes=hh.prototype.ma;hh.prototype.box=hh.prototype.box;var jh=0,kh=1,sh=["moov","trak","mdia","minf","stbl"],th=["moof","traf"],uh=["av01","dav1"],vh=[].concat(wa(["avc1","avc3","dvav","dva1"]),wa(["hev1","hvc1","dvh1","dvhe"])),wh=[].concat(wa(vh),wa(["vvc1","vvi1","dvc1","dvi1"])),xh="ac-3 ec-3 ac-4 Opus fLaC apac iamf".split(" ");function yh(a,b){for(var c=0,d=0;d<8&&!(b+d>=a.byteLength);d++){var e=a[b+d];c+=(e&127)*Math.pow(2,d*7);if(!(e&128))return{value:c,size:d+1}}return null}function zh(a){for(var b=[],c=0;c<a.byteLength;){var d=c,e=a[c++];if(e&128)break;var f=(e&120)>>3,g=(e&2)!=0;if((e&4)!=0){if(c>=a.byteLength)break;c++}if(g){g=yh(a,c);if(!g)break;e=g.value;c+=g.size}else e=a.byteLength-c;e=c+e;if(e>a.byteLength)break;b.push({type:f,data:a.subarray(c,e),fullData:a.subarray(d,e)});c=e}return b}
function Ah(a){for(var b=[],c=-1,d=0,e=0;e<a.byteLength;e++){var f=a[e];if(f){if(f==1&&d>=2){if(c>=0){c=Bh(a.subarray(c,e-2));if(!c)return null;b.push.apply(b,wa(c))}c=e+1}d=0}else d++}if(c<0)return null;a=Bh(a.subarray(c));if(!a)return null;b.push.apply(b,wa(a));return Ub(b)}
function Bh(a){for(var b=null,c=0,d=0,e=0;e<a.byteLength;e++){var f=a[e];d==2&&f==3?(b||(b=new Uint8Array(a.byteLength-1),b.set(a.subarray(0,e)),c=e),d=0):(d=f?0:d+1,b&&(b[c++]=f))}a=b?b.subarray(0,c):a;if(!a.byteLength)return[];b=a[0];if(b&128)return null;if(b&2)return[a];b=b&4?2:1;if(a.byteLength<b)return null;c=a.slice(0,b);c[0]|=2;d=a.byteLength-b;e=[];do f=d%128,d=Math.floor(d/128),e.push(d?f|128:f);while(d);d=new Uint8Array(e);return[c,d,a.subarray(b)]};function Ch(a,b){var c=null,d=null,e=null,f=null,g=a.R();b&1&&(e=a.Ze());b&2&&(f=a.R());b&8&&(c=a.R());b&16&&(d=a.R());return{trackId:g,Fb:c,ac:d,uh:e,Rg:f}}function Dh(a,b){return b==1?(b=a.R(),a=a.R(),{za:b*4294967296+a}):{za:a.R()}}function Eh(a,b){b==1?(a.skip(8),a.skip(8)):(a.skip(4),a.skip(4));b=a.R();a.skip(4);a=a.xa();return{timescale:b,language:String.fromCharCode((a>>10)+96)+String.fromCharCode(((a&960)>>5)+96)+String.fromCharCode((a&31)+96)}}
function Fh(a,b,c){var d=a.R(),e=[],f=null;c&1&&(f=a.Gg());c&4&&a.skip(4);for(var g=0;g<d;g++){var h={qc:null,sampleSize:null,ef:null};c&256&&(h.qc=a.R());c&512&&(h.sampleSize=a.R());c&1024&&a.skip(4);c&2048&&(h.ef=b==0?a.R():a.Gg());e.push(h)}return{sampleCount:d,nc:e,Zb:f}}
function Gh(a,b){b==1?(a.skip(8),a.skip(8)):(a.skip(4),a.skip(4));var c=a.R();b==1?a.skip(8):a.skip(4);a.skip(4);a.skip(8);a.skip(2);a.skip(2);a.skip(2);a.skip(2);a.skip(36);b=a.xa()+a.xa()/16;a=a.xa()+a.xa()/16;return{trackId:c,width:b,height:a}}function Hh(a){a.skip(6);a.skip(2);a.skip(8);var b=a.xa();a.skip(2);a.skip(2);a.skip(2);a=a.xa()+a.xa()/65536;return{channelCount:b,sampleRate:a}}
function Ih(a,b){b.skip(1);var c=b.X();b=b.X();var d=c>>>5,e=(b&64)>>6;return{codec:a+"."+d+"."+Jh(c&31,2)+(b>>>7?"H":"M")+"."+Jh(d===2&&e?(b&32)>>5?12:10:e?10:8,2)+"."+((b&16)>>4)+"."+((b&8)>>3)+((b&4)>>2)+(b&3)+"."+Jh(1,2)+"."+Jh(1,2)+"."+Jh(1,2)+".0"}}function Kh(a){a=a.R();return{codec:lh(a)}}function Lh(a,b){a.X();var c=a.X(),d=b>=1?c>>4&15:0;b=b>=1?c&15:0;c=a.X();var e=a.X(),f=a.wa(16,!1);f=Rb(f);var g=null;c===1&&e===0&&(g=a.X(),g=a.wa(g,!0));return{defaultKID:f,Cm:c,nj:e,ze:d,Ae:b,$b:g}}
function Mh(a){var b=null,c=null,d=a.wa(4,!1);var e=String.fromCharCode(d[0]);e+=String.fromCharCode(d[1]);e+=String.fromCharCode(d[2]);e+=String.fromCharCode(d[3]);if(e==="nclx"){switch(a.xa()){case 1:case 5:case 6:case 7:b="srgb";break;case 9:b="rec2020";break;case 11:case 12:b="p3"}d=a.xa();a.xa();switch(d){case 1:case 6:case 13:case 14:case 15:c="SDR";break;case 16:c="PQ";break;case 18:c="HLG"}}return{colorGamut:b,videoRange:c}}
function Nh(a,b){a=a.toString(16).toUpperCase();return(b===void 0?0:b)?a:("0"+a).slice(-2)}function Jh(a,b){for(a=String(a);a.length<b;)a="0"+a;return a}
function Oh(a,b,c,d){var e=!!(b&2);b&1&&(a.skip(3),c=a.X(),a.skip(16),c===0&&(d=a.X(),d=a.wa(d,!0)));b=a.R();for(var f=[],g=0;g<b;g++){var h=d;if(c>0)h=a.wa(c,!0);else if(!h)throw Error("SENC specifies IV size 0 but no constant IV is available.");var k=new Uint8Array(16);k.set(h.subarray(0,Math.min(h.length,16)),0);h=null;if(e){var l=a.xa();h=[];for(var m=0;m<l;m++)h.push({yd:a.xa(),cc:a.R()})}f.push({iv:k,Li:h})}return{Sa:f}};function Ph(){this.l=new Map;this.j=this.i=0;this.m=null;this.h=Qh}
Ph.prototype.init=function(a){function b(g){g=g.name;Rh.has(g)&&(c.h=Rh.get(g))}var c=this,d=[],e=[],f=null;(new hh).ma([].concat(wa(sh),["mvex"]),mh).P("trex",function(g){var h=g.reader;h.skip(4);h.skip(4);g=h.R();h=h.R();c.i=g;c.j=h}).P("tkhd",function(g){g=Gh(g.reader,g.version);f=g.trackId;d.push(g.trackId)}).P("mdhd",function(g){g=Eh(g.reader,g.version);e.push(g.timescale)}).P("stsd",oh).ma(wh,b).ma(uh,b).box("encv",ph).box("sinf",mh).box("frma",function(g){g=Kh(g.reader).codec;Rh.has(g)&&(c.h=
Rh.get(g))}).box("c608",function(){c.h=Sh;c.m=f}).parse(a,!0,!0);if(!d.length||!e.length||d.length!=e.length)throw new L(2,2,2010);this.h==Qh&&Wa("Unable to determine bitstream format for CEA parsing!");d.forEach(function(g,h){c.l.set(g,e[h])})};
Ph.prototype.parse=function(a){var b=this;if(this.h==Qh)return[];var c=[],d=0,e=[];(new hh).box("moof",function(f){d=f.start;e=[];mh(f)}).box("traf",function(f){e.push({trackId:null,za:null,Fb:b.i,ac:b.j,Cg:[],timescale:9E4});mh(f)}).P("trun",function(f){var g=e[e.length-1];f=Fh(f.reader,f.version,f.flags);g.Cg.push(f)}).P("tfhd",function(f){var g=e[e.length-1];f=Ch(f.reader,f.flags);g.trackId=f.trackId;g.Fb=f.Fb||b.i;g.ac=f.ac||b.j;f=f.trackId;b.l.has(f)&&(g.timescale=b.l.get(f))}).P("tfdt",function(f){var g=
e[e.length-1];f=Dh(f.reader,f.version);g.za=f.za}).box("mdat",function(f){for(var g=d-f.start-8,h=f.reader.Ia(),k=t(e),l=k.next();!l.done;l=k.next()){var m=l.value;if(b.h!=Sh||m.trackId===b.m)if(m.za===null)Wa("Unable to find base media decode time for CEA captions!");else if(f.reader.seek(h),b.h===Sh){l=f.reader;var n=m.timescale,p=m.Fb,u=m.ac,q=m.za,v=t(m.Cg);for(m=v.next();!m.done;m=v.next()){m=m.value;m.Zb!=null&&l.seek(g+m.Zb);m=t(m.nc);for(var w=m.next();!w.done;w=m.next()){w=w.value;var y=
q/n,x=l.wa(w.sampleSize||u,!1);c.push({packet:x,pts:y,format:Yc});q+=w.qc||p}}}else a:for(l=b,n=f.reader,p=m.timescale,u=m.Fb,q=m.ac,v=m.za,m=t(m.Cg),w=m.next();!w.done;w=m.next())for(w=w.value,w.Zb!=null&&n.seek(g+w.Zb),w=t(w.nc),y=w.next();!y.done;y=w.next()){y=y.value;x=(v+(y.ef||0))/p;var z=y.sampleSize||q;if(l.h==Th)try{for(var D=n.wa(z,!1),B=t(zh(D)),A=B.next();!A.done;A=B.next()){var E=A.value;if(E.type==5){var C=yh(E.data,0);C&&C.value==4&&c.push({packet:E.data.subarray(C.size),pts:x,format:Wc})}}}catch(Q){break a}else for(;z>
0&&n.Wa();){var F=n.R(),G=n.X(),J=1;switch(l.h){case Uh:G&=31;G=ig(jg,G);break;case Vh:case Wh:J=2;n.skip(1);G=G>>1&63;G=ig(l.h===Vh?kg:lg,G);break;default:break a}if(G)for(J=n.wa(F-J,!1),J=t(gh(J)),G=J.next();!G.done;G=J.next())c.push({packet:G.value,pts:x,format:Wc});else try{n.skip(F-J)}catch(Q){break a}z-=F+4}v+=y.qc||u}}}).parse(a,!1,!0);return c};K("shaka.cea.Mp4CeaParser",Ph);
var Qh=0,Uh=1,Vh=2,Wh=3,Sh=4,Th=5,Rh=(new Map).set("avc1",Uh).set("avc3",Uh).set("dvav",Uh).set("dva1",Uh).set("hev1",Vh).set("hvc1",Vh).set("dvh1",Vh).set("dvhe",Vh).set("vvc1",Wh).set("vvi1",Wh).set("dvc1",Wh).set("dvi1",Wh).set("av01",Th).set("dav1",Th);Zc("video/mp4",function(){return new Ph});function Xh(){}function Yh(a,b){var c=Zh.get(b)||[];b=[];c=t(c);for(var d=c.next();!d.done;d=c.next())d=d.value,b.push.apply(b,wa(d().parse(a)));a=new Set;c=[];b=t(b);for(d=b.next();!d.done;d=b.next())d=d.value,a.has(d.key)||(a.add(d.key),c.push(d));return c}function $h(a){a=Zh.get(a);return a!=null&&a.length>0}function ai(a,b){Zh.has(a)||Zh.set(a,[]);Zh.get(a).push(b)}K("shaka.metadata.Metadata",Xh);Xh.unregisterParserByMime=function(a){Zh.delete(a)};Xh.registerParserByMime=ai;Xh.supports=$h;
Xh.getMetadataFrames=Yh;var Zh=new Map;function bi(){}function ci(a,b){return b+10<=a.length&&a[b]===73&&a[b+1]===68&&a[b+2]===51&&a[b+3]<255&&a[b+4]<255&&a[b+6]<128&&a[b+7]<128&&a[b+8]<128&&a[b+9]<128?!0:!1}function di(a,b){return b+10<=a.length&&a[b]===51&&a[b+1]===68&&a[b+2]===73&&a[b+3]<255&&a[b+4]<255&&a[b+6]<128&&a[b+7]<128&&a[b+8]<128&&a[b+9]<128?!0:!1}function ei(a,b){var c=(a[b]&127)<<21;c|=(a[b+1]&127)<<14;c|=(a[b+2]&127)<<7;return c|=a[b+3]&127}
function fi(a,b){switch(b){case 0:return Array.from(a).map(function(c){return String.fromCharCode(c)}).join("");case 1:return Ib(a);case 2:return Gb(a,!1);case 3:return Fb(a);default:return""}}function gi(a){return a===1||a===2?2:1}function hi(a,b,c){c=c===void 0?0:c;if(b===1||b===2){for(b=c;b+1<a.length;b+=2)if(a[b]===0&&a[b+1]===0)return b;return-1}return a.indexOf(0,c)}
function ii(a){var b={key:a.type,description:"",data:"",mimeType:null,pictureType:null};if(a.type==="APIC"){if(a.size<2)return null;var c=a.data[0],d=a.data.subarray(1).indexOf(0);if(d===-1)return null;var e=Fb(yb(a.data,1,d)),f=a.data[2+d],g=3+d;d=hi(a.data,c,g);if(d===-1)return null;g=fi(a.data.subarray(g,d),c);c=d+gi(c);var h;e==="--\x3e"?h=Fb(a.data.subarray(c)):h=xb(a.data.subarray(c));b.mimeType=e;b.pictureType=f;b.description=g;b.data=h;return b}if(a.type==="COMM"){if(a.size<5)return null;
h=a.data[0];e=Fb(a.data.subarray(1,4)).replace(/\0/g,"");c=hi(a.data,h,4);if(c===-1)return null;f=fi(a.data.subarray(4,c),h);a=fi(a.data.subarray(c+gi(h)),h).replace(/\0*$/,"");b.description=f||e;b.data=a;return b}if(a.type==="TXXX"){if(a.size<2)return null;f=a.data[0];h=hi(a.data,f,1);if(h===-1)return null;e=fi(a.data.subarray(1,h),f);a=fi(a.data.subarray(h+gi(f)),f).replace(/^\ufeff/,"").replace(/\0*$/,"");b.description=e;b.data=a;return b}if(a.type==="WXXX"){if(a.size<2)return null;f=a.data[0];
h=hi(a.data,f,1);if(h===-1)return null;e=fi(a.data.subarray(1,h),f);a=Fb(a.data.subarray(h+gi(f))).replace(/\0*$/,"");b.description=e;b.data=a;return b}if(a.type==="PRIV"){if(a.size<2)return null;e=a.data.indexOf(0);if(e===-1)return null;e=Fb(yb(a.data,0,e));b.description=e;e=="com.apple.streaming.transportStreamTimestamp"?(e=a.data.subarray(e.length+1),a=e[3]&1,e=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7],e/=45,a&&(e+=4.772185884E7),b.data=e):(a=xb(a.data.subarray(e.length+1)),b.data=a);return b}if(a.type===
"UFID"){e=a.data.indexOf(0);if(e===-1)return null;f=Fb(yb(a.data,0,e));b.description=f;b.data=xb(a.data.subarray(e+1));return b}if(a.type[0]==="T"){if(a.size<2)return null;a=fi(a.data.subarray(1),a.data[0]).replace(/\0+$/,"").split("\x00").map(function(k){return k.replace(/^\ufeff/,"")}).filter(function(k){return k.length>0}).join(" / ");b.data=a;return b}return a.type[0]==="W"?(a=Fb(a.data).replace(/\0*$/,""),b.data=a,b):a.data?(b.data=xb(a.data),b):null}
function ji(a){for(var b=0,c=[];ci(a,b);){var d=a[b+3],e=ei(a,b+6);a[b+5]>>6&1&&(b+=10);b+=10;for(e=b+e;b+10<e&&a[b]!==0;){var f=a.subarray(b);if(d>=4)var g=ei(f,4);else g=f[4]<<24,g|=f[5]<<16,g|=f[6]<<8,g|=f[7],g>>>=0;f={type:String.fromCharCode(f[0],f[1],f[2],f[3]),size:g,data:f.subarray(10,10+g)};(g=ii(f))&&c.push(g);b+=f.size+10}di(a,b)&&(b+=10)}return c}
function ki(a,b){for(var c=b=b===void 0?0:b,d=0;ci(a,b);)a[b+5]>>6&1&&(d+=10),d+=10,d+=ei(a,b+6),di(a,b+10)&&(d+=10),b+=d;return d>0?a.subarray(c,c+d):new Uint8Array([])}bi.prototype.parse=function(a){return ji(a)};K("shaka.metadata.Id3Utils",bi);bi.prototype.parse=bi.prototype.parse;bi.getID3Data=ki;bi.getID3Frames=ji;for(var li=t(we),mi=li.next();!mi.done;mi=li.next())ai(mi.value,function(){return new bi});/*

 Copyright Brightcove, Inc.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
*/
function ni(a,b){this.l=a;if(b===void 0?0:b)this.l=Vb(a);this.j=this.l.byteLength;this.h=this.i=0}function oi(a){var b=a.l.byteLength-a.j,c=Math.min(4,a.j);if(c!==0){for(var d=0,e=0;e<c;e++)d=d<<8|a.l[b+e];a.i=d<<(4-c)*8;a.h=c*8;a.j-=c}}function pi(a,b){if(a.h<=b){b-=a.h;var c=Math.floor(b/8);b-=c*8;a.h-=c;oi(a)}a.i<<=b;a.h-=b}function qi(a,b){var c=Math.min(a.h,b),d=a.i>>>32-c;a.h-=c;a.h>0?a.i<<=c:a.j>0&&oi(a);c=b-c;return c>0?d<<c|qi(a,c):d}
function ri(a){for(var b=0;a.h===0;){if(a.j===0)return b;oi(a)}for(;;){var c=Math.clz32(a.i);c>a.h&&(c=a.h);b+=c;a.i<<=c;a.h-=c;if(a.h>0||a.j===0)break;oi(a)}return b}function si(a){pi(a,1+ri(a))}function W(a){var b=ri(a);return qi(a,b+1)-1}function ti(a){a=W(a);return 1&a?1+a>>>1:-1*(a>>>1)}function ui(a){return qi(a,1)===1}function vi(a){return qi(a,8)}function wi(a,b){for(var c=8,d=8,e=0;e<b;e++)d!==0&&(d=ti(a),d=(c+d+256)%256),c=d===0?c:d}function xi(a){W(a);return W(a)}
K("shaka.util.ExpGolomb",ni);function yi(){this.N=null;this.O=!1;this.j=this.H=null;this.u=[];this.m=[];this.h=[];this.I=this.F=null;this.o=[];this.l=[];this.i=[];this.G=null;this.C=[];this.B=[];this.L=this.K=this.M=this.D=null}r=yi.prototype;r.clearData=function(){this.u=[];this.m=[];this.h=[];this.o=[];this.l=[];this.i=[];this.C=[];this.B=[]};r.gf=function(a){this.L!=null&&this.L!=a&&(this.D=null);this.L=a};
r.parse=function(a){if(a.length<564)return this;for(var b=Math.max(0,zi(a)),c=a.length-(a.length+b)%188,d=!1,e=b;e<c;e+=188)if(a[e]==71){var f=!!(a[e+1]&64),g=((a[e+1]&31)<<8)+a[e+2];if((a[e+3]&48)>>4>1){var h=e+5+a[e+4];if(h==e+188)continue}else h=e+4;switch(g){case 0:f&&(h+=a[h]+1);this.N=(a[h+10]&31)<<8|a[h+11];break;case 17:case 8191:break;case this.N:f&&(h+=a[h]+1);f=a;g={audio:-1,video:-1,Zc:-1,audioCodec:"",videoCodec:""};var k=h+3+((f[h+1]&15)<<8|f[h+2])-4;for(h+=12+((f[h+10]&15)<<8|f[h+11]);h<
k;){var l=(f[h+1]&31)<<8|f[h+2],m=(f[h+3]&15)<<8|f[h+4];switch(f[h]){case 6:if(m>0)for(var n=h+5,p=m;p>2;){var u=f[n+1]+2;switch(f[n]){case 5:var q=n+2;q=f[q]<<24|f[q+1]<<16|f[q+2]<<8|f[q+3];g.audio==-1&&q===1332770163?(g.audio=l,g.audioCodec="opus"):g.video==-1&&q===1096167473&&(g.video=l,g.videoCodec="av1");break;case 106:g.audio==-1&&(g.audio=l,g.audioCodec="ac3");break;case 122:g.audio==-1&&(g.audio=l,g.audioCodec="ec3");break;case 124:g.audio==-1&&(g.audio=l,g.audioCodec="aac");break;case 128:g.videoCodec==
"av1"&&u>=5&&(this.K=f.subarray(n+2,n+5));break;case 127:g.audioCodec=="opus"&&(q=null,f[n+2]===128&&(q=f[n+3]),q!=null&&(this.M={channelCount:(q&15)===0?2:q&15,ej:q,sampleRate:48E3}))}n+=u;p-=u}break;case 15:g.audio==-1&&(g.audio=l,g.audioCodec="aac");break;case 17:g.audio==-1&&(g.audio=l,g.audioCodec="aac-loas");break;case 21:g.Zc==-1&&(g.Zc=l);break;case 27:g.video==-1&&(g.video=l,g.videoCodec="avc");break;case 3:case 4:g.audio==-1&&(g.audio=l,g.audioCodec="mp3");break;case 36:g.video==-1&&(g.video=
l,g.videoCodec="hvc");break;case 129:g.audio==-1&&(g.audio=l,g.audioCodec="ac3");break;case 132:case 135:g.audio==-1&&(g.audio=l,g.audioCodec="ec3")}h+=m+5}f=g;f.video!=-1&&(this.H=f.video,this.j=f.videoCodec);f.audio!=-1&&(this.F=f.audio,this.I=f.audioCodec);f.Zc!=-1&&(this.G=f.Zc);h=[f.video,f.audio,f.Zc];f.video==-1&&h.includes(this.H)&&(this.j=this.H=null);f.audio==-1&&h.includes(this.F)&&(this.I=this.F=null);f.Zc==-1&&h.includes(this.G)&&(this.G=null);d&&!this.O&&(d=!1,e=b-188);this.O=!0;break;
case this.H:h=a.subarray(h,e+188);f?(this.m.push(this.u.length),this.u.push(h)):this.m.length&&this.u.push(h);break;case this.F:h=a.subarray(h,e+188);f?(this.l.push(this.o.length),this.o.push(h)):this.l.length&&this.o.push(h);break;case this.G:h=a.subarray(h,e+188);f?(this.B.push(this.C.length),this.C.push(h)):this.B.length&&this.C.push(h);break;default:d=!0}}return this};function Ai(a,b,c){return Ub(a,b[c],c+1<b.length?b[c+1]:a.length)}
function Bi(a,b,c){if(b.byteLength<9||(b[0]<<16|b[1]<<8|b[2])!==1)return null;var d=b[4]<<8|b[5];if(d&&d>c-6)return null;var e=null,f=null,g=b[7];if(b.byteLength<Ci(b))return null;if(g&192){e=(b[9]&14)*536870912+(b[10]&255)*4194304+(b[11]&254)*16384+(b[12]&255)*128+(b[13]&254)/2;var h=null;g&64&&(h=(b[14]&14)*536870912+(b[15]&255)*4194304+(b[16]&254)*16384+(b[17]&255)*128+(b[18]&254)/2,e=Di(e,h));a.D==null&&(a.D=e);e=Di(e,a.D);f=a.D=e;h!=null&&(f=Di(h,e))}a=b[8]+9;return c<=a?null:{packetLength:d,
Lk:a,pts:e,dts:f}}function Ei(a,b){return(a=Bi(a,b,b.byteLength))?{data:b.subarray(a.Lk),packetLength:a.packetLength,pts:a.pts,dts:a.dts,nalus:[]}:null}
r.mi=function(a,b){var c=a.pts?a.pts/9E4:null;a=a.data;var d=a.byteLength,e=1;this.j=="hvc"&&(e=2);var f=b.state||0,g=f,h=0,k=[],l=-1,m=0,n=this.j==="hvc";f==-1&&(l=0,m=n?a[0]>>1&63:a[0]&31,f=0,h=1);for(;h<d;){var p=a[h++];if(f)if(f===1)f=p?0:2;else if(p)if(p==1){p=h-f-1;if(l>=0)k.push({data:a.subarray(l+e,p),fullData:a.subarray(l,p),type:m,time:c,state:null});else if(f=k.length?k[k.length-1]:b.Te)g&&h<=4-g&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-g),f.fullData=f.fullData.subarray(0,
f.fullData.byteLength-g)),p>0&&(p=a.subarray(0,p),f.data=Sb(f.data,p),f.fullData=Sb(f.fullData,p),f.state=0);h<d?(m=n?a[h]>>1&63:a[h]&31,l=h,f=0):f=-1}else f=0;else f=3;else f=p?0:1}l>=0&&f>=0&&k.push({data:a.subarray(l+e,d),fullData:a.subarray(l,d),type:m,time:c,state:f});!k.length&&b.Te&&(c=k.length?k[k.length-1]:b.Te)&&(c.data=Sb(c.data,a),c.fullData=Sb(c.fullData,a));b.state=f;return k};
r.getMetadata=function(){for(var a=[],b=0;b<this.B.length;b++){var c=Ai(this.C,this.B,b);(c=Ei(this,c))&&a.push({cueTime:c.pts?c.pts/9E4:null,data:c.data,frames:ji(c.data),dts:c.dts,pts:c.pts})}return a};
r.jb=function(){if(this.l.length&&!this.i.length)for(var a=0;a<this.l.length;a++){var b=Ai(this.o,this.l,a),c=Ei(this,b),d=this.i.length?this.i[this.i.length-1]:null;c&&c.pts!=null&&c.dts!=null&&(!d||d.pts!=c.pts&&d.dts!=c.dts)?this.i.push(c):this.i.length&&(b=c?c.data:b)&&(d=this.i[this.i.length-1],d.data=Sb(d.data,b))}return this.i};
r.yc=function(a){a=a===void 0?!0:a;if(this.m.length&&!this.h.length){for(var b=0;b<this.m.length;b++){var c=Ai(this.u,this.m,b),d=Ei(this,c),e=this.h.length?this.h[this.h.length-1]:null;d&&d.pts!=null&&d.dts!=null&&(!e||e.pts!=d.pts&&e.dts!=d.dts)?this.h.push(d):this.h.length&&(c=d?d.data:c)&&(e=this.h[this.h.length-1],e.data=Sb(e.data,c))}if(a&&this.j!="av1"){b={Te:null,state:null};e=[];c=t(this.h);for(d=c.next();!d.done;d=c.next())d=d.value,d.nalus=this.mi(d,b),d.nalus.length&&(e.push(d),b.Te=d.nalus[d.nalus.length-
1]);this.h=e}}return a?this.h:(a=this.h,this.h=[],a)};function Fi(a,b){if(b=="audio"){b=a.o;var c=a.l}else if(b=="video")b=a.u,c=a.m;else return null;for(var d=0;d<c.length;d++){var e=c[d],f=d+1<c.length?c[d+1]:b.length,g=b[e];if(g){for(var h=0,k=e;k<f;k++)h+=b[k].byteLength;e=g.byteLength>=9&&g.byteLength>=Ci(g)?g:Ub(b,e,f);if(h=Bi(a,e,h))if(h=Gi(h),h!=null)return h}}return null}function Ci(a){a=a[7];return a&64?19:a&192?14:9}
function Gi(a){return a.pts==null||a.dts==null?null:Math.min(a.dts,a.pts)/9E4}r.getStartTime=function(a){if(a=="audio")a=this.jb();else if(a=="video")a=this.yc(!1);else return null;return a.length?Gi(a[0]):null};r.Dd=function(){return{audio:this.I,video:this.j}};r.Le=function(){for(var a=[],b=t(this.yc()),c=b.next();!c.done;c=b.next())a.push.apply(a,wa(c.value.nalus));return a};
r.Nh=function(){if(this.j=="hvc")var a=Hi(this);else if(this.j=="av1"){if(a={height:null,width:null,codec:null,frameRate:Ii(this)},this.K){var b=new Uint8Array(4);b.set(this.K);b=new Zg(b,0);a.codec=Ih("av01",b).codec}}else a=Ji(this);return a};function Ii(a){var b=a.yc();return b.length>1&&(a=b[0].pts,b=b[1].pts,!isNaN(b-a))?Math.abs(1/(b-a)*9E4):null}
function Ji(a){var b={height:null,width:null,codec:null,frameRate:null},c=a.Le();if(!c.length)return b;c=c.find(function(u){return u.type==7});if(!c)return b;c=new ni(c.data);var d=vi(c),e=vi(c),f=vi(c);si(c);if(Ki.includes(d)){var g=W(c);g===3&&pi(c,1);si(c);si(c);pi(c,1);if(ui(c)){g=g!==3?8:12;for(var h=0;h<g;h++)ui(c)&&(h<6?wi(c,16):wi(c,64))}}si(c);g=W(c);if(g===0)W(c);else if(g===1)for(pi(c,1),si(c),si(c),g=W(c),h=0;h<g;h++)si(c);si(c);pi(c,1);g=W(c);h=W(c);var k=qi(c,1);k===0&&pi(c,1);pi(c,
1);var l=0,m=0,n=0,p=0;ui(c)&&(l=W(c),m=W(c),n=W(c),p=W(c));b.height=String((2-k)*(h+1)*16-n*2-p*2);b.width=String((g+1)*16-l*2-m*2);b.codec="avc1."+("0"+d.toString(16).toUpperCase()).slice(-2)+("0"+e.toString(16).toUpperCase()).slice(-2)+("0"+f.toString(16).toUpperCase()).slice(-2);b.frameRate=Ii(a);return b}
function Hi(a){var b={height:null,width:null,codec:null,frameRate:null},c=a.Le();if(!c.length)return b;c=c.find(function(B){return B.type==33});if(!c)return b;var d=new ni(c.fullData,!0);vi(d);vi(d);qi(d,4);var e=qi(d,3);ui(d);var f=qi(d,2);c=qi(d,1);for(var g=qi(d,5),h=qi(d,32),k=vi(d),l=vi(d),m=vi(d),n=vi(d),p=vi(d),u=vi(d),q=vi(d),v=[],w=[],y=0;y<e;y++)v.push(ui(d)),w.push(ui(d));if(e>0)for(y=e;y<8;y++)qi(d,2);for(y=0;y<e;y++)v[y]&&qi(d,88),w[y]&&vi(d);W(d);e=W(d);e==3&&qi(d,1);v=W(d);w=W(d);var x=
y=0,z=0,D=0;ui(d)&&(y+=W(d),x+=W(d),z+=W(d),D+=W(d));b.width=String(v-(y+x)*(e===1||e===2?2:1));b.height=String(w-(z+D)*(e===1?2:1));d=function(B){for(var A=0,E=0;E<32;E++)A|=(B>>E&1)<<31-E;return A>>>0}(h);f="hvc1"+("."+["","A","B","C"][f]+g);f+="."+d.toString(16).toUpperCase();f+="."+(c==1?"H":"L")+q;u&&(f+="."+u.toString(16).toUpperCase());p&&(f+="."+p.toString(16).toUpperCase());n&&(f+="."+n.toString(16).toUpperCase());m&&(f+="."+m.toString(16).toUpperCase());l&&(f+="."+l.toString(16).toUpperCase());
k&&(f+="."+k.toString(16).toUpperCase());b.codec=f;b.frameRate=Ii(a);return b}function Di(a,b){var c=1;for(a>b&&(c=-1);Math.abs(b-a)>4294967296;)a+=c*8589934592;return a}function Li(a){return zi(a)<0?!1:!0}function zi(a){for(var b=Math.min(1E3,a.length-564),c=0;c<b;){if(a[c]==71&&a[c+188]==71&&a[c+376]==71)return c;var d=a.indexOf(71,c+1);c=d>=0&&d<b?d:c+1}return-1}K("shaka.util.TsParser",yi);yi.syncOffset=zi;yi.probe=Li;yi.prototype.getVideoInfo=yi.prototype.Nh;yi.prototype.getVideoNalus=yi.prototype.Le;
yi.prototype.getCodecs=yi.prototype.Dd;yi.prototype.getStartTime=yi.prototype.getStartTime;yi.prototype.getVideoData=yi.prototype.yc;yi.prototype.getAudioData=yi.prototype.jb;yi.prototype.getMetadata=yi.prototype.getMetadata;yi.prototype.parseNalus=yi.prototype.mi;yi.prototype.parse=yi.prototype.parse;yi.prototype.setDiscontinuitySequence=yi.prototype.gf;yi.prototype.clearData=yi.prototype.clearData;yi.Timescale=9E4;var Ki=[100,110,122,244,44,83,86,118,128,138,139,134];function Mi(){this.h=null}Mi.prototype.init=function(){};Mi.prototype.parse=function(a){this.h?this.h.clearData():this.h=new yi;var b=[];a=yb(a);if(!Li(a))return b;var c=this.h.parse(a);a=null;switch(c.Dd().video){case "avc":a=jg;break;case "hvc":a=kg}if(a==null)return b;c=c.Le();c=t(c);for(var d=c.next();!d.done;d=c.next())if(d=d.value,d.time!=null&&ig(a,d.type))for(var e=t(gh(d.data)),f=e.next();!f.done;f=e.next())b.push({packet:f.value,pts:d.time,format:Wc});return b};
K("shaka.cea.TsCeaParser",Mi);Zc("video/mp2t",function(){return new Mi});function Ni(a,b,c){if(b+8>a.length||a[b]!==11||a[b+1]!==119)return!1;var d=a[b+4]>>6;if(d>=3)return!1;var e=a[b+4]&63,f=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,
1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][e*3+d]*2;if(b+f>a.length)return!1;var g=a[b+6]>>5,h=0;g===2?h+=2:(g&1&&g!==1&&(h+=2),g&4&&(h+=2));h=(a[b+6]<<8|a[b+7])>>12-h&1;var k=a[b+5]&7;a=new Uint8Array([d<<6|a[b+5]>>3<<1|k>>2,(k&3)<<6|g<<3|h<<2|e>>4,e<<4&224]);c.sampleRate=[48E3,44100,32E3][d];c.channelCount=[2,1,2,3,3,4,4,5][g]+h;c.Ob=a;c.ea=f;return!0}
function Oi(a,b){if(a[b]===11&&a[b+1]===119){var c=0,d=5;b+=d;for(var e,f;d>0;){f=a[b];var g=Math.min(d,8),h=8-g;e=4278190080>>>24+h<<h;e=(f&e)>>h;c=c?c<<g|e:e;b+=1;d-=g}if(c<16)return!0}return!1};function Pi(a,b){var c=a[b+1]&1?7:9;return b+c<=a.length&&(a=((a[b+3]&3)<<11|a[b+4]<<3|(a[b+5]&224)>>>5)-c,a>0)?{Id:c,ea:a}:null}function Qi(a,b){var c=[96E3,88200,64E3,48E3,44100,32E3,24E3,22050,16E3,12E3,11025,8E3,7350],d=(a[b+2]&60)>>>2;if(d>c.length-1)return null;var e=((a[b+2]&192)>>>6)+1,f=(a[b+2]&1)<<2;f|=(a[b+3]&192)>>>6;return{sampleRate:c[d],channelCount:f,codec:"mp4a.40."+e}}
function Ri(a,b){if(b+1<a.length&&a[b]===255&&(a[b+1]&246)===240){var c=a[b+1]&1?7:9;if(b+c>=a.length)return!1;var d=(a[b+3]&3)<<11|a[b+4]<<3|(a[b+5]&224)>>>5;if(d<=c)return!1;b+=d;return b===a.length||b+1<a.length&&a[b]===255&&(a[b+1]&246)===240}return!1}
function Si(a,b){switch(a){case "mp4a.40.2":if(b===1)return new Uint8Array([0,200,0,128,35,128]);if(b===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(b===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(b===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(b===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(b===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,
2,0,178,0,32,8,224]);break;default:if(b===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(b===2||b===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null};function Ti(a){if(!a.length)return null;a=a.find(function(c){return c.type==1});if(!a)return null;var b=Ui(a.data);return b?{width:b.width,height:b.height,Ig:b.Ig,Yd:Vi(b,a.fullData)}:null}function Vi(a,b){var c=new Uint8Array(4+b.byteLength);c[0]=129;c[1]=(a.al&7)<<5|a.$k&31;c[2]=a.cl<<7|a.jk<<6|a.wl<<5|a.Ak<<4|a.ql<<3|a.rl<<2|a.fj&3;c[3]=0;c.set(b,4);return c}
function Ui(a){if(!a.byteLength)return null;a={wj:new ni(a),me:a.byteLength*8,Ag:!1};var b=Wi(a,3);Wi(a,1);var c=Wi(a,1)==1,d=0,e=0;if(c)d=Wi(a,5);else{var f=!1,g=0;if(Wi(a,1)==1){Wi(a,64);if(Wi(a,1)==1)a:{for(f=0;f<32&&Wi(a,1)==0;){if(a.Ag)break a;f++}f<32&&Wi(a,f)}if(f=Wi(a,1)==1)g=Wi(a,5)+1,Wi(a,32),Wi(a,10)}for(var h=Wi(a,1)==1,k=Wi(a,5)+1,l=0;l<k;l++){Wi(a,12);var m=Wi(a,5),n=m>7?Wi(a,1):0;l==0&&(d=m,e=n);f&&Wi(a,1)==1&&Wi(a,2*g+1);h&&Wi(a,1)==1&&Wi(a,4)}}g=Wi(a,4)+1;f=Wi(a,4)+1;g=Wi(a,g)+1;
f=Wi(a,f)+1;c||Wi(a,1)==1&&Wi(a,7);Wi(a,3);c||(Wi(a,4),(h=Wi(a,1)==1)&&Wi(a,2),k=2,Wi(a,1)==0&&(k=Wi(a,1)),k>0&&Wi(a,1)==0&&Wi(a,1),h&&Wi(a,3));Wi(a,3);h=Wi(a,1);k=0;l=h?10:8;b==2&&h&&(l=(k=Wi(a,1))?12:10);m=b==1?0:Wi(a,1);var p=n=2,u=2;Wi(a,1)==1&&(n=Wi(a,8),p=Wi(a,8),u=Wi(a,8));var q=1,v=1,w=0;m?Wi(a,1):n==1&&p==13&&u==0?v=q=0:(Wi(a,1),b==0?v=q=1:b==1?v=q=0:l==12?v=(q=Wi(a,1))?Wi(a,1):0:(q=1,v=0),q&&v&&(w=Wi(a,2)));return a.Ag||g<=1||f<=1?null:{al:b,$k:d,cl:e,jk:h,wl:k,Ak:m,ql:q,rl:v,fj:w,width:g,
height:f,Ig:c}}function Wi(a,b){if(b>a.me)return a.Ag=!0,a.me=0;a.me-=b;for(var c=0;b>0;){var d=Math.min(b,16);c=c*Math.pow(2,d)+qi(a.wj,d);b-=d}return c};function Xi(a,b,c){if(b+8>a.length||!kj(a,b))return!1;var d=new ni(a.subarray(b+2));pi(d,2);pi(d,3);var e=qi(d,11)+1<<1,f=qi(d,2);if(f==3){f=qi(d,2);f=[24E3,22060,16E3][f];var g=3}else f=[48E3,44100,32E3][f],g=qi(d,2);var h=qi(d,3),k=qi(d,1);d=qi(d,5);if(b+e>a.byteLength)return!1;a=Math.floor(e*f/([1,2,3,6][g]*16));a=new Uint8Array([(a&8160)>>5,(a&31)<<3,f<<6|d<<1|0,0|h<<1|k<<0,0]);c.sampleRate=f;c.channelCount=[2,1,2,3,3,4,4,5][h]+k;c.Ob=a;c.ea=e;return!0}
function kj(a,b){return(a[b]<<8|a[b+1]<<0)===2935?!0:!1};function lj(a){if(!a.length)return null;var b=a.find(function(v){return v.type==7});a=a.find(function(v){return v.type==8});if(!b||!a)return null;var c=new ni(b.data),d=vi(c);vi(c);vi(c);si(c);if(mj.includes(d)&&(d=W(c),d===3&&pi(c,1),si(c),si(c),pi(c,1),ui(c))){d=d!==3?8:12;for(var e=0;e<d;e++)ui(c)&&(e<6?wi(c,16):wi(c,64))}si(c);d=W(c);if(d===0)W(c);else if(d===1)for(pi(c,1),si(c),si(c),d=W(c),e=0;e<d;e++)si(c);si(c);pi(c,1);var f=W(c),g=W(c),h=qi(c,1);h===0&&pi(c,1);pi(c,1);var k=0,l=0,m=0,n=0;
ui(c)&&(k=W(c),l=W(c),m=W(c),n=W(c));e=d=1;if(ui(c)&&ui(c)){var p=vi(c),u=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],q=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];p>0&&p<=16?(d=u[p-1],e=q[p-1]):p===255&&(d=qi(c,16),e=qi(c,16))}c=(2-h)*(g+1)*16-m*2-n*2;f=(f+1)*16-k*2-l*2;b=b.fullData;k=b.byteLength;a=a.fullData;l=a.byteLength;g=0;h=new Uint8Array(11+k+l);h[g++]=1;h[g++]=b[1];h[g++]=b[2];h[g++]=b[3];h[g++]=255;h[g++]=225;h[g++]=k>>>8&255;h[g++]=k&255;h.set(b,g);g+=k;h[g++]=1;h[g++]=l>>>8&255;
h[g++]=l&255;h.set(a,g);return{height:c,width:f,Yd:h,zc:d,Mc:e}}
function nj(a){function b(v){e={data:g,frame:!1,isKeyframe:!1,pts:v.pts,dts:v.dts,nalus:[]}}function c(){if(e&&e.nalus.length&&e.frame){for(var v=e.nalus.length*4,w=t(e.nalus),y=w.next();!y.done;y=w.next())v+=y.value.fullData.byteLength;v=new Uint8Array(v);w=0;y=t(e.nalus);for(var x=y.next();!x.done;x=y.next()){x=x.value;var z=x.fullData.byteLength;v[w]=z>>24&255;v[w+1]=z>>16&255;v[w+2]=z>>8&255;v[w+3]=z&255;v.set(x.fullData,w+4);w+=4+z}e.data=v;d.push(e)}}for(var d=[],e=null,f=!1,g=new Uint8Array(0),
h=0;h<a.length;h++){var k=a[h],l=k.nalus,m=!1;e&&l.length&&!f&&(c(),b(k));l=t(k.nalus);for(var n=l.next();!n.done;n=l.next()){n=n.value;var p=!1;switch(n.type){case 1:var u=!1;p=!0;var q=n.data;m&&q.length>4&&(q=xi(new ni(q)),q===2||q===4||q===7||q===9)&&(u=!0);u&&e&&e.frame&&!e.isKeyframe&&(c(),e=null);e||b(k);e.frame=!0;e.isKeyframe=u;break;case 5:p=!0;e&&e.frame&&!e.isKeyframe&&(c(),e=null);e||b(k);e.frame=!0;e.isKeyframe=!0;break;case 6:p=!0;break;case 7:m=p=!0;break;case 8:p=!0;break;case 9:f=
p=!0;e&&e.frame&&(c(),e=null);e||b(k);break;case 12:p=!0;break;default:p=!1}e&&p&&e.nalus.push(n)}}c();return d}var mj=[100,110,122,244,44,83,86,118,128,138,139,134];function oj(a){if(!a.length)return null;var b=a.find(function(g){return g.type==32}),c=a.find(function(g){return g.type==33}),d=a.find(function(g){return g.type==34});if(!b||!c||!d)return null;var e=pj(b.fullData);a=qj(c.fullData);var f=rj(d.fullData);b=sj(b.fullData,c.fullData,d.fullData,{yg:e.yg,$g:e.$g,Zf:a.Zf,$f:a.$f,Tf:a.Tf,Yf:a.Yf,Uf:a.Uf,Vf:a.Vf,Wf:a.Wf,Xf:a.Xf,Nf:a.Nf,Of:a.Of,Pf:a.Pf,Qf:a.Qf,Rf:a.Rf,Sf:a.Sf,Se:a.Se,Df:a.Df,zf:a.zf,yf:a.yf,Bg:f.Bg,Mf:a.Mf,Lf:a.Lf});return{height:a.height,width:a.width,
Yd:b,zc:a.Wk,Mc:a.Vk}}function pj(a){var b=new ni(a,!0);vi(b);vi(b);qi(b,4);qi(b,2);qi(b,6);a=qi(b,3);b=ui(b);return{yg:a+1,$g:b}}
function qj(a){a=new ni(a,!0);vi(a);vi(a);var b=0,c=0,d=0,e=0;qi(a,4);var f=qi(a,3);ui(a);for(var g=qi(a,2),h=qi(a,1),k=qi(a,5),l=vi(a),m=vi(a),n=vi(a),p=vi(a),u=vi(a),q=vi(a),v=vi(a),w=vi(a),y=vi(a),x=vi(a),z=vi(a),D=[],B=[],A=0;A<f;A++)D.push(ui(a)),B.push(ui(a));if(f>0)for(A=f;A<8;A++)qi(a,2);for(A=0;A<f;A++)D[A]&&qi(a,88),B[A]&&vi(a);W(a);D=W(a);D==3&&qi(a,1);B=W(a);A=W(a);ui(a)&&(b+=W(a),c+=W(a),d+=W(a),e+=W(a));var E=W(a),C=W(a),F=W(a);if(ui(a))for(var G=0;G<=f;G++)W(a),W(a),W(a);else W(a),
W(a),W(a);W(a);W(a);W(a);W(a);W(a);W(a);if(ui(a)&&ui(a))for(G=0;G<4;G++)for(var J=0;J<(G===3?2:6);J++)if(ui(a)){var Q=Math.min(64,1<<4+(G<<1));G>1&&ti(a);for(var O=0;O<Q;O++)ti(a)}else W(a);ui(a);ui(a);ui(a)&&(vi(a),W(a),W(a),ui(a));G=W(a);for(Q=J=0;Q<G;Q++)if(O=!1,Q!==0&&(O=ui(a)),O){Q===G&&W(a);ui(a);W(a);for(var V=O=0;V<=J;V++){var M=ui(a),N=!1;M||(N=ui(a));(M||N)&&O++}J=O}else{V=W(a);O=W(a);J=V+O;for(M=0;M<V;M++)W(a),ui(a);for(V=0;V<O;V++)W(a),ui(a)}if(ui(a))for(G=W(a),J=0;J<G;J++){for(Q=0;Q<
F+4;Q++)qi(a,1);qi(a,1)}G=F=1;J=!0;Q=1;V=O=0;ui(a);ui(a);if(ui(a)){if(ui(a)){M=vi(a);N=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2];var P=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];M>0&&M<=16?(F=N[M-1],G=P[M-1]):M===255&&(F=qi(a,16),G=qi(a,16))}ui(a)&&ui(a);ui(a)&&(qi(a,3),ui(a),ui(a)&&(vi(a),vi(a),vi(a)));ui(a)&&(W(a),W(a));ui(a);ui(a);ui(a);if(M=ui(a))si(a),si(a),si(a),si(a);if(ui(a)&&(Q=qi(a,32),O=qi(a,32),ui(a)&&W(a),ui(a))){P=!1;M=ui(a);N=ui(a);if(M||N){if(P=ui(a))vi(a),qi(a,5),ui(a),qi(a,
5);qi(a,4);qi(a,4);P&&qi(a,4);qi(a,5);qi(a,5);qi(a,5)}for(var U=0;U<=f;U++){J=ui(a);var ea=!0,ha=1;J||(ea=ui(a));var I=!1;ea?W(a):I=ui(a);I||(ha=W(a)+1);if(M){for(ea=0;ea<ha;ea++)W(a),W(a),P&&(W(a),W(a));ui(a)}if(N){for(ea=0;ea<ha;ea++)W(a),W(a),P&&(W(a),W(a));ui(a)}}}ui(a)&&(ui(a),ui(a),ui(a),V=W(a),W(a),W(a),W(a),W(a))}return{Tf:z,Zf:g,$f:h,Yf:k,Uf:l,Vf:m,Wf:n,Xf:p,Nf:u,Of:q,Pf:v,Qf:w,Rf:y,Sf:x,Se:V,Df:D,zf:E,yf:C,width:B-(b+c)*(D===1||D===2?2:1),height:A-(d+e)*(D===1?2:1),Wk:F,Vk:G,Mf:O/Q,Lf:J}}
function rj(a){var b=new ni(a,!0);vi(b);vi(b);W(b);W(b);ui(b);ui(b);qi(b,3);ui(b);ui(b);W(b);W(b);ti(b);ui(b);ui(b);ui(b)&&W(b);ti(b);ti(b);ui(b);ui(b);ui(b);ui(b);a=ui(b);b=ui(b);var c=1;b&&a?c=0:b?c=3:a&&(c=2);return{Bg:c}}
function sj(a,b,c,d){var e=new Uint8Array(23+(5+a.byteLength)+(5+b.byteLength)+(5+c.byteLength));e[0]=1;e[1]=(d.Zf&3)<<6|(d.$f?1:0)<<5|d.Yf&31;e[2]=d.Uf;e[3]=d.Vf;e[4]=d.Wf;e[5]=d.Xf;e[6]=d.Nf;e[7]=d.Of;e[8]=d.Pf;e[9]=d.Qf;e[10]=d.Rf;e[11]=d.Sf;e[12]=d.Tf;e[13]=240|(d.Se&3840)>>8;e[14]=d.Se&255;e[15]=252|d.Bg&3;e[16]=252|d.Df&3;e[17]=248|d.zf&7;e[18]=248|d.yf&7;e[19]=0;e[20]=parseInt(d.Mf,10);e[21]=((d.Lf?1:0)&3)<<6|(d.yg&7)<<3|(d.$g?1:0)<<2|3;e[22]=3;a=[a,b,c];b=23;c=a.length-1;for(d=0;d<a.length;d+=
1)e.set(new Uint8Array([32+d|(d===c?128:0),0,1,a[d].byteLength>>8,a[d].byteLength&255]),b),b+=5,e.set(a[d],b),b+=a[d].byteLength;return e};function tj(a,b){if(!(b+1<a.length&&uj(a,b)))return null;var c=a[b+1]>>3&3,d=a[b+1]>>1&3,e=a[b+2]>>4&15,f=a[b+2]>>2&3;if(c!==1&&e!==0&&e!==15&&f!==3){var g=a[b+3]>>6;e=vj[(c===3?3-d:d===3?3:4)*14+e-1]*1E3;f=wj[(c===3?0:c===2?1:2)*3+f];var h=xj[c][d],k=yj[d];c=h*8*k;h=Math.floor(h*e/f+(a[b+2]>>1&1))*k;if(!h||!c||!f)return null;(k=(k=(navigator.userAgent||"").match(/Chrome\/(\d+)/i))?parseInt(k[1],10):0)&&k<=87&&d===2&&e>=224E3&&g===0&&(a[b+3]|=128);return{sampleRate:f,channelCount:g===3?1:2,ea:h,Uk:c}}return null}
function uj(a,b){return a[b]===255&&(a[b+1]&224)===224&&(a[b+1]&6)!==0}function zj(a,b){if(b+1<a.length&&uj(a,b)){var c=tj(a,b),d=4;c&&c.ea&&(d=c.ea);b+=d;return b===a.length||b+1<a.length&&uj(a,b)}return!1}
var vj=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],wj=[44100,48E3,32E3,22050,24E3,16E3,11025,12E3,8E3],xj=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],yj=[0,1,1,4];function Aj(a){if(a.length<1)return 960;var b=a[0],c=b&3;b=Bj[b>>3&31];if(c===0)a=1;else if(c===1||c===2)a=2;else{if(a.length<2)return b;a=a[1]&63;if(a===0)return b}return b*a}var Bj=[480,960,1920,2880,480,960,1920,2880,480,960,1920,2880,480,960,480,960,120,240,480,960,120,240,480,960,120,240,480,960,120,240,480,960];new Uint8Array([79,112,117,115,72,101,97,100]);K("shaka.config.CharacterEdgeStyle",{DEFAULT:0,NONE:1,DROP_SHADOW:2,RAISED:3,DEPRESSED:4,OUTLINE:5});K("shaka.config.CodecSwitchingStrategy",{RELOAD:"reload",SMOOTH:"smooth"});K("shaka.config.CrossBoundaryStrategy",{KEEP:"keep",RESET:"reset",RESET_TO_ENCRYPTED:"reset_to_encrypted",RESET_ON_ENCRYPTION_CHANGE:"RESET_ON_ENCRYPTION_CHANGE"});K("shaka.config.FontFamily",{DEFAULT:"",MONOSPACED_SERIF:'"Courier New", Courier, "Nimbus Mono L", "Cutive Mono", monospace',PROPORTIONAL_SERIF:'"Times New Roman", Times, Georgia, Cambria, "PT Serif Caption", serif',MONOSPACED_SANS_SERIF:'"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, "PT Mono", monospace',PROPORTIONAL_SANS_SERIF:'Roboto, Arial, Helvetica, Verdana, "PT Sans Caption", sans-serif'});K("shaka.config.MsfVersion",{AUTO:"auto",DRAFT_18:"draft-18",DRAFT_20:"draft-20",DRAFT_21:"draft-21",DRAFT_22:"draft-22"});K("shaka.config.PositionArea",{DEFAULT:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,CENTER_LEFT:4,CENTER:5,CENTER_RIGHT:6,BOTTOM_LEFT:7,BOTTOM_CENTER:8,BOTTOM_RIGHT:9});K("shaka.config.RepeatMode",{OFF:0,ALL:1,SINGLE:2});function Cj(a,b){this.h=a;this.i=b}Cj.prototype.toString=function(){return"v"+this.h+"."+this.i};function Dj(a,b){var c=new Cj(6,0),d=Ej,e=d.h,f=c.i-e.i;((c.h-e.h||f)>0?d.j:d.i)(d.h,c,a,b)}function Fj(a,b,c,d){Wa([c,"has been deprecated and will be removed in",b,". We are currently at version",a,". Additional information:",d].join(" "))}function Gj(a,b,c,d){Va([c,"has been deprecated and has been removed in",b,". We are now at version",a,". Additional information:",d].join(" "))}var Ej=null;function Hj(){}function Ij(a,b){var c=document.createElement("source");c.src=a;c.type=b===void 0?"":b;return c}function Jj(a){for(var b=!1,c=a.getElementsByTagName("source"),d=c.length-1;d>=0;--d)a.removeChild(c[d]),b=!0;a.src&&(a.removeAttribute("src"),b=!0);return b}function Kj(a){for(;a.firstChild;)a.removeChild(a.firstChild)}
function Mc(){if(Lj)return Lj;Mj||(Mj=new $e(function(){Lj=null}));(Lj=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(Lj=document.createElement("video"));Mj.ha(1);return Lj}
function Nj(a,b){var c,d,e,f,g;return H(function(h){if(h.i==1)return"fonts"in document&&"FontFace"in window?h.h(document.fonts.ready,2):h.return();if(!("entries"in document.fonts))return h.return();c=function(k){k=k.entries();for(var l=[],m=k.next();m.done===!1;)l.push(m.value),m=k.next();return l};d=t(c(document.fonts));for(e=d.next();!e.done;e=d.next())if(f=e.value,f.family===a&&f.display==="swap")return h.return();g=new FontFace(a,"url("+b+")",{display:"swap"});document.fonts.add(g);h.l()})}
function Oj(a,b,c){a.J(document,"fullscreenchange",function(){c(!!document.fullscreenElement)});b&&((b.webkitPresentationMode||b.webkitSupportsFullscreen)&&a.J(b,"webkitpresentationmodechanged",function(){b.webkitPresentationMode?c(b.webkitPresentationMode!=="inline"):b.webkitSupportsFullscreen&&c(b.webkitDisplayingFullscreen)}),a.J(b,"enterpictureinpicture",function(){c(!0)}),a.J(b,"leavepictureinpicture",function(){c(!1)}));"documentPictureInPicture"in window&&a.J(window.documentPictureInPicture,
"enter",function(d){c(!0);a.Ra(d.window,"pagehide",function(){c(!1)})})}K("shaka.util.Dom",Hj);Hj.removeAllChildren=Kj;Hj.clearSourceFromVideo=Jj;var Mj=null,Lj=null;function Pj(){this.l=new nb(function(){for(var a=navigator.userAgent.toLowerCase(),b=t([{type:"VR",Jg:/oculus|quest/},{type:"TV",Jg:/smart[ _]?tv|android ?tv/},{type:"MOBILE",Jg:/iphone|ipad|ipod|android/}]),c=b.next();!c.done;c=b.next())if(c=c.value,c.Jg.test(a))return c.type;a=navigator.userAgentData;var d;b=(a==null?void 0:(d=a.platform)==null?void 0:d.toLowerCase())||"";if(a){if(a.mobile)return"MOBILE";if(b.includes("android"))return"TV"}return"DESKTOP"});this.m=new nb(function(){var a=navigator.userAgent;
return navigator.vendor.includes("Apple")&&(a.includes("Version/")||a.includes("OS/"))?"WEBKIT":a.includes("Edge/")?"EDGE":a.includes("Chrome/")?"CHROMIUM":a.includes("Firefox/")?"GECKO":"UNKNOWN"})}function Lc(){var a=window.ManagedMediaSource||window.MediaSource;return a&&a.isTypeSupported?!0:!1}r=Pj.prototype;r.Lb=function(){return!!navigator.mediaCapabilities};r.Ka=function(){return this.l.value()};r.Ea=function(){return this.m.value()};r.hd=function(){return!1};r.Ng=function(){return!1};
r.Ne=function(){return!1};r.si=function(){return!1};r.Td=function(){return!1};r.cf=function(){return!1};r.gb=function(){var a=window.ManagedSourceBuffer||window.SourceBuffer;return!!a&&!!a.prototype&&!!a.prototype.changeType};r.Vd=function(){return!0};r.wi=function(){return 0};r.Gb=function(){return Promise.resolve({width:Infinity,height:Infinity})};r.Ii=function(){return!1};r.Ug=function(){return!1};
r.Va=function(a){var b=this.Ka();if(b==="TV"||b==="CONSOLE"||b==="CAST")a.ads.customPlayheadTracker=!0,a.ads.skipPlayDetection=!0,a.ads.supportsMultipleMediaElements=!1;b==="TV"&&(a.textDisplayer.suspendRenderingWhenHidden=!1);return a};r.Kg=function(){return[]};r.fc=function(a){return window.matchMedia!==void 0&&(window.matchMedia("(color-gamut: p3)").matches||window.matchMedia("(dynamic-range: high)").matches)?a?"HLG":"PQ":"SDR"};r.Ni=function(){return!1};r.ci=function(){return!1};r.df=function(){return!1};
r.kf=function(){return!0};r.di=function(){return!1};r.Mi=function(){return!0};r.Kc=function(){return!1};r.wg=function(a){return a==="com.apple.fps"};r.kd=function(){return!0};function Qj(a,b){a=a.Ka();return["DESKTOP","MOBILE","VR","APPLE_VR"].includes(a)?b.remote:null}r.ld=function(){return typeof Worker!=="undefined"};r.Oh=function(){return!0};r.xg=function(){return!1};r.toString=function(){return"Device: "+this.kb()+" v"+this.va()+"; Type: "+this.Ka()};function Rj(){Pj.call(this);this.h=new nb(function(){var a=navigator.userAgent.match(/Version\/(\d+)(?:\.(\d+))?/);a||(a=navigator.userAgent.match(/OS (\d+)(?:_(\d+))?/));return a?[parseInt(a[1],10),parseInt(a[2]||"0",10)]:[0,0]});this.i=new nb(function(){return/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1?"xr"in navigator?"APPLE_VR":"MOBILE":"xr"in navigator?"APPLE_VR":"DESKTOP"})}ta(Rj,Pj);r=Rj.prototype;r.va=function(){return this.h.value()[0]};r.kb=function(){return"Apple Browser"};
r.Ka=function(){return this.i.value()};r.Ea=function(){return"WEBKIT"};r.Lb=function(){return!1};r.hd=function(a,b){return!Sj(this)&&b==="audio"};r.Ne=function(){return!Sj(this)};r.si=function(a){return!Sj(this)&&a==="audio"};r.Va=function(a){Pj.prototype.Va.call(this,a);a.streaming.fallbackToNativeHlsOnMseError=!0;a.abr.minTimeToSwitch=.5;a.streaming.inaccurateManifestTolerance=0;return a};r.Ni=function(){return!0};r.kd=function(){return!1};r.Oh=function(){return!1};r.cf=function(){return!0};
r.xg=function(){return!0};function Sj(a){a=a.h.value();return a[0]>=27?!0:a[0]===26&&a[1]>=4}(navigator.vendor||"").includes("Apple")&&(/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1||navigator.userAgentData&&navigator.userAgentData.platform&&navigator.userAgentData.platform.toLowerCase()=="macos"||navigator.platform&&navigator.platform.toLowerCase().includes("mac"))&&(rb=function(){return new Rj});function Tj(){if(!Uj())throw Error("Not a Chromecast device!");Pj.call(this);this.i=new nb(function(){var a=navigator.userAgent.match(/Chrome\/(\d+)/);return a?parseInt(a[1],10):null});this.h=new nb(function(){var a=navigator.userAgentData&&navigator.userAgentData.platform||navigator.userAgent;a=a.toLowerCase();return a.includes("android")?Vj:a.includes("fuchsia")?Wj:Xj})}ta(Tj,Pj);r=Tj.prototype;r.va=function(){return this.i.value()};r.kb=function(){return"Chromecast with "+this.h.value()};
r.Ka=function(){return"CAST"};r.Ea=function(){return"CHROMIUM"};r.Lb=function(){return Pj.prototype.Lb.call(this)&&this.h.value()!==Xj};r.gb=function(a){return Pj.prototype.gb.call(this,a)&&this.h.value()!==Xj};r.wi=function(){switch(this.h.value()){case Vj:return 0;case Wj:return 3;default:return 1}};
r.Gb=function(){var a,b,c,d,e;return H(function(f){switch(f.i){case 1:a=window.cast&&cast.__platform__&&cast.__platform__.canDisplayType;b={width:1280,height:720};f.o(2);if(!(c=a)){f.A(4);break}return f.h(cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160'),5);case 5:c=f.j;case 4:if(c){b.width=3840;b.height=2160;f.A(6);break}if(!(d=a)){f.A(7);break}return f.h(cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=1920; height=1080'),8);case 8:d=
f.j;case 7:d&&(b.width=1920,b.height=1080);case 6:f.u(3);break;case 2:e=f.m(),Va("Failed to check canDisplayType:",e);case 3:return f.return(b)}})};r.Va=function(a){Pj.prototype.Va.call(this,a);a.streaming.stallSkip=0;return a};r.Kc=function(){return!0};r.Kg=function(){var a=this.va();return a!==null&&a<90?["opus"]:[]};r.cf=function(){return this.h.value()===Xj};function Uj(){return navigator.userAgent.includes("CrKey")&&!navigator.userAgent.includes("VIZIO SmartCast")}
var Vj="Android",Wj="Fuchsia",Xj="Linux";Uj()&&(rb=function(){return new Tj});function Yj(){Pj.call(this);this.j=new nb(function(){var a=navigator.userAgent.match(/Edge?\/(\d+)/);return a||(a=navigator.userAgent.match(/OPR\/(\d+)/))?parseInt(a[1],10):(a=navigator.userAgent.match(/(Chrome|Firefox)\/(\d+)/))?parseInt(a[2],10):null});this.h=new nb(function(){return navigator.userAgent.match(/Edge?\//)?"Edge":navigator.userAgent.includes("OPR/")?"Opera":navigator.userAgent.includes("Chrome")?"Chrome":navigator.userAgent.includes("Firefox")?"Firefox":"Unknown"});this.u=new nb(function(){return navigator.userAgentData&&
navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()=="macos":navigator.platform?navigator.platform.toLowerCase().includes("mac"):!1});this.i=new nb(function(){return navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()=="windows":navigator.platform?navigator.platform.toLowerCase().includes("win32"):!1});this.B=new nb(function(){return navigator.userAgent.includes("sony.hbbtv.tv")});this.o=new nb(function(){return navigator.userAgentData&&
navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()=="android":navigator.userAgent.includes("Android")?!0:!1})}ta(Yj,Pj);r=Yj.prototype;r.va=function(){return this.j.value()};r.kb=function(){return this.h.value()};r.hd=function(a){return bc(a)?this.i.value():!1};r.Ng=function(a){return bc(a)||this.h.value()==="Edge"?this.i.value():!1};r.kd=function(){return this.h.value()==="Opera"&&this.u.value()?!1:Pj.prototype.kd.call(this)};
r.Ne=function(a){return bc(a)||this.h.value()==="Edge"?this.i.value():!1};r.gb=function(a){return this.i.value()&&bc(a)?!1:Pj.prototype.gb.call(this,a)};
r.Va=function(a){Pj.prototype.Va.call(this,a);if(this.i.value())switch(this.h.value()){case "Firefox":a.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation"};break;case "Opera":case "Chrome":a.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation.3000","com.microsoft.playready.recommendation":"com.microsoft.playready.recommendation.3000"}}this.o.value()&&(a.drm.defaultAudioRobustnessForWidevine="SW_SECURE_CRYPTO",a.drm.defaultVideoRobustnessForWidevine=
"SW_SECURE_CRYPTO");return a};r.df=function(){return this.h.value()==="Edge"||this.B.value()};r.Kc=function(){if(this.Ea()==="GECKO"){var a=this.va();return a!==null?a>=100:Pj.prototype.Kc.call(this)}return Pj.prototype.Kc.call(this)};r.wg=function(a){return this.Ea()==="GECKO"?bc(a):Pj.prototype.wg.call(this,a)};sb=function(){return new Yj};function Zj(){Pj.apply(this,arguments)}ta(Zj,Pj);r=Zj.prototype;r.va=function(){return null};r.kb=function(){return"Hisense"};r.Ka=function(){return"TV"};r.Lb=function(){return!1};r.gb=function(){return!1};r.Gb=function(){var a={width:1920,height:1080},b=null;if(window.Hisense_Get4KSupportState)try{b=window.Hisense_Get4KSupportState()}catch(c){}b==null&&(b=navigator.userAgent.includes("UHD"));b&&(a.width=3840,a.height=2160);return Promise.resolve(a)};
r.Va=function(a){Pj.prototype.Va.call(this,a);a.streaming.stallSkip=0;return a};r.ld=function(){return!1};if(navigator.userAgent.includes("Hisense")||navigator.userAgent.includes("VIDAA"))rb=function(){return new Zj};function ak(){Pj.call(this);this.h=new nb(function(){var a=navigator.userAgent.match(/PlayStation (\d+)/);return a?parseInt(a[1],10):null})}ta(ak,Pj);r=ak.prototype;r.kb=function(){return"PlayStation"};r.Ka=function(){return"CONSOLE"};r.Ea=function(){return"WEBKIT"};r.va=function(){return this.h.value()};r.Lb=function(){return!1};r.gb=function(){return!1};r.Ug=function(){return this.va()===4};
r.Gb=function(){var a,b,c,d,e;return H(function(f){switch(f.i){case 1:return a={width:1920,height:1080},b=!1,f.o(2),f.h(window.msdk.device.getDisplayInfo(),4);case 4:c=f.j;b=c.resolution==="4K";f.u(3);break;case 2:return f.m(),f.o(5),f.h(window.msdk.device.getDisplayInfoImmediate(),7);case 7:d=f.j;b=d.resolution==="4K";f.u(3);break;case 5:e=f.m(),Wa("PlayStation: Failed to get the display info:",e);case 3:return b&&(a.width=3840,a.height=2160),f.return(a)}})};
r.Va=function(a){Pj.prototype.Va.call(this,a);this.va()===4&&a.drm.preferredKeySystems.push("com.microsoft.playready");a.streaming.clearDecodingCache=!0;return a};r.df=function(){return this.va()===4};r.kf=function(){return this.va()!==4};navigator.userAgent.includes("PlayStation")&&(rb=function(){return new ak});function bk(){Pj.apply(this,arguments)}ta(bk,Pj);r=bk.prototype;r.va=function(){return null};r.kb=function(){return"TitanOS"};r.Ka=function(){return"TV"};r.Gb=function(){var a={width:1920,height:1080};try{SmartTvA_API.hasCapability("UHD")?(a.width=3840,a.height=2160):SmartTvA_API.hasCapability("FHD")?(a.width=1920,a.height=1080):(a.width=1280,a.height=720)}catch(b){Wa("Titan OS: Error detecting screen size, default screen size 1920x1080.",b)}return Promise.resolve(a)};
r.fc=function(a){try{if(SmartTvA_API.hasCapability("HDR","HDR10")||SmartTvA_API.hasCapability("HDR","DV"))return a?"HLG":"PQ"}catch(b){return Wa("Titan OS: Error checking HDR support",b),Pj.prototype.fc.call(this,a)}return"SDR"};navigator.userAgent.includes("TitanOS")&&(rb=function(){return new bk});function ck(){Pj.apply(this,arguments)}ta(ck,Pj);r=ck.prototype;r.va=function(){return null};r.kb=function(){return"TiVoOS"};r.Ka=function(){return"TV"};r.Ea=function(){return"CHROMIUM"};r.gb=function(){return!1};navigator.userAgent.includes("TiVoOS")&&(rb=function(){return new ck});function dk(){Pj.call(this);var a=navigator.userAgent.match(/Tizen (\d+).(\d+)/);this.h=a?parseInt(a[1],10):null;this.i=a?parseInt(a[2],10):null}ta(dk,Pj);r=dk.prototype;r.va=function(){return this.h};r.kb=function(){return"Tizen"};r.Ea=function(){return"CHROMIUM"};r.Ka=function(){return"TV"};r.hd=function(){return!0};r.Td=function(){return this.va()===3};r.Lb=function(){return!1};r.gb=function(){return!1};r.Vd=function(){return this.h&&this.i?this.h===5?this.i>=5:this.h>5:Pj.prototype.Vd.call(this)};
r.Gb=function(){var a=window.devicePixelRatio;a={width:window.screen.width*a>1920?3840:1920,height:window.screen.height*a>1080?2160:1080};try{if(webapis.systeminfo&&webapis.systeminfo.getMaxVideoResolution){var b=webapis.systeminfo.getMaxVideoResolution();a.width=b.width;a.height=b.height}else webapis.productinfo.is8KPanelSupported&&webapis.productinfo.is8KPanelSupported()?(a.width=7680,a.height=4320):webapis.productinfo.isUdPanelSupported&&webapis.productinfo.isUdPanelSupported()&&(a.width=3840,
a.height=2160)}catch(c){Wa("Tizen: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)};r.Va=function(a){Pj.prototype.Va.call(this,a);a.drm.ignoreDuplicateInitData=this.va()!==2;this.va()===3&&(a.streaming.crossBoundaryStrategy="reset_to_encrypted");a.streaming.shouldFixTimestampOffset=!0;a.streaming.stallSkip=0;a.streaming.gapPadding=2;return a};r.Kg=function(){var a=[];this.h!==null&&this.h<5&&a.push("opus");return a};
r.fc=function(a){try{if(webapis.avinfo.isHdrTvSupport())return a?"HLG":"PQ"}catch(b){return Pj.prototype.fc.call(this,a)}return"SDR"};r.ci=function(){return!0};r.di=function(){return this.va()===3};r.ld=function(){var a=this.va();return a!==null&&a<3?!1:Pj.prototype.ld.call(this)};navigator.userAgent.includes("Tizen")&&(rb=function(){return new dk});function ek(){Pj.apply(this,arguments)}ta(ek,Pj);r=ek.prototype;r.va=function(){return null};r.kb=function(){return"Vizio"};r.Ka=function(){return"TV"};r.Lb=function(){return!1};r.cf=function(){return!0};navigator.userAgent.includes("VIZIO SmartCast")&&(rb=function(){return new ek});function fk(){Pj.call(this);this.j=new nb(function(){return navigator.userAgent.includes("DT_STB_BCM")||navigator.userAgent.includes("Sky_STB")});this.i=new nb(function(){return navigator.userAgent.includes("SOPOpenBrowser")});this.h=new nb(function(){if(navigator.userAgent.includes("DT_STB_BCM"))return 11;var a=navigator.userAgent.match(/Version\/(\d+)/);return a?parseInt(a[1],10):(a=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(a[1],10):null})}ta(fk,Pj);r=fk.prototype;r.va=function(){return this.h.value()};
r.kb=function(){return"WebKit STB"};r.Ka=function(){return"TV"};r.Ea=function(){return"WEBKIT"};r.Lb=function(){return!1};r.hd=function(){return this.i.value()};r.Gb=function(){return Promise.resolve({width:window.screen.width*window.devicePixelRatio,height:window.screen.height*window.devicePixelRatio})};r.kf=function(){return!this.j.value()};r.kd=function(){return!1};r.xg=function(){return!0};
if(navigator.userAgent.includes("PlayStation")?0:navigator.userAgent.includes("SOPOpenBrowser")||navigator.userAgent.includes("DT_STB_BCM")||navigator.userAgent.includes("Sky_STB")||!(!(navigator.vendor||"").includes("Apple")||/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1||navigator.userAgentData&&navigator.userAgentData.platform&&navigator.userAgentData.platform.toLowerCase()=="macos"||navigator.platform&&navigator.platform.toLowerCase().includes("mac")))rb=function(){return new fk};function gk(){Pj.call(this);var a=this;this.i=hk();this.h=null;try{var b=new PalmServiceBridge;b.onservicecallback=function(c){c=JSON.parse(c);var d,e,f,g;a.h=(g=(f=(d=c.configs)==null?void 0:d["tv.model.supportHDR"])!=null?f:(e=c.configs)==null?void 0:e["tv.config.supportDolbyHDRContents"])!=null?g:!1};b.call("luna://com.webos.service.config/getConfigs",JSON.stringify({configNames:["tv.model.supportHDR","tv.config.supportDolbyHDRContents"]}))}catch(c){Wa("WebOS: getConfigs call failed",c)}}
ta(gk,Pj);r=gk.prototype;r.va=function(){return this.i};r.kb=function(){return"WebOS"};r.Ka=function(){return"TV"};r.Ea=function(){return"CHROMIUM"};r.Lb=function(){return!1};r.gb=function(){return!1};r.Vd=function(){var a=this.va();return a!==null?a>3:Pj.prototype.Vd.call(this)};r.Gb=function(){var a={width:1920,height:1080};try{var b=JSON.parse(window.PalmSystem.deviceInfo);a.width=Math.max(1920,b.screenWidth);a.height=Math.max(1080,b.screenHeight)}catch(c){Wa("WebOS: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)};
r.Va=function(a){Pj.prototype.Va.call(this,a);this.va()===3&&(a.streaming.crossBoundaryStrategy="reset");a.streaming.shouldFixTimestampOffset=!0;a.streaming.stallSkip=0;return a};r.fc=function(a){return this.h==null?(Wa("WebOS: getConfigs call haven't finished"),Pj.prototype.fc.call(this,a)):this.h?a?"HLG":"PQ":"SDR"};
function hk(){var a=null,b=navigator.userAgent.match(/Chrome\/(\d+)/);b&&(a=parseInt(b[1],10));switch(a){case 38:return 3;case 53:return 4;case 68:return 5;case 79:return 6;case 87:return 22;case 94:return 23;case 108:return 24;case 120:return 25;case 132:return 26;default:return null}}r.Mi=function(){return!1};r.Kc=function(){var a=this.va();return a!==null?a>=6:Pj.prototype.Kc.call(this)};r.ld=function(){var a=this.va();return a!==null&&a<4?!1:Pj.prototype.ld.call(this)};
if(navigator.userAgent.includes("Web0S")){var ik=new gk;rb=function(){return ik}};function jk(){Pj.call(this);this.h=navigator.userAgent.includes("Edge/");var a=navigator.userAgent.match(/Edge?\/(\d+)/);this.i=a?parseInt(a[1],10):null}ta(jk,Pj);r=jk.prototype;r.va=function(){return this.i};r.kb=function(){return"Xbox"};r.Ka=function(){return"CONSOLE"};r.Ea=function(){return this.h?"EDGE":"CHROMIUM"};r.hd=function(){return!0};r.Ng=function(){return!0};r.Ne=function(){return!0};r.Ii=function(){return this.h};
r.Gb=function(){var a={width:1920,height:1080},b=kk();if(b)try{var c=new b.Media.Protection.ProtectionCapabilities,d=b.Media.Protection.ProtectionCapabilityResult;b=null;do b=c.isTypeSupported('video/mp4;codecs="hvc1,mp4a";features="decode-res-x=3840,decode-res-y=2160,decode-bitrate=20000,decode-fps=30,decode-bpc=10,display-res-x=3840,display-res-y=2160,display-bpc=8"',"com.microsoft.playready.recommendation");while(b===d.maybe);b===d.probably&&(a.width=3840,a.height=2160)}catch(e){Wa("Xbox: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(a)};
r.Va=function(a){Pj.prototype.Va.call(this,a);a.drm.parseInbandPsshEnabled=this.h;a.drm.preferredKeySystems.push("com.microsoft.playready");this.h&&(a.streaming.gapPadding=.01);return a};r.df=function(){return!0};function kk(){var a=null;try{a=typeof Windows!=="undefined"?Windows:chrome.webview.hostObjects.sync.Windows}catch(b){}return a}if(navigator.userAgent.includes("Xbox One")||kk()!==null)rb=function(){return new jk};function lk(a,b){var c=mk();this.u=a.maxAttempts==null?c.maxAttempts:a.maxAttempts;this.o=a.baseDelay==null?c.baseDelay:a.baseDelay;this.C=a.fuzzFactor==null?c.fuzzFactor:a.fuzzFactor;this.B=a.backoffFactor==null?c.backoffFactor:a.backoffFactor;this.h=0;this.i=this.o;this.m=b===void 0?!1:b;this.l=this.j=null;this.m&&(this.h=1)}
lk.prototype.attempt=function(){var a=this,b,c,d;return H(function(e){if(e.i==1){if(a.h>=a.u)if(a.m)a.h=1,a.i=a.o;else throw new L(2,7,1010);b=a.h;a.h++;if(b==0)return e.return();c=a.i*(1+(Math.random()*2-1)*a.C);d=Promise.withResolvers();a.j=d;a.l=nk(c,function(){a.j=null;a.l=null;d.resolve()});return e.h(d.promise,2)}a.i*=a.B;e.l()})};lk.prototype.stop=function(){var a;(a=this.l)==null||a.stop();this.l=null;var b;(b=this.j)==null||b.reject(new L(2,7,7001));this.j=null};
function mk(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:3E4,stallTimeout:5E3,connectionTimeout:1E4}}function nk(a,b){b=new $e(b);b.ha(a/1E3);return b};function ok(a,b){this.promise=a;this.j=b;this.h=null}function pk(a){return new ok(Promise.reject(a),function(){return Promise.resolve()})}function qk(){var a=Promise.reject(new L(2,7,7001));a.catch(function(){});return new ok(a,function(){return Promise.resolve()})}function rk(a){return new ok(Promise.resolve(a),function(){return Promise.resolve()})}da.Object.defineProperties(ok.prototype,{aborted:{configurable:!0,enumerable:!0,get:function(){return this.h!==null}}});
ok.prototype.abort=function(){this.h||(this.h=this.j());return this.h};ok.prototype.finally=function(a){this.promise.then(function(){return a(!0)},function(){return a(!1)});return this};
ok.prototype.Eb=function(a,b){function c(g){return function(h){if(e.h&&g)f.reject(new L(2,7,7001));else{var k=g?a:b;k?d=sk(k,h,f):(g?f.resolve:f.reject)(h)}}}function d(){f.reject(new L(2,7,7001));return e.abort()}var e=this,f=Promise.withResolvers();f.promise.catch(function(){});this.promise.then(c(!0),c(!1));return new ok(f.promise,function(){return d()})};
function sk(a,b,c){try{var d=a(b);if(d&&d.promise&&d.abort)return c.resolve(d.promise),function(){return d.abort()};c.resolve(d);return function(){return Promise.resolve(d).then(function(){},function(){})}}catch(e){return c.reject(e),function(){return Promise.resolve()}}}K("shaka.util.AbortableOperation",ok);ok.prototype.chain=ok.prototype.Eb;ok.prototype["finally"]=ok.prototype.finally;ok.all=function(a){return new ok(Promise.all(a.map(function(b){return b.promise})),function(){return Promise.all(a.map(function(b){return b.abort()}))})};
ok.prototype.abort=ok.prototype.abort;ok.notAbortable=function(a){return new ok(a,function(){return a.catch(function(){})})};ok.completed=rk;ok.aborted=qk;ok.failed=pk;function tk(a,b){if(b)if(b instanceof Map)for(var c=t(b.keys()),d=c.next();!d.done;d=c.next())d=d.value,Object.defineProperty(this,d,{value:b.get(d),writable:!0,enumerable:!0});else for(c in b)Object.defineProperty(this,c,{value:b[c],writable:!0,enumerable:!0});this.defaultPrevented=this.cancelable=this.bubbles=!1;this.timeStamp=window.performance&&window.performance.now?window.performance.now():Date.now();this.type=a;this.isTrusted=!1;this.target=this.currentTarget=null;this.h=!1}
tk.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)};tk.prototype.stopImmediatePropagation=function(){this.h=!0};tk.prototype.stopPropagation=function(){};K("shaka.util.FakeEvent",tk);function uk(){this.fb=new hb;this.nh=this}uk.prototype.addEventListener=function(a,b){this.fb&&this.fb.push(a,b)};uk.prototype.removeEventListener=function(a,b){this.fb&&this.fb.remove(a,b)};uk.prototype.dispatchEvent=function(a){if(!this.fb)return!0;var b=this.fb.get(a.type)||[],c=this.fb.get("__shaka_all_events__");c&&(b=b.concat(c));b=t(b);for(c=b.next();!c.done;c=b.next()){c=c.value;a.target=this.nh;a.currentTarget=this.nh;try{c.handleEvent?c.handleEvent(a):c.call(this,a)}catch(d){}if(a.h)break}return a.defaultPrevented};
uk.prototype.release=function(){this.fb=null};function vk(){this.h=[]}function wk(a,b){a.h.push(b.finally(function(){db(a.h,b)}))}vk.prototype.destroy=function(){for(var a=[],b=t(this.h),c=b.next();!c.done;c=b.next())c=c.value,c.promise.catch(function(){}),a.push(c.abort());this.h=[];return Promise.all(a)};function xk(a,b){var c=c===void 0?"":c;if(b.length==0)return a;var d=[];a=t(a);for(var e=a.next();!e.done;e=a.next()){e=e.value;for(var f=t(b),g=f.next();!g.done;g=f.next()){g=new URL(g.value,e);if(c){var h=c.replace(/^[?&]/,""),k=g.search.replace(/^\?/,"");g.search=k?k+"&"+h:h}d.push(g.toString())}}return d}function yk(a){try{var b=(new URL(a)).protocol.slice(0,-1);if(b&&a.toLowerCase().startsWith(b+":"))return b}catch(c){}return(a=a.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/))?a[1].toLowerCase():""}
function zk(a){if(/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(a))return a;try{return(new URL(a,typeof document!="undefined"&&document.baseURI||location.href)).toString()}catch(b){return a}}function Ak(a){try{var b=(new URL(a)).hostname;if(b)return b}catch(c){}return(a=a.match(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\/([^/?#]*)/))?a[1]:""}function Bk(a,b){a=new URL(a);a.hostname=b;return a.toString()}
function Ck(a,b){b=b==null?void 0:b();if(!b)return a;a=new URL(a);b=b.replace(/^[?&]/,"").split("&").filter(function(c){return c});Dk(a,b);return a.toString()}function Ek(a,b){if(!b.size)return a;a=new URL(a);var c=[];b=t(b.entries());for(var d=b.next();!d.done;d=b.next()){var e=t(d.value);d=e.next().value;e=e.next().value;c.push(encodeURIComponent(d)+"="+encodeURIComponent(e))}Dk(a,c);return a.toString()}
function Dk(a,b){function c(f){return f.split("=")[0]}var d=new Set(b.map(c)),e=a.search.replace(/^\?/,"").split("&").filter(function(f){return f&&!d.has(c(f))});a.search=e.concat(b).join("&")};function Fk(a,b,c,d,e,f,g){uk.call(this);this.j=null;this.l=!1;this.B=new vk;this.h=new Set;this.i=new Set;this.u=a||null;this.o=b||null;this.C=c||null;this.D=d||null;this.F=e||null;this.H=f||null;this.G=g||null;this.m=new Map}ta(Fk,uk);r=Fk.prototype;r.configure=function(a){this.j=a};function Gk(a,b,c,d){d=d===void 0?!1:d;c=c||Hk;var e=Ik.get(a);(!e||c>=e.priority)&&Ik.set(a,{priority:c,Ye:b,Mk:d})}
function Jk(a,b){for(var c=t(a.h),d=c.next();!d.done;d=c.next())b.h.add(d.value);a=t(a.i);for(c=a.next();!c.done;c=a.next())b.i.add(c.value)}r.Pk=function(a){this.h.add(a)};r.zl=function(a){this.h.delete(a)};r.gj=function(){this.h.clear()};r.Qk=function(a){this.i.add(a)};r.Al=function(a){this.i.delete(a)};r.hj=function(){this.i.clear()};r.Ah=function(){this.m.clear()};
function Kk(a,b,c){return{uris:a,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:b,licenseRequestType:null,sessionId:null,drmInfo:null,initData:null,initDataType:null,streamDataCallback:c===void 0?null:c,attempt:0}}r.destroy=function(){this.l=!0;this.h.clear();this.i.clear();this.m.clear();uk.prototype.release.call(this);return this.B.destroy()};
r.request=function(a,b,c){var d=this,e=new Lk;if(this.l){var f=Promise.reject(new L(2,7,7001));f.catch(function(){});return new Mk(f,function(){return Promise.resolve()},e)}b.method=b.method||"GET";b.headers=b.headers||{};f=nd(b.headers);b.retryParameters=b.retryParameters?nd(b.retryParameters):mk();b.uris=nd(b.uris);b.attempt=0;f=Nk(this,a,b,c,new lk(b.retryParameters,!1),null,e,f);var g=f.Eb(function(l){return Ok(d,a,l,c)}),h=0;f.promise.then(function(){h=Date.now()},function(){});var k=g.Eb(function(l){var m=
l.response;m.timeMs+=Date.now()-h;l.hk||!d.u||m.fromCache||b.method=="HEAD"||a!=Pk||d.u(m.timeMs,m.data.byteLength,Qk(c),b,c);d.G&&d.G(a,m,c);return m},function(l){l&&(l.severity=2);throw l;});e=new Mk(k.promise,function(){return k.abort()},e);wk(this.B,e);return e};
function Rk(a,b,c,d){function e(h){f=f.Eb(function(){c.body&&(c.body=xb(c.body));return h(b,c,d)})}var f=rk(void 0);a.F&&e(a.F);a=t(a.h);for(var g=a.next();!g.done;g=a.next())e(g.value);return f.Eb(void 0,function(h){if(h instanceof L&&h.code==7001)throw h;throw new L(2,1,1006,h);})}
function Nk(a,b,c,d,e,f,g,h){var k=c.attempt%c.uris.length;c.headers=nd(h);var l=Rk(a,b,c,d),m=Date.now(),n=0;l.promise.then(function(){n=Date.now()-m},function(){});c.uris[k]=zk(c.uris[k]);a.j.forceHTTP&&(c.uris[k]=c.uris[k].replace("https://","http://"));a.j.forceHTTPS&&(c.uris[k]=c.uris[k].replace("http://","https://"));k>0&&a.H&&a.H(b,d,c.uris[k],c.uris[k-1]);var p=!1,u=yk(c.uris[k]),q=(u=Ik.get(u))?u.Ye:null;if(!q)return pk(new L(2,1,1E3,c.uris[k]));var v=u.Mk;(u=a.m.get(Ak(c.uris[k])))&&(c.headers[a.j.commonAccessTokenHeaderName]=
u);var w=null,y=null,x=!1,z=!1,D;return l.Eb(function(){var B=e.attempt();return new ok(B,function(){e.stop();return B.catch(function(){})})}).Eb(function(){if(a.l)return qk();D=Date.now();var B=0;c.requestStartTime=Date.now();var A=q(c.uris[k],c,b,function(F,G,J){w&&w.stop();y&&y.ha(C/1E3);a.u&&b==Pk&&(B++,c.packetNumber=B,a.u(F,G,Qk(d),c,d),p=!0,g.h=J)},function(F){z=!0;c.timeToFirstByte=Date.now()-c.requestStartTime;a.o&&a.o(F,c,b)},{minBytesForProgressEvents:a.j.minBytesForProgressEvents});if(!v)return A;
var E=c.retryParameters.connectionTimeout;E&&(w=new $e(function(){x=!0;A.abort()}),w.ha(E/1E3));var C=c.retryParameters.stallTimeout;C&&(y=new $e(function(){x=!0;A.abort()}));return A}).Eb(function(B){w&&w.stop();y&&y.stop();B.timeMs==void 0&&(B.timeMs=Date.now()-D,B.timeMs+=n);var A=B.headers[a.j.commonAccessTokenHeaderName];A&&a.m.set(Ak(B.uri),A);A={response:B,hk:p};!z&&a.o&&a.o(B.headers,c,b);a.C&&a.C(b,c,d,B);return A},function(B){w&&w.stop();y&&y.stop();if(a.D){var A=null,E=0;B instanceof L&&
(A=B,B.code==1001&&(E=B.data[1]));a.D(b,c,d,A,E,x)}if(a.l)return qk();x&&(B=new L(1,1,1003,c.uris[k],b));if(B instanceof L){if(B.code==7001)throw B;if(B.code==1010)throw f;if(B.severity==1){A=(new Map).set("error",B);A=new tk("retry",A);A.cancelable=!0;a.dispatchEvent(A);if(A.defaultPrevented)throw B;++c.attempt;return Nk(a,b,c,d,e,B,g,h)}}throw B;})}
function Ok(a,b,c,d){var e=rk(void 0);a=t(a.i);for(var f=a.next(),g={};!f.done;g={ti:void 0},f=a.next())g.ti=f.value,e=e.Eb(function(h){return function(){var k=c.response;k.data&&(k.data=xb(k.data));return(0,h.ti)(b,k,d)}}(g));return e.Eb(function(){return c},function(h){var k=2;if(h instanceof L){if(h.code==7001)throw h;k=h.severity}throw new L(k,1,1007,h);})}function Qk(a){if(a){var b=a.segment;a=a.stream;if(b&&a&&a.fastSwitching&&b.Fc)return!1}return!0}K("shaka.net.NetworkingEngine",Fk);
Fk.prototype.request=Fk.prototype.request;Fk.prototype.destroy=Fk.prototype.destroy;Fk.makeRequest=Kk;Fk.defaultRetryParameters=function(){return mk()};Fk.prototype.clearCommonAccessTokenMap=Fk.prototype.Ah;Fk.prototype.clearAllResponseFilters=Fk.prototype.hj;Fk.prototype.unregisterResponseFilter=Fk.prototype.Al;Fk.prototype.registerResponseFilter=Fk.prototype.Qk;Fk.prototype.clearAllRequestFilters=Fk.prototype.gj;Fk.prototype.unregisterRequestFilter=Fk.prototype.zl;
Fk.prototype.registerRequestFilter=Fk.prototype.Pk;Fk.unregisterScheme=function(a){Ik.delete(a)};Fk.registerScheme=Gk;Fk.prototype.configure=Fk.prototype.configure;function Lk(){this.h=0}Fk.NumBytesRemainingClass=Lk;function Mk(a,b,c){ok.call(this,a,b);this.i=c}ta(Mk,ok);Fk.PendingRequest=Mk;var Pk=1,Sk={MANIFEST:0,SEGMENT:Pk,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5,KEY:6,ADS:7,CONTENT_STEERING:8,CMCD:9,SESSION_DATA:10,FINGERPRINT:11,PLAYLIST:12,EVENT_CALLBACK:13};Fk.RequestType=Sk;
Fk.AdvancedRequestType={INIT_SEGMENT:0,MEDIA_SEGMENT:1,MEDIA_PLAYLIST:2,MASTER_PLAYLIST:3,MPD:4,MPD_PATCH:6,MEDIATAILOR_SESSION_INFO:7,MEDIATAILOR_TRACKING_INFO:8,MEDIATAILOR_STATIC_RESOURCE:9,MEDIATAILOR_TRACKING_EVENT:10,INTERSTITIAL_ASSET_LIST:11,INTERSTITIAL_AD_URL:12,TRACKING_EVENT:13,XLINK:14,LINKED_MPD:15};var Hk=3;Fk.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:Hk};var Ik=new Map;function Tk(a){this.h=!1;this.i=Promise.withResolvers();this.j=a}Tk.prototype.destroy=function(){var a=this;if(this.h)return this.i.promise;this.h=!0;return this.j().then(function(){a.i.resolve()},function(){a.i.resolve()})};function Uk(a,b){if(a.h){if(b instanceof L&&b.code==7003)throw b;throw new L(2,7,7003,b);}};function Vk(a,b){var c=[];a=t(a);for(var d=a.next();!d.done;d=a.next())c.push(b(d.value));return c}function Wk(a,b){a=t(a);for(var c=a.next();!c.done;c=a.next())if(!b(c.value))return!1;return!0};function Xk(a){for(var b=new Map,c=t(Object.keys(a)),d=c.next();!d.done;d=c.next())d=d.value,b.set(d,a[d]);return b}function Yk(a){var b={};a.forEach(function(c,d){b[d]=c});return b};function Zk(a){var b=this;this.h=[];this.data=[];(new hh).ma(["moov","moof"],mh).P("pssh",function(c){if(!(c.version>1)){var d=yb(c.reader.i,-12,c.size);b.data.push(d);c=c.reader.wa(16,!1);b.h.push(Rb(c))}}).parse(a)};function $k(a){var b=this;this.F=a;this.u=this.B=null;this.T=!1;this.K=0;this.h=null;this.C=new ib;this.j=new Map;this.Y=[];this.D=new Map;this.L=!1;this.m=Promise.withResolvers();this.i=null;this.o=function(c){c.severity==2&&b.m.reject(c);a.onError(c)};this.Z=new Map;this.ka=new Map;this.M=new $e(function(){return al(b)});this.ba=!1;this.N=[];this.na=!1;this.G=new $e(function(){bl(b)});this.m.promise.catch(function(){});this.l=new Tk(function(){return cl(b)});this.O=!1;this.H=this.I=null;this.V=
function(){return!1}}r=$k.prototype;r.destroy=function(){return this.l.destroy()};
function cl(a){var b;return H(function(c){switch(c.i){case 1:return a.C.release(),a.C=null,a.m.reject(),a.G.stop(),a.G=null,a.M.stop(),a.M=null,c.h(dl(a),2);case 2:if(!a.u){c.A(3);break}if(!a.B){c.A(4);break}c.o(5);return c.h(a.u.setMediaKeys(null),7);case 7:c.u(4);break;case 5:b=c.m(),Wa("DrmEngine.destroyNow_ exception",b);case 4:a.u=null;case 3:a.h=null,a.B=null,a.D=new Map,a.i=null,a.o=function(){},a.F=null,a.O=!1,a.I=null,c.l()}})}
r.configure=function(a,b){this.i=a;b&&(this.V=b);this.G&&this.T&&this.h&&this.G.La(this.i.updateExpirationTime)};function el(a,b,c,d){d=d===void 0?!0:d;a.D=new Map;c=t(c);for(var e=c.next();!e.done;e=c.next())a.D.set(e.value,{initData:null,initDataType:null});c=t(a.i.persistentSessionsMetadata);for(e=c.next();!e.done;e=c.next())e=e.value,a.D.set(e.sessionId,{initData:e.initData,initDataType:e.initDataType});a.ba=a.D.size>0;return fl(a,b,d)}
function fl(a,b,c){var d,e,f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D;return H(function(B){if(B.i==1){gl(a.i.clearKeys,b);d=b.some(function(A){return A.video&&A.video.drmInfos.length||A.audio&&A.audio.drmInfos.length?!0:!1});e=Xk(a.i.servers);f=Xk(a.i.advanced||{});!d&&c&&hl(b,e);g=new WeakSet;h=t(b);for(k=h.next();!k.done;k=h.next())for(l=k.value,m=il(l),n=t(m),p=n.next();!p.done;p=n.next())u=p.value,g.has(u)||(g.add(u),jl(u,e,f,a.i.keySystemsMapping));q=function(A,E){var C=[];A=t(A);for(var F=A.next();!F.done;F=
A.next()){F=F.value;var G=F[E]||f.has(F.keySystem)&&f.get(F.keySystem)[E]||"";G==""&&ac(F.keySystem)&&(E=="audioRobustness"?G=[a.i.defaultAudioRobustnessForWidevine]:E=="videoRobustness"&&(G=[a.i.defaultVideoRobustnessForWidevine]));if(typeof G==="string")C.push(F);else if(Array.isArray(G)){G.length===0&&(G=[""]);G=t(G);for(var J=G.next();!J.done;J=G.next()){var Q={};C.push(Object.assign({},F,(Q[E]=J.value,Q)))}}}return C};v=new WeakSet;w=t(b);for(y=w.next();!y.done;y=w.next())x=y.value,x.video&&
!v.has(x.video)&&(x.video.drmInfos=q(x.video.drmInfos,"videoRobustness"),x.video.drmInfos=q(x.video.drmInfos,"audioRobustness"),v.add(x.video)),x.audio&&!v.has(x.audio)&&(x.audio.drmInfos=q(x.audio.drmInfos,"videoRobustness"),x.audio.drmInfos=q(x.audio.drmInfos,"audioRobustness"),v.add(x.audio));return B.h(uf(b,a.ba,a.O,a.i.preferredKeySystems),2)}Uk(a.l);z=d||e.size>0;if(!z)return a.T=!0,B.return(Promise.resolve());D=kl(a,b);return B.return(d?D:D.catch(function(){}))})}
function ll(a){var b;return H(function(c){switch(c.i){case 1:if(a.u.mediaKeys)return c.return();if(!a.I){c.A(2);break}return c.h(a.I,3);case 3:return Uk(a.l),c.return();case 2:return c.o(4),a.I=a.u.setMediaKeys(a.B),c.h(a.I,6);case 6:c.u(5);break;case 4:b=c.m(),a.o(new L(2,6,6003,b.message));case 5:Uk(a.l),c.l()}})}function ml(a,b){return H(function(c){if(c.i==1)return c.h(ll(a),2);nl(a,b.initDataType,yb(b.initData));c.l()})}
r.wb=function(a){var b=this,c,d,e,f;return H(function(g){if(g.i==1){if(b.u===a)return g.return();if(!b.B)return b.C.Ra(a,"encrypted",function(){b.o(new L(2,6,6010))}),g.return();c=ob();b.u=a;b.i.delayLicenseRequestUntilPlayed&&b.C.Ra(b.u,"play",function(){for(var h=t(b.N),k=h.next();!k.done;k=h.next())ol(b,k.value);b.na=!0;b.N=[]});(d=Qj(c,b.u))?b.C.Jb(d,["connect","connecting","disconnect"],function(){dl(b)}):"webkitCurrentPlaybackTargetIsWireless"in b.u&&b.C.J(b.u,"webkitcurrentplaybacktargetiswirelesschanged",
function(){return dl(b)});b.H=b.h?b.h.initData.find(function(h){return h.initData.length>0})||null:null;e=b.h.keySystem;return(f=c.wg(e))||!b.H&&b.h.keySystem==="com.apple.fps"&&!b.D.size?g.A(2):g.h(ll(b),2)}pl(b).catch(function(){});!f&&(b.H||b.D.size||b.i.parseInbandPsshEnabled)||b.C.J(b.u,"encrypted",function(h){return ml(b,h)});g.l()})};
function ql(a){var b,c,d,e,f;return H(function(g){switch(g.i){case 1:if(!a.B||!a.h)return g.return();if(!a.h.serverCertificateUri||a.h.serverCertificate&&a.h.serverCertificate.length){g.A(2);break}b=Kk([a.h.serverCertificateUri],a.i.retryParameters);g.o(3);c=a.F.Ec.request(5,b,{isPreload:a.V()});return g.h(c.promise,5);case 5:d=g.j;a.h.serverCertificate=yb(d.data);g.u(4);break;case 3:throw e=g.m(),new L(2,6,6017,e);case 4:if(a.l.h)return g.return();case 2:if(!a.h.serverCertificate||!a.h.serverCertificate.length)return g.return();
g.o(6);return g.h(a.B.setServerCertificate(a.h.serverCertificate),8);case 8:g.u(0);break;case 6:throw f=g.m(),new L(2,6,6004,f.message);}})}
function pl(a){var b,c,d,e,f;return H(function(g){if(g.i==1){if(!a.D.size)return g.A(2);a.D.forEach(function(h,k){rl(a,k,h)});return g.h(a.m.promise,3)}if(g.i!=2){b=a.h&&a.h.keyIds||new Set([]);if(b.size>0&&sl(a))return g.return(a.m.promise);a.L=!1;a.m=Promise.withResolvers();a.m.promise.catch(function(){})}c=(a.h?a.h.initData:[])||[];d=t(c);for(e=d.next();!e.done;e=d.next())f=e.value,nl(a,f.initDataType,f.initData);tl(a)&&a.m.resolve();return g.return(a.m.promise)})}
function nl(a,b,c){if(!a.l.h&&c.length){try{c=a.i.initDataTransform(c,b,a.h)}catch(g){b=g;g instanceof L||(b=new L(2,6,6016,g));a.o(b);return}if(a.i.ignoreDuplicateInitData){var d=a.j.values();d=t(d);for(var e=d.next();!e.done;e=d.next())if(wb(c,e.value.initData))return;var f=!1;a.D.forEach(function(g){!f&&wb(c,g.initData)&&(f=!0)});if(f)return}a.L=!0;a.j.size>0&&tl(a)&&(a.m.resolve(),a.L=!1,a.m=Promise.withResolvers(),a.m.promise.catch(function(){}));ul(a,b,c,a.h.sessionType)}}
r.ag=function(){var a=this,b=this.j.keys();b=Vk(b,function(c){var d=a.j.get(c);return{sessionId:c.sessionId,sessionType:d.type,initData:d.initData,initDataType:d.initDataType}});return Array.from(b)};r.Lg=function(a){var b=this;this.j.forEach(function(c,d){a!=void 0&&d.sessionId!=a||vl(b,d)})};
r.Pg=function(a,b){b=b===void 0?.1:b;var c=this,d,e,f,g,h;return H(function(k){switch(k.i){case 1:Uk(c.l);e=d=null;c.j.forEach(function(l,m){m.sessionId===a.sessionId&&(d=m,e=l)});if(!(d&&e&&c.h&&e.initData&&e.initDataType))return k.return(!1);f=e.initData;g=e.initDataType;if(!(b>0)){k.A(2);break}return k.h(ef(b),2);case 2:return k.o(4),c.j.delete(d),k.h(wl(c,d),6);case 6:h=ul(c,g,f,c.h.sessionType,!1);if(!h)throw new L(2,6,6005,"Failed to create new session for license retry");return k.return(!0);
case 4:return k.m(),k.return(!1)}})};r.cg=function(){var a=Infinity,b=this.j.keys();b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,isNaN(c.expiration)||(a=Math.min(a,c.expiration));return a};function xl(a){return a.K?a.K:NaN}r.Sb=function(){return this.h};r.Ie=function(){return Yk(this.ka)};
function kl(a,b){var c,d,e,f,g,h,k;return H(function(l){switch(l.i){case 1:c=new Map;d=yl(a,b,c);if(!d){if(!navigator.requestMediaKeySystemAccess)throw new L(2,6,6020);throw new L(2,6,6001);}Uk(a.l);l.o(2);d.getConfiguration();e=a.i.keySystemsMapping[d.keySystem]||d.keySystem;a.h=zl(a,e,c.get(e));if(!a.h.licenseServerUri)throw new L(2,6,6012,a.h.keySystem);return l.h(d.createMediaKeys(),4);case 4:f=l.j;Uk(a.l);a.B=f;if(!(a.i.minHdcpVersion!=""&&"getStatusForPolicy"in a.B)){l.A(5);break}l.o(6);return l.h(a.B.getStatusForPolicy({minHdcpVersion:a.i.minHdcpVersion}),
8);case 8:g=l.j;if(g!="usable")throw new L(2,6,6018);Uk(a.l);l.u(5,2);break;case 6:h=l.m(2);if(h instanceof L)throw h;throw new L(2,6,6019,h.message);case 5:return a.T=!0,a.G.La(a.i.updateExpirationTime),l.h(ql(a),9);case 9:Uk(a.l);l.u(0);break;case 2:k=l.m();Uk(a.l,k);a.h=null;if(k instanceof L)throw k;throw new L(2,6,6002,k.message);}})}
function yl(a,b,c){for(var d=t(b),e=d.next();!e.done;e=d.next()){e=t(il(e.value));for(var f=e.next();!f.done;f=e.next())f=f.value,c.getOrInsertComputed(f.keySystem,function(){return[]}).push(f)}if(c.size==1&&c.has(""))throw new L(2,6,6E3);d=a.i.preferredKeySystems;d.length||(e=Xk(a.i.servers),e.size==1&&(d=Array.from(e.keys())));e=t(d);var g=e.next();for(f={};!g.done;f={oi:void 0},g=e.next()){f.oi=g.value;g=t(b);for(var h=g.next();!h.done;h=g.next())if(h=h.value.decodingInfos.find(function(n){return function(p){return p.supported&&
p.keySystemAccess!=null&&p.keySystemAccess.keySystem==n.oi}}(f)))return h.keySystemAccess}e=t([!0,!1]);for(f=e.next();!f.done;f=e.next())for(f=f.value,g=t(b),h=g.next();!h.done;h=g.next()){h=t(h.value.decodingInfos);for(var k=h.next();!k.done;k=h.next())if(k=k.value,k.supported&&k.keySystemAccess){var l=k.keySystemAccess.keySystem;if(!d.includes(l)){var m=c.get(l);!m&&a.i.keySystemsMapping[l]&&(m=c.get(a.i.keySystemsMapping[l]));l=t(m);for(m=l.next();!m.done;m=l.next())if(!!m.value.licenseServerUri==
f)return k.keySystemAccess}}}return null}function Al(a){tl(a)&&a.m.resolve()}function Bl(a,b){(new $e(function(){b.loaded=!0;Al(a)})).ha(Cl)}
function rl(a,b,c){var d,e,f,g,h,k,l;H(function(m){switch(m.i){case 1:try{d=a.B.createSession("persistent-license")}catch(n){return e=new L(2,6,6005,n.message),a.o(e),m.return(Promise.reject(e))}a.C.J(d,"message",function(n){Dl(a)?a.N.push(n):ol(a,n)});a.C.J(d,"keystatuseschange",function(n){return El(a,n)});f={initData:c.initData,initDataType:c.initDataType,loaded:!1,zg:Infinity,rb:null,type:"persistent-license",Md:0,Uh:!1};a.j.set(d,f);m.o(2);return m.h(d.load(b),4);case 4:return g=m.j,Uk(a.l),
g||(a.j.delete(d),h=a.i.persistentSessionOnlinePlayback?1:2,a.o(new L(h,6,6013)),f.loaded=!0),Bl(a,f),Al(a),m.return(d);case 2:k=m.m(),Uk(a.l,k),a.j.delete(d),l=a.i.persistentSessionOnlinePlayback?1:2,a.o(new L(l,6,6005,k.message)),f.loaded=!0,Al(a);case 3:return m.return(Promise.resolve())}})}
function ul(a,b,c,d,e){e=e===void 0?!1:e;if(a.l.h)return null;try{var f=a.B.createSession(d)}catch(g){return a.o(new L(2,6,6005,g.message)),null}a.C.J(f,"message",function(g){Dl(a)?a.N.push(g):ol(a,g)});a.C.J(f,"keystatuseschange",function(g){return El(a,g)});a.j.set(f,{initData:c,initDataType:b,loaded:!1,zg:Infinity,rb:null,type:d,Md:0,Uh:e});f.closed.then(function(g){if(!a.l.h){var h=a.j.get(f);if(h){var k=f;g=g||"unknown";g!=="unknown"&&(a.j.delete(k),Fl(a,g,h))}}}).catch(function(){});a.i.logLicenseExchange&&
Ob(c);f.generateRequest(b,c).catch(function(g){if(!a.l.h){a.j.delete(f);var h=g.errorCode;if(h&&h.systemCode){var k=h.systemCode;k<0&&(k+=4294967296);k="0x"+k.toString(16)}a.o(new L(2,6,6006,g.message,g,k))}});return f}function Dl(a){return a.u?a.i.delayLicenseRequestUntilPlayed&&a.u.paused&&!a.na:a.i.delayLicenseRequestUntilPlayed}function Gl(a){return H(function(b){return b.i==1?!a.L||Dl(a)?b.A(0):b.h(a.m.promise,3):b.h(Promise.all(a.Y.map(function(c){return c.promise})),0)})}
function ol(a,b){var c,d,e,f,g,h,k,l,m,n,p,u,q,v,w,y,x;H(function(z){switch(z.i){case 1:c=b.target;a.i.logLicenseExchange&&Ob(b.message);d=a.j.get(c);e=a.h.licenseServerUri;f=a.i.advanced[a.h.keySystem];b.messageType=="individualization-request"&&f&&f.individualizationServer&&(e=f.individualizationServer);g=Kk([e],a.i.retryParameters);g.body=b.message;g.method="POST";g.licenseRequestType=b.messageType;g.sessionId=c.sessionId;g.drmInfo=a.h;d&&(g.initData=d.initData,g.initDataType=d.initDataType,d.Uh&&
(g.licenseRequestType="license-renewal"));if(f&&f.headers)for(h in f.headers)g.headers[h]=f.headers[h];if(k=$b(a.h.keySystem)){var D=g,B=a.h;try{var A=Ib(D.body);if(A){var E=JSON.parse(A);E.type||(E.type=B.sessionType,D.body=Jb(JSON.stringify(E)))}}catch(C){}}if(bc(a.h.keySystem))if(D=Gb(g.body,!0,!0),D.includes("PlayReadyKeyMessage")){D=qd(D,"PlayReadyKeyMessage");B=Dd(D,"HttpHeader");B=t(B);for(A=B.next();!A.done;A=B.next())E=A.value,A=Dd(E,"name")[0],E=Dd(E,"value")[0],g.headers[Cd(A)]=Cd(E);D=
Dd(D,"Challenge")[0];g.body=Pb(Cd(D))}else g.headers["Content-Type"]="text/xml; charset=utf-8";l=Date.now();z.o(2);n=a.F.Ec.request(2,g,{isPreload:a.V()});a.Y.push(n);return z.h(n.promise,4);case 4:m=z.j;db(a.Y,n);z.u(3);break;case 2:p=z.m();if(a.l.h)return z.return();u={sessionId:c.sessionId,sessionType:d.type,initData:d.initData,initDataType:d.initDataType};q=new L(2,6,6007,p,u);if(a.i.failureCallback)try{a.i.failureCallback(q)}catch(C){}if(q.handled)return d&&d.rb&&d.rb.reject(q),z.return();a.j.size==
1?(a.o(q),d&&d.rb&&d.rb.reject(q)):(d&&d.rb&&d.rb.reject(q),a.j.delete(c),wl(a,c),tl(a)&&(a.m.resolve(),a.M.ha(.1)));return z.return();case 3:if(a.l.h)return z.return();a.K+=(Date.now()-l)/1E3;a.i.logLicenseExchange&&Ob(m.data);k&&Hl(a,m);z.o(5);return z.h(c.update(m.data),7);case 7:d&&(d.Md=Date.now()/1E3);z.u(6);break;case 5:return w=(v=z.m())&&v.message||String(v),y=new L(2,6,6008,w),a.o(y),d&&d.rb&&d.rb.reject(y),z.return();case 6:if(a.l.h)return z.return();x=new tk("drmsessionupdate");a.F.onEvent(x);
d&&(d.rb&&d.rb.resolve(),Bl(a,d));z.l()}})}function Hl(a,b){b=Fb(b.data);try{var c=JSON.parse(b),d=new Map(c.keys.map(function(l){var m=l.kid;l=l.k;return[fc(m),fc(l)]}));if(a.h.clearKeys)for(var e=t(d),f=e.next();!f.done;f=e.next()){var g=t(f.value),h=g.next().value,k=g.next().value;a.h.clearKeys.set(h,k)}else a.h.clearKeys=d}catch(l){}}
function El(a,b){b=b.target;var c=a.j.get(b),d=!1;b.keyStatuses.forEach(function(f,g){if(typeof g=="string"){var h=g;g=f;f=h}h=ob();if(bc(a.h.keySystem)&&g.byteLength==16&&h.df()){h=Bb(g);var k=h.getUint32(0,!0),l=h.getUint16(4,!0),m=h.getUint16(6,!0);h.setUint32(0,k,!1);h.setUint16(4,l,!1);h.setUint16(6,m,!1)}c&&f!="status-pending"&&(c.loaded=!0);f=="expired"&&(d=!0);g=Rb(g).slice(0,32);a.Z.set(g,f)});var e=b.expiration-Date.now();(e<0||d&&e<1E3)&&c&&!c.rb&&(a.j.delete(b),wl(a,b));tl(a)&&(a.m.resolve(),
a.M.ha(Il))}function al(a){var b=a.Z,c=a.ka;c.clear();b.forEach(function(d,e){return c.set(e,d)});b=Array.from(c.values());b.length&&b.every(function(d){return d=="expired"})&&a.o(new L(2,6,6014));a.F.li(Yk(c))}
function Jl(){var a,b,c,d,e,f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D,B,A,E,C,F,G,J;return H(function(Q){if(Q.i==1){a="org.w3.clearkey com.widevine.alpha com.microsoft.playready com.microsoft.playready.hardware com.microsoft.playready.recommendation com.microsoft.playready.recommendation.3000 com.microsoft.playready.recommendation.3000.clearlead com.chromecast.playready com.apple.fps.1_0 com.apple.fps com.huawei.wiseplay".split(" ");if(!(window.MediaKeys&&window.navigator&&window.navigator.requestMediaKeySystemAccess&&
window.MediaKeySystemAccess&&window.MediaKeySystemAccess.prototype.getConfiguration)){b={};c=t(a);for(d=c.next();!d.done;d=c.next())e=d.value,b[e]=null;return Q.return(b)}f="1.0 1.1 1.2 1.3 1.4 2.0 2.1 2.2 2.3".split(" ");g=["SW_SECURE_CRYPTO","SW_SECURE_DECODE","HW_SECURE_CRYPTO","HW_SECURE_DECODE","HW_SECURE_ALL"];h=["150","2000","3000"];k={"com.widevine.alpha":g,"com.widevine.alpha.experiment":g,"com.microsoft.playready.recommendation":h};l=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}];
m=[{contentType:'audio/mp4; codecs="mp4a.40.2"'},{contentType:'audio/webm; codecs="opus"'}];n={videoCapabilities:l,audioCapabilities:m,initDataTypes:["cenc","sinf","skd","keyids"]};p=[null,"cenc","cbcs"];u=new Map;q=ob();v=function(O,V,M){var N,P,U,ea,ha,I,T,R,S,X,ka,ma,Aa;return H(function(ja){switch(ja.i){case 1:return ja.o(2),ja.h(V.createMediaKeys(),5);case 5:N=ja.j;case 4:ja.u(3);break;case 2:return ja.m(),ja.return();case 3:U=(P=V.getConfiguration().sessionTypes)?P.includes("persistent-license"):
!1;q.di()&&(U=!1);ea=V.getConfiguration().videoCapabilities;ha=V.getConfiguration().audioCapabilities;I={persistentState:U,encryptionSchemes:[],videoRobustnessLevels:[],audioRobustnessLevels:[],minHdcpVersions:[]};u.get(O)?I=u.get(O):u.set(O,I);(T=ea[0].encryptionScheme)&&!I.encryptionSchemes.includes(T)&&I.encryptionSchemes.push(T);(R=ea[0].robustness)&&!I.videoRobustnessLevels.includes(R)&&I.videoRobustnessLevels.push(R);(S=ha[0].robustness)&&!I.audioRobustnessLevels.includes(S)&&I.audioRobustnessLevels.push(S);
if(!(M&&"getStatusForPolicy"in N)){ja.A(0);break}X=t(f);ka=X.next();case 7:if(ka.done){ja.A(0);break}ma=ka.value;if(I.minHdcpVersions.includes(ma)){ja.A(8);break}return ja.h(N.getStatusForPolicy({minHdcpVersion:ma}),10);case 10:if(Aa=ja.j,Aa=="usable")I.minHdcpVersions.includes(ma)||I.minHdcpVersions.push(ma);else{ja.A(0);break}case 8:ka=X.next(),ja.A(7)}})};w=function(O,V,M,N,P){P=P===void 0?!1:P;var U,ea,ha,I,T,R,S,X,ka,ma,Aa;return H(function(ja){switch(ja.i){case 1:ja.o(2);U=nd(n);ea=t(U.videoCapabilities);
for(ha=ea.next();!ha.done;ha=ea.next())I=ha.value,I.encryptionScheme=V,I.robustness=M;T=t(U.audioCapabilities);for(R=T.next();!R.done;R=T.next())S=R.value,S.encryptionScheme=V,S.robustness=N;X=nd(U);X.persistentState="required";X.sessionTypes=["persistent-license"];ka=[X,U];Aa=ob();return Aa.Ka()=="MOBILE"?ja.h(df(5,navigator.requestMediaKeySystemAccess(O,ka)),7):ja.h(navigator.requestMediaKeySystemAccess(O,ka),6);case 6:ma=ja.j;ja.A(5);break;case 7:ma=ja.j;case 5:return ja.h(v(O,ma,P),8);case 8:ja.u(0);
break;case 2:ja.m(),ja.l()}})};y=[];x=t(a);for(z=x.next();!z.done;z=x.next()){D=z.value;u.set(D,null);B=!0;A=t(p);for(E=A.next();!E.done;E=A.next())C=E.value,y.push(w(D,C,"","",B)),B=!1;F=t(k[D]||[]);for(G=F.next();!G.done;G=F.next())J=G.value,y.push(w(D,null,J,"")),y.push(w(D,null,"",J))}return Q.h(Promise.all(y),2)}return Q.return(Yk(u))})}
function wl(a,b){var c,d;return H(function(e){switch(e.i){case 1:return c=null,e.o(2),e.h(df(Kl,Promise.all([b.close().catch(function(){}),b.closed])),4);case 4:d=e.j;c=d[1];e.u(3);break;case 2:e.m();case 3:c&&c!=="unknown"&&Fl(a,c),e.l()}})}
function Fl(a,b,c){if(b==="internal-error")a.o(new L(2,6,6005,"CDM reported internal error"));else if(b!=="closed-by-application"&&b!=="release-acknowledged"&&b!=="resource-evicted"&&b==="hardware-context-reset"&&c)if(c.initDataType&&c.initData)try{ul(a,c.initDataType,c.initData,c.type)}catch(d){a.o(new L(2,6,6005,"Failed to recreate session after hardware context reset: "+d.message))}else a.o(new L(2,6,6005,"Cannot recreate session after hardware reset: missing metadata"))}
function dl(a){var b;return H(function(c){b=Array.from(a.j.entries());a.j.clear();return c.h(Promise.all(b.map(function(d){d=t(d);var e=d.next().value;var f=d.next().value;return H(function(g){if(g.i==1)return g.o(2),a.D.has(e.sessionId)||f.type!=="persistent-license"||a.i.persistentSessionOnlinePlayback?g.h(wl(a,e),5):g.h(e.remove(),5);if(g.i!=2)return g.u(0);g.m();g.l()})})),0)})}function il(a){return(a.video?a.video.drmInfos:[]).concat(a.audio?a.audio.drmInfos:[])}
function bl(a){var b=Date.now()/1E3;a.j.forEach(function(c,d){var e=c.zg,f=d.expiration;isNaN(f)&&(f=Infinity);f!=e&&(a.F.onExpirationUpdated(d.sessionId,f),c.zg=f);a.i.renewalIntervalSec>0&&(e=b-c.Md,c.Md>0&&e>=a.i.renewalIntervalSec&&vl(a,d))})}
function vl(a,b){var c,d,e,f,g,h,k,l;H(function(m){switch(m.i){case 1:if(c=a.j.get(b))c.Md=Date.now()/1E3;if(!a.h)return m.return();d=a.h.keySystem;e=b;f={sessionId:b.sessionId,sessionType:a.h.sessionType,initData:c?c.initData:null,initDataType:c?c.initDataType:null};m.o(2);return cc(d)?(g=Jb("renew"),m.h(b.update(g),5)):bc(d)&&c&&c.initData&&c.initDataType?m.h(Ll(a,b,c),7):(Wa("Manual license renewal is not supported for "+d),m.return());case 7:e=m.j;m.A(5);break;case 5:m.u(3);break;case 2:return m.m(),
m.return();case 3:h=a.j.get(e),k={sessionId:e.sessionId,sessionType:a.h.sessionType,initData:h?h.initData:null,initDataType:h?h.initDataType:null},l=new tk("licenserenewal",(new Map).set("oldSessionMetadata",f).set("newSessionMetadata",k)),a.F.onEvent(l),m.l()}})}
function Ll(a,b,c){var d;return H(function(e){if(e.i==1)return a.j.delete(b),e.h(wl(a,b),2);d=ul(a,c.initDataType,c.initData,a.h.sessionType,!0);if(!d)throw new L(2,6,6005,"Failed to create new session for renewal");return e.return(d)})}function tl(a){a=a.j.values();return Wk(a,function(b){return b.loaded})}function sl(a){for(var b=t(a.h&&a.h.keyIds||new Set([])),c=b.next();!c.done;c=b.next())if(a.Z.get(c.value)!=="usable")return!1;return!0}
function hl(a,b){var c=[];b.forEach(function(d,e){c.push({keySystem:e,licenseServerUri:d,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",initData:[],keyIds:new Set})});a=t(a);for(b=a.next();!b.done;b=a.next())b=b.value,b.video&&(b.video.drmInfos=c),b.audio&&(b.audio.drmInfos=c)}
function zl(a,b,c){var d=[],e=[],f=[],g=[],h=[],k=new Set,l=new Set;Ml(c,d,e,g,f,h,k,l);a=a.ba?"persistent-license":"temporary";b={keySystem:b,encryptionScheme:d[0],licenseServerUri:e[0],distinctiveIdentifierRequired:c[0].distinctiveIdentifierRequired,persistentStateRequired:c[0].persistentStateRequired,sessionType:c[0].sessionType||a,audioRobustness:c[0].audioRobustness||"",videoRobustness:c[0].videoRobustness||"",serverCertificate:g[0],serverCertificateUri:f[0],initData:h,keyIds:k,mediaTypes:c[0].mediaTypes};
l.size>0&&(b.keySystemUris=l);c=t(c);for(l=c.next();!l.done;l=c.next())l=l.value,l.distinctiveIdentifierRequired&&(b.distinctiveIdentifierRequired=l.distinctiveIdentifierRequired),l.persistentStateRequired&&(b.persistentStateRequired=l.persistentStateRequired);return b}
function Ml(a,b,c,d,e,f,g,h){var k=[];a=t(a);for(var l=a.next(),m={};!l.done;m={Ja:void 0},l=a.next()){m.Ja=l.value;b.includes(m.Ja.encryptionScheme)||b.push(m.Ja.encryptionScheme);$b(m.Ja.keySystem)&&m.Ja.licenseServerUri.startsWith("data:application/json;base64,")?k.includes(m.Ja.licenseServerUri)||k.push(m.Ja.licenseServerUri):c.includes(m.Ja.licenseServerUri)||c.push(m.Ja.licenseServerUri);e.includes(m.Ja.serverCertificateUri)||e.push(m.Ja.serverCertificateUri);m.Ja.serverCertificate&&(d.some(function(u){return function(q){return wb(q,
u.Ja.serverCertificate)}}(m))||d.push(m.Ja.serverCertificate));if(m.Ja.initData){l=t(m.Ja.initData);for(var n=l.next(),p={};!n.done;p={jg:void 0},n=l.next())p.jg=n.value,f.some(function(u){return function(q){var v=u.jg;return q.keyId&&q.keyId==v.keyId?!0:q.initDataType==v.initDataType&&wb(q.initData,v.initData)}}(p))||f.push(p.jg)}if(m.Ja.keyIds)for(l=t(m.Ja.keyIds),n=l.next();!n.done;n=l.next())g.add(n.value);if(m.Ja.keySystemUris&&h)for(m=t(m.Ja.keySystemUris),l=m.next();!l.done;l=m.next())h.add(l.value)}if(k.length==
1)c.push(k[0]);else if(k.length>0){b=[];k=t(k);for(d=k.next();!d.done;d=k.next())d=window.atob(d.value.split("data:application/json;base64,").pop()),d=JSON.parse(d),b.push.apply(b,wa(d.keys));k=JSON.stringify({keys:b});c.push("data:application/json;base64,"+window.btoa(k))}}
function jl(a,b,c,d){var e=a.keySystem;if(e&&(!$b(e)||!Xb(a))){b.size&&b.get(e)&&(b=b.get(e),a.licenseServerUri=b);a.keyIds||(a.keyIds=new Set);if(c=c.get(e))a.distinctiveIdentifierRequired||(a.distinctiveIdentifierRequired=c.distinctiveIdentifierRequired),a.persistentStateRequired||(a.persistentStateRequired=c.persistentStateRequired),a.serverCertificate||(a.serverCertificate=c.serverCertificate),c.sessionType&&(a.sessionType=c.sessionType),a.serverCertificateUri||(a.serverCertificateUri=c.serverCertificateUri);
d[e]&&(a.keySystem=d[e]);window.cast&&window.cast.__platform__&&e=="com.microsoft.playready"&&(a.keySystem="com.chromecast.playready")}}function gl(a,b){a=Xk(a);if(a.size!=0){a=vc(a);b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,c.video&&(c.video.drmInfos=[a]),c.audio&&(c.audio.drmInfos=[a])}}var Kl=1,Cl=5,Il=.5;function Nl(){}function Ol(a){a=Ib(a);return Ak(a)}function Pl(a,b,c){function d(h){Bb(f).setUint32(g,h.byteLength,!0);g+=4;f.set(yb(h),g);g+=h.byteLength}if(!c||!c.byteLength)throw new L(2,6,6015);var e;typeof b=="string"?e=Kb(b,!0):e=b;a=Ib(a);a=Kb(a,!0);var f=new Uint8Array(12+a.byteLength+e.byteLength+c.byteLength),g=0;d(a);d(e);d(c);return f}function Ql(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=Ib(a).split("skd://").pop();return Pl(a,c,b)}
function Rl(a,b){a!==2||b.attempt>0||(a=b.drmInfo)&&cc(a.keySystem)&&(b.headers["Content-Type"]="application/octet-stream")}K("shaka.drm.FairPlay",Nl);
Nl.commonFairPlayResponse=function(a,b){if(a===2&&(a=b.originalRequest.drmInfo)&&cc(a.keySystem)){try{var c=Fb(b.data)}catch(e){return}a=!1;c=c.trim();c.substr(0,5)==="<ckc>"&&c.substr(-6)==="</ckc>"&&(c=c.slice(5,-6),a=!0);if(!a)try{var d=JSON.parse(c);d.ckc&&(c=d.ckc,a=!0);d.CkcMessage&&(c=d.CkcMessage,a=!0);d.License&&(c=d.License,a=!0)}catch(e){}a&&(b.data=xb(Pb(c)))}};
Nl.gumletFairPlayRequest=function(a,b){a!==2||b.attempt>0||(a=b.drmInfo)&&cc(a.keySystem)&&b.body&&(a=yb(b.body),a=Ob(a),b.body=Jb(JSON.stringify({Om:a})),b.headers["Content-Type"]="application/json")};Nl.muxFairPlayRequest=function(a,b){Rl(a,b)};Nl.expressplayFairPlayRequest=function(a,b){Rl(a,b)};Nl.conaxFairPlayRequest=function(a,b){Rl(a,b)};Nl.ezdrmFairPlayRequest=function(a,b){Rl(a,b)};
Nl.verimatrixFairPlayRequest=function(a,b){a!==2||b.attempt>0||(a=b.drmInfo)&&cc(a.keySystem)&&(a=yb(b.body),a=Ob(a),b.headers["Content-Type"]="application/x-www-form-urlencoded",b.body=Jb("spc="+a))};Nl.muxInitDataTransform=function(a,b,c){return Ql(a,b,c)};Nl.expressplayInitDataTransform=function(a,b,c){return Ql(a,b,c)};
Nl.conaxInitDataTransform=function(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=Ib(a).split("skd://").pop().split("?").shift();c=window.atob(c);var d=new ArrayBuffer(c.length*2);d=Ab(d);for(var e=0,f=c.length;e<f;e++)d[e]=c.charCodeAt(e);return Pl(a,d,b)};Nl.ezdrmInitDataTransform=function(a,b,c){if(b!=="skd")return a;b=c.serverCertificate;c=Ib(a).split(";").pop();return Pl(a,c,b)};Nl.verimatrixInitDataTransform=function(a,b,c){return Ql(a,b,c)};Nl.initDataTransform=Pl;
Nl.defaultGetContentId=Ol;Nl.isFairPlaySupported=function(){var a;return H(function(b){if(b.i==1)return a={initDataTypes:["cenc","sinf","skd"],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'}]},b.o(2),b.h(navigator.requestMediaKeySystemAccess("com.apple.fps",[a]),4);if(b.i!=2)return b.return(!0);b.m();return b.return(!1)})};function Sl(a){var b=0,c=Bb(a),d=c.getUint32(b,!0);if(d!=a.byteLength)return[];a:{a=b+4+2;for(b=[];a<c.byteLength-1;){d=c.getUint16(a,!0);a+=2;var e=c.getUint16(a,!0);a+=2;if((e&1)!=0||e+a>c.byteLength){c=[];break a}var f=yb(c,a,e);b.push({type:d,value:f});a+=e}c=b}return c}function Tl(a){a=Sl(a).find(function(b){return b.type===Ul});if(!a)return null;a=Gb(a.value,!0);return(a=qd(a,"WRMHEADER"))?a:null}
function Vl(a){try{var b=Tl(a);if(b)a:{for(var c=t(Dd(b,"DATA")),d=c.next();!d.done;d=c.next()){var e=d.value;if(e.children)for(var f=t(e.children),g=f.next();!g.done;g=f.next()){var h=g.value;if(h.tagName=="LA_URL"){var k=Cd(h);break a}}}k=""}else k="";return k}catch(l){return""}}var Ul=1;function Wl(a,b,c){this.type=a;this.W=b;this.segments=c||null}function Xl(a,b,c,d){this.id=a;this.name=b;this.attributes=c;this.value=d===void 0?null:d}Xl.prototype.toString=function(a){function b(e){return e.name+"="+(isNaN(Number(e.value))?'"'+e.value+'"':e.value)}var c="#"+this.name,d=this.attributes?this.attributes.filter(function(e){return a?!a.has(e.name):!0}).map(b):[];this.value&&d.unshift(this.value);d.length>0&&(c+=":"+d.join(","));return c};
function Yl(a,b){return a.attributes.find(function(c){return c.name===b})||null}function Y(a,b,c){return(a=Yl(a,b))?a.value:c||null}function Zl(a,b){a=Yl(a,b);if(!a)throw new L(2,4,4023,b);return a.value}function $l(a,b,c){c=c===void 0?[]:c;this.W=b;this.h=a;this.Gc=c}function am(a,b){this.name=a;this.value=b};function bm(a,b){return a.filter(function(c){return c.name==b})}function cm(a,b){return a.filter(function(c){return Zl(c,"TYPE")==b})}function dm(a,b){a=t(a);for(var c=a.next();!c.done;c=a.next())if(c=c.value,c.name===b)return c;return null}function em(a,b,c){c=c===void 0?0:c;return(a=dm(a,b))?Number(a.value):c}function fm(a,b,c){return b?gm(a,[b],c):[]}function gm(a,b,c){if(!b.length)return[];var d=b;c&&c.size&&(d=b.map(function(e){return hm(e,c)}));return xk(a,d)}
function hm(a,b){if(!b||!b.size)return a;a=String(a).replace(/%7B/g,"{").replace(/%7D/g,"}");var c=a.match(/{\$\w*}/g);if(c){c=t(c);for(var d=c.next();!d.done;d=c.next()){d=d.value;var e=d.slice(2,d.length-1),f=b.get(e);if(f)a=a.replace(d,f);else throw new L(2,4,4039,e);}}return a}function im(a){a=a.value;var b=a.indexOf(",");return Number(b===-1?a:a.substring(0,b))}function jm(a){return(a=Y(a,"SUPPLEMENTAL-CODECS"))?a.split(/\s*,\s*/).map(function(b){return b.split("/")[0]}).join(","):""};function km(){this.h=0}
function lm(a,b){var c=Fb(b).trim().split(/[\r\n]+/);if(!c[0].startsWith("#EXTM3U"))throw new L(2,4,4015);b=0;for(var d=!1,e=[],f=!0,g=0;g<c.length;g++){var h=c[g],k=c[g+1];if(h.startsWith("#")&&!h.startsWith("#EXT")||f)f=!1;else{h=mm(a,h);d||(nm.has(h.name)?(b=1,d=!0):h.name=="EXT-X-STREAM-INF"||h.name=="EXT-X-MEDIA"?d=!0:om.has(h.name)&&(b=1,d=!0));if(om.has(h.name)){if(b!=1)throw new L(2,4,4017);f=a;a=Array(Math.max(100,Math.floor((c.length-g)/2)));d=0;h=[];var l=[];for(k=null;g<c.length;g++){var m=
c[g];if(m.startsWith("#EXT"))if(m=mm(f,m),nm.has(m.name))e.push(m);else if(m.name=="EXT-X-MAP")k=m;else if(m.name=="EXT-X-PART")l.push(m);else if(m.name=="EXT-X-PRELOAD-HINT")switch(Y(m,"TYPE")){case "PART":l.push(m);break;case "MAP":m.name="EXT-X-MAP";k=m;break;case "KEY":e.push(m)}else h.push(m);else if(!m.startsWith("#")||m.startsWith("#EXT"))m=m.trim(),k&&h.push(k),h=new $l(m,h,l),d<a.length?a[d++]=h:(a.push(h),d++),h=[],l=[]}l.length&&(k&&h.push(k),c=new $l("",h,l),d<a.length?a[d++]=c:(a.push(c),
d++));return new Wl(b,e,d<a.length?a.slice(0,d):a)}e.push(h);h.name=="EXT-X-STREAM-INF"&&(h.attributes.push(new am("URI",k)),f=!0)}}return new Wl(b,e)}
function mm(a,b){a=a.h++;var c=b.indexOf(":"),d=c===-1?b.substring(1):b.substring(1,c);if(!d.startsWith("EXT"))throw new L(2,4,4016,b);b=c===-1?null:b.substring(c+1);if(b===null)a=new Xl(a,d,[]);else if(b.indexOf("=")===-1)a=new Xl(a,d,[],b);else{c=[];var e=null,f=0,g=b.indexOf(","),h=b.indexOf("=");g!==-1&&g<h&&(e=b.substring(0,g),f=g+1);for(;f<b.length;){for(;b[f]===" ";)f++;h=b.indexOf("=",f);if(h===-1)break;g=b.substring(f,h);f=h+1;if(b[f]==='"'){f++;var k=b.indexOf('"',f);h=k===-1?b.substring(f):
b.substring(f,k);f=k===-1?b.length:k+1}else k=b.indexOf(",",f),h=k===-1?b.substring(f):b.substring(f,k),f=k===-1?b.length:k;f<b.length&&b[f]===","&&f++;c.push(new am(g,h))}a=new Xl(a,d,c,e)}return a}var nm=new Set("EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST EXT-X-SERVER-CONTROL EXT-X-SKIP EXT-X-PART-INF EXT-X-DATERANGE".split(" ")),om=new Set("EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE EXT-X-MAP EXT-X-GAP EXT-X-TILES".split(" "));function pm(a,b,c,d,e,f,g,h){this.S=a;this.startByte=b;this.endByte=c;this.bd=d===void 0?null:d;this.timescale=e===void 0?null:e;this.i=f===void 0?null:f;this.aesKey=g===void 0?null:g;this.h=this.mimeType=this.codecs=null;this.encrypted=h===void 0?!1:h}pm.prototype.hc=function(){return this.startByte};pm.prototype.ec=function(){return this.endByte};pm.prototype.Ud=function(a){this.i=a};pm.prototype.xc=function(){return this.i};
function qm(a,b){return a===b?!0:a&&b?a.hc()==b.hc()&&a.ec()==b.ec()&&gb(a.S().sort(),b.S().sort())&&wb(a.xc(),b.xc()):a==b}K("shaka.media.InitSegmentReference",pm);pm.prototype.getEndByte=pm.prototype.ec;pm.prototype.getStartByte=pm.prototype.hc;
function rm(a,b,c,d,e,f,g,h,k,l,m,n,p,u,q,v){l=l===void 0?[]:l;u=u===void 0?sm:u;this.startTime=a;this.l=this.endTime=b;this.G=c;this.startByte=d;this.endByte=e;this.initSegmentReference=f;this.m=g;this.F=h;this.D=k;this.i=l;this.tilesLayout=m===void 0?"":m;this.C=n===void 0?null:n;this.h=p===void 0?null:p;this.status=u;this.preload=!1;this.j=!0;this.u=!1;this.aesKey=q===void 0?null:q;this.thumbnailSprite=null;this.discontinuitySequence=-1;this.o=v===void 0?!1:v;this.Ld=this.Fc=!1;a=t(this.i);for(b=
a.next();!b.done;b=a.next())b.value.bi();this.o&&this.i.length&&this.i[this.i.length-1].$h();this.B=this.bandwidth=this.mimeType=this.codecs=null;this.I=!1;this.H=null}r=rm.prototype;r.S=function(){return this.G()};r.getStartTime=function(){return this.startTime};r.Ij=function(){return this.endTime};r.hc=function(){return this.startByte};r.ec=function(){return this.endByte};
function tm(a){if(a.endByte)return a.endByte+1-a.startByte;if(a.bandwidth){var b=a.bandwidth*(a.endTime-a.startTime);if(!isNaN(b)&&b>0)return b}if(a.i.length>0&&a.o)for(a=t(a.i),a=a.next();!a.done;a=a.next()){tm(a.value);break}return null}r.ek=function(){return this.tilesLayout};r.dk=function(){return this.C};r.Ib=function(){return this.status};r.yk=function(){this.status=um};r.sg=function(){this.preload=!0};r.isPreload=function(){return this.preload};r.ai=function(){this.j=!1};r.lk=function(){return this.j};
r.bi=function(){this.Fc=!0};r.pk=function(){return this.Fc};r.$h=function(){this.Ld=!0};r.nk=function(){return this.Ld};r.Zh=function(){this.u=!0};r.ik=function(){return this.u};r.Gi=function(a){this.thumbnailSprite=a};r.bk=function(){return this.thumbnailSprite};r.offset=function(a){this.startTime+=a;this.endTime+=a;this.l+=a;for(var b=t(this.i),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.l+=a};
r.Zg=function(a){this.h==null?Va("Sync attempted without sync time!"):(a=this.h-a-this.startTime,Math.abs(a)>=.001&&this.offset(a))};r.Ud=function(a,b){this.B=a;this.I=b===void 0?!1:b};r.xc=function(a){var b=this.B;(a===void 0||a)&&this.I&&(this.B=null);return b};r.Tg=function(a){this.H=a};r.getMetadata=function(){return this.H};K("shaka.media.SegmentReference",rm);rm.prototype.getMetadata=rm.prototype.getMetadata;rm.prototype.setMetadata=rm.prototype.Tg;rm.prototype.getSegmentData=rm.prototype.xc;
rm.prototype.setSegmentData=rm.prototype.Ud;rm.prototype.syncAgainst=rm.prototype.Zg;rm.prototype.offset=rm.prototype.offset;rm.prototype.getThumbnailSprite=rm.prototype.bk;rm.prototype.setThumbnailSprite=rm.prototype.Gi;rm.prototype.hasByterangeOptimization=rm.prototype.ik;rm.prototype.markAsByterangeOptimization=rm.prototype.Zh;rm.prototype.isLastPartial=rm.prototype.nk;rm.prototype.markAsLastPartial=rm.prototype.$h;rm.prototype.isPartial=rm.prototype.pk;rm.prototype.markAsPartial=rm.prototype.bi;
rm.prototype.isIndependent=rm.prototype.lk;rm.prototype.markAsNonIndependent=rm.prototype.ai;rm.prototype.isPreload=rm.prototype.isPreload;rm.prototype.markAsPreload=rm.prototype.sg;rm.prototype.markAsUnavailable=rm.prototype.yk;rm.prototype.getStatus=rm.prototype.Ib;rm.prototype.getTileDuration=rm.prototype.dk;rm.prototype.getTilesLayout=rm.prototype.ek;rm.prototype.getEndByte=rm.prototype.ec;rm.prototype.getStartByte=rm.prototype.hc;rm.prototype.getEndTime=rm.prototype.Ij;
rm.prototype.getStartTime=rm.prototype.getStartTime;rm.prototype.getUris=rm.prototype.S;var sm=0,um=1;rm.Status={Jl:sm,om:um,Tl:2};function vm(a,b,c,d){this.j=a;this.H=b;this.u=this.o=Infinity;this.i=d===void 0?1:d;this.h=this.m=null;this.F=0;this.C=!0;this.M=!1;this.K=0;this.I=c===void 0?!0:c;this.L=!1;this.D=0;this.B=!1;this.l=a;this.G=[]}r=vm.prototype;r.getDuration=function(){return this.o};r.Oj=function(){return this.i};r.Ci=function(a){this.j=a};r.sc=function(a){this.o=a;a!=Infinity&&(this.u=Infinity)};r.Vj=function(){return this.j};r.hl=function(a){this.F=a};
r.hf=function(a){a&&!this.C&&(this.M=!0);if(this.C=a)this.u=Infinity};r.Fi=function(a){this.isLive()&&(this.u=a)};r.Ke=function(){return this.u};r.zi=function(a){this.L=a};r.Ai=function(a){this.H=a};r.Hj=function(){return this.H};
r.Gk=function(a,b){if(a.length!=0){var c=(Date.now()+this.F)/1E3;a=a.filter(function(e){return e.start+b<c});if(a.length!=0){var d=a[a.length-1].end+b;this.Ve(a[0].start+b);this.i=a.reduce(function(e,f){return Math.max(e,f.end-f.start)},this.i);this.h=Math.max(this.h,d);this.j!=null&&this.I&&!this.B&&(this.j=c-this.h-this.i)}}};
r.ki=function(a){if(a.length!=0){var b=a[0].startTime,c=a[0].endTime,d=(Date.now()+this.F)/1E3;a=t(a);for(var e=a.next();!e.done;e=a.next())e=e.value,d<e.startTime||(b=Math.min(b,e.startTime),c=Math.max(c,e.endTime),this.i=Math.max(this.i,e.endTime-e.startTime));this.Ve(b);this.h=Math.max(this.h,c);this.j!=null&&this.I&&!this.B&&(this.j=d-this.h-this.i)}};r.Fk=function(a,b){this.Ve(a);b==Infinity||this.isLive()||(this.h=Math.max(this.h,b))};r.Pj=function(){return this.h};r.Xh=function(){this.B=!0};
r.rk=function(){return this.B};r.Bi=function(a){this.l=a};r.Mj=function(){return this.l};r.Di=function(a){this.G=a};r.gg=function(a){if(!this.G.length)return null;for(var b=this.G[0],c=t(this.G),d=c.next();!d.done;d=c.next())if(d=d.value,d.start<=a)b=d;else break;return b};r.Mh=function(a){var b=this.gg(a);return b?b.Fg+(a-b.start):this.l==null?null:this.l+a};r.Ve=function(a){this.m==null?this.m=a:this.M||(this.m=Math.min(this.m,a))};r.Ek=function(a){this.i=Math.max(this.i,a)};
r.offset=function(a){this.m!=null&&(this.m+=a);this.h!=null&&(this.h+=a)};r.isLive=function(){return this.o==Infinity&&!this.C};r.ad=function(){return this.o!=Infinity&&!this.C};r.oa=function(){return!this.C};r.Gd=function(){var a=this.Fd()-this.u;return Math.max(this.K,a)};r.Hi=function(a){this.K=a};r.Fd=function(){return this.oa()?Math.min(Math.max(0,(Date.now()+this.F)/1E3-this.i-this.j)+this.D,this.L&&this.h!=null?this.h+this.i+this.D:Infinity,this.o):this.h?Math.min(this.h,this.o):this.o};
r.Ed=function(a){var b=Math.max(this.m,this.K);if(this.u==Infinity)return Math.ceil(b*1E3)/1E3;var c=this.Fd()-this.u;a=Math.min(c+a,this.ob());return Math.max(b,a)};r.zb=function(){return this.Ed(0)};r.ob=function(){var a=this.oa()?this.H:0;return Math.max(0,this.Fd()-a)};r.Cl=function(){return this.j==null||this.h!=null&&this.I?!1:!0};r.fl=function(a){this.D=a};r.Dj=function(){return this.D};K("shaka.media.PresentationTimeline",vm);vm.prototype.getAvailabilityTimeOffset=vm.prototype.Dj;
vm.prototype.setAvailabilityTimeOffset=vm.prototype.fl;vm.prototype.usingPresentationStartTime=vm.prototype.Cl;vm.prototype.getSeekRangeEnd=vm.prototype.ob;vm.prototype.getSeekRangeStart=vm.prototype.zb;vm.prototype.getSafeSeekRangeStart=vm.prototype.Ed;vm.prototype.getSegmentAvailabilityEnd=vm.prototype.Fd;vm.prototype.setUserSeekStart=vm.prototype.Hi;vm.prototype.getSegmentAvailabilityStart=vm.prototype.Gd;vm.prototype.isDynamic=vm.prototype.oa;vm.prototype.isInProgress=vm.prototype.ad;
vm.prototype.isLive=vm.prototype.isLive;vm.prototype.offset=vm.prototype.offset;vm.prototype.notifyMaxSegmentDuration=vm.prototype.Ek;vm.prototype.notifyMinSegmentStartTime=vm.prototype.Ve;vm.prototype.getProgramDateTimeForTime=vm.prototype.Mh;vm.prototype.getProgramDateTimeRegionForTime=vm.prototype.gg;vm.prototype.setProgramDateTimeRegions=vm.prototype.Di;vm.prototype.getInitialProgramDateTime=vm.prototype.Mj;vm.prototype.setInitialProgramDateTime=vm.prototype.Bi;
vm.prototype.isStartTimeLocked=vm.prototype.rk;vm.prototype.lockStartTime=vm.prototype.Xh;vm.prototype.getMaxSegmentEndTime=vm.prototype.Pj;vm.prototype.notifyPeriodDuration=vm.prototype.Fk;vm.prototype.notifySegments=vm.prototype.ki;vm.prototype.notifyTimeRange=vm.prototype.Gk;vm.prototype.getDelay=vm.prototype.Hj;vm.prototype.setDelay=vm.prototype.Ai;vm.prototype.setClampLiveEdgeToSegments=vm.prototype.zi;vm.prototype.getSegmentAvailabilityDuration=vm.prototype.Ke;
vm.prototype.setSegmentAvailabilityDuration=vm.prototype.Fi;vm.prototype.setStatic=vm.prototype.hf;vm.prototype.setClockOffset=vm.prototype.hl;vm.prototype.getPresentationStartTime=vm.prototype.Vj;vm.prototype.setDuration=vm.prototype.sc;vm.prototype.setPresentationStartTime=vm.prototype.Ci;vm.prototype.getMaxSegmentDuration=vm.prototype.Oj;vm.prototype.getDuration=vm.prototype.getDuration;function wm(a){var b=this;this.l=a;this.i=new ib;this.h=new Set;this.j=(new $e(function(){xm(b,!1)})).hb();a.paused||this.j.La(.25);this.i.J(a,"playing",function(){b.j.hb().La(.25)});this.i.J(a,"pause",function(){b.j.stop()});this.i.J(a,"seeked",function(){b.j.hb();a.paused||b.j.La(.25)});this.i.J(a,"ended",function(){xm(b,!1,a.duration)})}wm.prototype.release=function(){this.i&&(this.i.release(),this.i=null);this.j.stop();for(var a=t(this.h),b=a.next();!b.done;b=a.next())b.value.release();this.h.clear()};
function xm(a,b,c){c=isFinite(c)?Number(c):a.l.currentTime;a=t(a.h);for(var d=a.next();!d.done;d=a.next())d.value.l(c,b)};function ym(a){uk.call(this);this.h=new Map;this.i=a}ta(ym,uk);ym.prototype.release=function(){this.h.clear();uk.prototype.release.call(this)};function zm(a,b){var c=a.h.get(b);c||(c={Sd:[],Gf:null,contentType:b},a.h.set(b,c));return c}function Am(a,b,c){var d=zm(a,b.contentType);Bm(a,d);a={bd:b,position:c};d=d.Sd;b=d.findIndex(function(e){return e.position>=c});b>=0?d.splice(b,d[b].position==c?1:0,a):d.push(a)}
ym.prototype.l=function(a){for(var b=t(this.h.values()),c=b.next();!c.done;c=b.next()){c=c.value;var d=c.Gf;a:{var e=c.Sd;for(var f=e.length-1;f>=0;f--){var g=e[f];if(g.position<=a){e=g.bd;break a}}e=null}f=e&&!(d===e||d&&e&&d.bandwidth==e.bandwidth&&d.audioSamplingRate==e.audioSamplingRate&&d.codecs==e.codecs&&d.contentType==e.contentType&&d.frameRate==e.frameRate&&d.height==e.height&&d.mimeType==e.mimeType&&d.channelsCount==e.channelsCount&&d.pixelAspectRatio==e.pixelAspectRatio&&d.width==e.width);
g=e&&d&&e.label&&d.label&&d.label!==e.label;var h=e&&d&&e.language&&d.language&&d.language!==e.language;d=e&&d&&e.roles&&d.roles&&!gb(d.roles,e.roles);(g||h||d)&&Cm(this,a,e.contentType)&&(c.Gf=e,d=new tk("audiotrackchange",new Map([["quality",e],["position",a]])),this.dispatchEvent(d));f&&Cm(this,a,e.contentType)&&(c.Gf=e,JSON.stringify(e),c=new tk("qualitychange",new Map([["quality",e],["position",a]])),this.dispatchEvent(c))}};
function Cm(a,b,c){return(a=a.i()[c])&&a.length>0&&(c=a[a.length-1].end,b>=a[0].start&&b<c)?!0:!1}function Bm(a,b){if((a=a.i()[b.contentType])&&a.length>0){var c=a[0].start,d=a[a.length-1].end,e=b.Sd;b.Sd=e.filter(function(f,g){return f.position<=c&&g+1<e.length&&e[g+1].position<=c||f.position>=d?!1:!0})}else b.Sd=[]}
function Dm(a){var b={bandwidth:a.bandwidth||0,audioSamplingRate:null,codecs:a.codecs,contentType:a.type,frameRate:null,height:null,mimeType:a.mimeType,channelsCount:null,pixelAspectRatio:null,width:null,label:null,roles:a.roles,language:null};a.type=="video"&&(b.frameRate=a.frameRate||null,b.height=a.height||null,b.pixelAspectRatio=a.pixelAspectRatio||null,b.width=a.width||null);a.type=="audio"&&(b.audioSamplingRate=a.audioSamplingRate,b.channelsCount=a.channelsCount,b.label=a.label||null,b.language=
a.language);return b};function Em(a){this.h=a;this.l=null;this.i=0;this.m=!1}r=Em.prototype;r.getNumReferences=function(){return this.h.length};r.getNumEvicted=function(){return this.i};r.release=function(){this.m||(this.h=[],this.l&&this.l.stop(),this.l=null)};r.zk=function(){this.m=!0};r.Rb=function(a){for(var b=t(this.h),c=b.next();!c.done;c=b.next())a(c.value)};function Hf(a){return a.h[0]||null}
r.find=function(a){var b=this.h.length-1;if(b<0)return null;if(a<this.h[0].startTime)return this.i;var c=fb(this.h,function(e){return e.startTime<=a})-1;if(c<0)return null;var d=this.h[c];b=c<b?this.h[c+1].startTime:d.endTime;return a>=d.startTime&&a<b?c+this.i:null};r.get=function(a){if(this.h.length==0)return null;a-=this.i;return a<0||a>=this.h.length?null:this.h[a]};r.offset=function(a){if(!this.m)for(var b=t(this.h),c=b.next();!c.done;c=b.next())c.value.offset(a)};
r.vg=function(a){if(!this.m&&a.length){var b=Math.round(a[0].startTime*1E3)/1E3,c=fb(this.h,function(d){return Math.round(d.startTime*1E3)/1E3<b});this.h.length=c;this.h.push.apply(this.h,wa(a))}};r.Od=function(a,b){for(var c=Math.max(b,this.h.length>0?this.h[0].startTime:-Infinity),d=0;d<a.length&&a[d].endTime<=c;)d++;d>0&&(a=a.slice(d));this.vg(a);this.yb(b)};r.yb=function(a){if(!this.m){var b=fb(this.h,function(c){return c.endTime<=a});b>0&&(this.i+=b,this.h=this.h.slice(b))}};
r.Ee=function(a,b,c){c=c===void 0?!1:c;if(!this.m){for(;this.h.length;)if(this.h[this.h.length-1].startTime>=b)this.h.pop();else break;var d=fb(this.h,function(e){return e.endTime<=a});d>0&&(c||(this.i+=d),this.h=this.h.slice(d));this.h.length!=0&&(c=this.h[this.h.length-1],b=new rm(c.startTime,b,c.G,c.startByte,c.endByte,c.initSegmentReference,c.m,c.F,c.D,c.i,c.tilesLayout,c.C,c.h,c.status,c.aesKey),b.mimeType=c.mimeType,b.codecs=c.codecs,b.discontinuitySequence=c.discontinuitySequence,this.h[this.h.length-
1]=b)}};r.fh=function(a,b){var c=this;this.m||(this.l&&this.l.stop(),this.l=new $e(function(){var d=b();d?c.h.push.apply(c.h,wa(d)):(c.l.stop(),c.l=null)}),this.l.La(a))};Em.prototype[Symbol.iterator]=function(){return this.mb(0)};
Em.prototype.mb=function(a,b,c){b=b===void 0?!1:b;c=c===void 0?!1:c;var d=this.find(a);if(d==null)return null;var e=this.get(d);c?d++:d--;var f=-1;if(e&&e.i.length>0)for(var g=e.i.length-1;g>=0;--g){var h=e.i[g];if(a>=h.startTime&&a<h.endTime){if(!b){for(;g&&!h.j;)g--,h=e.i[g];if(!h.j)return Va("No independent partial segment found!"),null}c?d--:d++;f=g-1;break}}return new Fm(this,d,f,c)};function Gm(a,b,c){a=new rm(a,a+b,function(){return c},0,null,null,a,a,a+b);return new Em([a])}
K("shaka.media.SegmentIndex",Em);Em.forSingleSegment=Gm;Em.prototype.getIteratorForTime=Em.prototype.mb;Em.prototype.updateEvery=Em.prototype.fh;Em.prototype.fit=Em.prototype.Ee;Em.prototype.evict=Em.prototype.yb;Em.prototype.mergeAndEvict=Em.prototype.Od;Em.prototype.offset=Em.prototype.offset;Em.prototype.get=Em.prototype.get;Em.prototype.find=Em.prototype.find;Em.prototype.markImmutable=Em.prototype.zk;Em.prototype.release=Em.prototype.release;Em.prototype.getNumEvicted=Em.prototype.getNumEvicted;
Em.prototype.getNumReferences=Em.prototype.getNumReferences;function Fm(a,b,c,d){this.j=a;this.i=b;this.h=c;this.reverse=d}r=Fm.prototype;r.jd=function(a){this.reverse=a};r.mj=function(){return this.i};r.current=function(){var a=this.j.get(this.i);a&&a.i.length>0&&a.o&&this.h>=a.i.length&&(this.i++,this.h=0,a=this.j.get(this.i));return a&&a.i.length>0?a.i[this.h]:a};
r.next=function(){var a=this.j.get(this.i);this.reverse?a&&a.i.length>0?(this.h--,this.h<0&&(this.i--,this.h=(a=this.j.get(this.i))&&a.i.length>0?a.i.length-1:0)):(this.i--,this.h=0):a&&a.i.length>0?(this.h++,a.o&&this.h==a.i.length&&(this.i++,this.h=0)):(this.i++,this.h=0);a=this.current();return{value:a,done:!a}};r.Og=function(){var a=this.current();if(a&&a.Fc&&!a.j&&(a=this.j.get(this.i))&&a.i.length>0)for(var b=a.i[this.h];b.j&&!(this.h<=0);)this.h--,b=a.i[this.h]};
K("shaka.media.SegmentIterator",Fm);Fm.prototype.resetToLastIndependent=Fm.prototype.Og;Fm.prototype.next=Fm.prototype.next;Fm.prototype.current=Fm.prototype.current;Fm.prototype.currentPosition=Fm.prototype.mj;Fm.prototype.setReverse=Fm.prototype.jd;function Hm(){Em.call(this,[]);this.j=[]}ta(Hm,Em);r=Hm.prototype;r.clone=function(){var a=new Hm;a.j=this.j.slice();a.i=this.i;return a};r.release=function(){this.j=[]};r.Rb=function(a){for(var b=t(this.j),c=b.next();!c.done;c=b.next())c.value.Rb(a)};
function Im(a,b){a=t(a.j);for(var c=a.next();!c.done;c=a.next())b(c.value)}r.find=function(a){for(var b=this.i,c=t(this.j),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.find(a);if(e!=null)return e+b;b+=d.getNumEvicted()+d.getNumReferences()}return null};function Jm(a,b){a=t(a.j);for(var c=a.next();!c.done&&c.value.find(b)==null;c=a.next());return-1}
r.get=function(a){for(var b=this.i,c=t(this.j),d=c.next();!d.done;d=c.next()){d=d.value;var e=d.get(a-b);if(e)return e;e=d.getNumReferences();b+=d.getNumEvicted()+e}return null};r.offset=function(){};r.vg=function(){};r.yb=function(a){if(this.j.length){var b=this.j[0];b.yb(a);b.getNumReferences()==0&&(this.j.shift(),this.i+=b.getNumEvicted(),b.release(),this.yb(a))}};r.Od=function(){};r.Ee=function(){};r.fh=function(){};K("shaka.media.MetaSegmentIndex",Hm);Hm.prototype.updateEvery=Hm.prototype.fh;
Hm.prototype.fit=Hm.prototype.Ee;Hm.prototype.mergeAndEvict=Hm.prototype.Od;Hm.prototype.evict=Hm.prototype.yb;Hm.prototype.merge=Hm.prototype.vg;Hm.prototype.offset=Hm.prototype.offset;Hm.prototype.get=Hm.prototype.get;Hm.prototype.find=Hm.prototype.find;Hm.prototype.forEachTopLevelReference=Hm.prototype.Rb;Hm.prototype.release=Hm.prototype.release;function Km(a){return Lm.getOrInsertComputed(a,function(){var b,c;return(c=(b=self.ManagedMediaSource||self.MediaSource)==null?void 0:b.isTypeSupported(a))!=null?c:!1})}function Mm(){var a=self.ManagedMediaSource||self.MediaSource;return a&&a.prototype?!!a.prototype.setLiveSeekableRange&&!!a.prototype.clearLiveSeekableRange:!1}var Lm=new Map;function Nm(a){var b=De(a),c=b.split("/")[0];a=Ee(a);return{type:c,mimeType:b,codecs:a,language:null,height:null,width:null,channelCount:null,sampleRate:null,closedCaptions:new Map,videoRange:null,colorGamut:null,frameRate:null,timescale:null,drmInfos:[]}}function Om(a){a=yb(a);var b=ki(a).length;return zj(a,b)?"audio/mpeg":Ri(a,b)?"audio/aac":Oi(a,b)?"audio/ac3":kj(a,b)?"audio/ec3":null}
function Pm(a,b,c){function d(I){F=I.name;var T=I.reader;T.skip(24);var R=T.xa(),S=T.xa();T.skip(50);q=String(R);u=String(S);I.reader.Wa()&&mh(I)}function e(I){var T=Hh(I.reader);v=T.channelCount;w=T.sampleRate;f(I.name);I.reader.Wa()&&mh(I)}function f(I){I=I.toLowerCase();switch(I){case "avc1":case "avc3":h.push(I+".42E01E");m=!0;break;case "hev1":case "hvc1":h.push(I+".1.6.L93.90");m=!0;break;case "dvh1":case "dvhe":h.push(I+".05.04");m=!0;break;case "vp09":h.push(I+".00.10.08");m=!0;break;case "av01":h.push(I+
".0.01M.08");m=!0;break;case "mp4a":g.push("mp4a.40.2");l=!0;break;case "ac-3":case "ec-3":case "ac-4":case "opus":case "flac":g.push(I);l=!0;break;case "apac":g.push("apac.31.00"),l=!0}}var g=[],h=[],k=[],l=!1,m=!1,n=!1,p=null,u=null,q=null,v=null,w=null,y=null,x=null,z=null,D=null,B=new Map,A=new Set,E=null,C=null,F,G=0,J=[],Q=new Map,O=null,V=new Map;if(a&&b){D=yb(a);var M=yb(b);M=Sb(D,M)}else b?M=yb(b):a&&(M=yb(a));var N;(new hh).ma([].concat(wa(sh),wa(th)),mh).P("tkhd",function(I){O=Gh(I.reader,
I.version).trackId}).P("mdhd",function(I){I=Eh(I.reader,I.version);p=I.language;O!==null&&Q.set(O,I.timescale)}).P("stsd",oh).P("tfhd",function(I){I=Ch(I.reader,I.flags);I.Fb&&(G=I.Fb)}).P("trun",function(I){J=Fh(I.reader,I.version,I.flags).nc}).box("mp4a",function(I){var T=Hh(I.reader);v=T.channelCount;w=T.sampleRate;I.reader.Wa()?mh(I):f(I.name)}).box("esds",function(I){I=I.reader;for(var T="mp4a",R,S;I.Wa();){R=I.X();for(var X=I.X();X&128;)X=I.X();if(R==3)I.xa(),X=I.X(),X&128&&I.xa(),X&64&&I.skip(I.X()),
X&32&&I.xa();else if(R==4)S=I.X(),I.skip(12);else if(R==5)break}S&&(T+="."+Nh(S),R==5&&I.Wa()&&(R=I.X(),S=(R&248)>>3,S===31&&I.Wa()&&(S=32+((R&7)<<3)+((I.X()&224)>>5)),T+="."+S));g.push(T);l=!0}).ma(xh,e).box("iacb",function(I){I=I.reader;if(I.X()!=1)I={codec:null};else{I=I.wa(I.Na()-I.Ia(),!1);var T=yh(I,0);if(T){T=I.subarray(T.size,T.size+T.value);I=[];for(var R=0;R<T.byteLength;){var S=R,X=T[R++],ka=X>>3,ma=(X&2)!=0;X=(X&1)!=0;var Aa=yh(T,R);if(!Aa)break;R+=Aa.size;Aa=R+Aa.value;if(Aa>T.byteLength)break;
if(ma){ma=yh(T,R);if(!ma)break;R+=ma.size;ma=yh(T,R);if(!ma)break;R+=ma.size}if(X){X=yh(T,R);if(!X)break;R+=X.size+X.value}if(R>Aa)break;I.push({type:ka,data:T.subarray(R,Aa),fullData:T.subarray(S,Aa)});R=Aa}R=T=null;I=t(I);for(S=I.next();!S.done;S=I.next()){S=S.value;switch(S.type){case 31:S.data.byteLength>=6&&(T=Jh(S.data[4],3)+"."+Jh(S.data[5],3));break;case 0:(ka=yh(S.data,0))&&S.data.byteLength>=ka.size+4&&(R=ka.size,R=String.fromCharCode(S.data[R],S.data[R+1],S.data[R+2],S.data[R+3]))}if(T&&
R)break}I=T&&R?{codec:"iamf."+T+"."+(R=="mp4a"?"mp4a.40.2":R)}:{codec:null}}else I={codec:null}}I.codec&&(g.push(I.codec),l=!0)}).ma([].concat(wa(vh),["vp09","av01"]),d).box("avcC",function(I){var T=F||"";switch(F){case "dvav":T="avc3";break;case "dva1":T="avc1"}I=I.reader;I.skip(1);I=T+"."+Nh(I.X())+Nh(I.X())+Nh(I.X());h.push(I);m=!0}).box("hvcC",function(I){var T=F||"";switch(F){case "dvh1":T="hvc1";break;case "dvhe":T="hev1"}var R=I.reader;R.skip(1);I=R.X();var S=["","A","B","C"][I>>6],X=I&31,
ka=R.R(),ma=(I&32)>>5?"H":"L";I=[R.X(),R.X(),R.X(),R.X(),R.X(),R.X()];R=R.X();for(var Aa=0,ja=0;ja<32;ja++){Aa|=ka&1;if(ja==31)break;Aa<<=1;ka>>=1}T=T+("."+S+X)+("."+Nh(Aa,!0));T+="."+ma+R;S="";for(X=I.length;X--;)if((ma=I[X])||S)S="."+ma.toString(16).toUpperCase()+S;T+=S;h.push(T);m=!0}).box("dvcC",function(I){var T=F||"";switch(F){case "hvc1":T="dvh1";break;case "hev1":T="dvhe";break;case "avc1":T="dva1";break;case "avc3":T="dvav";break;case "av01":T="dav1"}var R=I.reader;R.skip(2);I=R.X();R=R.X();
h.push(T+"."+Jh(I>>1&127,2)+"."+Jh(I<<5&32|R>>3&31,2));m=!0}).box("dvvC",function(I){var T=F||"";switch(F){case "hvc1":T="dvh1";break;case "hev1":T="dvhe";break;case "avc1":T="dva1";break;case "avc3":T="dvav";break;case "av01":T="dav1"}var R=I.reader;R.skip(2);I=R.X();R=R.X();h.push(T+"."+Jh(I>>1&127,2)+"."+Jh(I<<5&32|R>>3&31,2));m=!0}).P("vpcC",function(I){var T=F||"",R=I.reader;I=R.X();var S=R.X();R=R.X()>>4&15;h.push(T+"."+Jh(I,2)+"."+Jh(S,2)+"."+Jh(R,2));m=!0}).box("av1C",function(I){var T=F||
"";switch(F){case "dav1":T="av01"}I=Ih(T,I.reader);h.push(I.codec);m=!0}).ma(["wvtt","stpp"],function(I){k.push(I.name);n=!0}).box("c608",function(){V.set("CC1","CC1");O!==null&&Q.delete(O)}).box("enca",e).box("encv",d).box("sinf",mh).box("frma",function(I){I=Kh(I.reader).codec;f(I)}).box("colr",function(I){h=h.map(function(S){if(S.startsWith("av01.")){var X=I.reader,ka=X.Ia(),ma=X.wa(4,!1);var Aa=String.fromCharCode(ma[0]);Aa+=String.fromCharCode(ma[1]);Aa+=String.fromCharCode(ma[2]);Aa+=String.fromCharCode(ma[3]);
if(Aa==="nclx"){ma=X.xa();Aa=X.xa();var ja=X.xa(),ua=X.X()>>7,ub=S.split(".");ub.length==10&&(ub[6]=Jh(ma,2),ub[7]=Jh(Aa,2),ub[8]=Jh(ja,2),ub[9]=String(ua),S=ub.join("."))}X.seek(ka)}return S});var T=Mh(I.reader),R=T.colorGamut;y=T.videoRange;x=R}).P("schm",function(I){E=lh(I.reader.R())}).box("schi",mh).P("tenc",function(I){C=Lh(I.reader,I.version).defaultKID}).P("pssh",function(I){var T=yb(I.reader.i,-12,I.size),R=Rb(T);if(!A.has(R)&&(A.add(R),R=I.reader.wa(16,!1),R=Rb(R),N||(N=ec(!0)),R=N[R.toLowerCase()])){var S=
uc(R,"cenc",[{initDataType:"cenc",initData:T}]);if(bc(R)){var X=8;T=Bb(T);var ka=T.getUint8(X);X+=20;ka>0&&(X+=4+16*T.getUint32(X));T=yb(T,X+4);T=Vl(T);S.licenseServerUri=T}if(I.version>0)for(T=I.reader.R(),X=0;X<T;X++)ka=I.reader.wa(16,!1),S.keyIds.add(Rb(ka));B.set(R,S)}}).parse(M,!0,!0);if(!g.length&&!h.length&&!k.length)return null;D=Q.values().next().value;M=l&&!m;if(m&&!c&&b&&!V.size){c=new Rc("video/mp4");a&&c.init(a);try{Vc(c,b);for(var P=t(c.h.getStreams()),U=P.next();!U.done;U=P.next()){var ea=
U.value;V.set(ea,ea)}}catch(I){}c.h.clear()}a=g.concat(h).concat(k);E==="cbcs"&&C&&!B.has("com.apple.fps")&&B.set("com.apple.fps",uc("com.apple.fps",E,null));b=t(B.values());for(P=b.next();!P.done;P=b.next())P=P.value,E&&(P.encryptionScheme=E),C&&P.keyIds.add(C);b="video";P="video/mp4";n?(b="text",P="application/mp4"):M&&(b="audio",P="audio/mp4");if(b==="video"&&D!=null&&J.length){M=D;U=0;ea=t(J);for(c=ea.next();!c.done;c=ea.next()){var ha=void 0;U+=(ha=c.value.qc)!=null?ha:G}U>0&&(z=M*J.length/U)}return{type:b,
mimeType:P,codecs:Qm(a).join(", "),language:p,height:u,width:q,channelCount:v,sampleRate:w,closedCaptions:V,videoRange:y,colorGamut:x,frameRate:z,timescale:D,drmInfos:Array.from(B.values())}}function Qm(a){var b=new Set,c=[];a=t(a);for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=Ce(d);b.has(e)||(c.push(d),b.add(e))}b=Ac("audio",c);d=Ac("video",c);a=Ac(zc,c);d=Rm(d);b=b.concat(d).concat(a);return c.length&&!b.length?c:b}
function Rm(a){if(a.length<=1)return a;var b=a.find(function(c){return c.startsWith("dvav.")||c.startsWith("dva1.")||c.startsWith("dvh1.")||c.startsWith("dvhe.")||c.startsWith("dav1.")||c.startsWith("dvc1.")||c.startsWith("dvi1.")});return b?Km('video/mp4; codecs="'+b+'"')?[b]:a.filter(function(c){return c!=b}):a}
function Sm(a){var b=null;(new hh).ma([].concat(wa(sh),["sinf","schi"]),mh).P("stsd",oh).box("encv",ph).box("enca",qh).P("tenc",function(c){b=Lh(c.reader,c.version).defaultKID}).parse(a,!0);return b}
function Tm(a,b,c){var d,e,f,g,h,k,l,m,n;return H(function(p){if(p.i==1)return d=b,d.cryptoKey?p.A(2):p.h(d.fetchKey(),3);if(b.blockCipherMode=="GCM"&&b.bitsKey==256){e=yb(a);if(e.byteLength<32)throw new L(2,4,4060);f=e.slice(0,16);g=e.slice(16);h={name:"AES-GCM",iv:f,tagLength:128};return p.return(window.crypto.subtle.decrypt(h,d.cryptoKey,g))}k=d.iv;if(!k)for(k=yb(new ArrayBuffer(16)),l=d.firstMediaSequenceNumber+c,m=k.byteLength-1;m>=0;m--)k[m]=l&255,l>>=8;b.blockCipherMode=="CBC"?n={name:"AES-CBC",
iv:k}:n={name:"AES-CTR",counter:k,length:64};return p.return(window.crypto.subtle.decrypt(n,d.cryptoKey,a))})};function Um(){}function Vm(a,b){try{var c=Wm(a);return rk({uri:a,originalUri:a,data:c.data,headers:{"content-type":c.contentType},originalRequest:b})}catch(d){return pk(d)}}
function Wm(a){if(!a.startsWith("data:"))throw new L(2,1,1004,a);var b=a.substring(5),c=b.indexOf(",");if(c<0)throw new L(2,1,1004,a);a=b.substring(0,c);b=decodeURIComponent(b.substring(c+1));c=a.split(";");a=c[0];var d=!1;c.length>1&&c[c.length-1].toLowerCase()=="base64"&&(d=!0,c.pop());var e;d?e=Pb(b):e=Jb(b);return{data:e,contentType:a,eh:c}}K("shaka.net.DataUriPlugin",Um);Um.parse=Vm;Gk("data",Vm);function Xm(a,b,c){var d,e,f,g,h,k;return H(function(l){switch(l.i){case 1:var m;if(d=(m=Ym.get(Zm(a)))!=null?m:"")return l.return(d);e=0;f=Kk([a],c);l.o(2);f.method="HEAD";return l.h(b.request(e,f).promise,4);case 4:g=l.j;d=g.headers["content-type"];l.u(3);break;case 2:h=l.m();if(!h||h.code!=1002&&h.code!=1001){l.A(3);break}f.method="GET";return l.h(b.request(e,f).promise,6);case 6:k=l.j,d=k.headers["content-type"];case 3:return l.return(d?d.toLowerCase().split(";").shift():"")}})}
function Zm(a){for(var b=a.length,c=0;c<a.length;c++){var d=a.charCodeAt(c);if(d===63||d===35){b=c;break}}for(c=b-1;c>=0;c--){d=a.charCodeAt(c);if(d===46){if(c+1<b)return a.slice(c+1,b).toLowerCase();break}if(d===47)break}return""}function $m(a,b,c,d,e){a=Kk(a,d,e);if(b!=0||c!=null)a.headers.Range=c?"bytes="+b+"-"+c:"bytes="+b+"-";return a}
var Ym=(new Map).set("mp4","video/mp4").set("m4v","video/mp4").set("m4a","audio/mp4").set("cmfv","video/mp4").set("cmfa","audio/mp4").set("webm","video/webm").set("weba","audio/webm").set("mkv","video/webm").set("ts","video/mp2t").set("ogv","video/ogg").set("ogg","audio/ogg").set("opus","audio/opus").set("mpg","video/mpeg").set("mpeg","video/mpeg").set("mov","video/quicktime").set("m3u8","application/x-mpegurl").set("mpd","application/dash+xml").set("mp3","audio/mpeg").set("aac","audio/aac").set("flac",
"audio/flac").set("wav","audio/wav").set("srt","text/srt").set("vtt","text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml").set("jpeg","image/jpeg").set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif").set("html","text/html").set("htm","text/html");function an(a){this.u=null;this.C=a;this.H=new vk;this.m=[];this.j=null;this.l=[];this.D=null;this.G=[];this.F=300;this.o=new Map;this.i=new Map;this.h=null;this.B="UNKNOWN"}an.prototype.configure=function(a){this.u=a};an.prototype.destroy=function(){this.C=this.u=null;this.m=[];this.j=null;this.l=[];this.G=[];this.o.clear();this.h!=null&&(this.h.stop(),this.h=null);return this.H.destroy()};an.prototype.setManifestType=function(a){this.B=a};
function bn(a,b){var c,d,e,f,g,h,k;return H(function(l){if(l.i==1)return c=xk(a.m,[cn(a,b)]),d=Kk(c,a.u.retryParameters),e=a.C.networkingEngine.request(8,d),wk(a.H,e),l.o(2),l.h(e.promise,4);if(l.i!=2)return f=l.j,g=Fb(f.data),h=JSON.parse(g),h.VERSION==1&&dn(a,h,f.uri),l.u(0);if((k=l.m())&&k.code==7001)return l.return();a.h!=null&&(a.h.stop(),a.h=null);a.h=new $e(function(){bn(a,b)});a.h.ha(a.F);l.l()})}
function cn(a,b){if(!a.l.length)return b;var c=new Map,d=a.D||a.l[0],e=Math.round(a.C.getBandwidthEstimate()),f=Number.isFinite(e);a.B=="DASH"?(c.set("_DASH_pathway",d),f&&c.set("_DASH_throughput",String(e))):a.B=="HLS"&&(c.set("_HLS_pathway",d),f&&c.set("_HLS_throughput",String(e)));return Ek(b,c)}function dn(a,b,c){a.h!=null&&(a.h.stop(),a.h=null);var d=b["RELOAD-URI"]||c;a.h=new $e(function(){bn(a,d)});if(c=b.TTL)a.F=c;a.h.ha(a.F);a.l=b["PATHWAY-PRIORITY"]||[];a.G=b["PATHWAY-CLONES"]||[]}
function en(a,b,c,d){var e=a.o.get(b);e||(e=new Map);e.set(c,d);a.o.set(b,e)}an.prototype.banLocation=function(a){this.i.set(a,Date.now()+6E4)};
function fn(a,b){var c=c===void 0?!1:c;b=a.o.get(b)||new Map;for(var d=[],e=t(a.l),f=e.next(),g={};!f.done;g={fd:void 0},f=e.next())if(g.fd=f.value,f=b.get(g.fd))d.push({Dg:g.fd,location:f});else if(f=a.G.find(function(k){return function(l){return l.Sl==k.fd}}(g))){var h=b.get(f["BASE-ID"]);h&&(f["URI-REPLACEMENT"].Vi?(f=Bk(h,f["URI-REPLACEMENT"].Vi),d.push({Dg:g.fd,location:f})):d.push({Dg:g.fd,location:h}))}e=Date.now();g=t(a.i.keys());for(f=g.next();!f.done;f=g.next())f=f.value,h=a.i.get(f),e>
h&&a.i.delete(f);d=d.filter(function(k){k=Ak(k.location);for(var l=t(a.i.keys()),m=l.next();!m.done;m=l.next())if(m.value.includes(k))return!1;return!0});d.length&&(a.D=d[0].Dg);d=d.map(function(k){return k.location});if(!d.length&&a.j)for(e=t(a.j.split(",")),g=e.next();!g.done;g=e.next())if(g=b.get(g.value))a.D=a.j,d.push(g);if(!d.length)for(b=t(b.values()),e=b.next();!e.done;e=b.next())d.push(e.value);return c?d:xk(a.m,d)};function gn(a){if(a.tagName.split(":").pop()=="Binary")return a=Cd(a),a=(a||"").replace(/\s/g,""),!a||a.length%4||!/^[A-Za-z0-9+/]+={0,2}$/.test(a)?null:Pb(a);a=t(a.children);for(var b=a.next();!b.done;b=a.next())if(b=b.value,typeof b!="string"&&(b=gn(b)))return b;return null}function hn(a){return a&&/^0[xX](?:[0-9a-fA-F]{2})+$/.test(a)?Qb(a.substring(2)):null}var jn=["urn:scte:scte35:2013:xml","urn:scte:scte35:2014:xml+bin","urn:scte:scte35:2013:xml+bin","urn:scte:scte35:2013:bin"];function kn(){var a=this;this.h=this.j=null;this.H=1;this.T=new Map;this.V=new Map;this.u=new Map;this.u.set("video",new Map);this.u.set("audio",new Map);this.u.set(zc,new Map);this.u.set("image",new Map);this.Mb=(new Map).set("com.apple.streamingkeydelivery",function(b,c,d){return ln(a,b,c,d)}).set("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",function(b){return mn(a,b)}).set("com.microsoft.playready",function(b){var c=Zl(b,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(c)){var d="cenc";
c=="SAMPLE-AES"&&(d="cbcs");b=Zl(b,"URI");c=Wm(b.split("?")[0]);b=yb(c.data);var e=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),f=b.length,g=12+e.length+4+f,h=new Uint8Array(g),k=Bb(h),l=0;k.setUint32(l,g);l+=4;k.setUint32(l,1886614376);l+=4;k.setUint32(l,0);l+=4;h.set(e,l);l+=e.length;k.setUint32(l,f);h.set(b,l+4);d=uc("com.microsoft.playready",d,[{initDataType:"cenc",initData:h}],void 0,c.eh);if(b=qd(["<PLAYREADY>",Ob(b),"</PLAYREADY>"].join("\n")))b=Pb(Cd(b)),b=Vl(b),
d.licenseServerUri=b;d=Promise.resolve(d)}else d=Promise.resolve(null);return d}).set("urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c",function(b){return nn(a,b)});this.$a=new Set;this.l=new Map;this.m=null;this.G="";this.Oa=new km;this.K=-1;this.ua=Infinity;this.Ya=new WeakMap;this.O=this.Yb=this.Aa=!1;this.F=new $e(function(){if(a.ka&&!a.h.continueLoadingWhenPaused&&(a.ba.pb(a.ka,"timeupdate"),a.ka.paused)){a.ba.Ra(a.ka,"timeupdate",function(){return on(a)});return}on(a)});this.B=pn;this.i=null;
this.Pa=0;this.D=Infinity;this.Ma=this.Da=this.Z=0;this.na=new vk;this.I=new Map;this.L=new Map;this.Xb=new Map;this.eb=new Map;this.ra=new Map;this.M=new Map;this.Cb=new Map;this.Ba=new Map;this.Nb=this.sa=!1;this.fb=new Ra(5);this.o=null;this.Y=!0;this.ba=new ib;this.C=this.ka=null;this.Kb=function(){return!1};this.Qa=new Map;this.N=[];this.Ga=new Map}r=kn.prototype;
r.configure=function(a,b){var c=this.j&&a.updatePeriod!=this.h.updatePeriod&&a.updatePeriod>=0;this.h=a;b&&(this.Kb=b);this.o&&this.o.configure(this.h);c&&this.i&&this.i.presentationTimeline.oa()&&this.F.hb()};r.start=function(a,b){var c=this,d;return H(function(e){return e.i==1?(c.j=b,c.sa=b.isLowLatencyMode(),e.h(qn(c,[a]).promise,2)):e.i!=3?(d=e.j,c.G=d.uri,e.h(rn(c,d.data),3)):e.return(c.i)})};
r.stop=function(){this.F&&(this.F.stop(),this.F=null);var a=[];this.na&&(a.push(this.na.destroy()),this.na=null);this.h=this.j=null;this.$a.clear();this.i=null;this.l.clear();this.V.clear();this.L.clear();this.T.clear();this.Xb.clear();this.eb.clear();this.ra.clear();for(var b=t(this.M.values()),c=b.next();!c.done;c=b.next())c.value.Lc.stop();this.M.clear();this.Cb.clear();this.Ba.clear();this.Qa.clear();this.o&&this.o.destroy();this.ba&&(this.ba.release(),this.ba=null);return Promise.all(a)};
r.update=function(){var a=this,b,c,d,e,f,g,h,k,l,m,n,p,u,q;return H(function(v){if(v.i==1){if(!sn(a))return v.return();b=[];c=Array.from(a.l.values());d=c.filter(function(w){return!w.stream.isAudioMuxedInVideo&&w.stream.segmentIndex});if(d.length===0)return v.return();a.D=Infinity;a.i.gapCount=0;e=t(d);for(f=e.next();!f.done;f=e.next())g=f.value,b.push(tn(a,g));b.push(un(a));return v.h(Promise.all(b),2)}h=Array.from(a.Ga.values());k=t(h);for(l=k.next();!l.done;l=k.next())m=l.value,a.i.chapterStreams.includes(m)||
a.i.chapterStreams.push(m);vn(a,d.map(function(w){return w.stream}));n=d.some(function(w){return w.Hd==0});d.length&&!n&&(wn(a,pn),xn(a));n&&xn(a);p=t(d);for(u=p.next();!u.done;u=p.next())q=u.value,q.stream.isAudioMuxedInVideo||!q.stream.segmentIndex||Hf(q.stream.segmentIndex)||a.j.disableStream(q.stream);v.l()})};function yn(a,b){return a.B==zn?a.u.get(b.type):b.Re}
function tn(a,b){var c,d,e,f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D,B,A,E,C,F,G,J,Q,O,V,M,N,P,U,ea,ha,I,T,R;return H(function(S){switch(S.i){case 1:if(b.stream.isAudioMuxedInVideo)return S.return();c=[];d=t(b.S());for(e=d.next();!e.done;e=d.next())f=e.value,g=new Map,b.qe&&(b.Ab>=0&&g.set("_HLS_msn",String(b.Ab)),b.Bb>=0&&g.set("_HLS_part",String(b.Bb))),b.re?g.set("_HLS_skip","v2"):b.se&&g.set("_HLS_skip","YES"),c.push(Ek(f,g));S.o(2);return S.h(qn(a,c,!0).promise,4);case 4:h=S.j;S.u(3);break;case 2:throw k=
S.m(),a.j&&a.j.disableStream(b.stream),k;case 3:if(!b.stream.segmentIndex)return S.return();l=lm(a.Oa,h.data);if(l.type!=1)throw new L(2,4,4017);m=h.uri;An(b,h);n=bm(l.W,"EXT-X-DEFINE");p=Tn(a,n,m);u=b.stream;q=yn(a,b);return S.h(Un(a,l,u.mimeType,b.S,p),5);case 5:v=S.j;w=v.keyIds;y=v.drmInfos;x=v.encrypted;z=v.rh;Vn(a,l,u.id,b.S,p);u.encrypted||!x||z||(u.encrypted=!0);D=function(X,ka){return X.size===ka.size&&[].concat(wa(X)).every(function(ma){return ka.has(ma)})};D(u.keyIds,w)||(u.keyIds=w,u.drmInfos=
y,a.j.newDrmInfo(u));B=h.uri!==h.originalUri;A=Wn(a,l,q,p,b.S,b.type,B,u.segmentIndex);E=A.segments;C=A.ul;F=A.bandwidth;Xn(E,u.mimeType);F&&(u.bandwidth=F);G=Dm(u);J=t(E);for(Q=J.next();!Q.done;Q=J.next())O=Q.value,O.initSegmentReference&&(O.initSegmentReference.bd=G);V=em(l.W,"EXT-X-MEDIA-SEQUENCE",0);M=q.get(V);E.length&&(N=M!=null?M:a.m.Gd(),u.segmentIndex.Od(E,N));C&&(U=(P=dm(l.W,"EXT-X-SKIP"))?Number(Y(P,"SKIPPED-SEGMENTS")):0,ea=Yn(V,E,C),ha=ea.Ab,I=ea.Bb,b.Ab=ha+U,b.Bb=I,u.segmentIndex.yb(M));
Zn(a,u,b.type);if(T=Hf(u.segmentIndex))b.Dc=T.startTime,E.length&&(b.kc=E[E.length-1].endTime);if(R=dm(l.W,"EXT-X-ENDLIST"))b.Hd=!0;$n(a,l);ao(a,l.W,u.type,p,b.S);S.l()}})}r.onExpirationUpdated=function(){};r.onInitialVariantChosen=function(){};r.banLocation=function(a){this.o&&this.o.banLocation(a)};r.setMediaElement=function(a){this.ka=a};
function bo(a,b,c){c=c===void 0?!1:c;for(var d=a.K==-1,e=t(b),f=e.next();!f.done;f=e.next()){f=f.value;var g=f.stream.segmentIndex,h=yn(a,f);if(g=Hf(g)){h=t(h);for(var k=h.next();!k.done;k=h.next()){k=t(k.value);var l=k.next().value;if(k.next().value==g.startTime){d&&(a.K=Math.max(a.K,l));f.Kf=l;break}}}}if(!(a.K<0))for(b=t(b),d=b.next();!d.done;d=b.next())if(d=d.value,co(a,d.type)||c)if(e=d.stream.segmentIndex)if(f=a.K-d.Kf,f>0&&(e.h.splice(0,f),e=Hf(e)))e=-e.startTime,d.stream.segmentIndex.offset(e),
eo(a,d,e)}
function fo(a,b){if(a.ua==Infinity){b=t(b);for(var c=b.next();!c.done;c=b.next())c=Hf(c.value.stream.segmentIndex),c!=null&&c.h!=null&&(a.ua=Math.min(a.ua,c.h))}b=a.ua;if(b!=Infinity){c=t(a.l.values());for(var d=c.next();!d.done;d=c.next())if(d=d.value,!co(a,d.type)){var e=d.stream.segmentIndex;if(e!=null){var f=Hf(e);if(f)if(f.h==null)Va("Missing EXT-X-PROGRAM-DATE-TIME for stream",d.S(),"Expect AV sync issues!");else for(eo(a,d,f.h-b-f.startTime),d=t(e),e=d.next();!e.done;e=d.next())e.value.Zg(b)}}}}
function eo(a,b,c){if(!(Math.abs(c)<.001)){b.Dc+=c;b.kc+=c;a=yn(a,b);for(var d=t(a),e=d.next();!e.done;e=d.next()){var f=t(e.value);e=f.next().value;f=f.next().value;a.set(e,f+c)}b.S()}}
function rn(a,b){var c,d,e,f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D,B,A,E,C,F,G,J,Q,O,V,M,N,P;return H(function(U){switch(U.i){case 1:c=Bc;d=lm(a.Oa,b);e=bm(d.W,"EXT-X-DEFINE");f=[];g=[];h=[];a.m=new vm(null,0);a.m.hf(!0);k=function(){return[a.G]};l=null;m=new Map;a.i={presentationTimeline:a.m,variants:f,textStreams:g,imageStreams:h,chapterStreams:[],offlineSessionIds:[],sequenceMode:a.h.hls.sequenceMode,ignoreManifestTimestampsInSegmentsMode:a.h.hls.ignoreManifestTimestampsInSegmentsMode,type:"HLS",serviceDescription:null,
nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:a.C};if(d.type==1)return a.Y=!1,B=bm(d.W,"EXT-X-DEFINE"),m=Tn(a,B,a.G),l=c.qa,A="",E=new Map,C=a.G,U.h(go(a,a.H++,m,d,k,"",l,A,!0,"Media Playlist",null,E,null,!1,null,!1,"",C),7);ho(a,e,a.T,a.G);n=bm(d.W,"EXT-X-MEDIA");p=bm(d.W,"EXT-X-STREAM-INF");u=bm(d.W,"EXT-X-IMAGE-STREAM-INF");q=bm(d.W,"EXT-X-I-FRAME-STREAM-INF");v=bm(d.W,"EXT-X-SESSION-KEY");w=bm(d.W,"EXT-X-SESSION-DATA");y=bm(d.W,"EXT-X-CONTENT-STEERING");a.N=io(a,w);a.h.hls.chaptersUri&&
!a.N.includes(a.h.hls.chaptersUri)&&a.N.push(a.h.hls.chaptersUri);return U.h(jo(a,y),4);case 4:return a.h.ignoreSupplementalCodecs||(p.push.apply(p,wa(ko(p,!0))),q.push.apply(q,wa(ko(q,!1)))),lo(a,p),mo(a,n),x=no(a,q),U.h(oo(a,p,v,n,k,a.T,x),5);case 5:return f=U.j,g=po(a,n),z=t,U.h(Promise.all([qo(a,u,q),un(a)]),6);case 6:D=z(U.j);h=D.next().value;U.A(3);break;case 7:return F=U.j,Vn(a,d,F.stream.id,k,m),a.l.set(a.G,F),F.stream&&(G=Dm(F.stream),F.stream.segmentIndex.Rb(function(ea){ea.initSegmentReference&&
(ea.initSegmentReference.bd=G)})),l=F.stream.type,J=!0,a.h.disableAudio&&F.type=="audio"?J=!1:a.h.disableVideo&&F.type=="video"&&!F.stream.codecs.includes(",")&&(J=!1),J&&f.push({id:0,language:mc(A||"und"),disabledUntilTime:0,primary:!0,audio:F.type=="audio"?F.stream:null,video:F.type=="video"?F.stream:null,bandwidth:F.stream.bandwidth||0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]}),a.h.hls.chaptersUri&&!a.N.includes(a.h.hls.chaptersUri)&&a.N.push(a.h.hls.chaptersUri),U.h(un(a),
3);case 3:if(!a.j)throw new L(2,7,7001);ro(a,d);if(d.type!=1){U.A(9);break}sn(a)&&(so(a,d),Q=a.D,a.F.ha(Q));O=Array.from(a.l.values());to(a,O);xn(a);return U.h(ao(a,d.W,l,m,k),9);case 9:a.i.variants=f;a.i.textStreams=g;a.i.imageStreams=h;a.i.chapterStreams=Array.from(a.Ga.values());a.i.startTime=a.C;uo(a);if(a.O||!a.h.hls.disableCodecGuessing){U.A(11);break}V=[];M=t(a.i.variants);for(N=M.next();!N.done;N=M.next())P=N.value,P.audio&&P.audio.codecs===""&&V.push(P.audio.createSegmentIndex()),P.video&&
P.video.codecs===""&&V.push(P.video.createSegmentIndex());return U.h(Promise.all(V),11);case 11:a.j.makeTextStreamsForClosedCaptions(a.i),U.l()}})}
function uo(a){if(!a.I.size){for(var b=new Map,c=t(a.i.variants),d=c.next();!d.done;d=c.next())if(d=d.value,d.video&&d.video.closedCaptions){d=t(d.video.closedCaptions);for(var e=d.next();!e.done;e=d.next()){var f=t(e.value);e=f.next().value;f=f.next().value;b.set(e,f)}}if(b.size)for(a=t(a.i.variants),c=a.next();!c.done;c=a.next())c=c.value,c.video&&!c.video.closedCaptions&&(c.video.closedCaptions=new Map(b))}}
function vo(a,b,c){var d,e,f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D,B,A;return H(function(E){switch(E.i){case 1:d=Nm(a.h.hls.mediaPlaylistFullMimeType);if(!b.length)return E.return(d);e=wo(a,b);f=e.segment;g=e.segmentIndex;h=f.S();if(k=Zm(h[0]))if(l=xo.get(k))return E.return(Nm(l));return E.h(Promise.all([yo(a,f.initSegmentReference,0),yo(a,f,g)]),2);case 2:m=E.j;n=m[1].mimeType;p=m[0].data;u=m[1].data;q="mp4 mp4a m4s m4i m4a m4f cmfa mp4v m4v cmfv fmp4".split(" ");v=["audio/mp4","video/mp4","video/iso.segment"];
w=f.initSegmentReference||v.includes(n);if(y=!w&&Li(yb(u))){var C=u,F=a.h.disableAudio,G=a.h.disableVideo,J=a.h.disableText;var Q=yb(C);var O=(new yi).parse(Q),V=O.Dd();Q=O.Nh();var M=[],N=!1,P=!1;if(!F)switch(V.audio){case "aac":case "aac-loas":O.jb().length&&(M.push("mp4a.40.2"),N=!0);break;case "mp3":O.jb().length&&(M.push("mp4a.40.34"),N=!0);break;case "ac3":O.jb().length&&(M.push("ac-3"),N=!0);break;case "ec3":O.jb().length&&(M.push("ec-3"),N=!0);break;case "opus":O.jb().length&&(M.push("opus"),
N=!0)}if(!G)switch(V.video){case "avc":Q.codec?M.push(Q.codec):M.push("avc1.42E01E");P=!0;break;case "hvc":Q.codec?M.push(Q.codec):M.push("hvc1.1.6.L93.90");P=!0;break;case "av1":Q.codec?M.push(Q.codec):M.push("av01.0.01M.08"),P=!0}if(M.length){F=N&&!P;G=new Map;if(P&&!J){J=new Rc("video/mp2t");Vc(J,C);C=t(J.h.getStreams());for(P=C.next();!P.done;P=C.next())P=P.value,G.set(P,P);J.h.clear()}Q={type:F?"audio":"video",mimeType:"video/mp2t",codecs:M.join(", "),language:null,height:Q.height,width:Q.width,
channelCount:null,sampleRate:null,closedCaptions:G,videoRange:null,colorGamut:null,frameRate:Q.frameRate,timescale:null,drmInfos:[]}}else Q=null;if(x=Q)return E.return(x);E.A(3);break}if(!w&&!q.includes(k)){E.A(3);break}z=Pm(p,u,a.h.disableText);if(!z){E.A(3);break}if(!c||z.closedCaptions.size){E.A(6);break}D=zo(a,b,g);return E.h(Ao(a,D,f.initSegmentReference,p),7);case 7:if(B=E.j)z.closedCaptions=B;case 6:return E.return(z);case 3:return w||y||!(A=Om(u))?n?E.return(Nm(n)):E.return(d):E.return(Nm(A))}})}
function Ao(a,b,c,d){var e,f,g,h;return H(function(k){switch(k.i){case 1:e=b.shift();if(!e)return k.return(null);if(e.segment.initSegmentReference==c){k.A(2);break}c=e.segment.initSegmentReference;return k.h(yo(a,c,0),3);case 3:f=k.j,d=f.data;case 2:return k.h(yo(a,e.segment,e.segmentIndex),4);case 4:return g=k.j,(h=Pm(d,g.data,a.h.disableText))&&h.closedCaptions.size?k.return(h.closedCaptions):k.return(Ao(a,b,c,d))}})}
function zo(a,b,c){var d=b.length-1;d=a.B==zn?[Math.trunc(d*3/4),Math.trunc(d/4)]:[Math.trunc(d/2),d];a=[];b=b.map(function(g,h){return{segment:g,segmentIndex:h}}).filter(function(g){return g.segmentIndex!=c&&g.segment.Ib()!=2});d=t(d);for(var e=d.next(),f={};!e.done;f={Bf:void 0},e=d.next())f.Bf=e.value,b.length&&(b.sort(function(g){return function(h,k){return Math.abs(h.segmentIndex-g.Bf)-Math.abs(k.segmentIndex-g.Bf)}}(f)),a.push(b.shift()));return a}
function yo(a,b,c){var d,e,f,g,h,k;return H(function(l){switch(l.i){case 1:if(!b)return l.return({mimeType:null,data:null});d=Pk;e=$m(b.S(),b.hc(),b.ec(),a.j.getStreamingRetryParameters());f=b instanceof rm?1:0;return l.h(Bo(a,e,d,{type:f}).promise,2);case 2:g=l.j;h=g.data;if(!b.aesKey){l.A(3);break}return l.h(Tm(h,b.aesKey,c),4);case 4:h=l.j;case 3:return b instanceof rm?b.Ud(h,!0):b.Ud(h),(k=g.headers["content-type"])&&(k=k.split(";")[0].toLowerCase()),l.return({mimeType:k,data:h})}})}
function xn(a){if(a.B==zn){for(var b=Infinity,c=Infinity,d=t(a.l.values()),e=d.next();!e.done;e=d.next())e=e.value,e.stream.segmentIndex&&e.stream.type!="text"&&!e.stream.isAudioMuxedInVideo&&(b=Math.min(b,e.kc),c=Math.min(c,e.Dc));b=b-c||0;isNaN(a.h.availabilityWindowOverride)||(b=a.h.availabilityWindowOverride);a.m.Fi(b)}else a.m.sc(Co(a));if(!a.m.B)for(b=t(a.l.values()),c=b.next();!c.done;c=b.next())c=c.value,!c.stream.segmentIndex||c.type!="audio"&&c.type!="video"||(c=Hf(c.stream.segmentIndex))&&
c.h!=null&&a.m.Bi(c.h);a.m.Xh()}function Tn(a,b,c){var d=new Map;ho(a,b,d,c,!0);return d}function ho(a,b,c,d,e){e=e===void 0?!1:e;b=t(b);for(var f=b.next();!f.done;f=b.next()){f=f.value;var g=Y(f,"NAME"),h=Y(f,"VALUE"),k=Y(f,"QUERYPARAM");g&&h&&c.getOrInsert(g,h);if(k){if(!l)var l=(new URL(d)).searchParams;(g=l.get(k))&&!c.has(g)&&c.set(k,g)}e&&(f=Y(f,"IMPORT"))&&(k=a.T.get(f))&&c.set(f,k)}}
function An(a,b){var c=a.S(),d=b.uri;if(d==b.originalUri){d=(b=b.originalRequest)?b.uris.indexOf(d):-1;if(d<=0||d>=c.length)return;d=c[d]}else if(c.includes(d))return;db(a.$e,d);a.$e.unshift(d)}function Do(a,b){var c={};b=t(b);for(var d=b.next();!d.done;d=b.next()){var e=d=d.value,f=!a.o,g=(new Set).add("URI");f||g.add("AUDIO").add("VIDEO").add("SUBTITLES").add("PATHWAY-ID").add("GROUP-ID");e=e.toString(g);c[e]?c[e].push(d):c[e]=[d]}return c}
function ko(a,b){var c=[];a=t(a);for(var d=a.next(),e={};!d.done;e={Yg:void 0},d=a.next())d=d.value,e.Yg=jm(d),e.Yg&&(e=d.attributes.map(function(f){return function(g){var h=g.name,k=g.value;h=="CODECS"&&(k=f.Yg,b&&(g=g.value.split(","),g.length>1&&(g=xc("audio",g))&&(k+=","+g)));return new am(h,k)}}(e)),c.push(new Xl(d.id,d.name,e,null)));return c}
function lo(a,b){b=t(b);for(var c=b.next();!c.done;c=b.next()){var d=c.value,e=Y(d,"AUDIO");c=Y(d,"VIDEO");var f=Y(d,"SUBTITLES");d=Eo(a,d);if(f){var g=xc(zc,d);a.L.set(f,g);db(d,g)}e&&(f=xc("audio",d),f||(f=a.h.hls.defaultAudioCodec),a.L.set(e,f));c&&(e=xc("video",d),e||(e=a.h.hls.defaultVideoCodec),a.L.set(c,e))}}
function io(a,b){var c=[];b=t(b);for(var d=b.next();!d.done;d=b.next()){var e=d.value;d=Y(e,"DATA-ID");var f=Y(e,"URI"),g=Y(e,"LANGUAGE");e=Y(e,"VALUE");var h=(new Map).set("id",d);f&&h.set("uri",fm([a.G],f,a.T)[0]);g&&h.set("language",g);e&&h.set("value",e);d=="com.apple.hls.chapters"&&f&&c.push(h.get("uri"));d=new tk("sessiondata",h);if(a.j)a.j.onEvent(d)}return c}
function jo(a,b){var c,d,e,f,g,h;return H(function(k){if(!a.j||!a.h)return k.return();d=t(b);for(e=d.next();!e.done;e=d.next())if(f=e.value,g=Y(f,"PATHWAY-ID"),h=Y(f,"SERVER-URI"),g&&h){a.o=new an(a.j);a.o.configure(a.h);a.o.m=[a.G];a.o.setManifestType("HLS");a.o.j=g;c=bn(a.o,h);break}return k.h(c,0)})}
function po(a,b){var c=cm(b,"SUBTITLES"),d=Do(a,c);b=[];if(!a.h.disableText)for(var e in d)try{b.push(Fo(a,d[e],new Map).stream)}catch(g){if(!a.h.hls.ignoreTextStreamFailures)throw g;}e=t(c);for(c=e.next();!c.done;c=e.next())if(d=Zl(c.value,"GROUP-ID"),c=a.L.get(d))if(d=a.V.get(d)){d=t(d);for(var f=d.next();!f.done;f=d.next())f=f.value,f.stream.codecs=c,f.stream.mimeType=Go(zc,c)||Ho(zc),Io(f.stream)}return b.filter(function(g){return g})}
function Io(a){var b=new Set([ve(a.mimeType,a.codecs)]);a.segmentIndex&&a.segmentIndex.Rb(function(c){c.mimeType&&b.add(ve(c.mimeType,a.codecs))});a.fullMimeTypes=b}
function qo(a,b,c){var d,e;return H(function(f){if(f.i==1)return d=b.map(function(g){var h,k,l;return H(function(m){if(m.i==1){if(h=a.h.disableThumbnails)return m.return(null);m.o(2);return m.h(Jo(a,g),4)}if(m.i!=2)return k=m.j,m.return(k.stream);l=m.m();if(a.h.hls.ignoreImageStreamFailures)return m.return(null);throw l;})}).concat(c.map(function(g){if(a.h.disableThumbnails)return null;try{var h=Ko(a,g);return h.stream.type!=="image"?null:h.stream}catch(k){if(a.h.hls.ignoreImageStreamFailures)return null;
throw k;}})),f.h(Promise.all(d),2);e=f.j;return f.return(e.filter(function(g){return g}))})}function un(a){var b,c,d,e;return H(function(f){if(a.h.disableChapters)return f.return();b=[];c=t(a.N);for(d=c.next();!d.done;d=c.next())e=d.value,b.push(Lo(a,e));return f.h(Promise.all(b),0)})}
function Lo(a,b){var c,d,e,f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D,B;return H(function(A){if(A.i==1)return c=Kk([b],a.h.retryParameters),A.h(Bo(a,c,10).promise,2);d=A.j;e=Fb(d.data);f=JSON.parse(e);g=new Map;for(h=0;h<f.length;h++)if(k=f[h],k.titles){l=[];if(k.images)for(m=t(k.images),n=m.next();!n.done;n=m.next())if(p=n.value,p.url)for(u=fm([d.uri],p.url),q=t(u),v=q.next();!v.done;v=q.next())w=v.value,y={type:p["image-category"],width:p["pixel-width"],height:p["pixel-height"],url:w},l.push(y);x=t(k.titles);
for(z=x.next();!z.done;z=x.next())D=z.value,B={id:"",title:D.title,startTime:k["start-time"],endTime:k["start-time"],images:l},k.duration?B.endTime+=k.duration:h+1<f.length&&(B.endTime=f[h+1]["start-time"]),g.getOrInsertComputed(D.language,function(){return[]}).push(B)}g.forEach(function(E,C){var F=[];E=t(E);for(var G=E.next();!G.done;G=E.next()){G=G.value;var J=new rm(G.startTime,G.endTime,function(){return[]},0,null,null,0,0,Infinity);J.Tg({title:G.title,images:G.images});F.push(J)}E=a.Ga.getOrInsertComputed(C,
function(){return Uf({id:a.H++,mimeType:"text/plain",kind:"",language:C,originalLanguage:C,type:"chapter",external:!0})});E.segmentIndex?E.segmentIndex.Od(F,a.m.Gd()):E.segmentIndex=new Em(F)});A.l()})}function Mo(a,b,c){b=b.filter(function(e){var f=Y(e,"URI")||"";e=Y(e,"TYPE");return e!="SUBTITLES"&&(f!=""||e=="AUDIO"||e=="VIDEO")});b=Do(a,b);for(var d in b)Fo(a,b[d],c,!1)}
function no(a,b){return b.map(function(c){c=Ko(a,c);return c.stream.type!=="video"?null:c.stream}).filter(function(c){return c})}
function oo(a,b,c,d,e,f,g){var h,k,l,m,n,p,u,q,v,w,y,x,z,D,B,A,E,C,F,G,J,Q,O,V,M,N,P,U,ea;return H(function(ha){switch(ha.i){case 1:h=[];k=new Set;if(a.h.ignoreDrmInfo||!(c.length>0)){ha.A(2);break}l=t(c);m=l.next();case 3:if(m.done){ha.A(2);break}n=m.value;p=Zl(n,"METHOD");u=Y(n,"KEYFORMAT")||"identity";q=null;if(p=="NONE"){ha.A(4);break}if(No(p)){v=fm(e(),Zl(n,"URI"),f);Oo(a,v);ha.A(4);break}if(u=="identity")return ha.h(Po(a,n,"",e,null,f),12);w=a.Mb.get(u);if(!w){y=null;ha.A(10);break}return ha.h(w(n,
"",null),11);case 11:y=ha.j;case 10:q=y;ha.A(6);break;case 12:q=ha.j;case 6:if(q){if(q.keyIds)for(x=t(q.keyIds),z=x.next();!z.done;z=x.next())D=z.value,k.add(D);h.push(q)}case 4:m=l.next();ha.A(3);break;case 2:B=Do(a,b);A=[];for(E in B)C=B[E],F=C[0],G=Qo(F),J=Number(Zl(F,"BANDWIDTH"))||Number(Y(F,"AVERAGE-BANDWIDTH")),Q=Y(F,"RESOLUTION"),O=t(Q?Q.split("x"):[null,null]),V=O.next().value,M=O.next().value,N=Y(F,"VIDEO-RANGE"),(P=Y(F,"REQ-VIDEO-LAYOUT"))&&P.includes(",")&&(U=P.split(",").filter(function(I){return I==
"CH-STEREO"||I=="CH-MONO"}),P=U[0]),P=P||"CH-MONO",ea=Ro(a,C,d),A.push.apply(A,wa(So(a,ea.audio,ea.video,J,V,M,G,N,P,h,k,g)));return ha.return(A.filter(function(I){return I!=null}))}})}
function Ro(a,b,c){for(var d={audio:[],video:[]},e=new Map,f=new Set,g=new Set,h=t(b),k=h.next();!k.done;k=h.next()){var l=k.value;k=Y(l,"AUDIO");var m=Y(l,"VIDEO");if(k||m)l=Y(l,"PATHWAY-ID"),k&&!f.has(k)&&(f.add(k),l&&e.set(k,l)),m&&!g.has(m)&&(g.add(m),l&&e.set(m,l))}var n=[].concat(wa(f),wa(g));n.length&&c.length&&(c=c.filter(function(u){return n.includes(Zl(u,"GROUP-ID"))}),Mo(a,c,e));d.audio.push.apply(d.audio,wa(To(a,f)));d.video.push.apply(d.video,wa(To(a,g)));e=d.video.find(function(u){return u.stream.isAudioMuxedInVideo});
f=!1;var p=b.map(function(u){return Zl(u,"URI")});m=d.audio.find(function(u){return u&&u.S().find(function(q){return p.includes(q)})});g=Eo(a,b[0]);c=xc("video",g);h=xc("audio",g);k=jm(b[0]);e?(e="video",h&&c&&!d.audio.length&&(g=[[c,h].join()])):h&&!c?(e="audio",f=d.audio.length>0&&!d.audio.some(function(u){return u.stream.isAudioMuxedInVideo})):!d.audio.length&&!d.video.length&&h&&c?(e="video",g=[[c,h].join()]):d.audio.length&&m?(e="audio",f=!0):e=d.video.length&&!d.audio.length?"audio":"video";
f||(a=Uo(a,b,g,e,k),b=a.stream,f=e=="audio"?d.audio:d.video,g=f.find(function(u){return u.stream.isAudioMuxedInVideo}),b.type==e&&g?(e=g.stream,b.language=e.language,b.originalLanguage=e.originalLanguage,b.label=e.label,b.channelsCount=e.channelsCount,b.audioSamplingRate=e.audioSamplingRate,b.originalId=e.originalId,b.primary=e.primary,b.roles=e.roles,f.splice(f.indexOf(g),1,a)):(b.type=="audio"?d.audio:d.video).push(a));d.video=d.video.filter(function(u){return!u.stream.isAudioMuxedInVideo});return d}
function To(a,b){if(!b.size)return[];b=[].concat(wa(b)).sort().join(",");return a.V.get(b)||[]}function Eo(a,b){b=Y(b,"CODECS")||"";a.O=b.length>0;a.O||a.h.hls.disableCodecGuessing||(b=[],a.h.disableVideo||b.push(a.h.hls.defaultVideoCodec),a.h.disableAudio||b.push(a.h.hls.defaultAudioCodec),b=b.join(","));return Qm(b.split(/\s*,\s*/))}function Vo(a){return(a=Y(a,"CHANNELS"))?parseInt(a.split("/")[0],10):null}function Wo(a){return(a=Y(a,"SAMPLE-RATE"))?parseInt(a,10):null}
function Qo(a){return(a=Y(a,"FRAME-RATE"))?parseFloat(a):null}function Xo(a){a=Y(a,"CHANNELS");if(!a)return!1;a=a.split("/");return a.length!=2?!1:a[1]==="JOC"||a[1].includes("ATMOS")||a[1].includes("IMSA")}function Yo(a){a=Zl(a,"TYPE").toLowerCase();a=="subtitles"&&(a=zc);return a}
function So(a,b,c,d,e,f,g,h,k,l,m,n){for(var p=t(c),u=p.next();!u.done;u=p.next())Zo(u.value.stream,e,f,g,h,k,null);e=a.h.disableVideo;if(!c.length||e)c=[null];e&&(b=b.filter(function(y){return!y.stream.isAudioMuxedInVideo}));e=a.h.disableAudio;if(!b.length||e)b=[null];e=[];b=t(b);for(f=b.next();!f.done;f=b.next())for(f=f.value,g=t(c),h=g.next();!h.done;h=g.next()){var q=h.value;if(h=f?f.stream:null)h.drmInfos=l,h.keyIds=m;if(k=q?q.stream:null)k.drmInfos=l,k.keyIds=m,a.h.disableIFrames||Tf(k,n);k&&
!h&&(k.bandwidth=d);!k&&h&&(h.bandwidth=d);p=f?f.stream.drmInfos:null;u=q?q.stream.drmInfos:null;q=q?q.S().sort().join(","):"";var v=f?f.S().sort().join(","):"",w=[];h&&h.codecs&&w.push(h.codecs);k&&k.codecs&&w.push(k.codecs);q=[q,v,w.sort()].join("-");h&&k&&!Wb(p,u)||a.$a.has(q)||(h={id:a.H++,language:h?h.language:"und",disabledUntilTime:0,primary:!!h&&h.primary||!!k&&k.primary,audio:h,video:k,bandwidth:d,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},e.push(h),a.$a.add(q))}return e}
function mo(a,b){b=cm(b,"CLOSED-CAPTIONS");a.Y=b.length==0;b=t(b);for(var c=b.next();!c.done;c=b.next()){var d=c.value,e=Y(d,"LANGUAGE");c=mc(e||"und");e||(e=Y(d,"NAME"))&&(c=e);e=Zl(d,"GROUP-ID");d=Zl(d,"INSTREAM-ID").replace("SERVICE","svc");a.I.get(e)||a.I.set(e,new Map);a.I.get(e).set(d,c)}}
function Fo(a,b,c,d){d=d===void 0?!0:d;for(var e=[],f=[],g=new Map,h=t(b),k=h.next(),l={};!k.done;l={md:void 0},k=h.next()){l.md=k.value;k=function(y){return function(){return"shaka://hls-muxed"+y.md.id}}(l);var m=d?Zl(l.md,"URI"):Y(l.md,"URI")||k();k=Zl(l.md,"GROUP-ID");e.push(m);f.push(k);g.set(k,m);(l=Y(l.md,"PATHWAY-ID"))&&c.set(k,l)}d=f.sort().join(",");l=b[0];b="";h=Yo(l);h==zc&&(b=Y(l,"CODECS")||"");if(!b)for(f=t(f),k=f.next();!k.done;k=f.next())if(k=k.value,a.L.has(k)){b=a.L.get(k);break}k=
jm(l);f=m=e.sort().join(",");h=="audio"&&d&&(f+=d);if(a.l.has(f))return a.l.get(f);var n=a.H++;if(a.o){g=t(g);for(var p=g.next();!p.done;p=g.next()){var u=t(p.value);p=u.next().value;u=u.next().value;(p=c.get(p))&&en(a.o,n,p,u)}}c=Y(l,"LANGUAGE");g=Y(l,"NAME");p=Y(l,"DEFAULT")=="YES";u=h=="audio"?Vo(l):null;var q=h=="audio"?Xo(l):!1,v=Y(l,"CHARACTERISTICS"),w=Y(l,"FORCED")=="YES";l=h=="audio"?Wo(l):null;e=$o(a,n,e,b,h,c,p,g,u,null,v,w,l,q,k,m);a.V.has(d)?a.V.get(d).push(e):a.V.set(d,[e]);a.l.set(f,
e);return e}
function Jo(a,b){var c,d,e,f,g,h,k,l,m,n,p,u;return H(function(q){if(q.i==1){c=Zl(b,"URI");d=Y(b,"CODECS","jpeg")||"";e=jm(b);if(a.l.has(c))return q.return(a.l.get(c));f=Y(b,"LANGUAGE");g=Y(b,"NAME");h=Y(b,"CHARACTERISTICS");k=c;l=$o(a,a.H++,[c],d,"image",f,!1,g,null,null,h,!1,null,!1,e,k);return(m=Y(b,"RESOLUTION"))?q.h(l.stream.createSegmentIndex(),3):q.A(2)}if(q.i!=2){n=Hf(l.stream.segmentIndex);if(p=n.tilesLayout)l.stream.width=Number(m.split("x")[0])*Number(p.split("x")[0]),l.stream.height=Number(m.split("x")[1])*
Number(p.split("x")[1]);l.stream.closeSegmentIndex()}if(u=Y(b,"BANDWIDTH"))l.stream.bandwidth=Number(u);a.l.set(c,l);return q.return(l)})}
function Ko(a,b){var c="video",d=Zl(b,"URI"),e=Y(b,"CODECS")||"",f=jm(b);e=="mjpg"&&(c="image");if(a.l.has(d))return a.l.get(d);var g=Y(b,"LANGUAGE"),h=Y(b,"NAME"),k=Y(b,"CHARACTERISTICS");c=$o(a,a.H++,[d],e,c,g,!1,h,null,null,k,!1,null,!1,f,d);c.stream.isIframe=!0;e=Y(b,"RESOLUTION");f=t(e?e.split("x"):[null,null]);e=f.next().value;f=f.next().value;c.stream.width=Number(e)||void 0;c.stream.height=Number(f)||void 0;if(b=Y(b,"BANDWIDTH"))c.stream.bandwidth=Number(b);a.l.set(d,c);return c}
function Uo(a,b,c,d,e){for(var f=a.H++,g=[],h=t(b),k=h.next();!k.done;k=h.next()){var l=k.value;k=Zl(l,"URI");l=Y(l,"PATHWAY-ID");a.o&&l&&en(a.o,f,l,k);g.push(k)}h=g.sort().join(",")+c.sort().join(",");if(a.l.has(h))return a.l.get(h);k=g.join(",");a:{b=Y(b[0],"CLOSED-CAPTIONS");if(d=="video"){if(a.h.disableText){a.Y=!1;b=null;break a}if(b){if(b!="NONE"){b=a.I.get(b);break a}a.Y=!1}else if(!b&&a.I.size)for(b=t(a.I.keys()),b=b.next();!b.done;b=b.next()){b=a.I.get(b.value);break a}}b=null}c=wc(d,c);
d=$o(a,f,g,c,d,null,!1,null,null,b,null,!1,null,!1,e,k);a.l.set(h,d);return d}
function $o(a,b,c,d,e,f,g,h,k,l,m,n,p,u,q,v){function w(A){var E,C,F,G,J,Q,O,V,M,N,P,U,ea,ha,I,T,R,S,X;return H(function(ka){switch(ka.i){case 1:return E=Bc,ka.o(2),ka.h(A.promise,4);case 4:C=ka.j;if(A.aborted)return ka.return();F=C.uri;An(z,C);G=lm(a.Oa,C.data);if(G.type!=1)throw new L(2,4,4017);J=bm(G.W,"EXT-X-DEFINE");Q=Tn(a,J,F);O=!1;(!a.O&&a.h.hls.disableCodecGuessing||a.Y&&e==E.qa&&!a.h.hls.disableClosedCaptionsDetection)&&G.segments.length>0&&(a.Y=!1,O=!0);V=!a.O&&a.h.hls.disableCodecGuessing;
M=sn(a);return ka.h(go(a,0,Q,G,y,d,e,f,g,h,k,l,m,n,p,u,q,v,void 0,O,V),5);case 5:N=ka.j;if(A.aborted)return ka.return();P=N.stream;ro(a,G);sn(a)&&!M&&so(a,G);z.Dc=N.Dc;z.kc=N.kc;z.se=N.se;z.re=N.re;z.qe=N.qe;z.Hd=N.Hd;z.Re=N.Re;z.Ab=N.Ab;z.Bb=N.Bb;x.segmentIndex=P.segmentIndex;x.encrypted=P.encrypted;x.drmInfos=P.drmInfos;x.keyIds=P.keyIds;x.mimeType=P.mimeType;Vn(a,G,x.id,y,Q);x.bandwidth=x.bandwidth||P.bandwidth;x.codecs=x.codecs||P.codecs;x.closedCaptions=x.closedCaptions||P.closedCaptions;uo(a);
x.width=x.width||P.width;x.height=x.height||P.height;x.hdr=x.hdr||P.hdr;x.colorGamut=x.colorGamut||P.colorGamut;x.frameRate=x.frameRate||P.frameRate;x.language=="und"&&P.language!="und"&&(x.language=P.language);x.language=x.language||P.language;x.channelsCount=x.channelsCount||P.channelsCount;x.audioSamplingRate=x.audioSamplingRate||P.audioSamplingRate;Io(x);z.type!=E.qa||N.type!=E.$||a.O&&!we.includes(x.mimeType)||ap(a,z,P);x.drmInfos.length&&a.j.newDrmInfo(x);U=!1;if(!l&&x.closedCaptions||l&&x.closedCaptions&&
l.size!=x.closedCaptions.size)U=!0;a.i&&U&&a.j.makeTextStreamsForClosedCaptions(a.i);e==E.Ua&&(ea=Hf(P.segmentIndex))&&ea.initSegmentReference&&(x.mimeType="application/mp4",Io(x));ha=Dm(x);x.segmentIndex.Rb(function(ma){ma.initSegmentReference&&(ma.initSegmentReference.bd=ha)});bp(a)&&(a.Yb?to(a,[z]):(a.Yb=!0,I=Array.from(a.l.values()),T=I.filter(function(ma){return ma.stream.segmentIndex}),to(a,T),xn(a),R=a.D,R>0&&a.F.ha(R)));a.i&&(a.i.startTime=a.C);return ka.h(ao(a,G.W,x.type,Q,y),6);case 6:ka.u(0);
break;case 2:S=ka.m();x.closeSegmentIndex();if(S.code===7001)return ka.return();X=a.j.disableStream(x);if(!X)throw S;ka.l()}})}function y(){if(a.o&&c.length>1)return fn(a.o,b);var A=z.$e.concat(gm([a.G],c,a.T));return Array.from(new Set(A))}var x=cp(a,d,e,f,g,h,k,l,m,n,p,u,q,v);c.some(function(A){return A.startsWith("shaka://hls-muxed")})&&(x.isAudioMuxedInVideo=!0,e=="audio"&&(x.mimeType="video/mp2t",Io(x)));var z={stream:x,type:e,$e:[],Dc:0,kc:0,Re:new Map,se:!1,re:!1,qe:!1,Hd:!1,Kf:-1,Ab:-1,Bb:-1,
S:y},D=null,B;x.createSegmentIndex=function(){if(D)return D;if(x.isAudioMuxedInVideo)return x.segmentIndex=new Em([]),Promise.resolve();B=qn(a,z.S(),!0);return D=new Promise(function(A){A(w(B))})};x.closeSegmentIndex=function(){D&&!x.segmentIndex&&B.abort();x.segmentIndex&&(x.segmentIndex.release(),x.segmentIndex=null);D=null};return z}
function ap(a,b,c){var d=b.stream,e=c.type,f=b.type;a.B==zn&&(a.u.set(e,a.u.get(f)),a.u.set(f,new Map));b.type=e;d.type=e;d.codecs=xc(e,c.codecs.split(/\s*,\s*/))||"";Io(d);if(a.i){b=t(a.i.variants);for(c=b.next();!c.done;c=b.next())c=c.value,e=="audio"&&c.video==d&&(c.video=null,c.audio||(c.audio=d,c.language=d.language));a.i.variants=a.i.variants.filter(function(g){return g.audio||g.video})}}
function Co(a){var b=Infinity;a=t(a.l.values());for(var c=a.next();!c.done;c=a.next())c=c.value,c.stream.segmentIndex&&c.stream.type!="text"&&!c.stream.isAudioMuxedInVideo&&(b=Math.min(b,c.kc));return b}function vn(a,b){var c=[];b=t(b);for(var d=b.next();!d.done;d=b.next())d=d.value,d.segmentIndex&&d.segmentIndex.Rb(function(e){c.push(e)});a.m.ki(c)}
function to(a,b){if(!sn(a))for(var c=Co(a),d=t(b),e=d.next();!e.done;e=d.next())e.value.stream.segmentIndex.Ee(0,c);vn(a,b.map(function(f){return f.stream}));d=Array.from(a.l.values()).filter(function(f){return f.stream.segmentIndex});c=d.some(function(f){return f.stream.type=="audio"});e=d.some(function(f){return f.stream.type=="video"});d=a.B==zn&&!a.Aa;c=!sn(a)&&a.Aa&&!(c&&e);a.h.hls.ignoreManifestProgramDateTime||d||c?bo(a,b,d):(fo(a,b),a.h.hls.ignoreManifestProgramDateTimeForTypes.length>0&&
bo(a,b))}function co(a,b){return a.h.hls.ignoreManifestProgramDateTime?!0:a.h.hls.ignoreManifestProgramDateTimeForTypes.includes(b)}function bp(a){if(!a.i||!a.i.variants.length)return!1;var b=[],c=[];a=t(a.i.variants);for(var d=a.next();!d.done;d=a.next())d=d.value,d.video&&b.push(d.video),d.audio&&c.push(d.audio);return b.length>0&&!b.some(function(e){return e.segmentIndex})||c.length>0&&!c.some(function(e){return e.segmentIndex})?!1:!0}
function go(a,b,c,d,e,f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D){z=z===void 0?!0:z;D=D===void 0?!0:D;var B,A,E,C,F,G,J,Q,O,V,M,N,P,U,ea,ha,I,T,R,S,X,ka,ma,Aa,ja,ua,ub,vb,cg,rd,Kc,Xc;return H(function(ab){switch(ab.i){case 1:B=g;A=d.segments||[];E=A.every(function(Te){return dm(Te.W,"EXT-X-GAP")?!0:!1});if(!A.length||E)throw new L(2,4,4053);dp(a,d);sn(a)&&$n(a,d);C=a.B==zn?a.u.get(g):new Map;F=Wn(a,d,C,c,e,g,!0,null);G=F.segments;J=F.bandwidth;if(x||g!=zc){ab.A(2);break}return ab.h(ep(a,g,f,G),3);case 3:x=ab.j,
f||x!="application/mp4"||!G[0]||G[0].initSegmentReference||(x="text/vtt"),f||x!="application/mp4"||(D=z=!0);case 2:N=M=V=O=Q=null;if(!(G.length>0&&z)){ab.A(4);break}P=g=="video"&&!n&&!a.h.hls.disableClosedCaptionsDetection;return ab.h(vo(a,G,P),5);case 5:U=ab.j,g!=U.type&&a.B==zn&&(a.u.set(U.type,a.u.get(g)),a.u.set(g,new Map)),g=U.type,U.type!="video"&&(h=U.language),m=U.channelCount,q=U.sampleRate,a.h.disableText||(n=U.closedCaptions),O=U.height,Q=U.width,V=U.videoRange,M=U.colorGamut,N=U.frameRate,
D&&(x=U.mimeType,f=U.codecs);case 4:if(x){ab.A(6);break}return ab.h(ep(a,g,f,G),7);case 7:x=ab.j;case 6:return B=="video"&&we.includes(x)&&(g="audio"),Xn(G,x),ab.h(Un(a,d,x,e,c),8);case 8:ea=ab.j;ha=ea.drmInfos;I=ea.keyIds;T=ea.encrypted;R=ea.rh;if(T&&!ha.length&&!R)throw new L(2,4,4026);S=cp(a,f,g,h,k,l,m,n,p,u,q,v,w,y);S.encrypted=T&&!R;S.drmInfos=ha;S.keyIds=I;S.mimeType=x;J&&(S.bandwidth=J);dm(d.W,"EXT-X-I-FRAMES-ONLY")&&(S.isIframe=!0);Io(S);g=="video"&&(Q||O||V||M)&&Zo(S,Q,O,N,V,null,M);sn(a)&&
$n(a,d);X=G[0].startTime;ka=G[G.length-1];ma=ka.endTime;Aa=new Em(G);S.segmentIndex=Aa;Zn(a,S,g);ua=(ja=dm(d.W,"EXT-X-SERVER-CONTROL"))?Yl(ja,"CAN-SKIP-UNTIL")!=null:!1;ub=!1;ua&&(ub=ja?Yl(ja,"CAN-SKIP-DATERANGES")!=null:!1);vb=ja?Yl(ja,"CAN-BLOCK-RELOAD")!=null:!1;cg=em(d.W,"EXT-X-MEDIA-SEQUENCE",0);rd=Yn(cg,G);Kc=rd.Ab;Xc=rd.Bb;return ab.return({stream:S,type:g,$e:[],S:e,Dc:X,kc:ma,se:ua,re:ub,qe:vb,Hd:!1,Kf:-1,Ab:Kc,Bb:Xc,Re:C})}})}
function Yn(a,b,c){c=c===void 0?b.length:c;a=a+c-1;c=-1;if(!b.length)return a++,{Ab:a,Bb:c};b=b[b.length-1];var d=b.i;if(!b.i.length)return a++,b.u&&(c=0),{Ab:a,Bb:c};c=d.length-1;d[d.length-1].isPreload()||(a++,c=0);return{Ab:a,Bb:c}}function fp(a,b,c,d){for(var e=t(["video","audio"]),f=e.next();!f.done;f=e.next())if(f=f.value,f!=b){f=a.u.get(f);for(var g=0,h=0;h<d.length;h++){if(f.has(c+h))return f.get(c+h)-g;var k=dm(d[h].W,"EXTINF");if(!k)break;g+=im(k)}}return null}
function gp(a,b,c){if(!a||!b.has(c))return null;b=b.get(c);c=a.find(b);return c==null?null:(a=a.get(c))&&a.startTime==b?a:null}
function cp(a,b,c,d,e,f,g,h,k,l,m,n,p,u){var q=Go(c,b)||Ho(c),v=[];if(k){k=t(k.split(","));for(var w=k.next();!w.done;w=k.next())v.push(w.value)}k=void 0;w=null;c==zc?k=v.includes("public.accessibility.transcribes-spoken-dialog")&&v.includes("public.accessibility.describes-music-and-sound")?"caption":"subtitle":v.includes("public.accessibility.describes-video")&&(w="visually impaired");v.length||k!=="subtitle"||v.push("subtitle");a={id:a.H++,originalId:u,groupId:null,createSegmentIndex:function(){return Promise.resolve()},
segmentIndex:null,mimeType:q,codecs:b,supplementalCodecs:p,kind:c==zc?"subtitle":void 0,encrypted:!1,drmInfos:[],keyIds:new Set,language:mc(d||"und"),originalLanguage:d,label:f,type:c,primary:e,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:v,forced:l,channelsCount:g,audioSamplingRate:m,spatialAudio:n,closedCaptions:h,hdr:void 0,colorGamut:void 0,videoLayout:void 0,tilesLayout:void 0,accessibilityPurpose:w,
external:!1,fastSwitching:!1,fullMimeTypes:new Set,isAudioMuxedInVideo:!1,baseOriginalId:null,isIframe:!1,preselection:null};Io(a);return a}
function Un(a,b,c,d,e){var f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D,B,A,E,C,F,G,J,Q,O,V,M,N,P;return H(function(U){switch(U.i){case 1:f=new Map;if(!a.h.ignoreDrmInfo&&b.segments)for(g=t(b.segments),h=g.next();!h.done;h=g.next())if(k=h.value,l=bm(k.W,"EXT-X-KEY"),m=null,l.length)for(m=hp(a,b,k.W,d,e),n=t(l),p=n.next();!p.done;p=n.next())u=p.value,f.set(u,m);v=q=!1;w=[];y=new Set;x=t(f);z=x.next();case 2:if(z.done){U.A(4);break}D=z.value;B=t(D);A=B.next().value;E=B.next().value;C=A;F=E;G=Zl(C,"METHOD");if(G==
"NONE"){U.A(3);break}q=!0;J=Y(C,"KEYFORMAT")||"identity";Q=null;if(No(G)){v=!0;U.A(3);break}if(J=="identity")return U.h(Po(a,C,c,d,F,e),11);O=a.Mb.get(J);if(!O){V=null;U.A(9);break}return U.h(O(C,c,F),10);case 10:V=U.j;case 9:Q=V;U.A(6);break;case 11:Q=U.j;case 6:if(Q){if(Q.keyIds)for(M=t(Q.keyIds),N=M.next();!N.done;N=M.next())P=N.value,y.add(P);w.push(Q)}case 3:z=x.next();U.A(2);break;case 4:return U.return({drmInfos:w,keyIds:y,encrypted:q,rh:v})}})}
function ip(a,b,c,d,e){if(!window.crypto||!window.crypto.subtle)throw Wa("Web Crypto API is not available to decrypt AES. (Web Crypto only exists in secure origins like https)"),new L(2,4,4042);var f=Zl(b,"METHOD"),g=0,h=Y(b,"IV","");if(f==="AES-256-GCM"){if(h)throw new L(2,4,4059);}else if(h){var k=Qb(h.substr(2));if(k.byteLength!=16)throw new L(2,4,4048);}else g=em(c.W,"EXT-X-MEDIA-SEQUENCE",0);var l=fm(d(),Zl(b,"URI"),e);c=l.slice().sort().join("");return a.eb.getOrInsertComputed(b.toString()+
"-"+g+"-"+c,function(){var m={bitsKey:128,blockCipherMode:"CBC",iv:k,firstMediaSequenceNumber:g};switch(f){case "AES-256":m.bitsKey=256;break;case "AES-256-CTR":m.bitsKey=256;m.blockCipherMode="CTR";break;case "AES-256-GCM":m.bitsKey=256,m.blockCipherMode="GCM"}m.fetchKey=function(){var n,p;return H(function(u){if(u.i==1)return u.h(Oo(a,l),2);if(u.i!=3){n=u.j;if(!n.data||n.data.byteLength!=m.bitsKey/8)throw new L(2,4,4049);p={name:m.blockCipherMode==="CBC"?"AES-CBC":m.blockCipherMode==="GCM"?"AES-GCM":
"AES-CTR",length:m.bitsKey};return u.h(window.crypto.subtle.importKey("raw",n.data,p,!0,["decrypt"]),3)}m.cryptoKey=u.j;m.fetchKey=void 0;u.l()})};return m})}function Oo(a,b){var c=b.slice().sort().join("");return a.ra.getOrInsertComputed(c,function(){var d=Bo(a,Kk(b,a.h.retryParameters),6).promise;d.catch(function(){a.ra.get(c)===d&&a.ra.delete(c)});return d})}
function Vn(a,b,c,d,e){if(sn(a)){var f=new Set,g=new Set,h=bm(b.W,"EXT-X-PRELOAD-HINT");h=t(h);for(var k=h.next(),l={};!k.done;l={Kd:void 0,og:void 0,hint:void 0},k=h.next())if(l.hint=k.value,Y(l.hint,"TYPE")=="KEY"&&(k=Y(l.hint,"KEYFORMAT")||"identity",!g.has(k))){g.add(k);var m=Y(l.hint,"METHOD")||"",n=Y(l.hint,"URI");k=="identity"&&No(m)&&n&&(l.og=fm(d(),n,e),l.Kd=l.og.slice().sort().join(""),a.ra.has(l.Kd)||(f.add(l.Kd),a.M.getOrInsertComputed(l.Kd,function(p){return function(){var u=new $e(function(){a.M.delete(p.Kd);
Oo(a,p.og)}),q=jp(a,p.hint,b);u.ha(q);return{Lc:u,Xg:new Set}}}(l)).Xg.add(c)))}d=t(Array.from(a.M.keys()));for(e=d.next();!e.done;e=d.next())e=e.value,g=a.M.get(e),f.has(e)||!g.Xg.delete(c)||g.Xg.size||(g.Lc.stop(),a.M.delete(e))}}
function jp(a,b,c){var d=null;b=Kd(Y(b,"DATE-OF-FIRST-USE")||"");if(b!=null&&!a.h.hls.ignoreManifestProgramDateTime){a:{for(var e=c.segments||[],f=e.length-1;f>=0;f--)if((a=dm(e[f].W,"EXT-X-PROGRAM-DATE-TIME"))&&a.value){a=Kd(a.value);if(a==null)break;e=t(e.slice(f));for(f=e.next();!f.done;f=e.next()){f=f.value;var g=dm(f.W,"EXTINF");if(g)a+=im(g);else for(f=t(f.Gc),g=f.next();!g.done;g=f.next())g=g.value,g.name=="EXT-X-PART"&&(a+=Number(Y(g,"DURATION"))||0)}break a}a=null}a!=null&&(d=b-a)}d==null&&
(d=em(c.W,"EXT-X-TARGETDURATION",0));return Math.random()*Math.max(0,d)}function ro(a,b){a.C==null&&(b=dm(b.W,"EXT-X-START"))&&(a.C=Number(Zl(b,"TIME-OFFSET")))}function dp(a,b){var c=dm(b.W,"EXT-X-PLAYLIST-TYPE");b=dm(b.W,"EXT-X-ENDLIST");b=c&&c.value=="VOD"||b;c=c&&c.value=="EVENT"&&!b;c=!b&&!c;b?wn(a,pn):c?wn(a,zn):wn(a,kp)}
function $n(a,b){var c=Infinity,d=b.segments;if(d.length)for(var e=d.length-1;e>=0;){var f=dm(d[e].W,"EXTINF");if(f){c=im(f);break}e--}d=dm(b.W,"EXT-X-TARGETDURATION");if(!d)throw new L(2,4,4024,"EXT-X-TARGETDURATION");d=Number(d.value);if(e=dm(b.W,"EXT-X-PART-INF"))a.Z=Number(Zl(e,"PART-TARGET"));b=dm(b.W,"EXT-X-SERVER-CONTROL");a.sa&&a.Z?(a.D=a.Nb?a.Z*5<=c?Math.min(a.Z,a.D):Math.min(c,a.D):Math.min(a.Z,a.D),a.Ma=b?Number(Zl(b,"PART-HOLD-BACK")):0):(a.D=Math.min(c,a.D),c=b?Yl(b,"HOLD-BACK"):null,
a.Da=c?Number(c.value):0);a.Pa=Math.max(d,a.Pa)}function so(a,b){var c=0;if(a.h.defaultPresentationDelay)c=a.h.defaultPresentationDelay;else if(a.Ma)c=a.Ma;else if(a.Da)c=a.Da;else for(var d=b.segments.length,e=d-Math.min(d,a.h.hls.liveSegmentsDelay);e<d;e++){var f=dm(b.segments[e].W,"EXTINF");c=f?c+im(f):c+a.Pa}a.C&&a.C<0&&(c=Math.min(-a.C,c),a.C+=c);a.m.Ci(0);a.m.Ai(c);a.m.hf(!1);a.m.zi(!0)}
function hp(a,b,c,d,e){var f=dm(c,"EXT-X-MAP");if(!f)return null;var g=Zl(f,"URI"),h=fm(d(),g,e);g=[h.toString(),Y(f,"BYTERANGE","")].join("-");return a.Xb.getOrInsertComputed(g,function(){for(var k=void 0,l=void 0,m=!1,n=t(c),p=n.next();!p.done;p=n.next())p=p.value,p.name=="EXT-X-KEY"?(m=Zl(p,"METHOD"),No(m)&&p.id<f.id?(m=!1,k=ip(a,p,b,d,e)):m=m!="NONE"):p.name=="EXT-X-BYTERANGE"&&p.id<f.id&&(l=p);return lp(h,f,l,k,m)})}
function lp(a,b,c,d,e){var f=0,g=null;b=Y(b,"BYTERANGE");!b&&c&&(b=c.value);b&&(f=b.split("@"),g=Number(f[0]),f=Number(f[1]),g=f+g-1,d&&(c=g+1-f,c%16&&(g+=16-c%16)));return new pm(function(){return a},f,g,null,null,null,d,e)}
function mp(a,b,c,d,e,f,g,h,k,l){var m=d.W,n=dm(m,"EXTINF"),p=0,u=0,q=null;d.Gc.length&&(a.i.isLowLatency=!0);var v=null;if(!a.h.hls.ignoreManifestProgramDateTime){var w=dm(m,"EXT-X-PROGRAM-DATE-TIME");w&&w.value&&(v=Kd(w.value),a.Aa=!0)}var y=sm;dm(m,"EXT-X-GAP")&&(a.i.gapCount++,y=2);if(!n){if(d.Gc.length==0)throw new L(2,4,4024,"EXTINF");if(!a.sa)return null}var x=[];w=!1;var z=null,D=!1,B=!1;if(a.sa&&d.Gc.length){p=b&&window.ReadableStream&&a.h.hls.allowLowLatencyByteRangeOptimization;for(var A=
v,E={},C=0;C<d.Gc.length;E={mf:void 0,Rd:void 0},C++){var F=d.Gc[C],G=C==0?c:x[x.length-1],J=C==0?e:G.endTime,Q=Number(Y(F,"DURATION"))||a.Z;if(Q){var O=J+Q,V=0,M=null;F.name=="EXT-X-PRELOAD-HINT"?(V=(V=Y(F,"BYTERANGE-START"))?Number(V):0,(G=Y(F,"BYTERANGE-LENGTH"))?M=V+Number(G)-1:V&&(M=Number.MAX_SAFE_INTEGER)):(V=Y(F,"BYTERANGE"),M=t(np(G,V)),V=M.next().value,M=M.next().value);E.Rd=Y(F,"URI");if(E.Rd){G=sm;Y(F,"GAP")=="YES"&&(a.i.gapCount++,G=2,D=!0);E.mf=null;var N=function(U){return function(){U.mf==
null&&(U.mf=fm(h(),U.Rd,f));return U.mf}}(E);p&&V>=0&&M!=null&&(z=N,w=!0);J=new rm(J,O,N,V,M,b,0,0,Infinity,[],"",null,A,G,l);F.name=="EXT-X-PRELOAD-HINT"&&(J.sg(),B=!0);Y(F,"INDEPENDENT")!="YES"&&C>0&&J.ai();F=k;F||(x.length&&x[0].mimeType?F=x[0].mimeType:E.Rd&&(E=Zm(E.Rd),F=op.get(g).get(E)||null));F&&(J.mimeType=F,pp.has(F)&&(J.initSegmentReference=null));x.push(J);A&&(A+=Q)}}}}if(n){n=im(n);if(n==0)return null;p=e+n}else if(x.length)p=x[x.length-1].endTime;else return null;w&&(D||x[0].startByte!=
0?(w=!1,z=null):x=[]);(n=dm(m,"EXT-X-BYTERANGE"))?(q=t(np(c,n.value)),u=q.next().value,q=q.next().value):x.length&&(u=x[0].startByte,q=x[x.length-1].endByte);c="";n=null;g=="image"&&(c="1x1",g=dm(m,"EXT-X-TILES"))&&(c=Zl(g,"LAYOUT"),(g=Y(g,"DURATION"))&&(n=Number(g)));var P=null;b=new rm(e,p,function(){if(z)return z();P==null&&(P=fm(h(),d.h,f));return P||[]},u,q,b,0,0,Infinity,x,c,n,v,y,l,x.length>0&&!!d.h);k&&(b.mimeType=k,pp.has(k)&&(b.initSegmentReference=null));w&&(a.Nb=!0,b.Zh(),B&&b.sg());return b}
function np(a,b){var c=0,d=null;b&&(c=b.split("@"),b=Number(c[0]),c=c[1]?Number(c[1]):a.endByte+1,d=c+b-1);return[c,d]}
function ao(a,b,c,d,e){var f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D,B,A,E,C,F,G,J,Q,O,V,M,N,P,U,ea,ha,I,T,R,S,X,ka,ma;return H(function(Aa){f=Bc;if(c!=f.qa&&c!=f.$)return Aa.return();g=a.m.l;if(g==null||co(a,c))return Aa.return();h=bm(b,"EXT-X-DATERANGE");h=h.filter(function(ja){return Yl(ja,"START-DATE")!=null}).sort(function(ja,ua){ja=Zl(ja,"START-DATE");ua=Zl(ua,"START-DATE");return ja<ua?-1:ja>ua?1:0});k=[];for(l=0;l<h.length;l++){m=h[l];try{if(n=Zl(m,"START-DATE"),p=Kd(n),!isNaN(p)){u=Math.max(0,p-g);
q=null;if(v=Y(m,"END-DATE"))if(w=Kd(v),!isNaN(w)&&(q=w-g,q<0))continue;if(q==null&&(y=Y(m,"DURATION")||Y(m,"PLANNED-DURATION"))&&(x=parseFloat(y),isNaN(x)||(q=u+x),z=p-g+x,z<0))continue;D=t(["SCTE35-OUT","SCTE35-IN","SCTE35-CMD"]);for(B=D.next();!B.done;B=D.next())if(A=B.value,E=hn(Y(m,A)))C=A=="SCTE35-IN"&&q!=null?q:u,a.j.onScte35Event({schemeIdUri:"urn:scte:scte35:2013:bin",startTime:C,endTime:A=="SCTE35-OUT"&&q!=null?q:C,id:Zl(m,"ID"),source:"hls",kind:A.substring(7).toLowerCase(),data:E,node:null});
F=Y(m,"CLASS")||"com.apple.quicktime.HLS";G=Y(m,"END-ON-NEXT")=="YES";if(q==null&&G){for(J=l+1;J<h.length;J++)if(Q=Y(h[J],"CLASS")||"com.apple.quicktime.HLS",F==Q&&(O=Zl(h[J],"START-DATE"),V=Kd(O),!isNaN(V)&&V&&V>p)){q=Math.max(0,V-g);break}if(q==null)continue}M=["CLASS","START-DATE","END-DATE","DURATION","END-ON-NEXT"];N=[];P=t(m.attributes);for(U=P.next();!U.done;U=P.next())if(ea=U.value,!M.includes(ea.name)){ha=hm(ea.value,d);if(ea.name=="X-ASSET-URI"||ea.name=="X-ASSET-LIST")ha=fm(e(),ea.value,
d)[0];I={key:ea.name,description:"",data:ha,mimeType:null,pictureType:null};N.push(I)}T={schemeIdUri:F,value:"",startTime:u,endTime:q!=null?q:Infinity,id:Zl(m,"ID"),timescale:1,eventNode:null,urlParams:void 0,values:N};a.j.onTimelineRegionAdded(T);if(N.length>1){R=a.j.onMetadata(F,u,q,N);S=!1;if(X=N.find(function(ja){return ja.key=="CUE"})||N.find(function(ja){return ja.key=="X-CUE"}))ka=X.data,ka.includes("PRE")&&(S=!0);q==null||S||(ma=void 0,ma=a.i.startTime!=null?a.i.startTime:sn(a)?a.i.presentationTimeline.ob():
a.i.presentationTimeline.zb(),S=u<=ma&&q>=ma);S&&k.push(R)}}}catch(ja){}}return k.length?Aa.h(Promise.all(k),0):Aa.A(0)})}function Xn(a,b){if(we.includes(b)){a=t(a);for(var c=a.next();!c.done;c=a.next())c=c.value,c.mimeType&&c.mimeType!=b&&(c.mimeType=b)}}
function Wn(a,b,c,d,e,f,g,h){function k(N){N=Zm(N);if(!N)return null;var P=op.get(f).get(N);P||(P=xo.get(N));return P}var l=b.segments,m=null,n=null,p=null,u=null,q=void 0,v=em(b.W,"EXT-X-DISCONTINUITY-SEQUENCE",-1),w=em(b.W,"EXT-X-MEDIA-SEQUENCE",0),y=dm(b.W,"EXT-X-SKIP"),x=y?Number(Y(y,"SKIPPED-SEGMENTS")):0,z=w+x,D=0;a.B==zn&&c.has(z)&&(D=c.get(z));D===0&&a.B==zn&&c.size>0&&!c.has(z)&&a.m.j!=null&&(D=a.m.Gd());a.B==zn&&!c.size&&a.K>=0&&(!a.Aa||co(a,f))&&(y=fp(a,f,z,l),y!=null&&(D=y));var B=[];
y=[];var A=null,E=null,C=[],F=0;if(!g&&h){F=l.length;for(var G=0;G<l.length;G++){z=w+x+G;if(!c.has(z)){F=G;break}if(l[G].Gc.length){F=G;break}if(a.sa){var J=dm(l[G].W,"EXTINF");if(J&&(J=im(J),(z=gp(h,c,z))&&Math.abs(z.endTime-z.startTime-J)>.001)){F=G;break}}}F>0&&((A=gp(h,c,w+x+F-1))?E=A:F=0)}G=E;!G&&h&&(G=gp(h,c,w+x)||h.get(h.getNumEvicted()+h.getNumReferences()-1));for(h=0;h<l.length;h++){var Q=l[h];(z=dm(Q.W,"EXT-X-MAP"))&&z.id!==n&&(m=hp(a,b,Q.W,e,d),n=z.id);z=Q.h;J="";z&&(J=Zm(z));J!==u&&(p=
k(z),u=J);var O=h==0?D:A.endTime;z=w+x+h;dm(Q.W,"EXT-X-DISCONTINUITY")&&(v++,h>=F&&A&&A.initSegmentReference&&(A.initSegmentReference.h=O));J=t(Q.W);for(var V=J.next();!V.done;V=J.next())V=V.value,V.name=="EXT-X-KEY"&&(No(Zl(V,"METHOD"))?q=ip(a,V,b,e,d):q=void 0);if(!(h<F)&&(J=g||!c.has(z),c.set(z,O),O=mp(a,m,A,Q,O,d,f,e,p,q))){if(A=em(Q.W,"EXT-X-BITRATE"))C.push({bitrate:A,duration:O.endTime-O.startTime}),O.bandwidth=A;else if(O.endByte){if(Q=tm(O))A=O.endTime-O.startTime,Q=Q*8/A/1E3,C.push({bitrate:Q,
duration:A}),O.bandwidth=Q}else C.length&&(A=C[C.length-1],A.duration+=O.endTime-O.startTime,O.bandwidth=A.bitrate);if(O.bandwidth)for(A=t(O.i),Q=A.next();!Q.done;Q=A.next())Q.value.bandwidth=O.bandwidth;A=O;O.discontinuitySequence=v;co(a,f)&&a.K!=null&&z<a.K||(B.push(O),!J&&g||y.push(O))}}b=void 0;C.length&&(b=C.reduce(function(N,P){return N+P.duration},0),b=Math.round(C.reduce(function(N,P){return N+P.bitrate*P.duration},0)/b*1E3));var M;if(c=!((M=E)==null||!M.h)||B.some(function(N){return N.h!=
null}))for(M={},d=0;d<B.length;M={Ge:void 0,Fe:void 0,ke:void 0,Hc:void 0,wd:void 0},d++)if(M.Hc=B[d],M.Hc.h==null)for(M.Fe=0,M.Ge=d,e=function(N){return function(){var P=B[N.Ge];if(P){if(P.h!=null)return P.h+N.Fe;N.Fe-=P.endTime-P.startTime;N.Ge+=1}return null}}(M),M.wd=0,M.ke=d,l=function(N){return function(){var P=B[N.ke];if(P){P!=N.Hc&&(N.wd+=P.endTime-P.startTime);if(P.h!=null)return P.h+N.wd;--N.ke}else if(E&&E.h!=null)return E.h+(E.endTime-E.startTime)+N.wd;return null}}(M);M.Hc.h==null;)M.Hc.h=
l(),M.Hc.h==null&&(M.Hc.h=e());if(c)for(M=0,e=E,G&&G.h!=null&&(d=a.Ya.get(G),d!=null&&(M=d-G.h)),G=t(B),d=G.next();!d.done;d=G.next()){d=d.value;d.h!=null&&(a.Ya.set(d,d.h),e&&e.h!=null&&e.discontinuitySequence!=d.discontinuitySequence&&(e=d.h-(e.h+(e.endTime-e.startTime))-M,Math.abs(e)>1&&(M+=e)),d.h-=M);e=d.h;l=t(d.i);for(m=l.next();!m.done;m=l.next())m=m.value,m.h=e,e+=m.endTime-m.startTime;e=d}G=a.ua;if(c&&G!=Infinity&&!co(a,f))for(a=t(B),M=a.next();!M.done;M=a.next())M.value.Zg(G);return{segments:g?
B:y,ul:F+B.length,bandwidth:b}}function Zn(a,b,c){if(c=="video"&&!co(a,c)&&b.segmentIndex){c=[];var d=null;b=t(b.segmentIndex);for(var e=b.next();!e.done;e=b.next())if((e=e.value)&&e.h!=null){var f=a.Ya.get(e);if(f!=null){var g=f-e.h;(d==null||Math.abs(g-d)>.001)&&c.push({start:e.startTime,Fg:f});d=g}}a.m.Di(c)}}
function Go(a,b){if(a==zc){if(b=="vtt"||b=="wvtt")return"text/vtt";if(b&&b!=="")return"application/mp4"}return a!="image"||b&&b!="jpeg"?a=="audio"&&b=="mp4a.40.34"?"audio/mpeg":b=="mjpg"?"application/mp4":null:"image/jpeg"}function Ho(a){return a==zc?"text/vtt":op.get(a).get("mp4")}function wo(a,b){a=a.B==zn?Math.trunc((b.length-1)/2):0;for(var c=b[a];c.Ib()==2&&a+1<b.length;)a++,c=b[a];return{segment:c,segmentIndex:a}}
function ep(a,b,c,d){var e,f,g,h,k,l,m,n,p,u,q,v,w;return H(function(y){switch(y.i){case 1:e=Pk;f=wo(a,d);g=f.segment;if(g.status==2)return y.return(Ho(b));k=g.S();if(l=Zm(k[0]))if(m=op.get(b),(n=m.get(l))||(n=xo.get(l)))return y.return(n);if(h=Go(b,c))return y.return(h);u=1;q=Kk(k,a.j.getStreamingRetryParameters());y.o(2);q.method="HEAD";return y.h(Bo(a,q,e,{type:u}).promise,4);case 4:v=y.j;p=v.headers["content-type"];y.u(3);break;case 2:w=y.m();if(!w||w.code!=1002&&w.code!=1001){y.A(3);break}q.method=
"GET";a.h.hls.allowRangeRequestsToGuessMimeType&&(q.headers.Range="bytes=0-0");return y.h(Bo(a,q,e,{type:u}).promise,6);case 6:v=y.j,p=v.headers["content-type"];case 3:if(!p){y.A(7);break}h=p.toLowerCase().split(";")[0];if(!qp.includes(h)){y.A(8);break}if(v.data.byteLength){y.A(9);break}q.method="GET";return y.h(Bo(a,q,e,{type:u}).promise,10);case 10:v=y.j;case 9:Li(yb(v.data))&&(h="video/mp2t");case 8:if(!qp.includes(h))return y.return(h);case 7:return y.return(Ho(b))}})}
function Zo(a,b,c,d,e,f,g){a&&(a.width=Number(b)||void 0,a.height=Number(c)||void 0,a.frameRate=d||void 0,a.hdr=e||void 0,a.videoLayout=f||void 0,a.colorGamut=g||void 0)}function qn(a,b,c){return Bo(a,Kk(b,a.h.retryParameters),0,{type:c?2:3})}
function on(a){var b,c,d,e,f,g;return H(function(h){switch(h.i){case 1:if(!a.j)return h.return();h.o(2);b=Date.now();return h.h(a.update(),4);case 4:c=Date.now();sn(a)&&(d=(c-b)/1E3,a.fb.sample(1,d),e=a.h.updatePeriod>0?a.h.updatePeriod:a.D,f=Math.max(0,e-Sa(a.fb)),isFinite(f)?a.F.ha(f):a.F.ha(1));h.u(3);break;case 2:g=h.m();if(!a.j)return h.return();if(a.h.raiseFatalErrorOnManifestUpdateRequestFailure)return a.j.onError(g),h.return();g.severity=1;a.j.onError(g);a.F.ha(.1);case 3:if(!a.j)return h.return();
a.j.onManifestUpdated();h.l()}})}function sn(a){return a.B!=pn}function wn(a,b){a.B=b;a.m&&a.m.hf(!sn(a));sn(a)||a.F.stop()}function Bo(a,b,c,d){if(!a.na)throw new L(2,7,7001);d||(d={});d.isPreload=a.Kb();b=a.j.networkingEngine.request(c,b,d);wk(a.na,b);return b}function No(a){return a=="AES-128"||a=="AES-256"||a=="AES-256-CTR"||a=="AES-256-GCM"}
function ln(a,b,c,d){var e,f,g,h,k,l;return H(function(m){if(m.i==1){if(c=="video/mp2t")throw new L(2,4,4040);if("apple"===window.shakaMediaKeysPolyfill)throw new L(2,4,4041);e=Zl(b,"METHOD");f=["SAMPLE-AES","SAMPLE-AES-CTR"];if(!f.includes(e))return m.return(null);g="cenc";e=="SAMPLE-AES"&&(g="cbcs");h=Zl(b,"URI");k=uc("com.apple.fps",g,null,h);var n=Ak(h).replace(/-/g,"").toLowerCase();return(l=n.length===32&&/^[0-9a-f]+$/.test(n)?n:null)||!d?m.A(2):m.h(rp(a,d),3)}m.i!=2&&(l=m.j);l&&k.keyIds.add(l);
return m.return(k)})}function mn(a,b){var c=Zl(b,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(c))return Promise.resolve(null);var d="cenc";c=="SAMPLE-AES"&&(d="cbcs");c=Zl(b,"URI");var e=Wm(c.split("?")[0]);a=a.Qa.getOrInsertComputed(c.split("?")[0],function(){return yb(e.data)});d=uc("com.widevine.alpha",d,[{initDataType:"cenc",initData:a}],void 0,e.eh);(b=Y(b,"KEYID"))&&d.keyIds.add(b.toLowerCase().substr(2));return Promise.resolve(d)}
function nn(a,b){var c=Zl(b,"METHOD");if(!["SAMPLE-AES","SAMPLE-AES-CTR"].includes(c))return Promise.resolve(null);var d="cenc";c=="SAMPLE-AES"&&(d="cbcs");c=Zl(b,"URI");var e=Wm(c.split("?")[0]);a=a.Qa.getOrInsertComputed(c.split("?")[0],function(){return yb(e.data)});d=uc("com.huawei.wiseplay",d,[{initDataType:"cenc",initData:a}],void 0,e.eh);(b=Y(b,"KEYID"))&&d.keyIds.add(b.toLowerCase().substr(2));return Promise.resolve(d)}
function Po(a,b,c,d,e,f){var g,h,k,l,m,n,p,u,q,v;return H(function(w){switch(w.i){case 1:if(c=="video/mp2t")throw new L(2,4,4040);g=Zl(b,"METHOD");h=["SAMPLE-AES","SAMPLE-AES-CTR"];if(!h.includes(g))return w.return(null);k=fm(d(),Zl(b,"URI"),f);if(k[0].startsWith("data:text/plain;base64,")){l=Rb(Pb(k[0].split("data:text/plain;base64,").pop()));w.A(2);break}m=k.sort().join("");return w.h(a.Cb.getOrInsertComputed(m,function(){return Bo(a,Kk(k,a.h.retryParameters),6).promise}),3);case 3:n=w.j,l=Rb(n.data);
case 2:p="00000000000000000000000000000000";if(!e){w.A(4);break}return w.h(rp(a,e),5);case 5:(u=w.j)&&(p=u);case 4:return q=new Map,q.set(p,l),v="cenc",g=="SAMPLE-AES"&&(v="cbcs"),w.return(vc(q,v))}})}function rp(a,b){var c,d,e,f;return H(function(g){if(g.i==1){c=null;if(a.Ba.has(b))return c=a.Ba.get(b),g.A(2);d=$m(b.S(),b.hc(),b.ec(),a.j.getStreamingRetryParameters());e=Pk;return g.h(Bo(a,d,e,{type:0}).promise,3)}g.i!=2&&(f=g.j,b.Ud(f.data),c=Sm(f.data),a.Ba.set(b,c));return g.return(c)})}
K("shaka.hls.HlsParser",kn);
var xo=(new Map).set("aac","audio/aac").set("ac3","audio/ac3").set("ec3","audio/ec3").set("mp3","audio/mpeg"),sp=(new Map).set("mp4","audio/mp4").set("mp4a","audio/mp4").set("m4s","audio/mp4").set("m4i","audio/mp4").set("m4a","audio/mp4").set("m4f","audio/mp4").set("cmfa","audio/mp4").set("ts","video/mp2t").set("tsa","video/mp2t"),tp=(new Map).set("mp4","video/mp4").set("mp4v","video/mp4").set("m4s","video/mp4").set("m4i","video/mp4").set("m4v","video/mp4").set("m4f","video/mp4").set("cmfv","video/mp4").set("ts",
"video/mp2t").set("tsv","video/mp2t"),up=(new Map).set("mp4","application/mp4").set("m4s","application/mp4").set("m4i","application/mp4").set("m4f","application/mp4").set("cmft","application/mp4").set("vtt","text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml"),vp=(new Map).set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif"),op=(new Map).set("audio",sp).set("video",tp).set("text",up).set("image",vp),pp=new Set(["video/mp2t"].concat(wa(we))),
qp=["application/octet-stream","binary/octet-stream"],pn="VOD",kp="EVENT",zn="LIVE";Hc("application/x-mpegurl",function(){return new kn});Hc("application/vnd.apple.mpegurl",function(){return new kn});Hc("audio/x-mpegurl",function(){return new kn});function wp(a,b,c){c=c===void 0?!0:c;this.i=a;this.h=new Set([a]);b=b||[];a=t(b);for(b=a.next();!b.done;b=a.next())this.add(b.value,c)}wp.prototype.add=function(a,b){return xp(this.i,a,b===void 0?!0:b)?(this.h.add(a),!0):!1};function xp(a,b,c){return!!a.audio!=!!b.audio||!!a.video!=!!b.video||a.language!=b.language||a.audio&&b.audio&&!yp(a.audio,b.audio,c)||a.video&&b.video&&!zp(a.video,b.video,c)?!1:!0}wp.prototype.values=function(){return this.h.values()};
function Ap(a,b){if(!a.audio||!b.audio)return a.audio==b.audio;if(a.audio==b.audio)return!0;var c=!a.audio.channelsCount||!b.audio.channelsCount||a.audio.channelsCount==b.audio.channelsCount;return a.language==b.language&&a.audio.label==b.audio.label&&c&&a.audio.spatialAudio==b.audio.spatialAudio&&a.audio.groupId==b.audio.groupId&&Ae(a.audio.codecs)==Ae(b.audio.codecs)&&eb(a.audio.roles,b.audio.roles)}
function Bp(a,b){return a.video&&b.video?(a.video.label||"")==(b.video.label||"")&&(a.video.language||"")==(b.video.language||"")&&eb(a.video.roles,b.video.roles):!a.video==!b.video}
function Cp(a,b,c){function d(p){return(p.channelsCount||0)*2+(p.spatialAudio?1:0)}var e=a[0];if(!e||!e.audio||a.some(function(p){return!p.audio||!p.audio.channelsCount}))return[];var f=Math.min.apply(Math,wa(a.map(function(p){return d(p.audio)}))),g=new Set(a.map(function(p){var u;return(u=p.video)==null?void 0:u.hdr})),h=new Set(a.map(function(p){var u;return(u=p.video)==null?void 0:u.videoLayout})),k=new Map;b=t(b);for(var l=b.next();!l.done;l=b.next()){l=l.value;var m=l.audio;a.includes(l)||!m||
!m.channelsCount||d(m)>=f||l.language!=e.language||m.label!=e.audio.label||!eb(m.roles,e.audio.roles)||c&&!Dp(e.audio,m)||Bp(e,l)&&(!e.video||!l.video||g.has(l.video.hdr)&&h.has(l.video.videoLayout)&&zp(e.video,l.video,c))&&k.getOrInsertComputed(d(m),function(){return[]}).push(l)}c=Ae(e.audio.codecs);e=[];var n=Math.min.apply(Math,wa(a.map(function(p){return p.bandwidth})));a=Array.from(k.keys()).sort(function(p,u){return u-p});a=t(a);g=a.next();for(f={};!g.done;f={wc:void 0,De:void 0},g=a.next()){g=
k.get(g.value);f.wc=new Map;h=t(g);for(b=h.next();!b.done;b=h.next())b=Ae(b.value.audio.codecs),f.wc.set(b,f.wc.getOrInsert(b,0)+1);f.De=c;f.wc.has(f.De)||(f.De=Array.from(f.wc.keys()).reduce(function(p){return function(u,q){return p.wc.get(q)>p.wc.get(u)?q:u}}(f)));f=g.filter(function(p){return function(u){return Ae(u.audio.codecs)==p.De&&u.bandwidth<n}}(f));f.length&&(e.push.apply(e,wa(f)),n=Math.min.apply(Math,wa(f.map(function(p){return p.bandwidth}))))}return e}
function yp(a,b,c){if(!a.channelsCount||!b.channelsCount){if(a.channelsCount!=b.channelsCount&&Ae(a.codecs)!=Ae(b.codecs))return!1}else if((a.channelsCount>2||b.channelsCount>2)&&a.channelsCount!=b.channelsCount)return!1;return a.spatialAudio!==b.spatialAudio||c&&!Dp(a,b)||!eb(a.roles,b.roles)||a.groupId!==b.groupId?!1:!0}function zp(a,b,c){return c&&!Dp(a,b)||!eb(a.roles,b.roles)?!1:!0}
function Dp(a,b){if(a.mimeType!=b.mimeType)return!1;a=a.codecs.split(",").map(function(c){return Ce(c)});b=b.codecs.split(",").map(function(c){return Ce(c)});return eb(a,b)}K("shaka.media.AdaptationSet",wp);function Ep(){this.h=Fp;this.l=(new Map).set(Fp,2).set(Gp,1);this.j=0;this.i=-1}function Hp(a,b){var c=a.h!==b;a.h=b;c&&b===Fp&&(a.j=Date.now());return c}var Gp=0,Fp=1;function Ip(){this.i=null;this.l=new Map;this.j=this.h=null}function Jp(a,b,c,d){var e;return H(function(f){if(f.i==1){e=yb(b);if(c)return a.j=e,f.return(Kp(e));if(!a.j)return f.return(e);if(a.i===d)return f.A(2);a.i=d;a.h=Lp(a.i);return f.h(a.h,3)}f.i!=2&&(a.l=f.j,a.h=null);return f.return(Mp(a,e,a.j))})}
Ip.prototype.destroy=function(){var a=this;return H(function(b){switch(b.i){case 1:if(!a.h){b.A(2);break}b.o(3);return b.h(a.h,5);case 5:b.u(2);break;case 3:b.m();case 2:a.i=null,a.l.clear(),a.h=null,a.j=null,b.l()}})};
function Lp(a){var b,c,d,e,f,g,h,k,l;return H(function(m){if(m.i==1)return b=new Map,a.clearKeys?m.h(Promise.all([].concat(wa(a.clearKeys.entries())).map(function(n){var p=t(n);n=p.next().value;p=p.next().value;p=Pb(p);var u=Pb(n);return Promise.all([crypto.subtle.importKey("raw",p,{name:"AES-CBC"},!1,["decrypt","encrypt"]),crypto.subtle.importKey("raw",p,{name:"AES-CTR"},!1,["decrypt"])]).then(function(q){var v=t(q);q=v.next().value;v=v.next().value;return{tk:Rb(u),Cf:q,xe:v}})})),2):m.return(b);
c=m.j;d=t(c);for(e=d.next();!e.done;e=d.next())g=f=e.value,h=g.tk,k=g.Cf,l=g.xe,b.set(h,{Cf:k,xe:l});return m.return(b)})}function Mp(a,b,c){var d,e,f,g,h;return H(function(k){if(k.i==1)return d=Np(c),e=Op(b,d),f=e.uj.map(function(l){var m=d.get(l.trackId)||d.values().next().value;return Pp(a,l,b,m)}),k.h(Promise.all(f),2);g=k.j;h=[b.slice(0,e.sj)].concat(wa(g));return k.return(Sb.apply(Mb,wa(h)))})}
function Kp(a){function b(h){e.push(function(){d.setUint32(h.start+4,1718773093,!1);c.fill(0,h.start+8,h.start+h.size)})}var c=yb(a).slice(),d=Bb(c),e=[],f=-1;(new hh).ma(sh,mh).P("stsd",oh).box("encv",function(h){f=h.start;ph(h)}).box("enca",function(h){f=h.start;qh(h)}).box("sinf",function(h){b(h);mh(h)}).box("frma",function(h){var k=Kh(h.reader).codec,l=f;l!==-1&&k&&e.push(function(){for(var m=0;m<4;++m)d.setUint8(l+4+m,k.charCodeAt(m))})}).P("sgpd",b).box("pssh",b).parse(c,!0);a=t(e);for(var g=
a.next();!g.done;g=a.next())g=g.value,g();return c}
function Np(a){var b=new Map,c=0;(new hh).ma(["moov","mdia","minf","stbl"],mh).box("trak",function(d){c=0;mh(d)}).P("tkhd",function(d){c=Gh(d.reader,d.version).trackId;b.getOrInsert(c,{defaultKID:"",encryptionScheme:"cenc",Bd:8,$b:null,ze:0,Ae:0})}).P("stsd",oh).box("encv",ph).box("enca",qh).box("sinf",mh).P("schm",function(d){d=lh(d.reader.R());var e=b.get(c);e&&(e.encryptionScheme=d.toLowerCase())}).box("schi",mh).P("tenc",function(d){d=Lh(d.reader,d.version);var e=b.get(c);e&&(e.defaultKID=d.defaultKID,
e.Bd=d.nj,e.$b=d.$b,e.ze=d.ze,e.Ae=d.Ae)}).parse(a,!0);return b}
function Op(a,b){function c(g){f&&f.Af.push({start:g.start,size:g.size})}var d=[],e=0,f=null;(new hh).box("moof",function(g){d.length||(e=g.start);f={cd:g.start,ei:g.size,ug:-1,Nd:-1,xi:null,Oi:0,trackId:0,Qi:[],Af:[]};mh(g)}).box("traf",mh).P("tfhd",function(g){f&&(g=Ch(g.reader,g.flags),f.trackId=g.trackId,f.Oi=g.ac||0)}).P("trun",function(g){if(f){g=Fh(g.reader,g.version,g.flags);g=t(g.nc);for(var h=g.next();!h.done;h=g.next())f.Qi.push({size:h.value.sampleSize||f.Oi})}}).P("senc",function(g){if(f){var h=
b.get(f.trackId);h&&(f.xi=Oh(g.reader,g.flags,h.Bd,h.$b));c(g)}}).Gh(["saiz","saio","sgpd","sbgp"],c).box("pssh",c).box("mdat",function(g){f&&(f.ug=g.start,f.Nd=g.size,d.push(f),f=null)}).parse(a);return{uj:d,sj:e}}
function Pp(a,b,c,d){var e,f,g,h,k,l,m,n,p,u,q,v,w,y,x,z;return H(function(D){if(D.i==1){e=d.defaultKID;f=a.l.get(e);if(!f)return D.return(c.slice(b.cd,b.ug+b.Nd));g=d.encryptionScheme;(h=b.xi)&&d.Bd!==8&&(k=c.subarray(b.cd,b.cd+b.ei),(new hh).ma(th,mh).P("senc",function(B){h=Oh(B.reader,B.flags,d.Bd,d.$b)}).parse(k,!1));l=b.ug+8;m=c.subarray(l,l+b.Nd-8);return D.h(Qp(m,b.Qi.map(function(B){return B.size}),h,d,f,g),2)}n=D.j;p=c.slice(b.cd,b.cd+b.ei);u=Bb(p);if(b.Af)for(q=t(b.Af),v=q.next();!v.done;v=
q.next())w=v.value,y=w.start-b.cd,y>=0&&y+w.size<=p.byteLength&&(u.setUint32(y+4,1718773093,!1),p.fill(0,y+8,y+w.size));x=8+n.byteLength;z=new Uint8Array(x);Bb(z).setUint32(0,x,!1);z.set([109,100,97,116],4);z.set(n,8);return D.return(Sb(p,z))})}
function Qp(a,b,c,d,e,f){var g,h,k,l,m,n,p,u,q,v;return H(function(w){if(w.i==1)return g=new Uint8Array(a.byteLength),h=0,k=b.map(function(y,x){var z=h;h+=y;y=a.subarray(z,z+y);if(c&&c.Sa[x]){x=c.Sa[x];var D=d.Bd===16?16:8,B=new Uint8Array(16);B.set(x.iv.slice(0,D),0);return f==="cenc"?Rp(y,B,x.Li,e).then(function(A){return{offset:z,ye:A}}):Sp(y,d.$b||B,x.Li,d,e).then(function(A){return{offset:z,ye:A}})}return f==="cbcs"&&d.$b?Sp(y,d.$b,null,d,e).then(function(A){return{offset:z,ye:A}}):Promise.resolve({offset:z,
ye:y})}),w.h(Promise.all(k),2);l=w.j;m=t(l);for(n=m.next();!n.done;n=m.next())u=p=n.value,q=u.offset,v=u.ye,g.set(v,q);return w.return(g)})}
function Rp(a,b,c,d){var e,f,g,h,k,l,m,n,p,u;return H(function(q){switch(q.i){case 1:if(c&&c.length){q.A(2);break}e=tb;f=yb;return q.h(crypto.subtle.decrypt({name:"AES-CTR",counter:b,length:64},d.xe,a),3);case 3:return q.return(f.call(e,q.j));case 2:return g=new Uint8Array(a.byteLength),k=h=0,l=c.map(function(v){var w=h;h+=v.yd;if(v.cc===0)return Promise.resolve({ve:w,Bh:v.yd,Eh:h,qj:0,If:null});var y=b.slice();Tp(y,k);var x=h;h+=v.cc;k+=Math.ceil(v.cc/16);return crypto.subtle.decrypt({name:"AES-CTR",
counter:y,length:64},d.xe,a.subarray(x,x+v.cc)).then(function(z){return{ve:w,Bh:v.yd,Eh:x,qj:v.cc,If:yb(z)}})}),q.h(Promise.all(l),4);case 4:m=q.j;n=t(m);for(p=n.next();!p.done;p=n.next())u=p.value,g.set(a.subarray(u.ve,u.ve+u.Bh),u.ve),u.If&&g.set(u.If,u.Eh);return q.return(g)}})}
function Sp(a,b,c,d,e){var f,g,h,k,l,m,n,p,u,q,v;return H(function(w){if(w.i==1){f=d.ze;g=d.Ae;f===0&&(f=1,g=0);h=new Uint8Array(a.byteLength);k=[];l=function(y,x){var z=b,D=y;y+=x;for(x={};D<y;x={Vc:void 0,Xe:void 0,ue:void 0}){var B=Math.min(f*16,y-D);if(B>=16){var A=Math.floor(B/16)*16;x.Vc=D;x.Xe=B-A;x.ue=D+A;k.push(Up(a.subarray(x.Vc,x.Vc+A),z,e.Cf).then(function(E){return function(C){h.set(C,E.Vc);E.Xe>0&&h.set(a.subarray(E.ue,E.ue+E.Xe),E.ue)}}(x)));z=a.slice(x.Vc+A-16,x.Vc+A);D+=A+x.Xe}else h.set(a.subarray(D,
D+B),D),D+=B;x=Math.min(g*16,y-D);x>0&&(h.set(a.subarray(D,D+x),D),D+=x)}};if(c&&c.length)for(m=0,n=t(c),p=n.next();!p.done;p=n.next())u=p.value,q=m,m+=u.yd,h.set(a.subarray(q,q+u.yd),q),u.cc>0&&(v=m,m+=u.cc,l(v,u.cc));else l(0,a.byteLength);return w.h(Promise.all(k),2)}return w.return(h)})}
function Up(a,b,c){var d,e,f,g,h,k,l,m;return H(function(n){if(n.i==1){if(!a||!a.byteLength||a.byteLength%16!==0)return n.return(new Uint8Array(0));d=a.byteLength/16;e=a.subarray((d-1)*16,d*16);f=e.map(function(p){return 16^p});g=new Uint8Array(16);return n.h(crypto.subtle.encrypt({name:"AES-CBC",iv:g},c,f),2)}if(n.i!=3)return h=n.j,k=new Uint8Array(h,0,16),l=new Uint8Array(a.byteLength+16),l.set(a,0),l.set(k,a.byteLength),n.h(crypto.subtle.decrypt({name:"AES-CBC",iv:b},c,l),3);m=n.j;return n.return(yb(m))})}
function Tp(a,b){for(var c=15;c>=8&&b>0;c--)b+=a[c],a[c]=b&255,b>>>=8}function Vp(a){if(!a)return!1;var b;return(b=window.crypto)!=null&&b.subtle&&$b(a.keySystem)?!ob().Oh():!1};function Wp(a){this.h=a=a===void 0?[]:a}function Xp(a,b){return Yp("stbl",Zp(b),$p.value(),aq.value(),bq.value(),cq.value())}function Zp(a){var b=new Uint8Array([]);switch(a.type){case "video":var c=dq.find(function(d){d=t(d).next().value;return a.codecs.includes(d)});c&&(b=eq(a,c[0],c[1]));break;case "audio":b=fq(a)}return Yp("stsd",gq.value(),b)}
function eq(a,b,c){var d=a.stream.width||0,e=a.stream.height||0,f=new Uint8Array([]);a.cb.byteLength>0&&(f=Yp(c,a.cb));c=hq.value();iq(c,d,24);iq(c,e,26);if(a.zc||a.Mc){d=a.zc||0;e=a.Mc||0;var g=jq("pasp",8);kq(g,d,8);kq(g,e,12);d=g}else d=new Uint8Array([]);g=(e=a.Fm)&&(e.length<5?null:{profile:e[2]>>1,level:(e[2]&1)<<5|e[3]>>3,Mm:!!(e[3]&4),Hm:!!(e[3]&2),um:!!(e[3]&1),vm:e[4]>>4});e=e&&g?Yp(g.profile>7?"dvvC":"dvcC",e):new Uint8Array([]);g=new Uint8Array([]);lq(a.stream)&&(g=mq(a.stream,a.codecs),
b="encv");return Yp(b,c,f,e,d,g)}
function fq(a){var b="aac";a.codecs.includes("mp3")?b="mp3":a.codecs.includes("ac-3")?b=ob().Td()?"ec-3":"ac-3":a.codecs.includes("ec-3")?b="ec-3":a.codecs.includes("opus")?b="opus":a.codecs.toLowerCase().includes("flac")&&(b="flac");var c=a.stream.channelsCount||2,d=a.stream.audioSamplingRate||44100,e=nq.value();e[17]=c;iq(e,d>65535?0:d,24);c=new Uint8Array([]);d=a.cb;switch(b){case "mp3":b=".mp3";break;case "ac-3":b="ac-3";c=Yp("dac3",d);break;case "ec-3":b="ec-3";c=Yp("dec3",d);break;case "opus":b=
"Opus";c=Yp("dOps",d);break;case "flac":b="fLaC";c=Yp("dfLa",d);break;default:b="mp4a";c=Yp;if(!(d.byteLength>0)){d=a.id+1;var f=a.stream.channelsCount||2,g=a.stream.audioSamplingRate||44100,h=wc("audio",a.codecs.split(",")),k={96E3:0,88200:1,64E3:2,48E3:3,44100:4,32E3:5,24E3:6,22050:7,16E3:8,12E3:9,11025:10,8E3:11,7350:12},l=k[g];if(h==="mp4a.40.5"||h==="mp4a.40.29")l=k[g*2];g=parseInt(h.split(".").pop(),10);h=oq.value();iq(h,d,6);h[26]=g<<3|l>>>1;h[27]=l<<7|f<<3;d=h}c=c("esds",d)}d=new Uint8Array([]);
lq(a.stream)&&(d=mq(a.stream,a.codecs),b="enca");return Yp(b,e,c,d)}function pq(a){var b=[];if(!lq(a))return new Uint8Array([]);a=t(a.drmInfos);for(var c=a.next();!c.done;c=a.next())if(c=c.value,c.initData){c=t(c.initData);for(var d=c.next();!d.done;d=c.next())b.push(d.value.initData)}return Sb.apply(Mb,wa(b))}
function mq(a,b){var c=Yp,d=b.split(".")[0];b=jq("frma",4);kq(b,qq(d),8);d="cenc";var e=a.drmInfos[0];e&&e.encryptionScheme&&(d=e.encryptionScheme);e=rq.value();kq(e,qq(d),4);d=Yp("schm",e);e=Yp;var f=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);a=t(a.drmInfos);for(var g=a.next();!g.done;g=a.next())if((g=g.value)&&g.keyIds&&g.keyIds.size){g=t(g.keyIds);for(var h=g.next();!h.done;h=g.next()){f=h.value;h=new Uint8Array(f.length/2);for(var k=0;k<f.length/2;k+=1)h[k]=parseInt(String(f[k*2]+f[k*2+
1]),16);f=h}}a=Yp("tenc",sq.value(),f);return c("sinf",b,d,e("schi",a))}
function tq(a){var b=[],c=0;a=t(a.h);for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=Yp,f=d.data?d.data.sequenceNumber:0,g=jq("mfhd",8);kq(g,f,12);f=g;var h,k=d.data?d.data.Sa:[];g=jq("sdtp",4+k.length);for(h=0;h<k.length;h++){var l=k[h].flags;g[h+12]=l.Ce<<4|l.Oe<<2|l.Me}var m=g.length+32+20+8+16+8+8;k=Yp;h=d.id+1;l=uq.value();kq(l,h,4);h=Yp("tfhd",l);l=d.data?d.data.za:0;var n=Math.floor(l/(vq+1)),p=Math.floor(l%(vq+1));l=jq("tfdt",12);l[8]=1;kq(l,n,12);kq(l,p,16);var u=m;m=d.data?d.data.Sa:
[];n=m.length;var q=12+16*n;p=jq("trun",q);u+=8+q;p[8]=d.type==="video"?1:0;p[9]=0;p[10]=15;p[11]=1;kq(p,n,12);kq(p,u,16);for(u=0;u<n;u++){q=m[u];var v=q.flags,w=20+16*u;kq(p,q.duration,w);kq(p,q.size,w+4);p[w+8]=v.mg<<2|v.Ce;p[w+9]=v.Oe<<6|v.Me<<4|v.ng;p[w+10]=v.Be&61440;p[w+11]=v.Be&15;kq(p,q.ab,w+12)}g=k("traf",h,l,p,g);e=e("moof",f,g);d=d.data?d.data.Sa:[];f=0;g=t(d);for(k=g.next();!k.done;k=g.next())f+=k.value.data.byteLength;f=8+f;b.push({Bk:e,Sa:d,Nd:f});c+=e.byteLength+f}c=yb(new ArrayBuffer(c));
a=0;b=t(b);for(d=b.next();!d.done;d=b.next())for(f=d.value,d=f.Bk,e=f.Sa,f=f.Nd,c.set(d,a),a+=d.byteLength,kq(c,f,a),c.set(wq.value(),a+4),a+=8,d=t(e),e=d.next();!e.done;e=d.next())e=e.value,c.set(e.data,a),a+=e.data.byteLength;return c}function kq(a,b,c){a[c]=b>>>24&255;a[c+1]=b>>>16&255;a[c+2]=b>>>8&255;a[c+3]=b&255}function iq(a,b,c){a[c]=b>>>8&255;a[c+1]=b&255}function qq(a){for(var b=0,c=0;c<a.length;c+=1)b|=a.charCodeAt(c)<<(a.length-c-1)*8;return b}
function Yp(a){for(var b=Ja.apply(1,arguments),c=0,d=t(b),e=d.next();!e.done;e=d.next())c+=e.value.byteLength;c=jq(a,c);d=8;for(e=0;e<b.length;e++)c.set(b[e],d),d+=b[e].byteLength;return c}function jq(a,b){var c=xq.get(a);c||(c=[a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2),a.charCodeAt(3)],xq.set(a,c));a=8+b;b=new Uint8Array(a);b[0]=a>>24&255;b[1]=a>>16&255;b[2]=a>>8&255;b[3]=a&255;b.set(c,4);return b}function lq(a){return a.encrypted&&a.drmInfos.length>0}
var vq=4294967295,xq=new Map,wq=new nb(function(){return new Uint8Array([109,100,97,116])}),yq=new nb(function(){return new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255])}),zq=new nb(function(){return new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0])}),Aq=new nb(function(){return new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])}),Bq=new nb(function(){return new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])}),uq=new nb(function(){return new Uint8Array([0,0,0,58,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])}),oq=new nb(function(){return new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,
0,0,0,0,0,0,0,0,0,0,5,2,0,0,6,1,2])}),nq=new nb(function(){return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0])}),hq=new nb(function(){return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17])}),sq=new nb(function(){return new Uint8Array([0,0,0,0,0,0,1,8])}),rq=new nb(function(){return new Uint8Array([0,0,0,
0,0,0,0,0,0,1,0,0])}),Cq=new nb(function(){return new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0])}),Dq=new nb(function(){return new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0])}),Eq=new nb(function(){return new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}),Fq=new nb(function(){return new Uint8Array([0,0,0,0,0,0,0,0])}),dq=[["avc1","avcC"],["hvc1","hvcC"],["av01",
"av1C"],["vp09","vpcC"],["dvh1","hvcC"],["dva1","avcC"],["dav1","av1C"]],gq=new nb(function(){return new Uint8Array([0,0,0,0,0,0,0,1])}),Gq=new nb(function(){var a=new Uint8Array([105,115,111,109]),b=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);return Yp("ftyp",a,c,a,b)}),Hq=new nb(function(){var a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]);a=Yp("dref",a);return Yp("dinf",a)}),$p=new nb(function(){return jq("stts",8)}),aq=new nb(function(){return jq("stsc",8)}),
bq=new nb(function(){return jq("stsz",12)}),cq=new nb(function(){return jq("stco",8)});function Iq(a){a=yb(a);var b=null;(new hh).ma(sh,mh).P("stsd",oh).box("enca",function(c){b=c.reader.i;return qh(c)}).box("sinf",mh).box("frma",function(c){c.parser.stop();Kh(c.reader).codec==="ec-3"&&b&&b.getUint16(16)!==2&&b.setUint16(16,2)}).parse(a);return a}function Jq(a){a=yb(a);var b=null,c=-1;(new hh).ma(sh,mh).P("stsd",oh).ma(["encv","hvc1"],function(d){b=d.reader.i;c=d.start;return ph(d)}).box("dvvC",function(d){d.parser.stop();b.setUint32(d.start-c-4,1718773093)}).parse(a);return a}
function Kq(a,b,c,d){var e=b=yb(b),f=!1,g,h=[],k=[];(new hh).ma(sh,function(m){h.push(m);mh(m)}).P("stsd",function(m){g=m;h.push(m);oh(m)}).ma(["encv","enca"],function(m){f=!0;m.parser.stop()}).ma(wh,function(m){k.push({box:m,ii:1701733238})}).ma([].concat(wa(xh),["mp4a"]),function(m){k.push({box:m,ii:1701733217})}).parse(b);if(f)return b;if(k.length==0||!g)throw bb(Rb(b)),new L(2,3,3019,c);k.reverse();c=t(k);for(var l=c.next();!l.done;l=c.next())l=l.value,e=Lq(a,e,g,l.box,h,l.ii,d);e=Mq(a,e);return ob().Ng(d)?
(a=new Uint8Array(b.byteLength+e.byteLength),a.set(e),a.set(b,e.byteLength),a):e}function Nq(a){a=yb(a);var b=[];(new hh).box("mdat",function(g){b.push(g)}).parse(a);for(var c=[],d=0;d<b.length;d++){var e=b[d-1],f=b[d];c.push(Oq(a.subarray(e?e.start+e.size:0,f.start+f.size)))}return Sb.apply(Mb,wa(c))}
function Oq(a){var b,c,d,e,f=[];(new hh).ma(th,function(m){f.push(m);mh(m)}).P("tfhd",function(m){b=m;d=Ch(m.reader,m.flags)}).P("trun",function(m){c=m;e=Fh(m.reader,m.version,m.flags)}).parse(a);if(d&&d.Rg!==2){var g=b.start+nh(b)+4+(d.uh!==null?8:0),h=Bb(a);if(d.Rg!==null)h.setUint32(g,2);else{Pq(a,b.start,b.size+4);var k=h.getUint32(b.start+8);h.setUint32(b.start+8,k|2);e&&e.Zb!==null&&h.setInt32(c.start+nh(c)+4,e.Zb+4);k=a.subarray(0,g);h=a.subarray(g);a=new Uint8Array(a.byteLength+4);a.set(k);
k=[];for(var l=3;l>=0;l--)k.push(2>>8*l&255);a.set(new Uint8Array(k),g);a.set(h,g+4);g=t(f);for(h=g.next();!h.done;h=g.next())h=h.value,Pq(a,h.start,h.size+4)}}return a}
function Lq(a,b,c,d,e,f,g){var h=mq(a,d.name),k=b.subarray(d.start,d.start+d.size);a=new Uint8Array(d.size+h.byteLength);a.set(k,0);Bb(a).setUint32(4,f);a.set(h,d.size);Pq(a,0,a.byteLength);f=new Uint8Array(b.byteLength+a.byteLength);d=ob().Ne(g)?d.start:d.start+d.size;g=b.subarray(d);f.set(b.subarray(0,d));f.set(a,d);f.set(g,d+a.byteLength);b=t(e);for(e=b.next();!e.done;e=b.next())e=e.value,Pq(f,e.start,e.size+a.byteLength);a=Bb(f,c.start);c=nh(c);b=a.getUint32(c);a.setUint32(c,b+1);return f}
function Mq(a,b){a=pq(a);if(a.byteLength===0)return b;var c=0,d=0;(new hh).box("moov",function(h){c=h.start;d=h.size;h.parser.stop()}).parse(b);var e=c+d;Pq(b,c,d+a.byteLength);var f=new Uint8Array(b.byteLength+a.byteLength),g=b.subarray(e);f.set(b.subarray(0,e));f.set(a,e);f.set(g,e+a.byteLength);return f}function Pq(a,b,c){a=Bb(a,b);b=a.getUint32(0);b!=0&&(b==1?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))}
function Qq(a){var b=yb(a),c=[];(new hh).ma(sh,function(d){c.push({start:d.start,size:d.size});mh(d)}).box("stsd",function(d){c.push({start:d.start,size:d.size});for(var e=Bb(b,d.start),f=0;f<d.size-3;f++){var g=e.getUint32(f);g==1633889587?e.setUint32(f,1700998451):g==1684103987&&e.setUint32(f,1684366131)}}).parse(b);return b}
function Rq(a){a=yb(a);var b=[],c=[],d=[],e=[],f=!1;(new hh).box("moof",function(A){b.push(A);mh(A)}).box("traf",function(A){c.push(A);mh(A)}).P("tfhd",function(A){d.push(A)}).P("trun",function(A){e.push(A)}).ma(["senc","saiz","saio"],function(){f=!0}).parse(a,!1,!0);if(f||b.length!=1||c.length!=1||d.length!=1||e.length!=1)return a;var g=b[0],h=c[0],k=d[0],l=e[0],m=l.flags,n=Ch(k.reader,k.flags),p=Fh(l.reader,l.version,l.flags);if(n.uh!=null||!(m&1)||p.Zb==null)return a;var u=g.start+g.size,q=Bb(a);
if(u+8>a.byteLength||q.getUint32(u+4)!=1835295092)return a;q=q.getUint32(u);if(q==1)return a;q==0&&(q=a.byteLength-u);var v=a.byteLength-(u+8);if(v>=q-8)return a;for(var w=q=0,y=t(p.nc),x=y.next();!x.done;x=y.next()){x=x.value;x=x.sampleSize!=null?x.sampleSize:n.ac;if(x==null)return a;if(q+x>v)break;q+=x;w++}if(w!=1||w>=p.sampleCount)return a;y=(m&256)!=0;v=0;x=t(p.nc);for(var z=x.next();!z.done;z=x.next()){z=z.value;z=y?z.qc:n.Fb;if(z==null)return a;v+=z}x=nh(l);z=l.start+x+4;z+=4;m&4&&(z+=4);var D=
0;m&256&&(D+=4);m&512&&(D+=4);m&1024&&(D+=4);m&2048&&(D+=4);m=(p.sampleCount-w)*D;D=z+w*D;if(D+m!=u)return a;D=a.slice(0,D);var B=Bb(D);B.setUint32(l.start+x,w);B.setInt32(l.start+x+4,p.Zb-m);y?B.setUint32(z,v):(k=k.start+nh(k)+4,n.Rg!=null&&(k+=4),B.setUint32(k,v));Pq(D,l.start,l.size-m);Pq(D,h.start,h.size-m);Pq(D,g.start,g.size-m);g=a.slice(u,u+8);Pq(g,0,8+q);return Sb(D,g,a.subarray(u+8,u+8+q))};function Sq(a){return a.length==1&&a.end(0)-a.start(0)<1E-4}function Tq(a){return!a||Sq(a)?null:a.length==1&&a.start(0)<0?0:a.length?a.start(0):null}function Uq(a){return!a||Sq(a)?null:a.length?a.end(a.length-1):null}function Vq(a,b){return!a||!a.length||Sq(a)||b>a.end(a.length-1)?!1:b>=a.start(0)}function Wq(a,b){if(!a||!a.length||Sq(a))return 0;var c=0;a=t(Xq(a));for(var d=a.next();!d.done;d=a.next()){var e=d.value;d=e.start;e=e.end;e>b&&(c+=e-Math.max(d,b))}return c}
function Yq(a,b){if(!a||!a.length||Sq(a))return 0;var c=0;a=t(Xq(a));for(var d=a.next();!d.done;d=a.next()){var e=d.value;d=e.start;e=e.end;d<b&&(c+=Math.min(e,b)-d)}return c}function Zq(a,b,c){if(!a||!a.length||Sq(a))return null;a=Xq(a).findIndex(function(d,e,f){return d.start>b&&(e==0||f[e-1].end-b<=c)});return a>=0?a:null}function Xq(a){if(!a)return[];for(var b=[],c=0;c<a.length;c++)b.push({start:a.start(c),end:a.end(c)});return b};function $q(a,b,c,d,e,f){var g=this;this.B=d;this.I=e||function(){return a.playbackRate};this.K=f||function(){return[]};this.h=a;this.F=b;this.i=c;this.m=new ib;this.u=!1;this.o=0;this.D=!1;this.H=this.G=0;this.l=ar(this);this.C=!1;this.m.J(a,"waiting",function(){return br(g)});this.j=(new $e(function(){br(g)})).La(this.i.gapJumpTimerTime)}
$q.prototype.release=function(){this.m&&(this.m.release(),this.m=null);this.j!=null&&(this.j.stop(),this.j=null);this.l&&(this.l.release(),this.l=null);this.h=this.F=this.B=null};$q.prototype.dd=function(){this.C=!0;this.j&&this.j.La(this.i.gapJumpTimerTime);br(this)};
function br(a){if(a.h.readyState!=0){if(a.h.seeking){if(!a.u)return}else a.u=!1;if(!a.h.paused||a.h.currentTime==a.o&&(a.h.autoplay||a.h.currentTime!=a.o))if(!a.l||!cr(a.l)){var b=a.h.currentTime,c=a.h.buffered,d=a.i.gapDetectionThreshold;if(!(a.I()<0)){d=Zq(c,b,d);if(d==null&&a.l&&!cr(a.l))for(var e=Xq(c),f=0;f<e.length-1;f++)if(Math.abs(b-e[f].end)<.1&&e[f+1].start>e[f].end){d=f+1;break}if(d!=null&&(d!=0||a.C)){if(d>0){var g=c.end(d-1);if(a.K().some(function(h){return g>=h.start-.1&&g<h.end})&&
g-b>.1)return}e=c.start(d);(f=a.i.gapPadding)&&(e=Math.ceil((e+f)*100)/100);f=a.F.ob();e>=f||e-b<.001||(d==0||Za(c.end(d-1)),dr(a,e),b==a.o&&(a.o=e),a.G++,a.B(new tk("gapjumped")))}}}}}function dr(a,b){a.D=!0;a.m.Ra(a.h,"seeked",function(){a.D=!1});a.h.currentTime=b}
function ar(a){if(!a.i.stallEnabled)return null;var b=a.i.stallThreshold,c=a.i.stallSkip;return new er(new fr(a.h),b,function(d,e,f){var g;return H(function(h){if(h.i==1)return g=Xq(a.h.buffered),g.length?c?(a.h.currentTime+=c,h.A(2)):h.h(a.h.play(),3):h.return();if(h.i!=2){if(!a.h)return h.return();a.h.pause();a.h.play()}f==0&&(a.H++,a.B(new tk("stalldetected")));h.l()})})}function er(a,b,c){this.j=a;this.B=gr(a);this.i=a.h.currentTime;this.o=Date.now()/1E3;this.m=this.h=0;this.u=b;this.l=c}
er.prototype.release=function(){this.j&&this.j.release();this.l=this.j=null};function cr(a){var b=a.j,c=gr(b),d=b.h.currentTime,e=Date.now()/1E3;if(a.i!=d||a.B!=c)a.o=e,a.i=d,a.B=c,a.h=0;d=e-a.o;if(c=d>=a.u&&c&&a.h<3&&(a.h==0||e-a.m>=a.u))a.l&&a.l(a.i,d,a.h),a.h++,a.m=e,a.i=b.h.currentTime;return c}
function fr(a){var b=this;this.h=a;this.i=new ib;this.j=!1;this.i.J(this.h,"audiofocuspaused",function(){b.j=!0});this.i.J(this.h,"audiofocusgranted",function(){b.j=!1});this.i.J(this.h,"audiofocuslost",function(){b.j=!0})}function gr(a){if(a.h.paused||a.h.playbackRate==0||a.j||a.h.buffered.length==0)var b=!1;else a:{b=a.h.currentTime;a=t(Xq(a.h.buffered));for(var c=a.next();!c.done;c=a.next())if(c=c.value,!(b<c.start-.1||b>c.end-.5)){b=!0;break a}b=!1}return b}
fr.prototype.release=function(){this.i&&this.i.release();this.i=null};function hr(a,b,c){this.i=a;this.j=b;this.h=c}
function ir(a,b){var c,d,e;return H(function(f){if(f.i==1)return f.h(pf(a.h,b,a.i.drm.preferredKeySystems,a.i.drm.keySystemsMapping),2);a.i.streaming.dontChooseCodecs||(c=a.i.preferredVideo.map(function(g){return g.codec}).filter(Boolean),d=a.i.preferredAudio.map(function(g){return g.codec}).filter(Boolean),e=a.i.preferredText.map(function(g){return g.format}).filter(Boolean),gf(b,c,d,a.i.preferredDecodingAttributes,e));if(!b.variants.some(Nf))throw new L(2,4,4032);return f.return(jr(a,b))})}
function kr(a,b){var c=a.i.restrictions;a=a.j;var d=!1;b=t(b.variants);for(var e=b.next();!e.done;e=b.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=of(e,c,a);f!=e.allowedByApplication&&(d=!0)}return d}
function jr(a,b){var c=kr(a,b);if(b){var d=a.h?a.h.Sb():null;if(d&&a.h.B){for(var e=new Set,f=t(b.variants),g=f.next();!g.done;g=f.next())g=g.value,g.audio&&e.add(g.audio),g.video&&e.add(g.video);e=t(e);for(f=e.next();!f.done;f=e.next())lr(a,d.keySystem,f.value)}mr(a,b)}return c}
function lr(a,b,c){c=t(c.drmInfos);for(var d=c.next();!d.done;d=c.next())if(d=d.value,d.keySystem==b){for(var e=t(d.initData||[]),f=e.next();!f.done;f=e.next())f=f.value,nl(a.h,f.initDataType,f.initData);e=a.h;e.h&&(e.h.mediaTypes!==d.mediaTypes&&(e.h.mediaTypes=d.mediaTypes),Xb(d)&&(e.h=zl(e,e.h.keySystem,[e.h,d])))}}
function mr(a,b){function c(l){if(l&&!h.has(l)&&(h.add(l),l.keyIds.size)){l=t(l.keyIds);for(var m=l.next();!m.done;m=l.next()){m=m.value;var n=d[e?"00":m];n?nr.includes(n)&&g.add(n):f.add(m)}}}var d=a.h?a.h.Ie():{};a=Object.keys(d);var e=a.length&&a[0]=="00";a=!1;var f=new Set,g=new Set,h=new WeakSet;b=t(b.variants);for(var k=b.next();!k.done;k=b.next()){k=k.value;if(!k.allowedByApplication)a=!0;else if(k.allowedByKeySystem)return;c(k.audio);c(k.video)}a={hasAppRestrictions:a,missingKeys:Array.from(f),
restrictedKeyStatuses:Array.from(g)};throw new L(2,4,4012,a);}var nr=["output-restricted","internal-error"];function or(a,b,c){this.i=a;this.B=c===void 0?null:c;this.C=b===void 0?"":b;this.j=!1;this.u=0;this.h=new Map;this.l=pr++;this.m=this.o=!1}r=or.prototype;r.destroy=function(){for(var a=t(this.h.values()),b=a.next();!b.done;b=a.next())b=b.value,b.Lc.stop(),b.reject(new L(2,3,3018,"Worker transmuxer destroyed"));this.h.clear();this.m&&(qr&&qr.postMessage({cmd:"destroy",id:this.l}),rr.delete(this.l),this.m=!1,rr.size===0&&qr&&(qr.terminate(),qr=null));this.i.destroy()};
r.isSupported=function(a,b){return this.i.isSupported(a,b)};r.convertCodecs=function(a,b){return this.i.convertCodecs(a,b)};r.getOriginalMimeType=function(){return this.i.getOriginalMimeType()};
r.transmux=function(a,b,c,d,e){var f=this,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D,B,A,E,C;return H(function(F){if(F.i==1){if(f.j)return F.return(f.i.transmux(a,b,c,d,e));if(!f.m){g=sr(f.C);if(!g)return f.j=!0,F.return(f.i.transmux(a,b,c,d,e));rr.set(f.l,f);f.m=!0}h=qr;if(!h)return f.j=!0,F.return(f.i.transmux(a,b,c,d,e));f.o||(k=f.i.getOriginalMimeType(),h.postMessage({cmd:"init",id:f.l,mimeType:k,priority:f.B,typeSupport:Array.from(Lm)}),f.o=!0);l=f.u++;m={id:b.id,codecs:b.codecs,channelsCount:b.channelsCount,
audioSamplingRate:b.audioSamplingRate,height:b.height,width:b.width,language:b.language};n=c?{discontinuitySequence:c.discontinuitySequence,startTime:c.startTime,endTime:c.endTime,uris:c.S()}:null;p=xb(Sb(a));u=Promise.withResolvers();q=u.promise;v=u.resolve;w=u.reject;y=!1;x=new $e(function(){f.h.has(l)&&(f.h.delete(l),y=f.j=!0,v(null))});x.ha(30);f.h.set(l,{resolve:v,reject:w,Lc:x});try{h.postMessage({cmd:"transmux",id:f.l,reqId:l,data:p,streamProps:m,refProps:n,duration:d,contentType:e},[p])}catch(G){return x.stop(),
f.h.delete(l),tr(),F.return(f.i.transmux(a,b,c,d,e))}return F.h(q,2)}z=F.j;if(y||z===null)return Wa("Worker transmux unavailable; falling back to main-thread transmuxing"),F.return(f.i.transmux(a,b,c,d,e));if((D=z.streamMutations)&&Object.keys(D).length>0)for(B=t(Object.keys(D)),A=B.next();!A.done;A=B.next())E=A.value,b[E]=D[E];C=z.output;return C.type==="raw"?F.return(yb(C.data)):F.return({data:yb(C.data),init:C.init?yb(C.init):null})})};K("shaka.transmuxer.TransmuxerProxy",or);
or.prototype.transmux=or.prototype.transmux;or.prototype.getOriginalMimeType=or.prototype.getOriginalMimeType;or.prototype.convertCodecs=or.prototype.convertCodecs;or.prototype.isSupported=or.prototype.isSupported;or.prototype.destroy=or.prototype.destroy;var pr=0,qr=null,rr=new Map;
function sr(a){if(qr)return qr;if(!ob().ld()||!a)return null;try{var b=new Worker(a);b.addEventListener("message",function(c){c=c.data;var d=c.cmd;if(d==="transmuxed"||d==="error"||d==="unavailable")if(d=rr.get(c.id)){var e=c.cmd;if(e==="unavailable"){d.j=!0;var f=d.h.get(c.reqId);f&&(f.Lc.stop(),d.h.delete(c.reqId),f.resolve(null))}else if(e==="transmuxed"||e==="error"){var g=c.reqId;if(f=d.h.get(g))f.Lc.stop(),d.h.delete(g),e==="error"?(c=c.error,f.reject(new (Function.prototype.bind.apply(L,[null,
c.severity,c.category,c.code].concat(wa(c.data)))))):f.resolve(c)}}});b.addEventListener("error",function(){tr()});return qr=b}catch(c){return null}}function tr(){for(var a=t(rr.values()),b=a.next();!b.done;b=a.next()){b=b.value;b.j=!0;for(var c=t(b.h.values()),d=c.next();!d.done;d=c.next())d=d.value,d.Lc.stop(),d.resolve(null);b.h.clear()}qr=null;rr.clear()};function ur(a,b,c){c=c===void 0?Number.EPSILON:c;if(a===b)return!0;a=Math.abs(a-b);return a<=c?!0:c!==Number.EPSILON?Math.abs(a-c)<=Number.EPSILON:!1};function vr(a,b,c,d,e){var f=this;this.h=a;this.F=c;this.o=d;this.ra=b;this.l=new Map;this.D=new Map;this.V=new Map;this.Ma=new Map;this.i=null;this.Ga=!1;this.H=e||null;this.B=new Map;this.C=new ib;this.m=new Map;this.I=null;this.O=Promise.withResolvers();this.Da="";this.fb=!1;this.Aa=!0;this.na=!1;this.L=this.ka=null;this.j=wr(this,this.O);this.Oa=this.Pa=this.K=!1;this.G=new Tk(function(){return xr(f)});this.M=!1;this.Y="UNKNOWN";this.u=this.$a=this.eb=!1;this.Ba=null;this.Qa=new Map;this.sa=this.Z=
this.ua=this.T=null;this.ba=Promise.withResolvers();var g=Qj(ob(),this.h);g&&(this.na=g.state!="disconnected",this.C.Jb(g,["connect","connecting","disconnect"],function(){f.na=g.state!="disconnected"}));this.Ya=!1;this.N=new Map}
function wr(a,b){a.Aa=!0;if(window.ManagedMediaSource){a.L||(a.h.disableRemotePlayback=!0);var c=new ManagedMediaSource;a.C.J(c,"startstreaming",function(){a.Aa=!0});a.C.J(c,"endstreaming",function(){a.Aa=!1})}else c=new MediaSource;a.C.Ra(c,"sourceopen",function(){URL.revokeObjectURL(a.Da);b.resolve()});a.C.Ra(a.h,"playing",function(){a.fb=!0});a.Da=yr(c);zr(a);a.o.useSourceElements?(a.ka=Ij(a.Da),a.h.appendChild(a.ka),a.L&&a.h.appendChild(a.L),a.h.load()):a.h.src=a.Da;return c}
function Ar(a,b,c){if(a.h&&window.ManagedMediaSource&&a.j&&a.o.useSourceElements){var d;((d=a.L)==null?void 0:d.parentElement)===a.h&&a.h.removeChild(a.L);a.L=Ij(b,c);a.h.appendChild(a.L);a.h.disableRemotePlayback=!1}}
function Br(){var a='video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.20000000.L153.B0",video/mp4; codecs="hvc1.2.4.L120.b0",video/mp4; codecs="hvc1.2.4.L123.b0",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",video/mp4; codecs="av01.0.31M.10.0.111.09.16.09.0",video/mp4; codecs="av01.0.31M.10.0.112.09.18.09.0",video/mp4; codecs="dvh1.05.01",video/mp4; codecs="dvh1.08.01",video/mp4; codecs="dav1.10.01",video/mp4; codecs="dvh1.20.01",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="ac-4.02.01.03",audio/mp4; codecs="opus",audio/mp4; codecs="flac",audio/mp4; codecs="mp3",audio/mp4; codecs="mp4a.6B",audio/mp4; codecs="mp4a.69",audio/mp4; codecs="dtsc",audio/mp4; codecs="dtse",audio/mp4; codecs="dtsx",audio/mp4; codecs="apac.31.00",audio/mp4; codecs="iamf.000.000.Opus",audio/mp4; codecs="iamf.000.000.mp4a.40.2",audio/mp4; codecs="iamf.000.000.fLaC",audio/mp4; codecs="iamf.000.000.ipcm",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").concat(wa(we)),b=
{};ob();a=t(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;if(Pe(c))b[c]=!0;else if(Lc()){var d=De(c),e=Ge(Ee(c),d);d=ve(d,e);b[c]=Km(d)||(oe(d)?!0:!1)}else b[c]=Mc().canPlayType(c)!="";d=c.split(";")[0];b[d]=b[d]||b[c]}return b}r=vr.prototype;r.destroy=function(){return this.G.destroy()};
function xr(a){var b,c,d,e,f,g,h,k,l,m,n,p,u,q,v,w,y,x;return H(function(z){if(z.i==1){b=[];c=t(a.B);for(d=c.next();!d.done;d=c.next())for(e=d.value,f=t(e),g=f.next().value,h=f.next().value,k=h[0],l=g,a.B.set(l,h.slice(0,1)),k&&b.push(k.p.promise.catch(function(){})),m=t(h.slice(1)),n=m.next();!n.done;n=m.next())p=n.value,p.p.reject(new L(2,7,7003,void 0));a.i&&b.push(a.i.destroy());return z.h(Promise.all(b),2)}b=[];u=t(a.m.values());for(q=u.next();!q.done;q=u.next())v=q.value,v.destroy();w=t(a.N.values());
for(y=w.next();!y.done;y=w.next())x=y.value,b.push(x.destroy());a.C&&(a.C.release(),a.C=null);a.h&&(zr(a),a.h.load(),a.h.disableRemotePlayback=!1);a.h=null;a.ka=null;a.L=null;a.o=null;a.j=null;a.i=null;a.ra=null;a.l.clear();a.V.clear();a.Ma.clear();a.N.clear();a.m.clear();a.I=null;a.B.clear();a.H=null;a.Qa.clear();a.F=null;return z.h(Promise.all(b),0)})}
function zr(a){if(a.h){a.h.removeAttribute("src");var b;((b=a.ka)==null?void 0:b.parentElement)===a.h&&a.h.removeChild(a.ka);var c;((c=a.L)==null?void 0:c.parentElement)===a.h&&a.h.removeChild(a.L)}}
r.init=function(a,b,c,d){b=b===void 0?!1:b;c=c===void 0?"UNKNOWN":c;d=d===void 0?!1:d;var e=this,f,g,h,k,l,m;return H(function(n){if(n.i==1)return f=Bc,n.h(e.O.promise,2);if(n.i!=3){if(!Cr(e)&&!Dr(e))return n.A(3);Va("Expected MediaSource to be open during init(); reopening the media source.");e.O=Promise.withResolvers();e.j=wr(e,e.O);return n.h(e.O.promise,3)}e.M=b;e.Y=c;e.eb=d;e.$a=!e.M&&e.Y=="HLS"&&!e.eb;e.Qa.clear();e.T=null;e.ua=null;e.Z=null;e.sa=null;e.ba=Promise.withResolvers();g=t(a.keys());
for(h=g.next();!h.done;h=g.next())k=h.value,l=a.get(k),Er(e,k,l,l.codecs),e.u?(e.B.set(f.$,[]),e.B.set(f.qa,[])):e.B.set(k,[]);(m=a.get(f.$))&&m.isAudioMuxedInVideo&&(e.u=!0);n.l()})};
function Er(a,b,c,d){b=="audio"&&d&&(d=Ge(d,c.mimeType));b=="video"&&d&&c.mimeType=="video/mp4"&&(d=He(d,c.mimeType));var e=ve(c.mimeType,d);if(b==zc)Fr(a,e,c.external);else{var f=Km(e)&&(a.M||!we.includes(e)),g=xe(c.mimeType,d);if(a.o.forceTransmux||!f){var h=oe(g),k=xc("audio",(d||"").split(","));d=xc("video",(d||"").split(","));if(k&&d&&(h||!f)){a.u=!0;Er(a,"audio",c,k);Er(a,"video",c,d);return}h&&(e=new or(h(),a.o.transmuxWorkerUrl,qe(g,h)),a.m.set(b,e),e=e.convertCodecs(b,g))}g=e+a.o.addExtraFeaturesToSourceBuffer(e);
Uk(a.G);try{var l=a.j.addSourceBuffer(g)}catch(n){throw new L(2,3,3015,n,"The mediaSource_ status was "+a.j.readyState+" expected 'open'",null);}a.M&&(l.mode=Gr);a.C.J(l,"error",function(){var n=a.B.get(b)[0];n.p.reject(new L(2,3,3014,a.h.error?a.h.error.code:0,n.uri))});a.C.J(l,"updateend",function(){return Hr(a,b)});a.l.set(b,l);a.D.set(b,e);a.Ma.set(b,!!c.drmInfos.length);c=a.F.Sb();if(Vp(c))a.N.set(b,new Ip);else{var m;(m=a.N.get(b))==null||m.destroy();a.N.delete(b)}}}
r.configure=function(a){this.o=a;this.i&&(this.i.G=a.modifyCueCallback)};function Ir(a){return a.Aa&&!a.na&&!a.K}function Fr(a,b,c){a.i||(a.i=new Le(a.ra,a.Y),a.i&&(a.i.G=a.o.modifyCueCallback));var d=a.i;a=a.Ga;b==Je||b==Ke?d.m=null:(d.m=Ne.get(b)(),d.m.setManifestType(d.F),d.I=a,d.D=c)}function Cr(a){return a.K?!1:a.j?a.j.readyState=="ended":!0}function Dr(a){return a.K?!1:a.j?a.j.readyState=="closed":!0}function Jr(a,b){return a.l.size?b==zc?a.i.h:Tq(Kr(a,b)):null}
function Lr(a,b){return a.l.size?b==zc?a.i.i:Uq(Kr(a,b)):null}function Mr(a,b,c){if(b==zc)return a=a.i,a.h==null||a.i==null?!1:c>=a.h&&c<a.i;a=Kr(a,b);return Vq(a,c)}function Nr(a,b,c){if(b==zc)return a=a.i,a.i==null||a.i<c?0:a.i-Math.max(c,a.h);a=Kr(a,b);return Wq(a,c)}function Or(a,b,c){if(b==zc)return a=a.i,a.h==null||a.h>c?0:Math.min(c,a.i)-a.h;a=Kr(a,b);return Yq(a,c)}
r.dc=function(){var a={total:this.K?[]:Xq(this.h.buffered),audio:Xq(Kr(this,"audio")),video:Xq(Kr(this,"video")),text:[]};if(this.i){var b=this.i.h,c=this.i.i;b!=null&&c!=null&&a.text.push({start:b,end:c})}return a};function Kr(a,b){if(!Pr(a))return null;try{return a.l.get(b).buffered}catch(c){return a.l.has(b),null}}
function Qr(a,b,c,d,e,f,g){g=g===void 0?!1:g;var h=null,k=[],l=yb(c);if(we.includes(f)||b=="audio"&&!f.includes("/mp4")&&!f.includes("/webm")&&!Li(l)&&Om(l))c=ji(l),c.length&&d&&((g=c.find(function(v){return v.description==="com.apple.streaming.transportStreamTimestamp"}))&&typeof g.data=="number"&&(h=Math.round(g.data)/1E3),a.F.onMetadata([{cueTime:d.startTime,data:l,frames:c,dts:d.startTime,pts:d.startTime}],0,d.endTime));else if(f.includes("/mp4")&&d&&d.initSegmentReference){l=new hh;var m=e.emsgSchemeIdUris!=
null&&e.emsgSchemeIdUris.length>0||a.o.dispatchAllEmsgBoxes,n=[];m&&l.P("emsg",function(v){a:{var w=e.emsgSchemeIdUris;if(v.version===0){var y=v.reader.gd();var x=v.reader.gd();var z=v.reader.R();var D=v.reader.R();var B=v.reader.R();var A=v.reader.R();var E=d.startTime+D/z}else z=v.reader.R(),E=v.reader.Ze()/z+d.m,D=E-d.startTime,B=v.reader.R(),A=v.reader.R(),y=v.reader.gd(),x=v.reader.gd();v=v.reader.wa(v.reader.Na()-v.reader.Ia(),!0);if(w&&w.includes(y)||a.o.dispatchAllEmsgBoxes)if(y=="urn:mpeg:dash:event:2012")a.F.Kk();
else{w=E;if(y!=="https://aomedia.org/emsg/ID3"||B!==4294967295)w+=B/z;z={startTime:E,endTime:w,schemeIdUri:y,value:x,timescale:z,presentationTimeDelta:D,eventDuration:B,id:A,messageData:v};break a}z=null}z&&n.push(z)});var p=d.initSegmentReference.timescale;b=p&&!isNaN(p);var u=0,q=!1;b&&l.P("prft",function(v){var w=v.reader,y=v.version;w.R();v=w.R();var x=w.R();v=v*1E3+x/4294967296*1E3;y===0?w=w.R():(y=w.R(),w=w.R(),w=y*4294967296+w);v=(new Date(Date.UTC(1900,0,1,0,0,0,0)+v)).getTime();w=(new Map).set("detail",
{wallClockTime:v,programStartDate:new Date(v-w/p*1E3)});w=new tk("prft",w);a.F.onEvent(w)}).ma(th,mh).P("tfdt",function(v){q||(u=Dh(v.reader,v.version).za/p,q=!0,m||v.parser.stop())});(m||b)&&l.parse(c,!1,g);q&&d.m==0&&(h=u);l=t(n);for(c=l.next();!c.done;c=l.next())Rr(a,c.value,d,h)}else f.includes("/mp4")||f.includes("/webm")||!Li(l)||(k=a.Qa.getOrInsertComputed(b,function(){return new yi}),k.clearData(),k.gf(d.discontinuitySequence),k.parse(l),l=Fi(k,b),l!=null&&(h=l),k=k.getMetadata());return{timestamp:h,
metadata:k}}function Rr(a,b,c,d){var e=ur(b.startTime,c.startTime+b.presentationTimeDelta/b.timescale);d&&a.Y=="HLS"&&!e&&(c=-d+c.startTime,b.startTime+=c,b.endTime+=c);a.F.Hk(b);!b.messageData||b.schemeIdUri!="https://aomedia.org/emsg/ID3"&&b.schemeIdUri!="https://developer.apple.com/streaming/emsg-id3"||(c=ji(b.messageData),c.length&&(d=b.startTime,a.F.onMetadata([{cueTime:d,data:b.messageData,frames:c,dts:d,pts:d}],0,b.endTime)))}
function Sr(a,b,c,d,e,f,g,h,k,l,m){g=g===void 0?!1:g;h=h===void 0?!1:h;k=k===void 0?!1:k;l=l===void 0?!1:l;var n,p,u,q,v,w,y,x,z,D,B,A,E,C,F,G,J,Q,O,V,M,N,P,U,ea,ha,I,T,R,S,X,ka,ma,Aa,ja;return H(function(ua){switch(ua.i){case 1:n=Bc;if(b!=n.Ua){ua.A(2);break}return ua.h(Qe(a.i,c,d?d.startTime:null,d?d.endTime:null,d?d.S()[0]:null,d?d.discontinuitySequence:-1),3);case 3:return ua.return({Cc:null});case 2:if(l||!a.u){ua.A(4);break}return ua.h(Sr(a,n.qa,c,d,e,f,g,h,k,!0,m),5);case 5:return p=ua.j,ua.h(Sr(a,
n.$,c,d,e,f,g,h,k,!0,m),6);case 6:return u=ua.j,ua.return(p.Cc!=null?p:u);case 4:if(!a.l.has(b))return ua.return({Cc:null});e.preselection&&(q={data:c,preselection:e.preselection,stream:e,contentType:b,isInitSegment:d==null},(v=a.o.modifyPreselectionSegmentCallback(q))&&v.data&&(c=v.data));w=a.V.has(b)?a.V.get(b):a.l.get(b).timestampOffset;y=null;Cr(a)&&Tr(a,b,function(){var ub=a.l.get(b);if(Cr(a)){var vb=ub.buffered;vb=vb.length?vb.end(vb.length-1):0;ub.remove(vb,vb+.001)}else Hr(a,b)},null);x=a.D.get(b);
a.m.has(b)&&(x=a.m.get(b).getOriginalMimeType());if(!d){ua.A(7);break}z=Qr(a,b,c,d,e,x,k);D=z.timestamp;B=z.metadata;if(D==null){ua.A(8);break}y=D;a.T==null&&b==n.qa&&(a.T=D,a.ua=d.startTime,a.Z!=null&&(A=0,a.ua==a.sa&&(A=a.T-a.Z),a.ba.resolve(A)));a.Z==null&&b==n.$&&(a.Z=D,a.sa=d.startTime,a.T!=null&&(E=0,a.ua==a.sa&&(E=a.T-a.Z),a.ba.resolve(E)));F=Ur;G=b==n.$&&a.u&&!a.M&&a.T!=null&&a.l.has(n.qa)&&a.l.get(n.$).mode==F.Xi;if(!G){J=D;Q=we;!a.M&&Q.includes(a.D.get(b))&&(J=0);C=d.startTime-J;ua.A(9);
break}O=a.V.has(n.qa)?a.V.get(n.qa):a.l.get(n.qa).timestampOffset;return ua.h(a.ba.promise,10);case 10:V=ua.j,C=O+V;case 9:M=Math.abs(w-C),(M>=.001||g||h)&&(!k||C>0||!w)&&(w=C,a.$a&&(Tr(a,b,function(){return Vr(a,b)},null),Tr(a,b,function(){return Wr(a,b,w)},null))),(N=b==n.qa||!a.l.has(n.qa))&&a.i&&((a.M||a.Y=="HLS")&&Ue(a.i,w,d.discontinuitySequence),Ve(a.i,(x||"").includes("mp2t")));case 8:if(B.length)a.F.onMetadata(B,w,d?d.endTime:null);case 7:P=null;if(!a.m.has(b)){ua.A(11);break}return ua.h(a.m.get(b).transmux(c,
e,d,a.j.duration,b),12);case 12:U=ua.j,ArrayBuffer.isView(U)?c=U:(ea=U,ea.init!=null&&(P=ha=ea.init,Tr(a,b,function(){Xr(a,b,ha,w,e,!0)},d?d.S()[0]:null)),c=ea.data);case 11:f&&b==n.qa&&(a.i||Fr(a,Je,!1),a.I||(I=a.D.get(b)||x,a.I=new Rc(I.split(";",1)[0])),!P&&d||a.I.init(P||c,h,m),d&&(T=Vc(a.I,c),T.length&&Ze(a.i,T,w)));c=Yr(a,e,c,d,b);if(!a.N.has(b)){ua.A(13);break}R=ze(a.D.get(b))=="mp4";S=a.F.Sb();if(!R||!S){ua.A(13);break}X=d===null;ka=a.N.get(b);return ua.h(Jp(ka,c,X,S),15);case 15:c=ua.j;case 13:ma=
we.includes(a.D.get(b));if(!d||!a.M&&!ma||b==n.Ua){ua.A(16);break}if(!g&&!h){ua.A(16);break}Aa=d.startTime;if(a.Y!="HLS"||a.u||b!=n.$||!a.l.has(n.qa)){ua.A(18);break}return ua.h(a.ba.promise,19);case 19:ja=ua.j,Math.abs(ja)>.15&&(Aa-=ja);case 18:Tr(a,b,function(){return Vr(a,b)},null),Tr(a,b,function(){return Wr(a,b,Aa)},null);case 16:return ua.h(Tr(a,b,function(){Xr(a,b,c,w,e,!d)},d?d.S()[0]:null),20);case 20:return ua.return({Cc:y})}})}function Zr(a,b){var c=Lr(a,"video")||0;Xe(a.i,b,c)}
function $r(a){a.i&&Xe(a.i,"",0)}r.remove=function(a,b,c,d){var e=this,f,g;return H(function(h){return h.i==1?(f=Bc,a==f.qa&&e.I&&(e.I.remove(d),g=e.i.h||0,e.i.remove(g,c,!0)),a==f.Ua?h.h(e.i.remove(b,c),0):c>b?h.h(Tr(e,a,function(){return as(e,a,b,c)},null),5):h.A(0)):e.u?h.h(Tr(e,f.$,function(){return as(e,f.$,b,c)},null),0):h.A(0)})};
function bs(a,b){var c;return H(function(d){return d.i==1?(c=Bc,b==c.Ua?a.i?d.h(a.i.remove(0,Infinity),0):d.return():b===c.qa&&a.I&&a.i?d.h(a.i.remove(0,Infinity,!0),4):d.A(4)):d.i!=6?d.h(Tr(a,b,function(){return as(a,b,0,a.j.duration)},null),6):a.u?d.h(Tr(a,c.$,function(){return as(a,c.$,0,a.j.duration)},null),0):d.A(0)})}
r.flush=function(a){var b=this,c;return H(function(d){return d.i==1?(c=Bc,a==c.Ua?d.return():d.h(Tr(b,a,function(){b.h.currentTime-=.001;Hr(b,a)},null),2)):b.u?d.h(Tr(b,c.$,function(){var e=c.$;b.h.currentTime-=.001;Hr(b,e)},null),0):d.A(0)})};
function cs(a,b,c,d,e,f,g,h,k,l){var m,n,p;return H(function(u){if(u.i==1){m=Bc;if(b==m.Ua)return f||Ue(a.i,c),We(a.i,d,e),u.return();n=[];return u.h(ds(a,b,g,h,k,l||null),2)}p=u.j;p||(n.push(Tr(a,b,function(){return Vr(a,b)},null)),a.u&&n.push(Tr(a,m.$,function(){return Vr(a,m.$)},null)));f||(n.push(Tr(a,b,function(){return Wr(a,b,c)},null)),a.u&&n.push(Tr(a,m.$,function(){return Wr(a,m.$,c)},null)));if(d!=0||e!=Infinity)n.push(Tr(a,b,function(){return es(a,b,d,e)},null)),a.u&&n.push(Tr(a,m.$,function(){return es(a,
m.$,d,e)},null));return n.length?u.h(Promise.all(n),0):u.A(0)})}function fs(a,b,c){var d,e;return H(function(f){if(f.i==1){d=Bc;if(b==d.Ua||!a.M||(e=Lr(a,b))&&Math.abs(e-c)<.15)return f.return();Tr(a,b,function(){return Vr(a,b)},null);a.u&&Tr(a,d.$,function(){return Vr(a,d.$)},null);return f.h(Tr(a,b,function(){return Wr(a,b,c)},null),2)}return a.u?f.h(Tr(a,d.$,function(){return Wr(a,d.$,c)},null),0):f.A(0)})}
r.endOfStream=function(a){var b=this;return H(function(c){return c.h(gs(b,function(){Cr(b)||Dr(b)||(a?b.j.endOfStream(a):b.j.endOfStream())}),0)})};r.sc=function(a){var b=this;return H(function(c){return c.h(gs(b,function(){if(b.o.durationReductionEmitsUpdateEnd&&a<b.j.duration)for(var d=t(b.l.keys()),e=d.next();!e.done;e=d.next()){e=e.value;var f={start:function(){},p:Promise.withResolvers(),uri:null};b.B.get(e).unshift(f)}b.j.duration=a;b.Ba=a}),0)})};r.getDuration=function(){return this.j.duration};
function hs(a,b,c){H(function(d){if(!Pr(a)||a.j.duration!==Infinity)return d.return();a.Ya=!0;return d.h(gs(a,function(){Pr(a)&&a.j.duration===Infinity&&a.j.setLiveSeekableRange(b,c)}),0)})}function is(a){H(function(b){if(!Pr(a)||!a.Ya||a.j.duration!==Infinity)return b.return();a.Ya=!1;return b.h(gs(a,function(){Pr(a)&&a.j.duration===Infinity&&a.j.clearLiveSeekableRange()}),0)})}
function Xr(a,b,c,d,e,f){f=f===void 0?!1:f;yb(c).byteLength==0?Hr(a,b):(a.H&&Dc(a.H,c,d,e),d=f,d=d===void 0?!1:d,d=(new Map).set("data",c).set("contentType",b).set("isInitData",d),d=new tk("bufferappending",d),a.F.onEvent(d),a.l.get(b).appendBuffer(c))}function as(a,b,c,d){if(d<=c)Hr(a,b);else{if(a.H){var e=a.H;b==="video"&&e.h&&e.h.flushBuffer(c,d)}a.l.get(b).remove(c,d)}}
function Vr(a,b){var c=a.l.get(b),d=c.appendWindowStart,e=c.appendWindowEnd;c.abort();c.appendWindowStart=d;c.appendWindowEnd=e;Hr(a,b)}function Wr(a,b,c){a.V.set(b,c);var d;if(d=c<0)d=ob().Ea()==="EDGE";d&&(c+=.001);a.l.get(b).timestampOffset=c;Hr(a,b)}function es(a,b,c,d){var e=a.l.get(b);if(e.appendWindowEnd!==d||e.appendWindowStart!==c)e.appendWindowStart=0,e.appendWindowEnd=d,e.appendWindowStart=c;Hr(a,b)}
function Hr(a,b){if(a.K||a.G.h){var c=a.B.get(b);c&&c.length&&((c=c[0])&&c.p&&c.p.resolve(),a.B.set(b,[]))}else if(c=a.B.get(b)[0])c.p.resolve(),js(a,b)}function Tr(a,b,c,d){Uk(a.G);c={start:c,p:Promise.withResolvers(),uri:d};a.B.get(b).push(c);a.B.get(b).length==1&&ks(a,b);return c.p.promise}
function gs(a,b){var c,d,e,f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D;return H(function(B){switch(B.i){case 1:Uk(a.G);c=[];d=Array.from(a.l.keys());e=new Map;f=t(d);g=f.next();for(h={};!g.done;h={ready:void 0},g=f.next())k=g.value,h.ready=Promise.withResolvers(),l={start:function(A){return function(){return A.ready.resolve()}}(h),p:h.ready,uri:null},m=a.B.get(k),m.push(l),c.push(h.ready.promise),e.set(k,l),m.length==1&&l.start();B.o(2);return B.h(Promise.all(c),4);case 4:B.u(3);break;case 2:n=B.m();if(a.G.h){p=
t(d);for(u=p.next();!u.done;u=p.next())q=u.value,v=a.B.get(q),e.has(q)&&db(v,e.get(q));return B.return()}throw n;case 3:return B.o(5,6),B.h(b(),6);case 6:B.F();w=t(d);for(y=w.next();!y.done;y=w.next())x=y.value,js(a,x);B.G(0);break;case 5:throw z=B.m(),D=a.h.error?Db(a.h.error):"No error in the media element",new L(2,3,3015,z,D,null);}})}function js(a,b){a.B.get(b).shift();ks(a,b)}
function ks(a,b){var c=a.B.get(b)[0];if(c)try{c.start()}catch(d){d.name=="QuotaExceededError"?c.p.reject(new L(2,3,3017,b)):Ir(a)?c.p.reject(new L(2,3,3015,d,a.h.error?Db(a.h.error):"No error in the media element",c.uri)):c.p.reject(new L(2,3,3024,b)),js(a,b)}}function ls(a,b){a.ra=b;a.i&&(a.i.l=b)}
function Yr(a,b,c,d,e){if(ze(a.D.get(e))!="mp4")return c;var f=d===null,g=a.Ma.get(e),h=a.F.Je(),k=!1;d&&d.initSegmentReference&&(k=d.initSegmentReference.encrypted);d=d?d.S()[0]:null;var l=ob();a.o.correctEc3Enca&&f&&e==="audio"&&(c=Iq(c));var m;if(m=f)if(l.Ea()!="CHROMIUM")m=!1;else{m=null;var n=navigator.userAgent.match(/Chrome\/(\d+)/);n&&(m=parseInt(n[1],10));m=b.type==="video"&&m!=null&&m<94&&b.supplementalCodecs!=b.codecs&&/dvh1|dvhe/.test(b.supplementalCodecs)}m&&(c=Jq(c));a.o.insertFakeEncryptionInInit&&
g&&l.hd(h,e)&&(f?c=Kq(b,c,d,h):!k&&l.si(e)&&(c=Nq(c)));f&&l.Td()&&(c=Qq(c));!f&&b.isIframe&&a.o.repairIFrames&&(c=Rq(c));return c}function ms(a,b,c,d){var e;return H(function(f){return f.i==1?(e=!0,f.h(Tr(a,b,function(){if(b===zc)e=!0;else{a.D.get(b);a.m.has(b)&&(a.m.get(b).destroy(),a.m.delete(b));d&&a.m.set(b,d);var g=c+a.o.addExtraFeaturesToSourceBuffer(c),h=!0;try{a.l.get(b).changeType(g),a.D.set(b,c)}catch(k){h=!1}Hr(a,b);e=h}},null),2)):f.return(e)})}
function ns(a,b){var c,d,e,f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D,B,A,E,C;return H(function(F){if(F.i==1){if(a.K||a.na)return F.return();c=Bc;a.K=!0;a.Pa=!0;a.u=!1;d=a.h.currentTime;e=a.h.autoplay;a.h.paused||(a.Oa=!0);a.fb&&(a.h.autoplay=!1);F.K(2);a.C.Ta();f=t(a.m.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.destroy();k=t(a.N.values());for(l=k.next();!l.done;l=k.next())m=l.value,m.destroy();n=t(a.l.values());for(p=n.next();!p.done;p=n.next()){u=p.value;try{a.j.removeSourceBuffer(u)}catch(G){}}a.m.clear();
a.l.clear();a.V.clear();a.N.clear();q=a.j.duration;a.O=Promise.withResolvers();a.j=wr(a,a.O);return F.h(a.O.promise,4)}if(F.i!=2){!isNaN(q)&&q?a.j.duration=q:!isNaN(a.Ba)&&a.Ba&&(a.j.duration=a.Ba);v=Promise.withResolvers();w=a.j.sourceBuffers;y=b.size;x=0;z=function(){x++;x===y&&(v.resolve(),a.C.pb(w,"addsourcebuffer",z))};a.C.J(w,"addsourcebuffer",z);D=t(b.keys());for(B=D.next();!B.done;B=D.next())A=B.value,E=b.get(A),Er(a,A,E,E.codecs);(C=b.get(c.$))&&C.isAudioMuxedInVideo&&(a.u=!0);a.u&&!a.B.has(c.$)&&
a.B.set(c.$,[]);return F.h(v.promise,2)}F.F();a.K=!1;Uk(a.G);a.C.Ra(a.h,"loadedmetadata",function(){a.G.h||(a.h.currentTime=d,a.Pa=!1)});a.C.Ra(a.h,"canplaythrough",function(){a.G.h||(a.h.autoplay=e,a.Oa&&(a.Oa=!1,a.h.play()))});return F.G(0)})}function os(a,b){return gs(a,function(){return ns(a,b)})}
function ps(a,b,c,d){c=="video/mp4"&&(d=He(d,c));var e=!1,f=xc("audio",(d||"").split(",")),g=xc("video",(d||"").split(",")),h=g;b=="audio"&&(h=f);h||(h=d);var k=ve(c,h),l=De(a.D.get(b)),m=a.o.forceTransmux;!Km(k)||!a.M&&we.includes(k)?m=!0:m||c==l||(m=!ob().kd()&&we.includes(c));if(m&&(h=xe(c,h),l=oe(h))){var n=new or(l(),a.o.transmuxWorkerUrl,qe(h,l));f&&g&&(e=!0);k=n.convertCodecs(b,h)}!n&&b==="video"&&f&&(k=ve(c,d));a=Ae(Ee(k));return{uc:n,vl:e,wh:De(k),codec:a,mimeType:k}}
function ds(a,b,c,d,e,f){var g,h,k,l,m,n,p,u;return H(function(q){switch(q.i){case 1:g=Bc;if(b==zc)var v={type:qs,Ue:c,uc:null};else{var w=Ae(Ee(a.D.get(b))),y=De(a.D.get(b)),x=ps(a,b,c,d);v=x.uc;var z=x.vl,D=x.wh,B=x.codec;x=x.mimeType;var A=!0;if(z&&a.D.has("audio")){var E=ps(a,"audio",c,d);A=Ae(Ee(a.D.get("audio")));var C=De(a.D.get("audio"));A=A==E.codec&&C==E.wh;E.uc&&E.uc.destroy()}if(w===B&&y===D&&A)v={type:qs,Ue:x,uc:v};else{w=!0;if(a.u&&!e.has("audio")||z&&v&&!a.m.has(b))w=!1;z=ob();y=a.F.Je();
w&&a.o.codecSwitchingStrategy==="smooth"&&z.gb(y)?v={type:rs,Ue:x,uc:v}:(v&&v.destroy(),v={type:ss,Ue:x,uc:null})}}h=v;k=h.type;l=h.uc;m=h.Ue;if(n=e.get(g.$))a.u=n.isAudioMuxedInVideo;if(k==qs)return a.m.has(b)&&!l?(a.m.get(b).destroy(),a.m.delete(b)):!a.m.has(b)&&l?a.m.set(b,l):l&&(a.m.has(b)&&a.m.get(b).transmux!==l.transmux?(a.m.get(b).destroy(),a.m.set(b,l)):l.destroy()),q.return(!1);p=k==ss;if(k!=rs){l&&l.destroy();q.A(2);break}return q.h(ms(a,b,m,l),3);case 3:(u=q.j)||(p=!0);case 2:if(!p){q.A(4);
break}if(!f){q.A(5);break}return q.h(f(),5);case 5:return q.h(os(a,e),4);case 4:return q.return(!0)}})}function Pr(a){return!a.j||a.G.h||a.h.error||a.na||a.K||Dr(a)?!1:!0}var yr=window.URL.createObjectURL,Gr="sequence",Ur={gm:Gr,Xi:"segments"},qs="none",ss="reset",rs="changeType";function ts(a){var b=this;this.h=a;this.l=!1;this.i=this.h.hg();this.j=new $e(function(){b.h.isPaused()||b.h.Ck(b.i*.25)})}ts.prototype.release=function(){this.set(this.Wc());this.j&&(this.j.stop(),this.j=null);this.h=null};ts.prototype.set=function(a){this.i=a;us(this)};ts.prototype.Wc=function(){return this.h.Wc()};function us(a){a.j.stop();var b=a.l?0:a.i;if(b>=0&&b<=16)try{a.h.hg()!=b&&a.h.Ei(b);return}catch(c){}a.j.La(.25);a.h.hg()!=0&&a.h.Ei(0)};function vs(a,b,c,d){b==HTMLMediaElement.HAVE_NOTHING||a.readyState>=b?d():(b=ws.value().get(b),c.Ra(a,b,d))}var ws=new nb(function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])});function xs(a,b,c,d){var e=this;this.h=a;this.u=b;this.C=c;this.l=null;this.o=function(){e.l==null&&(e.l=d());return e.l};this.m=this.B=!1;this.i=new ib;this.j=new ys(a);vs(this.h,HTMLMediaElement.HAVE_METADATA,this.i,function(){zs(e,e.o())})}xs.prototype.release=function(){this.i&&(this.i.release(),this.i=null);this.j!=null&&(this.j.release(),this.j=null);this.u=function(){};this.h=null};function As(a){return a.B?a.h.currentTime:a.o()}
function Bs(a,b){a.h.readyState>0?Cs(a.j,b):(a.l=b,vs(a.h,HTMLMediaElement.HAVE_METADATA,a.i,function(){zs(a,a.o())}))}function zs(a,b){Math.abs(a.h.currentTime-b)<.001?Ds(a):(a.i.Ra(a.h,"seeking",function(){Ds(a)}),Cs(a.j,b))}function Ds(a){a.B=!0;a.i.J(a.h,"seeking",function(){(a.m||a.h.ended)&&a.h.paused&&a.h.pause();a.m=!1;a.u()});a.i.J(a.h,"ended",function(){a.m=!0});a.i.J(a.h,"play",function(){a.m=!1});a.C(a.h.currentTime)}
function ys(a){var b=this;this.h=a;this.o=10;this.l=this.m=this.j=0;this.i=new $e(function(){b.j<=0?b.i.stop():b.h.currentTime!=b.m||b.h.currentTime===b.l?b.i.stop():(b.h.currentTime=b.l,b.j--)})}ys.prototype.release=function(){this.i&&(this.i.stop(),this.i=null);this.h=null};function Cs(a,b){var c=a.h.ended,d=a.h.paused;a.m=a.h.currentTime;a.l=b;a.j=a.o;a.h.currentTime=b;c&&d&&a.h.pause();a.i.La(.1)};function Es(a){this.h=a;this.j=!1;this.i=null;this.l=new ib}r=Es.prototype;r.ready=function(){function a(){if(b.i==null||b.i==0&&b.h.duration!=Infinity)b.j=!0;else{var c=b.h.currentTime,d=null;if(typeof b.i==="number")d=b.i;else if(b.i instanceof Date){var e=Fs(b);e!==null&&(d=b.i.getTime()/1E3-e,d=Gs(b,d))}d==null?b.j=!0:(d<0&&(d=Math.max(0,c+d)),c!=d?(b.l.Ra(b.h,"seeking",function(){b.j=!0}),b.h.currentTime=d):b.j=!0)}}var b=this;vs(this.h,HTMLMediaElement.HAVE_FUTURE_DATA,this.l,function(){a()})};
r.release=function(){this.l&&(this.l.release(),this.l=null);this.h=null};r.pf=function(a){this.i=this.j?this.i:a};r.vd=function(){var a=this.j?this.h.currentTime:this.i;a instanceof Date&&(a=a.getTime()/1E3-(Fs(this)||0),a=Gs(this,a));return a||0};r.kh=function(){return 0};r.ih=function(){return 0};r.jh=function(){return!1};r.ji=function(){};r.Rh=function(){var a=Uq(this.h.buffered);return a!=null&&a>=this.h.duration-1};
function Fs(a){return a.h.getStartDate&&(a=a.h.getStartDate().getTime(),!isNaN(a))?a/1E3:null}function Gs(a,b){a=a.h.seekable;a.length>0&&(b=Math.max(a.start(0),b),b=Math.min(a.end(a.length-1),b));return b}
function Hs(a,b,c,d,e,f,g,h){var k=this;this.i=a;this.h=b.presentationTimeline;this.m=c;this.B=e;this.u=null;this.D=h||function(){return[]};this.C=g||function(){return a.playbackRate};this.j=new $q(a,b.presentationTimeline,c,f,g,h);this.l=new xs(a,function(){a:{var l=k.j;l.u=!0;l.C=!1;l.j&&l.j.La(l.i.gapJumpTimerTime);br(l);var m=As(k.l);l=Is(k,m);if(!Mm()&&Math.abs(l-m)>.001){m=!1;var n=ob().wi();if(n){var p=Date.now()/1E3;if(!k.u||k.u<p-n)k.u=p,m=!0}else m=!0;if(m){Bs(k.l,l);l=void 0;break a}}k.B();
l=void 0}return l},function(l){var m=k.j;m.h.seeking&&!m.u&&(m.u=!0,m.o=l);m.j&&m.j.La(m.i.gapJumpTimerTime);br(m)},function(){return Js(k,d)});this.o=new $e(function(){if(k.i.readyState!=0&&!k.i.paused){var l=As(k.l),m=k.h.zb(),n=k.h.ob();n-m<3&&(m=n-3);l<m&&(l=Is(k,l),k.i.currentTime=l)}})}r=Hs.prototype;r.ready=function(){this.o.La(.25)};
r.release=function(){this.l&&(this.l.release(),this.l=null);this.j&&(this.j.release(),this.j=null);this.o&&(this.o.stop(),this.o=null);this.i=this.l=this.h=this.m=null;this.B=function(){}};r.pf=function(a){Bs(this.l,Js(this,a))};r.vd=function(){var a=As(this.l);return this.i.readyState>0&&!this.i.paused?Ks(this,a):a};r.kh=function(){return this.j.H};r.ih=function(){return this.j.G};r.jh=function(){return this.j.D};
function Js(a,b){b==null?b=a.h.oa()?a.h.ob():a.h.zb():b instanceof Date?b=b.getTime()/1E3-(a.h.l||a.h.j):b<0&&(b=a.h.ob()+b);return Ls(a,Ks(a,b))}r.ji=function(){this.j.dd()};r.Rh=function(){if(this.h.oa()){var a=this.h.Fd(),b=Uq(this.i.buffered);if(b!=null&&b>=a)return!0}return!1};function Ls(a,b){var c=a.h.getDuration();return b>=c?c-a.m.durationBackoff:b}
function Is(a,b){var c=a.m.rebufferingGoal,d=a.m.safeSeekOffset,e=a.h.zb(),f=a.h.ob(),g=a.h.getDuration();f-e<3&&(e=f-3);var h=a.h.Ed(c),k=a.h.Ed(d);c=a.h.Ed(c+d);if(b>=g)return Ls(a,b);if(b>f)return f-a.m.safeSeekEndOffset;if(b<e)return a.h.isLive()&&a.m.returnToEndOfLiveWindowWhenOutside?f-a.m.safeSeekEndOffset:Vq(a.i.buffered,k)?k:c;if(a.C()>0)for(e=t(a.D()),f=e.next();!f.done;f=e.next())if(f=f.value,b>=f.start&&b<f.end)return f.end;return b>=h||Vq(a.i.buffered,b)?b:c}
function Ks(a,b){var c=a.h.zb();if(b<c)return c;a=a.h.ob();return b>a?a:b};function Ms(){this.i=this.h=null}Ms.prototype.configure=function(a){this.h=a};Ms.prototype.getConfiguration=function(){return this.h};
Ms.prototype.create=function(a){a=Ns(a,this.h.preferredAudio,this.h.audioCodec,this.h.activeAudioCodec);a:for(var b=t(this.h.preferredVideo),c=b.next();!c.done;c=b.next()){c=c.value;var d=a;if(c.role&&(d=Os(d,c.role),!d.length))continue;if(c.language&&(d=Ps(d,c.language),!d.length))continue;if(c.label&&(d=Qs(d,c.label),!d.length))continue;if(c.hdrLevel&&(d=Rs(d,c.hdrLevel),!d.length))continue;if(c.layout&&(d=Ss(d,c.layout),!d.length))continue;if(c.codec)if(c=Ts(d,c.codec),c.length)d=c;else continue;
if(d.length){a=d;break a}}b=ob();c=this.h.keySystem;b=!(this.h.codecSwitchingStrategy=="smooth"&&b.gb(c));c=Us(a,b);return this.i=new wp(c,a,b)};Ms.prototype.getLastAdaptationSet=function(){return this.i};
function Us(a,b){function c(m){return a.filter(function(n){return xp(m,n,!0)}).length}function d(m){var n=m.video.codecs.split(",").map(function(p){return Ce(p)}).sort();return m.video.mimeType+";"+n.join(",")}var e=a[0];if(!b||!e.video)return e;b=e;for(var f=c(e),g=new Set([d(e)]),h=t(a),k=h.next();!k.done;k=h.next())if(k=k.value,k.video&&!g.has(d(k))&&xp(e,k,!1)&&(!e.audio||!k.audio||yp(e.audio,k.audio,!0))){g.add(d(k));var l=c(k);l>f&&(b=k,f=l)}return b}
function Ns(a,b,c,d){b=t(b);for(var e=b.next(),f={};!e.done;f={Tc:void 0},e=b.next()){e=e.value;var g=a;if(e.language&&(g=Vs(g,e.language),!g.length))continue;if(e.role&&(g=Ws(g,e.role),!g.length))continue;if(e.label&&(g=Xs(g,e.label),!g.length))continue;if(e.channelCount&&(g=Ys(g,e.channelCount),!g.length))continue;f.Tc=[];e.codec&&f.Tc.push(e.codec);c&&f.Tc.push(c);d&&f.Tc.push(d);var h=f.Tc.filter(function(m){return function(n,p){return m.Tc.indexOf(n)===p}}(f));if(h.length){f=!1;h=t(h);for(var k=
h.next();!k.done;k=h.next())if(k=k.value,k=Zs(g,k,k!=e.codec),k.length){g=k;f=!0;break}if(!f&&e.codec)continue}if(e.spatialAudio!==void 0)if(e=$s(g,e.spatialAudio),e.length)g=e;else continue;if(g.length)return g}var l=[];c&&l.push(c);d&&l.push(d);c=l.filter(function(m,n){return l.indexOf(m)===n});if(c.length)for(c=t(c),d=c.next();!d.done;d=c.next())if(d=Zs(a,d.value,!0),d.length){a=d;break}c=a.filter(function(m){return m.primary});return c.length?c:a}
function Vs(a,b){b=mc(b);var c=tc(b,a.map(function(d){return sc(d)}));return c?a.filter(function(d){return c==sc(d)}):[]}function Ws(a,b){return a.filter(function(c){return c.audio?b?c.audio.roles.includes(b):c.audio.roles.length==0:!1})}function Os(a,b){return a.filter(function(c){return c.video?b?c.video.roles.includes(b):c.video.roles.length==0:!1})}function Ps(a,b){var c=mc(b);return a.filter(function(d){return d.video&&d.video.language?mc(d.video.language)==c:!1})}
function Xs(a,b){return a.filter(function(c){return c.audio&&c.audio.label?c.audio.label.toLowerCase()==b.toLowerCase():!1})}function Qs(a,b){return a.filter(function(c){return c.video&&c.video.label?c.video.label.toLowerCase()==b.toLowerCase():!1})}function Ys(a,b){return a.filter(function(c){return c.audio&&c.audio.channelsCount&&c.audio.channelsCount>b?!1:!0}).sort(function(c,d){return c.audio||d.audio?c.audio?d.audio?(d.audio.channelsCount||0)-(c.audio.channelsCount||0):1:-1:0})}
function Rs(a,b){if(b=="AUTO"){var c=a.some(function(d){return d.video&&d.video.hdr&&d.video.hdr=="HLG"?!0:!1});b=ob().fc(c)}return a.filter(function(d){return d.video&&d.video.hdr&&d.video.hdr!=b?!1:!0})}function Ss(a,b){return a.filter(function(c){return c.video&&c.video.videoLayout&&c.video.videoLayout!=b?!1:!0})}function $s(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!=b?!1:!0})}
function Zs(a,b,c){var d=c?Ae(b):b;return a.filter(function(e){return e.audio?(c?Ae(e.audio.codecs):e.audio.codecs)==d:!0})}function Ts(a,b){return a.filter(function(c){return c.video&&c.video.codecs!=b?!1:!0})};function at(a){uk.call(this);this.h=new Map;this.j=a;this.i=null}ta(at,uk);at.prototype.release=function(){this.h.clear();this.i&&(this.i.stop(),this.i=null);uk.prototype.release.call(this)};function bt(a,b){var c=b.schemeIdUri+"_"+b.id+"_"+(b.startTime.toFixed(1)+"_"+b.endTime.toFixed(1));a.h.has(c)||(a.h.set(c,b),b=new tk("regionadd",new Map([["region",b]])),a.dispatchEvent(b),ct(a))}
function ct(a){a.i||(a.i=(new $e(function(){for(var b=a.j(),c=t(a.h),d=c.next();!d.done;d=c.next()){var e=t(d.value);d=e.next().value;e=e.next().value;e.endTime<b.start&&(a.h.delete(d),d=new tk("regionremove",new Map([["region",e]])),a.dispatchEvent(d))}!a.h.size&&a.i&&(a.i.stop(),a.i=null)})).La(2))};function dt(a,b,c,d,e,f,g){function h(k,l){return l.fastSwitching&&k.Fc&&k.Ld?!1:!0}this.o=a;this.j=b;this.m=c;this.h=new Map;this.l=new Map;this.i=null;this.u=d;this.D=e||h;this.B=f||function(){return 1};this.C=g||function(){return!0}}function et(a,b){a.m=b;a=t(a.h.values());for(var c=a.next();!c.done;c=a.next())c.value.h=b}
function ft(a,b,c){c=c===void 0?!1:c;if(!a.j.segmentIndex)return Promise.resolve();a.i||(a.i=a.j.segmentIndex.mb(b,!0,a.u));if(!a.i)return Promise.resolve();c&&a.i.next();b=[];c=Math.abs(a.B());for(c=Math.ceil(a.o*c);a.h.size<c;){var d=a.i.next().value;if(!d)break;var e=!0;d.isPreload()&&d.endByte!=null&&(e=!1);d.Ib()==2&&(e=!1);d.xc(!1)&&(e=!1);a.C(d)||(e=!1);e&&d.initSegmentReference&&b.push(gt(a,d.initSegmentReference));e&&!a.h.has(d)&&(e=new ht(a.m),b.push(it(a,a.h,d,e)),a.h.set(d,e));if(!a.D(d,
a.j))break}jt(a);return Promise.all(b)}function gt(a,b){if(!a.j.segmentIndex||b.xc()||Array.from(a.l.keys()).some(function(e){return qm(e,b)}))return Promise.resolve();var c=new ht(a.m),d=it(a,a.l,b,c);a.l.set(b,c);return d}function it(a,b,c,d){return kt(d,c,a.j).catch(function(e){b.get(c)==d&&b.delete(c);throw e;})}function lt(a,b){b=t(b.keys());for(var c=b.next();!c.done;c=b.next())(c=c.value)&&mt(a,c)}function nt(a,b){b=b===void 0?!0:b;lt(a,a.h);b&&lt(a,a.l);a.i=null}
dt.prototype.yb=function(a,b){b=b===void 0?!1:b;for(var c=t(this.h.keys()),d=c.next();!d.done;d=c.next())d=d.value,a>d.endTime&&mt(this,d);b&&jt(this)};dt.prototype.jd=function(a){this.u=a;this.i&&this.i.jd(a)};function jt(a){if(a.h.size)for(var b=Array.from(a.h.keys()),c=t(a.l.keys()),d=c.next(),e={};!d.done;e={kg:void 0},d=c.next())e.kg=d.value,b.some(function(f){return function(g){return qm(g.initSegmentReference,f.kg)}}(e))||mt(a,e.kg)}
function ot(a,b){a.o=b;for(var c=Array.from(a.h.keys());c.length>b;){var d=c.pop();d&&mt(a,d)}jt(a)}function pt(a,b){b&&b!==a.j&&(nt(a),a.j=b)}function mt(a,b){var c=a.h;b instanceof pm&&(c=a.l);a=c.get(b);c.delete(b);a&&a.abort()}function ht(a){this.h=a;this.Qd=this.Wg=null}
function kt(a,b,c){var d=[];a.Qd=a.h(b,c,function(e){var f;return H(function(g){if(!a.Wg)return d.push(e),g.return();f=e;d.length>0&&(d.push(e),f=Ub(d),d=[]);return g.h(a.Wg(f),0)})});return a.Qd.promise.catch(function(e){return e instanceof L&&e.code==7001?Promise.resolve():Promise.reject(e)})}ht.prototype.abort=function(){this.Qd&&this.Qd.abort()};function qt(a){this.h=[];this.i=a;this.j=new WeakSet;this.l=new WeakSet}qt.prototype.add=function(a,b){if(b<=a)return!1;a={start:a,end:b};b=[];for(var c=t(this.h),d=c.next();!d.done;d=c.next())d=d.value,a.start<=d.end+.001&&d.start<=a.end+.001?a={start:Math.min(a.start,d.start),end:Math.max(a.end,d.end)}:b.push(d);b.push(a);b.sort(function(e,f){return e.start-f.start});this.h=b;this.i.ri();return!0};
qt.prototype.remove=function(a,b){if(!(b<=a)){for(var c=[],d=!1,e=t(this.h),f=e.next();!f.done;f=e.next()){f=f.value;var g=ur(a,f.start,.001)?f.start:a,h=ur(b,f.end,.001)?f.end:b;h<=f.start||g>=f.end?c.push(f):(d=!0,g-f.start>.001&&c.push({start:f.start,end:g}),f.end-h>.001&&c.push({start:h,end:f.end}))}d&&(c.sort(function(k,l){return k.start-l.start}),this.h=c,this.i.ri())}};
function rt(a,b){a=t(a.h);for(var c=a.next();!c.done;c=a.next())if(c=c.value,b>c.start-.001&&b<c.end&&!ur(b,c.end,.001))return c;return null}function st(a,b,c){b=tt(a,b);return!b||c>b.end+.001||!a.j.has(b)?null:b}function tt(a,b){return a.h.length==0||a.i.Ha()<0?null:rt(a,b)}function ut(a,b){var c=tt(a,b);return(a=!c||a.i.qk(c.start,c.end)?null:c)?a.end:b}
function vt(a,b,c,d){c=wt(b.start,c,function(e){return[e.startTime]});d=wt(b.end,d,function(e){return[e.startTime,e.endTime]});c==null||d==null?a.l.add(b):xt(a,b,c,d)}function wt(a,b,c){var d=null,e=Infinity;b=t(Array.isArray(b)?b:[b]);for(var f=b.next();!f.done;f=b.next())if(f=f.value){f=t(c(f));for(var g=f.next();!g.done;g=f.next()){g=g.value;var h=Math.abs(g-a);h<=.001&&h<e&&(d=g,e=h)}}return d}
function xt(a,b,c,d){var e=b.start!==c||b.end!==d;b.start=c;b.end=d;a.j.add(b);e&&a.h.sort(function(f,g){return f.start-g.start})};function yt(a,b,c){var d=this;this.h=b;this.C=c;this.j=a;this.l=null;this.Y=new Map;this.D=1;this.F=this.u=null;this.ka=0;this.i=new Map;this.K=!1;this.ra=null;this.G=!1;this.m=new Tk(function(){return zt(d)});this.Z=Date.now()/1E3;this.na=!1;this.o=new Map;this.ba={projection:null,hfov:null};this.ua=0;this.sa=Infinity;this.I=null;this.V=[];this.T=new ib;this.B=new $e(function(){if(d.j&&d.h){var e=d.j.presentationTimeline,f=d.h.U;f=d.j.type=="HLS"&&e.getDuration()<Infinity&&f.getDuration()==Infinity;
e.oa()||f?(e=d.j.presentationTimeline.zb(),f=d.j.presentationTimeline.ob(),f-e>1?hs(d.h.U,e,f):is(d.h.U)):(is(d.h.U),d.B&&d.B.stop())}else d.B&&d.B.stop()});this.N=this.H=null;this.M=!1;this.O=new $e(function(){var e=d.h.video;!e.ended&&d.H&&(d.N=d.H,d.M=!0,e.currentTime=d.H,d.H=null)});this.L=new ib}r=yt.prototype;r.destroy=function(){return this.m.destroy()};
function zt(a){var b,c,d,e,f,g,h,k,l,m,n;return H(function(p){if(p.i==1){(b=a.B)==null||b.stop();a.B=null;(c=a.T)==null||c.release();a.T=null;(d=a.O)==null||d.stop();a.O=null;(e=a.L)==null||e.release();a.L=null;f=[];g=t(a.i.values());for(h=g.next();!h.done;h=g.next())k=h.value,At(k),f.push(Bt(k)),k.aa&&(nt(k.aa),k.aa=null);l=t(a.o.values());for(m=l.next();!m.done;m=l.next())n=m.value,nt(n);return p.h(Promise.all(f),2)}a.i.clear();a.o.clear();a.h=null;a.j=null;a.l=null;a.H=null;p.l()})}
r.configure=function(a){this.l=a;this.ra=new lk({maxAttempts:Math.max(a.retryParameters.maxAttempts,2),baseDelay:a.retryParameters.baseDelay,backoffFactor:a.retryParameters.backoffFactor,fuzzFactor:a.retryParameters.fuzzFactor,timeout:0,stallTimeout:0,connectionTimeout:0},!0);if(a.disableAudioPrefetch){var b=this.i.get("audio");b&&b.aa&&(nt(b.aa),b.aa=null);b=t(this.o.keys());for(var c=b.next();!c.done;c=b.next())c=c.value,nt(this.o.get(c)),this.o.delete(c)}a.disableTextPrefetch&&(b=this.i.get(zc))&&
b.aa&&(nt(b.aa),b.aa=null);a.disableVideoPrefetch&&(b=this.i.get("video"))&&b.aa&&(nt(b.aa),b.aa=null);b=t(this.i.keys());for(c=b.next();!c.done;c=b.next())c=this.i.get(c.value),c.aa?(ot(c.aa,a.segmentPrefetchLimit),a.segmentPrefetchLimit>0||(nt(c.aa),c.aa=null)):a.segmentPrefetchLimit>0&&(c.aa=Ct(this,c.stream));a.disableAudioPrefetch||Dt(this)};function Et(a,b,c){a.j.presentationTimeline.oa()||(a.ua=b,a.sa=c)}
function Ft(a,b){a=a.mb(Math.max(0,b-.001));if(!a)return[];b=[];for(var c=0;c<2;c++){var d=a.next().value;if(!d)break;b.push(d)}return b}
function Gt(a,b,c){if(!c||a.C.h.length==0)return c;if(a.h.Ha()>=0){var d=rt(a.C,c.startTime),e;if(e=d)e=a.C,e=!(e.j.has(d)||e.l.has(d));if(e){var f,g;(e=(g=(f=a.i.get("video")||a.i.get("audio"))==null?void 0:f.stream.segmentIndex)!=null?g:null)&&vt(a.C,d,Ft(e,d.start),Ft(e,d.end))}}a=st(a.C,c.startTime,c.endTime);if(!a)return c;d=b.stream.segmentIndex.mb(a.end);if(!d){for(;b.ia&&b.ia.next().value;);return null}b.ia=d;for(c=d.next().value;c&&c.startTime<a.end&&!ur(c.startTime,a.end,.001);)c=d.next().value;
return c}r.start=function(a){var b=this;return H(function(c){if(c.i==1)return c.h(Ht(b,a||new Map),2);Uk(b.m);b.K=!0;c.l()})};function It(a,b){var c,d,e,f,g,h,k;H(function(l){switch(l.i){case 1:return c=Bc,a.ka++,d=a.ka,l.o(2),l.h(bs(a.h.U,c.Ua),4);case 4:l.u(3);break;case 2:if(e=l.m(),a.h)a.h.onError(e);case 3:f=ve(b.mimeType,b.codecs),Fr(a.h.U,f,b.external),g=a.h.U.ra,(h=g.isTextVisible())&&a.ka==d&&(k=Jt(a,b),a.i.set(c.Ua,k),Kt(a,k,0)),l.l()}})}
function Lt(a){var b=a.i.get(zc);b&&(At(b),Bt(b).catch(function(){}),a.I=a.i.get(zc),a.i.delete(zc),b.stream&&b.stream.closeSegmentIndex&&b.stream.closeSegmentIndex());a.F=null}
function Mt(a,b){for(var c=a.h.Ha()<0,d=t(a.i.values()),e=d.next();!e.done;e=d.next())e=e.value,e.ia&&e.ia.jd(c),e.aa&&e.aa.jd(c),c&&(e.ia=null,e.endOfStream=!1,e.ya||e.Xa||e.xb||e.ub||Kt(a,e,0));d=t(a.o.values());for(e=d.next();!e.done;e=d.next())e.value.jd(c);if(c=a.i.get("video"))if(d=c.stream)if(b)(b=d.trickModeVideo)&&!c.mc&&(Nt(a,b,!1,0,!1),c.mc=d);else if(b=c.mc)c.mc=null,Nt(a,b,!0,0,!1)}
function Ot(a,b,c,d,e,f){c=c===void 0?!1:c;d=d===void 0?0:d;e=e===void 0?!1:e;f=f===void 0?!1:f;a.u=b;a.K&&(b.video&&Nt(a,b.video,c,d,e,f),b.audio&&Nt(a,b.audio,c,d,e,f))}function Pt(a,b){H(function(c){if(c.i==1)return a.I=null,a.F=b,a.K?b.segmentIndex?c.A(2):c.h(b.createSegmentIndex(),2):c.return();Nt(a,b,!0,0,!1);c.l()})}function Qt(a){var b=a.i.get(zc);b&&Nt(a,b.stream,!0,0,!0)}
function Rt(a,b){for(var c=t(a.Y.entries()),d=c.next();!d.done;d=c.next()){var e=t(d.value);d=e.next().value;e=e.next().value;d.includes(b.type)&&(e(),a.Y.delete(d))}}
function Nt(a,b,c,d,e,f){var g=a.i.get(b.type);g||b.type!=zc?g&&(g.mc&&(b.trickModeVideo?(g.mc=b,b=b.trickModeVideo):g.mc=null),g.stream!=b||e)&&(a.o.has(b)?g.aa=a.o.get(b):g.aa&&pt(g.aa,b),b.type==zc&&g.stream!=b&&(e=ve(b.mimeType,b.codecs),Fr(a.h.U,e,b.external)),a.o.has(g.stream)||g.stream.closeSegmentIndex&&(g.ya?a.Y.getOrInsert("("+g.type+":"+g.stream.id+")",g.stream.closeSegmentIndex):g.stream.closeSegmentIndex()),e=g.stream.isAudioMuxedInVideo!=b.isAudioMuxedInVideo,g.stream=b,g.ia=null,g.wf=
!!f,b.dependencyStream?g.bc=Jt(a,b.dependencyStream):g.bc=null,St(a),e&&(g.bb=null,g.Ub=null,g.Tb=null,b.isAudioMuxedInVideo&&(b=null,g.type==="video"?b=a.i.get("audio"):g.type==="audio"&&(b=a.i.get("video")),b&&(Bt(b).catch(function(){}),b.bb=null,b.Ub=null,b.Tb=null,Tt(a,b),Ut(a,b).catch(function(h){if(a.h)a.h.onError(h)})))),c?g.xb?g.nd=!0:g.ya?(g.ub=!0,g.Sc=d,g.nd=!0):(At(g),Vt(a,g,!0,d).catch(function(h){if(a.h)a.h.onError(h)})):g.ya||g.Xa||Kt(a,g,0),Ut(a,g).catch(function(h){if(a.h)a.h.onError(h)})):
It(a,b)}
function Ut(a,b){var c,d,e;return H(function(f){if(f.i==1){if(!b.operation)return f.return();c=b.stream;d=b.operation;return c.segmentIndex?f.A(2):f.h(c.createSegmentIndex(),2)}if(f.i!=4)return e=c.dependencyStream,!e||e.segmentIndex?f.A(4):f.h(e.createSegmentIndex(),4);if(b.operation!=d||b.stream!=c||!b.stream.segmentIndex)return f.return();var g=a.h.Hb();var h=Lr(a.h.U,b.type),k=Wt(a,b,g);k=b.stream.segmentIndex.find(k);var l=k==null?null:b.stream.segmentIndex.get(k);k=l?tm(l):null;l&&!k&&(k=(l.endTime-
l.getStartTime())*(b.stream.bandwidth||a.u.bandwidth)/8);k?((l=l.initSegmentReference)&&(k+=(l.endByte?l.endByte+1-l.startByte:null)||0),l=a.h.getBandwidthEstimate(),g=k*8/l<(h||0)-g-a.l.rebufferingGoal||b.operation.i.h>k?!0:!1):g=!0;g&&b.operation.abort();f.l()})}
r.Ic=function(){if(this.h){var a=this.h.Hb(),b=this.N!=null&&ur(a,this.N,.1);this.N=null;b||(this.M=!1);for(var c=t(this.i.keys()),d=c.next();!d.done;d=c.next()){var e=d.value;d=this.i.get(e);if(!b&&!Mr(this.h.U,e,a)){this.Z=0;d.aa&&(d.aa.i=null);if(d.type==="audio")for(var f=t(this.o.values()),g=f.next();!g.done;g=f.next())g.value.i=null;d.ia=null;(Lr(this.h.U,e)!=null||d.ya)&&Tt(this,d);d.operation&&(d.operation.abort(),d.operation=null);e===zc&&(e=this.h.U,e.I&&e.I.h.clear());d.Ic=!0}!b||d.xb||
d.ya||d.Xa||Kt(this,d,0)}Xt(this)&&Yt(this)}};function Tt(a,b){b.xb||b.ub||(b.ya?(b.ub=!0,b.Sc=0):Jr(a.h.U,b.type)==null?b.Xa==null&&Kt(a,b,0):(At(b),Vt(a,b,!1,0).catch(function(c){if(a.h)a.h.onError(c)})))}
function Ht(a,b){var c,d,e,f,g,h,k,l;return H(function(m){if(m.i==1){if(!a.u)throw new L(2,5,5006);c=Zt(a,!0);d=a.h.U;return m.h(d.init(c,a.j.sequenceMode,a.j.type,a.j.ignoreManifestTimestampsInSegmentsMode),2)}Uk(a.m);a.updateDuration().catch(function(){});e=t(c.keys());for(f=e.next();!f.done;f=e.next())if(g=f.value,h=c.get(g),!a.i.has(g)){k=Jt(a,h);if(l=b.get(h.id))et(l,function(n,p,u){return $t(n,p,u||null,a.l.retryParameters,a.h.Ec)}),k.aa=l;a.i.set(g,k);Kt(a,k,0)}St(a);m.l()})}
function Jt(a,b){var c={stream:b,type:b.type,ia:null,aa:Ct(a,b),Fa:null,bb:null,Qe:null,Ub:null,Tb:null,qg:null,rg:null,mc:null,endOfStream:!1,ya:!1,Xa:null,ub:!1,Sc:0,nd:!1,xb:!1,Ic:!0,wf:!1,Hg:!1,Yc:!1,operation:null,bc:null};b.dependencyStream&&(c.bc=Jt(a,b.dependencyStream));return c}
function Ct(a,b){if(a.j.type=="MSF"||b.type==="video"&&a.l.disableVideoPrefetch||b.type==="audio"&&a.l.disableAudioPrefetch||b.type===zc&&(b.mimeType==Je||b.mimeType==Ke)||b.type===zc&&a.l.disableTextPrefetch)return null;if(a.o.has(b))return a.o.get(b);var c=a.i.get(b.type);return(c=c&&c.aa)&&b===c.j?c:a.l.segmentPrefetchLimit>0?new dt(a.l.segmentPrefetchLimit,b,function(d,e,f){return $t(d,e,f||null,a.l.retryParameters,a.h.Ec)},a.h.Ha()<0,a.h.ol,a.h.Ha,function(d){var e=a.C,f=d.endTime;d=tt(e,d.startTime);
return!(!d||f>d.end+.001?0:!e.l.has(d))}):null}
function Dt(a){for(var b=a.l.segmentPrefetchLimit,c=a.l.prefetchAudioLanguages,d=t(a.j.variants),e=d.next(),f={};!e.done;f={sb:void 0},e=d.next())if(f.sb=e.value,f.sb.audio)if(a.o.has(f.sb.audio)){if(e=a.o.get(f.sb.audio),ot(e,b),!(b>0&&c.some(function(h){return function(k){return lc(h.sb.audio.language,k)}}(f)))){var g=a.i.get(f.sb.audio.type);e!==(g&&g.aa)&&nt(e);a.o.delete(f.sb.audio)}}else b<=0||!c.some(function(h){return function(k){return lc(h.sb.audio.language,k)}}(f))||!(e=Ct(a,f.sb.audio))||
(f.sb.audio.segmentIndex||f.sb.audio.createSegmentIndex(),a.o.set(f.sb.audio,e))}r.updateDuration=function(){var a=this,b,c;return H(function(d){if(d.i==1)return b=Mm(),c=a.j.presentationTimeline.getDuration(),a.T.Ta(),c<Infinity?(b&&(a.B&&a.B.stop(),is(a.h.U)),d.h(a.h.U.sc(c),0)):b?d.h(a.h.U.sc(Infinity),5):(a.h.U.sc(4294967296),d.A(0));a.B&&(a.B.hb(),a.T.Ra(a.h.video,"timeupdate",function(){a.B.hb().La(.5)}));return d.A(0)})};
function au(a,b){var c,d,e,f,g,h,k,l,m,n,p,u;return H(function(q){switch(q.i){case 1:Uk(a.m);c=Bc;if(b.ya||b.Xa==null||b.xb)return q.return();b.Xa=null;if(!b.ub){q.A(2);break}return q.h(Vt(a,b,b.nd,b.Sc),3);case 3:return q.return();case 2:Rt(a,b);if(b.stream.segmentIndex){q.A(4);break}d=b.stream;e=b.stream.codecs;f=b.stream.mimeType;q.o(5);return q.h(b.stream.createSegmentIndex(),7);case 7:q.u(6);break;case 5:return g=q.m(),q.h(bu(a,b,g),8);case 8:return q.return();case 6:if(b.type!==c.Ua||e==b.stream.codecs&&
f==b.stream.mimeType||(h=ve(b.stream.mimeType,b.stream.codecs),Fr(a.h.U,h,b.stream.external)),d!=b.stream)return d.closeSegmentIndex&&d.closeSegmentIndex(),b.ya||b.Xa||Kt(a,b,0),q.return();case 4:if(!b.bc){q.A(9);break}if(b.bc.stream.segmentIndex){q.A(9);break}q.o(11);return q.h(b.bc.stream.createSegmentIndex(),13);case 13:q.u(9);break;case 11:q.m();case 9:q.o(14);k=cu(a,b);k!=null&&(Kt(a,b,k),b.Yc=!1);q.u(15);break;case 14:return l=q.m(),q.h(bu(a,b,l),16);case 16:return q.return();case 15:if(b.type===
c.Ua)return q.return();m=[];b.stream&&!b.stream.isAudioMuxedInVideo&&m.push(b);n=b.type===c.$?c.qa:c.$;(p=a.i.get(n))&&p.stream&&!p.stream.isAudioMuxedInVideo&&m.push(p);if(!a.K||!m.every(function(v){return v.endOfStream})){q.A(0);break}return q.h(a.h.U.endOfStream(),18);case 18:Uk(a.m),u=a.h.U.getDuration(),u!=0&&u<a.j.presentationTimeline.getDuration()&&a.j.presentationTimeline.sc(u),q.l()}})}
function cu(a,b){if(du(b))return Zr(a.h.U,b.stream.originalId||""),null;b.type==zc&&$r(a.h.U);if(b.stream.isAudioMuxedInVideo&&b.type=="audio")return null;if(b.type!=zc&&Dr(a.h.U))return eu(a,!0),null;var c=a.l.updateIntervalSeconds/Math.max(1,Math.abs(a.h.Ha()));if(!Ir(a.h.U)&&b.type!=zc)return c/2;var d=a.h.Hb(),e=a.h.Ha()<0;if(b.type==="audio")for(var f=t(a.o.keys()),g=f.next();!g.done;g=f.next())g=a.o.get(g.value),g.yb(d,!0),ft(g,d);f=Wt(a,b,d);var h=e?Or(a.h.U,b.type,d):Nr(a.h.U,b.type,d);b.type==
"video"&&!a.i.has("audio")&&a.h.U.l.has("audio")&&(g=e?Or(a.h.U,"audio",d):Nr(a.h.U,"audio",d),h=Math.min(h,g));g=Math.max(1,Math.max(a.l.rebufferingGoal,a.l.bufferingGoal)*a.D);var k=a.j.presentationTimeline.oa()?Infinity:a.j.presentationTimeline.getDuration()-f,l=Lr(a.h.U,b.type);if(!e&&k<1E-6&&l)return b.endOfStream=!0,b.type=="video"&&((c=a.i.get(zc))&&du(c)&&(c.endOfStream=!0),(c=a.i.get("audio"))&&c.stream.isAudioMuxedInVideo&&(c.endOfStream=!0)),null;b.endOfStream=!1;if(e){var m=a.j.presentationTimeline.zb();
if(l!=null&&f<=m+1E-6)return null}if(h>0&&a.l.stopFetchingOnPause&&a.h.video.paused||h>=g)return c/2;m=!b.ia;h=fu(a,b,d,l);if(!h){if(!a.j.presentationTimeline.oa()&&k<1E-6)return b.endOfStream=!0,b.type=="video"&&(c=a.i.get(zc))&&du(c)&&(c.endOfStream=!0),null;a=Infinity;(b=b.Fa)&&(a=b.endTime-b.startTime);return Math.min(a/2,c)}k=b.bb;l=h.initSegmentReference;k&&l&&qm(l,k)&&(k.h=l.h);k=!1;m&&b.wf&&(k=!0,b.wf=!1);m=Infinity;l=-Infinity;for(var n=t(a.i.values()),p=n.next();!p.done;p=n.next())p=p.value,
du(p)||p.stream.isAudioMuxedInVideo||p.ia&&!p.ia.current()||(p=Wt(a,p,d),m=Math.min(m,p),l=Math.max(l,p));if((e?l-f:f-m)>=Math.max(a.j.presentationTimeline.i,.5))return c;b.aa&&b.ia&&!a.o.has(b.stream)&&(b.aa.yb(h.startTime+.001),ft(b.aa,h.startTime).catch(function(){}));if(Xt(a)&&gu(a,b,h))return null;hu(a,b,d,h,k).catch(function(){});b.bc&&iu(a,b.bc,d,g);return null}function Wt(a,b,c){return b.Fa?a.h.Ha()<0?b.Fa.startTime:ut(a.C,b.Fa.endTime):ut(a.C,c)}
function fu(a,b,c,d){if(b.ia){var e=b.ia.current();e&&b.Fa&&(c=b.Fa.endTime,ur(b.Fa.startTime,e.startTime,.002)&&ur(c,e.endTime,.002)&&(e=b.ia.next().value));return Gt(a,b,e)}if(b.Fa||d){if(e=a.h.Ha()<0){var f=Jr(a.h.U,b.type);c=b.Fa?b.Fa.startTime:null;c!=null&&(f==null||c<f)&&(f=c);c=f!=null?f-.001:d}else c=b.Fa?b.Fa.endTime:d;b.stream.segmentIndex&&(b.ia=b.stream.segmentIndex.mb(c,!1,e));e=b.ia&&b.ia.next().value;return Gt(a,b,e)}f=a.j.sequenceMode||Xt(a)||a.j.type==="MSF"?0:a.l.inaccurateManifestTolerance;
var g=Math.max(c-f,0);d=a.h.U.getDuration();Math.abs(g-d)<1&&(f=1,g=Math.max(c-f,0));var h=a.h.Ha()<0;d=null;f&&(b.stream.segmentIndex&&(b.ia=b.stream.segmentIndex.mb(g,!1,h)),d=b.ia&&b.ia.next().value);d||(b.stream.segmentIndex&&(b.ia=b.stream.segmentIndex.mb(c,!1,h)),d=b.ia&&b.ia.next().value);for(;((e=d)==null?void 0:e.Ib())===2;)f=c=void 0,d=(f=(c=b.ia)==null?void 0:c.next().value)!=null?f:null;return d=Gt(a,b,d)}
function hu(a,b,c,d,e){var f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D,B,A,E;return H(function(C){switch(C.i){case 1:f=Bc;g=b.stream;h=b.ia;b.ya=!0;C.o(2);if(d.Ib()==2)throw new L(1,1,1011);return C.h(ju(a,b,d,e),4);case 4:Uk(a.m);if(a.G)return C.return();k=g.mimeType=="video/mp4"||g.mimeType=="audio/mp4";l=window.ReadableStream;m=a.l.lowLatencyMode&&a.j.isLowLatency;n={Cc:null};if(m&&l&&k&&(a.j.type!="HLS"||d.u))return q=new Uint8Array(0),w=v=!1,x=function(F){var G,J,Q,O,V;return H(function(M){switch(M.i){case 1:if(v)return M.return();
w=!0;Uk(a.m);if(a.G)return M.return();M.o(2);q=Sb(q,F);G=!1;J=0;(new hh).box("mdat",function(N){J=N.size+N.start;G=!0}).parse(q,!1,!0);if(!G){M.A(4);break}Q=q.subarray(0,J);q=q.subarray(J);return M.h(ku(a,b,c,g,d,Q,!0,e),5);case 5:O=M.j,n.Cc==null&&(n=O),b.aa&&b.ia&&ft(b.aa,d.startTime,!0);case 4:M.u(0);break;case 2:y=V=M.m(),M.l()}})},C.h(lu(a,b,d,x),9);p=lu(a,b,d);return C.h(p,7);case 7:u=C.j;Uk(a.m);if(a.G)return C.return();Uk(a.m);return b.ub?(b.ya=!1,Kt(a,b,0),C.return()):st(a.C,d.startTime,
d.endTime)?(b.ya=!1,b.Xa||Kt(a,b,0),C.return()):C.h(ku(a,b,c,g,d,u,!1,e),8);case 8:n=C.j;C.A(6);break;case 9:z=C.j;if(y)throw y;if(w){C.A(10);break}v=!0;Uk(a.m);return a.G?C.return():b.ub?(b.ya=!1,Kt(a,b,0),C.return()):C.h(ku(a,b,c,g,d,z,!1,e),11);case 11:n=C.j;case 10:b.aa&&b.ia&&ft(b.aa,d.startTime,!0);case 6:Uk(a.m);if(a.G)return C.return();b.Fa=d;h.next();b.ya=!1;b.Hg=!1;D=a.h.U.dc();B=D[b.type];$a(JSON.stringify(B));b.ub||(A=null,b.type===f.qa?A=a.i.get(f.$):b.type===f.$&&(A=a.i.get(f.qa)),A&&
A.type==f.$?a.h.dd(d,b.stream,A.stream.isAudioMuxedInVideo,!1,n.Cc):a.h.dd(d,b.stream,b.stream.codecs.includes(","),!1,n.Cc));At(b);Kt(a,b,0);C.u(0);break;case 2:E=C.m();Uk(a.m,E);if(a.G)return C.return();b.ya=!1;E.code!=7001&&E.category!=1||!b.aa||(mt(b.aa,d),d.initSegmentReference&&mt(b.aa,d.initSegmentReference));if(E.code==7001)b.ya=!1,At(b),Kt(a,b,0),C.A(0);else if(b.type==f.Ua&&a.l.ignoreTextStreamFailures)a.i.delete(f.Ua),C.A(0);else{if(E.code==3017)return C.h(mu(a,b,E),0);b.Yc=!0;E.severity=
2;return C.h(bu(a,b,E),0)}}})}
function iu(a,b,c,d){var e,f,g,h,k,l,m,n,p,u,q,v,w;return H(function(y){switch(y.i){case 1:e=Bc;f=b.stream;for(k=(h=(g=f.segmentIndex)&&g.mb(c))&&h.next().value;k&&a.V.includes(k.startTime);)k=h&&h.next().value;if(!k){y.A(0);break}l=k.initSegmentReference;if(!l||qm(l,b.bb)){y.A(3);break}b.bb=l;y.o(4);return y.h(lu(a,b,l),6);case 6:m=y.j;if(!a.h)return y.return();var x=a.h.U;x.H&&Dc(x.H,m,0,f);a.V=[];y.u(3);break;case 4:throw n=y.m(),b.bb=null,n;case 3:if(b.Fa&&b.Fa==k){y.A(0);break}b.Fa=k;y.o(8);
return y.h(lu(a,b,k),10);case 10:p=y.j;if(!a.h)return y.return();x=a.h.U;x.H&&Dc(x.H,p,0,f);a.V.push(k.startTime);y.u(9);break;case 8:throw u=y.m(),b.Fa=null,u;case 9:if(!a.h)return y.return();b.ub||(q=null,b.type===e.qa?q=a.i.get(e.$):b.type===e.$&&(q=a.i.get(e.qa)),q&&q.type==e.$?a.h.dd(k,b.stream,q.stream.isAudioMuxedInVideo,!0,null):a.h.dd(k,b.stream,b.stream.codecs.includes(","),!0,null));v=Math.max.apply(Math,[0].concat(wa(a.V)));w=a.h.Hb();if(w+d>v)return y.h(iu(a,b,k.startTime,d),0);y.A(0)}})}
function mu(a,b,c){var d,e,f,g,h,k,l,m,n,p,u;return H(function(q){switch(q.i){case 1:d=!1;e=t(a.i.values());for(f=e.next();!f.done;f=e.next())if(g=f.value,g!=b&&g.Hg){d=!0;break}if(d){q.A(2);break}if(a.l.avoidEvictionOnQuotaExceededError){h=nu(a,c);if(k=a.h.disableStream(b.stream,h))return q.return();Kt(a,b,4);return q.return()}l=Math.round(100*a.D);if(l>20){a.D-=.2;q.A(3);break}if(l>4){a.D-=.04;q.A(3);break}m=nu(a,c);n=a.h.disableStream(b.stream,m);if(!n){b.Yc=!0;a.G=!0;a.h.onError(c);q.A(5);break}a.D=
1;p=a.h.Hb();return q.h(ou(a,b,p),5);case 5:return q.return();case 3:return b.Hg=!0,u=a.h.Hb(),q.h(ou(a,b,u),2);case 2:Kt(a,b,4),q.l()}})}
function ju(a,b,c,d){var e,f,g,h,k,l,m,n,p,u,q,v,w,y,x;return H(function(z){if(z.i==1)return e=Bc,f=b.Fa==null,g=[],h=Math.max(0,Math.max(c.F,a.ua)-.1),k=Math.min(c.D,a.sa)+.1,a.l.clampAppendWindowToDuration&&(l=a.j.presentationTimeline.getDuration(),l<Infinity&&(k=Math.min(k,l))),m=c.codecs||b.stream.codecs,n=Ce(m),p=De(c.mimeType||b.stream.mimeType),u=c.m,u==b.Qe&&h==b.Ub&&k==b.Tb&&n==b.qg&&p==b.rg?z.A(2):z.h(pu(a,b,u,h,k,c,n,p),2);qm(c.initSegmentReference,b.bb)||(b.bb=c.initSegmentReference,c.j&&
c.initSegmentReference&&(q=lu(a,b,c.initSegmentReference),v=function(){var D,B,A,E,C,F,G,J,Q,O,V;return H(function(M){switch(M.i){case 1:return M.o(2),M.h(q,4);case 4:return D=M.j,Uk(a.m),B=null,A=new Map,E={projection:null,hfov:null},b.stream&&(C=b.stream.videoLayout)&&(F=C.split("/"),F.includes("PROJ-RECT")?E.projection="rect":F.includes("PROJ-EQUI")?E.projection="equi":F.includes("PROJ-HEQU")?E.projection="hequ":F.includes("PROJ-PRIM")?E.projection="prim":F.includes("PROJ-AIV")&&(E.projection=
"aiv")),G=new hh,G.ma(["moov","trak","mdia"],mh).P("mdhd",function(N){B=Eh(N.reader,N.version).timescale}).P("hdlr",function(N){N=N.reader;N.skip(4);N=N.wa(4,!1);switch(String.fromCharCode(N[0],N[1],N[2],N[3])){case "soun":A.set(e.$,B);break;case "vide":A.set(e.qa,B)}B=null}),b.type!==e.qa||E.projection||G.ma(["minf","stbl"],mh).P("stsd",oh).ma([].concat(wa(wh),["encv"]),ph).ma(["vexu","proj"],mh).P("prji",function(N){N=N.reader.gd();E.projection=N}).box("hfov",function(N){N=N.reader.R()/1E3;E.hfov=
N}),G.parse(D,!0,!0),b.type===e.qa&&qu(a,E),A.has(b.type)?c.initSegmentReference.timescale=A.get(b.type):B!=null&&(c.initSegmentReference.timescale=B),J=b.stream.segmentIndex,J instanceof Hm&&(Q=Jm(J,c.startTime)),O=b.stream.closedCaptions&&b.stream.closedCaptions.size>0,M.h(a.h.xh(b.type,D),5);case 5:return M.h(Sr(a.h.U,b.type,D,null,b.stream,O,b.Ic,d,!1,!1,Q),6);case 6:M.u(0);break;case 2:throw V=M.m(),b.bb=null,V;}})},w=c.startTime,f&&(y=Lr(a.h.U,b.type),y!=null&&(w=y)),a.h.Ik(w,c.initSegmentReference),
g.push(v())));x=b.Fa?b.Fa.discontinuitySequence:-1;c.discontinuitySequence!=x&&g.push(fs(a.h.U,b.type,c.startTime));return z.h(Promise.all(g),0)})}
function pu(a,b,c,d,e,f,g,h){var k,l,m,n,p;return H(function(u){switch(u.i){case 1:k=Bc;l=Zt(a);u.o(2);b.Ub=d;b.Tb=e;g&&(b.qg=g);h&&(b.rg=h);b.Qe=c;m=a.j.sequenceMode||a.j.type=="HLS";n=null;b.type===k.qa?n=a.i.get(k.$):b.type===k.$&&(n=a.i.get(k.qa));if(!(n&&n.stream&&n.stream.isAudioMuxedInVideo)){u.A(4);break}return u.h(cs(a.h.U,n.type,c,d,e,m,n.stream.mimeType,n.stream.codecs,l),4);case 4:return u.h(cs(a.h.U,b.type,c,d,e,m,f.mimeType||b.stream.mimeType,f.codecs||b.stream.codecs,l,function(){return ru(a,
n)}),6);case 6:u.u(0);break;case 2:throw p=u.m(),b.Ub=null,b.Tb=null,b.qg=null,b.rg=null,b.Qe=null,p;}})}function ru(a,b){return H(function(c){if(c.i==1)return b?c.h(Bt(b).catch(function(){}),2):c.return();b.bb=null;b.Ub=null;b.Tb=null;Tt(a,b);c.l()})}
function ku(a,b,c,d,e,f,g,h){g=g===void 0?!1:g;h=h===void 0?!1:h;var k,l,m,n,p,u;return H(function(q){switch(q.i){case 1:return k=d.closedCaptions&&d.closedCaptions.size>0,a.l.shouldFixTimestampOffset&&(l=d.mimeType=="video/mp4"||d.mimeType=="audio/mp4",m=null,e.initSegmentReference&&(m=e.initSegmentReference.timescale),(n=l&&m&&d.type==="video"&&a.j.type=="DASH")&&(new hh).ma(th,mh).P("tfdt",function(v){var w,y,x,z,D,B;return H(function(A){w=Dh(v.reader,v.version);y=w.za;if(!y)return A.return();
x=-y/m;z=Number(b.Qe)||0;if(!(z<x))return A.A(0);D=b.Ub;B=b.Tb;return A.h(pu(a,b,x,D,B,e),0)})}).parse(f,!1,g)),q.h(ou(a,b,c),2);case 2:return Uk(a.m),p=b.Ic,b.Ic=!1,q.h(a.h.xh(b.type,f),3);case 3:return q.h(Sr(a.h.U,b.type,f,e,d,k,p,h,g),4);case 4:return u=q.j,Uk(a.m),q.return(u)}})}
function ou(a,b,c){var d,e,f,g,h,k,l,m,n,p;return H(function(u){if(u.i==1){a.I==b&&(a.I=null);d=b.stream.segmentIndex;d instanceof Hm&&(d.yb(a.j.presentationTimeline.Gd()),e=[],Im(d,function(){e.push(-1)}));f=Math.max(a.l.bufferBehind*a.D,a.j.presentationTimeline.i);g=Jr(a.h.U,b.type);if(g==null)return u.return();h=c-g;k=a.l.evictionGoal;l=a.j.presentationTimeline.zb();m=a.j.presentationTimeline.ob();n=m-l;p=h-f;n>k&&(p=Math.max(h-f,l-k-g));return p<=k?u.return():u.h(a.h.U.remove(b.type,g,g+p,e),
2)}if(u.i!=4)return Uk(a.m),a.I?u.h(ou(a,a.I,c),4):u.A(0);Uk(a.m);u.l()})}function du(a){return a&&a.type==zc&&(a.stream.mimeType==Je||a.stream.mimeType==Ke)}
function lu(a,b,c,d){var e,f,g,h,k;return H(function(l){switch(l.i){case 1:if(e=c.xc())return l.return(e);f=null;if(b.aa){var m=b.aa,n=m.h;c instanceof pm&&(n=m.l);n.has(c)?(m=n.get(c),d&&(m.Wg=d),f=m.Qd):f=null}f||(f=$t(c,b.stream,d||null,a.l.retryParameters,a.h.Ec));g=0;b.ia&&(g=b.ia.i);b.operation=f;return l.h(f.promise,2);case 2:h=l.j;b.operation=null;k=h.data;if(!c.aesKey){l.A(3);break}return l.h(Tm(k,c.aesKey,g),4);case 4:k=l.j;case 3:return l.return(k)}})}
function $t(a,b,c,d,e,f){f=f===void 0?!1:f;var g=a instanceof rm?a:void 0,h=g?1:0;a=$m(a.S(),a.startByte,a.endByte,d,c);a.contentType=b.type;return e.request(Pk,a,{type:h,stream:b,segment:g,isPreload:f})}
function Vt(a,b,c,d){var e,f,g;return H(function(h){if(h.i==1)return b.ub=!1,b.nd=!1,b.Sc=0,b.xb=!0,b.Fa=null,b.ia=null,b.aa&&!a.o.has(b.stream)&&nt(b.aa,c),d?(f=a.h.Hb(),g=a.h.U.getDuration(),h.h(a.h.U.remove(b.type,f+d,g),3)):h.h(bs(a.h.U,b.type),4);if(h.i!=3){Uk(a.m);if(!c)return h.A(3);e=ob();return e.cf()?h.h(a.h.U.flush(b.type),3):h.A(3)}Uk(a.m);b.xb=!1;b.endOfStream=!1;b.ya||b.Xa||Kt(a,b,0);h.l()})}
function Kt(a,b,c){var d=b.type;if(d!=zc||a.i.has(d))b.Xa=(new $e(function(){var e;return H(function(f){if(f.i==1)return f.o(2),f.h(au(a,b),4);if(f.i!=2)return f.u(0);e=f.m();if(a.h)a.h.onError(e);f.l()})})).ha(c)}function At(a){a.Xa!=null&&(a.Xa.stop(),a.Xa=null)}function Bt(a){return H(function(b){return a.operation?b.h(a.operation.abort(),0):b.A(0)})}
function bu(a,b,c){var d,e,f,g,h,k,l,m,n,p;return H(function(u){switch(u.i){case 1:return c.code==3024?(b.ya=!1,At(b),Kt(a,b,0),u.return()):u.h(a.ra.attempt(),2);case 2:Uk(a.m);if(c.code!=3015&&c.code!=3014&&(c.category!==1||c.code==1003)){u.A(3);break}if(b.mc)return Mt(a,!1),u.return();d=!1;if(c.code!=3015&&c.code!=3014){u.A(4);break}return u.h(eu(a,!0),5);case 5:d=u.j;e=t(a.i.values());for(f=e.next();!f.done;f=e.next())g=f.value,At(g);Uk(a.m);case 4:h=nu(a,c),k=a.h.disableStream(b.stream,h),c.handled=
k||d,k&&(c.severity=1);case 3:if(c.handled||c.code!=1011){u.A(6);break}l=a.h.Hb();m=Lr(a.h.U,b.type);for(n=fu(a,b,l,m);((p=n)==null?void 0:p.Ib())===2;)b.Fa=n,n=fu(a,b,l,m);if(!n){u.A(6);break}return u.h(fs(a.h.U,b.type,n.startTime),8);case 8:return b.ya=!1,b.Yc=!1,At(b),Kt(a,b,0),u.return();case 6:if(!c.handled||c.code!=1011)a.h.onError(c);c.handled||a.l.failureCallback(c);u.l()}})}
function nu(a,b){return a.l.maxDisabledTime===0&&b.code==1011?1:b.code==3014||b.code==3015?Infinity:a.l.maxDisabledTime}
function eu(a,b){b=b===void 0?!1:b;var c,d,e,f,g,h;return H(function(k){if(k.i==1){c=Date.now()/1E3;d=a.l.minTimeBetweenRecoveries;if(!b&&(!a.l.allowMediaSourceRecoveries||c-a.Z<d))return k.return(!1);a.Z=c;e=Bc;if(f=a.i.get(e.$))At(f),f.operation&&(f.operation.abort(),f.operation=null),f.bb=null,f.Ub=null,f.Tb=null,f.ya=!1,f.ub=!1,f.Sc=0,f.nd=!1,f.xb=!1,f.ia&&f.ia.Og();if(g=a.i.get(e.qa))At(g),g.operation&&(g.operation.abort(),g.operation=null),g.bb=null,g.Ub=null,g.Tb=null,g.ya=!1,g.ub=!1,g.Sc=
0,g.nd=!1,g.xb=!1,g.ia&&g.ia.Og();h=a.h.video.paused;return k.h(os(a.h.U,Zt(a)),2)}!g||g.xb||g.ya||g.Xa||Kt(a,g,0);!f||f.xb||f.ya||f.Xa||Kt(a,f,0);h||a.h.video.play();return k.return(!0)})}function qu(a,b){if(a.ba.projection!=b.projection||a.ba.hfov!=b.hfov){if(b.projection!=null||b.hfov!=null){var c=(new Map).set("detail",b);c=new tk("spatialvideoinfo",c)}else c=new tk("nospatialvideoinfo");c.cancelable=!0;a.h.onEvent(c);a.ba=b}}
function su(a){var b=a.l.crossBoundaryStrategy;return b==="reset_to_encrypted"&&a.na?"keep":b}
function Xt(a){if(su(a)!=="keep")return!0;var b=ob(),c=a.h.Je();if(!b.gb(c))for(b=t(a.i.keys()),c=b.next();!c.done;c=b.next()){if(c=a.i.get(c.value),c.type!==Bc.Ua&&(c=c.stream)&&c.fullMimeTypes&&c.fullMimeTypes.size>1)return!0}else if(!b.kd())for(b=t(a.i.keys()),c=b.next();!c.done;c=b.next())if(c=a.i.get(c.value),c.type!==Bc.Ua&&(c=c.stream)&&c.fullMimeTypes&&c.fullMimeTypes.size>1){a=new Set;b=t(c.fullMimeTypes);for(c=b.next();!c.done;c=b.next())a.add(ze(c.value));return a.size>1}return!1}
function St(a){a.L.Ta();Xt(a)&&a.L.Jb(a.h.video,["waiting","timeupdate"],function(){Yt(a)})}function Yt(a){if(Xt(a)){a.O.stop();var b=a.h.Hb(),c=a.i.get("video")||a.i.get("audio");c&&(c=c.bb)&&c.h!==null&&(b=c.h-b,b<-.1||b>1||(a.H=c.h+.1,a.O.ha(Math.max(0,b))))}}
function gu(a,b,c){if(b.type===zc)return!1;var d=b.bb;if(!d)return!1;var e=c.initSegmentReference,f=d.h!==e.h;c=f;su(a)==="reset_to_encrypted"&&(d.encrypted||e.encrypted||(c=!1),d.encrypted&&(a.na=!0));var g=su(a);g==="RESET_ON_ENCRYPTION_CHANGE"&&d.encrypted==e.encrypted&&(c=!1);if(g==="keep"&&d.mimeType&&e.mimeType){g=Ae(Ee(d.mimeType));var h=Ae(Ee(e.mimeType));d.mimeType==e.mimeType&&g==h&&(c=!1)}if(f=(g=(a.i.get("video")||a.i.get("audio"))===b)&&f&&a.M)a.M=!1;g&&c&&(f||b.Ic)&&eu(a,!0).then(function(){var k=
(new Map).set("oldEncrypted",d.encrypted).set("newEncrypted",e.encrypted);a.h.onEvent(new tk("boundarycrossed",k))});return c}function Zt(a,b){function c(f){if(f.fullMimeTypes&&f.fullMimeTypes.size>1&&a.i.has(f.type)){var g=a.i.get(f.type),h=Lr(a.h.U,g.type),k=a.h.Hb();(g=fu(a,g,k,h))&&g.codecs&&g.mimeType&&(f.codecs=g.codecs,f.mimeType=g.mimeType)}}b=b===void 0?!1:b;var d=new Map,e=a.u.audio;e&&(c(e),d.set("audio",e));if(e=a.u.video)c(e),d.set("video",e);b&&a.F&&d.set(zc,a.F);return d};function tu(){}
function uu(a,b,c,d,e){var f=e in d,g=new Set(["__proto__","constructor","prototype"]);var h=f?c.constructor==Object&&Object.keys(d).length==0:c.constructor==Object&&Object.keys(c).length==0;for(var k=f||h,l=!0,m=t(Object.keys(b)),n=m.next();!n.done;n=m.next()){n=n.value;var p=e+"."+n,u=f?d[e]:c[n];g.has(n)?(Va("Invalid config, dangerous key "+p),l=!1):k||n in c?b[n]===void 0?u===void 0||k?delete a[n]:a[n]=nd(u):h?a[n]=b[n]:u.constructor==Object&&b[n]&&b[n].constructor==Object?(a[n]||(a[n]=nd(u)),
n=uu(a[n],b[n],u,d,p),l=l&&n):typeof b[n]!=typeof u||b[n]==null||typeof b[n]!="function"&&b[n].constructor!=u.constructor?(Va("Invalid config, wrong type for "+p),l=!1):typeof c[n]=="function"&&c[n].length!=b[n].length?(Wa("Unexpected number of arguments for "+p),a[n]=b[n]):a[n]=Array.isArray(a[n])?b[n].slice():b[n]:(Va("Invalid config, unrecognized key "+p),l=!1)}return l}
function vu(a,b){for(var c={},d=c,e=0,f=0;;){e=a.indexOf(".",e);if(e<0)break;if(e==0||a[e-1]!="\\")f=a.substring(f,e).replace(/\\\./g,"."),d[f]={},d=d[f],f=e+1;e+=1}d[a.substring(f).replace(/\\\./g,".")]=b;return c}function wu(a,b){return a&&b}
function xu(a,b){function c(f){for(var g=t(Object.keys(f)),h=g.next();!h.done;h=g.next())h=h.value,f[h]instanceof HTMLElement||(e(f[h])&&Object.keys(f[h]).length===0?delete f[h]:typeof f[h]=="function"?delete f[h]:e(f[h])&&(c(f[h]),Object.keys(f[h]).length===0&&delete f[h]))}function d(f,g){return Object.keys(f).reduce(function(h,k){var l=f[k];if(g.hasOwnProperty(k))if(l instanceof HTMLElement&&g[k]instanceof HTMLElement)l.isEqualNode(g[k])||(h[k]=l);else if(e(l)&&e(g[k])){if(l=d(l,g[k]),Object.keys(l).length>
0||!e(l))h[k]=l}else Array.isArray(l)&&Array.isArray(g[k])?gb(l,g[k])||(h[k]=l):Number.isNaN(l)&&Number.isNaN(g[k])||l!==g[k]&&(h[k]=l);else h[k]=l;return h},{})}function e(f){return f&&typeof f==="object"&&!Array.isArray(f)}a=d(a,b);c(a);return a}K("shaka.util.ConfigUtils",tu);tu.getDifferenceFromConfigObjects=xu;tu.convertToConfigObject=vu;tu.mergeConfigObjects=uu;function yu(){}
function zu(){var a=Infinity,b=ob();navigator.connection&&navigator.connection.saveData&&(a=360);var c={retryParameters:mk(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,persistentSessionOnlinePlayback:!1,persistentSessionsMetadata:[],keepDrmEngineOnDetach:!1,initDataTransform:function(g,h,k){"apple"===window.shakaMediaKeysPolyfill&&h=="skd"&&(h=k.serverCertificate,k=Ol(g),g=Pl(g,k,h));return g},logLicenseExchange:!1,updateExpirationTime:1,preferredKeySystems:[],keySystemsMapping:{},
parseInbandPsshEnabled:!1,minHdcpVersion:"",ignoreDuplicateInitData:!0,defaultAudioRobustnessForWidevine:"SW_SECURE_CRYPTO",defaultVideoRobustnessForWidevine:"SW_SECURE_DECODE",renewalIntervalSec:0,failureCallback:function(g){return wu([g])}},d="reload";b.gb("")&&(d="smooth");var e={trackSelectionCallback:function(g){return H(function(h){return h.return(g)})},downloadSizeCallback:function(g){var h;return H(function(k){if(k.i==1)return navigator.storage&&navigator.storage.estimate?k.h(navigator.storage.estimate(),
3):k.return(!0);h=k.j;return k.return(h.usage+g<h.quota*.95)})},progressCallback:function(g,h){return wu([g,h])},usePersistentLicense:!0,numberOfParallelDownloads:5},f={drm:c,manifest:{retryParameters:mk(),availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,disableThumbnails:!1,disableIFrames:!1,disableChapters:!1,defaultPresentationDelay:0,segmentRelativeVttTiming:!1,raiseFatalErrorOnManifestUpdateRequestFailure:!1,continueLoadingWhenPaused:!0,ignoreSupplementalCodecs:!1,
updatePeriod:-1,ignoreDrmInfo:!1,enableAudioGroups:!0,dash:{clockSyncUri:"",xlinkFailGracefully:!1,ignoreMinBufferTime:!1,autoCorrectDrift:!0,initialSegmentLimit:1E3,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1,ignoreMaxSegmentDuration:!1,keySystemsByURI:ec(!1,!0),manifestPreprocessorTXml:Au,sequenceMode:!1,useStreamOnceInPeriodFlattening:!1,enableFastSwitching:!0},hls:{ignoreTextStreamFailures:!1,ignoreImageStreamFailures:!1,defaultAudioCodec:"mp4a.40.2",defaultVideoCodec:"avc1.42E01E",
ignoreManifestProgramDateTime:!1,ignoreManifestProgramDateTimeForTypes:[],mediaPlaylistFullMimeType:'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"',liveSegmentsDelay:3,sequenceMode:!1,ignoreManifestTimestampsInSegmentsMode:!1,disableCodecGuessing:!1,disableClosedCaptionsDetection:!1,allowLowLatencyByteRangeOptimization:!0,allowRangeRequestsToGuessMimeType:!1,chaptersUri:""},msf:{fingerprintUri:"",namespaces:[],authorizationToken:"",version:"auto",catalogPreprocessor:Bu}},streaming:{retryParameters:mk(),
failureCallback:function(g){return wu([g])},rebufferingGoal:0,bufferingGoal:10,bufferBehind:30,evictionGoal:1,ignoreTextStreamFailures:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.5,gapPadding:0,gapJumpTimerTime:.25,durationBackoff:1,safeSeekOffset:5,safeSeekEndOffset:0,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsForFairPlay:!1,inaccurateManifestTolerance:2,lowLatencyMode:!0,preferNativeDash:!1,preferNativeHls:!1,fallbackToNativeHlsOnMseError:!1,updateIntervalSeconds:1,observeQualityChanges:!1,
maxDisabledTime:30,segmentPrefetchLimit:1,prefetchAudioLanguages:[],disableAudioPrefetch:!1,disableTextPrefetch:!1,disableVideoPrefetch:!1,liveSync:{enabled:!1,targetLatency:.5,targetLatencyTolerance:.5,maxPlaybackRate:1.1,minPlaybackRate:.95,panicMode:!1,panicThreshold:60,dynamicTargetLatency:{enabled:!1,stabilityThreshold:60,rebufferIncrement:.5,maxAttempts:10,maxLatency:4,minLatency:1}},allowMediaSourceRecoveries:!0,minTimeBetweenRecoveries:5,vodDynamicPlaybackRate:!1,vodDynamicPlaybackRateLowBufferRate:.95,
vodDynamicPlaybackRateBufferRatio:.5,preloadNextUrlWindow:30,loadTimeout:30,clearDecodingCache:!1,dontChooseCodecs:!1,shouldFixTimestampOffset:!1,avoidEvictionOnQuotaExceededError:!1,crossBoundaryStrategy:"keep",returnToEndOfLiveWindowWhenOutside:!1,stopFetchingOnPause:!1,clampAppendWindowToDuration:!1,processSrcEqualMetadata:!0},networking:{forceHTTP:!1,forceHTTPS:!1,minBytesForProgressEvents:16E3,commonAccessTokenHeaderName:"cta-common-access-token"},mediaSource:{codecSwitchingStrategy:d,addExtraFeaturesToSourceBuffer:function(g){return wu([g],
"")},forceTransmux:!1,insertFakeEncryptionInInit:!0,correctEc3Enca:!1,modifyCueCallback:function(g,h,k){return wu([g,h,k])},modifyPreselectionSegmentCallback:function(g){return g},dispatchAllEmsgBoxes:!1,useSourceElements:!0,durationReductionEmitsUpdateEnd:!0,transmuxWorkerUrl:"",repairIFrames:!0},offline:e,abrFactory:function(){return new Wf},adaptationSetCriteriaFactory:function(){return new (Function.prototype.bind.apply(Ms,[null].concat(wa(Ja.apply(0,arguments)))))},abr:{enabled:!0,useNetworkInformation:!0,
defaultBandwidthEstimate:1E6,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:a,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},advanced:{minTotalBytes:128E3,minBytes:16E3,fastHalfLife:2,slowHalfLife:5,droppedFramesThreshold:.15,droppedFramesInterval:2,droppedFramesBanDuration:30},restrictToElementSize:!1,restrictToScreenSize:!1,
ignoreDevicePixelRatio:!1,clearBufferSwitch:!1,safeMarginSwitch:0,cacheLoadThreshold:5,minTimeToSwitch:0,preferNetworkInformationBandwidth:!1,droppedFrames:!0,allowAudioFallback:!0},preferredAudio:[{language:"",role:"",label:"",channelCount:2,codec:""}],preferredText:[],preferredVideo:[{label:"",role:"",language:"",codec:"",hdrLevel:"AUTO",layout:""}],preferredDecodingAttributes:[],restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minFrameRate:0,
maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},playRangeStart:0,playRangeEnd:Infinity,textDisplayer:{fontScaleFactor:1,positionArea:0,fontFamily:"",fontColor:"",fontOpacity:NaN,backgroundColor:"",backgroundOpacity:NaN,characterEdgeStyle:0,subtitleDelay:0,suspendRenderingWhenHidden:!0},textDisplayFactory:function(){return null},cmcd:{enabled:!1,sessionId:"",contentId:"",rtpSafetyFactor:5,useHeaders:!1,includeKeys:[],includeInRequests:[],version:1,
eventTargets:[],applyParametersFromManifest:!0},cmsd:{enabled:!0,applyMaximumSuggestedBitrate:!0,estimatedThroughputWeightRatio:.5},lcevc:{enabled:!1,dynamicPerformanceScaling:!0,logLevel:0,drawLogo:!1,poster:!0},ads:{customPlayheadTracker:!1,skipPlayDetection:!1,supportsMultipleMediaElements:!0,disableHLSInterstitial:!1,disableDASHInterstitial:!1,disableSVTA:!1,allowPreloadOnDomElements:!0,allowStartInMiddleOfInterstitial:!0,disableTrackingEvents:!1,disableSnapback:!1,interstitialPreloadAheadTime:10,
interstitialCooldown:0,disablePlayedLinearAdSkip:!1,disableTrackingForPlayedLinearAds:!1},ignoreHardwareResolution:!1,queue:{preloadNextUrlWindow:Infinity,preloadPrevItem:!0,repeatMode:0,autoPlayNext:!0},accessibility:{handleForcedSubtitlesAutomatically:!0,speechToText:{enabled:!1,maxTextLength:140,processLocally:!1,languagesToTranslate:[]}}};e.trackSelectionCallback=function(g){var h,k;return H(function(l){h=f.preferredAudio.map(function(m){return m.language}).filter(Boolean);k=f.preferredVideo[0]&&
f.preferredVideo[0].hdrLevel||"";return l.return(Cu(g,h,k))})};return b.Va(f)}function Du(){return{streaming:{inaccurateManifestTolerance:0,segmentPrefetchLimit:2,updateIntervalSeconds:.1,maxDisabledTime:1,retryParameters:{baseDelay:100}},manifest:{dash:{autoCorrectDrift:!1},retryParameters:{baseDelay:100}},drm:{retryParameters:{baseDelay:100}}}}
function Eu(a,b,c){var d={".drm.keySystemsMapping":"",".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:[],audioRobustness:[],sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:"",headers:{}}};return uu(a,b,c||zu(),d,"")}
function Fu(a){var b=a.preferredAudio[0],c=a.preferredVideo[0],d;a.language=(d=b==null?void 0:b.language)!=null?d:"";var e;a.role=(e=b==null?void 0:b.role)!=null?e:"";var f;a.channelCount=(f=b==null?void 0:b.channelCount)!=null?f:2;var g;a.spatialAudio=(g=b==null?void 0:b.spatialAudio)!=null?g:!1;var h;a.audioLabel=(h=b==null?void 0:b.label)!=null?h:"";var k;a.videoRole=(k=c==null?void 0:c.role)!=null?k:"";var l;a.hdrLevel=(l=c==null?void 0:c.hdrLevel)!=null?l:"";var m;a.videoLayout=(m=c==null?void 0:
c.layout)!=null?m:"";var n;a.videoLabel=(n=c==null?void 0:c.label)!=null?n:"";a.preferredAudioCodecs=a.preferredAudio.map(function(u){return u.codec}).filter(Boolean);var p;a.preferredAudioChannelCount=(p=b==null?void 0:b.channelCount)!=null?p:2}
function Cu(a,b,c){var d=c;d=="AUTO"&&(c=a.some(function(l){return l.hdr&&l.hdr=="HLG"?!0:!1}),d=ob().fc(c));var e=a.filter(function(l){return l.type!="variant"||l.hdr&&l.hdr!=d?!1:!0});c=[];var f=e.map(function(l){return l.language}),g=null;b=t(b);for(var h=b.next();!h.done&&!(g=tc(h.value,f));h=b.next());g&&(c=e.filter(function(l){return mc(l.language)==g}));c.length==0&&(c=e.filter(function(l){return l.primary}));c.length==0&&(e.map(function(l){return l.language}),c=e);var k=c.filter(function(l){return l.height&&
l.height<=480});k.length&&(k.sort(function(l,m){return m.height-l.height}),c=k.filter(function(l){return l.height==k[0].height}));b=[];c.length&&(e=Math.floor(c.length/2),c.sort(function(l,m){return l.bandwidth-m.bandwidth}),b.push(c[e]));a=t(a);for(c=a.next();!c.done;c=a.next())c=c.value,c.type!=zc&&c.type!="image"&&c.type!="chapter"||b.push(c);return b}function Au(a){return wu([a],a)}function Bu(a){return wu([a],a)}K("shaka.util.PlayerConfiguration",yu);yu.mergeConfigObjects=Eu;
yu.createDefaultForLL=Du;yu.createDefault=zu;function Gu(){this.h=null;this.i=[]}function Hu(a,b){var c=0;a.h&&a.h.state==b&&(c+=a.h.duration);a=t(a.i);for(var d=a.next();!d.done;d=a.next())d=d.value,c+=d.state==b?d.duration:0;return c}function Iu(a){function b(f){return{timestamp:f.timestamp,state:f.state,duration:f.duration}}for(var c=[],d=t(a.i),e=d.next();!e.done;e=d.next())c.push(b(e.value));a.h&&c.push(b(a.h));return c};function Ju(){this.j=this.i=null;this.h=[]}function Ku(a,b,c){a.j!=b&&(a.j=b,a.h.push({timestamp:Date.now()/1E3,id:b.id,type:"text",fromAdaptation:c,bandwidth:null}))};function Lu(){this.F=this.ba=NaN;this.m="";this.j=this.Yh=this.C=this.D=this.M=this.G=this.B=this.o=this.L=this.u=this.H=this.i=this.Y=this.Z=this.O=this.T=this.V=NaN;this.N=0;this.I=this.K=NaN;this.h=new Gu;this.l=new Ju}function Mu(a,b,c){a.V=b;a.T=c}function Nu(a,b,c){a.ba=b;a.F=c}function Ou(a,b){a.i=isNaN(a.i)?b:Math.max(a.i,b)}function Pu(a,b){b>=0&&(a.B=b)}function Qu(a,b){b>=0&&(a.G=b)}function Ru(a,b){b>=0&&(a.M=b)}function Su(a,b){a.j=isNaN(a.j)?b:a.j+b}
function Tu(a){var b=a.ba,c=a.F,d=a.m,e=a.D,f=a.T,g=a.V,h=a.O,k=a.Z,l=a.Y,m=a.C,n=a.i,p=a.H,u=a.u,q=a.L,v=a.o,w=Hu(a.h,"playing"),y=Hu(a.h,"paused"),x=Hu(a.h,"buffering"),z=a.B,D=a.G,B=a.M,A=a.Yh,E=a.j,C=a.N,F=a.K,G=a.I,J=Iu(a.h),Q=[];a=t(a.l.h);for(var O=a.next();!O.done;O=a.next())O=O.value,Q.push({timestamp:O.timestamp,id:O.id,type:O.type,fromAdaptation:O.fromAdaptation,bandwidth:O.bandwidth});return{width:b,height:c,currentCodecs:d,streamBandwidth:e,decodedFrames:f,droppedFrames:g,corruptedFrames:h,
stallsDetected:k,gapsJumped:l,estimatedBandwidth:m,completionPercent:n,loadLatency:p,timeToFirstFrame:u,manifestTimeSeconds:q,drmTimeSeconds:v,playTime:w,pauseTime:y,bufferingTime:x,licenseTime:z,liveLatency:D,maxSegmentDuration:B,manifestSizeBytes:A,bytesDownloaded:E,nonFatalErrorCount:C,manifestPeriodCount:F,manifestGapCount:G,stateHistory:J,switchHistory:Q}};function Uu(a,b,c,d){uk.call(this);this.T=a;this.ba=b;this.Ma=d.networkingEngine;this.B=c;this.m=null;this.Ga=0;this.Pa=d.we;this.I=d.wk;this.ra=d.xk;this.j=d.config;this.o=this.L=this.h=null;this.ua=!1;this.M=d.Ok;this.Ba=!1;this.V=d.Xk||new at(function(){return{start:0,end:Infinity}});this.Aa=!1;this.l=null;this.Y=!1;this.D=null;this.G=new Map;this.Da=!1;this.Oa=d.Nk;this.ka=new Lu;this.sa=Promise.withResolvers();this.C=Promise.withResolvers();this.Z=null;this.F=!1;this.na=d.aj;this.Qa=d.Jk;this.u=
this.i=null;this.K=!1;this.O=[];this.N=[];this.H=!0}ta(Uu,uk);function Vu(a,b,c){(a=b?a.N:a.O)?a.push(c):c()}function Wu(a){if(a.N)for(var b=t(a.N),c=b.next();!c.done;c=b.next())c=c.value,c();a.N=null}function Xu(a,b){a.Z=b;a.K=!0;if(a.O){b=t(a.O);for(var c=b.next();!c.done;c=b.next())c=c.value,c()}a.O=null}r=Uu.prototype;r.getStartTime=function(){return this.B};r.fg=function(){return this.ba};r.He=function(){return this.T};r.eg=function(){return this.h};function Yu(a){a.Ba=!0;return a.M}
function Zu(a){a.Aa=!0;return a.V}r.getStats=function(){return this.ka};function $u(a){a.Y=!0;return a.l}function av(a,b){a.l=b;a.I.h=b;a.Y=!0}r.Uj=function(){return this.i?Ef(this.i):null};r.Tj=function(){return this.u?Ff(this.u):null};function bv(a){a.Da=!0;return a.G}
r.start=function(){var a=this;this.C.promise.catch(function(){});(function(){var b;return H(function(c){switch(c.i){case 1:return c.h(Promise.resolve(),2);case 2:return c.o(3),c.h(cv(a),5);case 5:dv(a);if("webkit"===window.shakaMediaKeysPolyfill){c.A(6);break}return c.h(ev(a),7);case 7:dv(a);case 6:return c.h(fv(a),8);case 8:dv(a);if(!a.na){c.A(9);break}return c.h(gv(a),10);case 10:dv(a);case 9:if(!a.na||!a.l){c.A(11);break}return c.h(Gl(a.l),12);case 12:dv(a);case 11:a.C.resolve();c.u(0);break;case 3:b=
c.m(),b instanceof L&&(b.code==7001||b.code==7003)||a.C.reject(b),c.l()}})})()};r.dispatchEvent=function(a){return this.Z?this.Z.dispatchEvent(a):uk.prototype.dispatchEvent.call(this,a)};r.onError=function(a){a.severity===2&&(this.C.reject(a),this.destroy());var b=(new Map).set("detail",a);b=new tk("error",b);this.dispatchEvent(b);b.defaultPrevented&&(a.handled=!0)};function dv(a){if(a.F)throw new L(2,7,7003);}function hv(a,b){a.dispatchEvent(new tk("onstatechange",(new Map).set("state",b)))}
function cv(a){var b,c,d,e,f,g;return H(function(h){switch(h.i){case 1:hv(a,"manifest-parser");a.o||(a.L=Nc(a.T,a.ba),a.o=a.L(),a.o.configure(a.j.manifest,function(){return a.H}));b=Date.now()/1E3;hv(a,"manifest");if(a.h){h.A(2);break}return h.h(a.o.start(a.T,a.ra),3);case 3:return a.h=h.j,iv(a.h),a.F||a.Qa(a.h),h.h(jv(a),2);case 2:return a.sa.resolve(),c=new tk("manifestparsed",void 0),h.h(Promise.resolve(),5);case 5:a.dispatchEvent(c);if(a.h.variants.length==0)throw new L(2,4,4036);iv(a.h);d=kr(a.I,
a.h);if(!d){h.A(6);break}e=new tk("trackschanged",void 0);return h.h(Promise.resolve(),7);case 7:dv(a),a.dispatchEvent(e);case 6:f=Date.now()/1E3,g=f-b,g>=0&&(a.ka.L=g),h.l()}})}
function ev(a,b){var c,d,e,f,g;return H(function(h){switch(h.i){case 1:if(!a.h||a.l)return h.return();hv(a,"drm-engine");a.Ga=Date.now()/1E3;a.l=a.Pa();a.I.h=a.l;a.l.configure(a.j.drm,function(){return a.H});c=Of(a.h.variants);d=!0;a.h&&a.h.presentationTimeline&&(d=a.h.presentationTimeline.oa());return h.h(el(a.l,c,a.h.offlineSessionIds,d),2);case 2:dv(a);if(!b){h.A(3);break}return h.h(a.l.wb(b),4);case 4:dv(a);case 3:return a.m&&(e=a.m.getConfiguration(),e.keySystem=kv(a),a.m.configure(e)),h.h(ir(a.I,
a.h),5);case 5:f=h.j;if(!f){h.A(0);break}g=new tk("trackschanged",void 0);return h.h(Promise.resolve(),7);case 7:a.dispatchEvent(g),h.l()}})}r.configure=function(a,b){a=vu(a,b);Eu(this.j,a);lv(this)};r.getConfiguration=function(){return nd(this.j)};
function jv(a){var b;return H(function(c){a.m||(a.m=a.j.adaptationSetCriteriaFactory(),b={preferredAudio:a.j.preferredAudio,preferredVideo:a.j.preferredVideo,language:"",role:"",videoRole:"",channelCount:0,hdrLevel:"",spatialAudio:!1,videoLayout:"",audioLabel:"",videoLabel:"",preferredAudioCodecs:[],preferredAudioChannelCount:0,codecSwitchingStrategy:a.j.mediaSource.codecSwitchingStrategy,audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,keySystem:kv(a)},Fu(b),a.m.configure(b));if(a.i||
!a.h.variants.length||a.h.variants.length!=1&&a.h.type!="HLS")return c.A(0);a.i=mv(a);return a.i?c.h(nv(a.i),0):c.A(0)})}function fv(a){return H(function(b){if(b.i==1)return!a.i||a.h.variants.includes(a.i)?b.A(0):b.h(ov(a.i),3);a.i=mv(a);return a.i?b.h(nv(a.i),0):b.A(0)})}
function gv(a){var b,c,d,e,f;return H(function(g){!a.i&&(b=mv(a))&&(a.i=b);if(!a.i)return g.A(0);c=a.h.presentationTimeline.isLive();d=[];e=a.i;e.video&&d.push(pv(a,e.video,c));e.audio&&d.push(pv(a,e.audio,c));if(f=qv(a,e))d.push(pv(a,f,c)),a.u=f;return g.h(Promise.all(d),0)})}
function mv(a){if(!a.D){var b=a.j.abrFactory;a.D=b();b=a.D;var c=b.configure;var d=a.ra.getBandwidthEstimate();if(!Number.isFinite(d)||d<=0)d=a.j.abr;else{var e=od(a.j.abr);e.defaultBandwidthEstimate=d;e.useNetworkInformation=!1;d=e}c.call(b,d)}b=a.h.isLowLatency&&a.j.streaming.lowLatencyMode;c=Of(a.h.variants);c=a.m.create(c);a.D.setVariants(Array.from(c.values()),b);return a.D.chooseVariant(!0)}
function qv(a,b){var c=null,d=Rf(a.h.textStreams,a.j.preferredText);d.length&&(c=d[0]);!c&&(b==null?0:b.audio)&&a.j.accessibility.handleForcedSubtitlesAutomatically&&(d=Pf(a.h.textStreams,b.audio.language,"",!0),d.length&&(c=d[0]));return c}
function pv(a,b,c){var d,e,f,g,h;return H(function(k){if(k.i==1)return d=a.j.streaming.segmentPrefetchLimit||2,e=new dt(d,b,function(l,m,n){return $t(l,m,n||null,a.j.streaming.retryParameters,a.Ma,a.H)},!1),a.G.set(b.id,e),b.segmentIndex?k.A(2):k.h(b.createSegmentIndex(),2);f=typeof a.B==="number"?a.B:0;(h=(g=b.segmentIndex.mb(f))?g.next().value:null)||(h=Hf(b.segmentIndex));return h?c?h.initSegmentReference?k.h(gt(e,h.initSegmentReference),0):k.A(0):k.h(ft(e,h.startTime),0):k.A(0)})}
function lv(a){var b,c,d,e,f,g,h,k,l,m,n,p,u;H(function(q){if(q.i==1){if(!a.i)return q.return();b=a.h.presentationTimeline.isLive();c=[];d=function(v){v&&(a.G.has(v.id)&&(nt(a.G.get(v.id)),a.G.delete(v.id)),v.segmentIndex&&v.closeSegmentIndex&&c.push(v.closeSegmentIndex()))};e=function(){var v=a.i;v=t([v.video,v.audio]);for(var w=v.next();!w.done;w=v.next())d(w.value);a.u=null};f=function(){d(a.u);a.u=null};g=a.m.getConfiguration();h={preferredAudio:a.j.preferredAudio,preferredVideo:a.j.preferredVideo,
language:"",role:"",videoRole:"",channelCount:0,hdrLevel:"",spatialAudio:!1,videoLayout:"",audioLabel:"",videoLabel:"",preferredAudioCodecs:[],preferredAudioChannelCount:0,codecSwitchingStrategy:a.j.mediaSource.codecSwitchingStrategy,audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,keySystem:kv(a)};Fu(h);pd(g)!=pd(h)&&(a.m.configure(h),e(),a.i=mv(a));a.i?(k=qv(a,a.i))?k!=a.u&&(f(),a.u=k):f():f();return q.h(Promise.all(c),2)}l=[];if(a.i){m=a.i;n=t([m.video,m.audio]);for(p=n.next();!p.done;p=
n.next())u=p.value,l.push(pv(a,u,b));a.u&&l.push(pv(a,a.u,b))}return q.h(Promise.all(l),0)})}function nv(a){var b,c,d,e;return H(function(f){b=[];c=t([a.video,a.audio]);for(d=c.next();!d.done;d=c.next())(e=d.value)&&!e.segmentIndex&&b.push(e.createSegmentIndex());return b.length>0?f.h(Promise.all(b),0):f.A(0)})}
function ov(a){var b,c,d,e;return H(function(f){b=[];c=t([a.video,a.audio]);for(d=c.next();!d.done;d=c.next())(e=d.value)&&e.segmentIndex&&e.closeSegmentIndex&&b.push(e.closeSegmentIndex());return b.length>0?f.h(Promise.all(b),0):f.A(0)})}r.Dl=function(){return this.C.promise};
r.destroy=function(){var a=this,b,c,d;return H(function(e){if(e.i==1)return a.F=!0,!a.o||a.ua?e.A(2):e.h(a.o.stop(),2);if(e.i!=4)return a.D&&a.D.release(),a.M&&!a.Ba&&a.M.release(),a.Aa||a.V.release(),!a.l||a.Y?e.A(4):e.h(a.l.destroy(),4);if(a.G.size>0&&!a.Da)for(b=t(a.G.values()),c=b.next();!c.done;c=b.next())d=c.value,nt(d);e.l()})};function kv(a){return Zb(a.l?a.l.Sb():null)}
function iv(a){function b(c){return c.video&&c.audio||c.video&&c.video.codecs.includes(",")}a.variants.some(b)&&(a.variants=a.variants.filter(b))}K("shaka.media.PreloadManager",Uu);Uu.prototype.destroy=Uu.prototype.destroy;Uu.prototype.waitForFinish=Uu.prototype.Dl;Uu.prototype.getPrefetchedTextTrack=Uu.prototype.Tj;Uu.prototype.getPrefetchedVariantTrack=Uu.prototype.Uj;function rv(a){uk.call(this);this.h=a;this.i=null}ta(rv,uk);rv.prototype.release=function(){this.h=null;uk.prototype.release.call(this)};rv.prototype.l=function(a){if(this.h&&(a=this.h.gg(a))){var b=a.Fg-a.start;this.i!=null&&Math.abs(b-this.i)>.5&&this.dispatchEvent(new tk("change",new Map([["programDateTime",new Date(a.Fg*1E3)],["timestamp",a.start]])));this.i=b}};function sv(a,b){uk.call(this);var c=this;this.j=a;this.m=b;this.h=new Map;this.o=[{Oc:null,Nc:tv,Bc:function(d,e){return uv(c,"enter",d,e)}},{Oc:vv,Nc:tv,Bc:function(d,e){return uv(c,"enter",d,e)}},{Oc:wv,Nc:tv,Bc:function(d,e){return uv(c,"enter",d,e)}},{Oc:tv,Nc:vv,Bc:function(d,e){return uv(c,"exit",d,e)}},{Oc:tv,Nc:wv,Bc:function(d,e){return uv(c,"exit",d,e)}},{Oc:vv,Nc:wv,Bc:function(d,e){e?uv(c,"skip",d,e):(uv(c,"enter",d,e),uv(c,"exit",d,e))}},{Oc:wv,Nc:vv,Bc:function(d,e){return uv(c,"skip",
d,e)}}];this.i=new ib;this.i.J(this.j,"regionremove",function(d){c.h.delete(d.region)})}ta(sv,uk);sv.prototype.release=function(){this.j=null;this.h.clear();this.i.release();this.i=null;uk.prototype.release.call(this)};
sv.prototype.l=function(a,b){if(!this.m||a!=0){this.m=!1;for(var c=t(this.j.h.values()),d=c.next();!d.done;d=c.next()){d=d.value;var e=this.h.get(d),f=a<d.startTime?vv:a>d.endTime?wv:tv;this.h.set(d,f);for(var g=t(this.o),h=g.next();!h.done;h=g.next())h=h.value,h.Oc==e&&h.Nc==f&&h.Bc(d,b)}}};function uv(a,b,c,d){b=new tk(b,new Map([["region",c],["seeking",d]]));a.dispatchEvent(b)}var vv=1,tv=2,wv=3;function xv(){}xv.prototype.parse=function(a){function b(h,k){k&&d.push({key:h,description:"",data:k,mimeType:null,pictureType:null})}function c(h,k){return Fb(a.subarray(e+h,e+h+k)).replace(/\0/g,"").trim()}var d=[],e=a.length-128;if(e<0||a[e]!==84||a[e+1]!==65||a[e+2]!==71)return d;b("TIT2",c(3,30));b("TPE1",c(33,30));b("TALB",c(63,30));b("TYER",c(93,4));var f="",g=null;a[e+125]===0?(f=c(97,28),g=a[e+126]):f=c(97,30);b("COMM",f);g!==null&&b("TRCK",String(g));b("TCON",String(a[e+127]));return d};
K("shaka.metadata.Id3V1Utils",xv);xv.prototype.parse=xv.prototype.parse;for(var yv=t(we),zv=yv.next();!zv.done;zv=yv.next())ai(zv.value,function(){return new xv});function Av(){}Av.prototype.parse=function(a){var b=[];(new hh).ma(["moov","udta"],mh).P("meta",mh).box("ilst",function(c){for(;c.reader.Wa()&&!(c.reader.Na()-c.reader.Ia()<8);){var d=c.reader.R(),e=lh(c.reader.R());if(d<8)break;d=c.reader.wa(Math.min(d-8,c.reader.Na()-c.reader.Ia()),!1);(e=e==="----"?Bv(d):Cv(e,d))&&b.push(e)}}).parse(a);return b};
function Bv(a){var b="",c="",d=null;(new hh).P("mean",function(e){b=Fb(e.reader.wa(e.reader.Na()-e.reader.Ia(),!1))}).P("name",function(e){c=Fb(e.reader.wa(e.reader.Na()-e.reader.Ia(),!1))}).P("data",function(e){d=Dv(e)}).parse(a);return d&&c?{key:c,data:d.data,description:b?"Domain: "+b:"",mimeType:d.mimeType,pictureType:d.pictureType}:null}
function Cv(a,b){var c=Ev.get(a)||a,d=null;(new hh).P("data",function(e){e=Dv(e,a);d={key:c,data:e.data,description:"",mimeType:e.mimeType,pictureType:e.pictureType}}).parse(b);return d}
function Dv(a,b){b=b===void 0?"":b;a.reader.skip(4);var c=a.reader.wa(a.reader.Na()-a.reader.Ia(),!1);if((b==="trkn"||b==="disk")&&c.length>=6)return a=Bb(c),c=a.getUint16(2,!1),a=a.getUint16(4,!1),{data:a>0?c+"/"+a:""+c,mimeType:null,pictureType:null};switch(a.flags){case 13:return{data:xb(c),mimeType:"image/jpeg",pictureType:3};case 14:return{data:xb(c),mimeType:"image/png",pictureType:3};case 21:a=Bb(c);switch(c.length){case 1:a=a.getInt8(0);break;case 2:a=a.getInt16(0,!1);break;case 3:a=c[0]<<
16|c[1]<<8|c[2];a&8388608&&(a|=-16777216);break;case 4:a=a.getInt32(0,!1);break;default:for(a=0,c=t(c),b=c.next();!b.done;b=c.next())a=a<<8|b.value}return{data:a,mimeType:null,pictureType:null};default:return{data:Fb(c).replace(/\0/g,""),mimeType:null,pictureType:null}}}K("shaka.metadata.IlstUtils",Av);Av.prototype.parse=Av.prototype.parse;
var Ev=(new Map).set("\u00a9nam","TIT2").set("\u00a9ART","TPE1").set("aART","TPE2").set("\u00a9alb","TALB").set("\u00a9gen","TCON").set("\u00a9day","TDRC").set("\u00a9wrt","TEXT").set("trkn","TRCK").set("disk","TPOS").set("\u00a9cmt","COMM").set("covr","APIC").set("cprt","TCOP").set("\u00a9too","TENC").set("tmpo","TBPM").set("cpil","TCMP");ai("audio/mp4",function(){return new Av});function Fv(){}
Fv.prototype.parse=function(a){if(a.length>=4&&a[0]==102&&a[1]==76&&a[2]==97&&a[3]==67){for(var b=[],c=4;c+4<=a.length;){var d=a[c],e=!!(d&128),f=d&127;d=a[c+1]<<16|a[c+2]<<8|a[c+3];c+=4;if(c+d>a.length)break;var g=a.subarray(c,c+d);f==4&&b.push.apply(b,wa(Gv(g)));if(f==6){try{var h=new Zg(g,0),k=h.R(),l=h.R(),m=Fb(h.wa(l,!0)),n=h.R(),p=Fb(h.wa(n,!0));h.skip(16);var u=h.R(),q=h.wa(u,!0);var v={key:"APIC",data:xb(q),description:p,mimeType:m,pictureType:k}}catch(w){v=null}(f=v)&&b.push(f)}c+=d;if(e)break}return b}return a.length>=
4&&a[0]==79&&a[1]==103&&a[2]==103&&a[3]==83&&(b=Fb(a),c=b.indexOf("OpusTags"),c<0&&(c=b.indexOf("vorbis")),c>=0)?Gv(a.subarray(c+8)):[]};function Gv(a){var b=[];try{var c=new Zg(a,$g),d=c.R();c.skip(d);var e=c.R();for(a=0;a<e;a++){var f=c.R(),g=Fb(c.wa(f,!1)),h=g.indexOf("=");if(!(h<0)){var k=g.substring(0,h).toUpperCase();b.push({key:Hv[k]||k,data:g.substring(h+1),description:"",mimeType:null,pictureType:null})}}}catch(l){}return b}K("shaka.metadata.VorbisUtils",Fv);Fv.prototype.parse=Fv.prototype.parse;
var Hv={TITLE:"TIT2",ARTIST:"TPE1",ALBUM:"TALB",ALBUMARTIST:"TPE2",TRACKNUMBER:"TRCK",DISCNUMBER:"TPOS",DATE:"TDRC",GENRE:"TCON",COMMENT:"COMM",DESCRIPTION:"TIT3",COPYRIGHT:"TCOP",COMPOSER:"TCOM",LYRICS:"USLT",ISRC:"TSRC"};ai("audio/flac",function(){return new Fv});ai("audio/ogg",function(){return new Fv});ai("audio/vorbis",function(){return new Fv});ai("audio/opus",function(){return new Fv});function Iv(a){return a>=200&&a<=299&&a!=202||a==304}function Jv(a,b,c,d,e,f,g){if(Iv(c))return{uri:e||d,originalUri:d,data:b,status:c,headers:a,fromCache:!!a["x-shaka-from-cache"],originalRequest:f};f=null;try{f=Ib(b)}catch(h){}throw new L(1,1,1001,d,c,f,a,g,e||d);};function Kv(){}
function Lv(a,b,c,d,e,f){var g=new gw;try{Xk(b.headers).forEach(function(m,n){g.append(n,m)})}catch(m){return pk(new L(1,1,1002,a,m,c))}var h=new hw,k={yh:!1,Pi:!1};a=iw(a,b,c,{body:b.body||void 0,headers:g,method:b.method,signal:h.signal,credentials:b.allowCrossSiteCredentials?"include":void 0},k,d,e,b.streamDataCallback,f.minBytesForProgressEvents||0);a=new ok(a,function(){k.yh=!0;h.abort();return Promise.resolve()});if(b=b.retryParameters.timeout){var l=new $e(function(){k.Pi=!0;h.abort()});l.ha(b/
1E3);a.finally(function(){l.stop()})}return a}
function iw(a,b,c,d,e,f,g,h,k){var l,m,n,p,u,q,v,w,y,x,z,D,B,A,E;return H(function(C){switch(C.i){case 1:return l=jw,m=kw,p=new ArrayBuffer(0),q=u=0,v={},w=Date.now(),C.o(2),C.h(l(a,d),4);case 4:n=C.j;v=lw(n.headers);g(v);Iv(n.status)||(h=null);if(d.method=="HEAD"){C.A(5);break}x=(y=n.headers.get("Content-Length"))?parseInt(y,10):0;if(!n.body)return C.h(n.arrayBuffer(),9);z=n.clone().body.getReader();D=function(F){function G(){var J,Q,O,V;return H(function(M){switch(M.i){case 1:return M.o(2),M.h(z.read(),
4);case 4:J=M.j;M.u(3);break;case 2:return M.m(),M.return();case 3:if(J.done){M.A(5);break}u+=J.value.byteLength;if(!h){M.A(5);break}return M.h(h(J.value),5);case 5:Q=Date.now();O=u-q;if(Q-w>100&&O>=k||J.done)V=J.done?0:x-u,f(Q-w,O,V),q=u,w=Q;J.done?F.close():(F.enqueue(J.value),G());M.l()}})}G()};new m({start:D});return C.h(n.arrayBuffer(),8);case 8:p=C.j;C.A(5);break;case 9:p=C.j,B=Date.now(),f(B-w,p.byteLength,0);case 5:b.headers.Range&&(A=b.headers.Range.replace("bytes=","").split("-").filter(function(F){return F}).map(function(F){return parseInt(F,
10)}),A.length==2&&p.byteLength!=A[1]-A[0]+1&&Wa("Payload length does not match range requested bytes",b,n));C.u(3);break;case 2:E=C.m();if(e.yh)throw new L(1,1,7001,a,c);if(e.Pi)throw new L(1,1,1003,a,c);throw new L(1,1,1002,a,E,c);case 3:return C.return(Jv(v,p,n.status,a,n.url,b,c))}})}function lw(a){var b={};a.forEach(function(c,d){b[d.trim()]=c});return b}
function mw(){if(window.ReadableStream)try{new ReadableStream({})}catch(a){return!1}else return!1;if(window.Response){if(!(new Response("")).body)return!1}else return!1;return!(!window.fetch||"polyfill"in window.fetch||!window.AbortController)}K("shaka.net.HttpFetchPlugin",Kv);Kv.isSupported=mw;Kv.parse=Lv;var jw=window.fetch,hw=window.AbortController,kw=window.ReadableStream,gw=window.Headers;mw()&&(Gk("http",Lv,2,!0),Gk("https",Lv,2,!0),Gk("blob",Lv,2,!0));function nw(){}
function ow(a,b,c,d,e,f){var g=new pw,h=Date.now(),k=0,l=new Promise(function(m,n){function p(){g.onload=null;g.onerror=null;g.ontimeout=null;g.onabort=null;g.onreadystatechange=null;g.onprogress=null}g.open(b.method,a,!0);g.responseType="arraybuffer";g.timeout=b.retryParameters.timeout;g.withCredentials=b.allowCrossSiteCredentials;var u={};g.onabort=function(){n(new L(1,1,7001,a,c));p()};g.onreadystatechange=function(){if(g.readyState===XMLHttpRequest.HEADERS_RECEIVED){var v=g.getAllResponseHeaders().trim().split("\r\n"),w=
{};v=t(v);for(var y=v.next();!y.done;y=v.next()){y=y.value;var x=y.indexOf(": ");x!==-1&&(w[y.slice(0,x).toLowerCase()]=y.slice(x+2))}u=w;e(u)}};g.onload=function(){var v=g.response;try{var w=Jv(u,v,g.status,a,g.responseURL,b,c);m(w)}catch(y){n(y)}p()};g.onerror=function(v){n(new L(1,1,1002,a,v,c));p()};g.ontimeout=function(){n(new L(1,1,1003,a,c));p()};g.onprogress=function(v){var w=Date.now(),y=f.minBytesForProgressEvents||0,x=v.loaded-k;if(w-h>100&&x>=y||v.lengthComputable&&v.loaded==v.total)d(w-
h,x,g.readyState==4?0:v.total-v.loaded),k=v.loaded,h=w};for(var q in b.headers)try{g.setRequestHeader(q.toLowerCase(),b.headers[q])}catch(v){throw new L(1,1,1002,a,v,c);}g.send(b.body)});return new ok(l,function(){g.abort();return Promise.resolve()})}K("shaka.net.HttpXHRPlugin",nw);nw.parse=ow;var pw=window.XMLHttpRequest;Gk("http",ow,1,!0);Gk("https",ow,1,!0);Gk("blob",ow,1,!0);for(var qw={ach:"Lwo",ady:"\u0410\u0434\u044b\u0433\u044d\u0431\u0437\u044d",af:"Afrikaans","af-NA":"Afrikaans (Namibia)","af-ZA":"Afrikaans (South Africa)",ak:"T\u0255\u0265i",ar:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-AR":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-MA":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","ar-SA":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629)","ay-BO":"Aymar aru",az:"Az\u0259rbaycan dili","az-AZ":"Az\u0259rbaycan dili",
"be-BY":"\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f",bg:"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438","bg-BG":"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438",bn:"\u09ac\u09be\u0982\u09b2\u09be","bn-IN":"\u09ac\u09be\u0982\u09b2\u09be (\u09ad\u09be\u09b0\u09a4)","bn-BD":"\u09ac\u09be\u0982\u09b2\u09be(\u09ac\u09be\u0982\u09b2\u09be\u09a6\u09c7\u09b6)","bs-BA":"Bosanski",ca:"Catal\u00e0","ca-ES":"Catal\u00e0",cak:"Maya Kaqchikel","ck-US":"\u13e3\u13b3\u13a9 (tsalagi)",
cs:"\u010ce\u0161tina","cs-CZ":"\u010ce\u0161tina",cy:"Cymraeg","cy-GB":"Cymraeg",da:"Dansk","da-DK":"Dansk",de:"Deutsch","de-AT":"Deutsch (\u00d6sterreich)","de-DE":"Deutsch (Deutschland)","de-CH":"Deutsch (Schweiz)",dsb:"Dolnoserb\u0161\u0107ina",el:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac","el-GR":"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac",en:"English","en-GB":"English (UK)","en-AU":"English (Australia)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-IN":"English (India)",
"en-PI":"English (Pirate)","en-UD":"English (Upside Down)","en-US":"English (US)","en-ZA":"English (South Africa)","en@pirate":"English (Pirate)",eo:"Esperanto","eo-EO":"Esperanto",es:"Espa\u00f1ol","es-AR":"Espa\u00f1ol (Argentine)","es-419":"Espa\u00f1ol (Latinoam\u00e9rica)","es-CL":"Espa\u00f1ol (Chile)","es-CO":"Espa\u00f1ol (Colombia)","es-EC":"Espa\u00f1ol (Ecuador)","es-ES":"Espa\u00f1ol (Espa\u00f1a)","es-LA":"Espa\u00f1ol (Latinoam\u00e9rica)","es-NI":"Espa\u00f1ol (Nicaragua)","es-MX":"Espa\u00f1ol (M\u00e9xico)",
"es-US":"Espa\u00f1ol (Estados Unidos)","es-VE":"Espa\u00f1ol (Venezuela)",et:"eesti keel","et-EE":"Eesti (Estonia)",eu:"Euskara","eu-ES":"Euskara",fa:"\u0641\u0627\u0631\u0633\u06cc","fa-IR":"\u0641\u0627\u0631\u0633\u06cc","fb-LT":"Leet Speak",ff:"Fulah",fi:"Suomi","fi-FI":"Suomi","fo-FO":"F\u00f8royskt",fr:"Fran\u00e7ais","fr-CA":"Fran\u00e7ais (Canada)","fr-FR":"Fran\u00e7ais (France)","fr-BE":"Fran\u00e7ais (Belgique)","fr-CH":"Fran\u00e7ais (Suisse)","fy-NL":"Frysk",ga:"Gaeilge","ga-IE":"Gaeilge (Gaelic)",
gl:"Galego","gl-ES":"Galego","gn-PY":"Ava\u00f1e'\u1ebd","gu-IN":"\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0","gx-GR":"\u1f19\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ae \u1f00\u03c1\u03c7\u03b1\u03af\u03b1",he:"\u05e2\u05d1\u05e8\u05d9\u05ea\u200f","he-IL":"\u05e2\u05d1\u05e8\u05d9\u05ea\u200f",hi:"\u0939\u093f\u0928\u094d\u0926\u0940","hi-IN":"\u0939\u093f\u0928\u094d\u0926\u0940",hr:"Hrvatski","hr-HR":"Hrvatski",hsb:"Hornjoserb\u0161\u0107ina",ht:"Krey\u00f2l",hu:"Magyar","hu-HU":"Magyar","hy-AM":"\u0540\u0561\u0575\u0565\u0580\u0565\u0576",
id:"Bahasa Indonesia","id-ID":"Bahasa Indonesia",is:"\u00cdslenska","is-IS":"\u00cdslenska (Iceland)",it:"Italiano","it-IT":"Italiano",ja:"\u65e5\u672c\u8a9e","ja-JP":"\u65e5\u672c\u8a9e","jv-ID":"Basa Jawa","ka-GE":"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8","kk-KZ":"\u049a\u0430\u0437\u0430\u049b\u0448\u0430",km:"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a","km-KH":"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a",kab:"Taqbaylit",kn:"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1","kn-IN":"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1 (India)",
ko:"\ud55c\uad6d\uc5b4","ko-KR":"\ud55c\uad6d\uc5b4 (\u97e9\u56fd)",ku:"Kurd\u00ee","ku-TR":"Kurd\u00ee",la:"Latin","la-VA":"Latin",lb:"L\u00ebtzebuergesch","li-NL":"L\u00e8mb\u00f6rgs",lt:"Lietuvi\u0173","lt-LT":"Lietuvi\u0173",lv:"Latvie\u0161u","lv-LV":"Latvie\u0161u",mai:"\u092e\u0948\u0925\u093f\u0932\u0940, \u09ae\u09c8\u09a5\u09bf\u09b2\u09c0","mg-MG":"Malagasy",mk:"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438","mk-MK":"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438 (\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438)",
ml:"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02","ml-IN":"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02","mn-MN":"\u041c\u043e\u043d\u0433\u043e\u043b",mr:"\u092e\u0930\u093e\u0920\u0940","mr-IN":"\u092e\u0930\u093e\u0920\u0940",ms:"Bahasa Melayu","ms-MY":"Bahasa Melayu",mt:"Malti","mt-MT":"Malti",my:"\u1017\u1019\u102c\u1005\u1000\u102c",nb:"Norsk (bokm\u00e5l)","nb-NO":"Norsk (bokm\u00e5l)",ne:"\u0928\u0947\u092a\u093e\u0932\u0940","ne-NP":"\u0928\u0947\u092a\u093e\u0932\u0940",nl:"Nederlands","nl-BE":"Nederlands (Belgi\u00eb)",
"nl-NL":"Nederlands (Nederland)","nn-NO":"Norsk (nynorsk)",no:"Norsk",oc:"Occitan","or-IN":"\u0b13\u0b21\u0b3c\u0b3f\u0b06",pa:"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40","pa-IN":"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40 (\u0a2d\u0a3e\u0a30\u0a24 \u0a28\u0a42\u0a70)",pl:"Polski","pl-PL":"Polski","ps-AF":"\u067e\u069a\u062a\u0648",pt:"Portugu\u00eas","pt-BR":"Portugu\u00eas (Brasil)","pt-PT":"Portugu\u00eas (Portugal)","qu-PE":"Qhichwa","rm-CH":"Rumantsch",ro:"Rom\u00e2n\u0103","ro-RO":"Rom\u00e2n\u0103",ru:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439",
"ru-RU":"\u0420\u0443\u0441\u0441\u043a\u0438\u0439","sa-IN":"\u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d","se-NO":"Davvis\u00e1megiella","si-LK":"\u0db4\u0dc5\u0dcf\u0dad",sk:"Sloven\u010dina","sk-SK":"Sloven\u010dina (Slovakia)",sl:"Sloven\u0161\u010dina","sl-SI":"Sloven\u0161\u010dina","so-SO":"Soomaaliga",sq:"Shqip","sq-AL":"Shqip",sr:"\u0421\u0440\u043f\u0441\u043a\u0438","sr-RS":"\u0421\u0440\u043f\u0441\u043a\u0438 (Serbia)",su:"Basa Sunda",sv:"Svenska","sv-SE":"Svenska",sw:"Kiswahili",
"sw-KE":"Kiswahili",ta:"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd","ta-IN":"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd",te:"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41","te-IN":"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41",tg:"\u0437\u0430\u0431\u043e\u0301\u043d\u0438 \u0442\u043e\u04b7\u0438\u043a\u04e3\u0301","tg-TJ":"\u0442\u043e\u04b7\u0438\u043a\u04e3",th:"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22","th-TH":"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22 (\u0e1b\u0e23\u0e30\u0e40\u0e17\u0e28\u0e44\u0e17\u0e22)",tl:"Filipino","tl-PH":"Filipino",
tlh:"tlhIngan-Hol",tr:"T\u00fcrk\u00e7e","tr-TR":"T\u00fcrk\u00e7e","tt-RU":"\u0442\u0430\u0442\u0430\u0440\u0447\u0430",uk:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430","uk-UA":"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",ur:"\u0627\u0631\u062f\u0648","ur-PK":"\u0627\u0631\u062f\u0648",uz:"O'zbek","uz-UZ":"O'zbek",vi:"Ti\u1ebfng Vi\u1ec7t","vi-VN":"Ti\u1ebfng Vi\u1ec7t","xh-ZA":"isiXhosa",yi:"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9","yi-DE":"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9 (German)",
zh:"\u4e2d\u6587","zh-HANS":"\u4e2d\u6587\u7b80\u4f53","zh-HANT":"\u4e2d\u6587\u7e41\u9ad4","zh-CN":"\u4e2d\u6587\uff08\u4e2d\u56fd\uff09","zh-HK":"\u4e2d\u6587\uff08\u9999\u6e2f\uff09","zh-SG":"\u4e2d\u6587\uff08\u65b0\u52a0\u5761\uff09","zh-TW":"\u4e2d\u6587\uff08\u53f0\u7063\uff09","zu-ZA":"isiZulu",ase:"American Sign Language",bfi:"British Sign Language",bzs:"Brazilian Sign Language",csn:"Colombian Sign Language",dse:"Dutch Sign Language",dsl:"Danish Sign Language",fsl:"French Sign Language",
gsg:"German Sign Language",gss:"Greek Sign Language",isg:"Irish Sign Language",ise:"Italian Sign Language",jsl:"Japanese Sign Language",mfs:"Mexican Sign Language",ncs:"Nicaraguan Sign Language",nsl:"Norwegian Sign Language",psr:"Portuguese Sign Language",sfb:"French Belgian Sign Language",sfs:"South African Sign Language",sgg:"Swiss German Sign Language",ssp:"Spanish Sign Language",swl:"Swedish Sign Language",vgt:"Flemish Sign Language"},rw=t(Object.keys(qw)),sw=rw.next();!sw.done;sw=rw.next()){var tw=
sw.value;qw[tw.toLowerCase()]=qw[tw]};function uw(a,b){if(a.lineBreak)return"\n";if(a.nestedCues.length)return a.nestedCues.map(function(g){return uw(g,a)}).join("");if(!a.payload)return a.payload;var c=[],d=a.fontWeight>=de,e=a.fontStyle==ee,f=a.textDecoration.includes(fe);d&&c.push(["b"]);e&&c.push(["i"]);f&&c.push(["u"]);e=a.color;e==""&&b&&(e=b.color);d="";(e=vw(e))&&(d+="."+e);e=a.backgroundColor;e==""&&b&&(e=b.backgroundColor);(b=vw(e))&&(d+=".bg_"+b);d&&c.push(["c",d]);return c.reduceRight(function(g,h){var k=t(h);h=k.next().value;
k=k.next().value;return"<"+h+(k===void 0?"":k)+">"+g+"</"+h+">"},a.payload)}
function vw(a){a=a.toLowerCase();var b=a.replace(/\s/g,"").match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i);b?a="#"+(parseInt(b[1],10)|256).toString(16).slice(1)+(parseInt(b[2],10)|256).toString(16).slice(1)+(parseInt(b[3],10)|256).toString(16).slice(1):a.startsWith("#")&&a.length>7&&(a=a.slice(0,7));switch(a){case "white":case "#fff":case "#ffffff":return"white";case "lime":case "#0f0":case "#00ff00":return"lime";case "cyan":case "#0ff":case "#00ffff":return"cyan";case "red":case "#f00":case "#ff0000":return"red";
case "yellow":case "#ff0":case "#ffff00":return"yellow";case "magenta":case "#f0f":case "#ff00ff":return"magenta";case "blue":case "#00f":case "#0000ff":return"blue";case "black":case "#000":case "#000000":return"black"}return null}
function ww(a){a=a.trim().toLowerCase();xw.has(a)&&(a=xw.get(a));var b=a.match(/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/);if(b){a=b[1];a.length<=4&&(a=a.split("").map(function(g){return g+g}).join(""));b=[];for(var c=0;c<a.length;c+=2)b.push(parseInt(a.slice(c,c+2),16));b.length==3?b.push(1):b[3]/=255;return b}if(a=a.match(/^rgba?\(([^)]*)\)$/)){a=a[1].trim().split(/\s*[,/]\s*|\s+/);if(a.length<3||a.length>4)return null;b=[];for(c=0;c<a.length;c++){var d=a[c],e=d.endsWith("%"),f=Number(e?d.slice(0,
-1):d);if(!d||isNaN(f))return null;c<3?(f=e?f*255/100:f,b.push(Math.min(255,Math.max(0,f)))):(f=e?f/100:f,b.push(Math.min(1,Math.max(0,f))))}b.length==3&&b.push(1);return b}return null}function yw(a,b){return(a=ww(a))?"rgba("+a.slice(0,3).join(", ")+", "+Math.min(1,Math.max(0,b))+")":null}
function zw(a,b){var c=[];a=t(Aw(a));for(var d=a.next();!d.done;d=a.next())if(d=d.value,d.isContainer)c.push.apply(c,wa(zw(d.nestedCues,d)));else{var e=d.clone();e.nestedCues=[];e.payload=uw(d,b);c.push(e)}return c}function Aw(a){var b=[];a=t(a);for(var c=a.next(),d={};!c.done;d={Ef:void 0},c=a.next())d.Ef=c.value,b.some(function(e){return function(f){return Wd(e.Ef,f)}}(d))||b.push(d.Ef);return b}
function Bw(a,b){function c(e){for(var f=5381,g=e.length;g;)f=f*33^e.charCodeAt(--g);return(f>>>0).toString()}if(a.startTime>=a.endTime)return null;var d=new VTTCue(a.startTime,a.endTime,a.payload);d.id=c(a.startTime.toString())+c(a.endTime.toString())+c(a.payload);d.lineAlign=a.lineAlign;d.positionAlign=a.positionAlign;a.size&&(d.size=a.size);try{d.align=a.textAlign}catch(e){}a.textAlign=="center"&&d.align!="center"&&(d.align="middle");a.writingMode=="vertical-lr"?d.vertical="lr":a.writingMode==
"vertical-rl"&&(d.vertical="rl");a.lineInterpretation==1&&(d.snapToLines=!1);a.line!=null&&(d.line=a.line);a.position!=null&&(d.position=a.position);b&&(a=Cw(b,a.region))&&(d.region=a);return d}
function Cw(a,b){if(!(window.VTTRegion&&"region"in VTTCue.prototype&&b&&b.id&&b.heightUnits==2&&b.widthUnits==bd&&b.viewportAnchorUnits==bd))return null;var c=[b.id,b.width,b.height,b.regionAnchorX,b.regionAnchorY,b.viewportAnchorX,b.viewportAnchorY,b.scroll].join("_"),d=a.get(c);d||(d=new VTTRegion,d.id=b.id,d.width=b.width,d.lines=b.height,d.regionAnchorX=b.regionAnchorX,d.regionAnchorY=b.regionAnchorY,d.viewportAnchorX=b.viewportAnchorX,d.viewportAnchorY=b.viewportAnchorY,d.scroll=b.scroll,a.set(c,
d));return d}
function Dw(a,b,c){var d=zw(b),e=[];b=a.cues?Array.from(a.cues):[];d=t(d);for(var f=d.next(),g={};!f.done;g={$c:void 0},f=d.next())g.$c=f.value,!b.some(function(h){return function(k){return k.startTime==h.$c.startTime&&k.endTime==h.$c.endTime&&k.text==h.$c.payload}}(g))&&g.$c.payload&&(f=Bw(g.$c,c))&&e.push(f);c=e.slice().sort(function(h,k){return h.startTime!=k.startTime?h.startTime-k.startTime:h.endTime!=k.endTime?h.endTime-k.startTime:h.region&&k.region?e.indexOf(h)-e.indexOf(k):"line"in VTTCue.prototype?
e.indexOf(k)-e.indexOf(h):e.indexOf(h)-e.indexOf(k)});c=t(c);for(b=c.next();!b.done;b=c.next())a.addCue(b.value)}function Ew(a,b){var c=!1;a.mode==="disabled"&&(c=!0,a.mode="hidden");for(var d=0;d<a.cues.length;){var e=a.cues[d];b(e)?a.removeCue(e):d++}c&&(a.mode="disabled")}
function Fw(a){function b(d){d.line=c.line;d.lineAlign=c.lineAlign;d.position=c.position;d.positionAlign=c.positionAlign;d.size=c.size;d.displayAlign=c.displayAlign;d.region=c.region;d=t(d.nestedCues);for(var e=d.next();!e.done;e=d.next())b(e.value)}var c=new Ld(0,0,"");b(a)}
var xw=new Map([["transparent","#0000"],["black","#000"],["silver","#c0c0c0"],["gray","#808080"],["grey","#808080"],["white","#fff"],["maroon","#800000"],["red","#f00"],["purple","#800080"],["fuchsia","#f0f"],["magenta","#f0f"],["green","#008000"],["lime","#0f0"],["olive","#808000"],["yellow","#ff0"],["navy","#000080"],["blue","#00f"],["teal","#008080"],["aqua","#0ff"],["cyan","#0ff"]]);function Gw(a){var b=this;this.i=a;this.u=new ib;this.o=new ib;this.l=this.D=null;this.h=new Map;this.B=new Map;this.j=-1;this.C=!1;this.m=null;this.u.J(a,"loaded",function(){return Hw(b)});Hw(this)}r=Gw.prototype;r.configure=function(a){this.D=a};r.remove=function(a,b){if(!this.i)return!1;var c=Iw(this);c&&Ew(c,function(d){return d.startTime<b&&d.endTime>a});return!0};
r.append=function(a){var b=Iw(this);if(b){var c,d,e=(d=(c=this.D)==null?void 0:c.subtitleDelay)!=null?d:0;a=e!==0?a.map(function(f){f=f.clone();f.startTime=Math.max(0,f.startTime+e);f.endTime=Math.max(0,f.endTime+e);return f}):a;c=this.B.getOrInsert(b,new Map);Dw(b,a,c)}};r.destroy=function(){this.i&&(this.l&&Jw(this),this.i=null);this.B.clear();var a;(a=this.m)==null||a.stop();this.m=null;var b;(b=this.u)==null||b.release();this.u=null;var c;(c=this.o)==null||c.release();this.o=null;return Promise.resolve()};
r.isTextVisible=function(){return this.C};r.setTextVisibility=function(a){this.C=a;var b=Iw(this);b?b.mode!=="disabled"&&(a=a?"showing":"hidden",b.mode!==a&&(b.mode=a)):this.i&&this.i.dg()===Kw&&Lw(this,a)};r.setTextLanguage=function(){};function Jw(a){var b;(b=a.m)==null||b.stop();a.m=null;var c;(c=a.o)==null||c.Ta();b=t(a.h.values());for(c=b.next();!c.done;c=b.next())c.value.remove();a.h.clear();a.B.clear();a.j=-1;a.l=null}
function Mw(a){var b=new Map,c=a.i.qb();c=t(c);for(var d=c.next();!d.done;d=c.next()){d=d.value;if(a.h.has(d.id)){var e=a;var f=e.h.get(d.id);d.active||f.track.mode==="disabled"||(f.track.mode="disabled");e.h.delete(d.id);e=f}else{e=a;f=e.l.ownerDocument.createElement("track");var g=ob();g=d.forced&&g.Ea()==="WEBKIT"?"forced":d.kind==="caption"?"captions":"subtitles";f.kind=g;f.label=Nw(d);var h=void 0;g=d.language?d.language in qw?d.language:(h=rc(d.language))!=null?h:"und":"und";f.srclang=g;f.src=
"data:,WEBVTT";f.track.mode="disabled";e.l.appendChild(f);e=f}b.set(d.id,e);d.active&&(a.j=d.id)}c=t(a.h.values());for(d=c.next();!d.done;d=c.next())d=d.value,a.B.delete(d.track),d.remove();a.h=b;a.j<=-1||(a.h.has(a.j)?(b=a.h.get(a.j).track,b.mode==="disabled"&&(b.mode=a.C?"showing":"hidden")):a.j=-1)}
function Ow(a){if(!a.m){var b=a.l;a.m=(new $e(function(){a.m=null;if(a.l===b){a:{var c=-1;if(a.h.has(a.j)){var d=a.h.get(a.j).track.mode;if(d==="showing"){c=a.j;break a}d==="hidden"&&(c=a.j)}d=t(a.h.keys());for(var e=d.next();!e.done;e=d.next()){e=e.value;var f=a.h.get(e);if(f.track.mode==="showing"){c=e;break a}c<0&&f.track.mode==="hidden"&&(c=e)}}d=a.h.get(c);e=t(a.h.values());for(f=e.next();!f.done;f=e.next())f=f.value,f!==d&&f.track.mode!=="disabled"&&(f.track.mode="disabled");a.j!==c&&(a.j=c,
Pw(a,c))}})).ha(0)}}function Iw(a){return a.h.has(a.j)?a.h.get(a.j).track:null}function Lw(a,b){a=Array.from(a.i.Xc().textTracks).filter(function(c){return["captions","subtitles","forced"].includes(c.kind)});if(b)!a.some(function(c){return c.mode==="showing"})&&(b=a.find(function(c){return c.mode==="hidden"}))&&(b.mode="showing");else for(b=t(a),a=b.next();!a.done;a=b.next())a=a.value,a.mode==="showing"&&(a.mode="hidden")}
function Pw(a,b){if(b>-1){var c=a.i.qb().find(function(d){return d.id===b});if(c){a.i.Jc(c);return}}a.i.Jc(null)}function Hw(a){!a.l&&a.i&&a.i.dg()===Qw&&(a.l=a.i.Xc(),a.u.Ra(a.i,"unloading",function(){return Jw(a)}),a.o.J(a.i,"textchanged",function(){return Mw(a)}),a.o.J(a.l.textTracks,"change",function(){return Ow(a)}),Mw(a))}
function Nw(a){if(a.label)return a.label;if(a.language){var b=rc(a.language);if(window.Intl&&"DisplayNames"in Intl)try{var c=(new Intl.DisplayNames(a.language,{type:"language",languageDisplay:"standard"})).of(a.language);if(c&&c.toLowerCase()!=a.language.toLowerCase())return c.charAt(0).toUpperCase()+c.slice(1)}catch(e){}if(c=qw[a.language])return c;if(c=b&&qw[b])return b===a.language?c:c+" ("+a.language+")"}var d;b=String((d=a.originalTextId)!=null?d:"");return a.language&&a.language!==a.originalTextId?
b+" ("+a.language+")":b}K("shaka.text.NativeTextDisplayer",Gw);Gw.prototype.setTextLanguage=Gw.prototype.setTextLanguage;Gw.prototype.setTextVisibility=Gw.prototype.setTextVisibility;Gw.prototype.isTextVisible=Gw.prototype.isTextVisible;Gw.prototype.destroy=Gw.prototype.destroy;Gw.prototype.append=Gw.prototype.append;Gw.prototype.remove=Gw.prototype.remove;Gw.prototype.configure=Gw.prototype.configure;var Qw=2,Kw=3;function Rw(a){var b=this;this.m=a;this.u=null;this.l=new ib;this.I=Sw.value();this.h=null;this.B=!1;this.C=new Tw;this.L=new $e(function(){Uw(b)});this.K=1E15;this.G=Vw(this);this.j=[this.G];this.F=this.H=this.i=this.o=null;this.D=new Ww(this.C,this.L,function(c){if(b.B&&b.h){var d=b.u.maxTextLength;if(!(c.length<=d)){for(d=c.length-d;d>0&&c[d-1]!==" ";)d--;c="..."+c.slice(d).trimStart()}var e;(e=b.i)!=null&&e.i&&(e.h||(e.h=document.createElement("span"),e.h.setAttribute("translate","no"),e.h.style.backgroundColor=
"rgba(0,0,0,0.8)",e.h.style.padding="0px 5px",e.h.style.margin="2.5% 5%",e.i.appendChild(e.h)),e.h.textContent=c)}},function(){var c;(c=b.i)!=null&&c.h&&(c.h.textContent="")})}r=Rw.prototype;r.configure=function(a){this.u=a;Xw(this)};r.release=function(){this.o=null;this.l.Ta();Yw(this);this.m=null;this.l.release();var a;(a=this.i)==null||a.release();this.h&&this.h.parentElement&&(this.h.remove(),this.h=null)};
r.enable=function(a){var b=this;this.I&&(this.h||(this.h=Zw(this)),this.h&&(this.i||(this.i=new $w(this.h)),this.B&&a.id==this.o||(this.B=!0,this.o=a.id,this.l.J(this.m,"audiotrackschanged",function(){Uw(b)}),a=this.m.Xc(),this.l.J(a,"seeking",function(){Uw(b)}),this.l.J(a,"pause",function(){Yw(b,!1)}),this.l.J(a,"play",function(){Uw(b)}),a.paused||Uw(this))))};
r.disable=function(){if(this.B){this.B=!1;this.o=null;this.l.Ta();Yw(this);var a;(a=this.i)==null||a.release();this.i=null;this.C.release();this.D.release()}};r.isSupported=function(){if(!this.I)return!1;this.h||(this.h=Zw(this));return this.h?!0:!1};r.qb=function(){if(!this.isSupported())return[];for(var a=t(this.j),b=a.next();!b.done;b=a.next())b=b.value,b.active=b.id==this.o;return this.j};
function Uw(a){var b,c,d,e,f,g,h,k;H(function(l){switch(l.i){case 1:(b=a.i)!=null&&b.h&&(b.h.textContent="");c=a.m.getAudioTracks();if(!c.length)return l.return();d=ax(a);if(!d)return l.return();e=c.find(function(m){return m.active});f="en";e&&e.language&&e.language!="und"&&(f=e.language);g=a.j.find(function(m){return m.id==a.o});h="";g&&g.language&&g.language!="und"&&(h=g.language);if(!a.D.isActive()||a.H!==f||a.F===h){l.A(2);break}a.F=h;return l.h(bx(a.C,f,h),3);case 3:return l.return();case 2:return Yw(a),
l.o(4),l.h(bx(a.C,f,h),6);case 6:l.u(5);break;case 4:if(k=l.m(),k.name=="NotSupportedError")return l.return();case 5:return l.h(a.D.start(d,f,a.u.processLocally),7);case 7:a.H=f,a.F=h,l.l()}})}function Yw(a,b){a.D.stop(b===void 0?!0:b)}
function ax(a){var b=a.m.Xc();return b?cx.getOrInsertComputed(b,function(){var c=new (window.AudioContext||window.webkitAudioContext),d=c.createMediaElementSource(b),e=c.createMediaStreamDestination();d.connect(e);d.connect(c.destination);var f=e.stream.getAudioTracks()[0];return{tm:c,Nm:d,Dm:e,cj:f}}).cj:null}
function Zw(a){a=a.m.pd;if(!a)return null;var b=document.createElement("div");b.classList.add("shaka-speech-to-text-container");b.style.textAlign="center";b.style.display="flex";b.style.flexDirection="column";b.style.alignItems="center";b.style.justifyContent="flex-end";a.appendChild(b);return b}
function Xw(a){var b=a.j.map(function(e){return e.language}).filter(function(e){return e});if(!eb(a.u.languagesToTranslate,b)&&"Translator"in window){a.j=a.j.filter(function(e){if(e.id==a.G.id||a.u.languagesToTranslate.includes(e.language))return!0;e.id==a.o&&a.disable();return!1});b=t(a.u.languagesToTranslate);for(var c=b.next(),d={};!c.done;d={pg:void 0},c=b.next())d.pg=c.value,c=a.j.find(function(e){return function(f){return f.language==e.pg}}(d)),c||(c=Vw(a),c.language=d.pg,a.j.push(c));b=new tk("textchanged");
a.m.dispatchEvent(b)}}function Vw(a){return{id:a.K++,active:!1,type:zc,bandwidth:0,language:"",label:null,kind:null,mimeType:null,codecs:null,primary:!1,roles:[],accessibilityPurpose:null,forced:!1,originalTextId:null,originalLanguage:"speech-to-text"}}
var cx=new Map,Sw=new nb(function(){var a=document.body.appendChild(document.createElement("iframe"));var b=a.contentWindow;b=b.SpeechRecognition||b.webkitSpeechRecognition;if(!b)return a.remove(),!1;b=new b;a.remove();try{return b.start(0),b.stop(),!1}catch(c){return c.name=="TypeError"}});function $w(a){this.i=a;this.h=null}$w.prototype.release=function(){this.i&&Kj(this.i);this.h=null};function Ww(a,b,c,d){this.o=a;this.j=b;this.B=c;this.u=d;this.i=new ib;this.m=null;this.h=0;this.l=!1}
Ww.prototype.start=function(a,b,c){var d=this,e,f,g,h,k;return H(function(l){switch(l.i){case 1:d.stop();d.h++;e=d.h;d.l=!0;f=window.SpeechRecognition||window.webkitSpeechRecognition;g=new f;d.m=g;g.lang=b;g.continuous=!0;g.interimResults=!0;if(!(c&&"install"in f&&"available"in f)){l.A(2);break}l.o(3);return l.h(f.available({langs:[b],processLocally:!0}),5);case 5:h=l.j;switch(h){case "available":g.processLocally=!0;break;case "downloading":case "downloadable":return l.A(6);default:return l.return()}l.A(7);
break;case 6:return l.h(f.install({langs:[b],processLocally:!0}),8);case 8:g.processLocally=!0;l.A(7);break;case 7:l.u(2);break;case 3:l.m();case 2:if(e!==d.h)return l.return();k=!1;d.i.J(g,"start",function(){e===d.h&&d.j.ha(5)});d.i.J(g,"result",function(m){var n,p,u,q;return H(function(v){if(v.i==1){if(e!==d.h)return v.return();n=m;p="";for(u=n.resultIndex;u<n.results.length;u++)p+=n.results[u][0].transcript;return v.h(dx(d.o,p),2)}q=v.j;if(q===null||e!==d.h)return v.return();d.B(q);d.j.ha(.75);
v.l()})});d.i.J(g,"error",function(m){e===d.h&&(k=!0,d.u(),m.error=="network"&&d.j.ha(30))});d.i.J(g,"end",function(){d.l&&e===d.h&&(k||d.start(a,b,c))});g.start(a);l.l()}})};Ww.prototype.stop=function(a){a=a===void 0?!0:a;this.h++;this.l=!1;this.i.Ta();this.j.stop();this.m&&(this.m.stop(),this.m=null);a&&this.u()};Ww.prototype.release=function(){this.stop();this.o.release()};Ww.prototype.isActive=function(){return this.l};function Tw(){this.i=this.h=null;this.o=this.m=0;this.l=this.j=null}
function bx(a,b,c){var d,e,f;return H(function(g){if(g.i==1){if(a.j===b&&a.l===c&&a.h)return g.return();a.release();a.m++;d=a.m;if(!(c&&b!=c&&"Translator"in window))return g.return();a.i=new AbortController;g.o(2);return g.h(Translator.create({sourceLanguage:b,targetLanguage:c,signal:a.i.signal}),4)}if(g.i!=2){e=g.j;if(d!==a.m)return e.destroy(),g.return();a.h=e;a.j=b;a.l=c;return g.u(0)}f=g.m();if(f.name=="NotSupportedError")throw f;g.l()})}
function dx(a,b){var c,d;return H(function(e){if(e.i==1){if(!a.h)return e.return(b);a.o++;c=a.o;e.o(2);return e.h(a.h.translate(b),4)}if(e.i!=2)return d=e.j,c!==a.o?e.return(null):e.return(d);e.m();return e.return(null)})}Tw.prototype.release=function(){var a;(a=this.i)==null||a.abort();this.i=null;var b;(b=this.h)==null||b.destroy();this.l=this.j=this.h=null};function ex(){}r=ex.prototype;r.configure=function(){};r.remove=function(){};r.append=function(){};r.destroy=function(){};r.isTextVisible=function(){return!1};r.setTextVisibility=function(){};r.setTextLanguage=function(){};K("shaka.text.StubTextDisplayer",ex);ex.prototype.setTextLanguage=ex.prototype.setTextLanguage;ex.prototype.setTextVisibility=ex.prototype.setTextVisibility;ex.prototype.isTextVisible=ex.prototype.isTextVisible;ex.prototype.destroy=ex.prototype.destroy;ex.prototype.append=ex.prototype.append;
ex.prototype.remove=ex.prototype.remove;ex.prototype.configure=ex.prototype.configure;function fx(a){var b=this;this.u=!1;this.j=[];this.V=a;this.l=a.Xc();this.i=a.pd;this.F=null;this.G=!1;this.Y=!0;this.C=this.H=this.O=null;this.M=!1;this.h=document.createElement("div");this.h.classList.add("shaka-text-container");this.h.style.textAlign="center";this.h.style.display="flex";this.h.style.flexDirection="column";this.h.style.alignItems="center";this.h.style.justifyContent="flex-end";this.B=new $e(function(){gx(b);hx(b)});hx(this);this.D=new $e(function(){ix(b)});this.o=new Map;this.m=
new ib;this.m.J(document,"fullscreenchange",function(){gx(b,!0)});this.m.J(this.l,"seeking",function(){gx(b,!0);hx(b)});this.m.Jb(this.l,["play","playing","pause","waiting"],function(){hx(b)});this.m.J(this.V,"ratechange",function(){hx(b)});this.m.J(this.l,"resize",function(){var c=b.l,d=c.videoWidth;c=c.videoHeight;d&&c?b.F=d/c:b.F=null});this.T=!1;this.L=null;"ResizeObserver"in window&&(this.L=new ResizeObserver(function(){b.T||(b.T=!0,requestAnimationFrame(function(){b.T=!1;b.h&&b.h.parentElement&&
b.u&&gx(b,!0)}))}),this.L.observe(this.i));this.K=new Map;this.I=new Map;this.N=null;"IntersectionObserver"in window&&(this.N=new IntersectionObserver(function(c){c.length&&(c=c[c.length-1],b.Y=c.isIntersecting&&c.intersectionRatio>0,b.D.ha(.25))},{root:null,threshold:[.01]}),this.N.observe(this.i));this.m.J(document,"visibilitychange",function(){b.D.hb()});Oj(this.m,this.l,function(){return b.D.hb()});a=this.l;(a.webkitPresentationMode||a.webkitSupportsFullscreen)&&this.m.J(a,"webkitpresentationmodechanged",
function(){b.D.hb()});ix(this)}r=fx.prototype;r.configure=function(a){this.O=a;hx(this);ix(this);gx(this,!0)};r.jl=function(a,b){this.H=Object.assign({},a);this.C=new Ld(Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,b);gx(this,!0)};r.jj=function(){if(this.H||this.C)this.C=this.H=null,this.M=!1,gx(this,!0)};
r.append=function(a){var b=[].concat(wa(this.j));a=t(Aw(a));for(var c=a.next(),d={};!c.done;d={Ff:void 0},c=a.next())d.Ff=c.value,b.some(function(e){return function(f){return Wd(f,e.Ff)}}(d))||this.j.push(d.Ff);this.j.length&&hx(this);gx(this)};
r.destroy=function(){if(!this.h)return Promise.resolve();this.h.parentElement&&this.i.removeChild(this.h);this.h=null;this.u=!1;this.j=[];this.C=this.H=null;this.M=!1;var a;(a=this.B)==null||a.stop();this.B=null;var b;(b=this.D)==null||b.stop();this.D=null;this.o.clear();var c;(c=this.m)==null||c.release();this.m=null;var d;(d=this.L)==null||d.disconnect();this.L=null;var e;(e=this.N)==null||e.disconnect();this.N=null;return Promise.resolve()};
r.remove=function(a,b){if(!this.h)return!1;var c=this.j.length;this.j=this.j.filter(function(d){return d.startTime<a||d.endTime>=b});gx(this,c>this.j.length);this.j.length||hx(this);return!0};r.isTextVisible=function(){return this.u};r.setTextVisibility=function(a){(this.u=a)?(this.h.parentElement||this.i.appendChild(this.h),gx(this,!0)):this.h.parentElement&&this.i.removeChild(this.h)};r.setTextLanguage=function(a){a&&a!="und"?this.h.setAttribute("lang",a):this.h.setAttribute("lang","")};
function hx(a){if(a.B)if(!a.j.length||a.G||a.l.paused)a.B.stop();else{var b,c,d=(c=(b=jx(a))==null?void 0:b.subtitleDelay)!=null?c:0;b=a.l.currentTime-d;c=1;d=kx(a,a.j,b);d!=null&&a.l.readyState>=HTMLMediaElement.HAVE_FUTURE_DATA&&(c=Math.min(c,Math.max(0,d-b)));a.B.ha(Math.max(lx,c/(Math.abs(a.V.Ha())||1)))}}
function kx(a,b,c){function d(g){g>c&&(e==null||g<e)&&(e=g)}var e=null;b=t(b);for(var f=b.next();!f.done;f=b.next())f=f.value,d(f.startTime),d(f.endTime),f.nestedCues.length&&(f=kx(a,f.nestedCues,c),f!=null&&d(f));return e}function jx(a){return a.H||a.O}
function ix(a){var b=a.l,c=!1;window.documentPictureInPicture&&window.documentPictureInPicture.window?c=!0:document.pictureInPictureElement===b&&(c=!0);var d=!1;document.fullscreenEnabled&&document.fullscreenElement===a.i?d=!0:b.webkitSupportsFullscreen&&(d=b.webkitDisplayingFullscreen);b=document.visibilityState==="visible";var e,f;(f=(e=a.O)==null?void 0:e.suspendRenderingWhenHidden)!=null&&!f||c||d||b&&a.Y?a.G&&(a.G=!1,hx(a),requestAnimationFrame(function(){a.h&&a.h.parentElement&&a.u&&gx(a)})):
a.G||(a.G=!0,a.B&&a.B.stop())}function mx(a,b){for(;b!=null;){if(b==a.h)return!0;b=b.parentElement}return!1}function nx(a,b,c){var d=b,e=a.o.get(b)||null;if(!e&&c&&c.positionArea!=0){c=t(a.o.keys());for(var f=c.next();!f.done;f=c.next())f=f.value,Wd(b,f)&&(d=f,e=a.o.get(f))}return{key:d,pi:e}}
function ox(a,b,c,d,e){var f=jx(a),g=!1,h=[],k=[],l=new Set;b=t(b);for(var m=b.next();!m.done;m=b.next()){m=m.value;e.push(m);var n=nx(a,m,f),p=n.key;n=n.pi;var u=m.startTime<=d&&m.endTime>d,q=n?n.Ti:null;n&&(h.push(n.zd),n.lc&&h.push(n.lc),u||(g=!0,a.o.delete(p),n=null));u&&(k.push(m),n?mx(a,q)||(g=!0):(px(a,m,e),l.add(m),n=a.o.get(p),q=n.Ti,g=!0));m.nestedCues.length>0&&q&&ox(a,m.nestedCues,q,d,e);e.pop()}if(g){d=t(h);for(g=d.next();!g.done;g=d.next())g=g.value,g.parentElement&&g.parentElement.removeChild(g);
e.length||k.sort(function(v,w){return v.startTime!=w.startTime?v.startTime-w.startTime:v.endTime-w.endTime});e=new Map;k=t(k);for(d=k.next();!d.done;d=k.next())g=d.value,d=nx(a,g,f).pi,d.lc?(d.lc.contains(c)&&d.lc.removeChild(c),c.appendChild(d.lc),d.lc.appendChild(d.zd),l.has(g)&&g.region.scroll=="up"&&(g=d.lc,e.has(g)||e.set(g,[]),e.get(g).push(d.zd))):c.appendChild(d.zd);a=t(e.keys());for(c=a.next();!c.done;c=a.next())c=c.value,qx(c,e.get(c))}}
function rx(a,b,c){return b.some(function(d){return d.startTime<=c&&d.endTime>c&&sx(a,d)})}function sx(a,b){return!!b.payload.replace(/[\u00a0\u200B]/g," ").trim()||!!b.backgroundImage||b.nestedCues.some(function(c){return sx(a,c)})}
function gx(a,b){b=b===void 0?!1:b;if(a.h&&!a.G){var c=jx(a),d,e=(d=c==null?void 0:c.subtitleDelay)!=null?d:0;d=a.l.currentTime-e;e=!!a.C&&(!a.u||!rx(a,a.j,d));e!=a.M&&(b=!0,a.M=e);e&&(b=!0);var f=a.u||e;f?a.h.parentElement||a.i.appendChild(a.h):a.h.parentElement&&a.i.removeChild(a.h);if(!f||b){b=t(a.K.values());for(var g=b.next();!g.done;g=b.next())Kj(g.value);Kj(a.h);a.o.clear();a.K.clear();a.I.clear()}f&&(b=e&&a.C?[a.C]:a.j,c&&c.positionArea!=0&&(b=b.map(function(h){var k=jx(a);h=h.clone();Fw(h);
h.region=tx.value();switch(k.positionArea){case 1:h.textAlign="left";h.displayAlign="before";break;case 2:h.textAlign=Nd;h.displayAlign="before";break;case 3:h.textAlign="right";h.displayAlign="before";break;case 4:h.textAlign="left";h.displayAlign="center";break;case 5:h.textAlign=Nd;h.displayAlign="center";break;case 6:h.textAlign="right";h.displayAlign="center";break;case 7:h.textAlign="left";h.displayAlign=Sd;break;case 8:h.textAlign=Nd;h.displayAlign=Sd;break;case 9:h.textAlign="right",h.displayAlign=
Sd}return h})),ox(a,b,a.h,d,[]),ux(a))}}function vx(a){var b=a.heightUnits==bd?"%":"px";a.heightUnits==2&&(b="lines");return a.id+"_"+a.width+"x"+a.height+b+"-"+a.viewportAnchorX+"x"+a.viewportAnchorY+(a.viewportAnchorUnits==bd?"%":"px")+"-"+a.regionAnchorX+"x"+a.regionAnchorY+"-"+a.backgroundColor+"-"+a.opacity+"-"+a.padding+"-"+a.overflow+"-"+a.zIndex}
function wx(a,b){var c=b.region,d=a.F===4/3?2.5:1.9,e=vx(c);if(a.K.has(e))return a.K.get(e);var f=document.createElement("span"),g=c.heightUnits==bd?"%":"px",h=c.widthUnits==bd?"%":"px",k=c.viewportAnchorUnits==bd?"%":"px";f.id="shaka-text-region---"+e;f.classList.add("shaka-text-region");f.style.position="absolute";var l=c.width;c.widthUnits===2&&(l=c.width*d,h="%");f.style.width=l+h;d=c.heightUnits===2;h="";var m=0;d?(h=jx(a),h=xx(b.fontSize||"1em",b,a.i,h?h.fontScaleFactor:1),m=c.height*1.4,f.style.height=
"calc("+m+" * "+h+")",f.style.lineHeight="1.4"):f.style.height=c.height+g;var n=k;c.viewportAnchorUnits===2?(k=c.viewportAnchorY/75*100,g=c.viewportAnchorX/(a.F===4/3?160:210)*100,n="%"):(k=c.viewportAnchorY,g=c.viewportAnchorX);g-=c.regionAnchorX*l/100;f.style.left=g+n;d?f.style.top="calc("+k+n+" - "+c.regionAnchorY/100*m+" * "+h+")":(k-=c.regionAnchorY*c.height/100,f.style.top=k+n);c.heightUnits!==0&&c.widthUnits!==0&&c.viewportAnchorUnits!==0&&(f.style.left=Math.max(0,Math.min(100-(parseInt(f.style.width.slice(0,
-1),10)||0),g))+"%",d||(f.style.top=Math.max(0,Math.min(100-(parseInt(f.style.height.slice(0,-1),10)||0),k))+"%"));f.style.display="flex";f.style.flexDirection="column";f.style.alignItems="center";f.style.justifyContent=yx(b.displayAlign);c.backgroundColor&&a.I.set(f,c.backgroundColor);c.opacity!=1&&(f.style.opacity=String(c.opacity));if(c.padding&&!d){f.style.boxSizing="border-box";var p=a.i;f.style.padding=c.padding.split(" ").map(function(u,q){var v=q%2;q=v?c.width:c.height;v=(v?c.widthUnits:c.heightUnits)!=
bd?100:v?p.clientWidth:p.clientHeight;return u.endsWith("%")?parseFloat(u)*q*v/1E4+"px":u}).join(" ")}c.overflow&&(f.style.overflow=c.overflow);c.zIndex!=null&&(f.style.zIndex=String(c.zIndex),a.h.style.isolation="isolate");c.scroll=="up"&&(f.style.justifyContent="flex-end",f.style.overflow="hidden");a.K.set(e,f);return f}
function ux(a){if(a.I.size){for(var b=[],c=t(a.o.keys()),d=c.next();!d.done;d=c.next())d=d.value,d.nestedCues.length||b.push(a.o.get(d).zd);c=t(a.I.keys());var e=c.next();for(d={};!e.done;d={bf:void 0},e=c.next())d.bf=e.value,e=b.some(function(f){return function(g){return f.bf.contains(g)}}(d)),d.bf.style.backgroundColor=e?a.I.get(d.bf):""}}
function qx(a,b){var c=Array.from(a.childNodes);if(!(c.length<=b.length)){a=0;b=t(b);for(var d=b.next();!d.done;d=b.next())a+=d.value.offsetHeight;if(a)for(c=t(c),b=c.next();!b.done;b=c.next())b=b.value,b.animate&&b.animate([{transform:"translateY("+a+"px)"},{transform:"translateY(0)"}],{duration:433,easing:"ease"})}}
function px(a,b,c){var d=c.length>1,e=d?"span":"div";b.lineBreak&&(e="br");b.rubyTag&&(e=b.rubyTag);d=!d&&b.nestedCues.length>0;var f=document.createElement(e);e!="br"&&zx(a,f,b,c,d);c=null;b.region&&b.region.id&&(c=wx(a,b));e=f;d&&(e=document.createElement("span"),e.classList.add("shaka-text-wrapper"),Ax(jx(a))||(e.style.backgroundColor=b.backgroundColor),e.style.lineHeight="normal",f.appendChild(e));a.o.set(b,{zd:f,Ti:e,lc:c})}
function Bx(a,b,c,d){b=b.color;d&&d.fontColor&&(b=d.fontColor);if(!d||isNaN(d.fontOpacity))return b;if(!b){if(c)return"";b=window.getComputedStyle(a.h).color}return yw(b,d.fontOpacity)||b}function Cx(a,b,c){if(!Ax(c))return a||(b?"rgba(0, 0, 0, 0.8)":"");if(!b)return"";a=c.backgroundColor||a||"rgba(0, 0, 0, 0.8)";return isNaN(c.backgroundOpacity)?a:yw(a,c.backgroundOpacity)||a}function Ax(a){return!!a&&(!!a.backgroundColor||!isNaN(a.backgroundOpacity))}
function Dx(a,b){var c=b?b.characterEdgeStyle:0;if(c!=0){var d=b&&!isNaN(b.fontOpacity)?b.fontOpacity:1;b="rgba(34, 34, 34, "+d+")";var e="rgba(204, 204, 204, "+d+")";d=[];switch(c){case 2:c=t([3,4,5]);for(e=c.next();!e.done;e=c.next())d.push("0.0625em 0.0625em "+(e.value/32+"em ")+b);break;case 3:c=t([1,2,3]);for(e=c.next();!e.done;e=c.next())e=e.value,d.push(e/32+"em "+(e/32+"em ")+b);break;case 4:d.push("0.03125em 0.03125em "+e);d.push("-0.03125em -0.03125em "+b);break;case 5:for(c=0;c<5;c++)d.push("0 0 0.0625em "+
b)}a.textShadow=d.length?d.join(", "):"none";a.webkitTextStrokeWidth="0"}}
function Ex(a,b,c){var d=[],e=c.slice().reverse().find(function(l){return l.textStrokeWidth}),f=e?Fx(Gx(a,e.textStrokeWidth,b)):null;if(f&&f.value>0)for(var g=e.textStrokeColor||Hx(c,function(l){return l.color})||"currentColor",h=0;h<16;h++){var k=h*2*Math.PI/16;d.push((""+Number((f.value*Math.cos(k)).toFixed(3))+f.unit+" "+Number((f.value*Math.sin(k)).toFixed(3))+f.unit+" 0 "+g).trim())}(c=Hx(c,function(l){return l.textShadow}))&&c!="none"&&d.push(Gx(a,c,b));return d.length?d.join(", "):e||c?"none":
""}function Gx(a,b,c){var d=a.i;return b.replace(/(^|[\s,(])(-?\d*\.?\d+)(c|rw|rh)(?=[\s,)]|$)/g,function(e,f,g,h){e=Number(g);g=d.clientHeight*e/100;h=="c"?g=d.clientHeight*e/c.cellResolution.rows:h=="rw"&&(g=d.clientWidth*e/100);return f+g+"px"})}function Ix(a){var b=a.direction,c=a.positionAlign;a=a.textAlign;return c!==Md?c:a==="left"||a==="start"&&b===Od||a==="end"&&b==="rtl"?"line-left":a==="right"||a==="start"&&b==="rtl"||a==="end"&&b===Od?"line-right":"center"}
function zx(a,b,c,d,e){var f=b.style,g=c.nestedCues.length==0,h=d.length>1,k=jx(a),l=c.payload.replace(/\s+$/g,function(n){return"\u00a0".repeat(n.length)});f.whiteSpace=c.wrapLine?/[\t\r\f]| {2}|(^|\n) | \n/.test(l)?"pre-wrap":"pre-line":"pre";f.color=Bx(a,c,h,k);f.direction=c.direction;f.opacity=c.opacity;f.paddingLeft=xx(c.linePadding,c,a.i);f.paddingRight=xx(c.linePadding,c,a.i);f.textCombineUpright=c.textCombineUpright;f.visibility=c.visibility;f.textShadow=Ex(a,c,d);Dx(f,k);if(c.backgroundImage)f.backgroundImage=
"url('"+c.backgroundImage.replace(/['"()\\]/g,"")+"')",f.backgroundRepeat="no-repeat",f.backgroundSize="contain",f.backgroundPosition="center",c.backgroundColor&&(f.backgroundColor=c.backgroundColor),f.width="100%",f.height="100%";else{if(c.nestedCues.length)var m=b;else m=document.createElement("span"),b.appendChild(m);c.border&&(m.style.border=c.border);!e&&(b=Cx(Hx(d,function(n){return n.backgroundColor}),!!l,k))&&(m.style.backgroundColor=b);l&&(m.setAttribute("translate","no"),m.textContent=l)}if(h&&
!d[d.length-1].isContainer)f.display="inline";else{f.display="flex";f.flexDirection="column";f.alignItems="center";if(c.textAlign=="left"||c.textAlign=="start")f.width="100%",f.alignItems="flex-start";else if(c.textAlign=="right"||c.textAlign=="end")f.width="100%",f.alignItems="flex-end";f.justifyContent=yx(c.displayAlign)}g||(f.margin="0");f.fontFamily=(k==null?void 0:k.fontFamily)||c.fontFamily;f.fontWeight=c.fontWeight.toString();f.fontStyle=c.fontStyle;f.letterSpacing=c.letterSpacing;d=k?k.fontScaleFactor:
1;if(h)c.fontSize&&(h=Fx(c.fontSize),f.fontSize=xx(c.fontSize,c,a.i,h&&h.unit=="em"?1:d));else if(d!==1||c.fontSize)f.fontSize=xx(c.fontSize||"1em",c,a.i,d);h=c.line;h!=null?(d=c.lineInterpretation,d==Qd&&(d=1,g=16,a.F&&a.F<1&&(g=32),h=h<0?100+h/g*100:h/g*100),d==1&&(f.position="absolute",c.writingMode==Pd?(f.width="100%",c.lineAlign==Rd?f.top=h+"%":c.lineAlign=="end"&&(f.bottom=100-h+"%")):c.writingMode=="vertical-lr"?(f.height="100%",c.lineAlign==Rd?f.left=h+"%":c.lineAlign=="end"&&(f.right=100-
h+"%")):(f.height="100%",c.lineAlign==Rd?f.right=h+"%":c.lineAlign=="end"&&(f.left=100-h+"%")))):c.writingMode!=Pd&&(f.position="absolute",f.top="0",f.height="100%",c.writingMode=="vertical-lr"?f.right="0":f.left="0");f.lineHeight=Gx(a,c.lineHeight,c);a=Ix(c);a=="line-left"?(f.cssFloat="left",c.position!==null&&(f.position="absolute",c.writingMode==Pd?(f.left=c.position+"%",f.width="auto"):f.top=c.position+"%")):a=="line-right"?(f.cssFloat="right",c.position!==null&&(f.position="absolute",c.writingMode==
Pd?(f.right=100-c.position+"%",f.width="auto"):f.bottom=c.position+"%")):c.position!==null&&c.position!=50&&(f.position="absolute",c.writingMode==Pd?(f.left=c.position+"%",f.width="auto"):f.top=c.position+"%",c.size&&(f.transform="translateX(-50%)"));f.textAlign=c.textAlign;f.textDecoration=c.textDecoration.join(" ");f.writingMode=c.writingMode;"writingMode"in document.documentElement.style&&f.writingMode==c.writingMode||(f.webkitWritingMode=c.writingMode);c.size&&(h=c.position,h==null&&(h=c.textAlign==
"left"?0:c.textAlign=="right"?100:50),a=Math.min(c.size,a=="line-left"?100-h:a=="line-right"?h:h<=50?h*2:(100-h)*2),c.writingMode==Pd?f.width=a+"%":f.height=a+"%")}function Fx(a){return(a=(new RegExp(/(\d*\.?\d+)([a-z]+|%+)/)).exec(a))?{value:Number(a[1]),unit:a[2]}:null}
function xx(a,b,c,d){d=d===void 0?1:d;var e=Fx(a);if(!e)return a;a=e.unit;d*=e.value;switch(a){case "%":return d/100*c.clientHeight/b.cellResolution.rows+"px";case "c":return c.clientHeight*d/b.cellResolution.rows+"px";default:return d+a}}function Hx(a,b){for(var c=a.length-1;c>=0;c--){var d=b(a[c]);if(d||d===0)return d}return null}function yx(a){switch(a){case "before":return"flex-start";case "center":return"center";default:return"flex-end"}}K("shaka.text.UITextDisplayer",fx);
fx.prototype.setTextLanguage=fx.prototype.setTextLanguage;fx.prototype.setTextVisibility=fx.prototype.setTextVisibility;fx.prototype.isTextVisible=fx.prototype.isTextVisible;fx.prototype.remove=fx.prototype.remove;fx.prototype.destroy=fx.prototype.destroy;fx.prototype.append=fx.prototype.append;fx.prototype.clearTextStylePreview=fx.prototype.jj;fx.prototype.setTextStylePreview=fx.prototype.jl;fx.prototype.configure=fx.prototype.configure;
var lx=1/60,tx=new nb(function(){var a=new ad;a.id="shaka-custom-region";a.height=90;a.width=90;a.viewportAnchorX=5;a.viewportAnchorY=5;return a});function Jx(a,b){function c(g){var h=[];switch(g.textAlign){case "left":h.push("align:left");break;case "right":h.push("align:right");break;case Nd:h.push("align:middle");break;case "start":h.push("align:start");break;case "end":h.push("align:end")}switch(g.writingMode){case "vertical-lr":h.push("vertical:lr");break;case "vertical-rl":h.push("vertical:rl")}return h.length?" "+h.join(" "):""}function d(g){for(var h=g,k=t(b),l=k.next();!l.done;l=k.next())l=l.value,l.end&&l.start<g&&(h+=l.end-l.start);
g=Math.floor(h/3600);k=Math.floor(h/60%60);l=Math.floor(h%60);h=Math.floor(h*1E3%1E3);return(g<10?"0":"")+g+":"+(k<10?"0":"")+k+":"+(l<10?"0":"")+l+"."+(h<100?h<10?"00":"0":"")+h}var e=zw(a);a="WEBVTT\n\n";e=t(e);for(var f=e.next();!f.done;f=e.next())f=f.value,a+=d(f.startTime)+" --\x3e "+d(f.endTime)+c(f)+"\n",a+=f.payload+"\n\n";return a}K("shaka.text.WebVttGenerator",function(){});/*
 @license
 Copyright 2024 Streaming Video Technology Alliance
 SPDX-License-Identifier: Apache-2.0
*/
var Kx=["cen","e","h","ts"];var Lx="ab bg bl br bs bsa bsd bsda cdn cid cs d dfa dl ec lab lb ltc msd mtp nor nr ot pb pr pt rtp sf sid sn st sta su tab tb tbl tpb v".split(" ");var Mx="cmsdd cmsds rc smrt ttfb ttfbb ttlb url".split(" ");var Nx="bl br bs cid d dl mtp nor nrr ot pr rtp sf sid st su tb v".split(" ");var Ox=new Map([["ps","sta"],["pr","pr"],["c","cid"],["b","bg"],["bc","br"]]);function Px(a,b){Array.isArray(a)&&(a=a.map(function(c){return c instanceof Px?c:new Px(c)}));this.value=a;this.Vb=b}function Qx(a){this.description=a}function Rx(a,b){var c=Error;a=Array.isArray(a)?JSON.stringify(a):a instanceof Map?"Map{}":a instanceof Set?"Set{}":typeof a==="object"?JSON.stringify(a):String(a);return c('failed to serialize "'+a+'" as '+b,{cause:void 0})}
function Sx(a,b){if(a<0)return-Sx(-a,b);b=Math.pow(10,b);return Math.abs(a*b%1-.5)<Number.EPSILON?(a=Math.floor(a*b),(a%2===0?a:a+1)/b):Math.round(a*b)/b}function Tx(a){if(a<-999999999999999||999999999999999<a)throw Rx(a,"Integer");return a.toString()}var Ux=/[\x00-\x1f\x7f]+/;function Vx(a){a=a.description||a.toString().slice(7,-1);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(a)===!1)throw Rx(a,"Token");return a}
function Wx(a){switch(typeof a){case "number":if(!Number.isFinite(a))throw Rx(a,"Bare Item");if(Number.isInteger(a))a=Tx(a);else{var b=Sx(a,3);if(Math.floor(Math.abs(b)).toString().length>12)throw Rx(a,"Decimal");a=b.toString();a=a.includes(".")?a:a+".0"}return a;case "string":if(Ux.test(a))throw Rx(a,"String");return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"';case "symbol":return Vx(a);case "boolean":if(typeof a!=="boolean")throw Rx(a,"Boolean");return a?"?1":"?0";case "object":if(a instanceof
Date)return"@"+Tx(a.getTime()/1E3);if(a instanceof Uint8Array){if(ArrayBuffer.isView(a)===!1)throw Rx(a,"Byte Sequence");return":"+btoa(String.fromCharCode.apply(String,wa(a)))+":"}if(a instanceof Qx)return Vx(a);default:throw Rx(a,"Bare Item");}}function Xx(a){if(/^[a-z*][a-z0-9\-_.*]*$/.test(a)===!1)throw Rx(a,"Key");return a}function Yx(a){return a==null?"":Object.entries(a).map(function(b){var c=t(b);b=c.next().value;c=c.next().value;return c===!0?";"+Xx(b):";"+Xx(b)+"="+Wx(c)}).join("")}
function Zx(a){return a instanceof Px?Wx(a.value)+Yx(a.Vb):Wx(a)}
function $x(a){var b={Si:!1};b=b===void 0?{Si:!0}:b;if(typeof a!=="object"||a==null)throw Rx(a,"Dict");a=a instanceof Map?a.entries():Object.entries(a);b=b.Si?" ":"";return Array.from(a).map(function(c){c=t(c);var d=c.next().value;c=c.next().value;c instanceof Px===!1&&(c=new Px(c));d=Xx(d);c.value===!0?d+=Yx(c.Vb):(d+="=",Array.isArray(c.value)?(c="("+c.value.map(Zx).join(" ")+")"+Yx(c.Vb),c=d+c):c=d+Zx(c),d=c);return d}).join(","+b)};function ay(a,b){try{var c=new URL(a)}catch(f){return a}b=new URL(b);if(c.origin!==b.origin)return a;a=c.pathname.split("/").slice(1);b=b.pathname.split("/").slice(1,-1);for(var d=Math.min(a.length,b.length),e=0;e<d&&a[e]===b[e];e++)a.shift(),b.shift();for(;b.length;)b.shift(),a.unshift("..");return a.join("/")+c.search+c.hash};function by(a){return a instanceof Px?new Px(Math.round(a.value),a.Vb):Math.round(a)}function cy(a){return Array.isArray(a)?a.map(by):by(a)}function dy(a){if(a)try{var b=URL,c=new URL(a);var d=c.origin+c.pathname.substring(0,c.pathname.lastIndexOf("/")+1);return(new b(d)).href}catch(e){}}
function ey(a,b){if(Array.isArray(a))return a.map(function(d){return ey(d,b)});if(a instanceof Px&&typeof a.value==="string")return new Px(ey(a.value,b),a.Vb);var c=dy(b.le);c&&(a=ay(a,c));return b.version===1?encodeURIComponent(a):a}function fy(a){return a instanceof Px?new Px(Math.round(a.value/100)*100,a.Vb):Math.round(a/100)*100}function gy(a){return Array.isArray(a)?a.map(fy):fy(a)}
var hy={br:cy,d:cy,bl:gy,dl:gy,mtp:gy,nor:function(a,b){var c=a;b.version>=2&&(a instanceof Px&&typeof a.value==="string"?c=new Px([a]):typeof a==="string"&&(c=[a]));return ey(c,b)},rtp:gy,tb:cy};var iy=new Set("ab bl br bsa bsd bsda lab lb mtp pb tab tb tbl tpb".split(" "));var jy=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;var ky=new Set(Lx);function ly(a){return ky.has(a)||jy.test(a)};var my=new Set(Mx);var ny=new Set(Kx);var oy=new Set(Nx);function py(a){return oy.has(a)||jy.test(a)};var qy=new Set(["ot","sf","st","e","sta"]);function ry(a){return typeof a==="number"?Number.isFinite(a):a!=null&&a!==""&&a!==!1};var sy={},ty=(sy.event=function(a){return ly(a)||my.has(a)||ny.has(a)},sy.request=ly,sy);function uy(a,b){if(Array.isArray(a)){var c;b&&(c=a.find(function(d){return d&&d.Vb&&d.Vb.ot===b}));c||(c=a[0]);return uy(c)}return a instanceof Px?a.value:a}
function vy(a){for(var b={},c=t(Object.entries(a)),d=c.next();!d.done;d=c.next()){var e=t(d.value);d=e.next().value;e=e.next().value;e==null?b[d]=e:d==="nor"?(d=(Array.isArray(e)?e:[e])[0],d instanceof Px?(b.nor=d.value,(d=d.Vb)&&d.r&&(b.nrr=d.r)):b.nor=d):iy.has(d)?b[d]=uy(e,a.ot):b[d]=e}return b}
function wy(a,b){b=b||{};var c={};if(a==null||typeof a!=="object")return c;var d=b.version||a.v||2,e=b.Mg||"request";a=d===1?vy(a):a;var f=d===1?py:ty[e],g=Object.keys(a).filter(f);a.e&&a.e!=="rr"&&(g=g.filter(function(m){return!my.has(m)}));f=b.filter;typeof f==="function"&&(g=g.filter(f));if(f=e==="event"){var h=a.e;g.includes("e")||h==null||g.push("e");g.includes("ts")||g.push("ts");g.includes("cen")||a.cen==null||h!=="ce"||g.push("cen");(h=h?Ox.get(h):void 0)&&a[h]!=null&&!g.includes(h)&&g.push(h)}if(g.length===
0)return c;d>1&&!g.includes("v")&&g.push("v");e={version:d,Mg:e,le:b.le};g.sort();g=t(g);for(h=g.next();!h.done;h=g.next()){h=h.value;var k=a[h],l=b.tj&&b.tj[h]||hy[h];typeof l==="function"&&(k=l(k,e));if(h==="v")if(d===1)continue;else k=d;if(h!=="pr"||k!==1||f&&a.e==="pr")if(f&&h==="ts"&&!Number.isFinite(k)&&(k=Date.now()),l=f&&k===!1&&h==="bg"&&a.e==="b",ry(k)||l)qy.has(h)&&typeof k==="string"&&(k=new Qx(k)),c[h]=k}return c};var xy=/[!'()*]/g,yy=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDFFF]/g;function zy(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()}function Ay(a){return a.length===2?a:"\ufffd"};function By(a,b){var c=a.indexOf("#");c=c===-1?a.length:c;var d=a.indexOf("?");d=d===-1||d>c?c:d;var e=[];if(b){try{var f=encodeURIComponent(b)}catch(k){f=encodeURIComponent(b.replace(yy,Ay))}b="CMCD="+f.replace(xy,zy)}else b="";f=!1;for(var g=t(d<c?a.slice(d+1,c).split("&"):[]),h=g.next();!h.done;h=g.next())h=h.value,h==="CMCD"||h.startsWith("CMCD=")?(f=!0,b&&(e.push(b),b="")):e.push(h);if(b)e[e.length-1]===""&&e.pop(),e.push(b);else if(!f)return a;e=e.join("&");return a.slice(0,d)+(e?"?"+e:"")+
a.slice(c)};var Cy={sm:"CMCD-Object",br:"CMCD-Object",d:"CMCD-Object",Im:"CMCD-Object",Jm:"CMCD-Object",ot:"CMCD-Object",Qm:"CMCD-Object",tb:"CMCD-Object",Sm:"CMCD-Object",bl:"CMCD-Request",Am:"CMCD-Request",Em:"CMCD-Request",dl:"CMCD-Request",ltc:"CMCD-Request",mtp:"CMCD-Request",nor:"CMCD-Request",nrr:"CMCD-Request",Lm:"CMCD-Request",sn:"CMCD-Request",Ki:"CMCD-Request",su:"CMCD-Request",Rm:"CMCD-Request",cid:"CMCD-Session",msd:"CMCD-Session",sf:"CMCD-Session",sid:"CMCD-Session",st:"CMCD-Session",v:"CMCD-Session",
bg:"CMCD-Status",bs:"CMCD-Status",wm:"CMCD-Status",xm:"CMCD-Status",ym:"CMCD-Status",zm:"CMCD-Status",Gm:"CMCD-Status",Km:"CMCD-Status",pr:"CMCD-Status",pt:"CMCD-Status",rtp:"CMCD-Status"};function Dy(a){return Object.keys(a).reduce(function(b,c){var d=a[c];d&&d.forEach(function(e){return b[e]=c});return b},{})};function Ey(a,b,c){var d=new Set(b.Qb||[]);return{version:b.version||2,Mg:a,filter:function(e){return d.has(e)},le:c}}function Fy(a,b){if(a===b)return!0;if(a.length!==b.length)return!1;for(var c=0;c<a.length;c++){var d=a[c],e=b[c];if(d!==e){if(typeof d==="number"||typeof e==="number")return!1;var f=e;if(d.value!==f.value)return!1;e=d.params;d=f.params;f=e&&Object.keys(e)[0];var g=d&&Object.keys(d)[0];if(f!==g||f&&g&&e&&d&&e[f]!==d[g])return!1}}return!0}function Gy(a){return a}
for(var Hy=function(){var a=[];Ox.forEach(function(b,c){b==="br"?a.push({event:c,Cd:b,Jf:function(d,e){return d===void 0||e===void 0?d===e:Fy(d,e)},Ji:function(d){return d.slice()}}):a.push({event:c,Cd:b,Jf:Object.is,Ji:Gy})});return a}(),Iy=new Map,Jy=t(Hy),Ky=Jy.next();!Ky.done;Ky=Jy.next()){var Ly=Ky.value;Iy.set(Ly.event,Ly)}
function My(a,b){this.B=performance.timeOrigin||performance.timing&&performance.timing.fetchStart||Date.now()-performance.now();this.h={};var c=a.version||2,d=a.eventTargets||[],e=a.sid||crypto.randomUUID(),f=a.dh||"query",g=[];d=t(d);for(var h=d.next();!h.done;h=d.next())(h=h.value)&&h.url&&h.events&&h.events.length&&g.push({version:h.version||2,Qb:h.Qb?[].concat(h.Qb):[],url:h.url,events:[].concat(h.events),interval:h.interval!=null?h.interval:30,batchSize:h.batchSize||1});this.i=Object.assign({},
a,{version:c,dh:f,sid:e,cid:a.cid,Qb:a.Qb,eventTargets:g});this.l=NaN;this.j=new Map;this.o={sn:0,Pd:!1};this.u=b;this.m={};this.h={cid:this.i.cid,sid:this.i.sid,v:this.i.version};a=t(this.i.eventTargets||[]);for(b=a.next();!b.done;b=a.next())this.j.set(b.value,{lg:void 0,sn:0,Pd:!1,queue:[]})}My.prototype.start=function(){var a=this;this.j.forEach(function(b,c){Ny(b);if(c.interval!==0&&c.events&&c.events.includes("t")){var d=function(){Oy(a,b,c,"t");Py(a)};b.lg=setInterval(d,c.interval*1E3);d()}})};
My.prototype.stop=function(a){(a===void 0?0:a)&&this.flush();this.j.forEach(function(b){Ny(b)})};My.prototype.flush=function(){Py(this,!0)};function Qy(a,b){b.sid&&b.sid!==a.h.sid&&Ry(a);b.msd&&!isNaN(b.msd)&&(a.l=b.msd);a.h=Object.assign({},a.h,b,{msd:void 0});for(var c=t(Hy),d=c.next();!d.done;d=c.next())d=d.value,d.Cd in b&&!d.Jf(a.h[d.Cd],a.m[d.Cd])&&Sy(a,d.event)}
function Sy(a,b,c){var d=c||{};if(c=Iy.get(b)){var e=c.Cd,f=d[e];f!==void 0&&(a.h[e]=f);f=a.h[e];if(f===void 0||c.Jf(f,a.m[e]))return;a.m[e]=c.Ji(f)}a.j.forEach(function(g,h){Oy(a,g,h,b,d)});Py(a)}function Oy(a,b,c,d,e){e=e||{};c.events&&c.events.includes(d)&&(c=Object.assign({},a.h,e,{e:d,ts:e.ts!=null?e.ts:Date.now(),sn:b.sn++}),isNaN(a.l)||b.Pd||(c.msd=a.l,b.Pd=!0),b.queue.push(c))}
function Ty(a,b,c){var d=b.customData||{};b=Object.assign({},b,{headers:Object.assign({},b.headers||{}),Hf:Object.assign({},d,{cmcd:{}})});if(!a.i.Qb||!a.i.Qb.length||!b.url)return b;c=Object.assign({},a.h,c||{},{sn:a.o.sn++});var e=Ey("request",a.i,b.url);isNaN(a.l)||a.o.Pd||(c.msd=a.l,a.o.Pd=!0);var f=b.Hf.cmcd=wy(c,e);switch(a.i.dh){case "query":if(a=$x(f))b.url=By(b.url,a);break;case "headers":a=Object;c=a.assign;d=b.headers;var g={};var h=e.Bm;e={};if(f){var k=Object.keys(f);h=h?Dy(h):{};k=t(k);
for(var l=k.next();!l.done;l=k.next()){l=l.value;var m=Cy[l]||h[l]||"CMCD-Request";(e[m]||(e[m]={}))[l]=f[l]}}f=t(Object.entries(e));for(e=f.next();!e.done;e=f.next())h=t(e.value),e=h.next().value,h=h.next().value,(h=$x(h))&&(g[e]=h);c.call(a,d,g)}return b}
function Py(a,b){b=b===void 0?!1:b;var c=!1;a.j.forEach(function(d,e){var f=d.queue;if(f.length&&(!(f.length<e.batchSize)||b)){var g=f.splice(0,b?f.length:e.batchSize);Uy(a,e,g).catch(function(){d.queue.unshift.apply(d.queue,wa(g))});c=c||f.length>0}});c&&Py(a)}
function Uy(a,b,c){var d,e,f;return H(function(g){if(g.i==1)return d=Ey("event",b),g.h(a.u({url:b.url,method:"POST",headers:{"Content-Type":"application/cmcd"},body:c.map(function(h){h?(h=wy(h,d),h=$x(h)):h="";return h}).join("\n")+"\n"}),2);e=g.j;f=e.status;if(f===410)Vy(a,b);else if(f===429||f>499&&f<600)throw Error("Event report failed with status "+f);g.l()})}function Ny(a){clearInterval(a.lg);a.lg=void 0}function Vy(a,b){var c=a.j.get(b);c&&(Ny(c),a.j.delete(b))}
function Ry(a){a.j.forEach(function(b){b.sn=0});a.o.sn=0;a.m={}};function Wy(a,b,c){b?b?(b=wy(b,c),b=$x(b)):b="":b="";return b?By(a,b):a};function Xy(a,b){this.i=a;this.G=b;this.D=this.F=null;this.j=Yy(this);this.o=this.h=this.l=null;this.B=void 0;this.u=new Map;this.m=new ib;this.C=0}Xy.prototype.setMediaElement=function(a){this.l=a;Zy(this)};Xy.prototype.configure=function(a){this.G=a;$y(this)};function az(a){bz(a);a.F=null;a.D=null;a.o=null;a.B=void 0;a.C=0;a.j=Yy(a)}
function $y(a){var b=a.j;a.j=Yy(a);var c;if(c=a.h)c=a.j,c=b.enabled!=c.enabled||b.version!=c.version||b.useHeaders!=c.useHeaders||b.sessionId!=c.sessionId||b.contentId!=c.contentId||b.eventTargets!=c.eventTargets||!gb(b.includeKeys,c.includeKeys);c&&bz(a);Zy(a)}
function Yy(a){var b=a.G,c=a.F;a=a.D;var d=(c=b.applyParametersFromManifest!==!1&&c&&c.cmcdParameters?c:null)?c.cmcdParameters:null,e=d?d.version:b.version,f=b.includeKeys||[];if(d&&d.keys){var g=cz(d.keys,e);g.length?f=g:Xa("CMCD_NO_SUPPORTED_MANIFEST_KEYS","CMCD: the manifest lists no key this player supports at version "+e+"; using the application keys instead.")}return{enabled:!!d||b.enabled,version:e,useHeaders:d?d.mode=="header":b.useHeaders,sessionId:d&&d.sessionId||b.sessionId||a||"",contentId:d&&
d.contentId||b.contentId||"",rtpSafetyFactor:b.rtpSafetyFactor,includeKeys:f,includeInRequests:d?d.includeInRequests:b.includeInRequests||[],eventTargets:b.eventTargets,serviceLocations:c?c.serviceLocations:null,adaptationSets:c?c.adaptationSets:null,serviceLocationBaseUris:c?c.serviceLocationBaseUris:[],vj:!!d}}function bz(a){a.h&&(a.h.stop(!0),a.h=null);a.u.clear();a.m.Ta()}function dz(a,b){a.h&&(a.C=b,a.l&&a.l.autoplay&&(b=a.l.play())&&b.catch(function(){a.C=0}))}
function ez(a,b,c){if(!a.h||!fz(a,"segment"))return b;try{var d=gz(a);a:{switch(c.toLowerCase()){case "audio/mp4":case "audio/webm":case "audio/ogg":case "audio/mpeg":case "audio/aac":case "audio/flac":case "audio/wav":var e="a";break a;case "video/webm":case "video/mp4":case "video/mpeg":case "video/mp2t":e="av";break a;case "application/x-mpegurl":case "application/vnd.apple.mpegurl":case "audio/x-mpegurl":case "application/dash+xml":case "video/vnd.mpeg.dash.mpd":case "application/vnd.ms-sstr+xml":e=
"m";break a}e=void 0}d.ot=e;d.su=!0;return Wy(b,d,hz(a,b))}catch(f){return Xa("CMCD_SRC_ERROR","Could not generate src CMCD data.",f),b}}function Zy(a){if(!a.h&&a.l&&a.j.enabled){a.j.sessionId||(a.D=window.crypto.randomUUID(),a.j=Yy(a));var b=iz(a.j);a.h=new My(b,jz(a));a.h.start();a.B&&Qy(a.h,{sf:a.B,st:a.i.isLive()?"l":"v"});a.o&&Qy(a.h,{Ki:a.o});kz(a)}}
function iz(a){var b=a.includeKeys&&a.includeKeys.length?a.includeKeys:lz(a.version);b={sid:a.sessionId,cid:a.contentId,dh:a.useHeaders?"headers":"query",Qb:b,version:a.version===2?2:1};var c=a.eventTargets;c&&c.length&&(b.eventTargets=c.filter(function(d){return d.enabled!==!1&&d.url&&d.events&&d.events.length}).map(function(d){var e=d.includeKeys&&d.includeKeys.length?d.includeKeys:lz(d.version||a.version);return{url:d.url,events:d.events,interval:d.interval,batchSize:d.batchSize,Qb:e,version:2}}));
return b}function jz(a){return function(b){var c,d,e,f,g,h;return H(function(k){if(k.i==1)return c=Sk,d=mk(),e=b.url,f=Kk([e],d),f.method=b.method||"POST",f.headers=b.headers||{},f.body=Jb(b.body),k.o(2),g=a.i.M,k.h(g.request(c.Ml,f).promise,4);if(k.i!=2)return k.return({status:200});h=k.m();return k.return({status:h&&h.status?h.status:0})})}}function mz(a,b){a.h&&a.o!==b&&(a.o=b,Qy(a.h,{Ki:b}))}
function nz(a,b,c){try{var d={url:b.uris[0],headers:Object.assign({},b.headers||{}),Hf:{}},e=Ty(a.h,d,c),f=e.headers||{},g=Object.keys(d.headers).length;if(Object.keys(f).length>g){b.headers||(b.headers={});for(var h=t(Object.keys(f)),k=h.next();!k.done;k=h.next()){var l=k.value;l in d.headers||(b.headers[l]=f[l])}}var m=e.url;if(m&&m!==d.url)if(b.uris.length===1)b.uris=[m];else{var n=$x(e.Hf.cmcd);b.uris=b.uris.map(function(p){return p.includes("offline:")?p:By(p,n)})}}catch(p){Xa("CMCD_REQUEST_ERROR",
"Could not apply CMCD data to request.",p)}}
function oz(a,b,c,d){a=a.j;if(a.serviceLocations&&b!=8){b=pz(c.uris[0],a.serviceLocationBaseUris);if(!b)return Xa("CMCD_UNKNOWN_SERVICE_LOCATION","CMCD: the manifest restricts reporting to service locations "+a.serviceLocations.join(" ")+" but the location of some requests cannot be resolved; they are not decorated."),!1;if(!a.serviceLocations.includes(b))return!1}if(a.adaptationSets&&d.stream){var e=d.stream.groupId;if(!e)return Xa("CMCD_NO_GROUP_ID","CMCD: the manifest restricts reporting to adaptation sets "+a.adaptationSets.join(" ")+
" but some streams have no group id; they are not decorated. For DASH this happens when dash.enableAudioGroups is false."),!1;if(!a.adaptationSets.some(function(f){return e==f||e.startsWith(f+"_preselection_")}))return!1}return!0}function fz(a,b){var c=a.j.includeInRequests,d=c;if(!c.length){if(a.j.vj)return!1;d=qz}return d.includes("*")||b=="init"&&d.includes("segment")?!0:d.includes(b)}
function rz(a){return(a=a.j.eventTargets)?a.some(function(b){return b.enabled!==!1&&b.events&&b.events.includes("rr")}):!1}function gz(a){return{v:a.j.version,sid:a.j.sessionId,cid:a.j.contentId,sf:a.B,mtp:a.i.getBandwidthEstimate()/1E3}}function hz(a,b){var c={};b&&!b.includes("offline:")&&(c.le=b);a.j.version!=null&&(c.version=a.j.version);c.Mg="request";return c}
function kz(a){a.m.J(a.l,"pause",function(){mz(a,"a")});a.m.J(a.l,"playing",function(){mz(a,"p");a.h&&a.C&&(Qy(a.h,{msd:Date.now()-a.C}),a.C=0)});a.m.J(a.l,"seeking",function(){mz(a,"k")});a.m.J(a.l,"ended",function(){mz(a,"e")});a.m.J(a.l,"volumechange",function(){a.h&&a.l&&Sy(a.h,a.l.muted?"m":"um")});a.m.J(a.i,"buffering",function(b){mz(a,b.buffering?"r":"p")});a.m.J(a.i,"adaptation",function(){if(a.h&&a.i){var b=a.i.jc().find(function(c){return c.active});b&&b.bandwidth&&Qy(a.h,{br:[b.bandwidth/
1E3]})}});a.m.J(a.i,"error",function(){mz(a,"f");a.h&&Sy(a.h,"e")});Oj(a.m,a.l,function(b){a.h&&Sy(a.h,b?"pe":"pc")});a.m.J(document,"visibilitychange",function(){a.h&&Qy(a.h,{bg:document.hidden})});a.m.J(a.i,"complete",function(){mz(a,"e")})}function sz(a){if(a.type===0)return"i";if(a=a.stream){var b=a.type;if(b=="video")return a.codecs&&a.codecs.includes(",")?"av":"v";if(b=="audio")return"a";if(b=="text")return a.mimeType==="application/mp4"?"tt":"c"}}
function tz(a,b){b=a.i.dc()[b];if(!b.length)return NaN;var c=a.l?a.l.currentTime:0;return(a=b.find(function(d){return d.start<=c&&d.end>=c}))?(a.end-c)*1E3:NaN}function uz(a,b){b=a.i.dc()[b];if(!b.length)return 0;var c=a.l?a.l.currentTime:0;return(a=b.find(function(d){return d.start<=c&&d.end>=c}))?(a.end-c)*1E3:0}
function vz(a,b){var c=a.i.jc();if(!c.length)return NaN;a=c[0];c=t(c);for(var d=c.next();!d.done;d=c.next())d=d.value,d.type==="variant"&&d.bandwidth>a.bandwidth&&(a=d);switch(b){case "v":return a.videoBandwidth||NaN;case "a":return a.audioBandwidth||NaN;default:return a.bandwidth}}function cz(a,b){var c=new Set(lz(b)),d=a.filter(function(e){return c.has(e)||jy.test(e)});d.length!=a.length&&Za(a.filter(function(e){return!d.includes(e)}));return d}
function lz(a){return a===2?Array.from(new Set([].concat(Lx,Mx,Kx))):[].concat(Nx)}function wz(a,b){switch(a){case Pk:return b.type==0?"init":"segment";case 0:switch(b.type){case 6:return"mpdpatch";case 14:return"xlink";case 15:return"mpdlink";default:return"mpd"}case 8:return"steering";case 13:return"callback";case 2:case 5:case 6:return"license";case 4:return"timing";default:return null}}
function pz(a,b){var c=null;b=t(b);for(var d=b.next();!d.done;d=b.next())d=d.value,a.startsWith(d.uri)&&(!c||d.uri.length>c.uri.length)&&(c=d);return c?c.serviceLocation:null}var qz="segment init mpd mpdpatch xlink mpdlink license timing".split(" ");K("shaka.util.CmcdManager.StreamingFormat",{DASH:"d",HLS:"h",im:"s",OTHER:"o"});
K("shaka.util.CmcdManager.EventType",{Ll:"bc",Zl:"ps",Vl:"pr",ERROR:"e",nm:"t",Nl:"c",Kl:"b",Ul:"m",pm:"um",Xl:"pe",Wl:"pc",dm:"rr",Hl:"as",Gl:"ae",Fl:"abs",El:"abe",hm:"sk",Ol:"ce"});K("shaka.util.CmcdManager.PlayerState",{lm:"s",Yl:"p",fm:"k",bm:"r",PAUSED:"a",rm:"w",Pl:"e",Ql:"f",am:"q",$l:"d"});function xz(a){this.i=a;this.h=null}r=xz.prototype;r.configure=function(a){this.i=a};r.Kh=function(){return this.i.enabled&&this.i.applyMaximumSuggestedBitrate&&this.h&&this.h.has(yz)?this.h.get(yz)*1E3:null};r.Ih=function(){return this.i.enabled&&this.h&&this.h.has(zz)?this.h.get(zz)*1E3:null};r.Xj=function(){return this.i.enabled&&this.h&&this.h.has(Az)?this.h.get(Az):null};r.Yj=function(){return this.i.enabled&&this.h&&this.h.has(Bz)?this.h.get(Bz):null};
r.getBandwidthEstimate=function(a){var b=this.Ih();if(!b)return a;var c=this.i.estimatedThroughputWeightRatio;return c>0&&c<=1?a*(1-c)+b*c:a};function Cz(a){return a?a.toLowerCase()==="false"?!1:/^[-0-9]/.test(a)?parseInt(a,10):a.replace(/["]+/g,""):!0}K("shaka.util.CmsdManager",xz);xz.prototype.getBandwidthEstimate=xz.prototype.getBandwidthEstimate;xz.prototype.getRoundTripTime=xz.prototype.Yj;xz.prototype.getResponseDelay=xz.prototype.Xj;xz.prototype.getEstimatedThroughput=xz.prototype.Ih;
xz.prototype.getMaxBitrate=xz.prototype.Kh;var zz="etp",yz="mb",Az="rd",Bz="rtt";function Dz(){this.h=null;this.i=[]}function Ez(a,b){return H(function(c){if(c.i==1)return a.h?c.h(new Promise(function(d){return a.i.push(d)}),2):c.A(2);a.h=b;c.l()})}Dz.prototype.release=function(){this.i.length>0?this.i.shift()():this.h=null};function Fz(a){this.h=a;this.j=this.i=null}Fz.prototype.start=function(a,b){function c(e,f){d.h&&d.j===c&&a(e,f);d.h&&d.j===c&&!b&&(d.i=d.h.requestVideoFrameCallback(c))}var d=this;b=b===void 0?!1:b;Gz(this);if(!(this.h&&"requestVideoFrameCallback"in this.h))return!1;this.j=c;this.i=this.h.requestVideoFrameCallback(c);return!0};Fz.prototype.release=function(){Gz(this);this.h=null};
function Gz(a){if(a.i!==null){var b,c;(b=a.h)==null||(c=b.cancelVideoFrameCallback)==null||c.call(b,a.i);a.i=null}a.j=null};function Z(a,b,c){b=b===void 0?null:b;uk.call(this);var d=this;this.m=Hz;this.i=null;this.pd=b;this.Oa=!1;this.fe=new ib;this.rd=new ib;this.o=new ib;this.Nb=new ib;this.Pc=new ib;this.G=this.H=this.td=this.V=this.u=this.M=null;this.Qc=0;this.ua=new Dz;this.l=this.qd=this.ka=this.ph=this.Ma=this.K=this.Ya=this.eb=this.Aa=this.od=this.Z=this.$a=this.N=this.Kb=null;this.ra=Iz(this);this.T=this.Y=this.ba=this.j=this.Yb=this.I=null;this.sa=!1;this.$d=this.B=null;this.ge=1E9;this.ee=[];this.Xb=new Map;
this.ce=[];this.qf=-1;this.h=Jz(this);this.tf=Du();this.na=null;this.je=-1;this.Mb=null;this.Pa={width:Infinity,height:Infinity};this.Zd=new hr(this.h,this.Pa,null);this.be=[];this.C=null;this.O=this.h.adaptationSetCriteriaFactory();b={preferredAudio:this.h.preferredAudio,preferredVideo:this.h.preferredVideo,language:"",role:"",videoRole:"",channelCount:0,hdrLevel:"",spatialAudio:!1,videoLayout:"",audioLabel:"",videoLabel:"",preferredAudioCodecs:[],preferredAudioChannelCount:0,codecSwitchingStrategy:this.h.mediaSource.codecSwitchingStrategy,
audioCodec:"",activeAudioCodec:"",activeAudioChannelCount:0,keySystem:this.keySystem()};Fu(b);this.O.configure(b);this.sd=[];c&&c(this);this.K=new Xy(this,this.h.cmcd);this.Ma=new xz(this.h.cmsd);this.M=Kz(this);this.Da=this.Ga=this.Qa=this.D=null;this.vf=!1;this.rf=[];this.uf=new $e(function(){var e;return H(function(f){switch(f.i){case 1:if(!d.Ga){f.A(0);break}f.o(3);return f.h(d.wb(d.Da,!0),5);case 5:return f.h(d.load(d.Ga),6);case 6:f.u(4);break;case 3:return e=f.m(),Lz(d,e),f.return();case 4:d.vf?
d.Da.pause():d.Da.play(),d.Ga=null,d.vf=!1,f.l()}})});Mz&&(this.D=Mz(this),this.D.configure(this.h.ads),this.Pc.J(this.D,"ad-content-pause-requested",function(e){var f,g,h;return H(function(k){if(k.i==1){d.uf.stop();if(d.Ga)return k.A(0);d.Da=d.i;d.vf=d.Jd();f=e.saveLivePosition||!1;g=!0;d.isLive()&&(g=f);k.o(3);return k.h(d.Dh(!0,g),5)}if(k.i!=3)return d.Ga=k.j,k.u(0);h=k.m();Lz(d,h);k.l()})}),this.Pc.J(this.D,"ad-content-resume-requested",function(e){e=e.offset||0;if(d.Ga){var f=d.Ga;f.B&&e&&(typeof f.B===
"number"?f.B+=e:f.B.setTime(f.B.getTime()+e*1E3))}d.uf.ha(.1)}),this.Pc.J(this.D,"ad-content-attach-requested",function(){var e;return H(function(f){switch(f.i){case 1:if(d.i||!d.Da){f.A(0);break}f.o(3);return f.h(d.wb(d.Da,!0),5);case 5:f.u(4);break;case 3:return e=f.m(),Lz(d,e),f.return();case 4:d.Da=null,f.l()}})}));Nz&&(this.Qa=Nz(this),this.Qa.configure(this.h.queue));this.fe.J(window,"online",function(){Oz(d);d.Qg()});this.ae=new $e(function(){for(var e=Date.now()/1E3,f=!1,g=!0,h=t(d.j.variants),
k=h.next();!k.done;k=h.next())k=k.value,k.disabledUntilTime>0&&k.disabledUntilTime<=e&&(k.disabledUntilTime=0,f=!0),k.disabledUntilTime>0&&(g=!1);g&&d.ae.stop();f&&Pz(d,!1,void 0,!1,!1)});this.L=this.F=this.Cb=null;this.ud=new Set;this.Ba=null;this.mh=new vk;this.ie=null;a&&(Wa("Please migrate from initializing Player with a mediaElement; use the attach method instead."),this.wb(a,!0))}ta(Z,uk);function Qz(a){a.ka!=null&&(Fc(a.ka),a.ka.release(),a.ka=null)}
function Rz(a,b,c){c||b.lcevc.enabled?(Qz(a),a.ka==null&&(a.ka=new Cc(a.i,a.ph,b.lcevc,c),a.H&&(a.H.H=a.ka))):Qz(a)}function Sz(a,b){return new tk(a,b)}r=Z.prototype;
r.destroy=function(){var a=this,b;return H(function(c){switch(c.i){case 1:if(a.m==Tz)return c.return();Qz(a);for(var d=a.ua;d.h;)d.release();b=a.detach();a.m=Tz;return c.h(b,2);case 2:if(!a.V){c.A(3);break}return c.h(a.V.destroy(),4);case 4:a.V=null;case 3:return a.td=null,c.h(a.Ch(),5);case 5:a.fe&&(a.fe.release(),a.fe=null);a.rd&&(a.rd.release(),a.rd=null);a.o&&(a.o.release(),a.o=null);a.Nb&&(a.Nb.release(),a.Nb=null);a.Pc&&(a.Pc.release(),a.Pc=null);a.$d=null;a.h=null;a.C=null;a.pd=null;a.K=null;
a.Ma=null;if(!a.M){c.A(6);break}return c.h(a.M.destroy(),7);case 7:a.M=null;case 6:a.B&&(a.B.release(),a.B=null),a.Qa&&(a.Qa.destroy(),a.Qa=null),a.L&&(a.L.release(),a.L=null),a.Ba&&(a.Ba.release(),a.Ba=null),uk.prototype.release.call(a),c.l()}})};function Uz(a,b){a.dispatchEvent(Sz("onstatechange",(new Map).set("state",b)))}
r.wb=function(a,b){b=b===void 0?!0:b;var c=this,d,e,f;return H(function(g){switch(g.i){case 1:Vz(c);d=c.i&&c.i==a;if(!c.i||c.i==a){g.A(2);break}return g.h(c.detach(),2);case 2:return Vz(c),g.h(Wz(c,"attach"),4);case 4:if(g.j)return g.return();g.o(5,6);d||(Uz(c,"attach"),e=function(){var h=Xz(c,!1);h&&Yz(c,h)},c.rd.J(a,"error",e),c.i=a,c.K&&c.K.setMediaElement(a));ob();if(!b||!Lc()||c.H){g.A(6);break}return g.h(Zz(c),6);case 6:g.F();c.ua.release();g.G(0);break;case 5:return f=g.m(),g.h(c.detach(),
10);case 10:throw f;}})};r.bj=function(a){this.ph=a};r.detach=function(a,b){a=a===void 0?!1:a;b=b===void 0?!1:b;var c=this;return H(function(d){if(d.i==1)return Vz(c),d.h(c.Xd(!1,a,b),2);if(d.i!=3)return d.h(Wz(c,"detach"),3);if(d.j)return d.return();try{c.i&&(c.rd.Ta(),c.i=null),Uz(c,"detach"),c.D&&!a&&c.D.release()}finally{c.ua.release()}d.l()})};function Wz(a,b){var c;return H(function(d){return d.i==1?(c=++a.Qc,d.h(Ez(a.ua,b),2)):c!=a.Qc?(a.ua.release(),d.return(!0)):d.return(!1)})}
r.Xd=function(a,b,c){a=a===void 0?!0:a;b=b===void 0?!1:b;c=c===void 0?!1:c;var d=this,e,f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D,B;return H(function(A){switch(A.i){case 1:return d.m!=Tz&&(d.m=Hz),A.h(Wz(d,"unload"),2);case 2:if(A.j)return A.return();e=d.h.drm.keepDrmEngineOnDetach&&!!d.u&&!!d.u.Sb();if(!e){A.A(3);break}if(!d.V||d.V==d.u){A.A(4);break}return A.h(d.V.destroy(),4);case 4:d.V=d.u,d.td=d.ba,d.u=null;case 3:return A.K(6),d.sa=!1,Uz(d,"unload"),Qz(d),f=d.sd.map(function(E){return E()}),d.sd=[],A.h(Promise.all(f),
8);case 8:g=(new Map).set("isSwitchingContent",c);d.dispatchEvent(Sz("unloading",g));d.od&&(d.od.release(),d.od=null);d.Ya&&(d.Ya.release(),d.Ya=null);d.Aa&&(d.Aa.release(),d.Aa=null);d.eb&&(d.eb.release(),d.eb=null);d.i&&(d.o.Ta(),d.Nb.Ta());d.ae.stop();d.Kb&&(d.Kb.release(),d.Kb=null);d.$a&&(d.$a.stop(),d.$a=null);if(!d.I){A.A(9);break}return A.h(d.I.stop(),10);case 10:d.I=null,d.Yb=null;case 9:d.B&&d.B.stop();if(!d.l){A.A(11);break}return A.h(d.l.destroy(),12);case 12:d.l=null;case 11:d.ra.h=[];
d.N&&(d.N.release(),d.N=null);d.G&&(d.G.release(),d.G=null);if("webkit"!==window.shakaMediaKeysPolyfill||!d.u){A.A(13);break}return A.h(d.u.destroy(),14);case 14:d.u=null;case 13:if(!d.H){A.A(15);break}return A.h(d.H.destroy(),16);case 16:d.H=null;case 15:if(d.D&&!b)d.D.onAssetUnload();d.Ga&&!b&&(d.Ga.destroy(),d.Ga=null);b||d.uf.stop();d.K&&az(d.K);d.Ma&&(d.Ma.h=null);if(!d.F){A.A(17);break}return A.h(d.F.destroy(),18);case 18:d.F=null;case 17:return d.Oa=!1,d.L&&d.L.disable(),d.ud.clear(),d.Ba&&
(d.Ba.release(),d.Ba=null),A.h(d.mh.destroy(),19);case 19:if(d.i){h=t(d.rf);for(k=h.next();!k.done;k=h.next())l=k.value,l.src.startsWith("blob:")&&URL.revokeObjectURL(l.src),l.remove();d.rf=[];Jj(d.i)&&d.i.load()}if(!d.u){A.A(20);break}return A.h(d.u.destroy(),21);case 21:d.u=null;case 20:d.Cb&&d.ba!=d.Cb.He()&&(d.Cb.F||d.Cb.destroy(),d.Cb=null);d.ba=null;d.Y=null;d.Z=null;if(d.j){m=t(d.j.variants);for(n=m.next();!n.done;n=m.next())for(p=n.value,u=t([p.audio,p.video]),q=u.next();!q.done;q=u.next())(v=
q.value)&&v.segmentIndex&&v.segmentIndex.release();w=t(d.j.textStreams);for(y=w.next();!y.done;y=w.next())x=y.value,x.segmentIndex&&x.segmentIndex.release()}d.h&&d.h.streaming.clearDecodingCache&&(yf.clear(),jc.clear());d.j=null;d.C=new Lu;d.oh=null;d.Mb=null;d.na=null;d.je=-1;d.ee=[];z=t(d.Xb.values());for(D=z.next();!D.done;D=z.next())B=D.value,B.stop();d.Xb.clear();d.ce=[];d.qf=-1;d.M&&d.M.Ah();d.ie&&(URL.revokeObjectURL(d.ie),d.ie=null);$z(d);ob();if(!a||!Lc()||d.H||!d.i){A.A(6);break}return A.h(Zz(d),
6);case 6:A.F(),d.ua.release(),A.G(0)}})};r.Bl=function(a){this.T=a};r.load=function(a,b,c){b=b===void 0?null:b;var d=this;return H(function(e){return e.h(aA(d,a,b,c),0)})};
function aA(a,b,c,d,e,f){e=e===void 0?!1:e;f=f===void 0?null:f;var g,h,k,l,m,n,p,u,q,v,w,y,x,z,D,B,A,E;return H(function(C){switch(C.i){case 1:Vz(a);if(a.i||!a.Da){C.A(2);break}return C.h(a.wb(a.Da,!0),3);case 3:a.Da=null;case 2:g=null;h="";d=(k=d)==null?void 0:k.toLowerCase();if(b instanceof Uu){if(b.F)throw new L(2,7,7006);g=b;h=g.He()||""}else h=b||"";return C.h(Ez(a.ua,"load"),4);case 4:a.ua.release();if(f!=null&&f!=a.Qc)throw new L(2,7,7E3);if(!a.i)throw new L(2,7,7002);l=a.h.drm.keepDrmEngineOnDetach&&
!!a.V&&a.td===h;if(!a.ba){C.A(5);break}a.ba=h;return C.h(a.Xd(!1,!1,!0),5);case 5:a.K&&Zy(a.K);Vz(a);m=++a.Qc;n=function(){return H(function(F){if(F.i==1)return a.Qc==m?F.A(0):g?F.h(g.destroy(),3):F.A(3);throw new L(2,7,7E3);})};p=function(F,G){return H(function(J){switch(J.i){case 1:return J.K(2),J.h(Ez(a.ua,G),4);case 4:return J.h(n(),5);case 5:return J.h(F(),6);case 6:return J.h(n(),7);case 7:g&&a.h&&(g.j=a.h);case 2:J.F(),a.ua.release(),J.G(0)}})};u=!1;C.o(7,8);c==null&&g&&(c=g.getStartTime());
a.T=c;a.sa=!1;a.ba=h;a.dispatchEvent(Sz("loading"));if(g){d=g.fg();C.A(10);break}if(d){C.A(10);break}return C.h(p(function(){return H(function(F){if(F.i==1)return F.h(bA(a,h),2);d=F.j;F.l()})},"guessMimeType_"),10);case 10:q=!!g;if(g||e){g&&(Xu(g,a),a.C=g.getStats());C.A(13);break}return C.h(cA(a,h,c,d,!0,a.h),14);case 14:(g=C.j)?(g.H=!1,Xu(g,a),a.C=g.getStats(),l&&a.V&&av(g,a.V),g.start(),g.C.promise.catch(function(){})):a.C=new Lu;case 13:v=!g;w=Date.now()/1E3;a.C=g?g.getStats():new Lu;a.Y=d||null;
$z(a);y=function(){var F=a.i?a.i.buffered:null;return{start:Tq(F)||0,end:Uq(F)||0}};a.Aa=new at(y);a.Aa.addEventListener("regionadd",function(F){dA(a,F.region,"metadataadded")});if(v)return C.h(p(function(){return H(function(F){return F.h(eA(a,d,l),0)})},"initializeSrcEqualsDrmInner_"),28);a.eb=new at(y);return C.h(p(function(){return H(function(F){if(F.i==1)return F.h(Promise.race([g.sa.promise,g.C.promise]),2);a.Yb=g.L;var G=g;G.ua=!0;a.I=G.o;a.j=g.eg();F.l()})},"waitForFinish"),17);case 17:fA(a);
if(a.H){C.A(18);break}return C.h(p(function(){return H(function(F){return F.h(Zz(a),0)})},"initializeMediaSourceEngineInner_"),18);case 18:return C.h(p(function(){return H(function(F){return F.h(g.C.promise,0)})},"waitForFinish"),20);case 20:a.h=g.getConfiguration();a.Zd=g.I;a.I&&a.I.setMediaElement&&a.i&&a.I.setMediaElement(a.i);a.od=Yu(g);a.Ya=Zu(g);a.qd=g.Oa;if(x=g.m)a.O=x;q&&a.i&&a.i.nodeName==="AUDIO"&&(gA(a),a.configure("manifest.disableVideo",!0));if(l)return a.u=a.V,a.V=null,a.td=null,C.h(p(function(){return H(function(F){return F.h(a.u.wb(a.i),
0)})},"drmEngine_.attach"),22);if(g.l){C.A(23);break}return C.h(p(function(){return H(function(F){return F.h(ev(g,a.i),0)})},"drmEngine_.init"),23);case 23:return a.u=$u(g),C.h(p(function(){return H(function(F){return F.h(a.u.wb(a.i),0)})},"drmEngine_.attach"),22);case 22:return a.O&&(z=a.O.getConfiguration(),z.keySystem=a.keySystem(),a.O.configure(z)),D=a.h.abrFactory,a.B&&a.$d==D||(a.$d=D,a.B&&a.B.release(),a.B=D(),a.B.configure(a.h.abr)),B=bv(g),A=g.i,C.h(p(function(){return H(function(F){return F.h(hA(a,
w,A,B),0)})},"loadInner_"),27);case 27:Wu(g);a.Y&&ob().Ni()&&Fe(a.Y)&&Ar(a.H,a.ba,a.Y);C.A(16);break;case 28:return C.h(p(function(){return H(function(F){return F.h(iA(a,w,d),0)})},"srcEqualsInner_"),16);case 16:a.dispatchEvent(Sz("loaded"));case 8:C.F();if(!g){C.A(30);break}return C.h(g.destroy(),30);case 30:a.Cb=null;C.G(9);break;case 7:E=C.m();if(u=E instanceof L&&!!g&&!e&&a.Qc==m&&jA(a,d,E))c=a.T;if(!E||E.code==7E3){C.A(32);break}return C.h(a.Xd(!1),32);case 32:if(!u)throw E;C.A(8);break;case 9:if(u)return C.h(aA(a,
h,c,d,!0,m+1),0);C.A(0)}})}function gA(a){for(var b=t(a.j.variants),c=b.next();!c.done;c=b.next())c=c.value,c.video&&(c.video.closeSegmentIndex(),c.video=null),c.bandwidth=c.audio&&c.audio.bandwidth?c.audio.bandwidth:0;a.j.variants=a.j.variants.filter(function(d){return d.audio})}r.yl=function(a,b,c,d){a=a===void 0?!0:a;b=b===void 0?!1:b;c=c===void 0?!1:c;d=d===void 0?!1:d;var e=this,f;return H(function(g){return g.i==1?g.h(kA(e,c),2):g.i!=3?(f=g.j,g.h(e.Xd(a,b,d),3)):g.return(f)})};
r.Dh=function(a,b,c){a=a===void 0?!1:a;b=b===void 0?!1:b;c=c===void 0?!1:c;var d=this,e;return H(function(f){return f.i==1?f.h(kA(d,b),2):f.i!=3?(e=f.j,f.h(d.detach(a,c),3)):f.return(e)})};
function kA(a,b){b=b===void 0?!1:b;var c,d,e;return H(function(f){if(f.i==1){c=null;if(!(a.j&&a.I&&a.Yb&&a.ba&&a.h))return f.A(2);d=a.i.currentTime;b||(d=null);return f.h(lA(a,a.ba,d,a.Y,a.h,!0,!1),3)}if(f.i!=2){c=f.j;a.be.push(c);a.I&&a.I.setMediaElement&&a.I.setMediaElement(null);if(e=a.l?a.l.u:null)c.i=e;var g=c,h=a.I,k=a.Yb;g.h=a.j;g.o=h;g.L=k;c.m=a.O;c.start();a.j=null;a.I=null;a.Yb=null;a.B=null;a.$d=null}return f.return(c)})}
r.preload=function(a,b,c,d,e){b=b===void 0?null:b;e=e===void 0?!1:e;var f=this,g,h,k,l;return H(function(m){if(m.i==1)return c=(g=c)==null?void 0:g.toLowerCase(),h=Jz(f),Eu(h,d||f.h,Jz(f)),m.h(cA(f,a,b,c,!1,h),2);if(k=m.j)k.start();else{l=new L(2,7,7005);if(e)throw l;Yz(f,l)}return m.return(k)})};r.Ch=function(){var a=this,b,c,d,e;return H(function(f){b=[];c=t(a.be);for(d=c.next();!d.done;d=c.next())e=d.value,e.F||b.push(e.destroy());a.be=[];return f.h(Promise.all(b),0)})};
function cA(a,b,c,d,e,f){e=e===void 0?!1:e;var g,h,k,l;return H(function(m){if(m.i==1)return d?m.A(2):m.h(bA(a,b),3);m.i!=2&&(d=m.j);if(g=jA(a,d))return m.return(null);h=f||a.h;k=!1;e&&a.i&&a.i.nodeName==="AUDIO"&&(k=!0);l=lA(a,b,c,d||null,h,!e,k);l=e?l.then(function(n){n.H=!1;return n}):l.then(function(n){a.be.push(n);return n});return m.return(l)})}
function lA(a,b,c,d,e,f,g){f=f===void 0?!0:f;g=g===void 0?!1:g;var h,k,l,m,n,p,u,q,v,w,y,x,z,D,B,A;return H(function(E){if(E.i==1){h=null;k=nd(e);g&&(k.manifest.disableVideo=!0);l=function(){return h.K&&h.F?null:h};m=function(){return l()?l().getConfiguration():a.h};if(a.Pa.width!=Infinity||a.Pa.height!=Infinity||a.h.ignoreHardwareResolution)return E.A(2);n=ob();return E.h(n.Gb(),3)}E.i!=2&&(p=E.j,a.Pa.width=p.width,a.Pa.height=p.height);u=new hr(k,a.Pa,null);q={networkingEngine:a.M,filter:function(C){var F,
G;return H(function(J){if(J.i==1)return J.h(ir(u,C),2);if(J.i!=4){F=J.j;if(!F)return J.A(0);G=Sz("trackschanged");return J.h(Promise.resolve(),4)}h.dispatchEvent(G);J.l()})},makeTextStreamsForClosedCaptions:function(C){for(var F=new Set,G=t(C.textStreams),J=G.next();!J.done;J=G.next())J=J.value,J.mimeType!=Je&&J.mimeType!=Ke||F.add(J.originalId);G=t(C.variants);for(J=G.next();!J.done;J=G.next())if((J=J.value.video)&&J.closedCaptions)for(var Q=t(J.closedCaptions.keys()),O=Q.next();!O.done;O=Q.next())if(O=
O.value,!F.has(O)){var V=O.startsWith("CC")?Je:Ke,M=new Hm,N=J.closedCaptions.get(O);V=Uf({id:a.ge++,originalId:O,segmentIndex:M,mimeType:V,kind:"caption",language:N,originalLanguage:N,type:zc,roles:J.roles});C.textStreams.push(V);F.add(O)}},onTimelineRegionAdded:function(C){bt(h.M,C)},onScte35Event:function(C){bt(h.V,C)},onEvent:function(C){return h.dispatchEvent(C)},onError:function(C){return h.onError(C)},isLowLatencyMode:function(){return m().streaming.lowLatencyMode},updateDuration:function(){a.l&&
h.K&&a.l.updateDuration()},newDrmInfo:function(C){var F=h.l,G=F?F.Sb():null;G&&F.B&&lr(u,G.keySystem,C)},onManifestUpdated:function(){var C=(new Map).set("isLive",a.isLive()).set("isInProgress",a.ad());h.dispatchEvent(Sz("manifestupdated",C));Vu(h,!1,function(){if(a.D)a.D.onManifestUpdated(a.oa())});h.K&&fA(a)},getBandwidthEstimate:function(){return a.B?a.B.getBandwidthEstimate():NaN},onMetadata:function(C,F,G,J){var Q=C;if(C=="com.apple.hls.interstitial"||C=="com.apple.hls.overlay")Q="com.apple.quicktime.HLS";
var O={type:Q,startTime:F,endTime:G,values:J};C=new Promise(function(N){Vu(h,!1,function(){return H(function(P){switch(P.i){case 1:if(!a.D){P.A(0);break}if(!a.i){P.A(3);break}P.o(4);return P.h(a.D.onHLSMetadata(O),6);case 6:P.u(3);break;case 4:P.m();case 3:N(),P.l()}})})});J=t(J);for(var V=J.next(),M={};!V.done;M={Eg:void 0},V=J.next())M.Eg=V.value,M.Eg.name!="ID"&&Vu(h,!1,function(N){return function(){mA(a,F,G,Q,N.Eg)}}(M));return C},disableStream:function(C){return a.disableStream(C,a.h.streaming.maxDisabledTime)},
addFont:function(C,F){return a.addFont(C,F)},getStreamingRetryParameters:function(){return a.h.streaming.retryParameters},onSegmentReceived:function(C,F){Vu(h,!1,function(){var G;(G=a.B)==null||G.segmentDownloaded(C,F,!0)})}};v=new at(function(){return a.Za()});v.addEventListener("regionadd",function(C){var F=C.region;nA(a,"timelineregionadded",F,h);Vu(h,!1,function(){if(a.D)a.D.onDASHMetadata(F)})});w=new at(function(){return a.Za()});w.addEventListener("regionadd",function(C){h.dispatchEvent(Sz("scte35added",
(new Map).set("detail",C.region)))});y=null;k.streaming.observeQualityChanges&&(y=new ym(function(){return a.dc()}),y.addEventListener("qualitychange",function(C){oA(a,C.quality,C.position)}),y.addEventListener("audiotrackchange",function(C){oA(a,C.quality,C.position,!0)}));x=!0;z={Ec:a.M,onError:function(C){return h.onError(C)},li:function(C){Vu(h,!0,function(){a.u&&pA(a,C)})},onExpirationUpdated:function(C,F){var G=Sz("expirationupdated");h.dispatchEvent(G);if((G=h.o)&&G.onExpirationUpdated)G.onExpirationUpdated(C,
F)},onEvent:function(C){h.dispatchEvent(C);if(C.type=="drmsessionupdate"&&x){x=!1;C=Date.now()/1E3-h.Ga;var F=a.C||h.getStats();C>=0&&(F.o=C);a.ka&&Fc(a.ka)}}};D=Kz(a,l);Jk(a.M,D);B=function(){return a.we(z)};A={config:k,xk:q,Ok:v,Xk:w,Nk:y,we:B,wk:u,networkingEngine:D,aj:f,Jk:function(C){h.K&&fA(a,C)}};h=new Uu(b,d,c,A);return E.return(h)})}
function bA(a,b){var c,d,e,f;return H(function(g){if(g.i==1)return c=a.h.manifest.retryParameters,g.h(Xm(b,a.M,c),2);d=g.j;Fe(d)?(e=ob(),e.Ea()==="WEBKIT"&&(d="application/vnd.apple.mpegurl")):d==="video/quicktime"&&(f=ob(),f.Ea()==="CHROMIUM"&&(d="video/mp4"));return g.return(d)})}
function jA(a,b,c){c=c===void 0?null:c;ob();if(!c&&!Lc())return!0;if(b){if((a.i||Mc()).canPlayType(b)=="")return!1;if(c)return a.h.streaming.fallbackToNativeHlsOnMseError&&Fe(b)&&(c.code==4040||c.code==4041);if(!Lc(ob())||!Ic.has(b))return!0;if(Fe(b))return ob().Ea()==="WEBKIT"&&(a.h.drm.servers["com.apple.fps"]||a.h.drm.servers["com.apple.fps.1_0"])?a.h.streaming.useNativeHlsForFairPlay:a.h.streaming.preferNativeHls;if(b==="application/dash+xml"||b==="video/vnd.mpeg.dash.mpd")return a.h.streaming.preferNativeDash}return!1}
function qA(a,b){var c=a.h.textDisplayFactory;a.oh!==c||(b===void 0?0:b)?(b=a.F,a.F=c(a),a.F.configure(a.h.textDisplayer),b?(a.F.setTextVisibility(b.isTextVisible()),b.destroy().catch(function(){})):a.F.setTextVisibility(a.Oa),a.H&&ls(a.H,a.F),a.oh=c,a.l&&Qt(a.l)):a.F&&a.F.configure(a.h.textDisplayer)}
function Zz(a){var b,c,d;return H(function(e){if(e.i==1)return ob(),Uz(a,"media-source"),a.h.mediaSource.useSourceElements&&Jj(a.i),qA(a),b=rA(a.i,a.F,{Je:function(){return a.keySystem()},onMetadata:function(f,g,h){f=t(f);for(var k=f.next();!k.done;k=f.next())if(k=k.value,k.data&&typeof k.cueTime=="number"&&k.frames){var l=k.cueTime+g,m=h;m&&l>m&&(m=l);for(var n=t(k.frames),p=n.next();!p.done;p=n.next())mA(a,l,m,"org.id3",p.value);if(a.D)a.D.onHlsTimedMetadata(k,l)}},Hk:function(f){a.eb&&bt(a.eb,
{schemeIdUri:f.schemeIdUri,startTime:f.startTime,endTime:f.endTime,id:String(f.id),emsg:f});if(a.Ya){if(jn.includes(f.schemeIdUri.trim())){var g={schemeIdUri:f.schemeIdUri,startTime:f.startTime,endTime:f.eventDuration==4294967295?f.startTime:f.endTime,id:String(f.id),source:"emsg",kind:"",data:null,node:null};if(f.messageData&&f.messageData.length)if(f.schemeIdUri.trim().endsWith(":bin"))g.data=f.messageData;else{var h=null;try{b:{var k=Ib(f.messageData);try{for(var l=t(sd(k,!1)||[]),m=l.next();!m.done;m=
l.next()){var n=m.value;if(typeof n!="string"&&!n.tagName.startsWith("?")){h=n;break b}}}catch(p){}h=null}}catch(p){}h&&(g.data=gn(h),g.data||(g.node=h))}f=g}else f=null;f&&bt(a.Ya,f)}},onEvent:function(f){return a.dispatchEvent(f)},Kk:function(){a.I&&a.I.update&&a.I.update()},Sb:function(){return a.drmInfo()}},a.ka,a.h.mediaSource),c=a.h.manifest,d=c.segmentRelativeVttTiming,b.Ga=d,e.h(b.O.promise,2);a.H=b;e.l()})}
function sA(a,b){a.N=new ts({hg:function(){return b.playbackRate},Wc:function(){return b.defaultPlaybackRate},Ei:function(c){b.playbackRate=c},Ck:function(c){var d=b.currentTime;if(Vq(b.buffered,d)&&!(b.readyState<=HTMLMediaElement.HAVE_CURRENT_DATA)){var e=d+c,f=a.Za();if(e<f.start)d!==f.start&&(b.currentTime=f.start);else if(e>f.end)d!==f.end&&(b.currentTime=f.end);else{if(c<0)for(c=Xq(b.buffered),d=c.length-1;d>=0;d--)if(e>=c[d].start){e>c[d].end&&(e=Math.max(c[d].start,c[d].end-.5));break}b.currentTime=
e}}},isPaused:function(){return b.paused}})}
function tA(a,b,c){a.o.Jb(b,["playing","pause","ended"],function(){uA(a)});a.o.J(b,"ratechange",function(){vA(a)});var d=Qj(ob(),b);d&&(a.o.J(d,"connect",function(){a.l&&d.state=="connected"&&wA(a);xA(a)}),a.o.J(d,"connecting",function(){return xA(a)}),a.o.J(d,"disconnect",function(){return H(function(f){if(f.i==1)return a.l&&d.state=="disconnected"?f.h(eu(a.l),3):f.A(2);f.i!=2&&wA(a);xA(a);f.l()})}));b.audioTracks&&a.o.Jb(b.audioTracks,["addtrack","removetrack","change"],function(){xA(a)});b.videoTracks&&
a.o.Jb(b.videoTracks,["addtrack","removetrack","change"],function(){xA(a)});(b.webkitPresentationMode||b.webkitSupportsFullscreen)&&a.o.J(b,"webkitpresentationmodechanged",function(){a.pd&&qA(a,!0)});if(b.textTracks){var e=function(){a.m===yA&&a.F instanceof Gw&&wA(a);xA(a)};a.o.J(b.textTracks,"addtrack",function(f){if(f.track)switch(f=f.track,f.kind){case "metadata":zA(a,f);break;case "chapters":AA(a,f);break;default:e()}});a.o.Jb(b.textTracks,["removetrack","change"],e)}b.preload!="none"&&(a.o.Ra(b,
"loadedmetadata",function(){var f=a.C,g=Date.now()/1E3-c;g>=0&&(f.H=g)}),a.Qh()||(a.Ba=new Fz(b),a.Ba.start(function(){a.Ba.release();a.Ba=null;var f=a.C,g=Date.now()/1E3-c;g>=0&&(f.u=g)},!0)||a.o.Ra(b,"loadeddata",function(){var f=a.C,g=Date.now()/1E3-c;g>=0&&(f.u=g)})))}
function hA(a,b,c,d){var e,f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D,B,A,E,C,F,G,J,Q,O,V,M,N,P,U,ea,ha,I,T;return H(function(R){switch(R.i){case 1:Uz(a,"load");e=a.i;sA(a,e);tA(a,e,b);"onchange"in window.screen&&a.o.J(window.screen,"change",function(){if(a.O.getConfiguration){var S=a.O.getConfiguration();S.preferredVideo.some(function(X){return X.hdrLevel=="AUTO"})?BA(a):a.h.preferredVideo.some(function(X){return X.hdrLevel=="AUTO"})&&a.h.abr.enabled&&(S.preferredVideo=a.h.preferredVideo,Fu(S),a.O.configure(S),
BA(a))}});f=!1;g=t(a.j.variants);for(h=g.next();!h.done;h=g.next())k=h.value,(l=k.video&&k.video.dependencyStream)&&(f=Ec(l));Rz(a,a.h,f);CA(a.j.presentationTimeline,a.h.playRangeStart,a.h.playRangeEnd);a.B.init(function(S,X,ka){a.j&&a.l&&S!=a.l.u&&DA(a,S,!0,X===void 0?!1:X,ka===void 0?0:ka)},function(S,X){var ka,ma=(ka=a.l)==null?void 0:ka.u;(S=ma&&ma[S])&&a.disableStream(S,X)});a.B.setMediaElement(e);a.B.setCmsdManager(a.Ma);a.l=EA(a);a.l.configure(a.h.streaming);m=a.ra.h.slice();a.ra.h=[];n=t(m);
for(p=n.next();!p.done;p=n.next())u=p.value,a.qh(u.start,u.end);a.m=FA;a.dispatchEvent(Sz("streaming"));q=c;case 2:w=a.l.u;w||(y=GA(a,!0),c||(q=y));x=[];v=w||q;z=t([v.video,v.audio]);for(D=z.next();!D.done;D=z.next())(B=D.value)&&!B.segmentIndex&&(x.push(B.createSegmentIndex()),B.dependencyStream&&x.push(B.dependencyStream.createSegmentIndex()));if(!(x.length>0)){R.A(4);break}return R.h(Promise.all(x),4);case 4:if(!v||v.disabledUntilTime!=0){R.A(2);break}BA(a);if(a.I&&a.I.onInitialVariantChosen)a.I.onInitialVariantChosen(v);
a.j.isLowLatency&&(a.h.streaming.lowLatencyMode?a.configure(a.tf):Wa("Low-latency live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details."));a.K&&dz(a.K,b*1E3);CA(a.j.presentationTimeline,a.h.playRangeStart,a.h.playRangeEnd);Et(a.l,a.h.playRangeStart,a.h.playRangeEnd);return R.h(HA(a),7);case 7:a.sa=!0;a.dispatchEvent(Sz("canupdatestarttime"));A=function(S){a.G=IA(a,S);a.Kb=
JA(a,S);KA(a,e,!1)};a.h.streaming.startAtSegmentBoundary||(E=a.T,E==null&&a.j.startTime&&(E=a.j.startTime),A(E));if(w){R.A(8);break}if(!a.h.streaming.startAtSegmentBoundary){R.A(9);break}C=a.j.presentationTimeline;a.T instanceof Date&&(G=C.l||C.j,J=a.T.getTime()/1E3-G,J!=null&&(F=J));F==null&&(F=typeof a.T==="number"?a.T:a.isLive()?Infinity:a.i.currentTime);a.T==null&&a.j.startTime&&(F=a.j.startTime);Q=C.zb();O=C.ob();F<Q?F=Q:F>O&&(F=O);return R.h(LA(q,F),10);case 10:V=R.j,A(V);case 9:DA(a,q,!0,!1,
0);case 8:a.G.ready();M=a.qb().find(function(S){return S.active});if(!M){if(N=MA(a,q))Ku(a.C.l,N,!0),N?(a.Oa=!0,a.F.setTextVisibility(!0)):(a.Oa=!1,a.F.setTextVisibility(!1));N&&a.Oa&&(Pt(a.l,N),NA(a))}return R.h(a.l.start(d),11);case 11:a.h.abr.enabled&&(a.B.enable(),OA(a));xA(a);a.j.variants.some(function(S){return S.primary});P=a.oa();U=a.j.serviceDescription;ea=!!U&&(U.targetLatency!=null||U.maxLatency!=null||U.minLatency!=null||U.maxPlaybackRate!=null||U.minPlaybackRate!=null);if(P&&(a.h.streaming.liveSync&&
a.h.streaming.liveSync.enabled||ea||a.h.streaming.liveSync.panicMode)||a.h.streaming.vodDynamicPlaybackRate)ha=function(){return PA(a)},a.o.J(e,"timeupdate",ha);P||(I=function(){return QA(a)},a.o.J(e,"timeupdate",I),QA(a),a.j.nextUrl&&(a.h.streaming.preloadNextUrlWindow>0&&(T=function(){var S;return H(function(X){if(X.i==1){S=a.Za().end-a.i.currentTime;if(isNaN(S)||!(S<=a.h.streaming.preloadNextUrlWindow))return X.A(0);a.o.pb(e,"timeupdate",T);return X.h(a.preload(a.j.nextUrl),4)}a.Cb=X.j;X.l()})},
a.o.J(e,"timeupdate",T)),a.o.J(e,"ended",function(){a.load(a.Cb||a.j.nextUrl)})));if(a.D)a.D.onManifestUpdated(P);R.l()}})}
function eA(a,b,c){c=c===void 0?!1:c;var d,e,f;return H(function(g){switch(g.i){case 1:if(!c||!a.V){g.A(2);break}a.u=a.V;a.V=null;a.td=null;a.u.O=!0;return g.h(a.u.wb(a.i),3);case 3:return g.return();case 2:return d=Date.now()/1E3,e=!0,a.u=a.we({Ec:a.M,onError:function(h){Yz(a,h)},li:function(){},onExpirationUpdated:function(){var h=Sz("expirationupdated");a.dispatchEvent(h)},onEvent:function(h){a.dispatchEvent(h);if(h.type=="drmsessionupdate"&&e){e=!1;h=a.C;var k=Date.now()/1E3-d;k>=0&&(h.o=k)}}}),
a.u.configure(a.h.drm),f=Vf([b]),a.u.O=!0,g.h(el(a.u,[f],[]),4);case 4:return g.h(a.u.wb(a.i),0)}})}
function iA(a,b,c){var d,e,f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D,B,A,E,C,F,G,J,Q,O,V;return H(function(M){switch(M.i){case 1:Uz(a,"src-equals");d=a.i;a.G=new Es(d);e=!1;a.sd.push(function(){e=!0});a.dispatchEvent(Sz("canupdatestarttime"));a.T!=null&&a.G.pf(a.T);a.Kb=RA(a,a.T||0);sA(a,d);KA(a,d,!0);d.textTracks&&(qA(a),f=function(N){if(!(a.F instanceof Gw)){var P=SA(a).find(function(U){return U.mode!=="disabled"});P&&(P.mode=N?"showing":"hidden")}},a.o.J(d,"enterpictureinpicture",function(){return f(!0)}),
a.o.J(d,"leavepictureinpicture",function(){return f(!1)}),g=ob(),(h=Qj(g,d))?a.o.Jb(h,["connect","connecting","disconnect"],function(){f(!1)}):"webkitCurrentPlaybackTargetIsWireless"in d&&a.o.J(d,"webkitcurrentplaybacktargetiswirelesschanged",function(){return f(!1)}),k=d,(k.webkitPresentationMode||k.webkitSupportsFullscreen)&&a.o.J(k,"webkitpresentationmodechanged",function(){k.webkitPresentationMode?f(k.webkitPresentationMode!=="inline"):k.webkitSupportsFullscreen&&f(k.webkitDisplayingFullscreen)}));
tA(a,d,b);l=ez(a.K,a.ba,c);if(!(a.Y&&a.h.streaming.processSrcEqualMetadata&&$h(a.Y))){M.A(2);break}n=!1;p=a.h.streaming.retryParameters;u=Kk([l],p);q=a.M.request(0,u);wk(a.mh,q);v=function(N){N.request===u&&(N=N.headers,!N["content-length"]||N["icy-br"]||N["icy-description"]||N["icy-genre"]||N["icy-name"]||N["icy-url"])&&(n=!0,q.abort())};a.addEventListener("downloadheadersreceived",v);M.o(3,4);return M.h(q.promise,6);case 6:w=M.j,m=yb(w.data),y=new Blob([w.data],{type:a.Y}),l=URL.createObjectURL(y),
a.ie=l;case 4:M.F();a.removeEventListener("downloadheadersreceived",v);M.G(2);break;case 3:x=M.m();if(!n)throw x;M.A(4);break;case 2:!l.includes("#t=")&&(a.h.playRangeStart>0||isFinite(a.h.playRangeEnd))&&(l+="#t=",a.h.playRangeStart>0&&(l+=a.h.playRangeStart),isFinite(a.h.playRangeEnd)&&(l+=","+a.h.playRangeEnd));if(!a.H){M.A(7);break}return M.h(a.H.destroy(),8);case 8:a.H=null;case 7:return Jj(d),d.src=l,z=ob(),z.Ka()=="TV"&&d.load(),d.preload!="none"&&!d.autoplay&&Fe(c)&&z.Ea()==="WEBKIT"&&d.load(),
a.m=yA,a.ra.h.length!=0&&(Wa("Skip ranges are not supported for src= playback; ignoring"),a.ra.h=[]),a.dispatchEvent(Sz("streaming")),D=function(){return new Promise(function(N){var P=new $e(N);a.o.J(d.textTracks,"change",function(){return P.ha(.5)});P.ha(.5)})},B=Promise.withResolvers(),vs(d,HTMLMediaElement.HAVE_METADATA,a.o,function(){return H(function(N){if(N.i==1)return a.G.ready(),a.Y&&Fe(a.Y)?N.h(D(),3):(B.resolve(),N.A(0));B.resolve();N.l()})}),vs(d,HTMLMediaElement.HAVE_CURRENT_DATA,a.o,
function(){var N,P,U,ea,ha;return H(function(I){if(I.i==1)return I.h(D(),2);if(e)return I.return();TA(a);N=SA(a);N.some(function(T){return T.mode==="showing"})&&(a.Oa=!0,a.F.setTextVisibility(!0));if(!(a.F instanceof Gw))for(P=!1,U=t(N),ea=U.next();!ea.done;ea=U.next())ha=ea.value,ha.mode!=="disabled"&&(P?(ha.mode="disabled",Wa("Found more than one enabled text track, disabling it",ha)):(UA(a,ha),P=!0));VA(a);I.l()})}),d.error?B.reject(Xz(a)):d.preload=="none"&&(Wa('With <video preload="none">, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),
B.resolve()),a.o.Ra(d,"error",function(){B.reject(Xz(a))}),M.h(df(a.h.streaming.loadTimeout,B.promise),9);case 9:if((A=a.oa())&&(a.h.streaming.liveSync&&a.h.streaming.liveSync.enabled||a.h.streaming.liveSync.panicMode)||a.h.streaming.vodDynamicPlaybackRate)E=function(){return PA(a)},a.o.J(d,"timeupdate",E);A||(C=function(){return QA(a)},a.o.J(d,"timeupdate",C),QA(a));a.D&&(a.D.onManifestUpdated(A),A&&(F=a.Za().end,a.o.J(d,"progress",function(){var N=a.Za().end;F!=N&&(a.D.onManifestUpdated(a.oa()),
F=N)})));if(a.Y&&m&&(G=Yh(m,a.Y),G.length))for(J=a.i.duration,Q=t(G),O=Q.next();!O.done;O=Q.next())V=O.value,mA(a,0,J,"org.id3",V);return M.h(HA(a),10);case 10:a.sa=!0,M.l()}})}function TA(a){var b=a.h.preferredAudio;if(b.length&&a.i&&a.i.audioTracks){var c=a.jc();b=t(b);for(var d=b.next();!d.done;d=b.next())if(d=d.value,d.language&&(d=Pf(c,d.language,d.role,!1)[0])){a.Sg(d);break}}}
function VA(a){var b=a.qb();if(!b.some(function(d){return d.active})){var c=Rf(b,a.h.preferredText);if(c.length)a.Jc(c[0]);else{if(a.i&&a.i.audioTracks&&a.h.accessibility.handleForcedSubtitlesAutomatically&&(c=Array.from(a.i.audioTracks).find(function(d){return d.enabled}))&&(c=Pf(b,c.language,"",!0),c.length)){a.Jc(c[0]);return}a.Jc(null)}}}
function zA(a,b){if(b.kind=="metadata"){b.mode="hidden";var c=function(){if(b.cues){for(var e=[],f=t(b.cues),g=f.next(),h={};!g.done;h={Pb:void 0},g=f.next())h.Pb=g.value,h.Pb.startTime!=null&&"type"in h.Pb&&(g=e.find(function(k){return function(l){return l.startTime==k.Pb.startTime&&l.endTime==k.Pb.endTime}}(h)),g||(g={type:h.Pb.type,startTime:h.Pb.startTime,endTime:h.Pb.endTime,values:[]},e.push(g)),g.values.push(h.Pb.value));e=t(e);for(f=e.next();!f.done;f=e.next())f=f.value,a.D&&(f.values.some(function(k){return k.key==
"X-ASSET-URI"||k.key=="X-ASSET-LIST"})&&(h=f.startTime==0&&!a.oa(),f.values.push({key:"CUE",description:"",data:h?"ONCE,PRE":"ONCE",mimeType:null,pictureType:null})),a.D.onHLSMetadata(f))}};a.o.J(b,"cuechange",function(){if(b.activeCues)for(var e=t(b.activeCues),f=e.next();!f.done;f=e.next())if(f=f.value,mA(a,f.startTime,f.endTime,f.type,f.value),a.D)a.D.onCueMetadataChange(f.value);c()});c();var d=(new $e(function(){var e=WA(a);e=t(e);for(var f=e.next();!f.done;f=e.next())f.value.mode="hidden"})).hb().ha(.5);
a.sd.push(function(){d.stop()})}}function dA(a,b,c){b=(new Map).set("startTime",b.startTime).set("endTime",b.endTime).set("metadataType",b.schemeIdUri).set("payload",b.payload);a.dispatchEvent(Sz(c,b))}function mA(a,b,c,d,e){a.Aa&&(b={schemeIdUri:d,startTime:b,endTime:c||Infinity,id:"",payload:e},b.id=JSON.stringify(b),bt(a.Aa,b))}function AA(a,b){if(b&&b.kind=="chapters"){b.mode="hidden";var c=(new $e(function(){b.mode="hidden"})).hb().ha(.5);a.sd.push(function(){c.stop()})}}
r.Rk=function(){for(var a=this.ua;a.h;)a.release()};r.we=function(a){return new $k(a)};
function Kz(a,b){function c(f){b()?b().dispatchEvent(f):a.dispatchEvent(f)}function d(f){b()?Vu(b(),!0,f):f()}b||(b=function(){return null});var e=new Fk(function(f,g,h,k,l){d(function(){a.B&&a.B.segmentDownloaded(f,g,h,k,l)})},function(f,g,h){g=(new Map).set("headers",f).set("request",g).set("requestType",h);c(Sz("downloadheadersreceived",g));d(function(){if(a.Ma){var k=a.Ma;if(k.i.enabled){var l=f["cmsd-static"];if(l)try{var m=new Map,n=l.split(",");for(l=0;l<n.length;l++){var p=n[l].split("=");
m.set(p[0],Cz(p[1]))}}catch(y){}if(m=f["cmsd-dynamic"]){a:{try{var u=new Map,q=m.split(";");for(m=1;m<q.length;m++){var v=q[m].split("=");u.set(v[0],Cz(v[1]))}var w=u;break a}catch(y){w=null;break a}w=void 0}w&&(k.h=w)}}}})},function(f,g,h,k){f=(new Map).set("requestType",f).set("request",g).set("context",h).set("response",k);c(Sz("downloadcompleted",f))},function(f,g,h,k,l,m){f=(new Map).set("requestType",f).set("request",g).set("context",h).set("error",k).set("httpResponseCode",l).set("aborted",
m);c(Sz("downloadfailed",f))},function(f,g,h){d(function(){if(a.K){var k=a.K,l=h;l=l===void 0?{}:l;if(f==0&&l.type){a:{switch(l.type){case 4:var m="d";break a;case 3:case 2:m="h";break a}m=void 0}m&&m!==k.B&&(k.B=m,k.h&&Qy(k.h,{sf:m,st:k.i.isLive()?"l":"v"}))}if(k.h){f==Pk&&(k.u.has(g)&&k.u.delete(g),k.u.set(g,Date.now()));m=l;var n=wz(f,m);if(n&&fz(k,n)&&oz(k,f,g,m))if(g.method==="HEAD")nz(k,g,{});else switch(f){case 0:nz(k,g,{ot:"m",su:k.o===null});break;case Pk:var p=l,u=g.uris[0];m=p.segment;
l=0;m&&(l=m.endTime-m.startTime);l={d:l*1E3,st:k.i.isLive()?"l":"v"};l.ot=sz(p);n=l.ot==="v"||l.ot==="a"||l.ot==="av"||l.ot==="tt";if(p=p.stream){var q=k.i.Ha();if(n){var v=tz(k,p.type);Number.isFinite(v)&&(l.bl=v);l.ot!=="tt"&&(v=uz(k,p.type),l.dl=q?v/Math.abs(q):v)}p.bandwidth&&(l.br=p.bandwidth/1E3);p.segmentIndex&&m&&((q=p.segmentIndex.mb(m.endTime,!0,q<0))&&(q=q.next().value)&&q!=m&&(u&&!gb(m.S(),q.S())&&(l.nor=q.S()[0]),!q.startByte&&!q.endByte||m.startByte==q.startByte&&m.endByte==q.endByte||
(u=q.startByte+"-",q.endByte&&(u+=q.endByte),l.nrr=u)),u=k.i.Ha()||1,q=uz(k,p.type)||500,m=(p=p.bandwidth)?p*(m.endTime-m.startTime)/1E3/(q/u/1E3)*k.j.rtpSafetyFactor:NaN,Number.isFinite(m)&&(l.rtp=m))}n&&l.ot!=="tt"&&(m=vz(k,l.ot)/1E3,Number.isFinite(m)&&(l.tb=m));k.i.isLive()&&(m=XA(k.i))&&(l.ltc=m);l.su=k.o===null||k.o==="r";nz(k,g,l);break;case 2:case 5:case 6:nz(k,g,{ot:"k"});break;case 4:nz(k,g,{ot:"o"});break;case 8:case 13:nz(k,g,{ot:"o"})}}}})},function(f,g,h,k){(f=b()?b().o:a.I)&&f.banLocation&&
f.banLocation(k)},function(f,g){if(g.data){var h=g.data.byteLength,k=b()?b().getStats():a.C;k&&(Su(k,h),f===0&&(k.Yh=h));h=a.K;if(h.h&&f===Pk&&(f=h.u.get(g.originalRequest),h.u.delete(g.originalRequest),rz(h)))try{var l=By(g.originalUri||g.uri);k={url:l};g.status!=null&&(k.rc=g.status);g.originalRequest&&g.originalRequest.timeToFirstByte!=null&&(k.ttfb=g.originalRequest.timeToFirstByte);g.timeMs!=null&&(k.ttlb=g.timeMs);f!=null&&(k.ts=f);g.headers&&g.headers["CMSD-Static"]&&(k.cmsds=btoa(g.headers["CMSD-Static"]));
g.headers&&g.headers["CMSD-Dynamic"]&&(k.cmsdd=btoa(g.headers["CMSD-Dynamic"]));var m=h.h,n={request:{url:l},status:g.status||0};g=k||{};var p=n.request||{},u=n.status,q=n.resourceTiming||null,v=g.url!=null?g.url:p.url;if(v){var w={url:By(v),rc:u};q&&(q.startTime!=null&&(w.ts=Math.round(m.B+q.startTime),q.responseStart!=null&&(w.ttfb=Math.round(q.responseStart-q.startTime))),q.duration!=null&&(w.ttlb=Math.round(q.duration)));var y=p.customData||{};Sy(m,"rr",Object.assign({},y.cmcd!=null?y.cmcd:{},
w,g))}}catch(x){Xa("CMCD_RESPONSE_ERROR","Could not apply CMCD data to response.",x)}}});e.configure(a.h.networking);return e}function IA(a,b){return new Hs(a.i,a.j,a.h.streaming,b,function(){a.Kb&&xm(a.Kb,!a.G.jh());a.l&&a.l.Ic();a.Z&&YA(a,"seeking")},function(c){return a.dispatchEvent(c)},function(){return a.Ha()},function(){return a.ra.h})}
function JA(a,b){var c=a.oa()||typeof b==="number"&&b>0;b=new sv(a.od,c);b.addEventListener("enter",function(h){h=h.region;nA(a,"timelineregionenter",h);ZA(a,h)});b.addEventListener("exit",function(h){nA(a,"timelineregionexit",h.region)});b.addEventListener("skip",function(h){var k=h.region;h.seeking||(nA(a,"timelineregionenter",k),nA(a,"timelineregionexit",k))});var d=new sv(a.Aa,c);d.addEventListener("enter",function(h){dA(a,h.region,"metadata")});var e=new sv(a.eb,c);e.addEventListener("enter",
function(h){h=(new Map).set("detail",h.region.emsg);a.dispatchEvent(Sz("emsg",h))});c=new sv(a.Ya,c);c.addEventListener("enter",function(h){a.dispatchEvent(Sz("scte35enter",(new Map).set("detail",h.region)))});c.addEventListener("exit",function(h){a.dispatchEvent(Sz("scte35exit",(new Map).set("detail",h.region)))});var f=new rv(a.j.presentationTimeline);f.addEventListener("change",function(h){a.dispatchEvent(Sz("timelinechange",new Map([["programDateTime",h.programDateTime],["timestamp",h.timestamp]])))});
var g=new wm(a.i);g.h.add(b);g.h.add(d);g.h.add(e);g.h.add(c);g.h.add(f);a.qd&&g.h.add(a.qd);return g}function RA(a,b){b=new sv(a.Aa,b instanceof Date||b>0);b.addEventListener("enter",function(d){dA(a,d.region,"metadata")});var c=new wm(a.i);c.h.add(b);return c}
function KA(a,b,c){a.Z=new Ep;Hp(a.Z,Gp);$A(a);$z(a);a.$a=new $e(function(){YA(a)});a.h.streaming.rebufferingGoal&&a.$a.La(.25);a.o.J(b,"waiting",function(){return YA(a,"waiting")});a.o.J(b,"canplaythrough",function(){return YA(a,"canplaythrough")});a.o.J(b,"playing",function(){return YA(a,"playing")});a.o.J(b,"seeked",function(){return YA(a,"seeked")});a.o.J(b,"timeupdate",function(){return YA(a,"timeupdate")});c&&(a.o.J(b,"progress",function(){return YA(a,"progress")}),a.o.J(b,"stalled",function(){return YA(a,
"stalled")}))}function $A(a){var b=a.h.streaming.rebufferingGoal;a.Z.l.set(Fp,Math.min(.5,b/2)).set(Gp,b)}
function YA(a,b){if(a.h.streaming.rebufferingGoal){b=a.H?Cr(a.H):!1;b=a.Jd()||b||a.G.Rh();var c=a.Ha()<0?Yq(a.i.buffered,a.i.currentTime):Wq(a.i.buffered,a.i.currentTime),d=a.Z,e=d.l.get(d.h);Hp(d,b||c>=e&&c>0?Fp:Gp)&&$z(a)}else if(b){c=a.Z;d=a.i.currentTime;e=c.i;c.i=d;var f=void 0;switch(b){case "seeking":case "waiting":c.i=-1;f=Gp;break;case "canplaythrough":case "playing":case "seeked":f=Fp;break;case "timeupdate":e>=0&&d-e>.01&&(f=Fp)}f!==void 0&&Hp(c,f)&&$z(a)}}
function rA(a,b,c,d,e){return new vr(a,b,c,e,d)}function fA(a,b){b=b===void 0?a.j:b;a.K&&(b=b?b.serviceDescription:null,a=a.K,a.F=b?b.clientDataReporting:null,$y(a))}
function Iz(a){return new qt({ri:function(){var b;if((b=a.l)!=null)for(var c=t(b.i.values()),d=c.next();!d.done;d=c.next())d=d.value,d.ya||d.Xa||Kt(b,d,0)},Ha:function(){return a.Ha()},qk:function(b,c){var d,e;if((d=a.l)==null)b=void 0;else a:{var f=d.h.U;d=t(d.i.values());for(var g=d.next();!g.done;g=d.next()){g=g.value;var h=g.stream.segmentIndex;if(h&&(h=h.mb(b)))for(var k=h.next().value;k&&k.startTime<c;){k=(k.startTime+k.endTime)/2;if(k>=b&&k<c&&Mr(f,g.type,k)){b=!0;break a}k=h.next().value}}b=
!1}return(e=b)!=null?e:!1}})}
function EA(a){return new yt(a.j,{Hb:function(){return a.G?a.G.vd():0},getBandwidthEstimate:function(){return a.B.getBandwidthEstimate()},Ha:function(){return a.Ha()},video:a.i,U:a.H,Ec:a.M,onError:function(b){return Yz(a,b)},onEvent:function(b){return a.dispatchEvent(b)},dd:function(b,c,d,e,f){var g=b.startTime,h=b.endTime,k=c.type;if(k!=zc){if(a.G){a.G.ji();var l=Jr(a.H,k),m;if(m=!a.oa()&&a.i.paused&&!a.i.seeking)m=a.H,m=!(m.K||m.Pa);m&&l!=null&&l>0&&a.G.vd()<l&&!ur(a.G.vd(),l,.001)&&a.G.pf(l)}YA(a)}d=
(new Map).set("start",g).set("end",h).set("contentType",k).set("isMuxed",d).set("isDependency",e).set("mediaTimestamp",f);a.dispatchEvent(Sz("segmentappended",d));a.B&&c.fastSwitching&&b.Fc&&b.Ld&&a.B.trySuggestStreams()},Ik:function(b,c){(c=c.bd)&&a.qd&&Am(a.qd,c,b)},xh:function(b,c){var d=a.u;if(d.i.parseInbandPsshEnabled&&!d.H&&["audio","video"].includes(b)){b=new Zk(yb(c));c=0;for(var e=t(b.data),f=e.next();!f.done;f=e.next())c+=f.value.length;if(c==0)d=Promise.resolve();else{c=new Uint8Array(c);
e=0;b=t(b.data);for(f=b.next();!f.done;f=b.next())f=f.value,c.set(f,e),e+=f.length;nl(d,"cenc",c);d=d.m.promise}}else d=Promise.resolve();return d},disableStream:function(b,c){return a.disableStream(b,c)},ol:function(b,c){return a.h.abr.enabled&&c.fastSwitching&&b.Fc&&b.Ld?!1:!0},Je:function(){return a.keySystem()}},a.ra)}
r.configure=function(a,b){var c=this.getConfiguration();arguments.length==2&&typeof a=="string"&&(a=vu(a,b));a.manifest&&a.manifest.dash&&"disableXlinkProcessing"in a.manifest.dash&&(Dj("manifest.dash.disableXlinkProcessing configuration","It is now automatically detected if the manifest has Xlink."),delete a.manifest.dash.disableXlinkProcessing);a.manifest&&a.manifest.msf&&"useFetchCatalog"in a.manifest.msf&&(Dj("manifest.msf.useFetchCatalog configuration","MSF requires the catalog to be retrieved with a SUBSCRIBE that joins the current Group, so it is always subscribed to."),
delete a.manifest.msf.useFetchCatalog);a.manifest&&a.manifest.msf&&"subscribeFilterType"in a.manifest.msf&&(Dj("manifest.msf.subscribeFilterType configuration","A subscription at the live edge now always joins the current Group from its first Object."),delete a.manifest.msf.subscribeFilterType);a.textDisplayer&&"captionsUpdatePeriod"in a.textDisplayer&&(Dj("textDisplayer.captionsUpdatePeriod configuration","Captions are now updated based on the cue timings, so this configuration is no longer needed."),
delete a.textDisplayer.captionsUpdatePeriod);aB(a);var d=Eu(this.h,a,Jz(this));bB(this,c);return d};r.lj=function(a){this.tf=a};
function bB(a,b){a.Zd=new hr(a.h,a.Pa,a.u);if(a.I){var c=nd(a.h.manifest);a.i&&a.i.nodeName==="AUDIO"&&(c.disableVideo=!0);a.I.configure(c)}a.u&&a.u.configure(a.h.drm);if(a.l){a.l.configure(a.h.streaming);try{a.m!=Tz&&jr(a.Zd,a.j)&&xA(a)}catch(e){Yz(a,e)}a.B&&BA(a);c=a.l.u;!c||c.allowedByApplication&&c.allowedByKeySystem||Pz(a)}a.M&&a.M.configure(a.h.networking);a.H&&(a.H.configure(a.h.mediaSource),a.H.Ga=a.h.manifest.segmentRelativeVttTiming);a.F&&qA(a);a.B&&(a.B.configure(a.h.abr),a.h.abr.enabled?
a.B.enable():a.B.disable(),OA(a));a.Z&&$A(a);a.$a&&(a.h.streaming.rebufferingGoal?a.$a.La(.25):a.$a.stop());a.j&&CA(a.j.presentationTimeline,a.h.playRangeStart,a.h.playRangeEnd);a.D&&a.D.configure(a.h.ads);a.K&&a.K.configure(a.h.cmcd);a.Ma&&a.Ma.configure(a.h.cmsd);a.Qa&&a.Qa.configure(a.h.queue);c=a.m==FA||a.m==yA;a.h.accessibility.speechToText.enabled?a.L?a.L.configure(a.h.accessibility.speechToText):(a.L=new Rw(a),a.L.configure(a.h.accessibility.speechToText),c&&wA(a)):a.L&&(a.L.release(),a.L=
null,c&&wA(a));if(a.m==FA&&a.O.getConfiguration){c=a.O.getConfiguration();var d=!1;pd(b.preferredVideo)!=pd(a.h.preferredVideo)&&(c.preferredVideo=a.h.preferredVideo,d=!0);pd(b.preferredAudio)!=pd(a.h.preferredAudio)&&(c.preferredAudio=a.h.preferredAudio,d=!0);d?(Fu(c),a.O.configure(c),Pz(a)):!b.abr.enabled&&a.h.abr.enabled&&(c.preferredVideo=a.h.preferredVideo,Fu(c),a.O.configure(c),a.j&&a.B&&BA(a))}b=Sz("configurationchanged");a.dispatchEvent(b)}
r.getConfiguration=function(){var a=Jz(this);Eu(a,this.h,Jz(this));return a};r.Gj=function(){return this.tf};r.Rj=function(){var a=Jz(this);Eu(a,this.h,Jz(this));return xu(this.h,Jz(this))};r.Hh=function(){if(this.i){var a=this.i.buffered.length;a=a?this.i.buffered.end(a-1):0;var b=Math.min(this.i.currentTime+this.h.streaming.bufferingGoal,this.Za().end);if(a>=b)return 1;if(!(a<=this.i.currentTime)&&a<b)return(a-this.i.currentTime)/(b-this.i.currentTime)}return 0};
r.Tk=function(){var a=this.getConfiguration(),b;for(b in this.h)delete this.h[b];Eu(this.h,Jz(this),Jz(this));bB(this,a)};r.dg=function(){return this.m};r.Jh=function(){return this.j?this.j.type:null};r.Xc=function(){return this.i};r.Qj=function(){return this.M};r.He=function(){return this.ba};r.fg=function(){return this.Y};r.zj=function(){var a;return Array.from(((a=this.Aa)==null?void 0:a.h.values())||[])};r.yj=function(){var a;return Array.from(((a=this.eb)==null?void 0:a.h.values())||[])};
r.Aj=function(){var a;return Array.from(((a=this.Ya)==null?void 0:a.h.values())||[])};r.Cj=function(){var a;return Array.from(((a=this.od)==null?void 0:a.h.values())||[])};r.xj=function(){return this.D?this.D:null};r.Wj=function(){return this.Qa?this.Qa:null};r.isLive=function(){return this.j&&!this.Ca()?this.j.presentationTimeline.isLive():this.i&&(this.i.src||this.Ca())?this.i.duration==Infinity:!1};r.ad=function(){return this.j?this.j.presentationTimeline.ad():!1};
r.oa=function(){return this.isLive()||this.ad()};r.Qh=function(){if(this.j&&!this.Ca()){var a=this.j.variants;return a.length?a.every(function(b){return!b.video}):!1}return this.i&&(this.i.src||this.Ca())?this.i.videoTracks?this.i.videoTracks.length==0:this.i.videoHeight==0:!1};
r.Vh=function(){if(this.j&&!this.Ca()){var a=this.j.variants;return a.length?a.every(function(b){return!b.audio&&!!b.video&&!b.video.codecs.includes(",")}):!1}return this.i&&(this.i.src||this.Ca())&&this.i.audioTracks?this.i.audioTracks.length==0:!1};
r.Za=function(){if(this.j&&!this.Ca()){if(!this.sa&&this.j.type=="HLS")return{start:0,end:0};var a=this.j.presentationTimeline;return{start:a.zb(),end:a.ob()}}if(this.i&&(this.i.src||this.Ca())&&(a=this.i.seekable)&&a.length){var b=this.h?this.h.playRangeStart:0;b=Math.max(a.start(0),b);var c=this.h?this.h.playRangeEnd:Infinity;a=Math.min(a.end(a.length-1),c);return{start:b,end:a}}return{start:0,end:0}};r.gk=function(){this.oa()&&(this.i.currentTime=this.Za().end)};r.kk=function(){return this.sa};
r.keySystem=function(){return Zb(this.drmInfo())};r.drmInfo=function(){return this.u?this.u.Sb():null};r.cg=function(){return this.u?this.u.cg():Infinity};r.ag=function(){return this.u?this.u.ag():[]};r.Lg=function(a){this.u&&this.u.Lg(a)};r.Pg=function(a,b){var c=this,d;return H(function(e){return e.i==1?c.u?e.h(c.u.Pg(a,b),3):e.A(2):e.i!=2?(d=e.j,e.return(d)):e.return(!1)})};r.Ie=function(){return this.u?this.u.Ie():{}};r.Sh=function(){return this.Z?this.Z.h==Gp:!!this.ba};
r.Ha=function(){return this.i?this.N?this.N.i:1:0};r.gh=function(a){this.m==FA&&this.l&&Mt(this.l,a)};r.qh=function(a,b){if(this.m==yA)return Wa("addSkipRange() is not supported for src= playback; ignoring"),!1;var c;if(c=this.j)c=this.j.sequenceMode||this.j.presentationTimeline.oa()?!1:!0,c=!c;return c?!1:this.ra.add(a,b)};r.Sk=function(a,b){this.ra.remove(a,b)};r.ij=function(){this.ra.h=[]};r.Zj=function(){return this.ra.h.map(function(a){return{start:a.start,end:a.end}})};
r.Wd=function(a,b){b=b===void 0?!0:b;if(a==0)Wa("A trick play rate of 0 is unsupported!");else{var c=this.i.playbackRate,d=this.N.i;this.N.set(a);this.m==FA&&(this.B.playbackRateChanged(a),this.gh(b&&a!=1));cB(this,a);c===0&&this.i.playbackRate===0&&a!=d&&vA(this)}};r.xd=function(){var a=this.N.Wc();this.m==yA&&this.N.set(a);this.m==FA&&(this.N.set(a),this.B.playbackRateChanged(a),this.gh(!1));this.Nb.Ta()};
r.jc=function(){if(this.j&&!this.Ca()){for(var a=this.l?this.l.u:null,b=[],c=0,d=t(this.j.variants),e=d.next();!e.done;e=d.next())if(e=e.value,Nf(e)){var f=Ef(e);f.active=e==a;f.active||c==1||a==null||e.video!=a.video||e.audio!=a.audio||(f.active=!0);f.active&&c++;b.push(f)}return b}if(this.i&&this.i.audioTracks){var g=dB(this);a=Array.from(this.i.audioTracks);return a.length?a.map(function(h){return Mf(h,g)}):g?[Mf(null,g)]:[]}return[]};
r.qb=function(){if(this.j){if(this.Ca())return[];for(var a=this.l?this.l.F:null,b=[],c=t(this.j.textStreams),d=c.next();!d.done;d=c.next()){d=d.value;var e=Ff(d);e.active=d==a;b.push(e)}this.L&&b.push.apply(b,wa(this.L.qb()));return b}if(this.i&&this.i.src&&this.i.textTracks){a=SA(this);var f=this.F.isTextVisible();a=a.map(function(g){return Lf(g,f)});this.L&&a.push.apply(a,wa(this.L.qb()));return a}return[]};r.Lj=function(){var a=this.ee;this.j&&(a=this.j.imageStreams);return a.map(function(b){return Gf(b)})};
r.Bj=function(a){var b=this,c,d;return H(function(e){if(e.i==1)return e.h(eB(b,a),2);c=e.j;if(!c)return e.return(null);d=[];c.segmentIndex.Rb(function(f){var g=fB(f.tilesLayout||c.tilesLayout);if(g)for(var h=g.rows*g.columns,k=(f.l-f.startTime)/h,l=0;l<h;l++){var m=gB(f,c,f.startTime+l*k,g);if(!m)break;d.push(m)}});return e.return(d)})};function fB(a){return a?(a=/(\d+)x(\d+)/.exec(a))?{columns:parseInt(a[1],10),rows:parseInt(a[2],10)}:null:null}
r.ck=function(a,b){var c=this,d,e,f,g;return H(function(h){if(h.i==1)return h.h(eB(c,a),2);d=h.j;if(!d)return h.return(null);e=d.segmentIndex.find(b);if(e==null)return h.return(null);f=d.segmentIndex.get(e);return(g=fB(f.tilesLayout||d.tilesLayout))?h.return(gB(f,d,b,g)):h.return(null)})};
function eB(a,b){var c,d,e;return H(function(f){if(f.i==1){if(a.m!=FA&&a.m!=yA)return f.return(null);c=a.ee;a.j&&(c=a.j.imageStreams);d=c[0];if(!d)return f.return(null);b!=null&&(d=c.find(function(g){return g.id==b}));return d?d.segmentIndex?f.A(2):f.h(d.createSegmentIndex(),2):f.return(null)}d.closeSegmentIndex&&(a.Xb.has(d)||(e=new $e(function(){d&&(d.closeSegmentIndex(),a.Xb.delete(d))}),a.Xb.set(d,e)),a.Xb.get(d).ha(5));return f.return(d)})}
function gB(a,b,c,d){var e=a.S();if(!e.length)return null;var f=b.width||0,g=b.height||0,h=f/d.columns,k=g/d.rows,l=d.columns*d.rows,m=a.l-a.startTime;m=a.C||m/l;var n=a.startTime,p=0,u=0;l>1&&(u=Math.floor((c-a.startTime)/m+1E-4),n=a.startTime+u*m,p=u%d.columns*h,u=Math.floor(u/d.columns)*k);if(n>=a.endTime||ur(n,a.endTime,1E-4))return null;d=!1;if(c=a.thumbnailSprite)d=!0,k=c.height,p=c.positionX,u=c.positionY,h=c.width;return{segment:a,imageHeight:g,imageWidth:f,height:k,positionX:p,positionY:u,
startTime:n,duration:m,uris:e,startByte:a.hc(),endByte:a.ec(),width:h,sprite:d,mimeType:a.mimeType||b.mimeType,codecs:a.codecs||b.codecs}}
r.Jc=function(a){var b=this,c=!1;this.L&&a&&(c=this.L.qb().includes(a));this.L&&!c&&this.L.disable();if(!a||c)this.L&&c&&a&&this.L.enable(a),wA(this),hB(this,!1);else{c=function(){var d=b.j.textStreams.find(function(e){return e.id==a.id});d?d!=b.l.F&&(Ku(b.C.l,d,!1),Pt(b.l,d),wA(b),NA(b),hB(b,!0)):b.Ca()};if(this.j&&this.G&&(c(),!this.Ca()))return;(function(){if(b.i&&b.i.textTracks){var d=SA(b),e=d.find(function(h){return Jf(h)===a.id});if(e){if(b.F instanceof Gw){d=t(d);for(var f=d.next();!f.done;f=
d.next()){f=f.value;var g=f===e?b.Oa?"showing":"hidden":"disabled";f.mode!==g&&(f.mode=g)}}else d=d.find(function(h){return h.mode!=="disabled"}),d!==e&&(d&&(d.mode="disabled",b.o.pb(d,"cuechange"),b.F.remove(0,Infinity)),e&&UA(b,e));wA(b);NA(b);hB(b,!0)}}})()}};
function UA(a,b){a.o.J(b,"cuechange",function(){a.F.remove(0,Math.max(0,a.i.currentTime-a.h.streaming.bufferBehind));var c={periodStart:0,segmentStart:0,segmentEnd:a.i.duration,vttOffset:0,isMpegTs:!1},d=[],e=Array.from(b.activeCues||[]);e=t(e);for(var f=e.next();!f.done;f=e.next()){f=f.value;if(f.endTime===Infinity||f.endTime<f.startTime)f=null;else{var g=new Ld(f.startTime,f.endTime,f.text);g.line=typeof f.line==="number"?f.line:null;f.lineAlign&&(g.lineAlign=f.lineAlign);g.lineInterpretation=f.snapToLines?
Qd:1;g.position=typeof f.position==="number"?f.position:null;f.positionAlign&&(g.positionAlign=f.positionAlign);g.size=f.size;g.textAlign=f.align;f.vertical==="lr"?g.writingMode="vertical-lr":f.vertical==="rl"&&(g.writingMode="vertical-rl");f.region&&(g.region.id=f.region.id,g.region.height=f.region.lines,g.region.heightUnits=2,g.region.regionAnchorX=f.region.regionAnchorX,g.region.regionAnchorY=f.region.regionAnchorY,g.region.scroll=f.region.scroll,g.region.viewportAnchorX=f.region.viewportAnchorX,
g.region.viewportAnchorY=f.region.viewportAnchorY,g.region.viewportAnchorUnits=bd,g.region.width=f.region.width,g.region.widthUnits=bd);Xd(g);f=g}f&&((g=a.h.mediaSource.modifyCueCallback)&&g(f,null,c),d.push(f))}a.F.append(d)});b.mode=document.pictureInPictureElement?"showing":"hidden"}
r.Sg=function(a,b,c){function d(){var f=e.j.variants.find(function(h){return h.id==a.id});if(f){if(Nf(f)){var g=e.l.u;e.h.abr.enabled&&(g.video!=f.video||g.audio&&f.audio&&g.audio.language==f.audio.language&&g.audio.channelsCount==f.audio.channelsCount&&g.audio.label==f.audio.label)&&Wa("Changing tracks while abr manager is enabled will likely result in the selected track being overridden. Consider disabling abr before calling selectVariantTrack().");e.Ca()?DA(e,f,!1,!1,0):DA(e,f,!1,b||!1,c||0);f=
{preferredAudio:[{language:f.language||"",role:f.audio&&f.audio.roles&&f.audio.roles[0]||"",label:f.audio&&f.audio.label||"",channelCount:f.audio&&f.audio.channelsCount||0,codec:"",spatialAudio:f.audio&&f.audio.spatialAudio?f.audio.spatialAudio:!1}],preferredVideo:[{label:f.video&&f.video.label||"",role:f.video&&f.video.roles&&f.video.roles[0]||"",language:f.video&&f.video.language||"",codec:f.video&&f.video.codecs||"",hdrLevel:f.video&&f.video.hdr||"",layout:f.video&&f.video.videoLayout||""}],language:"",
role:"",videoRole:"",channelCount:0,hdrLevel:"",spatialAudio:!1,videoLayout:"",audioLabel:"",videoLabel:"",preferredAudioCodecs:[],preferredAudioChannelCount:0,codecSwitchingStrategy:e.h.mediaSource.codecSwitchingStrategy,audioCodec:f.audio&&f.audio.codecs?f.audio.codecs:"",activeAudioCodec:g.audio&&g.audio.codecs?g.audio.codecs:"",activeAudioChannelCount:g.audio&&g.audio.channelsCount?g.audio.channelsCount:0,keySystem:e.keySystem()};Fu(f);e.O.configure(f);BA(e)}}else e.Ca()}var e=this;b=b===void 0?
!1:b;c=c===void 0?0:c;if(this.j&&this.G&&(d(),!this.Ca()))return;(function(){if(a.originalAudioId&&e.i&&e.i.audioTracks){var f=Array.from(e.i.audioTracks);f=t(f);for(var g=f.next();!g.done;g=f.next())if(g=g.value,Jf(g)==a.id){iB(e,g);break}}})()};
r.Yk=function(a,b){function c(){var f=e.O.getConfiguration();f.audioCodec=a.codecs||"";f.preferredAudio=[{language:a.language,role:a.roles[0]||"",label:a.label||"",channelCount:a.channelsCount||0,codec:"",spatialAudio:a.spatialAudio}];var g=e.l.u;if(g=g&&g.audio)f.activeAudioCodec=g.codecs||"",f.activeAudioChannelCount=g.channelsCount||0,d(g.language,a.language);Fu(f);e.O.configure(f);Pz(e,!0,b,!1,!1)}function d(f,g){if(f!=g&&e.h.accessibility.handleForcedSubtitlesAutomatically){var h=e.qb(),k=h.find(function(m){return m.active}),
l=k?mc(k.language):null;f=mc(f);g=mc(g);if(!k||l==f&&l!=g&&k.forced)h=Pf(h,g,"",!0),h.length&&e.Jc(h[0])}}var e=this;b=b===void 0?0:b;if(this.j&&this.G&&(c(),!this.Ca()))return;(function(){if(e.i&&e.i.audioTracks){var f=mc(a.language),g=Array.from(e.i.audioTracks),h=null,k=null;a.id!=null&&(h=g.find(function(u){return Jf(u)===a.id}));g=t(g);for(var l=g.next();!l.done;l=g.next()){l=l.value;if(!h){var m=l.language||"und",n=l.kind||"",p=a.roles&&a.roles.length?a.roles[0]:"";(l.label||"")==(a.label||
"")&&mc(m)==f&&n==p&&(h=l)}l.enabled&&(k=l)}h&&(k&&d(k.language,h.language),iB(e,h))}})()};
r.getAudioTracks=function(){if(this.j&&!this.Ca()){var a=this.jc();if(!a.length)return[];var b=a.find(function(g){return g.active});if(!b)return[];var c=a;if(this.m==FA&&!this.Ca()){var d=jB(this),e=d.get(b.id);c=a.filter(function(g){var h=d.get(g.id);return!!h&&!!e&&Bp(h,e)&&(g.audioCodec||we.includes(g.audioMimeType||""))})}if(!c.length)return[];a=new Map;c=t(c);for(b=c.next();!b.done;b=c.next()){var f=b.value;b=[f.language,f.originalLanguage,f.label||"",(f.audioRoles||[]).join(","),f.channelsCount,
f.spatialAudio,f.audioCodec?Ae(f.audioCodec):"",f.accessibilityPurpose||""].join("_");f={active:f.active,language:f.language,label:f.label,mimeType:f.audioMimeType,codecs:f.audioCodec,primary:f.primary,roles:f.audioRoles||[],accessibilityPurpose:f.accessibilityPurpose,channelsCount:f.channelsCount,audioSamplingRate:f.audioSamplingRate,spatialAudio:f.spatialAudio,originalLanguage:f.originalLanguage};a.has(b)?!a.get(b).active&&f.active&&a.set(b,f):a.set(b,f)}return Array.from(a.values())}return this.i&&
this.i.audioTracks?Array.from(this.i.audioTracks).map(function(g){var h=g.language;h={id:Jf(g),active:g.enabled,language:mc(h||"und"),label:g.label,mimeType:null,codecs:null,primary:g.kind=="main",roles:[],accessibilityPurpose:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,originalLanguage:h};g.kind&&(g.kind=="description"&&(h.accessibilityPurpose="visually impaired"),h.roles.push(g.kind));g.configuration&&(g.configuration.codec&&(h.codecs=g.configuration.codec),g.configuration.sampleRate&&
(h.audioSamplingRate=g.configuration.sampleRate),g.configuration.numberOfChannels&&(h.channelsCount=g.configuration.numberOfChannels));return h}):[]};
r.Zk=function(a,b,c){b=b===void 0?!1:b;c=c===void 0?0:c;var d=this.jc();if(d.length){var e=d.find(function(k){return k.active});if(e){d=d.filter(function(k){return(k.videoBandwidth||k.bandwidth)==a.bandwidth&&k.width==a.width&&k.height==a.height&&k.frameRate==a.frameRate&&k.pixelAspectRatio==a.pixelAspectRatio&&k.hdr==a.hdr&&k.colorGamut==a.colorGamut&&k.videoLayout==a.videoLayout&&k.videoMimeType==a.mimeType&&k.videoCodec==a.codecs&&gb(k.videoRoles,a.roles)&&(k.videoLanguage||"und")==(a.language||
"und")&&k.videoLabel==a.label});var f;d.length==1?f=d[0]:f=d.find(function(k){return k.audioId===e.audioId});if(!f&&this.j){var g=jB(this),h=g.get(e.id);f=d.find(function(k){k=g.get(k.id);return!!k&&!!h&&Ap(k,h)})}f&&!f.active&&this.Sg(f,b,c)}}};function jB(a){var b=new Map;a=t(a.j.variants);for(var c=a.next();!c.done;c=a.next())c=c.value,Nf(c)&&b.set(c.id,c);return b}
r.getVideoTracks=function(){if(this.m==yA||this.Ca())return[];var a=this.jc();if(!a.length)return[];var b=a.find(function(h){return h.active});if(!b)return[];var c=a;if(!this.Vh()&&this.j){c=jB(this);var d=c.get(b.id);b=[];d&&(b=Array.from(c.values()).filter(function(h){return!!h.video&&Ap(h,d)}));var e=new Set(b.map(function(h){return h.id}));c=a.filter(function(h){return h.active||e.has(h.id)})}if(!c.length)return[];a=new Map;b=t(c);for(c=b.next();!c.done;c=b.next()){var f=c.value;(c=f.originalVideoId)||
f.videoId==null||(c=String(f.videoId));if(c){f={active:f.active,language:f.videoLanguage||"und",bandwidth:f.videoBandwidth||f.bandwidth,width:f.width,height:f.height,frameRate:f.frameRate,pixelAspectRatio:f.pixelAspectRatio,hdr:f.hdr,colorGamut:f.colorGamut,videoLayout:f.videoLayout,mimeType:f.videoMimeType,codecs:f.videoCodec,roles:f.videoRoles||[],label:f.videoLabel};var g=a.get(c);(!g||!g.active&&f.active)&&a.set(c,f)}}return Array.from(a.values())};
r.Fj=function(){var a=this.ce;this.j&&(a=this.j.chapterStreams);a=a.map(function(c){return If(c)});var b=kB(this);b.length&&a.push.apply(a,wa(b.map(function(c){return{id:Jf(c),type:"chapter",bandwidth:0,language:mc(c.language||"und")}})));return a};
r.Ej=function(a){var b=this,c,d,e,f,g,h,k,l,m,n,p,u,q;return H(function(v){switch(v.i){case 1:c=lB(b,a);if(c.length)return v.return(c);d=b.ce;b.j&&(d=b.j.chapterStreams);if(!d.length)return v.return([]);e=mc(a);f=d.filter(function(w){return mc(w.language)==e});if(!f.length)return v.return([]);g=[];h=new Set;k=t(f);l=k.next();m={};case 2:if(l.done){v.A(4);break}n=l.value;if(n.segmentIndex){v.A(5);break}return v.h(n.createSegmentIndex(),5);case 5:m.Ac=0;p=void 0;b.isLive()&&((p=b.j)==null?void 0:p.type)===
"HLS"&&(u=b.j.presentationTimeline,q=void 0,m.Ac=Math.max(0,(q=u.l)!=null?q:u.j));n.segmentIndex.Rb(function(w){return function(y){var x=y.getMetadata();if(x){var z=x.title,D=y.startTime+"-"+y.endTime+"-"+z;w.Ac>0&&y.endTime-w.Ac<0&&(w.Ac=0);y={id:D,title:z,startTime:Math.max(0,y.startTime-w.Ac),endTime:Math.max(0,y.endTime-w.Ac),images:x.images};h.has(D)||(g.push(y),h.add(D))}}}(m));m={Ac:void 0};l=k.next();v.A(2);break;case 4:return v.return(g)}})};
function lB(a,b){a=kB(a);if(!a.length)return[];var c=mc(b),d=a.filter(function(h){return mc(h.language)==c});if(!d||!d.length)return[];b=[];a=new Set;d=t(d);for(var e=d.next();!e.done;e=d.next())if((e=e.value)&&e.cues){e=t(e.cues);for(var f=e.next();!f.done;f=e.next()){var g=f.value;(f=g.id)&&f!=""||(f=g.startTime+"-"+g.endTime+"-"+g.text);g={id:f,title:g.text,startTime:g.startTime,endTime:g.endTime,images:[]};a.has(f)||(b.push(g),a.add(f))}}return b}
function SA(a){return Array.from(a.i.textTracks).filter(function(b){return b.kind!="metadata"&&b.kind!="chapters"&&b.label!="Shaka Player TextTrack"})}function WA(a){return Array.from(a.i.textTracks).filter(function(b){return b.kind=="metadata"})}function kB(a){return a.i&&a.i.textTracks?Array.from(a.i.textTracks).filter(function(b){return b.kind=="chapters"}):[]}
function hB(a,b){b=!!b;a.Oa!=b&&(a.Oa=b,a.m==FA?(a.F.setTextVisibility(b),b?a.l.F||(b=Rf(a.j.textStreams,a.h.preferredText),b.length>0&&(Pt(a.l,b[0]),wA(a),NA(a))):Lt(a.l)):a.i&&a.i.src&&a.i.textTracks&&a.F.setTextVisibility(b))}
r.Sj=function(){if(this.G)var a=this.G.vd();else{if(this.T==null)return new Date;if(this.T instanceof Date)return this.T;a=this.T}if(this.j&&!this.Ca()){var b=this.j.presentationTimeline,c=b.Mh(a);return c!=null?new Date(c*1E3):new Date((b.j+a)*1E3)}return this.i&&this.i.getStartDate?(b=this.i.getStartDate(),b instanceof Date&&!isNaN(b.getTime())?new Date(b.getTime()+a*1E3):null):null};
r.Lh=function(){if(this.j&&!this.Ca()){var a=this.j.presentationTimeline;a=a.l||a.j;return a===null?null:new Date(a*1E3)}return this.i&&this.i.getStartDate?(a=this.i.getStartDate(),a instanceof Date&&!isNaN(a.getTime())?a:null):null};r.Ke=function(){return this.isLive()?this.j?this.j.presentationTimeline.Ke():null:null};r.dc=function(){if(this.m==FA)return this.H.dc();var a={total:[],audio:[],video:[],text:[]};this.m==yA&&(a.total=Xq(this.i.buffered));return a};
function XA(a){if(!a.i||!a.i.currentTime)return null;var b=a.Lh();return b?Math.floor(Date.now()-(b.getTime()+a.i.currentTime*1E3)):null}r.getBandwidthEstimate=function(){return this.B?this.B.getBandwidthEstimate():NaN};
r.getStats=function(){if(this.m!=FA&&this.m!=yA)return{width:NaN,height:NaN,currentCodecs:"",streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,stallsDetected:NaN,gapsJumped:NaN,estimatedBandwidth:NaN,completionPercent:NaN,loadLatency:NaN,timeToFirstFrame:NaN,manifestTimeSeconds:NaN,drmTimeSeconds:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,liveLatency:NaN,maxSegmentDuration:NaN,manifestSizeBytes:NaN,bytesDownloaded:NaN,nonFatalErrorCount:NaN,manifestPeriodCount:NaN,
manifestGapCount:NaN,switchHistory:[],stateHistory:[]};uA(this);var a=this.i,b=a.currentTime/a.duration;isNaN(b)||this.oa()||Ou(this.C,Math.round(100*b));this.G&&(this.C.Y=this.G.ih(),this.C.Z=this.G.kh());a.getVideoPlaybackQuality&&(b=a.getVideoPlaybackQuality(),Mu(this.C,Number(b.droppedVideoFrames),Number(b.totalVideoFrames)),this.C.O=Number(b.corruptedVideoFrames));Pu(this.C,this.u?xl(this.u):NaN);Nu(this.C,a.videoWidth||NaN,a.videoHeight||NaN);this.C.m="";this.oa()&&(a=XA(this),a!=null&&Qu(this.C,
a/1E3));b=this.jc().find(function(e){return e.active});a=this.qb().find(function(e){return e.active});if(b){if(b.bandwidth){var c=this.N?this.N.i:1,d=c*b.bandwidth;a&&a.bandwidth&&(d+=c*a.bandwidth);this.C.D=d}b.width&&b.height&&Nu(this.C,b.width||NaN,b.height||NaN);b=b.codecs;a&&(b+=","+(a.codecs||a.mimeType));b&&(this.C.m=b)}this.m!=FA||this.Ca()||(this.j&&(this.C.K=this.j.periodCount,this.C.I=this.j.gapCount,this.j.presentationTimeline&&Ru(this.C,this.j.presentationTimeline.i)),a=this.B.getBandwidthEstimate(),
this.C.C=a);this.m==yA&&Su(this.C,NaN);return Tu(this.C)};
r.Zi=function(a,b,c,d,e,f,g){var h=this;g=g===void 0?!1:g;var k=function(){var l,m,n,p,u,q,v,w,y,x,z,D;return H(function(B){switch(B.i){case 1:if(h.m!=FA&&h.m!=yA)throw new L(1,7,7004);c!="subtitles"&&c!="captions"&&Wa("Using a kind value different of `subtitles` or `captions` can cause unwanted issues.");a=zk(a);if(d){B.A(2);break}return B.h(mB(h,a),3);case 3:d=B.j;case 2:l=[];h.D&&(l=h.D.getCuePoints());if(h.m!=yA){B.A(4);break}m=ob();g&&m.Ea()==="WEBKIT"&&(c="forced");return B.h(nB(h,a,b,c,d,f||
"",l),5);case 5:n=B.j;if(n.track)return xA(h),wA(h),B.return(Lf(n.track,h.F.isTextVisible()));throw new L(1,2,2012);case 4:p=Bc;u=h.Za();q=u.end-u.start;h.j&&(q=h.j.presentationTimeline.getDuration());if(q==Infinity)throw new L(1,4,4033);if(!l.length){B.A(6);break}return B.h(oB(h,a),7);case 7:v=B.j,w=pB(h,v,d,l),y=new Blob([w],{type:"text/vtt"}),a=yr(y),d="text/vtt";case 6:x=Uf({id:h.ge++,segmentIndex:Gm(0,q,[a]),mimeType:d||"",codecs:e||"",kind:c,language:b,originalLanguage:b,label:f||null,type:p.Ua,
forced:!!g,external:!0});z=ve(x.mimeType,x.codecs);D=Pe(z);if(!D)throw new L(2,2,2014,d);h.j.textStreams.push(x);xA(h);wA(h);return B.return(Ff(x))}})}();this.sa||qB(this,k);return k};
r.$i=function(a,b){var c=this,d=function(){var e,f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D,B;return H(function(A){switch(A.i){case 1:if(c.m!=FA&&c.m!=yA)throw new L(1,7,7004);a=zk(a);if(b){A.A(2);break}return A.h(mB(c,a),3);case 3:b=A.j;case 2:if(b!="text/vtt")throw new L(1,2,2017,a);e=Bc;f=c.Za();g=f.end-f.start;c.j&&(g=c.j.presentationTimeline.getDuration());if(g==Infinity)throw new L(1,4,4045);return A.h(oB(c,a),4);case 4:h=A.j;k=Oe(b);if(!k)throw new L(2,2,2014,b);l=k();m={periodStart:0,segmentStart:0,
segmentEnd:g,vttOffset:0,isMpegTs:!1};n=yb(h);p=l.parseMedia(n,m,a,[]);u=[];q=t(p);v=q.next();for(w={};!v.done;w={lf:void 0,Uc:void 0},v=q.next())w.Uc=v.value,w.lf=null,y=function(E){return function(){E.lf==null&&(E.lf=xk([a],[E.Uc.payload]));return E.lf||[]}}(w),x=new rm(w.Uc.startTime,w.Uc.endTime,y,0,null,null,0,0,Infinity),w.Uc.payload.includes("#xywh")&&(z=w.Uc.payload.split("#xywh=")[1].split(","),z.length===4&&x.Gi({height:parseInt(z[3],10),positionX:parseInt(z[0],10),positionY:parseInt(z[1],
10),width:parseInt(z[2],10)})),u.push(x);D=b;if(!u.length){A.A(5);break}return A.h(mB(c,u[0].S()[0]),6);case 6:D=A.j;case 5:return B=Uf({id:c.ge++,segmentIndex:new Em(u),mimeType:D||"",kind:"",language:"und",type:e.Wi,tilesLayout:"1x1",external:!0}),c.m==yA?c.ee.push(B):c.j.imageStreams.push(B),xA(c),A.return(Gf(B))}})}();this.sa||qB(this,d);return d};
r.Yi=function(a,b,c){var d=this,e=function(){var f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D;return H(function(B){switch(B.i){case 1:if(d.m!=FA&&d.m!=yA)throw new L(1,7,7004);a=zk(a);if(c){B.A(2);break}return B.h(mB(d,a),3);case 3:c=B.j;case 2:f=Bc;g=d.Za();h=g.end-g.start;d.j&&(h=d.j.presentationTimeline.getDuration());if(h==Infinity)throw new L(1,4,4055);k=Oe(c);if(!k)throw new L(2,2,2014,c);return B.h(oB(d,a),4);case 4:l=B.j;m=k();n={periodStart:0,segmentStart:0,segmentEnd:h,vttOffset:0,isMpegTs:!1};p=yb(l);
u=m.parseMedia(p,n,a,[]);q=[];v=t(u);for(w=v.next();!w.done;w=v.next())y=w.value,x=new rm(y.startTime,y.endTime,function(){return[]},0,null,null,0,0,Infinity),z={title:y.payload,images:[]},x.Tg(z),q.push(x);D=Uf({id:d.ge++,segmentIndex:new Em(q),mimeType:"text/plain",kind:"",language:b,originalLanguage:b,type:f.Ui,external:!0});d.m==FA?d.j.chapterStreams.push(D):d.ce.push(D);xA(d);return B.return(If(D))}})}();this.sa||qB(this,e);return e};
function mB(a,b){var c;return H(function(d){switch(d.i){case 1:return d.o(2),d.h(Xm(b,a.M,a.h.streaming.retryParameters),4);case 4:c=d.j;d.u(3);break;case 2:d.m();case 3:if(c)return d.return(c);throw new L(1,2,2011,b);}})}
function nB(a,b,c,d,e,f,g){var h,k,l,m;return H(function(n){if(n.i==1)return e!="text/vtt"||g.length?n.h(oB(a,b),3):n.A(2);n.i!=2&&(h=n.j,k=pB(a,h,e,g),l=new Blob([k],{type:"text/vtt"}),b=yr(l),e="text/vtt");m=document.createElement("track");var p=a.K,u=b;if(p.h&&fz(p,"segment"))try{var q=gz(p);q.ot="c";q.su=!0;var v=Wy(u,q,hz(p,u))}catch(w){Xa("CMCD_TEXT_TRACK_ERROR","Could not generate text track CMCD data.",w),v=u}else v=u;m.src=v;m.label=f;m.kind=d;m.srclang=c;a.i.getAttribute("crossorigin")||
a.i.setAttribute("crossorigin","anonymous");a.i.appendChild(m);a.rf.push(m);return n.return(m)})}function oB(a,b){var c,d,e,f;return H(function(g){if(g.i==1){c=Pk;d=a.h.streaming.retryParameters;e=Kk([b],d);e.method="GET";var h=a.K;h.h&&fz(h,"segment")&&nz(h,e,{ot:"c",su:!0});return g.h(a.M.request(c,e).promise,2)}f=g.j;return g.return(f.data)})}
function pB(a,b,c,d){var e=Oe(c);if(e)return c=e(),a={periodStart:0,segmentStart:0,segmentEnd:a.i.duration,vttOffset:0,isMpegTs:!1},b=yb(b),b=c.parseMedia(b,a,null,[]),Jx(b,d);throw new L(2,2,2014,c);}r.il=function(a,b){this.Pa.width=a;this.Pa.height=b};
r.Qg=function(a){var b;if(!(b=this.m!=FA)){b=this.l;a=a===void 0?.1:a;if(b.m.h)b=!1;else if(b.G)b=!1;else{for(var c=t(b.i.values()),d=c.next();!d.done;d=c.next())d=d.value,!d.Yc||d.ya||d.Xa||(d.Yc=!1,Kt(b,d,a));b=!0}b=!b}if(b)return!1;Oz(this,!1);return!0};r.eg=function(){Wa("Shaka Player's internal Manifest structure is NOT covered by semantic versioning compatibility guarantees.  It may change at any time!  Please consider filing a feature request for whatever you use getManifest() for.");return this.j};
r.Nj=function(){return this.Yb};
r.Jj=function(){var a={video:null,audio:null,text:null};if(this.m!=FA)return a;var b=this.l.u,c=this.i.currentTime;b=t([b.video,b.audio,this.l.F]);for(var d=b.next();!d.done;d=b.next())if((d=d.value)&&d.segmentIndex){var e=d.segmentIndex.find(c);e=d.segmentIndex.get(e);var f=void 0,g=void 0,h=void 0,k=void 0,l=void 0,m=void 0,n={codecs:(k=(f=e)==null?void 0:f.codecs)!=null?k:d.codecs,mimeType:(l=(g=e)==null?void 0:g.mimeType)!=null?l:d.mimeType,bandwidth:(m=(h=e)==null?void 0:h.bandwidth)!=null?m:
d.bandwidth};d.type=="video"?(n.width=d.width,n.height=d.height,a.video=n):d.type=="audio"?a.audio=n:d.type==zc&&(a.text=n)}return a};
function Jz(a){var b=zu();b.streaming.failureCallback=function(c){if(a.oa()){var d=null;c.code==1001||c.code==1002?(d=1,a.h.streaming.lowLatencyMode&&(d=.1)):c.code==1003&&(d=.1);d!=null&&(c.severity=1,a.Qg(d))}};b.textDisplayFactory=function(c){if(a.pd){var d=a.i;d=d.webkitDisplayingFullscreen||d.webkitPresentationMode&&d.webkitPresentationMode!="inline"?!1:!0}else d=!1;return d?new fx(c):"track"in document.createElement("track")?new Gw(c):new ex};return b}r.ll=function(a){this.pd=a};
function LA(a,b){var c,d,e,f,g;return H(function(h){if(h.i==1)return c=a.audio,d=a.video,e=function(k,l){var m,n,p;return H(function(u){if(u.i==1)return k?k.segmentIndex?u.A(2):u.h(k.createSegmentIndex(),2):u.return(null);n=(m=k.segmentIndex.mb(l))?m.next().value:null;if(!n)return u.return(null);p=n.startTime;return u.return(p)})},h.h(e(c,b),2);if(h.i!=3)return f=h.j,h.h(e(d,b),3);g=h.j;return g!=null&&f!=null?h.return(Math.max(g,f)):g!=null?h.return(g):f!=null?h.return(f):h.return(b)})}
function $z(a){var b=a.Sh();if(a.C&&a.Z&&a.G){if(a.h.streaming.rebufferingGoal==0){var c=a.N;c.l=!1;us(c)}else c=a.N,c.l=b,us(c);a.K&&mz(a.K,b?"r":"p");uA(a);c=a.h.streaming.liveSync.dynamicTargetLatency.maxAttempts;if(a.h.streaming.liveSync.dynamicTargetLatency.enabled&&b&&a.je<c){c=a.h.streaming.liveSync.dynamicTargetLatency.maxLatency;var d=a.h.streaming.liveSync.targetLatencyTolerance,e=a.h.streaming.liveSync.dynamicTargetLatency.rebufferIncrement;a.na&&(a.na=Math.min(a.na+ ++a.je*e,c-d))}}b=
(new Map).set("buffering",b);a.dispatchEvent(Sz("buffering",b))}function vA(a){var b=a.i.playbackRate;b==0?(b=a.Ha(),b!==0&&b!==1&&(b=Sz("ratechange"),a.dispatchEvent(b))):(a.N&&(a.N.set(b),a.m==FA&&a.B.playbackRateChanged(b),cB(a,b)),b=Sz("ratechange"),a.dispatchEvent(b))}
function cB(a,b){a.Nb.Ta();a.Nb.J(a.i,"timeupdate",function(){var c=a.i.currentTime,d=a.Za(),e=a.oa(),f=e?a.h.streaming.safeSeekOffset:0;b>0?e&&b>1&&Math.floor(c)>=Math.floor(d.end)&&a.xd():Math.floor(c)<=Math.floor(d.start+f)&&a.xd()})}
function uA(a){if(a.C&&a.Z){var b=a.C.h,c="playing";a.Z.h==Gp?c="buffering":a.Jd()?c="ended":a.i.paused&&(c="paused");var d=c;if(b.h==null)b.h={timestamp:Date.now()/1E3,state:d,duration:0},b=!0;else{var e=Date.now()/1E3;b.h.duration=e-b.h.timestamp;b.h.state==d?b=!1:(b.i.push(b.h),b.h={timestamp:e,state:d,duration:0},b=!0)}b&&(c=(new Map).set("newstate",c),a.dispatchEvent(Sz("statechanged",c)))}}
function PA(a){var b=a.i.playbackRate,c=a.oa();if(a.h.streaming.vodDynamicPlaybackRate&&!c){var d=a.h.streaming.vodDynamicPlaybackRateLowBufferRate,e=a.Hh();e<=a.h.streaming.vodDynamicPlaybackRateBufferRatio?b!=d&&a.Wd(d,!1):e==1&&b!==a.N.Wc()&&a.xd()}if(c&&(c=a.Za(),Number.isFinite(c.end)&&!(a.i.currentTime<c.start||a.i.paused))){d=a.h.streaming.liveSync.targetLatencyTolerance;e=a.h.streaming.liveSync.dynamicTargetLatency.enabled;var f=a.h.streaming.liveSync.dynamicTargetLatency.stabilityThreshold;
if(a.h.streaming.liveSync&&a.h.streaming.liveSync.enabled){var g=a.h.streaming.liveSync.targetLatency;var h=g+d;var k=Math.max(0,g-d);var l=a.h.streaming.liveSync.maxPlaybackRate;var m=a.h.streaming.liveSync.minPlaybackRate}else a.j&&a.j.serviceDescription&&(g=a.j.serviceDescription.targetLatency,a.j.serviceDescription.targetLatency!=null?h=a.j.serviceDescription.targetLatency+d:a.j.serviceDescription.maxLatency!=null&&(h=a.j.serviceDescription.maxLatency),a.j.serviceDescription.targetLatency!=null?
k=Math.max(0,a.j.serviceDescription.targetLatency-d):a.j.serviceDescription.minLatency!=null&&(k=a.j.serviceDescription.minLatency),l=a.j.serviceDescription.maxPlaybackRate||a.h.streaming.liveSync.maxPlaybackRate,m=a.j.serviceDescription.minPlaybackRate||a.h.streaming.liveSync.minPlaybackRate);a.na||typeof g!=="number"||(a.na=g);var n=a.h.streaming.liveSync.dynamicTargetLatency.maxAttempts;e&&a.Mb&&a.na!==null&&typeof g==="number"&&a.je<n&&Date.now()-a.Mb>f*1E3&&(f=a.h.streaming.liveSync.dynamicTargetLatency.minLatency,
a.na=Math.max(a.na-(g-f)/2,f+d),a.Mb=Date.now());e&&a.na!==null&&(h=a.na+d,k=a.na-d);g=c.end-a.i.currentTime;d=0;a.m==yA&&(e=a.i.buffered,e.length>0&&(d=e.end(e.length-1),d=Math.max(l,d-c.end)));c=a.h.streaming.liveSync.panicMode;e=a.h.streaming.liveSync.panicThreshold*1E3;f=Date.now()-a.Z.j;c&&!m&&(m=a.h.streaming.liveSync.minPlaybackRate);c&&m&&f<=e?b!=m&&a.Wd(m,!1):h!=void 0&&l&&g-d>h?(b!=l&&a.Wd(l,!1),a.Mb=null):k!=void 0&&m&&g-d<k?(b!=m&&a.Wd(m,!1),a.Mb=null):b!==a.N.Wc()&&(a.xd(),a.Mb=Date.now())}}
function rB(a,b,c){return(ur(b,c,.01)||c>b)&&a.qf<b?(a.qf=b,!0):!1}function QA(a){if(a.i){var b=a.Za();b=b.end-b.start;b=b>0?a.i.currentTime/b:0;if(!isNaN(b)){b*=100;if(rB(a,0,b))var c=Sz("started");else if(rB(a,25,b))c=Sz("firstquartile");else if(rB(a,50,b))c=Sz("midpoint");else if(rB(a,75,b))c=Sz("thirdquartile");else{if(rB(a,100,b)||b>100)c=Sz("complete");a.h&&a.h.playRangeEnd!=Infinity&&a.Jd()&&a.i.pause()}c&&a.dispatchEvent(c)}}}
function BA(a){try{mr(a.Zd,a.j)}catch(f){return Yz(a,f),!1}var b=a.j.isLowLatency&&a.h.streaming.lowLatencyMode,c=Of(a.j.variants),d=a.O.create(c);d=Array.from(d.values());if(a.h.abr.allowAudioFallback){var e=ob();e=!(a.h.mediaSource.codecSwitchingStrategy=="smooth"&&e.gb(a.keySystem()));d.push.apply(d,wa(Cp(d,c,e)))}a=a.B.setVariants(d,b);return typeof a=="boolean"?a:!0}
function GA(a,b){b=b===void 0?!1:b;if(BA(a)){if(!a.h.abr.enabled){var c=a.O.getLastAdaptationSet();if(c&&(c=Array.from(c.values()),c.length)){var d=a.l.u;if(d&&d.video&&(c=c.find(function(e){return e.video==d.video})))return c}}return a.B.chooseVariant(b)}return null}function MA(a,b){var c=null,d=Rf(a.j.textStreams,a.h.preferredText);d.length&&(c=d[0]);!c&&b.audio&&a.h.accessibility.handleForcedSubtitlesAutomatically&&(d=Pf(a.j.textStreams,b.audio.language,"",!0),d.length&&(c=d[0]));return c}
function Pz(a,b,c,d,e){b=b===void 0?!0:b;c=c===void 0?0:c;d=d===void 0?!1:d;e=e===void 0?!0:e;var f=GA(a);f&&DA(a,f,e,b,c,d)}
function DA(a,b,c,d,e,f){f=f===void 0?!1:f;var g=a.l.u;if(b==g)d&&Ot(a.l,b,d,e,!0);else{var h=a.C.l;h.i!=b&&(h.i=b,h.h.push({timestamp:Date.now()/1E3,id:b.id,type:"variant",fromAdaptation:c,bandwidth:b.bandwidth}));Ot(a.l,b,d,e,f,c);d=null;g&&(d=Ef(g));e=Ef(b);e.active=!0;if(a.ka&&(f=a.ka,h=b.video)){h.dependencyStream&&(h=h.dependencyStream);var k=0,l=-1;switch(h.mimeType){case "video/webm":k=1;break;case "video/mp4":k=2}switch(a.Jh()){case "DASH":l=1;break;case "HLS":l=0}f.h&&(f.h.setLevelSwitching(h.id,
!0),f.h.setContainerFormat(k),f.h.setStreamingFormat(l))}c?(c=(new Map).set("oldTrack",d).set("newTrack",e),c=Sz("adaptation",c),sB(a,c)):tB(a,d,e);g&&Ap(g,b)&&Bp(g,b)||uB(a)}}function iB(a,b){var c=Array.from(a.i.audioTracks),d=c.find(function(f){return f.enabled});c=t(c);for(var e=c.next();!e.done;e=c.next())e=e.value,e!==b&&(e.enabled=!1);b.enabled=!0;c=dB(a);d=d?Mf(d,c):null;b=Mf(b,c);tB(a,d,b);vB(a,d,b)}
function dB(a){return a.i&&a.i.videoTracks?Array.from(a.i.videoTracks).find(function(b){return b.selected}):null}function xA(a){var b=Sz("trackschanged");sB(a,b);uB(a)}function tB(a,b,c){b=(new Map).set("oldTrack",b).set("newTrack",c);b=Sz("variantchanged",b);sB(a,b)}function vB(a,b,c){var d=!1;b&&b.audioId==c.audioId&&b.audioGroupId==c.audioGroupId||(d=!0);d&&uB(a)}function uB(a){var b=Sz("audiotrackschanged");sB(a,b)}function wA(a){var b=Sz("textchanged");sB(a,b)}
function OA(a){a.h.abr.enabled||Oz(a);var b=(new Map).set("newStatus",a.h.abr.enabled);sB(a,Sz("abrstatuschanged",b))}function NA(a){var b=a.qb().find(function(c){return c.active});b&&a.F&&a.F.setTextLanguage(b.language)}function Oz(a,b){b=b===void 0?!0:b;if(a.m==FA){a.ae.stop();for(var c=t(a.j.variants),d=c.next();!d.done;d=c.next())d=d.value,isFinite(d.disabledUntilTime)&&(d.disabledUntilTime=0);b&&BA(a)}}
r.disableStream=function(a,b){if(!(this.h.abr.enabled&&this.m!==Tz&&navigator.onLine&&b!=0&&this.j&&this.B&&this.l))return!1;if(this.j.variants.some(function(h){var k=h[a.type];return k&&k.id!==a.id&&!h.disabledUntilTime?a.type=="audio"?a.language===k.language:!0:!1})){for(var c=!1,d=!1,e=t(this.j.variants),f=e.next();!f.done;f=e.next()){f=f.value;var g=f[a.type];g&&(g.id===a.id?(f.disabledUntilTime=Date.now()/1E3+b,c=!0):g.trickModeVideo&&g.trickModeVideo.id==a.id&&(d=!0))}if(!c&&d)return!1;this.ae.La(1);
b=this.dc().video.reduce(function(h,k){return h+k.end-k.start},0);Pz(this,!1,b,!0,!1);return!0}return!1};function Lz(a,b){b instanceof L&&b.code==7E3||b instanceof L&&Yz(a,b)}
function Yz(a,b){var c,d,e,f,g;return H(function(h){switch(h.i){case 1:if(a.m==Tz)return h.return();b.severity===1&&a.C.N++;if(!a.j||!a.l||b.handled||b.code!=3016&&b.code!=3014&&b.code!=3015&&b.code!=3024&&b.code!=3018){h.A(2);break}c=Of(a.j.variants);if(!(c.length>1||a.sa)){h.A(2);break}d=ob();if(d.Ea()==="WEBKIT"&&b.code==3016)return h.return();h.o(4);return h.h(eu(a.l),6);case 6:if(e=h.j)return f=Sz("mediasourcerecovered"),a.dispatchEvent(f),h.return();h.u(2);break;case 4:h.m();case 2:g=Sz("error",
(new Map).set("detail",b)),a.dispatchEvent(g),g.defaultPrevented&&(b.handled=!0),h.l()}})}r.addFont=function(a,b){return Nj(a,b)};function nA(a,b,c,d){d=d===void 0?a:d;a=(new Map).set("detail",{schemeIdUri:c.schemeIdUri,value:c.value,startTime:c.startTime,endTime:c.endTime,id:c.id,timescale:c.timescale,eventNode:c.eventNode,urlParams:c.urlParams,values:c.values});d.dispatchEvent(Sz(b,a))}
function ZA(a,b){if(b.schemeIdUri==="urn:mpeg:dash:event:callback:2015"&&b.eventNode){var c=Cd(b.eventNode);c&&(c=c.trim())&&(c=Ck(c,b.urlParams),a.M.request(13,Kk([c],mk())).promise.catch(function(){}))}}
function oA(a,b,c,d){d=d===void 0?!1:d;b=(new Map).set("mediaQuality",{bandwidth:b.bandwidth,audioSamplingRate:b.audioSamplingRate,codecs:b.codecs,contentType:b.contentType,frameRate:b.frameRate,height:b.height,mimeType:b.mimeType,channelsCount:b.channelsCount,pixelAspectRatio:b.pixelAspectRatio,width:b.width,label:b.label,roles:b.roles,language:b.language}).set("position",c);a.dispatchEvent(Sz(d?"audiotrackchanged":"mediaqualitychanged",b))}
function Xz(a,b){b=b===void 0?!0:b;if(!a.i.error)return b?new L(2,3,3016):null;a=Db(a.i.error);var c=a.code;return b||c!==MediaError.MEDIA_ERR_ABORTED?new L(2,3,3016,c,a.rj,a.message):null}
function pA(a,b){if(a.l){var c=Sz("keystatuschanged");a.dispatchEvent(c);var d=Object.keys(b);d.length==1&&d[0]==""&&(d=["00"],b={"00":b[""]});var e=d.length==1&&d[0]=="00";c=!1;if(d.length){d=a.keySystem();for(var f=Xk(a.h.drm.clearKeys),g=function(q,v){q.allowedByKeySystem=!0;v=t(v);for(var w=v.next();!w.done;w=v.next())if(w=w.value,(w=b[e?"00":w])||a.u.H)q.allowedByKeySystem=q.allowedByKeySystem&&!!w&&!nr.includes(w)},h=t(a.j.variants),k=h.next();!k.done;k=h.next()){k=k.value;var l=Sf(k);l=t(l);
for(var m=l.next();!m.done;m=l.next()){m=m.value;var n=k.allowedByKeySystem;if(m.keyIds.size)if(m.drmInfos.length&&!f.size&&a.j.type=="HLS")for(var p=t(m.drmInfos),u=p.next();!u.done;u=p.next())u=u.value,u.keySystem==d&&(u.keyIds.size?g(k,u.keyIds):g(k,m.keyIds));else g(k,m.keyIds);n!=k.allowedByKeySystem&&(c=!0)}}}c&&(xA(a),(c=a.l.u)&&!c.allowedByKeySystem?Pz(a):BA(a))}}function CA(a,b,c){b>0&&(a.oa()||a.Hi(b));b=a.getDuration();c<b&&(a.oa()||a.sc(c))}
function sB(a,b){H(function(c){if(c.i==1)return c.h(Promise.resolve(),2);a.m!=Tz&&a.dispatchEvent(b);c.l()})}function Vz(a){if(a.m==Tz)throw new L(2,7,7E3);}r.Ca=function(){if(!this.i)return!1;var a=Qj(ob(),this.i);return a?a.state!="disconnected":!1};r.Jd=function(){return!this.i||this.i.ended?!0:this.sa&&!this.oa()&&this.i.currentTime>=this.Za().end};
function aB(a){function b(g,h){Wa(g,"has been deprecated. Please use",h,"instead.")}var c={preferredAudioLanguage:"language",preferredAudioRole:"role",preferredAudioLabel:"label",preferredAudioChannelCount:"channelCount",preferSpatialAudio:"spatialAudio"};if(Object.keys(c).some(function(g){return g in a})){var d={language:"",role:"",label:"",channelCount:0,codec:""};c=t(Object.entries(c));for(var e=c.next();!e.done;e=c.next()){var f=t(e.value);e=f.next().value;f=f.next().value;e in a&&(b(e,"preferredAudio"),
d[f]=a[e],delete a[e])}a.preferredAudio||(a.preferredAudio=[d])}"preferredAudioCodecs"in a&&(b("preferredAudioCodecs","preferredAudio"),d=a.preferredAudioCodecs,Array.isArray(d)&&d.length&&(a.preferredAudio||(a.preferredAudio=d.map(function(g){return{language:"",role:"",label:"",channelCount:0,codec:g}}))),delete a.preferredAudioCodecs);c={preferredTextLanguage:"language",preferredTextRole:"role",preferForcedSubs:"forced"};if(Object.keys(c).some(function(g){return g in a})){d={language:"",role:"",
format:""};c=t(Object.entries(c));for(e=c.next();!e.done;e=c.next())f=t(e.value),e=f.next().value,f=f.next().value,e in a&&(b(e,"preferredText"),d[f]=a[e],delete a[e]);a.preferredText||(a.preferredText=[d])}"preferredTextFormats"in a&&(b("preferredTextFormats","preferredText"),d=a.preferredTextFormats,Array.isArray(d)&&d.length&&(a.preferredText||(a.preferredText=d.map(function(g){return{language:"",role:"",format:g}}))),delete a.preferredTextFormats);c={preferredVideoLabel:"label",preferredVideoRole:"role",
preferredVideoHdrLevel:"hdrLevel",preferredVideoLayout:"layout"};if(Object.keys(c).some(function(g){return g in a})){d={label:"",role:"",language:"",codec:"",hdrLevel:"",layout:""};c=t(Object.entries(c));for(e=c.next();!e.done;e=c.next())f=t(e.value),e=f.next().value,f=f.next().value,e in a&&(b(e,"preferredVideo"),d[f]=a[e],delete a[e]);a.preferredVideo||(a.preferredVideo=[d])}"preferredVideoCodecs"in a&&(b("preferredVideoCodecs","preferredVideo"),d=a.preferredVideoCodecs,Array.isArray(d)&&d.length&&
(a.preferredVideo||(a.preferredVideo=d.map(function(g){return{label:"",role:"",language:"",codec:g,hdrLevel:"",layout:""}}))),delete a.preferredVideoCodecs)}function qB(a,b){a.ud.add(b);b.finally(function(){return a.ud.delete(b)})}function HA(a){return H(function(b){return a.ud.size?b.h(Promise.all([].concat(wa(a.ud))),0):b.return()})}K("shaka.Player",Z);Z.prototype.isEnded=Z.prototype.Jd;Z.prototype.isRemotePlayback=Z.prototype.Ca;Z.prototype.addFont=Z.prototype.addFont;
Z.prototype.setVideoContainer=Z.prototype.ll;Z.prototype.getFetchedPlaybackInfo=Z.prototype.Jj;Z.prototype.getManifestParserFactory=Z.prototype.Nj;Z.prototype.getManifest=Z.prototype.eg;Z.prototype.retryStreaming=Z.prototype.Qg;Z.prototype.setMaxHardwareResolution=Z.prototype.il;Z.prototype.addChaptersTrack=Z.prototype.Yi;Z.prototype.addThumbnailsTrack=Z.prototype.$i;Z.prototype.addTextTrackAsync=Z.prototype.Zi;Z.prototype.getStats=Z.prototype.getStats;Z.prototype.getBufferedInfo=Z.prototype.dc;
Z.prototype.getSegmentAvailabilityDuration=Z.prototype.Ke;Z.prototype.getPresentationStartTimeAsDate=Z.prototype.Lh;Z.prototype.getPlayheadTimeAsDate=Z.prototype.Sj;Z.prototype.getChaptersAsync=Z.prototype.Ej;Z.prototype.getChaptersTracks=Z.prototype.Fj;Z.prototype.getVideoTracks=Z.prototype.getVideoTracks;Z.prototype.selectVideoTrack=Z.prototype.Zk;Z.prototype.getAudioTracks=Z.prototype.getAudioTracks;Z.prototype.selectAudioTrack=Z.prototype.Yk;Z.prototype.selectVariantTrack=Z.prototype.Sg;
Z.prototype.selectTextTrack=Z.prototype.Jc;Z.prototype.getThumbnails=Z.prototype.ck;Z.prototype.getAllThumbnails=Z.prototype.Bj;Z.prototype.getImageTracks=Z.prototype.Lj;Z.prototype.getTextTracks=Z.prototype.qb;Z.prototype.getVariantTracks=Z.prototype.jc;Z.prototype.cancelTrickPlay=Z.prototype.xd;Z.prototype.trickPlay=Z.prototype.Wd;Z.prototype.getSkipRanges=Z.prototype.Zj;Z.prototype.clearSkipRanges=Z.prototype.ij;Z.prototype.removeSkipRange=Z.prototype.Sk;Z.prototype.addSkipRange=Z.prototype.qh;
Z.prototype.useTrickPlayTrackIfAvailable=Z.prototype.gh;Z.prototype.getPlaybackRate=Z.prototype.Ha;Z.prototype.isBuffering=Z.prototype.Sh;Z.prototype.getKeyStatuses=Z.prototype.Ie;Z.prototype.retryLicensing=Z.prototype.Pg;Z.prototype.renewLicense=Z.prototype.Lg;Z.prototype.getActiveSessionsMetadata=Z.prototype.ag;Z.prototype.getExpiration=Z.prototype.cg;Z.prototype.drmInfo=Z.prototype.drmInfo;Z.prototype.keySystem=Z.prototype.keySystem;Z.prototype.isFullyLoaded=Z.prototype.kk;
Z.prototype.goToLive=Z.prototype.gk;Z.prototype.seekRange=Z.prototype.Za;Z.prototype.isVideoOnly=Z.prototype.Vh;Z.prototype.isAudioOnly=Z.prototype.Qh;Z.prototype.isDynamic=Z.prototype.oa;Z.prototype.isInProgress=Z.prototype.ad;Z.prototype.isLive=Z.prototype.isLive;Z.prototype.getQueueManager=Z.prototype.Wj;Z.prototype.getAdManager=Z.prototype.xj;Z.prototype.getAllTimelineRegions=Z.prototype.Cj;Z.prototype.getAllScte35Events=Z.prototype.Aj;Z.prototype.getAllEmsgRegions=Z.prototype.yj;
Z.prototype.getAllMetadataRegions=Z.prototype.zj;Z.prototype.getMimeType=Z.prototype.fg;Z.prototype.getAssetUri=Z.prototype.He;Z.prototype.getNetworkingEngine=Z.prototype.Qj;Z.prototype.getMediaElement=Z.prototype.Xc;Z.prototype.getManifestType=Z.prototype.Jh;Z.prototype.getLoadMode=Z.prototype.dg;Z.prototype.resetConfiguration=Z.prototype.Tk;Z.prototype.getBufferFullness=Z.prototype.Hh;Z.prototype.getNonDefaultConfiguration=Z.prototype.Rj;Z.prototype.getConfigurationForLowLatency=Z.prototype.Gj;
Z.prototype.getConfiguration=Z.prototype.getConfiguration;Z.prototype.configurationForLowLatency=Z.prototype.lj;Z.prototype.configure=Z.prototype.configure;Z.prototype.releaseAllMutexes=Z.prototype.Rk;Z.prototype.destroyAllPreloads=Z.prototype.Ch;Z.prototype.preload=Z.prototype.preload;Z.prototype.detachAndSavePreload=Z.prototype.Dh;Z.prototype.unloadAndSavePreload=Z.prototype.yl;Z.prototype.load=Z.prototype.load;Z.prototype.updateStartTime=Z.prototype.Bl;Z.prototype.unload=Z.prototype.Xd;
Z.prototype.detach=Z.prototype.detach;Z.prototype.attachCanvas=Z.prototype.bj;Z.prototype.attach=Z.prototype.wb;Z.probeSupport=function(a){a=a===void 0?!0:a;var b,c,d,e,f,g,h;return H(function(k){switch(k.i){case 1:b={};if(!a){k.A(2);break}return k.h(Jl(),3);case 3:b=k.j;case 2:return c=Jc(),d=Br(),e=ob(),k.h(e.Gb(),4);case 4:return f=k.j,g={manifest:c,media:d,drm:b,hardwareResolution:f},h=wB,h.forEach(function(l,m){g[m]=l()}),k.return(g)}})};
Z.isBrowserSupported=function(){window.Promise||Wa("A Promise implementation or polyfill is required");if(!(window.Promise&&window.Uint8Array&&Array.prototype.forEach)||(navigator.userAgent||"").includes("Trident/"))return!1;ob();return Lc()?!0:Mc().canPlayType("application/x-mpegurl")!=""};Z.setQueueManagerFactory=function(a){Nz=a};Z.setAdManagerFactory=function(a){Mz=a};Z.registerSupportPlugin=function(a,b){wB.set(a,b)};Z.prototype.destroy=Z.prototype.destroy;var Tz=0,Hz=1,FA=2,yA=3;
Z.LoadMode={DESTROYED:Tz,NOT_LOADED:Hz,MEDIA_SOURCE:FA,SRC_EQUALS:yA};Z.version="v5.3.4";var xB=["5","3"];Ej=new function(a){this.h=a;this.j=Fj;this.i=Gj}(new Cj(Number(xB[0]),Number(xB[1])));var wB=new Map,Mz=null,Nz=null;function yB(){}function zB(a,b){a={priority:b||0,dj:a};for(b=0;b<AB.length;b++)if(AB[b].priority<a.priority){AB.splice(b,0,a);return}AB.push(a)}K("shaka.polyfill",yB);yB.register=zB;yB.installAll=function(){for(var a=t(AB),b=a.next();!b.done;b=a.next()){b=b.value;try{b.dj()}catch(c){Wa("Error installing polyfill!",c)}}};var AB=[];function BB(a,b,c){this.h=a;this.j=b||null;this.i=c||null;this.keySystem=a.keySystem}BB.prototype.getConfiguration=function(){var a=this.h.getConfiguration();if(a.videoCapabilities)for(var b=t(a.videoCapabilities),c=b.next();!c.done;c=b.next())c.value.encryptionScheme=this.j;if(a.audioCapabilities)for(b=t(a.audioCapabilities),c=b.next();!c.done;c=b.next())c.value.encryptionScheme=this.i;return a};BB.prototype.createMediaKeys=function(){return this.h.createMediaKeys()};function CB(a){if(cc(a))return"cbcs";if(ac(a)||bc(a)||$b(a)||a==="com.huawei.wiseplay")return"cenc";Wa("EmeEncryptionSchemePolyfill: Unknown key system:",a,"Please contribute!");return null}function DB(a){if(!a)return!1;a=a.getConfiguration();var b=a.audioCapabilities&&a.audioCapabilities[0];return(a=a.videoCapabilities&&a.videoCapabilities[0]||b)&&a.encryptionScheme!==void 0?!0:!1}function EB(a,b){return!a||a==b||(a=="cbcs"||a=="cbcs-1-9")&&ob().Kc()?!0:!1};function FB(){}var GB;function HB(){ob().kf()&&!GB&&!navigator.emeEncryptionSchemePolyfilled&&navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration&&(GB=navigator.requestMediaKeySystemAccess,navigator.requestMediaKeySystemAccess=IB,navigator.emeEncryptionSchemePolyfilled=!0)}
function IB(a,b){var c=this,d,e;return H(function(f){if(f.i==1)return f.h(GB.call(c,a,b),2);d=f.j;if(e=DB(d))return navigator.requestMediaKeySystemAccess=GB,f.return(d);navigator.requestMediaKeySystemAccess=JB;return f.return(JB.call(c,a,b))})}
function JB(a,b){var c=this,d,e,f,g,h,k,l,m,n,p,u,q;return H(function(v){if(v.i==1){d=CB(a);e=[];f=t(b);for(g=f.next();!g.done;g=f.next())h=g.value,k=KB(h.videoCapabilities,d),l=KB(h.audioCapabilities,d),h.videoCapabilities&&h.videoCapabilities.length&&!k.length||h.audioCapabilities&&h.audioCapabilities.length&&!l.length||(m=Object.assign({},h),m.videoCapabilities=k,m.audioCapabilities=l,e.push(m));if(!e.length)throw n=Error("Unsupported keySystem or supportedConfigurations."),n.name="NotSupportedError",
n.code=DOMException.NOT_SUPPORTED_ERR,n;return v.h(GB.call(c,a,e),2)}p=v.j;q=u=null;e[0]&&(e[0].videoCapabilities&&(u=e[0].videoCapabilities[0].encryptionScheme),e[0].audioCapabilities&&(q=e[0].audioCapabilities[0].encryptionScheme));return v.return(new BB(p,u,q))})}function KB(a,b){return a?a.filter(function(c){return EB(c.encryptionScheme,b)}):a}yB.EmeEncryptionScheme=FB;FB.install=HB;zB(HB);function LB(){}function MB(){"getOrInsert"in Map.prototype||(Map.prototype.getOrInsert=NB);"getOrInsertComputed"in Map.prototype||(Map.prototype.getOrInsertComputed=OB);"getOrInsert"in WeakMap.prototype||(WeakMap.prototype.getOrInsert=NB);"getOrInsertComputed"in WeakMap.prototype||(WeakMap.prototype.getOrInsertComputed=OB)}function NB(a,b){this.has(a)||this.set(a,b);return this.get(a)}function OB(a,b){this.has(a)||this.set(a,b(a));return this.get(a)}yB.Map=LB;LB.install=MB;zB(MB);function PB(){}var QB;function RB(){ob().kf()&&!QB&&!navigator.mediaCapabilitiesEncryptionSchemePolyfilled&&navigator.mediaCapabilities&&(QB=navigator.mediaCapabilities.decodingInfo,navigator.mediaCapabilities.decodingInfo=SB,navigator.mediaCapabilitiesEncryptionSchemePolyfilled=!0)}
function SB(a){var b=this,c,d,e;return H(function(f){switch(f.i){case 1:return f.h(QB.call(b,a),2);case 2:c=f.j;if(!c.supported||!a.keySystemConfiguration)return f.return(c);d=c.keySystemAccess;if(e=DB(d))return navigator.mediaCapabilities.decodingInfo=QB,f.return(c);navigator.mediaCapabilities.decodingInfo=TB;if(d){f.A(3);break}return f.h(UB(a),4);case 4:return c.keySystemAccess=f.j,f.return(c);case 3:return f.return(TB.call(b,a))}})}
function TB(a){var b=this,c,d,e,f,g,h,k;return H(function(l){switch(l.i){case 1:return d=c=null,!a.keySystemConfiguration||(e=a.keySystemConfiguration,f=e.keySystem,d=e.audio&&e.audio.encryptionScheme,c=e.video&&e.video.encryptionScheme,g=CB(f),h={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:a},EB(d,g)&&EB(c,g))?l.h(QB.call(b,a),2):l.return(h);case 2:k=l.j;if(k.keySystemAccess){k.keySystemAccess=new BB(k.keySystemAccess,c,d);l.A(3);break}if(!a.keySystemConfiguration){l.A(3);
break}return l.h(UB(a),5);case 5:k.keySystemAccess=l.j;case 3:return l.return(k)}})}
function UB(a){var b,c;return H(function(d){if(d.i==1){var e=a.keySystemConfiguration,f=[],g=[];e.audio&&f.push({robustness:e.audio.robustness||"",contentType:a.audio.contentType,encryptionScheme:e.audio.encryptionScheme});e.video&&g.push({robustness:e.video.robustness||"",contentType:a.video.contentType,encryptionScheme:e.video.encryptionScheme});e={initDataTypes:e.initDataType?[e.initDataType]:[],distinctiveIdentifier:e.distinctiveIdentifier,persistentState:e.persistentState,sessionTypes:e.sessionTypes};
f.length&&(e.audioCapabilities=f);g.length&&(e.videoCapabilities=g);b=e;return d.h(navigator.requestMediaKeySystemAccess(a.keySystemConfiguration.keySystem,[b]),2)}c=d.j;return d.return(c)})}yB.MCapEncryptionScheme=PB;PB.install=RB;zB(RB,-2);function VB(){}function WB(){ob().Lb()||(navigator.mediaCapabilities||(navigator.mediaCapabilities={}),VB.originalMcap=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=XB)}
function XB(a){var b,c,d,e,f,g,h,k,l,m,n;return H(function(p){switch(p.i){case 1:b={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:a};ob();c=a.video;d=a.audio;if(a.type!="media-source"){if(a.type=="file"){if(c&&(e=c.contentType,f=Mc().canPlayType(e)!="",!f)||d&&(g=d.contentType,h=Mc().canPlayType(g)!="",!h))return p.return(b)}else return p.return(b);p.A(2);break}if(!Lc())return p.return(b);if(!c){p.A(3);break}return p.h(YB(c),4);case 4:if(k=p.j,!k)return p.return(b);case 3:if(!d){p.A(2);
break}return p.h(ZB(d),6);case 6:if(l=p.j,!l)return p.return(b);case 2:if(!a.keySystemConfiguration)return b.supported=!0,p.return(b);m=a.keySystemConfiguration;return p.h($B(c,d,m),8);case 8:if(n=p.j)b.supported=!0,b.keySystemAccess=n;case 7:return p.return(b)}})}function YB(a){var b,c,d;return H(function(e){return e.i==1?(b=ob(),c=b.Ka(),c!=="CAST"?e.A(2):e.h(aC(a),3)):e.i!=2?(d=e.j,e.return(d)):e.return(Km(a.contentType))})}
function ZB(a){var b,c,d,e,f;return H(function(g){switch(g.i){case 1:b=ob();c=b.Ka();d=a.contentType;if(c!=="CAST"||!a.spatialRendering){g.A(2);break}d+="; spatialRendering=true";if(!(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)){g.A(2);break}e=!1;f=bC;if(f.has(d)){e=f.get(d);g.A(4);break}return g.h(cast.__platform__.canDisplayType(d),5);case 5:e=g.j,f.set(d,e);case 4:return g.return(e);case 2:return g.return(Km(d))}})}
function $B(a,b,c){var d,e,f,g,h,k,l,m,n,p,u,q;return H(function(v){switch(v.i){case 1:d=[];e=[];f=[];c.audio&&(g={robustness:c.audio.robustness||"",contentType:b.contentType},ob().ci()&&b.contentType.includes('codecs="ac-3"')&&(g.contentType='audio/mp4; codecs="ec-3"'),c.audio.encryptionScheme&&(g.encryptionScheme=c.audio.encryptionScheme,f.push(c.audio.encryptionScheme)),d.push(g));c.video&&(h={robustness:c.video.robustness||"",contentType:a.contentType},c.video.encryptionScheme&&(h.encryptionScheme=
c.video.encryptionScheme,f.push(c.video.encryptionScheme)),e.push(h));k={initDataTypes:[c.initDataType],distinctiveIdentifier:c.distinctiveIdentifier,persistentState:c.persistentState,sessionTypes:c.sessionTypes};d.length&&(k.audioCapabilities=d);e.length&&(k.videoCapabilities=e);l=a?a.contentType:"";m=b?b.contentType:"";n=De(l)+";"+Ce(l);p=De(m)+";"+Ce(m);u=c.keySystem;q=null;v.o(2);var w=dc(n,p,u,f);if(jc.has(w)){w=dc(n,p,u,f);q=jc.get(w)||null;v.A(4);break}return v.h(navigator.requestMediaKeySystemAccess(c.keySystem,
[k]),5);case 5:w=q=v.j;var y=dc(n,p,u,f);jc.set(y,w);case 4:v.u(3);break;case 2:v.m();case 3:return v.return(q)}})}
function aC(a){var b,c,d,e,f;return H(function(g){if(g.i==1){if(!(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType))return g.return(Km(a.contentType));b=a.contentType;a.width&&a.height&&a.width>1280&&a.height>720&&(b+="; width="+a.width+"; height="+a.height);a.framerate&&(c=Math.round(a.framerate),c<24||c>30)&&(b+="; framerate="+a.framerate);d=a.transferFunction||"";switch(d){case "":case "srgb":break;case "pq":b+="; eotf=smpte2084";break;case "hlg":b+="; eotf=arib-std-b67";break;
default:return g.return(!1)}e=!1;f=bC;return f.has(b)?(e=f.get(b),g.A(2)):g.h(cast.__platform__.canDisplayType(b),3)}g.i!=2&&(e=g.j,f.set(b,e));return g.return(e)})}yB.MediaCapabilities=VB;VB.install=WB;VB.originalMcap=null;var bC=new Map;zB(WB,-1);function cC(){this.size=0;this.h=void 0}r=cC.prototype;r.Ib=function(){return this.h};r.forEach=function(a){this.h&&a(this.h,hc.value())};r.get=function(a){if(this.has(a))return this.h};r.has=function(a){var b=hc.value();return this.h&&wb(a,b)?!0:!1};r.entries=function(){};r.keys=function(){};r.values=function(){};cC.prototype[Symbol.iterator]=function(){return[][Symbol.iterator]()};function dC(){}function eC(){var a=ob(),b=a.xg()?a.va():null;(window.MediaSource||window.ManagedMediaSource)&&b&&window.MediaSource&&(b<=12?(fC(),gC()):b<=15&&fC());a=t(a.Kg());for(b=a.next();!b.done;b=a.next())hC(b.value);(window.MediaSource||window.ManagedMediaSource)&&iC();window.MediaSource&&MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&jC()}
function fC(){var a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var b=a.apply(this,Ja.apply(0,arguments));b.abort=function(){};return b}}function gC(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}}
function iC(){if(window.MediaSource){var a=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(c){return ze(c)!="mp2t"&&a(c)}}if(window.ManagedMediaSource){var b=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=function(c){return ze(c)!="mp2t"&&b(c)}}}
function hC(a){var b=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(d){return!kC(d,a)&&b(d)};if(window.ManagedMediaSource){var c=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);window.ManagedMediaSource.isTypeSupported=function(d){return!kC(d,a)&&c(d)}}}function kC(a,b){return(a=Ee(a))?a.split(",").some(function(c){return Ce(c.trim()).toLowerCase()==b.toLowerCase()}):!1}
function jC(){var a=MediaSource.isTypeSupported;ob().Mi()&&(MediaSource.isTypeSupported=function(b){var c=b.split(/ *; */),d=c.findIndex(function(g){return g.startsWith("codecs=")});if(d<0)return a(b);var e=c[d].replace("codecs=","").replace(/"/g,"").split(/\s*,\s*/),f=e.findIndex(function(g){return g.startsWith("vp09")});f>=0&&(e[f]="vp9",c[d]='codecs="'+e.join(",")+'"',b=c.join("; "));return a(b)})}yB.MediaSource=dC;dC.install=eC;zB(eC);function lC(){}var mC,nC,oC,pC,qC,rC;
function sC(a){if(window.HTMLVideoElement&&window.WebKitMediaKeys&&window.shakaMediaKeysPolyfill!=tC){if(a===void 0?0:a)mC=!0,nC=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"mediaKeys"),oC=HTMLMediaElement.prototype.setMediaKeys,pC=window.MediaKeys,qC=window.MediaKeySystemAccess,rC=navigator.requestMediaKeySystemAccess;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=uC;window.MediaKeys=vC;window.MediaKeySystemAccess=
wC;navigator.requestMediaKeySystemAccess=xC;window.shakaMediaKeysPolyfill=tC;yf.clear();jc.clear()}}function xC(a,b){try{var c=new wC(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}function uC(a){var b=this.mediaKeys;b&&b!=a&&yC(b,null);delete this.mediaKeys;return(this.mediaKeys=a)?yC(a,this):Promise.resolve()}
function zC(a){a=yb(a.initData);if(Bb(a).getUint32(0,!0)+4!=a.byteLength)throw new RangeError("Malformed FairPlay init data");a=Gb(a.subarray(4),!0);a=Jb(a);var b=new Event("encrypted");b.initDataType="skd";b.initData=xb(a);this.dispatchEvent(b)}yB.PatchedMediaKeysApple=lC;
lC.uninstall=function(){window.shakaMediaKeysPolyfill==tC&&mC&&(mC=!1,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",nC),HTMLMediaElement.prototype.setMediaKeys=oC,window.MediaKeys=pC,window.MediaKeySystemAccess=qC,navigator.requestMediaKeySystemAccess=rC,nC=rC=oC=qC=pC=null,window.shakaMediaKeysPolyfill="",yf.clear(),jc.clear())};lC.install=sC;
function wC(a,b){this.keySystem=a;if(a.startsWith("com.apple.fps"))for(a=t(b),b=a.next();!b.done;b=a.next()){var c=b.value;if(c.persistentState=="required")b=null;else{b={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:c.initDataTypes,sessionTypes:["temporary"],label:c.label};var d=!1,e=!1;if(c.audioCapabilities)for(var f=t(c.audioCapabilities),g=f.next();!g.done;g=f.next())g=g.value,g.contentType&&(d=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,
g.contentType.split(";")[0])&&(b.audioCapabilities.push(g),e=!0));if(c.videoCapabilities)for(c=t(c.videoCapabilities),f=c.next();!f.done;f=c.next())f=f.value,f.contentType&&(d=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,f.contentType.split(";")[0])&&(b.videoCapabilities.push(f),e=!0));d||(e=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4"));b=e?b:null}if(b){this.h=b;return}}a=Error("Unsupported keySystem");a.name="NotSupportedError";a.code=DOMException.NOT_SUPPORTED_ERR;throw a;}
wC.prototype.createMediaKeys=function(){var a=new vC(this.keySystem);return Promise.resolve(a)};wC.prototype.getConfiguration=function(){return this.h};function vC(a){this.i=new WebKitMediaKeys(a);this.h=new ib}vC.prototype.createSession=function(a){a=a||"temporary";if(a!="temporary")throw new TypeError("Session type "+a+" is unsupported on this platform.");return new AC(this.i,a)};vC.prototype.setServerCertificate=function(){return Promise.resolve(!1)};
function yC(a,b){a.h.Ta();if(!b)return Promise.resolve();a.h.J(b,"webkitneedkey",zC);try{return vs(b,HTMLMediaElement.HAVE_METADATA,a.h,function(){b.webkitSetMediaKeys(a.i)}),Promise.resolve()}catch(c){return Promise.reject(c)}}vC.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};
function AC(a){uk.call(this);this.j=null;this.o=a;this.h=this.i=null;this.l=new ib;this.m=Promise.withResolvers();this.sessionId="";this.expiration=NaN;this.keyStatuses=new cC;this.onkeystatuseschange=null}ta(AC,uk);da.Object.defineProperties(AC.prototype,{closed:{configurable:!0,enumerable:!0,get:function(){return this.m.promise}}});r=AC.prototype;
r.generateRequest=function(a,b){var c=this;this.i=Promise.withResolvers();try{var d=this.o.createSession("video/mp4",yb(b));this.j=d;this.sessionId=d.sessionId||"";this.l.J(this.j,"webkitkeymessage",function(e){c.i&&(c.i.resolve(),c.i=null);e=(new Map).set("messageType",c.keyStatuses.Ib()==void 0?"license-request":"license-renewal").set("message",xb(e.message));e=new tk("message",e);c.dispatchEvent(e)});this.l.J(d,"webkitkeyadded",function(){c.h&&(BC(c,"usable"),c.h.resolve(),c.h=null)});this.l.J(d,
"webkitkeyerror",function(){var e=Error("EME PatchedMediaKeysApple key error");e.errorCode=c.j.error;if(c.i!=null)c.i.reject(e),c.i=null;else if(c.h!=null)c.h.reject(e),c.h=null;else switch(c.j.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:BC(c,"output-not-allowed");break;default:BC(c,"internal-error")}});BC(this,"status-pending")}catch(e){this.i.reject(e)}return this.i.promise};r.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))};
r.update=function(a){this.h=Promise.withResolvers();try{this.j.update(yb(a))}catch(b){this.h.reject(b)}return this.h.promise};r.close=function(){try{this.j.close(),this.m.resolve(),this.l.Ta()}catch(a){this.m.reject(a)}return this.closed};r.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))};
function BC(a,b){var c=a.keyStatuses;c.size=b==void 0?0:1;c.h=b;b=new tk("keystatuseschange");a.dispatchEvent(b);if(a.onkeystatuseschange)a.onkeystatuseschange(b)}var tC="apple";zB(function(){window.HTMLVideoElement&&window.WebKitMediaKeys&&(navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||sC())});function CC(){}function DC(){if(window.MediaKeys){var a=ob();MediaKeys.prototype.setServerCertificate&&a.Vd()||(MediaKeys.prototype.setServerCertificate=EC)}}function EC(){return Promise.resolve(!1)}yB.PatchedMediaKeysCert=CC;CC.install=DC;zB(DC);function FC(){}
function GC(){if(!(!window.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)HC="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=IC;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=JC;window.MediaKeys=KC;window.MediaKeySystemAccess=LC;window.shakaMediaKeysPolyfill=MC}}
function NC(a){var b=HC;return b?b+a.charAt(0).toUpperCase()+a.slice(1):a}function IC(a,b){try{var c=new LC(a,b);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}function JC(a){var b=this.mediaKeys;b&&b!=a&&OC(b,null);delete this.mediaKeys;(this.mediaKeys=a)&&OC(a,this);return Promise.resolve()}yB.PatchedMediaKeysWebkit=FC;FC.install=GC;
function LC(a,b){this.h=this.keySystem=a;var c=!1;a=="org.w3.clearkey"&&(this.h="webkit-org.w3.clearkey",c=!1);var d=!1;var e=document.getElementsByTagName("video");e=e.length?e[0]:document.createElement("video");b=t(b);for(var f=b.next();!f.done;f=b.next()){f=f.value;var g={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:f.initDataTypes,sessionTypes:["temporary"],label:f.label},h=!1;if(f.audioCapabilities)for(var k=t(f.audioCapabilities),
l=k.next();!l.done;l=k.next())l=l.value,l.contentType&&(h=!0,e.canPlayType(l.contentType.split(";")[0],this.h)&&(g.audioCapabilities.push(l),d=!0));if(f.videoCapabilities)for(k=t(f.videoCapabilities),l=k.next();!l.done;l=k.next())l=l.value,l.contentType&&(h=!0,e.canPlayType(l.contentType,this.h)&&(g.videoCapabilities.push(l),d=!0));h||(d=e.canPlayType("video/mp4",this.h)||e.canPlayType("video/webm",this.h));f.persistentState=="required"&&(c?(g.persistentState="required",g.sessionTypes=["persistent-license"]):
d=!1);if(d){this.i=g;return}}c="Unsupported keySystem";if(a=="org.w3.clearkey"||a=="com.widevine.alpha")c="None of the requested configurations were supported.";a=Error(c);a.name="NotSupportedError";a.code=DOMException.NOT_SUPPORTED_ERR;throw a;}LC.prototype.createMediaKeys=function(){var a=new KC(this.h);return Promise.resolve(a)};LC.prototype.getConfiguration=function(){return this.i};function KC(a){this.m=a;this.i=null;this.h=new ib;this.j=[];this.l=new Map}
function OC(a,b){a.i=b;a.h.Ta();var c=HC;b&&(a.h.J(b,c+"needkey",function(d){var e=new CustomEvent("encrypted");e.initDataType="cenc";e.initData=xb(d.initData);a.i.dispatchEvent(e)}),a.h.J(b,c+"keymessage",function(d){var e=PC(a,d.sessionId);e&&(d=(new Map).set("messageType",e.keyStatuses.Ib()==void 0?"licenserequest":"licenserenewal").set("message",d.message),d=new tk("message",d),e.i&&(e.i.resolve(),e.i=null),e.dispatchEvent(d))}),a.h.J(b,c+"keyadded",function(d){(d=PC(a,d.sessionId))&&d.ready()}),
a.h.J(b,c+"keyerror",function(d){var e=PC(a,d.sessionId);if(e){var f=Error("EME v0.1b key error"),g=d.errorCode;g.systemCode=d.systemCode;f.errorCode=g;!d.sessionId&&e.i?(d.systemCode==45&&(f.message="Unsupported session type."),e.i.reject(f),e.i=null):d.sessionId&&e.h?(e.h.reject(f),e.h=null):(f=d.systemCode,d.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?QC(e,"output-restricted"):f==1?QC(e,"expired"):QC(e,"internal-error"))}}))}
KC.prototype.createSession=function(a){a=a||"temporary";if(a!="temporary"&&a!="persistent-license")throw new TypeError("Session type "+a+" is unsupported on this platform.");var b=this.i||document.createElement("video");b.src||(b.src="about:blank");a=new RC(b,this.m,a);this.j.push(a);return a};KC.prototype.setServerCertificate=function(){return Promise.resolve(!1)};KC.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};
function PC(a,b){var c=a.l.get(b);return c?c:(c=a.j.shift())?(c.sessionId=b,a.l.set(b,c),c):null}function RC(a,b,c){uk.call(this);this.m=a;this.u=!1;this.h=this.i=null;this.l=b;this.o=c;this.j=Promise.withResolvers();this.sessionId="";this.expiration=NaN;this.keyStatuses=new cC;this.onkeystatuseschange=null}ta(RC,uk);da.Object.defineProperties(RC.prototype,{closed:{configurable:!0,enumerable:!0,get:function(){return this.j.promise}}});r=RC.prototype;
r.ready=function(){QC(this,"usable");this.h&&this.h.resolve();this.h=null};
function SC(a,b,c){if(a.u)return Promise.reject(Error("The session is already initialized."));a.u=!0;try{if(a.o=="persistent-license")if(c)var d=yb(Jb("LOAD_SESSION|"+c));else{var e=Jb("PERSISTENT|");d=Sb(e,b)}else d=yb(b)}catch(g){return Promise.reject(g)}a.i=Promise.withResolvers();var f=NC("generateKeyRequest");try{a.m[f](a.l,d)}catch(g){if(g.name!="InvalidStateError")return a.i=null,Promise.reject(g);(new $e(function(){try{a.m[f](a.l,d)}catch(h){a.i.reject(h),a.i=null}})).ha(.01)}return a.i.promise}
function TC(a,b,c){if(a.h)a.h.promise.then(function(){return TC(a,b,c)}).catch(function(){return TC(a,b,c)});else{a.h=b;if(a.l=="webkit-org.w3.clearkey"){var d=Fb(c);var e=JSON.parse(d);e.keys[0].kty!="oct"&&(a.h.reject(Error("Response is not a valid JSON Web Key Set.")),a.h=null);d=Pb(e.keys[0].k);e=Pb(e.keys[0].kid)}else d=yb(c),e=null;var f=NC("addKey");try{a.m[f](a.l,d,e,a.sessionId)}catch(g){a.h.reject(g),a.h=null}}}
function QC(a,b){var c=a.keyStatuses;c.size=b==void 0?0:1;c.h=b;b=new tk("keystatuseschange");a.dispatchEvent(b);if(a.onkeystatuseschange)a.onkeystatuseschange(b)}r.generateRequest=function(a,b){return SC(this,b,null)};r.load=function(a){return this.o=="persistent-license"?SC(this,null,a):Promise.reject(Error("Not a persistent session."))};r.update=function(a){var b=Promise.withResolvers();TC(this,b,a);return b.promise};
r.close=function(){if(this.o!="persistent-license"){if(!this.sessionId)return this.j.reject(Error("The session is not callable.")),this.j.promise;var a=NC("cancelKeyRequest");try{this.m[a](this.l,this.sessionId)}catch(b){}}this.j.resolve();return this.j.promise};r.remove=function(){return this.o!="persistent-license"?Promise.reject(Error("Not a persistent session.")):this.close()};var HC="",MC="webkit";zB(GC);function UC(){}function VC(){window.crypto&&("randomUUID"in window.crypto||(window.crypto.randomUUID=WC))}function WC(){var a=URL.createObjectURL(new Blob),b=a.toString();URL.revokeObjectURL(a);return b.substr(b.lastIndexOf("/")+1)}yB.RandomUUID=UC;UC.install=VC;zB(VC);function XC(){}function YC(){var a=Symbol.prototype;"description"in a||Object.defineProperty(a,"description",{get:ZC})}function ZC(){var a=/\((.*)\)/.exec(this.toString());return a?a[1]:void 0}yB.Symbol=XC;XC.install=YC;zB(YC);function $C(){}function aD(){for(var a=t([Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,Int8Array,Int16Array,Int32Array,Float32Array,Float64Array]),b=a.next();!b.done;b=a.next()){b=b.value;var c=void 0;(c=b.prototype).indexOf!=null||(c.indexOf=Array.prototype.indexOf);c=void 0;(c=b.prototype).lastIndexOf!=null||(c.lastIndexOf=Array.prototype.lastIndexOf);c=void 0;(c=b.prototype).includes!=null||(c.includes=Array.prototype.includes)}}yB.TypedArray=$C;$C.install=aD;zB(aD);function bD(){}function cD(){window.URLSearchParams||(window.URLSearchParams=dD);!window.URL||!window.URL.prototype||"searchParams"in window.URL.prototype||Object.defineProperty(window.URL.prototype,"searchParams",{get:eD,enumerable:!0,configurable:!0})}
function eD(){var a=this,b=fD.get(a);if(!b){b=new window.URLSearchParams(a.search);var c=function(){var g=b.toString();a.search=g?"?"+g:""},d=b.append;b.append=function(g,h){d.call(this,g,h);c()};var e=b.delete;b.delete=function(g){e.call(this,g);c()};var f=b.set;b.set=function(g,h){f.call(this,g,h);c()};fD.set(a,b)}return b}yB.URLSearchParams=bD;bD.install=cD;var fD=new WeakMap;
function dD(a){this.h=[];if(typeof a==="string"){if(a.startsWith("?")&&(a=a.substring(1)),a){a=t(a.split("&"));for(var b=a.next();!b.done;b=a.next()){var c=b.value.split("=");b=decodeURIComponent(c[0].replace(/\+/g," "));c=c.length>1?decodeURIComponent(c[1].replace(/\+/g," ")):"";this.append(b,c)}}}else if(Array.isArray(a))for(a=t(a),b=a.next();!b.done;b=a.next())b=b.value,this.append(b[0],b[1]);else if(a)for(b in a)this.append(b,a[b])}r=dD.prototype;
r.append=function(a,b){this.h.push([String(a),String(b)])};r.get=function(a){a=String(a);for(var b=t(this.h),c=b.next();!c.done;c=b.next())if(c=c.value,c[0]===a)return c[1];return null};r.has=function(a){var b=String(a);return this.h.some(function(c){return c[0]===b})};r.set=function(a,b){a=String(a);b=String(b);for(var c=!1,d=0;d<this.h.length;d++)this.h[d][0]===a&&(c?(this.h.splice(d,1),d--):(this.h[d][1]=b,c=!0));c||this.append(a,b)};
r.toString=function(){return this.h.map(function(a){return encodeURIComponent(a[0]).replace(/%20/g,"+")+"="+encodeURIComponent(a[1]).replace(/%20/g,"+")}).join("&")};r.entries=function(){var a=0,b=this.h.map(function(d){return[d[0],d[1]]}),c={next:function(){return a<b.length?{value:b[a++],done:!1}:{value:void 0,done:!0}}};c[Symbol.iterator]=function(){return c};return c};
r.keys=function(){var a=0,b=this.h,c={next:function(){return a<b.length?{value:b[a++][0],done:!1}:{value:void 0,done:!0}}};c[Symbol.iterator]=function(){return c};return c};r.values=function(){var a=0,b=this.h,c={next:function(){return a<b.length?{value:b[a++][1],done:!1}:{value:void 0,done:!0}}};c[Symbol.iterator]=function(){return c};return c};r.forEach=function(a){for(var b=t(this.h),c=b.next();!c.done;c=b.next())c=c.value,a(c[1],c[0],this)};dD.prototype[Symbol.iterator]=function(){return this.entries()};
zB(cD);function gD(){}function hD(){if(window.HTMLMediaElement){var a=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var b=a.apply(this);b&&b.catch(function(){});return b}}}yB.VideoPlayPromise=gD;gD.install=hD;zB(hD);function iD(){}function jD(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.requestVideoFrameCallback&&window.requestAnimationFrame&&a.getVideoPlaybackQuality&&(a.requestVideoFrameCallback=kD,a.cancelVideoFrameCallback=lD)}}function mD(a){var b=nD.get(a);b||(b={Dk:1,Rc:new Map,presentedFrames:0},nD.set(a,b));return b}
function kD(a){function b(g){if(d.Rc.has(e)){var h=c.getVideoPlaybackQuality().totalVideoFrames||0;h!==d.presentedFrames?(d.presentedFrames=h,h={presentationTime:g,expectedDisplayTime:g,mediaTime:c.currentTime,presentedFrames:h,width:c.videoWidth,height:c.videoHeight,processingDuration:0},d.Rc.delete(e),a(g,h)):(g=window.requestAnimationFrame(b),d.Rc.set(e,g))}}var c=this,d=mD(c),e=d.Dk++,f=window.requestAnimationFrame(b);d.Rc.set(e,f);return e}
function lD(a){var b=nD.get(this);if(b){var c=b.Rc.get(a);c!=null&&(window.cancelAnimationFrame(c),b.Rc.delete(a))}}yB.VideoFrameCallback=iD;iD.install=jD;var nD=new WeakMap;zB(jD,-2);function oD(){}function pD(){if(window.HTMLVideoElement){var a=HTMLVideoElement.prototype;!a.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in a||typeof Mc().webkitDroppedFrameCount==="number")&&(a.getVideoPlaybackQuality=qD)}}function qD(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}yB.VideoPlaybackQuality=oD;oD.install=pD;zB(pD);function rD(){}function sD(){if(!window.VTTCue&&window.TextTrackCue){var a=null,b=TextTrackCue.length;if(b==3)a=tD;else if(b==6)a=uD;else{try{var c=!!tD(1,2,"")}catch(d){c=!1}c&&(a=tD)}a&&(window.VTTCue=function(d,e,f){return a(d,e,f)})}}function tD(a,b,c){return new window.TextTrackCue(a,b,c)}function uD(a,b,c){return new window.TextTrackCue(a+"-"+b+"-"+c,a,b,c)}yB.VTTCue=rD;rD.install=sD;zB(sD);function vD(){this.h="UNKNOWN"}vD.prototype.parseInit=function(){};vD.prototype.setManifestType=function(a){this.h=a};
vD.prototype.parseMedia=function(a,b,c,d){function e(B,A,E){for(var C=[],F=t(q),G=F.next();!G.done;G=F.next())(G=wD(G.value.clone(),A,E))&&C.push(G);B.nestedCues=C.concat(B.nestedCues);A=t(C);for(E=A.next();!E.done;E=A.next())E=E.value,B.startTime=Math.min(B.startTime,E.startTime),B.endTime=Math.max(B.endTime,E.endTime)}a=Fb(a);var f=[];if(a=="")return f;var g=sd(a,!0).find(function(B){return Fd(B,Id,"tt")});if(!g)throw new L(2,2,2005,"Failed to parse TTML.");f=Ed(g,Id,"body")[0];if(!f)return[];a=
g.attributes["xml:space"]||"default";var h=Jd(g,xD,"extent");if(a!="default"&&a!="preserve")throw new L(2,2,2005,"Invalid xml:space value: "+a);var k=a=="default",l=new yD(Jd(g,zD,"frameRate"),Jd(g,zD,"subFrameRate"),Jd(g,zD,"frameRateMultiplier"),Jd(g,zD,"tickRate"));a=AD(Jd(g,zD,"cellResolution"));var m=Ed(g,Id,"metadata")[0];m=(m?m.children:[]).filter(function(B){return B!="\n"});var n=Ed(g,Id,"style"),p=Ed(g,Id,"region");g=new Map;for(var u=[],q=[],v=t(p),w=v.next();!w.done;w=v.next()){w=w.value;
var y=BD(this,w,n,h,a);if(y){u.push(y);var x=CD(this,w,l,0,!1,g);DD(this,w,n,"showBackground")=="whenActive"||ED.test(y.backgroundColor)||(x=new Ld(Math.max(x.start+b.periodStart,b.segmentStart),Math.min(x.end+b.periodStart,b.segmentEnd),""),x.region=y,x.isContainer=!0,x.displayAlign=DD(this,w,n,"displayAlign")||x.displayAlign,q.push(x))}}if(Hd(f,"p").length)throw new L(2,2,2001,"<p> can only be inside <div> in TTML");h=t(Hd(f,"div"));for(v=h.next();!v.done;v=h.next())if(Hd(v.value,"span").length)throw new L(2,
2,2001,"<span> can only be inside <p> in TTML");CD(this,f,l,0,!1,g);h=u.length>0&&Array.from(g.keys()).some(function(B){return!!B.attributes.region});c=FD(this,f,b,l,m,n,p,u,k,a,null,!1,c,d,g,{start:0,end:Infinity},h);d=t(c);for(k=d.next();!k.done;k=d.next())k=k.value,k.backgroundColor=k.backgroundColor||"transparent";var z=GD(f),D=c.slice().sort(function(B,A){return B.startTime-A.startTime});D.forEach(function(B,A){e(B,z||A>0?B.startTime:-Infinity,z||A<D.length-1?B.endTime:Infinity)});!c.length&&
q.length&&(f=g.get(f)||{start:0,end:Infinity},d=new Ld(Infinity,0,""),d.isContainer=!0,d.backgroundColor="transparent",a&&(d.cellResolution=a),e(d,z?f.start+b.periodStart:-Infinity,z?f.end+b.periodStart:Infinity),d.startTime<d.endTime&&c.push(d));return c};function GD(a){return!!(a.attributes.begin||a.attributes.end||a.attributes.dur)}
function FD(a,b,c,d,e,f,g,h,k,l,m,n,p,u,q,v,w){function y(Q,O){return HD(a,Q,O,m,z,B,C,f,F,G.length==0)}var x=xd(b)?m&&ID(m)?null:v:(x=q.get(b))?{start:Math.max(x.start,v.start),end:Math.min(x.end,v.end)}:v;var z=(v=xd(b)?m:b)?JD(v,"region",g,"")[0]:null;v=z?q.get(z):null;x&&v&&(x={start:Math.max(x.start,v.start),end:Math.min(x.end,v.end)});if(!x||x.start>=x.end)return[];var D=!w||!!z;if(xd(b)){if(!n||!D)return[];v={tagName:"span",children:[Cd(b)],attributes:{},parent:null}}else v=b;for(var B=null,
A=t(KD),E=A.next();!E.done&&!(B=JD(v,"backgroundImage",e,"#",E.value)[0]);E=A.next());var C=null;A=Jd(v,KD,"backgroundImage");E=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/;if(A&&E.test(A)){A=parseInt(A.split(":").pop(),10)-1;if(A>=u.length)return[];C=u[A]}else p&&A&&!A.startsWith("#")&&(A=(new URL(A,p)).toString())&&(C=A);b=LD(b);if(b=="p"||B||C)n=!0;var F=n;k=(v.attributes["xml:space"]||(k?"default":"preserve"))=="default";E=v.children.filter(function(Q){return xd(Q)||["div","p","span",
"br"].includes(LD(Q))});A=E.every(xd);var G=[];if(!A){E=t(E);for(var J=E.next();!J.done;J=E.next())G=G.concat(FD(a,J.value,c,d,e,f,g,h,k,l,v,n,p,u,q,x,w))}e=m!=null;d=Cd(v);p=v.children.length&&d&&/\S/.test(d);if(A&&p&&!D)return[];g=GD(v);if(!(g||p||b=="br"||G.length!=0||e&&!k))return[];e=x.start+c.periodStart;x=x.end+c.periodStart;a.h!=="HLS"&&(e=Math.max(e,c.segmentStart),x=Math.min(x,c.segmentEnd));if(!g&&G.length>0)for(e=Infinity,x=0,g=t(G),p=g.next();!p.done;p=g.next())p=p.value,e=Math.min(e,
p.startTime),x=Math.max(x,p.endTime);if(b=="br")return c=new Ld(e,x,""),c.lineBreak=!0,[c];g="";!A||b=="p"&&ID(v)||(g=Lb(d||""),k&&(g=g.replace(/\s+/g," ")));x=new Ld(e,x,g);x.nestedCues=G;n||(x.isContainer=!0);l&&(x.cellResolution=l);v.attributes.region&&z&&(x.region=h.find(function(Q){return Q.id==z.attributes["xml:id"]}));y(x,v);return MD(a,x,v,f,q,c,y)}
function MD(a,b,c,d,e,f,g){function h(v,w){for(var y=Object.assign({},c,{attributes:Object.assign({},c.attributes)}),x=m.filter(function(F){return e.get(F).start+f.periodStart<=v&&v<e.get(F).end+f.periodStart}),z=t(x),D=z.next();!D.done;D=z.next()){D=t(k(D.value));for(var B=D.next();!B.done;B=D.next()){B=B.value;for(var A=t(Object.entries(B.attributes)),E=A.next();!E.done;E=A.next()){var C=t(E.value);E=C.next().value;C=C.next().value;(E=l(B,E))&&(y.attributes[E]=C)}}}if(ND(a,y,d,"display")=="none")return null;
w=wD(b.clone(),v,w);x.length&&(w.textDecoration=[],g(w,y));return w}function k(v,w){w=w===void 0?new Set:w;var y=[];w.add(v);for(var x=t((v.attributes.style||"").split(/\s+/)),z=x.next(),D={};!z.done;D={gi:void 0},z=x.next())D.gi=z.value,(z=d.find(function(B){return function(A){return A.attributes["xml:id"]==B.gi}}(D)))&&!w.has(z)&&y.push.apply(y,wa(k(z,w)));y.push(v);return y}function l(v,w){var y=w.indexOf(":");if(y<1)return null;for(var x="xmlns:"+w.substring(0,y),z=null;v&&z==null;v=v.parent)z=
v.attributes[x];x=xD.concat(["urn:ebu:tt:style"]);return z!=null&&x.includes(z)?td(z)+":"+w.substring(y+1):null}var m=Hd(c,"set");if(!m.length)return ND(a,c,d,"display")!="none"?[b]:[];for(var n=[b.startTime,b.endTime],p=t(m),u=p.next();!u.done;u=p.next())u=u.value,n.push(e.get(u).start+f.periodStart,e.get(u).end+f.periodStart);n=Array.from(new Set(n)).filter(function(v){return v>=b.startTime&&v<=b.endTime}).sort(function(v,w){return v-w});p=[];for(u=1;u<n.length;u++){var q=h(n[u-1],n[u]);q&&p.push(q)}return p}
function wD(a,b,c){a.startTime=Math.max(a.startTime,b);a.endTime=Math.min(a.endTime,c);if(a.startTime>=a.endTime)return null;a.nestedCues=a.nestedCues.filter(function(d){return wD(d,b,c)});return a}
function BD(a,b,c,d,e){function f(y,x,z){if(!x||x.trim()=="auto")return null;var D=x.trim().split(/\s+/),B=D.length==2?g(D[0],!1,z):null;z=D.length==2?g(D[1],!0,z):null;return B&&z?{x:B,y:z}:(Xa("ttml-region-"+y+"-"+x,"TtmlTextParser ignored the tts:"+y+" of region "+n+", which is invalid or not supported: "+x),null)}function g(y,x,z){var D=OD(y);if(!D||!z&&Number(D[1])<0)return null;z=D[2]=="px";if(D[2]=="%")return{value:Number(D[1]),units:bd,Pe:z};y=h(y,x);return y!=null?{value:y,units:bd,Pe:z}:
z?{value:Number(D[1]),units:0,Pe:z}:null}function h(y,x){var z=OD(y),D=z?Number(z[1]):0;z=z?z[2]:"%";if(z=="%")return null;if(z=="px")return(y=x?u:p)?D*100/y:null;if(z=="rw"||z=="rh")return z=="rh"==x?D:null;if(z=="c")return D*100/(x?v:q);if(z=="em"){z=(l("fontSize")||"1c").trim().split(/\s+/);if(z.length>2)return null;if(z.length==2)return y=k(z[x?1:0],x),y==null?null:D*y;var B=k(z[0],!0);if(B==null)return null;if(x)return D*B;if(p&&u)return D*B*u/p;Xa("ttml-horizontal-em","TtmlTextParser approximated a horizontal length in em, as the TTML document has no tts:extent in pixels: "+
y);y=k(z[0],!1);return y==null?null:D*y}return null}function k(y,x){var z=100/(x?v:q);y=OD(y);if(!y)return z;var D=Number(y[1]);return y[2]=="%"?D*z/100:y[2]=="em"?D*z:h(y[0],x)}function l(y){return DD(a,b,c,y)}var m=new ad,n=b.attributes["xml:id"];if(!n)return null;m.id=n;var p=(d=PD.exec(d||""))?Number(d[1]):null,u=d?Number(d[2]):null,q=e?e.columns:32,v=e?e.rows:15;e=l("extent");if(d=f("extent",e,!1))m.width=d.x.value,m.height=d.y.value,m.widthUnits=d.x.units,m.heightUnits=d.y.units;d=l("origin");
var w=f("origin",d,!0);w&&w.x.units!=w.y.units&&(Xa("ttml-region-origin-units-"+d,"TtmlTextParser ignored the tts:origin of region "+n+", which mixes pixels and other units without a tts:extent in pixels on the TTML document: "+d),w=null);w&&(m.viewportAnchorX=w.x.value,m.viewportAnchorY=w.y.value,m.viewportAnchorUnits=w.x.units,e||w.x.Pe||w.y.Pe||(m.width=100-m.viewportAnchorX,m.widthUnits=bd,m.height=100-m.viewportAnchorY,m.heightUnits=bd));(e=l("position"))&&!d&&(e=QD(e,m,h))&&(m.viewportAnchorX=
e[0],m.viewportAnchorY=e[1],m.viewportAnchorUnits=bd);if(e=l("backgroundColor"))m.backgroundColor=RD(e);e=parseFloat(l("opacity")||"");isNaN(e)||(m.opacity=e);if(e=l("padding"))m.padding=SD(e,m,l("writingMode"),h);l("overflow")=="hidden"&&(m.overflow="hidden");(e=l("zIndex"))&&/^-?\d+$/.test(e)&&(m.zIndex=Number(e));return m}
function QD(a,b,c){a=a.trim().split(/\s+/);if(b.widthUnits!=bd||b.heightUnits!=bd||a.length>4)return null;for(var d=[["left","50%"],["top","50%"]],e=a.some(function(n){return/^(top|bottom)$/.test(n)}),f=a.some(function(n){return/^(left|right)$/.test(n)}),g=[!1,!1],h=0;h<a.length;h++){var k=a[h];if(/^[a-z]/.test(k)){var l=a.length>2&&/^[-.\d]/.test(a[h+1]||"")?a[++h]:"0%",m=void 0;m=/^(top|bottom)$/.test(k)?1:/^(left|right)$/.test(k)?0:e!=f?e?0:1:g[0]?1:0;d[m]=[k,l];g[m]=!0}else{if(a.length>2)return null;
d[h][1]=k;g[h]=!0}}a=d.map(function(n,p){var u=p?b.height:b.width,q=OD(n[1]);p=q&&q[2]=="%"?Number(q[1])*(100-u)/100:c(n[1],!!p);if(n[0]=="center")return p==null?NaN:Number(((100-u)/2+p).toFixed(4));n=n[0]=="right"||n[0]=="bottom";return p==null?NaN:Number((n?100-u-p:p).toFixed(4))});return a.some(isNaN)?null:a}
function SD(a,b,c,d){var e=a.trim().split(/\s+/);if(e.length>4)return"";a=e[0];var f=e[1]||a,g=e[2]||a;e=e[3]||f;var h=[a,f,g,e];if(c=="rltb"||c=="rl")h=[a,e,g,f];else if(c=="tblr")h=[e,g,f,a];else if(c=="tbrl"||c=="tb")h=[e,a,f,g];return h.map(function(k,l){var m=!(l%2),n=(OD(k)||[])[2];l=d(k,m);if(n=="%"||n=="px"&&!l)return k;k=(m?b.heightUnits:b.widthUnits)==bd;m=m?b.height:b.width;return l!=null&&k&&m?Number((l*100/m).toFixed(4))+"%":"0px"}).join(" ")}
function RD(a){var b=a.match(/rgba\(([^)]+)\)/);return b&&(b=b[1].split(",").map(function(c){return c.trim()}),b.length==4)?(b[3]=String(Number(b[3])/255),"rgba("+b.join(",")+")"):a}
function HD(a,b,c,d,e,f,g,h,k,l){function m(q){var v;if(!(v=n(q)))a:{for(v=d;v&&!Fd(v,Id,"tt");v=v.parent){var w=ND(a,v,h,q);if(w){v=w;break a}}v=null}return v}function n(q){return TD(a,c,e,h,q,p)}var p=k||l;n("direction")=="rtl"&&(b.direction="rtl");k=n("writingMode");k=="tblr"?b.writingMode="vertical-lr":k=="tb"||k=="tbrl"?b.writingMode="vertical-rl":k=="rltb"||k=="rl"?b.direction="rtl":k&&(b.direction=Od);if(k=TD(a,c,e,h,"textAlign")){var u=UD[k]||[];b.positionAlign=u[0];b.lineAlign=u[1];b.textAlign=
ge[k.toUpperCase()]}else b.textAlign=Nd;if(k=TD(a,c,e,h,"displayAlign"))b.displayAlign=he[k.toUpperCase()];if(k=n("color"))b.color=RD(k);if(k=ND(a,c,h,"backgroundColor"))b.backgroundColor=RD(k);if(k=n("border"))b.border=k;if(k=n("fontFamily"))b.fontFamily=VD[k]||k.split(",").filter(function(q){return q!="default"}).join(",");m("fontWeight")=="bold"&&(b.fontWeight=de);b.wrapLine=m("wrapOption")!="noWrap";(k=LD(c)=="p"?n("lineHeight")||"normal":null)&&(k=="normal"||k.match(WD)||k.match(XD))&&(b.lineHeight=
k);(k=n("fontSize"))&&(k.match(WD)||k.match(XD))&&(b.fontSize=YD(a,c,d,e,h)||k);if(k=m("fontStyle"))b.fontStyle=je[k.toUpperCase()];f?(g=f.attributes.imageType||f.attributes.imagetype,k=f.attributes.encoding,f=Cd(f).trim(),g=="PNG"&&k=="Base64"&&f&&(b.backgroundImage="data:image/png;base64,"+f)):g&&(b.backgroundImage=g);f=n("textOutline");f=="none"?b.textStrokeWidth="0":f&&(f=f.trim().split(/\s+(?![^(]*\))/),ZD(f[0])?(g=m("color"),b.textStrokeColor=g?RD(g):b.color):(b.textStrokeColor=RD(f[0]),f.shift()),
(f=f[0]?ZD(f[0]):null)?b.textStrokeWidth=f:b.textStrokeColor="");if(f=n("textShadow"))b.textShadow=$D(f);(f=n("letterSpacing"))&&f.match(WD)&&(b.letterSpacing=f);(f=n("linePadding"))&&f.match(WD)&&(b.linePadding=f);if(f=ND(a,c,h,"opacity"))b.opacity=parseFloat(f);if(l)for(l=[DD(a,e,h,"textDecoration")].concat(aE(c,d).map(function(q){return ND(a,q,h,"textDecoration")})),l=t(l),f=l.next();!f.done;f=l.next())(f=f.value)&&bE(b,f);l=n("visibility");if(l=="hidden"||l=="visible")b.visibility=l;if(l=n("textCombine"))b.textCombineUpright=
l;if(l={container:"ruby",text:"rt"}[n("ruby")])b.rubyTag=l}function $D(a){return a=="none"?a:a.split(/,(?![^(]*\))/).map(function(b){return b.trim().split(/\s+(?![^(]*\))/).map(function(c){return ZD(c)||RD(c)}).join(" ")}).join(", ")}function OD(a){return/^(-?\d*\.?\d+)(px|em|c|%|rw|rh)$/.exec(a)}function ZD(a){var b=OD(a);return b?b[2]=="%"?Number(b[1])/100+"em":a:null}function aE(a,b){for(a=[a];b&&LD(b)!="tt";b=b.parent)a.unshift(b);return a}
function bE(a,b){b=t(b.split(" "));for(var c=b.next();!c.done;c=b.next()){var d=c.value;d=="none"?a.textDecoration=[]:(c=!d.startsWith("no"),d=cE[(c?d:d.slice(2)).toLowerCase()],c?d&&!a.textDecoration.includes(d)&&a.textDecoration.push(d):db(a.textDecoration,d))}}function TD(a,b,c,d,e,f){f=f===void 0?!0:f;return Jd(b,xD,e)||dE(a,b,d,e)||(f?DD(a,c,d,e):null)}function DD(a,b,c,d){return b?Jd(b,xD,d)||dE(a,b,c,d,Hd(b,"style"))||dE(a,b,c,d):null}
function ND(a,b,c,d){return Jd(b,xD,d)||(b.attributes.style?dE(a,b,c,d):null)}function YD(a,b,c,d,e){b=[DD(a,d,e,"fontSize")].concat(aE(b,c).map(function(h){return ND(a,h,e,"fontSize")})).filter(function(h){return h});c=0;d="";for(var f=t(b),g=f.next();!g.done;g=f.next()){g=OD(g.value);if(!g||!["px","c","%"].includes(g[2]))return null;g[2]=="%"&&d?c=c*Number(g[1])/100:(c=Number(g[1]),d=g[2])}return b.length>1?Number(c.toFixed(4))+d:null}
function dE(a,b,c,d,e){e=e||JD(b,"style",c,"");b=null;e=t(e);for(var f=e.next();!f.done;f=e.next()){var g=f.value;if(!(f=Gd(g,"urn:ebu:tt:style",d)||Jd(g,xD,d))){f=a;var h=c,k=d;f=Jd(g,xD,k)||dE(f,g,h,k)}b=f||b}return b}function JD(a,b,c,d,e){return(a=a&&c.length?eE(a,b,e):null)?a.split(" ").map(function(f){return c.find(function(g){return d+g.attributes["xml:id"]==f})}).filter(function(f){return f}):[]}
function eE(a,b,c){for(;a;a=a.parent){var d=c?Gd(a,c,b):a.attributes[b];if(d)return d}return null}
function CD(a,b,c,d,e,f){var g=fE(b.attributes.begin,c),h=fE(b.attributes.end,c),k=fE(b.attributes.dur,c);g=d+(g||0);var l=ID(b),m=gE(b);e=m||e?g:Infinity;for(var n=t(Hd(b,"set")),p=n.next();!p.done;p=n.next())CD(a,p.value,c,g,!1,f);m=t(m||[]);for(n=m.next();!n.done;n=m.next())n=n.value,p=l?e:g,n=xd(n)?l?p:Infinity:CD(a,n,c,p,l,f).end,e=l?n:Math.max(e,n);a=e;h!=null&&k!=null?a=Math.min(g+k,d+h):k!=null?a=g+k:h!=null&&(a=d+h);d={start:g,end:a};f.set(b,d);return d}
function gE(a){var b=LD(a),c=b=="p"||b=="span";a=c||b=="body"||b=="div"?a.children.filter(function(d){return xd(d)?c:["div","p","span","br"].includes(LD(d))}):[];return!a.length||b=="span"&&a.every(xd)?null:a}function LD(a){if(xd(a))return"";var b=a.tagName.split(":").pop();return Fd(a,Id,b)?b:""}function ID(a){return a.attributes.timeContainer=="seq"}
function fE(a,b){if(!a)return null;var c=hE.exec(a);if(c)return Number(c[3])+(Number(c[4])+(Number(c[5])||0)/b.h)/b.frameRate+Number(c[2])*60+Number(c[1])*3600;if(c=iE.exec(a))return Number(c[1])/(c[2]=="f"?b.frameRate:b.i);c=jE.exec(a)||kE.exec(a);if(!c)throw new L(2,2,2001,"Could not parse cue time range in TTML");return(Number(c[4])||0)/1E3+(Number(c[3])||0)+(Number(c[2])||0)*60+(Number(c[1])||0)*3600}
function AD(a){return(a=/^(\d+) (\d+)$/.exec(a||""))?{columns:Number(a[1]),rows:Number(a[2])}:null}K("shaka.text.TtmlTextParser",vD);vD.prototype.parseMedia=vD.prototype.parseMedia;vD.prototype.setManifestType=vD.prototype.setManifestType;vD.prototype.parseInit=vD.prototype.parseInit;function yD(a,b,c,d){this.frameRate=Number(a)||30;this.h=Number(b)||1;this.i=Number(d)||(a?this.frameRate*this.h:1);if(a=/^(\d+) (\d+)$/.exec(c||""))this.frameRate*=Number(a[1])/Number(a[2])}
var ED=/^(transparent|#\w{6}00|rgba\(.*,\s*0\))?$/i,XD=/^(\d{1,4}(?:\.\d+)?|100)%$/,WD=/^(\d+px|\d+em|\d*\.?\d+c)$/,PD=/^(\d+)px (\d+)px$/,hE=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,jE=/^(?:(\d{2,}):)?(\d{2}):(\d{2}(?:\.\d+)?)$/,iE=/^(\d*(?:\.\d*)?)([ft])$/,kE=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m(?!s))?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),VD={monospaceSerif:"Courier New,Liberation Mono,Courier,monospace",proportionalSansSerif:"Arial,Helvetica,Liberation Sans,sans-serif",
sansSerif:"sans-serif",monospaceSansSerif:"Consolas,monospace",proportionalSerif:"serif"},cE={underline:fe,linethrough:"line-through",overline:"overline"},UD={left:["line-left",Rd],center:["center","center"],right:["line-right","end"],start:["line-left",Rd],end:["line-right","end"]},Id=["http://www.w3.org/ns/ttml","http://www.w3.org/2006/10/ttaf1",""],zD=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],xD=["http://www.w3.org/ns/ttml#styling","http://www.w3.org/2006/10/ttaf1#styling"],
KD=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];Me("application/ttml+xml",function(){return new vD});function lE(){this.h=new vD;this.i=null}lE.prototype.parseInit=function(a){var b=this,c=!1;(new hh).ma(sh,mh).P("mdhd",function(d){d=Eh(d.reader,d.version);b.i=d.timescale}).P("stsd",oh).box("stpp",function(d){c=!0;d.parser.stop()}).parse(a);if(!c)throw new L(2,2,2007);};lE.prototype.setManifestType=function(a){this.h.setManifestType(a)};
lE.prototype.parseMedia=function(a,b,c){var d=[],e=null,f=null,g=[],h=new Map,k=[],l=[],m=[],n=0;(new hh).ma(th,mh).P("tfhd",function(A){A=Ch(A.reader,A.flags);e=A.ac;f=A.Fb}).P("tfdt",function(A){n=Dh(A.reader,A.version).za}).P("trun",function(A){A=Fh(A.reader,A.version,A.flags);A=t(A.nc);for(var E=A.next();!E.done;E=A.next())E=E.value,k.push(E.sampleSize||e||0),E=E.qc||f,l.push(E),m.push(n),n+=E||0}).P("subs",function(A){for(var E=A.reader,C=E.R(),F=-1,G=0;G<C;G++){var J=E.R();F+=J;J=E.xa();for(var Q=
[],O=0;O<J;O++)A.version==1?Q.push(E.R()):Q.push(E.xa()),E.X(),E.X(),E.R();h.set(F,Q)}}).box("mdat",rh(function(A){g.push(A)},!1)).parse(a,!1);if(g.length==0)throw new L(2,2,2007);a=Sb.apply(Mb,wa(g));for(var p=mE(this,m,l,b),u=0,q=0;q<k.length;q++){var v=yb(a,u,k[q]);u+=k[q];var w=h.get(q),y=[];if(w&&w.length){for(var x=yb(v,0,w[0]),z=w[0],D=1;D<w.length;D++){var B=yb(v,z,w[D]);B=Nb(B);y.push("data:image/png;base64,"+B);z+=w[D]}v=x}d=d.concat(this.h.parseMedia(v,p?p[q]:b,c,y))}return d};
function mE(a,b,c,d){a=a.i;if(!a||c.length<2)return null;var e=[];c=t(c);for(var f=c.next();!f.done;f=c.next()){f=f.value;if(!f)return null;e.push(f)}c=b[0];f=[];for(var g=0;g<e.length;g++){var h=d.segmentStart+(b[g]-c)/a;f.push({periodStart:d.periodStart,segmentStart:Math.min(Math.max(h,d.segmentStart),d.segmentEnd),segmentEnd:Math.min(Math.max(h+e[g]/a,d.segmentStart),d.segmentEnd),vttOffset:d.vttOffset,isMpegTs:d.isMpegTs})}f[f.length-1].segmentEnd=d.segmentEnd;return f}
K("shaka.text.Mp4TtmlParser",lE);lE.prototype.parseMedia=lE.prototype.parseMedia;lE.prototype.setManifestType=lE.prototype.setManifestType;lE.prototype.parseInit=lE.prototype.parseInit;Me('application/mp4; codecs="stpp"',function(){return new lE});Me('application/mp4; codecs="stpp.ttml"',function(){return new lE});Me('application/mp4; codecs="stpp.ttml.im1i"',function(){return new lE});Me('application/mp4; codecs="stpp.ttml.im1t"',function(){return new lE});
Me('application/mp4; codecs="stpp.ttml.im2i"',function(){return new lE});Me('application/mp4; codecs="stpp.ttml.im2t"',function(){return new lE});Me('application/mp4; codecs="stpp.ttml.etd1"',function(){return new lE});Me('application/mp4; codecs="stpp.ttml.etd1|im1t"',function(){return new lE});Me('application/mp4; codecs="stpp.ttml.im1t|etd1"',function(){return new lE});Me('application/mp4; codecs="stpp.TTML.im1t"',function(){return new lE});function nE(){this.h="UNKNOWN"}nE.prototype.parseInit=function(){};nE.prototype.setManifestType=function(a){this.h=a};
nE.prototype.parseMedia=function(a,b){a=Fb(a);a=a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var c=a.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(c[0]))throw new L(2,2,2E3);a=b.vttOffset;if(this.h=="HLS"&&c[0].includes("X-TIMESTAMP-MAP")){var d=c[0];a=c.slice(1);var e=d.match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m);d=d.match(/MPEGTS:(\d+)/m);if(!e||!d)throw new L(2,2,2E3);e=ld(e[1]);if(e==null)throw new L(2,2,2E3);d=Number(d[1]);var f=b.segmentStart-b.periodStart;a=(a=a.join("\n").match(/^[ \t]*((?:\d+:)?\d{2}:\d{2}\.\d{3})[ \t]+--\x3e/m))?
ld(a[1]):null;a!=null&&(f-=a-e);d+=Math.max(0,Math.round((f-d/9E4)/95443.7176888889))*8589934592;a=b.periodStart+d/9E4-e}b=oE(c[0]);e=new Map;Yd(e);d=[];f=!1;c=t(c.slice(1));for(var g=c.next();!g.done;g=c.next())if(g=g.value.split("\n"),pE(g))f||b.push(qE(g.slice(1).join("\n"),":"));else{if((g.length!=1||g[0])&&!rE.test(g[0])&&g[0]=="STYLE"){for(var h=[],k=-1,l=1;l<g.length;l++)g[l].includes("::cue")&&(h.push([]),k=h.length-1),k!=-1&&(h[k].push(g[l]),g[l].includes("}")&&(k=-1));h=t(h);for(k=h.next();!k.done;k=
h.next()){var m=k.value;k="global";(l=m[0].match(/\((.*)\)/))&&(k=l.pop());l=m.slice(1,-1);m[0].includes("}")&&(m=/\{(.*?)\}/.exec(m[0]))&&(l=m[1].split(";"));(m=e.get(k))||(m=new Ld(0,0,""));for(var n=!1,p=0;p<l.length;p++){var u=/^\s*([^:]+):\s*(.*)/.exec(l[p]);if(u){var q=u[2].trim().replace(";","");switch(u[1].trim()){case "background-color":case "background":n=!0;m.backgroundColor=q;break;case "color":n=!0;m.color=q;break;case "font-family":n=!0;m.fontFamily=q;break;case "font-size":n=!0;m.fontSize=
/^\d*\.?\d+%$/.test(q)?parseFloat(q)/100+"em":q;break;case "font-weight":if(parseInt(q,10)>=700||q=="bold")n=!0,m.fontWeight=de;break;case "font-style":switch(q){case "normal":n=!0;m.fontStyle=Ud;break;case "italic":n=!0;m.fontStyle=ee;break;case "oblique":n=!0,m.fontStyle="oblique"}break;case "opacity":n=!0;m.opacity=parseFloat(q);break;case "text-combine-upright":n=!0;m.textCombineUpright=q;break;case "text-shadow":n=!0;m.textShadow=q;break;case "white-space":n=!0,m.wrapLine=q!="noWrap"}}}n&&e.set(k,
m)}}m=g;p=a;if(m.length==1&&!m[0]||rE.test(m[0])||m[0]=="STYLE"||pE(m))g=null;else if(g=null,n=0,m[0].includes("--\x3e")||(g=m[0],n=1),h=new fd(m[n]),k=jd(h),u=id(h,/[ \t]+--\x3e[ \t]+/g),l=jd(h),k==null||u==null||l==null)Wa("Failed to parse VTT time code. Cue skipped:",g,m),g=null;else{k+=p;l+=p;k<0&&(k=0);p="";for(u=n+1;u<m.length;u++)u>n+1&&(p+="\n"),p+=m[u];p=p.trim();e.has("global")?(m=e.get("global").clone(),m.startTime=k,m.endTime=l,m.payload=p):m=new Ld(k,l,p);id(h,/[ \t]+/gm);sE(m,h,b);Xd(m,
e);g!=null&&(m.id=g);g=m}g&&(f=!0,d.push(g))}return d};function tE(a){var b=a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").split(/\n{2,}/m);a=oE(b[0]);b=t(b);for(var c=b.next();!c.done;c=b.next()){c=c.value.split("\n");if(c.some(function(d){return d.includes("--\x3e")}))break;pE(c)&&a.push(qE(c.slice(1).join("\n"),":"))}return a}function oE(a){var b=[];a=t(a.split("\n"));for(var c=a.next();!c.done;c=a.next())c=c.value,/^Region:/.test(c)&&b.push(qE(c.substring(7),"="));return b}
function pE(a){return/^REGION[ \t]*$/.test(a[0])&&!(a.length>1&&a[1].includes("--\x3e"))}
function qE(a,b){var c=new ad;c.height=3;c.heightUnits=2;c.regionAnchorX=0;c.regionAnchorY=100;c.viewportAnchorX=0;c.viewportAnchorY=100;a=t(a.split(/[ \t\n]+/));for(var d=a.next();!d.done;d=a.next())if(d=d.value){var e=d.indexOf(b);if(!(e<=0||e==d.length-1)){var f=d.substring(e+1);switch(d.substring(0,e)){case "id":c.id=f;break;case "width":d=uE(f);if(d==null)break;c.width=d;break;case "lines":if(!/^\d+$/.test(f))break;c.height=Number(f);c.heightUnits=2;break;case "regionanchor":d=vE(f);if(!d)break;
c.regionAnchorX=d[0];c.regionAnchorY=d[1];break;case "viewportanchor":d=vE(f);if(!d)break;c.viewportAnchorX=d[0];c.viewportAnchorY=d[1];break;case "scroll":f=="up"&&(c.scroll="up")}}}return c}
function sE(a,b,c){gd(b,function(d){var e;if(e=wE.exec(d))d=e[1],d=="middle"?a.textAlign=Nd:a.textAlign=ge[d.toUpperCase()];else if(e=xE.exec(d))a.writingMode=e[1]=="lr"?"vertical-lr":"vertical-rl";else if(e=yE.exec(d))a.size=Number(e[1]);else if(e=zE.exec(d))a.position=Number(e[1]),e[2]&&(d=e[2],a.positionAlign=d=="line-left"||d=="start"?"line-left":d=="line-right"||d=="end"?"line-right":d=="center"||d=="middle"?"center":Md);else if(e=AE.exec(d)){b:{for(d=c.length-1;d>=0;d--)if(c[d].id==e[1]){d=
c[d];break b}d=null}d&&(a.region=d)}else b:{if(e=BE.exec(d))a.lineInterpretation=1;else if(e=CE.exec(d))a.lineInterpretation=Qd;else break b;a.line=Number(e[1]);e[2]&&(a.lineAlign=ie[e[2].toUpperCase()])}});a.region.id&&(a.line!=null||a.size&&a.size!=100||a.writingMode!=Pd)&&(a.region=new ad)}function vE(a){var b=a.indexOf(",");if(b<0)return null;var c=uE(a.substring(0,b));a=uE(a.substring(b+1));return c==null||a==null?null:[c,a]}
function uE(a){if(!/^\d+(?:\.\d+)?%$/.test(a))return null;a=parseFloat(a);return a>100?null:a}K("shaka.text.VttTextParser",nE);nE.prototype.parseMedia=nE.prototype.parseMedia;nE.prototype.setManifestType=nE.prototype.setManifestType;nE.prototype.parseInit=nE.prototype.parseInit;
var rE=/^NOTE($|[ \t])/,wE=/^align:(start|middle|center|end|left|right)$/,xE=/^vertical:(lr|rl)$/,yE=/^size:([\d.]+)%$/,zE=/^position:([\d.]+)%(?:,(line-left|line-right|middle|center|start|end|auto))?$/,AE=/^region:(.+)$/,BE=/^line:([\d.]+)%(?:,(start|end|center))?$/,CE=/^line:(-?\d+)(?:,(start|end|center))?$/;Me("text/vtt",function(){return new nE});Me('text/vtt; codecs="vtt"',function(){return new nE});Me('text/vtt; codecs="wvtt"',function(){return new nE});function DE(){this.h=null;this.i=[]}DE.prototype.parseInit=function(a){var b=this,c=!1;(new hh).ma(sh,mh).P("mdhd",function(d){d=Eh(d.reader,d.version);b.h=d.timescale}).P("stsd",oh).box("wvtt",function(d){c=!0;d.reader.skip(8);mh(d)}).box("vttC",rh(function(d){b.i=tE(Fb(d))},!1)).parse(a);if(!this.h)throw new L(2,2,2008);if(!c)throw new L(2,2,2008);};DE.prototype.setManifestType=function(){};
DE.prototype.parseMedia=function(a,b){var c=this;if(!a.length)return[];if(!this.h)throw new L(2,2,2008);var d=0,e=[],f=[],g=!1,h=!1,k=!1,l=null;(new hh).ma(th,mh).P("tfdt",function(m){g=!0;d=Dh(m.reader,m.version).za}).P("tfhd",function(m){l=Ch(m.reader,m.flags).Fb}).P("trun",function(m){h=!0;e=Fh(m.reader,m.version,m.flags).nc}).box("mdat",rh(function(m){k=!0;var n=e,p=d,u=l,q=p;m=new Zg(m,0);n=t(n);for(var v=n.next();!v.done;v=n.next()){v=v.value;var w=v.qc||u,y=v.ef?p+v.ef:q;q=y+(w||0);var x=0;
do{var z=m.R();if(z<8)throw new L(2,2,2008);x+=z;var D=m.R(),B=null;lh(D)=="vttc"?z>8&&(B=m.wa(z-8,!1)):m.skip(z-8);w&&B&&(z=EE(B,b.periodStart+y/c.h,b.periodStart+q/c.h,c.i),f.push(z))}while(v.sampleSize&&x<v.sampleSize)}p=t(e);for(u=p.next();!u.done;u=p.next())d+=u.value.qc||l||0;e=[]},!1)).parse(a,!1);if(!k&&!g&&!h)throw new L(2,2,2008);return f.filter(cf)};
function EE(a,b,c,d){var e,f,g;(new hh).box("payl",rh(function(h){e=Fb(h)},!1)).box("iden",rh(function(h){f=Fb(h)},!1)).box("sttg",rh(function(h){g=Fb(h)},!1)).parse(a);return e?FE(e,f,g,b,c,d):null}function FE(a,b,c,d,e,f){a=new Ld(d,e,a);Xd(a);b&&(a.id=b);c&&sE(a,new fd(c),f);return a}K("shaka.text.Mp4VttParser",DE);DE.prototype.parseMedia=DE.prototype.parseMedia;DE.prototype.setManifestType=DE.prototype.setManifestType;DE.prototype.parseInit=DE.prototype.parseInit;
Me('application/mp4; codecs="wvtt"',function(){return new DE});function GE(a){this.o=a;this.frameIndex=0;this.l=new Map;this.m=null}GE.prototype.destroy=function(){this.l.clear()};GE.prototype.getOriginalMimeType=function(){return this.o};function HE(a,b){a=ji(a);return a.length&&(a=a.find(function(c){return c.description==="com.apple.streaming.transportStreamTimestamp"}))?a.data:b}
function IE(a,b,c,d){c=a.l.getOrInsertComputed(c.id+"_"+d.discontinuitySequence,function(){if(b.h.length===0)throw Error("StreamInfos must have elements");var f=[];for(var g=t(b.h),h=g.next();!h.done;h=g.next()){var k=f,l=k.push,m=b,n=h.value;h=Yp;var p=n.id+1,u=n.stream.width||0,q=n.stream.height||0;n.type=="audio"&&(q=u=0);var v=n.duration*n.timescale,w=Math.floor(v/(vq+1));v=Math.floor(v%(vq+1));var y=zq.value();kq(y,p,20);kq(y,w,28);kq(y,v,32);iq(y,u,88);iq(y,q,92);p=Yp("tkhd",y);u=n;n=Yp;w=u.duration*
u.timescale;q=Math.floor(w/(vq+1));w=Math.floor(w%(vq+1));v=u.stream.language;v=v.charCodeAt(0)-96<<10|v.charCodeAt(1)-96<<5|v.charCodeAt(2)-96;y=Aq.value();kq(y,u.timescale,20);kq(y,q,24);kq(y,w,28);iq(y,v,32);q=Yp("mdhd",y);w=new Uint8Array([]);switch(u.type){case "video":w=Cq.value();break;case "audio":w=Dq.value()}w=Yp("hdlr",w);a:{switch(u.type){case "video":m=Yp("minf",Yp("vmhd",Eq.value()),Hq.value(),Xp(m,u));break a;case "audio":m=Yp("minf",Yp("smhd",Fq.value()),Hq.value(),Xp(m,u));break a}m=
new Uint8Array([])}m=n("mdia",q,w,m);h=h("trak",p,m);l.call(k,h)}g=b.h[0];k=Yp;l=k.apply;p=g.duration*g.timescale;h=Math.floor(p/(vq+1));p=Math.floor(p%(vq+1));m=yq.value();kq(m,g.timescale,20);kq(m,h,24);kq(m,p,28);h=["moov",Yp("mvhd",m)];p=h.concat;f=wa(f);m=[];n=t(b.h);for(w=n.next();!w.done;w=n.next())u=m,q=u.push,w=w.value.id+1,v=Bq.value(),kq(v,w,4),w=Yp("trex",v),q.call(u,w);m=Yp.apply(Wp,["mvex"].concat(wa(m)));f=l.call(k,Wp,p.call(h,f,[m,pq(g.stream)]));g=Gq.value();k=new Uint8Array(g.byteLength+
f.byteLength);k.set(g);k.set(f,g.byteLength);return k});d=a.m!==c;var e=tq(b);a.m=c;a.frameIndex++;return{data:e,init:d?c:null}}K("shaka.transmuxer.BaseTransmuxer",GE);GE.prototype.getOriginalMimeType=GE.prototype.getOriginalMimeType;GE.prototype.destroy=GE.prototype.destroy;var JE=Object.freeze({mg:0,Oe:0,Me:0,Be:0,Ce:2,ng:0}),KE=Object.freeze({mg:0,Oe:0,Me:0,Be:0,Ce:2,ng:0}),LE=Object.freeze({mg:0,Oe:0,Me:0,Be:0,Ce:1,ng:1});function ME(){GE.apply(this,arguments)}ta(ME,GE);ME.prototype.isSupported=function(a){return a.toLowerCase().split(";")[0]=="audio/aac"?Km(this.convertCodecs("audio",a)):!1};ME.prototype.convertCodecs=function(a,b){return b.toLowerCase().split(";")[0]=="audio/aac"?'audio/mp4; codecs="'+(Ee(b)||"mp4a.40.2")+'"':b};
ME.prototype.transmux=function(a,b,c,d){var e=yb(a);a=ki(e);for(var f=a.length;f<e.length&&!Ri(e,f);f++);var g=HE(a,c.endTime*1E3);a=Qi(e,f);if(!a)return Promise.reject(new L(2,3,3018,c?c.S()[0]:null));b.audioSamplingRate=a.sampleRate;b.channelsCount=a.channelCount;for(var h=[];f<e.length;){var k=Pi(e,f);if(!k)return Promise.reject(new L(2,3,3018,c?c.S()[0]:null));var l=k.Id+k.ea;f+l<=e.length&&h.push({data:e.subarray(f+k.Id,f+l),size:k.ea,duration:1024,ab:0,flags:JE});f+=l}e=a.sampleRate;f=Math.floor(g*
e/1E3);d={id:b.id,type:"audio",codecs:a.codec,timescale:e,duration:d,cb:new Uint8Array([]),data:{sequenceNumber:this.frameIndex,za:f,Sa:h},stream:b};return Promise.resolve(IE(this,new Wp([d]),b,c))};K("shaka.transmuxer.AacTransmuxer",ME);ME.prototype.transmux=ME.prototype.transmux;ME.prototype.convertCodecs=ME.prototype.convertCodecs;ME.prototype.isSupported=ME.prototype.isSupported;le("audio/aac",function(){return new ME("audio/aac")},1);function NE(){GE.apply(this,arguments)}ta(NE,GE);NE.prototype.isSupported=function(a){return a.toLowerCase().split(";")[0]=="audio/ac3"?Km(this.convertCodecs("audio",a)):!1};NE.prototype.convertCodecs=function(a,b){return b.toLowerCase().split(";")[0]=="audio/ac3"?ob().Td()?'audio/mp4; codecs="ec-3"':'audio/mp4; codecs="ac-3"':b};
NE.prototype.transmux=function(a,b,c,d){a=yb(a);for(var e=ki(a),f=e.length;f<a.length&&!Oi(a,f);f++);e=HE(e,c.endTime*1E3);for(var g=0,h=new Uint8Array([]),k=[],l={sampleRate:0,channelCount:0,Ob:new Uint8Array(0),ea:0};f<a.length;){if(!Ni(a,f,l))return Promise.reject(new L(2,3,3018,c?c.S()[0]:null));b.audioSamplingRate=l.sampleRate;b.channelsCount=l.channelCount;g=l.sampleRate;h=l.Ob;k.push({data:a.subarray(f,f+l.ea),size:l.ea,duration:1536,ab:0,flags:JE});f+=l.ea}return Promise.resolve(IE(this,new Wp([{id:b.id,
type:"audio",codecs:"ac-3",timescale:g,duration:d,cb:h,data:{sequenceNumber:this.frameIndex,za:Math.floor(e*g/1E3),Sa:k},stream:b}]),b,c))};K("shaka.transmuxer.Ac3Transmuxer",NE);NE.prototype.transmux=NE.prototype.transmux;NE.prototype.convertCodecs=NE.prototype.convertCodecs;NE.prototype.isSupported=NE.prototype.isSupported;le("audio/ac3",function(){return new NE("audio/ac3")},1);function OE(){GE.apply(this,arguments)}ta(OE,GE);OE.prototype.isSupported=function(a){return a.toLowerCase().split(";")[0]=="audio/ec3"?Km(this.convertCodecs("audio",a)):!1};OE.prototype.convertCodecs=function(a,b){return b.toLowerCase().split(";")[0]=="audio/ec3"?'audio/mp4; codecs="ec-3"':b};
OE.prototype.transmux=function(a,b,c,d){a=yb(a);for(var e=ki(a),f=e.length;f<a.length&&!kj(a,f);f++);e=HE(e,c.endTime*1E3);for(var g=0,h=new Uint8Array([]),k=[],l={sampleRate:0,channelCount:0,Ob:new Uint8Array(0),ea:0};f<a.length;){if(!Xi(a,f,l))return Promise.reject(new L(2,3,3018,c?c.S()[0]:null));b.audioSamplingRate=l.sampleRate;b.channelsCount=l.channelCount;g=l.sampleRate;h=l.Ob;k.push({data:a.subarray(f,f+l.ea),size:l.ea,duration:1536,ab:0,flags:JE});f+=l.ea}return Promise.resolve(IE(this,new Wp([{id:b.id,
type:"audio",codecs:"ec-3",timescale:g,duration:d,cb:h,data:{sequenceNumber:this.frameIndex,za:Math.floor(e*g/1E3),Sa:k},stream:b}]),b,c))};K("shaka.transmuxer.Ec3Transmuxer",OE);OE.prototype.transmux=OE.prototype.transmux;OE.prototype.convertCodecs=OE.prototype.convertCodecs;OE.prototype.isSupported=OE.prototype.isSupported;le("audio/ec3",function(){return new OE("audio/ec3")},1);function PE(){GE.apply(this,arguments)}ta(PE,GE);PE.prototype.isSupported=function(a){return a.toLowerCase().split(";")[0]=="audio/mpeg"?Km(this.convertCodecs("audio",a)):!1};PE.prototype.convertCodecs=function(a,b){return b.toLowerCase().split(";")[0]=="audio/mpeg"?'audio/mp4; codecs="mp3"':b};
PE.prototype.transmux=function(a,b,c,d){for(var e=yb(a),f=ki(e).length;f<e.length&&!zj(e,f);f++);var g;for(a=[];f<e.length;){var h=tj(e,f);h?(g||(g=h),f+h.ea<=e.length&&a.push({data:e.subarray(f,f+h.ea),size:h.ea,duration:1152,ab:0,flags:JE}),f+=h.ea):f++}if(!g)return Promise.reject(new L(2,3,3018,c?c.S()[0]:null));e=g.Uk*9E4/g.sampleRate*this.frameIndex;d={id:b.id,type:"audio",codecs:"mp3",timescale:g.sampleRate,duration:d,cb:new Uint8Array([]),data:{sequenceNumber:this.frameIndex,za:e,Sa:a},stream:b};
return Promise.resolve(IE(this,new Wp([d]),b,c))};K("shaka.transmuxer.Mp3Transmuxer",PE);PE.prototype.transmux=PE.prototype.transmux;PE.prototype.convertCodecs=PE.prototype.convertCodecs;PE.prototype.isSupported=PE.prototype.isSupported;le("audio/mpeg",function(){return new PE("audio/mpeg")},1);function QE(a){this.i=a;this.h=null}r=QE.prototype;r.destroy=function(){};r.isSupported=function(a){if(a.toLowerCase().split(";")[0]!="video/mp2t")return!1;var b=Ee(a).split(","),c=xc("audio",b);b=xc("video",b);return!c||b||Ae(c)!="mp3"?!1:Km(this.convertCodecs("audio",a))};r.convertCodecs=function(a,b){return b.toLowerCase().split(";")[0]=="video/mp2t"?"audio/mpeg":b};r.getOriginalMimeType=function(){return this.i};
r.transmux=function(a,b,c,d,e){this.h?this.h.clearData():this.h=new yi;this.h.gf(c.discontinuitySequence);a=yb(a);a=this.h.parse(a);if(a.Dd().audio!="mp3"||e!="audio")return Promise.reject(new L(2,3,3018,c?c.S()[0]:null));c=[];e=t(a.jb());for(a=e.next();!a.done;a=e.next())a=a.value,a.data&&c.push(a.data);c=Ub(c);e=[];for(a=0;a<c.length;)(b=tj(c,a))?(a+b.ea<=c.length&&e.push(c.subarray(a,a+b.ea)),a+=b.ea):a++;return Promise.resolve(Ub(e))};K("shaka.transmuxer.MpegTsTransmuxer",QE);
QE.prototype.transmux=QE.prototype.transmux;QE.prototype.getOriginalMimeType=QE.prototype.getOriginalMimeType;QE.prototype.convertCodecs=QE.prototype.convertCodecs;QE.prototype.isSupported=QE.prototype.isSupported;QE.prototype.destroy=QE.prototype.destroy;le("video/mp2t",function(){return new QE("video/mp2t")},2);function RE(a){GE.call(this,a);this.h=this.j=this.i=null}ta(RE,GE);RE.prototype.destroy=function(){GE.prototype.destroy.call(this);this.j&&this.j.destroy()};RE.prototype.isSupported=function(a,b){if(!SE(a))return!1;var c=a;b&&(c=this.convertCodecs(b,a));var d=Ee(c).split(",");c=xc("audio",d);d=xc("video",d);if(c&&(c=Ae(c),!TE.includes(c))||d&&(c=Ae(d),!UE.includes(c)))return!1;if(b)return Km(this.convertCodecs(b,a));b=this.convertCodecs("audio",a);a=this.convertCodecs("video",a);return Km(b)||Km(a)};
function SE(a){a=a.toLowerCase().split(";")[0];return a=="video/mp2t"||a=="audio/mp2t"}RE.prototype.convertCodecs=function(a,b){return SE(b)?(b=Ee(b).replace("mp4a.40.34","mp3").split(",").map(function(c){return Ge(c,"audio/mp4")}).map(Ie).join(","),a=="audio"?'audio/mp4; codecs="'+b+'"':'video/mp4; codecs="'+b+'"'):b};
RE.prototype.transmux=function(a,b,c,d,e){var f=yb(a);if(e=="audio"&&!Li(f)){for(var g=ki(f),h=g.length;h<f.length;h++)if(zj(f,h))return Promise.reject(new L(2,3,3018,c?c.S()[0]:null));for(h=g.length;h<f.length;h++)if(Ri(f,h))return this.j||(this.j=new ME("audio/aac")),this.j.transmux(a,b,c,d,e);return Promise.reject(new L(2,3,3018,c?c.S()[0]:null))}this.i?this.i.clearData():this.i=new yi;this.i.gf(c.discontinuitySequence);var k=this.i.parse(f),l=[],m=k.Dd();try{var n=null;if(e=="video"){switch(m.video){case "avc":var p=
[],u=null,q=k.yc(),v=nj(q);if(!v.length)throw new L(2,3,3023,c?c.S()[0]:null);for(var w=0;w<v.length;w++){var y=v[w];u==null&&(u=y.dts);var x=void 0;x=w+1<v.length?(v[w+1].dts||0)-(y.dts||0):v.length>1?(y.dts||0)-(v[w-1].dts||0):(c.endTime-c.startTime)*9E4;p.push({data:y.data,size:y.data.byteLength,duration:x,ab:Math.round((y.pts||0)-(y.dts||0)),flags:y.isKeyframe?KE:LE})}for(var z=[],D=t(q),B=D.next();!B.done;B=D.next())z.push.apply(z,wa(B.value.nalus));var A=lj(z);if(!A||u==null)throw new L(2,3,
3018,c?c.S()[0]:null);b.height=b.height||A.height;b.width=b.width||A.width;n={id:b.id,type:"video",codecs:"avc1",timescale:9E4,duration:d,cb:A.Yd,zc:A.zc,Mc:A.Mc,data:{sequenceNumber:this.frameIndex,za:u,Sa:p},stream:b};break;case "hvc":var E=[],C=null,F=[],G=k.yc(),J=new Uint8Array(0),Q=!1;if(!G.length)throw new L(2,3,3023,c?c.S()[0]:null);for(var O=0;O<G.length;O++){var V=G[O],M=V.nalus;F.push.apply(F,wa(M));for(var N=!1,P=[],U=0,ea=!1,ha=t(M),I=ha.next();!I.done;I=ha.next()){var T=I.value;switch(T.type){case 1:case 0:var R=
ea=!0;break;case 19:case 20:case 21:N=R=ea=!0;break;case 32:case 33:case 34:R=!0;break;case 35:ea=R=!0;break;case 39:case 40:R=!0;break;default:R=!1}R&&(P.push(T.fullData),U+=T.fullData.byteLength)}if(ea&&P.length){U+=4*P.length;for(var S=new Uint8Array(U),X=0,ka=t(P),ma=ka.next();!ma.done;ma=ka.next()){var Aa=ma.value,ja=Aa.byteLength;S[X]=ja>>24&255;S[X+1]=ja>>16&255;S[X+2]=ja>>8&255;S[X+3]=ja&255;S.set(Aa,X+4);X+=ja+4}J=S;Q=N;var ua=!0}else ua=!1;if(ua){C==null&&V.dts!=null&&(C=V.dts);var ub=void 0;
ub=O+1<G.length?(G[O+1].dts||0)-(V.dts||0):G.length>1?(V.dts||0)-(G[O-1].dts||0):(c.endTime-c.startTime)*9E4;E.push({data:J,size:J.byteLength,duration:ub,ab:Math.round((V.pts||0)-(V.dts||0)),flags:Q?KE:LE})}}var vb=oj(F);if(!vb||C==null)throw new L(2,3,3018,c?c.S()[0]:null);b.height=b.height||vb.height;b.width=b.width||vb.width;n={id:b.id,type:"video",codecs:"hvc1",timescale:9E4,duration:d,cb:vb.Yd,zc:vb.zc,Mc:vb.Mc,data:{sequenceNumber:this.frameIndex,za:C,Sa:E},stream:b};break;case "av1":var cg=
[],rd=null,Kc=k.yc();if(!Kc.length)throw new L(2,3,3023,c?c.S()[0]:null);for(var Xc=0;Xc<Kc.length;Xc++){var ab=Kc[Xc],Te=Ah(ab.data);if(Te){var Mv=zh(Te),Nv=Ti(Mv);Nv&&(this.h=Nv);if(this.h){rd==null&&ab.dts!=null&&(rd=ab.dts);var Ov=void 0;Ov=Xc+1<Kc.length?(Kc[Xc+1].dts||0)-(ab.dts||0):Kc.length>1?(ab.dts||0)-(Kc[Xc-1].dts||0):(c.endTime-c.startTime)*9E4;a:{for(var zF=this.h.Ig,Pv=t(Mv),Bn=Pv.next();!Bn.done;Bn=Pv.next()){var Yi=Bn.value;if(Yi.type==6||Yi.type==3){if(zF){var Cn=!0;break a}if(!Yi.data.byteLength)break;
var Qv=Yi.data[0];if(Qv&128)break;Cn=(Qv&96)>>5==0;break a}}Cn=!1}cg.push({data:Te,size:Te.byteLength,duration:Ov,ab:Math.round((ab.pts||0)-(ab.dts||0)),flags:Cn?KE:LE})}}}if(!this.h||rd==null)throw new L(2,3,3018,c?c.S()[0]:null);b.height=b.height||this.h.height;b.width=b.width||this.h.width;n={id:b.id,type:"video",codecs:"av01",timescale:9E4,duration:d,cb:this.h.Yd,data:{sequenceNumber:this.frameIndex,za:rd,Sa:cg},stream:b}}n&&(l.push(n),n=null)}if(e=="audio"){switch(m.audio){case "aac":for(var Zi=
[],cd,se=null,zd=null,te=null,Rv=t(k.jb()),Dn=Rv.next();!Dn.done;Dn=Rv.next()){var $i=Dn.value,ic=$i.data;if(ic){var Tb=0;if(zd==-1&&te)ic=Sb(te,$i.data),zd=null;else if(zd!=null&&te){Tb=Math.max(0,zd);var Sv=Sb(te,ic.subarray(0,Tb));Zi.push({data:Sv,size:Sv.byteLength,duration:1024,ab:0,flags:JE});zd=te=null}cd=Qi(ic,Tb);if(!cd)throw new L(2,3,3018,c?c.S()[0]:null);b.audioSamplingRate=cd.sampleRate;b.channelsCount=cd.channelCount;se==null&&$i.pts!==null&&(se=$i.pts);for(;Tb<ic.length;){var jf=Pi(ic,
Tb);if(!jf){te=ic.subarray(Tb,ic.length);zd=-1;break}var Mg=jf.Id+jf.ea;zd=Math.max(0,Tb+Mg-ic.length);zd!=0?te=ic.subarray(Tb+jf.Id,Tb+Mg):Tb+Mg<=ic.length&&Zi.push({data:ic.subarray(Tb+jf.Id,Tb+Mg),size:jf.ea,duration:1024,ab:0,flags:JE});Tb+=Mg}}}if(!cd||se==null){se=c.startTime*9E4;var En=xc("audio",b.codecs.split(","));if(!En||!b.channelsCount||!b.audioSamplingRate)throw new L(2,3,3018,c?c.S()[0]:null);cd={sampleRate:b.audioSamplingRate,channelCount:b.channelsCount,codec:En};var Fn=Si(En,b.channelsCount);
if(!Fn)throw new L(2,3,3018,c?c.S()[0]:null);for(var AF=se+(c.endTime-c.startTime)*9E4,Tv=se;Tv<AF;)Zi.push({data:Fn,size:Fn.byteLength,duration:1024,ab:0,flags:JE}),Tv+=1024/cd.sampleRate*9E4}var Uv=cd.sampleRate,BF=se/9E4*Uv;n={id:b.id,type:"audio",codecs:cd.codec,timescale:Uv,duration:d,cb:new Uint8Array([]),data:{sequenceNumber:this.frameIndex,za:BF,Sa:Zi},stream:b};break;case "ac3":for(var Vv=[],aj=0,Gn=new Uint8Array([]),bj=null,Ad={sampleRate:0,channelCount:0,Ob:new Uint8Array(0),ea:0},Wv=
t(k.jb()),Hn=Wv.next();!Hn.done;Hn=Wv.next()){var In=Hn.value,Jn=In.data;bj==null&&In.pts!==null&&(bj=In.pts);for(var kf=0;kf<Jn.length;)Ni(Jn,kf,Ad)?(b.audioSamplingRate=Ad.sampleRate,b.channelsCount=Ad.channelCount,aj=Ad.sampleRate,Gn=Ad.Ob,Vv.push({data:Jn.subarray(kf,kf+Ad.ea),size:Ad.ea,duration:1536,ab:0,flags:JE}),kf+=Ad.ea):kf++}if(aj==0||Gn.byteLength==0||bj==null)throw new L(2,3,3018,c?c.S()[0]:null);n={id:b.id,type:"audio",codecs:"ac-3",timescale:aj,duration:d,cb:Gn,data:{sequenceNumber:this.frameIndex,
za:bj/9E4*aj,Sa:Vv},stream:b};break;case "ec3":for(var Xv=[],cj=0,Kn=new Uint8Array([]),dj=null,Bd={sampleRate:0,channelCount:0,Ob:new Uint8Array(0),ea:0},Yv=t(k.jb()),Ln=Yv.next();!Ln.done;Ln=Yv.next()){var Mn=Ln.value,Nn=Mn.data;dj==null&&Mn.pts!==null&&(dj=Mn.pts);for(var lf=0;lf<Nn.length;)Xi(Nn,lf,Bd)?(b.audioSamplingRate=Bd.sampleRate,b.channelsCount=Bd.channelCount,cj=Bd.sampleRate,Kn=Bd.Ob,Xv.push({data:Nn.subarray(lf,lf+Bd.ea),size:Bd.ea,duration:1536,ab:0,flags:JE}),lf+=Bd.ea):lf++}if(cj==
0||Kn.byteLength==0||dj==null)throw new L(2,3,3018,c?c.S()[0]:null);n={id:b.id,type:"audio",codecs:"ec-3",timescale:cj,duration:d,cb:Kn,data:{sequenceNumber:this.frameIndex,za:dj/9E4*cj,Sa:Xv},stream:b};break;case "mp3":for(var Zv=[],ej,fj=null,$v=[],aw=t(k.jb()),On=aw.next();!On.done;On=aw.next()){var gj=On.value;gj.data&&(fj==null&&gj.pts!==null&&(fj=gj.pts),$v.push(gj.data))}for(var hj=Ub($v),ue=0;ue<hj.length;){var mf=tj(hj,ue);mf?(ej||(ej=mf),ue+mf.ea<=hj.length&&Zv.push({data:hj.subarray(ue,
ue+mf.ea),size:mf.ea,duration:1152,ab:0,flags:JE}),ue+=mf.ea):ue++}if(!ej||fj==null)throw new L(2,3,3018,c?c.S()[0]:null);var bw=ej.sampleRate,CF=fj/9E4*bw;n={id:b.id,type:"audio",codecs:"mp3",timescale:bw,duration:d,cb:new Uint8Array([]),data:{sequenceNumber:this.frameIndex,za:CF,Sa:Zv},stream:b};break;case "opus":var cw=[],ij=null,Pc=k.M;if(!Pc)throw new L(2,3,3018,c?c.S()[0]:null);var qb=[];switch(Pc.ej){case 1:case 2:qb=[0];break;case 0:qb=[255,1,1,0,1];break;case 128:qb=[255,2,0,0,1];break;case 3:qb=
[1,2,1,0,2,1];break;case 4:qb=[1,2,2,0,1,2,3];break;case 5:qb=[1,3,2,0,4,1,2,3];break;case 6:qb=[1,4,2,0,4,1,2,3,5];break;case 7:qb=[1,4,2,0,4,1,2,3,5,6];break;case 8:qb=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:qb=[1,1,2,0,1];break;case 131:qb=[1,1,3,0,1,2];break;case 132:qb=[1,1,4,0,1,2,3];break;case 133:qb=[1,1,5,0,1,2,3,4];break;case 134:qb=[1,1,6,0,1,2,3,4,5];break;case 135:qb=[1,1,7,0,1,2,3,4,5,6];break;case 136:qb=[1,1,8,0,1,2,3,4,5,6,7]}var dw=new Uint8Array([0,Pc.channelCount,0,0,Pc.sampleRate>>>
24&255,Pc.sampleRate>>>17&255,Pc.sampleRate>>>8&255,Pc.sampleRate>>>0&255,0,0].concat(wa(qb)));for(var ew=Pc.sampleRate,fw=t(k.jb()),Pn=fw.next();!Pn.done;Pn=fw.next()){var Qn=Pn.value,nf=Qn.data;ij==null&&Qn.pts!==null&&(ij=Qn.pts);for(var Ng=0;Ng<nf.length;){for(var DF=(nf[Ng+1]&16)!==0,EF=(nf[Ng+1]&8)!==0,dd=Ng+2,jj=0;nf[dd]===255;)jj+=255,dd+=1;jj+=nf[dd];dd+=1;dd+=DF?2:0;dd+=EF?2:0;var Rn=nf.slice(dd,dd+jj);cw.push({data:Rn,size:Rn.byteLength,duration:Aj(Rn),ab:0,flags:JE});Ng=dd+jj}}if(dw.byteLength==
0||ij==null)throw new L(2,3,3018,c?c.S()[0]:null);b.audioSamplingRate=Pc.sampleRate;b.channelsCount=Pc.channelCount;n={id:b.id,type:"audio",codecs:"opus",timescale:ew,duration:d,cb:dw,data:{sequenceNumber:this.frameIndex,za:ij/9E4*ew,Sa:cw},stream:b}}n&&(l.push(n),n=null)}}catch(Sn){return Sn&&Sn.code==3023?Promise.resolve(new Uint8Array([])):Promise.reject(Sn)}return l.length?Promise.resolve(IE(this,new Wp(l),b,c)):Promise.reject(new L(2,3,3018,c?c.S()[0]:null))};
K("shaka.transmuxer.TsTransmuxer",RE);RE.prototype.transmux=RE.prototype.transmux;RE.prototype.convertCodecs=RE.prototype.convertCodecs;RE.prototype.isSupported=RE.prototype.isSupported;RE.prototype.destroy=RE.prototype.destroy;var TE=["aac","ac-3","ec-3","mp3","opus"],UE=["av01","avc","hevc"];le("video/mp2t",function(){return new RE("video/mp2t")},3);le("audio/mp2t",function(){return new RE("audio/mp2t")},3);function VE(a){this.h=new Uint8Array(a);Bb(this.h);this.i=0}VE.prototype.Ia=function(){return this.i};VE.prototype.Na=function(){return this.i};VE.prototype.seek=function(a){if(a>this.h.length)throw new L(2,3,3025);this.i=a};VE.prototype.skip=function(a){var b=this.i+a;b<=this.h.length||(b=new Uint8Array(Math.max(this.h.length*2,b)),b.set(this.h),this.h=b,Bb(this.h));this.i+=a};K("shaka.util.DataViewWriter",VE);VE.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:1};function WE(){this.o=[];this.i=[];this.h=[];this.l=[];this.j=[];this.u=!1;this.m=new Set;this.B=(new Map).set("audio",this.i).set("video",this.h).set(zc,this.l).set("image",this.j)}r=WE.prototype;r.release=function(){for(var a=t(this.i.concat(this.h,this.l,this.j)),b=a.next();!b.done;b=a.next())b=b.value,b.segmentIndex&&b.segmentIndex.release();this.i=[];this.h=[];this.l=[];this.j=[];this.o=[];this.u=!1;this.m.clear();this.B.clear()};r.fk=function(){return this.o};r.$j=function(){return this.l.slice()};
r.Kj=function(){return this.j};r.oj=function(a,b){if(a){var c=this.B.get(a.type)||[];c=t(c);for(var d=c.next();!d.done;d=c.next()){d=d.value;XE(d,a);d=YE(d);d=t(d);for(var e=d.next();!e.done;e=d.next())XE(e.value,a)}a.segmentIndex&&a.closeSegmentIndex();this.m.delete(b)}};function XE(a,b){var c;a.matchedStreams=(c=a.matchedStreams)==null?void 0:c.filter(function(d){return d!==b})}function ZE(a,b){return new Map(a.map(function(c){return[b(c),c]}))}
function $E(a,b){var c=[],d=[],e=[],f=[];a=t(a);for(var g=a.next();!g.done;g=a.next()){var h=g.value;g=ZE(h.audioStreams,aF);var k=ZE(h.videoStreams,bF),l=ZE(h.textStreams,cF);h=ZE(h.imageStreams,dF);if(b){var m=eF(zc);l.set(cF(m),m);m=eF("image");h.set(dF(m),m)}c.push(g);d.push(k);e.push(l);f.push(h)}return{xf:c,hh:d,bh:e,ig:f}}
r.kj=function(a,b,c){c=c===void 0?!1:c;var d=this,e,f,g,h,k,l,m,n,p,u,q,v,w,y,x,z,D,B,A,E,C,F,G,J,Q,O,V,M,N,P,U,ea;return H(function(ha){switch(ha.i){case 1:e=Bc;if(!b&&a.length==1){f=$E(a,!1);g=f.xf;h=f.hh;k=f.bh;l=f.ig;d.i=Array.from(g[0].values());d.h=Array.from(h[0].values());d.l=Array.from(k[0].values());d.j=Array.from(l[0].values());ha.A(2);break}m=c?d.m.size:0;n=-1;for(p=0;p<a.length;p++)u=a[p],d.m.has(u.id)||(d.m.add(u.id),n==-1&&(n=p));if(n!=-1){ha.A(3);break}return ha.h(fF(d,a),4);case 4:return ha.return();
case 3:return q=$E(a,!0),v=q.xf,w=q.hh,y=q.bh,x=q.ig,ha.h(Promise.all([gF(d,d.i,v,n,m),gF(d,d.h,w,n,m),gF(d,d.l,y,n,m),gF(d,d.j,x,n,m)]),2);case 2:z=0;D=[];if(d.h.length&&d.i.length)for(J=t(d.i),Q=J.next();!Q.done;Q=J.next())for(O=Q.value,V=t(d.h),M=V.next();!M.done;M=V.next())N=M.value,P=Yb(O.drmInfos,N.drmInfos),O.drmInfos.length&&N.drmInfos.length&&!P.length||(U=(O.bandwidth||0)+(N.bandwidth||0),O.dependencyStream&&(U+=O.dependencyStream.bandwidth||0),N.dependencyStream&&(U+=N.dependencyStream.bandwidth||
0),ea=z++,D.push({id:ea,language:O.language,disabledUntilTime:0,primary:O.primary,audio:O,video:N,bandwidth:U,drmInfos:P,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]}));else for(B=d.h.length?d.h:d.i,A=t(B),E=A.next();!E.done;E=A.next())C=E.value,F=z++,G=C.bandwidth||0,C.dependencyStream&&(G+=C.dependencyStream.bandwidth||0),D.push({id:F,language:C.language,disabledUntilTime:0,primary:C.primary,audio:C.type==e.$?C:null,video:C.type==e.qa?C:null,bandwidth:G,drmInfos:C.drmInfos,allowedByApplication:!0,
allowedByKeySystem:!0,decodingInfos:[]});d.o=D;ha.l()}})};
function fF(a,b){var c,d,e,f,g,h,k,l,m,n,p,u,q,v,w,y,x,z;return H(function(D){switch(D.i){case 1:c=$E(b,!1),d=[{We:a.i,jf:c.xf},{We:a.h,jf:c.hh},{We:a.l,jf:c.bh},{We:a.j,jf:c.ig}],e=t(d),f=e.next();case 2:if(f.done){D.A(0);break}h=g=f.value;k=h.We;l=h.jf;m=t(k);n=m.next();case 5:if(n.done){f=e.next();D.A(2);break}p=n.value;u=p.matchedStreams;if(!u){D.A(6);break}q=t(l);v=q.next();case 8:if(v.done){D.A(6);break}w=v.value;y=hF(a,w,p);if(!y||u.includes(y)){D.A(9);break}x=u.length;u.push(y);D.o(11);if(!p.segmentIndex){D.A(13);
break}return D.h(iF(p,x),13);case 13:D.u(12);break;case 11:throw z=D.m(),u.pop(),z;case 12:jF(p,y);case 9:v=q.next();D.A(8);break;case 6:n=m.next(),D.A(5)}})}
function gF(a,b,c,d,e){var f=kF,g=jF,h,k,l,m,n,p,u,q,v,w,y,x,z,D,B,A,E,C,F,G;return H(function(J){switch(J.i){case 1:h=[];for(k=0;k<c.length;k++)k>=d?h.push(new Set(c[k].values())):h.push(new Set);l=t(b);m=l.next();case 2:if(m.done){J.A(4);break}n=m.value;return J.h(lF(a,n,c,d,g,h,e),5);case 5:p=J.j;if(!p)throw new L(2,4,4037);m=l.next();J.A(2);break;case 4:u=t(h);for(q=u.next();!q.done;q=u.next())for(v=q.value,w=t(v),y=w.next();!y.done;y=w.next())x=y.value,(z=mF(a,b,x,c,f,g,h))&&b.push(z);D=t(h);
for(B=D.next();!B.done;B=D.next())for(A=B.value,E=t(A),C=E.next(),F={};!C.done;F={Vg:void 0},C=E.next())if(F.Vg=C.value,!nF(F.Vg)&&(G=b.some(function(Q){return function(O){return oF(Q.Vg,O)}}(F))))throw new L(2,4,4037);return J.return(b)}})}function lF(a,b,c,d,e,f,g){return H(function(h){if(h.i==1)return pF(a,c,b,g>0),b.matchedStreams?b.segmentIndex?h.h(iF(b,d+g),2):h.A(2):h.return(!1);qF(b,d,e,f,g);return h.return(!0)})}
function iF(a,b){var c,d,e,f,g,h,k,l,m,n;return H(function(p){if(p.i==1){c=[];d=a.matchedStreams;for(e=b;e<d.length;e++)for(f=d[e],c.push(f.createSegmentIndex()),g=YE(f),h=t(g),k=h.next();!k.done;k=h.next())l=k.value,l.segmentIndex||c.push(l.createSegmentIndex());return p.h(Promise.all(c),2)}if(a.segmentIndex instanceof Hm)for(m=b;m<d.length;m++)n=d[m],n.segmentIndex&&a.segmentIndex.j.push(n.segmentIndex);p.l()})}
function mF(a,b,c,d,e,f,g){if(nF(c))return null;var h=e(c);pF(a,d,h);h.createSegmentIndex&&(h.createSegmentIndex=function(){return H(function(k){if(h.segmentIndex)return k.A(0);h.segmentIndex=new Hm;return k.h(iF(h,0),0)})},h.closeSegmentIndex=function(){h.segmentIndex&&(h.segmentIndex.release(),h.segmentIndex=null);if(h.matchedStreams)for(var k=t(h.matchedStreams),l=k.next();!l.done;l=k.next()){l=l.value;var m;if(m=l.segmentIndex){a:{m=t(b);for(var n=m.next();!n.done;n=m.next())if(n=n.value,n!==
h&&n.segmentIndex&&n.matchedStreams&&n.matchedStreams.includes(l)){m=!0;break a}m=!1}m=!m}m&&(l.segmentIndex.release(),l.segmentIndex=null)}});if(!h.matchedStreams||!h.matchedStreams.length)return null;qF(h,0,f,g,0);return h}
function qF(a,b,c,d,e){var f=a.matchedStreams;for(b+=e;b<f.length;b++){var g=f[b];c(a,g);var h=!0;a.type=="audio"&&qc(a.language,g.language)==0&&(h=!1);if(h&&((h=d[b-e])&&h.delete(g),g.fullMimeTypes))for(g=t(g.fullMimeTypes.values()),h=g.next();!h.done;h=g.next())a.fullMimeTypes.add(h.value)}}
function kF(a){var b=Object.assign({},a);b.originalId=null;b.createSegmentIndex=function(){return Promise.resolve()};b.closeSegmentIndex=function(){};b.roles=b.roles.slice();b.segmentIndex=null;b.emsgSchemeIdUris=[];b.keyIds=new Set(a.keyIds);b.closedCaptions=a.closedCaptions?new Map(a.closedCaptions):null;b.trickModeVideo=null;b.dependencyStream=null;return b}function rF(a,b){a||(a=[]);b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,a.includes(c)||a.push(c);return a}
function jF(a,b){a.roles=rF(a.roles,b.roles);b.emsgSchemeIdUris&&(a.emsgSchemeIdUris=rF(a.emsgSchemeIdUris,b.emsgSchemeIdUris));for(var c=t(b.keyIds),d=c.next();!d.done;d=c.next())a.keyIds.add(d.value);a.originalId==null?a.originalId=b.originalId:(c=b.originalId||"")&&!a.originalId.endsWith(c)&&(a.originalId+=","+c);c=Yb(a.drmInfos,b.drmInfos);if(b.drmInfos.length&&a.drmInfos.length&&!c.length)throw new L(2,4,4038);a.drmInfos=c;a.encrypted=a.encrypted||b.encrypted;if(b.closedCaptions)for(a.closedCaptions||
(a.closedCaptions=new Map),c=t(b.closedCaptions),d=c.next();!d.done;d=c.next()){var e=t(d.value);d=e.next().value;e=e.next().value;a.closedCaptions.set(d,e)}a.bandwidth&&b.bandwidth&&(a.bandwidth=Math.max(a.bandwidth,b.bandwidth));c=t(sF);for(d=c.next();!d.done;d=c.next())tF(a,b,d.value)}
function tF(a,b,c){var d=b[c]||null,e=a[c]||null;d?(e||(e=kF(d),e.matchedStreams=[],e.createSegmentIndex=function(){var f,g,h,k;return H(function(l){switch(l.i){case 1:if(e.segmentIndex)return l.return();f=new Hm;g=t(e.matchedStreams);h=g.next();case 2:if(h.done){l.A(4);break}k=h.value;if(k.segmentIndex){l.A(5);break}return l.h(k.createSegmentIndex(),5);case 5:f.j.push(k.segmentIndex);h=g.next();l.A(2);break;case 4:e.segmentIndex=f,l.l()}})},a[c]=e),e.matchedStreams.push(d),jF(e,d)):e&&(e.matchedStreams.push(b),
jF(e,b))}function pF(a,b,c,d){d=(d===void 0?0:d)?c.matchedStreams:[];b=t(b);for(var e=b.next();!e.done;e=b.next()){e=hF(a,e.value,c);if(!e)return;d.push(e)}c.matchedStreams=d}
function hF(a,b,c){var d={audio:aF,video:bF,text:cF,image:dF}[c.type],e=null,f=d(c);if(b.has(f))e=b.get(f);else{f={audio:function(l,m){return oF(l,m)},video:function(l,m){return oF(l,m)},text:uF,image:vF}[c.type];for(var g={audio:wF,video:xF,text:yF,image:FF}[c.type],h=t(b.values()),k=h.next();!k.done;k=h.next())k=k.value,!f(c,k)||c.fastSwitching!=k.fastSwitching||e&&!g(c,e,k)||(e=k)}a.u&&!nF(e)&&b.delete(d(e));return e}
function GF(a,b){return a.mimeType!=b.mimeType?!1:HF(a.codecs)===HF(b.codecs)}r.kl=function(a){this.u=a};function oF(a,b){return a.drmInfos&&!Wb(a.drmInfos,b.drmInfos)?!1:!0}function uF(a,b){return b.language?a.forced!==b.forced||qc(a.language,b.language)==0?!1:!0:!0}function vF(){return!0}
function wF(a,b,c){var d=IF(a,b,c);if(d===JF)return!0;if(d===KF)return!1;d=qc(a.language,b.language);var e=qc(a.language,c.language);if(e>d)return!0;if(e<d)return!1;if(b.label!==c.label){if(a.label===b.label)return!1;if(a.label===c.label)return!0}if(a.roles.length){d=b.roles.filter(function(f){return a.roles.includes(f)});e=c.roles.filter(function(f){return a.roles.includes(f)});if(e.length>d.length)return!0;if(e.length<d.length)return!1;if(c.roles.length!==b.roles.length)return c.roles.length<b.roles.length}else{if(!c.roles.length&&
b.roles.length)return!0;if(c.roles.length&&!b.roles.length)return!1}if(!b.primary&&c.primary)return!0;if(b.primary&&!c.primary)return!1;d=LF(a.channelsCount,b.channelsCount,c.channelsCount);if(d==JF)return!0;if(d==KF)return!1;d=LF(a.audioSamplingRate,b.audioSamplingRate,c.audioSamplingRate);return d==JF?!0:d==KF?!1:a.bandwidth&&MF(a.bandwidth,b.bandwidth,c.bandwidth)==JF?!0:!1}
function xF(a,b,c){var d=IF(a,b,c);if(d===JF)return!0;if(d===KF)return!1;d=LF(a.width*a.height,b.width*b.height,c.width*c.height);if(d==JF)return!0;if(d==KF)return!1;if(a.frameRate){d=LF(a.frameRate,b.frameRate,c.frameRate);if(d==JF)return!0;if(d==KF)return!1}return a.bandwidth&&MF(a.bandwidth,b.bandwidth,c.bandwidth)==JF?!0:!1}
function yF(a,b,c){var d=qc(a.language,b.language),e=qc(a.language,c.language);if(e>d)return!0;if(e<d)return!1;d=b.kind==a.kind;if((e=c.kind==a.kind)&&!d)return!0;if(!e&&d)return!1;if(!b.primary&&c.primary)return!0;if(b.primary&&!c.primary)return!1;if(b.label!==c.label){if(a.label===b.label)return!1;if(a.label===c.label)return!0}if(a.roles.length){d=b.roles.filter(function(f){return a.roles.includes(f)});e=c.roles.filter(function(f){return a.roles.includes(f)});if(e.length>d.length)return!0;if(e.length<
d.length)return!1}else{if(!c.roles.length&&b.roles.length)return!0;if(c.roles.length&&!b.roles.length)return!1}return c.mimeType!=a.mimeType||c.codecs!=a.codecs||b.mimeType==a.mimeType&&b.codecs==a.codecs?!1:!0}function FF(a,b,c){return LF(a.width*a.height,b.width*b.height,c.width*c.height)==JF?!0:!1}function eF(a){return Uf({originalId:"",segmentIndex:new Em([]),type:a})}
function LF(a,b,c){if(b==a&&a!=c)return KF;if(c==a&&a!=b)return JF;if(b>a){if(c<=a||c-a<b-a)return JF;if(c-a>b-a)return KF}else{if(c>a)return KF;if(a-c<a-b)return JF;if(a-c>a-b)return KF}return NF}function IF(a,b,c){var d=a.mimeType===b.mimeType&&a.codecs===b.codecs,e=a.mimeType===c.mimeType&&a.codecs===c.codecs;if(d&&!e)return KF;if(!d&&e)return JF;b=GF(a,b);a=GF(a,c);return b&&!a?KF:!b&&a?JF:NF}function MF(a,b,c){b=Math.abs(a-b);a=Math.abs(a-c);return a<b?JF:b<a?KF:NF}
function nF(a){switch(a.type){case zc:return!a.language;case "image":return!a.tilesLayout;default:return!1}}function bF(a){var b,c;return OF([a.fastSwitching,a.width,a.frameRate,a.codecs,a.mimeType,a.label,a.roles,a.closedCaptions?Array.from(a.closedCaptions.entries()):null,a.bandwidth,(c=(b=a.dependencyStream)==null?void 0:b.baseOriginalId)!=null?c:a.baseOriginalId,Array.from(a.keyIds)])}
function aF(a){var b,c;return OF([a.fastSwitching,a.channelsCount,a.language,a.bandwidth,a.label,a.codecs,a.mimeType,a.roles,a.audioSamplingRate,a.primary,(c=(b=a.dependencyStream)==null?void 0:b.baseOriginalId)!=null?c:a.baseOriginalId,Array.from(a.keyIds)])}function cF(a){return OF([a.language,a.label,a.codecs,a.mimeType,a.bandwidth,a.roles])}function dF(a){return OF([a.width,a.codecs,a.mimeType])}function OF(a){return JSON.stringify(a)}
function HF(a){return PF.getOrInsertComputed(a,function(){return Ae(a)})}function YE(a){for(var b=[],c=t(sF),d=c.next();!d.done;d=c.next())(d=a[d.value])&&b.push(d);return b}K("shaka.util.PeriodCombiner",WE);WE.prototype.setUseStreamOnce=WE.prototype.kl;WE.prototype.combinePeriods=WE.prototype.kj;WE.prototype.deleteStream=WE.prototype.oj;WE.prototype.getImageStreams=WE.prototype.Kj;WE.prototype.getTextStreams=WE.prototype.$j;WE.prototype.getVariants=WE.prototype.fk;
var sF=["trickModeVideo","dependencyStream"],JF=1,NF=0,KF=-1,PF=new Map;[].concat(Nx,Lx,Mx,Kx).filter(function(a,b,c){return c.indexOf(a)===b});}).call(exportTo,innerGlobal,innerGlobal,undefined);if(typeof exports!="undefined")for(var k in exportTo.shaka)exports[k]=exportTo.shaka[k];else if(typeof define=="function"&&define.amd)define(function(){return exportTo.shaka});else innerGlobal.shaka=exportTo.shaka})();

//# sourceMappingURL=shaka-player.hls.map