shaka-player
Version:
DASH/EME video player library
121 lines (120 loc) • 431 kB
JavaScript
/*
@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 p;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}var ca="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&&ca(c,d,{configurable:!0,writable:!0,value:f})}}
fa("Symbol",function(a){function b(e){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new c("jscomp_symbol_"+(e||"")+"_"+d++,e)}function c(e,f){this.a=e;ca(this,"description",{configurable:!0,writable:!0,value:f})}if(a)return a;c.prototype.toString=function(){return this.a};var d=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]&&ca(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 q(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}}function ja(a){if(!(a instanceof Array)){a=q(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={We:!0},oa={};try{oa.__proto__=na;ma=oa.We;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 u(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.Vg=b.prototype}function qa(){this.o=!1;this.g=null;this.b=void 0;this.a=1;this.f=this.l=0;this.A=this.c=null}function ra(a){if(a.o)throw new TypeError("Generator is already running");a.o=!0}qa.prototype.s=function(a){this.b=a};
function sa(a,b){a.c={oe:b,we:!0};a.a=a.l||a.f}qa.prototype["return"]=function(a){this.c={"return":a};this.a=this.f};function w(a,b,c){a.a=c;return{value:b}}qa.prototype.u=function(a){this.a=a};function x(a){a.a=0}function C(a,b,c){a.l=b;void 0!=c&&(a.f=c)}function ta(a){a.l=0;a.f=2}function ua(a,b){a.a=b;a.l=0}function G(a){a.l=0;var b=a.c.oe;a.c=null;return b}function va(a){a.A=[a.c];a.l=0;a.f=0}
function wa(a,b){var c=a.A.splice(0)[0];(c=a.c=a.c||c)?c.we?a.a=a.l||a.f:void 0!=c.u&&a.f<c.u?(a.a=c.u,a.c=null):a.a=a.f:a.a=b}function xa(a){this.a=new qa;this.b=a}function ya(a,b){ra(a.a);var c=a.a.g;if(c)return za(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.a["return"]);a.a["return"](b);return Aa(a)}
function za(a,b,c,d){try{var e=b.call(a.a.g,c);if(!(e instanceof Object))throw new TypeError("Iterator result "+e+" is not an object");if(!e.done)return a.a.o=!1,e;var f=e.value}catch(g){return a.a.g=null,sa(a.a,g),Aa(a)}a.a.g=null;d.call(a.a,f);return Aa(a)}
function Aa(a){for(;a.a.a;)try{var b=a.b(a.a);if(b)return a.a.o=!1,{value:b.value,done:!1}}catch(c){a.a.b=void 0,sa(a.a,c)}a.a.o=!1;if(a.a.c){b=a.a.c;a.a.c=null;if(b.we)throw b.oe;return{value:b["return"],done:!0}}return{value:void 0,done:!0}}
function Ba(a){this.next=function(b){ra(a.a);a.a.g?b=za(a,a.a.g.next,b,a.a.s):(a.a.s(b),b=Aa(a));return b};this["throw"]=function(b){ra(a.a);a.a.g?b=za(a,a.a.g["throw"],b,a.a.s):(sa(a.a,b),b=Aa(a));return b};this["return"]=function(b){return ya(a,b)};this[Symbol.iterator]=function(){return this}}function Ca(a,b){var c=new Ba(new xa(b));pa&&a.prototype&&pa(c,a.prototype);return c}
function Da(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 Da(new Ba(new xa(a)))}
fa("Promise",function(a){function b(g){this.b=0;this.c=void 0;this.a=[];this.o=!1;var h=this.f();try{g(h.resolve,h.reject)}catch(k){h.reject(k)}}function c(){this.a=null}function d(g){return g instanceof b?g:new b(function(h){h(g)})}if(a)return a;c.prototype.b=function(g){if(null==this.a){this.a=[];var h=this;this.c(function(){h.g()})}this.a.push(g)};var e=ea.setTimeout;c.prototype.c=function(g){e(g,0)};c.prototype.g=function(){for(;this.a&&this.a.length;){var g=this.a;this.a=[];for(var h=0;h<g.length;++h){var k=
g[h];g[h]=null;try{k()}catch(l){this.f(l)}}}this.a=null};c.prototype.f=function(g){this.c(function(){throw g;})};b.prototype.f=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.g)}};b.prototype.G=function(g){if(g===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof b)this.L(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.F(g):this.l(g)}};
b.prototype.F=function(g){var h=void 0;try{h=g.then}catch(k){this.g(k);return}"function"==typeof h?this.M(h,g):this.l(g)};b.prototype.g=function(g){this.s(2,g)};b.prototype.l=function(g){this.s(1,g)};b.prototype.s=function(g,h){if(0!=this.b)throw Error("Cannot settle("+g+", "+h+"): Promise already settled in state"+this.b);this.b=g;this.c=h;2===this.b&&this.J();this.A()};b.prototype.J=function(){var g=this;e(function(){if(g.C()){var h=ea.console;"undefined"!==typeof h&&h.error(g.c)}},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.c;return k(g)};b.prototype.A=function(){if(null!=this.a){for(var g=0;g<this.a.length;++g)f.b(this.a[g]);this.a=null}};var f=new c;
b.prototype.L=function(g){var h=this.f();g.Oc(h.resolve,h.reject)};b.prototype.M=function(g,h){var k=this.f();try{g.call(h,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(g,h){function k(r,t){return"function"==typeof r?function(v){try{l(r(v))}catch(A){m(A)}}:t}var l,m,n=new b(function(r,t){l=r;m=t});this.Oc(k(g,l),k(h,m));return n};b.prototype["catch"]=function(g){return this.then(void 0,g)};b.prototype.Oc=function(g,h){function k(){switch(l.b){case 1:g(l.c);break;case 2:h(l.c);
break;default:throw Error("Unexpected state: "+l.b);}}var l=this;null==this.a?f.b(k):this.a.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=q(g),m=l.next();!m.done;m=l.next())d(m.value).Oc(h,k)})};b.all=function(g){var h=q(g),k=h.next();return k.done?d([]):new b(function(l,m){function n(v){return function(A){r[v]=A;t--;0==t&&l(r)}}var r=[],t=0;do r.push(void 0),t++,d(k.value).Oc(n(r.length-1),m),k=h.next();
while(!k.done)})};return b});function Ea(a,b){return Object.prototype.hasOwnProperty.call(a,b)}
fa("WeakMap",function(a){function b(k){this.a=(h+=Math.random()+1).toString();if(k){k=q(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(!Ea(k,g)){var l=new c;ca(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(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(!Ea(k,g))throw Error("WeakMap key fail: "+k);k[g][this.a]=l;return this};b.prototype.get=function(k){return d(k)&&Ea(k,g)?k[g][this.a]:void 0};b.prototype.has=function(k){return d(k)&&
Ea(k,g)&&Ea(k[g],this.a)};b.prototype["delete"]=function(k){return d(k)&&Ea(k,g)&&Ea(k[g],this.a)?delete k[g][this.a]:!1};return b});
fa("Map",function(a){function b(){var h={};return h.$a=h.next=h.head=h}function c(h,k){var l=h.a;return ha(function(){if(l){for(;l.head!=h.a;)l=l.$a;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.b[l];if(m&&Ea(h.b,l))for(var n=0;n<m.length;n++){var r=m[n];if(k!==k&&r.key!==r.key||k===r.key)return{id:l,list:m,index:n,ma:r}}return{id:l,
list:m,index:-1,ma:void 0}}function e(h){this.b={};this.a=b();this.size=0;if(h){h=q(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(q([[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(n){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.b[l.id]=[]);l.ma?l.ma.value=k:(l.ma={next:this.a,$a:this.a.$a,head:this.a,key:h,value:k},l.list.push(l.ma),this.a.$a.next=l.ma,this.a.$a=l.ma,this.size++);return this};e.prototype["delete"]=function(h){h=d(this,h);return h.ma&&h.list?(h.list.splice(h.index,1),h.list.length||delete this.b[h.id],h.ma.$a.next=h.ma.next,h.ma.next.$a=h.ma.$a,
h.ma.head=null,this.size--,!0):!1};e.prototype.clear=function(){this.b={};this.a=this.a.$a=b();this.size=0};e.prototype.has=function(h){return!!d(this,h).ma};e.prototype.get=function(h){return(h=d(this,h).ma)&&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.a=new Map;if(c){c=q(c);for(var d;!(d=c.next()).done;)this.add(d.value)}this.size=this.a.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(q([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.a.set(c,c);this.size=this.a.size;return this};b.prototype["delete"]=function(c){c=this.a["delete"](c);this.size=this.a.size;return c};b.prototype.clear=function(){this.a.clear();this.size=0};b.prototype.has=function(c){return this.a.has(c)};b.prototype.entries=function(){return this.a.entries()};b.prototype.values=function(){return this.a.values()};b.prototype.keys=b.prototype.values;
b.prototype[Symbol.iterator]=b.prototype.values;b.prototype.forEach=function(c,d){var e=this;this.a.forEach(function(f){return c.call(d,f,f,e)})};return b});function Fa(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 Fa(this,function(b){return b})}});
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}});function Ha(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{na:e,Te:f}}return{na:-1,Te:void 0}}
fa("Array.prototype.findIndex",function(a){return a?a:function(b,c){return Ha(this,b,c).na}});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("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 Ja(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!==Ja(this,b,"includes").indexOf(b,c||0)}});fa("Array.prototype.values",function(a){return a?a:function(){return Fa(this,function(b,c){return c})}});fa("Array.prototype.find",function(a){return a?a:function(b,c){return Ha(this,b,c).Te}});fa("Math.log2",function(a){return a?a:function(b){return Math.log(b)/Math.LN2}});
var Ka="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)Ea(d,e)&&(a[e]=d[e])}return a};fa("Object.assign",function(a){return a||Ka});fa("Object.values",function(a){return a?a:function(b){var c=[],d;for(d in b)Ea(b,d)&&c.push(b[d]);return c}});
fa("String.prototype.startsWith",function(a){return a?a:function(b,c){for(var d=Ja(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}});var La=this||self;function L(a,b){var c=a.split("."),d=La;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 M(a,b){b=void 0===b?{}:b;for(var 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.a=!1}M.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)};M.prototype.stopImmediatePropagation=function(){this.a=!0};
M.prototype.stopPropagation=function(){};L("shaka.util.FakeEvent",M);function Na(){}function Oa(){}function Pa(){}function Sa(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];Ta.has(a)||(Ta.add(a),Pa.apply(Na,ja(c)))}function Ua(){}function Va(){}function Wa(){}var Ta=new Set;if(window.console&&window.console.log.bind){var Xa={},Ya=(Xa[1]=console.error.bind(console),Xa[2]=console.warn.bind(console),Xa[3]=console.info.bind(console),Xa[4]=console.log.bind(console),Xa[5]=console.debug.bind(console),Xa[6]=console.debug.bind(console),Xa);Pa=Ya[2];Oa=Ya[1]};function Za(){this.a={}}Za.prototype.push=function(a,b){this.a.hasOwnProperty(a)?this.a[a].push(b):this.a[a]=[b]};Za.prototype.get=function(a){return(a=this.a[a])?a.slice():null};Za.prototype.remove=function(a,b){a in this.a&&(this.a[a]=this.a[a].filter(function(c){return c!=b}))};function bb(a,b){for(var c in a.a)b(c,a.a[c])}Za.prototype.size=function(){return Object.keys(this.a).length};function cb(){this.vd=new Za;this.Lc=this}cb.prototype.addEventListener=function(a,b){this.vd.push(a,b)};cb.prototype.removeEventListener=function(a,b){this.vd.remove(a,b)};cb.prototype.dispatchEvent=function(a){var b=this.vd.get(a.type)||[];b=q(b);for(var c=b.next();!c.done;c=b.next()){c=c.value;a.target=this.Lc;a.currentTarget=this.Lc;try{c.handleEvent?c.handleEvent(a):c.call(this,a)}catch(d){}if(a.a)break}return a.defaultPrevented};function db(a,b){for(var c=[],d=q(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c}function eb(a,b){for(var c=q(a),d=c.next();!d.done;d=c.next())if(!b(d.value))return!1;return!0}function fb(a,b){for(var c=q(a),d=c.next();!d.done;d=c.next())if(b(d.value))return!0;return!1}function gb(a,b){for(var c=[],d=q(a),e=d.next();!e.done;e=d.next())e=e.value,b(e)&&c.push(e);return c}
var ib=function hb(a){var c;return Ca(hb,function(d){1==d.a&&(c=0);if(3!=d.a)return c<a?w(d,c,3):d.u(0);c++;return d.u(2)})},kb=function jb(a){var c,d,e,f,g,h;return Ca(jb,function(k){1==k.a&&(c=-1,e=d=void 0,f=q(a),g=f.next());if(5!=k.a){if(g.done)return-1==c?k.u(0):w(k,{na:c,Vf:d,item:e,next:void 0},0);h=g.value;return 0<=c?w(k,{na:c,item:e,Vf:d,next:h},5):k.u(5)}c++;d=e;e=h;g=f.next();return k.u(2)})};/*
@license
Copyright 2008 The Closure Library Authors
SPDX-License-Identifier: Apache-2.0
*/
var lb=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;/*
@license
Copyright 2006 The Closure Library Authors
SPDX-License-Identifier: Apache-2.0
*/
function mb(a){var b;a instanceof mb?(nb(this,a.Na),this.Cb=a.Cb,this.Ma=a.Ma,ob(this,a.Zb),this.Ba=a.Ba,pb(this,a.a.clone()),this.qb=a.qb):a&&(b=String(a).match(lb))?(nb(this,b[1]||"",!0),this.Cb=qb(b[2]||""),this.Ma=qb(b[3]||"",!0),ob(this,b[4]),this.Ba=qb(b[5]||"",!0),pb(this,b[6]||"",!0),this.qb=qb(b[7]||"")):this.a=new rb(null)}p=mb.prototype;p.Na="";p.Cb="";p.Ma="";p.Zb=null;p.Ba="";p.qb="";
p.toString=function(){var a=[],b=this.Na;b&&a.push(sb(b,tb,!0),":");if(b=this.Ma){a.push("//");var c=this.Cb;c&&a.push(sb(c,tb,!0),"@");a.push(encodeURIComponent(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.Zb;null!=b&&a.push(":",String(b))}if(b=this.Ba)this.Ma&&"/"!=b.charAt(0)&&a.push("/"),a.push(sb(b,"/"==b.charAt(0)?ub:vb,!0));(b=this.a.toString())&&a.push("?",b);(b=this.qb)&&a.push("#",sb(b,wb));return a.join("")};
p.resolve=function(a){var b=this.clone();"data"===b.Na&&(b=new mb);var c=!!a.Na;c?nb(b,a.Na):c=!!a.Cb;c?b.Cb=a.Cb:c=!!a.Ma;c?b.Ma=a.Ma:c=null!=a.Zb;var d=a.Ba;if(c)ob(b,a.Zb);else if(c=!!a.Ba){if("/"!=d.charAt(0))if(this.Ma&&!this.Ba)d="/"+d;else{var e=b.Ba.lastIndexOf("/");-1!=e&&(d=b.Ba.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.Ba=d:c=""!==a.a.toString();c?pb(b,a.a.clone()):c=!!a.qb;c&&(b.qb=a.qb);return b};p.clone=function(){return new mb(this)};function nb(a,b,c){a.Na=c?qb(b,!0):b;a.Na&&(a.Na=a.Na.replace(/:$/,""))}function ob(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.Zb=b}else a.Zb=null}function pb(a,b,c){b instanceof rb?a.a=b:(c||(b=sb(b,xb)),a.a=new rb(b))}
function qb(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function sb(a,b,c){return null!=a?(a=encodeURI(a).replace(b,yb),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function yb(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var tb=/[#\/\?@]/g,vb=/[#\?:]/g,ub=/[#\?]/g,xb=/[#\?@]/g,wb=/#/g;function rb(a){this.a=a||null}p=rb.prototype;p.ya=null;p.Qc=null;
p.add=function(a,b){if(!this.ya&&(this.ya={},this.Qc=0,this.a))for(var c=this.a.split("&"),d=0;d<c.length;d++){var e=c[d].indexOf("="),f=null;if(0<=e){var g=c[d].substring(0,e);f=c[d].substring(e+1)}else g=c[d];g=decodeURIComponent(g.replace(/\+/g," "));f=f||"";this.add(g,decodeURIComponent(f.replace(/\+/g," ")))}this.a=null;(c=this.ya.hasOwnProperty(a)&&this.ya[a])||(this.ya[a]=c=[]);c.push(b);this.Qc++;return this};
p.toString=function(){if(this.a)return this.a;if(!this.ya)return"";var a=[],b;for(b in this.ya)for(var c=encodeURIComponent(b),d=this.ya[b],e=0;e<d.length;e++){var f=c;""!==d[e]&&(f+="="+encodeURIComponent(d[e]));a.push(f)}return this.a=a.join("&")};p.clone=function(){var a=new rb;a.a=this.a;if(this.ya){var b={},c;for(c in this.ya)b[c]=this.ya[c].concat();a.ya=b;a.Qc=this.Qc}return a};function zb(a,b){this.a=a;this.b=b}zb.prototype.toString=function(){return"v"+this.a+"."+this.b};function Ab(a,b){var c=new zb(4,0),d=Bb,e=d.a,f=c.b-e.b;(0<(c.a-e.a||f)?d.c:d.b)(d.a,c,a,b)}function Cb(a,b,c,d){Pa([c,"has been deprecated and will be removed in",b,". We are currently at version",a,". Additional information:",d].join(" "))}function Db(a,b,c,d){Oa([c,"has been deprecated and has been removed in",b,". We are now at version",a,". Additional information:",d].join(""))}var Bb=null;function Eb(a,b){return a.concat(b)}function Fb(){}function Gb(a){return null!=a}function Hb(a){var b=Object.create(a.prototype||Object.prototype);try{var c=a.call(b);c||(Ab("Factories requiring new","Factories should be plain functions"),c=b)}catch(d){Ab("Factories requiring new","Factories should be plain functions"),c=new a}return c};function Ib(a,b){if(0==b.length)return a;var c=b.map(function(d){return new mb(d)});return a.map(function(d){return new mb(d)}).map(function(d){return c.map(function(e){return d.resolve(e)})}).reduce(Eb,[]).map(function(d){return d.toString()})}function Jb(a,b){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:new Set}}
var Kb={Wa:"video",Kb:"audio",qa:"text",Ag:"image",rg:"application"};function Lb(a,b){a=Mb(a);b=Mb(b);return a.split("-")[0]==b.split("-")[0]}function Nb(a,b){a=Mb(a);b=Mb(b);var c=a.split("-"),d=b.split("-");return c[0]==d[0]&&1==c.length&&2==d.length}function Ob(a,b){a=Mb(a);b=Mb(b);var c=a.split("-"),d=b.split("-");return 2==c.length&&2==d.length&&c[0]==d[0]}function Mb(a){var b=a.split("-");a=b[0]||"";b=b[1]||"";a=a.toLowerCase();a=Pb.get(a)||a;return(b=b.toUpperCase())?a+"-"+b:a}function Qb(a,b){a=Mb(a);b=Mb(b);return b==a?4:Nb(b,a)?3:Ob(b,a)?2:Nb(a,b)?1:0}
function Rb(a){var b=a.indexOf("-");a=0<=b?a.substring(0,b):a;a=a.toLowerCase();return a=Pb.get(a)||a}function Sb(a){return a.language?Mb(a.language):a.audio&&a.audio.language?Mb(a.audio.language):a.video&&a.video.language?Mb(a.video.language):"und"}
function Tb(a,b){for(var c=Mb(a),d=new Set,e=q(b),f=e.next();!f.done;f=e.next())d.add(Mb(f.value));e=q(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,f==c)return f;e=q(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,Nb(f,c))return f;e=q(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,Ob(f,c))return f;d=q(d);for(f=d.next();!f.done;f=d.next())if(f=f.value,Nb(c,f))return f;return null}
var Pb=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 Ub(a){this.g=Mb(a);this.f=new Map;this.b=new Set;this.c=new Map;this.a=new cb}p=Ub.prototype;p.addEventListener=function(a,b,c){this.a.addEventListener(a,b,c)};p.removeEventListener=function(a,b,c){this.a.removeEventListener(a,b,c||void 0)};p.dispatchEvent=function(a){return this.a.dispatchEvent(a)};
p.ge=function(a){var b=this;this.b.clear();a=q(a);for(var c=a.next();!c.done;c=a.next())this.b.add(Mb(c.value));Vb(this);a=gb(this.b,function(d){return!b.c.has(d)});a.length&&this.a.dispatchEvent(new M("unknown-locales",{locales:a}));a=gb(this.b,function(d){return b.c.has(d)});this.a.dispatchEvent(new M("locale-changed",{locales:a.length?a:[this.g]}))};
p.Y=function(a,b,c){a=Mb(a);void 0===c&&(c=Wb);var d=this.c.get(a)||new Map;b.forEach(function(e,f){d.has(f)&&c!=Wb||d.set(f,e)});this.c.set(a,d);Vb(this);this.a.dispatchEvent(new M("locale-updated"));return this};p.dg=function(a){for(var b=q(a.keys()),c=b.next();!c.done;c=b.next())c=c.value,a.set(c,this.resolve(c))};p.resolve=function(a){var b=this.f.get(a);if(b)return b;a={locales:Array.from(this.b),missing:a};this.a.dispatchEvent(new M("unknown-localization",a));return""};
function Vb(a){for(var b=a.c,c=a.g,d=a.b,e=new Set,f={},g=q(d),h=g.next();!h.done;f={Hb:f.Hb},h=g.next()){f.Hb=h.value;e.add(f.Hb);e.add(Rb(f.Hb));h=gb(b.keys(),function(l){return function(m){var n=l.Hb,r=Rb(m),t=Rb(n);return m!=r&&n!=t&&r==t}}(f));h.sort();var k=q(h);for(h=k.next();!h.done;h=k.next())e.add(h.value);h=gb(b.keys(),function(l){return function(m){return Rb(m)==l.Hb}}(f));h.sort();k=q(h);for(h=k.next();!h.done;h=k.next())e.add(h.value)}e.add(c);c=[];e=q(e);for(h=e.next();!h.done;h=e.next())(h=
b.get(h.value))&&c.push(h);c.reverse();a.f.clear();b=q(c);for(h=b.next();!h.done;h=b.next())h.value.forEach(function(l,m){a.f.set(m,l)});b=a.f.keys();e=new Set;c=q(a.b);for(h=c.next();!h.done;h=c.next())h=a.c.get(h.value)||new Map,Xb(h,b,e);0<e.size&&(d={locales:Array.from(d),missing:Array.from(e)},a.a.dispatchEvent(new M("missing-localizations",d)))}function Xb(a,b,c){b=q(b);for(var d=b.next();!d.done;d=b.next())d=d.value,a.get(d)||c.add(d)}L("shaka.ui.Localization",Ub);Ub.prototype.resolve=Ub.prototype.resolve;
Ub.prototype.resolveDictionary=Ub.prototype.dg;Ub.prototype.insert=Ub.prototype.Y;Ub.prototype.changeLocale=Ub.prototype.ge;Ub.prototype.dispatchEvent=Ub.prototype.dispatchEvent;Ub.prototype.removeEventListener=Ub.prototype.removeEventListener;Ub.prototype.addEventListener=Ub.prototype.addEventListener;var Wb=1;Ub.ConflictResolution={USE_OLD:0,USE_NEW:Wb};Ub.UNKNOWN_LOCALES="unknown-locales";Ub.UNKNOWN_LOCALIZATION="unknown-localization";Ub.MISSING_LOCALIZATIONS="missing-localizations";
Ub.LOCALE_CHANGED="locale-changed";Ub.LOCALE_UPDATED="locale-updated";function Yb(a){this.c=Math.exp(Math.log(.5)/a);this.b=this.a=0}function Zb(a,b,c){var d=Math.pow(a.c,b);c=c*(1-d)+d*a.a;isNaN(c)||(a.a=c,a.b+=b)}function $b(a){return a.a/(1-Math.pow(a.c,a.b))};function ac(){this.b=new Yb(2);this.c=new Yb(5);this.a=0}ac.prototype.getBandwidthEstimate=function(a){return 128E3>this.a?a:Math.min($b(this.b),$b(this.c))};function cc(){}function dc(a,b){if(!a&&!b)return!0;if(!a||!b||a.byteLength!=b.byteLength)return!1;if(ec(a)==ec(b)&&(a.byteOffset||0)==(b.byteOffset||0))return!0;for(var c=fc(a),d=fc(b),e=q(ib(a.byteLength)),f=e.next();!f.done;f=e.next())if(f=f.value,c[f]!=d[f])return!1;return!0}function ec(a){return a instanceof ArrayBuffer?a:a.buffer}function gc(a){return a instanceof ArrayBuffer?a:0==a.byteOffset&&a.byteLength==a.buffer.byteLength?a.buffer:(new Uint8Array(a)).buffer}
function fc(a,b,c){c=void 0===c?Infinity:c;return hc(a,void 0===b?0:b,c,Uint8Array)}function ic(a,b,c){c=void 0===c?Infinity:c;return hc(a,void 0===b?0:b,c,DataView)}function hc(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(ec(a),b,Math.min(b+Math.max(c,0),e)-b)}L("shaka.util.BufferUtils",cc);cc.toDataView=ic;cc.toUint8=fc;cc.toArrayBuffer=gc;cc.equal=dc;function N(a,b,c,d){for(var e=[],f=3;f<arguments.length;++f)e[f-3]=arguments[f];this.severity=a;this.category=b;this.code=c;this.data=e;this.handled=!1}N.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")};L("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,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_COULD_NOT_GUESS_MIME_TYPE:4021,HLS_MASTER_PLAYLIST_NOT_PROVIDED:4022,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,HLS_COULD_NOT_PARSE_SEGMENT_START_TIME:4030,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,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,LOAD_INTERRUPTED:7E3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,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,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};function jc(){var a,b,c=new Promise(function(d,e){a=d;b=e});c.resolve=a;c.reject=b;return c}jc.prototype.resolve=function(){};jc.prototype.reject=function(){};function kc(a){this.b=a;this.a=void 0}kc.prototype.value=function(){void 0==this.a&&(this.a=this.b());return this.a};function lc(){}function mc(a){if(!a)return"";a=fc(a);239==a[0]&&187==a[1]&&191==a[2]&&(a=a.subarray(3));a=nc(a);a=escape(a);try{return decodeURIComponent(a)}catch(b){throw new N(2,2,2004);}}function oc(a,b,c){if(!a)return"";if(!c&&0!=a.byteLength%2)throw new N(2,2,2004);var d=Math.floor(a.byteLength/2);c=new Uint16Array(d);a=ic(a);d=q(ib(d));for(var e=d.next();!e.done;e=d.next())e=e.value,c[e]=a.getUint16(2*e,b);return nc(c)}
function pc(a){function b(d){return c.byteLength<=d||32<=c[d]&&126>=c[d]}if(!a)return"";var c=fc(a);if(239==c[0]&&187==c[1]&&191==c[2])return mc(c);if(254==c[0]&&255==c[1])return oc(c.subarray(2),!1);if(255==c[0]&&254==c[1])return oc(c.subarray(2),!0);if(0==c[0]&&0==c[2])return oc(a,!1);if(0==c[1]&&0==c[3])return oc(a,!0);if(b(0)&&b(1)&&b(2)&&b(3))return mc(a);throw new N(2,2,2003);}
function qc(a){a=encodeURIComponent(a);var b=unescape(a);a=new Uint8Array(b.length);b=q(kb(b));for(var c=b.next();!c.done;c=b.next())c=c.value,a[c.na]=c.item.charCodeAt(0);return gc(a)}function rc(a,b){for(var c=new ArrayBuffer(2*a.length),d=new DataView(c),e=q(kb(a)),f=e.next();!f.done;f=e.next())f=f.value,d.setUint16(2*f.na,f.item.charCodeAt(0),b);return c}function nc(a){return sc.value()(a)}L("shaka.util.StringUtils",lc);lc.resetFromCharCode=function(){sc.a=void 0};lc.toUTF16=rc;lc.toUTF8=qc;
lc.fromBytesAutoDetect=pc;lc.fromUTF16=oc;lc.fromUTF8=mc;var sc=new kc(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={cb:65536};0<b.cb;b={cb:b.cb},b.cb/=2)if(a(b.cb))return function(c){return function(d){for(var e="",f=0;f<d.length;f+=c.cb)e+=String.fromCharCode.apply(null,d.subarray(f,f+c.cb));return e}}(b);return null});function tc(){}function uc(a){a=nc(fc(a));return btoa(a)}function vc(a,b){b=void 0==b?!0:b;var c=uc(a).replace(/\+/g,"-").replace(/\//g,"_");return b?c:c.replace(/[=]*$/,"")}function wc(a){var b=window.atob(a.replace(/-/g,"+").replace(/_/g,"/"));a=new Uint8Array(b.length);b=q(kb(b));for(var c=b.next();!c.done;c=b.next())c=c.value,a[c.na]=c.item.charCodeAt(0);return a}
function xc(a){var b=a.length/2,c=new Uint8Array(b);b=q(ib(b));for(var d=b.next();!d.done;d=b.next())d=d.value,c[d]=window.parseInt(a.substr(2*d,2),16);return c}function yc(a){var b=fc(a);a="";b=q(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 zc(a){for(var b=[],c=0;c<arguments.length;++c)b[c]=arguments[c];var d=0,e=q(b);for(c=e.next();!c.done;c=e.next())d+=c.value.byteLength;d=new Uint8Array(d);e=0;b=q(b);for(c=b.next();!c.done;c=b.next())c=c.value,d.set(fc(c),e),e+=c.byteLength;return d}L("shaka.util.Uint8ArrayUtils",tc);tc.concat=zc;tc.toHex=yc;tc.fromHex=xc;tc.fromBase64=wc;tc.toBase64=vc;tc.toStandardBase64=uc;
tc.equal=function(a,b){Ab("shaka.util.Uint8ArrayUtils.equal","Please use shaka.util.BufferUtils.equal instead.");return dc(a,b)};function Ac(){var a=this;this.a=new muxjs.mp4.Transmuxer({keepOriginalTimestamps:!0});this.b=null;this.l=[];this.c=[];this.g=[];this.f=!1;this.a.on("data",function(b){a.c=b.captions;a.g=b.metadata;a.l.push(zc(b.initSegment,b.data))});this.a.on("done",function(){var b={data:zc.apply(tc,ja(a.l)),captions:a.c,metadata:a.g};a.b.resolve(b);a.f=!1})}Ac.prototype.destroy=function(){this.a.dispose();this.a=null;return Promise.resolve()};
function Bc(a,b){if(!window.muxjs||"mp2t"!=a.toLowerCase().split(";")[0].split("/")[1])return!1;if(b)return MediaSource.isTypeSupported(Cc(b,a));var c=Cc("audio",a),d=Cc("video",a);return MediaSource.isTypeSupported(c)||MediaSource.isTypeSupported(d)}
function Cc(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 Dc(a,b){a.f=!0;a.b=new jc;a.l=[];a.c=[];a.g=[];var c=fc(b);a.a.push(c);a.a.flush();a.f&&a.b.reject(new N(2,3,3018));return a.b};function Ec(a){this.b=a;this.a=null}Ec.prototype.P=function(a){var b=this;this.stop();var c=!0,d=null;this.a=function(){window.clearTimeout(d);c=!1};d=window.setTimeout(function(){c&&b.b()},1E3*a);return this};Ec.prototype.stop=function(){this.a&&(this.a(),this.a=null)};function O(a){this.b=a;this.a=null}O.prototype.va=function(){this.stop();this.b();return this};O.prototype.P=function(a){var b=this;this.stop();this.a=(new Ec(function(){b.b()})).P(a);return this};O.prototype.Z=function(a){var b=this;this.stop();this.a=(new Ec(function(){b.a.P(a);b.b()})).P(a);return this};O.prototype.stop=function(){this.a&&(this.a.stop(),this.a=null)};L("shaka.util.Timer",O);O.prototype.stop=O.prototype.stop;O.prototype.tickEvery=O.prototype.Z;O.prototype.tickAfter=O.prototype.P;
O.prototype.tickNow=O.prototype.va;function Fc(a,b){var c=Gc();this.o=null==a.maxAttempts?c.maxAttempts:a.maxAttempts;this.f=null==a.baseDelay?c.baseDelay:a.baseDelay;this.l=null==a.fuzzFactor?c.fuzzFactor:a.fuzzFactor;this.g=null==a.backoffFactor?c.backoffFactor:a.backoffFactor;this.a=0;this.b=this.f;if(this.c=void 0===b?!1:b)this.a=1}
function Hc(a){var b,c;return H(function(d){if(1==d.a){if(a.a>=a.o)if(a.c)a.a=1,a.b=a.f;else throw new N(2,7,1010);b=a.a;a.a++;if(0==b)return d["return"]();c=a.b*(1+(2*Math.random()-1)*a.l);return w(d,new Promise(function(e){(new O(e)).P(c/1E3)}),2)}a.b*=a.g;x(d)})}function Gc(){return{maxAttempts:2,baseDelay:1E3,backoffFactor:2,fuzzFactor:.5,timeout:0}};function Ic(a,b){this.promise=a;this.c=b;this.a=!1}function Jc(a){return new Ic(Promise.reject(a),function(){return Promise.resolve()})}function Kc(){var a=Promise.reject(new N(2,7,7001));a["catch"](function(){});return new Ic(a,function(){return Promise.resolve()})}function Lc(a){return new Ic(Promise.resolve(a),function(){return Promise.resolve()})}function Mc(a){return new Ic(a,function(){return a["catch"](function(){})})}Ic.prototype.abort=function(){this.a=!0;return this.c()};
function Nc(a){return new Ic(Promise.all(a.map(function(b){return b.promise})),function(){return Promise.all(a.map(function(b){return b.abort()}))})}Ic.prototype["finally"]=function(a){this.promise.then(function(){return a(!0)},function(){return a(!1)});return this};
Ic.prototype.aa=function(a,b){function c(h){return function(k){if(e.a&&h)f.reject(g);else{var l=h?a:b;l?d=Oc(l,k,f):(h?f.resolve:f.reject)(k)}}}function d(){f.reject(g);return e.abort()}var e=this,f=new jc,g=new N(2,7,7001);this.promise.then(c(!0),c(!1));return new Ic(f,function(){return d()})};
function Oc(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()}}}L("shaka.util.AbortableOperation",Ic);Ic.prototype.chain=Ic.prototype.aa;Ic.prototype["finally"]=Ic.prototype["finally"];Ic.all=Nc;Ic.prototype.abort=Ic.prototype.abort;Ic.notAbortable=Mc;Ic.completed=Lc;Ic.aborted=Kc;Ic.failed=Jc;function Pc(a){function b(d){switch(typeof d){case "undefined":case "boolean":case "number":case "string":case "symbol":case "function":return d;default:if(!d||d.buffer&&d.buffer.constructor==ArrayBuffer)return d;if(c.has(d))return null;var e=d.constructor==Array;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 Set;return b(a)}function Qc(a){var b={},c;for(c in a)b[c]=a[c];return b};function Rc(a,b){return"number"===typeof a&&"number"===typeof b&&isNaN(a)&&isNaN(b)?!0:a===b}function Sc(a,b){var c=a.indexOf(b);-1<c&&a.splice(c,1)}function Tc(a,b,c){c||(c=Rc);if(a.length!=b.length)return!1;b=b.slice();var d={};a=q(a);for(var e=a.next();!e.done;d={nd:d.nd},e=a.next()){d.nd=e.value;e=b.findIndex(function(f){return function(g){return c(f.nd,g)}}(d));if(-1==e)return!1;b[e]=b[b.length-1];b.pop()}return 0==b.length}
function Uc(a,b,c){c||(c=Rc);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 Vc(){this.a=[]}function Wc(a,b){a.a.push(b["finally"](function(){Sc(a.a,b)}))}Vc.prototype.destroy=function(){for(var a=[],b=q(this.a),c=b.next();!c.done;c=b.next())c=c.value,c.promise["catch"](function(){}),a.push(c.abort());this.a=[];return Promise.all(a)};function Xc(a){cb.call(this);this.f=!1;this.g=new Vc;this.a=new Set;this.b=new Set;this.c=a||null}u(Xc,cb);function Yc(a,b,c){c=c||Zc;var d=$c[a];if(!d||c>=d.priority)$c[a]={priority:c,Uf:b}}p=Xc.prototype;p.Wf=function(a){this.a.add(a)};p.ng=function(a){this.a["delete"](a)};p.$e=function(){this.a.clear()};p.Xf=function(a){this.b.add(a)};p.og=function(a){this.b["delete"](a)};p.bf=function(){this.b.clear()};
function ad(a,b){return{uris:a,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:b,licenseRequestType:null,sessionId:null}}p.destroy=function(){this.f=!0;this.a.clear();this.b.clear();return this.g.destroy()};
p.request=function(a,b){var c=this,d=new bd;if(this.f){var e=Promise.reject(new N(2,7,7001));e["catch"](function(){});return new cd(e,function(){return Promise.resolve()},d)}b.method=b.method||"GET";b.headers=b.headers||{};b.retryParameters=b.retryParameters?Pc(b.retryParameters):Gc();b.uris=Pc(b.uris);e=dd(this,a,b);var f=e.aa(function(){return ed(c,a,b,new Fc(b.retryParameters,!1),0,null,d)}),g=f.aa(function(n){return fd(c,a,n)}),h=Date.now(),k=0;e.promise.then(function(){k=Date.now()-h},function(){});
var l=0;f.promise.then(function(){l=Date.now()},function(){});var m=g.aa(function(n){var r=Date.now()-l,t=n.response;t.timeMs+=k;t.timeMs+=r;n.Jf||!c.c||t.fromCache||a!=gd||c.c(t.timeMs,t.data.byteLength);return t},function(n){n&&(n.severity=2);throw n;});e=new cd(m.promise,function(){return m.abort()},d);Wc(this.g,e);return e};
function dd(a,b,c){var d=Lc(void 0),e={};a=q(a.a);for(var f=a.next();!f.done;e={rd:e.rd},f=a.next())e.rd=f.value,d=d.aa(function(g){return function(){c.body&&(c.body=gc(c.body));return g.rd(b,c)}}(e));return d.aa(void 0,function(g){if(g instanceof N&&7001==g.code)throw g;throw new N(2,1,1006,g);})}
function ed(a,b,c,d,e,f,g){var h=new mb(c.uris[e]),k=h.Na,l=!1;k||(k=location.protocol,k=k.slice(0,-1),nb(h,k),c.uris[e]=h.toString());k=k.toLowerCase();var m=(k=$c[k])?k.Uf:null;if(!m)return Jc(new N(2,1,1E3,h));var n;return Mc(Hc(d)).aa(function(){if(a.f)return Kc();n=Date.now();return m(c.uris[e],c,b,function(r,t,v){a.c&&b==gd&&(a.c(r,t),l=!0,g.a=v)})}).aa(function(r){void 0==r.timeMs&&(r.timeMs=Date.now()-n);return{response:r,Jf:l}},function(r){if(a.f)return Kc();if(r instanceof N){if(7001==r.code)throw r;
if(1010==r.code)throw f;if(1==r.severity){var t=new M("retry",{error:r});a.dispatchEvent(t);e=(e+1)%c.uris.length;return ed(a,b,c,d,e,r,g)}}throw r;})}
function fd(a,b,c){var d=Lc(void 0),e={};a=q(a.b);for(var f=a.next();!f.done;e={sd:e.sd},f=a.next())e.sd=f.value,d=d.aa(function(g){return function(){var h=c.response;h.data&&(h.data=gc(h.data));return g.sd(b,h)}}(e));return d.aa(function(){return c},function(g){var h=2;if(g instanceof N){if(7001==g.code)throw g;h=g.severity}throw new N(h,1,1007,g);})}L("shaka.net.NetworkingEngine",Xc);Xc.prototype.request=Xc.prototype.request;Xc.prototype.destroy=Xc.prototype.destroy;Xc.makeRequest=ad;
Xc.defaultRetryParameters=function(){return Gc()};Xc.prototype.clearAllResponseFilters=Xc.prototype.bf;Xc.prototype.unregisterResponseFilter=Xc.prototype.og;Xc.prototype.registerResponseFilter=Xc.prototype.Xf;Xc.prototype.clearAllRequestFilters=Xc.prototype.$e;Xc.prototype.unregisterRequestFilter=Xc.prototype.ng;Xc.prototype.registerRequestFilter=Xc.prototype.Wf;Xc.unregisterScheme=function(a){delete $c[a]};Xc.registerScheme=Yc;function bd(){this.a=0}Xc.NumBytesRemainingClass=bd;
function cd(a,b,c){Ic.call(this,a,b);this.b=c}u(cd,Ic);Xc.PendingRequest=cd;var gd=1;Xc.RequestType={MANIFEST:0,SEGMENT:gd,LICENSE:2,APP:3,TIMING:4};var Zc=3;Xc.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:Zc};var $c={};function hd(a){this.a=!1;this.b=new jc;this.c=a}hd.prototype.destroy=function(){var a=this;if(this.a)return this.b;this.a=!0;return this.c().then(function(){a.b.resolve()},function(){a.b.resolve()})};function id(a,b){if(a.a){if(b instanceof N&&7003==b.code)throw b;throw new N(2,7,7003,b);}};function jd(){this.a=new Za}p=jd.prototype;p.release=function(){this.Ab();this.a=null};p.h=function(a,b,c,d){this.a&&(a=new kd(a,b,c,d),this.a.push(b,a))};p.za=function(a,b,c,d){function e(g){f.Da(a,b,e);c(g)}var f=this;this.h(a,b,e,d)};p.Da=function(a,b,c){if(this.a){var d=this.a.get(b)||[];d=q(d);for(var e=d.next();!e.done;e=d.next())e=e.value,e.target!=a||c!=e.listener&&c||(e.Da(),this.a.remove(b,e))}};
p.Ab=function(){if(this.a){var a=this.a,b=[],c;for(c in a.a)b.push.apply(b,ja(a.a[c]));a=q(b);for(b=a.next();!b.done;b=a.next())b.value.Da();this.a.a={}}};L("shaka.util.EventManager",jd);jd.prototype.removeAll=jd.prototype.Ab;jd.prototype.unlisten=jd.prototype.Da;jd.prototype.listenOnce=jd.prototype.za;jd.prototype.listen=jd.prototype.h;jd.prototype.release=jd.prototype.release;function kd(a,b,c,d){this.target=a;this.type=b;this.listener=c;this.a=ld(a,d);this.target.addEventListener(b,c,this.a)}
kd.prototype.Da=function(){this.target.removeEventListener(this.type,this.listener,this.a);this.listener=this.target=null;this.a=!1};function ld(a,b){if(void 0==b)return!1;if("boolean"==typeof b)return b;var c=new Set(["passive","capture"]);Object.keys(b).filter(function(d){return!c.has(d)});return md(a)?b:b.capture||!1}
function md(a){var b=nd;if(void 0==b){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}nd=b}return b||!1}var nd=void 0;function od(){}function pd(a){a=pc(a);return(new mb(a)).Ma}function qd(a,b,c){function d(h){ic(f).setUint32(g,h.byteLength,!0);g+=4;f.set(fc(h),g);g+=h.byteLength}if(!c||!c.byteLength)throw new N(2,6,6015);var e;"string"==typeof b?e=rc(b,!0):e=b;a=pc(a);a=rc(a,!0);var f=new Uint8Array(12+a.byteLength+e.byteLength+c.byteLength),g=0;d(a);d(e);d(c);return f}L("shaka.util.FairPlayUtils",od);od.initDataTransform=qd;od.defaultGetContentId=pd;function rd(a){for(var b=new Map,c=q(Object.keys(a)),d=c.next();!d.done;d=c.next())d=d.value,b.set(d,a[d]);return b}function sd(a){var b={};a.forEach(function(c,d){b[d]=c});return b}function td(a,b){if(a||b){if(a&&!b||b&&!a)return!1}else return!0;if(a.size!=b.size)return!1;for(var c=q(a),d=c.next();!d.done;d=c.next()){var e=q(d.value);d=e.next().value;e=e.next().value;if(!b.has(d))return!1;d=b.get(d);if(d!=e||void 0==d)return!1}return!0};function ud(a,b){var c=a;b&&(c+='; codecs="'+b+'"');return c}function vd(a){var b=[a.mimeType];wd.forEach(function(c,d){var e=a[d];e&&b.push(c+'="'+e+'"')});return b.join(";")}function xd(a){a=a.split(".");var b=a[0];a.pop();return b}var wd=(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");function yd(){return window.MediaSource&&MediaSource.isTypeSupported?!0:!1}function zd(a){return""!=Ad().canPlayType(a)}function Bd(){