UNPKG

shaka-player

Version:
128 lines (127 loc) 399 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){/* Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */ var r;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}var ba="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a}; function da(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 ea=da(this);function fa(a,b){if(b)a:{for(var c=ea,d=a.split("."),e=0;e<d.length-1;e++){var f=d[e];if(!(f in c))break a;c=c[f]}d=d[d.length-1];e=c[d];f=b(e);f!=e&&null!=f&&ba(c,d,{configurable:!0,writable:!0,value:f})}} fa("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.g=f;ba(this,"description",{configurable:!0,writable:!0,value:g})}if(a)return a;c.prototype.toString=function(){return this.g};var d="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",e=0;return b}); fa("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c<b.length;c++){var d=ea[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&ba(d.prototype,a,{configurable:!0,writable:!0,value:function(){return ha(aa(this))}})}return a});function ha(a){a={next:a};a[Symbol.iterator]=function(){return this};return a} function t(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}}function ia(a){if(!(a instanceof Array)){a=t(a);for(var b,c=[];!(b=a.next()).done;)c.push(b.value);a=c}return a}var ka="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},la; if("function"==typeof Object.setPrototypeOf)la=Object.setPrototypeOf;else{var ma;a:{var na={a:!0},oa={};try{oa.__proto__=na;ma=oa.a;break a}catch(a){}ma=!1}la=ma?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var pa=la; function qa(a,b){a.prototype=ka(b.prototype);a.prototype.constructor=a;if(pa)pa(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.Tg=b.prototype}function ra(){this.o=!1;this.l=null;this.h=void 0;this.g=1;this.j=this.m=0;this.u=this.i=null}function sa(a){if(a.o)throw new TypeError("Generator is already running");a.o=!0}ra.prototype.s=function(a){this.h=a}; function ta(a,b){a.i={je:b,qe:!0};a.g=a.m||a.j}ra.prototype["return"]=function(a){this.i={"return":a};this.g=this.j};function u(a,b,c){a.g=c;return{value:b}}ra.prototype.A=function(a){this.g=a};function z(a){a.g=0}function B(a,b,c){a.m=b;void 0!=c&&(a.j=c)}function ua(a){a.m=0;a.j=2}function va(a,b){a.g=b;a.m=0}function E(a){a.m=0;var b=a.i.je;a.i=null;return b}function wa(a){a.u=[a.i];a.m=0;a.j=0} function xa(a,b){var c=a.u.splice(0)[0];(c=a.i=a.i||c)?c.qe?a.g=a.m||a.j:void 0!=c.A&&a.j<c.A?(a.g=c.A,a.i=null):a.g=a.j:a.g=b}function ya(a){this.g=new ra;this.h=a}function Aa(a,b){sa(a.g);var c=a.g.l;if(c)return Ba(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.g["return"]);a.g["return"](b);return Ca(a)} function Ba(a,b,c,d){try{var e=b.call(a.g.l,c);if(!(e instanceof Object))throw new TypeError("Iterator result "+e+" is not an object");if(!e.done)return a.g.o=!1,e;var f=e.value}catch(g){return a.g.l=null,ta(a.g,g),Ca(a)}a.g.l=null;d.call(a.g,f);return Ca(a)} function Ca(a){for(;a.g.g;)try{var b=a.h(a.g);if(b)return a.g.o=!1,{value:b.value,done:!1}}catch(c){a.g.h=void 0,ta(a.g,c)}a.g.o=!1;if(a.g.i){b=a.g.i;a.g.i=null;if(b.qe)throw b.je;return{value:b["return"],done:!0}}return{value:void 0,done:!0}} function Ea(a){this.next=function(b){sa(a.g);a.g.l?b=Ba(a,a.g.l.next,b,a.g.s):(a.g.s(b),b=Ca(a));return b};this["throw"]=function(b){sa(a.g);a.g.l?b=Ba(a,a.g.l["throw"],b,a.g.s):(ta(a.g,b),b=Ca(a));return b};this["return"]=function(b){return Aa(a,b)};this[Symbol.iterator]=function(){return this}} function Fa(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 K(a){return Fa(new Ea(new ya(a)))}function Ga(){for(var a=Number(this),b=[],c=a;c<arguments.length;c++)b[c-a]=arguments[c];return b} fa("Promise",function(a){function b(g){this.h=0;this.i=void 0;this.g=[];this.o=!1;var h=this.j();try{g(h.resolve,h.reject)}catch(k){h.reject(k)}}function c(){this.g=null}function d(g){return g instanceof b?g:new b(function(h){h(g)})}if(a)return a;c.prototype.h=function(g){if(null==this.g){this.g=[];var h=this;this.i(function(){h.l()})}this.g.push(g)};var e=ea.setTimeout;c.prototype.i=function(g){e(g,0)};c.prototype.l=function(){for(;this.g&&this.g.length;){var g=this.g;this.g=[];for(var h=0;h<g.length;++h){var k= g[h];g[h]=null;try{k()}catch(l){this.j(l)}}}this.g=null};c.prototype.j=function(g){this.i(function(){throw g;})};b.prototype.j=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.l)}};b.prototype.G=function(g){if(g===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof b)this.J(g);else{a:switch(typeof g){case "object":var h=null!=g;break a;case "function":h=!0;break a;default:h=!1}h?this.D(g):this.m(g)}}; b.prototype.D=function(g){var h=void 0;try{h=g.then}catch(k){this.l(k);return}"function"==typeof h?this.K(h,g):this.m(g)};b.prototype.l=function(g){this.s(2,g)};b.prototype.m=function(g){this.s(1,g)};b.prototype.s=function(g,h){if(0!=this.h)throw Error("Cannot settle("+g+", "+h+"): Promise already settled in state"+this.h);this.h=g;this.i=h;2===this.h&&this.H();this.u()};b.prototype.H=function(){var g=this;e(function(){if(g.C()){var h=ea.console;"undefined"!==typeof h&&h.error(g.i)}},1)};b.prototype.C= function(){if(this.o)return!1;var g=ea.CustomEvent,h=ea.Event,k=ea.dispatchEvent;if("undefined"===typeof k)return!0;"function"===typeof g?g=new g("unhandledrejection",{cancelable:!0}):"function"===typeof h?g=new h("unhandledrejection",{cancelable:!0}):(g=ea.document.createEvent("CustomEvent"),g.initCustomEvent("unhandledrejection",!1,!0,g));g.promise=this;g.reason=this.i;return k(g)};b.prototype.u=function(){if(null!=this.g){for(var g=0;g<this.g.length;++g)f.h(this.g[g]);this.g=null}};var f=new c; b.prototype.J=function(g){var h=this.j();g.Bc(h.resolve,h.reject)};b.prototype.K=function(g,h){var k=this.j();try{g.call(h,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(g,h){function k(n,q){return"function"==typeof n?function(v){try{l(n(v))}catch(x){m(x)}}:q}var l,m,p=new b(function(n,q){l=n;m=q});this.Bc(k(g,l),k(h,m));return p};b.prototype["catch"]=function(g){return this.then(void 0,g)};b.prototype.Bc=function(g,h){function k(){switch(l.h){case 1:g(l.i);break;case 2:h(l.i); break;default:throw Error("Unexpected state: "+l.h);}}var l=this;null==this.g?f.h(k):this.g.push(k);this.o=!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).Bc(h,k)})};b.all=function(g){var h=t(g),k=h.next();return k.done?d([]):new b(function(l,m){function p(v){return function(x){n[v]=x;q--;0==q&&l(n)}}var n=[],q=0;do n.push(void 0),q++,d(k.value).Bc(p(n.length-1),m),k=h.next(); while(!k.done)})};return b});function Ja(a,b){return Object.prototype.hasOwnProperty.call(a,b)} fa("WeakMap",function(a){function b(k){this.g=(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"object"===l&&null!==k||"function"===l}function e(k){if(!Ja(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(2!=m.get(k)||3!=m.get(l))return!1;m["delete"](k);m.set(l,4);return!m.has(k)&&4==m.get(l)}catch(p){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(!Ja(k,g))throw Error("WeakMap key fail: "+k);k[g][this.g]=l;return this};b.prototype.get=function(k){return d(k)&&Ja(k,g)?k[g][this.g]:void 0};b.prototype.has=function(k){return d(k)&& Ja(k,g)&&Ja(k[g],this.g)};b.prototype["delete"]=function(k){return d(k)&&Ja(k,g)&&Ja(k[g],this.g)?delete k[g][this.g]:!1};return b}); fa("Map",function(a){function b(){var h={};return h.Sa=h.next=h.head=h}function c(h,k){var l=h.g;return ha(function(){if(l){for(;l.head!=h.g;)l=l.Sa;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;"object"==l||"function"==l?f.has(k)?l=f.get(k):(l=""+ ++g,f.set(k,l)):l="p_"+k;var m=h.h[l];if(m&&Ja(h.h,l))for(var p=0;p<m.length;p++){var n=m[p];if(k!==k&&n.key!==n.key||k===n.key)return{id:l,list:m,index:p,ga:n}}return{id:l, list:m,index:-1,ga:void 0}}function e(h){this.h={};this.g=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||"function"!=typeof a||!a.prototype.entries||"function"!=typeof Object.seal)return!1;try{var h=Object.seal({x:4}),k=new a(t([[h,"s"]]));if("s"!=k.get(h)||1!=k.size||k.get({x:4})||k.set({x:4},"t")!=k||2!=k.size)return!1;var l=k.entries(),m=l.next();if(m.done||m.value[0]!=h||"s"!=m.value[1])return!1;m=l.next();return m.done||4!=m.value[0].x|| "t"!=m.value[1]||!l.next().done?!1:!0}catch(p){return!1}}())return a;var f=new WeakMap;e.prototype.set=function(h,k){h=0===h?0:h;var l=d(this,h);l.list||(l.list=this.h[l.id]=[]);l.ga?l.ga.value=k:(l.ga={next:this.g,Sa:this.g.Sa,head:this.g,key:h,value:k},l.list.push(l.ga),this.g.Sa.next=l.ga,this.g.Sa=l.ga,this.size++);return this};e.prototype["delete"]=function(h){h=d(this,h);return h.ga&&h.list?(h.list.splice(h.index,1),h.list.length||delete this.h[h.id],h.ga.Sa.next=h.ga.next,h.ga.next.Sa=h.ga.Sa, h.ga.head=null,this.size--,!0):!1};e.prototype.clear=function(){this.h={};this.g=this.g.Sa=b();this.size=0};e.prototype.has=function(h){return!!d(this,h).ga};e.prototype.get=function(h){return(h=d(this,h).ga)&&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}); fa("Set",function(a){function b(c){this.g=new Map;if(c){c=t(c);for(var d;!(d=c.next()).done;)this.add(d.value)}this.size=this.g.size}if(function(){if(!a||"function"!=typeof a||!a.prototype.entries||"function"!=typeof Object.seal)return!1;try{var c=Object.seal({x:4}),d=new a(t([c]));if(!d.has(c)||1!=d.size||d.add(c)!=d||1!=d.size||d.add({x:4})!=d||2!=d.size)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||4!=f.value[0].x|| f.value[1]!=f.value[0]?!1:e.next().done}catch(g){return!1}}())return a;b.prototype.add=function(c){c=0===c?0:c;this.g.set(c,c);this.size=this.g.size;return this};b.prototype["delete"]=function(c){c=this.g["delete"](c);this.size=this.g.size;return c};b.prototype.clear=function(){this.g.clear();this.size=0};b.prototype.has=function(c){return this.g.has(c)};b.prototype.entries=function(){return this.g.entries()};b.prototype.values=function(){return this.g.values()};b.prototype.keys=b.prototype.values; b.prototype[Symbol.iterator]=b.prototype.values;b.prototype.forEach=function(c,d){var e=this;this.g.forEach(function(f){return c.call(d,f,f,e)})};return b});function Ka(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{oe:e,v:f}}return{oe:-1,v:void 0}}fa("Array.prototype.findIndex",function(a){return a?a:function(b,c){return Ka(this,b,c).oe}});fa("Object.is",function(a){return a?a:function(b,c){return b===c?0!==b||1/b===1/c:b!==b&&c!==c}}); fa("Array.prototype.includes",function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length,f=c||0;for(0>f&&(f=Math.max(f+e,0));f<e;f++){var g=d[f];if(g===b||Object.is(g,b))return!0}return!1}});function La(a,b,c){if(null==a)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+""} fa("String.prototype.includes",function(a){return a?a:function(b,c){return-1!==La(this,b,"includes").indexOf(b,c||0)}});fa("Array.prototype.find",function(a){return a?a:function(b,c){return Ka(this,b,c).v}});fa("String.prototype.startsWith",function(a){return a?a:function(b,c){for(var d=La(this,b,"startsWith"),e=d.length,f=b.length,g=Math.max(0,Math.min(c|0,d.length)),h=0;h<f&&g<e;)if(d[g++]!=b[h++])return!1;return h>=f}}); function Ma(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}fa("Array.prototype.keys",function(a){return a?a:function(){return Ma(this,function(b){return b})}});var Na="function"==typeof Object.assign?Object.assign:function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var e in d)Ja(d,e)&&(a[e]=d[e])}return a}; fa("Object.assign",function(a){return a||Na});fa("Array.from",function(a){return a?a:function(b,c,d){c=null!=c?c:function(h){return h};var e=[],f="undefined"!=typeof Symbol&&Symbol.iterator&&b[Symbol.iterator];if("function"==typeof f){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}});fa("Array.prototype.values",function(a){return a?a:function(){return Ma(this,function(b,c){return c})}}); fa("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;})})}});fa("Array.prototype.entries",function(a){return a?a:function(){return Ma(this,function(b,c){return[b,c]})}}); fa("String.prototype.repeat",function(a){return a?a:function(b){var c=La(this,null,"repeat");if(0>b||1342177279<b)throw new RangeError("Invalid count value");b|=0;for(var d="";b;)if(b&1&&(d+=c),b>>>=1)c+=c;return d}});fa("Number.isNaN",function(a){return a?a:function(b){return"number"===typeof b&&isNaN(b)}});fa("Object.values",function(a){return a?a:function(b){var c=[],d;for(d in b)Ja(b,d)&&c.push(b[d]);return c}});fa("Math.log2",function(a){return a?a:function(b){return Math.log(b)/Math.LN2}}); fa("Object.entries",function(a){return a?a:function(b){var c=[],d;for(d in b)Ja(b,d)&&c.push([d,b[d]]);return c}});var Oa=this||self;function M(a,b){var c=a.split("."),d=Oa;c[0]in d||"undefined"==typeof d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]&&d[e]!==Object.prototype[e]?d=d[e]:d=d[e]={}:d[e]=b};/* @license Shaka Player Copyright 2016 Google LLC SPDX-License-Identifier: Apache-2.0 */ function Pa(a){this.g=Math.exp(Math.log(.5)/a);this.i=this.h=0}Pa.prototype.sample=function(a,b){var c=Math.pow(this.g,a);c=b*(1-c)+c*this.h;isNaN(c)||(this.h=c,this.i+=a)};function Qa(a){return a.h/(1-Math.pow(a.g,a.i))};function Sa(){this.h=new Pa(2);this.j=new Pa(5);this.g=0;this.i=128E3;this.l=16E3}Sa.prototype.configure=function(a){this.i=a.minTotalBytes;this.l=a.minBytes;this.h.g=Math.exp(Math.log(.5)/a.fastHalfLife);this.j.g=Math.exp(Math.log(.5)/a.slowHalfLife)};Sa.prototype.sample=function(a,b){if(!(b<this.l)){var c=8E3*b/a,d=a/1E3;this.g+=b;this.h.sample(d,c);this.j.sample(d,c)}};Sa.prototype.getBandwidthEstimate=function(a){return this.g<this.i?a:Math.min(Qa(this.h),Qa(this.j))};function Ta(){}function Ua(){}function Va(){}function Wa(a){var b=Ga.apply(1,arguments);Xa.has(a)||(Xa.add(a),Va.apply(Ta,ia(b)))}function Ya(){}function Za(){}function $a(){}function ab(){}var Xa=new Set;if(window.console&&window.console.log.bind){var bb={},cb=(bb[1]=console.error.bind(console),bb[2]=console.warn.bind(console),bb[3]=console.info.bind(console),bb[4]=console.log.bind(console),bb[5]=console.debug.bind(console),bb[6]=console.debug.bind(console),bb);Va=cb[2];Ua=cb[1]};function db(a,b){return"number"===typeof a&&"number"===typeof b&&isNaN(a)&&isNaN(b)?!0:a===b}function eb(a,b){var c=a.indexOf(b);-1<c&&a.splice(c,1)}function fb(a,b,c){c||(c=db);if(a.length!=b.length)return!1;b=b.slice();var d={};a=t(a);for(var e=a.next();!e.done;d={ad:d.ad},e=a.next()){d.ad=e.value;e=b.findIndex(function(f){return function(g){return c(f.ad,g)}}(d));if(-1==e)return!1;b[e]=b[b.length-1];b.pop()}return 0==b.length} function gb(a,b,c){c||(c=db);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(a,b,c){this.startTime=a;this.direction=jb;this.endTime=b;this.payload=c;this.region=new kb;this.position=null;this.positionAlign=lb;this.size=0;this.textAlign=mb;this.writingMode=nb;this.lineInterpretation=ob;this.line=null;this.lineHeight="";this.lineAlign=pb;this.displayAlign=qb;this.fontSize=this.textStrokeWidth=this.textStrokeColor=this.border=this.backgroundImage=this.backgroundColor=this.color="";this.fontWeight=rb;this.fontStyle=sb;this.linePadding=this.letterSpacing=this.fontFamily= "";this.opacity=1;this.textDecoration=[];this.wrapLine=!0;this.id="";this.nestedCues=[];this.lineBreak=this.isContainer=!1;this.cellResolution={columns:32,rows:15}}hb.prototype.clone=function(){var a=new hb(0,0,""),b;for(b in this)a[b]=this[b],a[b]&&a[b].constructor==Array&&(a[b]=a[b].slice());return a}; function tb(a,b){if(a.startTime!=b.startTime||a.endTime!=b.endTime||a.payload!=b.payload)return!1;for(var c in a)if("startTime"!=c&&"endTime"!=c&&"payload"!=c)if("nestedCues"==c){if(!gb(a.nestedCues,b.nestedCues,tb))return!1}else if("region"==c||"cellResolution"==c)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}M("shaka.text.Cue",hb);var lb="auto"; hb.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:lb};var mb="center",ub={LEFT:"left",RIGHT:"right",CENTER:mb,START:"start",END:"end"};hb.textAlign=ub;var qb="after",vb={BEFORE:"before",CENTER:"center",AFTER:qb};hb.displayAlign=vb;var jb="ltr";hb.direction={HORIZONTAL_LEFT_TO_RIGHT:jb,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var nb="horizontal-tb";hb.writingMode={HORIZONTAL_TOP_TO_BOTTOM:nb,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var ob=0; hb.lineInterpretation={LINE_NUMBER:ob,PERCENTAGE:1};var pb="start",wb={CENTER:"center",START:pb,END:"end"};hb.lineAlign=wb;var xb={white:"#FFF",lime:"#0F0",cyan:"#0FF",red:"#F00",yellow:"#FF0",magenta:"#F0F",blue:"#00F",black:"#000"};hb.defaultTextColor=xb;var yb={bg_white:"#FFF",bg_lime:"#0F0",bg_cyan:"#0FF",bg_red:"#F00",bg_yellow:"#FF0",bg_magenta:"#F0F",bg_blue:"#00F",bg_black:"#000"};hb.defaultTextBackgroundColor=yb;var rb=400;hb.fontWeight={NORMAL:rb,BOLD:700}; var sb="normal",zb={NORMAL:sb,ITALIC:"italic",OBLIQUE:"oblique"};hb.fontStyle=zb;hb.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"};function kb(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=Ab;this.scroll=Cb}M("shaka.text.CueRegion",kb);var Ab=1;kb.units={PX:0,PERCENTAGE:Ab,LINES:2};var Cb="";kb.scrollMode={NONE:Cb,UP:"up"};function Db(){}function Eb(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!=b.byteLength)return!1;if(Fb(a)==Fb(b)&&(a.byteOffset||0)==(b.byteOffset||0))return!0;for(var c=Gb(a),d=Gb(b),e=0;e<a.byteLength;e++)if(c[e]!=d[e])return!1;return!0}function Fb(a){return a instanceof ArrayBuffer?a:a.buffer}function Hb(a){return a instanceof ArrayBuffer?a:0==a.byteOffset&&a.byteLength==a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer} function Gb(a,b,c){c=void 0===c?Infinity:c;return Ib(a,void 0===b?0:b,c,Uint8Array)}function Jb(a,b,c){c=void 0===c?Infinity:c;return Ib(a,void 0===b?0:b,c,DataView)}function Ib(a,b,c,d){var e=(a.byteOffset||0)+a.byteLength;b=Math.max(0,Math.min((a.byteOffset||0)+b,e));return new d(Fb(a),b,Math.min(b+Math.max(c,0),e)-b)}M("shaka.util.BufferUtils",Db);Db.toDataView=Jb;Db.toUint8=Gb;Db.toArrayBuffer=Hb;Db.equal=Eb;function Kb(){}M("shaka.dependencies",Kb);Kb.has=function(a){return Lb.has(a)};Kb.add=function(a,b){if(!Mb[a])throw Error(a+" is not supported");Lb.set(a,function(){return b})};var Mb={muxjs:"muxjs"};Kb.Allowed=Mb;var Lb=new Map([["muxjs",function(){return window.muxjs}]]);function N(a,b,c){var d=Ga.apply(3,arguments);this.severity=a;this.category=b;this.code=c;this.data=d;this.handled=!1}N.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")};M("shaka.util.Error",N);N.Severity={RECOVERABLE:1,CRITICAL:2};N.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10}; N.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,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,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,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,HLS_AES_128_ENCRYPTION_NOT_SUPPORTED:4034,HLS_INTERNAL_SKIP_STREAM:4035, NO_VARIANTS:4036,PERIOD_FLATTENING_FAILED:4037,INCONSISTENT_DRM_ACROSS_PERIODS:4038,HLS_VARIABLE_NOT_FOUND:4039,HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED:4040,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,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,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,CS_IMA_SDK_MISSING:1E4,CS_AD_MANAGER_NOT_INITIALIZED:10001,SS_IMA_SDK_MISSING:10002,SS_AD_MANAGER_NOT_INITIALIZED:10003, CURRENT_DAI_REQUEST_NOT_FINISHED:10004};/* @license Copyright 2008 The Closure Library Authors SPDX-License-Identifier: Apache-2.0 */ var Nb=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");/* @license Copyright 2006 The Closure Library Authors SPDX-License-Identifier: Apache-2.0 */ function Ob(a){var b;a instanceof Ob?(Pb(this,a.Fa),this.pb=a.pb,this.Ha=a.Ha,Qb(this,a.Ib),this.va=a.va,Rb(this,a.g.clone()),this.gb=a.gb):a&&(b=String(a).match(Nb))?(Pb(this,b[1]||"",!0),this.pb=Sb(b[2]||""),this.Ha=Sb(b[3]||"",!0),Qb(this,b[4]),this.va=Sb(b[5]||"",!0),Rb(this,b[6]||"",!0),this.gb=Sb(b[7]||"")):this.g=new Tb(null)}r=Ob.prototype;r.Fa="";r.pb="";r.Ha="";r.Ib=null;r.va="";r.gb=""; r.toString=function(){var a=[],b=this.Fa;b&&a.push(Ub(b,Vb,!0),":");if(b=this.Ha){a.push("//");var c=this.pb;c&&a.push(Ub(c,Vb,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.Ib;null!=b&&a.push(":",String(b))}if(b=this.va)this.Ha&&"/"!=b.charAt(0)&&a.push("/"),a.push(Ub(b,"/"==b.charAt(0)?Wb:Xb,!0));(b=this.g.toString())&&a.push("?",b);(b=this.gb)&&a.push("#",Ub(b,Yb));return a.join("")}; r.resolve=function(a){var b=this.clone();"data"===b.Fa&&(b=new Ob);var c=!!a.Fa;c?Pb(b,a.Fa):c=!!a.pb;c?b.pb=a.pb:c=!!a.Ha;c?b.Ha=a.Ha:c=null!=a.Ib;var d=a.va;if(c)Qb(b,a.Ib);else if(c=!!a.va){if("/"!=d.charAt(0))if(this.Ha&&!this.va)d="/"+d;else{var e=b.va.lastIndexOf("/");-1!=e&&(d=b.va.substr(0,e+1)+d)}if(".."==d||"."==d)d="";else if(-1!=d.indexOf("./")||-1!=d.indexOf("/.")){e=0==d.lastIndexOf("/",0);d=d.split("/");for(var f=[],g=0;g<d.length;){var h=d[g++];"."==h?e&&g==d.length&&f.push(""):".."== h?((1<f.length||1==f.length&&""!=f[0])&&f.pop(),e&&g==d.length&&f.push("")):(f.push(h),e=!0)}d=f.join("/")}}c?b.va=d:c=""!==a.g.toString();c?Rb(b,a.g.clone()):c=!!a.gb;c&&(b.gb=a.gb);return b};r.clone=function(){return new Ob(this)};function Pb(a,b,c){a.Fa=c?Sb(b,!0):b;a.Fa&&(a.Fa=a.Fa.replace(/:$/,""))}function Qb(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.Ib=b}else a.Ib=null}function Rb(a,b,c){b instanceof Tb?a.g=b:(c||(b=Ub(b,Zb)),a.g=new Tb(b))} function Sb(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function Ub(a,b,c){return null!=a?(a=encodeURI(a).replace(b,$b),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function $b(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var Vb=/[#\/\?@]/g,Xb=/[#\?:]/g,Wb=/[#\?]/g,Zb=/[#\?@]/g,Yb=/#/g;function Tb(a){this.g=a||null} function ac(a){if(!a.na&&(a.na={},a.Dc=0,a.g))for(var b=a.g.split("&"),c=0;c<b.length;c++){var d=b[c].indexOf("="),e=null;if(0<=d){var f=b[c].substring(0,d);e=b[c].substring(d+1)}else f=b[c];f=decodeURIComponent(f.replace(/\+/g," "));e=e||"";a.add(f,decodeURIComponent(e.replace(/\+/g," ")))}}r=Tb.prototype;r.na=null;r.Dc=null;r.add=function(a,b){ac(this);this.g=null;var c=this.na.hasOwnProperty(a)&&this.na[a];c||(this.na[a]=c=[]);c.push(b);this.Dc++;return this}; r.set=function(a,b){ac(this);this.g=null;this.na.hasOwnProperty(a)?this.na[a]=[b]:this.add(a,b);return this};r.toString=function(){if(this.g)return this.g;if(!this.na)return"";var a=[],b;for(b in this.na)for(var c=encodeURIComponent(b),d=this.na[b],e=0;e<d.length;e++){var f=c;""!==d[e]&&(f+="="+encodeURIComponent(d[e]));a.push(f)}return this.g=a.join("&")};r.clone=function(){var a=new Tb;a.g=this.g;if(this.na){var b={},c;for(c in this.na)b[c]=this.na[c].concat();a.na=b;a.Dc=this.Dc}return a};function bc(a,b){return a.concat(b)}function cc(){}function dc(a){return null!=a};function ec(a,b){if(0==b.length)return a;var c=b.map(function(d){return new Ob(d)});return a.map(function(d){return new Ob(d)}).map(function(d){return c.map(function(e){return d.resolve(e)})}).reduce(bc,[]).map(function(d){return d.toString()})}function hc(a,b){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:b||[],keyIds:new Set}} function ic(a,b){if(1==b.length)return b[0];var c=jc(a,b);if(null!=c)return c;throw new N(2,4,4025,b);}function jc(a,b){for(var c=t(kc[a]),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==lc?"":null}var lc="text",mc={Oa:"video",eb:"audio",X:lc,Ub:"image",hg:"application"},kc={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/],text:[/^vtt$/,/^wvtt/,/^stpp/]};function nc(){var a,b,c=new Promise(function(d,e){a=d;b=e});c.resolve=a;c.reject=b;return c}nc.prototype.resolve=function(){};nc.prototype.reject=function(){};function oc(a){this.h=a;this.g=void 0}oc.prototype.value=function(){void 0==this.g&&(this.g=this.h());return this.g};function pc(){}function qc(a){if(!a)return"";a=Gb(a);239==a[0]&&187==a[1]&&191==a[2]&&(a=a.subarray(3));a=(new TextDecoder).decode(a);a.includes("\ufffd")&&Ua('Decoded string contains an "unknown character" codepoint. That probably means the UTF8 encoding was incorrect!');return a}function rc(a,b,c){if(!a)return"";if(!c&&0!=a.byteLength%2)throw new N(2,2,2004);c=Math.floor(a.byteLength/2);var d=new Uint16Array(c);a=Jb(a);for(var e=0;e<c;e++)d[e]=a.getUint16(2*e,b);return sc.value()(d)} function tc(a){function b(d){return c.byteLength<=d||32<=c[d]&&126>=c[d]}if(!a)return"";var c=Gb(a);if(239==c[0]&&187==c[1]&&191==c[2])return qc(c);if(254==c[0]&&255==c[1])return rc(c.subarray(2),!1);if(255==c[0]&&254==c[1])return rc(c.subarray(2),!0);if(0==c[0]&&0==c[2])return rc(a,!1);if(0==c[1]&&0==c[3])return rc(a,!0);if(b(0)&&b(1)&&b(2)&&b(3))return qc(a);throw new N(2,2,2003);}function uc(a){var b=new TextEncoder;return Hb(b.encode(a))} function vc(a,b){for(var c=new ArrayBuffer(2*a.length),d=new DataView(c),e=0;e<a.length;++e)d.setUint16(2*e,a.charCodeAt(e),b);return c}M("shaka.util.StringUtils",pc);pc.resetFromCharCode=function(){sc.g=void 0};pc.toUTF16=vc;pc.toUTF8=uc;pc.fromBytesAutoDetect=tc;pc.fromUTF16=rc;pc.fromUTF8=qc; var sc=new oc(function(){function a(c){try{var d=new Uint8Array(c);return 0<String.fromCharCode.apply(null,d).length}catch(e){return!1}}for(var b={Wa:65536};0<b.Wa;b={Wa:b.Wa},b.Wa/=2)if(a(b.Wa))return function(c){return function(d){for(var e="",f=0;f<d.length;f+=c.Wa)e+=String.fromCharCode.apply(null,d.subarray(f,f+c.Wa));return e}}(b);return null});function wc(){}function xc(a){a=Gb(a);a=sc.value()(a);return btoa(a)}function yc(a,b){b=void 0==b?!0:b;var c=xc(a).replace(/\+/g,"-").replace(/\//g,"_");return b?c:c.replace(/[=]*$/,"")}function zc(a){a=window.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}function Ac(a){for(var b=a.length/2,c=new Uint8Array(b),d=0;d<b;d++)c[d]=window.parseInt(a.substr(2*d,2),16);return c} function Bc(a){var b=Gb(a);a="";b=t(b);for(var c=b.next();!c.done;c=b.next())c=c.value,c=c.toString(16),1==c.length&&(c="0"+c),a+=c;return a}function Dc(){for(var a=Ga.apply(0,arguments),b=0,c=t(a),d=c.next();!d.done;d=c.next())b+=d.value.byteLength;b=new Uint8Array(b);c=0;a=t(a);for(d=a.next();!d.done;d=a.next())d=d.value,b.set(Gb(d),c),c+=d.byteLength;return b}M("shaka.util.Uint8ArrayUtils",wc);wc.concat=Dc;wc.toHex=Bc;wc.fromHex=Ac;wc.fromBase64=zc;wc.toBase64=yc;wc.toStandardBase64=xc;function Ec(){var a=this;this.o=Lb.get("muxjs")();this.g=new this.o.mp4.Transmuxer({keepOriginalTimestamps:!0});this.h=null;this.m=[];this.j=[];this.i=[];this.l=!1;this.g.on("data",function(b){a.j=b.captions;a.i=b.metadata;a.m.push(Dc(b.initSegment,b.data))});this.g.on("done",function(){var b={data:Dc.apply(wc,ia(a.m)),captions:a.j,metadata:a.i};a.h.resolve(b);a.l=!1})}Ec.prototype.destroy=function(){this.g.dispose();this.g=null;return Promise.resolve()}; function Fc(a,b){if(!Lb.get("muxjs")()||!Gc(a))return!1;if(b)return MediaSource.isTypeSupported(Hc(b,a));var c=Hc("audio",a),d=Hc("video",a);return MediaSource.isTypeSupported(c)||MediaSource.isTypeSupported(d)}function Gc(a){return"mp2t"==a.toLowerCase().split(";")[0].split("/")[1]} function Hc(a,b){var c=b.replace(/mp2t/i,"mp4");"audio"==a&&(c=c.replace("video","audio"));var d=/avc1\.(66|77|100)\.(\d+)/.exec(c);if(d){var e="avc1.",f=d[1],g=Number(d[2]);e=("66"==f?e+"4200":"77"==f?e+"4d00":e+"6400")+(g>>4).toString(16);e+=(g&15).toString(16);c=c.replace(d[0],e)}return c}function Ic(a,b){a.l=!0;a.h=new nc;a.m=[];a.j=[];a.i=[];var c=Gb(b);a.g.push(c);a.g.flush();a.l&&a.h.reject(new N(2,3,3018));return a.h};function Jc(){}function Kc(a,b){var c=a;b&&(c+='; codecs="'+b+'"');return c}function Lc(a,b,c){a=Kc(a,b);return Lb.get("muxjs")()&&Gc(a)?Hc(c,a):a}function Mc(a){a=a.split(".");var b=a[0];a.pop();return b}function Nc(a){a=a.split(/ *; */);a.shift();return(a=a.find(function(b){return b.startsWith("codecs=")}))?a.split("=")[1].replace(/^"|"$/g,""):""}M("shaka.util.MimeUtils",Jc);Jc.getFullType=Kc; (new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");function Oc(a){this.j=null;this.i=a;this.u=!1;this.l=this.s=0;this.m=Infinity;this.h=this.g=null;this.C="";this.o=new Map}function Pc(a){return Qc[a]||"application/cea-608"==a||"application/cea-708"==a?!0:!1}Oc.prototype.destroy=function(){this.i=this.j=null;this.o.clear();return Promise.resolve()}; function Rc(a,b,c,d){var e,f,g,h;return K(function(k){if(1==k.g)return u(k,Promise.resolve(),2);if(!a.j||!a.i)return k["return"]();if(null==c||null==d)return a.j.parseInit(Gb(b)),k["return"]();e=a.u?c:a.s;f={periodStart:a.s,segmentStart:c,segmentEnd:d,vttOffset:e};g=a.j.parseMedia(Gb(b),f);h=g.filter(function(l){return l.startTime>=a.l&&l.startTime<a.m});a.i.append(h);null==a.g&&(a.g=Math.max(c,a.l));a.h=Math.min(d,a.m);z(k)})} Oc.prototype.remove=function(a,b){var c=this;return K(function(d){if(1==d.g)return u(d,Promise.resolve(),2);!c.i||!c.i.remove(a,b)||null==c.g||b<=c.g||a>=c.h||(a<=c.g&&b>=c.h?c.g=c.h=null:a<=c.g&&b<c.h?c.g=b:a>c.g&&b>=c.h&&(c.h=a));z(d)})};function Sc(a,b,c){a.l=b;a.m=c}function Tc(a,b,c){a.C=b;if(b=a.o.get(b))for(var d=t(b.keys()),e=d.next();!e.done;e=d.next())(e=b.get(e.value).filter(function(f){return f.endTime<=c}))&&a.i.append(e)} function Uc(a){var b=[];a=t(a);for(var c=a.next();!c.done;c=a.next())c=c.value,b.push({stream:c.stream,cue:new hb(c.startTime,c.endTime,c.text)});return b}function Vc(a,b,c){b.startTime+=c;b.endTime+=c;b=t(b.nestedCues);for(var d=b.next();!d.done;d=b.next())Vc(a,d.value,c)} function Wc(a,b,c,d,e){var f=c+" "+d,g=new Map;b=t(b);for(var h=b.next();!h.done;h=b.next()){var k=h.value;h=k.stream;k=k.cue;g.has(h)||g.set(h,new Map);g.get(h).has(f)||g.get(h).set(f,[]);Vc(a,k,e);k.startTime>=a.l&&k.startTime<a.m&&(g.get(h).get(f).push(k),h==a.C&&a.i.append([k]))}e=t(g.keys());for(f=e.next();!f.done;f=e.next())for(f=f.value,a.o.has(f)||a.o.set(f,new Map),b=t(g.get(f).keys()),h=b.next();!h.done;h=b.next())h=h.value,k=g.get(f).get(h),a.o.get(f).set(h,k);a.g=null==a.g?Math.max(c, a.l):Math.min(a.g,Math.max(c,a.l));a.h=Math.max(a.h,Math.min(d,a.m))}M("shaka.text.TextEngine",Oc);Oc.prototype.destroy=Oc.prototype.destroy;Oc.findParser=function(a){return Qc[a]};Oc.unregisterParser=function(a){delete Qc[a]};Oc.registerParser=function(a,b){Qc[a]=b};var Qc={};function Xc(){}function Yc(a,b){a=O(a);b=O(b);return a.split("-")[0]==b.split("-")[0]}function Zc(a,b){a=O(a);b=O(b);var c=a.split("-"),d=b.split("-");return c[0]==d[0]&&1==c.length&&2==d.length}function $c(a,b){a=O(a);b=O(b);var c=a.split("-"),d=b.split("-");return 2==c.length&&2==d.length&&c[0]==d[0]}function O(a){var b=a.split("-");a=b[0]||"";b=b[1]||"";a=a.toLowerCase();a=ad.get(a)||a;return(b=b.toUpperCase())?a+"-"+b:a} function bd(a,b){a=O(a);b=O(b);return b==a?4:Zc(b,a)?3:$c(b,a)?2:Zc(a,b)?1:0}function cd(a){var b=a.indexOf("-");a=0<=b?a.substring(0,b):a;a=a.toLowerCase();return a=ad.get(a)||a}function dd(a){return a.language?O(a.language):a.audio&&a.audio.language?O(a.audio.language):a.video&&a.video.language?O(a.video.language):"und"} function ed(a,b){for(var c=O(a),d=new Set,e=t(b),f=e.next();!f.done;f=e.next())d.add(O(f.value));e=t(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,f==c)return f;e=t(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,Zc(f,c))return f;e=t(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,$c(f,c))return f;d=t(d);for(f=d.next();!f.done;f=d.next())if(f=f.value,Zc(c,f))return f;return null}M("shaka.util.LanguageUtils",Xc);Xc.findClosestLocale=ed;Xc.getLocaleForVariant=dd; Xc.getLocaleForText=function(a){return O(a.language||"und")};Xc.getBase=cd;Xc.relatedness=bd;Xc.areSiblings=function(a,b){var c=cd(a),d=cd(b);return a!=c&&b!=d&&c==d};Xc.normalize=O;Xc.isSiblingOf=$c;Xc.isParentOf=Zc;Xc.areLanguageCompatible=Yc;Xc.areLocaleCompatible=function(a,b){a=O(a);b=O(b);return a==b}; var ad=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 fd(){this.g={}}r=fd.prototype;r.push=function(a,b){this.g.hasOwnProperty(a)?this.g[a].push(b):this.g[a]=[b]};r.get=function(a){return(a=this.g[a])?a.slice():null};r.remove=function(a,b){a in this.g&&(this.g[a]=this.g[a].filter(function(c){return c!=b}),0==this.g[a].length&&delete this.g[a])};function gd(a,b){for(var c in a.g)b(c,a.g[c])}r.size=function(){return Object.keys(this.g).length};r.keys=function(){return Object.keys(this.g)};function hd(a){this.h=a;this.g=null}hd.prototype.R=function(a){var b=this;this.stop();var c=!0,d=null;this.g=function(){window.clearTimeout(d);c=!1};d=window.setTimeout(function(){c&&b.h()},1E3*a);return this};hd.prototype.stop=function(){this.g&&(this.g(),this.g=null)};function R(a){this.h=a;this.g=null}R.prototype.Lb=function(){this.stop();this.h();return this};R.prototype.R=function(a){var b=this;this.stop();this.g=(new hd(function(){b.h()})).R(a);return this};R.prototype.Ca=function(a){var b=this;this.stop();this.g=(new hd(function(){b.g.R(a);b.h()})).R(a);return this};R.prototype.stop=function(){this.g&&(this.g.stop(),this.g=null)};M("shaka.util.Timer",R);R.prototype.stop=R.prototype.stop;R.prototype.tickEvery=R.prototype.Ca;R.prototype.tickAfter=R.prototype.R; R.prototype.tickNow=R.prototype.Lb;function id(){return window.MediaSource&&MediaSource.isTypeSupported?!0:!1}function jd(a){return""!=kd().canPlayType(a)}function pd(){return qd("Tizen")}function rd(){return qd("CrKey")}function sd(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!pd()}function td(){if(!sd())return null;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} function qd(a){return(navigator.userAgent||"").includes(a)}function kd(){if(ud)return ud;vd||(vd=new R(function(){ud=null}));(ud=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(ud=document.createElement("video"));vd.R(1);return ud}var vd=null,ud=null;function wd(a,b,c,d,e){var f=a.variants;if(b.length||c.length)f=xd(f,b,c);f=yd(f,d);b=zd(f);b=Ad(b);var g=Bd(b,e);a.variants=a.variants.filter(function(h){return Cd(h)==g?!0:!1})}function zd(a){var b=new fd;a=t(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=Cd(c);b.push(d,c)}return b} function Ad(a){var b=0,c=new Map,d=a.size();gd(a,function(e,f){for(var g=t(f),h=g.next();!h.done;h=g.next()){h=h.value;var k=h.video;if(k&&k.width&&k.height){k=k.width*k.height*(k.frameRate||1);c.has(k)||c.set(k,new fd);var l=c.get(k);l.push(e,h);l.size()===d&&(b=Math.max(b,k))}}});return b?c.get(b):a} function xd(a,b,c){var d={};b=t(b);for(var e=b.next();!e.done;d={md:d.md},e=b.next())if(d.md=e.value,e=a.filter(function(f){return function(g){return g.video&&g.video.codecs.startsWith(f.md)}}(d)),e.length){a=e;break}d={};c=t(c);for(b=c.next();!b.done;d={Yc:d.Yc},b=c.next())if(d.Yc=b.value,b=a.filter(function(f){return function(g){return g.audio&&g.audio.codecs.startsWith(f.Yc)}}(d)),b.length){a=b;break}return a} function Bd(a,b){for(var c=t(b),d=c.next();!d.done;d=c.next())if(d=d.value,d==Dd||d==Ed){if(a=Fd(a,d),1==a.size())return a.keys()[0]}else if(d==Gd)break;return Hd(a)}function Fd(a,b){var c=0,d=new fd;gd(a,function(e,f){for(var g=0,h=0,k=t(f),l=k.next();!l.done;l=k.next())l=l.value,l.decodingInfos.length&&(g+=l.decodingInfos[0][b]?1:0,h++);g/=h;g>c?(d.g={},d.push(e,f),c=g):g==c&&d.push(e,f)});return d} function Hd(a){var b="",c=Infinity;gd(a,function(d,e){for(var f=0,g=0,h=t(e),k=h.next();!k.done;k=h.next())f+=k.value.bandwidth||0,++g;f/=g;f<c&&(b=d,c=f)});return b}function Cd(a){var b="";a.video&&(b=Mc(a.video.codecs));var c="";a.audio&&(c=Mc(a.audio.codecs));return b+"-"+c}function Id(a,b,c){a.variants=a.variants.filter(function(d){return Jd(d,b,c)})} function Jd(a,b,c){function d(f,g,h){return f>=g&&f<=h}var e=a.video;return e&&e.width&&e.height&&(!d(e.width,b.minWidth,Math.min(b.maxWidth,c.width))||!d(e.height,b.minHeight,Math.min(b.maxHeight,c.height))||!d(e.width*e.height,b.minPixels,b.maxPixels))||a&&a.video&&a.video.frameRate&&!d(a.video.frameRate,b.minFrameRate,b.maxFrameRate)||!d(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!1:!0} function Kd(a,b){return K(function(c){if(1==c.g)return u(c,Ld(b,0<b.offlineSessionIds.length),2);Md(a,b);Nd(b);return u(c,Od(b),0)})} function Ld(a,b){return K(function(c){if(1==c.g)return u(c,Pd(a.variants,b,!1),2);a.variants=a.variants.filter(function(d){var e=d.video;if(e){var f=Qd(e.codecs);if(e.codecs.includes(",")){var g=e.codecs.split(",");f=ic("video",g);g=ic("audio",g);g=Lc(e.mimeType,g,"audio");if(!MediaSource.isTypeSupported(g))return!1}f=Lc(e.mimeType,f,"video");if(!MediaSource.isTypeSupported(f))return!1}if(f=d.audio)if(g=Rd(f.codecs),f=Lc(f.mimeType,g,"audio"),!MediaSource.isTypeSupported(f))return!1;if(qd("Xbox One")&& e&&(e.width&&1920<e.width||e.height&&1080<e.height)&&e.codecs.includes("avc1."))return Za(Sd(d)),!1;(e=d.decodingInfos.some(function(h){return h.supported}))||Za(Sd(d));return e});z(c)})} function Pd(a,b,c){var d,e,f,g,h,k,l,m,p,n,q;return K(function(v){if(d=a.some(function(x){return x.decodingInfos.length}))return v["return"]();e=navigator.mediaCapabilities;f=[];g=function(x,w){var y;return K(function(D){if(1==D.g)return B(D,2),u(D,e.decodingInfo(w),4);if(2!=D.g)return y=D.h,x.decodingInfos.push(y),va(D,0);E(D);JSON.stringify(w);z(D)})};h=t(a);for(k=h.next();!k.done;k=h.next())for(l=k.value,m=Td(l,b,c),p=t(m),n=p.next();!n.done;n=p.next())q=n.value,f.push(g(l,q));return u(v,Promise.all(f), 0)})} function Td(a,b,c){var d=a.audio,e=a.video;c={type:c?"file":"media-source"};if(e){var f=e.codecs;if(e.codecs.includes(",")){var g=e.codecs.split(",");f=ic("video",g);f=Qd(f);g=ic("audio",g);g=Lc(e.mimeType,g,"audio");c.audio={contentType:g,channels:2,bitrate:a.bandwidth||1,samplerate:1,spatialRendering:!1}}f=Qd(f);f=Lc(e.mimeType,f,"video");c.video={contentType:f,width:e.width||1,height:e.height||1,bitrate:e.bandwidth||a.bandwidth||1,framerate:e.frameRate||1};if(e.hdr)switch(e.hdr){case "SDR":c.video.transferFunction="srgb"; break;case "PQ":c.video.transferFunction="pq";break;case "HLG":c.video.transferFunction="hlg"}}d&&(f=Rd(d.codecs),f=Lc(d.mimeType,f,"audio"),c.audio={contentType:f,channels:d.channelsCount||2,bitrate:d.bandwidth||a.bandwidth||1,samplerate:d.audioSamplingRate||1,spatialRendering:d.spatialAudio});g=(a.video?a.video.drmInfos:[]).concat(a.audio?a.audio.drmInfos:[]);if(!g.length)return[c];a=[];f=new Map;g=t(g);for(var h=g.next();!h.done;h=g.next()){var k=h.value;f.get(k.keySystem)||f.set(k.keySystem,[]); f.get(k.keySystem).push(k)}g=b?"required":"optional";b=b?["persistent-license"]:["temporary"];k=t(f.keys());for(var l=k.next();!l.done;l=k.next()){var m=l.value;l=Object.assign({},c);var p=f.get(m);m={keySystem:m,initDataType:"cenc",persistentState:g,distinctiveIdentifier:"optional",sessionTypes:b};p=t(p);for(h=p.next();!h.done;h=p.next()){h=h.value;if(h.initData&&h.initData.length){for(var n=new Set,q=t(h.initData),v=q.next();!v.done;v=q.next())n.add(v.value.initDataType);m.initDataType=h.initData[0].initDataType}h.distinctiveIdentifierRequired&& (m.distinctiveIdentifier="required");h.persistentStateRequired&&(m.persistentState="required");h.sessionType&&(m.sessionTypes=[h.sessionType]);d&&(m.audio?m.audio.robustness=m.audio.robustness||h.audioRobustness:m.audio={robustness:h.audioRobustness});e&&(m.video?m.video.robustness=m.video.robustness||h.videoRobustness:m.video={robustness:h.videoRobustness})}l.keySystemConfiguration=m;a.push(l)}return a}function Rd(a){return pd()?"ac-3"==a.toLowerCase()?"ec-3":a:a} function Qd(a){return"vp9"==a?"vp09.00.10.08":a}function Md(a,b){b.variants=b.variants.filter(function(c){var d=c.audio;c=c.video;return d&&a&&a.audio&&!Ud(d,a.audio)||c&&a&&a.video&&!Ud(c,a.video)?!1:!0})}function Nd(a){a.textStreams=a.textStreams.filter(function(b){return Pc(Kc(b.mimeType,b.codecs))})} function Od(a){var b,c,d,e,f,g,h,k;return K(function(l){switch(l.g){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;if(Vd.has(f)){l.A(5);break}g=Wd.get(f);if(!g){Vd.set(f,!1);l.A(5);break}return u(l,Xd(g),7);case 7:h=l.h,Vd.set(f,h);case 5:(k=Vd.get(f))&&b.push(e);d=c.next();l.A(2);break;case 4:a.imageStreams=b,z(l)}})} function Xd(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(2===c.height)}})}function Ud(a,b){return a.mimeType!=b.mimeType||a.codecs.split(".")[0]!=b.codecs.split(".")[0]?!1:!0} function Yd(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=[];g&&h.push(g);f&&h.push(f);var k=[];c&&k.push(c.mimeType);b&&k.push(b.mimeType);k=k[0]||null;var l=[];b&&l.push(b