diff options
author | Anton Schubert | 2020-06-05 20:41:25 +0200 |
---|---|---|
committer | Anton Schubert | 2020-06-05 20:41:32 +0200 |
commit | 5da35b82a29604778d410bf569c55304a1a64a24 (patch) | |
tree | 28c1489e844a1563f720033f989941882980cb52 /assets/voc-player/player.js | |
parent | 1ee296bcba4f37775206208af0fa65d6886554e2 (diff) |
Pass stream language as preferred language to voc-player
This allows setting a preferred language in embeds e.g. with
/embed/stream/dash/translated to start off with a different audio lang
than native
Diffstat (limited to 'assets/voc-player/player.js')
-rw-r--r-- | assets/voc-player/player.js | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/assets/voc-player/player.js b/assets/voc-player/player.js index 6615d1f..e6b2d0f 100644 --- a/assets/voc-player/player.js +++ b/assets/voc-player/player.js @@ -74,7 +74,7 @@ /*!********************************************!*\ !*** ./node_modules/clappr-zepto/zepto.js ***! \********************************************/ -/*! no static exports found */function(e,t){var r,n=function(){var e,t,r,n,i,o=[],a=o.concat,s=o.filter,l=o.slice,u=window.document,c={},d={},f={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},h=/^\s*<(\w+|!)[^>]*>/,p=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,m=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,g=/^(?:body|html)$/i,y=/([A-Z])/g,v=["val","css","html","text","data","width","height","offset"],b=u.createElement("table"),_=u.createElement("tr"),A={tr:u.createElement("tbody"),tbody:b,thead:b,tfoot:b,td:_,th:_,"*":u.createElement("div")},E=/complete|loaded|interactive/,T=/^[\w-]*$/,S={},w=S.toString,k={},x=u.createElement("div"),C={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},R=Array.isArray||function(e){return e instanceof Array};function L(e){return null==e?String(e):S[w.call(e)]||"object"}function j(e){return"function"==L(e)}function P(e){return null!=e&&e==e.window}function I(e){return null!=e&&e.nodeType==e.DOCUMENT_NODE}function O(e){return"object"==L(e)}function D(e){return O(e)&&!P(e)&&Object.getPrototypeOf(e)==Object.prototype}function M(e){var r=!!e&&"length"in e&&e.length,n=t.type(e);return"function"!=n&&!P(e)&&("array"==n||0===r||"number"==typeof r&&r>0&&r-1 in e)}function N(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function U(e){return e in d?d[e]:d[e]=new RegExp("(^|\\s)"+e+"(\\s|$)")}function F(e,t){return"number"!=typeof t||f[N(e)]?t:t+"px"}function B(e){return"children"in e?l.call(e.children):t.map(e.childNodes,(function(e){if(1==e.nodeType)return e}))}function K(e,t){var r,n=e?e.length:0;for(r=0;r<n;r++)this[r]=e[r];this.length=n,this.selector=t||""}function G(t,r,n){for(e in r)n&&(D(r[e])||R(r[e]))?(D(r[e])&&!D(t[e])&&(t[e]={}),R(r[e])&&!R(t[e])&&(t[e]=[]),G(t[e],r[e],n)):void 0!==r[e]&&(t[e]=r[e])}function V(e,r){return null==r?t(e):t(e).filter(r)}function H(e,t,r,n){return j(t)?t.call(e,r,n):t}function Y(e,t,r){null==r?e.removeAttribute(t):e.setAttribute(t,r)}function z(e,t){var r=e.className||"",n=r&&void 0!==r.baseVal;if(void 0===t)return n?r.baseVal:r;n?r.baseVal=t:e.className=t}function W(e){try{return e?"true"==e||"false"!=e&&("null"==e?null:+e+""==e?+e:/^[\[\{]/.test(e)?t.parseJSON(e):e):e}catch(t){return e}}function $(e,t){t(e);for(var r=0,n=e.childNodes.length;r<n;r++)$(e.childNodes[r],t)}return k.matches=function(e,t){if(!t||!e||1!==e.nodeType)return!1;var r=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.matchesSelector;if(r)return r.call(e,t);var n,i=e.parentNode,o=!i;return o&&(i=x).appendChild(e),n=~k.qsa(i,t).indexOf(e),o&&x.removeChild(e),n},n=function(e){return e.replace(/-+(.)?/g,(function(e,t){return t?t.toUpperCase():""}))},i=function(e){return s.call(e,(function(t,r){return e.indexOf(t)==r}))},k.fragment=function(e,r,n){var i,o,a;return p.test(e)&&(i=t(u.createElement(RegExp.$1))),i||(e.replace&&(e=e.replace(m,"<$1></$2>")),void 0===r&&(r=h.test(e)&&RegExp.$1),r in A||(r="*"),(a=A[r]).innerHTML=""+e,i=t.each(l.call(a.childNodes),(function(){a.removeChild(this)}))),D(n)&&(o=t(i),t.each(n,(function(e,t){v.indexOf(e)>-1?o[e](t):o.attr(e,t)}))),i},k.Z=function(e,t){return new K(e,t)},k.isZ=function(e){return e instanceof k.Z},k.init=function(e,r){var n,i;if(!e)return k.Z();if("string"==typeof e)if("<"==(e=e.trim())[0]&&h.test(e))n=k.fragment(e,RegExp.$1,r),e=null;else{if(void 0!==r)return t(r).find(e);n=k.qsa(u,e)}else{if(j(e))return t(u).ready(e);if(k.isZ(e))return e;if(R(e))i=e,n=s.call(i,(function(e){return null!=e}));else if(O(e))n=[e],e=null;else if(h.test(e))n=k.fragment(e.trim(),RegExp.$1,r),e=null;else{if(void 0!==r)return t(r).find(e);n=k.qsa(u,e)}}return k.Z(n,e)},(t=function(e,t){return k.init(e,t)}).extend=function(e){var t,r=l.call(arguments,1);return"boolean"==typeof e&&(t=e,e=r.shift()),r.forEach((function(r){G(e,r,t)})),e},k.qsa=function(e,t){var r,n="#"==t[0],i=!n&&"."==t[0],o=n||i?t.slice(1):t,a=T.test(o);return e.getElementById&&a&&n?(r=e.getElementById(o))?[r]:[]:1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType?[]:l.call(a&&!n&&e.getElementsByClassName?i?e.getElementsByClassName(o):e.getElementsByTagName(t):e.querySelectorAll(t))},t.contains=u.documentElement.contains?function(e,t){return e!==t&&e.contains(t)}:function(e,t){for(;t&&(t=t.parentNode);)if(t===e)return!0;return!1},t.type=L,t.isFunction=j,t.isWindow=P,t.isArray=R,t.isPlainObject=D,t.isEmptyObject=function(e){var t;for(t in e)return!1;return!0},t.isNumeric=function(e){var t=Number(e),r=typeof e;return null!=e&&"boolean"!=r&&("string"!=r||e.length)&&!isNaN(t)&&isFinite(t)||!1},t.inArray=function(e,t,r){return o.indexOf.call(t,e,r)},t.camelCase=n,t.trim=function(e){return null==e?"":String.prototype.trim.call(e)},t.uuid=0,t.support={},t.expr={},t.noop=function(){},t.map=function(e,r){var n,i,o,a,s=[];if(M(e))for(i=0;i<e.length;i++)null!=(n=r(e[i],i))&&s.push(n);else for(o in e)null!=(n=r(e[o],o))&&s.push(n);return(a=s).length>0?t.fn.concat.apply([],a):a},t.each=function(e,t){var r,n;if(M(e)){for(r=0;r<e.length;r++)if(!1===t.call(e[r],r,e[r]))return e}else for(n in e)if(!1===t.call(e[n],n,e[n]))return e;return e},t.grep=function(e,t){return s.call(e,t)},window.JSON&&(t.parseJSON=JSON.parse),t.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),(function(e,t){S["[object "+t+"]"]=t.toLowerCase()})),t.fn={constructor:k.Z,length:0,forEach:o.forEach,reduce:o.reduce,push:o.push,sort:o.sort,splice:o.splice,indexOf:o.indexOf,concat:function(){var e,t,r=[];for(e=0;e<arguments.length;e++)t=arguments[e],r[e]=k.isZ(t)?t.toArray():t;return a.apply(k.isZ(this)?this.toArray():this,r)},map:function(e){return t(t.map(this,(function(t,r){return e.call(t,r,t)})))},slice:function(){return t(l.apply(this,arguments))},ready:function(e){return E.test(u.readyState)&&u.body?e(t):u.addEventListener("DOMContentLoaded",(function(){e(t)}),!1),this},get:function(e){return void 0===e?l.call(this):this[e>=0?e:e+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each((function(){null!=this.parentNode&&this.parentNode.removeChild(this)}))},each:function(e){return o.every.call(this,(function(t,r){return!1!==e.call(t,r,t)})),this},filter:function(e){return j(e)?this.not(this.not(e)):t(s.call(this,(function(t){return k.matches(t,e)})))},add:function(e,r){return t(i(this.concat(t(e,r))))},is:function(e){return this.length>0&&k.matches(this[0],e)},not:function(e){var r=[];if(j(e)&&void 0!==e.call)this.each((function(t){e.call(this,t)||r.push(this)}));else{var n="string"==typeof e?this.filter(e):M(e)&&j(e.item)?l.call(e):t(e);this.forEach((function(e){n.indexOf(e)<0&&r.push(e)}))}return t(r)},has:function(e){return this.filter((function(){return O(e)?t.contains(this,e):t(this).find(e).size()}))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){var e=this[0];return e&&!O(e)?e:t(e)},last:function(){var e=this[this.length-1];return e&&!O(e)?e:t(e)},find:function(e){var r=this;return e?"object"==typeof e?t(e).filter((function(){var e=this;return o.some.call(r,(function(r){return t.contains(r,e)}))})):1==this.length?t(k.qsa(this[0],e)):this.map((function(){return k.qsa(this,e)})):t()},closest:function(e,r){var n=[],i="object"==typeof e&&t(e);return this.each((function(t,o){for(;o&&!(i?i.indexOf(o)>=0:k.matches(o,e));)o=o!==r&&!I(o)&&o.parentNode;o&&n.indexOf(o)<0&&n.push(o)})),t(n)},parents:function(e){for(var r=[],n=this;n.length>0;)n=t.map(n,(function(e){if((e=e.parentNode)&&!I(e)&&r.indexOf(e)<0)return r.push(e),e}));return V(r,e)},parent:function(e){return V(i(this.pluck("parentNode")),e)},children:function(e){return V(this.map((function(){return B(this)})),e)},contents:function(){return this.map((function(){return this.contentDocument||l.call(this.childNodes)}))},siblings:function(e){return V(this.map((function(e,t){return s.call(B(t.parentNode),(function(e){return e!==t}))})),e)},empty:function(){return this.each((function(){this.innerHTML=""}))},pluck:function(e){return t.map(this,(function(t){return t[e]}))},show:function(){return this.each((function(){var e,t,r;"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=(e=this.nodeName,c[e]||(t=u.createElement(e),u.body.appendChild(t),r=getComputedStyle(t,"").getPropertyValue("display"),t.parentNode.removeChild(t),"none"==r&&(r="block"),c[e]=r),c[e]))}))},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){var r=j(e);if(this[0]&&!r)var n=t(e).get(0),i=n.parentNode||this.length>1;return this.each((function(o){t(this).wrapAll(r?e.call(this,o):i?n.cloneNode(!0):n)}))},wrapAll:function(e){if(this[0]){var r;for(t(this[0]).before(e=t(e));(r=e.children()).length;)e=r.first();t(e).append(this)}return this},wrapInner:function(e){var r=j(e);return this.each((function(n){var i=t(this),o=i.contents(),a=r?e.call(this,n):e;o.length?o.wrapAll(a):i.append(a)}))},unwrap:function(){return this.parent().each((function(){t(this).replaceWith(t(this).children())})),this},clone:function(){return this.map((function(){return this.cloneNode(!0)}))},hide:function(){return this.css("display","none")},toggle:function(e){return this.each((function(){var r=t(this);(void 0===e?"none"==r.css("display"):e)?r.show():r.hide()}))},prev:function(e){return t(this.pluck("previousElementSibling")).filter(e||"*")},next:function(e){return t(this.pluck("nextElementSibling")).filter(e||"*")},html:function(e){return 0 in arguments?this.each((function(r){var n=this.innerHTML;t(this).empty().append(H(this,e,r,n))})):0 in this?this[0].innerHTML:null},text:function(e){return 0 in arguments?this.each((function(t){var r=H(this,e,t,this.textContent);this.textContent=null==r?"":""+r})):0 in this?this.pluck("textContent").join(""):null},attr:function(t,r){var n;return"string"!=typeof t||1 in arguments?this.each((function(n){if(1===this.nodeType)if(O(t))for(e in t)Y(this,e,t[e]);else Y(this,t,H(this,r,n,this.getAttribute(t)))})):0 in this&&1==this[0].nodeType&&null!=(n=this[0].getAttribute(t))?n:void 0},removeAttr:function(e){return this.each((function(){1===this.nodeType&&e.split(" ").forEach((function(e){Y(this,e)}),this)}))},prop:function(e,t){return e=C[e]||e,1 in arguments?this.each((function(r){this[e]=H(this,t,r,this[e])})):this[0]&&this[0][e]},removeProp:function(e){return e=C[e]||e,this.each((function(){delete this[e]}))},data:function(e,t){var r="data-"+e.replace(y,"-$1").toLowerCase(),n=1 in arguments?this.attr(r,t):this.attr(r);return null!==n?W(n):void 0},val:function(e){return 0 in arguments?(null==e&&(e=""),this.each((function(t){this.value=H(this,e,t,this.value)}))):this[0]&&(this[0].multiple?t(this[0]).find("option").filter((function(){return this.selected})).pluck("value"):this[0].value)},offset:function(e){if(e)return this.each((function(r){var n=t(this),i=H(this,e,r,n.offset()),o=n.offsetParent().offset(),a={top:i.top-o.top,left:i.left-o.left};"static"==n.css("position")&&(a.position="relative"),n.css(a)}));if(!this.length)return null;if(u.documentElement!==this[0]&&!t.contains(u.documentElement,this[0]))return{top:0,left:0};var r=this[0].getBoundingClientRect();return{left:r.left+window.pageXOffset,top:r.top+window.pageYOffset,width:Math.round(r.width),height:Math.round(r.height)}},css:function(r,i){if(arguments.length<2){var o=this[0];if("string"==typeof r){if(!o)return;return o.style[n(r)]||getComputedStyle(o,"").getPropertyValue(r)}if(R(r)){if(!o)return;var a={},s=getComputedStyle(o,"");return t.each(r,(function(e,t){a[t]=o.style[n(t)]||s.getPropertyValue(t)})),a}}var l="";if("string"==L(r))i||0===i?l=N(r)+":"+F(r,i):this.each((function(){this.style.removeProperty(N(r))}));else for(e in r)r[e]||0===r[e]?l+=N(e)+":"+F(e,r[e])+";":this.each((function(){this.style.removeProperty(N(e))}));return this.each((function(){this.style.cssText+=";"+l}))},index:function(e){return e?this.indexOf(t(e)[0]):this.parent().children().indexOf(this[0])},hasClass:function(e){return!!e&&o.some.call(this,(function(e){return this.test(z(e))}),U(e))},addClass:function(e){return e?this.each((function(n){if("className"in this){r=[];var i=z(this);H(this,e,n,i).split(/\s+/g).forEach((function(e){t(this).hasClass(e)||r.push(e)}),this),r.length&&z(this,i+(i?" ":"")+r.join(" "))}})):this},removeClass:function(e){return this.each((function(t){if("className"in this){if(void 0===e)return z(this,"");r=z(this),H(this,e,t,r).split(/\s+/g).forEach((function(e){r=r.replace(U(e)," ")})),z(this,r.trim())}}))},toggleClass:function(e,r){return e?this.each((function(n){var i=t(this);H(this,e,n,z(this)).split(/\s+/g).forEach((function(e){(void 0===r?!i.hasClass(e):r)?i.addClass(e):i.removeClass(e)}))})):this},scrollTop:function(e){if(this.length){var t="scrollTop"in this[0];return void 0===e?t?this[0].scrollTop:this[0].pageYOffset:this.each(t?function(){this.scrollTop=e}:function(){this.scrollTo(this.scrollX,e)})}},scrollLeft:function(e){if(this.length){var t="scrollLeft"in this[0];return void 0===e?t?this[0].scrollLeft:this[0].pageXOffset:this.each(t?function(){this.scrollLeft=e}:function(){this.scrollTo(e,this.scrollY)})}},position:function(){if(this.length){var e=this[0],r=this.offsetParent(),n=this.offset(),i=g.test(r[0].nodeName)?{top:0,left:0}:r.offset();return n.top-=parseFloat(t(e).css("margin-top"))||0,n.left-=parseFloat(t(e).css("margin-left"))||0,i.top+=parseFloat(t(r[0]).css("border-top-width"))||0,i.left+=parseFloat(t(r[0]).css("border-left-width"))||0,{top:n.top-i.top,left:n.left-i.left}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent||u.body;e&&!g.test(e.nodeName)&&"static"==t(e).css("position");)e=e.offsetParent;return e}))}},t.fn.detach=t.fn.remove,["width","height"].forEach((function(e){var r=e.replace(/./,(function(e){return e[0].toUpperCase()}));t.fn[e]=function(n){var i,o=this[0];return void 0===n?P(o)?o["inner"+r]:I(o)?o.documentElement["scroll"+r]:(i=this.offset())&&i[e]:this.each((function(r){(o=t(this)).css(e,H(this,n,r,o[e]()))}))}})),["after","prepend","before","append"].forEach((function(e,r){var n=r%2;t.fn[e]=function(){var e,i,o=t.map(arguments,(function(r){var n=[];return"array"==(e=L(r))?(r.forEach((function(e){return void 0!==e.nodeType?n.push(e):t.zepto.isZ(e)?n=n.concat(e.get()):void(n=n.concat(k.fragment(e)))})),n):"object"==e||null==r?r:k.fragment(r)})),a=this.length>1;return o.length<1?this:this.each((function(e,s){i=n?s:s.parentNode,s=0==r?s.nextSibling:1==r?s.firstChild:2==r?s:null;var l=t.contains(u.documentElement,i);o.forEach((function(e){if(a)e=e.cloneNode(!0);else if(!i)return t(e).remove();i.insertBefore(e,s),l&&$(e,(function(e){if(!(null==e.nodeName||"SCRIPT"!==e.nodeName.toUpperCase()||e.type&&"text/javascript"!==e.type||e.src)){var t=e.ownerDocument?e.ownerDocument.defaultView:window;t.eval.call(t,e.innerHTML)}}))}))}))},t.fn[n?e+"To":"insert"+(r?"Before":"After")]=function(r){return t(r)[e](this),this}})),k.Z.prototype=K.prototype=t.fn,k.uniq=i,k.deserializeValue=W,t.zepto=k,t}();window.Zepto=n,void 0===window.$&&(window.$=n),function(e){var t,r,n=+new Date,i=window.document,o=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,a=/^(?:text|application)\/javascript/i,s=/^(?:text|application)\/xml/i,l=/^\s*$/,u=i.createElement("a");function c(t,r,n,o){if(t.global)return function(t,r,n){var i=e.Event(r);return e(t).trigger(i,n),!i.isDefaultPrevented()}(r||i,n,o)}function d(e,t){var r=t.context;if(!1===t.beforeSend.call(r,e,t)||!1===c(t,r,"ajaxBeforeSend",[e,t]))return!1;c(t,r,"ajaxSend",[e,t])}function f(e,t,r,n){var i=r.context;r.success.call(i,e,"success",t),n&&n.resolveWith(i,[e,"success",t]),c(r,i,"ajaxSuccess",[t,r,e]),p("success",t,r)}function h(e,t,r,n,i){var o=n.context;n.error.call(o,r,t,e),i&&i.rejectWith(o,[r,t,e]),c(n,o,"ajaxError",[r,n,e||t]),p(t,r,n)}function p(t,r,n){var i=n.context;n.complete.call(i,r,t),c(n,i,"ajaxComplete",[r,n]),function(t){t.global&&!--e.active&&c(t,null,"ajaxStop")}(n)}function m(){}function g(e,t){return""==t?e:(e+"&"+t).replace(/[&?]{1,2}/,"?")}function y(t,r,n,i){return e.isFunction(r)&&(i=n,n=r,r=void 0),e.isFunction(n)||(i=n,n=void 0),{url:t,data:r,success:n,dataType:i}}u.href=window.location.href,e.active=0,e.ajaxJSONP=function(t,r){if(!("type"in t))return e.ajax(t);var o,a,s=t.jsonpCallback,l=(e.isFunction(s)?s():s)||"Zepto"+n++,u=i.createElement("script"),c=window[l],p=function(t){e(u).triggerHandler("error",t||"abort")},m={abort:p};return r&&r.promise(m),e(u).on("load error",(function(n,i){clearTimeout(a),e(u).off().remove(),"error"!=n.type&&o?f(o[0],m,t,r):h(null,i||"error",m,t,r),window[l]=c,o&&e.isFunction(c)&&c(o[0]),c=o=void 0})),!1===d(m,t)?(p("abort"),m):(window[l]=function(){o=arguments},u.src=t.url.replace(/\?(.+)=\?/,"?$1="+l),i.head.appendChild(u),t.timeout>0&&(a=setTimeout((function(){p("timeout")}),t.timeout)),m)},e.ajaxSettings={type:"GET",beforeSend:m,success:m,error:m,complete:m,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:"application/json",xml:"application/xml, text/xml",html:"text/html",text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:m},e.ajax=function(n){var o,p,y=e.extend({},n||{}),v=e.Deferred&&e.Deferred();for(t in e.ajaxSettings)void 0===y[t]&&(y[t]=e.ajaxSettings[t]);!function(t){t.global&&0==e.active++&&c(t,null,"ajaxStart")}(y),y.crossDomain||((o=i.createElement("a")).href=y.url,o.href=o.href,y.crossDomain=u.protocol+"//"+u.host!=o.protocol+"//"+o.host),y.url||(y.url=window.location.toString()),(p=y.url.indexOf("#"))>-1&&(y.url=y.url.slice(0,p)),function(t){t.processData&&t.data&&"string"!=e.type(t.data)&&(t.data=e.param(t.data,t.traditional)),!t.data||t.type&&"GET"!=t.type.toUpperCase()&&"jsonp"!=t.dataType||(t.url=g(t.url,t.data),t.data=void 0)}(y);var b=y.dataType,_=/\?.+=\?/.test(y.url);if(_&&(b="jsonp"),!1!==y.cache&&(n&&!0===n.cache||"script"!=b&&"jsonp"!=b)||(y.url=g(y.url,"_="+Date.now())),"jsonp"==b)return _||(y.url=g(y.url,y.jsonp?y.jsonp+"=?":!1===y.jsonp?"":"callback=?")),e.ajaxJSONP(y,v);var A,E=y.accepts[b],T={},S=function(e,t){T[e.toLowerCase()]=[e,t]},w=/^([\w-]+:)\/\//.test(y.url)?RegExp.$1:window.location.protocol,k=y.xhr(),x=k.setRequestHeader;if(v&&v.promise(k),y.crossDomain||S("X-Requested-With","XMLHttpRequest"),S("Accept",E||"*/*"),(E=y.mimeType||E)&&(E.indexOf(",")>-1&&(E=E.split(",",2)[0]),k.overrideMimeType&&k.overrideMimeType(E)),(y.contentType||!1!==y.contentType&&y.data&&"GET"!=y.type.toUpperCase())&&S("Content-Type",y.contentType||"application/x-www-form-urlencoded"),y.headers)for(r in y.headers)S(r,y.headers[r]);if(k.setRequestHeader=S,k.onreadystatechange=function(){if(4==k.readyState){k.onreadystatechange=m,clearTimeout(A);var t,r=!1;if(k.status>=200&&k.status<300||304==k.status||0==k.status&&"file:"==w){if(b=b||function(e){return e&&(e=e.split(";",2)[0]),e&&("text/html"==e?"html":"application/json"==e?"json":a.test(e)?"script":s.test(e)&&"xml")||"text"}(y.mimeType||k.getResponseHeader("content-type")),"arraybuffer"==k.responseType||"blob"==k.responseType)t=k.response;else{t=k.responseText;try{t=function(e,t,r){if(r.dataFilter==m)return e;var n=r.context;return r.dataFilter.call(n,e,t)}(t,b,y),"script"==b?(0,eval)(t):"xml"==b?t=k.responseXML:"json"==b&&(t=l.test(t)?null:e.parseJSON(t))}catch(e){r=e}if(r)return h(r,"parsererror",k,y,v)}f(t,k,y,v)}else h(k.statusText||null,k.status?"error":"abort",k,y,v)}},!1===d(k,y))return k.abort(),h(null,"abort",k,y,v),k;var C=!("async"in y)||y.async;if(k.open(y.type,y.url,C,y.username,y.password),y.xhrFields)for(r in y.xhrFields)k[r]=y.xhrFields[r];for(r in T)x.apply(k,T[r]);return y.timeout>0&&(A=setTimeout((function(){k.onreadystatechange=m,k.abort(),h(null,"timeout",k,y,v)}),y.timeout)),k.send(y.data?y.data:null),k},e.get=function(){return e.ajax(y.apply(null,arguments))},e.post=function(){var t=y.apply(null,arguments);return t.type="POST",e.ajax(t)},e.getJSON=function(){var t=y.apply(null,arguments);return t.dataType="json",e.ajax(t)},e.fn.load=function(t,r,n){if(!this.length)return this;var i,a=this,s=t.split(/\s/),l=y(t,r,n),u=l.success;return s.length>1&&(l.url=s[0],i=s[1]),l.success=function(t){a.html(i?e("<div>").html(t.replace(o,"")).find(i):t),u&&u.apply(a,arguments)},e.ajax(l),this};var v=encodeURIComponent;e.param=function(t,r){var n=[];return n.add=function(t,r){e.isFunction(r)&&(r=r()),null==r&&(r=""),this.push(v(t)+"="+v(r))},function t(r,n,i,o){var a,s=e.isArray(n),l=e.isPlainObject(n);e.each(n,(function(n,u){a=e.type(u),o&&(n=i?o:o+"["+(l||"object"==a||"array"==a?n:"")+"]"),!o&&s?r.add(u.name,u.value):"array"==a||!i&&"object"==a?t(r,u,i,n):r.add(n,u)}))}(n,t,r),n.join("&").replace(/%20/g,"+")}}(n),(r=n).Callbacks=function(e){e=r.extend({},e);var t,n,i,o,a,s,l=[],u=!e.once&&[],c=function(r){for(t=e.memory&&r,n=!0,s=o||0,o=0,a=l.length,i=!0;l&&s<a;++s)if(!1===l[s].apply(r[0],r[1])&&e.stopOnFalse){t=!1;break}i=!1,l&&(u?u.length&&c(u.shift()):t?l.length=0:d.disable())},d={add:function(){if(l){var n=l.length,s=function(t){r.each(t,(function(t,r){"function"==typeof r?e.unique&&d.has(r)||l.push(r):r&&r.length&&"string"!=typeof r&&s(r)}))};s(arguments),i?a=l.length:t&&(o=n,c(t))}return this},remove:function(){return l&&r.each(arguments,(function(e,t){for(var n;(n=r.inArray(t,l,n))>-1;)l.splice(n,1),i&&(n<=a&&--a,n<=s&&--s)})),this},has:function(e){return!(!l||!(e?r.inArray(e,l)>-1:l.length))},empty:function(){return a=l.length=0,this},disable:function(){return l=u=t=void 0,this},disabled:function(){return!l},lock:function(){return u=void 0,t||d.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||n&&!u||(t=[e,(t=t||[]).slice?t.slice():t],i?u.push(t):c(t)),this},fire:function(){return d.fireWith(this,arguments)},fired:function(){return!!n}};return d},function(e){var t=Array.prototype.slice;function r(t){var n=[["resolve","done",e.Callbacks({once:1,memory:1}),"resolved"],["reject","fail",e.Callbacks({once:1,memory:1}),"rejected"],["notify","progress",e.Callbacks({memory:1})]],i="pending",o={state:function(){return i},always:function(){return a.done(arguments).fail(arguments),this},then:function(){var t=arguments;return r((function(r){e.each(n,(function(n,i){var s=e.isFunction(t[n])&&t[n];a[i[1]]((function(){var t=s&&s.apply(this,arguments);if(t&&e.isFunction(t.promise))t.promise().done(r.resolve).fail(r.reject).progress(r.notify);else{var n=this===o?r.promise():this,a=s?[t]:arguments;r[i[0]+"With"](n,a)}}))})),t=null})).promise()},promise:function(t){return null!=t?e.extend(t,o):o}},a={};return e.each(n,(function(e,t){var r=t[2],s=t[3];o[t[1]]=r.add,s&&r.add((function(){i=s}),n[1^e][2].disable,n[2][2].lock),a[t[0]]=function(){return a[t[0]+"With"](this===a?o:this,arguments),this},a[t[0]+"With"]=r.fireWith})),o.promise(a),t&&t.call(a,a),a}e.when=function(n){var i,o,a,s=t.call(arguments),l=s.length,u=0,c=1!==l||n&&e.isFunction(n.promise)?l:0,d=1===c?n:r(),f=function(e,r,n){return function(o){r[e]=this,n[e]=arguments.length>1?t.call(arguments):o,n===i?d.notifyWith(r,n):--c||d.resolveWith(r,n)}};if(l>1)for(i=new Array(l),o=new Array(l),a=new Array(l);u<l;++u)s[u]&&e.isFunction(s[u].promise)?s[u].promise().done(f(u,a,s)).fail(d.reject).progress(f(u,o,i)):--c;return c||d.resolveWith(a,s),d.promise()},e.Deferred=r}(n),function(e){var t=1,r=Array.prototype.slice,n=e.isFunction,i=function(e){return"string"==typeof e},o={},a={},s="onfocusin"in window,l={focus:"focusin",blur:"focusout"},u={mouseenter:"mouseover",mouseleave:"mouseout"};function c(e){return e._zid||(e._zid=t++)}function d(e,t,r,n){if((t=f(t)).ns)var i=(a=t.ns,new RegExp("(?:^| )"+a.replace(" "," .* ?")+"(?: |$)"));var a;return(o[c(e)]||[]).filter((function(e){return e&&(!t.e||e.e==t.e)&&(!t.ns||i.test(e.ns))&&(!r||c(e.fn)===c(r))&&(!n||e.sel==n)}))}function f(e){var t=(""+e).split(".");return{e:t[0],ns:t.slice(1).sort().join(" ")}}function h(e,t){return e.del&&!s&&e.e in l||!!t}function p(e){return u[e]||s&&l[e]||e}function m(t,r,n,i,a,s,l){var d=c(t),m=o[d]||(o[d]=[]);r.split(/\s/).forEach((function(r){if("ready"==r)return e(document).ready(n);var o=f(r);o.fn=n,o.sel=a,o.e in u&&(n=function(t){var r=t.relatedTarget;if(!r||r!==this&&!e.contains(this,r))return o.fn.apply(this,arguments)}),o.del=s;var c=s||n;o.proxy=function(e){if(!(e=A(e)).isImmediatePropagationStopped()){e.data=i;var r=c.apply(t,null==e._args?[e]:[e].concat(e._args));return!1===r&&(e.preventDefault(),e.stopPropagation()),r}},o.i=m.length,m.push(o),"addEventListener"in t&&t.addEventListener(p(o.e),o.proxy,h(o,l))}))}function g(e,t,r,n,i){var a=c(e);(t||"").split(/\s/).forEach((function(t){d(e,t,r,n).forEach((function(t){delete o[a][t.i],"removeEventListener"in e&&e.removeEventListener(p(t.e),t.proxy,h(t,i))}))}))}a.click=a.mousedown=a.mouseup=a.mousemove="MouseEvents",e.event={add:m,remove:g},e.proxy=function(t,o){var a=2 in arguments&&r.call(arguments,2);if(n(t)){var s=function(){return t.apply(o,a?a.concat(r.call(arguments)):arguments)};return s._zid=c(t),s}if(i(o))return a?(a.unshift(t[o],t),e.proxy.apply(null,a)):e.proxy(t[o],t);throw new TypeError("expected function")},e.fn.bind=function(e,t,r){return this.on(e,t,r)},e.fn.unbind=function(e,t){return this.off(e,t)},e.fn.one=function(e,t,r,n){return this.on(e,t,r,n,1)};var y=function(){return!0},v=function(){return!1},b=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,_={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};function A(t,r){return!r&&t.isDefaultPrevented||(r||(r=t),e.each(_,(function(e,n){var i=r[e];t[e]=function(){return this[n]=y,i&&i.apply(r,arguments)},t[n]=v})),t.timeStamp||(t.timeStamp=Date.now()),(void 0!==r.defaultPrevented?r.defaultPrevented:"returnValue"in r?!1===r.returnValue:r.getPreventDefault&&r.getPreventDefault())&&(t.isDefaultPrevented=y)),t}function E(e){var t,r={originalEvent:e};for(t in e)b.test(t)||void 0===e[t]||(r[t]=e[t]);return A(r,e)}e.fn.delegate=function(e,t,r){return this.on(t,e,r)},e.fn.undelegate=function(e,t,r){return this.off(t,e,r)},e.fn.live=function(t,r){return e(document.body).delegate(this.selector,t,r),this},e.fn.die=function(t,r){return e(document.body).undelegate(this.selector,t,r),this},e.fn.on=function(t,o,a,s,l){var u,c,d=this;return t&&!i(t)?(e.each(t,(function(e,t){d.on(e,o,a,t,l)})),d):(i(o)||n(s)||!1===s||(s=a,a=o,o=void 0),void 0!==s&&!1!==a||(s=a,a=void 0),!1===s&&(s=v),d.each((function(n,i){l&&(u=function(e){return g(i,e.type,s),s.apply(this,arguments)}),o&&(c=function(t){var n,a=e(t.target).closest(o,i).get(0);if(a&&a!==i)return n=e.extend(E(t),{currentTarget:a,liveFired:i}),(u||s).apply(a,[n].concat(r.call(arguments,1)))}),m(i,t,s,a,o,c||u)})))},e.fn.off=function(t,r,o){var a=this;return t&&!i(t)?(e.each(t,(function(e,t){a.off(e,r,t)})),a):(i(r)||n(o)||!1===o||(o=r,r=void 0),!1===o&&(o=v),a.each((function(){g(this,t,o,r)})))},e.fn.trigger=function(t,r){return(t=i(t)||e.isPlainObject(t)?e.Event(t):A(t))._args=r,this.each((function(){t.type in l&&"function"==typeof this[t.type]?this[t.type]():"dispatchEvent"in this?this.dispatchEvent(t):e(this).triggerHandler(t,r)}))},e.fn.triggerHandler=function(t,r){var n,o;return this.each((function(a,s){(n=E(i(t)?e.Event(t):t))._args=r,n.target=s,e.each(d(s,t.type||t),(function(e,t){if(o=t.proxy(n),n.isImmediatePropagationStopped())return!1}))})),o},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach((function(t){e.fn[t]=function(e){return 0 in arguments?this.bind(t,e):this.trigger(t)}})),e.Event=function(e,t){i(e)||(e=(t=e).type);var r=document.createEvent(a[e]||"Events"),n=!0;if(t)for(var o in t)"bubbles"==o?n=!!t[o]:r[o]=t[o];return r.initEvent(e,n,!0),A(r)}}(n),function(){try{getComputedStyle(void 0)}catch(t){var e=getComputedStyle;window.getComputedStyle=function(t,r){try{return e(t,r)}catch(e){return null}}}}(),function(e){var t=e.zepto,r=t.qsa,n=t.matches;function i(t){return!(!(t=e(t)).width()&&!t.height())&&"none"!==t.css("display")}var o=e.expr[":"]={visible:function(){if(i(this))return this},hidden:function(){if(!i(this))return this},selected:function(){if(this.selected)return this},checked:function(){if(this.checked)return this},parent:function(){return this.parentNode},first:function(e){if(0===e)return this},last:function(e,t){if(e===t.length-1)return this},eq:function(e,t,r){if(e===r)return this},contains:function(t,r,n){if(e(this).text().indexOf(n)>-1)return this},has:function(e,r,n){if(t.qsa(this,n).length)return this}},a=new RegExp("(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*"),s=/^\s*>/,l="Zepto"+ +new Date;function u(e,t){e=e.replace(/=#\]/g,'="#"]');var r,n,i=a.exec(e);if(i&&i[2]in o&&(r=o[i[2]],n=i[3],e=i[1],n)){var s=Number(n);n=isNaN(s)?n.replace(/^["']|["']$/g,""):s}return t(e,r,n)}t.qsa=function(n,i){return u(i,(function(o,a,u){try{var c;!o&&a?o="*":s.test(o)&&(c=e(n).addClass(l),o="."+l+" "+o);var d=r(n,o)}catch(e){throw console.error("error performing selector: %o",i),e}finally{c&&c.removeClass(l)}return a?t.uniq(e.map(d,(function(e,t){return a.call(e,t,d,u)}))):d}))},t.matches=function(e,t){return u(t,(function(t,r,i){return(!t||n(e,t))&&(!r||r.call(e,null,i)===e)}))}}(n),e.exports=n},"./node_modules/core-js/library/fn/array/from.js": +/*! no static exports found */function(e,t){var r,n=function(){var e,t,r,n,i,o=[],a=o.concat,s=o.filter,l=o.slice,u=window.document,c={},d={},f={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},h=/^\s*<(\w+|!)[^>]*>/,p=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,m=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,g=/^(?:body|html)$/i,y=/([A-Z])/g,v=["val","css","html","text","data","width","height","offset"],b=u.createElement("table"),_=u.createElement("tr"),A={tr:u.createElement("tbody"),tbody:b,thead:b,tfoot:b,td:_,th:_,"*":u.createElement("div")},E=/complete|loaded|interactive/,T=/^[\w-]*$/,S={},w=S.toString,k={},C=u.createElement("div"),x={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},R=Array.isArray||function(e){return e instanceof Array};function L(e){return null==e?String(e):S[w.call(e)]||"object"}function j(e){return"function"==L(e)}function P(e){return null!=e&&e==e.window}function I(e){return null!=e&&e.nodeType==e.DOCUMENT_NODE}function O(e){return"object"==L(e)}function D(e){return O(e)&&!P(e)&&Object.getPrototypeOf(e)==Object.prototype}function M(e){var r=!!e&&"length"in e&&e.length,n=t.type(e);return"function"!=n&&!P(e)&&("array"==n||0===r||"number"==typeof r&&r>0&&r-1 in e)}function N(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function F(e){return e in d?d[e]:d[e]=new RegExp("(^|\\s)"+e+"(\\s|$)")}function U(e,t){return"number"!=typeof t||f[N(e)]?t:t+"px"}function B(e){return"children"in e?l.call(e.children):t.map(e.childNodes,(function(e){if(1==e.nodeType)return e}))}function K(e,t){var r,n=e?e.length:0;for(r=0;r<n;r++)this[r]=e[r];this.length=n,this.selector=t||""}function G(t,r,n){for(e in r)n&&(D(r[e])||R(r[e]))?(D(r[e])&&!D(t[e])&&(t[e]={}),R(r[e])&&!R(t[e])&&(t[e]=[]),G(t[e],r[e],n)):void 0!==r[e]&&(t[e]=r[e])}function V(e,r){return null==r?t(e):t(e).filter(r)}function H(e,t,r,n){return j(t)?t.call(e,r,n):t}function Y(e,t,r){null==r?e.removeAttribute(t):e.setAttribute(t,r)}function z(e,t){var r=e.className||"",n=r&&void 0!==r.baseVal;if(void 0===t)return n?r.baseVal:r;n?r.baseVal=t:e.className=t}function W(e){try{return e?"true"==e||"false"!=e&&("null"==e?null:+e+""==e?+e:/^[\[\{]/.test(e)?t.parseJSON(e):e):e}catch(t){return e}}function $(e,t){t(e);for(var r=0,n=e.childNodes.length;r<n;r++)$(e.childNodes[r],t)}return k.matches=function(e,t){if(!t||!e||1!==e.nodeType)return!1;var r=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.matchesSelector;if(r)return r.call(e,t);var n,i=e.parentNode,o=!i;return o&&(i=C).appendChild(e),n=~k.qsa(i,t).indexOf(e),o&&C.removeChild(e),n},n=function(e){return e.replace(/-+(.)?/g,(function(e,t){return t?t.toUpperCase():""}))},i=function(e){return s.call(e,(function(t,r){return e.indexOf(t)==r}))},k.fragment=function(e,r,n){var i,o,a;return p.test(e)&&(i=t(u.createElement(RegExp.$1))),i||(e.replace&&(e=e.replace(m,"<$1></$2>")),void 0===r&&(r=h.test(e)&&RegExp.$1),r in A||(r="*"),(a=A[r]).innerHTML=""+e,i=t.each(l.call(a.childNodes),(function(){a.removeChild(this)}))),D(n)&&(o=t(i),t.each(n,(function(e,t){v.indexOf(e)>-1?o[e](t):o.attr(e,t)}))),i},k.Z=function(e,t){return new K(e,t)},k.isZ=function(e){return e instanceof k.Z},k.init=function(e,r){var n,i;if(!e)return k.Z();if("string"==typeof e)if("<"==(e=e.trim())[0]&&h.test(e))n=k.fragment(e,RegExp.$1,r),e=null;else{if(void 0!==r)return t(r).find(e);n=k.qsa(u,e)}else{if(j(e))return t(u).ready(e);if(k.isZ(e))return e;if(R(e))i=e,n=s.call(i,(function(e){return null!=e}));else if(O(e))n=[e],e=null;else if(h.test(e))n=k.fragment(e.trim(),RegExp.$1,r),e=null;else{if(void 0!==r)return t(r).find(e);n=k.qsa(u,e)}}return k.Z(n,e)},(t=function(e,t){return k.init(e,t)}).extend=function(e){var t,r=l.call(arguments,1);return"boolean"==typeof e&&(t=e,e=r.shift()),r.forEach((function(r){G(e,r,t)})),e},k.qsa=function(e,t){var r,n="#"==t[0],i=!n&&"."==t[0],o=n||i?t.slice(1):t,a=T.test(o);return e.getElementById&&a&&n?(r=e.getElementById(o))?[r]:[]:1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType?[]:l.call(a&&!n&&e.getElementsByClassName?i?e.getElementsByClassName(o):e.getElementsByTagName(t):e.querySelectorAll(t))},t.contains=u.documentElement.contains?function(e,t){return e!==t&&e.contains(t)}:function(e,t){for(;t&&(t=t.parentNode);)if(t===e)return!0;return!1},t.type=L,t.isFunction=j,t.isWindow=P,t.isArray=R,t.isPlainObject=D,t.isEmptyObject=function(e){var t;for(t in e)return!1;return!0},t.isNumeric=function(e){var t=Number(e),r=typeof e;return null!=e&&"boolean"!=r&&("string"!=r||e.length)&&!isNaN(t)&&isFinite(t)||!1},t.inArray=function(e,t,r){return o.indexOf.call(t,e,r)},t.camelCase=n,t.trim=function(e){return null==e?"":String.prototype.trim.call(e)},t.uuid=0,t.support={},t.expr={},t.noop=function(){},t.map=function(e,r){var n,i,o,a,s=[];if(M(e))for(i=0;i<e.length;i++)null!=(n=r(e[i],i))&&s.push(n);else for(o in e)null!=(n=r(e[o],o))&&s.push(n);return(a=s).length>0?t.fn.concat.apply([],a):a},t.each=function(e,t){var r,n;if(M(e)){for(r=0;r<e.length;r++)if(!1===t.call(e[r],r,e[r]))return e}else for(n in e)if(!1===t.call(e[n],n,e[n]))return e;return e},t.grep=function(e,t){return s.call(e,t)},window.JSON&&(t.parseJSON=JSON.parse),t.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),(function(e,t){S["[object "+t+"]"]=t.toLowerCase()})),t.fn={constructor:k.Z,length:0,forEach:o.forEach,reduce:o.reduce,push:o.push,sort:o.sort,splice:o.splice,indexOf:o.indexOf,concat:function(){var e,t,r=[];for(e=0;e<arguments.length;e++)t=arguments[e],r[e]=k.isZ(t)?t.toArray():t;return a.apply(k.isZ(this)?this.toArray():this,r)},map:function(e){return t(t.map(this,(function(t,r){return e.call(t,r,t)})))},slice:function(){return t(l.apply(this,arguments))},ready:function(e){return E.test(u.readyState)&&u.body?e(t):u.addEventListener("DOMContentLoaded",(function(){e(t)}),!1),this},get:function(e){return void 0===e?l.call(this):this[e>=0?e:e+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each((function(){null!=this.parentNode&&this.parentNode.removeChild(this)}))},each:function(e){return o.every.call(this,(function(t,r){return!1!==e.call(t,r,t)})),this},filter:function(e){return j(e)?this.not(this.not(e)):t(s.call(this,(function(t){return k.matches(t,e)})))},add:function(e,r){return t(i(this.concat(t(e,r))))},is:function(e){return this.length>0&&k.matches(this[0],e)},not:function(e){var r=[];if(j(e)&&void 0!==e.call)this.each((function(t){e.call(this,t)||r.push(this)}));else{var n="string"==typeof e?this.filter(e):M(e)&&j(e.item)?l.call(e):t(e);this.forEach((function(e){n.indexOf(e)<0&&r.push(e)}))}return t(r)},has:function(e){return this.filter((function(){return O(e)?t.contains(this,e):t(this).find(e).size()}))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){var e=this[0];return e&&!O(e)?e:t(e)},last:function(){var e=this[this.length-1];return e&&!O(e)?e:t(e)},find:function(e){var r=this;return e?"object"==typeof e?t(e).filter((function(){var e=this;return o.some.call(r,(function(r){return t.contains(r,e)}))})):1==this.length?t(k.qsa(this[0],e)):this.map((function(){return k.qsa(this,e)})):t()},closest:function(e,r){var n=[],i="object"==typeof e&&t(e);return this.each((function(t,o){for(;o&&!(i?i.indexOf(o)>=0:k.matches(o,e));)o=o!==r&&!I(o)&&o.parentNode;o&&n.indexOf(o)<0&&n.push(o)})),t(n)},parents:function(e){for(var r=[],n=this;n.length>0;)n=t.map(n,(function(e){if((e=e.parentNode)&&!I(e)&&r.indexOf(e)<0)return r.push(e),e}));return V(r,e)},parent:function(e){return V(i(this.pluck("parentNode")),e)},children:function(e){return V(this.map((function(){return B(this)})),e)},contents:function(){return this.map((function(){return this.contentDocument||l.call(this.childNodes)}))},siblings:function(e){return V(this.map((function(e,t){return s.call(B(t.parentNode),(function(e){return e!==t}))})),e)},empty:function(){return this.each((function(){this.innerHTML=""}))},pluck:function(e){return t.map(this,(function(t){return t[e]}))},show:function(){return this.each((function(){var e,t,r;"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=(e=this.nodeName,c[e]||(t=u.createElement(e),u.body.appendChild(t),r=getComputedStyle(t,"").getPropertyValue("display"),t.parentNode.removeChild(t),"none"==r&&(r="block"),c[e]=r),c[e]))}))},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){var r=j(e);if(this[0]&&!r)var n=t(e).get(0),i=n.parentNode||this.length>1;return this.each((function(o){t(this).wrapAll(r?e.call(this,o):i?n.cloneNode(!0):n)}))},wrapAll:function(e){if(this[0]){var r;for(t(this[0]).before(e=t(e));(r=e.children()).length;)e=r.first();t(e).append(this)}return this},wrapInner:function(e){var r=j(e);return this.each((function(n){var i=t(this),o=i.contents(),a=r?e.call(this,n):e;o.length?o.wrapAll(a):i.append(a)}))},unwrap:function(){return this.parent().each((function(){t(this).replaceWith(t(this).children())})),this},clone:function(){return this.map((function(){return this.cloneNode(!0)}))},hide:function(){return this.css("display","none")},toggle:function(e){return this.each((function(){var r=t(this);(void 0===e?"none"==r.css("display"):e)?r.show():r.hide()}))},prev:function(e){return t(this.pluck("previousElementSibling")).filter(e||"*")},next:function(e){return t(this.pluck("nextElementSibling")).filter(e||"*")},html:function(e){return 0 in arguments?this.each((function(r){var n=this.innerHTML;t(this).empty().append(H(this,e,r,n))})):0 in this?this[0].innerHTML:null},text:function(e){return 0 in arguments?this.each((function(t){var r=H(this,e,t,this.textContent);this.textContent=null==r?"":""+r})):0 in this?this.pluck("textContent").join(""):null},attr:function(t,r){var n;return"string"!=typeof t||1 in arguments?this.each((function(n){if(1===this.nodeType)if(O(t))for(e in t)Y(this,e,t[e]);else Y(this,t,H(this,r,n,this.getAttribute(t)))})):0 in this&&1==this[0].nodeType&&null!=(n=this[0].getAttribute(t))?n:void 0},removeAttr:function(e){return this.each((function(){1===this.nodeType&&e.split(" ").forEach((function(e){Y(this,e)}),this)}))},prop:function(e,t){return e=x[e]||e,1 in arguments?this.each((function(r){this[e]=H(this,t,r,this[e])})):this[0]&&this[0][e]},removeProp:function(e){return e=x[e]||e,this.each((function(){delete this[e]}))},data:function(e,t){var r="data-"+e.replace(y,"-$1").toLowerCase(),n=1 in arguments?this.attr(r,t):this.attr(r);return null!==n?W(n):void 0},val:function(e){return 0 in arguments?(null==e&&(e=""),this.each((function(t){this.value=H(this,e,t,this.value)}))):this[0]&&(this[0].multiple?t(this[0]).find("option").filter((function(){return this.selected})).pluck("value"):this[0].value)},offset:function(e){if(e)return this.each((function(r){var n=t(this),i=H(this,e,r,n.offset()),o=n.offsetParent().offset(),a={top:i.top-o.top,left:i.left-o.left};"static"==n.css("position")&&(a.position="relative"),n.css(a)}));if(!this.length)return null;if(u.documentElement!==this[0]&&!t.contains(u.documentElement,this[0]))return{top:0,left:0};var r=this[0].getBoundingClientRect();return{left:r.left+window.pageXOffset,top:r.top+window.pageYOffset,width:Math.round(r.width),height:Math.round(r.height)}},css:function(r,i){if(arguments.length<2){var o=this[0];if("string"==typeof r){if(!o)return;return o.style[n(r)]||getComputedStyle(o,"").getPropertyValue(r)}if(R(r)){if(!o)return;var a={},s=getComputedStyle(o,"");return t.each(r,(function(e,t){a[t]=o.style[n(t)]||s.getPropertyValue(t)})),a}}var l="";if("string"==L(r))i||0===i?l=N(r)+":"+U(r,i):this.each((function(){this.style.removeProperty(N(r))}));else for(e in r)r[e]||0===r[e]?l+=N(e)+":"+U(e,r[e])+";":this.each((function(){this.style.removeProperty(N(e))}));return this.each((function(){this.style.cssText+=";"+l}))},index:function(e){return e?this.indexOf(t(e)[0]):this.parent().children().indexOf(this[0])},hasClass:function(e){return!!e&&o.some.call(this,(function(e){return this.test(z(e))}),F(e))},addClass:function(e){return e?this.each((function(n){if("className"in this){r=[];var i=z(this);H(this,e,n,i).split(/\s+/g).forEach((function(e){t(this).hasClass(e)||r.push(e)}),this),r.length&&z(this,i+(i?" ":"")+r.join(" "))}})):this},removeClass:function(e){return this.each((function(t){if("className"in this){if(void 0===e)return z(this,"");r=z(this),H(this,e,t,r).split(/\s+/g).forEach((function(e){r=r.replace(F(e)," ")})),z(this,r.trim())}}))},toggleClass:function(e,r){return e?this.each((function(n){var i=t(this);H(this,e,n,z(this)).split(/\s+/g).forEach((function(e){(void 0===r?!i.hasClass(e):r)?i.addClass(e):i.removeClass(e)}))})):this},scrollTop:function(e){if(this.length){var t="scrollTop"in this[0];return void 0===e?t?this[0].scrollTop:this[0].pageYOffset:this.each(t?function(){this.scrollTop=e}:function(){this.scrollTo(this.scrollX,e)})}},scrollLeft:function(e){if(this.length){var t="scrollLeft"in this[0];return void 0===e?t?this[0].scrollLeft:this[0].pageXOffset:this.each(t?function(){this.scrollLeft=e}:function(){this.scrollTo(e,this.scrollY)})}},position:function(){if(this.length){var e=this[0],r=this.offsetParent(),n=this.offset(),i=g.test(r[0].nodeName)?{top:0,left:0}:r.offset();return n.top-=parseFloat(t(e).css("margin-top"))||0,n.left-=parseFloat(t(e).css("margin-left"))||0,i.top+=parseFloat(t(r[0]).css("border-top-width"))||0,i.left+=parseFloat(t(r[0]).css("border-left-width"))||0,{top:n.top-i.top,left:n.left-i.left}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent||u.body;e&&!g.test(e.nodeName)&&"static"==t(e).css("position");)e=e.offsetParent;return e}))}},t.fn.detach=t.fn.remove,["width","height"].forEach((function(e){var r=e.replace(/./,(function(e){return e[0].toUpperCase()}));t.fn[e]=function(n){var i,o=this[0];return void 0===n?P(o)?o["inner"+r]:I(o)?o.documentElement["scroll"+r]:(i=this.offset())&&i[e]:this.each((function(r){(o=t(this)).css(e,H(this,n,r,o[e]()))}))}})),["after","prepend","before","append"].forEach((function(e,r){var n=r%2;t.fn[e]=function(){var e,i,o=t.map(arguments,(function(r){var n=[];return"array"==(e=L(r))?(r.forEach((function(e){return void 0!==e.nodeType?n.push(e):t.zepto.isZ(e)?n=n.concat(e.get()):void(n=n.concat(k.fragment(e)))})),n):"object"==e||null==r?r:k.fragment(r)})),a=this.length>1;return o.length<1?this:this.each((function(e,s){i=n?s:s.parentNode,s=0==r?s.nextSibling:1==r?s.firstChild:2==r?s:null;var l=t.contains(u.documentElement,i);o.forEach((function(e){if(a)e=e.cloneNode(!0);else if(!i)return t(e).remove();i.insertBefore(e,s),l&&$(e,(function(e){if(!(null==e.nodeName||"SCRIPT"!==e.nodeName.toUpperCase()||e.type&&"text/javascript"!==e.type||e.src)){var t=e.ownerDocument?e.ownerDocument.defaultView:window;t.eval.call(t,e.innerHTML)}}))}))}))},t.fn[n?e+"To":"insert"+(r?"Before":"After")]=function(r){return t(r)[e](this),this}})),k.Z.prototype=K.prototype=t.fn,k.uniq=i,k.deserializeValue=W,t.zepto=k,t}();window.Zepto=n,void 0===window.$&&(window.$=n),function(e){var t,r,n=+new Date,i=window.document,o=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,a=/^(?:text|application)\/javascript/i,s=/^(?:text|application)\/xml/i,l=/^\s*$/,u=i.createElement("a");function c(t,r,n,o){if(t.global)return function(t,r,n){var i=e.Event(r);return e(t).trigger(i,n),!i.isDefaultPrevented()}(r||i,n,o)}function d(e,t){var r=t.context;if(!1===t.beforeSend.call(r,e,t)||!1===c(t,r,"ajaxBeforeSend",[e,t]))return!1;c(t,r,"ajaxSend",[e,t])}function f(e,t,r,n){var i=r.context;r.success.call(i,e,"success",t),n&&n.resolveWith(i,[e,"success",t]),c(r,i,"ajaxSuccess",[t,r,e]),p("success",t,r)}function h(e,t,r,n,i){var o=n.context;n.error.call(o,r,t,e),i&&i.rejectWith(o,[r,t,e]),c(n,o,"ajaxError",[r,n,e||t]),p(t,r,n)}function p(t,r,n){var i=n.context;n.complete.call(i,r,t),c(n,i,"ajaxComplete",[r,n]),function(t){t.global&&!--e.active&&c(t,null,"ajaxStop")}(n)}function m(){}function g(e,t){return""==t?e:(e+"&"+t).replace(/[&?]{1,2}/,"?")}function y(t,r,n,i){return e.isFunction(r)&&(i=n,n=r,r=void 0),e.isFunction(n)||(i=n,n=void 0),{url:t,data:r,success:n,dataType:i}}u.href=window.location.href,e.active=0,e.ajaxJSONP=function(t,r){if(!("type"in t))return e.ajax(t);var o,a,s=t.jsonpCallback,l=(e.isFunction(s)?s():s)||"Zepto"+n++,u=i.createElement("script"),c=window[l],p=function(t){e(u).triggerHandler("error",t||"abort")},m={abort:p};return r&&r.promise(m),e(u).on("load error",(function(n,i){clearTimeout(a),e(u).off().remove(),"error"!=n.type&&o?f(o[0],m,t,r):h(null,i||"error",m,t,r),window[l]=c,o&&e.isFunction(c)&&c(o[0]),c=o=void 0})),!1===d(m,t)?(p("abort"),m):(window[l]=function(){o=arguments},u.src=t.url.replace(/\?(.+)=\?/,"?$1="+l),i.head.appendChild(u),t.timeout>0&&(a=setTimeout((function(){p("timeout")}),t.timeout)),m)},e.ajaxSettings={type:"GET",beforeSend:m,success:m,error:m,complete:m,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:"application/json",xml:"application/xml, text/xml",html:"text/html",text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:m},e.ajax=function(n){var o,p,y=e.extend({},n||{}),v=e.Deferred&&e.Deferred();for(t in e.ajaxSettings)void 0===y[t]&&(y[t]=e.ajaxSettings[t]);!function(t){t.global&&0==e.active++&&c(t,null,"ajaxStart")}(y),y.crossDomain||((o=i.createElement("a")).href=y.url,o.href=o.href,y.crossDomain=u.protocol+"//"+u.host!=o.protocol+"//"+o.host),y.url||(y.url=window.location.toString()),(p=y.url.indexOf("#"))>-1&&(y.url=y.url.slice(0,p)),function(t){t.processData&&t.data&&"string"!=e.type(t.data)&&(t.data=e.param(t.data,t.traditional)),!t.data||t.type&&"GET"!=t.type.toUpperCase()&&"jsonp"!=t.dataType||(t.url=g(t.url,t.data),t.data=void 0)}(y);var b=y.dataType,_=/\?.+=\?/.test(y.url);if(_&&(b="jsonp"),!1!==y.cache&&(n&&!0===n.cache||"script"!=b&&"jsonp"!=b)||(y.url=g(y.url,"_="+Date.now())),"jsonp"==b)return _||(y.url=g(y.url,y.jsonp?y.jsonp+"=?":!1===y.jsonp?"":"callback=?")),e.ajaxJSONP(y,v);var A,E=y.accepts[b],T={},S=function(e,t){T[e.toLowerCase()]=[e,t]},w=/^([\w-]+:)\/\//.test(y.url)?RegExp.$1:window.location.protocol,k=y.xhr(),C=k.setRequestHeader;if(v&&v.promise(k),y.crossDomain||S("X-Requested-With","XMLHttpRequest"),S("Accept",E||"*/*"),(E=y.mimeType||E)&&(E.indexOf(",")>-1&&(E=E.split(",",2)[0]),k.overrideMimeType&&k.overrideMimeType(E)),(y.contentType||!1!==y.contentType&&y.data&&"GET"!=y.type.toUpperCase())&&S("Content-Type",y.contentType||"application/x-www-form-urlencoded"),y.headers)for(r in y.headers)S(r,y.headers[r]);if(k.setRequestHeader=S,k.onreadystatechange=function(){if(4==k.readyState){k.onreadystatechange=m,clearTimeout(A);var t,r=!1;if(k.status>=200&&k.status<300||304==k.status||0==k.status&&"file:"==w){if(b=b||function(e){return e&&(e=e.split(";",2)[0]),e&&("text/html"==e?"html":"application/json"==e?"json":a.test(e)?"script":s.test(e)&&"xml")||"text"}(y.mimeType||k.getResponseHeader("content-type")),"arraybuffer"==k.responseType||"blob"==k.responseType)t=k.response;else{t=k.responseText;try{t=function(e,t,r){if(r.dataFilter==m)return e;var n=r.context;return r.dataFilter.call(n,e,t)}(t,b,y),"script"==b?(0,eval)(t):"xml"==b?t=k.responseXML:"json"==b&&(t=l.test(t)?null:e.parseJSON(t))}catch(e){r=e}if(r)return h(r,"parsererror",k,y,v)}f(t,k,y,v)}else h(k.statusText||null,k.status?"error":"abort",k,y,v)}},!1===d(k,y))return k.abort(),h(null,"abort",k,y,v),k;var x=!("async"in y)||y.async;if(k.open(y.type,y.url,x,y.username,y.password),y.xhrFields)for(r in y.xhrFields)k[r]=y.xhrFields[r];for(r in T)C.apply(k,T[r]);return y.timeout>0&&(A=setTimeout((function(){k.onreadystatechange=m,k.abort(),h(null,"timeout",k,y,v)}),y.timeout)),k.send(y.data?y.data:null),k},e.get=function(){return e.ajax(y.apply(null,arguments))},e.post=function(){var t=y.apply(null,arguments);return t.type="POST",e.ajax(t)},e.getJSON=function(){var t=y.apply(null,arguments);return t.dataType="json",e.ajax(t)},e.fn.load=function(t,r,n){if(!this.length)return this;var i,a=this,s=t.split(/\s/),l=y(t,r,n),u=l.success;return s.length>1&&(l.url=s[0],i=s[1]),l.success=function(t){a.html(i?e("<div>").html(t.replace(o,"")).find(i):t),u&&u.apply(a,arguments)},e.ajax(l),this};var v=encodeURIComponent;e.param=function(t,r){var n=[];return n.add=function(t,r){e.isFunction(r)&&(r=r()),null==r&&(r=""),this.push(v(t)+"="+v(r))},function t(r,n,i,o){var a,s=e.isArray(n),l=e.isPlainObject(n);e.each(n,(function(n,u){a=e.type(u),o&&(n=i?o:o+"["+(l||"object"==a||"array"==a?n:"")+"]"),!o&&s?r.add(u.name,u.value):"array"==a||!i&&"object"==a?t(r,u,i,n):r.add(n,u)}))}(n,t,r),n.join("&").replace(/%20/g,"+")}}(n),(r=n).Callbacks=function(e){e=r.extend({},e);var t,n,i,o,a,s,l=[],u=!e.once&&[],c=function(r){for(t=e.memory&&r,n=!0,s=o||0,o=0,a=l.length,i=!0;l&&s<a;++s)if(!1===l[s].apply(r[0],r[1])&&e.stopOnFalse){t=!1;break}i=!1,l&&(u?u.length&&c(u.shift()):t?l.length=0:d.disable())},d={add:function(){if(l){var n=l.length,s=function(t){r.each(t,(function(t,r){"function"==typeof r?e.unique&&d.has(r)||l.push(r):r&&r.length&&"string"!=typeof r&&s(r)}))};s(arguments),i?a=l.length:t&&(o=n,c(t))}return this},remove:function(){return l&&r.each(arguments,(function(e,t){for(var n;(n=r.inArray(t,l,n))>-1;)l.splice(n,1),i&&(n<=a&&--a,n<=s&&--s)})),this},has:function(e){return!(!l||!(e?r.inArray(e,l)>-1:l.length))},empty:function(){return a=l.length=0,this},disable:function(){return l=u=t=void 0,this},disabled:function(){return!l},lock:function(){return u=void 0,t||d.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||n&&!u||(t=[e,(t=t||[]).slice?t.slice():t],i?u.push(t):c(t)),this},fire:function(){return d.fireWith(this,arguments)},fired:function(){return!!n}};return d},function(e){var t=Array.prototype.slice;function r(t){var n=[["resolve","done",e.Callbacks({once:1,memory:1}),"resolved"],["reject","fail",e.Callbacks({once:1,memory:1}),"rejected"],["notify","progress",e.Callbacks({memory:1})]],i="pending",o={state:function(){return i},always:function(){return a.done(arguments).fail(arguments),this},then:function(){var t=arguments;return r((function(r){e.each(n,(function(n,i){var s=e.isFunction(t[n])&&t[n];a[i[1]]((function(){var t=s&&s.apply(this,arguments);if(t&&e.isFunction(t.promise))t.promise().done(r.resolve).fail(r.reject).progress(r.notify);else{var n=this===o?r.promise():this,a=s?[t]:arguments;r[i[0]+"With"](n,a)}}))})),t=null})).promise()},promise:function(t){return null!=t?e.extend(t,o):o}},a={};return e.each(n,(function(e,t){var r=t[2],s=t[3];o[t[1]]=r.add,s&&r.add((function(){i=s}),n[1^e][2].disable,n[2][2].lock),a[t[0]]=function(){return a[t[0]+"With"](this===a?o:this,arguments),this},a[t[0]+"With"]=r.fireWith})),o.promise(a),t&&t.call(a,a),a}e.when=function(n){var i,o,a,s=t.call(arguments),l=s.length,u=0,c=1!==l||n&&e.isFunction(n.promise)?l:0,d=1===c?n:r(),f=function(e,r,n){return function(o){r[e]=this,n[e]=arguments.length>1?t.call(arguments):o,n===i?d.notifyWith(r,n):--c||d.resolveWith(r,n)}};if(l>1)for(i=new Array(l),o=new Array(l),a=new Array(l);u<l;++u)s[u]&&e.isFunction(s[u].promise)?s[u].promise().done(f(u,a,s)).fail(d.reject).progress(f(u,o,i)):--c;return c||d.resolveWith(a,s),d.promise()},e.Deferred=r}(n),function(e){var t=1,r=Array.prototype.slice,n=e.isFunction,i=function(e){return"string"==typeof e},o={},a={},s="onfocusin"in window,l={focus:"focusin",blur:"focusout"},u={mouseenter:"mouseover",mouseleave:"mouseout"};function c(e){return e._zid||(e._zid=t++)}function d(e,t,r,n){if((t=f(t)).ns)var i=(a=t.ns,new RegExp("(?:^| )"+a.replace(" "," .* ?")+"(?: |$)"));var a;return(o[c(e)]||[]).filter((function(e){return e&&(!t.e||e.e==t.e)&&(!t.ns||i.test(e.ns))&&(!r||c(e.fn)===c(r))&&(!n||e.sel==n)}))}function f(e){var t=(""+e).split(".");return{e:t[0],ns:t.slice(1).sort().join(" ")}}function h(e,t){return e.del&&!s&&e.e in l||!!t}function p(e){return u[e]||s&&l[e]||e}function m(t,r,n,i,a,s,l){var d=c(t),m=o[d]||(o[d]=[]);r.split(/\s/).forEach((function(r){if("ready"==r)return e(document).ready(n);var o=f(r);o.fn=n,o.sel=a,o.e in u&&(n=function(t){var r=t.relatedTarget;if(!r||r!==this&&!e.contains(this,r))return o.fn.apply(this,arguments)}),o.del=s;var c=s||n;o.proxy=function(e){if(!(e=A(e)).isImmediatePropagationStopped()){e.data=i;var r=c.apply(t,null==e._args?[e]:[e].concat(e._args));return!1===r&&(e.preventDefault(),e.stopPropagation()),r}},o.i=m.length,m.push(o),"addEventListener"in t&&t.addEventListener(p(o.e),o.proxy,h(o,l))}))}function g(e,t,r,n,i){var a=c(e);(t||"").split(/\s/).forEach((function(t){d(e,t,r,n).forEach((function(t){delete o[a][t.i],"removeEventListener"in e&&e.removeEventListener(p(t.e),t.proxy,h(t,i))}))}))}a.click=a.mousedown=a.mouseup=a.mousemove="MouseEvents",e.event={add:m,remove:g},e.proxy=function(t,o){var a=2 in arguments&&r.call(arguments,2);if(n(t)){var s=function(){return t.apply(o,a?a.concat(r.call(arguments)):arguments)};return s._zid=c(t),s}if(i(o))return a?(a.unshift(t[o],t),e.proxy.apply(null,a)):e.proxy(t[o],t);throw new TypeError("expected function")},e.fn.bind=function(e,t,r){return this.on(e,t,r)},e.fn.unbind=function(e,t){return this.off(e,t)},e.fn.one=function(e,t,r,n){return this.on(e,t,r,n,1)};var y=function(){return!0},v=function(){return!1},b=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,_={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};function A(t,r){return!r&&t.isDefaultPrevented||(r||(r=t),e.each(_,(function(e,n){var i=r[e];t[e]=function(){return this[n]=y,i&&i.apply(r,arguments)},t[n]=v})),t.timeStamp||(t.timeStamp=Date.now()),(void 0!==r.defaultPrevented?r.defaultPrevented:"returnValue"in r?!1===r.returnValue:r.getPreventDefault&&r.getPreventDefault())&&(t.isDefaultPrevented=y)),t}function E(e){var t,r={originalEvent:e};for(t in e)b.test(t)||void 0===e[t]||(r[t]=e[t]);return A(r,e)}e.fn.delegate=function(e,t,r){return this.on(t,e,r)},e.fn.undelegate=function(e,t,r){return this.off(t,e,r)},e.fn.live=function(t,r){return e(document.body).delegate(this.selector,t,r),this},e.fn.die=function(t,r){return e(document.body).undelegate(this.selector,t,r),this},e.fn.on=function(t,o,a,s,l){var u,c,d=this;return t&&!i(t)?(e.each(t,(function(e,t){d.on(e,o,a,t,l)})),d):(i(o)||n(s)||!1===s||(s=a,a=o,o=void 0),void 0!==s&&!1!==a||(s=a,a=void 0),!1===s&&(s=v),d.each((function(n,i){l&&(u=function(e){return g(i,e.type,s),s.apply(this,arguments)}),o&&(c=function(t){var n,a=e(t.target).closest(o,i).get(0);if(a&&a!==i)return n=e.extend(E(t),{currentTarget:a,liveFired:i}),(u||s).apply(a,[n].concat(r.call(arguments,1)))}),m(i,t,s,a,o,c||u)})))},e.fn.off=function(t,r,o){var a=this;return t&&!i(t)?(e.each(t,(function(e,t){a.off(e,r,t)})),a):(i(r)||n(o)||!1===o||(o=r,r=void 0),!1===o&&(o=v),a.each((function(){g(this,t,o,r)})))},e.fn.trigger=function(t,r){return(t=i(t)||e.isPlainObject(t)?e.Event(t):A(t))._args=r,this.each((function(){t.type in l&&"function"==typeof this[t.type]?this[t.type]():"dispatchEvent"in this?this.dispatchEvent(t):e(this).triggerHandler(t,r)}))},e.fn.triggerHandler=function(t,r){var n,o;return this.each((function(a,s){(n=E(i(t)?e.Event(t):t))._args=r,n.target=s,e.each(d(s,t.type||t),(function(e,t){if(o=t.proxy(n),n.isImmediatePropagationStopped())return!1}))})),o},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach((function(t){e.fn[t]=function(e){return 0 in arguments?this.bind(t,e):this.trigger(t)}})),e.Event=function(e,t){i(e)||(e=(t=e).type);var r=document.createEvent(a[e]||"Events"),n=!0;if(t)for(var o in t)"bubbles"==o?n=!!t[o]:r[o]=t[o];return r.initEvent(e,n,!0),A(r)}}(n),function(){try{getComputedStyle(void 0)}catch(t){var e=getComputedStyle;window.getComputedStyle=function(t,r){try{return e(t,r)}catch(e){return null}}}}(),function(e){var t=e.zepto,r=t.qsa,n=t.matches;function i(t){return!(!(t=e(t)).width()&&!t.height())&&"none"!==t.css("display")}var o=e.expr[":"]={visible:function(){if(i(this))return this},hidden:function(){if(!i(this))return this},selected:function(){if(this.selected)return this},checked:function(){if(this.checked)return this},parent:function(){return this.parentNode},first:function(e){if(0===e)return this},last:function(e,t){if(e===t.length-1)return this},eq:function(e,t,r){if(e===r)return this},contains:function(t,r,n){if(e(this).text().indexOf(n)>-1)return this},has:function(e,r,n){if(t.qsa(this,n).length)return this}},a=new RegExp("(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*"),s=/^\s*>/,l="Zepto"+ +new Date;function u(e,t){e=e.replace(/=#\]/g,'="#"]');var r,n,i=a.exec(e);if(i&&i[2]in o&&(r=o[i[2]],n=i[3],e=i[1],n)){var s=Number(n);n=isNaN(s)?n.replace(/^["']|["']$/g,""):s}return t(e,r,n)}t.qsa=function(n,i){return u(i,(function(o,a,u){try{var c;!o&&a?o="*":s.test(o)&&(c=e(n).addClass(l),o="."+l+" "+o);var d=r(n,o)}catch(e){throw console.error("error performing selector: %o",i),e}finally{c&&c.removeClass(l)}return a?t.uniq(e.map(d,(function(e,t){return a.call(e,t,d,u)}))):d}))},t.matches=function(e,t){return u(t,(function(t,r,i){return(!t||n(e,t))&&(!r||r.call(e,null,i)===e)}))}}(n),e.exports=n},"./node_modules/core-js/library/fn/array/from.js": /*!*******************************************************!*\ !*** ./node_modules/core-js/library/fn/array/from.js ***! \*******************************************************/ @@ -230,7 +230,7 @@ /*!**************************************************************!*\ !*** ./node_modules/core-js/library/modules/_iter-define.js ***! \**************************************************************/ -/*! no static exports found */function(e,t,r){"use strict";var n=r(/*! ./_library */"./node_modules/core-js/library/modules/_library.js"),i=r(/*! ./_export */"./node_modules/core-js/library/modules/_export.js"),o=r(/*! ./_redefine */"./node_modules/core-js/library/modules/_redefine.js"),a=r(/*! ./_hide */"./node_modules/core-js/library/modules/_hide.js"),s=r(/*! ./_has */"./node_modules/core-js/library/modules/_has.js"),l=r(/*! ./_iterators */"./node_modules/core-js/library/modules/_iterators.js"),u=r(/*! ./_iter-create */"./node_modules/core-js/library/modules/_iter-create.js"),c=r(/*! ./_set-to-string-tag */"./node_modules/core-js/library/modules/_set-to-string-tag.js"),d=r(/*! ./_object-gpo */"./node_modules/core-js/library/modules/_object-gpo.js"),f=r(/*! ./_wks */"./node_modules/core-js/library/modules/_wks.js")("iterator"),h=!([].keys&&"next"in[].keys()),p=function(){return this};e.exports=function(e,t,r,m,g,y,v){u(r,t,m);var b,_,A,E=function(e){if(!h&&e in k)return k[e];switch(e){case"keys":case"values":return function(){return new r(this,e)}}return function(){return new r(this,e)}},T=t+" Iterator",S="values"==g,w=!1,k=e.prototype,x=k[f]||k["@@iterator"]||g&&k[g],C=x||E(g),R=g?S?E("entries"):C:void 0,L="Array"==t&&k.entries||x;if(L&&(A=d(L.call(new e)))!==Object.prototype&&(c(A,T,!0),n||s(A,f)||a(A,f,p)),S&&x&&"values"!==x.name&&(w=!0,C=function(){return x.call(this)}),n&&!v||!h&&!w&&k[f]||a(k,f,C),l[t]=C,l[T]=p,g)if(b={values:S?C:E("values"),keys:y?C:E("keys"),entries:R},v)for(_ in b)_ in k||o(k,_,b[_]);else i(i.P+i.F*(h||w),t,b);return b}},"./node_modules/core-js/library/modules/_iter-detect.js": +/*! no static exports found */function(e,t,r){"use strict";var n=r(/*! ./_library */"./node_modules/core-js/library/modules/_library.js"),i=r(/*! ./_export */"./node_modules/core-js/library/modules/_export.js"),o=r(/*! ./_redefine */"./node_modules/core-js/library/modules/_redefine.js"),a=r(/*! ./_hide */"./node_modules/core-js/library/modules/_hide.js"),s=r(/*! ./_has */"./node_modules/core-js/library/modules/_has.js"),l=r(/*! ./_iterators */"./node_modules/core-js/library/modules/_iterators.js"),u=r(/*! ./_iter-create */"./node_modules/core-js/library/modules/_iter-create.js"),c=r(/*! ./_set-to-string-tag */"./node_modules/core-js/library/modules/_set-to-string-tag.js"),d=r(/*! ./_object-gpo */"./node_modules/core-js/library/modules/_object-gpo.js"),f=r(/*! ./_wks */"./node_modules/core-js/library/modules/_wks.js")("iterator"),h=!([].keys&&"next"in[].keys()),p=function(){return this};e.exports=function(e,t,r,m,g,y,v){u(r,t,m);var b,_,A,E=function(e){if(!h&&e in k)return k[e];switch(e){case"keys":case"values":return function(){return new r(this,e)}}return function(){return new r(this,e)}},T=t+" Iterator",S="values"==g,w=!1,k=e.prototype,C=k[f]||k["@@iterator"]||g&&k[g],x=C||E(g),R=g?S?E("entries"):x:void 0,L="Array"==t&&k.entries||C;if(L&&(A=d(L.call(new e)))!==Object.prototype&&(c(A,T,!0),n||s(A,f)||a(A,f,p)),S&&C&&"values"!==C.name&&(w=!0,x=function(){return C.call(this)}),n&&!v||!h&&!w&&k[f]||a(k,f,x),l[t]=x,l[T]=p,g)if(b={values:S?x:E("values"),keys:y?x:E("keys"),entries:R},v)for(_ in b)_ in k||o(k,_,b[_]);else i(i.P+i.F*(h||w),t,b);return b}},"./node_modules/core-js/library/modules/_iter-detect.js": /*!**************************************************************!*\ !*** ./node_modules/core-js/library/modules/_iter-detect.js ***! \**************************************************************/ @@ -426,7 +426,7 @@ /*!************************************************************!*\ !*** ./node_modules/core-js/library/modules/es6.symbol.js ***! \************************************************************/ -/*! no static exports found */function(e,t,r){"use strict";var n=r(/*! ./_global */"./node_modules/core-js/library/modules/_global.js"),i=r(/*! ./_has */"./node_modules/core-js/library/modules/_has.js"),o=r(/*! ./_descriptors */"./node_modules/core-js/library/modules/_descriptors.js"),a=r(/*! ./_export */"./node_modules/core-js/library/modules/_export.js"),s=r(/*! ./_redefine */"./node_modules/core-js/library/modules/_redefine.js"),l=r(/*! ./_meta */"./node_modules/core-js/library/modules/_meta.js").KEY,u=r(/*! ./_fails */"./node_modules/core-js/library/modules/_fails.js"),c=r(/*! ./_shared */"./node_modules/core-js/library/modules/_shared.js"),d=r(/*! ./_set-to-string-tag */"./node_modules/core-js/library/modules/_set-to-string-tag.js"),f=r(/*! ./_uid */"./node_modules/core-js/library/modules/_uid.js"),h=r(/*! ./_wks */"./node_modules/core-js/library/modules/_wks.js"),p=r(/*! ./_wks-ext */"./node_modules/core-js/library/modules/_wks-ext.js"),m=r(/*! ./_wks-define */"./node_modules/core-js/library/modules/_wks-define.js"),g=r(/*! ./_keyof */"./node_modules/core-js/library/modules/_keyof.js"),y=r(/*! ./_enum-keys */"./node_modules/core-js/library/modules/_enum-keys.js"),v=r(/*! ./_is-array */"./node_modules/core-js/library/modules/_is-array.js"),b=r(/*! ./_an-object */"./node_modules/core-js/library/modules/_an-object.js"),_=r(/*! ./_to-iobject */"./node_modules/core-js/library/modules/_to-iobject.js"),A=r(/*! ./_to-primitive */"./node_modules/core-js/library/modules/_to-primitive.js"),E=r(/*! ./_property-desc */"./node_modules/core-js/library/modules/_property-desc.js"),T=r(/*! ./_object-create */"./node_modules/core-js/library/modules/_object-create.js"),S=r(/*! ./_object-gopn-ext */"./node_modules/core-js/library/modules/_object-gopn-ext.js"),w=r(/*! ./_object-gopd */"./node_modules/core-js/library/modules/_object-gopd.js"),k=r(/*! ./_object-dp */"./node_modules/core-js/library/modules/_object-dp.js"),x=r(/*! ./_object-keys */"./node_modules/core-js/library/modules/_object-keys.js"),C=w.f,R=k.f,L=S.f,j=n.Symbol,P=n.JSON,I=P&&P.stringify,O=h("_hidden"),D=h("toPrimitive"),M={}.propertyIsEnumerable,N=c("symbol-registry"),U=c("symbols"),F=c("op-symbols"),B=Object.prototype,K="function"==typeof j,G=n.QObject,V=!G||!G.prototype||!G.prototype.findChild,H=o&&u((function(){return 7!=T(R({},"a",{get:function(){return R(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=C(B,t);n&&delete B[t],R(e,t,r),n&&e!==B&&R(B,t,n)}:R,Y=function(e){var t=U[e]=T(j.prototype);return t._k=e,t},z=K&&"symbol"==typeof j.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof j},W=function(e,t,r){return e===B&&W(F,t,r),b(e),t=A(t,!0),b(r),i(U,t)?(r.enumerable?(i(e,O)&&e[O][t]&&(e[O][t]=!1),r=T(r,{enumerable:E(0,!1)})):(i(e,O)||R(e,O,E(1,{})),e[O][t]=!0),H(e,t,r)):R(e,t,r)},$=function(e,t){b(e);for(var r,n=y(t=_(t)),i=0,o=n.length;o>i;)W(e,r=n[i++],t[r]);return e},q=function(e){var t=M.call(this,e=A(e,!0));return!(this===B&&i(U,e)&&!i(F,e))&&(!(t||!i(this,e)||!i(U,e)||i(this,O)&&this[O][e])||t)},X=function(e,t){if(e=_(e),t=A(t,!0),e!==B||!i(U,t)||i(F,t)){var r=C(e,t);return!r||!i(U,t)||i(e,O)&&e[O][t]||(r.enumerable=!0),r}},J=function(e){for(var t,r=L(_(e)),n=[],o=0;r.length>o;)i(U,t=r[o++])||t==O||t==l||n.push(t);return n},Z=function(e){for(var t,r=e===B,n=L(r?F:_(e)),o=[],a=0;n.length>a;)!i(U,t=n[a++])||r&&!i(B,t)||o.push(U[t]);return o};K||(s((j=function(){if(this instanceof j)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(r){this===B&&t.call(F,r),i(this,O)&&i(this[O],e)&&(this[O][e]=!1),H(this,e,E(1,r))};return o&&V&&H(B,e,{configurable:!0,set:t}),Y(e)}).prototype,"toString",(function(){return this._k})),w.f=X,k.f=W,r(/*! ./_object-gopn */"./node_modules/core-js/library/modules/_object-gopn.js").f=S.f=J,r(/*! ./_object-pie */"./node_modules/core-js/library/modules/_object-pie.js").f=q,r(/*! ./_object-gops */"./node_modules/core-js/library/modules/_object-gops.js").f=Z,o&&!r(/*! ./_library */"./node_modules/core-js/library/modules/_library.js")&&s(B,"propertyIsEnumerable",q,!0),p.f=function(e){return Y(h(e))}),a(a.G+a.W+a.F*!K,{Symbol:j});for(var Q="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;Q.length>ee;)h(Q[ee++]);for(Q=x(h.store),ee=0;Q.length>ee;)m(Q[ee++]);a(a.S+a.F*!K,"Symbol",{for:function(e){return i(N,e+="")?N[e]:N[e]=j(e)},keyFor:function(e){if(z(e))return g(N,e);throw TypeError(e+" is not a symbol!")},useSetter:function(){V=!0},useSimple:function(){V=!1}}),a(a.S+a.F*!K,"Object",{create:function(e,t){return void 0===t?T(e):$(T(e),t)},defineProperty:W,defineProperties:$,getOwnPropertyDescriptor:X,getOwnPropertyNames:J,getOwnPropertySymbols:Z}),P&&a(a.S+a.F*(!K||u((function(){var e=j();return"[null]"!=I([e])||"{}"!=I({a:e})||"{}"!=I(Object(e))}))),"JSON",{stringify:function(e){if(void 0!==e&&!z(e)){for(var t,r,n=[e],i=1;arguments.length>i;)n.push(arguments[i++]);return"function"==typeof(t=n[1])&&(r=t),!r&&v(t)||(t=function(e,t){if(r&&(t=r.call(this,e,t)),!z(t))return t}),n[1]=t,I.apply(P,n)}}}),j.prototype[D]||r(/*! ./_hide */"./node_modules/core-js/library/modules/_hide.js")(j.prototype,D,j.prototype.valueOf),d(j,"Symbol"),d(Math,"Math",!0),d(n.JSON,"JSON",!0)},"./node_modules/core-js/library/modules/es7.symbol.async-iterator.js": +/*! no static exports found */function(e,t,r){"use strict";var n=r(/*! ./_global */"./node_modules/core-js/library/modules/_global.js"),i=r(/*! ./_has */"./node_modules/core-js/library/modules/_has.js"),o=r(/*! ./_descriptors */"./node_modules/core-js/library/modules/_descriptors.js"),a=r(/*! ./_export */"./node_modules/core-js/library/modules/_export.js"),s=r(/*! ./_redefine */"./node_modules/core-js/library/modules/_redefine.js"),l=r(/*! ./_meta */"./node_modules/core-js/library/modules/_meta.js").KEY,u=r(/*! ./_fails */"./node_modules/core-js/library/modules/_fails.js"),c=r(/*! ./_shared */"./node_modules/core-js/library/modules/_shared.js"),d=r(/*! ./_set-to-string-tag */"./node_modules/core-js/library/modules/_set-to-string-tag.js"),f=r(/*! ./_uid */"./node_modules/core-js/library/modules/_uid.js"),h=r(/*! ./_wks */"./node_modules/core-js/library/modules/_wks.js"),p=r(/*! ./_wks-ext */"./node_modules/core-js/library/modules/_wks-ext.js"),m=r(/*! ./_wks-define */"./node_modules/core-js/library/modules/_wks-define.js"),g=r(/*! ./_keyof */"./node_modules/core-js/library/modules/_keyof.js"),y=r(/*! ./_enum-keys */"./node_modules/core-js/library/modules/_enum-keys.js"),v=r(/*! ./_is-array */"./node_modules/core-js/library/modules/_is-array.js"),b=r(/*! ./_an-object */"./node_modules/core-js/library/modules/_an-object.js"),_=r(/*! ./_to-iobject */"./node_modules/core-js/library/modules/_to-iobject.js"),A=r(/*! ./_to-primitive */"./node_modules/core-js/library/modules/_to-primitive.js"),E=r(/*! ./_property-desc */"./node_modules/core-js/library/modules/_property-desc.js"),T=r(/*! ./_object-create */"./node_modules/core-js/library/modules/_object-create.js"),S=r(/*! ./_object-gopn-ext */"./node_modules/core-js/library/modules/_object-gopn-ext.js"),w=r(/*! ./_object-gopd */"./node_modules/core-js/library/modules/_object-gopd.js"),k=r(/*! ./_object-dp */"./node_modules/core-js/library/modules/_object-dp.js"),C=r(/*! ./_object-keys */"./node_modules/core-js/library/modules/_object-keys.js"),x=w.f,R=k.f,L=S.f,j=n.Symbol,P=n.JSON,I=P&&P.stringify,O=h("_hidden"),D=h("toPrimitive"),M={}.propertyIsEnumerable,N=c("symbol-registry"),F=c("symbols"),U=c("op-symbols"),B=Object.prototype,K="function"==typeof j,G=n.QObject,V=!G||!G.prototype||!G.prototype.findChild,H=o&&u((function(){return 7!=T(R({},"a",{get:function(){return R(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=x(B,t);n&&delete B[t],R(e,t,r),n&&e!==B&&R(B,t,n)}:R,Y=function(e){var t=F[e]=T(j.prototype);return t._k=e,t},z=K&&"symbol"==typeof j.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof j},W=function(e,t,r){return e===B&&W(U,t,r),b(e),t=A(t,!0),b(r),i(F,t)?(r.enumerable?(i(e,O)&&e[O][t]&&(e[O][t]=!1),r=T(r,{enumerable:E(0,!1)})):(i(e,O)||R(e,O,E(1,{})),e[O][t]=!0),H(e,t,r)):R(e,t,r)},$=function(e,t){b(e);for(var r,n=y(t=_(t)),i=0,o=n.length;o>i;)W(e,r=n[i++],t[r]);return e},q=function(e){var t=M.call(this,e=A(e,!0));return!(this===B&&i(F,e)&&!i(U,e))&&(!(t||!i(this,e)||!i(F,e)||i(this,O)&&this[O][e])||t)},X=function(e,t){if(e=_(e),t=A(t,!0),e!==B||!i(F,t)||i(U,t)){var r=x(e,t);return!r||!i(F,t)||i(e,O)&&e[O][t]||(r.enumerable=!0),r}},J=function(e){for(var t,r=L(_(e)),n=[],o=0;r.length>o;)i(F,t=r[o++])||t==O||t==l||n.push(t);return n},Z=function(e){for(var t,r=e===B,n=L(r?U:_(e)),o=[],a=0;n.length>a;)!i(F,t=n[a++])||r&&!i(B,t)||o.push(F[t]);return o};K||(s((j=function(){if(this instanceof j)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(r){this===B&&t.call(U,r),i(this,O)&&i(this[O],e)&&(this[O][e]=!1),H(this,e,E(1,r))};return o&&V&&H(B,e,{configurable:!0,set:t}),Y(e)}).prototype,"toString",(function(){return this._k})),w.f=X,k.f=W,r(/*! ./_object-gopn */"./node_modules/core-js/library/modules/_object-gopn.js").f=S.f=J,r(/*! ./_object-pie */"./node_modules/core-js/library/modules/_object-pie.js").f=q,r(/*! ./_object-gops */"./node_modules/core-js/library/modules/_object-gops.js").f=Z,o&&!r(/*! ./_library */"./node_modules/core-js/library/modules/_library.js")&&s(B,"propertyIsEnumerable",q,!0),p.f=function(e){return Y(h(e))}),a(a.G+a.W+a.F*!K,{Symbol:j});for(var Q="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;Q.length>ee;)h(Q[ee++]);for(Q=C(h.store),ee=0;Q.length>ee;)m(Q[ee++]);a(a.S+a.F*!K,"Symbol",{for:function(e){return i(N,e+="")?N[e]:N[e]=j(e)},keyFor:function(e){if(z(e))return g(N,e);throw TypeError(e+" is not a symbol!")},useSetter:function(){V=!0},useSimple:function(){V=!1}}),a(a.S+a.F*!K,"Object",{create:function(e,t){return void 0===t?T(e):$(T(e),t)},defineProperty:W,defineProperties:$,getOwnPropertyDescriptor:X,getOwnPropertyNames:J,getOwnPropertySymbols:Z}),P&&a(a.S+a.F*(!K||u((function(){var e=j();return"[null]"!=I([e])||"{}"!=I({a:e})||"{}"!=I(Object(e))}))),"JSON",{stringify:function(e){if(void 0!==e&&!z(e)){for(var t,r,n=[e],i=1;arguments.length>i;)n.push(arguments[i++]);return"function"==typeof(t=n[1])&&(r=t),!r&&v(t)||(t=function(e,t){if(r&&(t=r.call(this,e,t)),!z(t))return t}),n[1]=t,I.apply(P,n)}}}),j.prototype[D]||r(/*! ./_hide */"./node_modules/core-js/library/modules/_hide.js")(j.prototype,D,j.prototype.valueOf),d(j,"Symbol"),d(Math,"Math",!0),d(n.JSON,"JSON",!0)},"./node_modules/core-js/library/modules/es7.symbol.async-iterator.js": /*!***************************************************************************!*\ !*** ./node_modules/core-js/library/modules/es7.symbol.async-iterator.js ***! \***************************************************************************/ @@ -541,7 +541,7 @@ !*** ./src/controller/audio-stream-controller.js ***! \***************************************************/ /*! no static exports found */ -/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";(function(e){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(/*! ../utils/binary-search */"./src/utils/binary-search.js"),a=r(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.js"),s=r(/*! ../demux/demuxer */"./src/demux/demuxer.js"),l=r(/*! ../events */"./src/events.js"),u=r(/*! ./level-helper */"./src/controller/level-helper.js"),c=r(/*! ../utils/time-ranges */"./src/utils/time-ranges.js"),d=r(/*! ../errors */"./src/errors.js"),f=r(/*! ../utils/logger */"./src/utils/logger.js"),h=r(/*! ../utils/discontinuities */"./src/utils/discontinuities.js"),p=r(/*! ./fragment-tracker */"./src/controller/fragment-tracker.js"),m=r(/*! ../loader/fragment */"./src/loader/fragment.js"),g=r(/*! ./base-stream-controller */"./src/controller/base-stream-controller.js"),y=window.performance,v=function(t){function r(e,r){var n=t.call(this,e,l.default.MEDIA_ATTACHED,l.default.MEDIA_DETACHING,l.default.AUDIO_TRACKS_UPDATED,l.default.AUDIO_TRACK_SWITCHING,l.default.AUDIO_TRACK_LOADED,l.default.KEY_LOADED,l.default.FRAG_LOADED,l.default.FRAG_PARSING_INIT_SEGMENT,l.default.FRAG_PARSING_DATA,l.default.FRAG_PARSED,l.default.ERROR,l.default.BUFFER_RESET,l.default.BUFFER_CREATED,l.default.BUFFER_APPENDED,l.default.BUFFER_FLUSHED,l.default.INIT_PTS_FOUND)||this;return n.fragmentTracker=r,n.config=e.config,n.audioCodecSwap=!1,n._state=g.State.STOPPED,n.initPTS=[],n.waitingFragment=null,n.videoTrackCC=null,n}return i(r,t),r.prototype.onHandlerDestroying=function(){this.stopLoad(),t.prototype.onHandlerDestroying.call(this)},r.prototype.onHandlerDestroyed=function(){this.state=g.State.STOPPED,this.fragmentTracker=null,t.prototype.onHandlerDestroyed.call(this)},r.prototype.onInitPtsFound=function(e){var t=e.id,r=e.frag.cc,n=e.initPTS;"main"===t&&(this.initPTS[r]=n,this.videoTrackCC=r,f.logger.log("InitPTS for cc: "+r+" found from video track: "+n),this.state===g.State.WAITING_INIT_PTS&&this.tick())},r.prototype.startLoad=function(e){if(this.tracks){var t=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),this.fragLoadError=0,t>0&&-1===e?(f.logger.log("audio:override startPosition with lastCurrentTime @"+t.toFixed(3)),this.state=g.State.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:e,this.state=g.State.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=e,this.state=g.State.STOPPED},r.prototype.stopLoad=function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragmentTracker.removeFragment(e),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=g.State.STOPPED},Object.defineProperty(r.prototype,"state",{get:function(){return this._state},set:function(e){if(this.state!==e){var t=this.state;this._state=e,f.logger.log("audio stream:"+t+"->"+e)}},enumerable:!0,configurable:!0}),r.prototype.doTick=function(){var t,r,n,i=this.hls,s=i.config;switch(this.state){case g.State.ERROR:case g.State.PAUSED:case g.State.BUFFER_FLUSHING:break;case g.State.STARTING:this.state=g.State.WAITING_TRACK,this.loadedmetadata=!1;break;case g.State.IDLE:var u=this.tracks;if(!u)break;if(!this.media&&(this.startFragRequested||!s.startFragPrefetch))break;if(this.loadedmetadata)t=this.media.currentTime;else if(void 0===(t=this.nextLoadPosition))break;var c=this.mediaBuffer?this.mediaBuffer:this.media,d=this.videoBuffer?this.videoBuffer:this.media,m=a.BufferHelper.bufferInfo(c,t,s.maxBufferHole),v=a.BufferHelper.bufferInfo(d,t,s.maxBufferHole),b=m.len,_=m.end,A=this.fragPrevious,E=Math.min(s.maxBufferLength,s.maxMaxBufferLength),T=Math.max(E,v.len),S=this.audioSwitch,w=this.trackId;if((b<T||S)&&w<u.length){if(void 0===(n=u[w].details)){this.state=g.State.WAITING_TRACK;break}if(!S&&this._streamEnded(m,n))return this.hls.trigger(l.default.BUFFER_EOS,{type:"audio"}),void(this.state=g.State.ENDED);var k=n.fragments,x=k.length,C=k[0].start,R=k[x-1].start+k[x-1].duration,L=void 0;if(S)if(n.live&&!n.PTSKnown)f.logger.log("switching audiotrack, live stream, unknown PTS,load first fragment"),_=0;else if(_=t,n.PTSKnown&&t<C){if(!(m.end>C||m.nextStart))return;f.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=C+.05}if(n.initSegment&&!n.initSegment.data)L=n.initSegment;else if(_<=C){if(L=k[0],null!==this.videoTrackCC&&L.cc!==this.videoTrackCC&&(L=h.findFragWithCC(k,this.videoTrackCC)),n.live&&L.loadIdx&&L.loadIdx===this.fragLoadIdx){var j=m.nextStart?m.nextStart:C;return f.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(j+.05)),void(this.media.currentTime=j+.05)}}else{var P=void 0,I=s.maxFragLookUpTolerance,O=A?k[A.sn-k[0].sn+1]:void 0,D=function(e){var t=Math.min(I,e.duration);return e.start+e.duration-t<=_?1:e.start-t>_&&e.start?-1:0};_<R?(_>R-I&&(I=0),P=O&&!D(O)?O:o.default.search(k,D)):P=k[x-1],P&&(L=P,C=P.start,A&&L.level===A.level&&L.sn===A.sn&&(L.sn<n.endSN?(L=k[L.sn+1-n.startSN],f.logger.log("SN just loaded, load next one: "+L.sn)):L=null))}L&&(L.encrypted?(f.logger.log("Loading key for "+L.sn+" of ["+n.startSN+" ,"+n.endSN+"],track "+w),this.state=g.State.KEY_LOADING,i.trigger(l.default.KEY_LOADING,{frag:L})):(f.logger.log("Loading "+L.sn+", cc: "+L.cc+" of ["+n.startSN+" ,"+n.endSN+"],track "+w+", currentTime:"+t+",bufferEnd:"+_.toFixed(3)),this.fragCurrent=L,(S||this.fragmentTracker.getState(L)===p.FragmentState.NOT_LOADED)&&(this.startFragRequested=!0,e.isFinite(L.sn)&&(this.nextLoadPosition=L.start+L.duration),i.trigger(l.default.FRAG_LOADING,{frag:L}),this.state=g.State.FRAG_LOADING)))}break;case g.State.WAITING_TRACK:(r=this.tracks[this.trackId])&&r.details&&(this.state=g.State.IDLE);break;case g.State.FRAG_LOADING_WAITING_RETRY:var M=y.now(),N=this.retryDate,U=(c=this.media)&&c.seeking;(!N||M>=N||U)&&(f.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=g.State.IDLE);break;case g.State.WAITING_INIT_PTS:var F=this.videoTrackCC;if(void 0===this.initPTS[F])break;var B=this.waitingFragment;if(B){var K=B.frag.cc;F!==K?(r=this.tracks[this.trackId]).details&&r.details.live&&(f.logger.warn("Waiting fragment CC ("+K+") does not match video track CC ("+F+")"),this.waitingFragment=null,this.state=g.State.IDLE):(this.state=g.State.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=g.State.IDLE;break;case g.State.STOPPED:case g.State.FRAG_LOADING:case g.State.PARSING:case g.State.PARSED:case g.State.ENDED:}},r.prototype.onMediaAttached=function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("ended",this.onvended);var r=this.config;this.tracks&&r.autoStartLoad&&this.startLoad(r.startPosition)},r.prototype.onMediaDetaching=function(){var e=this.media;e&&e.ended&&(f.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1,this.stopLoad()},r.prototype.onAudioTracksUpdated=function(e){f.logger.log("audio tracks updated"),this.tracks=e.audioTracks},r.prototype.onAudioTrackSwitching=function(e){var t=!!e.url;this.trackId=e.id,this.fragCurrent=null,this.state=g.State.PAUSED,this.waitingFragment=null,t?this.setInterval(100):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),t&&(this.audioSwitch=!0,this.state=g.State.IDLE),this.tick()},r.prototype.onAudioTrackLoaded=function(t){var r=t.details,n=t.id,i=this.tracks[n],o=r.totalduration,a=0;if(f.logger.log("track "+n+" loaded ["+r.startSN+","+r.endSN+"],duration:"+o),r.live){var s=i.details;s&&r.fragments.length>0?(u.mergeDetails(s,r),a=r.fragments[0].start,r.PTSKnown?f.logger.log("live audio playlist sliding:"+a.toFixed(3)):f.logger.log("live audio playlist - outdated PTS, unknown sliding")):(r.PTSKnown=!1,f.logger.log("live audio playlist - first load, unknown sliding"))}else r.PTSKnown=!1;if(i.details=r,!this.startFragRequested){if(-1===this.startPosition){var l=r.startTimeOffset;e.isFinite(l)?(f.logger.log("start time offset found in playlist, adjust startPosition to "+l),this.startPosition=l):this.startPosition=0}this.nextLoadPosition=this.startPosition}this.state===g.State.WAITING_TRACK&&(this.state=g.State.IDLE),this.tick()},r.prototype.onKeyLoaded=function(){this.state===g.State.KEY_LOADING&&(this.state=g.State.IDLE,this.tick())},r.prototype.onFragLoaded=function(e){var t=this.fragCurrent,r=e.frag;if(this.state===g.State.FRAG_LOADING&&t&&"audio"===r.type&&r.level===t.level&&r.sn===t.sn){var n=this.tracks[this.trackId],i=n.details,o=i.totalduration,a=t.level,u=t.sn,c=t.cc,d=this.config.defaultAudioCodec||n.audioCodec||"mp4a.40.2",h=this.stats=e.stats;if("initSegment"===u)this.state=g.State.IDLE,h.tparsed=h.tbuffered=y.now(),i.initSegment.data=e.payload,this.hls.trigger(l.default.FRAG_BUFFERED,{stats:h,frag:t,id:"audio"}),this.tick();else{this.state=g.State.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new s.default(this.hls,"audio"));var p=this.initPTS[c],m=i.initSegment?i.initSegment.data:[];i.initSegment||void 0!==p?(this.pendingBuffering=!0,f.logger.log("Demuxing "+u+" of ["+i.startSN+" ,"+i.endSN+"],track "+a),this.demuxer.push(e.payload,m,d,null,t,o,!1,p)):(f.logger.log("unknown video PTS for continuity counter "+c+", waiting for video PTS before demuxing audio frag "+u+" of ["+i.startSN+" ,"+i.endSN+"],track "+a),this.waitingFragment=e,this.state=g.State.WAITING_INIT_PTS)}}this.fragLoadError=0},r.prototype.onFragParsingInitSegment=function(e){var t=this.fragCurrent,r=e.frag;if(t&&"audio"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===g.State.PARSING){var n=e.tracks,i=void 0;if(n.video&&delete n.video,i=n.audio){i.levelCodec=i.codec,i.id=e.id,this.hls.trigger(l.default.BUFFER_CODECS,n),f.logger.log("audio track:audio,container:"+i.container+",codecs[level/parsed]=["+i.levelCodec+"/"+i.codec+"]");var o=i.initSegment;if(o){var a={type:"audio",data:o,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[a]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(l.default.BUFFER_APPENDING,a))}this.tick()}}},r.prototype.onFragParsingData=function(t){var r=this,n=this.fragCurrent,i=t.frag;if(n&&"audio"===t.id&&"audio"===t.type&&i.sn===n.sn&&i.level===n.level&&this.state===g.State.PARSING){var o=this.trackId,a=this.tracks[o],s=this.hls;e.isFinite(t.endPTS)||(t.endPTS=t.startPTS+n.duration,t.endDTS=t.startDTS+n.duration),n.addElementaryStream(m.default.ElementaryStreamTypes.AUDIO),f.logger.log("parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb),u.updateFragPTSDTS(a.details,n,t.startPTS,t.endPTS);var c=this.audioSwitch,h=this.media,p=!1;if(c&&h)if(h.readyState){var y=h.currentTime;f.logger.log("switching audio track : currentTime:"+y),y>=t.startPTS&&(f.logger.log("switching audio track : flushing all audio"),this.state=g.State.BUFFER_FLUSHING,s.trigger(l.default.BUFFER_FLUSHING,{startOffset:0,endOffset:e.POSITIVE_INFINITY,type:"audio"}),p=!0,this.audioSwitch=!1,s.trigger(l.default.AUDIO_TRACK_SWITCHED,{id:o}))}else this.audioSwitch=!1,s.trigger(l.default.AUDIO_TRACK_SWITCHED,{id:o});var v=this.pendingData;if(!v)return f.logger.warn("Apparently attempt to enqueue media payload without codec initialization data upfront"),void s.trigger(l.default.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:null,fatal:!0});this.audioSwitch||([t.data1,t.data2].forEach((function(e){e&&e.length&&v.push({type:t.type,data:e,parent:"audio",content:"data"})})),!p&&v.length&&(v.forEach((function(e){r.state===g.State.PARSING&&(r.pendingBuffering=!0,r.hls.trigger(l.default.BUFFER_APPENDING,e))})),this.pendingData=[],this.appended=!0)),this.tick()}},r.prototype.onFragParsed=function(e){var t=this.fragCurrent,r=e.frag;t&&"audio"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===g.State.PARSING&&(this.stats.tparsed=y.now(),this.state=g.State.PARSED,this._checkAppendedParsed())},r.prototype.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},r.prototype.onBufferCreated=function(e){var t=e.tracks.audio;t&&(this.mediaBuffer=t.buffer,this.loadedmetadata=!0),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer)},r.prototype.onBufferAppended=function(e){if("audio"===e.parent){var t=this.state;t!==g.State.PARSING&&t!==g.State.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}},r.prototype._checkAppendedParsed=function(){if(!(this.state!==g.State.PARSED||this.appended&&this.pendingBuffering)){var e=this.fragCurrent,t=this.stats,r=this.hls;if(e){this.fragPrevious=e,t.tbuffered=y.now(),r.trigger(l.default.FRAG_BUFFERED,{stats:t,frag:e,id:"audio"});var n=this.mediaBuffer?this.mediaBuffer:this.media;f.logger.log("audio buffered : "+c.default.toString(n.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,r.trigger(l.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=g.State.IDLE}this.tick()}},r.prototype.onError=function(t){var r=t.frag;if(!r||"audio"===r.type)switch(t.details){case d.ErrorDetails.FRAG_LOAD_ERROR:case d.ErrorDetails.FRAG_LOAD_TIMEOUT:var n=t.frag;if(n&&"audio"!==n.type)break;if(!t.fatal){var i=this.fragLoadError;if(i?i++:i=1,i<=(s=this.config).fragLoadingMaxRetry){this.fragLoadError=i;var o=Math.min(Math.pow(2,i-1)*s.fragLoadingRetryDelay,s.fragLoadingMaxRetryTimeout);f.logger.warn("AudioStreamController: frag loading failed, retry in "+o+" ms"),this.retryDate=y.now()+o,this.state=g.State.FRAG_LOADING_WAITING_RETRY}else f.logger.error("AudioStreamController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=g.State.ERROR}break;case d.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case d.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case d.ErrorDetails.KEY_LOAD_ERROR:case d.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==g.State.ERROR&&(this.state=t.fatal?g.State.ERROR:g.State.IDLE,f.logger.warn("AudioStreamController: "+t.details+" while loading frag, now switching to "+this.state+" state ..."));break;case d.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===t.parent&&(this.state===g.State.PARSING||this.state===g.State.PARSED)){var s,u=this.mediaBuffer,c=this.media.currentTime;u&&a.BufferHelper.isBuffered(u,c)&&a.BufferHelper.isBuffered(u,c+.5)?((s=this.config).maxMaxBufferLength>=s.maxBufferLength&&(s.maxMaxBufferLength/=2,f.logger.warn("AudioStreamController: reduce max buffer length to "+s.maxMaxBufferLength+"s")),this.state=g.State.IDLE):(f.logger.warn("AudioStreamController: buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=g.State.BUFFER_FLUSHING,this.hls.trigger(l.default.BUFFER_FLUSHING,{startOffset:0,endOffset:e.POSITIVE_INFINITY,type:"audio"}))}}},r.prototype.onBufferFlushed=function(){var e=this,t=this.pendingData;t&&t.length?(f.logger.log("AudioStreamController: appending pending audio data after buffer flushed"),t.forEach((function(t){e.hls.trigger(l.default.BUFFER_APPENDING,t)})),this.appended=!0,this.pendingData=[],this.state=g.State.PARSED):(this.state=g.State.IDLE,this.fragPrevious=null,this.tick())},r}(g.default);t.default=v}).call(this,r(/*! ./src/polyfills/number */"./src/polyfills/number.js").Number)},"./src/controller/audio-track-controller.js": +/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";(function(e){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(/*! ../utils/binary-search */"./src/utils/binary-search.js"),a=r(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.js"),s=r(/*! ../demux/demuxer */"./src/demux/demuxer.js"),l=r(/*! ../events */"./src/events.js"),u=r(/*! ./level-helper */"./src/controller/level-helper.js"),c=r(/*! ../utils/time-ranges */"./src/utils/time-ranges.js"),d=r(/*! ../errors */"./src/errors.js"),f=r(/*! ../utils/logger */"./src/utils/logger.js"),h=r(/*! ../utils/discontinuities */"./src/utils/discontinuities.js"),p=r(/*! ./fragment-tracker */"./src/controller/fragment-tracker.js"),m=r(/*! ../loader/fragment */"./src/loader/fragment.js"),g=r(/*! ./base-stream-controller */"./src/controller/base-stream-controller.js"),y=window.performance,v=function(t){function r(e,r){var n=t.call(this,e,l.default.MEDIA_ATTACHED,l.default.MEDIA_DETACHING,l.default.AUDIO_TRACKS_UPDATED,l.default.AUDIO_TRACK_SWITCHING,l.default.AUDIO_TRACK_LOADED,l.default.KEY_LOADED,l.default.FRAG_LOADED,l.default.FRAG_PARSING_INIT_SEGMENT,l.default.FRAG_PARSING_DATA,l.default.FRAG_PARSED,l.default.ERROR,l.default.BUFFER_RESET,l.default.BUFFER_CREATED,l.default.BUFFER_APPENDED,l.default.BUFFER_FLUSHED,l.default.INIT_PTS_FOUND)||this;return n.fragmentTracker=r,n.config=e.config,n.audioCodecSwap=!1,n._state=g.State.STOPPED,n.initPTS=[],n.waitingFragment=null,n.videoTrackCC=null,n}return i(r,t),r.prototype.onHandlerDestroying=function(){this.stopLoad(),t.prototype.onHandlerDestroying.call(this)},r.prototype.onHandlerDestroyed=function(){this.state=g.State.STOPPED,this.fragmentTracker=null,t.prototype.onHandlerDestroyed.call(this)},r.prototype.onInitPtsFound=function(e){var t=e.id,r=e.frag.cc,n=e.initPTS;"main"===t&&(this.initPTS[r]=n,this.videoTrackCC=r,f.logger.log("InitPTS for cc: "+r+" found from video track: "+n),this.state===g.State.WAITING_INIT_PTS&&this.tick())},r.prototype.startLoad=function(e){if(this.tracks){var t=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),this.fragLoadError=0,t>0&&-1===e?(f.logger.log("audio:override startPosition with lastCurrentTime @"+t.toFixed(3)),this.state=g.State.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:e,this.state=g.State.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=e,this.state=g.State.STOPPED},r.prototype.stopLoad=function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragmentTracker.removeFragment(e),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=g.State.STOPPED},Object.defineProperty(r.prototype,"state",{get:function(){return this._state},set:function(e){if(this.state!==e){var t=this.state;this._state=e,f.logger.log("audio stream:"+t+"->"+e)}},enumerable:!0,configurable:!0}),r.prototype.doTick=function(){var t,r,n,i=this.hls,s=i.config;switch(this.state){case g.State.ERROR:case g.State.PAUSED:case g.State.BUFFER_FLUSHING:break;case g.State.STARTING:this.state=g.State.WAITING_TRACK,this.loadedmetadata=!1;break;case g.State.IDLE:var u=this.tracks;if(!u)break;if(!this.media&&(this.startFragRequested||!s.startFragPrefetch))break;if(this.loadedmetadata)t=this.media.currentTime;else if(void 0===(t=this.nextLoadPosition))break;var c=this.mediaBuffer?this.mediaBuffer:this.media,d=this.videoBuffer?this.videoBuffer:this.media,m=a.BufferHelper.bufferInfo(c,t,s.maxBufferHole),v=a.BufferHelper.bufferInfo(d,t,s.maxBufferHole),b=m.len,_=m.end,A=this.fragPrevious,E=Math.min(s.maxBufferLength,s.maxMaxBufferLength),T=Math.max(E,v.len),S=this.audioSwitch,w=this.trackId;if((b<T||S)&&w<u.length){if(void 0===(n=u[w].details)){this.state=g.State.WAITING_TRACK;break}if(!S&&this._streamEnded(m,n))return this.hls.trigger(l.default.BUFFER_EOS,{type:"audio"}),void(this.state=g.State.ENDED);var k=n.fragments,C=k.length,x=k[0].start,R=k[C-1].start+k[C-1].duration,L=void 0;if(S)if(n.live&&!n.PTSKnown)f.logger.log("switching audiotrack, live stream, unknown PTS,load first fragment"),_=0;else if(_=t,n.PTSKnown&&t<x){if(!(m.end>x||m.nextStart))return;f.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=x+.05}if(n.initSegment&&!n.initSegment.data)L=n.initSegment;else if(_<=x){if(L=k[0],null!==this.videoTrackCC&&L.cc!==this.videoTrackCC&&(L=h.findFragWithCC(k,this.videoTrackCC)),n.live&&L.loadIdx&&L.loadIdx===this.fragLoadIdx){var j=m.nextStart?m.nextStart:x;return f.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(j+.05)),void(this.media.currentTime=j+.05)}}else{var P=void 0,I=s.maxFragLookUpTolerance,O=A?k[A.sn-k[0].sn+1]:void 0,D=function(e){var t=Math.min(I,e.duration);return e.start+e.duration-t<=_?1:e.start-t>_&&e.start?-1:0};_<R?(_>R-I&&(I=0),P=O&&!D(O)?O:o.default.search(k,D)):P=k[C-1],P&&(L=P,x=P.start,A&&L.level===A.level&&L.sn===A.sn&&(L.sn<n.endSN?(L=k[L.sn+1-n.startSN],f.logger.log("SN just loaded, load next one: "+L.sn)):L=null))}L&&(L.encrypted?(f.logger.log("Loading key for "+L.sn+" of ["+n.startSN+" ,"+n.endSN+"],track "+w),this.state=g.State.KEY_LOADING,i.trigger(l.default.KEY_LOADING,{frag:L})):(f.logger.log("Loading "+L.sn+", cc: "+L.cc+" of ["+n.startSN+" ,"+n.endSN+"],track "+w+", currentTime:"+t+",bufferEnd:"+_.toFixed(3)),this.fragCurrent=L,(S||this.fragmentTracker.getState(L)===p.FragmentState.NOT_LOADED)&&(this.startFragRequested=!0,e.isFinite(L.sn)&&(this.nextLoadPosition=L.start+L.duration),i.trigger(l.default.FRAG_LOADING,{frag:L}),this.state=g.State.FRAG_LOADING)))}break;case g.State.WAITING_TRACK:(r=this.tracks[this.trackId])&&r.details&&(this.state=g.State.IDLE);break;case g.State.FRAG_LOADING_WAITING_RETRY:var M=y.now(),N=this.retryDate,F=(c=this.media)&&c.seeking;(!N||M>=N||F)&&(f.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=g.State.IDLE);break;case g.State.WAITING_INIT_PTS:var U=this.videoTrackCC;if(void 0===this.initPTS[U])break;var B=this.waitingFragment;if(B){var K=B.frag.cc;U!==K?(r=this.tracks[this.trackId]).details&&r.details.live&&(f.logger.warn("Waiting fragment CC ("+K+") does not match video track CC ("+U+")"),this.waitingFragment=null,this.state=g.State.IDLE):(this.state=g.State.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=g.State.IDLE;break;case g.State.STOPPED:case g.State.FRAG_LOADING:case g.State.PARSING:case g.State.PARSED:case g.State.ENDED:}},r.prototype.onMediaAttached=function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("ended",this.onvended);var r=this.config;this.tracks&&r.autoStartLoad&&this.startLoad(r.startPosition)},r.prototype.onMediaDetaching=function(){var e=this.media;e&&e.ended&&(f.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1,this.stopLoad()},r.prototype.onAudioTracksUpdated=function(e){f.logger.log("audio tracks updated"),this.tracks=e.audioTracks},r.prototype.onAudioTrackSwitching=function(e){var t=!!e.url;this.trackId=e.id,this.fragCurrent=null,this.state=g.State.PAUSED,this.waitingFragment=null,t?this.setInterval(100):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),t&&(this.audioSwitch=!0,this.state=g.State.IDLE),this.tick()},r.prototype.onAudioTrackLoaded=function(t){var r=t.details,n=t.id,i=this.tracks[n],o=r.totalduration,a=0;if(f.logger.log("track "+n+" loaded ["+r.startSN+","+r.endSN+"],duration:"+o),r.live){var s=i.details;s&&r.fragments.length>0?(u.mergeDetails(s,r),a=r.fragments[0].start,r.PTSKnown?f.logger.log("live audio playlist sliding:"+a.toFixed(3)):f.logger.log("live audio playlist - outdated PTS, unknown sliding")):(r.PTSKnown=!1,f.logger.log("live audio playlist - first load, unknown sliding"))}else r.PTSKnown=!1;if(i.details=r,!this.startFragRequested){if(-1===this.startPosition){var l=r.startTimeOffset;e.isFinite(l)?(f.logger.log("start time offset found in playlist, adjust startPosition to "+l),this.startPosition=l):this.startPosition=0}this.nextLoadPosition=this.startPosition}this.state===g.State.WAITING_TRACK&&(this.state=g.State.IDLE),this.tick()},r.prototype.onKeyLoaded=function(){this.state===g.State.KEY_LOADING&&(this.state=g.State.IDLE,this.tick())},r.prototype.onFragLoaded=function(e){var t=this.fragCurrent,r=e.frag;if(this.state===g.State.FRAG_LOADING&&t&&"audio"===r.type&&r.level===t.level&&r.sn===t.sn){var n=this.tracks[this.trackId],i=n.details,o=i.totalduration,a=t.level,u=t.sn,c=t.cc,d=this.config.defaultAudioCodec||n.audioCodec||"mp4a.40.2",h=this.stats=e.stats;if("initSegment"===u)this.state=g.State.IDLE,h.tparsed=h.tbuffered=y.now(),i.initSegment.data=e.payload,this.hls.trigger(l.default.FRAG_BUFFERED,{stats:h,frag:t,id:"audio"}),this.tick();else{this.state=g.State.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new s.default(this.hls,"audio"));var p=this.initPTS[c],m=i.initSegment?i.initSegment.data:[];i.initSegment||void 0!==p?(this.pendingBuffering=!0,f.logger.log("Demuxing "+u+" of ["+i.startSN+" ,"+i.endSN+"],track "+a),this.demuxer.push(e.payload,m,d,null,t,o,!1,p)):(f.logger.log("unknown video PTS for continuity counter "+c+", waiting for video PTS before demuxing audio frag "+u+" of ["+i.startSN+" ,"+i.endSN+"],track "+a),this.waitingFragment=e,this.state=g.State.WAITING_INIT_PTS)}}this.fragLoadError=0},r.prototype.onFragParsingInitSegment=function(e){var t=this.fragCurrent,r=e.frag;if(t&&"audio"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===g.State.PARSING){var n=e.tracks,i=void 0;if(n.video&&delete n.video,i=n.audio){i.levelCodec=i.codec,i.id=e.id,this.hls.trigger(l.default.BUFFER_CODECS,n),f.logger.log("audio track:audio,container:"+i.container+",codecs[level/parsed]=["+i.levelCodec+"/"+i.codec+"]");var o=i.initSegment;if(o){var a={type:"audio",data:o,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[a]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(l.default.BUFFER_APPENDING,a))}this.tick()}}},r.prototype.onFragParsingData=function(t){var r=this,n=this.fragCurrent,i=t.frag;if(n&&"audio"===t.id&&"audio"===t.type&&i.sn===n.sn&&i.level===n.level&&this.state===g.State.PARSING){var o=this.trackId,a=this.tracks[o],s=this.hls;e.isFinite(t.endPTS)||(t.endPTS=t.startPTS+n.duration,t.endDTS=t.startDTS+n.duration),n.addElementaryStream(m.default.ElementaryStreamTypes.AUDIO),f.logger.log("parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb),u.updateFragPTSDTS(a.details,n,t.startPTS,t.endPTS);var c=this.audioSwitch,h=this.media,p=!1;if(c&&h)if(h.readyState){var y=h.currentTime;f.logger.log("switching audio track : currentTime:"+y),y>=t.startPTS&&(f.logger.log("switching audio track : flushing all audio"),this.state=g.State.BUFFER_FLUSHING,s.trigger(l.default.BUFFER_FLUSHING,{startOffset:0,endOffset:e.POSITIVE_INFINITY,type:"audio"}),p=!0,this.audioSwitch=!1,s.trigger(l.default.AUDIO_TRACK_SWITCHED,{id:o}))}else this.audioSwitch=!1,s.trigger(l.default.AUDIO_TRACK_SWITCHED,{id:o});var v=this.pendingData;if(!v)return f.logger.warn("Apparently attempt to enqueue media payload without codec initialization data upfront"),void s.trigger(l.default.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:null,fatal:!0});this.audioSwitch||([t.data1,t.data2].forEach((function(e){e&&e.length&&v.push({type:t.type,data:e,parent:"audio",content:"data"})})),!p&&v.length&&(v.forEach((function(e){r.state===g.State.PARSING&&(r.pendingBuffering=!0,r.hls.trigger(l.default.BUFFER_APPENDING,e))})),this.pendingData=[],this.appended=!0)),this.tick()}},r.prototype.onFragParsed=function(e){var t=this.fragCurrent,r=e.frag;t&&"audio"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===g.State.PARSING&&(this.stats.tparsed=y.now(),this.state=g.State.PARSED,this._checkAppendedParsed())},r.prototype.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},r.prototype.onBufferCreated=function(e){var t=e.tracks.audio;t&&(this.mediaBuffer=t.buffer,this.loadedmetadata=!0),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer)},r.prototype.onBufferAppended=function(e){if("audio"===e.parent){var t=this.state;t!==g.State.PARSING&&t!==g.State.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}},r.prototype._checkAppendedParsed=function(){if(!(this.state!==g.State.PARSED||this.appended&&this.pendingBuffering)){var e=this.fragCurrent,t=this.stats,r=this.hls;if(e){this.fragPrevious=e,t.tbuffered=y.now(),r.trigger(l.default.FRAG_BUFFERED,{stats:t,frag:e,id:"audio"});var n=this.mediaBuffer?this.mediaBuffer:this.media;f.logger.log("audio buffered : "+c.default.toString(n.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,r.trigger(l.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=g.State.IDLE}this.tick()}},r.prototype.onError=function(t){var r=t.frag;if(!r||"audio"===r.type)switch(t.details){case d.ErrorDetails.FRAG_LOAD_ERROR:case d.ErrorDetails.FRAG_LOAD_TIMEOUT:var n=t.frag;if(n&&"audio"!==n.type)break;if(!t.fatal){var i=this.fragLoadError;if(i?i++:i=1,i<=(s=this.config).fragLoadingMaxRetry){this.fragLoadError=i;var o=Math.min(Math.pow(2,i-1)*s.fragLoadingRetryDelay,s.fragLoadingMaxRetryTimeout);f.logger.warn("AudioStreamController: frag loading failed, retry in "+o+" ms"),this.retryDate=y.now()+o,this.state=g.State.FRAG_LOADING_WAITING_RETRY}else f.logger.error("AudioStreamController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=g.State.ERROR}break;case d.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case d.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case d.ErrorDetails.KEY_LOAD_ERROR:case d.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==g.State.ERROR&&(this.state=t.fatal?g.State.ERROR:g.State.IDLE,f.logger.warn("AudioStreamController: "+t.details+" while loading frag, now switching to "+this.state+" state ..."));break;case d.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===t.parent&&(this.state===g.State.PARSING||this.state===g.State.PARSED)){var s,u=this.mediaBuffer,c=this.media.currentTime;u&&a.BufferHelper.isBuffered(u,c)&&a.BufferHelper.isBuffered(u,c+.5)?((s=this.config).maxMaxBufferLength>=s.maxBufferLength&&(s.maxMaxBufferLength/=2,f.logger.warn("AudioStreamController: reduce max buffer length to "+s.maxMaxBufferLength+"s")),this.state=g.State.IDLE):(f.logger.warn("AudioStreamController: buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=g.State.BUFFER_FLUSHING,this.hls.trigger(l.default.BUFFER_FLUSHING,{startOffset:0,endOffset:e.POSITIVE_INFINITY,type:"audio"}))}}},r.prototype.onBufferFlushed=function(){var e=this,t=this.pendingData;t&&t.length?(f.logger.log("AudioStreamController: appending pending audio data after buffer flushed"),t.forEach((function(t){e.hls.trigger(l.default.BUFFER_APPENDING,t)})),this.appended=!0,this.pendingData=[],this.state=g.State.PARSED):(this.state=g.State.IDLE,this.fragPrevious=null,this.tick())},r}(g.default);t.default=v}).call(this,r(/*! ./src/polyfills/number */"./src/polyfills/number.js").Number)},"./src/controller/audio-track-controller.js": /*!**************************************************!*\ !*** ./src/controller/audio-track-controller.js ***! \**************************************************/ @@ -631,7 +631,7 @@ !*** ./src/crypt/aes-decryptor.js ***! \************************************/ /*! no static exports found */ -/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function n(e){var t=e.byteLength,r=t&&new DataView(e).getUint8(t-1);return r?e.slice(0,t-r):e}Object.defineProperty(t,"__esModule",{value:!0}),t.removePadding=n;var i=function(){function e(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.initTable()}return e.prototype.uint8ArrayToUint32Array_=function(e){for(var t=new DataView(e),r=new Uint32Array(4),n=0;n<4;n++)r[n]=t.getUint32(4*n);return r},e.prototype.initTable=function(){var e=this.sBox,t=this.invSBox,r=this.subMix,n=r[0],i=r[1],o=r[2],a=r[3],s=this.invSubMix,l=s[0],u=s[1],c=s[2],d=s[3],f=new Uint32Array(256),h=0,p=0,m=0;for(m=0;m<256;m++)f[m]=m<128?m<<1:m<<1^283;for(m=0;m<256;m++){var g=p^p<<1^p<<2^p<<3^p<<4;g=g>>>8^255&g^99,e[h]=g,t[g]=h;var y=f[h],v=f[y],b=f[v],_=257*f[g]^16843008*g;n[h]=_<<24|_>>>8,i[h]=_<<16|_>>>16,o[h]=_<<8|_>>>24,a[h]=_,_=16843009*b^65537*v^257*y^16843008*h,l[g]=_<<24|_>>>8,u[g]=_<<16|_>>>16,c[g]=_<<8|_>>>24,d[g]=_,h?(h=y^f[f[f[b^y]]],p^=f[f[p]]):h=p=1}},e.prototype.expandKey=function(e){for(var t=this.uint8ArrayToUint32Array_(e),r=!0,n=0;n<t.length&&r;)r=t[n]===this.key[n],n++;if(!r){this.key=t;var i=this.keySize=t.length;if(4!==i&&6!==i&&8!==i)throw new Error("Invalid aes key size="+i);var o,a,s,l,u=this.ksRows=4*(i+6+1),c=this.keySchedule=new Uint32Array(u),d=this.invKeySchedule=new Uint32Array(u),f=this.sBox,h=this.rcon,p=this.invSubMix,m=p[0],g=p[1],y=p[2],v=p[3];for(o=0;o<u;o++)o<i?s=c[o]=t[o]:(l=s,o%i==0?(l=f[(l=l<<8|l>>>24)>>>24]<<24|f[l>>>16&255]<<16|f[l>>>8&255]<<8|f[255&l],l^=h[o/i|0]<<24):i>6&&o%i==4&&(l=f[l>>>24]<<24|f[l>>>16&255]<<16|f[l>>>8&255]<<8|f[255&l]),c[o]=s=(c[o-i]^l)>>>0);for(a=0;a<u;a++)o=u-a,l=3&a?c[o]:c[o-4],d[a]=a<4||o<=4?l:m[f[l>>>24]]^g[f[l>>>16&255]]^y[f[l>>>8&255]]^v[f[255&l]],d[a]=d[a]>>>0}},e.prototype.networkToHostOrderSwap=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},e.prototype.decrypt=function(e,t,r,i){for(var o,a,s,l,u,c,d,f,h,p,m,g,y,v,b=this.keySize+6,_=this.invKeySchedule,A=this.invSBox,E=this.invSubMix,T=E[0],S=E[1],w=E[2],k=E[3],x=this.uint8ArrayToUint32Array_(r),C=x[0],R=x[1],L=x[2],j=x[3],P=new Int32Array(e),I=new Int32Array(P.length),O=this.networkToHostOrderSwap;t<P.length;){for(h=O(P[t]),p=O(P[t+1]),m=O(P[t+2]),g=O(P[t+3]),u=h^_[0],c=g^_[1],d=m^_[2],f=p^_[3],y=4,v=1;v<b;v++)o=T[u>>>24]^S[c>>16&255]^w[d>>8&255]^k[255&f]^_[y],a=T[c>>>24]^S[d>>16&255]^w[f>>8&255]^k[255&u]^_[y+1],s=T[d>>>24]^S[f>>16&255]^w[u>>8&255]^k[255&c]^_[y+2],l=T[f>>>24]^S[u>>16&255]^w[c>>8&255]^k[255&d]^_[y+3],u=o,c=a,d=s,f=l,y+=4;o=A[u>>>24]<<24^A[c>>16&255]<<16^A[d>>8&255]<<8^A[255&f]^_[y],a=A[c>>>24]<<24^A[d>>16&255]<<16^A[f>>8&255]<<8^A[255&u]^_[y+1],s=A[d>>>24]<<24^A[f>>16&255]<<16^A[u>>8&255]<<8^A[255&c]^_[y+2],l=A[f>>>24]<<24^A[u>>16&255]<<16^A[c>>8&255]<<8^A[255&d]^_[y+3],y+=3,I[t]=O(o^C),I[t+1]=O(l^R),I[t+2]=O(s^L),I[t+3]=O(a^j),C=h,R=p,L=m,j=g,t+=4}return i?n(I.buffer):I.buffer},e.prototype.destroy=function(){this.key=void 0,this.keySize=void 0,this.ksRows=void 0,this.sBox=void 0,this.invSBox=void 0,this.subMix=void 0,this.invSubMix=void 0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.rcon=void 0},e}();t.default=i},"./src/crypt/decrypter.js": +/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";function n(e){var t=e.byteLength,r=t&&new DataView(e).getUint8(t-1);return r?e.slice(0,t-r):e}Object.defineProperty(t,"__esModule",{value:!0}),t.removePadding=n;var i=function(){function e(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.initTable()}return e.prototype.uint8ArrayToUint32Array_=function(e){for(var t=new DataView(e),r=new Uint32Array(4),n=0;n<4;n++)r[n]=t.getUint32(4*n);return r},e.prototype.initTable=function(){var e=this.sBox,t=this.invSBox,r=this.subMix,n=r[0],i=r[1],o=r[2],a=r[3],s=this.invSubMix,l=s[0],u=s[1],c=s[2],d=s[3],f=new Uint32Array(256),h=0,p=0,m=0;for(m=0;m<256;m++)f[m]=m<128?m<<1:m<<1^283;for(m=0;m<256;m++){var g=p^p<<1^p<<2^p<<3^p<<4;g=g>>>8^255&g^99,e[h]=g,t[g]=h;var y=f[h],v=f[y],b=f[v],_=257*f[g]^16843008*g;n[h]=_<<24|_>>>8,i[h]=_<<16|_>>>16,o[h]=_<<8|_>>>24,a[h]=_,_=16843009*b^65537*v^257*y^16843008*h,l[g]=_<<24|_>>>8,u[g]=_<<16|_>>>16,c[g]=_<<8|_>>>24,d[g]=_,h?(h=y^f[f[f[b^y]]],p^=f[f[p]]):h=p=1}},e.prototype.expandKey=function(e){for(var t=this.uint8ArrayToUint32Array_(e),r=!0,n=0;n<t.length&&r;)r=t[n]===this.key[n],n++;if(!r){this.key=t;var i=this.keySize=t.length;if(4!==i&&6!==i&&8!==i)throw new Error("Invalid aes key size="+i);var o,a,s,l,u=this.ksRows=4*(i+6+1),c=this.keySchedule=new Uint32Array(u),d=this.invKeySchedule=new Uint32Array(u),f=this.sBox,h=this.rcon,p=this.invSubMix,m=p[0],g=p[1],y=p[2],v=p[3];for(o=0;o<u;o++)o<i?s=c[o]=t[o]:(l=s,o%i==0?(l=f[(l=l<<8|l>>>24)>>>24]<<24|f[l>>>16&255]<<16|f[l>>>8&255]<<8|f[255&l],l^=h[o/i|0]<<24):i>6&&o%i==4&&(l=f[l>>>24]<<24|f[l>>>16&255]<<16|f[l>>>8&255]<<8|f[255&l]),c[o]=s=(c[o-i]^l)>>>0);for(a=0;a<u;a++)o=u-a,l=3&a?c[o]:c[o-4],d[a]=a<4||o<=4?l:m[f[l>>>24]]^g[f[l>>>16&255]]^y[f[l>>>8&255]]^v[f[255&l]],d[a]=d[a]>>>0}},e.prototype.networkToHostOrderSwap=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},e.prototype.decrypt=function(e,t,r,i){for(var o,a,s,l,u,c,d,f,h,p,m,g,y,v,b=this.keySize+6,_=this.invKeySchedule,A=this.invSBox,E=this.invSubMix,T=E[0],S=E[1],w=E[2],k=E[3],C=this.uint8ArrayToUint32Array_(r),x=C[0],R=C[1],L=C[2],j=C[3],P=new Int32Array(e),I=new Int32Array(P.length),O=this.networkToHostOrderSwap;t<P.length;){for(h=O(P[t]),p=O(P[t+1]),m=O(P[t+2]),g=O(P[t+3]),u=h^_[0],c=g^_[1],d=m^_[2],f=p^_[3],y=4,v=1;v<b;v++)o=T[u>>>24]^S[c>>16&255]^w[d>>8&255]^k[255&f]^_[y],a=T[c>>>24]^S[d>>16&255]^w[f>>8&255]^k[255&u]^_[y+1],s=T[d>>>24]^S[f>>16&255]^w[u>>8&255]^k[255&c]^_[y+2],l=T[f>>>24]^S[u>>16&255]^w[c>>8&255]^k[255&d]^_[y+3],u=o,c=a,d=s,f=l,y+=4;o=A[u>>>24]<<24^A[c>>16&255]<<16^A[d>>8&255]<<8^A[255&f]^_[y],a=A[c>>>24]<<24^A[d>>16&255]<<16^A[f>>8&255]<<8^A[255&u]^_[y+1],s=A[d>>>24]<<24^A[f>>16&255]<<16^A[u>>8&255]<<8^A[255&c]^_[y+2],l=A[f>>>24]<<24^A[u>>16&255]<<16^A[c>>8&255]<<8^A[255&d]^_[y+3],y+=3,I[t]=O(o^x),I[t+1]=O(l^R),I[t+2]=O(s^L),I[t+3]=O(a^j),x=h,R=p,L=m,j=g,t+=4}return i?n(I.buffer):I.buffer},e.prototype.destroy=function(){this.key=void 0,this.keySize=void 0,this.ksRows=void 0,this.sBox=void 0,this.invSBox=void 0,this.subMix=void 0,this.invSubMix=void 0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.rcon=void 0},e}();t.default=i},"./src/crypt/decrypter.js": /*!********************************!*\ !*** ./src/crypt/decrypter.js ***! \********************************/ @@ -656,7 +656,7 @@ !*** ./src/demux/demuxer-inline.js ***! \*************************************/ /*! no static exports found */ -/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(/*! ../events */"./src/events.js"),o=r(/*! ../errors */"./src/errors.js"),a=r(/*! ../crypt/decrypter */"./src/crypt/decrypter.js"),s=r(/*! ../demux/aacdemuxer */"./src/demux/aacdemuxer.js"),l=r(/*! ../demux/mp4demuxer */"./src/demux/mp4demuxer.js"),u=r(/*! ../demux/tsdemuxer */"./src/demux/tsdemuxer.js"),c=r(/*! ../demux/mp3demuxer */"./src/demux/mp3demuxer.js"),d=r(/*! ../remux/mp4-remuxer */"./src/remux/mp4-remuxer.js"),f=r(/*! ../remux/passthrough-remuxer */"./src/remux/passthrough-remuxer.js"),h=r(/*! ../utils/get-self-scope */"./src/utils/get-self-scope.js"),p=r(/*! ../utils/logger */"./src/utils/logger.js"),m=h.getSelfScope();try{n=m.performance.now.bind(m.performance)}catch(e){p.logger.debug("Unable to use Performance API on this environment"),n=m.Date.now}var g=function(){function e(e,t,r,n){this.observer=e,this.typeSupported=t,this.config=r,this.vendor=n}return e.prototype.destroy=function(){var e=this.demuxer;e&&e.destroy()},e.prototype.push=function(e,t,r,o,s,l,u,c,d,f,h,p){var m=this;if(e.byteLength>0&&null!=t&&null!=t.key&&"AES-128"===t.method){var g=this.decrypter;null==g&&(g=this.decrypter=new a.default(this.observer,this.config));var y=n();g.decrypt(e,t.key.buffer,t.iv.buffer,(function(e){var a=n();m.observer.trigger(i.default.FRAG_DECRYPTED,{stats:{tstart:y,tdecrypt:a}}),m.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),o,s,l,u,c,d,f,h,p)}))}else this.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),o,s,l,u,c,d,f,h,p)},e.prototype.pushDecrypted=function(e,t,r,n,a,h,p,m,g,y,v,b){var _=this.demuxer;if(!_||(p||m)&&!this.probe(e)){for(var A=this.observer,E=this.typeSupported,T=this.config,S=[{demux:u.default,remux:d.default},{demux:l.default,remux:f.default},{demux:s.default,remux:d.default},{demux:c.default,remux:d.default}],w=0,k=S.length;w<k;w++){var x=S[w],C=x.demux.probe;if(C(e)){var R=this.remuxer=new x.remux(A,T,E,this.vendor);_=new x.demux(A,R,T,E),this.probe=C;break}}if(!_)return void A.trigger(i.default.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});this.demuxer=_}var L=this.remuxer;(p||m)&&(_.resetInitSegment(r,n,a,y),L.resetInitSegment()),p&&(_.resetTimeStamp(b),L.resetTimeStamp(b)),"function"==typeof _.setDecryptData&&_.setDecryptData(t),_.append(e,h,g,v)},e}();t.default=g},"./src/demux/demuxer-worker.js": +/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(/*! ../events */"./src/events.js"),o=r(/*! ../errors */"./src/errors.js"),a=r(/*! ../crypt/decrypter */"./src/crypt/decrypter.js"),s=r(/*! ../demux/aacdemuxer */"./src/demux/aacdemuxer.js"),l=r(/*! ../demux/mp4demuxer */"./src/demux/mp4demuxer.js"),u=r(/*! ../demux/tsdemuxer */"./src/demux/tsdemuxer.js"),c=r(/*! ../demux/mp3demuxer */"./src/demux/mp3demuxer.js"),d=r(/*! ../remux/mp4-remuxer */"./src/remux/mp4-remuxer.js"),f=r(/*! ../remux/passthrough-remuxer */"./src/remux/passthrough-remuxer.js"),h=r(/*! ../utils/get-self-scope */"./src/utils/get-self-scope.js"),p=r(/*! ../utils/logger */"./src/utils/logger.js"),m=h.getSelfScope();try{n=m.performance.now.bind(m.performance)}catch(e){p.logger.debug("Unable to use Performance API on this environment"),n=m.Date.now}var g=function(){function e(e,t,r,n){this.observer=e,this.typeSupported=t,this.config=r,this.vendor=n}return e.prototype.destroy=function(){var e=this.demuxer;e&&e.destroy()},e.prototype.push=function(e,t,r,o,s,l,u,c,d,f,h,p){var m=this;if(e.byteLength>0&&null!=t&&null!=t.key&&"AES-128"===t.method){var g=this.decrypter;null==g&&(g=this.decrypter=new a.default(this.observer,this.config));var y=n();g.decrypt(e,t.key.buffer,t.iv.buffer,(function(e){var a=n();m.observer.trigger(i.default.FRAG_DECRYPTED,{stats:{tstart:y,tdecrypt:a}}),m.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),o,s,l,u,c,d,f,h,p)}))}else this.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),o,s,l,u,c,d,f,h,p)},e.prototype.pushDecrypted=function(e,t,r,n,a,h,p,m,g,y,v,b){var _=this.demuxer;if(!_||(p||m)&&!this.probe(e)){for(var A=this.observer,E=this.typeSupported,T=this.config,S=[{demux:u.default,remux:d.default},{demux:l.default,remux:f.default},{demux:s.default,remux:d.default},{demux:c.default,remux:d.default}],w=0,k=S.length;w<k;w++){var C=S[w],x=C.demux.probe;if(x(e)){var R=this.remuxer=new C.remux(A,T,E,this.vendor);_=new C.demux(A,R,T,E),this.probe=x;break}}if(!_)return void A.trigger(i.default.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});this.demuxer=_}var L=this.remuxer;(p||m)&&(_.resetInitSegment(r,n,a,y),L.resetInitSegment()),p&&(_.resetTimeStamp(b),L.resetTimeStamp(b)),"function"==typeof _.setDecryptData&&_.setDecryptData(t),_.append(e,h,g,v)},e}();t.default=g},"./src/demux/demuxer-worker.js": /*!*************************************!*\ !*** ./src/demux/demuxer-worker.js ***! \*************************************/ @@ -701,7 +701,7 @@ !*** ./src/demux/tsdemuxer.js ***! \********************************/ /*! no static exports found */ -/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(/*! ./adts */"./src/demux/adts.js"),i=r(/*! ./mpegaudio */"./src/demux/mpegaudio.js"),o=r(/*! ../events */"./src/events.js"),a=r(/*! ./exp-golomb */"./src/demux/exp-golomb.js"),s=r(/*! ./sample-aes */"./src/demux/sample-aes.js"),l=r(/*! ../utils/logger */"./src/utils/logger.js"),u=r(/*! ../errors */"./src/errors.js"),c={video:1,audio:2,id3:3,text:4},d=function(){function e(e,t,r,n){this.observer=e,this.config=r,this.typeSupported=n,this.remuxer=t,this.sampleAes=null}return e.prototype.setDecryptData=function(e){null!=e&&null!=e.key&&"SAMPLE-AES"===e.method?this.sampleAes=new s.default(this.observer,this.config,e,this.discardEPB):this.sampleAes=null},e.probe=function(t){var r=e._syncOffset(t);return!(r<0||(r&&l.logger.warn("MPEG2-TS detected but first sync word found @ offset "+r+", junk ahead ?"),0))},e._syncOffset=function(e){for(var t=Math.min(1e3,e.length-564),r=0;r<t;){if(71===e[r]&&71===e[r+188]&&71===e[r+376])return r;r++}return-1},e.createTrack=function(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:c[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0,dropped:"video"===e?0:void 0,isAAC:"audio"===e||void 0,duration:"audio"===e?t:void 0}},e.prototype.resetInitSegment=function(t,r,n,i){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=e.createTrack("video",i),this._audioTrack=e.createTrack("audio",i),this._id3Track=e.createTrack("id3",i),this._txtTrack=e.createTrack("text",i),this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=r,this.videoCodec=n,this._duration=i},e.prototype.resetTimeStamp=function(){},e.prototype.append=function(t,r,n,i){var a,s,c,d,f,h=t.length,p=!1;this.contiguous=n;var m=this.pmtParsed,g=this._avcTrack,y=this._audioTrack,v=this._id3Track,b=g.pid,_=y.pid,A=v.pid,E=this._pmtId,T=g.pesData,S=y.pesData,w=v.pesData,k=this._parsePAT,x=this._parsePMT,C=this._parsePES,R=this._parseAVCPES.bind(this),L=this._parseAACPES.bind(this),j=this._parseMPEGPES.bind(this),P=this._parseID3PES.bind(this),I=e._syncOffset(t);for(h-=(h+I)%188,a=I;a<h;a+=188)if(71===t[a]){if(s=!!(64&t[a+1]),c=((31&t[a+1])<<8)+t[a+2],(48&t[a+3])>>4>1){if((d=a+5+t[a+4])===a+188)continue}else d=a+4;switch(c){case b:s&&(T&&(f=C(T))&&void 0!==f.pts&&R(f,!1),T={data:[],size:0}),T&&(T.data.push(t.subarray(d,a+188)),T.size+=a+188-d);break;case _:s&&(S&&(f=C(S))&&void 0!==f.pts&&(y.isAAC?L(f):j(f)),S={data:[],size:0}),S&&(S.data.push(t.subarray(d,a+188)),S.size+=a+188-d);break;case A:s&&(w&&(f=C(w))&&void 0!==f.pts&&P(f),w={data:[],size:0}),w&&(w.data.push(t.subarray(d,a+188)),w.size+=a+188-d);break;case 0:s&&(d+=t[d]+1),E=this._pmtId=k(t,d);break;case E:s&&(d+=t[d]+1);var O=x(t,d,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);(b=O.avc)>0&&(g.pid=b),(_=O.audio)>0&&(y.pid=_,y.isAAC=O.isAAC),(A=O.id3)>0&&(v.pid=A),p&&!m&&(l.logger.log("reparse from beginning"),p=!1,a=I-188),m=this.pmtParsed=!0;break;case 17:case 8191:break;default:p=!0}}else this.observer.trigger(o.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});T&&(f=C(T))&&void 0!==f.pts?(R(f,!0),g.pesData=null):g.pesData=T,S&&(f=C(S))&&void 0!==f.pts?(y.isAAC?L(f):j(f),y.pesData=null):(S&&S.size&&l.logger.log("last AAC PES packet truncated,might overlap between fragments"),y.pesData=S),w&&(f=C(w))&&void 0!==f.pts?(P(f),v.pesData=null):v.pesData=w,null==this.sampleAes?this.remuxer.remux(y,g,v,this._txtTrack,r,n,i):this.decryptAndRemux(y,g,v,this._txtTrack,r,n,i)},e.prototype.decryptAndRemux=function(e,t,r,n,i,o,a){if(e.samples&&e.isAAC){var s=this;this.sampleAes.decryptAacSamples(e.samples,0,(function(){s.decryptAndRemuxAvc(e,t,r,n,i,o,a)}))}else this.decryptAndRemuxAvc(e,t,r,n,i,o,a)},e.prototype.decryptAndRemuxAvc=function(e,t,r,n,i,o,a){if(t.samples){var s=this;this.sampleAes.decryptAvcSamples(t.samples,0,0,(function(){s.remuxer.remux(e,t,r,n,i,o,a)}))}else this.remuxer.remux(e,t,r,n,i,o,a)},e.prototype.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},e.prototype._parsePAT=function(e,t){return(31&e[t+10])<<8|e[t+11]},e.prototype._parsePMT=function(e,t,r,n){var i,o,a={audio:-1,avc:-1,id3:-1,isAAC:!0};for(i=t+3+((15&e[t+1])<<8|e[t+2])-4,t+=12+((15&e[t+10])<<8|e[t+11]);t<i;){switch(o=(31&e[t+1])<<8|e[t+2],e[t]){case 207:if(!n){l.logger.log("unkown stream type:"+e[t]);break}case 15:-1===a.audio&&(a.audio=o);break;case 21:-1===a.id3&&(a.id3=o);break;case 219:if(!n){l.logger.log("unkown stream type:"+e[t]);break}case 27:-1===a.avc&&(a.avc=o);break;case 3:case 4:r?-1===a.audio&&(a.audio=o,a.isAAC=!1):l.logger.log("MPEG audio found, not supported in this browser for now");break;case 36:l.logger.warn("HEVC stream type found, not supported for now");break;default:l.logger.log("unkown stream type:"+e[t])}t+=5+((15&e[t+3])<<8|e[t+4])}return a},e.prototype._parsePES=function(e){var t,r,n,i,o,a,s,u,c=0,d=e.data;if(!e||0===e.size)return null;for(;d[0].length<19&&d.length>1;){var f=new Uint8Array(d[0].length+d[1].length);f.set(d[0]),f.set(d[1],d[0].length),d[0]=f,d.splice(1,1)}if(1===((t=d[0])[0]<<16)+(t[1]<<8)+t[2]){if((n=(t[4]<<8)+t[5])&&n>e.size-6)return null;192&(r=t[7])&&((a=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2)>4294967295&&(a-=8589934592),64&r?((s=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2)>4294967295&&(s-=8589934592),a-s>54e5&&(l.logger.warn(Math.round((a-s)/9e4)+"s delta between PTS and DTS, align them"),a=s)):s=a),u=(i=t[8])+9,e.size-=u,o=new Uint8Array(e.size);for(var h=0,p=d.length;h<p;h++){var m=(t=d[h]).byteLength;if(u){if(u>m){u-=m;continue}t=t.subarray(u),m-=u,u=0}o.set(t,c),c+=m}return n&&(n-=i+3),{data:o,pts:a,dts:s,len:n}}return null},e.prototype.pushAccesUnit=function(e,t){if(e.units.length&&e.frame){var r=t.samples,n=r.length;!this.config.forceKeyFrameOnDiscontinuity||!0===e.key||t.sps&&(n||this.contiguous)?(e.id=n,r.push(e)):t.dropped++}e.debug.length&&l.logger.log(e.pts+"/"+e.dts+":"+e.debug)},e.prototype._parseAVCPES=function(e,t){var r,n,i,o=this,s=this._avcTrack,l=this._parseAVCNALu(e.data),u=this.avcSample,c=!1,d=this.pushAccesUnit.bind(this),f=function(e,t,r,n){return{key:e,pts:t,dts:r,units:[],debug:n}};e.data=null,u&&l.length&&!s.audFound&&(d(u,s),u=this.avcSample=f(!1,e.pts,e.dts,"")),l.forEach((function(t){switch(t.type){case 1:n=!0,u||(u=o.avcSample=f(!0,e.pts,e.dts,"")),u.frame=!0;var l=t.data;if(c&&l.length>4){var h=new a.default(l).readSliceType();2!==h&&4!==h&&7!==h&&9!==h||(u.key=!0)}break;case 5:n=!0,u||(u=o.avcSample=f(!0,e.pts,e.dts,"")),u.key=!0,u.frame=!0;break;case 6:n=!0,(r=new a.default(o.discardEPB(t.data))).readUByte();for(var p=0,m=0,g=!1,y=0;!g&&r.bytesAvailable>1;){p=0;do{p+=y=r.readUByte()}while(255===y);m=0;do{m+=y=r.readUByte()}while(255===y);if(4===p&&0!==r.bytesAvailable){if(g=!0,181===r.readUByte()&&49===r.readUShort()&&1195456820===r.readUInt()&&3===r.readUByte()){var v=r.readUByte(),b=31&v,_=[v,r.readUByte()];for(i=0;i<b;i++)_.push(r.readUByte()),_.push(r.readUByte()),_.push(r.readUByte());o._insertSampleInOrder(o._txtTrack.samples,{type:3,pts:e.pts,bytes:_})}}else if(m<r.bytesAvailable)for(i=0;i<m;i++)r.readUByte()}break;case 7:if(n=!0,c=!0,!s.sps){var A=(r=new a.default(t.data)).readSPS();s.width=A.width,s.height=A.height,s.pixelRatio=A.pixelRatio,s.sps=[t.data],s.duration=o._duration;var E=t.data.subarray(1,4),T="avc1.";for(i=0;i<3;i++){var S=E[i].toString(16);S.length<2&&(S="0"+S),T+=S}s.codec=T}break;case 8:n=!0,s.pps||(s.pps=[t.data]);break;case 9:n=!1,s.audFound=!0,u&&d(u,s),u=o.avcSample=f(!1,e.pts,e.dts,"");break;case 12:n=!1;break;default:n=!1,u&&(u.debug+="unknown NAL "+t.type+" ")}u&&n&&u.units.push(t)})),t&&u&&(d(u,s),this.avcSample=null)},e.prototype._insertSampleInOrder=function(e,t){var r=e.length;if(r>0){if(t.pts>=e[r-1].pts)e.push(t);else for(var n=r-1;n>=0;n--)if(t.pts<e[n].pts){e.splice(n,0,t);break}}else e.push(t)},e.prototype._getLastNalUnit=function(){var e,t=this.avcSample;if(!t||0===t.units.length){var r=this._avcTrack.samples;t=r[r.length-1]}if(t){var n=t.units;e=n[n.length-1]}return e},e.prototype._parseAVCNALu=function(e){var t,r,n,i,o=0,a=e.byteLength,s=this._avcTrack,l=s.naluState||0,u=l,c=[],d=-1;for(-1===l&&(d=0,i=31&e[0],l=0,o=1);o<a;)if(t=e[o++],l)if(1!==l)if(t)if(1===t){var f,h;d>=0?(n={data:e.subarray(d,o-l-1),type:i},c.push(n)):(f=this._getLastNalUnit())&&(u&&o<=4-u&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-u)),(r=o-l-1)>0&&((h=new Uint8Array(f.data.byteLength+r)).set(f.data,0),h.set(e.subarray(0,r),f.data.byteLength),f.data=h)),o<a?(d=o,i=31&e[o],l=0):l=-1}else l=0;else l=3;else l=t?0:2;else l=t?0:1;return d>=0&&l>=0&&(n={data:e.subarray(d,a),type:i,state:l},c.push(n)),0===c.length&&(f=this._getLastNalUnit())&&((h=new Uint8Array(f.data.byteLength+e.byteLength)).set(f.data,0),h.set(e,f.data.byteLength),f.data=h),s.naluState=l,c},e.prototype.discardEPB=function(e){for(var t,r,n=e.byteLength,i=[],o=1;o<n-2;)0===e[o]&&0===e[o+1]&&3===e[o+2]?(i.push(o+2),o+=2):o++;if(0===i.length)return e;t=n-i.length,r=new Uint8Array(t);var a=0;for(o=0;o<t;a++,o++)a===i[0]&&(a++,i.shift()),r[o]=e[a];return r},e.prototype._parseAACPES=function(e){var t,r,i,a,s,c=this._audioTrack,d=e.data,f=e.pts,h=this.aacOverFlow,p=this.aacLastPTS;if(h){var m=new Uint8Array(h.byteLength+d.byteLength);m.set(h,0),m.set(d,h.byteLength),d=m}for(i=0,s=d.length;i<s-1&&!n.isHeader(d,i);i++);if(i){var g=void 0,y=void 0;if(i<s-1?(g="AAC PES did not start with ADTS header,offset:"+i,y=!1):(g="no ADTS header found in AAC PES",y=!0),l.logger.warn("parsing error:"+g),this.observer.trigger(o.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_PARSING_ERROR,fatal:y,reason:g}),y)return}if(n.initTrackConfig(c,this.observer,d,i,this.audioCodec),r=0,t=n.getFrameDuration(c.samplerate),h&&p){var v=p+t;Math.abs(v-f)>1&&(l.logger.log("AAC: align PTS for overlapping frames by "+Math.round((v-f)/90)),f=v)}for(;i<s;)if(n.isHeader(d,i)&&i+5<s){var b=n.appendFrame(c,d,i,f,r);if(!b)break;i+=b.length,a=b.sample.pts,r++}else i++;h=i<s?d.subarray(i,s):null,this.aacOverFlow=h,this.aacLastPTS=a},e.prototype._parseMPEGPES=function(e){for(var t=e.data,r=t.length,n=0,o=0,a=e.pts;o<r;)if(i.default.isHeader(t,o)){var s=i.default.appendFrame(this._audioTrack,t,o,a,n);if(!s)break;o+=s.length,n++}else o++},e.prototype._parseID3PES=function(e){this._id3Track.samples.push(e)},e}();t.default=d},"./src/errors.js": +/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(/*! ./adts */"./src/demux/adts.js"),i=r(/*! ./mpegaudio */"./src/demux/mpegaudio.js"),o=r(/*! ../events */"./src/events.js"),a=r(/*! ./exp-golomb */"./src/demux/exp-golomb.js"),s=r(/*! ./sample-aes */"./src/demux/sample-aes.js"),l=r(/*! ../utils/logger */"./src/utils/logger.js"),u=r(/*! ../errors */"./src/errors.js"),c={video:1,audio:2,id3:3,text:4},d=function(){function e(e,t,r,n){this.observer=e,this.config=r,this.typeSupported=n,this.remuxer=t,this.sampleAes=null}return e.prototype.setDecryptData=function(e){null!=e&&null!=e.key&&"SAMPLE-AES"===e.method?this.sampleAes=new s.default(this.observer,this.config,e,this.discardEPB):this.sampleAes=null},e.probe=function(t){var r=e._syncOffset(t);return!(r<0||(r&&l.logger.warn("MPEG2-TS detected but first sync word found @ offset "+r+", junk ahead ?"),0))},e._syncOffset=function(e){for(var t=Math.min(1e3,e.length-564),r=0;r<t;){if(71===e[r]&&71===e[r+188]&&71===e[r+376])return r;r++}return-1},e.createTrack=function(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:c[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0,dropped:"video"===e?0:void 0,isAAC:"audio"===e||void 0,duration:"audio"===e?t:void 0}},e.prototype.resetInitSegment=function(t,r,n,i){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=e.createTrack("video",i),this._audioTrack=e.createTrack("audio",i),this._id3Track=e.createTrack("id3",i),this._txtTrack=e.createTrack("text",i),this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=r,this.videoCodec=n,this._duration=i},e.prototype.resetTimeStamp=function(){},e.prototype.append=function(t,r,n,i){var a,s,c,d,f,h=t.length,p=!1;this.contiguous=n;var m=this.pmtParsed,g=this._avcTrack,y=this._audioTrack,v=this._id3Track,b=g.pid,_=y.pid,A=v.pid,E=this._pmtId,T=g.pesData,S=y.pesData,w=v.pesData,k=this._parsePAT,C=this._parsePMT,x=this._parsePES,R=this._parseAVCPES.bind(this),L=this._parseAACPES.bind(this),j=this._parseMPEGPES.bind(this),P=this._parseID3PES.bind(this),I=e._syncOffset(t);for(h-=(h+I)%188,a=I;a<h;a+=188)if(71===t[a]){if(s=!!(64&t[a+1]),c=((31&t[a+1])<<8)+t[a+2],(48&t[a+3])>>4>1){if((d=a+5+t[a+4])===a+188)continue}else d=a+4;switch(c){case b:s&&(T&&(f=x(T))&&void 0!==f.pts&&R(f,!1),T={data:[],size:0}),T&&(T.data.push(t.subarray(d,a+188)),T.size+=a+188-d);break;case _:s&&(S&&(f=x(S))&&void 0!==f.pts&&(y.isAAC?L(f):j(f)),S={data:[],size:0}),S&&(S.data.push(t.subarray(d,a+188)),S.size+=a+188-d);break;case A:s&&(w&&(f=x(w))&&void 0!==f.pts&&P(f),w={data:[],size:0}),w&&(w.data.push(t.subarray(d,a+188)),w.size+=a+188-d);break;case 0:s&&(d+=t[d]+1),E=this._pmtId=k(t,d);break;case E:s&&(d+=t[d]+1);var O=C(t,d,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);(b=O.avc)>0&&(g.pid=b),(_=O.audio)>0&&(y.pid=_,y.isAAC=O.isAAC),(A=O.id3)>0&&(v.pid=A),p&&!m&&(l.logger.log("reparse from beginning"),p=!1,a=I-188),m=this.pmtParsed=!0;break;case 17:case 8191:break;default:p=!0}}else this.observer.trigger(o.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});T&&(f=x(T))&&void 0!==f.pts?(R(f,!0),g.pesData=null):g.pesData=T,S&&(f=x(S))&&void 0!==f.pts?(y.isAAC?L(f):j(f),y.pesData=null):(S&&S.size&&l.logger.log("last AAC PES packet truncated,might overlap between fragments"),y.pesData=S),w&&(f=x(w))&&void 0!==f.pts?(P(f),v.pesData=null):v.pesData=w,null==this.sampleAes?this.remuxer.remux(y,g,v,this._txtTrack,r,n,i):this.decryptAndRemux(y,g,v,this._txtTrack,r,n,i)},e.prototype.decryptAndRemux=function(e,t,r,n,i,o,a){if(e.samples&&e.isAAC){var s=this;this.sampleAes.decryptAacSamples(e.samples,0,(function(){s.decryptAndRemuxAvc(e,t,r,n,i,o,a)}))}else this.decryptAndRemuxAvc(e,t,r,n,i,o,a)},e.prototype.decryptAndRemuxAvc=function(e,t,r,n,i,o,a){if(t.samples){var s=this;this.sampleAes.decryptAvcSamples(t.samples,0,0,(function(){s.remuxer.remux(e,t,r,n,i,o,a)}))}else this.remuxer.remux(e,t,r,n,i,o,a)},e.prototype.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},e.prototype._parsePAT=function(e,t){return(31&e[t+10])<<8|e[t+11]},e.prototype._parsePMT=function(e,t,r,n){var i,o,a={audio:-1,avc:-1,id3:-1,isAAC:!0};for(i=t+3+((15&e[t+1])<<8|e[t+2])-4,t+=12+((15&e[t+10])<<8|e[t+11]);t<i;){switch(o=(31&e[t+1])<<8|e[t+2],e[t]){case 207:if(!n){l.logger.log("unkown stream type:"+e[t]);break}case 15:-1===a.audio&&(a.audio=o);break;case 21:-1===a.id3&&(a.id3=o);break;case 219:if(!n){l.logger.log("unkown stream type:"+e[t]);break}case 27:-1===a.avc&&(a.avc=o);break;case 3:case 4:r?-1===a.audio&&(a.audio=o,a.isAAC=!1):l.logger.log("MPEG audio found, not supported in this browser for now");break;case 36:l.logger.warn("HEVC stream type found, not supported for now");break;default:l.logger.log("unkown stream type:"+e[t])}t+=5+((15&e[t+3])<<8|e[t+4])}return a},e.prototype._parsePES=function(e){var t,r,n,i,o,a,s,u,c=0,d=e.data;if(!e||0===e.size)return null;for(;d[0].length<19&&d.length>1;){var f=new Uint8Array(d[0].length+d[1].length);f.set(d[0]),f.set(d[1],d[0].length),d[0]=f,d.splice(1,1)}if(1===((t=d[0])[0]<<16)+(t[1]<<8)+t[2]){if((n=(t[4]<<8)+t[5])&&n>e.size-6)return null;192&(r=t[7])&&((a=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2)>4294967295&&(a-=8589934592),64&r?((s=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2)>4294967295&&(s-=8589934592),a-s>54e5&&(l.logger.warn(Math.round((a-s)/9e4)+"s delta between PTS and DTS, align them"),a=s)):s=a),u=(i=t[8])+9,e.size-=u,o=new Uint8Array(e.size);for(var h=0,p=d.length;h<p;h++){var m=(t=d[h]).byteLength;if(u){if(u>m){u-=m;continue}t=t.subarray(u),m-=u,u=0}o.set(t,c),c+=m}return n&&(n-=i+3),{data:o,pts:a,dts:s,len:n}}return null},e.prototype.pushAccesUnit=function(e,t){if(e.units.length&&e.frame){var r=t.samples,n=r.length;!this.config.forceKeyFrameOnDiscontinuity||!0===e.key||t.sps&&(n||this.contiguous)?(e.id=n,r.push(e)):t.dropped++}e.debug.length&&l.logger.log(e.pts+"/"+e.dts+":"+e.debug)},e.prototype._parseAVCPES=function(e,t){var r,n,i,o=this,s=this._avcTrack,l=this._parseAVCNALu(e.data),u=this.avcSample,c=!1,d=this.pushAccesUnit.bind(this),f=function(e,t,r,n){return{key:e,pts:t,dts:r,units:[],debug:n}};e.data=null,u&&l.length&&!s.audFound&&(d(u,s),u=this.avcSample=f(!1,e.pts,e.dts,"")),l.forEach((function(t){switch(t.type){case 1:n=!0,u||(u=o.avcSample=f(!0,e.pts,e.dts,"")),u.frame=!0;var l=t.data;if(c&&l.length>4){var h=new a.default(l).readSliceType();2!==h&&4!==h&&7!==h&&9!==h||(u.key=!0)}break;case 5:n=!0,u||(u=o.avcSample=f(!0,e.pts,e.dts,"")),u.key=!0,u.frame=!0;break;case 6:n=!0,(r=new a.default(o.discardEPB(t.data))).readUByte();for(var p=0,m=0,g=!1,y=0;!g&&r.bytesAvailable>1;){p=0;do{p+=y=r.readUByte()}while(255===y);m=0;do{m+=y=r.readUByte()}while(255===y);if(4===p&&0!==r.bytesAvailable){if(g=!0,181===r.readUByte()&&49===r.readUShort()&&1195456820===r.readUInt()&&3===r.readUByte()){var v=r.readUByte(),b=31&v,_=[v,r.readUByte()];for(i=0;i<b;i++)_.push(r.readUByte()),_.push(r.readUByte()),_.push(r.readUByte());o._insertSampleInOrder(o._txtTrack.samples,{type:3,pts:e.pts,bytes:_})}}else if(m<r.bytesAvailable)for(i=0;i<m;i++)r.readUByte()}break;case 7:if(n=!0,c=!0,!s.sps){var A=(r=new a.default(t.data)).readSPS();s.width=A.width,s.height=A.height,s.pixelRatio=A.pixelRatio,s.sps=[t.data],s.duration=o._duration;var E=t.data.subarray(1,4),T="avc1.";for(i=0;i<3;i++){var S=E[i].toString(16);S.length<2&&(S="0"+S),T+=S}s.codec=T}break;case 8:n=!0,s.pps||(s.pps=[t.data]);break;case 9:n=!1,s.audFound=!0,u&&d(u,s),u=o.avcSample=f(!1,e.pts,e.dts,"");break;case 12:n=!1;break;default:n=!1,u&&(u.debug+="unknown NAL "+t.type+" ")}u&&n&&u.units.push(t)})),t&&u&&(d(u,s),this.avcSample=null)},e.prototype._insertSampleInOrder=function(e,t){var r=e.length;if(r>0){if(t.pts>=e[r-1].pts)e.push(t);else for(var n=r-1;n>=0;n--)if(t.pts<e[n].pts){e.splice(n,0,t);break}}else e.push(t)},e.prototype._getLastNalUnit=function(){var e,t=this.avcSample;if(!t||0===t.units.length){var r=this._avcTrack.samples;t=r[r.length-1]}if(t){var n=t.units;e=n[n.length-1]}return e},e.prototype._parseAVCNALu=function(e){var t,r,n,i,o=0,a=e.byteLength,s=this._avcTrack,l=s.naluState||0,u=l,c=[],d=-1;for(-1===l&&(d=0,i=31&e[0],l=0,o=1);o<a;)if(t=e[o++],l)if(1!==l)if(t)if(1===t){var f,h;d>=0?(n={data:e.subarray(d,o-l-1),type:i},c.push(n)):(f=this._getLastNalUnit())&&(u&&o<=4-u&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-u)),(r=o-l-1)>0&&((h=new Uint8Array(f.data.byteLength+r)).set(f.data,0),h.set(e.subarray(0,r),f.data.byteLength),f.data=h)),o<a?(d=o,i=31&e[o],l=0):l=-1}else l=0;else l=3;else l=t?0:2;else l=t?0:1;return d>=0&&l>=0&&(n={data:e.subarray(d,a),type:i,state:l},c.push(n)),0===c.length&&(f=this._getLastNalUnit())&&((h=new Uint8Array(f.data.byteLength+e.byteLength)).set(f.data,0),h.set(e,f.data.byteLength),f.data=h),s.naluState=l,c},e.prototype.discardEPB=function(e){for(var t,r,n=e.byteLength,i=[],o=1;o<n-2;)0===e[o]&&0===e[o+1]&&3===e[o+2]?(i.push(o+2),o+=2):o++;if(0===i.length)return e;t=n-i.length,r=new Uint8Array(t);var a=0;for(o=0;o<t;a++,o++)a===i[0]&&(a++,i.shift()),r[o]=e[a];return r},e.prototype._parseAACPES=function(e){var t,r,i,a,s,c=this._audioTrack,d=e.data,f=e.pts,h=this.aacOverFlow,p=this.aacLastPTS;if(h){var m=new Uint8Array(h.byteLength+d.byteLength);m.set(h,0),m.set(d,h.byteLength),d=m}for(i=0,s=d.length;i<s-1&&!n.isHeader(d,i);i++);if(i){var g=void 0,y=void 0;if(i<s-1?(g="AAC PES did not start with ADTS header,offset:"+i,y=!1):(g="no ADTS header found in AAC PES",y=!0),l.logger.warn("parsing error:"+g),this.observer.trigger(o.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_PARSING_ERROR,fatal:y,reason:g}),y)return}if(n.initTrackConfig(c,this.observer,d,i,this.audioCodec),r=0,t=n.getFrameDuration(c.samplerate),h&&p){var v=p+t;Math.abs(v-f)>1&&(l.logger.log("AAC: align PTS for overlapping frames by "+Math.round((v-f)/90)),f=v)}for(;i<s;)if(n.isHeader(d,i)&&i+5<s){var b=n.appendFrame(c,d,i,f,r);if(!b)break;i+=b.length,a=b.sample.pts,r++}else i++;h=i<s?d.subarray(i,s):null,this.aacOverFlow=h,this.aacLastPTS=a},e.prototype._parseMPEGPES=function(e){for(var t=e.data,r=t.length,n=0,o=0,a=e.pts;o<r;)if(i.default.isHeader(t,o)){var s=i.default.appendFrame(this._audioTrack,t,o,a,n);if(!s)break;o+=s.length,n++}else o++},e.prototype._parseID3PES=function(e){this._id3Track.samples.push(e)},e}();t.default=d},"./src/errors.js": /*!***********************!*\ !*** ./src/errors.js ***! \***********************/ @@ -721,7 +721,7 @@ !*** ./src/hls.js ***! \********************/ /*! no static exports found */ -/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),a=r(/*! ./errors */"./src/errors.js"),s=r(/*! ./loader/playlist-loader */"./src/loader/playlist-loader.js"),l=r(/*! ./loader/fragment-loader */"./src/loader/fragment-loader.js"),u=r(/*! ./loader/key-loader */"./src/loader/key-loader.js"),c=r(/*! ./controller/fragment-tracker */"./src/controller/fragment-tracker.js"),d=r(/*! ./controller/stream-controller */"./src/controller/stream-controller.js"),f=r(/*! ./controller/level-controller */"./src/controller/level-controller.js"),h=r(/*! ./controller/id3-track-controller */"./src/controller/id3-track-controller.js"),p=r(/*! ./is-supported */"./src/is-supported.js"),m=r(/*! ./utils/logger */"./src/utils/logger.js"),g=r(/*! ./config */"./src/config.js"),y=r(/*! ./events */"./src/events.js"),v=function(e){function t(r){void 0===r&&(r={});var n=e.call(this)||this,i=t.DefaultConfig;if((r.liveSyncDurationCount||r.liveMaxLatencyDurationCount)&&(r.liveSyncDuration||r.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var o in i)o in r||(r[o]=i[o]);if(void 0!==r.liveMaxLatencyDurationCount&&r.liveMaxLatencyDurationCount<=r.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==r.liveMaxLatencyDuration&&(r.liveMaxLatencyDuration<=r.liveSyncDuration||void 0===r.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');m.enableLogs(r.debug),n.config=r,n._autoLevelCapping=-1;var a=n.abrController=new r.abrController(n),p=new r.bufferController(n),g=new r.capLevelController(n),y=new r.fpsController(n),v=new s.default(n),b=new l.default(n),_=new u.default(n),A=new h.default(n),E=n.levelController=new f.default(n),T=new c.FragmentTracker(n),S=[E,n.streamController=new d.default(n,T)],w=r.audioStreamController;w&&S.push(new w(n,T)),n.networkControllers=S;var k=[v,b,_,a,p,g,y,A,T];if(w=r.audioTrackController){var x=new w(n);n.audioTrackController=x,k.push(x)}if(w=r.subtitleTrackController){var C=new w(n);n.subtitleTrackController=C,k.push(C)}if(w=r.emeController){var R=new w(n);n.emeController=R,k.push(R)}return(w=r.subtitleStreamController)&&k.push(new w(n,T)),(w=r.timelineController)&&k.push(new w(n)),n.coreComponents=k,n}return i(t,e),Object.defineProperty(t,"version",{get:function(){return"0.12.2"},enumerable:!0,configurable:!0}),t.isSupported=function(){return p.isSupported()},Object.defineProperty(t,"Events",{get:function(){return y.default},enumerable:!0,configurable:!0}),Object.defineProperty(t,"ErrorTypes",{get:function(){return a.ErrorTypes},enumerable:!0,configurable:!0}),Object.defineProperty(t,"ErrorDetails",{get:function(){return a.ErrorDetails},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DefaultConfig",{get:function(){return t.defaultConfig?t.defaultConfig:g.hlsDefaultConfig},set:function(e){t.defaultConfig=e},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){m.logger.log("destroy"),this.trigger(y.default.DESTROYING),this.detachMedia(),this.coreComponents.concat(this.networkControllers).forEach((function(e){e.destroy()})),this.url=null,this.removeAllListeners(),this._autoLevelCapping=-1},t.prototype.attachMedia=function(e){m.logger.log("attachMedia"),this.media=e,this.trigger(y.default.MEDIA_ATTACHING,{media:e})},t.prototype.detachMedia=function(){m.logger.log("detachMedia"),this.trigger(y.default.MEDIA_DETACHING),this.media=null},t.prototype.loadSource=function(e){e=o.buildAbsoluteURL(window.location.href,e,{alwaysNormalize:!0}),m.logger.log("loadSource:"+e),this.url=e,this.trigger(y.default.MANIFEST_LOADING,{url:e})},t.prototype.startLoad=function(e){void 0===e&&(e=-1),m.logger.log("startLoad("+e+")"),this.networkControllers.forEach((function(t){t.startLoad(e)}))},t.prototype.stopLoad=function(){m.logger.log("stopLoad"),this.networkControllers.forEach((function(e){e.stopLoad()}))},t.prototype.swapAudioCodec=function(){m.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},t.prototype.recoverMediaError=function(){m.logger.log("recoverMediaError");var e=this.media;this.detachMedia(),this.attachMedia(e)},Object.defineProperty(t.prototype,"levels",{get:function(){return this.levelController.levels},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentLevel",{get:function(){return this.streamController.currentLevel},set:function(e){m.logger.log("set currentLevel:"+e),this.loadLevel=e,this.streamController.immediateLevelSwitch()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nextLevel",{get:function(){return this.streamController.nextLevel},set:function(e){m.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"loadLevel",{get:function(){return this.levelController.level},set:function(e){m.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nextLoadLevel",{get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstLevel",{get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){m.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"startLevel",{get:function(){return this.levelController.startLevel},set:function(e){m.logger.log("set startLevel:"+e),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"autoLevelCapping",{get:function(){return this._autoLevelCapping},set:function(e){m.logger.log("set autoLevelCapping:"+e),this._autoLevelCapping=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"autoLevelEnabled",{get:function(){return-1===this.levelController.manualLevel},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"manualLevel",{get:function(){return this.levelController.manualLevel},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minAutoLevel",{get:function(){for(var e=this.levels,t=this.config.minAutoBitrate,r=e?e.length:0,n=0;n<r;n++)if((e[n].realBitrate?Math.max(e[n].realBitrate,e[n].bitrate):e[n].bitrate)>t)return n;return 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxAutoLevel",{get:function(){var e=this.levels,t=this.autoLevelCapping;return-1===t&&e&&e.length?e.length-1:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nextAutoLevel",{get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"audioTracks",{get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"audioTrack",{get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"liveSyncPosition",{get:function(){return this.streamController.liveSyncPosition},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subtitleTracks",{get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subtitleTrack",{get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subtitleDisplay",{get:function(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)},enumerable:!0,configurable:!0}),t}(r(/*! ./observer */"./src/observer.js").Observer);t.default=v},"./src/is-supported.js": +/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),a=r(/*! ./errors */"./src/errors.js"),s=r(/*! ./loader/playlist-loader */"./src/loader/playlist-loader.js"),l=r(/*! ./loader/fragment-loader */"./src/loader/fragment-loader.js"),u=r(/*! ./loader/key-loader */"./src/loader/key-loader.js"),c=r(/*! ./controller/fragment-tracker */"./src/controller/fragment-tracker.js"),d=r(/*! ./controller/stream-controller */"./src/controller/stream-controller.js"),f=r(/*! ./controller/level-controller */"./src/controller/level-controller.js"),h=r(/*! ./controller/id3-track-controller */"./src/controller/id3-track-controller.js"),p=r(/*! ./is-supported */"./src/is-supported.js"),m=r(/*! ./utils/logger */"./src/utils/logger.js"),g=r(/*! ./config */"./src/config.js"),y=r(/*! ./events */"./src/events.js"),v=function(e){function t(r){void 0===r&&(r={});var n=e.call(this)||this,i=t.DefaultConfig;if((r.liveSyncDurationCount||r.liveMaxLatencyDurationCount)&&(r.liveSyncDuration||r.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var o in i)o in r||(r[o]=i[o]);if(void 0!==r.liveMaxLatencyDurationCount&&r.liveMaxLatencyDurationCount<=r.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==r.liveMaxLatencyDuration&&(r.liveMaxLatencyDuration<=r.liveSyncDuration||void 0===r.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');m.enableLogs(r.debug),n.config=r,n._autoLevelCapping=-1;var a=n.abrController=new r.abrController(n),p=new r.bufferController(n),g=new r.capLevelController(n),y=new r.fpsController(n),v=new s.default(n),b=new l.default(n),_=new u.default(n),A=new h.default(n),E=n.levelController=new f.default(n),T=new c.FragmentTracker(n),S=[E,n.streamController=new d.default(n,T)],w=r.audioStreamController;w&&S.push(new w(n,T)),n.networkControllers=S;var k=[v,b,_,a,p,g,y,A,T];if(w=r.audioTrackController){var C=new w(n);n.audioTrackController=C,k.push(C)}if(w=r.subtitleTrackController){var x=new w(n);n.subtitleTrackController=x,k.push(x)}if(w=r.emeController){var R=new w(n);n.emeController=R,k.push(R)}return(w=r.subtitleStreamController)&&k.push(new w(n,T)),(w=r.timelineController)&&k.push(new w(n)),n.coreComponents=k,n}return i(t,e),Object.defineProperty(t,"version",{get:function(){return"0.12.2"},enumerable:!0,configurable:!0}),t.isSupported=function(){return p.isSupported()},Object.defineProperty(t,"Events",{get:function(){return y.default},enumerable:!0,configurable:!0}),Object.defineProperty(t,"ErrorTypes",{get:function(){return a.ErrorTypes},enumerable:!0,configurable:!0}),Object.defineProperty(t,"ErrorDetails",{get:function(){return a.ErrorDetails},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DefaultConfig",{get:function(){return t.defaultConfig?t.defaultConfig:g.hlsDefaultConfig},set:function(e){t.defaultConfig=e},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){m.logger.log("destroy"),this.trigger(y.default.DESTROYING),this.detachMedia(),this.coreComponents.concat(this.networkControllers).forEach((function(e){e.destroy()})),this.url=null,this.removeAllListeners(),this._autoLevelCapping=-1},t.prototype.attachMedia=function(e){m.logger.log("attachMedia"),this.media=e,this.trigger(y.default.MEDIA_ATTACHING,{media:e})},t.prototype.detachMedia=function(){m.logger.log("detachMedia"),this.trigger(y.default.MEDIA_DETACHING),this.media=null},t.prototype.loadSource=function(e){e=o.buildAbsoluteURL(window.location.href,e,{alwaysNormalize:!0}),m.logger.log("loadSource:"+e),this.url=e,this.trigger(y.default.MANIFEST_LOADING,{url:e})},t.prototype.startLoad=function(e){void 0===e&&(e=-1),m.logger.log("startLoad("+e+")"),this.networkControllers.forEach((function(t){t.startLoad(e)}))},t.prototype.stopLoad=function(){m.logger.log("stopLoad"),this.networkControllers.forEach((function(e){e.stopLoad()}))},t.prototype.swapAudioCodec=function(){m.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},t.prototype.recoverMediaError=function(){m.logger.log("recoverMediaError");var e=this.media;this.detachMedia(),this.attachMedia(e)},Object.defineProperty(t.prototype,"levels",{get:function(){return this.levelController.levels},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentLevel",{get:function(){return this.streamController.currentLevel},set:function(e){m.logger.log("set currentLevel:"+e),this.loadLevel=e,this.streamController.immediateLevelSwitch()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nextLevel",{get:function(){return this.streamController.nextLevel},set:function(e){m.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"loadLevel",{get:function(){return this.levelController.level},set:function(e){m.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nextLoadLevel",{get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstLevel",{get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){m.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"startLevel",{get:function(){return this.levelController.startLevel},set:function(e){m.logger.log("set startLevel:"+e),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"autoLevelCapping",{get:function(){return this._autoLevelCapping},set:function(e){m.logger.log("set autoLevelCapping:"+e),this._autoLevelCapping=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"autoLevelEnabled",{get:function(){return-1===this.levelController.manualLevel},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"manualLevel",{get:function(){return this.levelController.manualLevel},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minAutoLevel",{get:function(){for(var e=this.levels,t=this.config.minAutoBitrate,r=e?e.length:0,n=0;n<r;n++)if((e[n].realBitrate?Math.max(e[n].realBitrate,e[n].bitrate):e[n].bitrate)>t)return n;return 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxAutoLevel",{get:function(){var e=this.levels,t=this.autoLevelCapping;return-1===t&&e&&e.length?e.length-1:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nextAutoLevel",{get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"audioTracks",{get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"audioTrack",{get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"liveSyncPosition",{get:function(){return this.streamController.liveSyncPosition},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subtitleTracks",{get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subtitleTrack",{get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subtitleDisplay",{get:function(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)},enumerable:!0,configurable:!0}),t}(r(/*! ./observer */"./src/observer.js").Observer);t.default=v},"./src/is-supported.js": /*!*****************************!*\ !*** ./src/is-supported.js ***! \*****************************/ @@ -756,7 +756,7 @@ !*** ./src/loader/m3u8-parser.js ***! \***********************************/ /*! no static exports found */ -/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),i=r(/*! ./fragment */"./src/loader/fragment.js"),o=r(/*! ./level */"./src/loader/level.js"),a=r(/*! ./level-key */"./src/loader/level-key.js"),s=r(/*! ../utils/attr-list */"./src/utils/attr-list.js"),l=r(/*! ../utils/logger */"./src/utils/logger.js"),u=r(/*! ../utils/codecs */"./src/utils/codecs.js"),c=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,d=/#EXT-X-MEDIA:(.*)/g,f=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)([\S+ ?]+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),h=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)([^:]*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/,p=/\.(mp4|m4s|m4v|m4a)$/i,m=function(){function t(){}return t.findGroup=function(e,t){if(!e)return null;for(var r=null,n=0;n<e.length;n++){var i=e[n];i.id===t&&(r=i)}return r},t.convertAVC1ToAVCOTI=function(e){var t,r=e.split(".");return r.length>2?(t=r.shift()+".",t+=parseInt(r.shift()).toString(16),t+=("000"+parseInt(r.shift()).toString(16)).substr(-4)):t=e,t},t.resolve=function(e,t){return n.buildAbsoluteURL(t,e,{alwaysNormalize:!0})},t.parseMasterPlaylist=function(e,r){var n,i=[];function o(e,t){["video","audio"].forEach((function(r){var n=e.filter((function(e){return u.isCodecType(e,r)}));if(n.length){var i=n.filter((function(e){return 0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)}));t[r+"Codec"]=i.length>0?i[0]:n[0],e=e.filter((function(e){return-1===n.indexOf(e)}))}})),t.unknownCodecs=e}for(c.lastIndex=0;null!=(n=c.exec(e));){var a={},l=a.attrs=new s.default(n[1]);a.url=t.resolve(n[2],r);var d=l.decimalResolution("RESOLUTION");d&&(a.width=d.width,a.height=d.height),a.bitrate=l.decimalInteger("AVERAGE-BANDWIDTH")||l.decimalInteger("BANDWIDTH"),a.name=l.NAME,o([].concat((l.CODECS||"").split(/[ ,]+/)),a),a.videoCodec&&-1!==a.videoCodec.indexOf("avc1")&&(a.videoCodec=t.convertAVC1ToAVCOTI(a.videoCodec)),i.push(a)}return i},t.parseMasterPlaylistMedia=function(e,r,n,i){var o;void 0===i&&(i=[]);var a=[],l=0;for(d.lastIndex=0;null!==(o=d.exec(e));){var u={},c=new s.default(o[1]);if(c.TYPE===n){if(u.groupId=c["GROUP-ID"],u.name=c.NAME,u.type=n,u.default="YES"===c.DEFAULT,u.autoselect="YES"===c.AUTOSELECT,u.forced="YES"===c.FORCED,c.URI&&(u.url=t.resolve(c.URI,r)),u.lang=c.LANGUAGE,u.name||(u.name=u.lang),i.length){var f=t.findGroup(i,u.groupId);u.audioCodec=f?f.codec:i[0].codec}u.id=l++,a.push(u)}}return a},t.parseLevelPlaylist=function(t,r,n,u,c){var d,m,y=0,v=0,b=new o.default(r),_=new a.default,A=0,E=null,T=new i.default,S=null;for(f.lastIndex=0;null!==(d=f.exec(t));){var w=d[1];if(w){T.duration=parseFloat(w);var k=(" "+d[2]).slice(1);T.title=k||null,T.tagList.push(k?["INF",w,k]:["INF",w])}else if(d[3]){if(e.isFinite(T.duration)){var x=y++;T.type=u,T.start=v,T.levelkey=_,T.sn=x,T.level=n,T.cc=A,T.urlId=c,T.baseurl=r,T.relurl=(" "+d[3]).slice(1),g(T,E),b.fragments.push(T),E=T,v+=T.duration,T=new i.default}}else if(d[4]){if(T.rawByteRange=(" "+d[4]).slice(1),E){var C=E.byteRangeEndOffset;C&&(T.lastByteRangeEndOffset=C)}}else if(d[5])T.rawProgramDateTime=(" "+d[5]).slice(1),T.tagList.push(["PROGRAM-DATE-TIME",T.rawProgramDateTime]),null===S&&(S=b.fragments.length);else{for(d=d[0].match(h),m=1;m<d.length&&void 0===d[m];m++);var R=(" "+d[m+1]).slice(1),L=(" "+d[m+2]).slice(1);switch(d[m]){case"#":T.tagList.push(L?[R,L]:[R]);break;case"PLAYLIST-TYPE":b.type=R.toUpperCase();break;case"MEDIA-SEQUENCE":y=b.startSN=parseInt(R);break;case"TARGETDURATION":b.targetduration=parseFloat(R);break;case"VERSION":b.version=parseInt(R);break;case"EXTM3U":break;case"ENDLIST":b.live=!1;break;case"DIS":A++,T.tagList.push(["DIS"]);break;case"DISCONTINUITY-SEQ":A=parseInt(R);break;case"KEY":var j=R,P=new s.default(j),I=P.enumeratedString("METHOD"),O=P.URI,D=P.hexadecimalInteger("IV");I&&(_=new a.default,O&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(I)>=0&&(_.method=I,_.baseuri=r,_.reluri=O,_.key=null,_.iv=D));break;case"START":var M=R,N=new s.default(M).decimalFloatingPoint("TIME-OFFSET");e.isFinite(N)&&(b.startTimeOffset=N);break;case"MAP":var U=new s.default(R);T.relurl=U.URI,T.rawByteRange=U.BYTERANGE,T.baseurl=r,T.level=n,T.type=u,T.sn="initSegment",b.initSegment=T,(T=new i.default).rawProgramDateTime=b.initSegment.rawProgramDateTime;break;default:l.logger.warn("line parsed but not handled: "+d)}}}return(T=E)&&!T.relurl&&(b.fragments.pop(),v-=T.duration),b.totalduration=v,b.averagetargetduration=v/b.fragments.length,b.endSN=y-1,b.startCC=b.fragments[0]?b.fragments[0].cc:0,b.endCC=A,!b.initSegment&&b.fragments.length&&b.fragments.every((function(e){return p.test(e.relurl)}))&&(l.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(T=new i.default).relurl=b.fragments[0].relurl,T.baseurl=r,T.level=n,T.type=u,T.sn="initSegment",b.initSegment=T,b.needSidxRanges=!0),S&&function(e,t){for(var r=e[t],n=t-1;n>=0;n--){var i=e[n];i.programDateTime=r.programDateTime-1e3*i.duration,r=i}}(b.fragments,S),b},t}();function g(t,r){t.rawProgramDateTime?t.programDateTime=Date.parse(t.rawProgramDateTime):r&&r.programDateTime&&(t.programDateTime=r.endProgramDateTime),e.isFinite(t.programDateTime)||(t.programDateTime=null,t.rawProgramDateTime=null)}t.default=m}).call(this,r(/*! ./src/polyfills/number */"./src/polyfills/number.js").Number)},"./src/loader/playlist-loader.js": +/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),i=r(/*! ./fragment */"./src/loader/fragment.js"),o=r(/*! ./level */"./src/loader/level.js"),a=r(/*! ./level-key */"./src/loader/level-key.js"),s=r(/*! ../utils/attr-list */"./src/utils/attr-list.js"),l=r(/*! ../utils/logger */"./src/utils/logger.js"),u=r(/*! ../utils/codecs */"./src/utils/codecs.js"),c=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,d=/#EXT-X-MEDIA:(.*)/g,f=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)([\S+ ?]+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),h=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)([^:]*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/,p=/\.(mp4|m4s|m4v|m4a)$/i,m=function(){function t(){}return t.findGroup=function(e,t){if(!e)return null;for(var r=null,n=0;n<e.length;n++){var i=e[n];i.id===t&&(r=i)}return r},t.convertAVC1ToAVCOTI=function(e){var t,r=e.split(".");return r.length>2?(t=r.shift()+".",t+=parseInt(r.shift()).toString(16),t+=("000"+parseInt(r.shift()).toString(16)).substr(-4)):t=e,t},t.resolve=function(e,t){return n.buildAbsoluteURL(t,e,{alwaysNormalize:!0})},t.parseMasterPlaylist=function(e,r){var n,i=[];function o(e,t){["video","audio"].forEach((function(r){var n=e.filter((function(e){return u.isCodecType(e,r)}));if(n.length){var i=n.filter((function(e){return 0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)}));t[r+"Codec"]=i.length>0?i[0]:n[0],e=e.filter((function(e){return-1===n.indexOf(e)}))}})),t.unknownCodecs=e}for(c.lastIndex=0;null!=(n=c.exec(e));){var a={},l=a.attrs=new s.default(n[1]);a.url=t.resolve(n[2],r);var d=l.decimalResolution("RESOLUTION");d&&(a.width=d.width,a.height=d.height),a.bitrate=l.decimalInteger("AVERAGE-BANDWIDTH")||l.decimalInteger("BANDWIDTH"),a.name=l.NAME,o([].concat((l.CODECS||"").split(/[ ,]+/)),a),a.videoCodec&&-1!==a.videoCodec.indexOf("avc1")&&(a.videoCodec=t.convertAVC1ToAVCOTI(a.videoCodec)),i.push(a)}return i},t.parseMasterPlaylistMedia=function(e,r,n,i){var o;void 0===i&&(i=[]);var a=[],l=0;for(d.lastIndex=0;null!==(o=d.exec(e));){var u={},c=new s.default(o[1]);if(c.TYPE===n){if(u.groupId=c["GROUP-ID"],u.name=c.NAME,u.type=n,u.default="YES"===c.DEFAULT,u.autoselect="YES"===c.AUTOSELECT,u.forced="YES"===c.FORCED,c.URI&&(u.url=t.resolve(c.URI,r)),u.lang=c.LANGUAGE,u.name||(u.name=u.lang),i.length){var f=t.findGroup(i,u.groupId);u.audioCodec=f?f.codec:i[0].codec}u.id=l++,a.push(u)}}return a},t.parseLevelPlaylist=function(t,r,n,u,c){var d,m,y=0,v=0,b=new o.default(r),_=new a.default,A=0,E=null,T=new i.default,S=null;for(f.lastIndex=0;null!==(d=f.exec(t));){var w=d[1];if(w){T.duration=parseFloat(w);var k=(" "+d[2]).slice(1);T.title=k||null,T.tagList.push(k?["INF",w,k]:["INF",w])}else if(d[3]){if(e.isFinite(T.duration)){var C=y++;T.type=u,T.start=v,T.levelkey=_,T.sn=C,T.level=n,T.cc=A,T.urlId=c,T.baseurl=r,T.relurl=(" "+d[3]).slice(1),g(T,E),b.fragments.push(T),E=T,v+=T.duration,T=new i.default}}else if(d[4]){if(T.rawByteRange=(" "+d[4]).slice(1),E){var x=E.byteRangeEndOffset;x&&(T.lastByteRangeEndOffset=x)}}else if(d[5])T.rawProgramDateTime=(" "+d[5]).slice(1),T.tagList.push(["PROGRAM-DATE-TIME",T.rawProgramDateTime]),null===S&&(S=b.fragments.length);else{for(d=d[0].match(h),m=1;m<d.length&&void 0===d[m];m++);var R=(" "+d[m+1]).slice(1),L=(" "+d[m+2]).slice(1);switch(d[m]){case"#":T.tagList.push(L?[R,L]:[R]);break;case"PLAYLIST-TYPE":b.type=R.toUpperCase();break;case"MEDIA-SEQUENCE":y=b.startSN=parseInt(R);break;case"TARGETDURATION":b.targetduration=parseFloat(R);break;case"VERSION":b.version=parseInt(R);break;case"EXTM3U":break;case"ENDLIST":b.live=!1;break;case"DIS":A++,T.tagList.push(["DIS"]);break;case"DISCONTINUITY-SEQ":A=parseInt(R);break;case"KEY":var j=R,P=new s.default(j),I=P.enumeratedString("METHOD"),O=P.URI,D=P.hexadecimalInteger("IV");I&&(_=new a.default,O&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(I)>=0&&(_.method=I,_.baseuri=r,_.reluri=O,_.key=null,_.iv=D));break;case"START":var M=R,N=new s.default(M).decimalFloatingPoint("TIME-OFFSET");e.isFinite(N)&&(b.startTimeOffset=N);break;case"MAP":var F=new s.default(R);T.relurl=F.URI,T.rawByteRange=F.BYTERANGE,T.baseurl=r,T.level=n,T.type=u,T.sn="initSegment",b.initSegment=T,(T=new i.default).rawProgramDateTime=b.initSegment.rawProgramDateTime;break;default:l.logger.warn("line parsed but not handled: "+d)}}}return(T=E)&&!T.relurl&&(b.fragments.pop(),v-=T.duration),b.totalduration=v,b.averagetargetduration=v/b.fragments.length,b.endSN=y-1,b.startCC=b.fragments[0]?b.fragments[0].cc:0,b.endCC=A,!b.initSegment&&b.fragments.length&&b.fragments.every((function(e){return p.test(e.relurl)}))&&(l.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(T=new i.default).relurl=b.fragments[0].relurl,T.baseurl=r,T.level=n,T.type=u,T.sn="initSegment",b.initSegment=T,b.needSidxRanges=!0),S&&function(e,t){for(var r=e[t],n=t-1;n>=0;n--){var i=e[n];i.programDateTime=r.programDateTime-1e3*i.duration,r=i}}(b.fragments,S),b},t}();function g(t,r){t.rawProgramDateTime?t.programDateTime=Date.parse(t.rawProgramDateTime):r&&r.programDateTime&&(t.programDateTime=r.endProgramDateTime),e.isFinite(t.programDateTime)||(t.programDateTime=null,t.rawProgramDateTime=null)}t.default=m}).call(this,r(/*! ./src/polyfills/number */"./src/polyfills/number.js").Number)},"./src/loader/playlist-loader.js": /*!***************************************!*\ !*** ./src/loader/playlist-loader.js ***! \***************************************/ @@ -786,7 +786,7 @@ !*** ./src/remux/mp4-remuxer.js ***! \**********************************/ /*! no static exports found */ -/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(/*! ./aac-helper */"./src/remux/aac-helper.js"),i=r(/*! ./mp4-generator */"./src/remux/mp4-generator.js"),o=r(/*! ../events */"./src/events.js"),a=r(/*! ../errors */"./src/errors.js"),s=r(/*! ../utils/logger */"./src/utils/logger.js"),l=function(){function e(e,t,r,n){this.observer=e,this.config=t,this.typeSupported=r;var i=navigator.userAgent;this.isSafari=n&&n.indexOf("Apple")>-1&&i&&!i.match("CriOS"),this.ISGenerated=!1}return e.prototype.destroy=function(){},e.prototype.resetTimeStamp=function(e){this._initPTS=this._initDTS=e},e.prototype.resetInitSegment=function(){this.ISGenerated=!1},e.prototype.remux=function(e,t,r,n,i,a,l){if(this.ISGenerated||this.generateIS(e,t,i),this.ISGenerated){var u=e.samples.length,c=t.samples.length,d=i,f=i;if(u&&c){var h=(e.samples[0].pts-t.samples[0].pts)/t.inputTimeScale;d+=Math.max(0,h),f+=Math.max(0,-h)}if(u){e.timescale||(s.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(e,t,i));var p=this.remuxAudio(e,d,a,l);if(c){var m=void 0;p&&(m=p.endPTS-p.startPTS),t.timescale||(s.logger.warn("regenerate InitSegment as video detected"),this.generateIS(e,t,i)),this.remuxVideo(t,f,a,m,l)}}else if(c){var g=this.remuxVideo(t,f,a,0,l);g&&e.codec&&this.remuxEmptyAudio(e,d,a,g)}}r.samples.length&&this.remuxID3(r,i),n.samples.length&&this.remuxText(n,i),this.observer.trigger(o.default.FRAG_PARSED)},e.prototype.generateIS=function(e,t,r){var n,l,u=this.observer,c=e.samples,d=t.samples,f=this.typeSupported,h="audio/mp4",p={},m={tracks:p},g=void 0===this._initPTS;if(g&&(n=l=1/0),e.config&&c.length&&(e.timescale=e.samplerate,s.logger.log("audio sampling rate : "+e.samplerate),e.isAAC||(f.mpeg?(h="audio/mpeg",e.codec=""):f.mp3&&(e.codec="mp3")),p.audio={container:h,codec:e.codec,initSegment:!e.isAAC&&f.mpeg?new Uint8Array:i.default.initSegment([e]),metadata:{channelCount:e.channelCount}},g&&(n=l=c[0].pts-e.inputTimeScale*r)),t.sps&&t.pps&&d.length){var y=t.inputTimeScale;t.timescale=y,p.video={container:"video/mp4",codec:t.codec,initSegment:i.default.initSegment([t]),metadata:{width:t.width,height:t.height}},g&&(n=Math.min(n,d[0].pts-y*r),l=Math.min(l,d[0].dts-y*r),this.observer.trigger(o.default.INIT_PTS_FOUND,{initPTS:n}))}Object.keys(p).length?(u.trigger(o.default.FRAG_PARSING_INIT_SEGMENT,m),this.ISGenerated=!0,g&&(this._initPTS=n,this._initDTS=l)):u.trigger(o.default.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},e.prototype.remuxVideo=function(e,t,r,n,l){var u,c,d,f,h,p,m,g=8,y=e.timescale,v=e.samples,b=[],_=v.length,A=this._PTSNormalize,E=this._initPTS,T=this.nextAvcDts,S=this.isSafari;if(0!==_){S&&(r|=v.length&&T&&(l&&Math.abs(t-T/y)<.1||Math.abs(v[0].pts-T-E)<y/5)),r||(T=t*y),v.forEach((function(e){e.pts=A(e.pts-E,T),e.dts=A(e.dts-E,T)})),v.sort((function(e,t){var r=e.dts-t.dts,n=e.pts-t.pts;return r||n||e.id-t.id}));var w=v.reduce((function(e,t){return Math.max(Math.min(e,t.pts-t.dts),-18e3)}),0);if(w<0){s.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(w/90)+" ms to overcome this issue");for(var k=0;k<v.length;k++)v[k].dts+=w}var x=v[0];h=Math.max(x.dts,0),f=Math.max(x.pts,0);var C=Math.round((h-T)/90);r&&C&&(C>1?s.logger.log("AVC:"+C+" ms hole between fragments detected,filling it"):C<-1&&s.logger.log("AVC:"+-C+" ms overlapping between fragments detected"),h=T,v[0].dts=h,f=Math.max(f-C,T),v[0].pts=f,s.logger.log("Video/PTS/DTS adjusted: "+Math.round(f/90)+"/"+Math.round(h/90)+",delta:"+C+" ms")),x=v[v.length-1],m=Math.max(x.dts,0),p=Math.max(x.pts,0,m),S&&(u=Math.round((m-h)/(v.length-1)));var R=0,L=0;for(k=0;k<_;k++){for(var j=v[k],P=j.units,I=P.length,O=0,D=0;D<I;D++)O+=P[D].data.length;L+=O,R+=I,j.length=O,j.dts=S?h+k*u:Math.max(j.dts,h),j.pts=Math.max(j.pts,j.dts)}var M=L+4*R+8;try{c=new Uint8Array(M)}catch(e){return void this.observer.trigger(o.default.ERROR,{type:a.ErrorTypes.MUX_ERROR,details:a.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:M,reason:"fail allocating video mdat "+M})}var N=new DataView(c.buffer);for(N.setUint32(0,M),c.set(i.default.types.mdat,4),k=0;k<_;k++){var U=v[k],F=U.units,B=0,K=void 0;for(D=0,I=F.length;D<I;D++){var G=F[D],V=G.data,H=G.data.byteLength;N.setUint32(g,H),g+=4,c.set(V,g),g+=H,B+=4+H}if(S)K=Math.max(0,u*Math.round((U.pts-U.dts)/u));else{if(k<_-1)u=v[k+1].dts-U.dts;else{var Y=this.config,z=U.dts-v[k>0?k-1:k].dts;if(Y.stretchShortVideoTrack){var W=Y.maxBufferHole,$=Math.floor(W*y),q=(n?f+n*y:this.nextAudioPts)-U.pts;q>$?((u=q-z)<0&&(u=z),s.logger.log("It is approximately "+q/90+" ms to the next segment; using duration "+u/90+" ms for the last video frame.")):u=z}else u=z}K=Math.round(U.pts-U.dts)}b.push({size:B,duration:u,cts:K,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:U.key?2:1,isNonSync:U.key?0:1}})}this.nextAvcDts=m+u;var X=e.dropped;if(e.len=0,e.nbNalu=0,e.dropped=0,b.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var J=b[0].flags;J.dependsOn=2,J.isNonSync=0}e.samples=b,d=i.default.moof(e.sequenceNumber++,h,e),e.samples=[];var Z={data1:d,data2:c,startPTS:f/y,endPTS:(p+u)/y,startDTS:h/y,endDTS:this.nextAvcDts/y,type:"video",hasAudio:!1,hasVideo:!0,nb:b.length,dropped:X};return this.observer.trigger(o.default.FRAG_PARSING_DATA,Z),Z}},e.prototype.remuxAudio=function(e,t,r,l){var u,c,d,f,h,p,m,g=e.inputTimeScale,y=e.timescale,v=g/y,b=(e.isAAC?1024:1152)*v,_=this._PTSNormalize,A=this._initPTS,E=!e.isAAC&&this.typeSupported.mpeg,T=e.samples,S=[],w=this.nextAudioPts;if(r|=T.length&&w&&(l&&Math.abs(t-w/g)<.1||Math.abs(T[0].pts-w-A)<20*b),T.forEach((function(e){e.pts=e.dts=_(e.pts-A,t*g)})),0!==(T=T.filter((function(e){return e.pts>=0}))).length){if(r||(w=l?t*g:T[0].pts),e.isAAC)for(var k=this.config.maxAudioFramesDrift,x=0,C=w;x<T.length;){var R,L=T[x];R=(U=L.pts)-C;var j=Math.abs(1e3*R/g);if(R<=-k*b)s.logger.warn("Dropping 1 audio frame @ "+(C/g).toFixed(3)+"s due to "+Math.round(j)+" ms overlap."),T.splice(x,1),e.len-=L.unit.length;else if(R>=k*b&&j<1e4&&C){var P=Math.round(R/b);s.logger.warn("Injecting "+P+" audio frame @ "+(C/g).toFixed(3)+"s due to "+Math.round(1e3*R/g)+" ms gap.");for(var I=0;I<P;I++){var O=Math.max(C,0);(d=n.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(s.logger.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),d=L.unit.subarray()),T.splice(x,0,{unit:d,pts:O,dts:O}),e.len+=d.length,C+=b,x++}L.pts=L.dts=C,C+=b,x++}else Math.abs(R),L.pts=L.dts=C,C+=b,x++}I=0;for(var D=T.length;I<D;I++){var M=T[I],N=M.unit,U=M.pts;if(void 0!==m)c.duration=Math.round((U-m)/v);else{var F=Math.round(1e3*(U-w)/g),B=0;if(r&&e.isAAC&&F){if(F>0&&F<1e4)B=Math.round((U-w)/b),s.logger.log(F+" ms hole between AAC samples detected,filling it"),B>0&&((d=n.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(d=N.subarray()),e.len+=B*d.length);else if(F<-12){s.logger.log("drop overlapping AAC sample, expected/parsed/delta:"+(w/g).toFixed(3)+"s/"+(U/g).toFixed(3)+"s/"+-F+"ms"),e.len-=N.byteLength;continue}U=w}if(p=U,!(e.len>0))return;var K=E?e.len:e.len+8;u=E?0:8;try{f=new Uint8Array(K)}catch(e){return void this.observer.trigger(o.default.ERROR,{type:a.ErrorTypes.MUX_ERROR,details:a.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:K,reason:"fail allocating audio mdat "+K})}for(E||(new DataView(f.buffer).setUint32(0,K),f.set(i.default.types.mdat,4)),x=0;x<B;x++)(d=n.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(s.logger.log("Unable to get silent frame for given audio codec; duplicating this frame instead."),d=N.subarray()),f.set(d,u),u+=d.byteLength,c={size:d.byteLength,cts:0,duration:1024,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},S.push(c)}f.set(N,u);var G=N.byteLength;u+=G,c={size:G,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},S.push(c),m=U}var V=0,H=S.length;if(H>=2&&(V=S[H-2].duration,c.duration=V),H){this.nextAudioPts=w=m+v*V,e.len=0,e.samples=S,h=E?new Uint8Array:i.default.moof(e.sequenceNumber++,p/v,e),e.samples=[];var Y=p/g,z=w/g,W={data1:h,data2:f,startPTS:Y,endPTS:z,startDTS:Y,endDTS:z,type:"audio",hasAudio:!0,hasVideo:!1,nb:H};return this.observer.trigger(o.default.FRAG_PARSING_DATA,W),W}return null}},e.prototype.remuxEmptyAudio=function(e,t,r,i){var o=e.inputTimeScale,a=o/(e.samplerate?e.samplerate:o),l=this.nextAudioPts,u=(void 0!==l?l:i.startDTS*o)+this._initDTS,c=i.endDTS*o+this._initDTS,d=1024*a,f=Math.ceil((c-u)/d),h=n.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(s.logger.warn("remux empty Audio"),h){for(var p=[],m=0;m<f;m++){var g=u+m*d;p.push({unit:h,pts:g,dts:g}),e.len+=h.length}e.samples=p,this.remuxAudio(e,t,r)}else s.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!")},e.prototype.remuxID3=function(e){var t,r=e.samples.length,n=e.inputTimeScale,i=this._initPTS,a=this._initDTS;if(r){for(var s=0;s<r;s++)(t=e.samples[s]).pts=(t.pts-i)/n,t.dts=(t.dts-a)/n;this.observer.trigger(o.default.FRAG_PARSING_METADATA,{samples:e.samples})}e.samples=[]},e.prototype.remuxText=function(e){e.samples.sort((function(e,t){return e.pts-t.pts}));var t,r=e.samples.length,n=e.inputTimeScale,i=this._initPTS;if(r){for(var a=0;a<r;a++)(t=e.samples[a]).pts=(t.pts-i)/n;this.observer.trigger(o.default.FRAG_PARSING_USERDATA,{samples:e.samples})}e.samples=[]},e.prototype._PTSNormalize=function(e,t){var r;if(void 0===t)return e;for(r=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=r;return e},e}();t.default=l},"./src/remux/passthrough-remuxer.js": +/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(/*! ./aac-helper */"./src/remux/aac-helper.js"),i=r(/*! ./mp4-generator */"./src/remux/mp4-generator.js"),o=r(/*! ../events */"./src/events.js"),a=r(/*! ../errors */"./src/errors.js"),s=r(/*! ../utils/logger */"./src/utils/logger.js"),l=function(){function e(e,t,r,n){this.observer=e,this.config=t,this.typeSupported=r;var i=navigator.userAgent;this.isSafari=n&&n.indexOf("Apple")>-1&&i&&!i.match("CriOS"),this.ISGenerated=!1}return e.prototype.destroy=function(){},e.prototype.resetTimeStamp=function(e){this._initPTS=this._initDTS=e},e.prototype.resetInitSegment=function(){this.ISGenerated=!1},e.prototype.remux=function(e,t,r,n,i,a,l){if(this.ISGenerated||this.generateIS(e,t,i),this.ISGenerated){var u=e.samples.length,c=t.samples.length,d=i,f=i;if(u&&c){var h=(e.samples[0].pts-t.samples[0].pts)/t.inputTimeScale;d+=Math.max(0,h),f+=Math.max(0,-h)}if(u){e.timescale||(s.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(e,t,i));var p=this.remuxAudio(e,d,a,l);if(c){var m=void 0;p&&(m=p.endPTS-p.startPTS),t.timescale||(s.logger.warn("regenerate InitSegment as video detected"),this.generateIS(e,t,i)),this.remuxVideo(t,f,a,m,l)}}else if(c){var g=this.remuxVideo(t,f,a,0,l);g&&e.codec&&this.remuxEmptyAudio(e,d,a,g)}}r.samples.length&&this.remuxID3(r,i),n.samples.length&&this.remuxText(n,i),this.observer.trigger(o.default.FRAG_PARSED)},e.prototype.generateIS=function(e,t,r){var n,l,u=this.observer,c=e.samples,d=t.samples,f=this.typeSupported,h="audio/mp4",p={},m={tracks:p},g=void 0===this._initPTS;if(g&&(n=l=1/0),e.config&&c.length&&(e.timescale=e.samplerate,s.logger.log("audio sampling rate : "+e.samplerate),e.isAAC||(f.mpeg?(h="audio/mpeg",e.codec=""):f.mp3&&(e.codec="mp3")),p.audio={container:h,codec:e.codec,initSegment:!e.isAAC&&f.mpeg?new Uint8Array:i.default.initSegment([e]),metadata:{channelCount:e.channelCount}},g&&(n=l=c[0].pts-e.inputTimeScale*r)),t.sps&&t.pps&&d.length){var y=t.inputTimeScale;t.timescale=y,p.video={container:"video/mp4",codec:t.codec,initSegment:i.default.initSegment([t]),metadata:{width:t.width,height:t.height}},g&&(n=Math.min(n,d[0].pts-y*r),l=Math.min(l,d[0].dts-y*r),this.observer.trigger(o.default.INIT_PTS_FOUND,{initPTS:n}))}Object.keys(p).length?(u.trigger(o.default.FRAG_PARSING_INIT_SEGMENT,m),this.ISGenerated=!0,g&&(this._initPTS=n,this._initDTS=l)):u.trigger(o.default.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},e.prototype.remuxVideo=function(e,t,r,n,l){var u,c,d,f,h,p,m,g=8,y=e.timescale,v=e.samples,b=[],_=v.length,A=this._PTSNormalize,E=this._initPTS,T=this.nextAvcDts,S=this.isSafari;if(0!==_){S&&(r|=v.length&&T&&(l&&Math.abs(t-T/y)<.1||Math.abs(v[0].pts-T-E)<y/5)),r||(T=t*y),v.forEach((function(e){e.pts=A(e.pts-E,T),e.dts=A(e.dts-E,T)})),v.sort((function(e,t){var r=e.dts-t.dts,n=e.pts-t.pts;return r||n||e.id-t.id}));var w=v.reduce((function(e,t){return Math.max(Math.min(e,t.pts-t.dts),-18e3)}),0);if(w<0){s.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(w/90)+" ms to overcome this issue");for(var k=0;k<v.length;k++)v[k].dts+=w}var C=v[0];h=Math.max(C.dts,0),f=Math.max(C.pts,0);var x=Math.round((h-T)/90);r&&x&&(x>1?s.logger.log("AVC:"+x+" ms hole between fragments detected,filling it"):x<-1&&s.logger.log("AVC:"+-x+" ms overlapping between fragments detected"),h=T,v[0].dts=h,f=Math.max(f-x,T),v[0].pts=f,s.logger.log("Video/PTS/DTS adjusted: "+Math.round(f/90)+"/"+Math.round(h/90)+",delta:"+x+" ms")),C=v[v.length-1],m=Math.max(C.dts,0),p=Math.max(C.pts,0,m),S&&(u=Math.round((m-h)/(v.length-1)));var R=0,L=0;for(k=0;k<_;k++){for(var j=v[k],P=j.units,I=P.length,O=0,D=0;D<I;D++)O+=P[D].data.length;L+=O,R+=I,j.length=O,j.dts=S?h+k*u:Math.max(j.dts,h),j.pts=Math.max(j.pts,j.dts)}var M=L+4*R+8;try{c=new Uint8Array(M)}catch(e){return void this.observer.trigger(o.default.ERROR,{type:a.ErrorTypes.MUX_ERROR,details:a.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:M,reason:"fail allocating video mdat "+M})}var N=new DataView(c.buffer);for(N.setUint32(0,M),c.set(i.default.types.mdat,4),k=0;k<_;k++){var F=v[k],U=F.units,B=0,K=void 0;for(D=0,I=U.length;D<I;D++){var G=U[D],V=G.data,H=G.data.byteLength;N.setUint32(g,H),g+=4,c.set(V,g),g+=H,B+=4+H}if(S)K=Math.max(0,u*Math.round((F.pts-F.dts)/u));else{if(k<_-1)u=v[k+1].dts-F.dts;else{var Y=this.config,z=F.dts-v[k>0?k-1:k].dts;if(Y.stretchShortVideoTrack){var W=Y.maxBufferHole,$=Math.floor(W*y),q=(n?f+n*y:this.nextAudioPts)-F.pts;q>$?((u=q-z)<0&&(u=z),s.logger.log("It is approximately "+q/90+" ms to the next segment; using duration "+u/90+" ms for the last video frame.")):u=z}else u=z}K=Math.round(F.pts-F.dts)}b.push({size:B,duration:u,cts:K,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:F.key?2:1,isNonSync:F.key?0:1}})}this.nextAvcDts=m+u;var X=e.dropped;if(e.len=0,e.nbNalu=0,e.dropped=0,b.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var J=b[0].flags;J.dependsOn=2,J.isNonSync=0}e.samples=b,d=i.default.moof(e.sequenceNumber++,h,e),e.samples=[];var Z={data1:d,data2:c,startPTS:f/y,endPTS:(p+u)/y,startDTS:h/y,endDTS:this.nextAvcDts/y,type:"video",hasAudio:!1,hasVideo:!0,nb:b.length,dropped:X};return this.observer.trigger(o.default.FRAG_PARSING_DATA,Z),Z}},e.prototype.remuxAudio=function(e,t,r,l){var u,c,d,f,h,p,m,g=e.inputTimeScale,y=e.timescale,v=g/y,b=(e.isAAC?1024:1152)*v,_=this._PTSNormalize,A=this._initPTS,E=!e.isAAC&&this.typeSupported.mpeg,T=e.samples,S=[],w=this.nextAudioPts;if(r|=T.length&&w&&(l&&Math.abs(t-w/g)<.1||Math.abs(T[0].pts-w-A)<20*b),T.forEach((function(e){e.pts=e.dts=_(e.pts-A,t*g)})),0!==(T=T.filter((function(e){return e.pts>=0}))).length){if(r||(w=l?t*g:T[0].pts),e.isAAC)for(var k=this.config.maxAudioFramesDrift,C=0,x=w;C<T.length;){var R,L=T[C];R=(F=L.pts)-x;var j=Math.abs(1e3*R/g);if(R<=-k*b)s.logger.warn("Dropping 1 audio frame @ "+(x/g).toFixed(3)+"s due to "+Math.round(j)+" ms overlap."),T.splice(C,1),e.len-=L.unit.length;else if(R>=k*b&&j<1e4&&x){var P=Math.round(R/b);s.logger.warn("Injecting "+P+" audio frame @ "+(x/g).toFixed(3)+"s due to "+Math.round(1e3*R/g)+" ms gap.");for(var I=0;I<P;I++){var O=Math.max(x,0);(d=n.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(s.logger.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),d=L.unit.subarray()),T.splice(C,0,{unit:d,pts:O,dts:O}),e.len+=d.length,x+=b,C++}L.pts=L.dts=x,x+=b,C++}else Math.abs(R),L.pts=L.dts=x,x+=b,C++}I=0;for(var D=T.length;I<D;I++){var M=T[I],N=M.unit,F=M.pts;if(void 0!==m)c.duration=Math.round((F-m)/v);else{var U=Math.round(1e3*(F-w)/g),B=0;if(r&&e.isAAC&&U){if(U>0&&U<1e4)B=Math.round((F-w)/b),s.logger.log(U+" ms hole between AAC samples detected,filling it"),B>0&&((d=n.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(d=N.subarray()),e.len+=B*d.length);else if(U<-12){s.logger.log("drop overlapping AAC sample, expected/parsed/delta:"+(w/g).toFixed(3)+"s/"+(F/g).toFixed(3)+"s/"+-U+"ms"),e.len-=N.byteLength;continue}F=w}if(p=F,!(e.len>0))return;var K=E?e.len:e.len+8;u=E?0:8;try{f=new Uint8Array(K)}catch(e){return void this.observer.trigger(o.default.ERROR,{type:a.ErrorTypes.MUX_ERROR,details:a.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:K,reason:"fail allocating audio mdat "+K})}for(E||(new DataView(f.buffer).setUint32(0,K),f.set(i.default.types.mdat,4)),C=0;C<B;C++)(d=n.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(s.logger.log("Unable to get silent frame for given audio codec; duplicating this frame instead."),d=N.subarray()),f.set(d,u),u+=d.byteLength,c={size:d.byteLength,cts:0,duration:1024,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},S.push(c)}f.set(N,u);var G=N.byteLength;u+=G,c={size:G,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},S.push(c),m=F}var V=0,H=S.length;if(H>=2&&(V=S[H-2].duration,c.duration=V),H){this.nextAudioPts=w=m+v*V,e.len=0,e.samples=S,h=E?new Uint8Array:i.default.moof(e.sequenceNumber++,p/v,e),e.samples=[];var Y=p/g,z=w/g,W={data1:h,data2:f,startPTS:Y,endPTS:z,startDTS:Y,endDTS:z,type:"audio",hasAudio:!0,hasVideo:!1,nb:H};return this.observer.trigger(o.default.FRAG_PARSING_DATA,W),W}return null}},e.prototype.remuxEmptyAudio=function(e,t,r,i){var o=e.inputTimeScale,a=o/(e.samplerate?e.samplerate:o),l=this.nextAudioPts,u=(void 0!==l?l:i.startDTS*o)+this._initDTS,c=i.endDTS*o+this._initDTS,d=1024*a,f=Math.ceil((c-u)/d),h=n.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(s.logger.warn("remux empty Audio"),h){for(var p=[],m=0;m<f;m++){var g=u+m*d;p.push({unit:h,pts:g,dts:g}),e.len+=h.length}e.samples=p,this.remuxAudio(e,t,r)}else s.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!")},e.prototype.remuxID3=function(e){var t,r=e.samples.length,n=e.inputTimeScale,i=this._initPTS,a=this._initDTS;if(r){for(var s=0;s<r;s++)(t=e.samples[s]).pts=(t.pts-i)/n,t.dts=(t.dts-a)/n;this.observer.trigger(o.default.FRAG_PARSING_METADATA,{samples:e.samples})}e.samples=[]},e.prototype.remuxText=function(e){e.samples.sort((function(e,t){return e.pts-t.pts}));var t,r=e.samples.length,n=e.inputTimeScale,i=this._initPTS;if(r){for(var a=0;a<r;a++)(t=e.samples[a]).pts=(t.pts-i)/n;this.observer.trigger(o.default.FRAG_PARSING_USERDATA,{samples:e.samples})}e.samples=[]},e.prototype._PTSNormalize=function(e,t){var r;if(void 0===t)return e;for(r=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=r;return e},e}();t.default=l},"./src/remux/passthrough-remuxer.js": /*!******************************************!*\ !*** ./src/remux/passthrough-remuxer.js ***! \******************************************/ @@ -968,7 +968,7 @@ /*!***************************!*\ !*** ./src/base/utils.js ***! \***************************/ -/*! no static exports found */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SvgIcons=t.DoubleEventHandler=t.DomRecycler=t.cancelAnimationFrame=t.requestAnimationFrame=t.QueryString=t.Config=t.Fullscreen=void 0;var n=p(r(/*! babel-runtime/core-js/object/assign */"./node_modules/babel-runtime/core-js/object/assign.js")),i=p(r(/*! babel-runtime/helpers/createClass */"./node_modules/babel-runtime/helpers/createClass.js")),o=p(r(/*! babel-runtime/helpers/classCallCheck */"./node_modules/babel-runtime/helpers/classCallCheck.js")),a=p(r(/*! babel-runtime/helpers/possibleConstructorReturn */"./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),s=p(r(/*! babel-runtime/helpers/inherits */"./node_modules/babel-runtime/helpers/inherits.js")),l=p(r(/*! babel-runtime/core-js/object/define-property */"./node_modules/babel-runtime/core-js/object/define-property.js")),u=p(r(/*! babel-runtime/core-js/object/get-own-property-descriptor */"./node_modules/babel-runtime/core-js/object/get-own-property-descriptor.js"));t.assign=m,t.extend=g,t.formatTime=y,t.seekStringToSeconds=A,t.uniqueId=T,t.isNumber=S,t.currentScriptUrl=w,t.getBrowserLanguage=C,t.now=R,t.removeArrayItem=L,t.listContainsIgnoreCase=function(e,t){return void 0!==e&&void 0!==t&&void 0!==t.find((function(t){return e.toLowerCase()===t.toLowerCase()}))},t.canAutoPlayMedia=j,r(/*! ./polyfills */"./src/base/polyfills.js");var c=p(r(/*! ../components/browser */"./src/components/browser/index.js")),d=p(r(/*! clappr-zepto */"./node_modules/clappr-zepto/zepto.js")),f=p(r(/*! ./media */"./src/base/media.js")),h=p(r(/*! ./svg_icons */"./src/base/svg_icons.js"));function p(e){return e&&e.__esModule?e:{default:e}}function m(e,t){if(t)for(var r in t){var n=(0,u.default)(t,r);n?(0,l.default)(e,r,n):e[r]=t[r]}return e}function g(e,t){var r=function(e){function r(){(0,o.default)(this,r);for(var n=arguments.length,i=Array(n),s=0;s<n;s++)i[s]=arguments[s];var l=(0,a.default)(this,e.call.apply(e,[this].concat(i)));return t.initialize&&t.initialize.apply(l,i),l}return(0,s.default)(r,e),r}(e);return m(r.prototype,t),r}function y(e,t){if(!isFinite(e))return"--:--";e*=1e3;var r=(e=parseInt(e/1e3))%60,n=(e=parseInt(e/60))%60,i=(e=parseInt(e/60))%24,o=parseInt(e/24),a="";return o&&o>0&&(a+=o+":",i<1&&(a+="00:")),(i&&i>0||t)&&(a+=("0"+i).slice(-2)+":"),a+=("0"+n).slice(-2)+":",(a+=("0"+r).slice(-2)).trim()}var v=t.Fullscreen={fullscreenElement:function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},requestFullscreen:function(e){e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen?e.msRequestFullscreen():e.querySelector&&e.querySelector("video")&&e.querySelector("video").webkitEnterFullScreen?e.querySelector("video").webkitEnterFullScreen():e.webkitEnterFullScreen&&e.webkitEnterFullScreen()},cancelFullscreen:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;e.exitFullscreen?e.exitFullscreen():e.webkitCancelFullScreen?e.webkitCancelFullScreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.msExitFullscreen&&e.msExitFullscreen()},fullscreenEnabled:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},b=t.Config=function(){function e(){(0,o.default)(this,e)}return e._defaultConfig=function(){return{volume:{value:100,parse:parseInt}}},e._defaultValueFor=function(e){try{return this._defaultConfig()[e].parse(this._defaultConfig()[e].value)}catch(e){return}},e._createKeyspace=function(e){return"clappr."+document.domain+"."+e},e.restore=function(e){return c.default.hasLocalstorage&&localStorage[this._createKeyspace(e)]?this._defaultConfig()[e].parse(localStorage[this._createKeyspace(e)]):this._defaultValueFor(e)},e.persist=function(e,t){if(c.default.hasLocalstorage)try{return localStorage[this._createKeyspace(e)]=t,!0}catch(e){return!1}},e}(),_=t.QueryString=function(){function e(){(0,o.default)(this,e)}return e.parse=function(e){for(var t=void 0,r=/\+/g,n=/([^&=]+)=?([^&]*)/g,i=function(e){return decodeURIComponent(e.replace(r," "))},o={};t=n.exec(e);)o[i(t[1]).toLowerCase()]=i(t[2]);return o},(0,i.default)(e,null,[{key:"params",get:function(){var e=window.location.search.substring(1);return e!==this.query&&(this._urlParams=this.parse(e),this.query=e),this._urlParams}},{key:"hashParams",get:function(){var e=window.location.hash.substring(1);return e!==this.hash&&(this._hashParams=this.parse(e),this.hash=e),this._hashParams}}]),e}();function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"t",t=0,r=_.params[e]||_.hashParams[e]||"",n=r.match(/[0-9]+[hms]+/g)||[];if(n.length>0){var i={h:3600,m:60,s:1};n.forEach((function(e){if(e){var r=e[e.length-1],n=parseInt(e.slice(0,e.length-1),10);t+=n*i[r]}}))}else r&&(t=parseInt(r,10));return t}var E={};function T(e){return E[e]||(E[e]=0),e+ ++E[e]}function S(e){return e-parseFloat(e)+1>=0}function w(){var e=document.getElementsByTagName("script");return e.length?e[e.length-1].src:""}var k=t.requestAnimationFrame=(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}).bind(window),x=t.cancelAnimationFrame=(window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout).bind(window);function C(){return window.navigator&&window.navigator.language}function R(){return window.performance&&window.performance.now?performance.now():Date.now()}function L(e,t){var r=e.indexOf(t);r>=0&&e.splice(r,1)}function j(e,t){var r=(t=(0,n.default)({inline:!1,muted:!1,timeout:250,type:"video",source:f.default.mp4,element:null},t)).element?t.element:document.createElement(t.type);r.muted=t.muted,!0===t.muted&&r.setAttribute("muted","muted"),!0===t.inline&&r.setAttribute("playsinline","playsinline"),r.src=t.source;var i=r.play(),o=setTimeout((function(){a(!1,new Error("Timeout "+t.timeout+" ms has been reached"))}),t.timeout),a=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;clearTimeout(o),e(t,r)};void 0!==i?i.then((function(){return a(!0)})).catch((function(e){return a(!1,e)})):a(!0)}var P=[],I=t.DomRecycler=function(){function e(){(0,o.default)(this,e)}return e.configure=function(e){this.options=d.default.extend(this.options,e)},e.create=function(e){return this.options.recycleVideo&&"video"===e&&P.length>0?P.shift():(0,d.default)("<"+e+">")},e.garbage=function(e){this.options.recycleVideo&&"VIDEO"===e[0].tagName.toUpperCase()&&(e.children().remove(),P.push(e))},e}();I.options={recycleVideo:!1};var O=t.DoubleEventHandler=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;(0,o.default)(this,e),this.delay=t,this.lastTime=0}return e.prototype.handle=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=(new Date).getTime(),i=n-this.lastTime;i<this.delay&&i>0&&(t(),r&&e.preventDefault()),this.lastTime=n},e}();t.SvgIcons=h.default,t.default={Config:b,Fullscreen:v,QueryString:_,DomRecycler:I,extend:g,formatTime:y,seekStringToSeconds:A,uniqueId:T,currentScriptUrl:w,isNumber:S,requestAnimationFrame:k,cancelAnimationFrame:x,getBrowserLanguage:C,now:R,removeArrayItem:L,canAutoPlayMedia:j,Media:f.default,DoubleEventHandler:O,SvgIcons:h.default}},"./src/components/browser/browser.js": +/*! no static exports found */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SvgIcons=t.DoubleEventHandler=t.DomRecycler=t.cancelAnimationFrame=t.requestAnimationFrame=t.QueryString=t.Config=t.Fullscreen=void 0;var n=p(r(/*! babel-runtime/core-js/object/assign */"./node_modules/babel-runtime/core-js/object/assign.js")),i=p(r(/*! babel-runtime/helpers/createClass */"./node_modules/babel-runtime/helpers/createClass.js")),o=p(r(/*! babel-runtime/helpers/classCallCheck */"./node_modules/babel-runtime/helpers/classCallCheck.js")),a=p(r(/*! babel-runtime/helpers/possibleConstructorReturn */"./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),s=p(r(/*! babel-runtime/helpers/inherits */"./node_modules/babel-runtime/helpers/inherits.js")),l=p(r(/*! babel-runtime/core-js/object/define-property */"./node_modules/babel-runtime/core-js/object/define-property.js")),u=p(r(/*! babel-runtime/core-js/object/get-own-property-descriptor */"./node_modules/babel-runtime/core-js/object/get-own-property-descriptor.js"));t.assign=m,t.extend=g,t.formatTime=y,t.seekStringToSeconds=A,t.uniqueId=T,t.isNumber=S,t.currentScriptUrl=w,t.getBrowserLanguage=x,t.now=R,t.removeArrayItem=L,t.listContainsIgnoreCase=function(e,t){return void 0!==e&&void 0!==t&&void 0!==t.find((function(t){return e.toLowerCase()===t.toLowerCase()}))},t.canAutoPlayMedia=j,r(/*! ./polyfills */"./src/base/polyfills.js");var c=p(r(/*! ../components/browser */"./src/components/browser/index.js")),d=p(r(/*! clappr-zepto */"./node_modules/clappr-zepto/zepto.js")),f=p(r(/*! ./media */"./src/base/media.js")),h=p(r(/*! ./svg_icons */"./src/base/svg_icons.js"));function p(e){return e&&e.__esModule?e:{default:e}}function m(e,t){if(t)for(var r in t){var n=(0,u.default)(t,r);n?(0,l.default)(e,r,n):e[r]=t[r]}return e}function g(e,t){var r=function(e){function r(){(0,o.default)(this,r);for(var n=arguments.length,i=Array(n),s=0;s<n;s++)i[s]=arguments[s];var l=(0,a.default)(this,e.call.apply(e,[this].concat(i)));return t.initialize&&t.initialize.apply(l,i),l}return(0,s.default)(r,e),r}(e);return m(r.prototype,t),r}function y(e,t){if(!isFinite(e))return"--:--";e*=1e3;var r=(e=parseInt(e/1e3))%60,n=(e=parseInt(e/60))%60,i=(e=parseInt(e/60))%24,o=parseInt(e/24),a="";return o&&o>0&&(a+=o+":",i<1&&(a+="00:")),(i&&i>0||t)&&(a+=("0"+i).slice(-2)+":"),a+=("0"+n).slice(-2)+":",(a+=("0"+r).slice(-2)).trim()}var v=t.Fullscreen={fullscreenElement:function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},requestFullscreen:function(e){e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen?e.msRequestFullscreen():e.querySelector&&e.querySelector("video")&&e.querySelector("video").webkitEnterFullScreen?e.querySelector("video").webkitEnterFullScreen():e.webkitEnterFullScreen&&e.webkitEnterFullScreen()},cancelFullscreen:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;e.exitFullscreen?e.exitFullscreen():e.webkitCancelFullScreen?e.webkitCancelFullScreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.msExitFullscreen&&e.msExitFullscreen()},fullscreenEnabled:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},b=t.Config=function(){function e(){(0,o.default)(this,e)}return e._defaultConfig=function(){return{volume:{value:100,parse:parseInt}}},e._defaultValueFor=function(e){try{return this._defaultConfig()[e].parse(this._defaultConfig()[e].value)}catch(e){return}},e._createKeyspace=function(e){return"clappr."+document.domain+"."+e},e.restore=function(e){return c.default.hasLocalstorage&&localStorage[this._createKeyspace(e)]?this._defaultConfig()[e].parse(localStorage[this._createKeyspace(e)]):this._defaultValueFor(e)},e.persist=function(e,t){if(c.default.hasLocalstorage)try{return localStorage[this._createKeyspace(e)]=t,!0}catch(e){return!1}},e}(),_=t.QueryString=function(){function e(){(0,o.default)(this,e)}return e.parse=function(e){for(var t=void 0,r=/\+/g,n=/([^&=]+)=?([^&]*)/g,i=function(e){return decodeURIComponent(e.replace(r," "))},o={};t=n.exec(e);)o[i(t[1]).toLowerCase()]=i(t[2]);return o},(0,i.default)(e,null,[{key:"params",get:function(){var e=window.location.search.substring(1);return e!==this.query&&(this._urlParams=this.parse(e),this.query=e),this._urlParams}},{key:"hashParams",get:function(){var e=window.location.hash.substring(1);return e!==this.hash&&(this._hashParams=this.parse(e),this.hash=e),this._hashParams}}]),e}();function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"t",t=0,r=_.params[e]||_.hashParams[e]||"",n=r.match(/[0-9]+[hms]+/g)||[];if(n.length>0){var i={h:3600,m:60,s:1};n.forEach((function(e){if(e){var r=e[e.length-1],n=parseInt(e.slice(0,e.length-1),10);t+=n*i[r]}}))}else r&&(t=parseInt(r,10));return t}var E={};function T(e){return E[e]||(E[e]=0),e+ ++E[e]}function S(e){return e-parseFloat(e)+1>=0}function w(){var e=document.getElementsByTagName("script");return e.length?e[e.length-1].src:""}var k=t.requestAnimationFrame=(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}).bind(window),C=t.cancelAnimationFrame=(window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout).bind(window);function x(){return window.navigator&&window.navigator.language}function R(){return window.performance&&window.performance.now?performance.now():Date.now()}function L(e,t){var r=e.indexOf(t);r>=0&&e.splice(r,1)}function j(e,t){var r=(t=(0,n.default)({inline:!1,muted:!1,timeout:250,type:"video",source:f.default.mp4,element:null},t)).element?t.element:document.createElement(t.type);r.muted=t.muted,!0===t.muted&&r.setAttribute("muted","muted"),!0===t.inline&&r.setAttribute("playsinline","playsinline"),r.src=t.source;var i=r.play(),o=setTimeout((function(){a(!1,new Error("Timeout "+t.timeout+" ms has been reached"))}),t.timeout),a=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;clearTimeout(o),e(t,r)};void 0!==i?i.then((function(){return a(!0)})).catch((function(e){return a(!1,e)})):a(!0)}var P=[],I=t.DomRecycler=function(){function e(){(0,o.default)(this,e)}return e.configure=function(e){this.options=d.default.extend(this.options,e)},e.create=function(e){return this.options.recycleVideo&&"video"===e&&P.length>0?P.shift():(0,d.default)("<"+e+">")},e.garbage=function(e){this.options.recycleVideo&&"VIDEO"===e[0].tagName.toUpperCase()&&(e.children().remove(),P.push(e))},e}();I.options={recycleVideo:!1};var O=t.DoubleEventHandler=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;(0,o.default)(this,e),this.delay=t,this.lastTime=0}return e.prototype.handle=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=(new Date).getTime(),i=n-this.lastTime;i<this.delay&&i>0&&(t(),r&&e.preventDefault()),this.lastTime=n},e}();t.SvgIcons=h.default,t.default={Config:b,Fullscreen:v,QueryString:_,DomRecycler:I,extend:g,formatTime:y,seekStringToSeconds:A,uniqueId:T,currentScriptUrl:w,isNumber:S,requestAnimationFrame:k,cancelAnimationFrame:C,getBrowserLanguage:x,now:R,removeArrayItem:L,canAutoPlayMedia:j,Media:f.default,DoubleEventHandler:O,SvgIcons:h.default}},"./src/components/browser/browser.js": /*!*******************************************!*\ !*** ./src/components/browser/browser.js ***! \*******************************************/ @@ -1048,7 +1048,7 @@ /*!*****************************************!*\ !*** ./src/components/loader/loader.js ***! \*****************************************/ -/*! no static exports found */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=P(r(/*! babel-runtime/core-js/object/create */"./node_modules/babel-runtime/core-js/object/create.js")),i=P(r(/*! babel-runtime/helpers/toConsumableArray */"./node_modules/babel-runtime/helpers/toConsumableArray.js")),o=P(r(/*! babel-runtime/helpers/classCallCheck */"./node_modules/babel-runtime/helpers/classCallCheck.js")),a=P(r(/*! babel-runtime/helpers/possibleConstructorReturn */"./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),s=P(r(/*! babel-runtime/helpers/inherits */"./node_modules/babel-runtime/helpers/inherits.js")),l=P(r(/*! ../../base/base_object */"./src/base/base_object.js")),u=P(r(/*! ../player_info */"./src/components/player_info.js")),c=P(r(/*! ../../playbacks/html5_video */"./src/playbacks/html5_video/index.js")),d=P(r(/*! ../../playbacks/flash */"./src/playbacks/flash/index.js")),f=P(r(/*! ../../playbacks/html5_audio */"./src/playbacks/html5_audio/index.js")),h=P(r(/*! ../../playbacks/flashls */"./src/playbacks/flashls/index.js")),p=P(r(/*! ../../playbacks/hls */"./src/playbacks/hls/index.js")),m=P(r(/*! ../../playbacks/html_img */"./src/playbacks/html_img/index.js")),g=P(r(/*! ../../playbacks/no_op */"./src/playbacks/no_op/index.js")),y=P(r(/*! ../../plugins/spinner_three_bounce */"./src/plugins/spinner_three_bounce/index.js")),v=P(r(/*! ../../plugins/stats */"./src/plugins/stats/index.js")),b=P(r(/*! ../../plugins/watermark */"./src/plugins/watermark/index.js")),_=P(r(/*! ../../plugins/poster */"./src/plugins/poster/index.js")),A=P(r(/*! ../../plugins/google_analytics */"./src/plugins/google_analytics/index.js")),E=P(r(/*! ../../plugins/click_to_pause */"./src/plugins/click_to_pause/index.js")),T=P(r(/*! ../../plugins/media_control */"./src/plugins/media_control/index.js")),S=P(r(/*! ../../plugins/dvr_controls */"./src/plugins/dvr_controls/index.js")),w=P(r(/*! ../../plugins/closed_captions */"./src/plugins/closed_captions/index.js")),k=P(r(/*! ../../plugins/favicon */"./src/plugins/favicon/index.js")),x=P(r(/*! ../../plugins/seek_time */"./src/plugins/seek_time/index.js")),C=P(r(/*! ../../plugins/sources */"./src/plugins/sources.js")),R=P(r(/*! ../../plugins/end_video */"./src/plugins/end_video.js")),L=P(r(/*! ../../plugins/strings */"./src/plugins/strings.js")),j=P(r(/*! ../../plugins/error_screen */"./src/plugins/error_screen/index.js"));function P(e){return e&&e.__esModule?e:{default:e}}var I=function(e){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,o.default)(this,t);var l=(0,a.default)(this,e.call(this));return l.playerId=n,l.playbackPlugins=[],s||(l.playbackPlugins=[].concat((0,i.default)(l.playbackPlugins),[p.default])),l.playbackPlugins=[].concat((0,i.default)(l.playbackPlugins),[c.default,f.default]),s||(l.playbackPlugins=[].concat((0,i.default)(l.playbackPlugins),[d.default,h.default])),l.playbackPlugins=[].concat((0,i.default)(l.playbackPlugins),[m.default,g.default]),l.containerPlugins=[y.default,b.default,_.default,v.default,A.default,E.default],l.corePlugins=[T.default,S.default,w.default,k.default,x.default,C.default,R.default,j.default,L.default],Array.isArray(r)||l.validateExternalPluginsType(r),l.addExternalPlugins(r),l}return(0,s.default)(t,e),t.prototype.groupPluginsByType=function(e){return Array.isArray(e)&&(e=e.reduce((function(e,t){return e[t.type]||(e[t.type]=[]),e[t.type].push(t),e}),{})),e},t.prototype.removeDups=function(e){var t=e.reduceRight((function(e,t){return e[t.prototype.name]&&delete e[t.prototype.name],e[t.prototype.name]=t,e}),(0,n.default)(null)),r=[];for(var i in t)r.unshift(t[i]);return r},t.prototype.addExternalPlugins=function(e){(e=this.groupPluginsByType(e)).playback&&(this.playbackPlugins=this.removeDups(e.playback.concat(this.playbackPlugins))),e.container&&(this.containerPlugins=this.removeDups(e.container.concat(this.containerPlugins))),e.core&&(this.corePlugins=this.removeDups(e.core.concat(this.corePlugins))),u.default.getInstance(this.playerId).playbackPlugins=this.playbackPlugins},t.prototype.validateExternalPluginsType=function(e){["playback","container","core"].forEach((function(t){(e[t]||[]).forEach((function(e){var r="external "+e.type+" plugin on "+t+" array";if(e.type!==t)throw new ReferenceError(r)}))}))},t}(l.default);t.default=I,e.exports=t.default},"./src/components/mediator.js": +/*! no static exports found */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=P(r(/*! babel-runtime/core-js/object/create */"./node_modules/babel-runtime/core-js/object/create.js")),i=P(r(/*! babel-runtime/helpers/toConsumableArray */"./node_modules/babel-runtime/helpers/toConsumableArray.js")),o=P(r(/*! babel-runtime/helpers/classCallCheck */"./node_modules/babel-runtime/helpers/classCallCheck.js")),a=P(r(/*! babel-runtime/helpers/possibleConstructorReturn */"./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),s=P(r(/*! babel-runtime/helpers/inherits */"./node_modules/babel-runtime/helpers/inherits.js")),l=P(r(/*! ../../base/base_object */"./src/base/base_object.js")),u=P(r(/*! ../player_info */"./src/components/player_info.js")),c=P(r(/*! ../../playbacks/html5_video */"./src/playbacks/html5_video/index.js")),d=P(r(/*! ../../playbacks/flash */"./src/playbacks/flash/index.js")),f=P(r(/*! ../../playbacks/html5_audio */"./src/playbacks/html5_audio/index.js")),h=P(r(/*! ../../playbacks/flashls */"./src/playbacks/flashls/index.js")),p=P(r(/*! ../../playbacks/hls */"./src/playbacks/hls/index.js")),m=P(r(/*! ../../playbacks/html_img */"./src/playbacks/html_img/index.js")),g=P(r(/*! ../../playbacks/no_op */"./src/playbacks/no_op/index.js")),y=P(r(/*! ../../plugins/spinner_three_bounce */"./src/plugins/spinner_three_bounce/index.js")),v=P(r(/*! ../../plugins/stats */"./src/plugins/stats/index.js")),b=P(r(/*! ../../plugins/watermark */"./src/plugins/watermark/index.js")),_=P(r(/*! ../../plugins/poster */"./src/plugins/poster/index.js")),A=P(r(/*! ../../plugins/google_analytics */"./src/plugins/google_analytics/index.js")),E=P(r(/*! ../../plugins/click_to_pause */"./src/plugins/click_to_pause/index.js")),T=P(r(/*! ../../plugins/media_control */"./src/plugins/media_control/index.js")),S=P(r(/*! ../../plugins/dvr_controls */"./src/plugins/dvr_controls/index.js")),w=P(r(/*! ../../plugins/closed_captions */"./src/plugins/closed_captions/index.js")),k=P(r(/*! ../../plugins/favicon */"./src/plugins/favicon/index.js")),C=P(r(/*! ../../plugins/seek_time */"./src/plugins/seek_time/index.js")),x=P(r(/*! ../../plugins/sources */"./src/plugins/sources.js")),R=P(r(/*! ../../plugins/end_video */"./src/plugins/end_video.js")),L=P(r(/*! ../../plugins/strings */"./src/plugins/strings.js")),j=P(r(/*! ../../plugins/error_screen */"./src/plugins/error_screen/index.js"));function P(e){return e&&e.__esModule?e:{default:e}}var I=function(e){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,o.default)(this,t);var l=(0,a.default)(this,e.call(this));return l.playerId=n,l.playbackPlugins=[],s||(l.playbackPlugins=[].concat((0,i.default)(l.playbackPlugins),[p.default])),l.playbackPlugins=[].concat((0,i.default)(l.playbackPlugins),[c.default,f.default]),s||(l.playbackPlugins=[].concat((0,i.default)(l.playbackPlugins),[d.default,h.default])),l.playbackPlugins=[].concat((0,i.default)(l.playbackPlugins),[m.default,g.default]),l.containerPlugins=[y.default,b.default,_.default,v.default,A.default,E.default],l.corePlugins=[T.default,S.default,w.default,k.default,C.default,x.default,R.default,j.default,L.default],Array.isArray(r)||l.validateExternalPluginsType(r),l.addExternalPlugins(r),l}return(0,s.default)(t,e),t.prototype.groupPluginsByType=function(e){return Array.isArray(e)&&(e=e.reduce((function(e,t){return e[t.type]||(e[t.type]=[]),e[t.type].push(t),e}),{})),e},t.prototype.removeDups=function(e){var t=e.reduceRight((function(e,t){return e[t.prototype.name]&&delete e[t.prototype.name],e[t.prototype.name]=t,e}),(0,n.default)(null)),r=[];for(var i in t)r.unshift(t[i]);return r},t.prototype.addExternalPlugins=function(e){(e=this.groupPluginsByType(e)).playback&&(this.playbackPlugins=this.removeDups(e.playback.concat(this.playbackPlugins))),e.container&&(this.containerPlugins=this.removeDups(e.container.concat(this.containerPlugins))),e.core&&(this.corePlugins=this.removeDups(e.core.concat(this.corePlugins))),u.default.getInstance(this.playerId).playbackPlugins=this.playbackPlugins},t.prototype.validateExternalPluginsType=function(e){["playback","container","core"].forEach((function(t){(e[t]||[]).forEach((function(e){var r="external "+e.type+" plugin on "+t+" array";if(e.type!==t)throw new ReferenceError(r)}))}))},t}(l.default);t.default=I,e.exports=t.default},"./src/components/mediator.js": /*!************************************!*\ !*** ./src/components/mediator.js ***! \************************************/ @@ -1104,7 +1104,7 @@ /*!*********************!*\ !*** ./src/main.js ***! \*********************/ -/*! no static exports found */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=B(r(/*! ./components/player */"./src/components/player.js")),i=B(r(/*! ./base/utils */"./src/base/utils.js")),o=B(r(/*! ./base/events */"./src/base/events.js")),a=B(r(/*! ./base/playback */"./src/base/playback.js")),s=B(r(/*! ./base/container_plugin */"./src/base/container_plugin.js")),l=B(r(/*! ./base/core_plugin */"./src/base/core_plugin.js")),u=B(r(/*! ./base/ui_core_plugin */"./src/base/ui_core_plugin.js")),c=B(r(/*! ./base/ui_container_plugin */"./src/base/ui_container_plugin.js")),d=B(r(/*! ./base/base_object */"./src/base/base_object.js")),f=B(r(/*! ./base/ui_object */"./src/base/ui_object.js")),h=B(r(/*! ./components/browser */"./src/components/browser/index.js")),p=B(r(/*! ./components/container */"./src/components/container/index.js")),m=B(r(/*! ./components/core */"./src/components/core/index.js")),g=B(r(/*! ./components/error */"./src/components/error/index.js")),y=B(r(/*! ./components/loader */"./src/components/loader/index.js")),v=B(r(/*! ./components/mediator */"./src/components/mediator.js")),b=B(r(/*! ./components/player_info */"./src/components/player_info.js")),_=B(r(/*! ./playbacks/base_flash_playback */"./src/playbacks/base_flash_playback/index.js")),A=B(r(/*! ./playbacks/flash */"./src/playbacks/flash/index.js")),E=B(r(/*! ./playbacks/flashls */"./src/playbacks/flashls/index.js")),T=B(r(/*! ./playbacks/hls */"./src/playbacks/hls/index.js")),S=B(r(/*! ./playbacks/html5_audio */"./src/playbacks/html5_audio/index.js")),w=B(r(/*! ./playbacks/html5_video */"./src/playbacks/html5_video/index.js")),k=B(r(/*! ./playbacks/html_img */"./src/playbacks/html_img/index.js")),x=B(r(/*! ./playbacks/no_op */"./src/playbacks/no_op/index.js")),C=B(r(/*! ./plugins/media_control */"./src/plugins/media_control/index.js")),R=B(r(/*! ./plugins/click_to_pause */"./src/plugins/click_to_pause/index.js")),L=B(r(/*! ./plugins/dvr_controls */"./src/plugins/dvr_controls/index.js")),j=B(r(/*! ./plugins/favicon */"./src/plugins/favicon/index.js")),P=B(r(/*! ./plugins/log */"./src/plugins/log/index.js")),I=B(r(/*! ./plugins/poster */"./src/plugins/poster/index.js")),O=B(r(/*! ./plugins/spinner_three_bounce */"./src/plugins/spinner_three_bounce/index.js")),D=B(r(/*! ./plugins/watermark */"./src/plugins/watermark/index.js")),M=B(r(/*! ./base/styler */"./src/base/styler.js")),N=B(r(/*! ./vendor */"./src/vendor/index.js")),U=B(r(/*! ./base/template */"./src/base/template.js")),F=B(r(/*! clappr-zepto */"./node_modules/clappr-zepto/zepto.js"));function B(e){return e&&e.__esModule?e:{default:e}}t.default={Player:n.default,Mediator:v.default,Events:o.default,Browser:h.default,PlayerInfo:b.default,MediaControl:C.default,ContainerPlugin:s.default,UIContainerPlugin:c.default,CorePlugin:l.default,UICorePlugin:u.default,Playback:a.default,Container:p.default,Core:m.default,PlayerError:g.default,Loader:y.default,BaseObject:d.default,UIObject:f.default,Utils:i.default,BaseFlashPlayback:_.default,Flash:A.default,FlasHLS:E.default,HLS:T.default,HTML5Audio:S.default,HTML5Video:w.default,HTMLImg:k.default,NoOp:x.default,ClickToPausePlugin:R.default,DVRControls:L.default,Favicon:j.default,Log:P.default,Poster:I.default,SpinnerThreeBouncePlugin:O.default,WaterMarkPlugin:D.default,Styler:M.default,Vendor:N.default,version:"0.3.12",template:U.default,$:F.default},e.exports=t.default},"./src/playbacks/base_flash_playback/base_flash_playback.js": +/*! no static exports found */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=B(r(/*! ./components/player */"./src/components/player.js")),i=B(r(/*! ./base/utils */"./src/base/utils.js")),o=B(r(/*! ./base/events */"./src/base/events.js")),a=B(r(/*! ./base/playback */"./src/base/playback.js")),s=B(r(/*! ./base/container_plugin */"./src/base/container_plugin.js")),l=B(r(/*! ./base/core_plugin */"./src/base/core_plugin.js")),u=B(r(/*! ./base/ui_core_plugin */"./src/base/ui_core_plugin.js")),c=B(r(/*! ./base/ui_container_plugin */"./src/base/ui_container_plugin.js")),d=B(r(/*! ./base/base_object */"./src/base/base_object.js")),f=B(r(/*! ./base/ui_object */"./src/base/ui_object.js")),h=B(r(/*! ./components/browser */"./src/components/browser/index.js")),p=B(r(/*! ./components/container */"./src/components/container/index.js")),m=B(r(/*! ./components/core */"./src/components/core/index.js")),g=B(r(/*! ./components/error */"./src/components/error/index.js")),y=B(r(/*! ./components/loader */"./src/components/loader/index.js")),v=B(r(/*! ./components/mediator */"./src/components/mediator.js")),b=B(r(/*! ./components/player_info */"./src/components/player_info.js")),_=B(r(/*! ./playbacks/base_flash_playback */"./src/playbacks/base_flash_playback/index.js")),A=B(r(/*! ./playbacks/flash */"./src/playbacks/flash/index.js")),E=B(r(/*! ./playbacks/flashls */"./src/playbacks/flashls/index.js")),T=B(r(/*! ./playbacks/hls */"./src/playbacks/hls/index.js")),S=B(r(/*! ./playbacks/html5_audio */"./src/playbacks/html5_audio/index.js")),w=B(r(/*! ./playbacks/html5_video */"./src/playbacks/html5_video/index.js")),k=B(r(/*! ./playbacks/html_img */"./src/playbacks/html_img/index.js")),C=B(r(/*! ./playbacks/no_op */"./src/playbacks/no_op/index.js")),x=B(r(/*! ./plugins/media_control */"./src/plugins/media_control/index.js")),R=B(r(/*! ./plugins/click_to_pause */"./src/plugins/click_to_pause/index.js")),L=B(r(/*! ./plugins/dvr_controls */"./src/plugins/dvr_controls/index.js")),j=B(r(/*! ./plugins/favicon */"./src/plugins/favicon/index.js")),P=B(r(/*! ./plugins/log */"./src/plugins/log/index.js")),I=B(r(/*! ./plugins/poster */"./src/plugins/poster/index.js")),O=B(r(/*! ./plugins/spinner_three_bounce */"./src/plugins/spinner_three_bounce/index.js")),D=B(r(/*! ./plugins/watermark */"./src/plugins/watermark/index.js")),M=B(r(/*! ./base/styler */"./src/base/styler.js")),N=B(r(/*! ./vendor */"./src/vendor/index.js")),F=B(r(/*! ./base/template */"./src/base/template.js")),U=B(r(/*! clappr-zepto */"./node_modules/clappr-zepto/zepto.js"));function B(e){return e&&e.__esModule?e:{default:e}}t.default={Player:n.default,Mediator:v.default,Events:o.default,Browser:h.default,PlayerInfo:b.default,MediaControl:x.default,ContainerPlugin:s.default,UIContainerPlugin:c.default,CorePlugin:l.default,UICorePlugin:u.default,Playback:a.default,Container:p.default,Core:m.default,PlayerError:g.default,Loader:y.default,BaseObject:d.default,UIObject:f.default,Utils:i.default,BaseFlashPlayback:_.default,Flash:A.default,FlasHLS:E.default,HLS:T.default,HTML5Audio:S.default,HTML5Video:w.default,HTMLImg:k.default,NoOp:C.default,ClickToPausePlugin:R.default,DVRControls:L.default,Favicon:j.default,Log:P.default,Poster:I.default,SpinnerThreeBouncePlugin:O.default,WaterMarkPlugin:D.default,Styler:M.default,Vendor:N.default,version:"0.3.12",template:F.default,$:U.default},e.exports=t.default},"./src/playbacks/base_flash_playback/base_flash_playback.js": /*!******************************************************************!*\ !*** ./src/playbacks/base_flash_playback/base_flash_playback.js ***! \******************************************************************/ @@ -1404,14 +1404,14 @@ /*!*****************************************************************!*\ !*** ./node_modules/shaka-player/dist/shaka-player.compiled.js ***! \*****************************************************************/ -/*! no static exports found */function(e,t,r){(function(e,r){!function(){var n="undefined"!=typeof window?window:e,i={};for(var o in function(e,t){var n,i="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,r){e!=Array.prototype&&e!=Object.prototype&&(e[t]=r.value)},o=void 0!==e&&e===this?this:void 0!==t&&null!=t?t:this;function a(){a=function(){},o.Symbol||(o.Symbol=l)}var s,l=(s=0,function(e){return"jscomp_symbol_"+(e||"")+s++});function u(){a();var e=o.Symbol.iterator;e||(e=o.Symbol.iterator=o.Symbol("iterator")),"function"!=typeof Array.prototype[e]&&i(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return c(this)}}),u=function(){}}function c(e){var t=0;return d((function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}))}function d(e){return u(),(e={next:e})[o.Symbol.iterator]=function(){return this},e}function f(e){u();var t=e[Symbol.iterator];return t?t.call(e):c(e)}function h(e,t){if(t){for(var r=o,n=e.split("."),a=0;a<n.length-1;a++){var s=n[a];s in r||(r[s]={}),r=r[s]}(s=t(a=r[n=n[n.length-1]]))!=a&&null!=s&&i(r,n,{configurable:!0,writable:!0,value:s})}}function p(e){return function(e){function t(t){return e.next(t)}function r(t){return e.throw(t)}return new Promise((function(n,i){!function e(o){o.done?n(o.value):Promise.resolve(o.value).then(t,r).then(e,i)}(e.next())}))}(e())}h("Promise",(function(e){function t(e){this.b=0,this.g=void 0,this.a=[];var t=this.c();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function r(){this.a=null}function n(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;r.prototype.b=function(e){null==this.a&&(this.a=[],this.f()),this.a.push(e)},r.prototype.f=function(){var e=this;this.c((function(){e.h()}))};var i=o.setTimeout;r.prototype.c=function(e){i(e,0)},r.prototype.h=function(){for(;this.a&&this.a.length;){var e=this.a;this.a=[];for(var t=0;t<e.length;++t){var r=e[t];e[t]=null;try{r()}catch(e){this.g(e)}}}this.a=null},r.prototype.g=function(e){this.c((function(){throw e}))},t.prototype.c=function(){function e(e){return function(n){r||(r=!0,e.call(t,n))}}var t=this,r=!1;return{resolve:e(this.s),reject:e(this.f)}},t.prototype.s=function(e){if(e===this)this.f(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.u(e);else{e:switch(typeof e){case"object":var r=null!=e;break e;case"function":r=!0;break e;default:r=!1}r?this.m(e):this.h(e)}},t.prototype.m=function(e){var t=void 0;try{t=e.then}catch(e){return void this.f(e)}"function"==typeof t?this.B(t,e):this.h(e)},t.prototype.f=function(e){this.i(2,e)},t.prototype.h=function(e){this.i(1,e)},t.prototype.i=function(e,t){if(0!=this.b)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.b);this.b=e,this.g=t,this.l()},t.prototype.l=function(){if(null!=this.a){for(var e=0;e<this.a.length;++e)a.b(this.a[e]);this.a=null}};var a=new r;return t.prototype.u=function(e){var t=this.c();e.cc(t.resolve,t.reject)},t.prototype.B=function(e,t){var r=this.c();try{e.call(t,r.resolve,r.reject)}catch(e){r.reject(e)}},t.prototype.then=function(e,r){function n(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.cc(n(e,i),n(r,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.cc=function(e,t){function r(){switch(n.b){case 1:e(n.g);break;case 2:t(n.g);break;default:throw Error("Unexpected state: "+n.b)}}var n=this;null==this.a?a.b(r):this.a.push(r)},t.resolve=n,t.reject=function(e){return new t((function(t,r){r(e)}))},t.race=function(e){return new t((function(t,r){for(var i=f(e),o=i.next();!o.done;o=i.next())n(o.value).cc(t,r)}))},t.all=function(e){var r=f(e),i=r.next();return i.done?n([]):new t((function(e,t){function o(t){return function(r){a[t]=r,0==--s&&e(a)}}var a=[],s=0;do{a.push(void 0),s++,n(i.value).cc(o(a.length-1),t),i=r.next()}while(!i.done)}))},t})),h("Promise.prototype.finally",(function(e){return e||function(e){return this.then((function(t){return Promise.resolve(e()).then((function(){return t}))}),(function(t){return Promise.resolve(e()).then((function(){throw t}))}))}}));var m,g="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)m=Object.setPrototypeOf;else{var y;e:{var v={};try{v.__proto__={Ae:!0},y=v.Ae;break e}catch(s){}y=!1}m=y?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var b=m;function _(e,t){if(e.prototype=g(t.prototype),e.prototype.constructor=e,b)b(e,t);else for(var r in t)if("prototype"!=r)if(Object.defineProperties){var n=Object.getOwnPropertyDescriptor(t,r);n&&Object.defineProperty(e,r,n)}else e[r]=t[r];e.tg=t.prototype}function A(){this.g=!1,this.c=null,this.o=void 0,this.j=1,this.b=this.f=0,this.i=this.a=null}function E(e){if(e.g)throw new TypeError("Generator is already running");e.g=!0}function T(e,t){e.a={Ld:t,Wd:!0},e.j=e.f||e.b}function S(e,t,r){return e.j=r,{value:t}}function w(e){e.j=0}function k(e,t,r){e.f=t,null!=r&&(e.b=r)}function x(e,t){e.f=0,e.b=t||0}function C(e,t){e.j=t,e.f=0}function R(e){e.f=0;var t=e.a.Ld;return e.a=null,t}function L(e){e.i=[e.a],e.f=0,e.b=0}function j(e,t){var r=e.i.splice(0)[0];(r=e.a=e.a||r)?r.Wd?e.j=e.f||e.b:null!=r.A&&e.b<r.A?(e.j=r.A,e.a=null):e.j=e.b:e.j=t}function P(e){this.a=new A,this.b=e}function I(e,t,r,n){try{var i=t.call(e.a.c,r);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.a.g=!1,i;var o=i.value}catch(t){return e.a.c=null,T(e.a,t),O(e)}return e.a.c=null,n.call(e.a,o),O(e)}function O(e){for(;e.a.j;)try{var t=e.b(e.a);if(t)return e.a.g=!1,{value:t.value,done:!1}}catch(t){e.a.o=void 0,T(e.a,t)}if(e.a.g=!1,e.a.a){if(t=e.a.a,e.a.a=null,t.Wd)throw t.Ld;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function D(e){this.next=function(t){return E(e.a),e.a.c?t=I(e,e.a.c.next,t,e.a.h):(e.a.h(t),t=O(e)),t},this.throw=function(t){return E(e.a),e.a.c?t=I(e,e.a.c.throw,t,e.a.h):(T(e.a,t),t=O(e)),t},this.return=function(t){return function(e,t){E(e.a);var r=e.a.c;return r?I(e,"return"in r?r.return:function(e){return{value:e,done:!0}},t,e.a.return):(e.a.return(t),O(e))}(e,t)},u(),this[Symbol.iterator]=function(){return this}}function M(e,t){return D.prototype=e.prototype,new D(new P(t))}function N(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function U(e,t,r){e instanceof String&&(e=String(e));for(var n=e.length,i=0;i<n;i++){var o=e[i];if(t.call(r,o,i,e))return{Td:i,ve:o}}return{Td:-1,ve:void 0}}function F(e,t,r){if(null==e)throw new TypeError("The 'this' value for String.prototype."+r+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+r+" must not be a regular expression");return e+""}A.prototype.h=function(e){this.o=e},A.prototype.return=function(e){this.a={return:e},this.j=this.b},A.prototype.A=function(e){this.j=e},h("WeakMap",(function(e){function t(e){if(this.a=(s+=Math.random()+1).toString(),e){a(),u(),e=f(e);for(var t;!(t=e.next()).done;)t=t.value,this.set(t[0],t[1])}}function r(e){N(e,o)||i(e,o,{value:{}})}function n(e){var t=Object[e];t&&(Object[e]=function(e){return r(e),t(e)})}if(function(){if(!e||!Object.seal)return!1;try{var t=Object.seal({}),r=Object.seal({}),n=new e([[t,2],[r,3]]);return 2==n.get(t)&&3==n.get(r)&&(n.delete(t),n.set(r,4),!n.has(t)&&4==n.get(r))}catch(e){return!1}}())return e;var o="$jscomp_hidden_"+Math.random();n("freeze"),n("preventExtensions"),n("seal");var s=0;return t.prototype.set=function(e,t){if(r(e),!N(e,o))throw Error("WeakMap key fail: "+e);return e[o][this.a]=t,this},t.prototype.get=function(e){return N(e,o)?e[o][this.a]:void 0},t.prototype.has=function(e){return N(e,o)&&N(e[o],this.a)},t.prototype.delete=function(e){return!(!N(e,o)||!N(e[o],this.a))&&delete e[o][this.a]},t})),h("Map",(function(e){function t(){var e={};return e.Fa=e.next=e.head=e}function r(e,t){var r=e.a;return d((function(){if(r){for(;r.head!=e.a;)r=r.Fa;for(;r.next!=r.head;)return r=r.next,{done:!1,value:t(r)};r=null}return{done:!0,value:void 0}}))}function n(e,t){var r=t&&typeof t;"object"==r||"function"==r?o.has(t)?r=o.get(t):(r=""+ ++s,o.set(t,r)):r="p_"+t;var n=e.b[r];if(n&&N(e.b,r))for(var i=0;i<n.length;i++){var a=n[i];if(t!=t&&a.key!=a.key||t===a.key)return{id:r,list:n,index:i,X:a}}return{id:r,list:n,index:-1,X:void 0}}function i(e){if(this.b={},this.a=t(),this.size=0,e){e=f(e);for(var r;!(r=e.next()).done;)r=r.value,this.set(r[0],r[1])}}if(function(){if(!e||"function"!=typeof e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var t=Object.seal({x:4}),r=new e(f([[t,"s"]]));if("s"!=r.get(t)||1!=r.size||r.get({x:4})||r.set({x:4},"t")!=r||2!=r.size)return!1;var n=r.entries(),i=n.next();return!i.done&&i.value[0]==t&&"s"==i.value[1]&&!((i=n.next()).done||4!=i.value[0].x||"t"!=i.value[1]||!n.next().done)}catch(e){return!1}}())return e;a(),u();var o=new WeakMap;i.prototype.set=function(e,t){var r=n(this,e);return r.list||(r.list=this.b[r.id]=[]),r.X?r.X.value=t:(r.X={next:this.a,Fa:this.a.Fa,head:this.a,key:e,value:t},r.list.push(r.X),this.a.Fa.next=r.X,this.a.Fa=r.X,this.size++),this},i.prototype.delete=function(e){return!(!(e=n(this,e)).X||!e.list||(e.list.splice(e.index,1),e.list.length||delete this.b[e.id],e.X.Fa.next=e.X.next,e.X.next.Fa=e.X.Fa,e.X.head=null,this.size--,0))},i.prototype.clear=function(){this.b={},this.a=this.a.Fa=t(),this.size=0},i.prototype.has=function(e){return!!n(this,e).X},i.prototype.get=function(e){return(e=n(this,e).X)&&e.value},i.prototype.entries=function(){return r(this,(function(e){return[e.key,e.value]}))},i.prototype.keys=function(){return r(this,(function(e){return e.key}))},i.prototype.values=function(){return r(this,(function(e){return e.value}))},i.prototype.forEach=function(e,t){for(var r,n=this.entries();!(r=n.next()).done;)r=r.value,e.call(t,r[1],r[0],this)},i.prototype[Symbol.iterator]=i.prototype.entries;var s=0;return i})),h("Set",(function(e){function t(e){if(this.a=new Map,e){e=f(e);for(var t;!(t=e.next()).done;)this.add(t.value)}this.size=this.a.size}return function(){if(!e||"function"!=typeof e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var t=Object.seal({x:4}),r=new e(f([t]));if(!r.has(t)||1!=r.size||r.add(t)!=r||1!=r.size||r.add({x:4})!=r||2!=r.size)return!1;var n=r.entries(),i=n.next();return!i.done&&i.value[0]==t&&i.value[1]==t&&!(i=n.next()).done&&i.value[0]!=t&&4==i.value[0].x&&i.value[1]==i.value[0]&&n.next().done}catch(e){return!1}}()?e:(a(),u(),t.prototype.add=function(e){return this.a.set(e,e),this.size=this.a.size,this},t.prototype.delete=function(e){return e=this.a.delete(e),this.size=this.a.size,e},t.prototype.clear=function(){this.a.clear(),this.size=0},t.prototype.has=function(e){return this.a.has(e)},t.prototype.entries=function(){return this.a.entries()},t.prototype.values=function(){return this.a.values()},t.prototype.keys=t.prototype.values,t.prototype[Symbol.iterator]=t.prototype.values,t.prototype.forEach=function(e,t){var r=this;this.a.forEach((function(n){return e.call(t,n,n,r)}))},t)})),h("Array.prototype.findIndex",(function(e){return e||function(e,t){return U(this,e,t).Td}})),h("Array.prototype.keys",(function(e){return e||function(){return function(e,t){u(),e instanceof String&&(e+="");var r=0,n={next:function(){if(r<e.length){var i=r++;return{value:t(i,e[i]),done:!1}}return n.next=function(){return{done:!0,value:void 0}},n.next()}};return n[Symbol.iterator]=function(){return n},n}(this,(function(e){return e}))}})),h("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),h("Array.prototype.includes",(function(e){return e||function(e,t){var r=this;r instanceof String&&(r=String(r));var n=r.length,i=t||0;for(0>i&&(i=Math.max(i+n,0));i<n;i++){var o=r[i];if(o===e||Object.is(o,e))return!0}return!1}})),h("String.prototype.includes",(function(e){return e||function(e,t){return-1!==F(this,e,"includes").indexOf(e,t||0)}})),h("Array.from",(function(e){return e||function(e,t,r){u(),t=null!=t?t:function(e){return e};var n=[],i=e[Symbol.iterator];if("function"==typeof i)for(e=i.call(e);!(i=e.next()).done;)n.push(t.call(r,i.value));else{i=e.length;for(var o=0;o<i;o++)n.push(t.call(r,e[o]))}return n}})),h("String.prototype.startsWith",(function(e){return e||function(e,t){for(var r=F(this,e,"startsWith"),n=r.length,i=e.length,o=Math.max(0,Math.min(0|t,r.length)),a=0;a<i&&o<n;)if(r[o++]!=e[a++])return!1;return a>=i}})),h("Array.prototype.find",(function(e){return e||function(e,t){return U(this,e,t).ve}}));var B="function"==typeof Object.assign?Object.assign:function(e,t){for(var r=1;r<arguments.length;r++){var n=arguments[r];if(n)for(var i in n)N(n,i)&&(e[i]=n[i])}return e};h("Object.assign",(function(e){return e||B}));var K=this;function G(e,t){var r,n=e.split("."),i=K;n[0]in i||!i.execScript||i.execScript("var "+n[0]);for(;n.length&&(r=n.shift());)n.length||void 0===t?i=i[r]?i[r]:i[r]={}:i[r]=t}function V(e,t){function r(){}r.prototype=t.prototype,e.tg=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.Eg=function(e,r,n){return t.prototype[r].apply(e,Array.prototype.slice.call(arguments,2))}}function H(e){this.c=Math.exp(Math.log(.5)/e),this.b=this.a=0}function Y(e,t,r){var n=Math.pow(e.c,t);r=r*(1-n)+n*e.a,isNaN(r)||(e.a=r,e.b+=t)}function z(e){return e.a/(1-Math.pow(e.c,e.b))}function W(){this.b=new H(2),this.c=new H(5),this.a=0}function $(){}function q(){}function X(){}K.a=!0,W.prototype.getBandwidthEstimate=function(e){return 128e3>this.a?e:Math.min(z(this.b),z(this.c))},e.console&&e.console.log.bind&&(q=console.warn.bind(console),$=console.error.bind(console));var J=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;function Z(e){var t;e instanceof Z?(Q(this,e.ta),this.bb=e.bb,this.sa=e.sa,ee(this,e.Ab),this.ja=e.ja,te(this,e.a.clone()),this.Sa=e.Sa):e&&(t=String(e).match(J))?(Q(this,t[1]||"",!0),this.bb=re(t[2]||""),this.sa=re(t[3]||"",!0),ee(this,t[4]),this.ja=re(t[5]||"",!0),te(this,t[6]||"",!0),this.Sa=re(t[7]||"")):this.a=new ce(null)}function Q(e,t,r){e.ta=r?re(t,!0):t,e.ta&&(e.ta=e.ta.replace(/:$/,""))}function ee(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.Ab=t}else e.Ab=null}function te(e,t,r){t instanceof ce?e.a=t:(r||(t=ne(t,le)),e.a=new ce(t))}function re(e,t){return e?t?decodeURI(e):decodeURIComponent(e):""}function ne(e,t,r){return"string"==typeof e?(e=encodeURI(e).replace(t,ie),r&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function ie(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}(n=Z.prototype).ta="",n.bb="",n.sa="",n.Ab=null,n.ja="",n.Sa="",n.toString=function(){var e=[],t=this.ta;if(t&&e.push(ne(t,oe,!0),":"),t=this.sa){e.push("//");var r=this.bb;r&&e.push(ne(r,oe,!0),"@"),e.push(encodeURIComponent(t).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(t=this.Ab)&&e.push(":",String(t))}return(t=this.ja)&&(this.sa&&"/"!=t.charAt(0)&&e.push("/"),e.push(ne(t,"/"==t.charAt(0)?se:ae,!0))),(t=this.a.toString())&&e.push("?",t),(t=this.Sa)&&e.push("#",ne(t,ue)),e.join("")},n.resolve=function(e){var t=this.clone();"data"===t.ta&&(t=new Z);var r=!!e.ta;r?Q(t,e.ta):r=!!e.bb,r?t.bb=e.bb:r=!!e.sa,r?t.sa=e.sa:r=null!=e.Ab;var n=e.ja;if(r)ee(t,e.Ab);else if(r=!!e.ja){if("/"!=n.charAt(0))if(this.sa&&!this.ja)n="/"+n;else{var i=t.ja.lastIndexOf("/");-1!=i&&(n=t.ja.substr(0,i+1)+n)}if(".."==n||"."==n)n="";else if(-1!=n.indexOf("./")||-1!=n.indexOf("/.")){i=0==n.lastIndexOf("/",0),n=n.split("/");for(var o=[],a=0;a<n.length;){var s=n[a++];"."==s?i&&a==n.length&&o.push(""):".."==s?((1<o.length||1==o.length&&""!=o[0])&&o.pop(),i&&a==n.length&&o.push("")):(o.push(s),i=!0)}n=o.join("/")}}return r?t.ja=n:r=""!==e.a.toString(),r?te(t,e.a.clone()):r=!!e.Sa,r&&(t.Sa=e.Sa),t},n.clone=function(){return new Z(this)};var oe=/[#\/\?@]/g,ae=/[#\?:]/g,se=/[#\?]/g,le=/[#\?@]/g,ue=/#/g;function ce(e){this.a=e||null}function de(e){this.b=e,this.a=null}function fe(e){this.b=e,this.a=null}function he(e,t){var r={maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0};this.i=null==e.maxAttempts?r.maxAttempts:e.maxAttempts,this.f=null==e.baseDelay?r.baseDelay:e.baseDelay,this.h=null==e.fuzzFactor?r.fuzzFactor:e.fuzzFactor,this.g=null==e.backoffFactor?r.backoffFactor:e.backoffFactor,this.a=0,this.b=this.f,(this.c=void 0!==t&&t)&&(this.a=1)}function pe(e){return p((function t(){var r,n;return M(t,(function(t){switch(t.j){case 1:if(e.a>=e.i){if(!e.c)return t.return(Promise.reject());e.a=1,e.b=e.f}return r=e.a,e.a++,0==r?t.return():(n=e.b*(1+(2*Math.random()-1)*e.h),S(t,new Promise((function(e){new fe(e).R(n/1e3)})),2));case 2:e.b*=e.g,w(t)}}))}))}function me(e,t,r,n){for(var i=[],o=3;o<arguments.length;++o)i[o-3]=arguments[o];this.severity=e,this.category=t,this.code=r,this.data=i,this.handled=!1}function ge(){var e,t,r=new Promise((function(r,n){e=r,t=n}));return r.resolve=e,r.reject=t,r}function ye(e,t){this.promise=e,this.Zd=t,this.a=!1}function ve(e){return new ye(Promise.reject(e),(function(){return Promise.resolve()}))}function be(){var e=Promise.reject(new me(2,7,7001));return e.catch((function(){})),new ye(e,(function(){return Promise.resolve()}))}function _e(e){return new ye(Promise.resolve(e),(function(){return Promise.resolve()}))}function Ae(e){return new ye(e,(function(){return e.catch((function(){}))}))}function Ee(e){return new ye(Promise.all(e.map((function(e){return e.promise}))),(function(){return Promise.all(e.map((function(e){return e.abort()})))}))}function Te(e,t,r){try{var n=e(t);return n&&n.promise&&n.abort?(r.resolve(n.promise),function(){return n.abort()}):(r.resolve(n),function(){return Promise.resolve(n).then((function(){})).catch((function(){}))})}catch(e){return r.reject(e),function(){return Promise.resolve()}}}function Se(t,r){for(var n in r=void 0===r?{}:r)this[n]=r[n];this.defaultPrevented=this.cancelable=this.bubbles=!1,this.timeStamp=e.performance&&e.performance.now?e.performance.now():Date.now(),this.type=t,this.isTrusted=!1,this.target=this.currentTarget=null,this.a=!1}function we(){this.a={}}function ke(){this.Jc=new we,this.$b=this}function xe(e){var t=new Set;return function e(r){switch(typeof r){case"undefined":case"boolean":case"number":case"string":case"symbol":case"function":return r;default:if(!r||r.buffer&&r.buffer.constructor==ArrayBuffer)return r;if(t.has(r))return null;var n=r.constructor==Array;if(r.constructor!=Object&&!n)return null;t.add(r);var i,o=n?[]:{};for(i in r)o[i]=e(r[i]);return n&&(o.length=r.length),o}}(e)}function Ce(e,t){return!("number"!=typeof e||"number"!=typeof t||!isNaN(e)||!isNaN(t))||e===t}function Re(e,t){var r=e.indexOf(t);-1<r&&e.splice(r,1)}function Le(e,t,r){if(r||(r=Ce),e.length!=t.length)return!1;t=t.slice();for(var n={},i=(e=f(e)).next();!i.done;n={item:n.item},i=e.next()){if(n.item=i.value,-1==(i=t.findIndex(function(e){return function(t){return r(e.item,t)}}(n))))return!1;t[i]=t[t.length-1],t.pop()}return 0==t.length}function je(){this.a=[]}function Pe(e,t){e.a.push(t.finally((function(){Re(e.a,t)})))}function Ie(e){ke.call(this),this.f=!1,this.g=new je,this.a=new Set,this.b=new Set,this.c=e||null}(n=ce.prototype).ha=null,n.fc=null,n.add=function(e,t){if(!this.ha&&(this.ha={},this.fc=0,this.a))for(var r=this.a.split("&"),n=0;n<r.length;n++){var i=r[n].indexOf("="),o=null;if(0<=i){var a=r[n].substring(0,i);o=r[n].substring(i+1)}else a=r[n];a=decodeURIComponent(a.replace(/\+/g," ")),o=o||"",this.add(a,decodeURIComponent(o.replace(/\+/g," ")))}return this.a=null,(r=this.ha.hasOwnProperty(e)&&this.ha[e])||(this.ha[e]=r=[]),r.push(t),this.fc++,this},n.toString=function(){if(this.a)return this.a;if(!this.ha)return"";var e,t=[];for(e in this.ha)for(var r=encodeURIComponent(e),n=this.ha[e],i=0;i<n.length;i++){var o=r;""!==n[i]&&(o+="="+encodeURIComponent(n[i])),t.push(o)}return this.a=t.join("&")},n.clone=function(){var e=new ce;if(e.a=this.a,this.ha){var t,r={};for(t in this.ha)r[t]=this.ha[t].concat();e.ha=r,e.fc=this.fc}return e},de.prototype.R=function(t){var r=this;this.stop();var n=!0,i=null;return this.a=function(){e.clearTimeout(i),n=!1},i=e.setTimeout((function(){n&&r.b()}),1e3*t),this},de.prototype.stop=function(){this.a&&(this.a(),this.a=null)},G("shaka.util.Timer",fe),fe.prototype.yc=function(){return this.stop(),this.b(),this},fe.prototype.tickNow=fe.prototype.yc,fe.prototype.R=function(e){var t=this;return this.stop(),this.a=new de((function(){t.b()})).R(e),this},fe.prototype.tickAfter=fe.prototype.R,fe.prototype.Na=function(e){var t=this;return this.stop(),this.a=new de((function(){t.a.R(e),t.b()})).R(e),this},fe.prototype.tickEvery=fe.prototype.Na,fe.prototype.stop=function(){this.a&&(this.a.stop(),this.a=null)},fe.prototype.stop=fe.prototype.stop,G("shaka.util.Error",me),me.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},me.Severity={RECOVERABLE:1,CRITICAL:2},me.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9},me.Code={UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,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,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,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,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,INVALID_STREAMS_CHOSEN:5005,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,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,STORE_ALREADY_IN_PROGRESS:9006,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},ge.prototype.resolve=function(){},ge.prototype.reject=function(){},G("shaka.util.AbortableOperation",ye),ye.failed=ve,ye.aborted=be,ye.completed=_e,ye.notAbortable=Ae,ye.prototype.abort=function(){return this.a=!0,this.Zd()},ye.prototype.abort=ye.prototype.abort,ye.all=Ee,ye.prototype.finally=function(e){return this.promise.then((function(){return e(!0)}),(function(){return e(!1)})),this},ye.prototype.finally=ye.prototype.finally,ye.prototype.U=function(e,t){function r(){return i.reject(new me(2,7,7001)),n.abort()}var n=this,i=new ge;return this.promise.then((function(t){n.a?i.reject(new me(2,7,7001)):e?r=Te(e,t,i):i.resolve(t)}),(function(e){t?r=Te(t,e,i):i.reject(e)})),new ye(i,(function(){return r()}))},ye.prototype.chain=ye.prototype.U,Se.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},Se.prototype.stopImmediatePropagation=function(){this.a=!0},Se.prototype.stopPropagation=function(){},(n=we.prototype).push=function(e,t){this.a.hasOwnProperty(e)?this.a[e].push(t):this.a[e]=[t]},n.get=function(e){return(e=this.a[e])?e.slice():null},n.getAll=function(){var e,t=[];for(e in this.a)t.push.apply(t,this.a[e]);return t},n.remove=function(e,t){var r=this.a[e];if(r)for(var n=0;n<r.length;++n)r[n]==t&&(r.splice(n,1),--n)},n.forEach=function(e){for(var t in this.a)e(t,this.a[t])},ke.prototype.addEventListener=function(e,t){this.Jc.push(e,t)},ke.prototype.removeEventListener=function(e,t){this.Jc.remove(e,t)},ke.prototype.dispatchEvent=function(e){for(var t=this.Jc.get(e.type)||[],r=0;r<t.length;++r){e.target=this.$b,e.currentTarget=this.$b;var n=t[r];try{n.handleEvent?n.handleEvent(e):n.call(this,e)}catch(e){}if(e.a)break}return e.defaultPrevented},je.prototype.destroy=function(){var e=[];return this.a.forEach((function(t){t.promise.catch((function(){})),e.push(t.abort())})),this.a=[],Promise.all(e)},V(Ie,ke),G("shaka.net.NetworkingEngine",Ie),Ie.RequestType={MANIFEST:0,SEGMENT:1,LICENSE:2,APP:3,TIMING:4},Ie.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:3};var Oe={};function De(e,t,r){r=r||3;var n=Oe[e];(!n||r>=n.priority)&&(Oe[e]={priority:r,Rf:t})}function Me(e,t){return{uris:e,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:t,licenseRequestType:null,sessionId:null}}function Ne(){this.a=0}function Ue(e,t,r){ye.call(this,e,t),this.b=r}function Fe(){}function Be(){this.a=new we}function Ke(e,t,r,n){this.target=e,this.type=t,this.listener=r,this.a=function(e,t){if(null==t)return!1;if("boolean"==typeof t)return t;var r=new Set(["passive","capture"]);return Object.keys(t).filter((function(e){return!r.has(e)})),function(e){var t=Ge;if(null==t){t=!1;try{var r={},n={get:function(){return t=!0,!1}};Object.defineProperty(r,"passive",n),Object.defineProperty(r,"capture",n),n=function(){},e.addEventListener("test",n,r),e.removeEventListener("test",n,r)}catch(e){t=!1}Ge=t}return t||!1}(e)?t:t.capture||!1}(e,n),this.target.addEventListener(t,r,this.a)}Ie.registerScheme=De,Ie.unregisterScheme=function(e){delete Oe[e]},Ie.prototype.Tf=function(e){this.a.add(e)},Ie.prototype.registerRequestFilter=Ie.prototype.Tf,Ie.prototype.vg=function(e){this.a.delete(e)},Ie.prototype.unregisterRequestFilter=Ie.prototype.vg,Ie.prototype.Ie=function(){this.a.clear()},Ie.prototype.clearAllRequestFilters=Ie.prototype.Ie,Ie.prototype.Uf=function(e){this.b.add(e)},Ie.prototype.registerResponseFilter=Ie.prototype.Uf,Ie.prototype.wg=function(e){this.b.delete(e)},Ie.prototype.unregisterResponseFilter=Ie.prototype.wg,Ie.prototype.Je=function(){this.b.clear()},Ie.prototype.clearAllResponseFilters=Ie.prototype.Je,Ie.defaultRetryParameters=function(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0}},Ie.makeRequest=Me,Ie.prototype.destroy=function(){return this.f=!0,this.a.clear(),this.b.clear(),this.g.destroy()},Ie.prototype.destroy=Ie.prototype.destroy,Ie.prototype.request=function(e,t){var r=this,n=new Ne;if(this.f){var i=Promise.reject(new me(2,7,7001));return i.catch((function(){})),new Ue(i,(function(){return Promise.resolve()}),n)}t.method=t.method||"GET",t.headers=t.headers||{},t.retryParameters=t.retryParameters?xe(t.retryParameters):{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0},t.uris=xe(t.uris);var o=(i=function(e,t,r){for(var n=_e(void 0),i={},o=(e=f(e.a)).next();!o.done;i={qd:i.qd},o=e.next())i.qd=o.value,n=n.U(function(e){return function(){return e.qd(t,r)}}(i));return n.U(void 0,(function(e){if(e&&7001==e.code)throw e;throw new me(2,1,1006,e)}))}(this,e,t)).U((function(){return function e(t,r,n,i,o,a,s){var l=new Z(n.uris[o]),u=l.ta,c=!1;u||(u=(u=location.protocol).slice(0,-1),Q(l,u),n.uris[o]=l.toString()),u=u.toLowerCase();var d,f=(u=Oe[u])?u.Rf:null;return f?Ae(pe(i)).U((function(){return t.f?be():(d=Date.now(),f(n.uris[o],n,r,(function(e,n,i){t.c&&1==r&&(t.c(e,n),c=!0,s.a=i)})))})).U((function(e){return null==e.timeMs&&(e.timeMs=Date.now()-d),{response:e,qf:c}}),(function(l){if(l&&7001==l.code)throw l;if(t.f)return be();if(l&&1==l.severity)return t.dispatchEvent(new Se("retry",{error:l instanceof me?l:null})),o=(o+1)%n.uris.length,e(t,r,n,i,o,l,s);throw l||a})):ve(new me(2,1,1e3,l))}(r,e,t,new he(t.retryParameters,!1),0,null,n)})),a=o.U((function(t){return function(e,t,r){for(var n=_e(void 0),i=(e=f(e.b)).next();!i.done;i=e.next())n=n.U(i.value.bind(null,t,r.response));return n.U((function(){return r}),(function(e){if(e&&7001==e.code)throw e;var t=2;throw e instanceof me&&(t=e.severity),new me(t,1,1007,e)}))}(r,e,t)})),s=Date.now(),l=0;i.promise.then((function(){l=Date.now()-s}),(function(){}));var u=0;return o.promise.then((function(){u=Date.now()}),(function(){})),i=new Ue((i=a.U((function(t){var n=Date.now()-u,i=t.response;return i.timeMs+=l,i.timeMs+=n,t.qf||!r.c||i.fromCache||1!=e||r.c(i.timeMs,i.data.byteLength),i}),(function(e){throw e&&(e.severity=2),e}))).promise,i.Zd,n),Pe(this.g,i),i},Ie.prototype.request=Ie.prototype.request,Ie.NumBytesRemainingClass=Ne,_(Ue,ye),Ie.PendingRequest=Ue,Ue.all=Ee,Ue.notAbortable=Ae,Ue.completed=_e,Ue.aborted=be,Ue.failed=ve,G("shaka.util.IReleasable",Fe),Fe.prototype.release=function(){},G("shaka.util.EventManager",Be),Be.prototype.release=function(){this.$a(),this.a=null},Be.prototype.release=Be.prototype.release,Be.prototype.w=function(e,t,r,n){this.a&&(e=new Ke(e,t,r,n),this.a.push(t,e))},Be.prototype.listen=Be.prototype.w,Be.prototype.da=function(e,t,r,n){var i=this;this.w(e,t,(function n(o){i.ea(e,t,n),r(o)}),n)},Be.prototype.listenOnce=Be.prototype.da,Be.prototype.ea=function(e,t,r){if(this.a)for(var n=this.a.get(t)||[],i=(n=f(n)).next();!i.done;i=n.next())(i=i.value).target!=e||r!=i.listener&&r||(i.ea(),this.a.remove(t,i))},Be.prototype.unlisten=Be.prototype.ea,Be.prototype.$a=function(){if(this.a){for(var e=this.a.getAll(),t=(e=f(e)).next();!t.done;t=e.next())t.value.ea();this.a.a={}}},Be.prototype.removeAll=Be.prototype.$a,Ke.prototype.ea=function(){this.target.removeEventListener(this.type,this.listener,this.a),this.listener=this.target=null,this.a=!1},Ke.prototype.unlisten=Ke.prototype.ea;var Ge=void 0;function Ve(e){if(e=new Uint8Array(e),new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(0,!0)+4!=e.byteLength)throw new RangeError("Malformed FairPlay init data");return new Z(e=st(e.subarray(4),!0)).sa}function He(e,t,r){function n(e){new DataView(o.buffer).setUint32(a,e.byteLength,!0),a+=4,i(e)}function i(e){o.set(e,a),a+=e.byteLength}if(!r||!r.byteLength)throw new me(2,6,6015);t="string"==typeof t?new Uint8Array(ct(t,!0)):new Uint8Array(t);var o=new Uint8Array(8+e.byteLength+t.byteLength+r.byteLength),a=0;return i(new Uint8Array(e)),n(t),n(new Uint8Array(r)),o}function Ye(e,t){for(var r=[],n=f(e),i=n.next();!i.done;i=n.next())r.push(t(i.value));return r}function ze(e,t){for(var r=f(e),n=r.next();!n.done;n=r.next())if(!t(n.value))return!1;return!0}function We(e){var t=new Map;return Object.keys(e).forEach((function(r){t.set(r,e[r])})),t}function $e(e){var t={};return e.forEach((function(e,r){t[r]=e})),t}function qe(e,t){var r=e;return t&&(r+='; codecs="'+t+'"'),r}function Xe(e){var t=(e=e.split("."))[0];return e.pop(),[t,e.join(".")]}G("shaka.util.FairPlayUtils.defaultGetContentId",Ve),G("shaka.util.FairPlayUtils.initDataTransform",He);var Je=(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");function Ze(){return!(!e.MediaSource||!MediaSource.isTypeSupported)}function Qe(e){return""!=nt().canPlayType(e)}function et(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!rt("Tizen")}function tt(){if(!et())return null;var e=navigator.userAgent.match(/Version\/(\d+)/);return e||(e=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(e[1],10):null}function rt(e){return(navigator.userAgent||"").includes(e)}function nt(){return ot||(it||(it=new fe((function(){ot=null}))),(ot=document.querySelector("video")||document.querySelector("audio"))||(ot=document.createElement("video")),it.R(1),ot)}var it=null,ot=null;function at(e){if(!e)return"";239==(e=new Uint8Array(e))[0]&&187==e[1]&&191==e[2]&&(e=e.subarray(3)),e=dt(e),e=escape(e);try{return decodeURIComponent(e)}catch(e){throw new me(2,2,2004)}}function st(e,t,r){if(!e)return"";if(!r&&0!=e.byteLength%2)throw new me(2,2,2004);if(e instanceof ArrayBuffer)var n=e;else(r=new Uint8Array(e.byteLength)).set(new Uint8Array(e)),n=r.buffer;e=Math.floor(e.byteLength/2),r=new Uint16Array(e),n=new DataView(n);for(var i=0;i<e;i++)r[i]=n.getUint16(2*i,t);return dt(r)}function lt(e){var t=new Uint8Array(e);if(239==t[0]&&187==t[1]&&191==t[2])return at(t);if(254==t[0]&&255==t[1])return st(t.subarray(2),!1);if(255==t[0]&&254==t[1])return st(t.subarray(2),!0);var r=function(e,t){return e.byteLength<=t||32<=e[t]&&126>=e[t]}.bind(null,t);if(0==t[0]&&0==t[2])return st(e,!1);if(0==t[1]&&0==t[3])return st(e,!0);if(r(0)&&r(1)&&r(2)&&r(3))return at(e);throw new me(2,2,2003)}function ut(e){e=encodeURIComponent(e),e=unescape(e);for(var t=new Uint8Array(e.length),r=0;r<e.length;++r)t[r]=e.charCodeAt(r);return t.buffer}function ct(e,t){for(var r=new Uint8Array(2*e.length),n=new DataView(r.buffer),i=0;i<e.length;++i)n.setUint16(2*i,e.charCodeAt(i),t);return r.buffer}function dt(e){if(!ft)for(var t=function(e){try{var t=new Uint8Array(e);return 0<String.fromCharCode.apply(null,t).length}catch(e){return!1}},r={size:65536};0<r.size;(r={size:r.size}).size/=2)if(t(r.size)){ft=function(e){return function(t){for(var r="",n=0;n<t.length;n+=e.size)r+=String.fromCharCode.apply(null,t.subarray(n,n+e.size));return r}}(r);break}return ft(e)}G("shaka.util.StringUtils.fromUTF8",at),G("shaka.util.StringUtils.fromUTF16",st),G("shaka.util.StringUtils.fromBytesAutoDetect",lt),G("shaka.util.StringUtils.toUTF8",ut),G("shaka.util.StringUtils.toUTF16",ct);var ft=null;G("shaka.util.StringUtils.resetFromCharCode",(function(){ft=null}));var ht={zc:function(t,r){var n=dt(t);return r=null==r||r,n=e.btoa(n).replace(/\+/g,"-").replace(/\//g,"_"),r?n:n.replace(/=*$/,"")}};function pt(e){var t=this;this.B=e,this.u=new Set,this.h=this.l=null,this.S=!1,this.K=0,this.a=null,this.i=new Be,this.b=new Map,this.s=[],this.m=new ge,this.f=null,this.g=function(r){t.m.reject(r),e.onError(r)},this.pa=new Map,this.W=new Map,this.O=new fe((function(){return function(e){var t=e.pa,r=e.W;r.clear(),t.forEach((function(e,t){return r.set(t,e)})),(t=Array.from(r.values())).length&&t.every((function(e){return"expired"==e}))&&e.g(new me(2,6,6014)),e.B.qc($e(r))}(t)})),this.c=!1,this.na=new ge,this.D=!1,this.F=[],this.oa=!1,this.$=new fe((function(){!function(e){e.b.forEach((function(t,r){var n=t.hd,i=r.expiration;isNaN(i)&&(i=1/0),i!=n&&(e.B.onExpirationUpdated(r.sessionId,i),t.hd=i)}))}(t)})).Na(1),this.m.catch((function(){}))}function mt(e,t,r){return e.s=r,e.D=0<r.length,gt(e,t)}function gt(t,r){var n=function(t){if(0==(t=We(t.f.clearKeys)).size)return null;var r=[],n=[];t.forEach((function(e,t){var i=ht.Qc(t),o=ht.Qc(e);i={kty:"oct",kid:ht.zc(i,!1),k:ht.zc(o,!1)},r.push(i),n.push(i.kid)})),t=JSON.stringify({keys:r});var i=JSON.stringify({kids:n});return i=[{initData:new Uint8Array(ut(i)),initDataType:"keyids"}],{keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64,"+e.btoa(t),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:i,keyIds:[]}}(t);if(n)for(var i=f(r),o=i.next();!o.done;o=i.next())o.value.drmInfos=[n];for((n=r.some((function(e){return 0<e.drmInfos.length})))||function(e,t){var r=[];t.forEach((function(e,t){r.push({keySystem:t,licenseServerUri:e,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[]})}));for(var n=f(e),i=n.next();!i.done;i=n.next())i.value.drmInfos=r}(r,o=We(t.f.servers)),o=(i=f(r)).next();!o.done;o=i.next())for(var a=(o=f(o.value.drmInfos)).next();!a.done;a=o.next())It(a.value,We(t.f.servers),We(t.f.advanced||{}));return(o=function(e,t){for(var r=new Set,n=f(t),i=n.next();!i.done;i=n.next()){var o=f(i.value.drmInfos);for(i=o.next();!i.done;i=o.next())r.add(i.value)}for(n=f(r),i=n.next();!i.done;i=n.next())It(i.value,We(e.f.servers),We(e.f.advanced||{}));o=e.D?"required":"optional";var a=e.D?["persistent-license"]:["temporary"];for(n=new Map,r=f(r),i=r.next();!i.done;i=r.next())i=i.value,n.set(i.keySystem,{audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:o,sessionTypes:a,label:i.keySystem,drmInfos:[]});for(r=f(t),i=r.next();!i.done;i=r.next()){i=i.value,o=i.audio,a=i.video;var s=o?qe(o.mimeType,o.codecs):"",l=a?qe(a.mimeType,a.codecs):"",u=f(i.drmInfos);for(i=u.next();!i.done;i=u.next()){i=i.value;var c=n.get(i.keySystem);c.drmInfos.push(i),i.distinctiveIdentifierRequired&&(c.distinctiveIdentifier="required"),i.persistentStateRequired&&(c.persistentState="required"),o&&c.audioCapabilities.push({robustness:i.audioRobustness||"",contentType:s}),a&&c.videoCapabilities.push({robustness:i.videoRobustness||"",contentType:l})}}return n}(t,r)).size?(o=Tt(t,o),n?o:o.catch((function(){}))):(t.S=!0,Promise.resolve())}function yt(e){return p((function t(){var r;return M(t,(function(t){switch(t.j){case 1:if(!(e.l&&e.a&&e.a.serverCertificate&&e.a.serverCertificate.length)){t.A(0);break}return k(t,3),S(t,e.l.setServerCertificate(e.a.serverCertificate),5);case 5:C(t,0);break;case 3:return r=R(t),t.return(Promise.reject(new me(2,6,6004,r.message)))}}))}))}function vt(e){var t=e.a?e.a.initData:[];return t.forEach((function(t){return wt(e,t.initDataType,t.initData)})),e.s.forEach((function(t){return St(e,t)})),t.length||e.s.length||e.m.resolve(),e.m}function bt(e,t,r){for(var n=e.b.values(),i=(n=f(n)).next();!i.done;i=n.next())if(ht.za(r,i.value.initData)&&!rt("Tizen 2"))return;wt(e,t,r)}function _t(e){return e?e.keySystem:""}function At(e,t){return!!rt("Edge/")||e.u.has(t)}function Et(e){return e=Ye(e=e.b.keys(),(function(e){return e.sessionId})),Array.from(e)}function Tt(e,t){if(1==t.size&&t.has(""))return Promise.reject(new me(2,6,6e3));for(var r=f(t.values()),n=r.next();!n.done;n=r.next())0==(n=n.value).audioCapabilities.length&&delete n.audioCapabilities,0==n.videoCapabilities.length&&delete n.videoCapabilities;var i=r=new ge;return[!0,!1].forEach(function(e){var r=this;t.forEach((function(t,n){t.drmInfos.some((function(e){return!!e.licenseServerUri}))==e&&(i=i.catch(function(){if(!this.c)return navigator.requestMediaKeySystemAccess(n,[t])}.bind(r)))}))}.bind(e)),i=(i=i.catch((function(){return Promise.reject(new me(2,6,6001))}))).then(function(e){if(this.c)return Promise.reject();this.u.clear();var r=e.getConfiguration(),n=r.videoCapabilities||[],i=f(r.audioCapabilities||[]);for(r=i.next();!r.done;r=i.next())this.u.add(r.value.contentType);for(r=(n=f(n)).next();!r.done;r=n.next())this.u.add(r.value.contentType);n=e.keySystem,i=[];var o=[],a=[],s=[];return function(e,t,r,n,i){e.forEach((function(e){if(t.includes(e.licenseServerUri)||t.push(e.licenseServerUri),e.serverCertificate&&(r.some((function(t){return ht.za(t,e.serverCertificate)}))||r.push(e.serverCertificate)),e.initData&&e.initData.forEach((function(e){n.some((function(t){return!(!t.keyId||t.keyId!=e.keyId)||t.initDataType==e.initDataType&&ht.za(t.initData,e.initData)}))||n.push(e)})),e.keyIds)for(var o=0;o<e.keyIds.length;++o)i.includes(e.keyIds[o])||i.push(e.keyIds[o])}))}((r=t.get(e.keySystem)).drmInfos,i,o,a,s),this.a={keySystem:n,licenseServerUri:i[0],distinctiveIdentifierRequired:"required"==r.distinctiveIdentifier,persistentStateRequired:"required"==r.persistentState,audioRobustness:(r.audioCapabilities?r.audioCapabilities[0].robustness:"")||"",videoRobustness:(r.videoCapabilities?r.videoCapabilities[0].robustness:"")||"",serverCertificate:o[0],initData:a,keyIds:s},this.a.licenseServerUri?e.createMediaKeys():Promise.reject(new me(2,6,6012,this.a.keySystem))}.bind(e)).then(function(e){if(this.c)return Promise.reject();this.l=e,this.S=!0}.bind(e)).catch(function(e){if(!this.c)return this.a=null,this.u.clear(),e instanceof me?Promise.reject(e):Promise.reject(new me(2,6,6002,e.message))}.bind(e)),r.reject(),i}function St(e,t){try{var r=e.l.createSession("persistent-license")}catch(t){var n=new me(2,6,6005,t.message);return e.g(n),Promise.reject(n)}e.i.w(r,"message",e.fe.bind(e)),e.i.w(r,"keystatuseschange",e.de.bind(e));var i={initData:null,loaded:!1,hd:1/0,ya:null};return e.b.set(r,i),r.load(t).then(function(e){return this.c?Promise.reject():e?(i.loaded=!0,Pt(this)&&this.m.resolve(),r):(this.b.delete(r),void this.g(new me(2,6,6013)))}.bind(e),function(e){this.c||(this.b.delete(r),this.g(new me(2,6,6005,e.message)))}.bind(e))}function wt(e,t,r){try{var n=e.D?e.l.createSession("persistent-license"):e.l.createSession()}catch(t){return void e.g(new me(2,6,6005,t.message))}e.i.w(n,"message",e.fe.bind(e)),e.i.w(n,"keystatuseschange",e.de.bind(e)),e.b.set(n,{initData:r,loaded:!1,hd:1/0,ya:null});try{r=e.f.initDataTransform(r,e.a)}catch(r){return t=r,r instanceof me||(t=new me(2,6,6016,r)),void e.g(t)}n.generateRequest(t,r.buffer).catch((function(t){if(!e.c){if(e.b.delete(n),t.errorCode&&t.errorCode.systemCode){var r=t.errorCode.systemCode;0>r&&(r+=Math.pow(2,32)),r="0x"+r.toString(16)}e.g(new me(2,6,6006,t.message,t,r))}}))}function kt(e,t){if(_t(t).startsWith("com.apple.fps")){var r=t.serverCertificate;e=He(e,Ve(e),r)}return e}function xt(e,t){var r=t.target,n=e.b.get(r),i=e.a.licenseServerUri,o=e.f.advanced[e.a.keySystem];"individualization-request"==t.messageType&&o&&o.individualizationServer&&(i=o.individualizationServer),(i=Me([i],e.f.retryParameters)).body=t.message,i.method="POST",i.licenseRequestType=t.messageType,i.sessionId=r.sessionId,"com.microsoft.playready"!=e.a.keySystem&&"com.chromecast.playready"!=e.a.keySystem||function(e){var t=st(e.body,!0,!0);if(t.includes("PlayReadyKeyMessage")){for(var r=(t=(new DOMParser).parseFromString(t,"application/xml")).getElementsByTagName("HttpHeader"),n=0;n<r.length;++n)e.headers[r[n].querySelector("name").textContent]=r[n].querySelector("value").textContent;e.body=ht.Ba(t.querySelector("Challenge").textContent).buffer}else e.headers["Content-Type"]="text/xml; charset=utf-8"}(i),e.a.keySystem.startsWith("com.apple.fps")&&e.f.fairPlayTransform&&function(e){var t=new Uint8Array(e.body);t="spc="+ht.zc(t),e.headers["Content-Type"]="application/x-www-form-urlencoded",e.body=ut(t)}(i);var a=Date.now();e.B.ub.request(2,i).promise.then(function(e){return this.c?Promise.reject():(this.a.keySystem.startsWith("com.apple.fps")&&this.f.fairPlayTransform&&function(e){try{var t=at(e.data)}catch(e){return}"<ckc>"===(t=t.trim()).substr(0,5)&&"</ckc>"===t.substr(-6)&&(t=t.slice(5,-6));try{t=JSON.parse(t).ckc}catch(e){}e.data=ht.Ba(t).buffer}(e),this.K+=(Date.now()-a)/1e3,r.update(e.data).then(function(){var e=this;this.B.onEvent(new Se("drmsessionupdate")),n&&(n.ya&&n.ya.resolve(),new fe((function(){n.loaded=!0,Pt(e)&&e.m.resolve()})).R(Ot))}.bind(this)))}.bind(e),function(e){this.c||(e=new me(2,6,6007,e),this.g(e),n&&n.ya&&n.ya.reject(e))}.bind(e)).catch(function(e){this.c||(e=new me(2,6,6008,e.message),this.g(e),n&&n.ya&&n.ya.reject(e))}.bind(e))}function Ct(){var e=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],t=[{videoCapabilities:e,persistentState:"required",sessionTypes:["persistent-license"]},{videoCapabilities:e}],r=new Map;return e="org.w3.clearkey com.widevine.alpha com.microsoft.playready com.apple.fps.3_0 com.apple.fps.2_0 com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" ").map((function(e){return function(e){return p((function n(){var i,o,a;return M(n,(function(n){switch(n.j){case 1:return k(n,2),S(n,navigator.requestMediaKeySystemAccess(e,t),4);case 4:return i=n.o,a=!!(o=i.getConfiguration().sessionTypes)&&o.includes("persistent-license"),rt("Tizen 3")&&(a=!1),r.set(e,{persistentState:a}),S(n,i.createMediaKeys(),5);case 5:C(n,0);break;case 2:R(n),r.set(e,null),w(n)}}))}))}(e)})),Promise.all(e).then((function(){return $e(r)}))}function Rt(e,t){var r=t.audio,n=t.video;if(r&&r.encrypted&&!At(e,qe(r.mimeType,r.codecs))||n&&n.encrypted&&!At(e,qe(n.mimeType,n.codecs)))return!1;var i=_t(e.a);return 0==t.drmInfos.length||t.drmInfos.some((function(e){return e.keySystem==i}))}function Lt(e,t){if(!e.length)return t;if(!t.length)return e;for(var r=[],n=0;n<e.length;n++)for(var i=0;i<t.length;i++)if(e[n].keySystem==t[i].keySystem){var o=e[n];i=t[i];var a=[];a=(a=a.concat(o.initData||[])).concat(i.initData||[]);var s=[];s=(s=s.concat(o.keyIds)).concat(i.keyIds),r.push({keySystem:o.keySystem,licenseServerUri:o.licenseServerUri||i.licenseServerUri,distinctiveIdentifierRequired:o.distinctiveIdentifierRequired||i.distinctiveIdentifierRequired,persistentStateRequired:o.persistentStateRequired||i.persistentStateRequired,videoRobustness:o.videoRobustness||i.videoRobustness,audioRobustness:o.audioRobustness||i.audioRobustness,serverCertificate:o.serverCertificate||i.serverCertificate,initData:a,keyIds:s});break}return r}function jt(e){return p((function t(){var r;return M(t,(function(t){switch(t.j){case 1:return r=Array.from(e.b.keys()),e.b.clear(),S(t,Promise.all(r.map((function(e){return p((function t(){return M(t,(function(t){switch(t.j){case 1:return k(t,2),S(t,Promise.all([e.close(),e.closed]),4);case 4:C(t,0);break;case 2:R(t),w(t)}}))}))}))),0)}}))}))}function Pt(e){return ze(e=e.b.values(),(function(e){return e.loaded}))}function It(t,r,n){!t.keySystem||"org.w3.clearkey"==t.keySystem&&t.licenseServerUri||(r.size&&(r=r.get(t.keySystem)||"",t.licenseServerUri=r),t.keyIds||(t.keyIds=[]),(n=n.get(t.keySystem))&&(t.distinctiveIdentifierRequired||(t.distinctiveIdentifierRequired=n.distinctiveIdentifierRequired),t.persistentStateRequired||(t.persistentStateRequired=n.persistentStateRequired),t.videoRobustness||(t.videoRobustness=n.videoRobustness),t.audioRobustness||(t.audioRobustness=n.audioRobustness),t.serverCertificate||(t.serverCertificate=n.serverCertificate)),e.cast&&e.cast.__platform__&&"com.microsoft.playready"==t.keySystem&&(t.keySystem="com.chromecast.playready"))}G("shaka.util.Uint8ArrayUtils.toBase64",ht.zc),ht.Ba=function(t){t=e.atob(t.replace(/-/g,"+").replace(/_/g,"/"));for(var r=new Uint8Array(t.length),n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r},G("shaka.util.Uint8ArrayUtils.fromBase64",ht.Ba),ht.Qc=function(t){for(var r=new Uint8Array(t.length/2),n=0;n<t.length;n+=2)r[n/2]=e.parseInt(t.substr(n,2),16);return r},G("shaka.util.Uint8ArrayUtils.fromHex",ht.Qc),ht.Ac=function(e){for(var t="",r=0;r<e.length;++r){var n=e[r].toString(16);1==n.length&&(n="0"+n),t+=n}return t},G("shaka.util.Uint8ArrayUtils.toHex",ht.Ac),ht.za=function(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!=t.length)return!1;for(var r=0;r<e.length;++r)if(e[r]!=t[r])return!1;return!0},G("shaka.util.Uint8ArrayUtils.equal",ht.za),ht.concat=function(e){for(var t=[],r=0;r<arguments.length;++r)t[r]=arguments[r];for(var n=r=0;n<t.length;++n)r+=t[n].length;r=new Uint8Array(r);for(var i=n=0;i<t.length;++i)r.set(t[i],n),n+=t[i].length;return r},G("shaka.util.Uint8ArrayUtils.concat",ht.concat),(n=pt.prototype).destroy=function(){var e=this;return p((function t(){return M(t,(function(t){switch(t.j){case 1:return e.c?S(t,e.na,0):(e.c=!0,S(t,function(e){return p((function t(){return M(t,(function(t){switch(t.j){case 1:return e.i.release(),e.i=null,e.m.reject(),e.$.stop(),e.$=null,e.O.stop(),e.O=null,S(t,jt(e),2);case 2:if(!e.h){t.A(3);break}return k(t,4),S(t,e.h.setMediaKeys(null),6);case 6:C(t,5);break;case 4:R(t);case 5:e.h=null;case 3:e.a=null,e.u.clear(),e.l=null,e.s=[],e.f=null,e.g=null,e.B=null,w(t)}}))}))}(e),4));case 4:e.na.resolve(),t.A(0)}}))}))},n.configure=function(e){this.f=e},n.Hb=function(e){var t=this;if(!this.l)return this.i.da(e,"encrypted",(function(){t.g(new me(2,6,6010))})),Promise.resolve();this.h=e,this.i.da(this.h,"play",(function(){for(var e=0;e<t.F.length;e++)xt(t,t.F[e]);t.oa=!0,t.F=[]})),"webkitCurrentPlaybackTargetIsWireless"in this.h&&this.i.w(this.h,"webkitcurrentplaybacktargetiswirelesschanged",(function(){return jt(t)})),e=(e=this.h.setMediaKeys(this.l)).catch((function(e){return Promise.reject(new me(2,6,6003,e.message))}));var r=yt(this);return Promise.all([e,r]).then((function(){if(t.c)return Promise.reject();vt(t),t.a.initData.length||t.s.length||t.i.w(t.h,"encrypted",(function(e){return bt(t,e.initDataType,new Uint8Array(e.initData))}))})).catch((function(e){if(!t.c)return Promise.reject(e)}))},n.Lb=function(){for(var e=1/0,t=this.b.keys(),r=(t=f(t)).next();!r.done;r=t.next())r=r.value,isNaN(r.expiration)||(e=Math.min(e,r.expiration));return e},n.fe=function(e){this.h&&this.f.delayLicenseRequestUntilPlayed&&this.h.paused&&!this.oa?this.F.push(e):xt(this,e)},n.de=function(e){e=e.target;var t=this.b.get(e),r=!1;e.keyStatuses.forEach(function(e,n){if("string"==typeof n){var i=n;n=e,e=i}if("com.microsoft.playready"==this.a.keySystem&&16==n.byteLength&&!rt("Tizen")&&!rt("VITIS")){var o=(i=new DataView(n)).getUint32(0,!0),a=i.getUint16(4,!0),s=i.getUint16(6,!0);i.setUint32(0,o,!1),i.setUint16(4,a,!1),i.setUint16(6,s,!1)}"com.microsoft.playready"==this.a.keySystem&&"status-pending"==e&&(e="usable"),"status-pending"!=e&&(t.loaded=!0),"expired"==e&&(r=!0),i=ht.Ac(new Uint8Array(n)),this.pa.set(i,e)}.bind(this));var n=e.expiration-Date.now();(0>n||r&&1e3>n)&&t&&!t.ya&&(this.b.delete(e),e.close().catch((function(){}))),Pt(this)&&(this.m.resolve(),this.O.R(Dt))};var Ot=5,Dt=.5;function Mt(){this.a=new muxjs.mp4.CaptionParser,this.g=[],this.f={}}function Nt(){}function Ut(e){return!e||1==e.length&&1e-6>e.end(0)-e.start(0)?null:e.length?e.end(e.length-1):null}function Ft(e,t,r){return r=void 0===r?0:r,!(!e||!e.length||1==e.length&&1e-6>e.end(0)-e.start(0)||t>e.end(e.length-1))&&t+r>=e.start(0)}function Bt(e,t){if(!e||!e.length||1==e.length&&1e-6>e.end(0)-e.start(0))return 0;for(var r=0,n=e.length-1;0<=n&&e.end(n)>t;--n)r+=e.end(n)-Math.max(e.start(n),t);return r}function Kt(e){if(!e)return[];for(var t=[],r=0;r<e.length;r++)t.push({start:e.start(r),end:e.end(r)});return t}Mt.prototype.init=function(e){var t=muxjs.mp4.probe;e=new Uint8Array(e),this.g=t.videoTrackIds(e),this.f=t.timescale(e),this.a.init()},Mt.prototype.b=function(e,t){var r=new Uint8Array(e);(r=this.a.parse(r,this.g,this.f))&&r.captions&&t(r.captions),this.a.clearParsedCaptions()},Mt.prototype.c=function(){this.a.resetCaptionStream()},Nt.prototype.init=function(){},Nt.prototype.b=function(){},Nt.prototype.c=function(){};var Gt={Ke:function(e,t){return e.reduce(function(e,t,r){return t.catch(e.bind(null,r))}.bind(null,t),Promise.reject())},Gc:function(e,t){return e.concat(t)},oc:function(){},Ia:function(e){return null!=e}};function Vt(e,t){if(0==t.length)return e;var r=t.map((function(e){return new Z(e)}));return e.map((function(e){return new Z(e)})).map((function(e){return r.map(e.resolve.bind(e))})).reduce(Gt.Gc,[]).map((function(e){return e.toString()}))}function Ht(e,t){return{keySystem:e,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:t||[],keyIds:[]}}var Yt={Pa:"video",Eb:"audio",ra:"text",Cg:"image",Ag:"application"};function zt(){this.a=new muxjs.mp4.Transmuxer({keepOriginalTimestamps:!0}),this.b=null,this.g=[],this.c=[],this.f=!1,this.a.on("data",this.i.bind(this)),this.a.on("done",this.h.bind(this))}function Wt(t,r){return!(!e.muxjs||"mp2t"!=t.toLowerCase().split(";")[0].split("/")[1])&&(r?MediaSource.isTypeSupported($t(r,t)):MediaSource.isTypeSupported($t("audio",t))||MediaSource.isTypeSupported($t("video",t)))}function $t(e,t){var r=t.replace(/mp2t/i,"mp4");"audio"==e&&(r=r.replace("video","audio"));var n=/avc1\.(66|77|100)\.(\d+)/.exec(r);if(n){var i="avc1.",o=n[1],a=Number(n[2]);i=("66"==o?i+"4200":"77"==o?i+"4d00":i+"6400")+(a>>4).toString(16),i+=(15&a).toString(16),r=r.replace(n[0],i)}return r}function qt(e,t,r){this.startTime=e,this.direction=tr,this.endTime=t,this.payload=r,this.region=new ur,this.position=null,this.positionAlign=Xt,this.size=100,this.textAlign=Jt,this.writingMode=rr,this.lineInterpretation=nr,this.line=null,this.lineHeight="",this.lineAlign=ir,this.displayAlign=Qt,this.fontSize=this.backgroundImage=this.backgroundColor=this.color="",this.fontWeight=ar,this.fontStyle=sr,this.fontFamily="",this.textDecoration=[],this.wrapLine=!0,this.id="",this.nestedCues=[],this.spacer=!1}zt.prototype.destroy=function(){return this.a.dispose(),this.a=null,Promise.resolve()},zt.prototype.i=function(e){this.c=e.captions;var t=new Uint8Array(e.data.byteLength+e.initSegment.byteLength);t.set(e.initSegment,0),t.set(e.data,e.initSegment.byteLength),this.g.push(t)},zt.prototype.h=function(){var e={data:ht.concat.apply(null,this.g),captions:this.c};this.b.resolve(e),this.f=!1},G("shaka.text.Cue",qt);var Xt="auto";qt.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:Xt};var Jt="center",Zt={LEFT:"left",RIGHT:"right",CENTER:Jt,START:"start",END:"end"};qt.textAlign=Zt;var Qt="after",er={BEFORE:"before",CENTER:"center",AFTER:Qt};qt.displayAlign=er;var tr="ltr";qt.direction={HORIZONTAL_LEFT_TO_RIGHT:tr,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var rr="horizontal-tb";qt.writingMode={HORIZONTAL_TOP_TO_BOTTOM:rr,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var nr=0;qt.lineInterpretation={LINE_NUMBER:nr,PERCENTAGE:1};var ir="start",or={CENTER:"center",START:ir,END:"end"};qt.lineAlign=or;var ar=400;qt.fontWeight={NORMAL:ar,BOLD:700};var sr="normal",lr={NORMAL:sr,ITALIC:"italic",OBLIQUE:"oblique"};function ur(){this.id="",this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0,this.height=this.width=100,this.viewportAnchorUnits=this.widthUnits=this.heightUnits=cr,this.scroll=dr}qt.fontStyle=lr,qt.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"},G("shaka.text.CueRegion",ur);var cr=1;ur.units={PX:0,PERCENTAGE:cr,LINES:2};var dr="";function fr(e){this.g=null,this.c=e,this.f=this.m=0,this.h=1/0,this.b=this.a=null,this.l="",this.i=new Map}ur.scrollMode={NONE:dr,UP:"up"};var hr={};function pr(t){return!!(hr[t]||e.muxjs&&"application/cea-608"==t)}function mr(e,t){"application/cea-608"!=t&&(e.g=new hr[t])}function gr(e,t,r,n,i){for(var o=r+" "+n,a=new Map,s=(t=f(t)).next();!s.done;s=t.next()){var l=s.value;s=l.stream,a.has(s)||a.set(s,new Map),a.get(s).has(o)||a.get(s).set(o,[]),l.startTime+=i,l.endTime+=i,l.startTime>=e.f&&l.startTime<e.h&&(l=new qt(l.startTime,l.endTime,l.text),a.get(s).get(o).push(l),s==e.l&&e.c.append([l]))}for(o=(i=f(a.keys())).next();!o.done;o=i.next())for(o=o.value,e.i.has(o)||e.i.set(o,new Map),s=(t=f(a.get(o).keys())).next();!s.done;s=t.next())s=s.value,l=a.get(o).get(s),e.i.get(o).set(s,l);e.a=null==e.a?Math.max(r,e.f):Math.min(e.a,Math.max(r,e.f)),e.b=Math.max(e.b,Math.min(n,e.h))}function yr(e,t,r){this.f=e,this.g=r,this.b={},this.a=null,this.c={},this.i=new Be,this.u=!1,this.l={},this.m=t,e=this.s=new ge,t=new MediaSource,this.i.da(t,"sourceopen",e.resolve),this.f.src=vr(t),this.h=t}G("shaka.text.TextEngine.registerParser",(function(e,t){hr[e]=t})),G("shaka.text.TextEngine.unregisterParser",(function(e){delete hr[e]})),fr.prototype.destroy=function(){return this.c=this.g=null,this.i.clear(),Promise.resolve()},fr.prototype.kc=function(e){try{return this.g.parseMedia(new Uint8Array(e),{periodStart:0,segmentStart:null,segmentEnd:0})[0].startTime}catch(e){throw new me(2,2,2009,e)}},fr.prototype.remove=function(e,t){return Promise.resolve().then(function(){!this.c||!this.c.remove(e,t)||null==this.a||t<=this.a||e>=this.b||(e<=this.a&&t>=this.b?this.a=this.b=null:e<=this.a&&t<this.b?this.a=t:e>this.a&&t>=this.b&&(this.b=e))}.bind(this))};var vr=e.URL.createObjectURL;function br(e){var t=qe(e.mimeType,e.codecs),r=function(e){var t=[e.mimeType];return Je.forEach((function(r,n){var i=e[n];i&&t.push(r+'="'+i+'"')})),t.join(";")}(e);return pr(t)||MediaSource.isTypeSupported(r)||Wt(t,e.type)}function _r(e,t){e.a||(e.a=new fr(e.g)),mr(e.a,t)}function Ar(e){return!e.h||"ended"==e.h.readyState}function Er(e,t){if("text"==t)var r=e.a.a;else r=!(r=Sr(e,t))||1==r.length&&1e-6>r.end(0)-r.start(0)?null:1==r.length&&0>r.start(0)?0:r.length?r.start(0):null;return r}function Tr(e,t){return"text"==t?e.a.b:Ut(Sr(e,t))}function Sr(e,t){try{return e.b[t].buffered}catch(e){return null}}function wr(t,r,n,i,o,a){return"text"==r?function(e,t,r,n){return Promise.resolve().then(function(){if(this.g&&this.c)if(null==r||null==n)this.g.parseInit(new Uint8Array(t));else{var e={periodStart:this.m,segmentStart:r,segmentEnd:n};e=this.g.parseMedia(new Uint8Array(t),e).filter(function(e){return e.startTime>=this.f&&e.startTime<this.h}.bind(this)),this.c.append(e),null==this.a&&(this.a=Math.max(r,this.f)),this.b=Math.min(n,this.h)}}.bind(e))}(t.a,n,i,o):t.l[r]?function(e,t){e.f=!0,e.b=new ge,e.g=[],e.c=[];var r=new Uint8Array(t);return e.a.push(r),e.a.flush(),e.f&&e.b.reject(new me(2,3,3018)),e.b}(t.l[r],n).then(function(e){return this.a||_r(this,"text/vtt"),e.captions&&e.captions.length&&gr(this.a,e.captions,i,o,this.b.video.timestampOffset),Cr(this,r,this.re.bind(this,r,e.data.buffer))}.bind(t)):(a&&e.muxjs&&(t.a||_r(t,"text/vtt"),null==i&&null==o?t.m.init(n):t.m.b(n,(function(e){e.length&&gr(t.a,e,i,o,t.b.video.timestampOffset)}))),Cr(t,r,t.re.bind(t,r,n)))}function kr(e,t){var r=Tr(e,"video")||0;!function(e,t,r){if(e.l=t,t=e.i.get(t))for(var n=f(t.keys()),i=n.next();!i.done;i=n.next())(i=t.get(i.value).filter((function(e){return e.endTime<=r})))&&e.c.append(i)}(e.a,t,r)}function xr(e,t){return"text"==t?e.a?(e.m.c(),e.a.remove(0,1/0)):Promise.resolve():Cr(e,t,e.se.bind(e,t,0,e.h.duration))}function Cr(e,t,r){if(e.u)return Promise.reject();if(r={start:r,p:new ge},e.c[t].push(r),1==e.c[t].length)try{r.start()}catch(n){"QuotaExceededError"==n.name?r.p.reject(new me(2,3,3017,t)):r.p.reject(new me(2,3,3015,n)),Lr(e,t)}return r.p}function Rr(e,t){if(e.u)return Promise.reject();var r,n=[];for(r in e.b){var i=new ge,o={start:function(e){e.resolve()}.bind(null,i),p:i};e.c[r].push(o),n.push(i),1==e.c[r].length&&o.start()}return Promise.all(n).then(function(){try{t()}catch(t){var e=Promise.reject(new me(2,3,3015,t))}for(var r in this.b)Lr(this,r);return e}.bind(e),function(e){throw e}.bind(e))}function Lr(e,t){e.c[t].shift();var r=e.c[t][0];if(r)try{r.start()}catch(n){r.p.reject(new me(2,3,3015,n)),Lr(e,t)}}function jr(e,t){return e=Ir(e),t=Ir(t),e.split("-")[0]==t.split("-")[0]}function Pr(e,t){e=Ir(e),t=Ir(t);var r=e.split("-"),n=t.split("-");return r[0]==n[0]&&1==r.length&&2==n.length}function Ir(e){var t=e.split("-");return e=t[0]||"",t=t[1]||"",e=e.toLowerCase(),e=Mr.get(e)||e,(t=t.toUpperCase())?e+"-"+t:e}function Or(e){return e.language?Ir(e.language):e.audio&&e.audio.language?Ir(e.audio.language):e.video&&e.video.language?Ir(e.video.language):"und"}function Dr(e,t){for(var r=Ir(e),n=new Set,i=f(t),o=i.next();!o.done;o=i.next())n.add(Ir(o.value));for(o=(i=f(n)).next();!o.done;o=i.next())if((o=o.value)==r)return o;for(o=(i=f(n)).next();!o.done;o=i.next())if(Pr(o=o.value,r))return o;for(o=(i=f(n)).next();!o.done;o=i.next()){var a=o=o.value,s=r;if(a=Ir(a),s=Ir(s),a=a.split("-"),s=s.split("-"),2==a.length&&2==s.length&&a[0]==s[0])return o}for(o=(n=f(n)).next();!o.done;o=n.next())if(Pr(r,i=o.value))return i;return null}(n=yr.prototype).destroy=function(){var e=this;this.u=!0;var t,r=[];for(t in this.c){var n=this.c[t],i=n[0];for(this.c[t]=n.slice(0,1),i&&r.push(i.p.catch(Gt.oc)),i=1;i<n.length;++i)n[i].p.reject()}for(var o in this.a&&r.push(this.a.destroy()),this.g&&r.push(this.g.destroy()),this.l)r.push(this.l[o].destroy());return Promise.all(r).then((function(){e.i&&(e.i.release(),e.i=null),e.f&&(e.f.removeAttribute("src"),e.f.load(),e.f=null),e.h=null,e.a=null,e.g=null,e.b={},e.l={},e.m=null,e.c={}}))},n.init=function(e,t){var r=this;return p((function n(){var i;return M(n,(function(n){switch(n.j){case 1:return i=Yt,S(n,r.s,2);case 2:e.forEach((function(e,n){var o=qe(e.mimeType,e.codecs);n==i.ra?_r(r,o):(!t&&MediaSource.isTypeSupported(o)||!Wt(o,n)||(r.l[n]=new zt,o=$t(n,o)),o=r.h.addSourceBuffer(o),r.i.w(o,"error",r.lg.bind(r,n)),r.i.w(o,"updateend",r.xb.bind(r,n)),r.b[n]=o,r.c[n]=[])})),w(n)}}))}))},n.Sc=function(e){if(e.total=Kt(this.f.buffered),e.audio=Kt(Sr(this,"audio")),e.video=Kt(Sr(this,"video")),e.text=[],this.a){var t=this.a.a,r=this.a.b;null!=t&&null!=r&&e.text.push({start:t,end:r})}},n.remove=function(e,t,r){return"text"==e?this.a.remove(t,r):Cr(this,e,this.se.bind(this,e,t,r))},n.flush=function(e){return"text"==e?Promise.resolve():Cr(this,e,this.Pe.bind(this,e))},n.endOfStream=function(e){return Rr(this,function(){Ar(this)||(e?this.h.endOfStream(e):this.h.endOfStream())}.bind(this))},n.xa=function(e){return Rr(this,function(){this.h.duration=e}.bind(this))},n.Y=function(){return this.h.duration},n.re=function(e,t){this.b[e].appendBuffer(t)},n.se=function(e,t,r){r<=t?this.xb(e):this.b[e].remove(t,r)},n.Be=function(e){var t=this.b[e].appendWindowStart,r=this.b[e].appendWindowEnd;this.b[e].abort(),this.b[e].appendWindowStart=t,this.b[e].appendWindowEnd=r,this.xb(e)},n.Pe=function(e){this.f.currentTime-=.001,this.xb(e)},n.kg=function(e,t){0>t&&(t+=.001),this.b[e].timestampOffset=t,this.xb(e)},n.hg=function(e,t,r){this.b[e].appendWindowStart=0,this.b[e].appendWindowEnd=r,this.b[e].appendWindowStart=t,this.xb(e)},n.lg=function(e){this.c[e][0].p.reject(new me(2,3,3014,this.f.error?this.f.error.code:0))},n.xb=function(e){var t=this.c[e][0];t&&(t.p.resolve(),Lr(this,e))};var Mr=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"]]),Nr={bd:function(e,t,r){function n(e,t,r){return e>=t&&e<=r}var i=e.video;return!(i&&i.width&&i.height&&(!n(i.width,t.minWidth,Math.min(t.maxWidth,r.width))||!n(i.height,t.minHeight,Math.min(t.maxHeight,r.height))||!n(i.width*i.height,t.minPixels,t.maxPixels))||e&&e.frameRate&&!n(e.frameRate,t.minFrameRate,t.maxFrameRate)||!n(e.bandwidth,t.minBandwidth,t.maxBandwidth))},Gd:function(e,t,r){var n=!1;return e.forEach((function(e){var i=e.allowedByApplication;e.allowedByApplication=Nr.bd(e,t,r),i!=e.allowedByApplication&&(n=!0)})),n},filterNewPeriod:function(e,t,r,n){n.variants=n.variants.filter((function(n){if(e&&e.S&&!Rt(e,n))return!1;var i=n.audio;return n=n.video,!(i&&!br(i)||n&&!br(n)||i&&t&&!Nr.Hd(i,t)||n&&r&&!Nr.Hd(n,r))})),n.textStreams=n.textStreams.filter((function(e){return pr(qe(e.mimeType,e.codecs))}))},Hd:function(e,t){return e.mimeType==t.mimeType&&e.codecs.split(".")[0]==t.codecs.split(".")[0]},Ed:function(e){var t=e.audio,r=e.video,n=t?t.codecs:null,i=r?r.codecs:null,o=[];i&&o.push(i),n&&o.push(n);var a=[];r&&a.push(r.mimeType),t&&a.push(t.mimeType),a=a[0]||null;var s=[];t&&s.push(t.kind),r&&s.push(r.kind),s=s[0]||null;var l=new Set;return t&&t.roles.forEach((function(e){return l.add(e)})),r&&r.roles.forEach((function(e){return l.add(e)})),e={id:e.id,active:!1,type:"variant",bandwidth:e.bandwidth,language:e.language,label:null,kind:s,width:null,height:null,frameRate:null,pixelAspectRatio:null,mimeType:a,codecs:o.join(", "),audioCodec:n,videoCodec:i,primary:e.primary,roles:Array.from(l),audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null},r&&(e.videoId=r.id,e.originalVideoId=r.originalId,e.width=r.width||null,e.height=r.height||null,e.frameRate=r.frameRate||null,e.pixelAspectRatio=r.pixelAspectRatio||null,e.videoBandwidth=r.bandwidth||null),t&&(e.audioId=t.id,e.originalAudioId=t.originalId,e.channelsCount=t.channelsCount,e.audioSamplingRate=t.audioSamplingRate,e.audioBandwidth=t.bandwidth||null,e.label=t.label,e.audioRoles=t.roles),e},xc:function(e){return{id:e.id,active:!1,type:"text",bandwidth:0,language:e.language,label:e.label,kind:e.kind||null,width:null,height:null,frameRate:null,pixelAspectRatio:null,mimeType:e.mimeType,codecs:e.codecs||null,audioCodec:null,videoCodec:null,primary:e.primary,roles:e.roles,audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:e.originalId}},Wc:function(e){return e.__shaka_id||(e.__shaka_id=Nr.yf++),e.__shaka_id},yf:0,sf:function(e){var t=Nr.Sd(e);return t.active="disabled"!=e.mode,t.type="text",t.originalTextId=e.id,"captions"==e.kind&&(t.mimeType="application/cea-608"),t},rf:function(e){var t=Nr.Sd(e);return t.active=e.enabled,t.type="variant",t.originalAudioId=e.id,"main"==e.kind?(t.primary=!0,t.roles=["main"],t.audioRoles=["main"]):t.audioRoles=[],t},Sd:function(e){return{id:Nr.Wc(e),active:!1,type:"",bandwidth:0,language:Ir(e.language),label:e.label,kind:e.kind,width:null,height:null,frameRate:null,pixelAspectRatio:null,mimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:!1,roles:[],audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null}},rb:function(e){return e.allowedByApplication&&e.allowedByKeySystem},df:function(e){return e.filter((function(e){return Nr.rb(e)}))},Nd:function(e,t){for(var r=e.filter((function(e){return e.audio&&e.audio.channelsCount})),n=new Map,i=(r=f(r)).next();!i.done;i=r.next()){var o=(i=i.value).audio.channelsCount;n.has(o)||n.set(o,[]),n.get(o).push(i)}return 0==(r=Array.from(n.keys())).length?e:(i=r.filter((function(e){return e<=t}))).length?n.get(Math.max.apply(null,i)):n.get(Math.min.apply(null,r))},Jb:function(e,t,r){var n=e,i=e.filter((function(e){return e.primary}));i.length&&(n=i);var o=n.length?n[0].language:"";if(n=n.filter((function(e){return e.language==o})),t){var a=Dr(Ir(t),e.map((function(e){return e.language})));a&&(n=e.filter((function(e){return Ir(e.language)==a})))}if(r){if((e=Nr.Md(n,r)).length)return e}else if((e=n.filter((function(e){return 0==e.roles.length}))).length)return e;return(e=n.map((function(e){return e.roles})).reduce(Gt.Gc,[])).length?Nr.Md(n,e[0]):n},Md:function(e,t){return e.filter((function(e){return e.roles.includes(t)}))},Qd:function(e,t,r){for(var n=0;n<r.length;n++)if(r[n].audio==e&&r[n].video==t)return r[n];return null},tf:function(e){return"audio"==e.type},wf:function(e){return"video"==e.type},nf:function(e){var t=[];return e.audio&&t.push(e.audio),e.video&&t.push(e.video),t},Gg:function(e){return Nr.tf(e)?"type=audio codecs="+e.codecs+" bandwidth="+e.bandwidth+" channelsCount="+e.channelsCount+" audioSamplingRate="+e.audioSamplingRate:Nr.wf(e)?"type=video codecs="+e.codecs+" bandwidth="+e.bandwidth+" frameRate="+e.frameRate+" width="+e.width+" height="+e.height:"unexpected stream type"}};function Ur(){this.h=null,this.f=!1,this.b=new W,this.c=[],this.i=!1,this.a=this.g=null}function Fr(e,t){return e&&(t=t.filter((function(t){return Nr.bd(t,e,{width:1/0,height:1/0})}))),t.sort((function(e,t){return e.bandwidth-t.bandwidth}))}function Br(e,t){this.a=e,this.b=t}function Kr(e,t){var r=new Br(2,6),n=Hr,i=n.a,o=r.b-i.b;(0<(r.a-i.a||o)?n.c:n.b)(n.a,r,e,t)}function Gr(e,t,r,n){q([r,"has been deprecated and will be removed in",t,". We are currently at version",e,". Additional information:",n].join(" "))}function Vr(e,t,r,n){$([r,"has been deprecated and has been removed in",t,". We are now at version",e,". Additional information:",n].join(""))}G("shaka.abr.SimpleAbrManager",Ur),Ur.prototype.stop=function(){this.h=null,this.f=!1,this.c=[],this.g=null},Ur.prototype.stop=Ur.prototype.stop,Ur.prototype.init=function(e){this.h=e},Ur.prototype.init=Ur.prototype.init,Ur.prototype.chooseVariant=function(){var e=Fr(this.a.restrictions,this.c),t=this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate);this.c.length&&!e.length&&(e=[(e=Fr(null,this.c))[0]]);for(var r=e[0]||null,n=0;n<e.length;++n){var i=e[n],o=(e[n+1]||{bandwidth:1/0}).bandwidth/this.a.bandwidthUpgradeTarget;t>=i.bandwidth/this.a.bandwidthDowngradeTarget&&t<=o&&(r=i)}return this.g=Date.now(),r},Ur.prototype.chooseVariant=Ur.prototype.chooseVariant,Ur.prototype.enable=function(){this.f=!0},Ur.prototype.enable=Ur.prototype.enable,Ur.prototype.disable=function(){this.f=!1},Ur.prototype.disable=Ur.prototype.disable,Ur.prototype.segmentDownloaded=function(e,t){var r=this.b;if(!(16e3>t)){var n=8e3*t/e,i=e/1e3;r.a+=t,Y(r.b,i,n),Y(r.c,i,n)}if(null!=this.g&&this.f)e:{if(this.i){if(Date.now()-this.g<1e3*this.a.switchInterval)break e}else{if(!(128e3<=this.b.a))break e;this.i=!0}r=this.chooseVariant(),this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate),this.h(r)}},Ur.prototype.segmentDownloaded=Ur.prototype.segmentDownloaded,Ur.prototype.getBandwidthEstimate=function(){return this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate)},Ur.prototype.getBandwidthEstimate=Ur.prototype.getBandwidthEstimate,Ur.prototype.setVariants=function(e){this.c=e},Ur.prototype.setVariants=Ur.prototype.setVariants,Ur.prototype.configure=function(e){this.a=e},Ur.prototype.configure=Ur.prototype.configure,Br.prototype.toString=function(){return"v"+this.a+"."+this.b};var Hr=null,Yr="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),zr="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),Wr=["loop","playbackRate"],$r=["pause","play"],qr="abrstatuschanged adaptation buffering drmsessionupdate emsg error expirationupdated largegap loading manifestparsed onstatechange onstateidle streaming textchanged texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged unloading variantchanged".split(" "),Xr={getAssetUri:2,getAudioLanguages:2,getAudioLanguagesAndRoles:2,getBufferedInfo:2,getConfiguration:2,getExpiration:2,getPlaybackRate:2,getTextLanguages:2,getTextLanguagesAndRoles:2,getTextTracks:2,getStats:5,getVariantTracks:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1,usingEmbeddedTextTrack:2,getLoadMode:10},Jr={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20},Zr=[["getConfiguration","configure"]],Qr=[["isTextTrackVisible","setTextTrackVisibility"]],en="addTextTrack cancelTrickPlay configure resetConfiguration retryStreaming selectAudioLanguage selectEmbeddedTextTrack selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel setTextTrackVisibility trickPlay".split(" "),tn=["attach","detach","load","unload"];function rn(e){return JSON.stringify(e,(function(e,t){if("function"!=typeof t){if(t instanceof Event||t instanceof Se){var r,n={};for(r in t){var i=t[r];i&&"object"==typeof i?"detail"==r&&(n[r]=i):r in Event||(n[r]=i)}return n}if(t instanceof TimeRanges)for(n={__type__:"TimeRanges",length:t.length,start:[],end:[]},r=0;r<t.length;++r)n.start.push(t.start(r)),n.end.push(t.end(r));else n=t instanceof Uint8Array?{__type__:"Uint8Array",entries:Array.from(t)}:"number"==typeof t?isNaN(t)?"NaN":isFinite(t)?t:0>t?"-Infinity":"Infinity":t;return n}}))}function nn(e){return JSON.parse(e,(function(e,t){return"NaN"==t?NaN:"-Infinity"==t?-1/0:"Infinity"==t?1/0:t&&"object"==typeof t&&"TimeRanges"==t.__type__?function(e){return{length:e.length,start:function(t){return e.start[t]},end:function(t){return e.end[t]}}}(t):t&&"object"==typeof t&&"Uint8Array"==t.__type__?new Uint8Array(t.entries):t}))}function on(e,t,r,n,i,o){this.O=e,this.f=new fe(t),this.S=r,this.l=!1,this.F=n,this.K=i,this.B=o,this.b=this.h=!1,this.D="",this.i=null,this.m=this.ce.bind(this),this.s=this.Ff.bind(this),this.a={video:{},player:{}},this.u=0,this.c={},this.g=null,pn.add(this)}var an=!1,sn=null;function ln(e){for(var t=f(pn),r=t.next();!r.done;r=t.next())un(r.value,e)}function un(e,t){var r=e.B();e.g=new ge,e.l=!0,e.kd(r,t)}function cn(e){for(var t=f(pn),r=t.next();!r.done;r=t.next())r=r.value,an="available"==e,r.f.yc()}function dn(e){var t=sn;t.removeUpdateListener(e.m),t.removeMessageListener("urn:x-cast:com.google.shaka.v2",e.s)}function fn(e){for(var t in e.c){var r=e.c[t];delete e.c[t],r.reject(new me(1,7,7e3))}}function hn(e){e=rn(e),sn.sendMessage("urn:x-cast:com.google.shaka.v2",e,(function(){}),X)}(n=on.prototype).destroy=function(){return pn.delete(this),fn(this),sn&&dn(this),this.f&&(this.f.stop(),this.f=null),this.K=this.F=null,this.b=this.h=!1,this.s=this.m=this.g=this.c=this.a=this.i=null,Promise.resolve()},n.ga=function(){return this.b},n.nd=function(){return this.D},n.init=function(){if(e.chrome&&chrome.cast&&chrome.cast.isAvailable&&this.O.length){this.h=!0,this.f.yc();var t=new chrome.cast.SessionRequest(this.O);t=new chrome.cast.ApiConfig(t,ln.bind(this),cn.bind(this),"origin_scoped"),chrome.cast.initialize(t,(function(){}),(function(){})),an&&this.f.R(.02),(t=sn)&&t.status!=chrome.cast.SessionStatus.STOPPED?un(this,t):sn=null}},n.ud=function(e){this.i=e,this.b&&hn({type:"appData",appData:this.i})},n.cast=function(e){return this.h?an?this.b?Promise.reject(new me(1,8,8002)):(this.g=new ge,chrome.cast.requestSession(this.kd.bind(this,e),this.be.bind(this)),this.g):Promise.reject(new me(1,8,8001)):Promise.reject(new me(1,8,8e3))},n.Kb=function(){this.b&&(fn(this),sn&&(dn(this),sn.stop((function(){}),(function(){})),sn=null))},n.get=function(e,t){if("video"==e){if($r.includes(t))return this.le.bind(this,e,t)}else if("player"==e){if(Jr[t]&&!this.get("player","isLive")())return function(){};if(en.includes(t))return this.le.bind(this,e,t);if(tn.includes(t))return this.Wf.bind(this,e,t);if(Xr[t])return this.ie.bind(this,e,t)}return this.ie(e,t)},n.set=function(e,t,r){this.a[e][t]=r,hn({type:"set",targetName:e,property:t,value:r})},n.kd=function(e,t){sn=t,t.addUpdateListener(this.m),t.addMessageListener("urn:x-cast:com.google.shaka.v2",this.s),this.ce(),hn({type:"init",initState:e,appData:this.i}),this.g.resolve()},n.be=function(e){var t=8003;switch(e.code){case"cancel":t=8004;break;case"timeout":t=8005;break;case"receiver_unavailable":t=8006}this.g.reject(new me(2,8,t,e))},n.ie=function(e,t){return this.a[e][t]},n.le=function(e,t,r){for(var n=[],i=2;i<arguments.length;++i)n[i-2]=arguments[i];hn({type:"call",targetName:e,methodName:t,args:n})},n.Wf=function(e,t,r){for(var n=[],i=2;i<arguments.length;++i)n[i-2]=arguments[i];i=new ge;var o=this.u.toString();return this.u++,this.c[o]=i,hn({type:"asyncCall",targetName:e,methodName:t,args:n,id:o}),i},n.ce=function(){var e=!!sn&&"connected"==sn.status;if(this.b&&!e){for(var t in this.K(),this.a)this.a[t]={};fn(this)}this.D=(this.b=e)?sn.receiver.friendlyName:"",this.f.yc()},n.Ff=function(e,t){var r=nn(t);switch(r.type){case"event":var n=r.event;this.F(r.targetName,new Se(n.type,n));break;case"update":for(var i in n=r.update)for(var o in r=this.a[i]||{},n[i])r[o]=n[i][o];this.l&&(this.S(),this.l=!1);break;case"asyncComplete":if(i=r.id,r=r.error,o=this.c[i],delete this.c[i],o)if(r){for(n in i=new me(r.severity,r.category,r.code),r)i[n]=r[n];o.reject(i)}else o.resolve()}};var pn=new Set;function mn(e,t,r){var n=this;ke.call(this),this.c=e,this.b=t,this.i=this.g=this.f=this.l=this.h=null,this.s=r,this.m=new Map,this.a=new on(r,(function(){return vn(n)}),(function(){return bn(n)}),(function(e,t){return An(n,e,t)}),(function(){return _n(n)}),(function(){return yn(n)})),function(e){for(var t in e.a.init(),e.i=new Be,Yr.forEach(function(e){this.i.w(this.c,e,this.D.bind(this))}.bind(e)),qr.forEach(function(e){this.i.w(this.b,e,this.u.bind(this))}.bind(e)),e.h={},e.c)Object.defineProperty(e.h,t,{configurable:!1,enumerable:!0,get:e.B.bind(e,t),set:e.F.bind(e,t)});e.l={},gn(e,(function(t){Object.defineProperty(e.l,t,{configurable:!1,enumerable:!0,get:function(){return function e(t,r){if(t.m.has(r)&&(r=t.m.get(r)),"addEventListener"==r)return t.g.addEventListener.bind(t.g);if("removeEventListener"==r)return t.g.removeEventListener.bind(t.g);if("getMediaElement"==r)return function(){return this.h}.bind(t);if("getSharedConfiguration"==r)return t.a.get("player","getConfiguration");if("getNetworkingEngine"==r)return t.b.Mb.bind(t.b);if(t.a.ga()){if("getManifest"==r||"drmInfo"==r)return function(){return q(r+"() does not work while casting!"),null};if("getManifestUri"==r)return Kr("getManifestUri",'Please use "getAssetUri" instead.'),e(t,"getAssetUri");if("attach"==r||"detach"==r)return function(){return q(r+"() does not work while casting!"),Promise.resolve()}}return t.a.ga()&&0==Object.keys(t.a.a.video).length&&Xr[r]||!t.a.ga()?t.b[r].bind(t.b):t.a.get("player",r)}(e,t)}})})),function(e){var t=new Map;gn(e,(function(r,n){if(t.has(n)){var i=t.get(n);r.length<i.length?e.m.set(r,i):e.m.set(i,r)}else t.set(n,r)}))}(e),e.f=new ke,e.f.$b=e.h,e.g=new ke,e.g.$b=e.l}(this)}function gn(e,t){function r(e){return"constructor"!=e&&"function"==typeof n[e]&&!i.has(e)}var n=e.b,i=new Set;for(o in n)r(o)&&(i.add(o),t(o,n[o]));for(var o=Object.getPrototypeOf(n),a=Object.getPrototypeOf({});o&&o!=a;){for(var s=f(Object.getOwnPropertyNames(o)),l=s.next();!l.done;l=s.next())r(l=l.value)&&(i.add(l),t(l,n[l]));o=Object.getPrototypeOf(o)}}function yn(e){var t={video:{},player:{},playerAfterLoad:{},manifest:e.b.hc(),startTime:null};return e.c.pause(),Wr.forEach(function(e){t.video[e]=this.c[e]}.bind(e)),e.c.ended||(t.startTime=e.c.currentTime),Zr.forEach(function(e){var r=e[1];e=this.b[e[0]](),t.player[r]=e}.bind(e)),Qr.forEach(function(e){var r=e[1];e=this.b[e[0]](),t.playerAfterLoad[r]=e}.bind(e)),t}function vn(e){e.dispatchEvent(new Se("caststatuschanged"))}function bn(e){e.f.dispatchEvent(new Se(e.h.paused?"pause":"play"))}function _n(e){Zr.forEach(function(e){var t=e[1];e=this.a.get("player",e[0])(),this.b[t](e)}.bind(e));var t=e.a.get("player","getAssetUri")(),r=e.a.get("video","ended"),n=Promise.resolve(),i=e.c.autoplay,o=null;r||(o=e.a.get("video","currentTime")),t&&(e.c.autoplay=!1,n=e.b.load(t,o));var a={};Wr.forEach(function(e){a[e]=this.a.get("video",e)}.bind(e)),n.then((function(){e.c&&(Wr.forEach(function(e){this.c[e]=a[e]}.bind(e)),Qr.forEach(function(e){var t=e[1];e=this.a.get("player",e[0])(),this.b[t](e)}.bind(e)),e.c.autoplay=i,t&&e.c.play())}),(function(t){e.b.dispatchEvent(new Se("error",{detail:t}))}))}function An(e,t,r){e.a.ga()&&("video"==t?e.f.dispatchEvent(r):"player"==t&&e.g.dispatchEvent(r))}function En(e,t,r,n){var i=this;ke.call(this),this.a=e,this.b=t,this.c=new Be,this.D={video:e,player:t},this.s=r||function(){},this.F=n||function(e){return e},this.u=!1,this.h=!0,this.g=0,this.m=!1,this.l=!0,this.i=this.f=null,this.B=new fe((function(){Sn(i)})),function(e){var t=cast.receiver.CastReceiverManager.getInstance();t.onSenderConnected=e.ee.bind(e),t.onSenderDisconnected=e.ee.bind(e),t.onSystemVolumeChanged=e.Oe.bind(e),e.i=t.getCastMessageBus("urn:x-cast:com.google.cast.media"),e.i.onMessage=e.Af.bind(e),e.f=t.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),e.f.onMessage=e.Kf.bind(e),t.start(),Yr.forEach(function(e){this.c.w(this.a,e,this.je.bind(this,"video"))}.bind(e)),qr.forEach(function(e){this.c.w(this.b,e,this.je.bind(this,"player"))}.bind(e)),cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?e.b.vd(3840,2160):e.b.vd(1920,1080),e.c.w(e.a,"loadeddata",function(){this.m=!0}.bind(e)),e.c.w(e.b,"loading",function(){this.h=!1,Tn(this)}.bind(e)),e.c.w(e.a,"playing",function(){this.h=!1,Tn(this)}.bind(e)),e.c.w(e.a,"pause",function(){Tn(this)}.bind(e)),e.c.w(e.b,"unloading",function(){this.h=!0,Tn(this)}.bind(e)),e.c.w(e.a,"ended",function(){var e=this;new fe((function(){e.a&&e.a.ended&&(e.h=!0,Tn(e))})).R(5)}.bind(e))}(this)}function Tn(e){Promise.resolve().then(function(){this.b&&(this.dispatchEvent(new Se("caststatuschanged")),wn(this)||Cn(this,0))}.bind(e))}function Sn(e){e.B.R(.5);var t={video:{},player:{}};if(zr.forEach(function(e){t.video[e]=this.a[e]}.bind(e)),e.b.V())for(var r in Jr)0==e.g%Jr[r]&&(t.player[r]=e.b[r]());for(var n in Xr)0==e.g%Xr[n]&&(t.player[n]=e.b[n]());(r=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())&&(t.video.volume=r.level,t.video.muted=r.muted),e.m&&(e.g+=1),xn(e,{type:"update",update:t},e.f),wn(e)}function wn(e){return!(!e.l||!e.a.duration&&!e.b.V()||(kn(e),e.l=!1,0))}function kn(e){var t={contentId:e.b.hc(),streamType:e.b.V()?"LIVE":"BUFFERED",duration:e.a.duration,contentType:""};Cn(e,0,t)}function xn(e,t,r,n){e.u&&(e=rn(t),n?r.getCastChannel(n).send(e):r.broadcast(e))}function Cn(e,t,r){var n=e.a.playbackRate,i=Rn;n={mediaSessionId:0,playbackRate:n,playerState:i=e.h?i.IDLE:e.b.Xc()?i.we:e.a.paused?i.ye:i.ze,currentTime:e.a.currentTime,supportedMediaCommands:15,volume:{level:e.a.volume,muted:e.a.muted}},r&&(n.media=r),xn(e,{requestId:t,type:"MEDIA_STATUS",status:[n]},e.i)}e.__onGCastApiAvailable=function(e){if(e)for(var t=(e=f(pn)).next();!t.done;t=e.next())t.value.init()},V(mn,ke),G("shaka.cast.CastProxy",mn),mn.prototype.destroy=function(e){return e&&this.a.Kb(),this.i&&(this.i.release(),this.i=null),e=[],this.b&&(e.push(this.b.destroy()),this.b=null),this.a&&(e.push(this.a.destroy()),this.a=null),this.l=this.h=this.c=null,Promise.all(e)},mn.prototype.destroy=mn.prototype.destroy,mn.prototype.pf=function(){return this.h},mn.prototype.getVideo=mn.prototype.pf,mn.prototype.ff=function(){return this.l},mn.prototype.getPlayer=mn.prototype.ff,mn.prototype.Ee=function(){return this.a.h&&an},mn.prototype.canCast=mn.prototype.Ee,mn.prototype.ga=function(){return this.a.ga()},mn.prototype.isCasting=mn.prototype.ga,mn.prototype.nd=function(){return this.a.nd()},mn.prototype.receiverName=mn.prototype.nd,mn.prototype.cast=function(){var e=yn(this);return this.a.cast(e).then(function(){if(this.b)return this.b.Cd()}.bind(this))},mn.prototype.cast=mn.prototype.cast,mn.prototype.ud=function(e){this.a.ud(e)},mn.prototype.setAppData=mn.prototype.ud,mn.prototype.sg=function(){var e=this.a;if(e.b){var t=e.B();chrome.cast.requestSession(e.kd.bind(e,t),e.be.bind(e))}},mn.prototype.suggestDisconnect=mn.prototype.sg,mn.prototype.He=function(e){var t=this;return p((function r(){return M(r,(function(r){switch(r.j){case 1:return e==t.s?r.return():(t.s=e,t.a.Kb(),S(r,t.a.destroy(),2));case 2:t.a=null,t.a=new on(e,(function(){return vn(t)}),(function(){return bn(t)}),(function(e,r){return An(t,e,r)}),(function(){return _n(t)}),(function(){return yn(t)})),t.a.init(),w(r)}}))}))},mn.prototype.changeReceiverId=mn.prototype.He,mn.prototype.Kb=function(){this.a.Kb()},mn.prototype.forceDisconnect=mn.prototype.Kb,mn.prototype.B=function(e){if("addEventListener"==e)return this.f.addEventListener.bind(this.f);if("removeEventListener"==e)return this.f.removeEventListener.bind(this.f);if(this.a.ga()&&0==Object.keys(this.a.a.video).length){var t=this.c[e];if("function"!=typeof t)return t}return this.a.ga()?this.a.get("video",e):("function"==typeof(e=this.c[e])&&(e=e.bind(this.c)),e)},mn.prototype.F=function(e,t){this.a.ga()?this.a.set("video",e,t):this.c[e]=t},mn.prototype.D=function(e){this.a.ga()||this.f.dispatchEvent(new Se(e.type,e))},mn.prototype.u=function(e){this.a.ga()||this.g.dispatchEvent(e)},V(En,ke),G("shaka.cast.CastReceiver",En),En.prototype.isConnected=function(){return this.u},En.prototype.isConnected=En.prototype.isConnected,En.prototype.vf=function(){return this.h},En.prototype.isIdle=En.prototype.vf,En.prototype.destroy=function(){var e=this;return p((function t(){var r;return M(t,(function(t){switch(t.j){case 1:return e.c&&(e.c.release(),e.c=null),r=[],e.b&&(r.push(e.b.destroy()),e.b=null),e.B&&(e.B.stop(),e.B=null),e.a=null,e.D=null,e.s=null,e.u=!1,e.h=!0,e.f=null,e.i=null,S(t,Promise.all(r),2);case 2:cast.receiver.CastReceiverManager.getInstance().stop(),w(t)}}))}))},En.prototype.destroy=En.prototype.destroy,(n=En.prototype).ee=function(){this.g=0,this.l=!0,this.u=0!=cast.receiver.CastReceiverManager.getInstance().getSenders().length,Tn(this)},n.je=function(e,t){this.b&&(Sn(this),xn(this,{type:"event",targetName:e,event:t},this.f))},n.Oe=function(){var e=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();e&&xn(this,{type:"update",update:{video:{volume:e.level,muted:e.muted}}},this.f),xn(this,{type:"event",targetName:"video",event:{type:"volumechange"}},this.f)},n.Kf=function(e){var t=nn(e.data);switch(t.type){case"init":this.g=0,this.m=!1,this.l=!0,function(e,t,r){for(var n in t.player)e.b[n](t.player[n]);e.s(r),r=Promise.resolve();var i=e.a.autoplay;t.manifest&&(e.a.autoplay=!1,r=e.b.load(t.manifest,t.startTime)),r.then((function(){if(e.b){for(var r in t.video)e.a[r]=t.video[r];for(var n in t.playerAfterLoad)e.b[n](t.playerAfterLoad[n]);e.a.autoplay=i,t.manifest&&(e.a.play(),Cn(e,0))}}),(function(t){e.b.dispatchEvent(new Se("error",{detail:t}))}))}(this,t.initState,t.appData),Sn(this);break;case"appData":this.s(t.appData);break;case"set":var r=t.targetName,n=t.property;if(t=t.value,"video"==r){var i=cast.receiver.CastReceiverManager.getInstance();if("volume"==n){i.setSystemVolumeLevel(t);break}if("muted"==n){i.setSystemVolumeMuted(t);break}}this.D[r][n]=t;break;case"call":(r=this.D[t.targetName])[t.methodName].apply(r,t.args);break;case"asyncCall":r=t.targetName,n=t.methodName,"player"==r&&"load"==n&&(this.g=0,this.m=!1),i=t.id,e=e.senderId;var o=this.D[r];t=o[n].apply(o,t.args),"player"==r&&"load"==n&&(t=t.then(function(){this.l=!0}.bind(this))),t.then(this.oe.bind(this,e,i,null),this.oe.bind(this,e,i))}},n.Af=function(e){var t=nn(e.data);switch(t.type){case"PLAY":this.a.play(),Cn(this,0);break;case"PAUSE":this.a.pause(),Cn(this,0);break;case"SEEK":e=t.currentTime;var r=t.resumeState;null!=e&&(this.a.currentTime=Number(e)),r&&"PLAYBACK_START"==r?(this.a.play(),Cn(this,0)):r&&"PLAYBACK_PAUSE"==r&&(this.a.pause(),Cn(this,0));break;case"STOP":this.b.Cd().then(function(){this.b&&Cn(this,0)}.bind(this));break;case"GET_STATUS":Cn(this,Number(t.requestId));break;case"VOLUME":e=(r=t.volume).level,r=r.muted;var n=this.a.volume,i=this.a.muted;null!=e&&(this.a.volume=Number(e)),null!=r&&(this.a.muted=r),n==this.a.volume&&i==this.a.muted||Cn(this,0);break;case"LOAD":this.g=0,this.l=this.m=!1,e=t.media,r=t.currentTime,n=this.F(e.contentId),i=t.autoplay||!0,this.s(e.customData),i&&(this.a.autoplay=!0),this.b.load(n,r).then(function(){this.b&&kn(this)}.bind(this)).catch(function(e){var r="LOAD_FAILED";7==e.category&&7e3==e.code&&(r="LOAD_CANCELLED"),xn(this,{requestId:Number(t.requestId),type:r},this.i)}.bind(this));break;default:xn(this,{requestId:Number(t.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},this.i)}},n.oe=function(e,t,r){this.b&&xn(this,{type:"asyncComplete",id:t,error:r},this.f,e)};var Rn={IDLE:"IDLE",ze:"PLAYING",we:"BUFFERING",ye:"PAUSED"};function Ln(e,t){this.J=e,this.b=t==jn,this.a=0}G("shaka.util.DataViewReader",Ln);var jn=1;function Pn(){throw new me(2,3,3e3)}function In(){this.c=[],this.b=[],this.a=!1}function On(e){for(var t=null!=e.flags?12:8;e.reader.ua()&&!e.parser.a;)e.parser.sc(e.start+t,e.reader,e.partialOkay)}function Dn(e){for(var t=null!=e.flags?12:8,r=e.reader.G();0<r&&!e.parser.a;--r)e.parser.sc(e.start+t,e.reader,e.partialOkay)}function Mn(e){return function(t){e(t.reader.Za(t.reader.J.byteLength-t.reader.ca()))}}function Nn(e){for(var t=0,r=0;r<e.length;r++)t=t<<8|e.charCodeAt(r);return t}function Un(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}function Fn(e){var t=this;this.a=[],this.b=[],this.data=[],(new In).H("moov",On).fa("pssh",(function(e){if(!(1<e.version)){var r=e.reader.J;if(r=new Uint8Array(r.buffer,r.byteOffset-12,e.size),t.data.push(r),t.a.push(ht.Ac(e.reader.Za(16))),0<e.version){r=e.reader.G();for(var n=0;n<r;++n){var i=ht.Ac(e.reader.Za(16));t.b.push(i)}}}})).parse(e)}Ln.Endianness={Bg:0,Dg:jn},Ln.prototype.ua=function(){return this.a<this.J.byteLength},Ln.prototype.hasMoreData=Ln.prototype.ua,Ln.prototype.ca=function(){return this.a},Ln.prototype.getPosition=Ln.prototype.ca,Ln.prototype.Ve=function(){return this.J.byteLength},Ln.prototype.getLength=Ln.prototype.Ve,Ln.prototype.la=function(){try{var e=this.J.getUint8(this.a);return this.a+=1,e}catch(e){Pn()}},Ln.prototype.readUint8=Ln.prototype.la,Ln.prototype.Tb=function(){try{var e=this.J.getUint16(this.a,this.b);return this.a+=2,e}catch(e){Pn()}},Ln.prototype.readUint16=Ln.prototype.Tb,Ln.prototype.G=function(){try{var e=this.J.getUint32(this.a,this.b);return this.a+=4,e}catch(e){Pn()}},Ln.prototype.readUint32=Ln.prototype.G,Ln.prototype.ke=function(){try{var e=this.J.getInt32(this.a,this.b);return this.a+=4,e}catch(e){Pn()}},Ln.prototype.readInt32=Ln.prototype.ke,Ln.prototype.Bb=function(){try{if(this.b)var e=this.J.getUint32(this.a,!0),t=this.J.getUint32(this.a+4,!0);else t=this.J.getUint32(this.a,!1),e=this.J.getUint32(this.a+4,!1)}catch(e){Pn()}if(2097151<t)throw new me(2,3,3001);return this.a+=8,t*Math.pow(2,32)+e},Ln.prototype.readUint64=Ln.prototype.Bb,Ln.prototype.Za=function(e){this.a+e>this.J.byteLength&&Pn();var t=new Uint8Array(this.J.buffer,this.J.byteOffset+this.a,e);return this.a+=e,t},Ln.prototype.readBytes=Ln.prototype.Za,Ln.prototype.M=function(e){this.a+e>this.J.byteLength&&Pn(),this.a+=e},Ln.prototype.skip=Ln.prototype.M,Ln.prototype.me=function(e){this.a<e&&Pn(),this.a-=e},Ln.prototype.rewind=Ln.prototype.me,Ln.prototype.seek=function(e){(0>e||e>this.J.byteLength)&&Pn(),this.a=e},Ln.prototype.seek=Ln.prototype.seek,Ln.prototype.md=function(){for(var e=this.a;this.ua()&&0!=this.J.getUint8(this.a);)this.a+=1;return e=new Uint8Array(this.J.buffer,this.J.byteOffset+e,this.a-e),this.a+=1,at(e)},Ln.prototype.readTerminatedString=Ln.prototype.md,G("shaka.util.Mp4Parser",In),In.prototype.H=function(e,t){var r=Nn(e);return this.c[r]=0,this.b[r]=t,this},In.prototype.box=In.prototype.H,In.prototype.fa=function(e,t){var r=Nn(e);return this.c[r]=1,this.b[r]=t,this},In.prototype.fullBox=In.prototype.fa,In.prototype.stop=function(){this.a=!0},In.prototype.stop=In.prototype.stop,In.prototype.parse=function(e,t){var r=new Uint8Array(e);for(r=new Ln(new DataView(r.buffer,r.byteOffset,r.byteLength),0),this.a=!1;r.ua()&&!this.a;)this.sc(0,r,t)},In.prototype.parse=In.prototype.parse,In.prototype.sc=function(e,t,r){var n=t.ca(),i=t.G(),o=t.G();switch(i){case 0:i=t.J.byteLength-n;break;case 1:i=t.Bb()}var a=this.b[o];if(a){var s=null,l=null;1==this.c[o]&&(s=(l=t.G())>>>24,l&=16777215),o=n+i,r&&o>t.J.byteLength&&(o=t.J.byteLength),o-=t.ca(),t=0<o?t.Za(o):new Uint8Array(0),a({parser:this,partialOkay:r||!1,version:s,flags:l,reader:t=new Ln(new DataView(t.buffer,t.byteOffset,t.byteLength),0),size:i,start:n+e})}else t.M(Math.min(n+i-t.ca(),t.J.byteLength-t.ca()))},In.prototype.parseNext=In.prototype.sc,In.children=On,In.sampleDescription=Dn,In.allData=Mn,In.typeToString=Un;var Bn={gc:function(e,t){var r=Bn.P(e,t);return 1!=r.length?null:r[0]},Oc:function(e,t,r){return 1!=(e=Bn.Od(e,t,r)).length?null:e[0]},P:function(e,t){return Array.prototype.filter.call(e.childNodes,(function(e){return e instanceof Element&&e.tagName==t}))},Od:function(e,t,r){return Array.prototype.filter.call(e.childNodes,(function(e){return e instanceof Element&&e.localName==r&&e.namespaceURI==t}))},getAttributeNS:function(e,t,r){return e.hasAttributeNS(t,r)?e.getAttributeNS(t,r):null},ic:function(e){return Array.prototype.every.call(e.childNodes,(function(e){return e.nodeType==Node.TEXT_NODE||e.nodeType==Node.CDATA_SECTION_NODE}))?e.textContent.trim():null},I:function(e,t,r,n){n=void 0===n?null:n;var i=null;return null!=(e=e.getAttribute(t))&&(i=r(e)),null==i?n:i},Of:function(e){return e?(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),e=Date.parse(e),isNaN(e)?null:Math.floor(e/1e3)):null},Ea:function(e){return e&&(e=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(e))?(e=31536e3*Number(e[1]||null)+2592e3*Number(e[2]||null)+86400*Number(e[3]||null)+3600*Number(e[4]||null)+60*Number(e[5]||null)+Number(e[6]||null),isFinite(e)?e:null):null},uc:function(e){var t=/([0-9]+)-([0-9]+)/.exec(e);return t?(e=Number(t[1]),isFinite(e)?(t=Number(t[2]),isFinite(t)?{start:e,end:t}:null):null):null},parseInt:function(e){return 0==(e=Number(e))%1?e:null},tc:function(e){return 0==(e=Number(e))%1&&0<e?e:null},yb:function(e){return 0==(e=Number(e))%1&&0<=e?e:null},parseFloat:function(e){return e=Number(e),isNaN(e)?null:e},Me:function(e){var t;return e=(t=e.match(/^(\d+)\/(\d+)$/))?Number(t[1])/Number(t[2]):Number(e),isNaN(e)?null:e},he:function(e,t){var r=new DOMParser;try{var n=r.parseFromString(e,"text/xml")}catch(e){}if(n&&n.documentElement.tagName==t)var i=n.documentElement;return i&&0<i.getElementsByTagName("parsererror").length?null:i},ge:function(e,t){try{var r=at(e);return Bn.he(r,t)}catch(e){}}},Kn=(new Map).set("urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b","org.w3.clearkey").set("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine.alpha").set("urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95","com.microsoft.playready").set("urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb","com.adobe.primetime");function Gn(e,t,r){var n=function(e){for(var t=[],r=(e=f(e)).next();!r.done;r=e.next())(r=Yn(r.value))&&t.push(r);return t}(e),i=null;e=[];var o=[],a=new Set(n.map((function(e){return e.keyId})));if(a.delete(null),1<a.size)throw new me(2,4,4010);if(r||(o=n.filter((function(e){return"urn:mpeg:dash:mp4protection:2011"!=e.ne||(i=e.init||i,!1)}))).length&&0==(e=function(e,t,r){for(var n=[],i=(r=f(r)).next();!i.done;i=r.next()){i=i.value;var o=Kn.get(i.ne);if(o){var a;if(a=Bn.Oc(i.node,"urn:microsoft:playready","pro")){a=ht.Ba(a.textContent);var s=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),l=a.length,u=s.length+16+l,c=new ArrayBuffer(u),d=new Uint8Array(c);c=new DataView(c);var h=0;c.setUint32(h,u),h+=4,c.setUint32(h,1886614376),h+=4,c.setUint32(h,0),h+=4,d.set(s,h),h+=s.length,c.setUint32(h,l),h+=4,d.set(a,h),a=[{initData:d,initDataType:"cenc",keyId:i.keyId}]}else a=null;a=Ht(o,i.init||e||a),(o=Hn.get(o))&&(a.licenseServerUri=o(i)),n.push(a)}else for(i=f(i=t(i.node)||[]),o=i.next();!o.done;o=i.next())n.push(o.value)}return n}(i,t,o)).length&&(e=[Ht("",i)]),n.length&&(r||!o.length))for(e=[],r=(t=f(Kn.values())).next();!r.done;r=t.next())"org.w3.clearkey"!=(r=r.value)&&e.push(Ht(r,i));if(a=Array.from(a)[0]||null)for(r=(t=f(e)).next();!r.done;r=t.next())for(n=(r=f(r.value.initData)).next();!n.done;n=r.next())n.value.keyId=a;return{Kd:a,Fg:i,drmInfos:e,Pd:!0}}var Vn,Hn=(new Map).set("com.widevine.alpha",(function(e){return(e=Bn.Oc(e.node,"urn:microsoft","laurl"))&&e.getAttribute("licenseUrl")||""})).set("com.microsoft.playready",(function(e){return(e=Bn.Oc(e.node,"urn:microsoft:playready","pro"))&&(e=function(e){var t=0,r=new DataView(e).getUint32(t,!0);if(r!==e.byteLength)return[];t+=6,r=[];for(var n=new DataView(e);t<e.byteLength-1;){var i=n.getUint16(t,!0);t+=2;var o=n.getUint16(t,!0);t+=2;var a=new Uint8Array(e,t,o);r.push({type:i,value:a}),t+=o}return r}((e=ht.Ba(e.textContent)).buffer).filter((function(e){return 1===e.type}))[0])?(e=st(e.value,!0),(e=Bn.he(e,"WRMHEADER"))?function(e){return(e=e.querySelector("DATA > LA_URL"))?e.textContent:""}(e):""):""}));function Yn(e){var t=e.getAttribute("schemeIdUri"),r=Bn.getAttributeNS(e,"urn:mpeg:cenc:2013","default_KID"),n=Bn.Od(e,"urn:mpeg:cenc:2013","pssh").map(Bn.ic);if(!t)return null;if(t=t.toLowerCase(),r&&(r=r.replace(/-/g,"").toLowerCase()).includes(" "))throw new me(2,4,4009);var i=[];try{i=n.map((function(e){return{initDataType:"cenc",initData:ht.Ba(e),keyId:null}}))}catch(e){throw new me(2,4,4007)}return{node:e,ne:t,keyId:r,init:0<i.length?i:null}}function zn(t,r,n,i,o){var a={RepresentationID:r,Number:n,Bandwidth:i,Time:o};return t.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,(function(t,r,n,i){if("$$"==t)return"$";var o=a[r];if(null==o)return t;switch("RepresentationID"==r&&n&&(n=void 0),"Time"==r&&(o=Math.round(o)),i){case void 0:case"d":case"i":case"u":t=o.toString();break;case"o":t=o.toString(8);break;case"x":t=o.toString(16);break;case"X":t=o.toString(16).toUpperCase();break;default:t=o.toString()}return n=e.parseInt(n,10)||1,Array(Math.max(0,n-t.length)+1).join("0")+t}))}function Wn(e,t){var r=$n(e,t,"timescale"),n=1;r&&(n=Bn.tc(r)||1),r=$n(e,t,"duration"),(r=Bn.tc(r||""))&&(r/=n);var i=$n(e,t,"startNumber"),o=Number($n(e,t,"presentationTimeOffset"))||0,a=Bn.yb(i||"");null!=i&&null!=a||(a=1);var s=qn(e,t,"SegmentTimeline");if(i=null,s){i=n;var l=e.T.duration||1/0;s=Bn.P(s,"S");for(var u=[],c=0,d=0;d<s.length;++d){var f=s[d],h=Bn.I(f,"t",Bn.yb),p=Bn.I(f,"d",Bn.yb);if(f=Bn.I(f,"r",Bn.parseInt),null!=h&&(h-=o),!p)break;if(h=null!=h?h:c,0>(f=f||0))if(d+1<s.length){if(null==(f=Bn.I(s[d+1],"t",Bn.yb)))break;if(h>=f)break;f=Math.ceil((f-h)/p)-1}else{if(1/0==l)break;if(h/i>=l)break;f=Math.ceil((l*i-h)/p)-1}0<u.length&&h!=c&&(u[u.length-1].end=h/i);for(var m=0;m<=f;++m)c=h+p,u.push({start:h/i,end:c/i,xg:h}),h=c}i=u}return{timescale:n,Z:r,ab:a,ma:o/n||0,Dd:o,N:i}}function $n(e,t,r){return[t(e.C),t(e.aa),t(e.ka)].filter(Gt.Ia).map((function(e){return e.getAttribute(r)})).reduce((function(e,t){return e||t}))}function qn(e,t,r){return[t(e.C),t(e.aa),t(e.ka)].filter(Gt.Ia).map((function(e){return Bn.gc(e,r)})).reduce((function(e,t){return e||t}))}function Xn(e,t,r,n,i,o){if(o=void 0===o?0:o,Bn.getAttributeNS(e,"http://www.w3.org/1999/xlink","href")){var a=function(e,t,r,n,i,o){for(var a=Bn.getAttributeNS(e,"http://www.w3.org/1999/xlink","href"),s=Bn.getAttributeNS(e,"http://www.w3.org/1999/xlink","actuate")||"onRequest",l=0;l<e.attributes.length;l++){var u=e.attributes[l];"http://www.w3.org/1999/xlink"==u.namespaceURI&&(e.removeAttributeNS(u.namespaceURI,u.localName),--l)}if(5<=o)return ve(new me(2,4,4028));if("onLoad"!=s)return ve(new me(2,4,4027));var c=Vt([n],[a]);return i.request(0,Me(c,t)).U((function(n){if(!(n=Bn.ge(n.data,e.tagName)))return ve(new me(2,4,4001,a));for(;e.childNodes.length;)e.removeChild(e.childNodes[0]);for(;n.childNodes.length;){var s=n.childNodes[0];n.removeChild(s),e.appendChild(s)}for(s=0;s<n.attributes.length;s++){var l=n.attributes[s].nodeName,u=n.getAttribute(l);e.setAttribute(l,u)}return Xn(e,t,r,c[0],i,o+1)}))}(e,t,r,n,i,o);return r&&(a=a.U(void 0,(function(){return Xn(e,t,r,n,i,o)}))),a}a=[];for(var s=0;s<e.childNodes.length;s++){var l=e.childNodes[s];l instanceof Element&&("urn:mpeg:dash:resolve-to-zero:2013"==Bn.getAttributeNS(l,"http://www.w3.org/1999/xlink","href")?(e.removeChild(l),--s):"SegmentTimeline"!=l.tagName&&a.push(Xn(l,t,r,n,i,o)))}return Ee(a).U((function(){return e}))}function Jn(e,t,r){this.c=e,this.b=t,this.a=r}function Zn(e,t,r,n,i,o){this.position=e,this.startTime=t,this.endTime=r,this.c=n,this.b=i,this.a=o}function Qn(e,t,r,n){var i,o=(new In).fa("sidx",(function(e){i=function(e,t,r,n){var i=[];n.reader.M(4);var o=n.reader.G();if(0==o)throw new me(2,3,3005);if(0==n.version)var a=n.reader.G(),s=n.reader.G();else a=n.reader.Bb(),s=n.reader.Bb();n.reader.M(2);var l=n.reader.Tb();for(e=e+n.size+s,s=0;s<l;s++){var u=n.reader.G(),c=(2147483648&u)>>>31;u&=2147483647;var d=n.reader.G();if(n.reader.M(4),1==c)throw new me(2,3,3006);i.push(new Zn(i.length,a/o-t,(a+d)/o-t,(function(){return r}),e,e+u-1)),a+=d,e+=u}return n.parser.stop(),i}(t,n,r,e)}));if(e&&o.parse(e),i)return i;throw new me(2,3,3004)}function ei(e){this.a=e}function ti(e,t){for(;e.a.length&&e.a[e.a.length-1].startTime>=t;)e.a.pop();for(;e.a.length&&0>=e.a[0].endTime;)e.a.shift();if(0!=e.a.length){var r=e.a[e.a.length-1];e.a[e.a.length-1]=new Zn(r.position,r.startTime,t,r.c,r.b,r.a)}}function ri(e){this.b=e,this.a=new Ln(e,0),Vn||(Vn=[new Uint8Array([255]),new Uint8Array([127,255]),new Uint8Array([63,255,255]),new Uint8Array([31,255,255,255]),new Uint8Array([15,255,255,255,255]),new Uint8Array([7,255,255,255,255,255]),new Uint8Array([3,255,255,255,255,255,255]),new Uint8Array([1,255,255,255,255,255,255,255])])}function ni(e){var t=ii(e);if(7<t.length)throw new me(2,3,3002);for(var r=0,n=0;n<t.length;n++)r=256*r+t[n];t=r,r=ii(e);e:{n=ht.za;for(var i=0;i<Vn.length;i++)if(n(r,Vn[i])){n=!0;break e}n=!1}if(n)r=e.b.byteLength-e.a.ca();else{if(8==r.length&&224&r[1])throw new me(2,3,3001);for(n=r[0]&(1<<8-r.length)-1,i=1;i<r.length;i++)n=256*n+r[i];r=n}return r=e.a.ca()+r<=e.b.byteLength?r:e.b.byteLength-e.a.ca(),n=new DataView(e.b.buffer,e.b.byteOffset+e.a.ca(),r),e.a.M(r),new oi(t,n)}function ii(e){var t,r=e.a.la();for(t=1;8>=t&&!(r&1<<8-t);t++);if(8<t)throw new me(2,3,3002);var n=new Uint8Array(t);for(n[0]=r,r=1;r<t;r++)n[r]=e.a.la();return n}function oi(e,t){this.id=e,this.a=t}function ai(e){if(8<e.a.byteLength)throw new me(2,3,3002);if(8==e.a.byteLength&&224&e.a.getUint8(0))throw new me(2,3,3001);for(var t=0,r=0;r<e.a.byteLength;r++)t=256*t+e.a.getUint8(r);return t}function si(){}function li(e){var t=new ri(e.a);if(179!=(e=ni(t)).id)throw new me(2,3,3013);if(e=ai(e),183!=(t=ni(t)).id)throw new me(2,3,3012);t=new ri(t.a);for(var r=0;t.ua();){var n=ni(t);if(241==n.id){r=ai(n);break}}return{yg:e,Vf:r}}function ui(e,t){var r=qn(e,t,"Initialization");if(!r)return null;var n=e.C.qa,i=r.getAttribute("sourceURL");i&&(n=Vt(e.C.qa,[i])),i=0;var o=null;return(r=Bn.I(r,"range",Bn.uc))&&(i=r.start,o=r.end),new Jn((function(){return n}),i,o)}function ci(e,t,r,n,i,o,a,s){var l=e.presentationTimeline,u=!e.mb||!e.T.Zc,c=e.T.start,d=e.T.duration,f=t,h=null;return{createSegmentIndex:function(){var e=[f(n,i,o),"webm"==a?f(r.c(),r.b,r.a):null];return f=null,Promise.all(e).then((function(e){var t=e[0];e=e[1]||null,t="mp4"==a?Qn(t,i,n,s):(new si).parse(t,e,n,s),l.vb(t,c),h=new ei(t),u&&ti(h,d)}))},findSegmentPosition:function(e){return h.find(e)},getSegmentReference:function(e){return h.get(e)}}}function di(e){return e.Ub}function fi(e,t){var r=ui(e,hi),n=function(e){return[e.C.La,e.aa.La,e.ka.La].filter(Gt.Ia).map((function(e){return Bn.P(e,"SegmentURL")})).reduce((function(e,t){return 0<e.length?e:t})).map((function(t){return t.getAttribute("indexRange")&&!e.Vd&&(e.Vd=!0),{xf:t.getAttribute("media"),start:(t=Bn.I(t,"mediaRange",Bn.uc,{start:0,end:null})).start,end:t.end}}))}(e),i=Wn(e,hi),o=i.ab;0==o&&(o=1);var a=0;if(i.Z?a=i.Z*(o-1):i.N&&0<i.N.length&&(a=i.N[0].start),!(n={Z:i.Z,startTime:a,ab:o,ma:i.ma,N:i.N,tb:n}).Z&&!n.N&&1<n.tb.length)throw new me(2,4,4002);if(!n.Z&&!e.T.duration&&!n.N&&1==n.tb.length)throw new me(2,4,4002);if(n.N&&0==n.N.length)throw new me(2,4,4002);return o=i=null,e.ka.id&&e.C.id&&(i=t[o=e.ka.id+","+e.C.id]),a=function(e,t,r,n){var i=n.tb.length;n.N&&n.N.length!=n.tb.length&&(i=Math.min(n.N.length,n.tb.length));for(var o=[],a=n.startTime,s=0;s<i;s++){var l,u=n.tb[s],c=Vt(r,[u.xf]);l=null!=n.Z?a+n.Z:n.N?n.N[s].end:a+e,o.push(new Zn(s+t,a,l,function(e){return e}.bind(null,c),u.start,u.end)),a=l}return o}(e.T.duration,n.ab,e.C.qa,n),i?(i.cd(a),o=e.presentationTimeline.Ob(),i.Lc(o-e.T.start)):(e.presentationTimeline.vb(a,e.T.start),i=new ei(a),o&&e.mb&&(t[o]=i)),e.mb&&e.T.Zc||ti(i,e.T.duration),{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:i.find.bind(i),getSegmentReference:i.get.bind(i),initSegmentReference:r,ma:n.ma}}function hi(e){return e.La}function pi(e,t,r,n){var i=function(e){var t=$n(e,mi,"initialization");if(!t)return null;var r=e.C.id,n=e.bandwidth||null,i=e.C.qa;return new Jn((function(){var e=zn(t,r,null,n,null);return Vt(i,[e])}),0,null)}(e),o=Wn(e,mi),a=$n(e,mi,"media"),s=$n(e,mi,"index");if(a=(o={Z:o.Z,timescale:o.timescale,ab:o.ab,ma:o.ma,Dd:o.Dd,N:o.N,ad:a,Qb:s}).Qb?1:0,a+=o.N?1:0,0==(a+=o.Z?1:0))throw new me(2,4,4002);if(1!=a&&(o.Qb&&(o.N=null),o.Z=null),!o.Qb&&!o.ad)throw new me(2,4,4002);if(o.Qb){if("mp4"!=(r=e.C.mimeType.split("/")[1])&&"webm"!=r)throw new me(2,4,4006);if("webm"==r&&!i)throw new me(2,4,4005);n=zn(o.Qb,e.C.id,null,e.bandwidth||null,null),e=ci(e,t,i,n=Vt(e.C.qa,[n]),0,null,r,o.ma)}else o.Z?(n||(e.presentationTimeline.ed(o.Z),e.presentationTimeline.fd(e.T.start)),e=function(e,t){var r=e.T.duration,n=t.Z,i=t.ab,o=t.timescale,a=t.ad,s=e.bandwidth||null,l=e.C.id,u=e.C.qa;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(e){return 0>e||r&&e>=r?null:Math.floor(e/n)},getSegmentReference:function(e){var t=e*n,c=t+n;return r&&(c=Math.min(c,r)),0>c||r&&t>=r?null:new Zn(e,t,c,(function(){var r=zn(a,l,e+i,s,t*o);return Vt(u,[r])}),0,null)}}}(e,o)):(a=t=null,e.ka.id&&e.C.id&&(t=r[a=e.ka.id+","+e.C.id]),s=function(e,t){for(var r=[],n=0;n<t.N.length;n++){var i=n+t.ab;r.push(new Zn(i,t.N[n].start,t.N[n].end,function(e,t,r,n,i,o){return Vt(n,[e=zn(e,t,i,r,o)]).map((function(e){return e.toString()}))}.bind(null,t.ad,e.C.id,e.bandwidth||null,e.C.qa,i,t.N[n].xg+t.Dd),0,null))}return r}(e,o),n=!e.mb||!e.T.Zc,t?(n&&ti(new ei(s),e.T.duration),t.cd(s),r=e.presentationTimeline.Ob(),t.Lc(r-e.T.start)):(e.presentationTimeline.vb(s,e.T.start),t=new ei(s),a&&e.mb&&(r[a]=t)),n&&ti(t,e.T.duration),e={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:t.find.bind(t),getSegmentReference:t.get.bind(t)});return{createSegmentIndex:e.createSegmentIndex,findSegmentPosition:e.findSegmentPosition,getSegmentReference:e.getSegmentReference,initSegmentReference:i,ma:o.ma}}function mi(e){return e.Wb}G("shaka.media.InitSegmentReference",Jn),Jn.prototype.Ic=function(){return this.c()},Jn.prototype.createUris=Jn.prototype.Ic,Jn.prototype.Uc=function(){return this.b},Jn.prototype.getStartByte=Jn.prototype.Uc,Jn.prototype.Tc=function(){return this.a},Jn.prototype.getEndByte=Jn.prototype.Tc,G("shaka.media.SegmentReference",Zn),Zn.prototype.ca=function(){return this.position},Zn.prototype.getPosition=Zn.prototype.ca,Zn.prototype.kc=function(){return this.startTime},Zn.prototype.getStartTime=Zn.prototype.kc,Zn.prototype.Te=function(){return this.endTime},Zn.prototype.getEndTime=Zn.prototype.Te,Zn.prototype.Ic=function(){return this.c()},Zn.prototype.createUris=Zn.prototype.Ic,Zn.prototype.Uc=function(){return this.b},Zn.prototype.getStartByte=Zn.prototype.Uc,Zn.prototype.Tc=function(){return this.a},Zn.prototype.getEndByte=Zn.prototype.Tc,G("shaka.media.SegmentIndex",ei),ei.prototype.destroy=function(){return this.a=null,Promise.resolve()},ei.prototype.destroy=ei.prototype.destroy,ei.prototype.find=function(e){for(var t=this.a.length-1;0<=t;--t){var r=this.a[t];if(e>=r.startTime&&e<r.endTime)return r.position}return this.a.length&&e<this.a[0].startTime?this.a[0].position:null},ei.prototype.find=ei.prototype.find,ei.prototype.get=function(e){return 0==this.a.length||0>(e-=this.a[0].position)||e>=this.a.length?null:this.a[e]},ei.prototype.get=ei.prototype.get,ei.prototype.offset=function(e){for(var t=0;t<this.a.length;++t)this.a[t].startTime+=e,this.a[t].endTime+=e},ei.prototype.offset=ei.prototype.offset,ei.prototype.cd=function(e){for(var t=[],r=0,n=0;r<this.a.length&&n<e.length;){var i=this.a[r],o=e[n];i.startTime<o.startTime?(t.push(i),r++):(i.startTime>o.startTime?0==r&&t.push(o):(.1<Math.abs(i.endTime-o.endTime)?t.push(new Zn(i.position,o.startTime,o.endTime,o.c,o.b,o.a)):t.push(i),r++),n++)}for(;r<this.a.length;)t.push(this.a[r++]);if(t.length)for(r=t[t.length-1].position+1;n<e.length;)i=new Zn(r++,(i=e[n++]).startTime,i.endTime,i.c,i.b,i.a),t.push(i);else t=e;this.a=t},ei.prototype.merge=ei.prototype.cd,ei.prototype.Lc=function(e){for(var t=0;t<this.a.length;++t)if(this.a[t].endTime>e)return void this.a.splice(0,t);this.a=[]},ei.prototype.evict=ei.prototype.Lc,ri.prototype.ua=function(){return this.a.ua()},si.prototype.parse=function(e,t,r,n){var i;if(440786851!=ni(t=new ri(new DataView(t))).id)throw new me(2,3,3008);var o=ni(t);if(408125543!=o.id)throw new me(2,3,3009);for(t=o.a.byteOffset,o=new ri(o.a),i=null;o.ua();){var a=ni(o);if(357149030==a.id){i=a;break}}if(!i)throw new me(2,3,3010);for(o=new ri(i.a),i=1e6,a=null;o.ua();){var s=ni(o);if(2807729==s.id)i=ai(s);else if(17545==s.id)if(4==(a=s).a.byteLength)a=a.a.getFloat32(0);else{if(8!=a.a.byteLength)throw new me(2,3,3003);a=a.a.getFloat64(0)}}if(null==a)throw new me(2,3,3011);if(i=a*(o=i/1e9),475249515!=(e=ni(new ri(new DataView(e)))).id)throw new me(2,3,3007);return function(e,t,r,n,i,o){function a(){return i}var s=[];e=new ri(e.a);for(var l=null,u=null;e.ua();){var c=ni(e);if(187==c.id){var d=li(c);d&&(c=r*d.yg,d=t+d.Vf,null!=l&&s.push(new Zn(s.length,l-o,c-o,a,u,d-1)),l=c,u=d)}}return null!=l&&s.push(new Zn(s.length,l-o,n-o,a,u,null)),s}(e,t,o,i,r,n)};var gi={zb:{},Sb:{},pd:function(e,t){gi.Sb[e]=t}};function yi(e,t,r){this.f=e,this.vc=t,this.h=this.g=1/0,this.a=1,this.b=this.c=null,this.l=0,this.m=!0,this.i=0,this.s=void 0===r||r}function vi(e,t,r,n){return e=Me(e,n),0==t&&null==r||(e.headers.Range=r?"bytes="+t+"-"+r:"bytes="+t+"-"),e}function bi(){var e=this;this.b=this.a=null,this.f=[],this.c=null,this.l=[],this.h=1,this.m={},this.s=0,this.u=new H(5),this.i=new fe((function(){!function(e){p((function t(){var r,n;return M(t,(function(t){switch(t.j){case 1:return r=0,k(t,2),S(t,_i(e),4);case 4:r=t.o,C(t,3);break;case 2:n=R(t),e.b&&(n.severity=1,e.b.onError(n));case 3:if(!e.b)return t.return();Si(e,r),w(t)}}))}))}(e)})),this.g=new je}function _i(e){var t=Date.now(),r=e.b.networkingEngine.request(0,Me(e.f,e.a.retryParameters));return Pe(e.g,r),r.promise.then((function(t){if(e.b)return t.uri&&!e.f.includes(t.uri)&&e.f.unshift(t.uri),function(e,t,r){if(!(t=Bn.ge(t,"MPD")))throw new me(2,4,4001,r);return t=Xn(t,e.a.retryParameters,e.a.dash.xlinkFailGracefully,r,e.b.networkingEngine),Pe(e.g,t),t.promise.then((function(t){return function(e,t,r){return p((function n(){var i,o,a,s,l,u,c,d,f,h,p,m,g,y,v,b,_,A,E,T,k,x,C,R;return M(n,(function(n){switch(n.j){case 1:s=Gt,u=[r],0<(c=(l=Bn).P(t,"Location").map(l.ic).filter(s.Ia)).length&&(d=Vt(u,c),u=e.f=d),f=l.P(t,"BaseURL").map(l.ic),h=Vt(u,f),p=e.a.dash.ignoreMinBufferTime,m=0,p||(m=l.I(t,"minBufferTime",l.Ea)),e.s=l.I(t,"minimumUpdatePeriod",l.Ea,-1),g=l.I(t,"availabilityStartTime",l.Of),y=l.I(t,"timeShiftBufferDepth",l.Ea),v=l.I(t,"maxSegmentDuration",l.Ea),b=t.getAttribute("type")||"static",_=e.a.dash.ignoreSuggestedPresentationDelay,A=null,_||(A=l.I(t,"suggestedPresentationDelay",l.Ea)),e.c?E=e.c.presentationTimeline:(T=Math.max(e.a.dash.defaultPresentationDelay,1.5*m),E=new yi(g,null!=A?A:T,e.a.dash.autoCorrectDrift));for(var L={mb:"static"!=b,presentationTimeline:E,ka:null,T:null,aa:null,C:null,bandwidth:0,Vd:!1},j=h,P=Bn.I(t,"mediaPresentationDuration",Bn.Ea),I=[],O=0,D=Bn.P(t,"Period"),M=0;M<D.length;M++){var N=D[M];O=Bn.I(N,"start",Bn.Ea,O);var U=Bn.I(N,"duration",Bn.Ea),F=null;if(M!=D.length-1){var B=Bn.I(D[M+1],"start",Bn.Ea);null!=B&&(F=B-O)}else null!=P&&(F=P-O);if(null==F&&(F=U),N=Ai(e,L,j,{start:O,duration:F,node:N,Zc:null==F||M==D.length-1}),I.push(N),U=L.ka.id,e.l.includes(U)||(e.l.push(U),e.c&&(e.b.filterNewPeriod(N),e.c.periods.push(N))),null==F){O=null;break}O+=F}if(null==e.c&&e.b.filterAllPeriods(I),null!=P?(i=I,o=P,a=!1):(i=I,o=O,a=!0),k=o,x=i,E.Xb("static"==b),"static"!=b&&a||E.xa(k||1/0),E.V()&&!isNaN(e.a.availabilityWindowOverride)&&(y=e.a.availabilityWindowOverride),null==y&&(y=1/0),E.xd(y),E.ed(v||1),e.c){n.A(0);break}if(e.c={presentationTimeline:E,periods:x,offlineSessionIds:[],minBufferTime:m||0},!E.ue()){n.A(0);break}return C=l.P(t,"UTCTiming"),S(n,function(e,t,r){r=r.map((function(e){return{scheme:e.getAttribute("schemeIdUri"),value:e.getAttribute("value")}}));var n=e.a.dash.clockSyncUri;return!r.length&&n&&r.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:n}),Gt.Ke(r,function(e){var r=e.scheme;switch(e=e.value,r){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":return ki(this,t,e,"HEAD");case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":return ki(this,t,e,"GET");case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":return r=Date.parse(e),isNaN(r)?0:r-Date.now();case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":return q("NTP UTCTiming scheme is not supported"),Promise.reject();default:return q("Unrecognized scheme in UTCTiming element",r),Promise.reject()}}.bind(e)).catch((function(){return q("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"),0}))}(e,h,C),4);case 4:if(R=n.o,!e.b)return n.return();E.pe(R),w(n)}}))}))}(e,t,r)}))}(e,t.data,t.uri)})).then((function(){var r=(Date.now()-t)/1e3;return Y(e.u,1,r),r}))}function Ai(e,t,r,n){if(t.ka=wi(n.node,null,r),t.T=n,t.ka.id||(t.ka.id="__shaka_period_"+n.start),Bn.P(n.node,"EventStream").forEach(e.Pf.bind(e,n.start,n.duration)),r=Bn.P(n.node,"AdaptationSet").map(e.Nf.bind(e,t)).filter(Gt.Ia),t.mb){t=[];for(var i=f(r),o=i.next();!o.done;o=i.next())for(var a=(o=f(o.value.Yf)).next();!a.done;a=o.next())t.push(a.value);if(t.length!=new Set(t).size)throw new me(2,4,4018)}var s=r.filter((function(e){return!e.Bd}));if(r.filter((function(e){return e.Bd})).forEach((function(e){var t=e.streams[0],r=e.Bd;s.forEach((function(e){e.id==r&&e.streams.forEach((function(e){e.trickModeVideo=t}))}))})),t=Ei(s,"video"),i=Ei(s,"audio"),!t.length&&!i.length)throw new me(2,4,4004);for(r=e.a.disableAudio,i.length&&!r||(i=[null]),r=e.a.disableVideo,t.length&&!r||(t=[null]),r=[],o=0;o<i.length;o++)for(a=0;a<t.length;a++)Ti(e,i[o],t[a],r);if(t=[],!e.a.disableText)for(e=Ei(s,"text"),i=0;i<e.length;i++)t.push.apply(t,e[i].streams);return{startTime:n.start,textStreams:t,variants:r}}function Ei(e,t){return e.filter((function(e){return e.contentType==t}))}function Ti(e,t,r,n){if(t||r)if(t&&r){var i=t.drmInfos,o=r.drmInfos;if(!i.length||!o.length||0<Lt(i,o).length){o=Lt(t.drmInfos,r.drmInfos);for(var a=0;a<t.streams.length;a++)for(var s=0;s<r.streams.length;s++)i=(r.streams[s].bandwidth||0)+(t.streams[a].bandwidth||0),i={id:e.h++,language:t.language,primary:t.$c||r.$c,audio:t.streams[a],video:r.streams[s],bandwidth:i,drmInfos:o,allowedByApplication:!0,allowedByKeySystem:!0},n.push(i)}}else for(o=t||r,a=0;a<o.streams.length;a++)i=o.streams[a].bandwidth||0,i={id:e.h++,language:o.language||"und",primary:o.$c,audio:t?o.streams[a]:null,video:r?o.streams[a]:null,bandwidth:i,drmInfos:o.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0},n.push(i)}function Si(e,t){0>e.s||e.i.R(Math.max(3,e.s-t,z(e.u)))}function wi(e,t,r){t=t||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,gd:null,audioSamplingRate:null},r=r||t.qa;var n=Bn.yb,i=Bn.Me,o=Bn.P(e,"BaseURL").map(Bn.ic),a=e.getAttribute("contentType")||t.contentType,s=e.getAttribute("mimeType")||t.mimeType,l=e.getAttribute("codecs")||t.codecs;i=Bn.I(e,"frameRate",i)||t.frameRate;for(var u=e.getAttribute("par")||t.pixelAspectRatio,c=Bn.P(e,"InbandEventStream"),d=t.emsgSchemeIdUris.slice(),h=(c=f(c)).next();!h.done;h=c.next())h=h.value.getAttribute("schemeIdUri"),d.includes(h)||d.push(h);return c=function(e){for(var t=0;t<e.length;++t){var r=e[t],n=r.getAttribute("schemeIdUri");if(n&&(r=r.getAttribute("value")))switch(n){case"urn:mpeg:dash:outputChannelPositionList:2012":return r.trim().split(/ +/).length;case"urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case"urn:dts:dash:audio_channel_configuration:2012":if(!(n=parseInt(r,10)))continue;return n;case"tag:dolby.com,2014:dash:audio_channel_configuration:2011":case"urn:dolby:dash:audio_channel_configuration:2011":if(n=parseInt(r,16)){for(e=0;n;)1&n&&++e,n>>=1;return e}}}return null}(c=Bn.P(e,"AudioChannelConfiguration"))||t.gd,h=Bn.I(e,"audioSamplingRate",n)||t.audioSamplingRate,a||(a=xi(s,l)),{qa:Vt(r,o),Ub:Bn.gc(e,"SegmentBase")||t.Ub,La:Bn.gc(e,"SegmentList")||t.La,Wb:Bn.gc(e,"SegmentTemplate")||t.Wb,width:Bn.I(e,"width",n)||t.width,height:Bn.I(e,"height",n)||t.height,contentType:a,mimeType:s,codecs:l,frameRate:i,pixelAspectRatio:u,emsgSchemeIdUris:d,id:e.getAttribute("id"),gd:c,audioSamplingRate:h}}function ki(e,t,r,n){return(t=Me(t=Vt(t,[r]),e.a.retryParameters)).method=n,t=e.b.networkingEngine.request(4,t),Pe(e.g,t),t.promise.then((function(e){if("HEAD"==n){if(!e.headers||!e.headers.date)return 0;e=e.headers.date}else e=at(e.data);return e=Date.parse(e),isNaN(e)?0:e-Date.now()}))}function xi(e,t){return pr(qe(e,t))?"text":e.split("/")[0]}function Ci(e,t,r,n){this.b=e,this.type=t,this.a=r,this.segments=n||null}function Ri(e,t,r,n){this.id=e,this.name=t,this.a=r,this.value=void 0===n?null:n}function Li(e,t){this.name=e,this.value=t}function ji(e,t,r){return(e=e.getAttribute(t))?e.value:r||null}function Pi(e,t){this.b=t,this.a=e}G("shaka.media.ManifestParser.registerParserByExtension",gi.pd),gi.Cb=function(e,t){gi.zb[e]=t},G("shaka.media.ManifestParser.registerParserByMime",gi.Cb),gi.Sf=function(){var e={};if(Ze()){for(var t in gi.zb)e[t]=!0;for(var r in gi.Sb)e[r]=!0}t={mpd:"application/dash+xml",m3u8:"application/x-mpegurl",ism:"application/vnd.ms-sstr+xml"};for(var n=(r=f(["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"])).next();!n.done;n=r.next())e[n=n.value]=Ze()?!!gi.zb[n]:Qe(n);for(var i in t)e[i]=Ze()?!!gi.Sb[i]:Qe(t[i]);return e},gi.create=function(e,t,r,n){return p((function i(){var o,a;return M(i,(function(i){switch(i.j){case 1:return k(i,2),S(i,gi.Ue(e,t,r,n),4);case 4:return o=i.o,i.return(new o);case 2:throw(a=R(i)).severity=2,a}}))}))},gi.Ue=function(e,t,r,n){return p((function i(){var o,a,s,l,u;return M(i,(function(i){switch(i.j){case 1:if(o=gi,n&&(a=o.zb[n.toLowerCase()]))return i.return(a);if((s=o.getExtension(e))&&(l=o.Sb[s]))return i.return(l);if(n){i.A(2);break}return S(i,o.bf(e,t,r),3);case 3:if((n=i.o)&&(u=gi.zb[n]))return i.return(u);case 2:throw new me(2,4,4e3,e)}}))}))},gi.bf=function(e,t,r){return p((function n(){var i,o,a;return M(n,(function(n){switch(n.j){case 1:return(i=Me([e],r)).method="HEAD",S(n,t.request(0,i).promise,2);case 2:return o=n.o,a=o.headers["content-type"],n.return(a?a.toLowerCase().split(";").shift():"")}}))}))},gi.getExtension=function(e){return 1==(e=new Z(e).ja.split("/").pop().split(".")).length?"":e.pop().toLowerCase()},gi.isSupported=function(e,t){return!!Ze()&&(t in gi.zb||gi.getExtension(e)in gi.Sb)},G("shaka.media.PresentationTimeline",yi),yi.prototype.Y=function(){return this.g},yi.prototype.getDuration=yi.prototype.Y,yi.prototype.$e=function(){return this.a},yi.prototype.getMaxSegmentDuration=yi.prototype.$e,yi.prototype.xa=function(e){this.g=e},yi.prototype.setDuration=yi.prototype.xa,yi.prototype.hf=function(){return this.f},yi.prototype.getPresentationStartTime=yi.prototype.hf,yi.prototype.pe=function(e){this.l=e},yi.prototype.setClockOffset=yi.prototype.pe,yi.prototype.Xb=function(e){this.m=e},yi.prototype.setStatic=yi.prototype.Xb,yi.prototype.xd=function(e){this.h=e},yi.prototype.setSegmentAvailabilityDuration=yi.prototype.xd,yi.prototype.ig=function(e){this.vc=e},yi.prototype.setDelay=yi.prototype.ig,yi.prototype.Se=function(){return this.vc},yi.prototype.getDelay=yi.prototype.Se,yi.prototype.vb=function(e,t){if(0!=e.length){var r=e[e.length-1].endTime+t;this.fd(e[0].startTime+t),this.a=e.reduce((function(e,t){return Math.max(e,t.endTime-t.startTime)}),this.a),this.b=Math.max(this.b,r),null!=this.f&&this.s&&(this.f=(Date.now()+this.l)/1e3-this.b-this.a)}},yi.prototype.notifySegments=yi.prototype.vb,yi.prototype.fd=function(e){this.c=null==this.c?e:Math.min(this.c,e)},yi.prototype.notifyMinSegmentStartTime=yi.prototype.fd,yi.prototype.ed=function(e){this.a=Math.max(this.a,e)},yi.prototype.notifyMaxSegmentDuration=yi.prototype.ed,yi.prototype.offset=function(e){null!=this.c&&(this.c+=e),null!=this.b&&(this.b+=e)},yi.prototype.offset=yi.prototype.offset,yi.prototype.V=function(){return 1/0==this.g&&!this.m},yi.prototype.isLive=yi.prototype.V,yi.prototype.Xa=function(){return 1/0!=this.g&&!this.m},yi.prototype.isInProgress=yi.prototype.Xa,yi.prototype.Ob=function(){if(1/0==this.h)return this.i;var e=this.pb()-this.h;return Math.max(this.i,e)},yi.prototype.getSegmentAvailabilityStart=yi.prototype.Ob,yi.prototype.qe=function(e){this.i=e},yi.prototype.setUserSeekStart=yi.prototype.qe,yi.prototype.pb=function(){return this.V()||this.Xa()?Math.min(Math.max(0,(Date.now()+this.l)/1e3-this.a-this.f),this.g):this.g},yi.prototype.getSegmentAvailabilityEnd=yi.prototype.pb,yi.prototype.Nb=function(e){var t=Math.max(this.c,this.i);if(1/0==this.h)return t;var r=this.pb()-this.h;return e=Math.min(r+e,this.Ca()),Math.max(t,e)},yi.prototype.getSafeSeekRangeStart=yi.prototype.Nb,yi.prototype.ob=function(){return this.Nb(0)},yi.prototype.getSeekRangeStart=yi.prototype.ob,yi.prototype.Ca=function(){var e=this.V()||this.Xa()?this.vc:0;return Math.max(0,this.pb()-e)},yi.prototype.getSeekRangeEnd=yi.prototype.Ca,yi.prototype.ue=function(){return!(null==this.f||null!=this.b&&this.s)},yi.prototype.usingPresentationStartTime=yi.prototype.ue,G("shaka.dash.DashParser",bi),(n=bi.prototype).configure=function(e){this.a=e},n.start=function(e,t){var r=this;return p((function n(){var i;return M(n,(function(n){switch(n.j){case 1:return r.f=[e],r.b=t,S(n,_i(r),2);case 2:if(i=n.o,r.b&&Si(r,i),!r.b)throw new me(2,7,7001);return n.return(r.c)}}))}))},n.stop=function(){return this.a=this.b=null,this.f=[],this.c=null,this.l=[],this.m={},null!=this.i&&(this.i.stop(),this.i=null),this.g.destroy()},n.update=function(){_i(this).catch(function(e){this.b&&this.b.onError(e)}.bind(this))},n.onExpirationUpdated=function(){},n.Nf=function(e,t){if(e.aa=wi(t,e.ka,null),"image"==e.aa.contentType)return null;var r=!1,n=Bn.P(t,"Role"),i=n.map((function(e){return e.getAttribute("value")})).filter(Gt.Ia),o=void 0,a="text"==e.aa.contentType;a&&(o="subtitle");for(var s=0;s<n.length;s++){var l=n[s].getAttribute("schemeIdUri");if(null==l||"urn:mpeg:dash:role:2011"==l)switch(l=n[s].getAttribute("value"),l){case"main":r=!0;break;case"caption":case"subtitle":o=l}}var u=null,c=!1;Bn.P(t,"EssentialProperty").forEach((function(e){"http://dashif.org/guidelines/trickmode"==e.getAttribute("schemeIdUri")?u=e.getAttribute("value"):c=!0})),s=Bn.P(t,"Accessibility");var d=new Map;for(n={},l=(s=f(s)).next();!l.done;n={Ib:n.Ib},l=s.next()){var h=l.value;l=h.getAttribute("schemeIdUri"),h=h.getAttribute("value"),"urn:scte:dash:cc:cea-608:2015"==l||"urn:scte:dash:cc:cea-708:2015"==l?(n.Ib=1,null!=h?h.split(";").forEach(function(e){return function(t){if(t.includes("=")){var r=(t=t.split("="))[0].startsWith("CC")?t[0]:"CC"+t[0];t=t[1].split(",")[0].split(":").pop()}else r="CC"+e.Ib,e.Ib+=2;d.set(r,Ir(t))}}(n)):d.set("CC1","und")):"urn:mpeg:dash:role:2011"==l&&null!=h&&(i.push(h),"captions"==h&&(o="caption"))}if(c)return null;var p=Gn(n=Bn.P(t,"ContentProtection"),this.a.dash.customScheme,this.a.dash.ignoreDrmInfo);if(n=Ir(t.getAttribute("lang")||"und"),s=t.getAttribute("label"),(l=Bn.P(t,"Label"))&&l.length&&(l=l[0]).textContent&&(s=l.textContent),0==(i=(l=Bn.P(t,"Representation")).map(this.Qf.bind(this,e,p,o,n,s,r,i,d)).filter((function(e){return!!e}))).length){if(this.a.dash.ignoreEmptyAdaptationSet||a)return null;throw new me(2,4,4003)}return e.aa.contentType&&"application"!=e.aa.contentType||(e.aa.contentType=xi(i[0].mimeType,i[0].codecs),i.forEach((function(t){t.type=e.aa.contentType}))),i.forEach((function(e){p.drmInfos.forEach((function(t){e.keyId&&t.keyIds.push(e.keyId)}))})),a=l.map((function(e){return e.getAttribute("id")})).filter(Gt.Ia),{id:e.aa.id||"__fake__"+this.h++,contentType:e.aa.contentType,language:n,$c:r,streams:i,drmInfos:p.drmInfos,Bd:u,Yf:a}},n.Qf=function(e,t,r,n,i,o,a,s,l){if(e.C=wi(l,e.aa,null),!function(e){var t=e.Ub?1:0;return t+=e.La?1:0,0==(t+=e.Wb?1:0)?"text"==e.contentType||"application"==e.contentType:(1!=t&&(e.Ub&&(e.La=null),e.Wb=null),!0)}(e.C))return null;e.bandwidth=Bn.I(l,"bandwidth",Bn.tc)||0;var u=e.C.contentType;u="text"==u||"application"==u;try{var c=this.Zf.bind(this);if(e.C.Ub)var d=function(e,t){var r=Number($n(e,di,"presentationTimeOffset"))||0,n=$n(e,di,"timescale"),i=1;n&&(i=Bn.tc(n)||1),r=r/i||0,n=ui(e,di);var o=e.C.contentType;if(i=e.C.mimeType.split("/")[1],"text"!=o&&"mp4"!=i&&"webm"!=i)throw new me(2,4,4006);if("webm"==i&&!n)throw new me(2,4,4005);o=qn(e,di,"RepresentationIndex");var a=$n(e,di,"indexRange"),s=e.C.qa;if(a=Bn.uc(a||""),o){var l=o.getAttribute("sourceURL");l&&(s=Vt(e.C.qa,[l])),a=Bn.I(o,"range",Bn.uc,a)}if(!a)throw new me(2,4,4002);return{createSegmentIndex:(i=ci(e,t,n,s,a.start,a.end,i,r)).createSegmentIndex,findSegmentPosition:i.findSegmentPosition,getSegmentReference:i.getSegmentReference,initSegmentReference:n,ma:r}}(e,c);else if(e.C.La)d=fi(e,this.m);else if(e.C.Wb)d=pi(e,c,this.m,!!this.c);else{var f=e.C.qa,h=e.T.duration||0;d={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(e){return 0<=e&&e<h?1:null},getSegmentReference:function(e){return 1!=e?null:new Zn(1,0,h,(function(){return f}),0,null)},initSegmentReference:null,ma:0}}}catch(e){if(u&&4002==e.code)return null;throw e}return l=function(e,t,r,n){var i=Gn(e,t,n);if(r.Pd)e=1==r.drmInfos.length&&!r.drmInfos[0].keySystem,t=0==i.drmInfos.length,(0==r.drmInfos.length||e&&!t)&&(r.drmInfos=i.drmInfos),r.Pd=!1;else if(0<i.drmInfos.length&&(r.drmInfos=r.drmInfos.filter((function(e){return i.drmInfos.some((function(t){return t.keySystem==e.keySystem}))})),0==r.drmInfos.length))throw new me(2,4,4008);return i.Kd||r.Kd}(l=Bn.P(l,"ContentProtection"),this.a.dash.customScheme,t,this.a.dash.ignoreDrmInfo),{id:this.h++,originalId:e.C.id,createSegmentIndex:d.createSegmentIndex,findSegmentPosition:d.findSegmentPosition,getSegmentReference:d.getSegmentReference,initSegmentReference:d.initSegmentReference,presentationTimeOffset:d.ma,mimeType:e.C.mimeType,codecs:e.C.codecs,frameRate:e.C.frameRate,pixelAspectRatio:e.C.pixelAspectRatio,bandwidth:e.bandwidth,width:e.C.width,height:e.C.height,kind:r,encrypted:0<t.drmInfos.length,keyId:l,language:n,label:i,type:e.aa.contentType,primary:o,trickModeVideo:null,emsgSchemeIdUris:e.C.emsgSchemeIdUris,roles:a,channelsCount:e.C.gd,audioSamplingRate:e.C.audioSamplingRate,closedCaptions:s}},n.Pf=function(e,t,r){var n=Bn.yb,i=r.getAttribute("schemeIdUri")||"",o=r.getAttribute("value")||"",a=Bn.I(r,"timescale",n)||1;Bn.P(r,"Event").forEach(function(r){var s=Bn.I(r,"presentationTime",n)||0,l=Bn.I(r,"duration",n)||0;l=(s=s/a+e)+l/a,null!=t&&(s=Math.min(s,e+t),l=Math.min(l,e+t)),r={schemeIdUri:i,value:o,startTime:s,endTime:l,id:r.getAttribute("id")||"",eventElement:r},this.b.onTimelineRegionAdded(r)}.bind(this))},n.Zf=function(e,t,r){return e=vi(e,t,r,this.a.retryParameters),e=this.b.networkingEngine.request(1,e),Pe(this.g,e),e.promise.then((function(e){return e.data}))},gi.pd("mpd",bi),gi.Cb("application/dash+xml",bi),gi.Cb("video/vnd.mpeg.dash.mpd",bi),Ri.prototype.toString=function(){var e="#"+this.name,t=this.a?this.a.map((function(e){return e.name+"="+(isNaN(Number(e.value))?'"'+e.value+'"':e.value)})):[];return this.value&&t.unshift(this.value),0<t.length&&(e+=":"+t.join(",")),e},Ri.prototype.getAttribute=function(e){var t=this.a.filter((function(t){return t.name==e}));return t.length?t[0]:null};var Ii={nb:function(e,t){return e.filter((function(e){return e.name==t}))},Ta:function(e,t){var r=Ii.nb(e,t);return r.length?r[0]:null},Pc:function(e,t,r){return e.filter((function(e){var n=e.getAttribute("TYPE");return e=e.getAttribute("GROUP-ID"),n.value==t&&e.value==r}))},Hc:function(e,t){return Vt([e],[t])[0]},Yc:function(e){return/^#(?!EXT)/m.test(e)}};function Oi(e){this.b=e,this.a=0}function Di(e){Mi(e,/[ \t]+/gm)}function Mi(e,t){t.lastIndex=e.a;var r=t.exec(e.b);return r=null==r?null:{position:r.index,length:r[0].length,ag:r},e.a==e.b.length||null==r||r.position!=e.a?null:(e.a+=r.length,r.ag)}function Ni(e){return e.a==e.b.length?null:(e=Mi(e,/[^ \t\n]*/gm))?e[0]:null}function Ui(){this.a=0}function Fi(e,t,r){var n=(t=(t=at(t)).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim()).split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(n[0]))throw new me(2,4,4015);t=0;for(var i=1;i<n.length;i++)if(!Ii.Yc(n[i])){var o=Ki(e,n[i]);if(--e.a,Gi.includes(o.name)){t=1;break}"EXT-X-STREAM-INF"==o.name&&(i+=1)}for(i=[],o=1;o<n.length;)if(Ii.Yc(n[o]))o+=1;else{var a=Ki(e,n[o]);if(Vi.includes(a.name)){if(1!=t)throw new me(2,4,4017);return new Ci(r,t,i,e=Bi(e,r,n=n.splice(o,n.length-o),i))}i.push(a),o+=1,"EXT-X-STREAM-INF"==a.name&&(a.a.push(new Li("URI",n[o])),o+=1)}return new Ci(r,t,i)}function Bi(e,t,r,n){var i=[],o=[];return r.forEach((function(r){if(/^(#EXT)/.test(r))r=Ki(e,r),Gi.includes(r.name)?n.push(r):o.push(r);else{if(Ii.Yc(r))return[];r=Ii.Hc(t,r.trim()),i.push(new Pi(r,o)),o=[]}})),i}function Ki(e,t){var r=e.a++,n=t.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!n)throw new me(2,4,4016,t);var i,o=n[1],a=n[2];if(n=[],a){var s;(s=Mi(a=new Oi(a),/^([^,=]+)(?:,|$)/g))&&(i=s[1]);for(var l=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;s=Mi(a,l);)n.push(new Li(s[1],s[2]||s[3]))}return new Ri(r,o,n,i)}var Gi="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-MAP EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST".split(" "),Vi="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE".split(" ");function Hi(e){try{var t=Hi.parse(e);return _e({uri:e,ld:e,data:t.data,headers:{"content-type":t.contentType}})}catch(e){return ve(e)}}function Yi(){var e=this;this.a=this.f=null,this.$=1,this.D=new Map,this.S=new Set,this.b=new Map,this.c=null,this.u="",this.s=new Ui,this.O=0,this.h=new fe((function(){!function(e){p((function t(){var r,n;return M(t,(function(t){switch(t.j){case 1:return e.f?(k(t,2),S(t,e.update(),4)):t.return();case 4:r=e.O,e.h.R(r),C(t,0);break;case 2:if(n=R(t),!e.f)return t.return();n.severity=1,e.f.onError(n),e.h.R(.1),w(t)}}))}))}(e)})),this.g=fo,this.m=null,this.B=0,this.F=1/0,this.i=new je,this.K=[],this.l=new Map,this.W=!1}function zi(e,t){return p((function r(){var n,i,o,a,s,l,u,c,d,f;return M(r,(function(r){switch(r.j){case 1:return n=Ii,i=ho,o=t.Ce,S(r,uo(e,Me([o],e.a.retryParameters),0),2);case 2:if(a=r.o,1!=(s=Fi(e.s,a.data,a.uri)).type)throw new me(2,4,4017);return u=(l=n.Ta(s.a,"EXT-X-MEDIA-SEQUENCE"))?Number(l.value):0,c=t.stream,S(r,eo(e,t.Bc,s,u,c.mimeType,c.codecs),3);case 3:d=r.o,t.Vb.a=d,f=d[d.length-1],n.Ta(s.a,"EXT-X-ENDLIST")&&(lo(e,i.Qa),e.c.xa(f.endTime)),w(r)}}))}))}function Wi(e){e.forEach((function(e){if(e){var t=e.stream.codecs.split(",");t=t.filter((function(e){return"mp4a.40.34"!=e})),e.stream.codecs=t.join(",")}}))}function $i(e,t,r,n,i){return{id:e.$++,language:t?t.language:"und",primary:!!t&&t.primary||!!r&&r.primary,audio:t,video:r,bandwidth:n,drmInfos:i,allowedByApplication:!0,allowedByKeySystem:!0}}function qi(e,t,r){return p((function n(){var i,o,a,s,l,u,c,d,f;return M(n,(function(n){switch(n.j){case 1:if(i=no(t,"URI"),e.b.has(i))return n.return(e.b.get(i));if(o=no(t,"TYPE").toLowerCase(),a=Yt,"subtitles"==o&&(o=a.ra),s=Ir(ji(t,"LANGUAGE","und")),l=ji(t,"NAME"),u=t.getAttribute("DEFAULT"),c=t.getAttribute("AUTOSELECT"),d=ji(t,"CHANNELS"),"audio"==o)if(d){var h=d.split("/")[0];h=parseInt(h,10)}else h=null;else h=null;return S(n,Xi(e,i,r,o,s,!!u||!!c,l,h,null),2);case 2:return f=n.o,e.b.has(i)?n.return(e.b.get(i)):null==f?n.return(null):(e.D.set(t.id,f),e.b.set(i,f),n.return(f))}}))}))}function Xi(e,t,r,n,i,o,a,s,l){return p((function u(){var c,d,h,m,g,y,v,b,_,A,E,T,w,x,L,j,P,I,O,D,N,U,F,B,K,G;return M(u,(function(u){switch(u.j){case 1:return d=(c=Ii).Hc(e.u,t),S(u,uo(e,Me([d],e.a.retryParameters),0),2);case 2:if(h=u.o,d=h.uri,1!=(m=Fi(e.s,h.data,d)).type)throw new me(2,4,4017);g=[],m.segments.forEach((function(e){e=c.nb(e.b,"EXT-X-KEY"),g.push.apply(g,e)})),y=!1,v=[],b=null;for(var V=f(g),H=V.next();!H.done;H=V.next())if(_=H.value,"NONE"!=(A=no(_,"METHOD"))){if(y=!0,"AES-128"==A)return e.W=!0,u.return(null);E=no(_,"KEYFORMAT"),(w=(T=co[E])?T(_):null)&&(w.keyIds.length&&(b=w.keyIds[0]),v.push(w))}if(y&&!v.length)throw new me(2,4,4026);return function(e,t){var r=ho,n=Ii.Ta(t.a,"EXT-X-PLAYLIST-TYPE"),i=Ii.Ta(t.a,"EXT-X-ENDLIST");i=n&&"VOD"==n.value||i,n=n&&"EVENT"==n.value&&!i,n=!i&&!n,i?lo(e,r.Qa):(lo(e,n?r.Fd:r.xe),r=io(t.a,"EXT-X-TARGETDURATION"),r=Number(r.value),e.B=Math.max(r,e.B),e.F=Math.min(r,e.F))}(e,m),x=function(e,t){if(1==t.length)return t[0];var r=ro(e,t);if(null!=r)return r;throw new me(2,4,4025,t)}(n,r),S(u,function(e,t,r,n){return p((function i(){var o,a,s,l,u,c,d,f,h;return M(i,(function(i){switch(i.j){case 1:return o=Yt,a=n.segments[0].a,s=new Z(a),l=s.ja.split(".").pop(),u=so[t],(c=u[l])?i.return(c):t==o.ra?r&&"vtt"!=r?i.return("application/mp4"):i.return("text/vtt"):((d=Me([a],e.a.retryParameters)).method="HEAD",S(i,uo(e,d,1),2));case 2:if(f=i.o,!(h=f.headers["content-type"]))throw new me(2,4,4021,l);return i.return(h.split(";")[0])}}))}))}(e,n,x,m),3);case 3:return L=u.o,ao.includes(L)&&(x=""),P=(j=c.Ta(m.a,"EXT-X-MEDIA-SEQUENCE"))?Number(j.value):0,k(u,4),S(u,eo(e,t,m,P,L,x),6);case 6:I=u.o,C(u,5);break;case 4:if(4035==(O=R(u)).code)return q("Skipping unsupported HLS stream",L,t),u.return(null);throw O;case 5:return D=I[0].startTime,N=I[I.length-1].endTime,U=N-D,F=new ei(I),B=Ji(m),K=void 0,"text"==n&&(K="subtitle"),G={id:e.$++,originalId:a,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:F.find.bind(F),getSegmentReference:F.get.bind(F),initSegmentReference:B,presentationTimeOffset:0,mimeType:L,codecs:x,kind:K,encrypted:y,keyId:b,language:i,label:a,type:n,primary:o,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:[],channelsCount:s,audioSamplingRate:null,closedCaptions:l},u.return({stream:G,Vb:F,drmInfos:v,Bc:t,Ce:d,dd:D,Hg:N,duration:U})}}))}))}function Ji(e){var t=Ii.nb(e.a,"EXT-X-MAP");if(!t.length)return null;if(1<t.length)throw new me(2,4,4020);var r=no(t=t[0],"URI"),n=Ii.Hc(e.b,r);return e=0,r=null,(t=ji(t,"BYTERANGE"))&&(e=t.split("@"),t=Number(e[0]),r=(e=Number(e[1]))+t-1),new Jn((function(){return[n]}),e,r)}function Zi(e,t,r,n){var i=t.b,o=t.a;t=io(i,"EXTINF").value.split(","),t=n+Number(t[0]);var a=0,s=null;return(i=Ii.Ta(i,"EXT-X-BYTERANGE"))&&(a=i.value.split("@"),i=Number(a[0]),s=(a=a[1]?Number(a[1]):e.a+1)+i-1),new Zn(r,n,t,(function(){return[o]}),a,s)}function Qi(e){e.c&&(e.K.forEach((function(t){e.c.vb(t,0)})),e.K=[])}function eo(e,t,r,n,i,o){return p((function a(){var s,l,u,c,d,f,h,m,g,y;return M(a,(function(a){switch(a.j){case 1:return s=r.segments,l=[],u=s[0].a,c=Zi(null,s[0],n,0),d=Ji(r),S(a,function(e,t,r,n,i,o){return p((function a(){var s,l,u,c,d,f,h,p,m;return M(a,(function(a){switch(a.j){case 1:if(e.m&&(s=e.b.get(t),l=s.Vb,u=l.get(n.position)))return a.return(u.startTime);if(i=i.toLowerCase(),ao.includes(i))throw q("Raw formats are not yet supported. Skipping "+i),new me(1,4,4035);if("video/webm"==i)throw q("WebM in HLS is not yet supported. Skipping."),new me(1,4,4035);if("video/mp4"!=i&&"audio/mp4"!=i){a.A(2);break}return c=[to(e,n)],r&&c.push(to(e,r)),S(a,Promise.all(c),3);case 3:return d=a.o,f=d[0],h=d[1]||d[0],a.return(function(e,t,r,n){var i=0;if((new In).H("moov",On).H("trak",On).H("mdia",On).fa("mdhd",(function(e){e.reader.M(0==e.version?8:16),i=e.reader.G(),e.parser.stop()})).parse(n,!0),!i)throw new me(2,4,4030,e,t);var o=0,a=!1;if((new In).H("moof",On).H("traf",On).fa("tfdt",(function(e){o=(0==e.version?e.reader.G():e.reader.Bb())/i,a=!0,e.parser.stop()})).parse(r,!0),!a)throw new me(2,4,4030,e,t);return o}(t,f.uri,f.data,h.data));case 2:if("video/mp2t"!=i){a.A(4);break}return S(a,to(e,n),5);case 5:return p=a.o,a.return(function(e,t,r){function n(){throw new me(2,4,4030,e,t)}r=new Ln(new DataView(r),0);for(var i=0,o=0;;){if(i=r.ca(),71!=(o=r.la())&&n(),16384&r.Tb()||n(),0!=(o=(48&r.la())>>4)&&2!=o||n(),3==o&&(o=r.la(),r.M(o)),1==r.G()>>8)return r.M(3),0!=(i=r.la()>>6)&&1!=i||n(),0==r.la()&&n(),i=r.la(),o=r.Tb(),r=r.Tb(),(1073741824*((14&i)>>1)+((65534&o)<<14|(65534&r)>>1))/9e4;r.seek(i+188),71!=(o=r.la())&&(r.seek(i+192),o=r.la()),71!=o&&(r.seek(i+204),o=r.la()),71!=o&&n(),r.me(1)}}(t,p.uri,p.data));case 4:if("application/mp4"!=i&&!i.startsWith("text/")){a.A(6);break}return S(a,to(e,n),7);case 7:return m=a.o,a.return(function(e,t,r){return pr(e=qe(e,t))?(mr(t=new fr(null),e),t.kc(r)):0}(i,o,m.data));case 6:throw new me(2,4,4030,t)}}))}))}(e,t,d,c,i,o),2);case 2:f=a.o,u.split("/").pop();for(var v=0;v<s.length;++v)h=s[v],m=l[l.length-1],g=0==v?f:m.endTime,y=Zi(m,h,n+v,g),l.push(y);return e.K.push(l),Qi(e),a.return(l)}}))}))}function to(e,t){return p((function r(){var n,i,o,a,s,l;return M(r,(function(r){switch(r.j){case 1:return n=1,i=vi(t.c(),t.b,t.b+2048-1,e.a.retryParameters),o=vi(t.c(),t.b,t.a,e.a.retryParameters),k(r,2),S(r,uo(e,i,n),4);case 4:return a=r.o,r.return(a);case 2:if(7001==(s=R(r)).code)throw s;return q("Unable to fetch a partial HLS segment! Falling back to a full segment request, which is expensive! Your server should support Range requests and CORS preflights.",i.uris[0]),S(r,uo(e,o,n),5);case 5:return l=r.o,r.return(l)}}))}))}function ro(e,t){for(var r=oo[e],n=0;n<r.length;n++)for(var i=0;i<t.length;i++)if(r[n].test(t[i].trim()))return t[i].trim();return"text"==e?"":null}function no(e,t){var r=e.getAttribute(t);if(!r)throw new me(2,4,4023,t);return r.value}function io(e,t){var r=Ii.Ta(e,t);if(!r)throw new me(2,4,4024,t);return r}G("shaka.net.DataUriPlugin",Hi),Hi.parse=function(t){var r=t.split(":");if(2>r.length||"data"!=r[0])throw new me(2,1,1004,t);if(2>(r=r.slice(1).join(":").split(",")).length)throw new me(2,1,1004,t);var n=r[0];r=e.decodeURIComponent(r.slice(1).join(","));var i=null;if(1<(n=n.split(";")).length&&(i=n[1]),"base64"==i)t=ht.Ba(r).buffer;else{if(i)throw new me(2,1,1005,t);t=ut(r)}return{data:t,contentType:n[0]}},De("data",Hi),G("shaka.hls.HlsParser",Yi),(n=Yi.prototype).configure=function(e){this.a=e},n.start=function(e,t){var r=this;return p((function n(){var i,o;return M(n,(function(n){switch(n.j){case 1:return r.f=t,S(n,uo(r,Me([e],r.a.retryParameters),0),2);case 2:return i=n.o,r.u=i.uri,S(n,function(e,t){return p((function r(){var n,i,o,a,s,l,u,c,d,h,m;return M(r,(function(r){switch(r.j){case 1:if(0!=(n=Fi(e.s,t,e.u)).type)throw new me(2,4,4022);return S(r,function(e,t){return p((function r(){var n,i,o,a,s,l,u,c,d,h,m,g;return M(r,(function(r){switch(r.j){case 1:return n=Ii,i=Gt,o=t.a,a=n.nb(t.a,"EXT-X-MEDIA"),s=a.filter(function(e){return"SUBTITLES"==no(e,"TYPE")}.bind(e)),l=s.map(function(e){var t=this;return p((function r(){var n;return M(r,(function(r){switch(r.j){case 1:return t.a.disableText?r.return(null):(k(r,2),S(r,function(e,t){return p((function r(){var n;return M(r,(function(r){switch(r.j){case 1:return no(t,"TYPE"),S(r,qi(e,t,[]),2);case 2:return n=r.o,r.return(n.stream)}}))}))}(t,e),4));case 4:return r.return(r.o);case 2:if(n=R(r),t.a.hls.ignoreTextStreamFailures)return r.return(null);throw n}}))}))}.bind(e)),u=a.filter((function(e){return"CLOSED-CAPTIONS"==no(e,"TYPE")})),function(e,t){for(var r=f(t),n=r.next();!n.done;n=r.next()){no(n=n.value,"TYPE");var i=ji(n,"LANGUAGE")||"und";i=Ir(i);var o=no(n,"GROUP-ID");n=no(n,"INSTREAM-ID"),e.l.get(o)||e.l.set(o,new Map),e.l.get(o).set(n,i)}}(e,u),S(r,Promise.all(l),2);case 2:return c=r.o,d=n.nb(o,"EXT-X-STREAM-INF"),h=d.map(function(e){return function(e,t,r){return p((function n(){var i,o,a,s,l,u,c,d,h,m,g,y,v,b,_,A,E,T,w,k,x,C,R,L,j,P,I;return M(n,(function(n){switch(n.j){case 1:return i=Yt,o=Ii,a=ji(t,"CODECS","avc1.42E01E,mp4a.40.2"),s=function(e){for(var t=new Set,r=[],n=(e=f(e)).next();!n.done;n=e.next()){var i=Xe(n=n.value)[0];t.has(i)||(r.push(n),t.add(i))}return r}(a.split(/\s*,\s*/)),l=t.getAttribute("RESOLUTION"),c=u=null,d=ji(t,"FRAME-RATE"),h=Number(no(t,"BANDWIDTH")),l&&(m=l.value.split("x"),u=m[0],c=m[1]),g=(g=(g=o.nb(r.a,"EXT-X-MEDIA")).filter((function(e){return"CLOSED-CAPTIONS"!=no(e,"TYPE")}))).filter((function(e){var t=ji(e,"URI")||"";return"SUBTITLES"==(ji(e,"TYPE")||"")||""!=t})),y=ji(t,"AUDIO"),v=ji(t,"VIDEO"),y?g=o.Pc(g,"AUDIO",y):v&&(g=o.Pc(g,"VIDEO",v)),(b=ro(i.ra,s))&&((_=ji(t,"SUBTITLES"))&&(A=o.Pc(g,"SUBTITLES",_)).length&&(E=e.D.get(A[0].id))&&(E.stream.codecs=b),Re(s,b)),T=g.map(function(e){return qi(this,e,s)}.bind(e)),w=[],k=[],S(n,Promise.all(T),2);case 2:if(C=(C=n.o).filter((function(e){return null!=e})),y?w=C:v&&(k=C),L=!1,w.length||k.length?w.length?(P=no(t,"URI"),I=w[0].Bc,P==I?(R=i.Eb,L=!0):R=i.Pa):R=i.Eb:1==s.length?(j=ro(i.Pa,s),R=l||d||j?i.Pa:i.Eb):(R=i.Pa,s=[s.join(",")]),L){n.A(3);break}return S(n,function(e,t,r,n){return p((function i(){var o,a,s,l,u;return M(i,(function(i){switch(i.j){case 1:return o=Yt,a=no(t,"URI"),e.b.has(a)?i.return(e.b.get(a)):(s=ji(t,"CLOSED-CAPTIONS"),l=null,n==o.Pa&&s&&"NONE"!=s&&(l=e.l.get(s)),S(i,Xi(e,a,r,n,"und",!1,null,null,l),2));case 2:return null==(u=i.o)?i.return(null):e.b.has(a)?i.return(e.b.get(a)):(e.b.set(a,u),i.return(u))}}))}))}(e,t,s,R),4);case 4:x=n.o;case 3:if(x)x.stream.type==i.Eb?w=[x]:k=[x];else if(null===x)return n.return([]);return k&&Wi(k),w&&Wi(w),n.return(function(e,t,r,n,i,o,a){r.forEach(function(e){(e=e.stream)&&(e.width=Number(i)||void 0,e.height=Number(o)||void 0,e.frameRate=Number(a)||void 0)}.bind(e));var s=!!e.a&&e.a.disableAudio;t.length&&!s||(t=[null]),s=!!e.a&&e.a.disableVideo,(!r.length||s)&&(r=[null]),s=[];for(var l=(t=f(t)).next();!l.done;l=t.next()){l=l.value;for(var u=f(r),c=u.next();!c.done;c=u.next()){var d=c.value;c=l?l.stream:null;var h=d?d.stream:null,p=l?l.drmInfos:null,m=d?d.drmInfos:null;d=(d?d.Bc:"")+" - "+(l?l.Bc:"");var g=void 0;if(c&&h){if(p.length&&m.length&&!(0<Lt(p,m).length))continue;g=Lt(p,m)}else c?g=p:h&&(g=m);e.S.has(d)||(c=$i(e,c,h,n,g),s.push(c),e.S.add(d))}}return s}(e,w,k,h,u,c,d))}}))}))}(this,e,t)}.bind(e)),S(r,Promise.all(h),3);case 3:return m=r.o,g=(g=m.reduce(i.Gc,[])).filter((function(e){return null!=e})),r.return({startTime:0,variants:g,textStreams:c.filter((function(e){return null!=e}))})}}))}))}(e,n),2);case 2:if(i=r.o,!e.f)throw new me(2,7,7001);if(e.W&&0==i.variants.length)throw new me(2,4,4034);e.f.filterAllPeriods([i]),o=1/0,a=0,s=1/0;for(var g=f(e.b.values()),y=g.next();!y.done;y=g.next())l=y.value,o=Math.min(o,l.dd),a=Math.max(a,l.dd),"text"!=l.stream.type&&(s=Math.min(s,l.duration));if(e.g!=ho.Qa?(e.c=new yi(0,3*e.B),e.c.Xb(!1)):(e.c=new yi(null,0),e.c.Xb(!0)),Qi(e),e.g!=ho.Qa){for(e.O=e.F,u=ho,e.g==u.Fd&&(c=e.c.vc,isNaN(e.a.availabilityWindowOverride)||(c=e.a.availabilityWindowOverride),e.c.xd(c)),d=0;95443.7176888889<=a;)d+=95443.7176888889,a-=95443.7176888889;if(d)for(y=(g=f(e.b.values())).next();!y.done;y=g.next())95443.7176888889>(h=y.value).dd&&(h.stream.presentationTimeOffset=-d,h.Vb.offset(d))}else for(e.c.xa(s),e.c.offset(-o),y=(g=f(e.b.values())).next();!y.done;y=g.next())(m=y.value).stream.presentationTimeOffset=o,m.Vb.offset(-o),ti(m.Vb,s);e.m={presentationTimeline:e.c,periods:[i],offlineSessionIds:[],minBufferTime:0},w(r)}}))}))}(r,i.data),3);case 3:return 0<(o=r.O)&&r.h.R(o),n.return(r.m)}}))}))},n.stop=function(){this.h&&(this.h.stop(),this.h=null);var e=[];return this.i&&(e.push(this.i.destroy()),this.i=null),this.a=this.f=null,this.D.clear(),this.S.clear(),this.b.clear(),this.m=null,Promise.all(e)},n.update=function(){if(this.g!=ho.Qa){for(var e=[],t=f(this.b.values()),r=t.next();!r.done;r=t.next())e.push(zi(this,r.value));return Promise.all(e)}},n.onExpirationUpdated=function(){};var oo={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/],text:[/^vtt$/,/^wvtt/,/^stpp/]},ao=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"],so={audio:{mp4:"audio/mp4",m4s:"audio/mp4",m4i:"audio/mp4",m4a:"audio/mp4",ts:"video/mp2t",aac:"audio/aac",ac3:"audio/ac3",ec3:"audio/ec3",mp3:"audio/mpeg"},video:{mp4:"video/mp4",m4s:"video/mp4",m4i:"video/mp4",m4v:"video/mp4",ts:"video/mp2t"},text:{mp4:"application/mp4",m4s:"application/mp4",m4i:"application/mp4",vtt:"text/vtt",ttml:"application/ttml+xml"}};function lo(e,t){e.g=t,e.c&&e.c.Xb(e.g==ho.Qa),e.g!=ho.Qa||e.h.stop()}function uo(e,t,r){if(!e.i)throw new me(2,7,7001);return t=e.f.networkingEngine.request(r,t),Pe(e.i,t),t.promise}var co={"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(e){var t=no(e,"METHOD");return Kr("HLS SAMPLE-AES-CENC","SAMPLE-AES-CENC will no longer be supported, see Issue #1227"),["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].includes(t)?(t=no(e,"URI"),t=Hi.parse(t),t=Ht("com.widevine.alpha",[{initDataType:"cenc",initData:t=new Uint8Array(t.data)}]),(e=ji(e,"KEYID"))&&(t.keyIds=[e.substr(2).toLowerCase()]),t):null}},fo="VOD",ho={Qa:fo,xe:"EVENT",Fd:"LIVE"};function po(){this.a=new Map}function mo(e,t,r){go(e,t).text=r}function go(e,t){return e.a.has(t)||e.a.set(t,new yo),e.a.get(t)}function yo(){this.text=this.variant=null}function vo(e,t){this.a=e,this.b=new Set([e]);for(var r=f(t=t||[]),n=r.next();!n.done;n=r.next())this.add(n.value)}function bo(e,t){var r;if(!(r=!!e.audio!=!!t.audio||!!e.video!=!!t.video||e.language!=t.language)&&(r=e.audio&&t.audio)){r=e.audio;var n=t.audio;r=!(r.channelsCount==n.channelsCount&&_o(r,n)&&Ao(r.roles,n.roles))}return!r&&(r=e.video&&t.video)&&(r=!(_o(r=e.video,n=t.video)&&Ao(r.roles,n.roles))),!r}function _o(e,t){if(e.mimeType!=t.mimeType)return!1;var r=e.codecs.split(",").map((function(e){return Xe(e)[0]})),n=t.codecs.split(",").map((function(e){return Xe(e)[0]}));if(r.length!=n.length)return!1;r.sort(),n.sort();for(var i=0;i<r.length;i++)if(r[i]!=n[i])return!1;return!0}function Ao(e,t){var r=new Set(e),n=new Set(t);if(r.delete("main"),n.delete("main"),r.size!=n.size)return!1;for(var i=(r=f(r)).next();!i.done;i=r.next())if(!n.has(i.value))return!1;return!0}function Eo(e){this.a=e,this.b=new To(e.language,"",e.audio&&e.audio.channelsCount?e.audio.channelsCount:0,"")}function To(e,t,r,n,i){this.f=e,this.c=t,this.a=r,this.b=void 0===n?"":n,this.g=void 0===i?"":i}function So(){this.a=xo,this.b=(new Map).set(xo,2).set(ko,1)}function wo(e,t,r){e.b.set(xo,r).set(ko,t)}gi.pd("m3u8",Yi),gi.Cb("application/x-mpegurl",Yi),gi.Cb("application/vnd.apple.mpegurl",Yi),vo.prototype.add=function(e){return!!bo(this.a,e)&&(this.b.add(e),!0)},vo.prototype.values=function(){return this.b.values()},Eo.prototype.create=function(e){var t=this,r=e.filter((function(e){return bo(t.a,e)}));return r.length?new vo(r[0],r):this.b.create(e)},To.prototype.create=function(e){var t=[];t=function(e,t){var r=Dr(Ir(t),e.map((function(e){return Or(e)})));return r?e.filter((function(e){return r==Or(e)})):[]}(e,this.f);var r=e.filter((function(e){return e.primary}));for(t=t.length?t:r.length?r:e,this.c&&(e=function(e,t,r){return e.filter((function(e){if(r){var n=e[r];return n&&n.roles.includes(t)}return n=e.audio,e=e.video,n&&0<=n.roles.indexOf(t)||e&&0<=e.roles.indexOf(t)}))}(t,this.c,this.g)).length&&(t=e),this.a&&(e=Nr.Nd(t,this.a)).length&&(t=e),this.b&&(e=function(e,t){return e.filter((function(e){return!!e.audio&&e.audio.label.toLowerCase()==t.toLowerCase()}))}(t,this.b)).length&&(t=e),e=new vo(t[0]),r=(t=f(t)).next();!r.done;r=t.next())r=r.value,bo(e.a,r)&&e.add(r);return e};var ko=0,xo=1;function Co(e,t){this.g=e,this.h=Lo(e),this.a=e.a.currentTime,this.f=Date.now()/1e3,this.b=!1,this.i=t,this.c=function(){}}function Ro(e){this.a=e}function Lo(e){if(e.a.paused||0==e.a.playbackRate||null==e.a.buffered)var t=!1;else e:{t=e.a.buffered,e=e.a.currentTime;for(var r=0;r<t.length;r++){var n=t.start(r),i=t.end(r);if(!(e<n||e>i-.5)){t=!0;break e}}t=!1}return t}function jo(e,t,r,n,i){var o=this;this.a=e,this.u=t,this.s=r,this.l=i,this.f=new Be,this.i=!1,this.m=e.readyState,this.c=!1,this.b=n,this.h=!1,this.f.w(e,"waiting",(function(){return Po(o)})),this.g=new fe((function(){Po(o)})).Na(.25)}function Po(e){if(0!=e.a.readyState){if(e.a.seeking){if(!e.i)return}else e.i=!1;if(!e.a.paused){e.a.readyState!=e.m&&(e.c=!1,e.m=e.a.readyState);var t=e.s.smallGapLimit,r=e.a.currentTime,n=e.a.buffered;e:{if(n&&n.length&&!(1==n.length&&1e-6>n.end(0)-n.start(0)))for(var i=rt("Edge/")||rt("Trident/")||rt("Tizen")||rt("CrKey")?.5:.1,o=0;o<n.length;o++)if(n.start(o)>r&&(0==o||n.end(o-1)-r<=i)){i=o;break e}i=null}if(null==i)e.b&&(r=Lo(n=(e=e.b).g),i=n.a.currentTime,o=Date.now()/1e3,e.a==i&&e.h==r||(e.f=o,e.a=i,e.h=r,e.b=!1),(i=o-e.f)>=e.i&&r&&!e.b&&(e.c(e.a,i),e.b=!0,e.a=n.a.currentTime));else if(0!=i||e.h){o=n.start(i);var a=e.u.Ca();if(!(o>=a)){t=(a=o-r)<=t;var s=!1;.001>a||(t||e.c||(e.c=!0,(r=new Se("largegap",{currentTime:r,gapSize:a})).cancelable=!0,e.l(r),e.s.jumpLargeGaps&&!r.defaultPrevented&&(s=!0)),!t&&!s)||(0!=i&&n.end(i-1),e.a.currentTime=o)}}}}}function Io(e){var t=this;this.c=e,this.a=new Set,this.b=new fe((function(){Oo(t,!1)})).Na(.25)}function Oo(e,t){for(var r=f(e.a),n=r.next();!n.done;n=r.next())n.value.g(e.c.currentTime,t)}function Do(e){for(var t=[],r=(e=f(e)).next();!r.done;r=e.next())for(var n=(r=f(r.value.variants)).next();!n.done;n=r.next())t.push(n.value);return t}function Mo(e,t){for(var r=null,n=f(e),i=n.next();!i.done;i=n.next())t>=(i=i.value).startTime&&(r=i);return r}function No(e){this.c=e,this.a=null,this.b=function(){}}function Uo(e){var t=this;this.a=e,this.f=!1,this.c=this.a.jc(),this.b=new fe((function(){t.a.Yd(.25*t.c)}))}function Fo(e){e.b.stop();var t=e.f?0:e.c;if(0<=t)try{return void(e.a.jc()!=t&&e.a.wd(t))}catch(e){}e.b.Na(.25),0!=e.a.jc()&&e.a.wd(0)}function Bo(e,t,r){this.a=e,this.f=t,this.g=r,this.h=!1,this.b=new Be,this.c=new Yo(e),0<e.readyState?Vo(this,r):Go(this,r)}function Ko(e){return e.h?e.a.currentTime:e.g}function Go(e,t){e.g=t,e.b.ea(e.a,"loadedmetadata"),e.b.da(e.a,"loadedmetadata",(function(){Vo(e,t)}))}function Vo(e,t){.001>Math.abs(e.a.currentTime-t)?Ho(e):(e.b.da(e.a,"seeking",(function(){Ho(e)})),zo(e.c,0==e.a.currentTime?t:e.a.currentTime))}function Ho(e){e.h=!0,e.b.w(e.a,"seeking",(function(){return e.f()}))}function Yo(e){var t=this;this.b=e,this.h=10,this.g=this.f=this.c=0,this.a=new fe((function(){0>=t.c||t.b.currentTime!=t.f?t.a.stop():(t.b.currentTime=t.g,t.c--)}))}function zo(e,t){e.f=e.b.currentTime,e.g=t,e.c=e.h,e.b.currentTime=t,e.a.Na(.1)}function Wo(e){function t(){null==r.c?r.f=!0:(r.b.da(r.a,"seeking",(function(){r.f=!0})),r.a.currentTime=Math.max(0,r.a.currentTime+r.c))}var r=this;this.a=e,this.f=!1,this.c=null,this.b=new Be,0==this.a.readyState?this.b.da(this.a,"loadeddata",t):t()}function $o(e,t,r,n,i,o){var a=this;this.b=e,this.a=t.presentationTimeline,this.B=t.minBufferTime||0,this.g=r,this.u=i,this.l=null,this.f=new jo(e,t.presentationTimeline,r,function(e,t){if(!t.stallEnabled)return null;var r=t.stallSkip,n=new Co(new Ro(e),t.stallThreshold);return function(e,t){e.c=t}(n,(function(){e.currentTime+=r})),n}(e,r),o),this.c=new Bo(e,(function(){var e=a.f;e.i=!0,e.h=!1,e.c=!1;var t=Ko(a.c);return e=Xo(a,t),.001<Math.abs(e-t)&&(t=(new Date).getTime()/1e3,!a.l||a.l<t-1)?(a.l=t,0<(t=a.c).a.readyState?zo(t.c,e):Go(t,e),e=void 0):(a.u(),e=void 0),e}),function(e,t){return null==t?t=1/0>e.a.Y()?e.a.ob():e.a.Ca():0>t&&(t=e.a.Ca()+t),qo(e,Jo(e,t))}(this,n)),this.i=new fe((function(){if(0!=a.b.readyState&&!a.b.paused){var e=a.b.currentTime,t=a.a.ob(),r=a.a.Ca();3>r-t&&(t=r-3),e<t&&(e=Xo(a,e),a.b.currentTime=e)}})).Na(.25)}function qo(e,t){var r=e.a.Y();return t>=r?r-e.g.durationBackoff:t}function Xo(e,t){var r=Ft.bind(null,e.b.buffered),n=Math.max(e.B,e.g.rebufferingGoal),i=e.g.safeSeekOffset,o=e.a.ob(),a=e.a.Ca(),s=e.a.Y();3>a-o&&(o=a-3);var l=e.a.Nb(n),u=e.a.Nb(i);return n=e.a.Nb(n+i),t>=s?qo(e,t):t>a?a:t<o?r(u)?u:n:t>=l||r(t)?t:n}function Jo(e,t){var r=e.a.ob();return t<r||t>(r=e.a.Ca())?r:t}function Zo(){this.b=function(){},this.a=new Set}function Qo(e){var t=this;this.h=e,this.f=new Map,this.a=function(){},this.b=function(){},this.c=function(){},this.i=[{eb:null,cb:ta,Wa:function(e,r){return t.a(e,r)}},{eb:ea,cb:ta,Wa:function(e,r){return t.a(e,r)}},{eb:ra,cb:ta,Wa:function(e,r){return t.a(e,r)}},{eb:ta,cb:ea,Wa:function(e,r){return t.b(e,r)}},{eb:ta,cb:ra,Wa:function(e,r){return t.b(e,r)}},{eb:ea,cb:ra,Wa:function(e,r){return t.c(e,r)}},{eb:ra,cb:ea,Wa:function(e,r){return t.c(e,r)}}]}Co.prototype.release=function(){this.g=null,this.c=function(){}},jo.prototype.release=function(){this.f&&(this.f.release(),this.f=null),null!=this.g&&(this.g.stop(),this.g=null),this.b&&(this.b.release(),this.b=null),this.a=this.u=this.l=null},jo.prototype.jd=function(){this.h=!0,Po(this)},Io.prototype.release=function(){this.b.stop();for(var e=f(this.a),t=e.next();!t.done;t=e.next())t.value.release();this.a.clear()},No.prototype.release=function(){this.a=this.c=null,this.b=function(){}},No.prototype.g=function(e){var t=this.a,r=this.c.periods;t!=(e=Mo(r,e)||r[0])&&this.b(e),this.a=e},Uo.prototype.release=function(){this.b&&(this.b.stop(),this.b=null),this.a=null},Uo.prototype.set=function(e){this.c=e,Fo(this)},Bo.prototype.release=function(){this.b&&(this.b.release(),this.b=null),null!=this.c&&(this.c.release(),this.c=null),this.f=function(){},this.a=null},Yo.prototype.release=function(){this.a&&(this.a.stop(),this.a=null),this.b=null},Wo.prototype.release=function(){this.b&&(this.b.release(),this.b=null),this.a=null},Wo.prototype.m=function(e){this.c=this.f?this.c:e},Wo.prototype.h=function(){return(this.f?this.a.currentTime:this.c)||0},Wo.prototype.s=function(){},$o.prototype.release=function(){this.c&&(this.c.release(),this.c=null),this.f&&(this.f.release(),this.f=null),this.i&&(this.i.stop(),this.i=null),this.b=this.c=this.a=this.g=null,this.u=function(){}},$o.prototype.m=function(e){var t=this.c;0<t.a.readyState?zo(t.c,e):Go(t,e)},$o.prototype.h=function(){var e=Ko(this.c);return 0<this.b.readyState&&!this.b.paused?Jo(this,e):e},$o.prototype.s=function(){this.f.jd()},Zo.prototype.release=function(){this.b=function(){},this.a.clear()},Qo.prototype.release=function(){this.h=null,this.f.clear(),this.a=function(){},this.b=function(){},this.c=function(){}},Qo.prototype.g=function(e,t){for(var r=f(this.h.a),n=r.next();!n.done;n=r.next()){n=n.value;var i=this.f.get(n),o=e<n.startTime?ea:e>n.endTime?ra:ta;this.f.set(n,o);for(var a=f(this.i),s=a.next();!s.done;s=a.next())(s=s.value).eb==i&&s.cb==o&&s.Wa(n,t)}};var ea=1,ta=2,ra=3;function na(e,t){this.a=t,this.c=e,this.g=null,this.l=1,this.u=Promise.resolve(),this.h=[],this.i=new Map,this.b=new Map,this.s=!1,this.F=null,this.D=this.f=this.m=!1,this.B=0}function ia(e){return aa(e,"audio")}function oa(e){return aa(e,"video")}function aa(e,t){var r=e.b.get(t);return r?r.Ka||r.stream:null}function sa(e,t){return p((function r(){var n,i,o,a,s,l,u,c,d;return M(r,(function(r){switch(r.j){case 1:return n=Yt,S(r,xr(e.a.L,n.ra),2);case 2:return e.B++,e.D=!1,i=e.B,o=e.a.L,a=new Map,s=new Set,a.set(n.ra,t),s.add(t),S(r,o.init(a,!1),3);case 3:return e.f?r.return():S(r,ma(e,s),4);case 4:if(e.f)return r.return();l=e.a.L.g.isTextVisible()||e.g.alwaysStreamText,e.B!=i||e.b.has(n.ra)||e.D||!l||(u=e.a.Ua(),c=Ea(e,u),d=ha(t,c,0),e.b.set(n.ra,d),ka(e,d,0)),w(r)}}))}))}function la(e,t){var r=e.b.get("video");if(r){var n=r.stream;if(n)if(t){var i=n.trickModeVideo;i&&!r.Ka&&(ca(e,i,!1,0,!1),r.Ka=n)}else(n=r.Ka)&&(r.Ka=null,ca(e,n,!0,0,!1))}}function ua(e,t,r,n){var i=!1;if(t.video){var o=ca(e,t.video,r,n,!1);i=i||o}return t.audio&&(e=ca(e,t.audio,r,n,!1),i=i||e),i}function ca(e,t,r,n,i){var o=e.b.get(t.type);if(!o&&"text"==t.type&&e.g.ignoreTextStreamFailures)return sa(e,t),!0;if(!o)return!1;var a=Ta(e,t),s=Array.from(e.b.values()).every((function(e){return e.ia==o.ia}));return r&&a!=o.ia&&s?(e.b.forEach((function(t){da(e,t)})),!0):(o.Ka&&(t.trickModeVideo?(o.Ka=t,t=t.trickModeVideo):o.Ka=null),!(!(s=e.h[a])||!s.Db||!(s=e.i.get(t.id))||!s.Db||o.stream==t&&!i||("text"==t.type&&_r(e.a.L,qe(t.mimeType,t.codecs)),o.stream=t,o.nc=!0,function(e,t,r){if(!t.Rb)return!1;var n=e.a.Ua(),i=Tr(e.a.L,t.type),o=va(e,t,n,i,r);return r=o&&o.a?o.a-o.b:null,o&&!r&&(r=(o.endTime-o.kc())*t.stream.bandwidth/8),!isNaN(r)&&((o=t.stream.initSegmentReference)&&(r+=(o.a?o.a-o.b:null)||0),o=e.a.getBandwidthEstimate(),8*r/o<i-n-Math.max(e.c.minBufferTime||0,e.g.rebufferingGoal)||t.Rb.b.a>r)}(e,o,a)&&o.Rb.abort(),r&&(o.Ra?o.Cc=!0:o.Ja?(o.Oa=!0,o.dc=n,o.Cc=!0):(xa(o),wa(e,o,!0,n).catch((function(t){e.a&&e.a.onError(t)})))),0)))}function da(e,t){t.Ra||t.Oa||(t.Ja?(t.Oa=!0,t.dc=0):null==Er(e.a.L,t.type)?null==t.Ga&&ka(e,t,0):(xa(t),wa(e,t,!1,0).catch((function(t){e.a&&e.a.onError(t)}))))}function fa(e,t,r,n,i){return p((function o(){var a,s,l,u,c,d,f;return M(o,(function(o){switch(o.j){case 1:return a=e.a.Ua(),s=Ea(e,a),l=Yt,u=new Map,c=new Set,t&&(u.set(l.Eb,t),c.add(t)),r&&(u.set(l.Pa,r),c.add(r)),n&&(u.set(l.ra,n),c.add(n)),d=e.a.L,f=e.g.forceTransmuxTS,S(o,d.init(u,f),2);case 2:return e.f?o.return():(function(e){var t=e.c.presentationTimeline.Y();1/0>t?e.a.L.xa(t):e.a.L.xa(Math.pow(2,32))}(e),S(o,ma(e,c),3));case 3:if(e.f)return o.return();u.forEach((function(t,r){if(!e.b.has(r)){var n=ha(t,s,i);e.b.set(r,n),ka(e,n,0)}})),w(o)}}))}))}function ha(e,t,r){return{stream:e,type:e.type,sb:null,Da:null,Ka:null,nc:!0,ia:t,endOfStream:!1,Ja:!1,Ga:null,Oa:!1,dc:0,Cc:!1,Ra:!1,od:!1,Pb:!1,rd:r||0,Rb:null}}function pa(e,t){var r=e.h[t];if(r)return r.promise;r={promise:new ge,Db:!1},e.h[t]=r;for(var n=new Set,i=f(e.c.periods[t].variants),o=i.next();!o.done;o=i.next())(o=o.value).video&&n.add(o.video),o.video&&o.video.trickModeVideo&&n.add(o.video.trickModeVideo),o.audio&&n.add(o.audio);for(o=(i=f(e.c.periods[t].textStreams)).next();!o.done;o=i.next())n.add(o.value);return e.u=e.u.then(function(){if(!this.f)return ma(this,n)}.bind(e)).then(function(){this.f||(this.h[t].promise.resolve(),this.h[t].Db=!0)}.bind(e)).catch(function(e){this.f||(this.h[t].promise.catch((function(){})),this.h[t].promise.reject(),delete this.h[t],this.a.onError(e))}.bind(e)),r.promise}function ma(e,t){return p((function r(){var n,i,o,a,s,l,u;return M(r,(function(r){switch(r.j){case 1:n=[];for(var c=f(t),d=c.next();!d.done;d=c.next())i=d.value,(o=e.i.get(i.id))?n.push(o.promise):(e.i.set(i.id,{promise:new ge,Db:!1}),n.push(i.createSegmentIndex()));return k(r,2),S(r,Promise.all(n),4);case 4:if(e.f)return r.return();C(r,3);break;case 2:if(a=R(r),e.f)return r.return();for(d=(r=f(t)).next();!d.done;d=r.next())s=d.value,e.i.get(s.id).promise.catch((function(){})),e.i.get(s.id).promise.reject(),e.i.delete(s.id);throw a;case 3:for(d=(c=f(t)).next();!d.done;d=c.next())l=d.value,(u=e.i.get(l.id)).Db||(u.promise.resolve(),u.Db=!0);w(r)}}))}))}function ga(e,t){if(!e.f&&!t.Ja&&null!=t.Ga&&!t.Ra)if(t.Ga=null,t.Oa)wa(e,t,t.Cc,t.dc);else{try{var r=function(e,t){if(_a(t))return kr(e.a.L,t.stream.originalId||""),null;var r=e.a.Ua(),n=ya(e,t,r),i=Ta(e,t.stream),o=Ea(e,n),a=function(e,t,r){return"text"==t?null==(e=e.a).b||e.b<r?0:e.b-Math.max(r,e.a):Bt(e=Sr(e,t),r)}(e.a.L,t.type,r),s=Math.max(e.c.minBufferTime||0,e.g.rebufferingGoal,e.g.bufferingGoal)*e.l;if(n>=e.c.presentationTimeline.Y())return t.endOfStream=!0,"video"==t.type&&(n=e.b.get("text"))&&"application/cea-608"==n.stream.mimeType&&(n.endOfStream=!0),null;if(t.endOfStream=!1,t.ia=o,o!=i)return null;if(a>=s)return.5;if(o=Tr(e.a.L,t.type),!(o=va(e,t,r,o,i)))return 1;var l=1/0;return Array.from(e.b.values()).forEach((function(t){_a(t)||(t=ya(e,t,r),l=Math.min(l,t))})),n>=l+e.c.presentationTimeline.a?1:(t.rd=0,function(e,t,r,n,i){var o=e.c.periods[n],a=t.stream,s=e.c.presentationTimeline.Y(),l=e.c.periods[n+1];n=function(e,t,r,n,i){return t.nc?(r=function(e,t,r,n,i){return"text"==t?(e.a.m=r,(e=e.a).f=n,e.h=i,Promise.resolve()):Promise.all([Cr(e,t,e.Be.bind(e,t)),Cr(e,t,e.kg.bind(e,t,r)),Cr(e,t,e.hg.bind(e,t,n,i))])}(e.a.L,t.type,e.c.periods[r].startTime-t.stream.presentationTimeOffset,n,i),t.stream.initSegmentReference?(e=Sa(e,t,t.stream.initSegmentReference).then(function(e){if(!this.f)return wr(this.a.L,t.type,e,null,null,t.stream.closedCaptions&&0<t.stream.closedCaptions.size)}.bind(e)).catch((function(e){return t.nc=!0,Promise.reject(e)})),Promise.all([r,e])):r):Promise.resolve()}(e,t,n,Math.max(0,o.startTime-.1),l?l.startTime+.01:s),t.Ja=!0,t.nc=!1,s=Sa(e,t,i),Promise.all([n,s]).then(function(e){if(!this.f&&!this.m)return function(e,t,r,n,i,o,a){var s=i.closedCaptions&&0<i.closedCaptions.size;return null!=i.emsgSchemeIdUris&&0<i.emsgSchemeIdUris.length&&(new In).fa("emsg",e.K.bind(e,n,o,i.emsgSchemeIdUris)).parse(a),function(e,t,r){var n=Math.max(e.g.bufferBehind,e.c.presentationTimeline.a),i=Er(e.a.L,t.type);return null==i||0>=(r=r-i-n)?Promise.resolve():e.a.L.remove(t.type,i,i+r).then(function(){}.bind(e))}(e,t,r).then(function(){if(!this.f)return wr(this.a.L,t.type,a,o.startTime+n.startTime,o.endTime+n.startTime,s)}.bind(e)).then(function(){if(!this.f)return t.sb=i,t.Da=o,Promise.resolve()}.bind(e))}(this,t,r,o,a,i,e[1])}.bind(e)).then(function(){this.f||this.m||(t.Ja=!1,t.od=!1,t.Oa||this.a.jd(),ka(this,t,0),function(e,t){if(!e.s){var r=Array.from(e.b.values());if(1==r.length&&"text"==r[0].type||(e.s=r.every((function(e){return"text"==e.type||!e.Oa&&!e.Ra&&e.Da}))),e.s){for(r=Ta(e,t),e.h[r]||pa(e,r).then(function(){this.f||this.a.$d()}.bind(e)).catch(Gt.oc),r=0;r<e.c.periods.length;++r)pa(e,r).catch(Gt.oc);e.a.Lf&&e.a.Lf()}}}(this,a))}.bind(e)).catch(function(e){this.f||this.m||(t.Ja=!1,"text"==t.type&&this.g.ignoreTextStreamFailures?this.b.delete("text"):7001==e.code?(t.Ja=!1,t.Ga=null,ka(this,t,0)):3017==e.code?function(e,t,r){if(!Array.from(e.b.values()).some((function(e){return e!=t&&e.od}))){var n=Math.round(100*e.l);if(20<n)e.l-=.2;else{if(!(4<n))return t.Pb=!0,e.m=!0,void e.a.onError(r);e.l-=.04}t.od=!0}ka(e,t,4)}(this,t,e):(t.Pb=!0,e.severity=2,Ca(this,e)))}.bind(e))}(e,t,r,i,o),null)}(e,t);null!=r&&(ka(e,t,r),t.Pb=!1)}catch(t){return void Ca(e,t)}r=Array.from(e.b.values()),function(e,t){var r=Ta(e,t.stream);if(t.ia!=r){var n=t.ia,i=Array.from(e.b.values());i.every((function(e){return e.ia==n||_a(e)}))&&i.every(Aa)&&pa(e,n).then(function(){if(!this.f&&i.every(function(e){var t=Aa(e),r=Ta(this,e.stream);return!!_a(e)||t&&e.ia==n&&r!=n}.bind(this))){var e=this.c.periods[n],t=this.a.ae(e),r=new Map;t.variant&&t.variant.video&&r.set("video",t.variant.video),t.variant&&t.variant.audio&&r.set("audio",t.variant.audio),t.text&&r.set("text",t.text);for(var o=(t=f(this.b.keys())).next();!o.done;o=t.next())if(o=o.value,!r.has(o)&&"text"!=o)return void this.a.onError(new me(2,5,5005));for(o=(t=f(Array.from(r.keys()))).next();!o.done;o=t.next())if(o=o.value,!this.b.has(o)){if("text"!=o)return void this.a.onError(new me(2,5,5005));fa(this,null,null,r.get("text"),e.startTime),r.delete(o)}for(o=(t=f(Array.from(this.b.keys()))).next();!o.done;o=t.next()){o=o.value;var a=this.b.get(o),s=r.get(o);if(s){var l=_a(a);l&&(a.ia=n,a.rd=e.startTime),ca(this,s,!1,0,!1),l&&_a(a)||ka(this,this.b.get(o),0)}else this.b.delete(o)}this.a.$d()}}.bind(e)).catch(Gt.oc)}}(e,t),e.s&&r.every((function(e){return e.endOfStream}))&&e.a.L.endOfStream().then(function(){if(!this.f){var e=this.a.L.Y();0!=e&&e<this.c.presentationTimeline.Y()&&this.c.presentationTimeline.xa(e)}}.bind(e))}}function ya(e,t,r){return t.sb&&t.Da?(r=Ta(e,t.sb),e.c.periods[r].startTime+t.Da.endTime):Math.max(r,t.rd)}function va(e,t,r,n,i){if(t.Da&&t.stream==t.sb)return ba(e,t,i,t.Da.position+1);if(t.Da?(r=Ta(e,t.sb),r=t.stream.findSegmentPosition(Math.max(0,e.c.periods[r].startTime+t.Da.endTime-e.c.periods[i].startTime))):r=t.stream.findSegmentPosition(Math.max(0,(n||r)-e.c.periods[i].startTime)),null==r)return null;var o=null;return null==n&&(o=ba(e,t,i,Math.max(0,r-1))),o||ba(e,t,i,r)}function ba(e,t,r,n){return r=e.c.periods[r],(t=t.stream.getSegmentReference(n))?(e=(n=e.c.presentationTimeline).Ob(),n=n.pb(),r.startTime+t.endTime<e||r.startTime+t.startTime>n?null:t):null}function _a(e){return e&&"text"==e.type&&"application/cea-608"==e.stream.mimeType}function Aa(e){return!e.Ja&&null==e.Ga&&!e.Oa&&!e.Ra}function Ea(e,t){var r=Mo(e.c.periods,t+1/15);return r?e.c.periods.indexOf(r):0}function Ta(e,t){for(var r=e.c.periods,n=0;n<r.length;n++){for(var i=r[n],o=new Set,a=f(i.variants),s=a.next();!s.done;s=a.next())(s=s.value).audio&&o.add(s.audio),s.video&&o.add(s.video),s.video&&s.video.trickModeVideo&&o.add(s.video.trickModeVideo);for(a=(i=f(i.textStreams)).next();!a.done;a=i.next())o.add(a.value);if(o.has(t))return n}return-1}function Sa(e,t,r){return r=vi(r.c(),r.b,r.a,e.g.retryParameters),e=e.a.ub.request(1,r),t.Rb=e,e.promise.then((function(e){return t.Rb=null,e.data}))}function wa(e,t,r,n){return p((function i(){var o,a,s;return M(i,(function(i){switch(i.j){case 1:return t.Oa=!1,t.Cc=!1,t.dc=0,t.Ra=!0,n?(a=e.a.Ua(),s=e.a.L.Y(),o=e.a.L.remove(t.type,a+n,s)):o=xr(e.a.L,t.type).then(function(){if(!this.f&&r)return this.a.L.flush(t.type)}.bind(e)),S(i,o,2);case 2:if(e.f)return i.return();t.sb=null,t.Da=null,t.Ra=!1,t.endOfStream=!1,ka(e,t,0),w(i)}}))}))}function ka(e,t,r){t.Ga=new de((function(){return p((function r(){var n;return M(r,(function(r){switch(r.j){case 1:return k(r,2),S(r,ga(e,t),4);case 4:C(r,0);break;case 2:n=R(r),e.a&&e.a.onError(n),w(r)}}))}))})).R(r)}function xa(e){null!=e.Ga&&(e.Ga.stop(),e.Ga=null)}function Ca(e,t){pe(e.F).then(function(){this.f||(this.a.onError(t),t.handled||this.g.failureCallback(t))}.bind(e))}function Ra(e,t,r,n,i,o){if(200<=r&&299>=r&&202!=r)return{uri:i||n,ld:n,data:t,headers:e,fromCache:!!e["x-shaka-from-cache"]};i=null;try{i=lt(t)}catch(e){}throw new me(401==r||403==r?2:1,1,1001,n,r,i,e,o)}function La(e,t,r,n){var i=new La.b;We(t.headers).forEach((function(e,t){i.append(t,e)}));var o=new La.a,a={Id:!1,te:!1};if(e=new ye(e=La.l(e,r,{body:t.body||void 0,headers:i,method:t.method,signal:o.signal,credentials:t.allowCrossSiteCredentials?"include":void 0},a,n),(function(){return a.Id=!0,o.abort(),Promise.resolve()})),t=t.retryParameters.timeout){var s=new fe((function(){a.te=!0,o.abort()}));s.R(t/1e3),e.finally((function(){s.stop()}))}return e}function ja(e,t,r,n){var i=new ja.f,o=Date.now(),a=0;return new ye(new Promise((function(s,l){for(var u in i.open(t.method,e,!0),i.responseType="arraybuffer",i.timeout=t.retryParameters.timeout,i.withCredentials=t.allowCrossSiteCredentials,i.onabort=function(){l(new me(1,1,7001,e,r))},i.onload=function(t){for(var n=(t=t.target).getAllResponseHeaders().trim().split("\r\n"),i={},o=(n=f(n)).next();!o.done;o=n.next())i[(o=o.value.split(": "))[0].toLowerCase()]=o.slice(1).join(": ");try{var a=Ra(i,t.response,t.status,e,t.responseURL,r);s(a)}catch(e){l(e)}},i.onerror=function(t){l(new me(1,1,1002,e,t,r))},i.ontimeout=function(){l(new me(1,1,1003,e,r))},i.onprogress=function(e){var t=Date.now();(100<t-o||e.lengthComputable&&e.loaded==e.total)&&(n(t-o,e.loaded-a,e.total-e.loaded),a=e.loaded,o=t)},t.headers)i.setRequestHeader(u.toLowerCase(),t.headers[u]);i.send(t.body)})),(function(){return i.abort(),Promise.resolve()}))}function Pa(){this.a=this.f=this.b=0,this.c=new Map,this.g=0}function Ia(e,t,r){this.h=e,this.b=new Map,this.c=!1,this.g=t,this.f=r,this.a=new Pa}function Oa(e,t,r,n,i,o){var a=function(e,t){e.b+=t;var r=e.g;return e.g++,e.c.set(r,t),r}(e.a,n);n=e.b.get(t)||Promise.resolve(),e.b.set(t,n.then((function(){return p((function t(){var n,s,l,u,c,d;return M(t,(function(t){switch(t.j){case 1:return S(t,function(e,t){return p((function r(){var n;return M(r,(function(r){switch(r.j){case 1:return S(r,e.h.request(1,t).promise,2);case 2:return n=r.o,r.return(n.data)}}))}))}(e,r),2);case 2:if(n=t.o,e.c)throw new me(2,9,7001);if(i)for(var f in s=new Uint8Array(n),(l=new Fn(s)).data)u=Number(f),c=l.data[u],d=l.a[u],e.f(c,d);return e.a.close(a,n.byteLength),f=e.a,e.g(0==f.b?0:f.f/f.b,e.a.a),t.return(o(n))}}))}))})))}function Da(e,t){var r=this;this.c=e,this.b=e.objectStore(t),this.a=new ge,e.onabort=function(e){e.preventDefault(),r.a.reject()},e.onerror=function(e){e.preventDefault(),r.a.reject()},e.oncomplete=function(){r.a.resolve()}}function Ma(e,t){return new Promise((function(r,n){var i=e.b.openCursor();i.onerror=n,i.onsuccess=function(e){if(!(e=e.target.result))return r();t(e.key,e.value,e),e.continue()}}))}function Na(e){this.b=e,this.a=[]}function Ua(e,t){return Fa(e,t,"readwrite")}function Fa(e,t,r){var n=new Da(r=e.b.transaction([t],r),t);return e.a.push(n),n.promise().then((function(){Re(e.a,n)}),(function(){Re(e.a,n)})),n}function Ba(e,t,r){this.b=new Na(e),this.c=t,this.a=r}function Ka(e){return Promise.reject(new me(2,9,9011,"Cannot add new value to "+e))}function Ga(e,t,r,n){t=(e=Ua(e.b,t)).store();for(var i={},o=(r=f(r)).next();!o.done;i={key:i.key},o=r.next())i.key=o.value,t.delete(i.key).onsuccess=function(e){return function(){return n(e.key)}}(i);return e.promise()}function Va(e,t,r){return p((function n(){var i,o,a,s,l,u,c;return M(n,(function(n){switch(n.j){case 1:for(i=Fa(e.b,t,"readonly"),o=i.store(),a={},s=[],l={},u=f(r),c=u.next();!c.done;l={request:l.request,key:l.key},c=u.next())l.key=c.value,l.request=o.get(l.key),l.request.onsuccess=function(e){return function(){null==e.request.result&&s.push(e.key),a[e.key]=e.request.result}}(l);return S(n,i.promise(),2);case 2:if(s.length)throw new me(2,9,9012,"Could not find values for "+s);return n.return(r.map((function(e){return a[e]})))}}))}))}function Ha(e){this.a=new Na(e)}function Ya(){this.a=new Map}function za(e,t,r){if(!(e=e.a.get(t)))throw new me(2,9,9013,"Could not find mechanism with name "+t);if(!(t=e.getCells().get(r)))throw new me(2,9,9013,"Could not find cell with name "+r);return t}function Wa(e,t){$a.set(e,t)}na.prototype.destroy=function(){for(var e=f(this.b.values()),t=e.next();!t.done;t=e.next())xa(t.value);return this.b.clear(),this.i.clear(),this.g=this.h=this.u=this.c=this.a=null,this.f=!0,Promise.resolve()},na.prototype.configure=function(e){this.g=e,this.F=new he({maxAttempts:Math.max(e.retryParameters.maxAttempts,2),baseDelay:e.retryParameters.baseDelay,backoffFactor:e.retryParameters.backoffFactor,fuzzFactor:e.retryParameters.fuzzFactor,timeout:0},!0)},na.prototype.start=function(){var e=this;return p((function t(){var r,n,i;return M(t,(function(t){switch(t.j){case 1:return r=e.a.Ua(),n=Ea(e,r),(i=e.a.ae(e.c.periods[n])).variant||i.text?S(t,fa(e,i.variant?i.variant.audio:null,i.variant?i.variant.video:null,i.text,r),2):t.return(new me(2,5,5005));case 2:if(e.f)return t.return();e.a&&e.a.Cf&&e.a.Cf(),w(t)}}))}))},na.prototype.K=function(e,t,r,n){var i=n.reader.md(),o=n.reader.md(),a=n.reader.G(),s=n.reader.G(),l=n.reader.G(),u=n.reader.G();n=n.reader.Za(n.reader.J.byteLength-n.reader.ca()),e=e.startTime+t.startTime+s/a,r.includes(i)&&("urn:mpeg:dash:event:2012"==i?this.a.Df():this.a.onEvent(new Se("emsg",{detail:{startTime:e,endTime:e+l/a,schemeIdUri:i,value:o,timescale:a,presentationTimeDelta:s,eventDuration:l,id:u,messageData:n}})))},G("shaka.net.HttpFetchPlugin",La),La.l=function(e,t,r,n,i){return p((function o(){var a,s,l,u,c,d,f,h,m,g,y,v;return M(o,(function(o){switch(o.j){case 1:return a=La.g,s=La.c,d=c=0,f=Date.now(),k(o,2),S(o,a(e,r),4);case 4:return l=o.o,h=l.clone().body.getReader(),g=(m=l.headers.get("Content-Length"))?parseInt(m,10):0,new s({start:function(e){!function t(){return p((function r(){var n,o;return M(r,(function(r){switch(r.j){case 1:return k(r,2),S(r,h.read(),4);case 4:n=r.o,C(r,3);break;case 2:return R(r),r.return();case 3:n.done||(c+=n.value.byteLength),(100<(o=Date.now())-f||n.done)&&(i(o-f,c-d,g-c),d=c,f=o),n.done?e.close():(e.enqueue(n.value),t()),w(r)}}))}))}()}}),S(o,l.arrayBuffer(),5);case 5:u=o.o,C(o,3);break;case 2:if(y=R(o),n.Id)throw new me(1,1,7001,e,t);if(n.te)throw new me(1,1,1003,e,t);throw new me(1,1,1002,e,y,t);case 3:return v={},l.headers.forEach((function(e,t){v[t.trim()]=e})),o.return(Ra(v,u,l.status,e,l.url,t))}}))}))},La.isSupported=function(){if(!e.ReadableStream)return!1;try{new ReadableStream({})}catch(e){return!1}return!(!e.fetch||!e.AbortController)},La.isSupported=La.isSupported,La.g=e.fetch,La.a=e.AbortController,La.c=e.ReadableStream,La.b=e.Headers,La.isSupported()&&(De("http",La,2),De("https",La,2)),G("shaka.net.HttpXHRPlugin",ja),ja.f=e.XMLHttpRequest,De("http",ja,1),De("https",ja,1),Pa.prototype.close=function(e,t){if(this.c.has(e)){var r=this.c.get(e);this.c.delete(e),this.f+=r,this.a+=t}},Ia.prototype.destroy=function(){return this.c=!0,Promise.all(this.b.values()).then((function(){}),(function(){}))},Da.prototype.abort=function(){try{this.c.abort()}catch(e){}return this.a.catch((function(){}))},Da.prototype.store=function(){return this.b},Da.prototype.promise=function(){return this.a},Na.prototype.destroy=function(){return Promise.all(this.a.map((function(e){return e.abort()})))},(n=Ba.prototype).destroy=function(){return this.b.destroy()},n.hasFixedKeySpace=function(){return!0},n.addSegments=function(){return Ka(this.c)},n.removeSegments=function(e,t){return Ga(this,this.c,e,t)},n.getSegments=function(e){var t=this;return p((function r(){var n;return M(r,(function(r){switch(r.j){case 1:return S(r,Va(t,t.c,e),2);case 2:return n=r.o,r.return(n.map((function(e){return t.Jd(e)})))}}))}))},n.addManifests=function(){return Ka(this.a)},n.updateManifestExpiration=function(e,t){var r=Ua(this.b,this.a),n=r.store();return n.get(e).onsuccess=function(r){(r=r.target.result)&&(r.expiration=t,n.put(r,e))},r.promise()},n.removeManifests=function(e,t){return Ga(this,this.a,e,t)},n.getManifests=function(e){var t=this;return p((function r(){var n;return M(r,(function(r){switch(r.j){case 1:return S(r,Va(t,t.a,e),2);case 2:return n=r.o,r.return(n.map((function(e){return t.ec(e)})))}}))}))},n.getAllManifests=function(){var e=this;return p((function t(){var r,n;return M(t,(function(t){switch(t.j){case 1:return r=Fa(e.b,e.a,"readonly"),n=new Map,S(t,Ma(r,(function(t,r){n.set(t,e.ec(r))})),2);case 2:return S(t,r.promise(),3);case 3:return t.return(n)}}))}))},n.Jd=function(e){return e},n.ec=function(e){return e},n.add=function(e,t){var r=this;return p((function n(){var i,o,a,s;return M(n,(function(n){switch(n.j){case 1:i=Ua(r.b,e),o=i.store(),a=[];for(var l=f(t),u=l.next();!u.done;u=l.next())s=u.value,o.add(s).onsuccess=function(e){a.push(e.target.result)};return S(n,i.promise(),2);case 2:return n.return(a)}}))}))},Ha.prototype.destroy=function(){return this.a.destroy()},Ha.prototype.getAll=function(){var e=this;return p((function t(){var r,n;return M(t,(function(t){switch(t.j){case 1:return r=Fa(e.a,"session-ids","readonly"),n=[],S(t,Ma(r,(function(e,t){n.push(t)})),2);case 2:return S(t,r.promise(),3);case 3:return t.return(n)}}))}))},Ha.prototype.add=function(e){for(var t=Ua(this.a,"session-ids"),r=t.store(),n=(e=f(e)).next();!n.done;n=e.next())r.add(n.value);return t.promise()},Ha.prototype.remove=function(e){var t=this;return p((function r(){var n;return M(r,(function(r){switch(r.j){case 1:return S(r,Ma(n=Ua(t.a,"session-ids"),(function(t,r,n){0<=e.indexOf(r.sessionId)&&n.delete()})),2);case 2:return S(r,n.promise(),0)}}))}))},Ya.prototype.destroy=function(){for(var e=[],t=f(this.a.values()),r=t.next();!r.done;r=t.next())e.push(r.value.destroy());return this.a.clear(),Promise.all(e)},Ya.prototype.init=function(){var e=this;$a.forEach((function(t,r){var n=t();n&&e.a.set(r,n)}));for(var t=[],r=f(this.a.values()),n=r.next();!n.done;n=r.next())t.push(n.value.init());return Promise.all(t)},Ya.prototype.erase=function(){var e=this;return p((function t(){var r,n;return M(t,(function(t){switch(t.j){case 1:return r=Array.from(e.a.values()),(n=0<r.length)||$a.forEach((function(e){(e=e())&&r.push(e)})),S(t,Promise.all(r.map((function(e){return e.erase()}))),2);case 2:if(!n)return S(t,Promise.all(r.map((function(e){return e.destroy()}))),0);t.A(0)}}))}))},G("shaka.offline.StorageMuxer.register",Wa),G("shaka.offline.StorageMuxer.unregister",(function(e){$a.delete(e)}));var $a=new Map;function qa(e){Ba.apply(this,arguments)}function Xa(e){return function(e){var t=e.streams.filter((function(e){return"audio"==e.contentType})),r=e.streams.filter((function(e){return"video"==e.contentType}));if(!t.every((function(e){return e.variantIds}))||!r.every((function(e){return e.variantIds}))){t.forEach((function(e){e.variantIds=[]})),r.forEach((function(e){e.variantIds=[]}));var n=0;if(r.length&&!t.length){var i=n++;r.forEach((function(e){e.variantIds.push(i)}))}if(!r.length&&t.length){var o=n++;t.forEach((function(e){e.variantIds.push(o)}))}r.length&&t.length&&t.forEach((function(e){r.forEach((function(t){var r=n++;e.variantIds.push(r),t.variantIds.push(r)}))}))}}(e),e.streams.forEach((function(){})),{startTime:e.startTime,streams:e.streams.map(Ja)}}function Ja(e){var t=e.initSegmentUri?Qa(e.initSegmentUri):null;return{id:e.id,originalId:null,primary:e.primary,presentationTimeOffset:e.presentationTimeOffset,contentType:e.contentType,mimeType:e.mimeType,codecs:e.codecs,frameRate:e.frameRate,pixelAspectRatio:void 0,kind:e.kind,language:e.language,label:e.label,width:e.width,height:e.height,initSegmentKey:t,encrypted:e.encrypted,keyId:e.keyId,segments:e.segments.map(Za),variantIds:e.variantIds}}function Za(e){var t=Qa(e.uri);return{startTime:e.startTime,endTime:e.endTime,dataKey:t}}function Qa(e){var t;if((t=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(e))||(t=/^offline:segment\/([0-9]+)$/.exec(e)))return Number(t[1]);throw new me(2,9,9004,"Could not parse uri "+e)}function es(e,t,r,n){Ba.call(this,e,t,r),this.f=n}function ts(){this.g=this.c=this.b=this.a=this.f=null}function rs(e,t,r,n){this.a=e,this.g=t,this.f=r,this.c=n,this.b=["offline:",e,"/",t,"/",r,"/",n].join("")}function ns(e){if(null==(e=/^offline:([a-z]+)\/([^/]+)\/([^/]+)\/([0-9]+)$/.exec(e)))return null;var t=e[1];if("manifest"!=t&&"segment"!=t)return null;var r=e[2];if(!r)return null;var n=e[3];return n&&null!=t?new rs(t,r,n,Number(e[4])):null}function is(e,t){this.b=e,this.a=t}function os(e,t,r){var n=t.streams.filter((function(e){return"audio"==e.contentType})),i=t.streams.filter((function(e){return"video"==e.contentType}));return n=function(e,t,r){for(var n=new Set,i=f(t),o=i.next();!o.done;o=i.next()){var a=f(o.value.variantIds);for(o=a.next();!o.done;o=a.next())n.add(o.value)}for(i=f(r),o=i.next();!o.done;o=i.next())for(a=f(o.value.variantIds),o=a.next();!o.done;o=a.next())n.add(o.value);for(i=new Map,n=f(n),o=n.next();!o.done;o=n.next())o=o.value,i.set(o,{id:o,language:"",primary:!1,audio:null,video:null,bandwidth:0,drmInfos:[],allowedByApplication:!0,allowedByKeySystem:!0});for(t=f(t),n=t.next();!n.done;n=t.next())for(n=n.value,o=as(e,n),a=f(n.variantIds),n=a.next();!n.done;n=a.next())(n=i.get(n.value)).language=o.language,n.primary=n.primary||o.primary,n.audio=o;for(r=f(r),t=r.next();!t.done;t=r.next())for(n=t.value,t=as(e,n),o=f(n.variantIds),n=o.next();!n.done;n=o.next())(n=i.get(n.value)).primary=n.primary||t.primary,n.video=t;return i}(e,n,i),i=t.streams.filter((function(e){return"text"==e.contentType})).map((function(t){return as(e,t)})),t.streams.forEach((function(n){n=n.segments.map((function(t,r){return ss(e,r,t)})),r.vb(n,t.startTime)})),{startTime:t.startTime,variants:Array.from(n.values()),textStreams:i}}function as(e,t){var r=t.segments.map((function(t,r){return ss(e,r,t)})),n=new ei(r);return r={id:t.id,originalId:t.originalId,createSegmentIndex:function(){return Promise.resolve()},findSegmentPosition:function(e){return n.find(e)},getSegmentReference:function(e){return n.get(e)},initSegmentReference:null,presentationTimeOffset:t.presentationTimeOffset,mimeType:t.mimeType,codecs:t.codecs,width:t.width||void 0,height:t.height||void 0,frameRate:t.frameRate||void 0,pixelAspectRatio:t.pixelAspectRatio||void 0,kind:t.kind,encrypted:t.encrypted,keyId:t.keyId,language:t.language,label:t.label||null,type:t.contentType,primary:t.primary,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,audioSamplingRate:null,closedCaptions:null},null!=t.initSegmentKey&&(r.initSegmentReference=function(e,t){var r=new rs("segment",e.b,e.a,t);return new Jn((function(){return[r.toString()]}),0,null)}(e,t.initSegmentKey)),r}function ss(e,t,r){var n=new rs("segment",e.b,e.a,r.dataKey);return new Zn(t,r.startTime,r.endTime,(function(){return[n.toString()]}),0,null)}function ls(){this.a=null}function us(e){var t=ns(e);return t&&"manifest"==t.a?us.h(e):t&&"segment"==t.a?us.i(t.key(),t):ve(new me(2,1,9004,e))}function cs(e,t,r){return p((function n(){var i,o,a,s,l,u;return M(n,(function(n){switch(n.j){case 1:i=[];for(var c=[],d=f(r),h=d.next();!h.done;h=d.next()){h=h.value;for(var m=!1,g=f(c),y=g.next();!y.done;y=g.next())if(ds((y=y.value).info,h)){y.sessionIds.push(h.sessionId),m=!0;break}m||c.push({info:h,sessionIds:[h.sessionId]})}o=f(c),a=o.next();case 2:if(a.done){n.A(4);break}return s=a.value,l=function(e,t,r){return p((function n(){var i,o;return M(n,(function(n){switch(n.j){case 1:return i=new pt({ub:t,onError:function(){},qc:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),k(n,2),i.configure(e),S(n,function(e,t,r,n,i,o){var a=new Map;return a.set(t,{audioCapabilities:i,videoCapabilities:o,distinctiveIdentifier:"optional",persistentState:"required",sessionTypes:["persistent-license"],label:t,drmInfos:[{keySystem:t,licenseServerUri:r,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:n,initData:null,keyIds:null}]}),Tt(e,a)}(i,r.info.keySystem,r.info.licenseUri,r.info.serverCertificate,r.info.audioCapabilities,r.info.videoCapabilities),4);case 4:C(n,3);break;case 2:return R(n),S(n,i.destroy(),5);case 5:return n.return([]);case 3:return k(n,6),S(n,yt(i),8);case 8:C(n,7);break;case 6:return R(n),S(n,i.destroy(),9);case 9:return n.return([]);case 7:return o=[],S(n,Promise.all(r.sessionIds.map((function(e){return p((function t(){return M(t,(function(t){switch(t.j){case 1:return k(t,2),S(t,function(e,t){return p((function r(){var n,i,o;return M(r,(function(r){switch(r.j){case 1:return S(r,St(e,t),2);case 2:return(n=r.o)?(i=[],(o=e.b.get(n))&&(o.ya=new ge,i.push(o.ya)),i.push(n.remove()),S(r,Promise.all(i),0)):r.return()}}))}))}(i,e),4);case 4:o.push(e),C(t,0);break;case 2:R(t),w(t)}}))}))}))),10);case 10:return S(n,i.destroy(),11);case 11:return n.return(o)}}))}))}(e,t,s),S(n,l,5);case 5:u=n.o,i=i.concat(u),a=o.next(),n.A(2);break;case 4:return n.return(i)}}))}))}function ds(e,t){function r(e,t){return e.robustness==t.robustness&&e.contentType==t.contentType}return e.keySystem==t.keySystem&&e.licenseUri==t.licenseUri&&Le(e.audioCapabilities,t.audioCapabilities,r)&&Le(e.videoCapabilities,t.videoCapabilities,r)}function fs(e,t){var r={Aa:null,v:null,mimeType:null,startTime:null,zd:null,uri:null},n=this;this.g=t,this.c=e,this.i=r,this.h=null,this.f=[],this.b=this.a=null,this.l=!0,this.m=Promise.resolve().then((function(){return function(e){return p((function t(){return M(t,(function(t){switch(t.j){case 1:if(e.l){if(0==e.f.length||e.a&&!e.a.Va)var r=!1;else{e.a&&(e.a.va.Ya(),e.a=null);var n=(r=e.f.shift()).create(e.i);n?(r.va.wb(),e.a={node:n.node,payload:n.payload,Va:n.Va,va:r.va}):r.va.rc(),r=!0}return r?r=Promise.resolve():e.a?r=function(e){return p((function t(){var r,n;return M(t,(function(t){switch(t.j){case 1:return e.c=e.g.cf(e.c,e.i,e.a.node,e.a.payload),k(t,2),e.b=e.g.Le(e.c,e.i,e.a.payload),S(t,e.b.promise,4);case 4:e.b=null,e.c==e.a.node&&(e.a.va.pc(),e.a=null),C(t,0);break;case 2:return 7001==(r=R(t)).code?e.a.va.Ya():e.a.va.onError(r),e.a=null,e.b=null,n=e,S(t,e.g.handleError(e.i,r),5);case 5:n.c=t.o,w(t)}}))}))}(e):(e.g.Bf(e.c),e.h=new ge,r=e.h),S(t,r,1)}t.A(0)}}))}))}(n)}))}function hs(e,t){var r={wb:function(){},pc:function(){},Ya:function(){},onError:function(){},rc:function(){},Jg:function(){}};return e.f.push({create:t,va:r}),e.b&&e.b.abort(),ps(e),r}function ps(e){e.h&&(e.h.resolve(),e.h=null)}function ms(e){this.a=null;for(var t=0;t<e.textTracks.length;++t){var r=e.textTracks[t];r.mode="disabled","Shaka Player TextTrack"==r.label&&(this.a=r)}this.a||(this.a=e.addTextTrack("subtitles","Shaka Player TextTrack")),this.a.mode="hidden"}function gs(e){if(e.startTime>=e.endTime)return null;var t=new VTTCue(e.startTime,e.endTime,e.payload);t.lineAlign=e.lineAlign,t.positionAlign=e.positionAlign,t.size=e.size;try{t.align=e.textAlign}catch(e){}return"center"==e.textAlign&&"center"!=t.align&&(t.align="middle"),"vertical-lr"==e.writingMode?t.vertical="lr":"vertical-rl"==e.writingMode&&(t.vertical="rl"),1==e.lineInterpretation&&(t.snapToLines=!1),null!=e.line&&(t.line=e.line),null!=e.position&&(t.position=e.position),t}function ys(e,t){var r=e.mode;e.mode="showing"==r?"showing":"hidden";for(var n=e.cues,i=n.length-1;0<=i;i--){var o=n[i];o&&t(o)&&e.removeCue(o)}e.mode=r}function vs(e,t,r,n,i){var o,a=i in n,s=!0;for(o in t){var l=i+"."+o,u=a?n[i]:r[o];a||o in r?void 0===t[o]?void 0===u||a?delete e[o]:e[o]=xe(u):u.constructor==Object&&t[o]&&t[o].constructor==Object?(e[o]||(e[o]=xe(u)),l=vs(e[o],t[o],u,n,l),s=s&&l):typeof t[o]!=typeof u||null==t[o]||"function"!=typeof t[o]&&t[o].constructor!=u.constructor?($("Invalid config, wrong type for "+l),s=!1):("function"==typeof r[o]&&r[o].length!=t[o].length&&q("Unexpected number of arguments for "+l),e[o]=t[o]):($("Invalid config, unrecognized key "+l),s=!1)}return s}function bs(e,t){for(var r={},n=r,i=0,o=0;!(0>(i=e.indexOf(".",i)));)0!=i&&"\\"==e[i-1]||(n[o=e.substring(o,i).replace(/\\\./g,".")]={},n=n[o],o=i+1),i+=1;return n[e.substring(o).replace(/\\\./g,".")]=t,r}function _s(){}function As(){var e=5e5,t=1/0;navigator.connection&&(e=1e6*navigator.connection.downlink,navigator.connection.saveData&&(t=360));var r={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0},servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,initDataTransform:kt,fairPlayTransform:!0},n={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0},availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,dash:{customScheme:function(e){if(e)return null},clockSyncUri:"",ignoreDrmInfo:!1,xlinkFailGracefully:!1,defaultPresentationDelay:10,ignoreMinBufferTime:!1,autoCorrectDrift:!0,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1},hls:{ignoreTextStreamFailures:!1}},i={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0},failureCallback:function(e){return[e]},rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,smallGapLimit:.5,jumpLargeGaps:!1,durationBackoff:1,forceTransmuxTS:!1,safeSeekOffset:5,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsOnSafari:!0};rt("Web0S")&&(i.stallEnabled=!1);var o={trackSelectionCallback:function(e){return p((function t(){return M(t,(function(t){switch(t.j){case 1:return t.return(e)}}))}))},progressCallback:function(e,t){return[e,t]},usePersistentLicense:!0},a={drm:r,manifest:n,streaming:i,offline:o,abrFactory:Ur,abr:{enabled:!0,defaultBandwidthEstimate:e,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:t,minPixels:0,maxPixels:1/0,minFrameRate:0,maxFrameRate:1/0,minBandwidth:0,maxBandwidth:1/0}},preferredAudioLanguage:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,minPixels:0,maxPixels:1/0,minFrameRate:0,maxFrameRate:1/0,minBandwidth:0,maxBandwidth:1/0},playRangeStart:0,playRangeEnd:1/0,textDisplayFactory:function(){return null}};return o.trackSelectionCallback=function(e){return p((function t(){return M(t,(function(t){switch(t.j){case 1:return t.return(function(e,t){var r=e.filter((function(e){return"variant"==e.type})),n=[],i=Dr(t,r.map((function(e){return e.language})));i&&(n=r.filter((function(e){return Ir(e.language)==i}))),0==n.length&&(n=r.filter((function(e){return e.primary}))),0==n.length&&(r.map((function(e){return e.language})),n=r);var o=n.filter((function(e){return e.height&&480>=e.height}));if(o.length&&(o.sort((function(e,t){return t.height-e.height})),n=o.filter((function(e){return e.height==o[0].height}))),r=[],n.length){var a=Math.floor(n.length/2);n.sort((function(e,t){return e.bandwidth-t.bandwidth})),r.push(n[a])}for(n=f(e),a=n.next();!a.done;a=n.next())"text"==(a=a.value).type&&r.push(a);return r}(e,a.preferredAudioLanguage))}}))}))},a}function Es(e,t,r){var n={".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",serverCertificate:new Uint8Array(0),individualizationServer:""}};return vs(e,t,r||As(),n,"")}function Ts(){this.a=null,this.b=[]}function Ss(e,t){if(null==e.a)e.a={timestamp:Date.now()/1e3,state:t,duration:0};else{var r=Date.now()/1e3;e.a.duration=r-e.a.timestamp,e.a.state!=t&&(e.b.push(e.a),e.a={timestamp:r,state:t,duration:0})}}function ws(e,t){var r=0;e.a&&e.a.state==t&&(r+=e.a.duration);for(var n=f(e.b),i=n.next();!i.done;i=n.next())r+=(i=i.value).state==t?i.duration:0;return r}function ks(){this.b=this.c=null,this.a=[]}function xs(){this.f=this.s=this.h=this.b=this.i=this.l=this.m=this.g=this.u=NaN,this.a=new Ts,this.c=new ks}function Cs(t,r){var n=this;ke.call(this),this.i=pl,this.a=null,this.gb=!1,this.g=new Be,this.Dc=this.l=this.Fb=this.b=this.s=this.f=this.Yb=this.B=this.Zb=this.W=this.ib=this.m=this.D=this.h=this.K=null,this.Xd=1e9,this.ac=new Set,this.kb=!0,this.pa=null,this.Ud=!1,this.Rd=0,this.oa=null,this.$=new po,this.c=Us(this),this.bc={width:1/0,height:1/0},this.u=null,this.Gb=new To(this.c.preferredAudioLanguage,this.c.preferredVariantRole,this.c.preferredAudioChannelCount),this.na=this.c.preferredTextLanguage,this.fb=this.c.preferredTextRole,r&&r(this),this.K=function(e){return new Ie((function(t,r){e.l&&e.l.segmentDownloaded(t,r)}))}(this),this.g.w(e,"online",(function(){n.sd()})),this.F={name:"detach"},this.O={name:"attach"},this.Ha={name:"unload"},this.Mc={name:"manifest-parser"},this.Kc={name:"manifest"},this.hb={name:"media-source"},this.Ec={name:"drm-engine"},this.S={name:"load"},this.Rc={name:"src-equals-drm-engine"},this.jb={name:"src-equals"};var i=new Map;i.set(this.O,(function(e,t){return Ae(function(e,t,r){return null==t.v&&(t.v=r.v,e.g.w(t.v,"error",(function(){var t=el(e);t&&e.Ma(t)}))),e.a=t.v,Promise.resolve()}(n,e,t))})),i.set(this.F,(function(e){return e.v&&(n.g.ea(e.v,"error"),e.v=null),n.a=null,Ae(e=Promise.resolve())})),i.set(this.Ha,(function(e){return Ae(Ps(n,e))})),i.set(this.hb,(function(t){return Ae(t=function(t,r){return p((function n(){var i,o,a,s;return M(n,(function(n){switch(n.j){case 1:return i=e.muxjs?new Mt:new Nt,o=t.c.textDisplayFactory,a=new o,t.Fc=o,S(n,(s=new yr(r.v,i,a)).s,2);case 2:t.D=s,w(n)}}))}))}(n,t))})),i.set(this.Mc,(function(e,t){return Ae(function(e,t,r){return p((function n(){var i,o,a,s;return M(n,(function(n){switch(n.j){case 1:if(t.Aa=r.Aa,t.mimeType=r.mimeType,t.uri=r.uri,i=t.uri,o=e.K,e.Fb=i,t.Aa){e.s=t.Aa(),n.A(2);break}return a=e,S(n,gi.create(i,o,e.c.manifest.retryParameters,t.mimeType),3);case 3:a.s=n.o;case 2:s=xe(e.c.manifest),r.v&&"AUDIO"===r.v.nodeName&&(s.disableVideo=!0),e.s.configure(s),w(n)}}))}))}(n,e,t))})),i.set(this.Kc,(function(e){return function(e,t){var r=t.uri,n=e.K;e.Yb=new Zo,function(e,t){e.b=t}(e.Yb,(function(t){Qs(e,"timelineregionadded",t)}));var i={networkingEngine:n,filterNewPeriod:function(t){return e.Nc(t)},filterAllPeriods:function(t){return Fs(e,t)},onTimelineRegionAdded:function(t){var r=e.Yb;e:{for(var n=f(r.a),i=n.next();!i.done;i=n.next())if((i=i.value).schemeIdUri==t.schemeIdUri&&i.id==t.id&&i.startTime==t.startTime&&i.endTime==t.endTime){n=i;break e}n=null}null==n&&(r.a.add(t),r.b(t))},onEvent:function(t){return e.dispatchEvent(t)},onError:function(t){return e.Ma(t)}};return new ye(Promise.resolve().then((function(){return p((function t(){var n;return M(t,(function(t){switch(t.j){case 1:return n=e,S(t,e.s.start(r,i),2);case 2:if(n.b=t.o,e.dispatchEvent(new Se("manifestparsed")),0==e.b.periods.length)throw new me(2,4,4014);!function(e){function t(e){return e.video&&e.audio||e.video&&e.video.codecs.includes(",")}e.some((function(e){return e.variants.some(t)}))&&e.forEach((function(e){e.variants=e.variants.filter(t)}))}(e.b.periods),w(t)}}))}))})),(function(){return e.s.stop()}))}(n,e)})),i.set(this.Ec,(function(){return Ae(function(e){return p((function t(){return M(t,(function(t){switch(t.j){case 1:return e.h=new pt({ub:e.K,onError:function(t){e.Ma(t)},qc:function(t){tl(e,t)},onExpirationUpdated:function(t,r){rl(e,t,r)},onEvent:function(t){e.dispatchEvent(t)}}),e.h.configure(e.c.drm),S(t,mt(e.h,Do(e.b.periods),e.b.offlineSessionIds),2);case 2:Fs(e,e.b.periods),w(t)}}))}))}(n))})),i.set(this.S,(function(e,t){return Ae(function(e,t,r){return p((function n(){var i,o,a,s,l,u,c,d,h;return M(n,(function(n){switch(n.j){case 1:return t.startTime=r.startTime,i=t.v,o=t.uri,e.Fb=o,e.u=new xs,a=function(){return Vs(e)},s=function(){var t=e.a.playbackRate;0!=t&&e.W.set(t)},e.g.w(i,"playing",a),e.g.w(i,"pause",a),e.g.w(i,"ended",a),e.g.w(i,"ratechange",s),l=e.c.abrFactory,e.l&&e.Dc==l||(e.Dc=l,e.l=new l,e.l.configure(e.c.abr)),function(e,t){for(var r=0;r<t.length;r++){for(var n=t[r],i=new Map,o=f(n.variants),a=o.next();!a.done;a=o.next())if((a=a.value).video&&a.video.closedCaptions)for(var s=f((a=a.video).closedCaptions.keys()),l=s.next();!l.done;l=s.next())if(l=l.value,!i.has(l)){var u={id:e.Xd++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,presentationTimeOffset:0,mimeType:"application/cea-608",codecs:"",kind:"caption",encrypted:!1,keyId:null,language:a.closedCaptions.get(l),label:null,type:"text",primary:!1,frameRate:void 0,pixelAspectRatio:void 0,trickModeVideo:null,emsgSchemeIdUris:null,roles:a.roles,channelsCount:null,audioSamplingRate:null,closedCaptions:null};i.set(l,u)}for(i=f(i.values()),o=i.next();!o.done;o=i.next())n.textStreams.push(o.value)}}(e,e.b.periods),e.Gb=new To(e.c.preferredAudioLanguage,e.c.preferredVariantRole,e.c.preferredAudioChannelCount),e.na=e.c.preferredTextLanguage,function(e,t,r){0<t&&(e.V()||e.qe(t)),r<e.Y()&&(e.V()||e.xa(r))}(e.b.presentationTimeline,e.c.playRangeStart,e.c.playRangeEnd),S(n,e.h.Hb(i),2);case 2:return e.l.init((function(t,r,n){r=void 0!==r&&r,n=void 0===n?0:n;e:{for(var i=f(e.b.periods),o=i.next();!o.done;o=i.next())if((o=o.value).variants.includes(t)){i=o;break e}i=null}Ms(e,i,t,!0),e.f&&ua(e.f,t,r,n)&&Ws(e)})),e.m=function(e,t){return new $o(e.a,e.b,e.c.streaming,t,(function(){e.ib&&Oo(e.ib,!0),e.f&&function(e){function t(t){var i=e.a.L;return t="text"==t?null!=(t=i.a).a&&null!=t.b&&r>=t.a&&r<t.b:Ft(t=Sr(i,t),r,n)}var r=e.a.Ua(),n=e.g.smallGapLimit,i=Ea(e,r);if(ze(e.b.values(),(function(e){return e.ia==i})))for(var o=f(e.b.keys()),a=o.next();!a.done;a=o.next())t(a=a.value)||da(e,e.b.get(a));else ze(e.b.keys(),t)||e.b.forEach((function(t){da(e,t)}))}(e.f),e.B&&Os(e)}),(function(t){return e.dispatchEvent(t)}))}(e,t.startTime),e.ib=function(e){var t=new No(e.b);!function(e,t){e.b=t}(t,(function(){$s(e)}));var r=new Qo(e.Yb);!function(e,t,r,n){e.a=t,e.b=r,e.c=n}(r,(function(t){Qs(e,"timelineregionenter",t)}),(function(t){Qs(e,"timelineregionexit",t)}),(function(t,r){r||(Qs(e,"timelineregionenter",t),Qs(e,"timelineregionexit",t))}));var n=new Io(e.a);return n.a.add(t),n.a.add(r),n}(e),e.W=new Uo({jc:function(){return t.v.playbackRate},wd:function(e){t.v.playbackRate=e},Yd:function(e){t.v.currentTime+=e}}),u=Math.max(e.b.minBufferTime,e.c.streaming.rebufferingGoal),Is(e,u),e.f=function(e){return new na(e.b,{Ua:function(){return e.m.h()},getBandwidthEstimate:function(){return e.l.getBandwidthEstimate()},L:e.D,ub:e.K,ae:e.zf.bind(e),$d:e.Fe.bind(e),onError:e.Ma.bind(e),onEvent:function(t){return e.dispatchEvent(t)},Df:e.Ef.bind(e),jd:e.Jf.bind(e)})}(e),e.f.configure(e.c.streaming),function(e){function t(e){var t="";e.video&&(t=Xe(e.video.codecs)[0]);var r="";return e.audio&&(r=Xe(e.audio.codecs)[0]),t+"-"+r}var r=e.b.periods.reduce((function(e,t){return e.concat(t.variants)}),[]);r=Nr.Nd(r,e.c.preferredAudioChannelCount);var n=new we;r.forEach((function(e){var r=t(e);n.push(r,e)}));var i=null,o=1/0;n.forEach((function(e,t){var r=0,n=0;t.forEach((function(e){r+=e.bandwidth||0,++n}));var a=r/n;a<o&&(i=e,o=a)})),e.b.periods.forEach((function(e){e.variants=e.variants.filter((function(e){return t(e)==i}))}))}(e),e.i=ml,e.dispatchEvent(new Se("streaming")),S(n,e.f.start(),3);case 3:e.c.streaming.startAtSegmentBoundary&&(c=e.m.h(),d=function(e,t){function r(e,t){if(!e)return null;var r=e.findSegmentPosition(t-o.startTime);return null==r?null:(r=e.getSegmentReference(r))?r.startTime+o.startTime:null}var n=ia(e.f),i=oa(e.f),o=ll(e);return n=r(n,t),null!=(i=r(i,t))&&null!=n?Math.max(i,n):null!=i?i:null!=n?n:t}(e,c),e.m.m(d)),e.b.periods.forEach(e.Nc.bind(e)),$s(e),Ws(e),(h=ll(e)||e.b.periods[0]).variants.some((function(e){return e.primary})),Hs(e,h.variants),e.g.da(i,"loadeddata",(function(){e.u.b=Date.now()/1e3-r.zd})),w(n)}}))}))}(n,e,t))})),i.set(this.Rc,(function(e){return Ae(e=function(e,t){return p((function r(){var n,i;return M(r,(function(r){switch(r.j){case 1:return n=Yt,e.h=new pt({ub:e.K,onError:function(t){e.Ma(t)},qc:function(t){tl(e,t)},onExpirationUpdated:function(t,r){rl(e,t,r)},onEvent:function(t){e.dispatchEvent(t)}}),e.h.configure(e.c.drm),i={id:0,language:"und",primary:!1,audio:null,video:{id:0,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,presentationTimeOffset:0,mimeType:"video/mp4",codecs:"",encrypted:!0,keyId:null,language:"und",label:null,type:n.Pa,primary:!1,frameRate:void 0,pixelAspectRatio:void 0,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,audioSamplingRate:null,closedCaptions:null},bandwidth:100,drmInfos:[],allowedByApplication:!0,allowedByKeySystem:!0},S(r,mt(e.h,[i],[]),2);case 2:return S(r,e.h.Hb(t.v),0)}}))}))}(n,e))})),i.set(this.jb,(function(e,t){return function(e,t,r){function n(){return Vs(e)}if(t.uri=r.uri,t.startTime=r.startTime,e.Fb=t.uri,e.u=new xs,e.m=new Wo(t.v),null!=t.startTime&&e.m.m(t.startTime),e.W=new Uo({jc:function(){return t.v.playbackRate},wd:function(e){t.v.playbackRate=e},Yd:function(e){t.v.currentTime+=e}}),Is(e,e.c.streaming.rebufferingGoal),e.g.w(t.v,"playing",n),e.g.w(t.v,"pause",n),e.g.w(t.v,"ended",n),e.g.da(t.v,"loadeddata",(function(){e.u.b=Date.now()/1e3-r.zd})),e.a.audioTracks&&(e.g.w(e.a.audioTracks,"addtrack",(function(){return $s(e)})),e.g.w(e.a.audioTracks,"removetrack",(function(){return $s(e)})),e.g.w(e.a.audioTracks,"change",(function(){return $s(e)}))),e.a.textTracks){var i=e.a.textTracks;e.g.w(i,"addtrack",(function(){return $s(e)})),e.g.w(i,"removetrack",(function(){return $s(e)})),e.g.w(i,"change",(function(){return $s(e)}))}t.v.src=t.uri,e.i=gl,e.dispatchEvent(new Se("streaming"));var o=new ge;return e.a.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?o.resolve():e.a.error?o.reject(el(e)):(e.g.da(e.a,"loadeddata",(function(){o.resolve()})),e.g.da(e.a,"error",(function(){o.reject(el(e))}))),new ye(o,(function(){return o.reject(new me(2,7,7001)),Promise.resolve()}))}(n,e,t)})),this.lb=new fs(this.F,{cf:function(e,t,r,i){var o=null;return e==n.F&&(o=r==n.F?n.F:n.O),e==n.O&&(o=r==n.F||t.v!=i.v?n.F:r==n.O?n.O:r==n.hb||r==n.S?n.hb:r==n.jb?n.Rc:null),e==n.hb&&(o=r==n.S&&t.v==i.v?n.Mc:n.Ha),e==n.Mc&&(o=dl(n.S,n.Kc,n.Ha,r,t,i)),e==n.Kc&&(o=dl(n.S,n.Ec,n.Ha,r,t,i)),e==n.Ec&&(o=dl(n.S,n.S,n.Ha,r,t,i)),e==n.Rc&&(o=r==n.jb&&t.v==i.v?n.jb:n.Ha),e!=n.S&&e!=n.jb||(o=n.Ha),e==n.Ha&&(o=i.v&&t.v==i.v?n.O:n.F),o},Le:function(e,t,r){return n.dispatchEvent(new Se("onstatechange",{state:e.name})),i.get(e)(t,r)},handleError:function(e){return p((function t(){return M(t,(function(t){switch(t.j){case 1:return S(t,Ps(n,e),2);case 2:return t.return(e.v?n.O:n.F)}}))}))},Bf:function(e){n.dispatchEvent(new Se("onstateidle",{state:e.name}))}}),t&&this.Hb(t,!0)}_(qa,Ba),qa.prototype.updateManifestExpiration=function(e,t){var r=Ua(this.b,this.a),n=r.store(),i=new ge;return n.get(e).onsuccess=function(r){(r=r.target.result)?(r.expiration=t,n.put(r),i.resolve()):i.reject(new me(2,9,9012,"Could not find values for "+e))},r.promise().then((function(){return i}))},qa.prototype.ec=function(e){return{originalManifestUri:e.originalManifestUri,duration:e.duration,size:e.size,expiration:null==e.expiration?1/0:e.expiration,periods:e.periods.map(Xa),sessionIds:e.sessionIds,drmInfo:e.drmInfo,appMetadata:e.appMetadata}},qa.prototype.Jd=function(e){return{data:e.data}},_(es,Ba),es.prototype.hasFixedKeySpace=function(){return this.f},es.prototype.addSegments=function(e){return this.f?Ka(this.c):this.add(this.c,e)},es.prototype.addManifests=function(e){return this.f?Ka(this.a):this.add(this.a,e)},es.prototype.ec=function(e){return null==e.expiration&&(e.expiration=1/0),e},(n=ts.prototype).init=function(){var t=this,r=new ge,n=e.indexedDB.open("shaka_offline_db",4);return n.onsuccess=function(e){e=e.target.result,t.f=e;var n=e.objectStoreNames;n=n.contains("manifest")&&n.contains("segment")?new qa(e,"segment","manifest"):null,t.a=n,n=(n=e.objectStoreNames).contains("manifest-v2")&&n.contains("segment-v2")?new es(e,"segment-v2","manifest-v2",!0):null,t.b=n,n=(n=e.objectStoreNames).contains("manifest-v3")&&n.contains("segment-v3")?new es(e,"segment-v3","manifest-v3",!1):null,t.c=n,e=e.objectStoreNames.contains("session-ids")?new Ha(e):null,t.g=e,r.resolve()},n.onupgradeneeded=function(e){e=e.target.result;for(var t=f(["segment-v3","manifest-v3","session-ids"]),r=t.next();!r.done;r=t.next())r=r.value,e.objectStoreNames.contains(r)||e.createObjectStore(r,{autoIncrement:!0})},n.onerror=function(e){r.reject(new me(2,9,9001,n.error)),e.preventDefault()},r},n.destroy=function(){var e=this;return p((function t(){return M(t,(function(t){switch(t.j){case 1:if(!e.a){t.A(2);break}return S(t,e.a.destroy(),2);case 2:if(!e.b){t.A(4);break}return S(t,e.b.destroy(),4);case 4:if(!e.c){t.A(6);break}return S(t,e.c.destroy(),6);case 6:if(!e.g){t.A(8);break}return S(t,e.g.destroy(),8);case 8:e.f&&e.f.close(),w(t)}}))}))},n.getCells=function(){var e=new Map;return this.a&&e.set("v1",this.a),this.b&&e.set("v2",this.b),this.c&&e.set("v3",this.c),e},n.getEmeSessionCell=function(){return this.g},n.erase=function(){var t=this;return p((function r(){return M(r,(function(r){switch(r.j){case 1:if(!t.a){r.A(2);break}return S(r,t.a.destroy(),2);case 2:if(!t.b){r.A(4);break}return S(r,t.b.destroy(),4);case 4:if(!t.c){r.A(6);break}return S(r,t.c.destroy(),6);case 6:return t.f&&t.f.close(),S(r,function(){var t=new ge,r=e.indexedDB.deleteDatabase("shaka_offline_db");return r.onblocked=function(){},r.onsuccess=function(){t.resolve()},r.onerror=function(e){t.reject(new me(2,9,9001,r.error)),e.preventDefault()},t}(),8);case 8:return t.f=null,t.a=null,t.b=null,t.c=null,S(r,t.init(),0)}}))}))},Wa("idb",(function(){return e.indexedDB?new ts:null})),rs.prototype.wa=function(){return this.g},rs.prototype.ba=function(){return this.f},rs.prototype.key=function(){return this.c},rs.prototype.toString=function(){return this.b},(n=ls.prototype).configure=function(){},n.start=function(e){var t=this;return p((function r(){var n,i,o,a,s;return M(r,(function(r){switch(r.j){case 1:return n=ns(e),t.a=n,null==n||"manifest"!=n.a?r.return(Promise.reject(new me(2,1,9004,n))):(i=new Ya,x(r,2),S(r,i.init(),4));case 4:return S(r,za(i,n.wa(),n.ba()),5);case 5:return S(r,r.o.getManifests([n.key()]),6);case 6:return o=r.o,a=o[0],s=new is(n.wa(),n.ba()),r.return(function(e,t){var r=new yi(null,0);r.xa(t.duration);var n=t.periods.map((function(t){return os(e,t,r)})),i=t.drmInfo?[t.drmInfo]:[];return t.drmInfo&&n.forEach((function(e){e.variants.forEach((function(e){e.drmInfos=i}))})),{presentationTimeline:r,minBufferTime:2,offlineSessionIds:t.sessionIds,periods:n}}(s,a));case 2:return L(r),S(r,i.destroy(),7);case 7:j(r,0)}}))}))},n.stop=function(){return Promise.resolve()},n.update=function(){},n.onExpirationUpdated=function(e,t){var r=this;return p((function n(){var i,o,a,s,l,u,c;return M(n,(function(n){switch(n.j){case 1:return i=r.a,o=new Ya,k(n,2,3),S(n,o.init(),5);case 5:return S(n,za(o,i.wa(),i.ba()),6);case 6:return S(n,(a=n.o).getManifests([i.key()]),7);case 7:if(s=n.o,l=s[0],u=l.sessionIds.includes(e),c=null==l.expiration||l.expiration>t,!u||!c){n.A(3);break}return S(n,a.updateManifestExpiration(i.key(),t),3);case 3:return L(n),S(n,o.destroy(),10);case 10:j(n,0);break;case 2:R(n),n.A(3)}}))}))},gi.Cb("application/x-offline-manifest",ls),G("shaka.offline.OfflineScheme",us),us.h=function(e){return _e(e={uri:e,ld:e,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}})},us.i=function(e,t){var r=new Ya;return _e(void 0).U((function(){return r.init()})).U((function(){return za(r,t.wa(),t.ba())})).U((function(e){return e.getSegments([t.key()])})).U((function(e){return{uri:t,ld:t,data:e[0].data,headers:{}}})).finally((function(){return r.destroy()}))},De("offline",us),fs.prototype.destroy=function(){var e=this;return p((function t(){return M(t,(function(t){switch(t.j){case 1:return e.l=!1,e.b&&e.b.abort(),ps(e),S(t,e.m,2);case 2:e.a&&e.a.va.Ya();for(var r=f(e.f),n=r.next();!n.done;n=r.next())n.value.va.Ya();e.a=null,e.f=[],e.g=null,w(t)}}))}))},G("shaka.text.SimpleTextDisplayer",ms),ms.prototype.remove=function(e,t){return!!this.a&&(ys(this.a,(function(r){return r.startTime<t&&r.endTime>e})),!0)},ms.prototype.remove=ms.prototype.remove,ms.prototype.append=function(e){for(var t=gs,r=[],n=0;n<e.length;n++){var i=t(e[n]);i&&r.push(i)}r.slice().sort((function(e,t){return e.startTime!=t.startTime?e.startTime-t.startTime:e.endTime!=t.endTime?e.endTime-t.startTime:r.indexOf(t)-r.indexOf(e)})).forEach(function(e){this.a.addCue(e)}.bind(this))},ms.prototype.append=ms.prototype.append,ms.prototype.destroy=function(){return this.a&&ys(this.a,(function(){return!0})),this.a=null,Promise.resolve()},ms.prototype.destroy=ms.prototype.destroy,ms.prototype.isTextVisible=function(){return"showing"==this.a.mode},ms.prototype.isTextVisible=ms.prototype.isTextVisible,ms.prototype.setTextVisibility=function(e){this.a.mode=e?"showing":"hidden"},ms.prototype.setTextVisibility=ms.prototype.setTextVisibility,G("shaka.util.ConfigUtils.mergeConfigObjects",vs),G("shaka.util.ConfigUtils.convertToConfigObject",bs),G("shaka.util.PlayerConfiguration",_s),_s.mergeConfigObjects=Es,V(Cs,ke),G("shaka.Player",Cs),Cs.prototype.destroy=function(){var e=this;return p((function t(){var r;return M(t,(function(t){switch(t.j){case 1:return e.i==hl?t.return():(e.i=hl,r=hs(e.lb,(function(){return{node:e.F,payload:{Aa:null,v:null,mimeType:null,startTime:null,zd:null,uri:null},Va:!1}})),S(t,new Promise((function(t){r.wb=function(){},r.pc=function(){t(),e.dispatchEvent(new Se("loaded"))},r.Ya=function(){t()},r.onError=function(){t()},r.rc=function(){t()}})),2));case 2:return S(t,e.lb.destroy(),3);case 3:if(e.g&&(e.g.release(),e.g=null),e.Dc=null,e.l=null,e.c=null,!e.K){t.A(0);break}return S(t,e.K.destroy(),5);case 5:e.K=null,w(t)}}))}))},Cs.prototype.destroy=Cs.prototype.destroy,Cs.version="v2.5.10";var Rs=["2","5"];Hr=new function(e){this.a=e,this.c=Gr,this.b=Vr}(new Br(Number(Rs[0]),Number(Rs[1])));var Ls=["output-restricted","internal-error"],js={};function Ps(e,t){return p((function r(){return M(r,(function(r){switch(r.j){case 1:if(e.i!=hl&&(e.i=pl),e.dispatchEvent(new Se("unloading")),t.Aa=null,t.mimeType=null,t.startTime=null,t.uri=null,t.v&&(e.g.ea(t.v,"loadeddata"),e.g.ea(t.v,"playing"),e.g.ea(t.v,"pause"),e.g.ea(t.v,"ended"),e.g.ea(t.v,"ratechange")),e.ib&&(e.ib.release(),e.ib=null),e.Zb&&(e.Zb.stop(),e.Zb=null),!e.s){r.A(2);break}return S(r,e.s.stop(),3);case 3:e.s=null;case 2:if(!e.l){r.A(4);break}return S(r,e.l.stop(),4);case 4:if(!e.f){r.A(6);break}return S(r,e.f.destroy(),7);case 7:e.f=null;case 6:if(e.m&&(e.m.release(),e.m=null),!e.D){r.A(8);break}return S(r,e.D.destroy(),9);case 9:e.D=null;case 8:if(!t.v||!t.v.src){r.A(10);break}return S(r,new Promise((function(e){return new fe(e).R(.1)})),11);case 11:t.v.removeAttribute("src"),t.v.load();case 10:if(!e.h){r.A(12);break}return S(r,e.h.destroy(),13);case 13:e.h=null;case 12:e.$.a.clear(),e.Fb=null,e.B=null,e.ac.clear(),e.b=null,e.u=null,e.Fc=null,e.kb=!0,Gs(e),w(r)}}))}))}function Is(e,t){e.B=new So,e.B.a=ko,wo(e.B,t,Math.min(.5,t/2)),Gs(e),e.Zb=new fe((function(){Os(e)})).Na(.25)}function Os(e){switch(e.i){case gl:var t=!!e.a.ended||Ut(e.a.buffered)>=e.a.duration-1;break;case ml:e:if(e.a.ended||Ar(e.D))t=!0;else{if(e.b.presentationTimeline.V()){var r=e.b.presentationTimeline.pb();if(Ut(e.a.buffered)>=r){t=!0;break e}}t=!1}break;default:t=!1}var n=Bt(e.a.buffered,e.a.currentTime),i=t,o=(r=e.B).b.get(r.a);t=r.a,n=i||n>=o?xo:ko,r.a=n,t!=n&&Gs(e)}function Ds(e){if(e.s){var t=xe(e.c.manifest);e.a&&"AUDIO"===e.a.nodeName&&(t.disableVideo=!0),e.s.configure(t)}if(e.h&&e.h.configure(e.c.drm),e.f){e.f.configure(e.c.streaming);try{e.b.periods.forEach(e.Nc.bind(e))}catch(t){e.Ma(t)}var r=ia(e.f),n=oa(e.f);t=ll(e),r=Nr.Qd(r,n,t.variants),e.l&&r&&r.allowedByApplication&&r.allowedByKeySystem?Hs(e,t.variants):Ys(e,t)}if(e.D&&(t=e.c.textDisplayFactory,e.Fc!=t)){r=new t;var i=(n=e.D).g;n.g=r,i&&(r.setTextVisibility(i.isTextVisible()),i.destroy()),n.a&&(n.a.c=r),e.Fc=t,e.f&&(r=(t=e.f).b.get("text"))&&ca(t,r.stream,!0,0,!0)}e.l&&(e.l.configure(e.c.abr),e.c.abr.enabled&&!e.kb?e.l.enable():e.l.disable(),Zs(e)),e.B&&(t=e.c.streaming.rebufferingGoal,e.b&&(t=Math.max(t,e.b.minBufferTime)),wo(e.B,t,Math.min(.5,t/2)))}function Ms(e,t,r,n){go(e.$,t).variant=r,(e=e.u.c).c!=r&&(e.c=r,e.a.push({timestamp:Date.now()/1e3,id:r.id,type:"variant",fromAdaptation:n,bandwidth:r.bandwidth}))}function Ns(e,t,r,n){mo(e.$,t,r),(e=e.u.c).b!=r&&(e.b=r,e.a.push({timestamp:Date.now()/1e3,id:r.id,type:"text",fromAdaptation:n,bandwidth:null}))}function Us(e){var t=As();return t.streaming.failureCallback=function(t){e.V()&&[1001,1002,1003].includes(t.code)&&(t.severity=1,e.sd())},t.textDisplayFactory=function(){return new ms(e.a)},t}function Fs(e,t){var r=e.f?ia(e.f):null,n=e.f?oa(e.f):null;if(t.forEach(Nr.filterNewPeriod.bind(null,e.h,r,n)),0==(r=function(e,t){var r=0;return e.forEach((function(e){r+=t(e)?1:0})),r}(t,(function(e){return e.variants.some(Nr.rb)}))))throw new me(2,4,4032);if(r<t.length)throw new me(2,4,4011);t.forEach(function(e){Nr.Gd(e.variants,this.c.restrictions,this.bc)&&this.f&&ll(this)==e&&$s(this),nl(this,e.variants)}.bind(e))}function Bs(e,t,r,n){return r=void 0!==r&&r,n=void 0===n?0:n,e.kb?(e.pa=t,e.Ud=r,e.Rd=n,!0):((t=ua(e.f,t,r,n))&&qs(e),t)}function Ks(e,t){if(e.kb)return e.oa=t,!0;var r=ca(e.f,t,!0,0,!1);return r&&Xs(e),r}function Gs(e){var t=e.Xc();if(e.u&&e.B&&e.m){var r=e.W;r.f=t,Fo(r),Vs(e)}e.dispatchEvent(new Se("buffering",{buffering:t}))}function Vs(e){if(e.u&&e.B){var t=e.u.a;e.B.a==ko?Ss(t,"buffering"):e.a.paused?Ss(t,"paused"):e.a.ended?Ss(t,"ended"):Ss(t,"playing")}}function Hs(e,t){try{nl(e,t)}catch(t){return e.Ma(t),null}var r=t.filter((function(e){return Nr.rb(e)}));return r=e.Gb.create(r),e.l.setVariants(Array.from(r.values())),e.l.chooseVariant()}function Ys(e,t){var r=zs(e,t,!1),n=Nr.Jb(t.textStreams,e.na,e.fb)[0]||null,i=!1;n&&(e.c.streaming.alwaysStreamText||e.mc())&&(Ns(e,t,n,!0),i=Ks(e,n)),(r||i)&&Ws(e)}function zs(e,t,r){r=void 0===r||r;var n=Hs(e,t.variants),i=!1;return n&&(Ms(e,t,n,!0),i=Bs(e,n,!0)),r&&i&&Ws(e),i}function Ws(e){il(e,new Se("adaptation"))}function $s(e){il(e,new Se("trackschanged"))}function qs(e){il(e,new Se("variantchanged"))}function Xs(e){il(e,new Se("textchanged"))}function Js(e){il(e,new Se("texttrackvisibility"))}function Zs(e){il(e,new Se("abrstatuschanged",{Ig:e.c.abr.enabled}))}function Qs(e,t,r){e.dispatchEvent(new Se(t,{detail:{schemeIdUri:r.schemeIdUri,value:r.value,startTime:r.startTime,endTime:r.endTime,id:r.id,eventElement:r.eventElement}}))}function el(e){if(!e.a.error)return null;var t=e.a.error.code;if(1==t)return null;var r=e.a.error.msExtendedCode;return r&&(0>r&&(r+=Math.pow(2,32)),r=r.toString(16)),new me(2,3,3016,t,r,e.a.error.message)}function tl(e,t){if(e.f){var r=ll(e),n=!1,i=Object.keys(t),o=1==i.length&&"00"==i[0];i.length&&e.b.periods.forEach((function(e){e.variants.forEach((function(e){Nr.nf(e).forEach((function(r){var i=e.allowedByKeySystem;r.keyId&&(r=t[o?"00":r.keyId],e.allowedByKeySystem=!!r&&!Ls.includes(r)),i!=e.allowedByKeySystem&&(n=!0)}))}))})),i=ia(e.f);var a=oa(e.f);(i=Nr.Qd(i,a,r.variants))&&!i.allowedByKeySystem&&zs(e,r),n&&($s(e),Hs(e,r.variants))}}function rl(e,t,r){e.s&&e.s.onExpirationUpdated&&e.s.onExpirationUpdated(t,r),e.dispatchEvent(new Se("expirationupdated"))}function nl(e,t){var r=e.h?$e(e.h.W):{},n=Object.keys(r);n=n.length&&"00"==n[0];for(var i=!1,o=!1,a=[],s=[],l=f(t),u=l.next();!u.done;u=l.next()){var c=[];(u=u.value).audio&&c.push(u.audio),u.video&&c.push(u.video);for(var d=(c=f(c)).next();!d.done;d=c.next())if((d=d.value).keyId){var h=r[n?"00":d.keyId];h?Ls.includes(h)&&(s.includes(h)||s.push(h)):a.includes(d.keyId)||a.push(d.keyId)}u.allowedByApplication?u.allowedByKeySystem&&(i=!0):o=!0}if(!i)throw new me(2,4,4012,{hasAppRestrictions:o,missingKeys:a,restrictedKeyStatuses:s})}function il(e,t){p((function r(){return M(r,(function(r){switch(r.j){case 1:return S(r,Promise.resolve(),2);case 2:e.i!=hl&&e.dispatchEvent(t),w(r)}}))}))}function ol(e){for(var t=new Set,r=(e=f(e)).next();!r.done;r=e.next())(r=r.value).language?t.add(Ir(r.language)):t.add("und");return t}function al(e){for(var t=new Map,r=(e=f(e)).next();!r.done;r=e.next()){var n=r.value;r="und";var i=[];for(n.language&&(r=Ir(n.language)),(i="variant"==n.type?n.audioRoles:n.roles)&&i.length||(i=[""]),t.has(r)||t.set(r,new Set),i=(n=f(i)).next();!i.done;i=n.next())i=i.value,t.get(r).add(i)}var o=[];return t.forEach((function(e,t){for(var r=f(e),n=r.next();!n.done;n=r.next())o.push({language:t,role:n.value})})),o}function sl(e){return null==(e=ll(e))?[]:e.variants.filter((function(e){return Nr.rb(e)}))}function ll(e){for(var t=e.m.h(),r=null,n=(e=f(e.b.periods)).next();!n.done;n=e.next())(n=n.value).startTime<=t&&(r=n);return r}function ul(e){var t=ll(e);return go(e.$,t).variant}function cl(){return new me(2,7,7e3)}function dl(e,t,r,n,i,o){return n==e&&i.v==o.v&&i.uri==o.uri&&i.mimeType==o.mimeType&&i.Aa==o.Aa?t:r}function fl(e){return new Promise((function(t,r){e.Ya=function(){return r(cl())},e.pc=function(){return t()},e.onError=function(e){return r(e)},e.rc=function(){return r(cl())}}))}Cs.registerSupportPlugin=function(e,t){js[e]=t},Cs.isBrowserSupported=function(){if(!(e.Promise&&e.Uint8Array&&Array.prototype.forEach))return!1;var t=tt();return!(t&&12>t||!(e.MediaKeys&&e.navigator&&e.navigator.requestMediaKeySystemAccess&&e.MediaKeySystemAccess&&e.MediaKeySystemAccess.prototype.getConfiguration))&&(!!Ze()||Qe("application/x-mpegurl"))},Cs.probeSupport=function(){return Ct().then((function(e){for(var t=gi.Sf(),r={},n=f('video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="opus",audio/mp4; codecs="flac",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",")),i=n.next();!i.done;i=n.next()){r[i=i.value]=Ze()?!!pr(i)||MediaSource.isTypeSupported(i)||Wt(i):Qe(i);var o=i.split(";")[0];r[o]=r[o]||r[i]}for(var a in e={manifest:t,media:r,drm:e},js)e[a]=js[a]();return e}))},Cs.prototype.Hb=function(e,t){if(t=void 0===t||t,this.i==hl)return Promise.reject(cl());var r={Aa:null,v:null,mimeType:null,startTime:null,zd:null,uri:null};r.v=e,Ze()||(t=!1);var n=t?this.hb:this.O,i=hs(this.lb,(function(){return{node:n,payload:r,Va:!1}}));return i.wb=function(){},fl(i)},Cs.prototype.attach=Cs.prototype.Hb,Cs.prototype.detach=function(){var e=this;if(this.i==hl)return Promise.reject(cl());var t=hs(this.lb,(function(){return{node:e.F,payload:{Aa:null,v:null,mimeType:null,startTime:null,zd:null,uri:null},Va:!1}}));return t.wb=function(){},fl(t)},Cs.prototype.detach=Cs.prototype.detach,Cs.prototype.Cd=function(e){var t=this;if(e=void 0===e||e,this.i==hl)return Promise.reject(cl());Ze()||(e=!1);var r={Aa:null,v:null,mimeType:null,startTime:null,zd:null,uri:null},n=hs(this.lb,(function(n){var i=n.v&&e?t.hb:n.v?t.O:t.F;return r.v=n.v,{node:i,payload:r,Va:!1}}));return n.wb=function(){},fl(n)},Cs.prototype.unload=Cs.prototype.Cd,Cs.prototype.load=function(e,t,r){if(this.i==hl)return Promise.reject(cl());this.dispatchEvent(new Se("loading"));var n={Aa:null,v:null,mimeType:null,startTime:null,zd:null,uri:null};n.uri=e,n.zd=Date.now()/1e3,r&&"string"!=typeof r&&(Kr("Loading with a manifest parser factory","Please register a manifest parser and for the mime-type."),n.Aa=function(){return new r}),r&&"string"==typeof r&&(n.mimeType=r),void 0!==t&&(n.startTime=t);var i=function(e,t){if(t.Aa)return!1;if(!Ze())return!0;var r=t.mimeType,n=t.uri||"";return r||(r={mp4:"video/mp4",m4v:"video/mp4",m4a:"audio/mp4",webm:"video/webm",weba:"audio/webm",mkv:"video/webm",ts:"video/mp2t",ogv:"video/ogg",ogg:"audio/ogg",mpg:"video/mpeg",mpeg:"video/mpeg",m3u8:"application/x-mpegurl",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav"}[gi.getExtension(n)]),!!r&&""!=(t.v||nt()).canPlayType(r)&&(!gi.isSupported(n,r)||et()&&e.c.streaming.useNativeHlsOnSafari)}(this,n)?this.jb:this.S,o=hs(this.lb,(function(e){return null==e.v?null:(n.v=e.v,{node:i,payload:n,Va:!0})}));return o.wb=function(){},new Promise((function(e,t){o.rc=function(){return t(new me(2,7,7002))},o.pc=function(){return e()},o.Ya=function(){return t(cl())},o.onError=function(e){return t(e)}}))},Cs.prototype.load=Cs.prototype.load,Cs.prototype.configure=function(e,t){2==arguments.length&&"string"==typeof e&&(e=bs(e,t));var r=Es(this.c,e,Us(this));return Ds(this),r},Cs.prototype.configure=Cs.prototype.configure,Cs.prototype.getConfiguration=function(){var e=Us(this);return Es(e,this.c,Us(this)),e},Cs.prototype.getConfiguration=Cs.prototype.getConfiguration,Cs.prototype.$f=function(){for(var e in this.c)delete this.c[e];Es(this.c,Us(this),Us(this)),Ds(this)},Cs.prototype.resetConfiguration=Cs.prototype.$f,Cs.prototype.We=function(){return this.i},Cs.prototype.getLoadMode=Cs.prototype.We,Cs.prototype.af=function(){return this.a},Cs.prototype.getMediaElement=Cs.prototype.af,Cs.prototype.Mb=function(){return this.K},Cs.prototype.getNetworkingEngine=Cs.prototype.Mb,Cs.prototype.hc=function(){return this.Fb},Cs.prototype.getAssetUri=Cs.prototype.hc,Cs.prototype.Ze=function(){return Kr("getManifestUri",'Please use "getAssetUri" instead.'),this.hc()},Cs.prototype.getManifestUri=Cs.prototype.Ze,Cs.prototype.V=function(){return this.b?this.b.presentationTimeline.V():!(!this.a||!this.a.src)&&1/0==this.a.duration},Cs.prototype.isLive=Cs.prototype.V,Cs.prototype.Xa=function(){return!!this.b&&this.b.presentationTimeline.Xa()},Cs.prototype.isInProgress=Cs.prototype.Xa,Cs.prototype.uf=function(){if(this.b){if(!this.b.periods.length)return!1;var e=this.b.periods[0].variants;return!!e.length&&!e[0].video}return!(!this.a||!this.a.src)&&(this.a.videoTracks?0==this.a.videoTracks.length:0==this.a.videoHeight)},Cs.prototype.isAudioOnly=Cs.prototype.uf,Cs.prototype.bg=function(){if(this.b){var e=this.b.presentationTimeline;return{start:e.ob(),end:e.Ca()}}return this.a&&this.a.src&&(e=this.a.seekable).length?{start:e.start(0),end:e.end(e.length-1)}:{start:0,end:0}},Cs.prototype.seekRange=Cs.prototype.bg,Cs.prototype.keySystem=function(){return _t(this.drmInfo())},Cs.prototype.keySystem=Cs.prototype.keySystem,Cs.prototype.drmInfo=function(){return this.h?this.h.a:null},Cs.prototype.drmInfo=Cs.prototype.drmInfo,Cs.prototype.Lb=function(){return this.h?this.h.Lb():1/0},Cs.prototype.getExpiration=Cs.prototype.Lb,Cs.prototype.Xc=function(){return!!this.B&&this.B.a==ko},Cs.prototype.isBuffering=Cs.prototype.Xc,Cs.prototype.ef=function(){if(this.W){var e=this.W;e=e.f?0:e.c}else e=0;return e},Cs.prototype.getPlaybackRate=Cs.prototype.ef,Cs.prototype.ug=function(e){0==e?q("A trick play rate of 0 is unsupported!"):(this.a.paused&&this.a.play(),this.W.set(e),this.i==ml&&la(this.f,1<Math.abs(e)))},Cs.prototype.trickPlay=Cs.prototype.ug,Cs.prototype.Ge=function(){this.i==gl&&this.W.set(1),this.i==ml&&(this.W.set(1),la(this.f,!1))},Cs.prototype.cancelTrickPlay=Cs.prototype.Ge,Cs.prototype.Vc=function(){if(this.b&&this.m){for(var e=ul(this),t=[],r=f(sl(this)),n=r.next();!n.done;n=r.next()){n=n.value;var i=Nr.Ed(n);i.active=n==e,t.push(i)}return t}return this.a&&this.a.audioTracks?Array.from(this.a.audioTracks).map((function(e){return Nr.rf(e)})):[]},Cs.prototype.getVariantTracks=Cs.prototype.Vc,Cs.prototype.qb=function(){if(this.b&&this.m){for(var e=function(e){var t=ll(e);if(null==t)return null;if(!go(e.$,t).text){var r=Nr.Jb(t.textStreams,e.na,e.fb);r.length&&mo(e.$,t,r[0])}return go(e.$,t).text}(this),t=[],r=f(function(e){var t=ll(e);return null==t?[]:t.textStreams.filter((function(t){return!e.ac.has(t)}))}(this)),n=r.next();!n.done;n=r.next()){n=n.value;var i=Nr.xc(n);i.active=n==e,t.push(i)}return t}return this.a&&this.a.src&&this.a.textTracks?Array.from(this.a.textTracks).map((function(e){return Nr.sf(e)})):[]},Cs.prototype.getTextTracks=Cs.prototype.qb,Cs.prototype.td=function(e){if(this.b&&this.f){var t=ll(this),r=t.textStreams.find((function(t){return t.id==e.id}));r&&(Ns(this,t,r,!1),Ks(this,r),this.na=r.language)}else if(this.a&&this.a.src&&this.a.textTracks){for(r=(t=f(t=Array.from(this.a.textTracks))).next();!r.done;r=t.next())r=r.value,Nr.Wc(r)==e.id?r.mode=this.gb?"showing":"hidden":r.mode="disabled";Xs(this)}},Cs.prototype.selectTextTrack=Cs.prototype.td,Cs.prototype.dg=function(){Kr("selectEmbeddedTextTrack","If closed captions are signaled in the manifest, a text stream will be created to represent them. Please use SelectTextTrack.");var e=this.qb().filter((function(e){return"application/cea-608"==e.mimeType}));0<e.length&&this.td(e[0])},Cs.prototype.selectEmbeddedTextTrack=Cs.prototype.dg,Cs.prototype.zg=function(){Kr("usingEmbeddedTextTrack","If closed captions are signaled in the manifest, a text stream will be created to represent them. There should be no reason to know if the player is playing embedded text.");var e=this.qb().filter((function(e){return e.active}))[0];return!!e&&"application/cea-608"==e.mimeType},Cs.prototype.usingEmbeddedTextTrack=Cs.prototype.zg,Cs.prototype.fg=function(e,t,r){if(r=void 0===r?0:r,this.b&&this.f){var n=ll(this);this.c.abr.enabled&&q("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");var i=n.variants.find((function(t){return t.id==e.id}));i&&Nr.rb(i)&&(Ms(this,n,i,!1),Bs(this,i,t,r),this.Gb=new Eo(i),Hs(this,n.variants))}else if(this.a&&this.a.audioTracks){for(r=(t=f(t=Array.from(this.a.audioTracks))).next();!r.done;r=t.next())r=r.value,Nr.Wc(r)==e.id&&(r.enabled=!0);qs(this)}},Cs.prototype.selectVariantTrack=Cs.prototype.fg,Cs.prototype.Re=function(){return al(this.Vc())},Cs.prototype.getAudioLanguagesAndRoles=Cs.prototype.Re,Cs.prototype.mf=function(){return al(this.qb())},Cs.prototype.getTextLanguagesAndRoles=Cs.prototype.mf,Cs.prototype.Qe=function(){return Array.from(ol(this.Vc()))},Cs.prototype.getAudioLanguages=Cs.prototype.Qe,Cs.prototype.lf=function(){return Array.from(ol(this.qb()))},Cs.prototype.getTextLanguages=Cs.prototype.lf,Cs.prototype.cg=function(e,t){if(this.b&&this.m){var r=ll(this);this.Gb=new To(e,t||"",0,"","audio"),zs(this,r)}else if(this.a&&this.a.audioTracks){for(var n=(r=f(r=Array.from(this.a.audioTracks))).next();!n.done;n=r.next())(n=n.value).language==e&&(n.enabled=!0);qs(this)}},Cs.prototype.selectAudioLanguage=Cs.prototype.cg,Cs.prototype.eg=function(e,t){if(this.b&&this.m){var r=ll(this);this.na=e,this.fb=t||"";var n=Nr.Jb(r.textStreams,this.na,this.fb)[0]||null;n&&(Ns(this,r,n,!1),(this.c.streaming.alwaysStreamText||this.mc())&&Ks(this,n))}else(r=this.qb().filter((function(t){return t.language==e}))[0])&&this.td(r)},Cs.prototype.selectTextLanguage=Cs.prototype.eg,Cs.prototype.gg=function(e){if(this.b&&this.m){for(var t=ll(this),r=null,n=f(sl(this)),i=n.next();!i.done;i=n.next())if((i=i.value).audio.label==e){r=i;break}null!=r&&(this.Gb=new To(r.language,"",0,e),zs(this,t))}},Cs.prototype.selectVariantsByLabel=Cs.prototype.gg,Cs.prototype.mc=function(){var e=this.gb;return this.D?this.D.g.isTextVisible():this.a&&this.a.src&&this.a.textTracks?Array.from(this.a.textTracks).some((function(e){return"showing"==e.mode})):e},Cs.prototype.isTextTrackVisible=Cs.prototype.mc,Cs.prototype.jg=function(e){var t=this;return p((function r(){var n,i,o,a;return M(r,(function(r){switch(r.j){case 1:if(t.gb==(n=!!e))return r.return();if(t.gb=n,t.i!=ml){if(t.a&&t.a.src&&t.a.textTracks)for(var s=f(Array.from(t.a.textTracks)),l=s.next();!l.done;l=s.next())"disabled"!=(i=l.value).mode&&(i.mode=n?"showing":"hidden");r.A(2);break}if(t.D.g.setTextVisibility(n),t.c.streaming.alwaysStreamText){r.A(2);break}if(!n){(s=t.f).D=!0,(l=s.b.get("text"))&&(xa(l),s.b.delete("text")),r.A(2);break}if(o=ll(t),!(0<(a=Nr.Jb(o.textStreams,t.na,t.fb)).length)){r.A(2);break}return S(r,sa(t.f,a[0]),2);case 2:Js(t),w(r)}}))}))},Cs.prototype.setTextTrackVisibility=Cs.prototype.jg,Cs.prototype.gf=function(){if(!this.V())return null;if(this.b)return new Date(1e3*(this.b.presentationTimeline.f+this.a.currentTime));if(this.a&&this.a.getStartDate){var e=this.a.getStartDate();return isNaN(e.getTime())?null:new Date(e.getTime()+1e3*this.a.currentTime)}return null},Cs.prototype.getPlayheadTimeAsDate=Cs.prototype.gf,Cs.prototype.jf=function(){if(!this.V())return null;if(this.b)return new Date(1e3*this.b.presentationTimeline.f);if(this.a&&this.a.getStartDate){var e=this.a.getStartDate();return isNaN(e.getTime())?null:e}return null},Cs.prototype.getPresentationStartTimeAsDate=Cs.prototype.jf,Cs.prototype.Sc=function(){var e={total:[],audio:[],video:[],text:[]};return this.i==gl&&(e.total=Kt(this.a.buffered)),this.i==ml&&this.D.Sc(e),e},Cs.prototype.getBufferedInfo=Cs.prototype.Sc,Cs.prototype.getStats=function(){if(this.i!=ml&&this.i!=gl)return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,estimatedBandwidth:NaN,loadLatency:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,switchHistory:[],stateHistory:[]};Vs(this);var e=this.a;if(e.getVideoPlaybackQuality){e=e.getVideoPlaybackQuality();var t=this.u,r=Number(e.totalVideoFrames);t.m=Number(e.droppedVideoFrames),t.l=r,this.u.i=Number(e.corruptedVideoFrames)}e=this.h&&(e=this.h).K?e.K:NaN,this.u.h=e,this.i==ml&&((e=ul(this))&&(this.u.s=e.bandwidth),e&&e.video&&(t=this.u,r=e.video.height||NaN,t.u=e.video.width||NaN,t.g=r),e=this.l.getBandwidthEstimate(),this.u.f=e);var n=this.u;e=n.u,t=n.g,r=n.s;for(var i=n.l,o=n.m,a=n.i,s=n.f,l=n.b,u=ws(n.a,"playing"),c=ws(n.a,"paused"),d=ws(n.a,"buffering"),h=n.h,p=function(e){function t(e){return{timestamp:e.timestamp,state:e.state,duration:e.duration}}for(var r=[],n=f(e.b),i=n.next();!i.done;i=n.next())r.push(t(i.value));return e.a&&r.push(t(e.a)),r}(n.a),m=[],g=(n=f(n.c.a)).next();!g.done;g=n.next())g=g.value,m.push({timestamp:g.timestamp,id:g.id,type:g.type,fromAdaptation:g.fromAdaptation,bandwidth:g.bandwidth});return{width:e,height:t,streamBandwidth:r,decodedFrames:i,droppedFrames:o,corruptedFrames:a,estimatedBandwidth:s,loadLatency:l,playTime:u,pauseTime:c,bufferingTime:d,licenseTime:h,stateHistory:p,switchHistory:m}},Cs.prototype.getStats=Cs.prototype.getStats,Cs.prototype.addTextTrack=function(e,t,r,n,i,o){var a=this;return p((function s(){var l,u,c,d,f,h,p,m,g;return M(s,(function(s){switch(s.j){case 1:if(a.i==gl)throw Error("State error!");if(a.i!=ml)throw Error("State error!");if(l=ll(a),u=Yt,c=a.b.periods.indexOf(l),f=(d=c+1)>=a.b.periods.length?a.b.presentationTimeline.Y():a.b.periods[d].startTime,1/0==(h=f-l.startTime))throw new me(1,4,4033);return p=new Zn(1,0,h,(function(){return[e]}),0,null),m={id:a.Xd++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return 1},getSegmentReference:function(e){return 1==e?p:null},initSegmentReference:null,presentationTimeOffset:0,mimeType:n,codecs:i||"",kind:r,encrypted:!1,keyId:null,language:t,label:o||null,type:u.ra,primary:!1,frameRate:void 0,pixelAspectRatio:void 0,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,audioSamplingRate:null,closedCaptions:null},a.ac.add(m),l.textStreams.push(m),S(s,sa(a.f,m),2);case 2:return(g=aa(a.f,"text"))&&mo(a.$,l,g),a.ac.delete(m),Ys(a,l),$s(a),s.return(Nr.xc(m))}}))}))},Cs.prototype.addTextTrack=Cs.prototype.addTextTrack,Cs.prototype.vd=function(e,t){this.bc.width=e,this.bc.height=t},Cs.prototype.setMaxHardwareResolution=Cs.prototype.vd,Cs.prototype.sd=function(){if(this.i==ml){var e=this.f;if(e.f)e=!1;else if(e.m)e=!1;else{for(var t=f(e.b.values()),r=t.next();!r.done;r=t.next())(r=r.value).Pb&&(r.Pb=!1,ka(e,r,.1));e=!0}}else e=!1;return e},Cs.prototype.retryStreaming=Cs.prototype.sd,Cs.prototype.Xe=function(){return this.b},Cs.prototype.getManifest=Cs.prototype.Xe,Cs.prototype.Ye=function(){return this.s?this.s.constructor:null},Cs.prototype.getManifestParserFactory=Cs.prototype.Ye,(n=Cs.prototype).Nc=function(e){var t=this.f?ia(this.f):null,r=this.f?oa(this.f):null;if(Nr.filterNewPeriod(this.h,t,r,e),!(t=e.variants).some(Nr.rb))throw new me(2,4,4011);if(nl(this,e.variants),Nr.Gd(t,this.c.restrictions,this.bc)&&this.f&&ll(this)==e&&$s(this),e=this.h?this.h.a:null)for(r=(t=f(t)).next();!r.done;r=t.next())for(var n=(r=f(r.value.drmInfos)).next();!n.done;n=r.next())if((n=n.value).keySystem==e.keySystem)for(var i=(n=f(n.initData||[])).next();!i.done;i=n.next())i=i.value,bt(this.h,i.initDataType,i.initData)},n.zf=function(e){try{this.kb=!0,this.l.disable(),Zs(this);var t=Hs(this,e.variants),r=Nr.Jb(e.textStreams,this.na,this.fb)[0]||null;this.pa&&(e.variants.includes(this.pa)&&(t=this.pa),this.pa=null),this.oa&&(e.textStreams.includes(this.oa)&&(r=this.oa),this.oa=null),t&&Ms(this,e,t,!0),r&&Ns(this,e,r,!0);var n=this.f,i=n.b.get("video");if(i)var o=n.c.periods[i.ia];else{var a=n.b.get("audio");o=a?n.c.periods[a.ia]:null}var s=t?t.audio:null;if(!o&&r){var l;if(l=s){e=r;var u=Ir(this.c.preferredTextLanguage),c=Ir(s.language),d=Ir(e.language);l=jr(d,u)&&!jr(c,d)}l&&(this.gb=!0),this.gb&&this.D.g.setTextVisibility(!0),Js(this)}return this.c.streaming.alwaysStreamText||this.mc()?{variant:t,text:r}:{variant:t,text:null}}catch(e){return this.Ma(e),{variant:null,text:null}}},n.Fe=function(){this.kb=!1,this.c.abr.enabled&&(this.l.enable(),Zs(this)),this.pa&&(ua(this.f,this.pa,this.Ud,this.Rd),qs(this),this.pa=null),this.oa&&(ca(this.f,this.oa,!0,0,!1),Xs(this),this.oa=null)},n.Ef=function(){this.s&&this.s.update&&this.s.update()},n.Jf=function(){this.m&&this.m.s()},n.Ma=function(e){if(this.i!=hl){var t=new Se("error",{detail:e});this.dispatchEvent(t),t.defaultPrevented&&(e.handled=!0)}};var hl=0,pl=1,ml=2,gl=3;function yl(e,t){var r=os(new is(e.wa(),e.ba()),t.periods[0],new yi(null,0)),n=t.appMetadata||{};return r=vl(r),{offlineUri:e.toString(),originalManifestUri:t.originalManifestUri,duration:t.duration,size:t.size,expiration:t.expiration,tracks:r,appMetadata:n}}function vl(e){for(var t=[],r=Nr.df(e.variants),n=(r=f(r)).next();!n.done;n=r.next())t.push(Nr.Ed(n.value));for(r=(e=f(e.textStreams)).next();!r.done;r=e.next())t.push(Nr.xc(r.value));return t}function bl(){this.a={}}function _l(e,t){var r=t.audio,n=t.video;if(r&&!n&&(e.a[r.id]=r.bandwidth||t.bandwidth),!r&&n&&(e.a[n.id]=n.bandwidth||t.bandwidth),r&&n){var i=r.bandwidth||393216,o=n.bandwidth||t.bandwidth-i;0>=o&&(o=t.bandwidth),e.a[r.id]=i,e.a[n.id]=o}}function Al(e,t){var r=e.a[t];return null==r&&(r=0),r}function El(e){this.a=!1,this.b=new ge,this.c=e}function Tl(e){var t=new wl;e.periods.forEach((function(e,r){var n=xl(e.variants);if(0==r)for(var i=(n=f(n.a)).next();!i.done;i=n.next())t.add(i.value);else!function(e,t){e.a=e.a.filter((function(e){return kl(t,e)}))}(t,n)}));for(var r=(e=f(e.periods)).next();!r.done;r=e.next())(r=r.value).variants=r.variants.filter((function(e){return kl(t,new Sl(e))}))}function Sl(e){var t=e.audio;e=e.video,this.b=t?t.mimeType:null,this.a=t?t.codecs.split(".")[0]:null,this.f=e?e.mimeType:null,this.c=e?e.codecs.split(".")[0]:null}function wl(){this.a=[]}function kl(e,t){return e.a.some((function(e){return t.b==e.b&&t.a==e.a&&t.f==e.f&&t.c==e.c}))}function xl(e){for(var t=new wl,r=(e=f(e)).next();!r.done;r=e.next())t.add(new Sl(r.value));return t}function Cl(e){var t=this;if(e&&e.constructor!=Cs)throw new me(2,9,9008);this.b=this.a=null,e?(this.a=e.c,this.b=e.Mb()):(this.a=As(),this.b=new Ie),this.f=!1,this.c=[],this.g=[];var r=!e;this.h=new El((function(){return p((function e(){var n;return M(e,(function(e){switch(e.j){case 1:return n=function(){},S(e,Promise.all(t.g.map((function(e){return e.then(n,n)}))),2);case 2:if(!r){e.A(3);break}return S(e,t.b.destroy(),3);case 3:t.a=null,t.b=null,w(e)}}))}))}))}function Rl(){if(Ze())e:{for(var e=f($a.values()),t=e.next();!t.done;t=e.next())if(t=(t=t.value)()){t.destroy(),e=!0;break e}e=!1}else e=!1;return e}function Ll(e,t){for(var r=[],n=f(e.periods),i=n.next();!i.done;i=n.next())for(var o=(i=f(i.value.streams)).next();!o.done;o=i.next())o=o.value,t&&"video"==o.contentType?r.push({contentType:qe(o.mimeType,o.codecs),robustness:e.drmInfo.videoRobustness}):t||"audio"!=o.contentType||r.push({contentType:qe(o.mimeType,o.codecs),robustness:e.drmInfo.audioRobustness});return r}function jl(e,t,r){return p((function n(){return M(n,(function(n){switch(n.j){case 1:return S(n,function(e,t,r,n){return p((function i(){var o,a,s;return M(i,(function(i){switch(i.j){case 1:return n.drmInfo?(o=function(e){var t=Array.from(e.a.keys());if(!t.length)throw new me(2,9,9e3,"No supported storage mechanisms found");return e.a.get(t[0]).getEmeSessionCell()}(r),a=n.sessionIds.map((function(e){return{sessionId:e,keySystem:n.drmInfo.keySystem,licenseUri:n.drmInfo.licenseServerUri,serverCertificate:n.drmInfo.serverCertificate,audioCapabilities:Ll(n,!1),videoCapabilities:Ll(n,!0)}})),S(i,cs(t,e,a),2)):i.return();case 2:return s=i.o,S(i,o.remove(s),3);case 3:return S(i,o.add(a.filter((function(e){return-1==s.indexOf(e.sessionId)}))),0)}}))}))}(e.b,e.a.drm,r,t),0)}}))}))}function Pl(e,t,r,n){function i(){s+=1,e.a.offline.progressCallback(l,s/a)}var o=function(e){var t=[];return e.periods.forEach((function(e){e.streams.forEach((function(e){null!=e.initSegmentKey&&t.push(e.initSegmentKey),e.segments.forEach((function(e){t.push(e.dataKey)}))}))})),t}(n),a=o.length+1,s=0,l=yl(r,n);return Promise.all([t.removeSegments(o,i),t.removeManifests([r.key()],i)])}function Il(e,t,r,n,i,o){var a={id:o.id,originalId:o.originalId,primary:o.primary,presentationTimeOffset:o.presentationTimeOffset||0,contentType:o.type,mimeType:o.mimeType,codecs:o.codecs,frameRate:o.frameRate,pixelAspectRatio:o.pixelAspectRatio,kind:o.kind,language:o.language,label:o.label,width:o.width||null,height:o.height||null,initSegmentKey:null,encrypted:o.encrypted,keyId:o.keyId,segments:[],variantIds:[]};i=i.presentationTimeline.Ob();var s=o.id,l=o.initSegmentReference;return l&&(l=vi(l.c(),l.b,l.a,e.a.streaming.retryParameters),Oa(t,s,l,.5*Al(n,o.id),!0,(function(t){return p((function n(){var i;return M(n,(function(n){switch(n.j){case 1:return S(n,r.addSegments([{data:t}]),2);case 2:i=n.o,e.c.push(i[0]),a.initSegmentKey=i[0],w(n)}}))}))}))),function(e,t,r){for(var n=null==(t=e.findSegmentPosition(t))?null:e.getSegmentReference(t);n;)r(n),n=e.getSegmentReference(++t)}(o,i,(function(i){var l=vi(i.c(),i.b,i.a,e.a.streaming.retryParameters);Oa(t,s,l,function(e,t,r){return r=r.endTime-r.startTime,Al(e,t)*r}(n,o.id,i),!1,(function(t){return p((function n(){var o;return M(n,(function(n){switch(n.j){case 1:return S(n,r.addSegments([{data:t}]),2);case 2:o=n.o,e.c.push(o[0]),a.segments.push({startTime:i.startTime,endTime:i.endTime,dataKey:o[0]}),w(n)}}))}))}))})),a}function Ol(e){if(e.h.a)throw new me(2,9,7001)}function Dl(){if(!Rl())throw new me(2,9,9e3)}function Ml(e,t){return p((function r(){return M(r,(function(r){switch(r.j){case 1:return e.g.push(t),x(r,2),S(r,t,4);case 4:return r.return(r.o);case 2:L(r),Re(e.g,t),j(r,0)}}))}))}function Nl(e){e.variants.map((function(e){return e.video}));var t=new Set(e.variants.map((function(e){return e.audio})));e=e.textStreams;for(var r=f(t),n=r.next();!n.done;n=r.next())for(var i=(n=f(t)).next();!i.done;i=n.next());for(r=(t=f(e)).next();!r.done;r=t.next())for(n=(r=f(e)).next();!n.done;n=r.next());}Cs.LoadMode={DESTROYED:hl,NOT_LOADED:pl,MEDIA_SOURCE:ml,SRC_EQUALS:gl},El.prototype.destroy=function(){var e=this;return this.a?this.b:(this.a=!0,this.c().then((function(){e.b.resolve()}),(function(){e.b.resolve()})))},wl.prototype.add=function(e){kl(this,e)||this.a.push(e)},G("shaka.offline.Storage",Cl),Cl.support=Rl,Cl.prototype.destroy=function(){return this.h.destroy()},Cl.prototype.destroy=Cl.prototype.destroy,Cl.prototype.configure=function(e,t){2==arguments.length&&"string"==typeof e&&(e=bs(e,t));var r=e,n=!1;return null!=r.trackSelectionCallback&&(n=!0,r.offline=r.offline||{},r.offline.trackSelectionCallback=r.trackSelectionCallback,delete r.trackSelectionCallback),null!=r.progressCallback&&(n=!0,r.offline=r.offline||{},r.offline.progressCallback=r.progressCallback,delete r.progressCallback),null!=r.usePersistentLicense&&(n=!0,r.offline=r.offline||{},r.offline.usePersistentLicense=r.usePersistentLicense,delete r.usePersistentLicense),n&&Kr("Storage.configure with OfflineConfig","Please configure storage with a player configuration."),Es(this.a,e)},Cl.prototype.configure=Cl.prototype.configure,Cl.prototype.getConfiguration=function(){var e=As();return Es(e,this.a,As()),e},Cl.prototype.getConfiguration=Cl.prototype.getConfiguration,Cl.prototype.Mb=function(){return this.b},Cl.prototype.getNetworkingEngine=Cl.prototype.Mb,Cl.prototype.store=function(e,t,r){var n=this;return Ml(this,function(e,t,r,n){return p((function i(){var o,a,s,l,u,c,d,h,m;return M(i,(function(i){switch(i.j){case 1:return Dl(),e.f?i.return(Promise.reject(new me(2,9,9006))):(e.f=!0,S(i,function(e,t,r){return p((function n(){var i,o,a,s,l,u;return M(n,(function(n){switch(n.j){case 1:return i=null,o=e.b,a={networkingEngine:o,filterAllPeriods:function(){},filterNewPeriod:function(){},onTimelineRegionAdded:function(){},onEvent:function(){},onError:function(e){i=e}},S(n,r(),2);case 2:return(s=n.o).configure(e.a.manifest),Ol(e),x(n,3),S(n,s.start(t,a),5);case 5:return l=n.o,Ol(e),u=function(e){for(var t=new Set,r=(e=f(e.periods)).next();!r.done;r=e.next()){for(var n=f((r=r.value).textStreams),i=n.next();!i.done;i=n.next())t.add(i.value);for(r=f(r.variants),n=r.next();!n.done;n=r.next())(n=n.value).audio&&t.add(n.audio),n.video&&t.add(n.video)}return t}(l),S(n,Promise.all(Ye(u,(function(e){return e.createSegmentIndex()}))),6);case 6:if(Ol(e),i)throw i;return n.return(l);case 3:return L(n),S(n,s.stop(),7);case 7:j(n,0)}}))}))}(e,t,n),2));case 2:if(o=i.o,Ol(e),o.presentationTimeline.V()||o.presentationTimeline.Xa())throw new me(2,9,9005,t);return a=null,s=new Ya,u=l=null,k(i,3,4),S(i,function(e,t,r){return p((function n(){var i,o,a;return M(n,(function(n){switch(n.j){case 1:return i=new pt({ub:e.b,onError:r,qc:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),o=Do(t.periods),a=e.a,i.configure(a.drm),S(n,function(e,t,r){return e.s=[],e.D=r,gt(e,t)}(i,o,a.offline.usePersistentLicense),2);case 2:return S(n,yt(i),3);case 3:return S(n,vt(i),4);case 4:return n.return(i)}}))}))}(e,o,(function(e){u=u||e})),6);case 6:if(a=i.o,Ol(e),u)throw u;return S(i,function(e,t,r){return p((function n(){var i;return M(n,(function(n){switch(n.j){case 1:return i={width:1/0,height:1/0},function(e,t,r){for(var n=(e=f(e.periods)).next();!n.done;n=e.next())(n=n.value).variants=n.variants.filter((function(e){return Nr.bd(e,t,r)}))}(t,e.a.restrictions,i),function(e){for(var t=(e=f(e.periods)).next();!t.done;t=e.next())(t=t.value).variants=t.variants.filter((function(e){var t=!0;return e.audio&&(t=t&&br(e.audio)),e.video&&(t=t&&br(e.video)),t}))}(t),function(e,t){for(var r=f(e.periods),n=r.next();!n.done;n=r.next())(n=n.value).variants=n.variants.filter((function(e){return Rt(t,e)}))}(t,r),Tl(t),S(n,function(e,t){return p((function r(){var n,i,o,a;return M(r,(function(r){switch(r.j){case 1:n=null,i=f(e.periods),o=i.next();case 2:if(o.done){r.A(0);break}return a=o.value,n&&(a.variants=a.variants.filter((function(e){return kl(n,new Sl(e))}))),S(r,t(a),5);case 5:n=xl(a.variants),o=i.next(),r.A(2)}}))}))}(t,(function(t){return p((function r(){var n,i,o,a,s,l,u,c;return M(r,(function(r){switch(r.j){case 1:n=Nr,i=[];for(var d=f(t.variants),h=d.next();!h.done;h=d.next())o=h.value,i.push(n.Ed(o));for(h=(d=f(t.textStreams)).next();!h.done;h=d.next())a=h.value,i.push(n.xc(a));return S(r,e.a.offline.trackSelectionCallback(i),2);case 2:for(s=r.o,l=new Set,u=new Set,h=(d=f(s)).next();!h.done;h=d.next())"variant"==(c=h.value).type&&l.add(c.id),"text"==c.type&&u.add(c.id);t.variants=t.variants.filter((function(e){return l.has(e.id)})),t.textStreams=t.textStreams.filter((function(e){return u.has(e.id)})),w(r)}}))}))})),2);case 2:(function(e){if(0==e.periods.length)throw new me(2,4,4014);for(var t=(e=f(e.periods)).next();!t.done;t=e.next())Nl(t.value)})(t),w(n)}}))}))}(e,o,a),7);case 7:return S(i,s.init(),8);case 8:return Ol(e),S(i,function(e){var t=null;if(e.a.forEach((function(e,r){e.getCells().forEach((function(e,n){e.hasFixedKeySpace()||t||(t={path:{wa:r,ba:n},ba:e})}))})),t)return t;throw new me(2,9,9013,"Could not find a cell that supports add-operations")}(s),9);case 9:return l=i.o,Ol(e),S(i,function(e,t,r,n,i,o){return p((function a(){var s,l,u,c,d,h,m,g,y,v;return M(a,(function(a){switch(a.j){case 1:return s=function(e,t,r){var n=null==t.expiration?1/0:t.expiration;return{offlineUri:null,originalManifestUri:e,duration:t.presentationTimeline.Y(),size:0,expiration:n,tracks:t=vl(t.periods[0]),appMetadata:r}}(i,n,o),l=n.periods.some((function(e){return e.variants.some((function(e){return e.drmInfos&&e.drmInfos.length}))})),u=n.periods.some((function(e){return e.variants.some((function(e){return e.drmInfos.some((function(e){return e.initData&&e.initData.length}))}))})),d=null,(c=l&&!u)&&(h=r.a,d=Ul.get(h.keySystem)),m=new Ia(e.b,(function(t,r){s.size=r,e.a.offline.progressCallback(s,t)}),(function(t,n){c&&e.a.offline.usePersistentLicense&&d==n&&bt(r,"cenc",t)})),x(a,2),y=g=function(e,t,r,n,i,o,a){var s=new bl,l=i.periods.map((function(n){return function(e,t,r,n,i,o){for(var a=f(o.variants),s=a.next();!s.done;s=a.next())_l(n,s.value);for(a=f(o.textStreams),s=a.next();!s.done;s=a.next())n.a[s.value.id]=52;a=function(e){for(var t=new Set,r=f(e.textStreams),n=r.next();!n.done;n=r.next())t.add(n.value);for(e=f(e.variants),r=e.next();!r.done;r=e.next())(r=r.value).audio&&t.add(r.audio),r.video&&t.add(r.video);return t}(o);var l=new Map;for(a=f(a),s=a.next();!s.done;s=a.next()){s=s.value;var u=Il(e,t,r,n,i,s);l.set(s.id,u)}return o.variants.forEach((function(e){e.audio&&l.get(e.audio.id).variantIds.push(e.id),e.video&&l.get(e.video.id).variantIds.push(e.id)})),{startTime:o.startTime,streams:Array.from(l.values())}}(e,t,r,s,i,n)})),u=n.a,c=e.a.offline.usePersistentLicense;return u&&c&&(u.initData=[]),{originalManifestUri:o,duration:i.presentationTimeline.Y(),size:0,expiration:n.Lb(),periods:l,sessionIds:c?Et(n):[],drmInfo:u,appMetadata:a}}(e,m,t,r,n,i,o),S(a,function(e){return p((function t(){return M(t,(function(t){switch(t.j){case 1:return S(t,Promise.all(e.b.values()),2);case 2:return t.return(e.a.a)}}))}))}(m),4);case 4:if(y.size=a.o,g.expiration=r.Lb(),v=Et(r),g.sessionIds=e.a.offline.usePersistentLicense?v:[],l&&e.a.offline.usePersistentLicense&&!v.length)throw new me(2,9,9007);return a.return(g);case 2:return L(a),S(a,m.destroy(),5);case 5:j(a,0)}}))}))}(e,l.ba,a,o,t,r),10);case 10:if(c=i.o,Ol(e),u)throw u;return S(i,l.ba.addManifests([c]),11);case 11:return d=i.o,Ol(e),h=new rs("manifest",l.path.wa,l.path.ba,d[0]),i.return(yl(h,c));case 4:return L(i),e.f=!1,e.c=[],S(i,s.destroy(),12);case 12:if(!a){i.A(13);break}return S(i,a.destroy(),13);case 13:j(i,0);break;case 3:if(m=R(i),!l){i.A(15);break}return S(i,l.ba.removeSegments(e.c,(function(){})),15);case 15:throw u||m}}))}))}(this,e,t||{},(function(){return p((function t(){var i,o;return M(t,(function(t){switch(t.j){case 1:return r&&"string"!=typeof r?(Kr("Storing with a manifest parser factory","Please register a manifest parser and for the mime-type."),i=r,t.return(new i)):S(t,gi.create(e,n.b,n.a.manifest.retryParameters,r),2);case 2:return o=t.o,t.return(o)}}))}))})))},Cl.prototype.store=Cl.prototype.store,Cl.prototype.kf=function(){return this.f},Cl.prototype.getStoreInProgress=Cl.prototype.kf,Cl.prototype.remove=function(e){return Ml(this,function(e,t){return p((function r(){var n,i,o,a,s,l;return M(r,(function(r){switch(r.j){case 1:return Dl(),null==(n=ns(t))||"manifest"!=n.a?r.return(Promise.reject(new me(2,9,9004,t))):(i=n,o=new Ya,x(r,2),S(r,o.init(),4));case 4:return S(r,za(o,i.wa(),i.ba()),5);case 5:return S(r,(a=r.o).getManifests([i.key()]),6);case 6:return s=r.o,l=s[0],S(r,Promise.all([jl(e,l,o),Pl(e,a,i,l)]),2);case 2:return L(r),S(r,o.destroy(),8);case 8:j(r,0)}}))}))}(this,e))},Cl.prototype.remove=Cl.prototype.remove,Cl.prototype.Xf=function(){return Ml(this,function(e){return p((function t(){var r,n,i,o,a,s,l,u,c;return M(t,(function(t){switch(t.j){case 1:return Dl(),r=e.b,n=e.a.drm,i=new Ya,o=!1,x(t,2),S(t,i.init(),4);case 4:for(a=[],function(e,t){e.a.forEach((function(e){t(e.getEmeSessionCell())}))}(i,(function(e){return a.push(e)})),s=Promise.resolve(),l={},u=f(a),c=u.next();!c.done;l={wc:l.wc},c=u.next())l.wc=c.value,s=s.then(function(e){return function(){return p((function t(){var i,a;return M(t,(function(t){switch(t.j){case 1:return S(t,e.wc.getAll(),2);case 2:return i=t.o,S(t,cs(n,r,i),3);case 3:return a=t.o,S(t,e.wc.remove(a),4);case 4:a.length!=i.length&&(o=!0),w(t)}}))}))}}(l));return S(t,s,2);case 2:return L(t),S(t,i.destroy(),6);case 6:j(t,3);break;case 3:return t.return(!o)}}))}))}(this))},Cl.prototype.removeEmeSessions=Cl.prototype.Xf,Cl.prototype.list=function(){return Ml(this,p((function e(){var t,r,n;return M(e,(function(e){switch(e.j){case 1:return Dl(),t=[],r=new Ya,x(e,2),S(e,r.init(),4);case 4:return n=Promise.resolve(),function(e,t){e.a.forEach((function(e,r){e.getCells().forEach((function(e,n){t({wa:r,ba:n},e)}))}))}(r,(function(e,r){n=n.then((function(){return p((function n(){return M(n,(function(n){switch(n.j){case 1:return S(n,r.getAllManifests(),2);case 2:n.o.forEach((function(r,n){var i=yl(new rs("manifest",e.wa,e.ba,n),r);t.push(i)})),w(n)}}))}))}))})),S(e,n,2);case 2:return L(e),S(e,r.destroy(),6);case 6:j(e,3);break;case 3:return e.return(t)}}))})))},Cl.prototype.list=Cl.prototype.list,Cl.deleteAll=function(){return p((function e(){var t;return M(e,(function(e){switch(e.j){case 1:return t=new Ya,x(e,2),S(e,t.erase(),2);case 2:return L(e),S(e,t.destroy(),5);case 5:j(e,0)}}))}))};var Ul=(new Map).set("org.w3.clearkey","1077efecc0b24d02ace33c1e52e2fb4b").set("com.widevine.alpha","edef8ba979d64acea3c827dcd51d21ed").set("com.microsoft.playready","9a04f07998404286ab92e65be0885f95").set("com.adobe.primetime","f239e769efa348509c16a903c6932efb");js.offline=Rl,G("shaka.polyfill.installAll",(function(){for(var e=0;e<Kl.length;++e)try{Kl[e].De()}catch(e){q("Error installing polyfill!",e)}}));var Fl,Bl,Kl=[];function Gl(e,t){for(var r={priority:t=t||0,De:e},n=0;n<Kl.length;n++)if(Kl[n].priority<t)return void Kl.splice(n,0,r);Kl.push(r)}function Vl(e){var t=e.type.replace(/^(webkit|moz|MS)/,"").toLowerCase();if("function"==typeof Event)var r=new Event(t,e);else(r=document.createEvent("Event")).initEvent(t,e.bubbles,e.cancelable);e.target.dispatchEvent(r)}function Hl(e,t,r){if("input"==e)switch(this.type){case"range":e="change"}HTMLInputElement.prototype.originalAddEventListener.call(this,e,t,r)}function Yl(){var e=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(t){for(var r=[],n=0;n<arguments.length;++n)r[n]=arguments[n];return(r=e.apply(this,r)).abort=function(){},r}}function zl(e,t){try{var r=new Wl(e,t);return Promise.resolve(r)}catch(e){return Promise.reject(e)}}function Wl(e,t){if(this.keySystem=e,e.startsWith("com.apple.fps"))for(var r=f(t),n=r.next();!n.done;n=r.next()){var i=n.value;if("required"==i.persistentState)n=null;else{n={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:i.initDataTypes,sessionTypes:["temporary"],label:i.label};var o=!1,a=!1;if(i.audioCapabilities)for(var s=f(i.audioCapabilities),l=s.next();!l.done;l=s.next())if((l=l.value).contentType){o=!0;var u=l.contentType.split(";")[0];WebKitMediaKeys.isTypeSupported(this.keySystem,u)&&(n.audioCapabilities.push(l),a=!0)}if(i.videoCapabilities)for(l=(i=f(i.videoCapabilities)).next();!l.done;l=i.next())(s=l.value).contentType&&(o=!0,l=s.contentType.split(";")[0],WebKitMediaKeys.isTypeSupported(this.keySystem,l)&&(n.videoCapabilities.push(s),a=!0));o||(a=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),n=a?n:null}if(n)return void(this.a=n)}throw(r=Error("Unsupported keySystem")).name="NotSupportedError",r.code=DOMException.NOT_SUPPORTED_ERR,r}function $l(e){var t=this.mediaKeys;return t&&t!=e&&Xl(t,null),delete this.mediaKeys,(this.mediaKeys=e)?Xl(e,this):Promise.resolve()}function ql(e){this.b=new WebKitMediaKeys(e),this.a=new Be}function Xl(e,t){if(e.a.$a(),!t)return Promise.resolve();e.a.w(t,"webkitneedkey",Zl);try{return 1<=t.readyState?t.webkitSetMediaKeys(e.b):e.a.da(t,"loadedmetadata",(function(){t.webkitSetMediaKeys(e.b)})),Promise.resolve()}catch(e){return Promise.reject(e)}}function Jl(e){ke.call(this),this.b=null,this.g=e,this.c=this.a=null,this.f=new Be,this.sessionId="",this.expiration=NaN,this.closed=new ge,this.keyStatuses=new eu}function Zl(e){var t=new Event("encrypted");t.initDataType="cenc",t.initData=e.initData,this.dispatchEvent(t)}function Ql(e,t){var r=e.keyStatuses;r.size=null==t?0:1,r.a=t,e.dispatchEvent(new Se("keystatuseschange"))}function eu(){this.size=0,this.a=void 0}function tu(e,t){try{var r=new ru(e,t);return Promise.resolve(r)}catch(e){return Promise.reject(e)}}function ru(e,t){this.keySystem=e;for(var r=!1,n=0;n<t.length;++n){var i=t[n],o={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:i.initDataTypes,sessionTypes:["temporary"],label:i.label},a=!1;if(i.audioCapabilities)for(var s=0;s<i.audioCapabilities.length;++s){var l=i.audioCapabilities[s];if(l.contentType){a=!0;var u=l.contentType.split(";")[0];MSMediaKeys.isTypeSupported(this.keySystem,u)&&(o.audioCapabilities.push(l),r=!0)}}if(i.videoCapabilities)for(s=0;s<i.videoCapabilities.length;++s)(l=i.videoCapabilities[s]).contentType&&(a=!0,u=l.contentType.split(";")[0],MSMediaKeys.isTypeSupported(this.keySystem,u)&&(o.videoCapabilities.push(l),r=!0));if(a||(r=MSMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),"required"==i.persistentState&&(r=!1),r)return void(this.a=o)}throw(r=Error("Unsupported keySystem")).name="NotSupportedError",r.code=DOMException.NOT_SUPPORTED_ERR,r}function nu(e){var t=this.mediaKeys;return t&&t!=e&&ou(t,null),delete this.mediaKeys,(this.mediaKeys=e)?ou(e,this):Promise.resolve()}function iu(e){this.a=new MSMediaKeys(e),this.b=new Be}function ou(e,t){if(e.b.$a(),!t)return Promise.resolve();e.b.w(t,"msneedkey",su);var r=e;try{return 1<=t.readyState?t.msSetMediaKeys(e.a):t.addEventListener("loadedmetadata",(function e(){t.msSetMediaKeys(r.a),t.removeEventListener("loadedmetadata",e)})),Promise.resolve()}catch(e){return Promise.reject(e)}}function au(e){ke.call(this),this.c=null,this.g=e,this.b=this.a=null,this.f=new Be,this.sessionId="",this.expiration=NaN,this.closed=new ge,this.keyStatuses=new uu}function su(e){if(e.initData){var t=document.createEvent("CustomEvent");t.initCustomEvent("encrypted",!1,!1,null),t.initDataType="cenc",t.initData=function(e){if(!e)return e;var t=new Fn(e);if(1>=t.data.length)return e;e=[];for(var r={},n=(t=f(t.data)).next();!n.done;r={lc:r.lc},n=t.next())r.lc=n.value,e.some(function(e){return function(t){return ht.za(t,e.lc)}}(r))||e.push(r.lc);return ht.concat.apply(ht,e instanceof Array?e:function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(f(e)))}(e.initData),this.dispatchEvent(t)}}function lu(e,t){var r=e.keyStatuses;r.size=null==t?0:1,r.a=t,e.dispatchEvent(new Se("keystatuseschange"))}function uu(){this.size=0,this.a=void 0}function cu(){return Promise.reject(Error("The key system specified is not supported."))}function du(e){return null==e?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}function fu(){throw new TypeError("Illegal constructor.")}function hu(){throw new TypeError("Illegal constructor.")}G("shaka.polyfill.register",Gl),Gl((function(){Sc()}),-1),Gl((function(){if(e.Document){var t=Element.prototype;t.requestFullscreen=t.requestFullscreen||t.mozRequestFullScreen||t.msRequestFullscreen||t.webkitRequestFullscreen,(t=Document.prototype).exitFullscreen=t.exitFullscreen||t.mozCancelFullScreen||t.msExitFullscreen||t.webkitExitFullscreen,"fullscreenElement"in document||(Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}})),document.addEventListener("webkitfullscreenchange",Vl),document.addEventListener("webkitfullscreenerror",Vl),document.addEventListener("mozfullscreenchange",Vl),document.addEventListener("mozfullscreenerror",Vl),document.addEventListener("MSFullscreenChange",Vl),document.addEventListener("MSFullscreenError",Vl)}})),Gl((function(){var t=!1;if(rt("CrKey"))t=!0;else try{e.indexedDB&&(t=!1)}catch(e){t=!0}t&&delete e.indexedDB})),Gl((function(){rt("Trident/")&&!HTMLInputElement.prototype.originalAddEventListener&&(HTMLInputElement.prototype.originalAddEventListener=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=Hl)})),Gl((function(){navigator.languages||Object.defineProperty(navigator,"languages",{get:function(){return navigator.language?[navigator.language]:["en"]}})})),Gl((function(){})),Gl((function(){var t=tt();e.MediaSource&&(e.cast&&cast.__platform__&&cast.__platform__.canDisplayType?function(){var e=MediaSource.isTypeSupported,t=/^dv(?:h[e1]|a[v1])\./;MediaSource.isTypeSupported=function(r){for(var n=r.split(/ *; */),i=n[0],o={},a=1;a<n.length;++a){var s=n[a].split("="),l=s[0];s=s[1].replace(/"(.*)"/,"$1"),o[l]=s}if(!(n=o.codecs))return e(r);var u=!1,c=!1;for(var d in r=n.split(",").filter((function(e){return t.test(e)&&(c=!0),/^(hev|hvc)1\.2/.test(e)&&(u=!0),!0})),c&&(u=!1),o.codecs=r.join(","),u&&(o.eotf="smpte2084"),o)i+="; "+d+'="'+o[d]+'"';return cast.__platform__.canDisplayType(i)}}():t?(function(){var e=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(t){return"mp2t"!=t.split(/ *; */)[0].split("/")[1].toLowerCase()&&e(t)}}(),12>=t?(Yl(),function(){var e=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(t,r){return e.call(this,t,r-.001)}}()):Yl()):rt("Tizen")&&function(){var e=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(t){return"opus"!=Xe(t)[0]&&e(t)}}())})),Wl.prototype.createMediaKeys=function(){var e=new ql(this.keySystem);return Promise.resolve(e)},Wl.prototype.getConfiguration=function(){return this.a},ql.prototype.createSession=function(e){if("temporary"!=(e=e||"temporary"))throw new TypeError("Session type "+e+" is unsupported on this platform.");return new Jl(this.b,e)},ql.prototype.setServerCertificate=function(e){return e&&new Uint8Array(e),Promise.resolve(!0)},V(Jl,ke),(n=Jl.prototype).generateRequest=function(e,t){this.a=new ge;try{this.b=this.g.createSession("video/mp4",new Uint8Array(t)),this.sessionId=this.b.sessionId||"",this.f.w(this.b,"webkitkeymessage",this.og.bind(this)),this.f.w(this.b,"webkitkeyadded",this.mg.bind(this)),this.f.w(this.b,"webkitkeyerror",this.ng.bind(this)),Ql(this,"status-pending")}catch(e){this.a.reject(e)}return this.a},n.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},n.update=function(e){this.c=new ge;try{this.b.update(new Uint8Array(e))}catch(e){this.c.reject(e)}return this.c},n.close=function(){try{this.b.close(),this.closed.resolve(),this.f.$a()}catch(e){this.closed.reject(e)}return this.closed},n.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))},n.og=function(e){this.a&&(this.a.resolve(),this.a=null),this.dispatchEvent(new Se("message",{messageType:null==this.keyStatuses.a?"license-request":"license-renewal",message:e.message.buffer}))},n.mg=function(){this.c&&(Ql(this,"usable"),this.c.resolve(),this.c=null)},n.ng=function(){var e=Error("EME PatchedMediaKeysApple key error");if(e.errorCode=this.b.error,null!=this.a)this.a.reject(e),this.a=null;else if(null!=this.c)this.c.reject(e),this.c=null;else switch(this.b.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:Ql(this,"output-not-allowed");break;default:Ql(this,"internal-error")}},(n=eu.prototype).forEach=function(e){this.a&&e(this.a,Fl)},n.get=function(e){if(this.has(e))return this.a},n.has=function(e){var t=Fl;return!(!this.a||!ht.za(new Uint8Array(e),new Uint8Array(t)))},n.entries=function(){},n.keys=function(){},n.values=function(){},Gl((function(){e.HTMLVideoElement&&e.WebKitMediaKeys&&(Fl=new Uint8Array([0]).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=$l,e.MediaKeys=ql,e.MediaKeySystemAccess=Wl,navigator.requestMediaKeySystemAccess=zl)})),ru.prototype.createMediaKeys=function(){var e=new iu(this.keySystem);return Promise.resolve(e)},ru.prototype.getConfiguration=function(){return this.a},iu.prototype.createSession=function(e){if("temporary"!=(e=e||"temporary"))throw new TypeError("Session type "+e+" is unsupported on this platform.");return new au(this.a,e)},iu.prototype.setServerCertificate=function(){return Promise.resolve(!1)},V(au,ke),(n=au.prototype).generateRequest=function(e,t){this.a=new ge;try{this.c=this.g.createSession("video/mp4",new Uint8Array(t),null),this.f.w(this.c,"mskeymessage",this.If.bind(this)),this.f.w(this.c,"mskeyadded",this.Gf.bind(this)),this.f.w(this.c,"mskeyerror",this.Hf.bind(this)),lu(this,"status-pending")}catch(e){this.a.reject(e)}return this.a},n.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},n.update=function(e){this.b=new ge;try{this.c.update(new Uint8Array(e))}catch(e){this.b.reject(e)}return this.b},n.close=function(){try{this.c.close(),this.closed.resolve(),this.f.$a()}catch(e){this.closed.reject(e)}return this.closed},n.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))},n.If=function(e){this.a&&(this.a.resolve(),this.a=null),this.dispatchEvent(new Se("message",{messageType:null==this.keyStatuses.a?"license-request":"license-renewal",message:e.message.buffer}))},n.Gf=function(){this.a?(lu(this,"usable"),this.a.resolve(),this.a=null):this.b&&(lu(this,"usable"),this.b.resolve(),this.b=null)},n.Hf=function(){var e=Error("EME PatchedMediaKeysMs key error");if(e.errorCode=this.c.error,null!=this.a)this.a.reject(e),this.a=null;else if(null!=this.b)this.b.reject(e),this.b=null;else switch(this.c.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:lu(this,"output-not-allowed");break;default:lu(this,"internal-error")}},(n=uu.prototype).forEach=function(e){this.a&&e(this.a,Bl)},n.get=function(e){if(this.has(e))return this.a},n.has=function(e){var t=Bl;return!(!this.a||!ht.za(new Uint8Array(e),new Uint8Array(t)))},n.entries=function(){},n.keys=function(){},n.values=function(){},Gl((function(){!e.HTMLVideoElement||!e.MSMediaKeys||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(Bl=new Uint8Array([0]).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=nu,e.MediaKeys=iu,e.MediaKeySystemAccess=ru,navigator.requestMediaKeySystemAccess=tu)})),fu.prototype.createSession=function(){},fu.prototype.setServerCertificate=function(){},hu.prototype.getConfiguration=function(){},hu.prototype.createMediaKeys=function(){},Gl((function(){!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(navigator.requestMediaKeySystemAccess=cu,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=du,e.MediaKeys=fu,e.MediaKeySystemAccess=hu)}),-10);var pu,mu="";function gu(e){return mu?mu+e.charAt(0).toUpperCase()+e.slice(1):e}function yu(e,t){try{var r=new bu(e,t);return Promise.resolve(r)}catch(e){return Promise.reject(e)}}function vu(e){var t=this.mediaKeys;return t&&t!=e&&Au(t,null),delete this.mediaKeys,(this.mediaKeys=e)&&Au(e,this),Promise.resolve()}function bu(e,t){this.a=this.keySystem=e;var r=!1;"org.w3.clearkey"==e&&(this.a="webkit-org.w3.clearkey",r=!1);var n=!1,i=document.getElementsByTagName("video");i=i.length?i[0]:document.createElement("video");for(var o=0;o<t.length;++o){var a=t[o],s={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:a.initDataTypes,sessionTypes:["temporary"],label:a.label},l=!1;if(a.audioCapabilities)for(var u=0;u<a.audioCapabilities.length;++u){var c=a.audioCapabilities[u];if(c.contentType){l=!0;var d=c.contentType.split(";")[0];i.canPlayType(d,this.a)&&(s.audioCapabilities.push(c),n=!0)}}if(a.videoCapabilities)for(u=0;u<a.videoCapabilities.length;++u)(c=a.videoCapabilities[u]).contentType&&(l=!0,i.canPlayType(c.contentType,this.a)&&(s.videoCapabilities.push(c),n=!0));if(l||(n=i.canPlayType("video/mp4",this.a)||i.canPlayType("video/webm",this.a)),"required"==a.persistentState&&(r?(s.persistentState="required",s.sessionTypes=["persistent-license"]):n=!1),n)return void(this.b=s)}throw r="Unsupported keySystem","org.w3.clearkey"!=e&&"com.widevine.alpha"!=e||(r="None of the requested configurations were supported."),(r=Error(r)).name="NotSupportedError",r.code=DOMException.NOT_SUPPORTED_ERR,r}function _u(e){this.g=e,this.b=null,this.a=new Be,this.c=[],this.f={}}function Au(e,t){e.b=t,e.a.$a();var r=mu;t&&(e.a.w(t,r+"needkey",e.Mf.bind(e)),e.a.w(t,r+"keymessage",e.rg.bind(e)),e.a.w(t,r+"keyadded",e.pg.bind(e)),e.a.w(t,r+"keyerror",e.qg.bind(e)))}function Eu(e,t){var r=e.f[t];return r||((r=e.c.shift())?(r.sessionId=t,e.f[t]=r):null)}function Tu(e,t,r){ke.call(this),this.f=e,this.h=!1,this.a=this.b=null,this.c=t,this.g=r,this.sessionId="",this.expiration=NaN,this.closed=new ge,this.keyStatuses=new ku}function Su(e,t,r){if(e.h)return Promise.reject(Error("The session is already initialized."));e.h=!0;try{if("persistent-license"==e.g)if(r)var n=new Uint8Array(ut("LOAD_SESSION|"+r));else{var i=ut("PERSISTENT|"),o=new Uint8Array(i.byteLength+t.byteLength);o.set(new Uint8Array(i),0),o.set(new Uint8Array(t),i.byteLength),n=o}else n=new Uint8Array(t)}catch(e){return Promise.reject(e)}e.b=new ge;var a=gu("generateKeyRequest");try{e.f[a](e.c,n)}catch(t){if("InvalidStateError"!=t.name)return e.b=null,Promise.reject(t);new fe((function(){try{e.f[a](e.c,n)}catch(t){e.b.reject(t),e.b=null}})).R(.01)}return e.b}function wu(e,t){var r=e.keyStatuses;r.size=null==t?0:1,r.a=t,e.dispatchEvent(new Se("keystatuseschange"))}function ku(){this.size=0,this.a=void 0}function xu(e){if("picture-in-picture"==(e=e.target).webkitPresentationMode){document.pictureInPictureElement=e;var t=new Event("enterpictureinpicture");e.dispatchEvent(t)}else document.pictureInPictureElement==e&&(document.pictureInPictureElement=null),t=new Event("leavepictureinpicture"),e.dispatchEvent(t)}function Cu(){return this.webkitSupportsPresentationMode("picture-in-picture")?(this.webkitSetPresentationMode("picture-in-picture"),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))}function Ru(){var e=document.pictureInPictureElement;return e?(e.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))}function Lu(){return!!this.hasAttribute("disablePictureInPicture")||!this.webkitSupportsPresentationMode("picture-in-picture")}function ju(e){e?this.setAttribute("disablePictureInPicture",""):this.removeAttribute("disablePictureInPicture")}function Pu(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}function Iu(t,r,n){return new e.TextTrackCue(t,r,n)}function Ou(t,r,n){return new e.TextTrackCue(t+"-"+r+"-"+n,t,r,n)}function Du(){}bu.prototype.createMediaKeys=function(){var e=new _u(this.a);return Promise.resolve(e)},bu.prototype.getConfiguration=function(){return this.b},(n=_u.prototype).createSession=function(e){if("temporary"!=(e=e||"temporary")&&"persistent-license"!=e)throw new TypeError("Session type "+e+" is unsupported on this platform.");var t=this.b||document.createElement("video");return t.src||(t.src="about:blank"),e=new Tu(t,this.g,e),this.c.push(e),e},n.setServerCertificate=function(){return Promise.resolve(!1)},n.Mf=function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("encrypted",!1,!1,null),t.initDataType="webm",t.initData=e.initData,this.b.dispatchEvent(t)},n.rg=function(e){var t=Eu(this,e.sessionId);t&&(e=new Se("message",{messageType:null==t.keyStatuses.a?"licenserequest":"licenserenewal",message:e.message}),t.b&&(t.b.resolve(),t.b=null),t.dispatchEvent(e))},n.pg=function(e){(e=Eu(this,e.sessionId))&&(wu(e,"usable"),e.a&&e.a.resolve(),e.a=null)},n.qg=function(e){var t=Eu(this,e.sessionId);t&&t.handleError(e)},V(Tu,ke),(n=Tu.prototype).handleError=function(e){var t=Error("EME v0.1b key error");t.errorCode=e.errorCode,t.errorCode.systemCode=e.systemCode,!e.sessionId&&this.b?(t.method="generateRequest",45==e.systemCode&&(t.message="Unsupported session type."),this.b.reject(t),this.b=null):e.sessionId&&this.a?(t.method="update",this.a.reject(t),this.a=null):(t=e.systemCode,e.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?wu(this,"output-restricted"):wu(this,1==t?"expired":"internal-error"))},n.yd=function(e,t){if(this.a)this.a.then(this.yd.bind(this,e,t)).catch(this.yd.bind(this,e,t));else{if(this.a=e,"webkit-org.w3.clearkey"==this.c){var r=at(t),n=JSON.parse(r);"oct"!=n.keys[0].kty&&(this.a.reject(Error("Response is not a valid JSON Web Key Set.")),this.a=null),r=ht.Ba(n.keys[0].k),n=ht.Ba(n.keys[0].kid)}else r=new Uint8Array(t),n=null;var i=gu("addKey");try{this.f[i](this.c,r,n,this.sessionId)}catch(e){this.a.reject(e),this.a=null}}},n.generateRequest=function(e,t){return Su(this,t,null)},n.load=function(e){return"persistent-license"==this.g?Su(this,null,e):Promise.reject(Error("Not a persistent session."))},n.update=function(e){var t=new ge;return this.yd(t,e),t},n.close=function(){if("persistent-license"!=this.g){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var e=gu("cancelKeyRequest");try{this.f[e](this.c,this.sessionId)}catch(e){}}return this.closed.resolve(),this.closed},n.remove=function(){return"persistent-license"!=this.g?Promise.reject(Error("Not a persistent session.")):this.close()},(n=ku.prototype).forEach=function(e){this.a&&e(this.a,pu)},n.get=function(e){if(this.has(e))return this.a},n.has=function(e){var t=pu;return!(!this.a||!ht.za(new Uint8Array(e),new Uint8Array(t)))},n.entries=function(){},n.keys=function(){},n.values=function(){},Gl((function(){if(!(!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)mu="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;pu=new Uint8Array([0]).buffer,navigator.requestMediaKeySystemAccess=yu,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=vu,e.MediaKeys=_u,e.MediaKeySystemAccess=bu}})),Gl((function(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;t.requestPictureInPicture&&document.exitPictureInPicture||!t.webkitSupportsPresentationMode||(document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,t.requestPictureInPicture=Cu,Object.defineProperty(t,"disablePictureInPicture",{get:Lu,set:ju,enumerable:!0,configurable:!0}),document.exitPictureInPicture=Ru,document.addEventListener("webkitpresentationmodechanged",xu,!0))}})),Gl((function(){if(e.HTMLMediaElement){var t=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var e=t.apply(this);return e&&e.catch((function(){})),e}}})),Gl((function(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;!t.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in t&&(t.getVideoPlaybackQuality=Pu)}})),Gl((function(){if(!e.VTTCue&&e.TextTrackCue){var t=TextTrackCue.length;if(3==t)e.VTTCue=Iu;else if(6==t)e.VTTCue=Ou;else{try{var r=!!Iu(1,2,"")}catch(e){r=!1}r&&(e.VTTCue=Iu)}}})),G("shaka.text.TtmlTextParser",Du),Du.prototype.parseInit=function(){},Du.prototype.parseInit=Du.prototype.parseInit,Du.prototype.parseMedia=function(e,t){var r=at(e),n=[],i=new DOMParser,o=null;if(""==r)return n;try{o=i.parseFromString(r,"text/xml")}catch(e){throw new me(2,2,2005,"Failed to parse TTML.")}if(o){if(r=o.getElementsByTagName("parsererror")[0])throw new me(2,2,2005,r.textContent);if(!(i=o.getElementsByTagName("tt")[0]))throw new me(2,2,2005,"TTML does not contain <tt> tag.");var a=Bn.getAttributeNS(i,"http://www.w3.org/ns/ttml#parameter","frameRate"),s=Bn.getAttributeNS(i,"http://www.w3.org/ns/ttml#parameter","subFrameRate"),l=Bn.getAttributeNS(i,"http://www.w3.org/ns/ttml#parameter","frameRateMultiplier"),u=Bn.getAttributeNS(i,"http://www.w3.org/ns/ttml#parameter","tickRate");if(o=i.getAttribute("xml:space")||"default",r=i.getAttribute("tts:extent"),"default"!=o&&"preserve"!=o)throw new me(2,2,2005,"Invalid xml:space value: "+o);o="default"==o,a=new ic(a,s,l,u),s=qu(i.getElementsByTagName("metadata")[0]),l=qu(i.getElementsByTagName("styling")[0]),u=qu(i.getElementsByTagName("layout")[0]);for(var c=[],d=0;d<u.length;d++){var h,p,m=u[d],g=l,y=r,v=new ur,b=m.getAttribute("xml:id");b?(v.id=b,b=null,y&&(b=Uu.exec(y)||Bu.exec(y)),y=b?Number(b[1]):null,b=b?Number(b[2]):null,(h=Qu(m,g,"extent"))&&null!=(h=(p=Uu.exec(h))||Bu.exec(h))&&(v.width=null!=y?100*Number(h[1])/y:Number(h[1]),v.height=null!=b?100*Number(h[2])/b:Number(h[2]),v.widthUnits=p||null!=y?cr:0,v.heightUnits=p||null!=b?cr:0),(m=Qu(m,g,"origin"))&&null!=(h=(p=Uu.exec(m))||Bu.exec(m))&&(v.viewportAnchorX=null!=b?100*Number(h[1])/b:Number(h[1]),v.viewportAnchorY=null!=y?100*Number(h[2])/y:Number(h[2]),v.viewportAnchorUnits=p||null!=y?cr:0)):v=null,v&&c.push(v)}for(r=(r=i.getElementsByTagName("body")[0])?Array.from(r.querySelectorAll("[begin]")):[],i=(r=f(r)).next();!i.done;i=r.next())(i=Xu(i.value,t.periodStart,a,s,l,u,c,o,!1))&&n.push(i)}return n},Du.prototype.parseMedia=Du.prototype.parseMedia;var Mu,Nu,Uu=/^(\d{1,2}(?:\.\d+)?|100)% (\d{1,2}(?:\.\d+)?|100)%$/,Fu=/^(\d+px|\d+em)$/,Bu=/^(\d+)px (\d+)px$/,Ku=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Gu=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Vu=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,Hu=/^(\d*(?:\.\d*)?)f$/,Yu=/^(\d*(?:\.\d*)?)t$/,zu=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,Wu={left:ir,center:"center",right:"end",start:ir,end:"end"},$u={left:"line-left",center:"center",right:"line-right"};function qu(e){var t=[];if(!e)return t;for(var r=f(e.childNodes),n=r.next();!n.done;n=r.next())(n=n.value).nodeType==Node.ELEMENT_NODE&&"br"!==n.nodeName&&(n=qu(n),t=t.concat(n));return t.length||t.push(e),t}function Xu(e,t,r,n,i,o,a,s,l){if(l&&"br"==e.nodeName)return(e=new qt(0,0,"")).spacer=!0,e;var u=/^[\s\n]*$/.test(e.textContent),c=e.nodeType==Node.ELEMENT_NODE&&!e.hasAttribute("begin")&&!e.hasAttribute("end");if(e.nodeType!=Node.ELEMENT_NODE||c&&u||c&&!l)return null;u=rc(e.getAttribute("begin"),r),c=rc(e.getAttribute("end"),r);var d=rc(e.getAttribute("dur"),r);if(null==c&&null!=d&&(c=u+d),!l&&(null==u||null==c))throw new me(2,2,2001);if(u+=t,c+=t,d="",l=[],Array.from(e.childNodes).find((function(e){return e.nodeType===Node.TEXT_NODE&&/\w+/.test(e.textContent)})))d=function e(t,r){for(var n="",i=f(t.childNodes),o=i.next();!o.done;o=i.next())"br"==(o=o.value).nodeName&&t.childNodes[0]!==o?n+="\n":o.childNodes&&0<o.childNodes.length?n+=e(o,r):n+=r?o=(o=o.textContent.trim()).replace(/\s+/g," "):o.textContent;return n}(e,s);else for(var h=f(e.childNodes),p=h.next();!p.done;p=h.next())(p=Xu(p.value,t,r,n,i,o,a,s,!0))&&l.push(p);if((t=new qt(u,c,d)).nestedCues=l,(o=tc(e,"region",o,"")[0])&&o.getAttribute("xml:id")){var m=o.getAttribute("xml:id");t.region=a.filter((function(e){return e.id==m}))[0]}return function(e,t,r,n,i){"rtl"==Zu(t,r,i,"direction")&&(e.direction="rtl");var o=Zu(t,r,i,"writingMode");if("tb"==o||"tblr"==o?e.writingMode="vertical-lr":"tbrl"==o?e.writingMode="vertical-rl":"rltb"==o||"rl"==o?e.direction="rtl":o&&(e.direction=tr),(o=Zu(t,r,i,"textAlign"))?(e.positionAlign=$u[o],e.lineAlign=Wu[o],e.textAlign=Zt[o.toUpperCase()]):e.textAlign="start",(o=Zu(t,r,i,"displayAlign"))&&(e.displayAlign=er[o.toUpperCase()]),(o=Zu(t,r,i,"color"))&&(e.color=o),(o=Zu(t,r,i,"backgroundColor"))&&(e.backgroundColor=o),(o=Zu(t,r,i,"fontFamily"))&&(e.fontFamily=o),(o=Zu(t,r,i,"fontWeight"))&&"bold"==o&&(e.fontWeight=700),(o=Zu(t,r,i,"wrapOption"))&&"noWrap"==o&&(e.wrapLine=!1),(o=Zu(t,r,i,"lineHeight"))&&o.match(Fu)&&(e.lineHeight=o),(o=Zu(t,r,i,"fontSize"))&&o.match(Fu)&&(e.fontSize=o),(o=Zu(t,r,i,"fontStyle"))&&(e.fontStyle=lr[o.toUpperCase()]),n){o=n.getAttribute("imagetype");var a=n.getAttribute("encoding");n=n.textContent.trim(),"PNG"==o&&"Base64"==a&&n&&(e.backgroundImage="data:image/png;base64,"+n)}(r=Qu(r,i,"textDecoration"))&&Ju(e,r),(t=ec(t,i,"textDecoration"))&&Ju(e,t)}(t,e,o,n=tc(e,"smpte:backgroundImage",n,"#")[0],i),t}function Ju(e,t){for(var r=t.split(" "),n=0;n<r.length;n++)switch(r[n]){case"underline":e.textDecoration.includes("underline")||e.textDecoration.push("underline");break;case"noUnderline":e.textDecoration.includes("underline")&&Re(e.textDecoration,"underline");break;case"lineThrough":e.textDecoration.includes("lineThrough")||e.textDecoration.push("lineThrough");break;case"noLineThrough":e.textDecoration.includes("lineThrough")&&Re(e.textDecoration,"lineThrough");break;case"overline":e.textDecoration.includes("overline")||e.textDecoration.push("overline");break;case"noOverline":e.textDecoration.includes("overline")&&Re(e.textDecoration,"overline")}}function Zu(e,t,r,n){return(e=ec(e,r,n))?e:Qu(t,r,n)}function Qu(e,t,r){for(var n=qu(e),i=0;i<n.length;i++){var o=Bn.getAttributeNS(n[i],"http://www.w3.org/ns/ttml#styling",r);if(o)return o}return(e=tc(e,"style",t,"")[0])?Bn.getAttributeNS(e,"http://www.w3.org/ns/ttml#styling",r):null}function ec(e,t,r){var n=Bn.getAttributeNS(e,"http://www.w3.org/ns/ttml#styling",r);if(n)return n;for(e=tc(e,"style",t,""),t=null,n=0;n<e.length;n++){var i=Bn.getAttributeNS(e[n],"http://www.w3.org/ns/ttml#styling",r);i&&(t=i)}return t}function tc(e,t,r,n){var i=[];if(!e||1>r.length)return i;var o=e;for(e=null;o&&!(e=o.getAttribute(t))&&(o=o.parentNode)instanceof Element;);if(t=e)for(e=(t=f(t=t.split(" "))).next();!e.done;e=t.next()){e=e.value;for(var a=(o=f(r)).next();!a.done;a=o.next())if(n+(a=a.value).getAttribute("xml:id")==e){i.push(a);break}}return i}function rc(e,t){var r=null;if(Ku.test(e)){r=Ku.exec(e);var n=Number(r[1]),i=Number(r[2]),o=Number(r[3]),a=Number(r[4]);r=(o+=(a+=(Number(r[5])||0)/t.b)/t.frameRate)+60*i+3600*n}else Gu.test(e)?r=nc(Gu,e):Vu.test(e)?r=nc(Vu,e):Hu.test(e)?(r=Hu.exec(e),r=Number(r[1])/t.frameRate):Yu.test(e)?(r=Yu.exec(e),r=Number(r[1])/t.a):zu.test(e)&&(r=nc(zu,e));return r}function nc(e,t){var r=e.exec(t);return null==r||""==r[0]?null:(Number(r[4])||0)/1e3+(Number(r[3])||0)+60*(Number(r[2])||0)+3600*(Number(r[1])||0)}function ic(e,t,r,n){this.frameRate=Number(e)||30,this.b=Number(t)||1,this.a=Number(n),0==this.a&&(this.a=e?this.frameRate*this.b:1),r&&(e=/^(\d+) (\d+)$/g.exec(r))&&(this.frameRate*=Number(e[1])/Number(e[2]))}function oc(){this.a=new Du}function ac(){}function sc(e,t,r){var n;(n=/^align:(start|middle|center|end|left|right)$/.exec(t))?(t=n[1],e.textAlign="middle"==t?Jt:Zt[t.toUpperCase()]):(n=/^vertical:(lr|rl)$/.exec(t))?e.writingMode="lr"==n[1]?"vertical-lr":"vertical-rl":(n=/^size:([\d.]+)%$/.exec(t))?e.size=Number(n[1]):(n=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(t))?(e.position=Number(n[1]),n[2]&&(t=n[2],e.positionAlign="line-left"==t||"start"==t?"line-left":"line-right"==t||"end"==t?"line-right":"center")):(n=/^region:(.*)$/.exec(t))?(t=function(e,t){var r=e.filter((function(e){return e.id==t}));return r.length?r[0]:null}(r,n[1]))&&(e.region=t):(r=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(t))?(e.lineInterpretation=1,e.line=Number(r[1]),r[2]&&(e.lineAlign=or[r[2].toUpperCase()])):(r=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(t))&&(e.lineInterpretation=nr,e.line=Number(r[1]),r[2]&&(e.lineAlign=or[r[2].toUpperCase()]))}function lc(e){if(null==(e=Mi(e,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g)))return null;var t=Number(e[2]),r=Number(e[3]);return 59<t||59<r?null:Number(e[4])/1e3+r+60*t+3600*(Number(e[1])||0)}function uc(){this.a=null}function cc(e,t,r){var n,i,o;return(new In).H("payl",Mn((function(e){n=at(e)}))).H("iden",Mn((function(e){i=at(e)}))).H("sttg",Mn((function(e){o=at(e)}))).parse(e),n?function(e,t,r,n,i){if(e=new qt(n,i,e),t&&(e.id=t),r)for(t=new Oi(r),r=Ni(t);r;)sc(e,r,[]),Di(t),r=Ni(t);return e}(n,i,o,t,r):null} +/*! no static exports found */function(e,t,r){(function(e,r){!function(){var n="undefined"!=typeof window?window:e,i={};for(var o in function(e,t){var n,i="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,r){e!=Array.prototype&&e!=Object.prototype&&(e[t]=r.value)},o=void 0!==e&&e===this?this:void 0!==t&&null!=t?t:this;function a(){a=function(){},o.Symbol||(o.Symbol=l)}var s,l=(s=0,function(e){return"jscomp_symbol_"+(e||"")+s++});function u(){a();var e=o.Symbol.iterator;e||(e=o.Symbol.iterator=o.Symbol("iterator")),"function"!=typeof Array.prototype[e]&&i(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return c(this)}}),u=function(){}}function c(e){var t=0;return d((function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}))}function d(e){return u(),(e={next:e})[o.Symbol.iterator]=function(){return this},e}function f(e){u();var t=e[Symbol.iterator];return t?t.call(e):c(e)}function h(e,t){if(t){for(var r=o,n=e.split("."),a=0;a<n.length-1;a++){var s=n[a];s in r||(r[s]={}),r=r[s]}(s=t(a=r[n=n[n.length-1]]))!=a&&null!=s&&i(r,n,{configurable:!0,writable:!0,value:s})}}function p(e){return function(e){function t(t){return e.next(t)}function r(t){return e.throw(t)}return new Promise((function(n,i){!function e(o){o.done?n(o.value):Promise.resolve(o.value).then(t,r).then(e,i)}(e.next())}))}(e())}h("Promise",(function(e){function t(e){this.b=0,this.g=void 0,this.a=[];var t=this.c();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function r(){this.a=null}function n(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;r.prototype.b=function(e){null==this.a&&(this.a=[],this.f()),this.a.push(e)},r.prototype.f=function(){var e=this;this.c((function(){e.h()}))};var i=o.setTimeout;r.prototype.c=function(e){i(e,0)},r.prototype.h=function(){for(;this.a&&this.a.length;){var e=this.a;this.a=[];for(var t=0;t<e.length;++t){var r=e[t];e[t]=null;try{r()}catch(e){this.g(e)}}}this.a=null},r.prototype.g=function(e){this.c((function(){throw e}))},t.prototype.c=function(){function e(e){return function(n){r||(r=!0,e.call(t,n))}}var t=this,r=!1;return{resolve:e(this.s),reject:e(this.f)}},t.prototype.s=function(e){if(e===this)this.f(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.u(e);else{e:switch(typeof e){case"object":var r=null!=e;break e;case"function":r=!0;break e;default:r=!1}r?this.m(e):this.h(e)}},t.prototype.m=function(e){var t=void 0;try{t=e.then}catch(e){return void this.f(e)}"function"==typeof t?this.B(t,e):this.h(e)},t.prototype.f=function(e){this.i(2,e)},t.prototype.h=function(e){this.i(1,e)},t.prototype.i=function(e,t){if(0!=this.b)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.b);this.b=e,this.g=t,this.l()},t.prototype.l=function(){if(null!=this.a){for(var e=0;e<this.a.length;++e)a.b(this.a[e]);this.a=null}};var a=new r;return t.prototype.u=function(e){var t=this.c();e.cc(t.resolve,t.reject)},t.prototype.B=function(e,t){var r=this.c();try{e.call(t,r.resolve,r.reject)}catch(e){r.reject(e)}},t.prototype.then=function(e,r){function n(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.cc(n(e,i),n(r,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.cc=function(e,t){function r(){switch(n.b){case 1:e(n.g);break;case 2:t(n.g);break;default:throw Error("Unexpected state: "+n.b)}}var n=this;null==this.a?a.b(r):this.a.push(r)},t.resolve=n,t.reject=function(e){return new t((function(t,r){r(e)}))},t.race=function(e){return new t((function(t,r){for(var i=f(e),o=i.next();!o.done;o=i.next())n(o.value).cc(t,r)}))},t.all=function(e){var r=f(e),i=r.next();return i.done?n([]):new t((function(e,t){function o(t){return function(r){a[t]=r,0==--s&&e(a)}}var a=[],s=0;do{a.push(void 0),s++,n(i.value).cc(o(a.length-1),t),i=r.next()}while(!i.done)}))},t})),h("Promise.prototype.finally",(function(e){return e||function(e){return this.then((function(t){return Promise.resolve(e()).then((function(){return t}))}),(function(t){return Promise.resolve(e()).then((function(){throw t}))}))}}));var m,g="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)m=Object.setPrototypeOf;else{var y;e:{var v={};try{v.__proto__={Ae:!0},y=v.Ae;break e}catch(s){}y=!1}m=y?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var b=m;function _(e,t){if(e.prototype=g(t.prototype),e.prototype.constructor=e,b)b(e,t);else for(var r in t)if("prototype"!=r)if(Object.defineProperties){var n=Object.getOwnPropertyDescriptor(t,r);n&&Object.defineProperty(e,r,n)}else e[r]=t[r];e.tg=t.prototype}function A(){this.g=!1,this.c=null,this.o=void 0,this.j=1,this.b=this.f=0,this.i=this.a=null}function E(e){if(e.g)throw new TypeError("Generator is already running");e.g=!0}function T(e,t){e.a={Ld:t,Wd:!0},e.j=e.f||e.b}function S(e,t,r){return e.j=r,{value:t}}function w(e){e.j=0}function k(e,t,r){e.f=t,null!=r&&(e.b=r)}function C(e,t){e.f=0,e.b=t||0}function x(e,t){e.j=t,e.f=0}function R(e){e.f=0;var t=e.a.Ld;return e.a=null,t}function L(e){e.i=[e.a],e.f=0,e.b=0}function j(e,t){var r=e.i.splice(0)[0];(r=e.a=e.a||r)?r.Wd?e.j=e.f||e.b:null!=r.A&&e.b<r.A?(e.j=r.A,e.a=null):e.j=e.b:e.j=t}function P(e){this.a=new A,this.b=e}function I(e,t,r,n){try{var i=t.call(e.a.c,r);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.a.g=!1,i;var o=i.value}catch(t){return e.a.c=null,T(e.a,t),O(e)}return e.a.c=null,n.call(e.a,o),O(e)}function O(e){for(;e.a.j;)try{var t=e.b(e.a);if(t)return e.a.g=!1,{value:t.value,done:!1}}catch(t){e.a.o=void 0,T(e.a,t)}if(e.a.g=!1,e.a.a){if(t=e.a.a,e.a.a=null,t.Wd)throw t.Ld;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function D(e){this.next=function(t){return E(e.a),e.a.c?t=I(e,e.a.c.next,t,e.a.h):(e.a.h(t),t=O(e)),t},this.throw=function(t){return E(e.a),e.a.c?t=I(e,e.a.c.throw,t,e.a.h):(T(e.a,t),t=O(e)),t},this.return=function(t){return function(e,t){E(e.a);var r=e.a.c;return r?I(e,"return"in r?r.return:function(e){return{value:e,done:!0}},t,e.a.return):(e.a.return(t),O(e))}(e,t)},u(),this[Symbol.iterator]=function(){return this}}function M(e,t){return D.prototype=e.prototype,new D(new P(t))}function N(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function F(e,t,r){e instanceof String&&(e=String(e));for(var n=e.length,i=0;i<n;i++){var o=e[i];if(t.call(r,o,i,e))return{Td:i,ve:o}}return{Td:-1,ve:void 0}}function U(e,t,r){if(null==e)throw new TypeError("The 'this' value for String.prototype."+r+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+r+" must not be a regular expression");return e+""}A.prototype.h=function(e){this.o=e},A.prototype.return=function(e){this.a={return:e},this.j=this.b},A.prototype.A=function(e){this.j=e},h("WeakMap",(function(e){function t(e){if(this.a=(s+=Math.random()+1).toString(),e){a(),u(),e=f(e);for(var t;!(t=e.next()).done;)t=t.value,this.set(t[0],t[1])}}function r(e){N(e,o)||i(e,o,{value:{}})}function n(e){var t=Object[e];t&&(Object[e]=function(e){return r(e),t(e)})}if(function(){if(!e||!Object.seal)return!1;try{var t=Object.seal({}),r=Object.seal({}),n=new e([[t,2],[r,3]]);return 2==n.get(t)&&3==n.get(r)&&(n.delete(t),n.set(r,4),!n.has(t)&&4==n.get(r))}catch(e){return!1}}())return e;var o="$jscomp_hidden_"+Math.random();n("freeze"),n("preventExtensions"),n("seal");var s=0;return t.prototype.set=function(e,t){if(r(e),!N(e,o))throw Error("WeakMap key fail: "+e);return e[o][this.a]=t,this},t.prototype.get=function(e){return N(e,o)?e[o][this.a]:void 0},t.prototype.has=function(e){return N(e,o)&&N(e[o],this.a)},t.prototype.delete=function(e){return!(!N(e,o)||!N(e[o],this.a))&&delete e[o][this.a]},t})),h("Map",(function(e){function t(){var e={};return e.Fa=e.next=e.head=e}function r(e,t){var r=e.a;return d((function(){if(r){for(;r.head!=e.a;)r=r.Fa;for(;r.next!=r.head;)return r=r.next,{done:!1,value:t(r)};r=null}return{done:!0,value:void 0}}))}function n(e,t){var r=t&&typeof t;"object"==r||"function"==r?o.has(t)?r=o.get(t):(r=""+ ++s,o.set(t,r)):r="p_"+t;var n=e.b[r];if(n&&N(e.b,r))for(var i=0;i<n.length;i++){var a=n[i];if(t!=t&&a.key!=a.key||t===a.key)return{id:r,list:n,index:i,X:a}}return{id:r,list:n,index:-1,X:void 0}}function i(e){if(this.b={},this.a=t(),this.size=0,e){e=f(e);for(var r;!(r=e.next()).done;)r=r.value,this.set(r[0],r[1])}}if(function(){if(!e||"function"!=typeof e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var t=Object.seal({x:4}),r=new e(f([[t,"s"]]));if("s"!=r.get(t)||1!=r.size||r.get({x:4})||r.set({x:4},"t")!=r||2!=r.size)return!1;var n=r.entries(),i=n.next();return!i.done&&i.value[0]==t&&"s"==i.value[1]&&!((i=n.next()).done||4!=i.value[0].x||"t"!=i.value[1]||!n.next().done)}catch(e){return!1}}())return e;a(),u();var o=new WeakMap;i.prototype.set=function(e,t){var r=n(this,e);return r.list||(r.list=this.b[r.id]=[]),r.X?r.X.value=t:(r.X={next:this.a,Fa:this.a.Fa,head:this.a,key:e,value:t},r.list.push(r.X),this.a.Fa.next=r.X,this.a.Fa=r.X,this.size++),this},i.prototype.delete=function(e){return!(!(e=n(this,e)).X||!e.list||(e.list.splice(e.index,1),e.list.length||delete this.b[e.id],e.X.Fa.next=e.X.next,e.X.next.Fa=e.X.Fa,e.X.head=null,this.size--,0))},i.prototype.clear=function(){this.b={},this.a=this.a.Fa=t(),this.size=0},i.prototype.has=function(e){return!!n(this,e).X},i.prototype.get=function(e){return(e=n(this,e).X)&&e.value},i.prototype.entries=function(){return r(this,(function(e){return[e.key,e.value]}))},i.prototype.keys=function(){return r(this,(function(e){return e.key}))},i.prototype.values=function(){return r(this,(function(e){return e.value}))},i.prototype.forEach=function(e,t){for(var r,n=this.entries();!(r=n.next()).done;)r=r.value,e.call(t,r[1],r[0],this)},i.prototype[Symbol.iterator]=i.prototype.entries;var s=0;return i})),h("Set",(function(e){function t(e){if(this.a=new Map,e){e=f(e);for(var t;!(t=e.next()).done;)this.add(t.value)}this.size=this.a.size}return function(){if(!e||"function"!=typeof e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var t=Object.seal({x:4}),r=new e(f([t]));if(!r.has(t)||1!=r.size||r.add(t)!=r||1!=r.size||r.add({x:4})!=r||2!=r.size)return!1;var n=r.entries(),i=n.next();return!i.done&&i.value[0]==t&&i.value[1]==t&&!(i=n.next()).done&&i.value[0]!=t&&4==i.value[0].x&&i.value[1]==i.value[0]&&n.next().done}catch(e){return!1}}()?e:(a(),u(),t.prototype.add=function(e){return this.a.set(e,e),this.size=this.a.size,this},t.prototype.delete=function(e){return e=this.a.delete(e),this.size=this.a.size,e},t.prototype.clear=function(){this.a.clear(),this.size=0},t.prototype.has=function(e){return this.a.has(e)},t.prototype.entries=function(){return this.a.entries()},t.prototype.values=function(){return this.a.values()},t.prototype.keys=t.prototype.values,t.prototype[Symbol.iterator]=t.prototype.values,t.prototype.forEach=function(e,t){var r=this;this.a.forEach((function(n){return e.call(t,n,n,r)}))},t)})),h("Array.prototype.findIndex",(function(e){return e||function(e,t){return F(this,e,t).Td}})),h("Array.prototype.keys",(function(e){return e||function(){return function(e,t){u(),e instanceof String&&(e+="");var r=0,n={next:function(){if(r<e.length){var i=r++;return{value:t(i,e[i]),done:!1}}return n.next=function(){return{done:!0,value:void 0}},n.next()}};return n[Symbol.iterator]=function(){return n},n}(this,(function(e){return e}))}})),h("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),h("Array.prototype.includes",(function(e){return e||function(e,t){var r=this;r instanceof String&&(r=String(r));var n=r.length,i=t||0;for(0>i&&(i=Math.max(i+n,0));i<n;i++){var o=r[i];if(o===e||Object.is(o,e))return!0}return!1}})),h("String.prototype.includes",(function(e){return e||function(e,t){return-1!==U(this,e,"includes").indexOf(e,t||0)}})),h("Array.from",(function(e){return e||function(e,t,r){u(),t=null!=t?t:function(e){return e};var n=[],i=e[Symbol.iterator];if("function"==typeof i)for(e=i.call(e);!(i=e.next()).done;)n.push(t.call(r,i.value));else{i=e.length;for(var o=0;o<i;o++)n.push(t.call(r,e[o]))}return n}})),h("String.prototype.startsWith",(function(e){return e||function(e,t){for(var r=U(this,e,"startsWith"),n=r.length,i=e.length,o=Math.max(0,Math.min(0|t,r.length)),a=0;a<i&&o<n;)if(r[o++]!=e[a++])return!1;return a>=i}})),h("Array.prototype.find",(function(e){return e||function(e,t){return F(this,e,t).ve}}));var B="function"==typeof Object.assign?Object.assign:function(e,t){for(var r=1;r<arguments.length;r++){var n=arguments[r];if(n)for(var i in n)N(n,i)&&(e[i]=n[i])}return e};h("Object.assign",(function(e){return e||B}));var K=this;function G(e,t){var r,n=e.split("."),i=K;n[0]in i||!i.execScript||i.execScript("var "+n[0]);for(;n.length&&(r=n.shift());)n.length||void 0===t?i=i[r]?i[r]:i[r]={}:i[r]=t}function V(e,t){function r(){}r.prototype=t.prototype,e.tg=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.Eg=function(e,r,n){return t.prototype[r].apply(e,Array.prototype.slice.call(arguments,2))}}function H(e){this.c=Math.exp(Math.log(.5)/e),this.b=this.a=0}function Y(e,t,r){var n=Math.pow(e.c,t);r=r*(1-n)+n*e.a,isNaN(r)||(e.a=r,e.b+=t)}function z(e){return e.a/(1-Math.pow(e.c,e.b))}function W(){this.b=new H(2),this.c=new H(5),this.a=0}function $(){}function q(){}function X(){}K.a=!0,W.prototype.getBandwidthEstimate=function(e){return 128e3>this.a?e:Math.min(z(this.b),z(this.c))},e.console&&e.console.log.bind&&(q=console.warn.bind(console),$=console.error.bind(console));var J=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;function Z(e){var t;e instanceof Z?(Q(this,e.ta),this.bb=e.bb,this.sa=e.sa,ee(this,e.Ab),this.ja=e.ja,te(this,e.a.clone()),this.Sa=e.Sa):e&&(t=String(e).match(J))?(Q(this,t[1]||"",!0),this.bb=re(t[2]||""),this.sa=re(t[3]||"",!0),ee(this,t[4]),this.ja=re(t[5]||"",!0),te(this,t[6]||"",!0),this.Sa=re(t[7]||"")):this.a=new ce(null)}function Q(e,t,r){e.ta=r?re(t,!0):t,e.ta&&(e.ta=e.ta.replace(/:$/,""))}function ee(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.Ab=t}else e.Ab=null}function te(e,t,r){t instanceof ce?e.a=t:(r||(t=ne(t,le)),e.a=new ce(t))}function re(e,t){return e?t?decodeURI(e):decodeURIComponent(e):""}function ne(e,t,r){return"string"==typeof e?(e=encodeURI(e).replace(t,ie),r&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function ie(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}(n=Z.prototype).ta="",n.bb="",n.sa="",n.Ab=null,n.ja="",n.Sa="",n.toString=function(){var e=[],t=this.ta;if(t&&e.push(ne(t,oe,!0),":"),t=this.sa){e.push("//");var r=this.bb;r&&e.push(ne(r,oe,!0),"@"),e.push(encodeURIComponent(t).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(t=this.Ab)&&e.push(":",String(t))}return(t=this.ja)&&(this.sa&&"/"!=t.charAt(0)&&e.push("/"),e.push(ne(t,"/"==t.charAt(0)?se:ae,!0))),(t=this.a.toString())&&e.push("?",t),(t=this.Sa)&&e.push("#",ne(t,ue)),e.join("")},n.resolve=function(e){var t=this.clone();"data"===t.ta&&(t=new Z);var r=!!e.ta;r?Q(t,e.ta):r=!!e.bb,r?t.bb=e.bb:r=!!e.sa,r?t.sa=e.sa:r=null!=e.Ab;var n=e.ja;if(r)ee(t,e.Ab);else if(r=!!e.ja){if("/"!=n.charAt(0))if(this.sa&&!this.ja)n="/"+n;else{var i=t.ja.lastIndexOf("/");-1!=i&&(n=t.ja.substr(0,i+1)+n)}if(".."==n||"."==n)n="";else if(-1!=n.indexOf("./")||-1!=n.indexOf("/.")){i=0==n.lastIndexOf("/",0),n=n.split("/");for(var o=[],a=0;a<n.length;){var s=n[a++];"."==s?i&&a==n.length&&o.push(""):".."==s?((1<o.length||1==o.length&&""!=o[0])&&o.pop(),i&&a==n.length&&o.push("")):(o.push(s),i=!0)}n=o.join("/")}}return r?t.ja=n:r=""!==e.a.toString(),r?te(t,e.a.clone()):r=!!e.Sa,r&&(t.Sa=e.Sa),t},n.clone=function(){return new Z(this)};var oe=/[#\/\?@]/g,ae=/[#\?:]/g,se=/[#\?]/g,le=/[#\?@]/g,ue=/#/g;function ce(e){this.a=e||null}function de(e){this.b=e,this.a=null}function fe(e){this.b=e,this.a=null}function he(e,t){var r={maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0};this.i=null==e.maxAttempts?r.maxAttempts:e.maxAttempts,this.f=null==e.baseDelay?r.baseDelay:e.baseDelay,this.h=null==e.fuzzFactor?r.fuzzFactor:e.fuzzFactor,this.g=null==e.backoffFactor?r.backoffFactor:e.backoffFactor,this.a=0,this.b=this.f,(this.c=void 0!==t&&t)&&(this.a=1)}function pe(e){return p((function t(){var r,n;return M(t,(function(t){switch(t.j){case 1:if(e.a>=e.i){if(!e.c)return t.return(Promise.reject());e.a=1,e.b=e.f}return r=e.a,e.a++,0==r?t.return():(n=e.b*(1+(2*Math.random()-1)*e.h),S(t,new Promise((function(e){new fe(e).R(n/1e3)})),2));case 2:e.b*=e.g,w(t)}}))}))}function me(e,t,r,n){for(var i=[],o=3;o<arguments.length;++o)i[o-3]=arguments[o];this.severity=e,this.category=t,this.code=r,this.data=i,this.handled=!1}function ge(){var e,t,r=new Promise((function(r,n){e=r,t=n}));return r.resolve=e,r.reject=t,r}function ye(e,t){this.promise=e,this.Zd=t,this.a=!1}function ve(e){return new ye(Promise.reject(e),(function(){return Promise.resolve()}))}function be(){var e=Promise.reject(new me(2,7,7001));return e.catch((function(){})),new ye(e,(function(){return Promise.resolve()}))}function _e(e){return new ye(Promise.resolve(e),(function(){return Promise.resolve()}))}function Ae(e){return new ye(e,(function(){return e.catch((function(){}))}))}function Ee(e){return new ye(Promise.all(e.map((function(e){return e.promise}))),(function(){return Promise.all(e.map((function(e){return e.abort()})))}))}function Te(e,t,r){try{var n=e(t);return n&&n.promise&&n.abort?(r.resolve(n.promise),function(){return n.abort()}):(r.resolve(n),function(){return Promise.resolve(n).then((function(){})).catch((function(){}))})}catch(e){return r.reject(e),function(){return Promise.resolve()}}}function Se(t,r){for(var n in r=void 0===r?{}:r)this[n]=r[n];this.defaultPrevented=this.cancelable=this.bubbles=!1,this.timeStamp=e.performance&&e.performance.now?e.performance.now():Date.now(),this.type=t,this.isTrusted=!1,this.target=this.currentTarget=null,this.a=!1}function we(){this.a={}}function ke(){this.Jc=new we,this.$b=this}function Ce(e){var t=new Set;return function e(r){switch(typeof r){case"undefined":case"boolean":case"number":case"string":case"symbol":case"function":return r;default:if(!r||r.buffer&&r.buffer.constructor==ArrayBuffer)return r;if(t.has(r))return null;var n=r.constructor==Array;if(r.constructor!=Object&&!n)return null;t.add(r);var i,o=n?[]:{};for(i in r)o[i]=e(r[i]);return n&&(o.length=r.length),o}}(e)}function xe(e,t){return!("number"!=typeof e||"number"!=typeof t||!isNaN(e)||!isNaN(t))||e===t}function Re(e,t){var r=e.indexOf(t);-1<r&&e.splice(r,1)}function Le(e,t,r){if(r||(r=xe),e.length!=t.length)return!1;t=t.slice();for(var n={},i=(e=f(e)).next();!i.done;n={item:n.item},i=e.next()){if(n.item=i.value,-1==(i=t.findIndex(function(e){return function(t){return r(e.item,t)}}(n))))return!1;t[i]=t[t.length-1],t.pop()}return 0==t.length}function je(){this.a=[]}function Pe(e,t){e.a.push(t.finally((function(){Re(e.a,t)})))}function Ie(e){ke.call(this),this.f=!1,this.g=new je,this.a=new Set,this.b=new Set,this.c=e||null}(n=ce.prototype).ha=null,n.fc=null,n.add=function(e,t){if(!this.ha&&(this.ha={},this.fc=0,this.a))for(var r=this.a.split("&"),n=0;n<r.length;n++){var i=r[n].indexOf("="),o=null;if(0<=i){var a=r[n].substring(0,i);o=r[n].substring(i+1)}else a=r[n];a=decodeURIComponent(a.replace(/\+/g," ")),o=o||"",this.add(a,decodeURIComponent(o.replace(/\+/g," ")))}return this.a=null,(r=this.ha.hasOwnProperty(e)&&this.ha[e])||(this.ha[e]=r=[]),r.push(t),this.fc++,this},n.toString=function(){if(this.a)return this.a;if(!this.ha)return"";var e,t=[];for(e in this.ha)for(var r=encodeURIComponent(e),n=this.ha[e],i=0;i<n.length;i++){var o=r;""!==n[i]&&(o+="="+encodeURIComponent(n[i])),t.push(o)}return this.a=t.join("&")},n.clone=function(){var e=new ce;if(e.a=this.a,this.ha){var t,r={};for(t in this.ha)r[t]=this.ha[t].concat();e.ha=r,e.fc=this.fc}return e},de.prototype.R=function(t){var r=this;this.stop();var n=!0,i=null;return this.a=function(){e.clearTimeout(i),n=!1},i=e.setTimeout((function(){n&&r.b()}),1e3*t),this},de.prototype.stop=function(){this.a&&(this.a(),this.a=null)},G("shaka.util.Timer",fe),fe.prototype.yc=function(){return this.stop(),this.b(),this},fe.prototype.tickNow=fe.prototype.yc,fe.prototype.R=function(e){var t=this;return this.stop(),this.a=new de((function(){t.b()})).R(e),this},fe.prototype.tickAfter=fe.prototype.R,fe.prototype.Na=function(e){var t=this;return this.stop(),this.a=new de((function(){t.a.R(e),t.b()})).R(e),this},fe.prototype.tickEvery=fe.prototype.Na,fe.prototype.stop=function(){this.a&&(this.a.stop(),this.a=null)},fe.prototype.stop=fe.prototype.stop,G("shaka.util.Error",me),me.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null," ")},me.Severity={RECOVERABLE:1,CRITICAL:2},me.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9},me.Code={UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,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,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,UNPLAYABLE_PERIOD:4011,RESTRICTIONS_CANNOT_BE_MET:4012,NO_PERIODS:4014,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,INVALID_STREAMS_CHOSEN:5005,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,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,STORE_ALREADY_IN_PROGRESS:9006,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},ge.prototype.resolve=function(){},ge.prototype.reject=function(){},G("shaka.util.AbortableOperation",ye),ye.failed=ve,ye.aborted=be,ye.completed=_e,ye.notAbortable=Ae,ye.prototype.abort=function(){return this.a=!0,this.Zd()},ye.prototype.abort=ye.prototype.abort,ye.all=Ee,ye.prototype.finally=function(e){return this.promise.then((function(){return e(!0)}),(function(){return e(!1)})),this},ye.prototype.finally=ye.prototype.finally,ye.prototype.U=function(e,t){function r(){return i.reject(new me(2,7,7001)),n.abort()}var n=this,i=new ge;return this.promise.then((function(t){n.a?i.reject(new me(2,7,7001)):e?r=Te(e,t,i):i.resolve(t)}),(function(e){t?r=Te(t,e,i):i.reject(e)})),new ye(i,(function(){return r()}))},ye.prototype.chain=ye.prototype.U,Se.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},Se.prototype.stopImmediatePropagation=function(){this.a=!0},Se.prototype.stopPropagation=function(){},(n=we.prototype).push=function(e,t){this.a.hasOwnProperty(e)?this.a[e].push(t):this.a[e]=[t]},n.get=function(e){return(e=this.a[e])?e.slice():null},n.getAll=function(){var e,t=[];for(e in this.a)t.push.apply(t,this.a[e]);return t},n.remove=function(e,t){var r=this.a[e];if(r)for(var n=0;n<r.length;++n)r[n]==t&&(r.splice(n,1),--n)},n.forEach=function(e){for(var t in this.a)e(t,this.a[t])},ke.prototype.addEventListener=function(e,t){this.Jc.push(e,t)},ke.prototype.removeEventListener=function(e,t){this.Jc.remove(e,t)},ke.prototype.dispatchEvent=function(e){for(var t=this.Jc.get(e.type)||[],r=0;r<t.length;++r){e.target=this.$b,e.currentTarget=this.$b;var n=t[r];try{n.handleEvent?n.handleEvent(e):n.call(this,e)}catch(e){}if(e.a)break}return e.defaultPrevented},je.prototype.destroy=function(){var e=[];return this.a.forEach((function(t){t.promise.catch((function(){})),e.push(t.abort())})),this.a=[],Promise.all(e)},V(Ie,ke),G("shaka.net.NetworkingEngine",Ie),Ie.RequestType={MANIFEST:0,SEGMENT:1,LICENSE:2,APP:3,TIMING:4},Ie.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:3};var Oe={};function De(e,t,r){r=r||3;var n=Oe[e];(!n||r>=n.priority)&&(Oe[e]={priority:r,Rf:t})}function Me(e,t){return{uris:e,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:t,licenseRequestType:null,sessionId:null}}function Ne(){this.a=0}function Fe(e,t,r){ye.call(this,e,t),this.b=r}function Ue(){}function Be(){this.a=new we}function Ke(e,t,r,n){this.target=e,this.type=t,this.listener=r,this.a=function(e,t){if(null==t)return!1;if("boolean"==typeof t)return t;var r=new Set(["passive","capture"]);return Object.keys(t).filter((function(e){return!r.has(e)})),function(e){var t=Ge;if(null==t){t=!1;try{var r={},n={get:function(){return t=!0,!1}};Object.defineProperty(r,"passive",n),Object.defineProperty(r,"capture",n),n=function(){},e.addEventListener("test",n,r),e.removeEventListener("test",n,r)}catch(e){t=!1}Ge=t}return t||!1}(e)?t:t.capture||!1}(e,n),this.target.addEventListener(t,r,this.a)}Ie.registerScheme=De,Ie.unregisterScheme=function(e){delete Oe[e]},Ie.prototype.Tf=function(e){this.a.add(e)},Ie.prototype.registerRequestFilter=Ie.prototype.Tf,Ie.prototype.vg=function(e){this.a.delete(e)},Ie.prototype.unregisterRequestFilter=Ie.prototype.vg,Ie.prototype.Ie=function(){this.a.clear()},Ie.prototype.clearAllRequestFilters=Ie.prototype.Ie,Ie.prototype.Uf=function(e){this.b.add(e)},Ie.prototype.registerResponseFilter=Ie.prototype.Uf,Ie.prototype.wg=function(e){this.b.delete(e)},Ie.prototype.unregisterResponseFilter=Ie.prototype.wg,Ie.prototype.Je=function(){this.b.clear()},Ie.prototype.clearAllResponseFilters=Ie.prototype.Je,Ie.defaultRetryParameters=function(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0}},Ie.makeRequest=Me,Ie.prototype.destroy=function(){return this.f=!0,this.a.clear(),this.b.clear(),this.g.destroy()},Ie.prototype.destroy=Ie.prototype.destroy,Ie.prototype.request=function(e,t){var r=this,n=new Ne;if(this.f){var i=Promise.reject(new me(2,7,7001));return i.catch((function(){})),new Fe(i,(function(){return Promise.resolve()}),n)}t.method=t.method||"GET",t.headers=t.headers||{},t.retryParameters=t.retryParameters?Ce(t.retryParameters):{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0},t.uris=Ce(t.uris);var o=(i=function(e,t,r){for(var n=_e(void 0),i={},o=(e=f(e.a)).next();!o.done;i={qd:i.qd},o=e.next())i.qd=o.value,n=n.U(function(e){return function(){return e.qd(t,r)}}(i));return n.U(void 0,(function(e){if(e&&7001==e.code)throw e;throw new me(2,1,1006,e)}))}(this,e,t)).U((function(){return function e(t,r,n,i,o,a,s){var l=new Z(n.uris[o]),u=l.ta,c=!1;u||(u=(u=location.protocol).slice(0,-1),Q(l,u),n.uris[o]=l.toString()),u=u.toLowerCase();var d,f=(u=Oe[u])?u.Rf:null;return f?Ae(pe(i)).U((function(){return t.f?be():(d=Date.now(),f(n.uris[o],n,r,(function(e,n,i){t.c&&1==r&&(t.c(e,n),c=!0,s.a=i)})))})).U((function(e){return null==e.timeMs&&(e.timeMs=Date.now()-d),{response:e,qf:c}}),(function(l){if(l&&7001==l.code)throw l;if(t.f)return be();if(l&&1==l.severity)return t.dispatchEvent(new Se("retry",{error:l instanceof me?l:null})),o=(o+1)%n.uris.length,e(t,r,n,i,o,l,s);throw l||a})):ve(new me(2,1,1e3,l))}(r,e,t,new he(t.retryParameters,!1),0,null,n)})),a=o.U((function(t){return function(e,t,r){for(var n=_e(void 0),i=(e=f(e.b)).next();!i.done;i=e.next())n=n.U(i.value.bind(null,t,r.response));return n.U((function(){return r}),(function(e){if(e&&7001==e.code)throw e;var t=2;throw e instanceof me&&(t=e.severity),new me(t,1,1007,e)}))}(r,e,t)})),s=Date.now(),l=0;i.promise.then((function(){l=Date.now()-s}),(function(){}));var u=0;return o.promise.then((function(){u=Date.now()}),(function(){})),i=new Fe((i=a.U((function(t){var n=Date.now()-u,i=t.response;return i.timeMs+=l,i.timeMs+=n,t.qf||!r.c||i.fromCache||1!=e||r.c(i.timeMs,i.data.byteLength),i}),(function(e){throw e&&(e.severity=2),e}))).promise,i.Zd,n),Pe(this.g,i),i},Ie.prototype.request=Ie.prototype.request,Ie.NumBytesRemainingClass=Ne,_(Fe,ye),Ie.PendingRequest=Fe,Fe.all=Ee,Fe.notAbortable=Ae,Fe.completed=_e,Fe.aborted=be,Fe.failed=ve,G("shaka.util.IReleasable",Ue),Ue.prototype.release=function(){},G("shaka.util.EventManager",Be),Be.prototype.release=function(){this.$a(),this.a=null},Be.prototype.release=Be.prototype.release,Be.prototype.w=function(e,t,r,n){this.a&&(e=new Ke(e,t,r,n),this.a.push(t,e))},Be.prototype.listen=Be.prototype.w,Be.prototype.da=function(e,t,r,n){var i=this;this.w(e,t,(function n(o){i.ea(e,t,n),r(o)}),n)},Be.prototype.listenOnce=Be.prototype.da,Be.prototype.ea=function(e,t,r){if(this.a)for(var n=this.a.get(t)||[],i=(n=f(n)).next();!i.done;i=n.next())(i=i.value).target!=e||r!=i.listener&&r||(i.ea(),this.a.remove(t,i))},Be.prototype.unlisten=Be.prototype.ea,Be.prototype.$a=function(){if(this.a){for(var e=this.a.getAll(),t=(e=f(e)).next();!t.done;t=e.next())t.value.ea();this.a.a={}}},Be.prototype.removeAll=Be.prototype.$a,Ke.prototype.ea=function(){this.target.removeEventListener(this.type,this.listener,this.a),this.listener=this.target=null,this.a=!1},Ke.prototype.unlisten=Ke.prototype.ea;var Ge=void 0;function Ve(e){if(e=new Uint8Array(e),new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(0,!0)+4!=e.byteLength)throw new RangeError("Malformed FairPlay init data");return new Z(e=st(e.subarray(4),!0)).sa}function He(e,t,r){function n(e){new DataView(o.buffer).setUint32(a,e.byteLength,!0),a+=4,i(e)}function i(e){o.set(e,a),a+=e.byteLength}if(!r||!r.byteLength)throw new me(2,6,6015);t="string"==typeof t?new Uint8Array(ct(t,!0)):new Uint8Array(t);var o=new Uint8Array(8+e.byteLength+t.byteLength+r.byteLength),a=0;return i(new Uint8Array(e)),n(t),n(new Uint8Array(r)),o}function Ye(e,t){for(var r=[],n=f(e),i=n.next();!i.done;i=n.next())r.push(t(i.value));return r}function ze(e,t){for(var r=f(e),n=r.next();!n.done;n=r.next())if(!t(n.value))return!1;return!0}function We(e){var t=new Map;return Object.keys(e).forEach((function(r){t.set(r,e[r])})),t}function $e(e){var t={};return e.forEach((function(e,r){t[r]=e})),t}function qe(e,t){var r=e;return t&&(r+='; codecs="'+t+'"'),r}function Xe(e){var t=(e=e.split("."))[0];return e.pop(),[t,e.join(".")]}G("shaka.util.FairPlayUtils.defaultGetContentId",Ve),G("shaka.util.FairPlayUtils.initDataTransform",He);var Je=(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");function Ze(){return!(!e.MediaSource||!MediaSource.isTypeSupported)}function Qe(e){return""!=nt().canPlayType(e)}function et(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!rt("Tizen")}function tt(){if(!et())return null;var e=navigator.userAgent.match(/Version\/(\d+)/);return e||(e=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(e[1],10):null}function rt(e){return(navigator.userAgent||"").includes(e)}function nt(){return ot||(it||(it=new fe((function(){ot=null}))),(ot=document.querySelector("video")||document.querySelector("audio"))||(ot=document.createElement("video")),it.R(1),ot)}var it=null,ot=null;function at(e){if(!e)return"";239==(e=new Uint8Array(e))[0]&&187==e[1]&&191==e[2]&&(e=e.subarray(3)),e=dt(e),e=escape(e);try{return decodeURIComponent(e)}catch(e){throw new me(2,2,2004)}}function st(e,t,r){if(!e)return"";if(!r&&0!=e.byteLength%2)throw new me(2,2,2004);if(e instanceof ArrayBuffer)var n=e;else(r=new Uint8Array(e.byteLength)).set(new Uint8Array(e)),n=r.buffer;e=Math.floor(e.byteLength/2),r=new Uint16Array(e),n=new DataView(n);for(var i=0;i<e;i++)r[i]=n.getUint16(2*i,t);return dt(r)}function lt(e){var t=new Uint8Array(e);if(239==t[0]&&187==t[1]&&191==t[2])return at(t);if(254==t[0]&&255==t[1])return st(t.subarray(2),!1);if(255==t[0]&&254==t[1])return st(t.subarray(2),!0);var r=function(e,t){return e.byteLength<=t||32<=e[t]&&126>=e[t]}.bind(null,t);if(0==t[0]&&0==t[2])return st(e,!1);if(0==t[1]&&0==t[3])return st(e,!0);if(r(0)&&r(1)&&r(2)&&r(3))return at(e);throw new me(2,2,2003)}function ut(e){e=encodeURIComponent(e),e=unescape(e);for(var t=new Uint8Array(e.length),r=0;r<e.length;++r)t[r]=e.charCodeAt(r);return t.buffer}function ct(e,t){for(var r=new Uint8Array(2*e.length),n=new DataView(r.buffer),i=0;i<e.length;++i)n.setUint16(2*i,e.charCodeAt(i),t);return r.buffer}function dt(e){if(!ft)for(var t=function(e){try{var t=new Uint8Array(e);return 0<String.fromCharCode.apply(null,t).length}catch(e){return!1}},r={size:65536};0<r.size;(r={size:r.size}).size/=2)if(t(r.size)){ft=function(e){return function(t){for(var r="",n=0;n<t.length;n+=e.size)r+=String.fromCharCode.apply(null,t.subarray(n,n+e.size));return r}}(r);break}return ft(e)}G("shaka.util.StringUtils.fromUTF8",at),G("shaka.util.StringUtils.fromUTF16",st),G("shaka.util.StringUtils.fromBytesAutoDetect",lt),G("shaka.util.StringUtils.toUTF8",ut),G("shaka.util.StringUtils.toUTF16",ct);var ft=null;G("shaka.util.StringUtils.resetFromCharCode",(function(){ft=null}));var ht={zc:function(t,r){var n=dt(t);return r=null==r||r,n=e.btoa(n).replace(/\+/g,"-").replace(/\//g,"_"),r?n:n.replace(/=*$/,"")}};function pt(e){var t=this;this.B=e,this.u=new Set,this.h=this.l=null,this.S=!1,this.K=0,this.a=null,this.i=new Be,this.b=new Map,this.s=[],this.m=new ge,this.f=null,this.g=function(r){t.m.reject(r),e.onError(r)},this.pa=new Map,this.W=new Map,this.O=new fe((function(){return function(e){var t=e.pa,r=e.W;r.clear(),t.forEach((function(e,t){return r.set(t,e)})),(t=Array.from(r.values())).length&&t.every((function(e){return"expired"==e}))&&e.g(new me(2,6,6014)),e.B.qc($e(r))}(t)})),this.c=!1,this.na=new ge,this.D=!1,this.F=[],this.oa=!1,this.$=new fe((function(){!function(e){e.b.forEach((function(t,r){var n=t.hd,i=r.expiration;isNaN(i)&&(i=1/0),i!=n&&(e.B.onExpirationUpdated(r.sessionId,i),t.hd=i)}))}(t)})).Na(1),this.m.catch((function(){}))}function mt(e,t,r){return e.s=r,e.D=0<r.length,gt(e,t)}function gt(t,r){var n=function(t){if(0==(t=We(t.f.clearKeys)).size)return null;var r=[],n=[];t.forEach((function(e,t){var i=ht.Qc(t),o=ht.Qc(e);i={kty:"oct",kid:ht.zc(i,!1),k:ht.zc(o,!1)},r.push(i),n.push(i.kid)})),t=JSON.stringify({keys:r});var i=JSON.stringify({kids:n});return i=[{initData:new Uint8Array(ut(i)),initDataType:"keyids"}],{keySystem:"org.w3.clearkey",licenseServerUri:"data:application/json;base64,"+e.btoa(t),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:i,keyIds:[]}}(t);if(n)for(var i=f(r),o=i.next();!o.done;o=i.next())o.value.drmInfos=[n];for((n=r.some((function(e){return 0<e.drmInfos.length})))||function(e,t){var r=[];t.forEach((function(e,t){r.push({keySystem:t,licenseServerUri:e,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],keyIds:[]})}));for(var n=f(e),i=n.next();!i.done;i=n.next())i.value.drmInfos=r}(r,o=We(t.f.servers)),o=(i=f(r)).next();!o.done;o=i.next())for(var a=(o=f(o.value.drmInfos)).next();!a.done;a=o.next())It(a.value,We(t.f.servers),We(t.f.advanced||{}));return(o=function(e,t){for(var r=new Set,n=f(t),i=n.next();!i.done;i=n.next()){var o=f(i.value.drmInfos);for(i=o.next();!i.done;i=o.next())r.add(i.value)}for(n=f(r),i=n.next();!i.done;i=n.next())It(i.value,We(e.f.servers),We(e.f.advanced||{}));o=e.D?"required":"optional";var a=e.D?["persistent-license"]:["temporary"];for(n=new Map,r=f(r),i=r.next();!i.done;i=r.next())i=i.value,n.set(i.keySystem,{audioCapabilities:[],videoCapabilities:[],distinctiveIdentifier:"optional",persistentState:o,sessionTypes:a,label:i.keySystem,drmInfos:[]});for(r=f(t),i=r.next();!i.done;i=r.next()){i=i.value,o=i.audio,a=i.video;var s=o?qe(o.mimeType,o.codecs):"",l=a?qe(a.mimeType,a.codecs):"",u=f(i.drmInfos);for(i=u.next();!i.done;i=u.next()){i=i.value;var c=n.get(i.keySystem);c.drmInfos.push(i),i.distinctiveIdentifierRequired&&(c.distinctiveIdentifier="required"),i.persistentStateRequired&&(c.persistentState="required"),o&&c.audioCapabilities.push({robustness:i.audioRobustness||"",contentType:s}),a&&c.videoCapabilities.push({robustness:i.videoRobustness||"",contentType:l})}}return n}(t,r)).size?(o=Tt(t,o),n?o:o.catch((function(){}))):(t.S=!0,Promise.resolve())}function yt(e){return p((function t(){var r;return M(t,(function(t){switch(t.j){case 1:if(!(e.l&&e.a&&e.a.serverCertificate&&e.a.serverCertificate.length)){t.A(0);break}return k(t,3),S(t,e.l.setServerCertificate(e.a.serverCertificate),5);case 5:x(t,0);break;case 3:return r=R(t),t.return(Promise.reject(new me(2,6,6004,r.message)))}}))}))}function vt(e){var t=e.a?e.a.initData:[];return t.forEach((function(t){return wt(e,t.initDataType,t.initData)})),e.s.forEach((function(t){return St(e,t)})),t.length||e.s.length||e.m.resolve(),e.m}function bt(e,t,r){for(var n=e.b.values(),i=(n=f(n)).next();!i.done;i=n.next())if(ht.za(r,i.value.initData)&&!rt("Tizen 2"))return;wt(e,t,r)}function _t(e){return e?e.keySystem:""}function At(e,t){return!!rt("Edge/")||e.u.has(t)}function Et(e){return e=Ye(e=e.b.keys(),(function(e){return e.sessionId})),Array.from(e)}function Tt(e,t){if(1==t.size&&t.has(""))return Promise.reject(new me(2,6,6e3));for(var r=f(t.values()),n=r.next();!n.done;n=r.next())0==(n=n.value).audioCapabilities.length&&delete n.audioCapabilities,0==n.videoCapabilities.length&&delete n.videoCapabilities;var i=r=new ge;return[!0,!1].forEach(function(e){var r=this;t.forEach((function(t,n){t.drmInfos.some((function(e){return!!e.licenseServerUri}))==e&&(i=i.catch(function(){if(!this.c)return navigator.requestMediaKeySystemAccess(n,[t])}.bind(r)))}))}.bind(e)),i=(i=i.catch((function(){return Promise.reject(new me(2,6,6001))}))).then(function(e){if(this.c)return Promise.reject();this.u.clear();var r=e.getConfiguration(),n=r.videoCapabilities||[],i=f(r.audioCapabilities||[]);for(r=i.next();!r.done;r=i.next())this.u.add(r.value.contentType);for(r=(n=f(n)).next();!r.done;r=n.next())this.u.add(r.value.contentType);n=e.keySystem,i=[];var o=[],a=[],s=[];return function(e,t,r,n,i){e.forEach((function(e){if(t.includes(e.licenseServerUri)||t.push(e.licenseServerUri),e.serverCertificate&&(r.some((function(t){return ht.za(t,e.serverCertificate)}))||r.push(e.serverCertificate)),e.initData&&e.initData.forEach((function(e){n.some((function(t){return!(!t.keyId||t.keyId!=e.keyId)||t.initDataType==e.initDataType&&ht.za(t.initData,e.initData)}))||n.push(e)})),e.keyIds)for(var o=0;o<e.keyIds.length;++o)i.includes(e.keyIds[o])||i.push(e.keyIds[o])}))}((r=t.get(e.keySystem)).drmInfos,i,o,a,s),this.a={keySystem:n,licenseServerUri:i[0],distinctiveIdentifierRequired:"required"==r.distinctiveIdentifier,persistentStateRequired:"required"==r.persistentState,audioRobustness:(r.audioCapabilities?r.audioCapabilities[0].robustness:"")||"",videoRobustness:(r.videoCapabilities?r.videoCapabilities[0].robustness:"")||"",serverCertificate:o[0],initData:a,keyIds:s},this.a.licenseServerUri?e.createMediaKeys():Promise.reject(new me(2,6,6012,this.a.keySystem))}.bind(e)).then(function(e){if(this.c)return Promise.reject();this.l=e,this.S=!0}.bind(e)).catch(function(e){if(!this.c)return this.a=null,this.u.clear(),e instanceof me?Promise.reject(e):Promise.reject(new me(2,6,6002,e.message))}.bind(e)),r.reject(),i}function St(e,t){try{var r=e.l.createSession("persistent-license")}catch(t){var n=new me(2,6,6005,t.message);return e.g(n),Promise.reject(n)}e.i.w(r,"message",e.fe.bind(e)),e.i.w(r,"keystatuseschange",e.de.bind(e));var i={initData:null,loaded:!1,hd:1/0,ya:null};return e.b.set(r,i),r.load(t).then(function(e){return this.c?Promise.reject():e?(i.loaded=!0,Pt(this)&&this.m.resolve(),r):(this.b.delete(r),void this.g(new me(2,6,6013)))}.bind(e),function(e){this.c||(this.b.delete(r),this.g(new me(2,6,6005,e.message)))}.bind(e))}function wt(e,t,r){try{var n=e.D?e.l.createSession("persistent-license"):e.l.createSession()}catch(t){return void e.g(new me(2,6,6005,t.message))}e.i.w(n,"message",e.fe.bind(e)),e.i.w(n,"keystatuseschange",e.de.bind(e)),e.b.set(n,{initData:r,loaded:!1,hd:1/0,ya:null});try{r=e.f.initDataTransform(r,e.a)}catch(r){return t=r,r instanceof me||(t=new me(2,6,6016,r)),void e.g(t)}n.generateRequest(t,r.buffer).catch((function(t){if(!e.c){if(e.b.delete(n),t.errorCode&&t.errorCode.systemCode){var r=t.errorCode.systemCode;0>r&&(r+=Math.pow(2,32)),r="0x"+r.toString(16)}e.g(new me(2,6,6006,t.message,t,r))}}))}function kt(e,t){if(_t(t).startsWith("com.apple.fps")){var r=t.serverCertificate;e=He(e,Ve(e),r)}return e}function Ct(e,t){var r=t.target,n=e.b.get(r),i=e.a.licenseServerUri,o=e.f.advanced[e.a.keySystem];"individualization-request"==t.messageType&&o&&o.individualizationServer&&(i=o.individualizationServer),(i=Me([i],e.f.retryParameters)).body=t.message,i.method="POST",i.licenseRequestType=t.messageType,i.sessionId=r.sessionId,"com.microsoft.playready"!=e.a.keySystem&&"com.chromecast.playready"!=e.a.keySystem||function(e){var t=st(e.body,!0,!0);if(t.includes("PlayReadyKeyMessage")){for(var r=(t=(new DOMParser).parseFromString(t,"application/xml")).getElementsByTagName("HttpHeader"),n=0;n<r.length;++n)e.headers[r[n].querySelector("name").textContent]=r[n].querySelector("value").textContent;e.body=ht.Ba(t.querySelector("Challenge").textContent).buffer}else e.headers["Content-Type"]="text/xml; charset=utf-8"}(i),e.a.keySystem.startsWith("com.apple.fps")&&e.f.fairPlayTransform&&function(e){var t=new Uint8Array(e.body);t="spc="+ht.zc(t),e.headers["Content-Type"]="application/x-www-form-urlencoded",e.body=ut(t)}(i);var a=Date.now();e.B.ub.request(2,i).promise.then(function(e){return this.c?Promise.reject():(this.a.keySystem.startsWith("com.apple.fps")&&this.f.fairPlayTransform&&function(e){try{var t=at(e.data)}catch(e){return}"<ckc>"===(t=t.trim()).substr(0,5)&&"</ckc>"===t.substr(-6)&&(t=t.slice(5,-6));try{t=JSON.parse(t).ckc}catch(e){}e.data=ht.Ba(t).buffer}(e),this.K+=(Date.now()-a)/1e3,r.update(e.data).then(function(){var e=this;this.B.onEvent(new Se("drmsessionupdate")),n&&(n.ya&&n.ya.resolve(),new fe((function(){n.loaded=!0,Pt(e)&&e.m.resolve()})).R(Ot))}.bind(this)))}.bind(e),function(e){this.c||(e=new me(2,6,6007,e),this.g(e),n&&n.ya&&n.ya.reject(e))}.bind(e)).catch(function(e){this.c||(e=new me(2,6,6008,e.message),this.g(e),n&&n.ya&&n.ya.reject(e))}.bind(e))}function xt(){var e=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],t=[{videoCapabilities:e,persistentState:"required",sessionTypes:["persistent-license"]},{videoCapabilities:e}],r=new Map;return e="org.w3.clearkey com.widevine.alpha com.microsoft.playready com.apple.fps.3_0 com.apple.fps.2_0 com.apple.fps.1_0 com.apple.fps com.adobe.primetime".split(" ").map((function(e){return function(e){return p((function n(){var i,o,a;return M(n,(function(n){switch(n.j){case 1:return k(n,2),S(n,navigator.requestMediaKeySystemAccess(e,t),4);case 4:return i=n.o,a=!!(o=i.getConfiguration().sessionTypes)&&o.includes("persistent-license"),rt("Tizen 3")&&(a=!1),r.set(e,{persistentState:a}),S(n,i.createMediaKeys(),5);case 5:x(n,0);break;case 2:R(n),r.set(e,null),w(n)}}))}))}(e)})),Promise.all(e).then((function(){return $e(r)}))}function Rt(e,t){var r=t.audio,n=t.video;if(r&&r.encrypted&&!At(e,qe(r.mimeType,r.codecs))||n&&n.encrypted&&!At(e,qe(n.mimeType,n.codecs)))return!1;var i=_t(e.a);return 0==t.drmInfos.length||t.drmInfos.some((function(e){return e.keySystem==i}))}function Lt(e,t){if(!e.length)return t;if(!t.length)return e;for(var r=[],n=0;n<e.length;n++)for(var i=0;i<t.length;i++)if(e[n].keySystem==t[i].keySystem){var o=e[n];i=t[i];var a=[];a=(a=a.concat(o.initData||[])).concat(i.initData||[]);var s=[];s=(s=s.concat(o.keyIds)).concat(i.keyIds),r.push({keySystem:o.keySystem,licenseServerUri:o.licenseServerUri||i.licenseServerUri,distinctiveIdentifierRequired:o.distinctiveIdentifierRequired||i.distinctiveIdentifierRequired,persistentStateRequired:o.persistentStateRequired||i.persistentStateRequired,videoRobustness:o.videoRobustness||i.videoRobustness,audioRobustness:o.audioRobustness||i.audioRobustness,serverCertificate:o.serverCertificate||i.serverCertificate,initData:a,keyIds:s});break}return r}function jt(e){return p((function t(){var r;return M(t,(function(t){switch(t.j){case 1:return r=Array.from(e.b.keys()),e.b.clear(),S(t,Promise.all(r.map((function(e){return p((function t(){return M(t,(function(t){switch(t.j){case 1:return k(t,2),S(t,Promise.all([e.close(),e.closed]),4);case 4:x(t,0);break;case 2:R(t),w(t)}}))}))}))),0)}}))}))}function Pt(e){return ze(e=e.b.values(),(function(e){return e.loaded}))}function It(t,r,n){!t.keySystem||"org.w3.clearkey"==t.keySystem&&t.licenseServerUri||(r.size&&(r=r.get(t.keySystem)||"",t.licenseServerUri=r),t.keyIds||(t.keyIds=[]),(n=n.get(t.keySystem))&&(t.distinctiveIdentifierRequired||(t.distinctiveIdentifierRequired=n.distinctiveIdentifierRequired),t.persistentStateRequired||(t.persistentStateRequired=n.persistentStateRequired),t.videoRobustness||(t.videoRobustness=n.videoRobustness),t.audioRobustness||(t.audioRobustness=n.audioRobustness),t.serverCertificate||(t.serverCertificate=n.serverCertificate)),e.cast&&e.cast.__platform__&&"com.microsoft.playready"==t.keySystem&&(t.keySystem="com.chromecast.playready"))}G("shaka.util.Uint8ArrayUtils.toBase64",ht.zc),ht.Ba=function(t){t=e.atob(t.replace(/-/g,"+").replace(/_/g,"/"));for(var r=new Uint8Array(t.length),n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r},G("shaka.util.Uint8ArrayUtils.fromBase64",ht.Ba),ht.Qc=function(t){for(var r=new Uint8Array(t.length/2),n=0;n<t.length;n+=2)r[n/2]=e.parseInt(t.substr(n,2),16);return r},G("shaka.util.Uint8ArrayUtils.fromHex",ht.Qc),ht.Ac=function(e){for(var t="",r=0;r<e.length;++r){var n=e[r].toString(16);1==n.length&&(n="0"+n),t+=n}return t},G("shaka.util.Uint8ArrayUtils.toHex",ht.Ac),ht.za=function(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!=t.length)return!1;for(var r=0;r<e.length;++r)if(e[r]!=t[r])return!1;return!0},G("shaka.util.Uint8ArrayUtils.equal",ht.za),ht.concat=function(e){for(var t=[],r=0;r<arguments.length;++r)t[r]=arguments[r];for(var n=r=0;n<t.length;++n)r+=t[n].length;r=new Uint8Array(r);for(var i=n=0;i<t.length;++i)r.set(t[i],n),n+=t[i].length;return r},G("shaka.util.Uint8ArrayUtils.concat",ht.concat),(n=pt.prototype).destroy=function(){var e=this;return p((function t(){return M(t,(function(t){switch(t.j){case 1:return e.c?S(t,e.na,0):(e.c=!0,S(t,function(e){return p((function t(){return M(t,(function(t){switch(t.j){case 1:return e.i.release(),e.i=null,e.m.reject(),e.$.stop(),e.$=null,e.O.stop(),e.O=null,S(t,jt(e),2);case 2:if(!e.h){t.A(3);break}return k(t,4),S(t,e.h.setMediaKeys(null),6);case 6:x(t,5);break;case 4:R(t);case 5:e.h=null;case 3:e.a=null,e.u.clear(),e.l=null,e.s=[],e.f=null,e.g=null,e.B=null,w(t)}}))}))}(e),4));case 4:e.na.resolve(),t.A(0)}}))}))},n.configure=function(e){this.f=e},n.Hb=function(e){var t=this;if(!this.l)return this.i.da(e,"encrypted",(function(){t.g(new me(2,6,6010))})),Promise.resolve();this.h=e,this.i.da(this.h,"play",(function(){for(var e=0;e<t.F.length;e++)Ct(t,t.F[e]);t.oa=!0,t.F=[]})),"webkitCurrentPlaybackTargetIsWireless"in this.h&&this.i.w(this.h,"webkitcurrentplaybacktargetiswirelesschanged",(function(){return jt(t)})),e=(e=this.h.setMediaKeys(this.l)).catch((function(e){return Promise.reject(new me(2,6,6003,e.message))}));var r=yt(this);return Promise.all([e,r]).then((function(){if(t.c)return Promise.reject();vt(t),t.a.initData.length||t.s.length||t.i.w(t.h,"encrypted",(function(e){return bt(t,e.initDataType,new Uint8Array(e.initData))}))})).catch((function(e){if(!t.c)return Promise.reject(e)}))},n.Lb=function(){for(var e=1/0,t=this.b.keys(),r=(t=f(t)).next();!r.done;r=t.next())r=r.value,isNaN(r.expiration)||(e=Math.min(e,r.expiration));return e},n.fe=function(e){this.h&&this.f.delayLicenseRequestUntilPlayed&&this.h.paused&&!this.oa?this.F.push(e):Ct(this,e)},n.de=function(e){e=e.target;var t=this.b.get(e),r=!1;e.keyStatuses.forEach(function(e,n){if("string"==typeof n){var i=n;n=e,e=i}if("com.microsoft.playready"==this.a.keySystem&&16==n.byteLength&&!rt("Tizen")&&!rt("VITIS")){var o=(i=new DataView(n)).getUint32(0,!0),a=i.getUint16(4,!0),s=i.getUint16(6,!0);i.setUint32(0,o,!1),i.setUint16(4,a,!1),i.setUint16(6,s,!1)}"com.microsoft.playready"==this.a.keySystem&&"status-pending"==e&&(e="usable"),"status-pending"!=e&&(t.loaded=!0),"expired"==e&&(r=!0),i=ht.Ac(new Uint8Array(n)),this.pa.set(i,e)}.bind(this));var n=e.expiration-Date.now();(0>n||r&&1e3>n)&&t&&!t.ya&&(this.b.delete(e),e.close().catch((function(){}))),Pt(this)&&(this.m.resolve(),this.O.R(Dt))};var Ot=5,Dt=.5;function Mt(){this.a=new muxjs.mp4.CaptionParser,this.g=[],this.f={}}function Nt(){}function Ft(e){return!e||1==e.length&&1e-6>e.end(0)-e.start(0)?null:e.length?e.end(e.length-1):null}function Ut(e,t,r){return r=void 0===r?0:r,!(!e||!e.length||1==e.length&&1e-6>e.end(0)-e.start(0)||t>e.end(e.length-1))&&t+r>=e.start(0)}function Bt(e,t){if(!e||!e.length||1==e.length&&1e-6>e.end(0)-e.start(0))return 0;for(var r=0,n=e.length-1;0<=n&&e.end(n)>t;--n)r+=e.end(n)-Math.max(e.start(n),t);return r}function Kt(e){if(!e)return[];for(var t=[],r=0;r<e.length;r++)t.push({start:e.start(r),end:e.end(r)});return t}Mt.prototype.init=function(e){var t=muxjs.mp4.probe;e=new Uint8Array(e),this.g=t.videoTrackIds(e),this.f=t.timescale(e),this.a.init()},Mt.prototype.b=function(e,t){var r=new Uint8Array(e);(r=this.a.parse(r,this.g,this.f))&&r.captions&&t(r.captions),this.a.clearParsedCaptions()},Mt.prototype.c=function(){this.a.resetCaptionStream()},Nt.prototype.init=function(){},Nt.prototype.b=function(){},Nt.prototype.c=function(){};var Gt={Ke:function(e,t){return e.reduce(function(e,t,r){return t.catch(e.bind(null,r))}.bind(null,t),Promise.reject())},Gc:function(e,t){return e.concat(t)},oc:function(){},Ia:function(e){return null!=e}};function Vt(e,t){if(0==t.length)return e;var r=t.map((function(e){return new Z(e)}));return e.map((function(e){return new Z(e)})).map((function(e){return r.map(e.resolve.bind(e))})).reduce(Gt.Gc,[]).map((function(e){return e.toString()}))}function Ht(e,t){return{keySystem:e,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:t||[],keyIds:[]}}var Yt={Pa:"video",Eb:"audio",ra:"text",Cg:"image",Ag:"application"};function zt(){this.a=new muxjs.mp4.Transmuxer({keepOriginalTimestamps:!0}),this.b=null,this.g=[],this.c=[],this.f=!1,this.a.on("data",this.i.bind(this)),this.a.on("done",this.h.bind(this))}function Wt(t,r){return!(!e.muxjs||"mp2t"!=t.toLowerCase().split(";")[0].split("/")[1])&&(r?MediaSource.isTypeSupported($t(r,t)):MediaSource.isTypeSupported($t("audio",t))||MediaSource.isTypeSupported($t("video",t)))}function $t(e,t){var r=t.replace(/mp2t/i,"mp4");"audio"==e&&(r=r.replace("video","audio"));var n=/avc1\.(66|77|100)\.(\d+)/.exec(r);if(n){var i="avc1.",o=n[1],a=Number(n[2]);i=("66"==o?i+"4200":"77"==o?i+"4d00":i+"6400")+(a>>4).toString(16),i+=(15&a).toString(16),r=r.replace(n[0],i)}return r}function qt(e,t,r){this.startTime=e,this.direction=tr,this.endTime=t,this.payload=r,this.region=new ur,this.position=null,this.positionAlign=Xt,this.size=100,this.textAlign=Jt,this.writingMode=rr,this.lineInterpretation=nr,this.line=null,this.lineHeight="",this.lineAlign=ir,this.displayAlign=Qt,this.fontSize=this.backgroundImage=this.backgroundColor=this.color="",this.fontWeight=ar,this.fontStyle=sr,this.fontFamily="",this.textDecoration=[],this.wrapLine=!0,this.id="",this.nestedCues=[],this.spacer=!1}zt.prototype.destroy=function(){return this.a.dispose(),this.a=null,Promise.resolve()},zt.prototype.i=function(e){this.c=e.captions;var t=new Uint8Array(e.data.byteLength+e.initSegment.byteLength);t.set(e.initSegment,0),t.set(e.data,e.initSegment.byteLength),this.g.push(t)},zt.prototype.h=function(){var e={data:ht.concat.apply(null,this.g),captions:this.c};this.b.resolve(e),this.f=!1},G("shaka.text.Cue",qt);var Xt="auto";qt.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:Xt};var Jt="center",Zt={LEFT:"left",RIGHT:"right",CENTER:Jt,START:"start",END:"end"};qt.textAlign=Zt;var Qt="after",er={BEFORE:"before",CENTER:"center",AFTER:Qt};qt.displayAlign=er;var tr="ltr";qt.direction={HORIZONTAL_LEFT_TO_RIGHT:tr,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var rr="horizontal-tb";qt.writingMode={HORIZONTAL_TOP_TO_BOTTOM:rr,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var nr=0;qt.lineInterpretation={LINE_NUMBER:nr,PERCENTAGE:1};var ir="start",or={CENTER:"center",START:ir,END:"end"};qt.lineAlign=or;var ar=400;qt.fontWeight={NORMAL:ar,BOLD:700};var sr="normal",lr={NORMAL:sr,ITALIC:"italic",OBLIQUE:"oblique"};function ur(){this.id="",this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0,this.height=this.width=100,this.viewportAnchorUnits=this.widthUnits=this.heightUnits=cr,this.scroll=dr}qt.fontStyle=lr,qt.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"},G("shaka.text.CueRegion",ur);var cr=1;ur.units={PX:0,PERCENTAGE:cr,LINES:2};var dr="";function fr(e){this.g=null,this.c=e,this.f=this.m=0,this.h=1/0,this.b=this.a=null,this.l="",this.i=new Map}ur.scrollMode={NONE:dr,UP:"up"};var hr={};function pr(t){return!!(hr[t]||e.muxjs&&"application/cea-608"==t)}function mr(e,t){"application/cea-608"!=t&&(e.g=new hr[t])}function gr(e,t,r,n,i){for(var o=r+" "+n,a=new Map,s=(t=f(t)).next();!s.done;s=t.next()){var l=s.value;s=l.stream,a.has(s)||a.set(s,new Map),a.get(s).has(o)||a.get(s).set(o,[]),l.startTime+=i,l.endTime+=i,l.startTime>=e.f&&l.startTime<e.h&&(l=new qt(l.startTime,l.endTime,l.text),a.get(s).get(o).push(l),s==e.l&&e.c.append([l]))}for(o=(i=f(a.keys())).next();!o.done;o=i.next())for(o=o.value,e.i.has(o)||e.i.set(o,new Map),s=(t=f(a.get(o).keys())).next();!s.done;s=t.next())s=s.value,l=a.get(o).get(s),e.i.get(o).set(s,l);e.a=null==e.a?Math.max(r,e.f):Math.min(e.a,Math.max(r,e.f)),e.b=Math.max(e.b,Math.min(n,e.h))}function yr(e,t,r){this.f=e,this.g=r,this.b={},this.a=null,this.c={},this.i=new Be,this.u=!1,this.l={},this.m=t,e=this.s=new ge,t=new MediaSource,this.i.da(t,"sourceopen",e.resolve),this.f.src=vr(t),this.h=t}G("shaka.text.TextEngine.registerParser",(function(e,t){hr[e]=t})),G("shaka.text.TextEngine.unregisterParser",(function(e){delete hr[e]})),fr.prototype.destroy=function(){return this.c=this.g=null,this.i.clear(),Promise.resolve()},fr.prototype.kc=function(e){try{return this.g.parseMedia(new Uint8Array(e),{periodStart:0,segmentStart:null,segmentEnd:0})[0].startTime}catch(e){throw new me(2,2,2009,e)}},fr.prototype.remove=function(e,t){return Promise.resolve().then(function(){!this.c||!this.c.remove(e,t)||null==this.a||t<=this.a||e>=this.b||(e<=this.a&&t>=this.b?this.a=this.b=null:e<=this.a&&t<this.b?this.a=t:e>this.a&&t>=this.b&&(this.b=e))}.bind(this))};var vr=e.URL.createObjectURL;function br(e){var t=qe(e.mimeType,e.codecs),r=function(e){var t=[e.mimeType];return Je.forEach((function(r,n){var i=e[n];i&&t.push(r+'="'+i+'"')})),t.join(";")}(e);return pr(t)||MediaSource.isTypeSupported(r)||Wt(t,e.type)}function _r(e,t){e.a||(e.a=new fr(e.g)),mr(e.a,t)}function Ar(e){return!e.h||"ended"==e.h.readyState}function Er(e,t){if("text"==t)var r=e.a.a;else r=!(r=Sr(e,t))||1==r.length&&1e-6>r.end(0)-r.start(0)?null:1==r.length&&0>r.start(0)?0:r.length?r.start(0):null;return r}function Tr(e,t){return"text"==t?e.a.b:Ft(Sr(e,t))}function Sr(e,t){try{return e.b[t].buffered}catch(e){return null}}function wr(t,r,n,i,o,a){return"text"==r?function(e,t,r,n){return Promise.resolve().then(function(){if(this.g&&this.c)if(null==r||null==n)this.g.parseInit(new Uint8Array(t));else{var e={periodStart:this.m,segmentStart:r,segmentEnd:n};e=this.g.parseMedia(new Uint8Array(t),e).filter(function(e){return e.startTime>=this.f&&e.startTime<this.h}.bind(this)),this.c.append(e),null==this.a&&(this.a=Math.max(r,this.f)),this.b=Math.min(n,this.h)}}.bind(e))}(t.a,n,i,o):t.l[r]?function(e,t){e.f=!0,e.b=new ge,e.g=[],e.c=[];var r=new Uint8Array(t);return e.a.push(r),e.a.flush(),e.f&&e.b.reject(new me(2,3,3018)),e.b}(t.l[r],n).then(function(e){return this.a||_r(this,"text/vtt"),e.captions&&e.captions.length&&gr(this.a,e.captions,i,o,this.b.video.timestampOffset),xr(this,r,this.re.bind(this,r,e.data.buffer))}.bind(t)):(a&&e.muxjs&&(t.a||_r(t,"text/vtt"),null==i&&null==o?t.m.init(n):t.m.b(n,(function(e){e.length&&gr(t.a,e,i,o,t.b.video.timestampOffset)}))),xr(t,r,t.re.bind(t,r,n)))}function kr(e,t){var r=Tr(e,"video")||0;!function(e,t,r){if(e.l=t,t=e.i.get(t))for(var n=f(t.keys()),i=n.next();!i.done;i=n.next())(i=t.get(i.value).filter((function(e){return e.endTime<=r})))&&e.c.append(i)}(e.a,t,r)}function Cr(e,t){return"text"==t?e.a?(e.m.c(),e.a.remove(0,1/0)):Promise.resolve():xr(e,t,e.se.bind(e,t,0,e.h.duration))}function xr(e,t,r){if(e.u)return Promise.reject();if(r={start:r,p:new ge},e.c[t].push(r),1==e.c[t].length)try{r.start()}catch(n){"QuotaExceededError"==n.name?r.p.reject(new me(2,3,3017,t)):r.p.reject(new me(2,3,3015,n)),Lr(e,t)}return r.p}function Rr(e,t){if(e.u)return Promise.reject();var r,n=[];for(r in e.b){var i=new ge,o={start:function(e){e.resolve()}.bind(null,i),p:i};e.c[r].push(o),n.push(i),1==e.c[r].length&&o.start()}return Promise.all(n).then(function(){try{t()}catch(t){var e=Promise.reject(new me(2,3,3015,t))}for(var r in this.b)Lr(this,r);return e}.bind(e),function(e){throw e}.bind(e))}function Lr(e,t){e.c[t].shift();var r=e.c[t][0];if(r)try{r.start()}catch(n){r.p.reject(new me(2,3,3015,n)),Lr(e,t)}}function jr(e,t){return e=Ir(e),t=Ir(t),e.split("-")[0]==t.split("-")[0]}function Pr(e,t){e=Ir(e),t=Ir(t);var r=e.split("-"),n=t.split("-");return r[0]==n[0]&&1==r.length&&2==n.length}function Ir(e){var t=e.split("-");return e=t[0]||"",t=t[1]||"",e=e.toLowerCase(),e=Mr.get(e)||e,(t=t.toUpperCase())?e+"-"+t:e}function Or(e){return e.language?Ir(e.language):e.audio&&e.audio.language?Ir(e.audio.language):e.video&&e.video.language?Ir(e.video.language):"und"}function Dr(e,t){for(var r=Ir(e),n=new Set,i=f(t),o=i.next();!o.done;o=i.next())n.add(Ir(o.value));for(o=(i=f(n)).next();!o.done;o=i.next())if((o=o.value)==r)return o;for(o=(i=f(n)).next();!o.done;o=i.next())if(Pr(o=o.value,r))return o;for(o=(i=f(n)).next();!o.done;o=i.next()){var a=o=o.value,s=r;if(a=Ir(a),s=Ir(s),a=a.split("-"),s=s.split("-"),2==a.length&&2==s.length&&a[0]==s[0])return o}for(o=(n=f(n)).next();!o.done;o=n.next())if(Pr(r,i=o.value))return i;return null}(n=yr.prototype).destroy=function(){var e=this;this.u=!0;var t,r=[];for(t in this.c){var n=this.c[t],i=n[0];for(this.c[t]=n.slice(0,1),i&&r.push(i.p.catch(Gt.oc)),i=1;i<n.length;++i)n[i].p.reject()}for(var o in this.a&&r.push(this.a.destroy()),this.g&&r.push(this.g.destroy()),this.l)r.push(this.l[o].destroy());return Promise.all(r).then((function(){e.i&&(e.i.release(),e.i=null),e.f&&(e.f.removeAttribute("src"),e.f.load(),e.f=null),e.h=null,e.a=null,e.g=null,e.b={},e.l={},e.m=null,e.c={}}))},n.init=function(e,t){var r=this;return p((function n(){var i;return M(n,(function(n){switch(n.j){case 1:return i=Yt,S(n,r.s,2);case 2:e.forEach((function(e,n){var o=qe(e.mimeType,e.codecs);n==i.ra?_r(r,o):(!t&&MediaSource.isTypeSupported(o)||!Wt(o,n)||(r.l[n]=new zt,o=$t(n,o)),o=r.h.addSourceBuffer(o),r.i.w(o,"error",r.lg.bind(r,n)),r.i.w(o,"updateend",r.xb.bind(r,n)),r.b[n]=o,r.c[n]=[])})),w(n)}}))}))},n.Sc=function(e){if(e.total=Kt(this.f.buffered),e.audio=Kt(Sr(this,"audio")),e.video=Kt(Sr(this,"video")),e.text=[],this.a){var t=this.a.a,r=this.a.b;null!=t&&null!=r&&e.text.push({start:t,end:r})}},n.remove=function(e,t,r){return"text"==e?this.a.remove(t,r):xr(this,e,this.se.bind(this,e,t,r))},n.flush=function(e){return"text"==e?Promise.resolve():xr(this,e,this.Pe.bind(this,e))},n.endOfStream=function(e){return Rr(this,function(){Ar(this)||(e?this.h.endOfStream(e):this.h.endOfStream())}.bind(this))},n.xa=function(e){return Rr(this,function(){this.h.duration=e}.bind(this))},n.Y=function(){return this.h.duration},n.re=function(e,t){this.b[e].appendBuffer(t)},n.se=function(e,t,r){r<=t?this.xb(e):this.b[e].remove(t,r)},n.Be=function(e){var t=this.b[e].appendWindowStart,r=this.b[e].appendWindowEnd;this.b[e].abort(),this.b[e].appendWindowStart=t,this.b[e].appendWindowEnd=r,this.xb(e)},n.Pe=function(e){this.f.currentTime-=.001,this.xb(e)},n.kg=function(e,t){0>t&&(t+=.001),this.b[e].timestampOffset=t,this.xb(e)},n.hg=function(e,t,r){this.b[e].appendWindowStart=0,this.b[e].appendWindowEnd=r,this.b[e].appendWindowStart=t,this.xb(e)},n.lg=function(e){this.c[e][0].p.reject(new me(2,3,3014,this.f.error?this.f.error.code:0))},n.xb=function(e){var t=this.c[e][0];t&&(t.p.resolve(),Lr(this,e))};var Mr=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"]]),Nr={bd:function(e,t,r){function n(e,t,r){return e>=t&&e<=r}var i=e.video;return!(i&&i.width&&i.height&&(!n(i.width,t.minWidth,Math.min(t.maxWidth,r.width))||!n(i.height,t.minHeight,Math.min(t.maxHeight,r.height))||!n(i.width*i.height,t.minPixels,t.maxPixels))||e&&e.frameRate&&!n(e.frameRate,t.minFrameRate,t.maxFrameRate)||!n(e.bandwidth,t.minBandwidth,t.maxBandwidth))},Gd:function(e,t,r){var n=!1;return e.forEach((function(e){var i=e.allowedByApplication;e.allowedByApplication=Nr.bd(e,t,r),i!=e.allowedByApplication&&(n=!0)})),n},filterNewPeriod:function(e,t,r,n){n.variants=n.variants.filter((function(n){if(e&&e.S&&!Rt(e,n))return!1;var i=n.audio;return n=n.video,!(i&&!br(i)||n&&!br(n)||i&&t&&!Nr.Hd(i,t)||n&&r&&!Nr.Hd(n,r))})),n.textStreams=n.textStreams.filter((function(e){return pr(qe(e.mimeType,e.codecs))}))},Hd:function(e,t){return e.mimeType==t.mimeType&&e.codecs.split(".")[0]==t.codecs.split(".")[0]},Ed:function(e){var t=e.audio,r=e.video,n=t?t.codecs:null,i=r?r.codecs:null,o=[];i&&o.push(i),n&&o.push(n);var a=[];r&&a.push(r.mimeType),t&&a.push(t.mimeType),a=a[0]||null;var s=[];t&&s.push(t.kind),r&&s.push(r.kind),s=s[0]||null;var l=new Set;return t&&t.roles.forEach((function(e){return l.add(e)})),r&&r.roles.forEach((function(e){return l.add(e)})),e={id:e.id,active:!1,type:"variant",bandwidth:e.bandwidth,language:e.language,label:null,kind:s,width:null,height:null,frameRate:null,pixelAspectRatio:null,mimeType:a,codecs:o.join(", "),audioCodec:n,videoCodec:i,primary:e.primary,roles:Array.from(l),audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null},r&&(e.videoId=r.id,e.originalVideoId=r.originalId,e.width=r.width||null,e.height=r.height||null,e.frameRate=r.frameRate||null,e.pixelAspectRatio=r.pixelAspectRatio||null,e.videoBandwidth=r.bandwidth||null),t&&(e.audioId=t.id,e.originalAudioId=t.originalId,e.channelsCount=t.channelsCount,e.audioSamplingRate=t.audioSamplingRate,e.audioBandwidth=t.bandwidth||null,e.label=t.label,e.audioRoles=t.roles),e},xc:function(e){return{id:e.id,active:!1,type:"text",bandwidth:0,language:e.language,label:e.label,kind:e.kind||null,width:null,height:null,frameRate:null,pixelAspectRatio:null,mimeType:e.mimeType,codecs:e.codecs||null,audioCodec:null,videoCodec:null,primary:e.primary,roles:e.roles,audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:e.originalId}},Wc:function(e){return e.__shaka_id||(e.__shaka_id=Nr.yf++),e.__shaka_id},yf:0,sf:function(e){var t=Nr.Sd(e);return t.active="disabled"!=e.mode,t.type="text",t.originalTextId=e.id,"captions"==e.kind&&(t.mimeType="application/cea-608"),t},rf:function(e){var t=Nr.Sd(e);return t.active=e.enabled,t.type="variant",t.originalAudioId=e.id,"main"==e.kind?(t.primary=!0,t.roles=["main"],t.audioRoles=["main"]):t.audioRoles=[],t},Sd:function(e){return{id:Nr.Wc(e),active:!1,type:"",bandwidth:0,language:Ir(e.language),label:e.label,kind:e.kind,width:null,height:null,frameRate:null,pixelAspectRatio:null,mimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:!1,roles:[],audioRoles:null,videoId:null,audioId:null,channelsCount:null,audioSamplingRate:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null}},rb:function(e){return e.allowedByApplication&&e.allowedByKeySystem},df:function(e){return e.filter((function(e){return Nr.rb(e)}))},Nd:function(e,t){for(var r=e.filter((function(e){return e.audio&&e.audio.channelsCount})),n=new Map,i=(r=f(r)).next();!i.done;i=r.next()){var o=(i=i.value).audio.channelsCount;n.has(o)||n.set(o,[]),n.get(o).push(i)}return 0==(r=Array.from(n.keys())).length?e:(i=r.filter((function(e){return e<=t}))).length?n.get(Math.max.apply(null,i)):n.get(Math.min.apply(null,r))},Jb:function(e,t,r){var n=e,i=e.filter((function(e){return e.primary}));i.length&&(n=i);var o=n.length?n[0].language:"";if(n=n.filter((function(e){return e.language==o})),t){var a=Dr(Ir(t),e.map((function(e){return e.language})));a&&(n=e.filter((function(e){return Ir(e.language)==a})))}if(r){if((e=Nr.Md(n,r)).length)return e}else if((e=n.filter((function(e){return 0==e.roles.length}))).length)return e;return(e=n.map((function(e){return e.roles})).reduce(Gt.Gc,[])).length?Nr.Md(n,e[0]):n},Md:function(e,t){return e.filter((function(e){return e.roles.includes(t)}))},Qd:function(e,t,r){for(var n=0;n<r.length;n++)if(r[n].audio==e&&r[n].video==t)return r[n];return null},tf:function(e){return"audio"==e.type},wf:function(e){return"video"==e.type},nf:function(e){var t=[];return e.audio&&t.push(e.audio),e.video&&t.push(e.video),t},Gg:function(e){return Nr.tf(e)?"type=audio codecs="+e.codecs+" bandwidth="+e.bandwidth+" channelsCount="+e.channelsCount+" audioSamplingRate="+e.audioSamplingRate:Nr.wf(e)?"type=video codecs="+e.codecs+" bandwidth="+e.bandwidth+" frameRate="+e.frameRate+" width="+e.width+" height="+e.height:"unexpected stream type"}};function Fr(){this.h=null,this.f=!1,this.b=new W,this.c=[],this.i=!1,this.a=this.g=null}function Ur(e,t){return e&&(t=t.filter((function(t){return Nr.bd(t,e,{width:1/0,height:1/0})}))),t.sort((function(e,t){return e.bandwidth-t.bandwidth}))}function Br(e,t){this.a=e,this.b=t}function Kr(e,t){var r=new Br(2,6),n=Hr,i=n.a,o=r.b-i.b;(0<(r.a-i.a||o)?n.c:n.b)(n.a,r,e,t)}function Gr(e,t,r,n){q([r,"has been deprecated and will be removed in",t,". We are currently at version",e,". Additional information:",n].join(" "))}function Vr(e,t,r,n){$([r,"has been deprecated and has been removed in",t,". We are now at version",e,". Additional information:",n].join(""))}G("shaka.abr.SimpleAbrManager",Fr),Fr.prototype.stop=function(){this.h=null,this.f=!1,this.c=[],this.g=null},Fr.prototype.stop=Fr.prototype.stop,Fr.prototype.init=function(e){this.h=e},Fr.prototype.init=Fr.prototype.init,Fr.prototype.chooseVariant=function(){var e=Ur(this.a.restrictions,this.c),t=this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate);this.c.length&&!e.length&&(e=[(e=Ur(null,this.c))[0]]);for(var r=e[0]||null,n=0;n<e.length;++n){var i=e[n],o=(e[n+1]||{bandwidth:1/0}).bandwidth/this.a.bandwidthUpgradeTarget;t>=i.bandwidth/this.a.bandwidthDowngradeTarget&&t<=o&&(r=i)}return this.g=Date.now(),r},Fr.prototype.chooseVariant=Fr.prototype.chooseVariant,Fr.prototype.enable=function(){this.f=!0},Fr.prototype.enable=Fr.prototype.enable,Fr.prototype.disable=function(){this.f=!1},Fr.prototype.disable=Fr.prototype.disable,Fr.prototype.segmentDownloaded=function(e,t){var r=this.b;if(!(16e3>t)){var n=8e3*t/e,i=e/1e3;r.a+=t,Y(r.b,i,n),Y(r.c,i,n)}if(null!=this.g&&this.f)e:{if(this.i){if(Date.now()-this.g<1e3*this.a.switchInterval)break e}else{if(!(128e3<=this.b.a))break e;this.i=!0}r=this.chooseVariant(),this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate),this.h(r)}},Fr.prototype.segmentDownloaded=Fr.prototype.segmentDownloaded,Fr.prototype.getBandwidthEstimate=function(){return this.b.getBandwidthEstimate(this.a.defaultBandwidthEstimate)},Fr.prototype.getBandwidthEstimate=Fr.prototype.getBandwidthEstimate,Fr.prototype.setVariants=function(e){this.c=e},Fr.prototype.setVariants=Fr.prototype.setVariants,Fr.prototype.configure=function(e){this.a=e},Fr.prototype.configure=Fr.prototype.configure,Br.prototype.toString=function(){return"v"+this.a+"."+this.b};var Hr=null,Yr="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),zr="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),Wr=["loop","playbackRate"],$r=["pause","play"],qr="abrstatuschanged adaptation buffering drmsessionupdate emsg error expirationupdated largegap loading manifestparsed onstatechange onstateidle streaming textchanged texttrackvisibility timelineregionadded timelineregionenter timelineregionexit trackschanged unloading variantchanged".split(" "),Xr={getAssetUri:2,getAudioLanguages:2,getAudioLanguagesAndRoles:2,getBufferedInfo:2,getConfiguration:2,getExpiration:2,getPlaybackRate:2,getTextLanguages:2,getTextLanguagesAndRoles:2,getTextTracks:2,getStats:5,getVariantTracks:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1,usingEmbeddedTextTrack:2,getLoadMode:10},Jr={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20},Zr=[["getConfiguration","configure"]],Qr=[["isTextTrackVisible","setTextTrackVisibility"]],en="addTextTrack cancelTrickPlay configure resetConfiguration retryStreaming selectAudioLanguage selectEmbeddedTextTrack selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel setTextTrackVisibility trickPlay".split(" "),tn=["attach","detach","load","unload"];function rn(e){return JSON.stringify(e,(function(e,t){if("function"!=typeof t){if(t instanceof Event||t instanceof Se){var r,n={};for(r in t){var i=t[r];i&&"object"==typeof i?"detail"==r&&(n[r]=i):r in Event||(n[r]=i)}return n}if(t instanceof TimeRanges)for(n={__type__:"TimeRanges",length:t.length,start:[],end:[]},r=0;r<t.length;++r)n.start.push(t.start(r)),n.end.push(t.end(r));else n=t instanceof Uint8Array?{__type__:"Uint8Array",entries:Array.from(t)}:"number"==typeof t?isNaN(t)?"NaN":isFinite(t)?t:0>t?"-Infinity":"Infinity":t;return n}}))}function nn(e){return JSON.parse(e,(function(e,t){return"NaN"==t?NaN:"-Infinity"==t?-1/0:"Infinity"==t?1/0:t&&"object"==typeof t&&"TimeRanges"==t.__type__?function(e){return{length:e.length,start:function(t){return e.start[t]},end:function(t){return e.end[t]}}}(t):t&&"object"==typeof t&&"Uint8Array"==t.__type__?new Uint8Array(t.entries):t}))}function on(e,t,r,n,i,o){this.O=e,this.f=new fe(t),this.S=r,this.l=!1,this.F=n,this.K=i,this.B=o,this.b=this.h=!1,this.D="",this.i=null,this.m=this.ce.bind(this),this.s=this.Ff.bind(this),this.a={video:{},player:{}},this.u=0,this.c={},this.g=null,pn.add(this)}var an=!1,sn=null;function ln(e){for(var t=f(pn),r=t.next();!r.done;r=t.next())un(r.value,e)}function un(e,t){var r=e.B();e.g=new ge,e.l=!0,e.kd(r,t)}function cn(e){for(var t=f(pn),r=t.next();!r.done;r=t.next())r=r.value,an="available"==e,r.f.yc()}function dn(e){var t=sn;t.removeUpdateListener(e.m),t.removeMessageListener("urn:x-cast:com.google.shaka.v2",e.s)}function fn(e){for(var t in e.c){var r=e.c[t];delete e.c[t],r.reject(new me(1,7,7e3))}}function hn(e){e=rn(e),sn.sendMessage("urn:x-cast:com.google.shaka.v2",e,(function(){}),X)}(n=on.prototype).destroy=function(){return pn.delete(this),fn(this),sn&&dn(this),this.f&&(this.f.stop(),this.f=null),this.K=this.F=null,this.b=this.h=!1,this.s=this.m=this.g=this.c=this.a=this.i=null,Promise.resolve()},n.ga=function(){return this.b},n.nd=function(){return this.D},n.init=function(){if(e.chrome&&chrome.cast&&chrome.cast.isAvailable&&this.O.length){this.h=!0,this.f.yc();var t=new chrome.cast.SessionRequest(this.O);t=new chrome.cast.ApiConfig(t,ln.bind(this),cn.bind(this),"origin_scoped"),chrome.cast.initialize(t,(function(){}),(function(){})),an&&this.f.R(.02),(t=sn)&&t.status!=chrome.cast.SessionStatus.STOPPED?un(this,t):sn=null}},n.ud=function(e){this.i=e,this.b&&hn({type:"appData",appData:this.i})},n.cast=function(e){return this.h?an?this.b?Promise.reject(new me(1,8,8002)):(this.g=new ge,chrome.cast.requestSession(this.kd.bind(this,e),this.be.bind(this)),this.g):Promise.reject(new me(1,8,8001)):Promise.reject(new me(1,8,8e3))},n.Kb=function(){this.b&&(fn(this),sn&&(dn(this),sn.stop((function(){}),(function(){})),sn=null))},n.get=function(e,t){if("video"==e){if($r.includes(t))return this.le.bind(this,e,t)}else if("player"==e){if(Jr[t]&&!this.get("player","isLive")())return function(){};if(en.includes(t))return this.le.bind(this,e,t);if(tn.includes(t))return this.Wf.bind(this,e,t);if(Xr[t])return this.ie.bind(this,e,t)}return this.ie(e,t)},n.set=function(e,t,r){this.a[e][t]=r,hn({type:"set",targetName:e,property:t,value:r})},n.kd=function(e,t){sn=t,t.addUpdateListener(this.m),t.addMessageListener("urn:x-cast:com.google.shaka.v2",this.s),this.ce(),hn({type:"init",initState:e,appData:this.i}),this.g.resolve()},n.be=function(e){var t=8003;switch(e.code){case"cancel":t=8004;break;case"timeout":t=8005;break;case"receiver_unavailable":t=8006}this.g.reject(new me(2,8,t,e))},n.ie=function(e,t){return this.a[e][t]},n.le=function(e,t,r){for(var n=[],i=2;i<arguments.length;++i)n[i-2]=arguments[i];hn({type:"call",targetName:e,methodName:t,args:n})},n.Wf=function(e,t,r){for(var n=[],i=2;i<arguments.length;++i)n[i-2]=arguments[i];i=new ge;var o=this.u.toString();return this.u++,this.c[o]=i,hn({type:"asyncCall",targetName:e,methodName:t,args:n,id:o}),i},n.ce=function(){var e=!!sn&&"connected"==sn.status;if(this.b&&!e){for(var t in this.K(),this.a)this.a[t]={};fn(this)}this.D=(this.b=e)?sn.receiver.friendlyName:"",this.f.yc()},n.Ff=function(e,t){var r=nn(t);switch(r.type){case"event":var n=r.event;this.F(r.targetName,new Se(n.type,n));break;case"update":for(var i in n=r.update)for(var o in r=this.a[i]||{},n[i])r[o]=n[i][o];this.l&&(this.S(),this.l=!1);break;case"asyncComplete":if(i=r.id,r=r.error,o=this.c[i],delete this.c[i],o)if(r){for(n in i=new me(r.severity,r.category,r.code),r)i[n]=r[n];o.reject(i)}else o.resolve()}};var pn=new Set;function mn(e,t,r){var n=this;ke.call(this),this.c=e,this.b=t,this.i=this.g=this.f=this.l=this.h=null,this.s=r,this.m=new Map,this.a=new on(r,(function(){return vn(n)}),(function(){return bn(n)}),(function(e,t){return An(n,e,t)}),(function(){return _n(n)}),(function(){return yn(n)})),function(e){for(var t in e.a.init(),e.i=new Be,Yr.forEach(function(e){this.i.w(this.c,e,this.D.bind(this))}.bind(e)),qr.forEach(function(e){this.i.w(this.b,e,this.u.bind(this))}.bind(e)),e.h={},e.c)Object.defineProperty(e.h,t,{configurable:!1,enumerable:!0,get:e.B.bind(e,t),set:e.F.bind(e,t)});e.l={},gn(e,(function(t){Object.defineProperty(e.l,t,{configurable:!1,enumerable:!0,get:function(){return function e(t,r){if(t.m.has(r)&&(r=t.m.get(r)),"addEventListener"==r)return t.g.addEventListener.bind(t.g);if("removeEventListener"==r)return t.g.removeEventListener.bind(t.g);if("getMediaElement"==r)return function(){return this.h}.bind(t);if("getSharedConfiguration"==r)return t.a.get("player","getConfiguration");if("getNetworkingEngine"==r)return t.b.Mb.bind(t.b);if(t.a.ga()){if("getManifest"==r||"drmInfo"==r)return function(){return q(r+"() does not work while casting!"),null};if("getManifestUri"==r)return Kr("getManifestUri",'Please use "getAssetUri" instead.'),e(t,"getAssetUri");if("attach"==r||"detach"==r)return function(){return q(r+"() does not work while casting!"),Promise.resolve()}}return t.a.ga()&&0==Object.keys(t.a.a.video).length&&Xr[r]||!t.a.ga()?t.b[r].bind(t.b):t.a.get("player",r)}(e,t)}})})),function(e){var t=new Map;gn(e,(function(r,n){if(t.has(n)){var i=t.get(n);r.length<i.length?e.m.set(r,i):e.m.set(i,r)}else t.set(n,r)}))}(e),e.f=new ke,e.f.$b=e.h,e.g=new ke,e.g.$b=e.l}(this)}function gn(e,t){function r(e){return"constructor"!=e&&"function"==typeof n[e]&&!i.has(e)}var n=e.b,i=new Set;for(o in n)r(o)&&(i.add(o),t(o,n[o]));for(var o=Object.getPrototypeOf(n),a=Object.getPrototypeOf({});o&&o!=a;){for(var s=f(Object.getOwnPropertyNames(o)),l=s.next();!l.done;l=s.next())r(l=l.value)&&(i.add(l),t(l,n[l]));o=Object.getPrototypeOf(o)}}function yn(e){var t={video:{},player:{},playerAfterLoad:{},manifest:e.b.hc(),startTime:null};return e.c.pause(),Wr.forEach(function(e){t.video[e]=this.c[e]}.bind(e)),e.c.ended||(t.startTime=e.c.currentTime),Zr.forEach(function(e){var r=e[1];e=this.b[e[0]](),t.player[r]=e}.bind(e)),Qr.forEach(function(e){var r=e[1];e=this.b[e[0]](),t.playerAfterLoad[r]=e}.bind(e)),t}function vn(e){e.dispatchEvent(new Se("caststatuschanged"))}function bn(e){e.f.dispatchEvent(new Se(e.h.paused?"pause":"play"))}function _n(e){Zr.forEach(function(e){var t=e[1];e=this.a.get("player",e[0])(),this.b[t](e)}.bind(e));var t=e.a.get("player","getAssetUri")(),r=e.a.get("video","ended"),n=Promise.resolve(),i=e.c.autoplay,o=null;r||(o=e.a.get("video","currentTime")),t&&(e.c.autoplay=!1,n=e.b.load(t,o));var a={};Wr.forEach(function(e){a[e]=this.a.get("video",e)}.bind(e)),n.then((function(){e.c&&(Wr.forEach(function(e){this.c[e]=a[e]}.bind(e)),Qr.forEach(function(e){var t=e[1];e=this.a.get("player",e[0])(),this.b[t](e)}.bind(e)),e.c.autoplay=i,t&&e.c.play())}),(function(t){e.b.dispatchEvent(new Se("error",{detail:t}))}))}function An(e,t,r){e.a.ga()&&("video"==t?e.f.dispatchEvent(r):"player"==t&&e.g.dispatchEvent(r))}function En(e,t,r,n){var i=this;ke.call(this),this.a=e,this.b=t,this.c=new Be,this.D={video:e,player:t},this.s=r||function(){},this.F=n||function(e){return e},this.u=!1,this.h=!0,this.g=0,this.m=!1,this.l=!0,this.i=this.f=null,this.B=new fe((function(){Sn(i)})),function(e){var t=cast.receiver.CastReceiverManager.getInstance();t.onSenderConnected=e.ee.bind(e),t.onSenderDisconnected=e.ee.bind(e),t.onSystemVolumeChanged=e.Oe.bind(e),e.i=t.getCastMessageBus("urn:x-cast:com.google.cast.media"),e.i.onMessage=e.Af.bind(e),e.f=t.getCastMessageBus("urn:x-cast:com.google.shaka.v2"),e.f.onMessage=e.Kf.bind(e),t.start(),Yr.forEach(function(e){this.c.w(this.a,e,this.je.bind(this,"video"))}.bind(e)),qr.forEach(function(e){this.c.w(this.b,e,this.je.bind(this,"player"))}.bind(e)),cast.__platform__&&cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160')?e.b.vd(3840,2160):e.b.vd(1920,1080),e.c.w(e.a,"loadeddata",function(){this.m=!0}.bind(e)),e.c.w(e.b,"loading",function(){this.h=!1,Tn(this)}.bind(e)),e.c.w(e.a,"playing",function(){this.h=!1,Tn(this)}.bind(e)),e.c.w(e.a,"pause",function(){Tn(this)}.bind(e)),e.c.w(e.b,"unloading",function(){this.h=!0,Tn(this)}.bind(e)),e.c.w(e.a,"ended",function(){var e=this;new fe((function(){e.a&&e.a.ended&&(e.h=!0,Tn(e))})).R(5)}.bind(e))}(this)}function Tn(e){Promise.resolve().then(function(){this.b&&(this.dispatchEvent(new Se("caststatuschanged")),wn(this)||xn(this,0))}.bind(e))}function Sn(e){e.B.R(.5);var t={video:{},player:{}};if(zr.forEach(function(e){t.video[e]=this.a[e]}.bind(e)),e.b.V())for(var r in Jr)0==e.g%Jr[r]&&(t.player[r]=e.b[r]());for(var n in Xr)0==e.g%Xr[n]&&(t.player[n]=e.b[n]());(r=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())&&(t.video.volume=r.level,t.video.muted=r.muted),e.m&&(e.g+=1),Cn(e,{type:"update",update:t},e.f),wn(e)}function wn(e){return!(!e.l||!e.a.duration&&!e.b.V()||(kn(e),e.l=!1,0))}function kn(e){var t={contentId:e.b.hc(),streamType:e.b.V()?"LIVE":"BUFFERED",duration:e.a.duration,contentType:""};xn(e,0,t)}function Cn(e,t,r,n){e.u&&(e=rn(t),n?r.getCastChannel(n).send(e):r.broadcast(e))}function xn(e,t,r){var n=e.a.playbackRate,i=Rn;n={mediaSessionId:0,playbackRate:n,playerState:i=e.h?i.IDLE:e.b.Xc()?i.we:e.a.paused?i.ye:i.ze,currentTime:e.a.currentTime,supportedMediaCommands:15,volume:{level:e.a.volume,muted:e.a.muted}},r&&(n.media=r),Cn(e,{requestId:t,type:"MEDIA_STATUS",status:[n]},e.i)}e.__onGCastApiAvailable=function(e){if(e)for(var t=(e=f(pn)).next();!t.done;t=e.next())t.value.init()},V(mn,ke),G("shaka.cast.CastProxy",mn),mn.prototype.destroy=function(e){return e&&this.a.Kb(),this.i&&(this.i.release(),this.i=null),e=[],this.b&&(e.push(this.b.destroy()),this.b=null),this.a&&(e.push(this.a.destroy()),this.a=null),this.l=this.h=this.c=null,Promise.all(e)},mn.prototype.destroy=mn.prototype.destroy,mn.prototype.pf=function(){return this.h},mn.prototype.getVideo=mn.prototype.pf,mn.prototype.ff=function(){return this.l},mn.prototype.getPlayer=mn.prototype.ff,mn.prototype.Ee=function(){return this.a.h&&an},mn.prototype.canCast=mn.prototype.Ee,mn.prototype.ga=function(){return this.a.ga()},mn.prototype.isCasting=mn.prototype.ga,mn.prototype.nd=function(){return this.a.nd()},mn.prototype.receiverName=mn.prototype.nd,mn.prototype.cast=function(){var e=yn(this);return this.a.cast(e).then(function(){if(this.b)return this.b.Cd()}.bind(this))},mn.prototype.cast=mn.prototype.cast,mn.prototype.ud=function(e){this.a.ud(e)},mn.prototype.setAppData=mn.prototype.ud,mn.prototype.sg=function(){var e=this.a;if(e.b){var t=e.B();chrome.cast.requestSession(e.kd.bind(e,t),e.be.bind(e))}},mn.prototype.suggestDisconnect=mn.prototype.sg,mn.prototype.He=function(e){var t=this;return p((function r(){return M(r,(function(r){switch(r.j){case 1:return e==t.s?r.return():(t.s=e,t.a.Kb(),S(r,t.a.destroy(),2));case 2:t.a=null,t.a=new on(e,(function(){return vn(t)}),(function(){return bn(t)}),(function(e,r){return An(t,e,r)}),(function(){return _n(t)}),(function(){return yn(t)})),t.a.init(),w(r)}}))}))},mn.prototype.changeReceiverId=mn.prototype.He,mn.prototype.Kb=function(){this.a.Kb()},mn.prototype.forceDisconnect=mn.prototype.Kb,mn.prototype.B=function(e){if("addEventListener"==e)return this.f.addEventListener.bind(this.f);if("removeEventListener"==e)return this.f.removeEventListener.bind(this.f);if(this.a.ga()&&0==Object.keys(this.a.a.video).length){var t=this.c[e];if("function"!=typeof t)return t}return this.a.ga()?this.a.get("video",e):("function"==typeof(e=this.c[e])&&(e=e.bind(this.c)),e)},mn.prototype.F=function(e,t){this.a.ga()?this.a.set("video",e,t):this.c[e]=t},mn.prototype.D=function(e){this.a.ga()||this.f.dispatchEvent(new Se(e.type,e))},mn.prototype.u=function(e){this.a.ga()||this.g.dispatchEvent(e)},V(En,ke),G("shaka.cast.CastReceiver",En),En.prototype.isConnected=function(){return this.u},En.prototype.isConnected=En.prototype.isConnected,En.prototype.vf=function(){return this.h},En.prototype.isIdle=En.prototype.vf,En.prototype.destroy=function(){var e=this;return p((function t(){var r;return M(t,(function(t){switch(t.j){case 1:return e.c&&(e.c.release(),e.c=null),r=[],e.b&&(r.push(e.b.destroy()),e.b=null),e.B&&(e.B.stop(),e.B=null),e.a=null,e.D=null,e.s=null,e.u=!1,e.h=!0,e.f=null,e.i=null,S(t,Promise.all(r),2);case 2:cast.receiver.CastReceiverManager.getInstance().stop(),w(t)}}))}))},En.prototype.destroy=En.prototype.destroy,(n=En.prototype).ee=function(){this.g=0,this.l=!0,this.u=0!=cast.receiver.CastReceiverManager.getInstance().getSenders().length,Tn(this)},n.je=function(e,t){this.b&&(Sn(this),Cn(this,{type:"event",targetName:e,event:t},this.f))},n.Oe=function(){var e=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();e&&Cn(this,{type:"update",update:{video:{volume:e.level,muted:e.muted}}},this.f),Cn(this,{type:"event",targetName:"video",event:{type:"volumechange"}},this.f)},n.Kf=function(e){var t=nn(e.data);switch(t.type){case"init":this.g=0,this.m=!1,this.l=!0,function(e,t,r){for(var n in t.player)e.b[n](t.player[n]);e.s(r),r=Promise.resolve();var i=e.a.autoplay;t.manifest&&(e.a.autoplay=!1,r=e.b.load(t.manifest,t.startTime)),r.then((function(){if(e.b){for(var r in t.video)e.a[r]=t.video[r];for(var n in t.playerAfterLoad)e.b[n](t.playerAfterLoad[n]);e.a.autoplay=i,t.manifest&&(e.a.play(),xn(e,0))}}),(function(t){e.b.dispatchEvent(new Se("error",{detail:t}))}))}(this,t.initState,t.appData),Sn(this);break;case"appData":this.s(t.appData);break;case"set":var r=t.targetName,n=t.property;if(t=t.value,"video"==r){var i=cast.receiver.CastReceiverManager.getInstance();if("volume"==n){i.setSystemVolumeLevel(t);break}if("muted"==n){i.setSystemVolumeMuted(t);break}}this.D[r][n]=t;break;case"call":(r=this.D[t.targetName])[t.methodName].apply(r,t.args);break;case"asyncCall":r=t.targetName,n=t.methodName,"player"==r&&"load"==n&&(this.g=0,this.m=!1),i=t.id,e=e.senderId;var o=this.D[r];t=o[n].apply(o,t.args),"player"==r&&"load"==n&&(t=t.then(function(){this.l=!0}.bind(this))),t.then(this.oe.bind(this,e,i,null),this.oe.bind(this,e,i))}},n.Af=function(e){var t=nn(e.data);switch(t.type){case"PLAY":this.a.play(),xn(this,0);break;case"PAUSE":this.a.pause(),xn(this,0);break;case"SEEK":e=t.currentTime;var r=t.resumeState;null!=e&&(this.a.currentTime=Number(e)),r&&"PLAYBACK_START"==r?(this.a.play(),xn(this,0)):r&&"PLAYBACK_PAUSE"==r&&(this.a.pause(),xn(this,0));break;case"STOP":this.b.Cd().then(function(){this.b&&xn(this,0)}.bind(this));break;case"GET_STATUS":xn(this,Number(t.requestId));break;case"VOLUME":e=(r=t.volume).level,r=r.muted;var n=this.a.volume,i=this.a.muted;null!=e&&(this.a.volume=Number(e)),null!=r&&(this.a.muted=r),n==this.a.volume&&i==this.a.muted||xn(this,0);break;case"LOAD":this.g=0,this.l=this.m=!1,e=t.media,r=t.currentTime,n=this.F(e.contentId),i=t.autoplay||!0,this.s(e.customData),i&&(this.a.autoplay=!0),this.b.load(n,r).then(function(){this.b&&kn(this)}.bind(this)).catch(function(e){var r="LOAD_FAILED";7==e.category&&7e3==e.code&&(r="LOAD_CANCELLED"),Cn(this,{requestId:Number(t.requestId),type:r},this.i)}.bind(this));break;default:Cn(this,{requestId:Number(t.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},this.i)}},n.oe=function(e,t,r){this.b&&Cn(this,{type:"asyncComplete",id:t,error:r},this.f,e)};var Rn={IDLE:"IDLE",ze:"PLAYING",we:"BUFFERING",ye:"PAUSED"};function Ln(e,t){this.J=e,this.b=t==jn,this.a=0}G("shaka.util.DataViewReader",Ln);var jn=1;function Pn(){throw new me(2,3,3e3)}function In(){this.c=[],this.b=[],this.a=!1}function On(e){for(var t=null!=e.flags?12:8;e.reader.ua()&&!e.parser.a;)e.parser.sc(e.start+t,e.reader,e.partialOkay)}function Dn(e){for(var t=null!=e.flags?12:8,r=e.reader.G();0<r&&!e.parser.a;--r)e.parser.sc(e.start+t,e.reader,e.partialOkay)}function Mn(e){return function(t){e(t.reader.Za(t.reader.J.byteLength-t.reader.ca()))}}function Nn(e){for(var t=0,r=0;r<e.length;r++)t=t<<8|e.charCodeAt(r);return t}function Fn(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}function Un(e){var t=this;this.a=[],this.b=[],this.data=[],(new In).H("moov",On).fa("pssh",(function(e){if(!(1<e.version)){var r=e.reader.J;if(r=new Uint8Array(r.buffer,r.byteOffset-12,e.size),t.data.push(r),t.a.push(ht.Ac(e.reader.Za(16))),0<e.version){r=e.reader.G();for(var n=0;n<r;++n){var i=ht.Ac(e.reader.Za(16));t.b.push(i)}}}})).parse(e)}Ln.Endianness={Bg:0,Dg:jn},Ln.prototype.ua=function(){return this.a<this.J.byteLength},Ln.prototype.hasMoreData=Ln.prototype.ua,Ln.prototype.ca=function(){return this.a},Ln.prototype.getPosition=Ln.prototype.ca,Ln.prototype.Ve=function(){return this.J.byteLength},Ln.prototype.getLength=Ln.prototype.Ve,Ln.prototype.la=function(){try{var e=this.J.getUint8(this.a);return this.a+=1,e}catch(e){Pn()}},Ln.prototype.readUint8=Ln.prototype.la,Ln.prototype.Tb=function(){try{var e=this.J.getUint16(this.a,this.b);return this.a+=2,e}catch(e){Pn()}},Ln.prototype.readUint16=Ln.prototype.Tb,Ln.prototype.G=function(){try{var e=this.J.getUint32(this.a,this.b);return this.a+=4,e}catch(e){Pn()}},Ln.prototype.readUint32=Ln.prototype.G,Ln.prototype.ke=function(){try{var e=this.J.getInt32(this.a,this.b);return this.a+=4,e}catch(e){Pn()}},Ln.prototype.readInt32=Ln.prototype.ke,Ln.prototype.Bb=function(){try{if(this.b)var e=this.J.getUint32(this.a,!0),t=this.J.getUint32(this.a+4,!0);else t=this.J.getUint32(this.a,!1),e=this.J.getUint32(this.a+4,!1)}catch(e){Pn()}if(2097151<t)throw new me(2,3,3001);return this.a+=8,t*Math.pow(2,32)+e},Ln.prototype.readUint64=Ln.prototype.Bb,Ln.prototype.Za=function(e){this.a+e>this.J.byteLength&&Pn();var t=new Uint8Array(this.J.buffer,this.J.byteOffset+this.a,e);return this.a+=e,t},Ln.prototype.readBytes=Ln.prototype.Za,Ln.prototype.M=function(e){this.a+e>this.J.byteLength&&Pn(),this.a+=e},Ln.prototype.skip=Ln.prototype.M,Ln.prototype.me=function(e){this.a<e&&Pn(),this.a-=e},Ln.prototype.rewind=Ln.prototype.me,Ln.prototype.seek=function(e){(0>e||e>this.J.byteLength)&&Pn(),this.a=e},Ln.prototype.seek=Ln.prototype.seek,Ln.prototype.md=function(){for(var e=this.a;this.ua()&&0!=this.J.getUint8(this.a);)this.a+=1;return e=new Uint8Array(this.J.buffer,this.J.byteOffset+e,this.a-e),this.a+=1,at(e)},Ln.prototype.readTerminatedString=Ln.prototype.md,G("shaka.util.Mp4Parser",In),In.prototype.H=function(e,t){var r=Nn(e);return this.c[r]=0,this.b[r]=t,this},In.prototype.box=In.prototype.H,In.prototype.fa=function(e,t){var r=Nn(e);return this.c[r]=1,this.b[r]=t,this},In.prototype.fullBox=In.prototype.fa,In.prototype.stop=function(){this.a=!0},In.prototype.stop=In.prototype.stop,In.prototype.parse=function(e,t){var r=new Uint8Array(e);for(r=new Ln(new DataView(r.buffer,r.byteOffset,r.byteLength),0),this.a=!1;r.ua()&&!this.a;)this.sc(0,r,t)},In.prototype.parse=In.prototype.parse,In.prototype.sc=function(e,t,r){var n=t.ca(),i=t.G(),o=t.G();switch(i){case 0:i=t.J.byteLength-n;break;case 1:i=t.Bb()}var a=this.b[o];if(a){var s=null,l=null;1==this.c[o]&&(s=(l=t.G())>>>24,l&=16777215),o=n+i,r&&o>t.J.byteLength&&(o=t.J.byteLength),o-=t.ca(),t=0<o?t.Za(o):new Uint8Array(0),a({parser:this,partialOkay:r||!1,version:s,flags:l,reader:t=new Ln(new DataView(t.buffer,t.byteOffset,t.byteLength),0),size:i,start:n+e})}else t.M(Math.min(n+i-t.ca(),t.J.byteLength-t.ca()))},In.prototype.parseNext=In.prototype.sc,In.children=On,In.sampleDescription=Dn,In.allData=Mn,In.typeToString=Fn;var Bn={gc:function(e,t){var r=Bn.P(e,t);return 1!=r.length?null:r[0]},Oc:function(e,t,r){return 1!=(e=Bn.Od(e,t,r)).length?null:e[0]},P:function(e,t){return Array.prototype.filter.call(e.childNodes,(function(e){return e instanceof Element&&e.tagName==t}))},Od:function(e,t,r){return Array.prototype.filter.call(e.childNodes,(function(e){return e instanceof Element&&e.localName==r&&e.namespaceURI==t}))},getAttributeNS:function(e,t,r){return e.hasAttributeNS(t,r)?e.getAttributeNS(t,r):null},ic:function(e){return Array.prototype.every.call(e.childNodes,(function(e){return e.nodeType==Node.TEXT_NODE||e.nodeType==Node.CDATA_SECTION_NODE}))?e.textContent.trim():null},I:function(e,t,r,n){n=void 0===n?null:n;var i=null;return null!=(e=e.getAttribute(t))&&(i=r(e)),null==i?n:i},Of:function(e){return e?(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),e=Date.parse(e),isNaN(e)?null:Math.floor(e/1e3)):null},Ea:function(e){return e&&(e=/^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$/.exec(e))?(e=31536e3*Number(e[1]||null)+2592e3*Number(e[2]||null)+86400*Number(e[3]||null)+3600*Number(e[4]||null)+60*Number(e[5]||null)+Number(e[6]||null),isFinite(e)?e:null):null},uc:function(e){var t=/([0-9]+)-([0-9]+)/.exec(e);return t?(e=Number(t[1]),isFinite(e)?(t=Number(t[2]),isFinite(t)?{start:e,end:t}:null):null):null},parseInt:function(e){return 0==(e=Number(e))%1?e:null},tc:function(e){return 0==(e=Number(e))%1&&0<e?e:null},yb:function(e){return 0==(e=Number(e))%1&&0<=e?e:null},parseFloat:function(e){return e=Number(e),isNaN(e)?null:e},Me:function(e){var t;return e=(t=e.match(/^(\d+)\/(\d+)$/))?Number(t[1])/Number(t[2]):Number(e),isNaN(e)?null:e},he:function(e,t){var r=new DOMParser;try{var n=r.parseFromString(e,"text/xml")}catch(e){}if(n&&n.documentElement.tagName==t)var i=n.documentElement;return i&&0<i.getElementsByTagName("parsererror").length?null:i},ge:function(e,t){try{var r=at(e);return Bn.he(r,t)}catch(e){}}},Kn=(new Map).set("urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b","org.w3.clearkey").set("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine.alpha").set("urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95","com.microsoft.playready").set("urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb","com.adobe.primetime");function Gn(e,t,r){var n=function(e){for(var t=[],r=(e=f(e)).next();!r.done;r=e.next())(r=Yn(r.value))&&t.push(r);return t}(e),i=null;e=[];var o=[],a=new Set(n.map((function(e){return e.keyId})));if(a.delete(null),1<a.size)throw new me(2,4,4010);if(r||(o=n.filter((function(e){return"urn:mpeg:dash:mp4protection:2011"!=e.ne||(i=e.init||i,!1)}))).length&&0==(e=function(e,t,r){for(var n=[],i=(r=f(r)).next();!i.done;i=r.next()){i=i.value;var o=Kn.get(i.ne);if(o){var a;if(a=Bn.Oc(i.node,"urn:microsoft:playready","pro")){a=ht.Ba(a.textContent);var s=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),l=a.length,u=s.length+16+l,c=new ArrayBuffer(u),d=new Uint8Array(c);c=new DataView(c);var h=0;c.setUint32(h,u),h+=4,c.setUint32(h,1886614376),h+=4,c.setUint32(h,0),h+=4,d.set(s,h),h+=s.length,c.setUint32(h,l),h+=4,d.set(a,h),a=[{initData:d,initDataType:"cenc",keyId:i.keyId}]}else a=null;a=Ht(o,i.init||e||a),(o=Hn.get(o))&&(a.licenseServerUri=o(i)),n.push(a)}else for(i=f(i=t(i.node)||[]),o=i.next();!o.done;o=i.next())n.push(o.value)}return n}(i,t,o)).length&&(e=[Ht("",i)]),n.length&&(r||!o.length))for(e=[],r=(t=f(Kn.values())).next();!r.done;r=t.next())"org.w3.clearkey"!=(r=r.value)&&e.push(Ht(r,i));if(a=Array.from(a)[0]||null)for(r=(t=f(e)).next();!r.done;r=t.next())for(n=(r=f(r.value.initData)).next();!n.done;n=r.next())n.value.keyId=a;return{Kd:a,Fg:i,drmInfos:e,Pd:!0}}var Vn,Hn=(new Map).set("com.widevine.alpha",(function(e){return(e=Bn.Oc(e.node,"urn:microsoft","laurl"))&&e.getAttribute("licenseUrl")||""})).set("com.microsoft.playready",(function(e){return(e=Bn.Oc(e.node,"urn:microsoft:playready","pro"))&&(e=function(e){var t=0,r=new DataView(e).getUint32(t,!0);if(r!==e.byteLength)return[];t+=6,r=[];for(var n=new DataView(e);t<e.byteLength-1;){var i=n.getUint16(t,!0);t+=2;var o=n.getUint16(t,!0);t+=2;var a=new Uint8Array(e,t,o);r.push({type:i,value:a}),t+=o}return r}((e=ht.Ba(e.textContent)).buffer).filter((function(e){return 1===e.type}))[0])?(e=st(e.value,!0),(e=Bn.he(e,"WRMHEADER"))?function(e){return(e=e.querySelector("DATA > LA_URL"))?e.textContent:""}(e):""):""}));function Yn(e){var t=e.getAttribute("schemeIdUri"),r=Bn.getAttributeNS(e,"urn:mpeg:cenc:2013","default_KID"),n=Bn.Od(e,"urn:mpeg:cenc:2013","pssh").map(Bn.ic);if(!t)return null;if(t=t.toLowerCase(),r&&(r=r.replace(/-/g,"").toLowerCase()).includes(" "))throw new me(2,4,4009);var i=[];try{i=n.map((function(e){return{initDataType:"cenc",initData:ht.Ba(e),keyId:null}}))}catch(e){throw new me(2,4,4007)}return{node:e,ne:t,keyId:r,init:0<i.length?i:null}}function zn(t,r,n,i,o){var a={RepresentationID:r,Number:n,Bandwidth:i,Time:o};return t.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,(function(t,r,n,i){if("$$"==t)return"$";var o=a[r];if(null==o)return t;switch("RepresentationID"==r&&n&&(n=void 0),"Time"==r&&(o=Math.round(o)),i){case void 0:case"d":case"i":case"u":t=o.toString();break;case"o":t=o.toString(8);break;case"x":t=o.toString(16);break;case"X":t=o.toString(16).toUpperCase();break;default:t=o.toString()}return n=e.parseInt(n,10)||1,Array(Math.max(0,n-t.length)+1).join("0")+t}))}function Wn(e,t){var r=$n(e,t,"timescale"),n=1;r&&(n=Bn.tc(r)||1),r=$n(e,t,"duration"),(r=Bn.tc(r||""))&&(r/=n);var i=$n(e,t,"startNumber"),o=Number($n(e,t,"presentationTimeOffset"))||0,a=Bn.yb(i||"");null!=i&&null!=a||(a=1);var s=qn(e,t,"SegmentTimeline");if(i=null,s){i=n;var l=e.T.duration||1/0;s=Bn.P(s,"S");for(var u=[],c=0,d=0;d<s.length;++d){var f=s[d],h=Bn.I(f,"t",Bn.yb),p=Bn.I(f,"d",Bn.yb);if(f=Bn.I(f,"r",Bn.parseInt),null!=h&&(h-=o),!p)break;if(h=null!=h?h:c,0>(f=f||0))if(d+1<s.length){if(null==(f=Bn.I(s[d+1],"t",Bn.yb)))break;if(h>=f)break;f=Math.ceil((f-h)/p)-1}else{if(1/0==l)break;if(h/i>=l)break;f=Math.ceil((l*i-h)/p)-1}0<u.length&&h!=c&&(u[u.length-1].end=h/i);for(var m=0;m<=f;++m)c=h+p,u.push({start:h/i,end:c/i,xg:h}),h=c}i=u}return{timescale:n,Z:r,ab:a,ma:o/n||0,Dd:o,N:i}}function $n(e,t,r){return[t(e.C),t(e.aa),t(e.ka)].filter(Gt.Ia).map((function(e){return e.getAttribute(r)})).reduce((function(e,t){return e||t}))}function qn(e,t,r){return[t(e.C),t(e.aa),t(e.ka)].filter(Gt.Ia).map((function(e){return Bn.gc(e,r)})).reduce((function(e,t){return e||t}))}function Xn(e,t,r,n,i,o){if(o=void 0===o?0:o,Bn.getAttributeNS(e,"http://www.w3.org/1999/xlink","href")){var a=function(e,t,r,n,i,o){for(var a=Bn.getAttributeNS(e,"http://www.w3.org/1999/xlink","href"),s=Bn.getAttributeNS(e,"http://www.w3.org/1999/xlink","actuate")||"onRequest",l=0;l<e.attributes.length;l++){var u=e.attributes[l];"http://www.w3.org/1999/xlink"==u.namespaceURI&&(e.removeAttributeNS(u.namespaceURI,u.localName),--l)}if(5<=o)return ve(new me(2,4,4028));if("onLoad"!=s)return ve(new me(2,4,4027));var c=Vt([n],[a]);return i.request(0,Me(c,t)).U((function(n){if(!(n=Bn.ge(n.data,e.tagName)))return ve(new me(2,4,4001,a));for(;e.childNodes.length;)e.removeChild(e.childNodes[0]);for(;n.childNodes.length;){var s=n.childNodes[0];n.removeChild(s),e.appendChild(s)}for(s=0;s<n.attributes.length;s++){var l=n.attributes[s].nodeName,u=n.getAttribute(l);e.setAttribute(l,u)}return Xn(e,t,r,c[0],i,o+1)}))}(e,t,r,n,i,o);return r&&(a=a.U(void 0,(function(){return Xn(e,t,r,n,i,o)}))),a}a=[];for(var s=0;s<e.childNodes.length;s++){var l=e.childNodes[s];l instanceof Element&&("urn:mpeg:dash:resolve-to-zero:2013"==Bn.getAttributeNS(l,"http://www.w3.org/1999/xlink","href")?(e.removeChild(l),--s):"SegmentTimeline"!=l.tagName&&a.push(Xn(l,t,r,n,i,o)))}return Ee(a).U((function(){return e}))}function Jn(e,t,r){this.c=e,this.b=t,this.a=r}function Zn(e,t,r,n,i,o){this.position=e,this.startTime=t,this.endTime=r,this.c=n,this.b=i,this.a=o}function Qn(e,t,r,n){var i,o=(new In).fa("sidx",(function(e){i=function(e,t,r,n){var i=[];n.reader.M(4);var o=n.reader.G();if(0==o)throw new me(2,3,3005);if(0==n.version)var a=n.reader.G(),s=n.reader.G();else a=n.reader.Bb(),s=n.reader.Bb();n.reader.M(2);var l=n.reader.Tb();for(e=e+n.size+s,s=0;s<l;s++){var u=n.reader.G(),c=(2147483648&u)>>>31;u&=2147483647;var d=n.reader.G();if(n.reader.M(4),1==c)throw new me(2,3,3006);i.push(new Zn(i.length,a/o-t,(a+d)/o-t,(function(){return r}),e,e+u-1)),a+=d,e+=u}return n.parser.stop(),i}(t,n,r,e)}));if(e&&o.parse(e),i)return i;throw new me(2,3,3004)}function ei(e){this.a=e}function ti(e,t){for(;e.a.length&&e.a[e.a.length-1].startTime>=t;)e.a.pop();for(;e.a.length&&0>=e.a[0].endTime;)e.a.shift();if(0!=e.a.length){var r=e.a[e.a.length-1];e.a[e.a.length-1]=new Zn(r.position,r.startTime,t,r.c,r.b,r.a)}}function ri(e){this.b=e,this.a=new Ln(e,0),Vn||(Vn=[new Uint8Array([255]),new Uint8Array([127,255]),new Uint8Array([63,255,255]),new Uint8Array([31,255,255,255]),new Uint8Array([15,255,255,255,255]),new Uint8Array([7,255,255,255,255,255]),new Uint8Array([3,255,255,255,255,255,255]),new Uint8Array([1,255,255,255,255,255,255,255])])}function ni(e){var t=ii(e);if(7<t.length)throw new me(2,3,3002);for(var r=0,n=0;n<t.length;n++)r=256*r+t[n];t=r,r=ii(e);e:{n=ht.za;for(var i=0;i<Vn.length;i++)if(n(r,Vn[i])){n=!0;break e}n=!1}if(n)r=e.b.byteLength-e.a.ca();else{if(8==r.length&&224&r[1])throw new me(2,3,3001);for(n=r[0]&(1<<8-r.length)-1,i=1;i<r.length;i++)n=256*n+r[i];r=n}return r=e.a.ca()+r<=e.b.byteLength?r:e.b.byteLength-e.a.ca(),n=new DataView(e.b.buffer,e.b.byteOffset+e.a.ca(),r),e.a.M(r),new oi(t,n)}function ii(e){var t,r=e.a.la();for(t=1;8>=t&&!(r&1<<8-t);t++);if(8<t)throw new me(2,3,3002);var n=new Uint8Array(t);for(n[0]=r,r=1;r<t;r++)n[r]=e.a.la();return n}function oi(e,t){this.id=e,this.a=t}function ai(e){if(8<e.a.byteLength)throw new me(2,3,3002);if(8==e.a.byteLength&&224&e.a.getUint8(0))throw new me(2,3,3001);for(var t=0,r=0;r<e.a.byteLength;r++)t=256*t+e.a.getUint8(r);return t}function si(){}function li(e){var t=new ri(e.a);if(179!=(e=ni(t)).id)throw new me(2,3,3013);if(e=ai(e),183!=(t=ni(t)).id)throw new me(2,3,3012);t=new ri(t.a);for(var r=0;t.ua();){var n=ni(t);if(241==n.id){r=ai(n);break}}return{yg:e,Vf:r}}function ui(e,t){var r=qn(e,t,"Initialization");if(!r)return null;var n=e.C.qa,i=r.getAttribute("sourceURL");i&&(n=Vt(e.C.qa,[i])),i=0;var o=null;return(r=Bn.I(r,"range",Bn.uc))&&(i=r.start,o=r.end),new Jn((function(){return n}),i,o)}function ci(e,t,r,n,i,o,a,s){var l=e.presentationTimeline,u=!e.mb||!e.T.Zc,c=e.T.start,d=e.T.duration,f=t,h=null;return{createSegmentIndex:function(){var e=[f(n,i,o),"webm"==a?f(r.c(),r.b,r.a):null];return f=null,Promise.all(e).then((function(e){var t=e[0];e=e[1]||null,t="mp4"==a?Qn(t,i,n,s):(new si).parse(t,e,n,s),l.vb(t,c),h=new ei(t),u&&ti(h,d)}))},findSegmentPosition:function(e){return h.find(e)},getSegmentReference:function(e){return h.get(e)}}}function di(e){return e.Ub}function fi(e,t){var r=ui(e,hi),n=function(e){return[e.C.La,e.aa.La,e.ka.La].filter(Gt.Ia).map((function(e){return Bn.P(e,"SegmentURL")})).reduce((function(e,t){return 0<e.length?e:t})).map((function(t){return t.getAttribute("indexRange")&&!e.Vd&&(e.Vd=!0),{xf:t.getAttribute("media"),start:(t=Bn.I(t,"mediaRange",Bn.uc,{start:0,end:null})).start,end:t.end}}))}(e),i=Wn(e,hi),o=i.ab;0==o&&(o=1);var a=0;if(i.Z?a=i.Z*(o-1):i.N&&0<i.N.length&&(a=i.N[0].start),!(n={Z:i.Z,startTime:a,ab:o,ma:i.ma,N:i.N,tb:n}).Z&&!n.N&&1<n.tb.length)throw new me(2,4,4002);if(!n.Z&&!e.T.duration&&!n.N&&1==n.tb.length)throw new me(2,4,4002);if(n.N&&0==n.N.length)throw new me(2,4,4002);return o=i=null,e.ka.id&&e.C.id&&(i=t[o=e.ka.id+","+e.C.id]),a=function(e,t,r,n){var i=n.tb.length;n.N&&n.N.length!=n.tb.length&&(i=Math.min(n.N.length,n.tb.length));for(var o=[],a=n.startTime,s=0;s<i;s++){var l,u=n.tb[s],c=Vt(r,[u.xf]);l=null!=n.Z?a+n.Z:n.N?n.N[s].end:a+e,o.push(new Zn(s+t,a,l,function(e){return e}.bind(null,c),u.start,u.end)),a=l}return o}(e.T.duration,n.ab,e.C.qa,n),i?(i.cd(a),o=e.presentationTimeline.Ob(),i.Lc(o-e.T.start)):(e.presentationTimeline.vb(a,e.T.start),i=new ei(a),o&&e.mb&&(t[o]=i)),e.mb&&e.T.Zc||ti(i,e.T.duration),{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:i.find.bind(i),getSegmentReference:i.get.bind(i),initSegmentReference:r,ma:n.ma}}function hi(e){return e.La}function pi(e,t,r,n){var i=function(e){var t=$n(e,mi,"initialization");if(!t)return null;var r=e.C.id,n=e.bandwidth||null,i=e.C.qa;return new Jn((function(){var e=zn(t,r,null,n,null);return Vt(i,[e])}),0,null)}(e),o=Wn(e,mi),a=$n(e,mi,"media"),s=$n(e,mi,"index");if(a=(o={Z:o.Z,timescale:o.timescale,ab:o.ab,ma:o.ma,Dd:o.Dd,N:o.N,ad:a,Qb:s}).Qb?1:0,a+=o.N?1:0,0==(a+=o.Z?1:0))throw new me(2,4,4002);if(1!=a&&(o.Qb&&(o.N=null),o.Z=null),!o.Qb&&!o.ad)throw new me(2,4,4002);if(o.Qb){if("mp4"!=(r=e.C.mimeType.split("/")[1])&&"webm"!=r)throw new me(2,4,4006);if("webm"==r&&!i)throw new me(2,4,4005);n=zn(o.Qb,e.C.id,null,e.bandwidth||null,null),e=ci(e,t,i,n=Vt(e.C.qa,[n]),0,null,r,o.ma)}else o.Z?(n||(e.presentationTimeline.ed(o.Z),e.presentationTimeline.fd(e.T.start)),e=function(e,t){var r=e.T.duration,n=t.Z,i=t.ab,o=t.timescale,a=t.ad,s=e.bandwidth||null,l=e.C.id,u=e.C.qa;return{createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(e){return 0>e||r&&e>=r?null:Math.floor(e/n)},getSegmentReference:function(e){var t=e*n,c=t+n;return r&&(c=Math.min(c,r)),0>c||r&&t>=r?null:new Zn(e,t,c,(function(){var r=zn(a,l,e+i,s,t*o);return Vt(u,[r])}),0,null)}}}(e,o)):(a=t=null,e.ka.id&&e.C.id&&(t=r[a=e.ka.id+","+e.C.id]),s=function(e,t){for(var r=[],n=0;n<t.N.length;n++){var i=n+t.ab;r.push(new Zn(i,t.N[n].start,t.N[n].end,function(e,t,r,n,i,o){return Vt(n,[e=zn(e,t,i,r,o)]).map((function(e){return e.toString()}))}.bind(null,t.ad,e.C.id,e.bandwidth||null,e.C.qa,i,t.N[n].xg+t.Dd),0,null))}return r}(e,o),n=!e.mb||!e.T.Zc,t?(n&&ti(new ei(s),e.T.duration),t.cd(s),r=e.presentationTimeline.Ob(),t.Lc(r-e.T.start)):(e.presentationTimeline.vb(s,e.T.start),t=new ei(s),a&&e.mb&&(r[a]=t)),n&&ti(t,e.T.duration),e={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:t.find.bind(t),getSegmentReference:t.get.bind(t)});return{createSegmentIndex:e.createSegmentIndex,findSegmentPosition:e.findSegmentPosition,getSegmentReference:e.getSegmentReference,initSegmentReference:i,ma:o.ma}}function mi(e){return e.Wb}G("shaka.media.InitSegmentReference",Jn),Jn.prototype.Ic=function(){return this.c()},Jn.prototype.createUris=Jn.prototype.Ic,Jn.prototype.Uc=function(){return this.b},Jn.prototype.getStartByte=Jn.prototype.Uc,Jn.prototype.Tc=function(){return this.a},Jn.prototype.getEndByte=Jn.prototype.Tc,G("shaka.media.SegmentReference",Zn),Zn.prototype.ca=function(){return this.position},Zn.prototype.getPosition=Zn.prototype.ca,Zn.prototype.kc=function(){return this.startTime},Zn.prototype.getStartTime=Zn.prototype.kc,Zn.prototype.Te=function(){return this.endTime},Zn.prototype.getEndTime=Zn.prototype.Te,Zn.prototype.Ic=function(){return this.c()},Zn.prototype.createUris=Zn.prototype.Ic,Zn.prototype.Uc=function(){return this.b},Zn.prototype.getStartByte=Zn.prototype.Uc,Zn.prototype.Tc=function(){return this.a},Zn.prototype.getEndByte=Zn.prototype.Tc,G("shaka.media.SegmentIndex",ei),ei.prototype.destroy=function(){return this.a=null,Promise.resolve()},ei.prototype.destroy=ei.prototype.destroy,ei.prototype.find=function(e){for(var t=this.a.length-1;0<=t;--t){var r=this.a[t];if(e>=r.startTime&&e<r.endTime)return r.position}return this.a.length&&e<this.a[0].startTime?this.a[0].position:null},ei.prototype.find=ei.prototype.find,ei.prototype.get=function(e){return 0==this.a.length||0>(e-=this.a[0].position)||e>=this.a.length?null:this.a[e]},ei.prototype.get=ei.prototype.get,ei.prototype.offset=function(e){for(var t=0;t<this.a.length;++t)this.a[t].startTime+=e,this.a[t].endTime+=e},ei.prototype.offset=ei.prototype.offset,ei.prototype.cd=function(e){for(var t=[],r=0,n=0;r<this.a.length&&n<e.length;){var i=this.a[r],o=e[n];i.startTime<o.startTime?(t.push(i),r++):(i.startTime>o.startTime?0==r&&t.push(o):(.1<Math.abs(i.endTime-o.endTime)?t.push(new Zn(i.position,o.startTime,o.endTime,o.c,o.b,o.a)):t.push(i),r++),n++)}for(;r<this.a.length;)t.push(this.a[r++]);if(t.length)for(r=t[t.length-1].position+1;n<e.length;)i=new Zn(r++,(i=e[n++]).startTime,i.endTime,i.c,i.b,i.a),t.push(i);else t=e;this.a=t},ei.prototype.merge=ei.prototype.cd,ei.prototype.Lc=function(e){for(var t=0;t<this.a.length;++t)if(this.a[t].endTime>e)return void this.a.splice(0,t);this.a=[]},ei.prototype.evict=ei.prototype.Lc,ri.prototype.ua=function(){return this.a.ua()},si.prototype.parse=function(e,t,r,n){var i;if(440786851!=ni(t=new ri(new DataView(t))).id)throw new me(2,3,3008);var o=ni(t);if(408125543!=o.id)throw new me(2,3,3009);for(t=o.a.byteOffset,o=new ri(o.a),i=null;o.ua();){var a=ni(o);if(357149030==a.id){i=a;break}}if(!i)throw new me(2,3,3010);for(o=new ri(i.a),i=1e6,a=null;o.ua();){var s=ni(o);if(2807729==s.id)i=ai(s);else if(17545==s.id)if(4==(a=s).a.byteLength)a=a.a.getFloat32(0);else{if(8!=a.a.byteLength)throw new me(2,3,3003);a=a.a.getFloat64(0)}}if(null==a)throw new me(2,3,3011);if(i=a*(o=i/1e9),475249515!=(e=ni(new ri(new DataView(e)))).id)throw new me(2,3,3007);return function(e,t,r,n,i,o){function a(){return i}var s=[];e=new ri(e.a);for(var l=null,u=null;e.ua();){var c=ni(e);if(187==c.id){var d=li(c);d&&(c=r*d.yg,d=t+d.Vf,null!=l&&s.push(new Zn(s.length,l-o,c-o,a,u,d-1)),l=c,u=d)}}return null!=l&&s.push(new Zn(s.length,l-o,n-o,a,u,null)),s}(e,t,o,i,r,n)};var gi={zb:{},Sb:{},pd:function(e,t){gi.Sb[e]=t}};function yi(e,t,r){this.f=e,this.vc=t,this.h=this.g=1/0,this.a=1,this.b=this.c=null,this.l=0,this.m=!0,this.i=0,this.s=void 0===r||r}function vi(e,t,r,n){return e=Me(e,n),0==t&&null==r||(e.headers.Range=r?"bytes="+t+"-"+r:"bytes="+t+"-"),e}function bi(){var e=this;this.b=this.a=null,this.f=[],this.c=null,this.l=[],this.h=1,this.m={},this.s=0,this.u=new H(5),this.i=new fe((function(){!function(e){p((function t(){var r,n;return M(t,(function(t){switch(t.j){case 1:return r=0,k(t,2),S(t,_i(e),4);case 4:r=t.o,x(t,3);break;case 2:n=R(t),e.b&&(n.severity=1,e.b.onError(n));case 3:if(!e.b)return t.return();Si(e,r),w(t)}}))}))}(e)})),this.g=new je}function _i(e){var t=Date.now(),r=e.b.networkingEngine.request(0,Me(e.f,e.a.retryParameters));return Pe(e.g,r),r.promise.then((function(t){if(e.b)return t.uri&&!e.f.includes(t.uri)&&e.f.unshift(t.uri),function(e,t,r){if(!(t=Bn.ge(t,"MPD")))throw new me(2,4,4001,r);return t=Xn(t,e.a.retryParameters,e.a.dash.xlinkFailGracefully,r,e.b.networkingEngine),Pe(e.g,t),t.promise.then((function(t){return function(e,t,r){return p((function n(){var i,o,a,s,l,u,c,d,f,h,p,m,g,y,v,b,_,A,E,T,k,C,x,R;return M(n,(function(n){switch(n.j){case 1:s=Gt,u=[r],0<(c=(l=Bn).P(t,"Location").map(l.ic).filter(s.Ia)).length&&(d=Vt(u,c),u=e.f=d),f=l.P(t,"BaseURL").map(l.ic),h=Vt(u,f),p=e.a.dash.ignoreMinBufferTime,m=0,p||(m=l.I(t,"minBufferTime",l.Ea)),e.s=l.I(t,"minimumUpdatePeriod",l.Ea,-1),g=l.I(t,"availabilityStartTime",l.Of),y=l.I(t,"timeShiftBufferDepth",l.Ea),v=l.I(t,"maxSegmentDuration",l.Ea),b=t.getAttribute("type")||"static",_=e.a.dash.ignoreSuggestedPresentationDelay,A=null,_||(A=l.I(t,"suggestedPresentationDelay",l.Ea)),e.c?E=e.c.presentationTimeline:(T=Math.max(e.a.dash.defaultPresentationDelay,1.5*m),E=new yi(g,null!=A?A:T,e.a.dash.autoCorrectDrift));for(var L={mb:"static"!=b,presentationTimeline:E,ka:null,T:null,aa:null,C:null,bandwidth:0,Vd:!1},j=h,P=Bn.I(t,"mediaPresentationDuration",Bn.Ea),I=[],O=0,D=Bn.P(t,"Period"),M=0;M<D.length;M++){var N=D[M];O=Bn.I(N,"start",Bn.Ea,O);var F=Bn.I(N,"duration",Bn.Ea),U=null;if(M!=D.length-1){var B=Bn.I(D[M+1],"start",Bn.Ea);null!=B&&(U=B-O)}else null!=P&&(U=P-O);if(null==U&&(U=F),N=Ai(e,L,j,{start:O,duration:U,node:N,Zc:null==U||M==D.length-1}),I.push(N),F=L.ka.id,e.l.includes(F)||(e.l.push(F),e.c&&(e.b.filterNewPeriod(N),e.c.periods.push(N))),null==U){O=null;break}O+=U}if(null==e.c&&e.b.filterAllPeriods(I),null!=P?(i=I,o=P,a=!1):(i=I,o=O,a=!0),k=o,C=i,E.Xb("static"==b),"static"!=b&&a||E.xa(k||1/0),E.V()&&!isNaN(e.a.availabilityWindowOverride)&&(y=e.a.availabilityWindowOverride),null==y&&(y=1/0),E.xd(y),E.ed(v||1),e.c){n.A(0);break}if(e.c={presentationTimeline:E,periods:C,offlineSessionIds:[],minBufferTime:m||0},!E.ue()){n.A(0);break}return x=l.P(t,"UTCTiming"),S(n,function(e,t,r){r=r.map((function(e){return{scheme:e.getAttribute("schemeIdUri"),value:e.getAttribute("value")}}));var n=e.a.dash.clockSyncUri;return!r.length&&n&&r.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:n}),Gt.Ke(r,function(e){var r=e.scheme;switch(e=e.value,r){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":return ki(this,t,e,"HEAD");case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":return ki(this,t,e,"GET");case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":return r=Date.parse(e),isNaN(r)?0:r-Date.now();case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":return q("NTP UTCTiming scheme is not supported"),Promise.reject();default:return q("Unrecognized scheme in UTCTiming element",r),Promise.reject()}}.bind(e)).catch((function(){return q("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"),0}))}(e,h,x),4);case 4:if(R=n.o,!e.b)return n.return();E.pe(R),w(n)}}))}))}(e,t,r)}))}(e,t.data,t.uri)})).then((function(){var r=(Date.now()-t)/1e3;return Y(e.u,1,r),r}))}function Ai(e,t,r,n){if(t.ka=wi(n.node,null,r),t.T=n,t.ka.id||(t.ka.id="__shaka_period_"+n.start),Bn.P(n.node,"EventStream").forEach(e.Pf.bind(e,n.start,n.duration)),r=Bn.P(n.node,"AdaptationSet").map(e.Nf.bind(e,t)).filter(Gt.Ia),t.mb){t=[];for(var i=f(r),o=i.next();!o.done;o=i.next())for(var a=(o=f(o.value.Yf)).next();!a.done;a=o.next())t.push(a.value);if(t.length!=new Set(t).size)throw new me(2,4,4018)}var s=r.filter((function(e){return!e.Bd}));if(r.filter((function(e){return e.Bd})).forEach((function(e){var t=e.streams[0],r=e.Bd;s.forEach((function(e){e.id==r&&e.streams.forEach((function(e){e.trickModeVideo=t}))}))})),t=Ei(s,"video"),i=Ei(s,"audio"),!t.length&&!i.length)throw new me(2,4,4004);for(r=e.a.disableAudio,i.length&&!r||(i=[null]),r=e.a.disableVideo,t.length&&!r||(t=[null]),r=[],o=0;o<i.length;o++)for(a=0;a<t.length;a++)Ti(e,i[o],t[a],r);if(t=[],!e.a.disableText)for(e=Ei(s,"text"),i=0;i<e.length;i++)t.push.apply(t,e[i].streams);return{startTime:n.start,textStreams:t,variants:r}}function Ei(e,t){return e.filter((function(e){return e.contentType==t}))}function Ti(e,t,r,n){if(t||r)if(t&&r){var i=t.drmInfos,o=r.drmInfos;if(!i.length||!o.length||0<Lt(i,o).length){o=Lt(t.drmInfos,r.drmInfos);for(var a=0;a<t.streams.length;a++)for(var s=0;s<r.streams.length;s++)i=(r.streams[s].bandwidth||0)+(t.streams[a].bandwidth||0),i={id:e.h++,language:t.language,primary:t.$c||r.$c,audio:t.streams[a],video:r.streams[s],bandwidth:i,drmInfos:o,allowedByApplication:!0,allowedByKeySystem:!0},n.push(i)}}else for(o=t||r,a=0;a<o.streams.length;a++)i=o.streams[a].bandwidth||0,i={id:e.h++,language:o.language||"und",primary:o.$c,audio:t?o.streams[a]:null,video:r?o.streams[a]:null,bandwidth:i,drmInfos:o.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0},n.push(i)}function Si(e,t){0>e.s||e.i.R(Math.max(3,e.s-t,z(e.u)))}function wi(e,t,r){t=t||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,gd:null,audioSamplingRate:null},r=r||t.qa;var n=Bn.yb,i=Bn.Me,o=Bn.P(e,"BaseURL").map(Bn.ic),a=e.getAttribute("contentType")||t.contentType,s=e.getAttribute("mimeType")||t.mimeType,l=e.getAttribute("codecs")||t.codecs;i=Bn.I(e,"frameRate",i)||t.frameRate;for(var u=e.getAttribute("par")||t.pixelAspectRatio,c=Bn.P(e,"InbandEventStream"),d=t.emsgSchemeIdUris.slice(),h=(c=f(c)).next();!h.done;h=c.next())h=h.value.getAttribute("schemeIdUri"),d.includes(h)||d.push(h);return c=function(e){for(var t=0;t<e.length;++t){var r=e[t],n=r.getAttribute("schemeIdUri");if(n&&(r=r.getAttribute("value")))switch(n){case"urn:mpeg:dash:outputChannelPositionList:2012":return r.trim().split(/ +/).length;case"urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case"urn:dts:dash:audio_channel_configuration:2012":if(!(n=parseInt(r,10)))continue;return n;case"tag:dolby.com,2014:dash:audio_channel_configuration:2011":case"urn:dolby:dash:audio_channel_configuration:2011":if(n=parseInt(r,16)){for(e=0;n;)1&n&&++e,n>>=1;return e}}}return null}(c=Bn.P(e,"AudioChannelConfiguration"))||t.gd,h=Bn.I(e,"audioSamplingRate",n)||t.audioSamplingRate,a||(a=Ci(s,l)),{qa:Vt(r,o),Ub:Bn.gc(e,"SegmentBase")||t.Ub,La:Bn.gc(e,"SegmentList")||t.La,Wb:Bn.gc(e,"SegmentTemplate")||t.Wb,width:Bn.I(e,"width",n)||t.width,height:Bn.I(e,"height",n)||t.height,contentType:a,mimeType:s,codecs:l,frameRate:i,pixelAspectRatio:u,emsgSchemeIdUris:d,id:e.getAttribute("id"),gd:c,audioSamplingRate:h}}function ki(e,t,r,n){return(t=Me(t=Vt(t,[r]),e.a.retryParameters)).method=n,t=e.b.networkingEngine.request(4,t),Pe(e.g,t),t.promise.then((function(e){if("HEAD"==n){if(!e.headers||!e.headers.date)return 0;e=e.headers.date}else e=at(e.data);return e=Date.parse(e),isNaN(e)?0:e-Date.now()}))}function Ci(e,t){return pr(qe(e,t))?"text":e.split("/")[0]}function xi(e,t,r,n){this.b=e,this.type=t,this.a=r,this.segments=n||null}function Ri(e,t,r,n){this.id=e,this.name=t,this.a=r,this.value=void 0===n?null:n}function Li(e,t){this.name=e,this.value=t}function ji(e,t,r){return(e=e.getAttribute(t))?e.value:r||null}function Pi(e,t){this.b=t,this.a=e}G("shaka.media.ManifestParser.registerParserByExtension",gi.pd),gi.Cb=function(e,t){gi.zb[e]=t},G("shaka.media.ManifestParser.registerParserByMime",gi.Cb),gi.Sf=function(){var e={};if(Ze()){for(var t in gi.zb)e[t]=!0;for(var r in gi.Sb)e[r]=!0}t={mpd:"application/dash+xml",m3u8:"application/x-mpegurl",ism:"application/vnd.ms-sstr+xml"};for(var n=(r=f(["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"])).next();!n.done;n=r.next())e[n=n.value]=Ze()?!!gi.zb[n]:Qe(n);for(var i in t)e[i]=Ze()?!!gi.Sb[i]:Qe(t[i]);return e},gi.create=function(e,t,r,n){return p((function i(){var o,a;return M(i,(function(i){switch(i.j){case 1:return k(i,2),S(i,gi.Ue(e,t,r,n),4);case 4:return o=i.o,i.return(new o);case 2:throw(a=R(i)).severity=2,a}}))}))},gi.Ue=function(e,t,r,n){return p((function i(){var o,a,s,l,u;return M(i,(function(i){switch(i.j){case 1:if(o=gi,n&&(a=o.zb[n.toLowerCase()]))return i.return(a);if((s=o.getExtension(e))&&(l=o.Sb[s]))return i.return(l);if(n){i.A(2);break}return S(i,o.bf(e,t,r),3);case 3:if((n=i.o)&&(u=gi.zb[n]))return i.return(u);case 2:throw new me(2,4,4e3,e)}}))}))},gi.bf=function(e,t,r){return p((function n(){var i,o,a;return M(n,(function(n){switch(n.j){case 1:return(i=Me([e],r)).method="HEAD",S(n,t.request(0,i).promise,2);case 2:return o=n.o,a=o.headers["content-type"],n.return(a?a.toLowerCase().split(";").shift():"")}}))}))},gi.getExtension=function(e){return 1==(e=new Z(e).ja.split("/").pop().split(".")).length?"":e.pop().toLowerCase()},gi.isSupported=function(e,t){return!!Ze()&&(t in gi.zb||gi.getExtension(e)in gi.Sb)},G("shaka.media.PresentationTimeline",yi),yi.prototype.Y=function(){return this.g},yi.prototype.getDuration=yi.prototype.Y,yi.prototype.$e=function(){return this.a},yi.prototype.getMaxSegmentDuration=yi.prototype.$e,yi.prototype.xa=function(e){this.g=e},yi.prototype.setDuration=yi.prototype.xa,yi.prototype.hf=function(){return this.f},yi.prototype.getPresentationStartTime=yi.prototype.hf,yi.prototype.pe=function(e){this.l=e},yi.prototype.setClockOffset=yi.prototype.pe,yi.prototype.Xb=function(e){this.m=e},yi.prototype.setStatic=yi.prototype.Xb,yi.prototype.xd=function(e){this.h=e},yi.prototype.setSegmentAvailabilityDuration=yi.prototype.xd,yi.prototype.ig=function(e){this.vc=e},yi.prototype.setDelay=yi.prototype.ig,yi.prototype.Se=function(){return this.vc},yi.prototype.getDelay=yi.prototype.Se,yi.prototype.vb=function(e,t){if(0!=e.length){var r=e[e.length-1].endTime+t;this.fd(e[0].startTime+t),this.a=e.reduce((function(e,t){return Math.max(e,t.endTime-t.startTime)}),this.a),this.b=Math.max(this.b,r),null!=this.f&&this.s&&(this.f=(Date.now()+this.l)/1e3-this.b-this.a)}},yi.prototype.notifySegments=yi.prototype.vb,yi.prototype.fd=function(e){this.c=null==this.c?e:Math.min(this.c,e)},yi.prototype.notifyMinSegmentStartTime=yi.prototype.fd,yi.prototype.ed=function(e){this.a=Math.max(this.a,e)},yi.prototype.notifyMaxSegmentDuration=yi.prototype.ed,yi.prototype.offset=function(e){null!=this.c&&(this.c+=e),null!=this.b&&(this.b+=e)},yi.prototype.offset=yi.prototype.offset,yi.prototype.V=function(){return 1/0==this.g&&!this.m},yi.prototype.isLive=yi.prototype.V,yi.prototype.Xa=function(){return 1/0!=this.g&&!this.m},yi.prototype.isInProgress=yi.prototype.Xa,yi.prototype.Ob=function(){if(1/0==this.h)return this.i;var e=this.pb()-this.h;return Math.max(this.i,e)},yi.prototype.getSegmentAvailabilityStart=yi.prototype.Ob,yi.prototype.qe=function(e){this.i=e},yi.prototype.setUserSeekStart=yi.prototype.qe,yi.prototype.pb=function(){return this.V()||this.Xa()?Math.min(Math.max(0,(Date.now()+this.l)/1e3-this.a-this.f),this.g):this.g},yi.prototype.getSegmentAvailabilityEnd=yi.prototype.pb,yi.prototype.Nb=function(e){var t=Math.max(this.c,this.i);if(1/0==this.h)return t;var r=this.pb()-this.h;return e=Math.min(r+e,this.Ca()),Math.max(t,e)},yi.prototype.getSafeSeekRangeStart=yi.prototype.Nb,yi.prototype.ob=function(){return this.Nb(0)},yi.prototype.getSeekRangeStart=yi.prototype.ob,yi.prototype.Ca=function(){var e=this.V()||this.Xa()?this.vc:0;return Math.max(0,this.pb()-e)},yi.prototype.getSeekRangeEnd=yi.prototype.Ca,yi.prototype.ue=function(){return!(null==this.f||null!=this.b&&this.s)},yi.prototype.usingPresentationStartTime=yi.prototype.ue,G("shaka.dash.DashParser",bi),(n=bi.prototype).configure=function(e){this.a=e},n.start=function(e,t){var r=this;return p((function n(){var i;return M(n,(function(n){switch(n.j){case 1:return r.f=[e],r.b=t,S(n,_i(r),2);case 2:if(i=n.o,r.b&&Si(r,i),!r.b)throw new me(2,7,7001);return n.return(r.c)}}))}))},n.stop=function(){return this.a=this.b=null,this.f=[],this.c=null,this.l=[],this.m={},null!=this.i&&(this.i.stop(),this.i=null),this.g.destroy()},n.update=function(){_i(this).catch(function(e){this.b&&this.b.onError(e)}.bind(this))},n.onExpirationUpdated=function(){},n.Nf=function(e,t){if(e.aa=wi(t,e.ka,null),"image"==e.aa.contentType)return null;var r=!1,n=Bn.P(t,"Role"),i=n.map((function(e){return e.getAttribute("value")})).filter(Gt.Ia),o=void 0,a="text"==e.aa.contentType;a&&(o="subtitle");for(var s=0;s<n.length;s++){var l=n[s].getAttribute("schemeIdUri");if(null==l||"urn:mpeg:dash:role:2011"==l)switch(l=n[s].getAttribute("value"),l){case"main":r=!0;break;case"caption":case"subtitle":o=l}}var u=null,c=!1;Bn.P(t,"EssentialProperty").forEach((function(e){"http://dashif.org/guidelines/trickmode"==e.getAttribute("schemeIdUri")?u=e.getAttribute("value"):c=!0})),s=Bn.P(t,"Accessibility");var d=new Map;for(n={},l=(s=f(s)).next();!l.done;n={Ib:n.Ib},l=s.next()){var h=l.value;l=h.getAttribute("schemeIdUri"),h=h.getAttribute("value"),"urn:scte:dash:cc:cea-608:2015"==l||"urn:scte:dash:cc:cea-708:2015"==l?(n.Ib=1,null!=h?h.split(";").forEach(function(e){return function(t){if(t.includes("=")){var r=(t=t.split("="))[0].startsWith("CC")?t[0]:"CC"+t[0];t=t[1].split(",")[0].split(":").pop()}else r="CC"+e.Ib,e.Ib+=2;d.set(r,Ir(t))}}(n)):d.set("CC1","und")):"urn:mpeg:dash:role:2011"==l&&null!=h&&(i.push(h),"captions"==h&&(o="caption"))}if(c)return null;var p=Gn(n=Bn.P(t,"ContentProtection"),this.a.dash.customScheme,this.a.dash.ignoreDrmInfo);if(n=Ir(t.getAttribute("lang")||"und"),s=t.getAttribute("label"),(l=Bn.P(t,"Label"))&&l.length&&(l=l[0]).textContent&&(s=l.textContent),0==(i=(l=Bn.P(t,"Representation")).map(this.Qf.bind(this,e,p,o,n,s,r,i,d)).filter((function(e){return!!e}))).length){if(this.a.dash.ignoreEmptyAdaptationSet||a)return null;throw new me(2,4,4003)}return e.aa.contentType&&"application"!=e.aa.contentType||(e.aa.contentType=Ci(i[0].mimeType,i[0].codecs),i.forEach((function(t){t.type=e.aa.contentType}))),i.forEach((function(e){p.drmInfos.forEach((function(t){e.keyId&&t.keyIds.push(e.keyId)}))})),a=l.map((function(e){return e.getAttribute("id")})).filter(Gt.Ia),{id:e.aa.id||"__fake__"+this.h++,contentType:e.aa.contentType,language:n,$c:r,streams:i,drmInfos:p.drmInfos,Bd:u,Yf:a}},n.Qf=function(e,t,r,n,i,o,a,s,l){if(e.C=wi(l,e.aa,null),!function(e){var t=e.Ub?1:0;return t+=e.La?1:0,0==(t+=e.Wb?1:0)?"text"==e.contentType||"application"==e.contentType:(1!=t&&(e.Ub&&(e.La=null),e.Wb=null),!0)}(e.C))return null;e.bandwidth=Bn.I(l,"bandwidth",Bn.tc)||0;var u=e.C.contentType;u="text"==u||"application"==u;try{var c=this.Zf.bind(this);if(e.C.Ub)var d=function(e,t){var r=Number($n(e,di,"presentationTimeOffset"))||0,n=$n(e,di,"timescale"),i=1;n&&(i=Bn.tc(n)||1),r=r/i||0,n=ui(e,di);var o=e.C.contentType;if(i=e.C.mimeType.split("/")[1],"text"!=o&&"mp4"!=i&&"webm"!=i)throw new me(2,4,4006);if("webm"==i&&!n)throw new me(2,4,4005);o=qn(e,di,"RepresentationIndex");var a=$n(e,di,"indexRange"),s=e.C.qa;if(a=Bn.uc(a||""),o){var l=o.getAttribute("sourceURL");l&&(s=Vt(e.C.qa,[l])),a=Bn.I(o,"range",Bn.uc,a)}if(!a)throw new me(2,4,4002);return{createSegmentIndex:(i=ci(e,t,n,s,a.start,a.end,i,r)).createSegmentIndex,findSegmentPosition:i.findSegmentPosition,getSegmentReference:i.getSegmentReference,initSegmentReference:n,ma:r}}(e,c);else if(e.C.La)d=fi(e,this.m);else if(e.C.Wb)d=pi(e,c,this.m,!!this.c);else{var f=e.C.qa,h=e.T.duration||0;d={createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(e){return 0<=e&&e<h?1:null},getSegmentReference:function(e){return 1!=e?null:new Zn(1,0,h,(function(){return f}),0,null)},initSegmentReference:null,ma:0}}}catch(e){if(u&&4002==e.code)return null;throw e}return l=function(e,t,r,n){var i=Gn(e,t,n);if(r.Pd)e=1==r.drmInfos.length&&!r.drmInfos[0].keySystem,t=0==i.drmInfos.length,(0==r.drmInfos.length||e&&!t)&&(r.drmInfos=i.drmInfos),r.Pd=!1;else if(0<i.drmInfos.length&&(r.drmInfos=r.drmInfos.filter((function(e){return i.drmInfos.some((function(t){return t.keySystem==e.keySystem}))})),0==r.drmInfos.length))throw new me(2,4,4008);return i.Kd||r.Kd}(l=Bn.P(l,"ContentProtection"),this.a.dash.customScheme,t,this.a.dash.ignoreDrmInfo),{id:this.h++,originalId:e.C.id,createSegmentIndex:d.createSegmentIndex,findSegmentPosition:d.findSegmentPosition,getSegmentReference:d.getSegmentReference,initSegmentReference:d.initSegmentReference,presentationTimeOffset:d.ma,mimeType:e.C.mimeType,codecs:e.C.codecs,frameRate:e.C.frameRate,pixelAspectRatio:e.C.pixelAspectRatio,bandwidth:e.bandwidth,width:e.C.width,height:e.C.height,kind:r,encrypted:0<t.drmInfos.length,keyId:l,language:n,label:i,type:e.aa.contentType,primary:o,trickModeVideo:null,emsgSchemeIdUris:e.C.emsgSchemeIdUris,roles:a,channelsCount:e.C.gd,audioSamplingRate:e.C.audioSamplingRate,closedCaptions:s}},n.Pf=function(e,t,r){var n=Bn.yb,i=r.getAttribute("schemeIdUri")||"",o=r.getAttribute("value")||"",a=Bn.I(r,"timescale",n)||1;Bn.P(r,"Event").forEach(function(r){var s=Bn.I(r,"presentationTime",n)||0,l=Bn.I(r,"duration",n)||0;l=(s=s/a+e)+l/a,null!=t&&(s=Math.min(s,e+t),l=Math.min(l,e+t)),r={schemeIdUri:i,value:o,startTime:s,endTime:l,id:r.getAttribute("id")||"",eventElement:r},this.b.onTimelineRegionAdded(r)}.bind(this))},n.Zf=function(e,t,r){return e=vi(e,t,r,this.a.retryParameters),e=this.b.networkingEngine.request(1,e),Pe(this.g,e),e.promise.then((function(e){return e.data}))},gi.pd("mpd",bi),gi.Cb("application/dash+xml",bi),gi.Cb("video/vnd.mpeg.dash.mpd",bi),Ri.prototype.toString=function(){var e="#"+this.name,t=this.a?this.a.map((function(e){return e.name+"="+(isNaN(Number(e.value))?'"'+e.value+'"':e.value)})):[];return this.value&&t.unshift(this.value),0<t.length&&(e+=":"+t.join(",")),e},Ri.prototype.getAttribute=function(e){var t=this.a.filter((function(t){return t.name==e}));return t.length?t[0]:null};var Ii={nb:function(e,t){return e.filter((function(e){return e.name==t}))},Ta:function(e,t){var r=Ii.nb(e,t);return r.length?r[0]:null},Pc:function(e,t,r){return e.filter((function(e){var n=e.getAttribute("TYPE");return e=e.getAttribute("GROUP-ID"),n.value==t&&e.value==r}))},Hc:function(e,t){return Vt([e],[t])[0]},Yc:function(e){return/^#(?!EXT)/m.test(e)}};function Oi(e){this.b=e,this.a=0}function Di(e){Mi(e,/[ \t]+/gm)}function Mi(e,t){t.lastIndex=e.a;var r=t.exec(e.b);return r=null==r?null:{position:r.index,length:r[0].length,ag:r},e.a==e.b.length||null==r||r.position!=e.a?null:(e.a+=r.length,r.ag)}function Ni(e){return e.a==e.b.length?null:(e=Mi(e,/[^ \t\n]*/gm))?e[0]:null}function Fi(){this.a=0}function Ui(e,t,r){var n=(t=(t=at(t)).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim()).split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(n[0]))throw new me(2,4,4015);t=0;for(var i=1;i<n.length;i++)if(!Ii.Yc(n[i])){var o=Ki(e,n[i]);if(--e.a,Gi.includes(o.name)){t=1;break}"EXT-X-STREAM-INF"==o.name&&(i+=1)}for(i=[],o=1;o<n.length;)if(Ii.Yc(n[o]))o+=1;else{var a=Ki(e,n[o]);if(Vi.includes(a.name)){if(1!=t)throw new me(2,4,4017);return new xi(r,t,i,e=Bi(e,r,n=n.splice(o,n.length-o),i))}i.push(a),o+=1,"EXT-X-STREAM-INF"==a.name&&(a.a.push(new Li("URI",n[o])),o+=1)}return new xi(r,t,i)}function Bi(e,t,r,n){var i=[],o=[];return r.forEach((function(r){if(/^(#EXT)/.test(r))r=Ki(e,r),Gi.includes(r.name)?n.push(r):o.push(r);else{if(Ii.Yc(r))return[];r=Ii.Hc(t,r.trim()),i.push(new Pi(r,o)),o=[]}})),i}function Ki(e,t){var r=e.a++,n=t.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!n)throw new me(2,4,4016,t);var i,o=n[1],a=n[2];if(n=[],a){var s;(s=Mi(a=new Oi(a),/^([^,=]+)(?:,|$)/g))&&(i=s[1]);for(var l=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;s=Mi(a,l);)n.push(new Li(s[1],s[2]||s[3]))}return new Ri(r,o,n,i)}var Gi="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-MAP EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST".split(" "),Vi="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE".split(" ");function Hi(e){try{var t=Hi.parse(e);return _e({uri:e,ld:e,data:t.data,headers:{"content-type":t.contentType}})}catch(e){return ve(e)}}function Yi(){var e=this;this.a=this.f=null,this.$=1,this.D=new Map,this.S=new Set,this.b=new Map,this.c=null,this.u="",this.s=new Fi,this.O=0,this.h=new fe((function(){!function(e){p((function t(){var r,n;return M(t,(function(t){switch(t.j){case 1:return e.f?(k(t,2),S(t,e.update(),4)):t.return();case 4:r=e.O,e.h.R(r),x(t,0);break;case 2:if(n=R(t),!e.f)return t.return();n.severity=1,e.f.onError(n),e.h.R(.1),w(t)}}))}))}(e)})),this.g=fo,this.m=null,this.B=0,this.F=1/0,this.i=new je,this.K=[],this.l=new Map,this.W=!1}function zi(e,t){return p((function r(){var n,i,o,a,s,l,u,c,d,f;return M(r,(function(r){switch(r.j){case 1:return n=Ii,i=ho,o=t.Ce,S(r,uo(e,Me([o],e.a.retryParameters),0),2);case 2:if(a=r.o,1!=(s=Ui(e.s,a.data,a.uri)).type)throw new me(2,4,4017);return u=(l=n.Ta(s.a,"EXT-X-MEDIA-SEQUENCE"))?Number(l.value):0,c=t.stream,S(r,eo(e,t.Bc,s,u,c.mimeType,c.codecs),3);case 3:d=r.o,t.Vb.a=d,f=d[d.length-1],n.Ta(s.a,"EXT-X-ENDLIST")&&(lo(e,i.Qa),e.c.xa(f.endTime)),w(r)}}))}))}function Wi(e){e.forEach((function(e){if(e){var t=e.stream.codecs.split(",");t=t.filter((function(e){return"mp4a.40.34"!=e})),e.stream.codecs=t.join(",")}}))}function $i(e,t,r,n,i){return{id:e.$++,language:t?t.language:"und",primary:!!t&&t.primary||!!r&&r.primary,audio:t,video:r,bandwidth:n,drmInfos:i,allowedByApplication:!0,allowedByKeySystem:!0}}function qi(e,t,r){return p((function n(){var i,o,a,s,l,u,c,d,f;return M(n,(function(n){switch(n.j){case 1:if(i=no(t,"URI"),e.b.has(i))return n.return(e.b.get(i));if(o=no(t,"TYPE").toLowerCase(),a=Yt,"subtitles"==o&&(o=a.ra),s=Ir(ji(t,"LANGUAGE","und")),l=ji(t,"NAME"),u=t.getAttribute("DEFAULT"),c=t.getAttribute("AUTOSELECT"),d=ji(t,"CHANNELS"),"audio"==o)if(d){var h=d.split("/")[0];h=parseInt(h,10)}else h=null;else h=null;return S(n,Xi(e,i,r,o,s,!!u||!!c,l,h,null),2);case 2:return f=n.o,e.b.has(i)?n.return(e.b.get(i)):null==f?n.return(null):(e.D.set(t.id,f),e.b.set(i,f),n.return(f))}}))}))}function Xi(e,t,r,n,i,o,a,s,l){return p((function u(){var c,d,h,m,g,y,v,b,_,A,E,T,w,C,L,j,P,I,O,D,N,F,U,B,K,G;return M(u,(function(u){switch(u.j){case 1:return d=(c=Ii).Hc(e.u,t),S(u,uo(e,Me([d],e.a.retryParameters),0),2);case 2:if(h=u.o,d=h.uri,1!=(m=Ui(e.s,h.data,d)).type)throw new me(2,4,4017);g=[],m.segments.forEach((function(e){e=c.nb(e.b,"EXT-X-KEY"),g.push.apply(g,e)})),y=!1,v=[],b=null;for(var V=f(g),H=V.next();!H.done;H=V.next())if(_=H.value,"NONE"!=(A=no(_,"METHOD"))){if(y=!0,"AES-128"==A)return e.W=!0,u.return(null);E=no(_,"KEYFORMAT"),(w=(T=co[E])?T(_):null)&&(w.keyIds.length&&(b=w.keyIds[0]),v.push(w))}if(y&&!v.length)throw new me(2,4,4026);return function(e,t){var r=ho,n=Ii.Ta(t.a,"EXT-X-PLAYLIST-TYPE"),i=Ii.Ta(t.a,"EXT-X-ENDLIST");i=n&&"VOD"==n.value||i,n=n&&"EVENT"==n.value&&!i,n=!i&&!n,i?lo(e,r.Qa):(lo(e,n?r.Fd:r.xe),r=io(t.a,"EXT-X-TARGETDURATION"),r=Number(r.value),e.B=Math.max(r,e.B),e.F=Math.min(r,e.F))}(e,m),C=function(e,t){if(1==t.length)return t[0];var r=ro(e,t);if(null!=r)return r;throw new me(2,4,4025,t)}(n,r),S(u,function(e,t,r,n){return p((function i(){var o,a,s,l,u,c,d,f,h;return M(i,(function(i){switch(i.j){case 1:return o=Yt,a=n.segments[0].a,s=new Z(a),l=s.ja.split(".").pop(),u=so[t],(c=u[l])?i.return(c):t==o.ra?r&&"vtt"!=r?i.return("application/mp4"):i.return("text/vtt"):((d=Me([a],e.a.retryParameters)).method="HEAD",S(i,uo(e,d,1),2));case 2:if(f=i.o,!(h=f.headers["content-type"]))throw new me(2,4,4021,l);return i.return(h.split(";")[0])}}))}))}(e,n,C,m),3);case 3:return L=u.o,ao.includes(L)&&(C=""),P=(j=c.Ta(m.a,"EXT-X-MEDIA-SEQUENCE"))?Number(j.value):0,k(u,4),S(u,eo(e,t,m,P,L,C),6);case 6:I=u.o,x(u,5);break;case 4:if(4035==(O=R(u)).code)return q("Skipping unsupported HLS stream",L,t),u.return(null);throw O;case 5:return D=I[0].startTime,N=I[I.length-1].endTime,F=N-D,U=new ei(I),B=Ji(m),K=void 0,"text"==n&&(K="subtitle"),G={id:e.$++,originalId:a,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:U.find.bind(U),getSegmentReference:U.get.bind(U),initSegmentReference:B,presentationTimeOffset:0,mimeType:L,codecs:C,kind:K,encrypted:y,keyId:b,language:i,label:a,type:n,primary:o,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:[],channelsCount:s,audioSamplingRate:null,closedCaptions:l},u.return({stream:G,Vb:U,drmInfos:v,Bc:t,Ce:d,dd:D,Hg:N,duration:F})}}))}))}function Ji(e){var t=Ii.nb(e.a,"EXT-X-MAP");if(!t.length)return null;if(1<t.length)throw new me(2,4,4020);var r=no(t=t[0],"URI"),n=Ii.Hc(e.b,r);return e=0,r=null,(t=ji(t,"BYTERANGE"))&&(e=t.split("@"),t=Number(e[0]),r=(e=Number(e[1]))+t-1),new Jn((function(){return[n]}),e,r)}function Zi(e,t,r,n){var i=t.b,o=t.a;t=io(i,"EXTINF").value.split(","),t=n+Number(t[0]);var a=0,s=null;return(i=Ii.Ta(i,"EXT-X-BYTERANGE"))&&(a=i.value.split("@"),i=Number(a[0]),s=(a=a[1]?Number(a[1]):e.a+1)+i-1),new Zn(r,n,t,(function(){return[o]}),a,s)}function Qi(e){e.c&&(e.K.forEach((function(t){e.c.vb(t,0)})),e.K=[])}function eo(e,t,r,n,i,o){return p((function a(){var s,l,u,c,d,f,h,m,g,y;return M(a,(function(a){switch(a.j){case 1:return s=r.segments,l=[],u=s[0].a,c=Zi(null,s[0],n,0),d=Ji(r),S(a,function(e,t,r,n,i,o){return p((function a(){var s,l,u,c,d,f,h,p,m;return M(a,(function(a){switch(a.j){case 1:if(e.m&&(s=e.b.get(t),l=s.Vb,u=l.get(n.position)))return a.return(u.startTime);if(i=i.toLowerCase(),ao.includes(i))throw q("Raw formats are not yet supported. Skipping "+i),new me(1,4,4035);if("video/webm"==i)throw q("WebM in HLS is not yet supported. Skipping."),new me(1,4,4035);if("video/mp4"!=i&&"audio/mp4"!=i){a.A(2);break}return c=[to(e,n)],r&&c.push(to(e,r)),S(a,Promise.all(c),3);case 3:return d=a.o,f=d[0],h=d[1]||d[0],a.return(function(e,t,r,n){var i=0;if((new In).H("moov",On).H("trak",On).H("mdia",On).fa("mdhd",(function(e){e.reader.M(0==e.version?8:16),i=e.reader.G(),e.parser.stop()})).parse(n,!0),!i)throw new me(2,4,4030,e,t);var o=0,a=!1;if((new In).H("moof",On).H("traf",On).fa("tfdt",(function(e){o=(0==e.version?e.reader.G():e.reader.Bb())/i,a=!0,e.parser.stop()})).parse(r,!0),!a)throw new me(2,4,4030,e,t);return o}(t,f.uri,f.data,h.data));case 2:if("video/mp2t"!=i){a.A(4);break}return S(a,to(e,n),5);case 5:return p=a.o,a.return(function(e,t,r){function n(){throw new me(2,4,4030,e,t)}r=new Ln(new DataView(r),0);for(var i=0,o=0;;){if(i=r.ca(),71!=(o=r.la())&&n(),16384&r.Tb()||n(),0!=(o=(48&r.la())>>4)&&2!=o||n(),3==o&&(o=r.la(),r.M(o)),1==r.G()>>8)return r.M(3),0!=(i=r.la()>>6)&&1!=i||n(),0==r.la()&&n(),i=r.la(),o=r.Tb(),r=r.Tb(),(1073741824*((14&i)>>1)+((65534&o)<<14|(65534&r)>>1))/9e4;r.seek(i+188),71!=(o=r.la())&&(r.seek(i+192),o=r.la()),71!=o&&(r.seek(i+204),o=r.la()),71!=o&&n(),r.me(1)}}(t,p.uri,p.data));case 4:if("application/mp4"!=i&&!i.startsWith("text/")){a.A(6);break}return S(a,to(e,n),7);case 7:return m=a.o,a.return(function(e,t,r){return pr(e=qe(e,t))?(mr(t=new fr(null),e),t.kc(r)):0}(i,o,m.data));case 6:throw new me(2,4,4030,t)}}))}))}(e,t,d,c,i,o),2);case 2:f=a.o,u.split("/").pop();for(var v=0;v<s.length;++v)h=s[v],m=l[l.length-1],g=0==v?f:m.endTime,y=Zi(m,h,n+v,g),l.push(y);return e.K.push(l),Qi(e),a.return(l)}}))}))}function to(e,t){return p((function r(){var n,i,o,a,s,l;return M(r,(function(r){switch(r.j){case 1:return n=1,i=vi(t.c(),t.b,t.b+2048-1,e.a.retryParameters),o=vi(t.c(),t.b,t.a,e.a.retryParameters),k(r,2),S(r,uo(e,i,n),4);case 4:return a=r.o,r.return(a);case 2:if(7001==(s=R(r)).code)throw s;return q("Unable to fetch a partial HLS segment! Falling back to a full segment request, which is expensive! Your server should support Range requests and CORS preflights.",i.uris[0]),S(r,uo(e,o,n),5);case 5:return l=r.o,r.return(l)}}))}))}function ro(e,t){for(var r=oo[e],n=0;n<r.length;n++)for(var i=0;i<t.length;i++)if(r[n].test(t[i].trim()))return t[i].trim();return"text"==e?"":null}function no(e,t){var r=e.getAttribute(t);if(!r)throw new me(2,4,4023,t);return r.value}function io(e,t){var r=Ii.Ta(e,t);if(!r)throw new me(2,4,4024,t);return r}G("shaka.net.DataUriPlugin",Hi),Hi.parse=function(t){var r=t.split(":");if(2>r.length||"data"!=r[0])throw new me(2,1,1004,t);if(2>(r=r.slice(1).join(":").split(",")).length)throw new me(2,1,1004,t);var n=r[0];r=e.decodeURIComponent(r.slice(1).join(","));var i=null;if(1<(n=n.split(";")).length&&(i=n[1]),"base64"==i)t=ht.Ba(r).buffer;else{if(i)throw new me(2,1,1005,t);t=ut(r)}return{data:t,contentType:n[0]}},De("data",Hi),G("shaka.hls.HlsParser",Yi),(n=Yi.prototype).configure=function(e){this.a=e},n.start=function(e,t){var r=this;return p((function n(){var i,o;return M(n,(function(n){switch(n.j){case 1:return r.f=t,S(n,uo(r,Me([e],r.a.retryParameters),0),2);case 2:return i=n.o,r.u=i.uri,S(n,function(e,t){return p((function r(){var n,i,o,a,s,l,u,c,d,h,m;return M(r,(function(r){switch(r.j){case 1:if(0!=(n=Ui(e.s,t,e.u)).type)throw new me(2,4,4022);return S(r,function(e,t){return p((function r(){var n,i,o,a,s,l,u,c,d,h,m,g;return M(r,(function(r){switch(r.j){case 1:return n=Ii,i=Gt,o=t.a,a=n.nb(t.a,"EXT-X-MEDIA"),s=a.filter(function(e){return"SUBTITLES"==no(e,"TYPE")}.bind(e)),l=s.map(function(e){var t=this;return p((function r(){var n;return M(r,(function(r){switch(r.j){case 1:return t.a.disableText?r.return(null):(k(r,2),S(r,function(e,t){return p((function r(){var n;return M(r,(function(r){switch(r.j){case 1:return no(t,"TYPE"),S(r,qi(e,t,[]),2);case 2:return n=r.o,r.return(n.stream)}}))}))}(t,e),4));case 4:return r.return(r.o);case 2:if(n=R(r),t.a.hls.ignoreTextStreamFailures)return r.return(null);throw n}}))}))}.bind(e)),u=a.filter((function(e){return"CLOSED-CAPTIONS"==no(e,"TYPE")})),function(e,t){for(var r=f(t),n=r.next();!n.done;n=r.next()){no(n=n.value,"TYPE");var i=ji(n,"LANGUAGE")||"und";i=Ir(i);var o=no(n,"GROUP-ID");n=no(n,"INSTREAM-ID"),e.l.get(o)||e.l.set(o,new Map),e.l.get(o).set(n,i)}}(e,u),S(r,Promise.all(l),2);case 2:return c=r.o,d=n.nb(o,"EXT-X-STREAM-INF"),h=d.map(function(e){return function(e,t,r){return p((function n(){var i,o,a,s,l,u,c,d,h,m,g,y,v,b,_,A,E,T,w,k,C,x,R,L,j,P,I;return M(n,(function(n){switch(n.j){case 1:return i=Yt,o=Ii,a=ji(t,"CODECS","avc1.42E01E,mp4a.40.2"),s=function(e){for(var t=new Set,r=[],n=(e=f(e)).next();!n.done;n=e.next()){var i=Xe(n=n.value)[0];t.has(i)||(r.push(n),t.add(i))}return r}(a.split(/\s*,\s*/)),l=t.getAttribute("RESOLUTION"),c=u=null,d=ji(t,"FRAME-RATE"),h=Number(no(t,"BANDWIDTH")),l&&(m=l.value.split("x"),u=m[0],c=m[1]),g=(g=(g=o.nb(r.a,"EXT-X-MEDIA")).filter((function(e){return"CLOSED-CAPTIONS"!=no(e,"TYPE")}))).filter((function(e){var t=ji(e,"URI")||"";return"SUBTITLES"==(ji(e,"TYPE")||"")||""!=t})),y=ji(t,"AUDIO"),v=ji(t,"VIDEO"),y?g=o.Pc(g,"AUDIO",y):v&&(g=o.Pc(g,"VIDEO",v)),(b=ro(i.ra,s))&&((_=ji(t,"SUBTITLES"))&&(A=o.Pc(g,"SUBTITLES",_)).length&&(E=e.D.get(A[0].id))&&(E.stream.codecs=b),Re(s,b)),T=g.map(function(e){return qi(this,e,s)}.bind(e)),w=[],k=[],S(n,Promise.all(T),2);case 2:if(x=(x=n.o).filter((function(e){return null!=e})),y?w=x:v&&(k=x),L=!1,w.length||k.length?w.length?(P=no(t,"URI"),I=w[0].Bc,P==I?(R=i.Eb,L=!0):R=i.Pa):R=i.Eb:1==s.length?(j=ro(i.Pa,s),R=l||d||j?i.Pa:i.Eb):(R=i.Pa,s=[s.join(",")]),L){n.A(3);break}return S(n,function(e,t,r,n){return p((function i(){var o,a,s,l,u;return M(i,(function(i){switch(i.j){case 1:return o=Yt,a=no(t,"URI"),e.b.has(a)?i.return(e.b.get(a)):(s=ji(t,"CLOSED-CAPTIONS"),l=null,n==o.Pa&&s&&"NONE"!=s&&(l=e.l.get(s)),S(i,Xi(e,a,r,n,"und",!1,null,null,l),2));case 2:return null==(u=i.o)?i.return(null):e.b.has(a)?i.return(e.b.get(a)):(e.b.set(a,u),i.return(u))}}))}))}(e,t,s,R),4);case 4:C=n.o;case 3:if(C)C.stream.type==i.Eb?w=[C]:k=[C];else if(null===C)return n.return([]);return k&&Wi(k),w&&Wi(w),n.return(function(e,t,r,n,i,o,a){r.forEach(function(e){(e=e.stream)&&(e.width=Number(i)||void 0,e.height=Number(o)||void 0,e.frameRate=Number(a)||void 0)}.bind(e));var s=!!e.a&&e.a.disableAudio;t.length&&!s||(t=[null]),s=!!e.a&&e.a.disableVideo,(!r.length||s)&&(r=[null]),s=[];for(var l=(t=f(t)).next();!l.done;l=t.next()){l=l.value;for(var u=f(r),c=u.next();!c.done;c=u.next()){var d=c.value;c=l?l.stream:null;var h=d?d.stream:null,p=l?l.drmInfos:null,m=d?d.drmInfos:null;d=(d?d.Bc:"")+" - "+(l?l.Bc:"");var g=void 0;if(c&&h){if(p.length&&m.length&&!(0<Lt(p,m).length))continue;g=Lt(p,m)}else c?g=p:h&&(g=m);e.S.has(d)||(c=$i(e,c,h,n,g),s.push(c),e.S.add(d))}}return s}(e,w,k,h,u,c,d))}}))}))}(this,e,t)}.bind(e)),S(r,Promise.all(h),3);case 3:return m=r.o,g=(g=m.reduce(i.Gc,[])).filter((function(e){return null!=e})),r.return({startTime:0,variants:g,textStreams:c.filter((function(e){return null!=e}))})}}))}))}(e,n),2);case 2:if(i=r.o,!e.f)throw new me(2,7,7001);if(e.W&&0==i.variants.length)throw new me(2,4,4034);e.f.filterAllPeriods([i]),o=1/0,a=0,s=1/0;for(var g=f(e.b.values()),y=g.next();!y.done;y=g.next())l=y.value,o=Math.min(o,l.dd),a=Math.max(a,l.dd),"text"!=l.stream.type&&(s=Math.min(s,l.duration));if(e.g!=ho.Qa?(e.c=new yi(0,3*e.B),e.c.Xb(!1)):(e.c=new yi(null,0),e.c.Xb(!0)),Qi(e),e.g!=ho.Qa){for(e.O=e.F,u=ho,e.g==u.Fd&&(c=e.c.vc,isNaN(e.a.availabilityWindowOverride)||(c=e.a.availabilityWindowOverride),e.c.xd(c)),d=0;95443.7176888889<=a;)d+=95443.7176888889,a-=95443.7176888889;if(d)for(y=(g=f(e.b.values())).next();!y.done;y=g.next())95443.7176888889>(h=y.value).dd&&(h.stream.presentationTimeOffset=-d,h.Vb.offset(d))}else for(e.c.xa(s),e.c.offset(-o),y=(g=f(e.b.values())).next();!y.done;y=g.next())(m=y.value).stream.presentationTimeOffset=o,m.Vb.offset(-o),ti(m.Vb,s);e.m={presentationTimeline:e.c,periods:[i],offlineSessionIds:[],minBufferTime:0},w(r)}}))}))}(r,i.data),3);case 3:return 0<(o=r.O)&&r.h.R(o),n.return(r.m)}}))}))},n.stop=function(){this.h&&(this.h.stop(),this.h=null);var e=[];return this.i&&(e.push(this.i.destroy()),this.i=null),this.a=this.f=null,this.D.clear(),this.S.clear(),this.b.clear(),this.m=null,Promise.all(e)},n.update=function(){if(this.g!=ho.Qa){for(var e=[],t=f(this.b.values()),r=t.next();!r.done;r=t.next())e.push(zi(this,r.value));return Promise.all(e)}},n.onExpirationUpdated=function(){};var oo={audio:[/^vorbis$/,/^opus$/,/^flac$/,/^mp4a/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/],text:[/^vtt$/,/^wvtt/,/^stpp/]},ao=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"],so={audio:{mp4:"audio/mp4",m4s:"audio/mp4",m4i:"audio/mp4",m4a:"audio/mp4",ts:"video/mp2t",aac:"audio/aac",ac3:"audio/ac3",ec3:"audio/ec3",mp3:"audio/mpeg"},video:{mp4:"video/mp4",m4s:"video/mp4",m4i:"video/mp4",m4v:"video/mp4",ts:"video/mp2t"},text:{mp4:"application/mp4",m4s:"application/mp4",m4i:"application/mp4",vtt:"text/vtt",ttml:"application/ttml+xml"}};function lo(e,t){e.g=t,e.c&&e.c.Xb(e.g==ho.Qa),e.g!=ho.Qa||e.h.stop()}function uo(e,t,r){if(!e.i)throw new me(2,7,7001);return t=e.f.networkingEngine.request(r,t),Pe(e.i,t),t.promise}var co={"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(e){var t=no(e,"METHOD");return Kr("HLS SAMPLE-AES-CENC","SAMPLE-AES-CENC will no longer be supported, see Issue #1227"),["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].includes(t)?(t=no(e,"URI"),t=Hi.parse(t),t=Ht("com.widevine.alpha",[{initDataType:"cenc",initData:t=new Uint8Array(t.data)}]),(e=ji(e,"KEYID"))&&(t.keyIds=[e.substr(2).toLowerCase()]),t):null}},fo="VOD",ho={Qa:fo,xe:"EVENT",Fd:"LIVE"};function po(){this.a=new Map}function mo(e,t,r){go(e,t).text=r}function go(e,t){return e.a.has(t)||e.a.set(t,new yo),e.a.get(t)}function yo(){this.text=this.variant=null}function vo(e,t){this.a=e,this.b=new Set([e]);for(var r=f(t=t||[]),n=r.next();!n.done;n=r.next())this.add(n.value)}function bo(e,t){var r;if(!(r=!!e.audio!=!!t.audio||!!e.video!=!!t.video||e.language!=t.language)&&(r=e.audio&&t.audio)){r=e.audio;var n=t.audio;r=!(r.channelsCount==n.channelsCount&&_o(r,n)&&Ao(r.roles,n.roles))}return!r&&(r=e.video&&t.video)&&(r=!(_o(r=e.video,n=t.video)&&Ao(r.roles,n.roles))),!r}function _o(e,t){if(e.mimeType!=t.mimeType)return!1;var r=e.codecs.split(",").map((function(e){return Xe(e)[0]})),n=t.codecs.split(",").map((function(e){return Xe(e)[0]}));if(r.length!=n.length)return!1;r.sort(),n.sort();for(var i=0;i<r.length;i++)if(r[i]!=n[i])return!1;return!0}function Ao(e,t){var r=new Set(e),n=new Set(t);if(r.delete("main"),n.delete("main"),r.size!=n.size)return!1;for(var i=(r=f(r)).next();!i.done;i=r.next())if(!n.has(i.value))return!1;return!0}function Eo(e){this.a=e,this.b=new To(e.language,"",e.audio&&e.audio.channelsCount?e.audio.channelsCount:0,"")}function To(e,t,r,n,i){this.f=e,this.c=t,this.a=r,this.b=void 0===n?"":n,this.g=void 0===i?"":i}function So(){this.a=Co,this.b=(new Map).set(Co,2).set(ko,1)}function wo(e,t,r){e.b.set(Co,r).set(ko,t)}gi.pd("m3u8",Yi),gi.Cb("application/x-mpegurl",Yi),gi.Cb("application/vnd.apple.mpegurl",Yi),vo.prototype.add=function(e){return!!bo(this.a,e)&&(this.b.add(e),!0)},vo.prototype.values=function(){return this.b.values()},Eo.prototype.create=function(e){var t=this,r=e.filter((function(e){return bo(t.a,e)}));return r.length?new vo(r[0],r):this.b.create(e)},To.prototype.create=function(e){var t=[];t=function(e,t){var r=Dr(Ir(t),e.map((function(e){return Or(e)})));return r?e.filter((function(e){return r==Or(e)})):[]}(e,this.f);var r=e.filter((function(e){return e.primary}));for(t=t.length?t:r.length?r:e,this.c&&(e=function(e,t,r){return e.filter((function(e){if(r){var n=e[r];return n&&n.roles.includes(t)}return n=e.audio,e=e.video,n&&0<=n.roles.indexOf(t)||e&&0<=e.roles.indexOf(t)}))}(t,this.c,this.g)).length&&(t=e),this.a&&(e=Nr.Nd(t,this.a)).length&&(t=e),this.b&&(e=function(e,t){return e.filter((function(e){return!!e.audio&&e.audio.label.toLowerCase()==t.toLowerCase()}))}(t,this.b)).length&&(t=e),e=new vo(t[0]),r=(t=f(t)).next();!r.done;r=t.next())r=r.value,bo(e.a,r)&&e.add(r);return e};var ko=0,Co=1;function xo(e,t){this.g=e,this.h=Lo(e),this.a=e.a.currentTime,this.f=Date.now()/1e3,this.b=!1,this.i=t,this.c=function(){}}function Ro(e){this.a=e}function Lo(e){if(e.a.paused||0==e.a.playbackRate||null==e.a.buffered)var t=!1;else e:{t=e.a.buffered,e=e.a.currentTime;for(var r=0;r<t.length;r++){var n=t.start(r),i=t.end(r);if(!(e<n||e>i-.5)){t=!0;break e}}t=!1}return t}function jo(e,t,r,n,i){var o=this;this.a=e,this.u=t,this.s=r,this.l=i,this.f=new Be,this.i=!1,this.m=e.readyState,this.c=!1,this.b=n,this.h=!1,this.f.w(e,"waiting",(function(){return Po(o)})),this.g=new fe((function(){Po(o)})).Na(.25)}function Po(e){if(0!=e.a.readyState){if(e.a.seeking){if(!e.i)return}else e.i=!1;if(!e.a.paused){e.a.readyState!=e.m&&(e.c=!1,e.m=e.a.readyState);var t=e.s.smallGapLimit,r=e.a.currentTime,n=e.a.buffered;e:{if(n&&n.length&&!(1==n.length&&1e-6>n.end(0)-n.start(0)))for(var i=rt("Edge/")||rt("Trident/")||rt("Tizen")||rt("CrKey")?.5:.1,o=0;o<n.length;o++)if(n.start(o)>r&&(0==o||n.end(o-1)-r<=i)){i=o;break e}i=null}if(null==i)e.b&&(r=Lo(n=(e=e.b).g),i=n.a.currentTime,o=Date.now()/1e3,e.a==i&&e.h==r||(e.f=o,e.a=i,e.h=r,e.b=!1),(i=o-e.f)>=e.i&&r&&!e.b&&(e.c(e.a,i),e.b=!0,e.a=n.a.currentTime));else if(0!=i||e.h){o=n.start(i);var a=e.u.Ca();if(!(o>=a)){t=(a=o-r)<=t;var s=!1;.001>a||(t||e.c||(e.c=!0,(r=new Se("largegap",{currentTime:r,gapSize:a})).cancelable=!0,e.l(r),e.s.jumpLargeGaps&&!r.defaultPrevented&&(s=!0)),!t&&!s)||(0!=i&&n.end(i-1),e.a.currentTime=o)}}}}}function Io(e){var t=this;this.c=e,this.a=new Set,this.b=new fe((function(){Oo(t,!1)})).Na(.25)}function Oo(e,t){for(var r=f(e.a),n=r.next();!n.done;n=r.next())n.value.g(e.c.currentTime,t)}function Do(e){for(var t=[],r=(e=f(e)).next();!r.done;r=e.next())for(var n=(r=f(r.value.variants)).next();!n.done;n=r.next())t.push(n.value);return t}function Mo(e,t){for(var r=null,n=f(e),i=n.next();!i.done;i=n.next())t>=(i=i.value).startTime&&(r=i);return r}function No(e){this.c=e,this.a=null,this.b=function(){}}function Fo(e){var t=this;this.a=e,this.f=!1,this.c=this.a.jc(),this.b=new fe((function(){t.a.Yd(.25*t.c)}))}function Uo(e){e.b.stop();var t=e.f?0:e.c;if(0<=t)try{return void(e.a.jc()!=t&&e.a.wd(t))}catch(e){}e.b.Na(.25),0!=e.a.jc()&&e.a.wd(0)}function Bo(e,t,r){this.a=e,this.f=t,this.g=r,this.h=!1,this.b=new Be,this.c=new Yo(e),0<e.readyState?Vo(this,r):Go(this,r)}function Ko(e){return e.h?e.a.currentTime:e.g}function Go(e,t){e.g=t,e.b.ea(e.a,"loadedmetadata"),e.b.da(e.a,"loadedmetadata",(function(){Vo(e,t)}))}function Vo(e,t){.001>Math.abs(e.a.currentTime-t)?Ho(e):(e.b.da(e.a,"seeking",(function(){Ho(e)})),zo(e.c,0==e.a.currentTime?t:e.a.currentTime))}function Ho(e){e.h=!0,e.b.w(e.a,"seeking",(function(){return e.f()}))}function Yo(e){var t=this;this.b=e,this.h=10,this.g=this.f=this.c=0,this.a=new fe((function(){0>=t.c||t.b.currentTime!=t.f?t.a.stop():(t.b.currentTime=t.g,t.c--)}))}function zo(e,t){e.f=e.b.currentTime,e.g=t,e.c=e.h,e.b.currentTime=t,e.a.Na(.1)}function Wo(e){function t(){null==r.c?r.f=!0:(r.b.da(r.a,"seeking",(function(){r.f=!0})),r.a.currentTime=Math.max(0,r.a.currentTime+r.c))}var r=this;this.a=e,this.f=!1,this.c=null,this.b=new Be,0==this.a.readyState?this.b.da(this.a,"loadeddata",t):t()}function $o(e,t,r,n,i,o){var a=this;this.b=e,this.a=t.presentationTimeline,this.B=t.minBufferTime||0,this.g=r,this.u=i,this.l=null,this.f=new jo(e,t.presentationTimeline,r,function(e,t){if(!t.stallEnabled)return null;var r=t.stallSkip,n=new xo(new Ro(e),t.stallThreshold);return function(e,t){e.c=t}(n,(function(){e.currentTime+=r})),n}(e,r),o),this.c=new Bo(e,(function(){var e=a.f;e.i=!0,e.h=!1,e.c=!1;var t=Ko(a.c);return e=Xo(a,t),.001<Math.abs(e-t)&&(t=(new Date).getTime()/1e3,!a.l||a.l<t-1)?(a.l=t,0<(t=a.c).a.readyState?zo(t.c,e):Go(t,e),e=void 0):(a.u(),e=void 0),e}),function(e,t){return null==t?t=1/0>e.a.Y()?e.a.ob():e.a.Ca():0>t&&(t=e.a.Ca()+t),qo(e,Jo(e,t))}(this,n)),this.i=new fe((function(){if(0!=a.b.readyState&&!a.b.paused){var e=a.b.currentTime,t=a.a.ob(),r=a.a.Ca();3>r-t&&(t=r-3),e<t&&(e=Xo(a,e),a.b.currentTime=e)}})).Na(.25)}function qo(e,t){var r=e.a.Y();return t>=r?r-e.g.durationBackoff:t}function Xo(e,t){var r=Ut.bind(null,e.b.buffered),n=Math.max(e.B,e.g.rebufferingGoal),i=e.g.safeSeekOffset,o=e.a.ob(),a=e.a.Ca(),s=e.a.Y();3>a-o&&(o=a-3);var l=e.a.Nb(n),u=e.a.Nb(i);return n=e.a.Nb(n+i),t>=s?qo(e,t):t>a?a:t<o?r(u)?u:n:t>=l||r(t)?t:n}function Jo(e,t){var r=e.a.ob();return t<r||t>(r=e.a.Ca())?r:t}function Zo(){this.b=function(){},this.a=new Set}function Qo(e){var t=this;this.h=e,this.f=new Map,this.a=function(){},this.b=function(){},this.c=function(){},this.i=[{eb:null,cb:ta,Wa:function(e,r){return t.a(e,r)}},{eb:ea,cb:ta,Wa:function(e,r){return t.a(e,r)}},{eb:ra,cb:ta,Wa:function(e,r){return t.a(e,r)}},{eb:ta,cb:ea,Wa:function(e,r){return t.b(e,r)}},{eb:ta,cb:ra,Wa:function(e,r){return t.b(e,r)}},{eb:ea,cb:ra,Wa:function(e,r){return t.c(e,r)}},{eb:ra,cb:ea,Wa:function(e,r){return t.c(e,r)}}]}xo.prototype.release=function(){this.g=null,this.c=function(){}},jo.prototype.release=function(){this.f&&(this.f.release(),this.f=null),null!=this.g&&(this.g.stop(),this.g=null),this.b&&(this.b.release(),this.b=null),this.a=this.u=this.l=null},jo.prototype.jd=function(){this.h=!0,Po(this)},Io.prototype.release=function(){this.b.stop();for(var e=f(this.a),t=e.next();!t.done;t=e.next())t.value.release();this.a.clear()},No.prototype.release=function(){this.a=this.c=null,this.b=function(){}},No.prototype.g=function(e){var t=this.a,r=this.c.periods;t!=(e=Mo(r,e)||r[0])&&this.b(e),this.a=e},Fo.prototype.release=function(){this.b&&(this.b.stop(),this.b=null),this.a=null},Fo.prototype.set=function(e){this.c=e,Uo(this)},Bo.prototype.release=function(){this.b&&(this.b.release(),this.b=null),null!=this.c&&(this.c.release(),this.c=null),this.f=function(){},this.a=null},Yo.prototype.release=function(){this.a&&(this.a.stop(),this.a=null),this.b=null},Wo.prototype.release=function(){this.b&&(this.b.release(),this.b=null),this.a=null},Wo.prototype.m=function(e){this.c=this.f?this.c:e},Wo.prototype.h=function(){return(this.f?this.a.currentTime:this.c)||0},Wo.prototype.s=function(){},$o.prototype.release=function(){this.c&&(this.c.release(),this.c=null),this.f&&(this.f.release(),this.f=null),this.i&&(this.i.stop(),this.i=null),this.b=this.c=this.a=this.g=null,this.u=function(){}},$o.prototype.m=function(e){var t=this.c;0<t.a.readyState?zo(t.c,e):Go(t,e)},$o.prototype.h=function(){var e=Ko(this.c);return 0<this.b.readyState&&!this.b.paused?Jo(this,e):e},$o.prototype.s=function(){this.f.jd()},Zo.prototype.release=function(){this.b=function(){},this.a.clear()},Qo.prototype.release=function(){this.h=null,this.f.clear(),this.a=function(){},this.b=function(){},this.c=function(){}},Qo.prototype.g=function(e,t){for(var r=f(this.h.a),n=r.next();!n.done;n=r.next()){n=n.value;var i=this.f.get(n),o=e<n.startTime?ea:e>n.endTime?ra:ta;this.f.set(n,o);for(var a=f(this.i),s=a.next();!s.done;s=a.next())(s=s.value).eb==i&&s.cb==o&&s.Wa(n,t)}};var ea=1,ta=2,ra=3;function na(e,t){this.a=t,this.c=e,this.g=null,this.l=1,this.u=Promise.resolve(),this.h=[],this.i=new Map,this.b=new Map,this.s=!1,this.F=null,this.D=this.f=this.m=!1,this.B=0}function ia(e){return aa(e,"audio")}function oa(e){return aa(e,"video")}function aa(e,t){var r=e.b.get(t);return r?r.Ka||r.stream:null}function sa(e,t){return p((function r(){var n,i,o,a,s,l,u,c,d;return M(r,(function(r){switch(r.j){case 1:return n=Yt,S(r,Cr(e.a.L,n.ra),2);case 2:return e.B++,e.D=!1,i=e.B,o=e.a.L,a=new Map,s=new Set,a.set(n.ra,t),s.add(t),S(r,o.init(a,!1),3);case 3:return e.f?r.return():S(r,ma(e,s),4);case 4:if(e.f)return r.return();l=e.a.L.g.isTextVisible()||e.g.alwaysStreamText,e.B!=i||e.b.has(n.ra)||e.D||!l||(u=e.a.Ua(),c=Ea(e,u),d=ha(t,c,0),e.b.set(n.ra,d),ka(e,d,0)),w(r)}}))}))}function la(e,t){var r=e.b.get("video");if(r){var n=r.stream;if(n)if(t){var i=n.trickModeVideo;i&&!r.Ka&&(ca(e,i,!1,0,!1),r.Ka=n)}else(n=r.Ka)&&(r.Ka=null,ca(e,n,!0,0,!1))}}function ua(e,t,r,n){var i=!1;if(t.video){var o=ca(e,t.video,r,n,!1);i=i||o}return t.audio&&(e=ca(e,t.audio,r,n,!1),i=i||e),i}function ca(e,t,r,n,i){var o=e.b.get(t.type);if(!o&&"text"==t.type&&e.g.ignoreTextStreamFailures)return sa(e,t),!0;if(!o)return!1;var a=Ta(e,t),s=Array.from(e.b.values()).every((function(e){return e.ia==o.ia}));return r&&a!=o.ia&&s?(e.b.forEach((function(t){da(e,t)})),!0):(o.Ka&&(t.trickModeVideo?(o.Ka=t,t=t.trickModeVideo):o.Ka=null),!(!(s=e.h[a])||!s.Db||!(s=e.i.get(t.id))||!s.Db||o.stream==t&&!i||("text"==t.type&&_r(e.a.L,qe(t.mimeType,t.codecs)),o.stream=t,o.nc=!0,function(e,t,r){if(!t.Rb)return!1;var n=e.a.Ua(),i=Tr(e.a.L,t.type),o=va(e,t,n,i,r);return r=o&&o.a?o.a-o.b:null,o&&!r&&(r=(o.endTime-o.kc())*t.stream.bandwidth/8),!isNaN(r)&&((o=t.stream.initSegmentReference)&&(r+=(o.a?o.a-o.b:null)||0),o=e.a.getBandwidthEstimate(),8*r/o<i-n-Math.max(e.c.minBufferTime||0,e.g.rebufferingGoal)||t.Rb.b.a>r)}(e,o,a)&&o.Rb.abort(),r&&(o.Ra?o.Cc=!0:o.Ja?(o.Oa=!0,o.dc=n,o.Cc=!0):(Ca(o),wa(e,o,!0,n).catch((function(t){e.a&&e.a.onError(t)})))),0)))}function da(e,t){t.Ra||t.Oa||(t.Ja?(t.Oa=!0,t.dc=0):null==Er(e.a.L,t.type)?null==t.Ga&&ka(e,t,0):(Ca(t),wa(e,t,!1,0).catch((function(t){e.a&&e.a.onError(t)}))))}function fa(e,t,r,n,i){return p((function o(){var a,s,l,u,c,d,f;return M(o,(function(o){switch(o.j){case 1:return a=e.a.Ua(),s=Ea(e,a),l=Yt,u=new Map,c=new Set,t&&(u.set(l.Eb,t),c.add(t)),r&&(u.set(l.Pa,r),c.add(r)),n&&(u.set(l.ra,n),c.add(n)),d=e.a.L,f=e.g.forceTransmuxTS,S(o,d.init(u,f),2);case 2:return e.f?o.return():(function(e){var t=e.c.presentationTimeline.Y();1/0>t?e.a.L.xa(t):e.a.L.xa(Math.pow(2,32))}(e),S(o,ma(e,c),3));case 3:if(e.f)return o.return();u.forEach((function(t,r){if(!e.b.has(r)){var n=ha(t,s,i);e.b.set(r,n),ka(e,n,0)}})),w(o)}}))}))}function ha(e,t,r){return{stream:e,type:e.type,sb:null,Da:null,Ka:null,nc:!0,ia:t,endOfStream:!1,Ja:!1,Ga:null,Oa:!1,dc:0,Cc:!1,Ra:!1,od:!1,Pb:!1,rd:r||0,Rb:null}}function pa(e,t){var r=e.h[t];if(r)return r.promise;r={promise:new ge,Db:!1},e.h[t]=r;for(var n=new Set,i=f(e.c.periods[t].variants),o=i.next();!o.done;o=i.next())(o=o.value).video&&n.add(o.video),o.video&&o.video.trickModeVideo&&n.add(o.video.trickModeVideo),o.audio&&n.add(o.audio);for(o=(i=f(e.c.periods[t].textStreams)).next();!o.done;o=i.next())n.add(o.value);return e.u=e.u.then(function(){if(!this.f)return ma(this,n)}.bind(e)).then(function(){this.f||(this.h[t].promise.resolve(),this.h[t].Db=!0)}.bind(e)).catch(function(e){this.f||(this.h[t].promise.catch((function(){})),this.h[t].promise.reject(),delete this.h[t],this.a.onError(e))}.bind(e)),r.promise}function ma(e,t){return p((function r(){var n,i,o,a,s,l,u;return M(r,(function(r){switch(r.j){case 1:n=[];for(var c=f(t),d=c.next();!d.done;d=c.next())i=d.value,(o=e.i.get(i.id))?n.push(o.promise):(e.i.set(i.id,{promise:new ge,Db:!1}),n.push(i.createSegmentIndex()));return k(r,2),S(r,Promise.all(n),4);case 4:if(e.f)return r.return();x(r,3);break;case 2:if(a=R(r),e.f)return r.return();for(d=(r=f(t)).next();!d.done;d=r.next())s=d.value,e.i.get(s.id).promise.catch((function(){})),e.i.get(s.id).promise.reject(),e.i.delete(s.id);throw a;case 3:for(d=(c=f(t)).next();!d.done;d=c.next())l=d.value,(u=e.i.get(l.id)).Db||(u.promise.resolve(),u.Db=!0);w(r)}}))}))}function ga(e,t){if(!e.f&&!t.Ja&&null!=t.Ga&&!t.Ra)if(t.Ga=null,t.Oa)wa(e,t,t.Cc,t.dc);else{try{var r=function(e,t){if(_a(t))return kr(e.a.L,t.stream.originalId||""),null;var r=e.a.Ua(),n=ya(e,t,r),i=Ta(e,t.stream),o=Ea(e,n),a=function(e,t,r){return"text"==t?null==(e=e.a).b||e.b<r?0:e.b-Math.max(r,e.a):Bt(e=Sr(e,t),r)}(e.a.L,t.type,r),s=Math.max(e.c.minBufferTime||0,e.g.rebufferingGoal,e.g.bufferingGoal)*e.l;if(n>=e.c.presentationTimeline.Y())return t.endOfStream=!0,"video"==t.type&&(n=e.b.get("text"))&&"application/cea-608"==n.stream.mimeType&&(n.endOfStream=!0),null;if(t.endOfStream=!1,t.ia=o,o!=i)return null;if(a>=s)return.5;if(o=Tr(e.a.L,t.type),!(o=va(e,t,r,o,i)))return 1;var l=1/0;return Array.from(e.b.values()).forEach((function(t){_a(t)||(t=ya(e,t,r),l=Math.min(l,t))})),n>=l+e.c.presentationTimeline.a?1:(t.rd=0,function(e,t,r,n,i){var o=e.c.periods[n],a=t.stream,s=e.c.presentationTimeline.Y(),l=e.c.periods[n+1];n=function(e,t,r,n,i){return t.nc?(r=function(e,t,r,n,i){return"text"==t?(e.a.m=r,(e=e.a).f=n,e.h=i,Promise.resolve()):Promise.all([xr(e,t,e.Be.bind(e,t)),xr(e,t,e.kg.bind(e,t,r)),xr(e,t,e.hg.bind(e,t,n,i))])}(e.a.L,t.type,e.c.periods[r].startTime-t.stream.presentationTimeOffset,n,i),t.stream.initSegmentReference?(e=Sa(e,t,t.stream.initSegmentReference).then(function(e){if(!this.f)return wr(this.a.L,t.type,e,null,null,t.stream.closedCaptions&&0<t.stream.closedCaptions.size)}.bind(e)).catch((function(e){return t.nc=!0,Promise.reject(e)})),Promise.all([r,e])):r):Promise.resolve()}(e,t,n,Math.max(0,o.startTime-.1),l?l.startTime+.01:s),t.Ja=!0,t.nc=!1,s=Sa(e,t,i),Promise.all([n,s]).then(function(e){if(!this.f&&!this.m)return function(e,t,r,n,i,o,a){var s=i.closedCaptions&&0<i.closedCaptions.size;return null!=i.emsgSchemeIdUris&&0<i.emsgSchemeIdUris.length&&(new In).fa("emsg",e.K.bind(e,n,o,i.emsgSchemeIdUris)).parse(a),function(e,t,r){var n=Math.max(e.g.bufferBehind,e.c.presentationTimeline.a),i=Er(e.a.L,t.type);return null==i||0>=(r=r-i-n)?Promise.resolve():e.a.L.remove(t.type,i,i+r).then(function(){}.bind(e))}(e,t,r).then(function(){if(!this.f)return wr(this.a.L,t.type,a,o.startTime+n.startTime,o.endTime+n.startTime,s)}.bind(e)).then(function(){if(!this.f)return t.sb=i,t.Da=o,Promise.resolve()}.bind(e))}(this,t,r,o,a,i,e[1])}.bind(e)).then(function(){this.f||this.m||(t.Ja=!1,t.od=!1,t.Oa||this.a.jd(),ka(this,t,0),function(e,t){if(!e.s){var r=Array.from(e.b.values());if(1==r.length&&"text"==r[0].type||(e.s=r.every((function(e){return"text"==e.type||!e.Oa&&!e.Ra&&e.Da}))),e.s){for(r=Ta(e,t),e.h[r]||pa(e,r).then(function(){this.f||this.a.$d()}.bind(e)).catch(Gt.oc),r=0;r<e.c.periods.length;++r)pa(e,r).catch(Gt.oc);e.a.Lf&&e.a.Lf()}}}(this,a))}.bind(e)).catch(function(e){this.f||this.m||(t.Ja=!1,"text"==t.type&&this.g.ignoreTextStreamFailures?this.b.delete("text"):7001==e.code?(t.Ja=!1,t.Ga=null,ka(this,t,0)):3017==e.code?function(e,t,r){if(!Array.from(e.b.values()).some((function(e){return e!=t&&e.od}))){var n=Math.round(100*e.l);if(20<n)e.l-=.2;else{if(!(4<n))return t.Pb=!0,e.m=!0,void e.a.onError(r);e.l-=.04}t.od=!0}ka(e,t,4)}(this,t,e):(t.Pb=!0,e.severity=2,xa(this,e)))}.bind(e))}(e,t,r,i,o),null)}(e,t);null!=r&&(ka(e,t,r),t.Pb=!1)}catch(t){return void xa(e,t)}r=Array.from(e.b.values()),function(e,t){var r=Ta(e,t.stream);if(t.ia!=r){var n=t.ia,i=Array.from(e.b.values());i.every((function(e){return e.ia==n||_a(e)}))&&i.every(Aa)&&pa(e,n).then(function(){if(!this.f&&i.every(function(e){var t=Aa(e),r=Ta(this,e.stream);return!!_a(e)||t&&e.ia==n&&r!=n}.bind(this))){var e=this.c.periods[n],t=this.a.ae(e),r=new Map;t.variant&&t.variant.video&&r.set("video",t.variant.video),t.variant&&t.variant.audio&&r.set("audio",t.variant.audio),t.text&&r.set("text",t.text);for(var o=(t=f(this.b.keys())).next();!o.done;o=t.next())if(o=o.value,!r.has(o)&&"text"!=o)return void this.a.onError(new me(2,5,5005));for(o=(t=f(Array.from(r.keys()))).next();!o.done;o=t.next())if(o=o.value,!this.b.has(o)){if("text"!=o)return void this.a.onError(new me(2,5,5005));fa(this,null,null,r.get("text"),e.startTime),r.delete(o)}for(o=(t=f(Array.from(this.b.keys()))).next();!o.done;o=t.next()){o=o.value;var a=this.b.get(o),s=r.get(o);if(s){var l=_a(a);l&&(a.ia=n,a.rd=e.startTime),ca(this,s,!1,0,!1),l&&_a(a)||ka(this,this.b.get(o),0)}else this.b.delete(o)}this.a.$d()}}.bind(e)).catch(Gt.oc)}}(e,t),e.s&&r.every((function(e){return e.endOfStream}))&&e.a.L.endOfStream().then(function(){if(!this.f){var e=this.a.L.Y();0!=e&&e<this.c.presentationTimeline.Y()&&this.c.presentationTimeline.xa(e)}}.bind(e))}}function ya(e,t,r){return t.sb&&t.Da?(r=Ta(e,t.sb),e.c.periods[r].startTime+t.Da.endTime):Math.max(r,t.rd)}function va(e,t,r,n,i){if(t.Da&&t.stream==t.sb)return ba(e,t,i,t.Da.position+1);if(t.Da?(r=Ta(e,t.sb),r=t.stream.findSegmentPosition(Math.max(0,e.c.periods[r].startTime+t.Da.endTime-e.c.periods[i].startTime))):r=t.stream.findSegmentPosition(Math.max(0,(n||r)-e.c.periods[i].startTime)),null==r)return null;var o=null;return null==n&&(o=ba(e,t,i,Math.max(0,r-1))),o||ba(e,t,i,r)}function ba(e,t,r,n){return r=e.c.periods[r],(t=t.stream.getSegmentReference(n))?(e=(n=e.c.presentationTimeline).Ob(),n=n.pb(),r.startTime+t.endTime<e||r.startTime+t.startTime>n?null:t):null}function _a(e){return e&&"text"==e.type&&"application/cea-608"==e.stream.mimeType}function Aa(e){return!e.Ja&&null==e.Ga&&!e.Oa&&!e.Ra}function Ea(e,t){var r=Mo(e.c.periods,t+1/15);return r?e.c.periods.indexOf(r):0}function Ta(e,t){for(var r=e.c.periods,n=0;n<r.length;n++){for(var i=r[n],o=new Set,a=f(i.variants),s=a.next();!s.done;s=a.next())(s=s.value).audio&&o.add(s.audio),s.video&&o.add(s.video),s.video&&s.video.trickModeVideo&&o.add(s.video.trickModeVideo);for(a=(i=f(i.textStreams)).next();!a.done;a=i.next())o.add(a.value);if(o.has(t))return n}return-1}function Sa(e,t,r){return r=vi(r.c(),r.b,r.a,e.g.retryParameters),e=e.a.ub.request(1,r),t.Rb=e,e.promise.then((function(e){return t.Rb=null,e.data}))}function wa(e,t,r,n){return p((function i(){var o,a,s;return M(i,(function(i){switch(i.j){case 1:return t.Oa=!1,t.Cc=!1,t.dc=0,t.Ra=!0,n?(a=e.a.Ua(),s=e.a.L.Y(),o=e.a.L.remove(t.type,a+n,s)):o=Cr(e.a.L,t.type).then(function(){if(!this.f&&r)return this.a.L.flush(t.type)}.bind(e)),S(i,o,2);case 2:if(e.f)return i.return();t.sb=null,t.Da=null,t.Ra=!1,t.endOfStream=!1,ka(e,t,0),w(i)}}))}))}function ka(e,t,r){t.Ga=new de((function(){return p((function r(){var n;return M(r,(function(r){switch(r.j){case 1:return k(r,2),S(r,ga(e,t),4);case 4:x(r,0);break;case 2:n=R(r),e.a&&e.a.onError(n),w(r)}}))}))})).R(r)}function Ca(e){null!=e.Ga&&(e.Ga.stop(),e.Ga=null)}function xa(e,t){pe(e.F).then(function(){this.f||(this.a.onError(t),t.handled||this.g.failureCallback(t))}.bind(e))}function Ra(e,t,r,n,i,o){if(200<=r&&299>=r&&202!=r)return{uri:i||n,ld:n,data:t,headers:e,fromCache:!!e["x-shaka-from-cache"]};i=null;try{i=lt(t)}catch(e){}throw new me(401==r||403==r?2:1,1,1001,n,r,i,e,o)}function La(e,t,r,n){var i=new La.b;We(t.headers).forEach((function(e,t){i.append(t,e)}));var o=new La.a,a={Id:!1,te:!1};if(e=new ye(e=La.l(e,r,{body:t.body||void 0,headers:i,method:t.method,signal:o.signal,credentials:t.allowCrossSiteCredentials?"include":void 0},a,n),(function(){return a.Id=!0,o.abort(),Promise.resolve()})),t=t.retryParameters.timeout){var s=new fe((function(){a.te=!0,o.abort()}));s.R(t/1e3),e.finally((function(){s.stop()}))}return e}function ja(e,t,r,n){var i=new ja.f,o=Date.now(),a=0;return new ye(new Promise((function(s,l){for(var u in i.open(t.method,e,!0),i.responseType="arraybuffer",i.timeout=t.retryParameters.timeout,i.withCredentials=t.allowCrossSiteCredentials,i.onabort=function(){l(new me(1,1,7001,e,r))},i.onload=function(t){for(var n=(t=t.target).getAllResponseHeaders().trim().split("\r\n"),i={},o=(n=f(n)).next();!o.done;o=n.next())i[(o=o.value.split(": "))[0].toLowerCase()]=o.slice(1).join(": ");try{var a=Ra(i,t.response,t.status,e,t.responseURL,r);s(a)}catch(e){l(e)}},i.onerror=function(t){l(new me(1,1,1002,e,t,r))},i.ontimeout=function(){l(new me(1,1,1003,e,r))},i.onprogress=function(e){var t=Date.now();(100<t-o||e.lengthComputable&&e.loaded==e.total)&&(n(t-o,e.loaded-a,e.total-e.loaded),a=e.loaded,o=t)},t.headers)i.setRequestHeader(u.toLowerCase(),t.headers[u]);i.send(t.body)})),(function(){return i.abort(),Promise.resolve()}))}function Pa(){this.a=this.f=this.b=0,this.c=new Map,this.g=0}function Ia(e,t,r){this.h=e,this.b=new Map,this.c=!1,this.g=t,this.f=r,this.a=new Pa}function Oa(e,t,r,n,i,o){var a=function(e,t){e.b+=t;var r=e.g;return e.g++,e.c.set(r,t),r}(e.a,n);n=e.b.get(t)||Promise.resolve(),e.b.set(t,n.then((function(){return p((function t(){var n,s,l,u,c,d;return M(t,(function(t){switch(t.j){case 1:return S(t,function(e,t){return p((function r(){var n;return M(r,(function(r){switch(r.j){case 1:return S(r,e.h.request(1,t).promise,2);case 2:return n=r.o,r.return(n.data)}}))}))}(e,r),2);case 2:if(n=t.o,e.c)throw new me(2,9,7001);if(i)for(var f in s=new Uint8Array(n),(l=new Un(s)).data)u=Number(f),c=l.data[u],d=l.a[u],e.f(c,d);return e.a.close(a,n.byteLength),f=e.a,e.g(0==f.b?0:f.f/f.b,e.a.a),t.return(o(n))}}))}))})))}function Da(e,t){var r=this;this.c=e,this.b=e.objectStore(t),this.a=new ge,e.onabort=function(e){e.preventDefault(),r.a.reject()},e.onerror=function(e){e.preventDefault(),r.a.reject()},e.oncomplete=function(){r.a.resolve()}}function Ma(e,t){return new Promise((function(r,n){var i=e.b.openCursor();i.onerror=n,i.onsuccess=function(e){if(!(e=e.target.result))return r();t(e.key,e.value,e),e.continue()}}))}function Na(e){this.b=e,this.a=[]}function Fa(e,t){return Ua(e,t,"readwrite")}function Ua(e,t,r){var n=new Da(r=e.b.transaction([t],r),t);return e.a.push(n),n.promise().then((function(){Re(e.a,n)}),(function(){Re(e.a,n)})),n}function Ba(e,t,r){this.b=new Na(e),this.c=t,this.a=r}function Ka(e){return Promise.reject(new me(2,9,9011,"Cannot add new value to "+e))}function Ga(e,t,r,n){t=(e=Fa(e.b,t)).store();for(var i={},o=(r=f(r)).next();!o.done;i={key:i.key},o=r.next())i.key=o.value,t.delete(i.key).onsuccess=function(e){return function(){return n(e.key)}}(i);return e.promise()}function Va(e,t,r){return p((function n(){var i,o,a,s,l,u,c;return M(n,(function(n){switch(n.j){case 1:for(i=Ua(e.b,t,"readonly"),o=i.store(),a={},s=[],l={},u=f(r),c=u.next();!c.done;l={request:l.request,key:l.key},c=u.next())l.key=c.value,l.request=o.get(l.key),l.request.onsuccess=function(e){return function(){null==e.request.result&&s.push(e.key),a[e.key]=e.request.result}}(l);return S(n,i.promise(),2);case 2:if(s.length)throw new me(2,9,9012,"Could not find values for "+s);return n.return(r.map((function(e){return a[e]})))}}))}))}function Ha(e){this.a=new Na(e)}function Ya(){this.a=new Map}function za(e,t,r){if(!(e=e.a.get(t)))throw new me(2,9,9013,"Could not find mechanism with name "+t);if(!(t=e.getCells().get(r)))throw new me(2,9,9013,"Could not find cell with name "+r);return t}function Wa(e,t){$a.set(e,t)}na.prototype.destroy=function(){for(var e=f(this.b.values()),t=e.next();!t.done;t=e.next())Ca(t.value);return this.b.clear(),this.i.clear(),this.g=this.h=this.u=this.c=this.a=null,this.f=!0,Promise.resolve()},na.prototype.configure=function(e){this.g=e,this.F=new he({maxAttempts:Math.max(e.retryParameters.maxAttempts,2),baseDelay:e.retryParameters.baseDelay,backoffFactor:e.retryParameters.backoffFactor,fuzzFactor:e.retryParameters.fuzzFactor,timeout:0},!0)},na.prototype.start=function(){var e=this;return p((function t(){var r,n,i;return M(t,(function(t){switch(t.j){case 1:return r=e.a.Ua(),n=Ea(e,r),(i=e.a.ae(e.c.periods[n])).variant||i.text?S(t,fa(e,i.variant?i.variant.audio:null,i.variant?i.variant.video:null,i.text,r),2):t.return(new me(2,5,5005));case 2:if(e.f)return t.return();e.a&&e.a.Cf&&e.a.Cf(),w(t)}}))}))},na.prototype.K=function(e,t,r,n){var i=n.reader.md(),o=n.reader.md(),a=n.reader.G(),s=n.reader.G(),l=n.reader.G(),u=n.reader.G();n=n.reader.Za(n.reader.J.byteLength-n.reader.ca()),e=e.startTime+t.startTime+s/a,r.includes(i)&&("urn:mpeg:dash:event:2012"==i?this.a.Df():this.a.onEvent(new Se("emsg",{detail:{startTime:e,endTime:e+l/a,schemeIdUri:i,value:o,timescale:a,presentationTimeDelta:s,eventDuration:l,id:u,messageData:n}})))},G("shaka.net.HttpFetchPlugin",La),La.l=function(e,t,r,n,i){return p((function o(){var a,s,l,u,c,d,f,h,m,g,y,v;return M(o,(function(o){switch(o.j){case 1:return a=La.g,s=La.c,d=c=0,f=Date.now(),k(o,2),S(o,a(e,r),4);case 4:return l=o.o,h=l.clone().body.getReader(),g=(m=l.headers.get("Content-Length"))?parseInt(m,10):0,new s({start:function(e){!function t(){return p((function r(){var n,o;return M(r,(function(r){switch(r.j){case 1:return k(r,2),S(r,h.read(),4);case 4:n=r.o,x(r,3);break;case 2:return R(r),r.return();case 3:n.done||(c+=n.value.byteLength),(100<(o=Date.now())-f||n.done)&&(i(o-f,c-d,g-c),d=c,f=o),n.done?e.close():(e.enqueue(n.value),t()),w(r)}}))}))}()}}),S(o,l.arrayBuffer(),5);case 5:u=o.o,x(o,3);break;case 2:if(y=R(o),n.Id)throw new me(1,1,7001,e,t);if(n.te)throw new me(1,1,1003,e,t);throw new me(1,1,1002,e,y,t);case 3:return v={},l.headers.forEach((function(e,t){v[t.trim()]=e})),o.return(Ra(v,u,l.status,e,l.url,t))}}))}))},La.isSupported=function(){if(!e.ReadableStream)return!1;try{new ReadableStream({})}catch(e){return!1}return!(!e.fetch||!e.AbortController)},La.isSupported=La.isSupported,La.g=e.fetch,La.a=e.AbortController,La.c=e.ReadableStream,La.b=e.Headers,La.isSupported()&&(De("http",La,2),De("https",La,2)),G("shaka.net.HttpXHRPlugin",ja),ja.f=e.XMLHttpRequest,De("http",ja,1),De("https",ja,1),Pa.prototype.close=function(e,t){if(this.c.has(e)){var r=this.c.get(e);this.c.delete(e),this.f+=r,this.a+=t}},Ia.prototype.destroy=function(){return this.c=!0,Promise.all(this.b.values()).then((function(){}),(function(){}))},Da.prototype.abort=function(){try{this.c.abort()}catch(e){}return this.a.catch((function(){}))},Da.prototype.store=function(){return this.b},Da.prototype.promise=function(){return this.a},Na.prototype.destroy=function(){return Promise.all(this.a.map((function(e){return e.abort()})))},(n=Ba.prototype).destroy=function(){return this.b.destroy()},n.hasFixedKeySpace=function(){return!0},n.addSegments=function(){return Ka(this.c)},n.removeSegments=function(e,t){return Ga(this,this.c,e,t)},n.getSegments=function(e){var t=this;return p((function r(){var n;return M(r,(function(r){switch(r.j){case 1:return S(r,Va(t,t.c,e),2);case 2:return n=r.o,r.return(n.map((function(e){return t.Jd(e)})))}}))}))},n.addManifests=function(){return Ka(this.a)},n.updateManifestExpiration=function(e,t){var r=Fa(this.b,this.a),n=r.store();return n.get(e).onsuccess=function(r){(r=r.target.result)&&(r.expiration=t,n.put(r,e))},r.promise()},n.removeManifests=function(e,t){return Ga(this,this.a,e,t)},n.getManifests=function(e){var t=this;return p((function r(){var n;return M(r,(function(r){switch(r.j){case 1:return S(r,Va(t,t.a,e),2);case 2:return n=r.o,r.return(n.map((function(e){return t.ec(e)})))}}))}))},n.getAllManifests=function(){var e=this;return p((function t(){var r,n;return M(t,(function(t){switch(t.j){case 1:return r=Ua(e.b,e.a,"readonly"),n=new Map,S(t,Ma(r,(function(t,r){n.set(t,e.ec(r))})),2);case 2:return S(t,r.promise(),3);case 3:return t.return(n)}}))}))},n.Jd=function(e){return e},n.ec=function(e){return e},n.add=function(e,t){var r=this;return p((function n(){var i,o,a,s;return M(n,(function(n){switch(n.j){case 1:i=Fa(r.b,e),o=i.store(),a=[];for(var l=f(t),u=l.next();!u.done;u=l.next())s=u.value,o.add(s).onsuccess=function(e){a.push(e.target.result)};return S(n,i.promise(),2);case 2:return n.return(a)}}))}))},Ha.prototype.destroy=function(){return this.a.destroy()},Ha.prototype.getAll=function(){var e=this;return p((function t(){var r,n;return M(t,(function(t){switch(t.j){case 1:return r=Ua(e.a,"session-ids","readonly"),n=[],S(t,Ma(r,(function(e,t){n.push(t)})),2);case 2:return S(t,r.promise(),3);case 3:return t.return(n)}}))}))},Ha.prototype.add=function(e){for(var t=Fa(this.a,"session-ids"),r=t.store(),n=(e=f(e)).next();!n.done;n=e.next())r.add(n.value);return t.promise()},Ha.prototype.remove=function(e){var t=this;return p((function r(){var n;return M(r,(function(r){switch(r.j){case 1:return S(r,Ma(n=Fa(t.a,"session-ids"),(function(t,r,n){0<=e.indexOf(r.sessionId)&&n.delete()})),2);case 2:return S(r,n.promise(),0)}}))}))},Ya.prototype.destroy=function(){for(var e=[],t=f(this.a.values()),r=t.next();!r.done;r=t.next())e.push(r.value.destroy());return this.a.clear(),Promise.all(e)},Ya.prototype.init=function(){var e=this;$a.forEach((function(t,r){var n=t();n&&e.a.set(r,n)}));for(var t=[],r=f(this.a.values()),n=r.next();!n.done;n=r.next())t.push(n.value.init());return Promise.all(t)},Ya.prototype.erase=function(){var e=this;return p((function t(){var r,n;return M(t,(function(t){switch(t.j){case 1:return r=Array.from(e.a.values()),(n=0<r.length)||$a.forEach((function(e){(e=e())&&r.push(e)})),S(t,Promise.all(r.map((function(e){return e.erase()}))),2);case 2:if(!n)return S(t,Promise.all(r.map((function(e){return e.destroy()}))),0);t.A(0)}}))}))},G("shaka.offline.StorageMuxer.register",Wa),G("shaka.offline.StorageMuxer.unregister",(function(e){$a.delete(e)}));var $a=new Map;function qa(e){Ba.apply(this,arguments)}function Xa(e){return function(e){var t=e.streams.filter((function(e){return"audio"==e.contentType})),r=e.streams.filter((function(e){return"video"==e.contentType}));if(!t.every((function(e){return e.variantIds}))||!r.every((function(e){return e.variantIds}))){t.forEach((function(e){e.variantIds=[]})),r.forEach((function(e){e.variantIds=[]}));var n=0;if(r.length&&!t.length){var i=n++;r.forEach((function(e){e.variantIds.push(i)}))}if(!r.length&&t.length){var o=n++;t.forEach((function(e){e.variantIds.push(o)}))}r.length&&t.length&&t.forEach((function(e){r.forEach((function(t){var r=n++;e.variantIds.push(r),t.variantIds.push(r)}))}))}}(e),e.streams.forEach((function(){})),{startTime:e.startTime,streams:e.streams.map(Ja)}}function Ja(e){var t=e.initSegmentUri?Qa(e.initSegmentUri):null;return{id:e.id,originalId:null,primary:e.primary,presentationTimeOffset:e.presentationTimeOffset,contentType:e.contentType,mimeType:e.mimeType,codecs:e.codecs,frameRate:e.frameRate,pixelAspectRatio:void 0,kind:e.kind,language:e.language,label:e.label,width:e.width,height:e.height,initSegmentKey:t,encrypted:e.encrypted,keyId:e.keyId,segments:e.segments.map(Za),variantIds:e.variantIds}}function Za(e){var t=Qa(e.uri);return{startTime:e.startTime,endTime:e.endTime,dataKey:t}}function Qa(e){var t;if((t=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(e))||(t=/^offline:segment\/([0-9]+)$/.exec(e)))return Number(t[1]);throw new me(2,9,9004,"Could not parse uri "+e)}function es(e,t,r,n){Ba.call(this,e,t,r),this.f=n}function ts(){this.g=this.c=this.b=this.a=this.f=null}function rs(e,t,r,n){this.a=e,this.g=t,this.f=r,this.c=n,this.b=["offline:",e,"/",t,"/",r,"/",n].join("")}function ns(e){if(null==(e=/^offline:([a-z]+)\/([^/]+)\/([^/]+)\/([0-9]+)$/.exec(e)))return null;var t=e[1];if("manifest"!=t&&"segment"!=t)return null;var r=e[2];if(!r)return null;var n=e[3];return n&&null!=t?new rs(t,r,n,Number(e[4])):null}function is(e,t){this.b=e,this.a=t}function os(e,t,r){var n=t.streams.filter((function(e){return"audio"==e.contentType})),i=t.streams.filter((function(e){return"video"==e.contentType}));return n=function(e,t,r){for(var n=new Set,i=f(t),o=i.next();!o.done;o=i.next()){var a=f(o.value.variantIds);for(o=a.next();!o.done;o=a.next())n.add(o.value)}for(i=f(r),o=i.next();!o.done;o=i.next())for(a=f(o.value.variantIds),o=a.next();!o.done;o=a.next())n.add(o.value);for(i=new Map,n=f(n),o=n.next();!o.done;o=n.next())o=o.value,i.set(o,{id:o,language:"",primary:!1,audio:null,video:null,bandwidth:0,drmInfos:[],allowedByApplication:!0,allowedByKeySystem:!0});for(t=f(t),n=t.next();!n.done;n=t.next())for(n=n.value,o=as(e,n),a=f(n.variantIds),n=a.next();!n.done;n=a.next())(n=i.get(n.value)).language=o.language,n.primary=n.primary||o.primary,n.audio=o;for(r=f(r),t=r.next();!t.done;t=r.next())for(n=t.value,t=as(e,n),o=f(n.variantIds),n=o.next();!n.done;n=o.next())(n=i.get(n.value)).primary=n.primary||t.primary,n.video=t;return i}(e,n,i),i=t.streams.filter((function(e){return"text"==e.contentType})).map((function(t){return as(e,t)})),t.streams.forEach((function(n){n=n.segments.map((function(t,r){return ss(e,r,t)})),r.vb(n,t.startTime)})),{startTime:t.startTime,variants:Array.from(n.values()),textStreams:i}}function as(e,t){var r=t.segments.map((function(t,r){return ss(e,r,t)})),n=new ei(r);return r={id:t.id,originalId:t.originalId,createSegmentIndex:function(){return Promise.resolve()},findSegmentPosition:function(e){return n.find(e)},getSegmentReference:function(e){return n.get(e)},initSegmentReference:null,presentationTimeOffset:t.presentationTimeOffset,mimeType:t.mimeType,codecs:t.codecs,width:t.width||void 0,height:t.height||void 0,frameRate:t.frameRate||void 0,pixelAspectRatio:t.pixelAspectRatio||void 0,kind:t.kind,encrypted:t.encrypted,keyId:t.keyId,language:t.language,label:t.label||null,type:t.contentType,primary:t.primary,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,audioSamplingRate:null,closedCaptions:null},null!=t.initSegmentKey&&(r.initSegmentReference=function(e,t){var r=new rs("segment",e.b,e.a,t);return new Jn((function(){return[r.toString()]}),0,null)}(e,t.initSegmentKey)),r}function ss(e,t,r){var n=new rs("segment",e.b,e.a,r.dataKey);return new Zn(t,r.startTime,r.endTime,(function(){return[n.toString()]}),0,null)}function ls(){this.a=null}function us(e){var t=ns(e);return t&&"manifest"==t.a?us.h(e):t&&"segment"==t.a?us.i(t.key(),t):ve(new me(2,1,9004,e))}function cs(e,t,r){return p((function n(){var i,o,a,s,l,u;return M(n,(function(n){switch(n.j){case 1:i=[];for(var c=[],d=f(r),h=d.next();!h.done;h=d.next()){h=h.value;for(var m=!1,g=f(c),y=g.next();!y.done;y=g.next())if(ds((y=y.value).info,h)){y.sessionIds.push(h.sessionId),m=!0;break}m||c.push({info:h,sessionIds:[h.sessionId]})}o=f(c),a=o.next();case 2:if(a.done){n.A(4);break}return s=a.value,l=function(e,t,r){return p((function n(){var i,o;return M(n,(function(n){switch(n.j){case 1:return i=new pt({ub:t,onError:function(){},qc:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),k(n,2),i.configure(e),S(n,function(e,t,r,n,i,o){var a=new Map;return a.set(t,{audioCapabilities:i,videoCapabilities:o,distinctiveIdentifier:"optional",persistentState:"required",sessionTypes:["persistent-license"],label:t,drmInfos:[{keySystem:t,licenseServerUri:r,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:n,initData:null,keyIds:null}]}),Tt(e,a)}(i,r.info.keySystem,r.info.licenseUri,r.info.serverCertificate,r.info.audioCapabilities,r.info.videoCapabilities),4);case 4:x(n,3);break;case 2:return R(n),S(n,i.destroy(),5);case 5:return n.return([]);case 3:return k(n,6),S(n,yt(i),8);case 8:x(n,7);break;case 6:return R(n),S(n,i.destroy(),9);case 9:return n.return([]);case 7:return o=[],S(n,Promise.all(r.sessionIds.map((function(e){return p((function t(){return M(t,(function(t){switch(t.j){case 1:return k(t,2),S(t,function(e,t){return p((function r(){var n,i,o;return M(r,(function(r){switch(r.j){case 1:return S(r,St(e,t),2);case 2:return(n=r.o)?(i=[],(o=e.b.get(n))&&(o.ya=new ge,i.push(o.ya)),i.push(n.remove()),S(r,Promise.all(i),0)):r.return()}}))}))}(i,e),4);case 4:o.push(e),x(t,0);break;case 2:R(t),w(t)}}))}))}))),10);case 10:return S(n,i.destroy(),11);case 11:return n.return(o)}}))}))}(e,t,s),S(n,l,5);case 5:u=n.o,i=i.concat(u),a=o.next(),n.A(2);break;case 4:return n.return(i)}}))}))}function ds(e,t){function r(e,t){return e.robustness==t.robustness&&e.contentType==t.contentType}return e.keySystem==t.keySystem&&e.licenseUri==t.licenseUri&&Le(e.audioCapabilities,t.audioCapabilities,r)&&Le(e.videoCapabilities,t.videoCapabilities,r)}function fs(e,t){var r={Aa:null,v:null,mimeType:null,startTime:null,zd:null,uri:null},n=this;this.g=t,this.c=e,this.i=r,this.h=null,this.f=[],this.b=this.a=null,this.l=!0,this.m=Promise.resolve().then((function(){return function(e){return p((function t(){return M(t,(function(t){switch(t.j){case 1:if(e.l){if(0==e.f.length||e.a&&!e.a.Va)var r=!1;else{e.a&&(e.a.va.Ya(),e.a=null);var n=(r=e.f.shift()).create(e.i);n?(r.va.wb(),e.a={node:n.node,payload:n.payload,Va:n.Va,va:r.va}):r.va.rc(),r=!0}return r?r=Promise.resolve():e.a?r=function(e){return p((function t(){var r,n;return M(t,(function(t){switch(t.j){case 1:return e.c=e.g.cf(e.c,e.i,e.a.node,e.a.payload),k(t,2),e.b=e.g.Le(e.c,e.i,e.a.payload),S(t,e.b.promise,4);case 4:e.b=null,e.c==e.a.node&&(e.a.va.pc(),e.a=null),x(t,0);break;case 2:return 7001==(r=R(t)).code?e.a.va.Ya():e.a.va.onError(r),e.a=null,e.b=null,n=e,S(t,e.g.handleError(e.i,r),5);case 5:n.c=t.o,w(t)}}))}))}(e):(e.g.Bf(e.c),e.h=new ge,r=e.h),S(t,r,1)}t.A(0)}}))}))}(n)}))}function hs(e,t){var r={wb:function(){},pc:function(){},Ya:function(){},onError:function(){},rc:function(){},Jg:function(){}};return e.f.push({create:t,va:r}),e.b&&e.b.abort(),ps(e),r}function ps(e){e.h&&(e.h.resolve(),e.h=null)}function ms(e){this.a=null;for(var t=0;t<e.textTracks.length;++t){var r=e.textTracks[t];r.mode="disabled","Shaka Player TextTrack"==r.label&&(this.a=r)}this.a||(this.a=e.addTextTrack("subtitles","Shaka Player TextTrack")),this.a.mode="hidden"}function gs(e){if(e.startTime>=e.endTime)return null;var t=new VTTCue(e.startTime,e.endTime,e.payload);t.lineAlign=e.lineAlign,t.positionAlign=e.positionAlign,t.size=e.size;try{t.align=e.textAlign}catch(e){}return"center"==e.textAlign&&"center"!=t.align&&(t.align="middle"),"vertical-lr"==e.writingMode?t.vertical="lr":"vertical-rl"==e.writingMode&&(t.vertical="rl"),1==e.lineInterpretation&&(t.snapToLines=!1),null!=e.line&&(t.line=e.line),null!=e.position&&(t.position=e.position),t}function ys(e,t){var r=e.mode;e.mode="showing"==r?"showing":"hidden";for(var n=e.cues,i=n.length-1;0<=i;i--){var o=n[i];o&&t(o)&&e.removeCue(o)}e.mode=r}function vs(e,t,r,n,i){var o,a=i in n,s=!0;for(o in t){var l=i+"."+o,u=a?n[i]:r[o];a||o in r?void 0===t[o]?void 0===u||a?delete e[o]:e[o]=Ce(u):u.constructor==Object&&t[o]&&t[o].constructor==Object?(e[o]||(e[o]=Ce(u)),l=vs(e[o],t[o],u,n,l),s=s&&l):typeof t[o]!=typeof u||null==t[o]||"function"!=typeof t[o]&&t[o].constructor!=u.constructor?($("Invalid config, wrong type for "+l),s=!1):("function"==typeof r[o]&&r[o].length!=t[o].length&&q("Unexpected number of arguments for "+l),e[o]=t[o]):($("Invalid config, unrecognized key "+l),s=!1)}return s}function bs(e,t){for(var r={},n=r,i=0,o=0;!(0>(i=e.indexOf(".",i)));)0!=i&&"\\"==e[i-1]||(n[o=e.substring(o,i).replace(/\\\./g,".")]={},n=n[o],o=i+1),i+=1;return n[e.substring(o).replace(/\\\./g,".")]=t,r}function _s(){}function As(){var e=5e5,t=1/0;navigator.connection&&(e=1e6*navigator.connection.downlink,navigator.connection.saveData&&(t=360));var r={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0},servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,initDataTransform:kt,fairPlayTransform:!0},n={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0},availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,dash:{customScheme:function(e){if(e)return null},clockSyncUri:"",ignoreDrmInfo:!1,xlinkFailGracefully:!1,defaultPresentationDelay:10,ignoreMinBufferTime:!1,autoCorrectDrift:!0,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1},hls:{ignoreTextStreamFailures:!1}},i={retryParameters:{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0},failureCallback:function(e){return[e]},rebufferingGoal:2,bufferingGoal:10,bufferBehind:30,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,smallGapLimit:.5,jumpLargeGaps:!1,durationBackoff:1,forceTransmuxTS:!1,safeSeekOffset:5,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsOnSafari:!0};rt("Web0S")&&(i.stallEnabled=!1);var o={trackSelectionCallback:function(e){return p((function t(){return M(t,(function(t){switch(t.j){case 1:return t.return(e)}}))}))},progressCallback:function(e,t){return[e,t]},usePersistentLicense:!0},a={drm:r,manifest:n,streaming:i,offline:o,abrFactory:Fr,abr:{enabled:!0,defaultBandwidthEstimate:e,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:t,minPixels:0,maxPixels:1/0,minFrameRate:0,maxFrameRate:1/0,minBandwidth:0,maxBandwidth:1/0}},preferredAudioLanguage:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,minPixels:0,maxPixels:1/0,minFrameRate:0,maxFrameRate:1/0,minBandwidth:0,maxBandwidth:1/0},playRangeStart:0,playRangeEnd:1/0,textDisplayFactory:function(){return null}};return o.trackSelectionCallback=function(e){return p((function t(){return M(t,(function(t){switch(t.j){case 1:return t.return(function(e,t){var r=e.filter((function(e){return"variant"==e.type})),n=[],i=Dr(t,r.map((function(e){return e.language})));i&&(n=r.filter((function(e){return Ir(e.language)==i}))),0==n.length&&(n=r.filter((function(e){return e.primary}))),0==n.length&&(r.map((function(e){return e.language})),n=r);var o=n.filter((function(e){return e.height&&480>=e.height}));if(o.length&&(o.sort((function(e,t){return t.height-e.height})),n=o.filter((function(e){return e.height==o[0].height}))),r=[],n.length){var a=Math.floor(n.length/2);n.sort((function(e,t){return e.bandwidth-t.bandwidth})),r.push(n[a])}for(n=f(e),a=n.next();!a.done;a=n.next())"text"==(a=a.value).type&&r.push(a);return r}(e,a.preferredAudioLanguage))}}))}))},a}function Es(e,t,r){var n={".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:"",audioRobustness:"",serverCertificate:new Uint8Array(0),individualizationServer:""}};return vs(e,t,r||As(),n,"")}function Ts(){this.a=null,this.b=[]}function Ss(e,t){if(null==e.a)e.a={timestamp:Date.now()/1e3,state:t,duration:0};else{var r=Date.now()/1e3;e.a.duration=r-e.a.timestamp,e.a.state!=t&&(e.b.push(e.a),e.a={timestamp:r,state:t,duration:0})}}function ws(e,t){var r=0;e.a&&e.a.state==t&&(r+=e.a.duration);for(var n=f(e.b),i=n.next();!i.done;i=n.next())r+=(i=i.value).state==t?i.duration:0;return r}function ks(){this.b=this.c=null,this.a=[]}function Cs(){this.f=this.s=this.h=this.b=this.i=this.l=this.m=this.g=this.u=NaN,this.a=new Ts,this.c=new ks}function xs(t,r){var n=this;ke.call(this),this.i=pl,this.a=null,this.gb=!1,this.g=new Be,this.Dc=this.l=this.Fb=this.b=this.s=this.f=this.Yb=this.B=this.Zb=this.W=this.ib=this.m=this.D=this.h=this.K=null,this.Xd=1e9,this.ac=new Set,this.kb=!0,this.pa=null,this.Ud=!1,this.Rd=0,this.oa=null,this.$=new po,this.c=Fs(this),this.bc={width:1/0,height:1/0},this.u=null,this.Gb=new To(this.c.preferredAudioLanguage,this.c.preferredVariantRole,this.c.preferredAudioChannelCount),this.na=this.c.preferredTextLanguage,this.fb=this.c.preferredTextRole,r&&r(this),this.K=function(e){return new Ie((function(t,r){e.l&&e.l.segmentDownloaded(t,r)}))}(this),this.g.w(e,"online",(function(){n.sd()})),this.F={name:"detach"},this.O={name:"attach"},this.Ha={name:"unload"},this.Mc={name:"manifest-parser"},this.Kc={name:"manifest"},this.hb={name:"media-source"},this.Ec={name:"drm-engine"},this.S={name:"load"},this.Rc={name:"src-equals-drm-engine"},this.jb={name:"src-equals"};var i=new Map;i.set(this.O,(function(e,t){return Ae(function(e,t,r){return null==t.v&&(t.v=r.v,e.g.w(t.v,"error",(function(){var t=el(e);t&&e.Ma(t)}))),e.a=t.v,Promise.resolve()}(n,e,t))})),i.set(this.F,(function(e){return e.v&&(n.g.ea(e.v,"error"),e.v=null),n.a=null,Ae(e=Promise.resolve())})),i.set(this.Ha,(function(e){return Ae(Ps(n,e))})),i.set(this.hb,(function(t){return Ae(t=function(t,r){return p((function n(){var i,o,a,s;return M(n,(function(n){switch(n.j){case 1:return i=e.muxjs?new Mt:new Nt,o=t.c.textDisplayFactory,a=new o,t.Fc=o,S(n,(s=new yr(r.v,i,a)).s,2);case 2:t.D=s,w(n)}}))}))}(n,t))})),i.set(this.Mc,(function(e,t){return Ae(function(e,t,r){return p((function n(){var i,o,a,s;return M(n,(function(n){switch(n.j){case 1:if(t.Aa=r.Aa,t.mimeType=r.mimeType,t.uri=r.uri,i=t.uri,o=e.K,e.Fb=i,t.Aa){e.s=t.Aa(),n.A(2);break}return a=e,S(n,gi.create(i,o,e.c.manifest.retryParameters,t.mimeType),3);case 3:a.s=n.o;case 2:s=Ce(e.c.manifest),r.v&&"AUDIO"===r.v.nodeName&&(s.disableVideo=!0),e.s.configure(s),w(n)}}))}))}(n,e,t))})),i.set(this.Kc,(function(e){return function(e,t){var r=t.uri,n=e.K;e.Yb=new Zo,function(e,t){e.b=t}(e.Yb,(function(t){Qs(e,"timelineregionadded",t)}));var i={networkingEngine:n,filterNewPeriod:function(t){return e.Nc(t)},filterAllPeriods:function(t){return Us(e,t)},onTimelineRegionAdded:function(t){var r=e.Yb;e:{for(var n=f(r.a),i=n.next();!i.done;i=n.next())if((i=i.value).schemeIdUri==t.schemeIdUri&&i.id==t.id&&i.startTime==t.startTime&&i.endTime==t.endTime){n=i;break e}n=null}null==n&&(r.a.add(t),r.b(t))},onEvent:function(t){return e.dispatchEvent(t)},onError:function(t){return e.Ma(t)}};return new ye(Promise.resolve().then((function(){return p((function t(){var n;return M(t,(function(t){switch(t.j){case 1:return n=e,S(t,e.s.start(r,i),2);case 2:if(n.b=t.o,e.dispatchEvent(new Se("manifestparsed")),0==e.b.periods.length)throw new me(2,4,4014);!function(e){function t(e){return e.video&&e.audio||e.video&&e.video.codecs.includes(",")}e.some((function(e){return e.variants.some(t)}))&&e.forEach((function(e){e.variants=e.variants.filter(t)}))}(e.b.periods),w(t)}}))}))})),(function(){return e.s.stop()}))}(n,e)})),i.set(this.Ec,(function(){return Ae(function(e){return p((function t(){return M(t,(function(t){switch(t.j){case 1:return e.h=new pt({ub:e.K,onError:function(t){e.Ma(t)},qc:function(t){tl(e,t)},onExpirationUpdated:function(t,r){rl(e,t,r)},onEvent:function(t){e.dispatchEvent(t)}}),e.h.configure(e.c.drm),S(t,mt(e.h,Do(e.b.periods),e.b.offlineSessionIds),2);case 2:Us(e,e.b.periods),w(t)}}))}))}(n))})),i.set(this.S,(function(e,t){return Ae(function(e,t,r){return p((function n(){var i,o,a,s,l,u,c,d,h;return M(n,(function(n){switch(n.j){case 1:return t.startTime=r.startTime,i=t.v,o=t.uri,e.Fb=o,e.u=new Cs,a=function(){return Vs(e)},s=function(){var t=e.a.playbackRate;0!=t&&e.W.set(t)},e.g.w(i,"playing",a),e.g.w(i,"pause",a),e.g.w(i,"ended",a),e.g.w(i,"ratechange",s),l=e.c.abrFactory,e.l&&e.Dc==l||(e.Dc=l,e.l=new l,e.l.configure(e.c.abr)),function(e,t){for(var r=0;r<t.length;r++){for(var n=t[r],i=new Map,o=f(n.variants),a=o.next();!a.done;a=o.next())if((a=a.value).video&&a.video.closedCaptions)for(var s=f((a=a.video).closedCaptions.keys()),l=s.next();!l.done;l=s.next())if(l=l.value,!i.has(l)){var u={id:e.Xd++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,presentationTimeOffset:0,mimeType:"application/cea-608",codecs:"",kind:"caption",encrypted:!1,keyId:null,language:a.closedCaptions.get(l),label:null,type:"text",primary:!1,frameRate:void 0,pixelAspectRatio:void 0,trickModeVideo:null,emsgSchemeIdUris:null,roles:a.roles,channelsCount:null,audioSamplingRate:null,closedCaptions:null};i.set(l,u)}for(i=f(i.values()),o=i.next();!o.done;o=i.next())n.textStreams.push(o.value)}}(e,e.b.periods),e.Gb=new To(e.c.preferredAudioLanguage,e.c.preferredVariantRole,e.c.preferredAudioChannelCount),e.na=e.c.preferredTextLanguage,function(e,t,r){0<t&&(e.V()||e.qe(t)),r<e.Y()&&(e.V()||e.xa(r))}(e.b.presentationTimeline,e.c.playRangeStart,e.c.playRangeEnd),S(n,e.h.Hb(i),2);case 2:return e.l.init((function(t,r,n){r=void 0!==r&&r,n=void 0===n?0:n;e:{for(var i=f(e.b.periods),o=i.next();!o.done;o=i.next())if((o=o.value).variants.includes(t)){i=o;break e}i=null}Ms(e,i,t,!0),e.f&&ua(e.f,t,r,n)&&Ws(e)})),e.m=function(e,t){return new $o(e.a,e.b,e.c.streaming,t,(function(){e.ib&&Oo(e.ib,!0),e.f&&function(e){function t(t){var i=e.a.L;return t="text"==t?null!=(t=i.a).a&&null!=t.b&&r>=t.a&&r<t.b:Ut(t=Sr(i,t),r,n)}var r=e.a.Ua(),n=e.g.smallGapLimit,i=Ea(e,r);if(ze(e.b.values(),(function(e){return e.ia==i})))for(var o=f(e.b.keys()),a=o.next();!a.done;a=o.next())t(a=a.value)||da(e,e.b.get(a));else ze(e.b.keys(),t)||e.b.forEach((function(t){da(e,t)}))}(e.f),e.B&&Os(e)}),(function(t){return e.dispatchEvent(t)}))}(e,t.startTime),e.ib=function(e){var t=new No(e.b);!function(e,t){e.b=t}(t,(function(){$s(e)}));var r=new Qo(e.Yb);!function(e,t,r,n){e.a=t,e.b=r,e.c=n}(r,(function(t){Qs(e,"timelineregionenter",t)}),(function(t){Qs(e,"timelineregionexit",t)}),(function(t,r){r||(Qs(e,"timelineregionenter",t),Qs(e,"timelineregionexit",t))}));var n=new Io(e.a);return n.a.add(t),n.a.add(r),n}(e),e.W=new Fo({jc:function(){return t.v.playbackRate},wd:function(e){t.v.playbackRate=e},Yd:function(e){t.v.currentTime+=e}}),u=Math.max(e.b.minBufferTime,e.c.streaming.rebufferingGoal),Is(e,u),e.f=function(e){return new na(e.b,{Ua:function(){return e.m.h()},getBandwidthEstimate:function(){return e.l.getBandwidthEstimate()},L:e.D,ub:e.K,ae:e.zf.bind(e),$d:e.Fe.bind(e),onError:e.Ma.bind(e),onEvent:function(t){return e.dispatchEvent(t)},Df:e.Ef.bind(e),jd:e.Jf.bind(e)})}(e),e.f.configure(e.c.streaming),function(e){function t(e){var t="";e.video&&(t=Xe(e.video.codecs)[0]);var r="";return e.audio&&(r=Xe(e.audio.codecs)[0]),t+"-"+r}var r=e.b.periods.reduce((function(e,t){return e.concat(t.variants)}),[]);r=Nr.Nd(r,e.c.preferredAudioChannelCount);var n=new we;r.forEach((function(e){var r=t(e);n.push(r,e)}));var i=null,o=1/0;n.forEach((function(e,t){var r=0,n=0;t.forEach((function(e){r+=e.bandwidth||0,++n}));var a=r/n;a<o&&(i=e,o=a)})),e.b.periods.forEach((function(e){e.variants=e.variants.filter((function(e){return t(e)==i}))}))}(e),e.i=ml,e.dispatchEvent(new Se("streaming")),S(n,e.f.start(),3);case 3:e.c.streaming.startAtSegmentBoundary&&(c=e.m.h(),d=function(e,t){function r(e,t){if(!e)return null;var r=e.findSegmentPosition(t-o.startTime);return null==r?null:(r=e.getSegmentReference(r))?r.startTime+o.startTime:null}var n=ia(e.f),i=oa(e.f),o=ll(e);return n=r(n,t),null!=(i=r(i,t))&&null!=n?Math.max(i,n):null!=i?i:null!=n?n:t}(e,c),e.m.m(d)),e.b.periods.forEach(e.Nc.bind(e)),$s(e),Ws(e),(h=ll(e)||e.b.periods[0]).variants.some((function(e){return e.primary})),Hs(e,h.variants),e.g.da(i,"loadeddata",(function(){e.u.b=Date.now()/1e3-r.zd})),w(n)}}))}))}(n,e,t))})),i.set(this.Rc,(function(e){return Ae(e=function(e,t){return p((function r(){var n,i;return M(r,(function(r){switch(r.j){case 1:return n=Yt,e.h=new pt({ub:e.K,onError:function(t){e.Ma(t)},qc:function(t){tl(e,t)},onExpirationUpdated:function(t,r){rl(e,t,r)},onEvent:function(t){e.dispatchEvent(t)}}),e.h.configure(e.c.drm),i={id:0,language:"und",primary:!1,audio:null,video:{id:0,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,presentationTimeOffset:0,mimeType:"video/mp4",codecs:"",encrypted:!0,keyId:null,language:"und",label:null,type:n.Pa,primary:!1,frameRate:void 0,pixelAspectRatio:void 0,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,audioSamplingRate:null,closedCaptions:null},bandwidth:100,drmInfos:[],allowedByApplication:!0,allowedByKeySystem:!0},S(r,mt(e.h,[i],[]),2);case 2:return S(r,e.h.Hb(t.v),0)}}))}))}(n,e))})),i.set(this.jb,(function(e,t){return function(e,t,r){function n(){return Vs(e)}if(t.uri=r.uri,t.startTime=r.startTime,e.Fb=t.uri,e.u=new Cs,e.m=new Wo(t.v),null!=t.startTime&&e.m.m(t.startTime),e.W=new Fo({jc:function(){return t.v.playbackRate},wd:function(e){t.v.playbackRate=e},Yd:function(e){t.v.currentTime+=e}}),Is(e,e.c.streaming.rebufferingGoal),e.g.w(t.v,"playing",n),e.g.w(t.v,"pause",n),e.g.w(t.v,"ended",n),e.g.da(t.v,"loadeddata",(function(){e.u.b=Date.now()/1e3-r.zd})),e.a.audioTracks&&(e.g.w(e.a.audioTracks,"addtrack",(function(){return $s(e)})),e.g.w(e.a.audioTracks,"removetrack",(function(){return $s(e)})),e.g.w(e.a.audioTracks,"change",(function(){return $s(e)}))),e.a.textTracks){var i=e.a.textTracks;e.g.w(i,"addtrack",(function(){return $s(e)})),e.g.w(i,"removetrack",(function(){return $s(e)})),e.g.w(i,"change",(function(){return $s(e)}))}t.v.src=t.uri,e.i=gl,e.dispatchEvent(new Se("streaming"));var o=new ge;return e.a.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?o.resolve():e.a.error?o.reject(el(e)):(e.g.da(e.a,"loadeddata",(function(){o.resolve()})),e.g.da(e.a,"error",(function(){o.reject(el(e))}))),new ye(o,(function(){return o.reject(new me(2,7,7001)),Promise.resolve()}))}(n,e,t)})),this.lb=new fs(this.F,{cf:function(e,t,r,i){var o=null;return e==n.F&&(o=r==n.F?n.F:n.O),e==n.O&&(o=r==n.F||t.v!=i.v?n.F:r==n.O?n.O:r==n.hb||r==n.S?n.hb:r==n.jb?n.Rc:null),e==n.hb&&(o=r==n.S&&t.v==i.v?n.Mc:n.Ha),e==n.Mc&&(o=dl(n.S,n.Kc,n.Ha,r,t,i)),e==n.Kc&&(o=dl(n.S,n.Ec,n.Ha,r,t,i)),e==n.Ec&&(o=dl(n.S,n.S,n.Ha,r,t,i)),e==n.Rc&&(o=r==n.jb&&t.v==i.v?n.jb:n.Ha),e!=n.S&&e!=n.jb||(o=n.Ha),e==n.Ha&&(o=i.v&&t.v==i.v?n.O:n.F),o},Le:function(e,t,r){return n.dispatchEvent(new Se("onstatechange",{state:e.name})),i.get(e)(t,r)},handleError:function(e){return p((function t(){return M(t,(function(t){switch(t.j){case 1:return S(t,Ps(n,e),2);case 2:return t.return(e.v?n.O:n.F)}}))}))},Bf:function(e){n.dispatchEvent(new Se("onstateidle",{state:e.name}))}}),t&&this.Hb(t,!0)}_(qa,Ba),qa.prototype.updateManifestExpiration=function(e,t){var r=Fa(this.b,this.a),n=r.store(),i=new ge;return n.get(e).onsuccess=function(r){(r=r.target.result)?(r.expiration=t,n.put(r),i.resolve()):i.reject(new me(2,9,9012,"Could not find values for "+e))},r.promise().then((function(){return i}))},qa.prototype.ec=function(e){return{originalManifestUri:e.originalManifestUri,duration:e.duration,size:e.size,expiration:null==e.expiration?1/0:e.expiration,periods:e.periods.map(Xa),sessionIds:e.sessionIds,drmInfo:e.drmInfo,appMetadata:e.appMetadata}},qa.prototype.Jd=function(e){return{data:e.data}},_(es,Ba),es.prototype.hasFixedKeySpace=function(){return this.f},es.prototype.addSegments=function(e){return this.f?Ka(this.c):this.add(this.c,e)},es.prototype.addManifests=function(e){return this.f?Ka(this.a):this.add(this.a,e)},es.prototype.ec=function(e){return null==e.expiration&&(e.expiration=1/0),e},(n=ts.prototype).init=function(){var t=this,r=new ge,n=e.indexedDB.open("shaka_offline_db",4);return n.onsuccess=function(e){e=e.target.result,t.f=e;var n=e.objectStoreNames;n=n.contains("manifest")&&n.contains("segment")?new qa(e,"segment","manifest"):null,t.a=n,n=(n=e.objectStoreNames).contains("manifest-v2")&&n.contains("segment-v2")?new es(e,"segment-v2","manifest-v2",!0):null,t.b=n,n=(n=e.objectStoreNames).contains("manifest-v3")&&n.contains("segment-v3")?new es(e,"segment-v3","manifest-v3",!1):null,t.c=n,e=e.objectStoreNames.contains("session-ids")?new Ha(e):null,t.g=e,r.resolve()},n.onupgradeneeded=function(e){e=e.target.result;for(var t=f(["segment-v3","manifest-v3","session-ids"]),r=t.next();!r.done;r=t.next())r=r.value,e.objectStoreNames.contains(r)||e.createObjectStore(r,{autoIncrement:!0})},n.onerror=function(e){r.reject(new me(2,9,9001,n.error)),e.preventDefault()},r},n.destroy=function(){var e=this;return p((function t(){return M(t,(function(t){switch(t.j){case 1:if(!e.a){t.A(2);break}return S(t,e.a.destroy(),2);case 2:if(!e.b){t.A(4);break}return S(t,e.b.destroy(),4);case 4:if(!e.c){t.A(6);break}return S(t,e.c.destroy(),6);case 6:if(!e.g){t.A(8);break}return S(t,e.g.destroy(),8);case 8:e.f&&e.f.close(),w(t)}}))}))},n.getCells=function(){var e=new Map;return this.a&&e.set("v1",this.a),this.b&&e.set("v2",this.b),this.c&&e.set("v3",this.c),e},n.getEmeSessionCell=function(){return this.g},n.erase=function(){var t=this;return p((function r(){return M(r,(function(r){switch(r.j){case 1:if(!t.a){r.A(2);break}return S(r,t.a.destroy(),2);case 2:if(!t.b){r.A(4);break}return S(r,t.b.destroy(),4);case 4:if(!t.c){r.A(6);break}return S(r,t.c.destroy(),6);case 6:return t.f&&t.f.close(),S(r,function(){var t=new ge,r=e.indexedDB.deleteDatabase("shaka_offline_db");return r.onblocked=function(){},r.onsuccess=function(){t.resolve()},r.onerror=function(e){t.reject(new me(2,9,9001,r.error)),e.preventDefault()},t}(),8);case 8:return t.f=null,t.a=null,t.b=null,t.c=null,S(r,t.init(),0)}}))}))},Wa("idb",(function(){return e.indexedDB?new ts:null})),rs.prototype.wa=function(){return this.g},rs.prototype.ba=function(){return this.f},rs.prototype.key=function(){return this.c},rs.prototype.toString=function(){return this.b},(n=ls.prototype).configure=function(){},n.start=function(e){var t=this;return p((function r(){var n,i,o,a,s;return M(r,(function(r){switch(r.j){case 1:return n=ns(e),t.a=n,null==n||"manifest"!=n.a?r.return(Promise.reject(new me(2,1,9004,n))):(i=new Ya,C(r,2),S(r,i.init(),4));case 4:return S(r,za(i,n.wa(),n.ba()),5);case 5:return S(r,r.o.getManifests([n.key()]),6);case 6:return o=r.o,a=o[0],s=new is(n.wa(),n.ba()),r.return(function(e,t){var r=new yi(null,0);r.xa(t.duration);var n=t.periods.map((function(t){return os(e,t,r)})),i=t.drmInfo?[t.drmInfo]:[];return t.drmInfo&&n.forEach((function(e){e.variants.forEach((function(e){e.drmInfos=i}))})),{presentationTimeline:r,minBufferTime:2,offlineSessionIds:t.sessionIds,periods:n}}(s,a));case 2:return L(r),S(r,i.destroy(),7);case 7:j(r,0)}}))}))},n.stop=function(){return Promise.resolve()},n.update=function(){},n.onExpirationUpdated=function(e,t){var r=this;return p((function n(){var i,o,a,s,l,u,c;return M(n,(function(n){switch(n.j){case 1:return i=r.a,o=new Ya,k(n,2,3),S(n,o.init(),5);case 5:return S(n,za(o,i.wa(),i.ba()),6);case 6:return S(n,(a=n.o).getManifests([i.key()]),7);case 7:if(s=n.o,l=s[0],u=l.sessionIds.includes(e),c=null==l.expiration||l.expiration>t,!u||!c){n.A(3);break}return S(n,a.updateManifestExpiration(i.key(),t),3);case 3:return L(n),S(n,o.destroy(),10);case 10:j(n,0);break;case 2:R(n),n.A(3)}}))}))},gi.Cb("application/x-offline-manifest",ls),G("shaka.offline.OfflineScheme",us),us.h=function(e){return _e(e={uri:e,ld:e,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"}})},us.i=function(e,t){var r=new Ya;return _e(void 0).U((function(){return r.init()})).U((function(){return za(r,t.wa(),t.ba())})).U((function(e){return e.getSegments([t.key()])})).U((function(e){return{uri:t,ld:t,data:e[0].data,headers:{}}})).finally((function(){return r.destroy()}))},De("offline",us),fs.prototype.destroy=function(){var e=this;return p((function t(){return M(t,(function(t){switch(t.j){case 1:return e.l=!1,e.b&&e.b.abort(),ps(e),S(t,e.m,2);case 2:e.a&&e.a.va.Ya();for(var r=f(e.f),n=r.next();!n.done;n=r.next())n.value.va.Ya();e.a=null,e.f=[],e.g=null,w(t)}}))}))},G("shaka.text.SimpleTextDisplayer",ms),ms.prototype.remove=function(e,t){return!!this.a&&(ys(this.a,(function(r){return r.startTime<t&&r.endTime>e})),!0)},ms.prototype.remove=ms.prototype.remove,ms.prototype.append=function(e){for(var t=gs,r=[],n=0;n<e.length;n++){var i=t(e[n]);i&&r.push(i)}r.slice().sort((function(e,t){return e.startTime!=t.startTime?e.startTime-t.startTime:e.endTime!=t.endTime?e.endTime-t.startTime:r.indexOf(t)-r.indexOf(e)})).forEach(function(e){this.a.addCue(e)}.bind(this))},ms.prototype.append=ms.prototype.append,ms.prototype.destroy=function(){return this.a&&ys(this.a,(function(){return!0})),this.a=null,Promise.resolve()},ms.prototype.destroy=ms.prototype.destroy,ms.prototype.isTextVisible=function(){return"showing"==this.a.mode},ms.prototype.isTextVisible=ms.prototype.isTextVisible,ms.prototype.setTextVisibility=function(e){this.a.mode=e?"showing":"hidden"},ms.prototype.setTextVisibility=ms.prototype.setTextVisibility,G("shaka.util.ConfigUtils.mergeConfigObjects",vs),G("shaka.util.ConfigUtils.convertToConfigObject",bs),G("shaka.util.PlayerConfiguration",_s),_s.mergeConfigObjects=Es,V(xs,ke),G("shaka.Player",xs),xs.prototype.destroy=function(){var e=this;return p((function t(){var r;return M(t,(function(t){switch(t.j){case 1:return e.i==hl?t.return():(e.i=hl,r=hs(e.lb,(function(){return{node:e.F,payload:{Aa:null,v:null,mimeType:null,startTime:null,zd:null,uri:null},Va:!1}})),S(t,new Promise((function(t){r.wb=function(){},r.pc=function(){t(),e.dispatchEvent(new Se("loaded"))},r.Ya=function(){t()},r.onError=function(){t()},r.rc=function(){t()}})),2));case 2:return S(t,e.lb.destroy(),3);case 3:if(e.g&&(e.g.release(),e.g=null),e.Dc=null,e.l=null,e.c=null,!e.K){t.A(0);break}return S(t,e.K.destroy(),5);case 5:e.K=null,w(t)}}))}))},xs.prototype.destroy=xs.prototype.destroy,xs.version="v2.5.10";var Rs=["2","5"];Hr=new function(e){this.a=e,this.c=Gr,this.b=Vr}(new Br(Number(Rs[0]),Number(Rs[1])));var Ls=["output-restricted","internal-error"],js={};function Ps(e,t){return p((function r(){return M(r,(function(r){switch(r.j){case 1:if(e.i!=hl&&(e.i=pl),e.dispatchEvent(new Se("unloading")),t.Aa=null,t.mimeType=null,t.startTime=null,t.uri=null,t.v&&(e.g.ea(t.v,"loadeddata"),e.g.ea(t.v,"playing"),e.g.ea(t.v,"pause"),e.g.ea(t.v,"ended"),e.g.ea(t.v,"ratechange")),e.ib&&(e.ib.release(),e.ib=null),e.Zb&&(e.Zb.stop(),e.Zb=null),!e.s){r.A(2);break}return S(r,e.s.stop(),3);case 3:e.s=null;case 2:if(!e.l){r.A(4);break}return S(r,e.l.stop(),4);case 4:if(!e.f){r.A(6);break}return S(r,e.f.destroy(),7);case 7:e.f=null;case 6:if(e.m&&(e.m.release(),e.m=null),!e.D){r.A(8);break}return S(r,e.D.destroy(),9);case 9:e.D=null;case 8:if(!t.v||!t.v.src){r.A(10);break}return S(r,new Promise((function(e){return new fe(e).R(.1)})),11);case 11:t.v.removeAttribute("src"),t.v.load();case 10:if(!e.h){r.A(12);break}return S(r,e.h.destroy(),13);case 13:e.h=null;case 12:e.$.a.clear(),e.Fb=null,e.B=null,e.ac.clear(),e.b=null,e.u=null,e.Fc=null,e.kb=!0,Gs(e),w(r)}}))}))}function Is(e,t){e.B=new So,e.B.a=ko,wo(e.B,t,Math.min(.5,t/2)),Gs(e),e.Zb=new fe((function(){Os(e)})).Na(.25)}function Os(e){switch(e.i){case gl:var t=!!e.a.ended||Ft(e.a.buffered)>=e.a.duration-1;break;case ml:e:if(e.a.ended||Ar(e.D))t=!0;else{if(e.b.presentationTimeline.V()){var r=e.b.presentationTimeline.pb();if(Ft(e.a.buffered)>=r){t=!0;break e}}t=!1}break;default:t=!1}var n=Bt(e.a.buffered,e.a.currentTime),i=t,o=(r=e.B).b.get(r.a);t=r.a,n=i||n>=o?Co:ko,r.a=n,t!=n&&Gs(e)}function Ds(e){if(e.s){var t=Ce(e.c.manifest);e.a&&"AUDIO"===e.a.nodeName&&(t.disableVideo=!0),e.s.configure(t)}if(e.h&&e.h.configure(e.c.drm),e.f){e.f.configure(e.c.streaming);try{e.b.periods.forEach(e.Nc.bind(e))}catch(t){e.Ma(t)}var r=ia(e.f),n=oa(e.f);t=ll(e),r=Nr.Qd(r,n,t.variants),e.l&&r&&r.allowedByApplication&&r.allowedByKeySystem?Hs(e,t.variants):Ys(e,t)}if(e.D&&(t=e.c.textDisplayFactory,e.Fc!=t)){r=new t;var i=(n=e.D).g;n.g=r,i&&(r.setTextVisibility(i.isTextVisible()),i.destroy()),n.a&&(n.a.c=r),e.Fc=t,e.f&&(r=(t=e.f).b.get("text"))&&ca(t,r.stream,!0,0,!0)}e.l&&(e.l.configure(e.c.abr),e.c.abr.enabled&&!e.kb?e.l.enable():e.l.disable(),Zs(e)),e.B&&(t=e.c.streaming.rebufferingGoal,e.b&&(t=Math.max(t,e.b.minBufferTime)),wo(e.B,t,Math.min(.5,t/2)))}function Ms(e,t,r,n){go(e.$,t).variant=r,(e=e.u.c).c!=r&&(e.c=r,e.a.push({timestamp:Date.now()/1e3,id:r.id,type:"variant",fromAdaptation:n,bandwidth:r.bandwidth}))}function Ns(e,t,r,n){mo(e.$,t,r),(e=e.u.c).b!=r&&(e.b=r,e.a.push({timestamp:Date.now()/1e3,id:r.id,type:"text",fromAdaptation:n,bandwidth:null}))}function Fs(e){var t=As();return t.streaming.failureCallback=function(t){e.V()&&[1001,1002,1003].includes(t.code)&&(t.severity=1,e.sd())},t.textDisplayFactory=function(){return new ms(e.a)},t}function Us(e,t){var r=e.f?ia(e.f):null,n=e.f?oa(e.f):null;if(t.forEach(Nr.filterNewPeriod.bind(null,e.h,r,n)),0==(r=function(e,t){var r=0;return e.forEach((function(e){r+=t(e)?1:0})),r}(t,(function(e){return e.variants.some(Nr.rb)}))))throw new me(2,4,4032);if(r<t.length)throw new me(2,4,4011);t.forEach(function(e){Nr.Gd(e.variants,this.c.restrictions,this.bc)&&this.f&&ll(this)==e&&$s(this),nl(this,e.variants)}.bind(e))}function Bs(e,t,r,n){return r=void 0!==r&&r,n=void 0===n?0:n,e.kb?(e.pa=t,e.Ud=r,e.Rd=n,!0):((t=ua(e.f,t,r,n))&&qs(e),t)}function Ks(e,t){if(e.kb)return e.oa=t,!0;var r=ca(e.f,t,!0,0,!1);return r&&Xs(e),r}function Gs(e){var t=e.Xc();if(e.u&&e.B&&e.m){var r=e.W;r.f=t,Uo(r),Vs(e)}e.dispatchEvent(new Se("buffering",{buffering:t}))}function Vs(e){if(e.u&&e.B){var t=e.u.a;e.B.a==ko?Ss(t,"buffering"):e.a.paused?Ss(t,"paused"):e.a.ended?Ss(t,"ended"):Ss(t,"playing")}}function Hs(e,t){try{nl(e,t)}catch(t){return e.Ma(t),null}var r=t.filter((function(e){return Nr.rb(e)}));return r=e.Gb.create(r),e.l.setVariants(Array.from(r.values())),e.l.chooseVariant()}function Ys(e,t){var r=zs(e,t,!1),n=Nr.Jb(t.textStreams,e.na,e.fb)[0]||null,i=!1;n&&(e.c.streaming.alwaysStreamText||e.mc())&&(Ns(e,t,n,!0),i=Ks(e,n)),(r||i)&&Ws(e)}function zs(e,t,r){r=void 0===r||r;var n=Hs(e,t.variants),i=!1;return n&&(Ms(e,t,n,!0),i=Bs(e,n,!0)),r&&i&&Ws(e),i}function Ws(e){il(e,new Se("adaptation"))}function $s(e){il(e,new Se("trackschanged"))}function qs(e){il(e,new Se("variantchanged"))}function Xs(e){il(e,new Se("textchanged"))}function Js(e){il(e,new Se("texttrackvisibility"))}function Zs(e){il(e,new Se("abrstatuschanged",{Ig:e.c.abr.enabled}))}function Qs(e,t,r){e.dispatchEvent(new Se(t,{detail:{schemeIdUri:r.schemeIdUri,value:r.value,startTime:r.startTime,endTime:r.endTime,id:r.id,eventElement:r.eventElement}}))}function el(e){if(!e.a.error)return null;var t=e.a.error.code;if(1==t)return null;var r=e.a.error.msExtendedCode;return r&&(0>r&&(r+=Math.pow(2,32)),r=r.toString(16)),new me(2,3,3016,t,r,e.a.error.message)}function tl(e,t){if(e.f){var r=ll(e),n=!1,i=Object.keys(t),o=1==i.length&&"00"==i[0];i.length&&e.b.periods.forEach((function(e){e.variants.forEach((function(e){Nr.nf(e).forEach((function(r){var i=e.allowedByKeySystem;r.keyId&&(r=t[o?"00":r.keyId],e.allowedByKeySystem=!!r&&!Ls.includes(r)),i!=e.allowedByKeySystem&&(n=!0)}))}))})),i=ia(e.f);var a=oa(e.f);(i=Nr.Qd(i,a,r.variants))&&!i.allowedByKeySystem&&zs(e,r),n&&($s(e),Hs(e,r.variants))}}function rl(e,t,r){e.s&&e.s.onExpirationUpdated&&e.s.onExpirationUpdated(t,r),e.dispatchEvent(new Se("expirationupdated"))}function nl(e,t){var r=e.h?$e(e.h.W):{},n=Object.keys(r);n=n.length&&"00"==n[0];for(var i=!1,o=!1,a=[],s=[],l=f(t),u=l.next();!u.done;u=l.next()){var c=[];(u=u.value).audio&&c.push(u.audio),u.video&&c.push(u.video);for(var d=(c=f(c)).next();!d.done;d=c.next())if((d=d.value).keyId){var h=r[n?"00":d.keyId];h?Ls.includes(h)&&(s.includes(h)||s.push(h)):a.includes(d.keyId)||a.push(d.keyId)}u.allowedByApplication?u.allowedByKeySystem&&(i=!0):o=!0}if(!i)throw new me(2,4,4012,{hasAppRestrictions:o,missingKeys:a,restrictedKeyStatuses:s})}function il(e,t){p((function r(){return M(r,(function(r){switch(r.j){case 1:return S(r,Promise.resolve(),2);case 2:e.i!=hl&&e.dispatchEvent(t),w(r)}}))}))}function ol(e){for(var t=new Set,r=(e=f(e)).next();!r.done;r=e.next())(r=r.value).language?t.add(Ir(r.language)):t.add("und");return t}function al(e){for(var t=new Map,r=(e=f(e)).next();!r.done;r=e.next()){var n=r.value;r="und";var i=[];for(n.language&&(r=Ir(n.language)),(i="variant"==n.type?n.audioRoles:n.roles)&&i.length||(i=[""]),t.has(r)||t.set(r,new Set),i=(n=f(i)).next();!i.done;i=n.next())i=i.value,t.get(r).add(i)}var o=[];return t.forEach((function(e,t){for(var r=f(e),n=r.next();!n.done;n=r.next())o.push({language:t,role:n.value})})),o}function sl(e){return null==(e=ll(e))?[]:e.variants.filter((function(e){return Nr.rb(e)}))}function ll(e){for(var t=e.m.h(),r=null,n=(e=f(e.b.periods)).next();!n.done;n=e.next())(n=n.value).startTime<=t&&(r=n);return r}function ul(e){var t=ll(e);return go(e.$,t).variant}function cl(){return new me(2,7,7e3)}function dl(e,t,r,n,i,o){return n==e&&i.v==o.v&&i.uri==o.uri&&i.mimeType==o.mimeType&&i.Aa==o.Aa?t:r}function fl(e){return new Promise((function(t,r){e.Ya=function(){return r(cl())},e.pc=function(){return t()},e.onError=function(e){return r(e)},e.rc=function(){return r(cl())}}))}xs.registerSupportPlugin=function(e,t){js[e]=t},xs.isBrowserSupported=function(){if(!(e.Promise&&e.Uint8Array&&Array.prototype.forEach))return!1;var t=tt();return!(t&&12>t||!(e.MediaKeys&&e.navigator&&e.navigator.requestMediaKeySystemAccess&&e.MediaKeySystemAccess&&e.MediaKeySystemAccess.prototype.getConfiguration))&&(!!Ze()||Qe("application/x-mpegurl"))},xs.probeSupport=function(){return xt().then((function(e){for(var t=gi.Sf(),r={},n=f('video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="opus",audio/mp4; codecs="flac",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",")),i=n.next();!i.done;i=n.next()){r[i=i.value]=Ze()?!!pr(i)||MediaSource.isTypeSupported(i)||Wt(i):Qe(i);var o=i.split(";")[0];r[o]=r[o]||r[i]}for(var a in e={manifest:t,media:r,drm:e},js)e[a]=js[a]();return e}))},xs.prototype.Hb=function(e,t){if(t=void 0===t||t,this.i==hl)return Promise.reject(cl());var r={Aa:null,v:null,mimeType:null,startTime:null,zd:null,uri:null};r.v=e,Ze()||(t=!1);var n=t?this.hb:this.O,i=hs(this.lb,(function(){return{node:n,payload:r,Va:!1}}));return i.wb=function(){},fl(i)},xs.prototype.attach=xs.prototype.Hb,xs.prototype.detach=function(){var e=this;if(this.i==hl)return Promise.reject(cl());var t=hs(this.lb,(function(){return{node:e.F,payload:{Aa:null,v:null,mimeType:null,startTime:null,zd:null,uri:null},Va:!1}}));return t.wb=function(){},fl(t)},xs.prototype.detach=xs.prototype.detach,xs.prototype.Cd=function(e){var t=this;if(e=void 0===e||e,this.i==hl)return Promise.reject(cl());Ze()||(e=!1);var r={Aa:null,v:null,mimeType:null,startTime:null,zd:null,uri:null},n=hs(this.lb,(function(n){var i=n.v&&e?t.hb:n.v?t.O:t.F;return r.v=n.v,{node:i,payload:r,Va:!1}}));return n.wb=function(){},fl(n)},xs.prototype.unload=xs.prototype.Cd,xs.prototype.load=function(e,t,r){if(this.i==hl)return Promise.reject(cl());this.dispatchEvent(new Se("loading"));var n={Aa:null,v:null,mimeType:null,startTime:null,zd:null,uri:null};n.uri=e,n.zd=Date.now()/1e3,r&&"string"!=typeof r&&(Kr("Loading with a manifest parser factory","Please register a manifest parser and for the mime-type."),n.Aa=function(){return new r}),r&&"string"==typeof r&&(n.mimeType=r),void 0!==t&&(n.startTime=t);var i=function(e,t){if(t.Aa)return!1;if(!Ze())return!0;var r=t.mimeType,n=t.uri||"";return r||(r={mp4:"video/mp4",m4v:"video/mp4",m4a:"audio/mp4",webm:"video/webm",weba:"audio/webm",mkv:"video/webm",ts:"video/mp2t",ogv:"video/ogg",ogg:"audio/ogg",mpg:"video/mpeg",mpeg:"video/mpeg",m3u8:"application/x-mpegurl",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav"}[gi.getExtension(n)]),!!r&&""!=(t.v||nt()).canPlayType(r)&&(!gi.isSupported(n,r)||et()&&e.c.streaming.useNativeHlsOnSafari)}(this,n)?this.jb:this.S,o=hs(this.lb,(function(e){return null==e.v?null:(n.v=e.v,{node:i,payload:n,Va:!0})}));return o.wb=function(){},new Promise((function(e,t){o.rc=function(){return t(new me(2,7,7002))},o.pc=function(){return e()},o.Ya=function(){return t(cl())},o.onError=function(e){return t(e)}}))},xs.prototype.load=xs.prototype.load,xs.prototype.configure=function(e,t){2==arguments.length&&"string"==typeof e&&(e=bs(e,t));var r=Es(this.c,e,Fs(this));return Ds(this),r},xs.prototype.configure=xs.prototype.configure,xs.prototype.getConfiguration=function(){var e=Fs(this);return Es(e,this.c,Fs(this)),e},xs.prototype.getConfiguration=xs.prototype.getConfiguration,xs.prototype.$f=function(){for(var e in this.c)delete this.c[e];Es(this.c,Fs(this),Fs(this)),Ds(this)},xs.prototype.resetConfiguration=xs.prototype.$f,xs.prototype.We=function(){return this.i},xs.prototype.getLoadMode=xs.prototype.We,xs.prototype.af=function(){return this.a},xs.prototype.getMediaElement=xs.prototype.af,xs.prototype.Mb=function(){return this.K},xs.prototype.getNetworkingEngine=xs.prototype.Mb,xs.prototype.hc=function(){return this.Fb},xs.prototype.getAssetUri=xs.prototype.hc,xs.prototype.Ze=function(){return Kr("getManifestUri",'Please use "getAssetUri" instead.'),this.hc()},xs.prototype.getManifestUri=xs.prototype.Ze,xs.prototype.V=function(){return this.b?this.b.presentationTimeline.V():!(!this.a||!this.a.src)&&1/0==this.a.duration},xs.prototype.isLive=xs.prototype.V,xs.prototype.Xa=function(){return!!this.b&&this.b.presentationTimeline.Xa()},xs.prototype.isInProgress=xs.prototype.Xa,xs.prototype.uf=function(){if(this.b){if(!this.b.periods.length)return!1;var e=this.b.periods[0].variants;return!!e.length&&!e[0].video}return!(!this.a||!this.a.src)&&(this.a.videoTracks?0==this.a.videoTracks.length:0==this.a.videoHeight)},xs.prototype.isAudioOnly=xs.prototype.uf,xs.prototype.bg=function(){if(this.b){var e=this.b.presentationTimeline;return{start:e.ob(),end:e.Ca()}}return this.a&&this.a.src&&(e=this.a.seekable).length?{start:e.start(0),end:e.end(e.length-1)}:{start:0,end:0}},xs.prototype.seekRange=xs.prototype.bg,xs.prototype.keySystem=function(){return _t(this.drmInfo())},xs.prototype.keySystem=xs.prototype.keySystem,xs.prototype.drmInfo=function(){return this.h?this.h.a:null},xs.prototype.drmInfo=xs.prototype.drmInfo,xs.prototype.Lb=function(){return this.h?this.h.Lb():1/0},xs.prototype.getExpiration=xs.prototype.Lb,xs.prototype.Xc=function(){return!!this.B&&this.B.a==ko},xs.prototype.isBuffering=xs.prototype.Xc,xs.prototype.ef=function(){if(this.W){var e=this.W;e=e.f?0:e.c}else e=0;return e},xs.prototype.getPlaybackRate=xs.prototype.ef,xs.prototype.ug=function(e){0==e?q("A trick play rate of 0 is unsupported!"):(this.a.paused&&this.a.play(),this.W.set(e),this.i==ml&&la(this.f,1<Math.abs(e)))},xs.prototype.trickPlay=xs.prototype.ug,xs.prototype.Ge=function(){this.i==gl&&this.W.set(1),this.i==ml&&(this.W.set(1),la(this.f,!1))},xs.prototype.cancelTrickPlay=xs.prototype.Ge,xs.prototype.Vc=function(){if(this.b&&this.m){for(var e=ul(this),t=[],r=f(sl(this)),n=r.next();!n.done;n=r.next()){n=n.value;var i=Nr.Ed(n);i.active=n==e,t.push(i)}return t}return this.a&&this.a.audioTracks?Array.from(this.a.audioTracks).map((function(e){return Nr.rf(e)})):[]},xs.prototype.getVariantTracks=xs.prototype.Vc,xs.prototype.qb=function(){if(this.b&&this.m){for(var e=function(e){var t=ll(e);if(null==t)return null;if(!go(e.$,t).text){var r=Nr.Jb(t.textStreams,e.na,e.fb);r.length&&mo(e.$,t,r[0])}return go(e.$,t).text}(this),t=[],r=f(function(e){var t=ll(e);return null==t?[]:t.textStreams.filter((function(t){return!e.ac.has(t)}))}(this)),n=r.next();!n.done;n=r.next()){n=n.value;var i=Nr.xc(n);i.active=n==e,t.push(i)}return t}return this.a&&this.a.src&&this.a.textTracks?Array.from(this.a.textTracks).map((function(e){return Nr.sf(e)})):[]},xs.prototype.getTextTracks=xs.prototype.qb,xs.prototype.td=function(e){if(this.b&&this.f){var t=ll(this),r=t.textStreams.find((function(t){return t.id==e.id}));r&&(Ns(this,t,r,!1),Ks(this,r),this.na=r.language)}else if(this.a&&this.a.src&&this.a.textTracks){for(r=(t=f(t=Array.from(this.a.textTracks))).next();!r.done;r=t.next())r=r.value,Nr.Wc(r)==e.id?r.mode=this.gb?"showing":"hidden":r.mode="disabled";Xs(this)}},xs.prototype.selectTextTrack=xs.prototype.td,xs.prototype.dg=function(){Kr("selectEmbeddedTextTrack","If closed captions are signaled in the manifest, a text stream will be created to represent them. Please use SelectTextTrack.");var e=this.qb().filter((function(e){return"application/cea-608"==e.mimeType}));0<e.length&&this.td(e[0])},xs.prototype.selectEmbeddedTextTrack=xs.prototype.dg,xs.prototype.zg=function(){Kr("usingEmbeddedTextTrack","If closed captions are signaled in the manifest, a text stream will be created to represent them. There should be no reason to know if the player is playing embedded text.");var e=this.qb().filter((function(e){return e.active}))[0];return!!e&&"application/cea-608"==e.mimeType},xs.prototype.usingEmbeddedTextTrack=xs.prototype.zg,xs.prototype.fg=function(e,t,r){if(r=void 0===r?0:r,this.b&&this.f){var n=ll(this);this.c.abr.enabled&&q("Changing tracks while abr manager is enabled will likely result in the selected track being overriden. Consider disabling abr before calling selectVariantTrack().");var i=n.variants.find((function(t){return t.id==e.id}));i&&Nr.rb(i)&&(Ms(this,n,i,!1),Bs(this,i,t,r),this.Gb=new Eo(i),Hs(this,n.variants))}else if(this.a&&this.a.audioTracks){for(r=(t=f(t=Array.from(this.a.audioTracks))).next();!r.done;r=t.next())r=r.value,Nr.Wc(r)==e.id&&(r.enabled=!0);qs(this)}},xs.prototype.selectVariantTrack=xs.prototype.fg,xs.prototype.Re=function(){return al(this.Vc())},xs.prototype.getAudioLanguagesAndRoles=xs.prototype.Re,xs.prototype.mf=function(){return al(this.qb())},xs.prototype.getTextLanguagesAndRoles=xs.prototype.mf,xs.prototype.Qe=function(){return Array.from(ol(this.Vc()))},xs.prototype.getAudioLanguages=xs.prototype.Qe,xs.prototype.lf=function(){return Array.from(ol(this.qb()))},xs.prototype.getTextLanguages=xs.prototype.lf,xs.prototype.cg=function(e,t){if(this.b&&this.m){var r=ll(this);this.Gb=new To(e,t||"",0,"","audio"),zs(this,r)}else if(this.a&&this.a.audioTracks){for(var n=(r=f(r=Array.from(this.a.audioTracks))).next();!n.done;n=r.next())(n=n.value).language==e&&(n.enabled=!0);qs(this)}},xs.prototype.selectAudioLanguage=xs.prototype.cg,xs.prototype.eg=function(e,t){if(this.b&&this.m){var r=ll(this);this.na=e,this.fb=t||"";var n=Nr.Jb(r.textStreams,this.na,this.fb)[0]||null;n&&(Ns(this,r,n,!1),(this.c.streaming.alwaysStreamText||this.mc())&&Ks(this,n))}else(r=this.qb().filter((function(t){return t.language==e}))[0])&&this.td(r)},xs.prototype.selectTextLanguage=xs.prototype.eg,xs.prototype.gg=function(e){if(this.b&&this.m){for(var t=ll(this),r=null,n=f(sl(this)),i=n.next();!i.done;i=n.next())if((i=i.value).audio.label==e){r=i;break}null!=r&&(this.Gb=new To(r.language,"",0,e),zs(this,t))}},xs.prototype.selectVariantsByLabel=xs.prototype.gg,xs.prototype.mc=function(){var e=this.gb;return this.D?this.D.g.isTextVisible():this.a&&this.a.src&&this.a.textTracks?Array.from(this.a.textTracks).some((function(e){return"showing"==e.mode})):e},xs.prototype.isTextTrackVisible=xs.prototype.mc,xs.prototype.jg=function(e){var t=this;return p((function r(){var n,i,o,a;return M(r,(function(r){switch(r.j){case 1:if(t.gb==(n=!!e))return r.return();if(t.gb=n,t.i!=ml){if(t.a&&t.a.src&&t.a.textTracks)for(var s=f(Array.from(t.a.textTracks)),l=s.next();!l.done;l=s.next())"disabled"!=(i=l.value).mode&&(i.mode=n?"showing":"hidden");r.A(2);break}if(t.D.g.setTextVisibility(n),t.c.streaming.alwaysStreamText){r.A(2);break}if(!n){(s=t.f).D=!0,(l=s.b.get("text"))&&(Ca(l),s.b.delete("text")),r.A(2);break}if(o=ll(t),!(0<(a=Nr.Jb(o.textStreams,t.na,t.fb)).length)){r.A(2);break}return S(r,sa(t.f,a[0]),2);case 2:Js(t),w(r)}}))}))},xs.prototype.setTextTrackVisibility=xs.prototype.jg,xs.prototype.gf=function(){if(!this.V())return null;if(this.b)return new Date(1e3*(this.b.presentationTimeline.f+this.a.currentTime));if(this.a&&this.a.getStartDate){var e=this.a.getStartDate();return isNaN(e.getTime())?null:new Date(e.getTime()+1e3*this.a.currentTime)}return null},xs.prototype.getPlayheadTimeAsDate=xs.prototype.gf,xs.prototype.jf=function(){if(!this.V())return null;if(this.b)return new Date(1e3*this.b.presentationTimeline.f);if(this.a&&this.a.getStartDate){var e=this.a.getStartDate();return isNaN(e.getTime())?null:e}return null},xs.prototype.getPresentationStartTimeAsDate=xs.prototype.jf,xs.prototype.Sc=function(){var e={total:[],audio:[],video:[],text:[]};return this.i==gl&&(e.total=Kt(this.a.buffered)),this.i==ml&&this.D.Sc(e),e},xs.prototype.getBufferedInfo=xs.prototype.Sc,xs.prototype.getStats=function(){if(this.i!=ml&&this.i!=gl)return{width:NaN,height:NaN,streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,estimatedBandwidth:NaN,loadLatency:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,switchHistory:[],stateHistory:[]};Vs(this);var e=this.a;if(e.getVideoPlaybackQuality){e=e.getVideoPlaybackQuality();var t=this.u,r=Number(e.totalVideoFrames);t.m=Number(e.droppedVideoFrames),t.l=r,this.u.i=Number(e.corruptedVideoFrames)}e=this.h&&(e=this.h).K?e.K:NaN,this.u.h=e,this.i==ml&&((e=ul(this))&&(this.u.s=e.bandwidth),e&&e.video&&(t=this.u,r=e.video.height||NaN,t.u=e.video.width||NaN,t.g=r),e=this.l.getBandwidthEstimate(),this.u.f=e);var n=this.u;e=n.u,t=n.g,r=n.s;for(var i=n.l,o=n.m,a=n.i,s=n.f,l=n.b,u=ws(n.a,"playing"),c=ws(n.a,"paused"),d=ws(n.a,"buffering"),h=n.h,p=function(e){function t(e){return{timestamp:e.timestamp,state:e.state,duration:e.duration}}for(var r=[],n=f(e.b),i=n.next();!i.done;i=n.next())r.push(t(i.value));return e.a&&r.push(t(e.a)),r}(n.a),m=[],g=(n=f(n.c.a)).next();!g.done;g=n.next())g=g.value,m.push({timestamp:g.timestamp,id:g.id,type:g.type,fromAdaptation:g.fromAdaptation,bandwidth:g.bandwidth});return{width:e,height:t,streamBandwidth:r,decodedFrames:i,droppedFrames:o,corruptedFrames:a,estimatedBandwidth:s,loadLatency:l,playTime:u,pauseTime:c,bufferingTime:d,licenseTime:h,stateHistory:p,switchHistory:m}},xs.prototype.getStats=xs.prototype.getStats,xs.prototype.addTextTrack=function(e,t,r,n,i,o){var a=this;return p((function s(){var l,u,c,d,f,h,p,m,g;return M(s,(function(s){switch(s.j){case 1:if(a.i==gl)throw Error("State error!");if(a.i!=ml)throw Error("State error!");if(l=ll(a),u=Yt,c=a.b.periods.indexOf(l),f=(d=c+1)>=a.b.periods.length?a.b.presentationTimeline.Y():a.b.periods[d].startTime,1/0==(h=f-l.startTime))throw new me(1,4,4033);return p=new Zn(1,0,h,(function(){return[e]}),0,null),m={id:a.Xd++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return 1},getSegmentReference:function(e){return 1==e?p:null},initSegmentReference:null,presentationTimeOffset:0,mimeType:n,codecs:i||"",kind:r,encrypted:!1,keyId:null,language:t,label:o||null,type:u.ra,primary:!1,frameRate:void 0,pixelAspectRatio:void 0,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,audioSamplingRate:null,closedCaptions:null},a.ac.add(m),l.textStreams.push(m),S(s,sa(a.f,m),2);case 2:return(g=aa(a.f,"text"))&&mo(a.$,l,g),a.ac.delete(m),Ys(a,l),$s(a),s.return(Nr.xc(m))}}))}))},xs.prototype.addTextTrack=xs.prototype.addTextTrack,xs.prototype.vd=function(e,t){this.bc.width=e,this.bc.height=t},xs.prototype.setMaxHardwareResolution=xs.prototype.vd,xs.prototype.sd=function(){if(this.i==ml){var e=this.f;if(e.f)e=!1;else if(e.m)e=!1;else{for(var t=f(e.b.values()),r=t.next();!r.done;r=t.next())(r=r.value).Pb&&(r.Pb=!1,ka(e,r,.1));e=!0}}else e=!1;return e},xs.prototype.retryStreaming=xs.prototype.sd,xs.prototype.Xe=function(){return this.b},xs.prototype.getManifest=xs.prototype.Xe,xs.prototype.Ye=function(){return this.s?this.s.constructor:null},xs.prototype.getManifestParserFactory=xs.prototype.Ye,(n=xs.prototype).Nc=function(e){var t=this.f?ia(this.f):null,r=this.f?oa(this.f):null;if(Nr.filterNewPeriod(this.h,t,r,e),!(t=e.variants).some(Nr.rb))throw new me(2,4,4011);if(nl(this,e.variants),Nr.Gd(t,this.c.restrictions,this.bc)&&this.f&&ll(this)==e&&$s(this),e=this.h?this.h.a:null)for(r=(t=f(t)).next();!r.done;r=t.next())for(var n=(r=f(r.value.drmInfos)).next();!n.done;n=r.next())if((n=n.value).keySystem==e.keySystem)for(var i=(n=f(n.initData||[])).next();!i.done;i=n.next())i=i.value,bt(this.h,i.initDataType,i.initData)},n.zf=function(e){try{this.kb=!0,this.l.disable(),Zs(this);var t=Hs(this,e.variants),r=Nr.Jb(e.textStreams,this.na,this.fb)[0]||null;this.pa&&(e.variants.includes(this.pa)&&(t=this.pa),this.pa=null),this.oa&&(e.textStreams.includes(this.oa)&&(r=this.oa),this.oa=null),t&&Ms(this,e,t,!0),r&&Ns(this,e,r,!0);var n=this.f,i=n.b.get("video");if(i)var o=n.c.periods[i.ia];else{var a=n.b.get("audio");o=a?n.c.periods[a.ia]:null}var s=t?t.audio:null;if(!o&&r){var l;if(l=s){e=r;var u=Ir(this.c.preferredTextLanguage),c=Ir(s.language),d=Ir(e.language);l=jr(d,u)&&!jr(c,d)}l&&(this.gb=!0),this.gb&&this.D.g.setTextVisibility(!0),Js(this)}return this.c.streaming.alwaysStreamText||this.mc()?{variant:t,text:r}:{variant:t,text:null}}catch(e){return this.Ma(e),{variant:null,text:null}}},n.Fe=function(){this.kb=!1,this.c.abr.enabled&&(this.l.enable(),Zs(this)),this.pa&&(ua(this.f,this.pa,this.Ud,this.Rd),qs(this),this.pa=null),this.oa&&(ca(this.f,this.oa,!0,0,!1),Xs(this),this.oa=null)},n.Ef=function(){this.s&&this.s.update&&this.s.update()},n.Jf=function(){this.m&&this.m.s()},n.Ma=function(e){if(this.i!=hl){var t=new Se("error",{detail:e});this.dispatchEvent(t),t.defaultPrevented&&(e.handled=!0)}};var hl=0,pl=1,ml=2,gl=3;function yl(e,t){var r=os(new is(e.wa(),e.ba()),t.periods[0],new yi(null,0)),n=t.appMetadata||{};return r=vl(r),{offlineUri:e.toString(),originalManifestUri:t.originalManifestUri,duration:t.duration,size:t.size,expiration:t.expiration,tracks:r,appMetadata:n}}function vl(e){for(var t=[],r=Nr.df(e.variants),n=(r=f(r)).next();!n.done;n=r.next())t.push(Nr.Ed(n.value));for(r=(e=f(e.textStreams)).next();!r.done;r=e.next())t.push(Nr.xc(r.value));return t}function bl(){this.a={}}function _l(e,t){var r=t.audio,n=t.video;if(r&&!n&&(e.a[r.id]=r.bandwidth||t.bandwidth),!r&&n&&(e.a[n.id]=n.bandwidth||t.bandwidth),r&&n){var i=r.bandwidth||393216,o=n.bandwidth||t.bandwidth-i;0>=o&&(o=t.bandwidth),e.a[r.id]=i,e.a[n.id]=o}}function Al(e,t){var r=e.a[t];return null==r&&(r=0),r}function El(e){this.a=!1,this.b=new ge,this.c=e}function Tl(e){var t=new wl;e.periods.forEach((function(e,r){var n=Cl(e.variants);if(0==r)for(var i=(n=f(n.a)).next();!i.done;i=n.next())t.add(i.value);else!function(e,t){e.a=e.a.filter((function(e){return kl(t,e)}))}(t,n)}));for(var r=(e=f(e.periods)).next();!r.done;r=e.next())(r=r.value).variants=r.variants.filter((function(e){return kl(t,new Sl(e))}))}function Sl(e){var t=e.audio;e=e.video,this.b=t?t.mimeType:null,this.a=t?t.codecs.split(".")[0]:null,this.f=e?e.mimeType:null,this.c=e?e.codecs.split(".")[0]:null}function wl(){this.a=[]}function kl(e,t){return e.a.some((function(e){return t.b==e.b&&t.a==e.a&&t.f==e.f&&t.c==e.c}))}function Cl(e){for(var t=new wl,r=(e=f(e)).next();!r.done;r=e.next())t.add(new Sl(r.value));return t}function xl(e){var t=this;if(e&&e.constructor!=xs)throw new me(2,9,9008);this.b=this.a=null,e?(this.a=e.c,this.b=e.Mb()):(this.a=As(),this.b=new Ie),this.f=!1,this.c=[],this.g=[];var r=!e;this.h=new El((function(){return p((function e(){var n;return M(e,(function(e){switch(e.j){case 1:return n=function(){},S(e,Promise.all(t.g.map((function(e){return e.then(n,n)}))),2);case 2:if(!r){e.A(3);break}return S(e,t.b.destroy(),3);case 3:t.a=null,t.b=null,w(e)}}))}))}))}function Rl(){if(Ze())e:{for(var e=f($a.values()),t=e.next();!t.done;t=e.next())if(t=(t=t.value)()){t.destroy(),e=!0;break e}e=!1}else e=!1;return e}function Ll(e,t){for(var r=[],n=f(e.periods),i=n.next();!i.done;i=n.next())for(var o=(i=f(i.value.streams)).next();!o.done;o=i.next())o=o.value,t&&"video"==o.contentType?r.push({contentType:qe(o.mimeType,o.codecs),robustness:e.drmInfo.videoRobustness}):t||"audio"!=o.contentType||r.push({contentType:qe(o.mimeType,o.codecs),robustness:e.drmInfo.audioRobustness});return r}function jl(e,t,r){return p((function n(){return M(n,(function(n){switch(n.j){case 1:return S(n,function(e,t,r,n){return p((function i(){var o,a,s;return M(i,(function(i){switch(i.j){case 1:return n.drmInfo?(o=function(e){var t=Array.from(e.a.keys());if(!t.length)throw new me(2,9,9e3,"No supported storage mechanisms found");return e.a.get(t[0]).getEmeSessionCell()}(r),a=n.sessionIds.map((function(e){return{sessionId:e,keySystem:n.drmInfo.keySystem,licenseUri:n.drmInfo.licenseServerUri,serverCertificate:n.drmInfo.serverCertificate,audioCapabilities:Ll(n,!1),videoCapabilities:Ll(n,!0)}})),S(i,cs(t,e,a),2)):i.return();case 2:return s=i.o,S(i,o.remove(s),3);case 3:return S(i,o.add(a.filter((function(e){return-1==s.indexOf(e.sessionId)}))),0)}}))}))}(e.b,e.a.drm,r,t),0)}}))}))}function Pl(e,t,r,n){function i(){s+=1,e.a.offline.progressCallback(l,s/a)}var o=function(e){var t=[];return e.periods.forEach((function(e){e.streams.forEach((function(e){null!=e.initSegmentKey&&t.push(e.initSegmentKey),e.segments.forEach((function(e){t.push(e.dataKey)}))}))})),t}(n),a=o.length+1,s=0,l=yl(r,n);return Promise.all([t.removeSegments(o,i),t.removeManifests([r.key()],i)])}function Il(e,t,r,n,i,o){var a={id:o.id,originalId:o.originalId,primary:o.primary,presentationTimeOffset:o.presentationTimeOffset||0,contentType:o.type,mimeType:o.mimeType,codecs:o.codecs,frameRate:o.frameRate,pixelAspectRatio:o.pixelAspectRatio,kind:o.kind,language:o.language,label:o.label,width:o.width||null,height:o.height||null,initSegmentKey:null,encrypted:o.encrypted,keyId:o.keyId,segments:[],variantIds:[]};i=i.presentationTimeline.Ob();var s=o.id,l=o.initSegmentReference;return l&&(l=vi(l.c(),l.b,l.a,e.a.streaming.retryParameters),Oa(t,s,l,.5*Al(n,o.id),!0,(function(t){return p((function n(){var i;return M(n,(function(n){switch(n.j){case 1:return S(n,r.addSegments([{data:t}]),2);case 2:i=n.o,e.c.push(i[0]),a.initSegmentKey=i[0],w(n)}}))}))}))),function(e,t,r){for(var n=null==(t=e.findSegmentPosition(t))?null:e.getSegmentReference(t);n;)r(n),n=e.getSegmentReference(++t)}(o,i,(function(i){var l=vi(i.c(),i.b,i.a,e.a.streaming.retryParameters);Oa(t,s,l,function(e,t,r){return r=r.endTime-r.startTime,Al(e,t)*r}(n,o.id,i),!1,(function(t){return p((function n(){var o;return M(n,(function(n){switch(n.j){case 1:return S(n,r.addSegments([{data:t}]),2);case 2:o=n.o,e.c.push(o[0]),a.segments.push({startTime:i.startTime,endTime:i.endTime,dataKey:o[0]}),w(n)}}))}))}))})),a}function Ol(e){if(e.h.a)throw new me(2,9,7001)}function Dl(){if(!Rl())throw new me(2,9,9e3)}function Ml(e,t){return p((function r(){return M(r,(function(r){switch(r.j){case 1:return e.g.push(t),C(r,2),S(r,t,4);case 4:return r.return(r.o);case 2:L(r),Re(e.g,t),j(r,0)}}))}))}function Nl(e){e.variants.map((function(e){return e.video}));var t=new Set(e.variants.map((function(e){return e.audio})));e=e.textStreams;for(var r=f(t),n=r.next();!n.done;n=r.next())for(var i=(n=f(t)).next();!i.done;i=n.next());for(r=(t=f(e)).next();!r.done;r=t.next())for(n=(r=f(e)).next();!n.done;n=r.next());}xs.LoadMode={DESTROYED:hl,NOT_LOADED:pl,MEDIA_SOURCE:ml,SRC_EQUALS:gl},El.prototype.destroy=function(){var e=this;return this.a?this.b:(this.a=!0,this.c().then((function(){e.b.resolve()}),(function(){e.b.resolve()})))},wl.prototype.add=function(e){kl(this,e)||this.a.push(e)},G("shaka.offline.Storage",xl),xl.support=Rl,xl.prototype.destroy=function(){return this.h.destroy()},xl.prototype.destroy=xl.prototype.destroy,xl.prototype.configure=function(e,t){2==arguments.length&&"string"==typeof e&&(e=bs(e,t));var r=e,n=!1;return null!=r.trackSelectionCallback&&(n=!0,r.offline=r.offline||{},r.offline.trackSelectionCallback=r.trackSelectionCallback,delete r.trackSelectionCallback),null!=r.progressCallback&&(n=!0,r.offline=r.offline||{},r.offline.progressCallback=r.progressCallback,delete r.progressCallback),null!=r.usePersistentLicense&&(n=!0,r.offline=r.offline||{},r.offline.usePersistentLicense=r.usePersistentLicense,delete r.usePersistentLicense),n&&Kr("Storage.configure with OfflineConfig","Please configure storage with a player configuration."),Es(this.a,e)},xl.prototype.configure=xl.prototype.configure,xl.prototype.getConfiguration=function(){var e=As();return Es(e,this.a,As()),e},xl.prototype.getConfiguration=xl.prototype.getConfiguration,xl.prototype.Mb=function(){return this.b},xl.prototype.getNetworkingEngine=xl.prototype.Mb,xl.prototype.store=function(e,t,r){var n=this;return Ml(this,function(e,t,r,n){return p((function i(){var o,a,s,l,u,c,d,h,m;return M(i,(function(i){switch(i.j){case 1:return Dl(),e.f?i.return(Promise.reject(new me(2,9,9006))):(e.f=!0,S(i,function(e,t,r){return p((function n(){var i,o,a,s,l,u;return M(n,(function(n){switch(n.j){case 1:return i=null,o=e.b,a={networkingEngine:o,filterAllPeriods:function(){},filterNewPeriod:function(){},onTimelineRegionAdded:function(){},onEvent:function(){},onError:function(e){i=e}},S(n,r(),2);case 2:return(s=n.o).configure(e.a.manifest),Ol(e),C(n,3),S(n,s.start(t,a),5);case 5:return l=n.o,Ol(e),u=function(e){for(var t=new Set,r=(e=f(e.periods)).next();!r.done;r=e.next()){for(var n=f((r=r.value).textStreams),i=n.next();!i.done;i=n.next())t.add(i.value);for(r=f(r.variants),n=r.next();!n.done;n=r.next())(n=n.value).audio&&t.add(n.audio),n.video&&t.add(n.video)}return t}(l),S(n,Promise.all(Ye(u,(function(e){return e.createSegmentIndex()}))),6);case 6:if(Ol(e),i)throw i;return n.return(l);case 3:return L(n),S(n,s.stop(),7);case 7:j(n,0)}}))}))}(e,t,n),2));case 2:if(o=i.o,Ol(e),o.presentationTimeline.V()||o.presentationTimeline.Xa())throw new me(2,9,9005,t);return a=null,s=new Ya,u=l=null,k(i,3,4),S(i,function(e,t,r){return p((function n(){var i,o,a;return M(n,(function(n){switch(n.j){case 1:return i=new pt({ub:e.b,onError:r,qc:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),o=Do(t.periods),a=e.a,i.configure(a.drm),S(n,function(e,t,r){return e.s=[],e.D=r,gt(e,t)}(i,o,a.offline.usePersistentLicense),2);case 2:return S(n,yt(i),3);case 3:return S(n,vt(i),4);case 4:return n.return(i)}}))}))}(e,o,(function(e){u=u||e})),6);case 6:if(a=i.o,Ol(e),u)throw u;return S(i,function(e,t,r){return p((function n(){var i;return M(n,(function(n){switch(n.j){case 1:return i={width:1/0,height:1/0},function(e,t,r){for(var n=(e=f(e.periods)).next();!n.done;n=e.next())(n=n.value).variants=n.variants.filter((function(e){return Nr.bd(e,t,r)}))}(t,e.a.restrictions,i),function(e){for(var t=(e=f(e.periods)).next();!t.done;t=e.next())(t=t.value).variants=t.variants.filter((function(e){var t=!0;return e.audio&&(t=t&&br(e.audio)),e.video&&(t=t&&br(e.video)),t}))}(t),function(e,t){for(var r=f(e.periods),n=r.next();!n.done;n=r.next())(n=n.value).variants=n.variants.filter((function(e){return Rt(t,e)}))}(t,r),Tl(t),S(n,function(e,t){return p((function r(){var n,i,o,a;return M(r,(function(r){switch(r.j){case 1:n=null,i=f(e.periods),o=i.next();case 2:if(o.done){r.A(0);break}return a=o.value,n&&(a.variants=a.variants.filter((function(e){return kl(n,new Sl(e))}))),S(r,t(a),5);case 5:n=Cl(a.variants),o=i.next(),r.A(2)}}))}))}(t,(function(t){return p((function r(){var n,i,o,a,s,l,u,c;return M(r,(function(r){switch(r.j){case 1:n=Nr,i=[];for(var d=f(t.variants),h=d.next();!h.done;h=d.next())o=h.value,i.push(n.Ed(o));for(h=(d=f(t.textStreams)).next();!h.done;h=d.next())a=h.value,i.push(n.xc(a));return S(r,e.a.offline.trackSelectionCallback(i),2);case 2:for(s=r.o,l=new Set,u=new Set,h=(d=f(s)).next();!h.done;h=d.next())"variant"==(c=h.value).type&&l.add(c.id),"text"==c.type&&u.add(c.id);t.variants=t.variants.filter((function(e){return l.has(e.id)})),t.textStreams=t.textStreams.filter((function(e){return u.has(e.id)})),w(r)}}))}))})),2);case 2:(function(e){if(0==e.periods.length)throw new me(2,4,4014);for(var t=(e=f(e.periods)).next();!t.done;t=e.next())Nl(t.value)})(t),w(n)}}))}))}(e,o,a),7);case 7:return S(i,s.init(),8);case 8:return Ol(e),S(i,function(e){var t=null;if(e.a.forEach((function(e,r){e.getCells().forEach((function(e,n){e.hasFixedKeySpace()||t||(t={path:{wa:r,ba:n},ba:e})}))})),t)return t;throw new me(2,9,9013,"Could not find a cell that supports add-operations")}(s),9);case 9:return l=i.o,Ol(e),S(i,function(e,t,r,n,i,o){return p((function a(){var s,l,u,c,d,h,m,g,y,v;return M(a,(function(a){switch(a.j){case 1:return s=function(e,t,r){var n=null==t.expiration?1/0:t.expiration;return{offlineUri:null,originalManifestUri:e,duration:t.presentationTimeline.Y(),size:0,expiration:n,tracks:t=vl(t.periods[0]),appMetadata:r}}(i,n,o),l=n.periods.some((function(e){return e.variants.some((function(e){return e.drmInfos&&e.drmInfos.length}))})),u=n.periods.some((function(e){return e.variants.some((function(e){return e.drmInfos.some((function(e){return e.initData&&e.initData.length}))}))})),d=null,(c=l&&!u)&&(h=r.a,d=Fl.get(h.keySystem)),m=new Ia(e.b,(function(t,r){s.size=r,e.a.offline.progressCallback(s,t)}),(function(t,n){c&&e.a.offline.usePersistentLicense&&d==n&&bt(r,"cenc",t)})),C(a,2),y=g=function(e,t,r,n,i,o,a){var s=new bl,l=i.periods.map((function(n){return function(e,t,r,n,i,o){for(var a=f(o.variants),s=a.next();!s.done;s=a.next())_l(n,s.value);for(a=f(o.textStreams),s=a.next();!s.done;s=a.next())n.a[s.value.id]=52;a=function(e){for(var t=new Set,r=f(e.textStreams),n=r.next();!n.done;n=r.next())t.add(n.value);for(e=f(e.variants),r=e.next();!r.done;r=e.next())(r=r.value).audio&&t.add(r.audio),r.video&&t.add(r.video);return t}(o);var l=new Map;for(a=f(a),s=a.next();!s.done;s=a.next()){s=s.value;var u=Il(e,t,r,n,i,s);l.set(s.id,u)}return o.variants.forEach((function(e){e.audio&&l.get(e.audio.id).variantIds.push(e.id),e.video&&l.get(e.video.id).variantIds.push(e.id)})),{startTime:o.startTime,streams:Array.from(l.values())}}(e,t,r,s,i,n)})),u=n.a,c=e.a.offline.usePersistentLicense;return u&&c&&(u.initData=[]),{originalManifestUri:o,duration:i.presentationTimeline.Y(),size:0,expiration:n.Lb(),periods:l,sessionIds:c?Et(n):[],drmInfo:u,appMetadata:a}}(e,m,t,r,n,i,o),S(a,function(e){return p((function t(){return M(t,(function(t){switch(t.j){case 1:return S(t,Promise.all(e.b.values()),2);case 2:return t.return(e.a.a)}}))}))}(m),4);case 4:if(y.size=a.o,g.expiration=r.Lb(),v=Et(r),g.sessionIds=e.a.offline.usePersistentLicense?v:[],l&&e.a.offline.usePersistentLicense&&!v.length)throw new me(2,9,9007);return a.return(g);case 2:return L(a),S(a,m.destroy(),5);case 5:j(a,0)}}))}))}(e,l.ba,a,o,t,r),10);case 10:if(c=i.o,Ol(e),u)throw u;return S(i,l.ba.addManifests([c]),11);case 11:return d=i.o,Ol(e),h=new rs("manifest",l.path.wa,l.path.ba,d[0]),i.return(yl(h,c));case 4:return L(i),e.f=!1,e.c=[],S(i,s.destroy(),12);case 12:if(!a){i.A(13);break}return S(i,a.destroy(),13);case 13:j(i,0);break;case 3:if(m=R(i),!l){i.A(15);break}return S(i,l.ba.removeSegments(e.c,(function(){})),15);case 15:throw u||m}}))}))}(this,e,t||{},(function(){return p((function t(){var i,o;return M(t,(function(t){switch(t.j){case 1:return r&&"string"!=typeof r?(Kr("Storing with a manifest parser factory","Please register a manifest parser and for the mime-type."),i=r,t.return(new i)):S(t,gi.create(e,n.b,n.a.manifest.retryParameters,r),2);case 2:return o=t.o,t.return(o)}}))}))})))},xl.prototype.store=xl.prototype.store,xl.prototype.kf=function(){return this.f},xl.prototype.getStoreInProgress=xl.prototype.kf,xl.prototype.remove=function(e){return Ml(this,function(e,t){return p((function r(){var n,i,o,a,s,l;return M(r,(function(r){switch(r.j){case 1:return Dl(),null==(n=ns(t))||"manifest"!=n.a?r.return(Promise.reject(new me(2,9,9004,t))):(i=n,o=new Ya,C(r,2),S(r,o.init(),4));case 4:return S(r,za(o,i.wa(),i.ba()),5);case 5:return S(r,(a=r.o).getManifests([i.key()]),6);case 6:return s=r.o,l=s[0],S(r,Promise.all([jl(e,l,o),Pl(e,a,i,l)]),2);case 2:return L(r),S(r,o.destroy(),8);case 8:j(r,0)}}))}))}(this,e))},xl.prototype.remove=xl.prototype.remove,xl.prototype.Xf=function(){return Ml(this,function(e){return p((function t(){var r,n,i,o,a,s,l,u,c;return M(t,(function(t){switch(t.j){case 1:return Dl(),r=e.b,n=e.a.drm,i=new Ya,o=!1,C(t,2),S(t,i.init(),4);case 4:for(a=[],function(e,t){e.a.forEach((function(e){t(e.getEmeSessionCell())}))}(i,(function(e){return a.push(e)})),s=Promise.resolve(),l={},u=f(a),c=u.next();!c.done;l={wc:l.wc},c=u.next())l.wc=c.value,s=s.then(function(e){return function(){return p((function t(){var i,a;return M(t,(function(t){switch(t.j){case 1:return S(t,e.wc.getAll(),2);case 2:return i=t.o,S(t,cs(n,r,i),3);case 3:return a=t.o,S(t,e.wc.remove(a),4);case 4:a.length!=i.length&&(o=!0),w(t)}}))}))}}(l));return S(t,s,2);case 2:return L(t),S(t,i.destroy(),6);case 6:j(t,3);break;case 3:return t.return(!o)}}))}))}(this))},xl.prototype.removeEmeSessions=xl.prototype.Xf,xl.prototype.list=function(){return Ml(this,p((function e(){var t,r,n;return M(e,(function(e){switch(e.j){case 1:return Dl(),t=[],r=new Ya,C(e,2),S(e,r.init(),4);case 4:return n=Promise.resolve(),function(e,t){e.a.forEach((function(e,r){e.getCells().forEach((function(e,n){t({wa:r,ba:n},e)}))}))}(r,(function(e,r){n=n.then((function(){return p((function n(){return M(n,(function(n){switch(n.j){case 1:return S(n,r.getAllManifests(),2);case 2:n.o.forEach((function(r,n){var i=yl(new rs("manifest",e.wa,e.ba,n),r);t.push(i)})),w(n)}}))}))}))})),S(e,n,2);case 2:return L(e),S(e,r.destroy(),6);case 6:j(e,3);break;case 3:return e.return(t)}}))})))},xl.prototype.list=xl.prototype.list,xl.deleteAll=function(){return p((function e(){var t;return M(e,(function(e){switch(e.j){case 1:return t=new Ya,C(e,2),S(e,t.erase(),2);case 2:return L(e),S(e,t.destroy(),5);case 5:j(e,0)}}))}))};var Fl=(new Map).set("org.w3.clearkey","1077efecc0b24d02ace33c1e52e2fb4b").set("com.widevine.alpha","edef8ba979d64acea3c827dcd51d21ed").set("com.microsoft.playready","9a04f07998404286ab92e65be0885f95").set("com.adobe.primetime","f239e769efa348509c16a903c6932efb");js.offline=Rl,G("shaka.polyfill.installAll",(function(){for(var e=0;e<Kl.length;++e)try{Kl[e].De()}catch(e){q("Error installing polyfill!",e)}}));var Ul,Bl,Kl=[];function Gl(e,t){for(var r={priority:t=t||0,De:e},n=0;n<Kl.length;n++)if(Kl[n].priority<t)return void Kl.splice(n,0,r);Kl.push(r)}function Vl(e){var t=e.type.replace(/^(webkit|moz|MS)/,"").toLowerCase();if("function"==typeof Event)var r=new Event(t,e);else(r=document.createEvent("Event")).initEvent(t,e.bubbles,e.cancelable);e.target.dispatchEvent(r)}function Hl(e,t,r){if("input"==e)switch(this.type){case"range":e="change"}HTMLInputElement.prototype.originalAddEventListener.call(this,e,t,r)}function Yl(){var e=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(t){for(var r=[],n=0;n<arguments.length;++n)r[n]=arguments[n];return(r=e.apply(this,r)).abort=function(){},r}}function zl(e,t){try{var r=new Wl(e,t);return Promise.resolve(r)}catch(e){return Promise.reject(e)}}function Wl(e,t){if(this.keySystem=e,e.startsWith("com.apple.fps"))for(var r=f(t),n=r.next();!n.done;n=r.next()){var i=n.value;if("required"==i.persistentState)n=null;else{n={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:i.initDataTypes,sessionTypes:["temporary"],label:i.label};var o=!1,a=!1;if(i.audioCapabilities)for(var s=f(i.audioCapabilities),l=s.next();!l.done;l=s.next())if((l=l.value).contentType){o=!0;var u=l.contentType.split(";")[0];WebKitMediaKeys.isTypeSupported(this.keySystem,u)&&(n.audioCapabilities.push(l),a=!0)}if(i.videoCapabilities)for(l=(i=f(i.videoCapabilities)).next();!l.done;l=i.next())(s=l.value).contentType&&(o=!0,l=s.contentType.split(";")[0],WebKitMediaKeys.isTypeSupported(this.keySystem,l)&&(n.videoCapabilities.push(s),a=!0));o||(a=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),n=a?n:null}if(n)return void(this.a=n)}throw(r=Error("Unsupported keySystem")).name="NotSupportedError",r.code=DOMException.NOT_SUPPORTED_ERR,r}function $l(e){var t=this.mediaKeys;return t&&t!=e&&Xl(t,null),delete this.mediaKeys,(this.mediaKeys=e)?Xl(e,this):Promise.resolve()}function ql(e){this.b=new WebKitMediaKeys(e),this.a=new Be}function Xl(e,t){if(e.a.$a(),!t)return Promise.resolve();e.a.w(t,"webkitneedkey",Zl);try{return 1<=t.readyState?t.webkitSetMediaKeys(e.b):e.a.da(t,"loadedmetadata",(function(){t.webkitSetMediaKeys(e.b)})),Promise.resolve()}catch(e){return Promise.reject(e)}}function Jl(e){ke.call(this),this.b=null,this.g=e,this.c=this.a=null,this.f=new Be,this.sessionId="",this.expiration=NaN,this.closed=new ge,this.keyStatuses=new eu}function Zl(e){var t=new Event("encrypted");t.initDataType="cenc",t.initData=e.initData,this.dispatchEvent(t)}function Ql(e,t){var r=e.keyStatuses;r.size=null==t?0:1,r.a=t,e.dispatchEvent(new Se("keystatuseschange"))}function eu(){this.size=0,this.a=void 0}function tu(e,t){try{var r=new ru(e,t);return Promise.resolve(r)}catch(e){return Promise.reject(e)}}function ru(e,t){this.keySystem=e;for(var r=!1,n=0;n<t.length;++n){var i=t[n],o={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:i.initDataTypes,sessionTypes:["temporary"],label:i.label},a=!1;if(i.audioCapabilities)for(var s=0;s<i.audioCapabilities.length;++s){var l=i.audioCapabilities[s];if(l.contentType){a=!0;var u=l.contentType.split(";")[0];MSMediaKeys.isTypeSupported(this.keySystem,u)&&(o.audioCapabilities.push(l),r=!0)}}if(i.videoCapabilities)for(s=0;s<i.videoCapabilities.length;++s)(l=i.videoCapabilities[s]).contentType&&(a=!0,u=l.contentType.split(";")[0],MSMediaKeys.isTypeSupported(this.keySystem,u)&&(o.videoCapabilities.push(l),r=!0));if(a||(r=MSMediaKeys.isTypeSupported(this.keySystem,"video/mp4")),"required"==i.persistentState&&(r=!1),r)return void(this.a=o)}throw(r=Error("Unsupported keySystem")).name="NotSupportedError",r.code=DOMException.NOT_SUPPORTED_ERR,r}function nu(e){var t=this.mediaKeys;return t&&t!=e&&ou(t,null),delete this.mediaKeys,(this.mediaKeys=e)?ou(e,this):Promise.resolve()}function iu(e){this.a=new MSMediaKeys(e),this.b=new Be}function ou(e,t){if(e.b.$a(),!t)return Promise.resolve();e.b.w(t,"msneedkey",su);var r=e;try{return 1<=t.readyState?t.msSetMediaKeys(e.a):t.addEventListener("loadedmetadata",(function e(){t.msSetMediaKeys(r.a),t.removeEventListener("loadedmetadata",e)})),Promise.resolve()}catch(e){return Promise.reject(e)}}function au(e){ke.call(this),this.c=null,this.g=e,this.b=this.a=null,this.f=new Be,this.sessionId="",this.expiration=NaN,this.closed=new ge,this.keyStatuses=new uu}function su(e){if(e.initData){var t=document.createEvent("CustomEvent");t.initCustomEvent("encrypted",!1,!1,null),t.initDataType="cenc",t.initData=function(e){if(!e)return e;var t=new Un(e);if(1>=t.data.length)return e;e=[];for(var r={},n=(t=f(t.data)).next();!n.done;r={lc:r.lc},n=t.next())r.lc=n.value,e.some(function(e){return function(t){return ht.za(t,e.lc)}}(r))||e.push(r.lc);return ht.concat.apply(ht,e instanceof Array?e:function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(f(e)))}(e.initData),this.dispatchEvent(t)}}function lu(e,t){var r=e.keyStatuses;r.size=null==t?0:1,r.a=t,e.dispatchEvent(new Se("keystatuseschange"))}function uu(){this.size=0,this.a=void 0}function cu(){return Promise.reject(Error("The key system specified is not supported."))}function du(e){return null==e?Promise.resolve():Promise.reject(Error("MediaKeys not supported."))}function fu(){throw new TypeError("Illegal constructor.")}function hu(){throw new TypeError("Illegal constructor.")}G("shaka.polyfill.register",Gl),Gl((function(){Sc()}),-1),Gl((function(){if(e.Document){var t=Element.prototype;t.requestFullscreen=t.requestFullscreen||t.mozRequestFullScreen||t.msRequestFullscreen||t.webkitRequestFullscreen,(t=Document.prototype).exitFullscreen=t.exitFullscreen||t.mozCancelFullScreen||t.msExitFullscreen||t.webkitExitFullscreen,"fullscreenElement"in document||(Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}})),document.addEventListener("webkitfullscreenchange",Vl),document.addEventListener("webkitfullscreenerror",Vl),document.addEventListener("mozfullscreenchange",Vl),document.addEventListener("mozfullscreenerror",Vl),document.addEventListener("MSFullscreenChange",Vl),document.addEventListener("MSFullscreenError",Vl)}})),Gl((function(){var t=!1;if(rt("CrKey"))t=!0;else try{e.indexedDB&&(t=!1)}catch(e){t=!0}t&&delete e.indexedDB})),Gl((function(){rt("Trident/")&&!HTMLInputElement.prototype.originalAddEventListener&&(HTMLInputElement.prototype.originalAddEventListener=HTMLInputElement.prototype.addEventListener,HTMLInputElement.prototype.addEventListener=Hl)})),Gl((function(){navigator.languages||Object.defineProperty(navigator,"languages",{get:function(){return navigator.language?[navigator.language]:["en"]}})})),Gl((function(){})),Gl((function(){var t=tt();e.MediaSource&&(e.cast&&cast.__platform__&&cast.__platform__.canDisplayType?function(){var e=MediaSource.isTypeSupported,t=/^dv(?:h[e1]|a[v1])\./;MediaSource.isTypeSupported=function(r){for(var n=r.split(/ *; */),i=n[0],o={},a=1;a<n.length;++a){var s=n[a].split("="),l=s[0];s=s[1].replace(/"(.*)"/,"$1"),o[l]=s}if(!(n=o.codecs))return e(r);var u=!1,c=!1;for(var d in r=n.split(",").filter((function(e){return t.test(e)&&(c=!0),/^(hev|hvc)1\.2/.test(e)&&(u=!0),!0})),c&&(u=!1),o.codecs=r.join(","),u&&(o.eotf="smpte2084"),o)i+="; "+d+'="'+o[d]+'"';return cast.__platform__.canDisplayType(i)}}():t?(function(){var e=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(t){return"mp2t"!=t.split(/ *; */)[0].split("/")[1].toLowerCase()&&e(t)}}(),12>=t?(Yl(),function(){var e=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(t,r){return e.call(this,t,r-.001)}}()):Yl()):rt("Tizen")&&function(){var e=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(t){return"opus"!=Xe(t)[0]&&e(t)}}())})),Wl.prototype.createMediaKeys=function(){var e=new ql(this.keySystem);return Promise.resolve(e)},Wl.prototype.getConfiguration=function(){return this.a},ql.prototype.createSession=function(e){if("temporary"!=(e=e||"temporary"))throw new TypeError("Session type "+e+" is unsupported on this platform.");return new Jl(this.b,e)},ql.prototype.setServerCertificate=function(e){return e&&new Uint8Array(e),Promise.resolve(!0)},V(Jl,ke),(n=Jl.prototype).generateRequest=function(e,t){this.a=new ge;try{this.b=this.g.createSession("video/mp4",new Uint8Array(t)),this.sessionId=this.b.sessionId||"",this.f.w(this.b,"webkitkeymessage",this.og.bind(this)),this.f.w(this.b,"webkitkeyadded",this.mg.bind(this)),this.f.w(this.b,"webkitkeyerror",this.ng.bind(this)),Ql(this,"status-pending")}catch(e){this.a.reject(e)}return this.a},n.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},n.update=function(e){this.c=new ge;try{this.b.update(new Uint8Array(e))}catch(e){this.c.reject(e)}return this.c},n.close=function(){try{this.b.close(),this.closed.resolve(),this.f.$a()}catch(e){this.closed.reject(e)}return this.closed},n.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))},n.og=function(e){this.a&&(this.a.resolve(),this.a=null),this.dispatchEvent(new Se("message",{messageType:null==this.keyStatuses.a?"license-request":"license-renewal",message:e.message.buffer}))},n.mg=function(){this.c&&(Ql(this,"usable"),this.c.resolve(),this.c=null)},n.ng=function(){var e=Error("EME PatchedMediaKeysApple key error");if(e.errorCode=this.b.error,null!=this.a)this.a.reject(e),this.a=null;else if(null!=this.c)this.c.reject(e),this.c=null;else switch(this.b.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:Ql(this,"output-not-allowed");break;default:Ql(this,"internal-error")}},(n=eu.prototype).forEach=function(e){this.a&&e(this.a,Ul)},n.get=function(e){if(this.has(e))return this.a},n.has=function(e){var t=Ul;return!(!this.a||!ht.za(new Uint8Array(e),new Uint8Array(t)))},n.entries=function(){},n.keys=function(){},n.values=function(){},Gl((function(){e.HTMLVideoElement&&e.WebKitMediaKeys&&(Ul=new Uint8Array([0]).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=$l,e.MediaKeys=ql,e.MediaKeySystemAccess=Wl,navigator.requestMediaKeySystemAccess=zl)})),ru.prototype.createMediaKeys=function(){var e=new iu(this.keySystem);return Promise.resolve(e)},ru.prototype.getConfiguration=function(){return this.a},iu.prototype.createSession=function(e){if("temporary"!=(e=e||"temporary"))throw new TypeError("Session type "+e+" is unsupported on this platform.");return new au(this.a,e)},iu.prototype.setServerCertificate=function(){return Promise.resolve(!1)},V(au,ke),(n=au.prototype).generateRequest=function(e,t){this.a=new ge;try{this.c=this.g.createSession("video/mp4",new Uint8Array(t),null),this.f.w(this.c,"mskeymessage",this.If.bind(this)),this.f.w(this.c,"mskeyadded",this.Gf.bind(this)),this.f.w(this.c,"mskeyerror",this.Hf.bind(this)),lu(this,"status-pending")}catch(e){this.a.reject(e)}return this.a},n.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))},n.update=function(e){this.b=new ge;try{this.c.update(new Uint8Array(e))}catch(e){this.b.reject(e)}return this.b},n.close=function(){try{this.c.close(),this.closed.resolve(),this.f.$a()}catch(e){this.closed.reject(e)}return this.closed},n.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))},n.If=function(e){this.a&&(this.a.resolve(),this.a=null),this.dispatchEvent(new Se("message",{messageType:null==this.keyStatuses.a?"license-request":"license-renewal",message:e.message.buffer}))},n.Gf=function(){this.a?(lu(this,"usable"),this.a.resolve(),this.a=null):this.b&&(lu(this,"usable"),this.b.resolve(),this.b=null)},n.Hf=function(){var e=Error("EME PatchedMediaKeysMs key error");if(e.errorCode=this.c.error,null!=this.a)this.a.reject(e),this.a=null;else if(null!=this.b)this.b.reject(e),this.b=null;else switch(this.c.error.code){case MSMediaKeyError.MS_MEDIA_KEYERR_OUTPUT:case MSMediaKeyError.MS_MEDIA_KEYERR_HARDWARECHANGE:lu(this,"output-not-allowed");break;default:lu(this,"internal-error")}},(n=uu.prototype).forEach=function(e){this.a&&e(this.a,Bl)},n.get=function(e){if(this.has(e))return this.a},n.has=function(e){var t=Bl;return!(!this.a||!ht.za(new Uint8Array(e),new Uint8Array(t)))},n.entries=function(){},n.keys=function(){},n.values=function(){},Gl((function(){!e.HTMLVideoElement||!e.MSMediaKeys||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(Bl=new Uint8Array([0]).buffer,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=nu,e.MediaKeys=iu,e.MediaKeySystemAccess=ru,navigator.requestMediaKeySystemAccess=tu)})),fu.prototype.createSession=function(){},fu.prototype.setServerCertificate=function(){},hu.prototype.getConfiguration=function(){},hu.prototype.createMediaKeys=function(){},Gl((function(){!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||(navigator.requestMediaKeySystemAccess=cu,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=du,e.MediaKeys=fu,e.MediaKeySystemAccess=hu)}),-10);var pu,mu="";function gu(e){return mu?mu+e.charAt(0).toUpperCase()+e.slice(1):e}function yu(e,t){try{var r=new bu(e,t);return Promise.resolve(r)}catch(e){return Promise.reject(e)}}function vu(e){var t=this.mediaKeys;return t&&t!=e&&Au(t,null),delete this.mediaKeys,(this.mediaKeys=e)&&Au(e,this),Promise.resolve()}function bu(e,t){this.a=this.keySystem=e;var r=!1;"org.w3.clearkey"==e&&(this.a="webkit-org.w3.clearkey",r=!1);var n=!1,i=document.getElementsByTagName("video");i=i.length?i[0]:document.createElement("video");for(var o=0;o<t.length;++o){var a=t[o],s={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:a.initDataTypes,sessionTypes:["temporary"],label:a.label},l=!1;if(a.audioCapabilities)for(var u=0;u<a.audioCapabilities.length;++u){var c=a.audioCapabilities[u];if(c.contentType){l=!0;var d=c.contentType.split(";")[0];i.canPlayType(d,this.a)&&(s.audioCapabilities.push(c),n=!0)}}if(a.videoCapabilities)for(u=0;u<a.videoCapabilities.length;++u)(c=a.videoCapabilities[u]).contentType&&(l=!0,i.canPlayType(c.contentType,this.a)&&(s.videoCapabilities.push(c),n=!0));if(l||(n=i.canPlayType("video/mp4",this.a)||i.canPlayType("video/webm",this.a)),"required"==a.persistentState&&(r?(s.persistentState="required",s.sessionTypes=["persistent-license"]):n=!1),n)return void(this.b=s)}throw r="Unsupported keySystem","org.w3.clearkey"!=e&&"com.widevine.alpha"!=e||(r="None of the requested configurations were supported."),(r=Error(r)).name="NotSupportedError",r.code=DOMException.NOT_SUPPORTED_ERR,r}function _u(e){this.g=e,this.b=null,this.a=new Be,this.c=[],this.f={}}function Au(e,t){e.b=t,e.a.$a();var r=mu;t&&(e.a.w(t,r+"needkey",e.Mf.bind(e)),e.a.w(t,r+"keymessage",e.rg.bind(e)),e.a.w(t,r+"keyadded",e.pg.bind(e)),e.a.w(t,r+"keyerror",e.qg.bind(e)))}function Eu(e,t){var r=e.f[t];return r||((r=e.c.shift())?(r.sessionId=t,e.f[t]=r):null)}function Tu(e,t,r){ke.call(this),this.f=e,this.h=!1,this.a=this.b=null,this.c=t,this.g=r,this.sessionId="",this.expiration=NaN,this.closed=new ge,this.keyStatuses=new ku}function Su(e,t,r){if(e.h)return Promise.reject(Error("The session is already initialized."));e.h=!0;try{if("persistent-license"==e.g)if(r)var n=new Uint8Array(ut("LOAD_SESSION|"+r));else{var i=ut("PERSISTENT|"),o=new Uint8Array(i.byteLength+t.byteLength);o.set(new Uint8Array(i),0),o.set(new Uint8Array(t),i.byteLength),n=o}else n=new Uint8Array(t)}catch(e){return Promise.reject(e)}e.b=new ge;var a=gu("generateKeyRequest");try{e.f[a](e.c,n)}catch(t){if("InvalidStateError"!=t.name)return e.b=null,Promise.reject(t);new fe((function(){try{e.f[a](e.c,n)}catch(t){e.b.reject(t),e.b=null}})).R(.01)}return e.b}function wu(e,t){var r=e.keyStatuses;r.size=null==t?0:1,r.a=t,e.dispatchEvent(new Se("keystatuseschange"))}function ku(){this.size=0,this.a=void 0}function Cu(e){if("picture-in-picture"==(e=e.target).webkitPresentationMode){document.pictureInPictureElement=e;var t=new Event("enterpictureinpicture");e.dispatchEvent(t)}else document.pictureInPictureElement==e&&(document.pictureInPictureElement=null),t=new Event("leavepictureinpicture"),e.dispatchEvent(t)}function xu(){return this.webkitSupportsPresentationMode("picture-in-picture")?(this.webkitSetPresentationMode("picture-in-picture"),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))}function Ru(){var e=document.pictureInPictureElement;return e?(e.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))}function Lu(){return!!this.hasAttribute("disablePictureInPicture")||!this.webkitSupportsPresentationMode("picture-in-picture")}function ju(e){e?this.setAttribute("disablePictureInPicture",""):this.removeAttribute("disablePictureInPicture")}function Pu(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}function Iu(t,r,n){return new e.TextTrackCue(t,r,n)}function Ou(t,r,n){return new e.TextTrackCue(t+"-"+r+"-"+n,t,r,n)}function Du(){}bu.prototype.createMediaKeys=function(){var e=new _u(this.a);return Promise.resolve(e)},bu.prototype.getConfiguration=function(){return this.b},(n=_u.prototype).createSession=function(e){if("temporary"!=(e=e||"temporary")&&"persistent-license"!=e)throw new TypeError("Session type "+e+" is unsupported on this platform.");var t=this.b||document.createElement("video");return t.src||(t.src="about:blank"),e=new Tu(t,this.g,e),this.c.push(e),e},n.setServerCertificate=function(){return Promise.resolve(!1)},n.Mf=function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("encrypted",!1,!1,null),t.initDataType="webm",t.initData=e.initData,this.b.dispatchEvent(t)},n.rg=function(e){var t=Eu(this,e.sessionId);t&&(e=new Se("message",{messageType:null==t.keyStatuses.a?"licenserequest":"licenserenewal",message:e.message}),t.b&&(t.b.resolve(),t.b=null),t.dispatchEvent(e))},n.pg=function(e){(e=Eu(this,e.sessionId))&&(wu(e,"usable"),e.a&&e.a.resolve(),e.a=null)},n.qg=function(e){var t=Eu(this,e.sessionId);t&&t.handleError(e)},V(Tu,ke),(n=Tu.prototype).handleError=function(e){var t=Error("EME v0.1b key error");t.errorCode=e.errorCode,t.errorCode.systemCode=e.systemCode,!e.sessionId&&this.b?(t.method="generateRequest",45==e.systemCode&&(t.message="Unsupported session type."),this.b.reject(t),this.b=null):e.sessionId&&this.a?(t.method="update",this.a.reject(t),this.a=null):(t=e.systemCode,e.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?wu(this,"output-restricted"):wu(this,1==t?"expired":"internal-error"))},n.yd=function(e,t){if(this.a)this.a.then(this.yd.bind(this,e,t)).catch(this.yd.bind(this,e,t));else{if(this.a=e,"webkit-org.w3.clearkey"==this.c){var r=at(t),n=JSON.parse(r);"oct"!=n.keys[0].kty&&(this.a.reject(Error("Response is not a valid JSON Web Key Set.")),this.a=null),r=ht.Ba(n.keys[0].k),n=ht.Ba(n.keys[0].kid)}else r=new Uint8Array(t),n=null;var i=gu("addKey");try{this.f[i](this.c,r,n,this.sessionId)}catch(e){this.a.reject(e),this.a=null}}},n.generateRequest=function(e,t){return Su(this,t,null)},n.load=function(e){return"persistent-license"==this.g?Su(this,null,e):Promise.reject(Error("Not a persistent session."))},n.update=function(e){var t=new ge;return this.yd(t,e),t},n.close=function(){if("persistent-license"!=this.g){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var e=gu("cancelKeyRequest");try{this.f[e](this.c,this.sessionId)}catch(e){}}return this.closed.resolve(),this.closed},n.remove=function(){return"persistent-license"!=this.g?Promise.reject(Error("Not a persistent session.")):this.close()},(n=ku.prototype).forEach=function(e){this.a&&e(this.a,pu)},n.get=function(e){if(this.has(e))return this.a},n.has=function(e){var t=pu;return!(!this.a||!ht.za(new Uint8Array(e),new Uint8Array(t)))},n.entries=function(){},n.keys=function(){},n.values=function(){},Gl((function(){if(!(!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)mu="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;pu=new Uint8Array([0]).buffer,navigator.requestMediaKeySystemAccess=yu,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=vu,e.MediaKeys=_u,e.MediaKeySystemAccess=bu}})),Gl((function(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;t.requestPictureInPicture&&document.exitPictureInPicture||!t.webkitSupportsPresentationMode||(document.pictureInPictureEnabled=!0,document.pictureInPictureElement=null,t.requestPictureInPicture=xu,Object.defineProperty(t,"disablePictureInPicture",{get:Lu,set:ju,enumerable:!0,configurable:!0}),document.exitPictureInPicture=Ru,document.addEventListener("webkitpresentationmodechanged",Cu,!0))}})),Gl((function(){if(e.HTMLMediaElement){var t=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var e=t.apply(this);return e&&e.catch((function(){})),e}}})),Gl((function(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;!t.getVideoPlaybackQuality&&"webkitDroppedFrameCount"in t&&(t.getVideoPlaybackQuality=Pu)}})),Gl((function(){if(!e.VTTCue&&e.TextTrackCue){var t=TextTrackCue.length;if(3==t)e.VTTCue=Iu;else if(6==t)e.VTTCue=Ou;else{try{var r=!!Iu(1,2,"")}catch(e){r=!1}r&&(e.VTTCue=Iu)}}})),G("shaka.text.TtmlTextParser",Du),Du.prototype.parseInit=function(){},Du.prototype.parseInit=Du.prototype.parseInit,Du.prototype.parseMedia=function(e,t){var r=at(e),n=[],i=new DOMParser,o=null;if(""==r)return n;try{o=i.parseFromString(r,"text/xml")}catch(e){throw new me(2,2,2005,"Failed to parse TTML.")}if(o){if(r=o.getElementsByTagName("parsererror")[0])throw new me(2,2,2005,r.textContent);if(!(i=o.getElementsByTagName("tt")[0]))throw new me(2,2,2005,"TTML does not contain <tt> tag.");var a=Bn.getAttributeNS(i,"http://www.w3.org/ns/ttml#parameter","frameRate"),s=Bn.getAttributeNS(i,"http://www.w3.org/ns/ttml#parameter","subFrameRate"),l=Bn.getAttributeNS(i,"http://www.w3.org/ns/ttml#parameter","frameRateMultiplier"),u=Bn.getAttributeNS(i,"http://www.w3.org/ns/ttml#parameter","tickRate");if(o=i.getAttribute("xml:space")||"default",r=i.getAttribute("tts:extent"),"default"!=o&&"preserve"!=o)throw new me(2,2,2005,"Invalid xml:space value: "+o);o="default"==o,a=new ic(a,s,l,u),s=qu(i.getElementsByTagName("metadata")[0]),l=qu(i.getElementsByTagName("styling")[0]),u=qu(i.getElementsByTagName("layout")[0]);for(var c=[],d=0;d<u.length;d++){var h,p,m=u[d],g=l,y=r,v=new ur,b=m.getAttribute("xml:id");b?(v.id=b,b=null,y&&(b=Fu.exec(y)||Bu.exec(y)),y=b?Number(b[1]):null,b=b?Number(b[2]):null,(h=Qu(m,g,"extent"))&&null!=(h=(p=Fu.exec(h))||Bu.exec(h))&&(v.width=null!=y?100*Number(h[1])/y:Number(h[1]),v.height=null!=b?100*Number(h[2])/b:Number(h[2]),v.widthUnits=p||null!=y?cr:0,v.heightUnits=p||null!=b?cr:0),(m=Qu(m,g,"origin"))&&null!=(h=(p=Fu.exec(m))||Bu.exec(m))&&(v.viewportAnchorX=null!=b?100*Number(h[1])/b:Number(h[1]),v.viewportAnchorY=null!=y?100*Number(h[2])/y:Number(h[2]),v.viewportAnchorUnits=p||null!=y?cr:0)):v=null,v&&c.push(v)}for(r=(r=i.getElementsByTagName("body")[0])?Array.from(r.querySelectorAll("[begin]")):[],i=(r=f(r)).next();!i.done;i=r.next())(i=Xu(i.value,t.periodStart,a,s,l,u,c,o,!1))&&n.push(i)}return n},Du.prototype.parseMedia=Du.prototype.parseMedia;var Mu,Nu,Fu=/^(\d{1,2}(?:\.\d+)?|100)% (\d{1,2}(?:\.\d+)?|100)%$/,Uu=/^(\d+px|\d+em)$/,Bu=/^(\d+)px (\d+)px$/,Ku=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Gu=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Vu=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,Hu=/^(\d*(?:\.\d*)?)f$/,Yu=/^(\d*(?:\.\d*)?)t$/,zu=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,Wu={left:ir,center:"center",right:"end",start:ir,end:"end"},$u={left:"line-left",center:"center",right:"line-right"};function qu(e){var t=[];if(!e)return t;for(var r=f(e.childNodes),n=r.next();!n.done;n=r.next())(n=n.value).nodeType==Node.ELEMENT_NODE&&"br"!==n.nodeName&&(n=qu(n),t=t.concat(n));return t.length||t.push(e),t}function Xu(e,t,r,n,i,o,a,s,l){if(l&&"br"==e.nodeName)return(e=new qt(0,0,"")).spacer=!0,e;var u=/^[\s\n]*$/.test(e.textContent),c=e.nodeType==Node.ELEMENT_NODE&&!e.hasAttribute("begin")&&!e.hasAttribute("end");if(e.nodeType!=Node.ELEMENT_NODE||c&&u||c&&!l)return null;u=rc(e.getAttribute("begin"),r),c=rc(e.getAttribute("end"),r);var d=rc(e.getAttribute("dur"),r);if(null==c&&null!=d&&(c=u+d),!l&&(null==u||null==c))throw new me(2,2,2001);if(u+=t,c+=t,d="",l=[],Array.from(e.childNodes).find((function(e){return e.nodeType===Node.TEXT_NODE&&/\w+/.test(e.textContent)})))d=function e(t,r){for(var n="",i=f(t.childNodes),o=i.next();!o.done;o=i.next())"br"==(o=o.value).nodeName&&t.childNodes[0]!==o?n+="\n":o.childNodes&&0<o.childNodes.length?n+=e(o,r):n+=r?o=(o=o.textContent.trim()).replace(/\s+/g," "):o.textContent;return n}(e,s);else for(var h=f(e.childNodes),p=h.next();!p.done;p=h.next())(p=Xu(p.value,t,r,n,i,o,a,s,!0))&&l.push(p);if((t=new qt(u,c,d)).nestedCues=l,(o=tc(e,"region",o,"")[0])&&o.getAttribute("xml:id")){var m=o.getAttribute("xml:id");t.region=a.filter((function(e){return e.id==m}))[0]}return function(e,t,r,n,i){"rtl"==Zu(t,r,i,"direction")&&(e.direction="rtl");var o=Zu(t,r,i,"writingMode");if("tb"==o||"tblr"==o?e.writingMode="vertical-lr":"tbrl"==o?e.writingMode="vertical-rl":"rltb"==o||"rl"==o?e.direction="rtl":o&&(e.direction=tr),(o=Zu(t,r,i,"textAlign"))?(e.positionAlign=$u[o],e.lineAlign=Wu[o],e.textAlign=Zt[o.toUpperCase()]):e.textAlign="start",(o=Zu(t,r,i,"displayAlign"))&&(e.displayAlign=er[o.toUpperCase()]),(o=Zu(t,r,i,"color"))&&(e.color=o),(o=Zu(t,r,i,"backgroundColor"))&&(e.backgroundColor=o),(o=Zu(t,r,i,"fontFamily"))&&(e.fontFamily=o),(o=Zu(t,r,i,"fontWeight"))&&"bold"==o&&(e.fontWeight=700),(o=Zu(t,r,i,"wrapOption"))&&"noWrap"==o&&(e.wrapLine=!1),(o=Zu(t,r,i,"lineHeight"))&&o.match(Uu)&&(e.lineHeight=o),(o=Zu(t,r,i,"fontSize"))&&o.match(Uu)&&(e.fontSize=o),(o=Zu(t,r,i,"fontStyle"))&&(e.fontStyle=lr[o.toUpperCase()]),n){o=n.getAttribute("imagetype");var a=n.getAttribute("encoding");n=n.textContent.trim(),"PNG"==o&&"Base64"==a&&n&&(e.backgroundImage="data:image/png;base64,"+n)}(r=Qu(r,i,"textDecoration"))&&Ju(e,r),(t=ec(t,i,"textDecoration"))&&Ju(e,t)}(t,e,o,n=tc(e,"smpte:backgroundImage",n,"#")[0],i),t}function Ju(e,t){for(var r=t.split(" "),n=0;n<r.length;n++)switch(r[n]){case"underline":e.textDecoration.includes("underline")||e.textDecoration.push("underline");break;case"noUnderline":e.textDecoration.includes("underline")&&Re(e.textDecoration,"underline");break;case"lineThrough":e.textDecoration.includes("lineThrough")||e.textDecoration.push("lineThrough");break;case"noLineThrough":e.textDecoration.includes("lineThrough")&&Re(e.textDecoration,"lineThrough");break;case"overline":e.textDecoration.includes("overline")||e.textDecoration.push("overline");break;case"noOverline":e.textDecoration.includes("overline")&&Re(e.textDecoration,"overline")}}function Zu(e,t,r,n){return(e=ec(e,r,n))?e:Qu(t,r,n)}function Qu(e,t,r){for(var n=qu(e),i=0;i<n.length;i++){var o=Bn.getAttributeNS(n[i],"http://www.w3.org/ns/ttml#styling",r);if(o)return o}return(e=tc(e,"style",t,"")[0])?Bn.getAttributeNS(e,"http://www.w3.org/ns/ttml#styling",r):null}function ec(e,t,r){var n=Bn.getAttributeNS(e,"http://www.w3.org/ns/ttml#styling",r);if(n)return n;for(e=tc(e,"style",t,""),t=null,n=0;n<e.length;n++){var i=Bn.getAttributeNS(e[n],"http://www.w3.org/ns/ttml#styling",r);i&&(t=i)}return t}function tc(e,t,r,n){var i=[];if(!e||1>r.length)return i;var o=e;for(e=null;o&&!(e=o.getAttribute(t))&&(o=o.parentNode)instanceof Element;);if(t=e)for(e=(t=f(t=t.split(" "))).next();!e.done;e=t.next()){e=e.value;for(var a=(o=f(r)).next();!a.done;a=o.next())if(n+(a=a.value).getAttribute("xml:id")==e){i.push(a);break}}return i}function rc(e,t){var r=null;if(Ku.test(e)){r=Ku.exec(e);var n=Number(r[1]),i=Number(r[2]),o=Number(r[3]),a=Number(r[4]);r=(o+=(a+=(Number(r[5])||0)/t.b)/t.frameRate)+60*i+3600*n}else Gu.test(e)?r=nc(Gu,e):Vu.test(e)?r=nc(Vu,e):Hu.test(e)?(r=Hu.exec(e),r=Number(r[1])/t.frameRate):Yu.test(e)?(r=Yu.exec(e),r=Number(r[1])/t.a):zu.test(e)&&(r=nc(zu,e));return r}function nc(e,t){var r=e.exec(t);return null==r||""==r[0]?null:(Number(r[4])||0)/1e3+(Number(r[3])||0)+60*(Number(r[2])||0)+3600*(Number(r[1])||0)}function ic(e,t,r,n){this.frameRate=Number(e)||30,this.b=Number(t)||1,this.a=Number(n),0==this.a&&(this.a=e?this.frameRate*this.b:1),r&&(e=/^(\d+) (\d+)$/g.exec(r))&&(this.frameRate*=Number(e[1])/Number(e[2]))}function oc(){this.a=new Du}function ac(){}function sc(e,t,r){var n;(n=/^align:(start|middle|center|end|left|right)$/.exec(t))?(t=n[1],e.textAlign="middle"==t?Jt:Zt[t.toUpperCase()]):(n=/^vertical:(lr|rl)$/.exec(t))?e.writingMode="lr"==n[1]?"vertical-lr":"vertical-rl":(n=/^size:([\d.]+)%$/.exec(t))?e.size=Number(n[1]):(n=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(t))?(e.position=Number(n[1]),n[2]&&(t=n[2],e.positionAlign="line-left"==t||"start"==t?"line-left":"line-right"==t||"end"==t?"line-right":"center")):(n=/^region:(.*)$/.exec(t))?(t=function(e,t){var r=e.filter((function(e){return e.id==t}));return r.length?r[0]:null}(r,n[1]))&&(e.region=t):(r=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(t))?(e.lineInterpretation=1,e.line=Number(r[1]),r[2]&&(e.lineAlign=or[r[2].toUpperCase()])):(r=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(t))&&(e.lineInterpretation=nr,e.line=Number(r[1]),r[2]&&(e.lineAlign=or[r[2].toUpperCase()]))}function lc(e){if(null==(e=Mi(e,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g)))return null;var t=Number(e[2]),r=Number(e[3]);return 59<t||59<r?null:Number(e[4])/1e3+r+60*t+3600*(Number(e[1])||0)}function uc(){this.a=null}function cc(e,t,r){var n,i,o;return(new In).H("payl",Mn((function(e){n=at(e)}))).H("iden",Mn((function(e){i=at(e)}))).H("sttg",Mn((function(e){o=at(e)}))).parse(e),n?function(e,t,r,n,i){if(e=new qt(n,i,e),t&&(e.id=t),r)for(t=new Oi(r),r=Ni(t);r;)sc(e,r,[]),Di(t),r=Ni(t);return e}(n,i,o,t,r):null} /* @license EME Encryption Scheme Polyfill Copyright 2019 Google LLC SPDX-License-Identifier: Apache-2.0 */ -function dc(){}function fc(){Mu?console.debug("EmeEncryptionSchemePolyfill: Already installed."):navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration?(Mu=navigator.requestMediaKeySystemAccess,console.debug("EmeEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.requestMediaKeySystemAccess=hc):console.debug("EmeEncryptionSchemePolyfill: EME not found")}function hc(e,t){var r=this;return p((function n(){var i;return M(n,(function(n){switch(n.j){case 1:return console.assert(r==navigator,'bad "this" for requestMediaKeySystemAccess'),S(n,Mu.call(r,e,t),2);case 2:return Ec(i=n.o)?(console.debug("EmeEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.requestMediaKeySystemAccess=Mu,n.return(i)):(console.debug("EmeEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.requestMediaKeySystemAccess=pc,n.return(pc.call(r,e,t)))}}))}))}function pc(e,t){var r=this;return p((function n(){var i,o,a,s,l,u,c,d;return M(n,(function(n){switch(n.j){case 1:console.assert(r==navigator,'bad "this" for requestMediaKeySystemAccess'),i=Ac(e),o=[];for(var h=f(t),p=h.next();!p.done;p=h.next())a=p.value,s=mc(a.videoCapabilities,i),l=mc(a.audioCapabilities,i),a.videoCapabilities&&a.videoCapabilities.length&&!s.length||a.audioCapabilities&&a.audioCapabilities.length&&!l.length||((u=Object.assign({},a)).videoCapabilities=s,u.audioCapabilities=l,o.push(u));if(!o.length)throw(c=Error("Unsupported keySystem or supportedConfigurations.")).name="NotSupportedError",c.code=DOMException.NOT_SUPPORTED_ERR,c;return S(n,Mu.call(r,e,o),2);case 2:return d=n.o,n.return(new _c(d,i))}}))}))}function mc(e,t){return e?e.filter((function(e){return!e.encryptionScheme||e.encryptionScheme==t})):e}function gc(){}function yc(){navigator.mediaCapabilities?(Nu=navigator.mediaCapabilities.decodingInfo,console.debug("McEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=vc):console.debug("McEncryptionSchemePolyfill: MediaCapabilities not found")}function vc(e){var t=this;return p((function r(){var n;return M(r,(function(r){switch(r.j){case 1:return console.assert(t==navigator.mediaCapabilities,'bad "this" for decodingInfo'),S(r,Nu.call(t,e),2);case 2:return n=r.o,e.keySystemConfiguration?Ec(n.keySystemAccess)?(console.debug("McEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.mediaCapabilities.decodingInfo=Nu,r.return(n)):(console.debug("McEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=bc,r.return(bc.call(t,e))):r.return(n)}}))}))}function bc(e){var t=this;return p((function r(){var n,i,o,a,s,l,u;return M(r,(function(r){switch(r.j){case 1:return console.assert(t==navigator.mediaCapabilities,'bad "this" for decodingInfo'),n=null,e.keySystemConfiguration&&(i=e.keySystemConfiguration,o=i.keySystem,a=i.audio&&i.audio.encryptionScheme,s=i.video&&i.video.encryptionScheme,n=Ac(o),l={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:e},a&&a!=n||s&&s!=n)?r.return(l):S(r,Nu.call(t,e),2);case 2:return(u=r.o).keySystemAccess&&(u.keySystemAccess=new _c(u.keySystemAccess,n)),r.return(u)}}))}))}function _c(e,t){this.b=e,this.a=t,this.keySystem=e.keySystem}function Ac(e){return e.startsWith("com.widevine")||e.startsWith("com.microsoft")||e.startsWith("com.adobe")||e.startsWith("org.w3")?"cenc":e.startsWith("com.apple")?"cbcs-1-9":(console.warn("EmeEncryptionSchemePolyfill: Unknown key system:",e,"Please contribute!"),null)}function Ec(e){var t=(e=e.getConfiguration()).audioCapabilities&&e.audioCapabilities[0];return!(!(e=e.videoCapabilities&&e.videoCapabilities[0]||t)||void 0===e.encryptionScheme)}function Tc(){}function Sc(){fc(),yc()}hr["application/ttml+xml"]=Du,G("shaka.text.Mp4TtmlParser",oc),oc.prototype.parseInit=function(e){var t=!1;if((new In).H("moov",On).H("trak",On).H("mdia",On).H("minf",On).H("stbl",On).fa("stsd",Dn).H("stpp",(function(e){t=!0,e.parser.stop()})).parse(e),!t)throw new me(2,2,2007)},oc.prototype.parseInit=oc.prototype.parseInit,oc.prototype.parseMedia=function(e,t){var r=!1,n=[];if((new In).H("mdat",Mn(function(e){r=!0,n=n.concat(this.a.parseMedia(e,t))}.bind(this))).parse(e),!r)throw new me(2,2,2007);return n},oc.prototype.parseMedia=oc.prototype.parseMedia,hr['application/mp4; codecs="stpp"']=oc,hr['application/mp4; codecs="stpp.ttml.im1t"']=oc,hr['application/mp4; codecs="stpp.TTML.im1t"']=oc,G("shaka.text.VttTextParser",ac),ac.prototype.parseInit=function(){},ac.prototype.parseInit=ac.prototype.parseInit,ac.prototype.parseMedia=function(e,t){var r=at(e);if(r=(r=r.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n")).split(/\n{2,}/m),!/^WEBVTT($|[ \t\n])/m.test(r[0]))throw new me(2,2,2e3);var n=t.segmentStart;if(null==n&&(n=0,r[0].includes("X-TIMESTAMP-MAP"))){var i=r[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),o=r[0].match(/MPEGTS:(\d+)/m);if(i&&o){if(null==(n=lc(new Oi(i[1]))))throw new me(2,2,2e3);n=t.periodStart+(Number(o[1])/9e4-n)}}o=[];var a=r[0].split("\n");for(i=1;i<a.length;i++)if(/^Region:/.test(a[i])){var s=new Oi(a[i]),l=new ur;Ni(s),Di(s);for(var u=Ni(s);u;){var c=l,d=u;(u=/^id=(.*)$/.exec(d))?c.id=u[1]:(u=/^width=(\d{1,2}|100)%$/.exec(d))?c.width=Number(u[1]):(u=/^lines=(\d+)$/.exec(d))?(c.height=Number(u[1]),c.heightUnits=2):(u=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(d))?(c.regionAnchorX=Number(u[1]),c.regionAnchorY=Number(u[2])):(u=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(d))?(c.viewportAnchorX=Number(u[1]),c.viewportAnchorY=Number(u[2])):/^scroll=up$/.exec(d)&&(c.scroll="up"),Di(s),u=Ni(s)}o.push(l)}for(i=[],s=1;s<r.length;s++){if(u=a=r[s].split("\n"),d=n,a=o,1==u.length&&!u[0]||/^NOTE($|[ \t])/.test(u[0])||"STYLE"==u[0])a=null;else{l=null,u[0].includes("--\x3e")||(l=u[0],u.splice(0,1));var f=lc(c=new Oi(u[0])),h=Mi(c,/[ \t]+--\x3e[ \t]+/g),p=lc(c);if(null==f||null==h||null==p)throw new me(2,2,2001);for(u=new qt(f+d,p+d,u.slice(1).join("\n").trim()),Di(c),d=Ni(c);d;)sc(u,d,a),Di(c),d=Ni(c);null!=l&&(u.id=l),a=u}a&&i.push(a)}return i},ac.prototype.parseMedia=ac.prototype.parseMedia,hr["text/vtt"]=ac,hr['text/vtt; codecs="vtt"']=ac,G("shaka.text.Mp4VttParser",uc),uc.prototype.parseInit=function(e){var t=!1;if((new In).H("moov",On).H("trak",On).H("mdia",On).fa("mdhd",function(e){0==e.version?(e.reader.M(4),e.reader.M(4),this.a=e.reader.G(),e.reader.M(4)):(e.reader.M(8),e.reader.M(8),this.a=e.reader.G(),e.reader.M(8)),e.reader.M(4)}.bind(this)).H("minf",On).H("stbl",On).fa("stsd",Dn).H("wvtt",(function(){t=!0})).parse(e),!this.a)throw new me(2,2,2008);if(!t)throw new me(2,2,2008)},uc.prototype.parseInit=uc.prototype.parseInit,uc.prototype.parseMedia=function(e,t){var r=this;if(!this.a)throw new me(2,2,2008);var n,i=0,o=[],a=[],s=!1,l=!1,u=!1,c=null;if((new In).H("moof",On).H("traf",On).fa("tfdt",(function(e){s=!0,i=0==e.version?e.reader.G():e.reader.Bb()})).fa("tfhd",(function(e){var t=e.flags;(e=e.reader).M(4),1&t&&e.M(8),2&t&&e.M(4),c=8&t?e.G():null})).fa("trun",(function(e){l=!0;var t=e.version,r=e.flags,n=(e=e.reader).G();1&r&&e.M(4),4&r&&e.M(4);for(var i=[],a=0;a<n;a++){var s={duration:null,sampleSize:null,Ad:null};256&r&&(s.duration=e.G()),512&r&&(s.sampleSize=e.G()),1024&r&&e.M(4),2048&r&&(s.Ad=0==t?e.G():e.ke()),i.push(s)}o=i})).H("mdat",Mn((function(e){u=!0,n=e}))).parse(e),!u&&!s&&!l)throw new me(2,2,2008);var d=i,f=new Ln(new DataView(n.buffer,n.byteOffset,n.byteLength),0);return o.forEach((function(e){var n=e.duration||c,o=e.Ad?i+e.Ad:d;d=o+(n||0);var s=0;do{var l=f.G();s+=l;var u=null;"vttc"==Un(f.G())?8<l&&(u=f.Za(l-8)):f.M(l-8),n&&u&&a.push(cc(u,t.periodStart+o/r.a,t.periodStart+d/r.a))}while(e.sampleSize&&s<e.sampleSize)})),a.filter(Gt.Ia)},uc.prototype.parseMedia=uc.prototype.parseMedia,hr['application/mp4; codecs="wvtt"']=uc,G("shaka.util.Dom.createHTMLElement",(function(e){return document.createElement(e)})),G("shaka.util.Dom.createVideoElement",(function(){var e=document.createElement("video");return e.muted=!0,e.width=600,e.height=400,e})),G("shaka.util.Dom.asHTMLElement",(function(e){return e})),G("shaka.util.Dom.asHTMLMediaElement",(function(e){return e})),G("shaka.util.Dom.removeAllChildren",(function(e){for(;e.firstChild;)e.removeChild(e.firstChild)})),G("EmeEncryptionSchemePolyfill",dc),dc.install=fc,G("McEncryptionSchemePolyfill",gc),gc.install=yc,_c.prototype.getConfiguration=function(){var e=this.b.getConfiguration();if(e.videoCapabilities)for(var t=f(e.videoCapabilities),r=t.next();!r.done;r=t.next())r.value.encryptionScheme=this.a;if(e.audioCapabilities)for(r=(t=f(e.audioCapabilities)).next();!r.done;r=t.next())r.value.encryptionScheme=this.a;return e},_c.prototype.createMediaKeys=function(){return this.b.createMediaKeys()},G("EncryptionSchemePolyfills",Tc),Tc.install=Sc,r.Ne&&(r.Ne=Tc)}.call(i,n,n),i.shaka)t[o]=i.shaka[o]}()}).call(this,r(/*! ./../../webpack/buildin/global.js */"./node_modules/webpack/buildin/global.js"),r(/*! ./../../webpack/buildin/module.js */"./node_modules/webpack/buildin/module.js")(e))},"./node_modules/webpack/buildin/global.js": +function dc(){}function fc(){Mu?console.debug("EmeEncryptionSchemePolyfill: Already installed."):navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration?(Mu=navigator.requestMediaKeySystemAccess,console.debug("EmeEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.requestMediaKeySystemAccess=hc):console.debug("EmeEncryptionSchemePolyfill: EME not found")}function hc(e,t){var r=this;return p((function n(){var i;return M(n,(function(n){switch(n.j){case 1:return console.assert(r==navigator,'bad "this" for requestMediaKeySystemAccess'),S(n,Mu.call(r,e,t),2);case 2:return Ec(i=n.o)?(console.debug("EmeEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.requestMediaKeySystemAccess=Mu,n.return(i)):(console.debug("EmeEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.requestMediaKeySystemAccess=pc,n.return(pc.call(r,e,t)))}}))}))}function pc(e,t){var r=this;return p((function n(){var i,o,a,s,l,u,c,d;return M(n,(function(n){switch(n.j){case 1:console.assert(r==navigator,'bad "this" for requestMediaKeySystemAccess'),i=Ac(e),o=[];for(var h=f(t),p=h.next();!p.done;p=h.next())a=p.value,s=mc(a.videoCapabilities,i),l=mc(a.audioCapabilities,i),a.videoCapabilities&&a.videoCapabilities.length&&!s.length||a.audioCapabilities&&a.audioCapabilities.length&&!l.length||((u=Object.assign({},a)).videoCapabilities=s,u.audioCapabilities=l,o.push(u));if(!o.length)throw(c=Error("Unsupported keySystem or supportedConfigurations.")).name="NotSupportedError",c.code=DOMException.NOT_SUPPORTED_ERR,c;return S(n,Mu.call(r,e,o),2);case 2:return d=n.o,n.return(new _c(d,i))}}))}))}function mc(e,t){return e?e.filter((function(e){return!e.encryptionScheme||e.encryptionScheme==t})):e}function gc(){}function yc(){navigator.mediaCapabilities?(Nu=navigator.mediaCapabilities.decodingInfo,console.debug("McEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=vc):console.debug("McEncryptionSchemePolyfill: MediaCapabilities not found")}function vc(e){var t=this;return p((function r(){var n;return M(r,(function(r){switch(r.j){case 1:return console.assert(t==navigator.mediaCapabilities,'bad "this" for decodingInfo'),S(r,Nu.call(t,e),2);case 2:return n=r.o,e.keySystemConfiguration?Ec(n.keySystemAccess)?(console.debug("McEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.mediaCapabilities.decodingInfo=Nu,r.return(n)):(console.debug("McEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=bc,r.return(bc.call(t,e))):r.return(n)}}))}))}function bc(e){var t=this;return p((function r(){var n,i,o,a,s,l,u;return M(r,(function(r){switch(r.j){case 1:return console.assert(t==navigator.mediaCapabilities,'bad "this" for decodingInfo'),n=null,e.keySystemConfiguration&&(i=e.keySystemConfiguration,o=i.keySystem,a=i.audio&&i.audio.encryptionScheme,s=i.video&&i.video.encryptionScheme,n=Ac(o),l={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:e},a&&a!=n||s&&s!=n)?r.return(l):S(r,Nu.call(t,e),2);case 2:return(u=r.o).keySystemAccess&&(u.keySystemAccess=new _c(u.keySystemAccess,n)),r.return(u)}}))}))}function _c(e,t){this.b=e,this.a=t,this.keySystem=e.keySystem}function Ac(e){return e.startsWith("com.widevine")||e.startsWith("com.microsoft")||e.startsWith("com.adobe")||e.startsWith("org.w3")?"cenc":e.startsWith("com.apple")?"cbcs-1-9":(console.warn("EmeEncryptionSchemePolyfill: Unknown key system:",e,"Please contribute!"),null)}function Ec(e){var t=(e=e.getConfiguration()).audioCapabilities&&e.audioCapabilities[0];return!(!(e=e.videoCapabilities&&e.videoCapabilities[0]||t)||void 0===e.encryptionScheme)}function Tc(){}function Sc(){fc(),yc()}hr["application/ttml+xml"]=Du,G("shaka.text.Mp4TtmlParser",oc),oc.prototype.parseInit=function(e){var t=!1;if((new In).H("moov",On).H("trak",On).H("mdia",On).H("minf",On).H("stbl",On).fa("stsd",Dn).H("stpp",(function(e){t=!0,e.parser.stop()})).parse(e),!t)throw new me(2,2,2007)},oc.prototype.parseInit=oc.prototype.parseInit,oc.prototype.parseMedia=function(e,t){var r=!1,n=[];if((new In).H("mdat",Mn(function(e){r=!0,n=n.concat(this.a.parseMedia(e,t))}.bind(this))).parse(e),!r)throw new me(2,2,2007);return n},oc.prototype.parseMedia=oc.prototype.parseMedia,hr['application/mp4; codecs="stpp"']=oc,hr['application/mp4; codecs="stpp.ttml.im1t"']=oc,hr['application/mp4; codecs="stpp.TTML.im1t"']=oc,G("shaka.text.VttTextParser",ac),ac.prototype.parseInit=function(){},ac.prototype.parseInit=ac.prototype.parseInit,ac.prototype.parseMedia=function(e,t){var r=at(e);if(r=(r=r.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n")).split(/\n{2,}/m),!/^WEBVTT($|[ \t\n])/m.test(r[0]))throw new me(2,2,2e3);var n=t.segmentStart;if(null==n&&(n=0,r[0].includes("X-TIMESTAMP-MAP"))){var i=r[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),o=r[0].match(/MPEGTS:(\d+)/m);if(i&&o){if(null==(n=lc(new Oi(i[1]))))throw new me(2,2,2e3);n=t.periodStart+(Number(o[1])/9e4-n)}}o=[];var a=r[0].split("\n");for(i=1;i<a.length;i++)if(/^Region:/.test(a[i])){var s=new Oi(a[i]),l=new ur;Ni(s),Di(s);for(var u=Ni(s);u;){var c=l,d=u;(u=/^id=(.*)$/.exec(d))?c.id=u[1]:(u=/^width=(\d{1,2}|100)%$/.exec(d))?c.width=Number(u[1]):(u=/^lines=(\d+)$/.exec(d))?(c.height=Number(u[1]),c.heightUnits=2):(u=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(d))?(c.regionAnchorX=Number(u[1]),c.regionAnchorY=Number(u[2])):(u=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(d))?(c.viewportAnchorX=Number(u[1]),c.viewportAnchorY=Number(u[2])):/^scroll=up$/.exec(d)&&(c.scroll="up"),Di(s),u=Ni(s)}o.push(l)}for(i=[],s=1;s<r.length;s++){if(u=a=r[s].split("\n"),d=n,a=o,1==u.length&&!u[0]||/^NOTE($|[ \t])/.test(u[0])||"STYLE"==u[0])a=null;else{l=null,u[0].includes("--\x3e")||(l=u[0],u.splice(0,1));var f=lc(c=new Oi(u[0])),h=Mi(c,/[ \t]+--\x3e[ \t]+/g),p=lc(c);if(null==f||null==h||null==p)throw new me(2,2,2001);for(u=new qt(f+d,p+d,u.slice(1).join("\n").trim()),Di(c),d=Ni(c);d;)sc(u,d,a),Di(c),d=Ni(c);null!=l&&(u.id=l),a=u}a&&i.push(a)}return i},ac.prototype.parseMedia=ac.prototype.parseMedia,hr["text/vtt"]=ac,hr['text/vtt; codecs="vtt"']=ac,G("shaka.text.Mp4VttParser",uc),uc.prototype.parseInit=function(e){var t=!1;if((new In).H("moov",On).H("trak",On).H("mdia",On).fa("mdhd",function(e){0==e.version?(e.reader.M(4),e.reader.M(4),this.a=e.reader.G(),e.reader.M(4)):(e.reader.M(8),e.reader.M(8),this.a=e.reader.G(),e.reader.M(8)),e.reader.M(4)}.bind(this)).H("minf",On).H("stbl",On).fa("stsd",Dn).H("wvtt",(function(){t=!0})).parse(e),!this.a)throw new me(2,2,2008);if(!t)throw new me(2,2,2008)},uc.prototype.parseInit=uc.prototype.parseInit,uc.prototype.parseMedia=function(e,t){var r=this;if(!this.a)throw new me(2,2,2008);var n,i=0,o=[],a=[],s=!1,l=!1,u=!1,c=null;if((new In).H("moof",On).H("traf",On).fa("tfdt",(function(e){s=!0,i=0==e.version?e.reader.G():e.reader.Bb()})).fa("tfhd",(function(e){var t=e.flags;(e=e.reader).M(4),1&t&&e.M(8),2&t&&e.M(4),c=8&t?e.G():null})).fa("trun",(function(e){l=!0;var t=e.version,r=e.flags,n=(e=e.reader).G();1&r&&e.M(4),4&r&&e.M(4);for(var i=[],a=0;a<n;a++){var s={duration:null,sampleSize:null,Ad:null};256&r&&(s.duration=e.G()),512&r&&(s.sampleSize=e.G()),1024&r&&e.M(4),2048&r&&(s.Ad=0==t?e.G():e.ke()),i.push(s)}o=i})).H("mdat",Mn((function(e){u=!0,n=e}))).parse(e),!u&&!s&&!l)throw new me(2,2,2008);var d=i,f=new Ln(new DataView(n.buffer,n.byteOffset,n.byteLength),0);return o.forEach((function(e){var n=e.duration||c,o=e.Ad?i+e.Ad:d;d=o+(n||0);var s=0;do{var l=f.G();s+=l;var u=null;"vttc"==Fn(f.G())?8<l&&(u=f.Za(l-8)):f.M(l-8),n&&u&&a.push(cc(u,t.periodStart+o/r.a,t.periodStart+d/r.a))}while(e.sampleSize&&s<e.sampleSize)})),a.filter(Gt.Ia)},uc.prototype.parseMedia=uc.prototype.parseMedia,hr['application/mp4; codecs="wvtt"']=uc,G("shaka.util.Dom.createHTMLElement",(function(e){return document.createElement(e)})),G("shaka.util.Dom.createVideoElement",(function(){var e=document.createElement("video");return e.muted=!0,e.width=600,e.height=400,e})),G("shaka.util.Dom.asHTMLElement",(function(e){return e})),G("shaka.util.Dom.asHTMLMediaElement",(function(e){return e})),G("shaka.util.Dom.removeAllChildren",(function(e){for(;e.firstChild;)e.removeChild(e.firstChild)})),G("EmeEncryptionSchemePolyfill",dc),dc.install=fc,G("McEncryptionSchemePolyfill",gc),gc.install=yc,_c.prototype.getConfiguration=function(){var e=this.b.getConfiguration();if(e.videoCapabilities)for(var t=f(e.videoCapabilities),r=t.next();!r.done;r=t.next())r.value.encryptionScheme=this.a;if(e.audioCapabilities)for(r=(t=f(e.audioCapabilities)).next();!r.done;r=t.next())r.value.encryptionScheme=this.a;return e},_c.prototype.createMediaKeys=function(){return this.b.createMediaKeys()},G("EncryptionSchemePolyfills",Tc),Tc.install=Sc,r.Ne&&(r.Ne=Tc)}.call(i,n,n),i.shaka)t[o]=i.shaka[o]}()}).call(this,r(/*! ./../../webpack/buildin/global.js */"./node_modules/webpack/buildin/global.js"),r(/*! ./../../webpack/buildin/module.js */"./node_modules/webpack/buildin/module.js")(e))},"./node_modules/webpack/buildin/global.js": /*!***********************************!*\ !*** (webpack)/buildin/global.js ***! \***********************************/ @@ -1427,7 +1427,7 @@ function dc(){}function fc(){Mu?console.debug("EmeEncryptionSchemePolyfill: Alre /*!******************************************************************************************!*\ !*** external {"amd":"clappr","commonjs":"clappr","commonjs2":"clappr","root":"Clappr"} ***! \******************************************************************************************/ -/*! no static exports found */function(t,r){t.exports=e}})},e.exports=n(r(0))},function(e,t,r){var n;"undefined"!=typeof self&&self,n=function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="<%=baseUrl%>/",r(r.s=40)}([function(e,t){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t){var r=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=r)},function(e,t,r){var n=r(10),i=r(29),o=r(15),a=Object.defineProperty;t.f=r(3)?Object.defineProperty:function(e,t,r){if(n(e),t=o(t,!0),n(r),i)try{return a(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){e.exports=!r(11)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){var n=r(2),i=r(12);e.exports=r(3)?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,r){var n=r(56),i=r(17);e.exports=function(e){return n(i(e))}},function(e,t,r){var n=r(22)("wks"),i=r(14),o=r(0).Symbol,a="function"==typeof o;(e.exports=function(e){return n[e]||(n[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=n},function(e,t,r){var n=r(0),i=r(1),o=r(28),a=r(5),s=r(4),l=function(e,t,r){var u,c,d,f=e&l.F,h=e&l.G,p=e&l.S,m=e&l.P,g=e&l.B,y=e&l.W,v=h?i:i[t]||(i[t]={}),b=v.prototype,_=h?n:p?n[t]:(n[t]||{}).prototype;for(u in h&&(r=t),r)(c=!f&&_&&void 0!==_[u])&&s(v,u)||(d=c?_[u]:r[u],v[u]=h&&"function"!=typeof _[u]?r[u]:g&&c?o(d,n):y&&_[u]==d?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(d):m&&"function"==typeof d?o(Function.call,d):d,m&&((v.virtual||(v.virtual={}))[u]=d,e&l.R&&b&&!b[u]&&a(b,u,d)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,r){var n=r(6);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports=!0},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+n).toString(36))}},function(e,t,r){var n=r(6);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){e.exports={}},function(e,t,r){var n=r(10),i=r(55),o=r(23),a=r(21)("IE_PROTO"),s=function(){},l=function(){var e,t=r(30)("iframe"),n=o.length;for(t.style.display="none",r(60).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),l=e.F;n--;)delete l.prototype[o[n]];return l()};e.exports=Object.create||function(e,t){var r;return null!==e?(s.prototype=n(e),r=new s,s.prototype=null,r[a]=e):r=l(),void 0===t?r:i(r,t)}},function(e,t,r){var n=r(34),i=r(23);e.exports=Object.keys||function(e){return n(e,i)}},function(e,t,r){var n=r(22)("keys"),i=r(14);e.exports=function(e){return n[e]||(n[e]=i(e))}},function(e,t,r){var n=r(1),i=r(0),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:n.version,mode:r(13)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,r){var n=r(2).f,i=r(4),o=r(8)("toStringTag");e.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,o)&&n(e,o,{configurable:!0,value:t})}},function(e,t,r){t.f=r(8)},function(e,t,r){var n=r(0),i=r(1),o=r(13),a=r(25),s=r(2).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,r){var n=r(48);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,r){e.exports=!r(3)&&!r(11)((function(){return 7!=Object.defineProperty(r(30)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,r){var n=r(6),i=r(0).document,o=n(i)&&n(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,r){"use strict";t.__esModule=!0;var n=a(r(50)),i=a(r(66)),o="function"==typeof i.default&&"symbol"==typeof n.default?function(e){return typeof e}:function(e){return e&&"function"==typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":typeof e};function a(e){return e&&e.__esModule?e:{default:e}}t.default="function"==typeof i.default&&"symbol"===o(n.default)?function(e){return void 0===e?"undefined":o(e)}:function(e){return e&&"function"==typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":void 0===e?"undefined":o(e)}},function(e,t,r){"use strict";var n=r(13),i=r(9),o=r(33),a=r(5),s=r(18),l=r(54),u=r(24),c=r(61),d=r(8)("iterator"),f=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,r,p,m,g,y){l(r,t,p);var v,b,_,A=function(e){if(!f&&e in w)return w[e];switch(e){case"keys":case"values":return function(){return new r(this,e)}}return function(){return new r(this,e)}},E=t+" Iterator",T="values"==m,S=!1,w=e.prototype,k=w[d]||w["@@iterator"]||m&&w[m],x=k||A(m),C=m?T?A("entries"):x:void 0,R="Array"==t&&w.entries||k;if(R&&(_=c(R.call(new e)))!==Object.prototype&&_.next&&(u(_,E,!0),n||"function"==typeof _[d]||a(_,d,h)),T&&k&&"values"!==k.name&&(S=!0,x=function(){return k.call(this)}),n&&!y||!f&&!S&&w[d]||a(w,d,x),s[t]=x,s[E]=h,m)if(v={values:T?x:A("values"),keys:g?x:A("keys"),entries:C},y)for(b in v)b in w||o(w,b,v[b]);else i(i.P+i.F*(f||S),t,v);return v}},function(e,t,r){e.exports=r(5)},function(e,t,r){var n=r(4),i=r(7),o=r(57)(!1),a=r(21)("IE_PROTO");e.exports=function(e,t){var r,s=i(e),l=0,u=[];for(r in s)r!=a&&n(s,r)&&u.push(r);for(;t.length>l;)n(s,r=t[l++])&&(~o(u,r)||u.push(r));return u}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){var n=r(17);e.exports=function(e){return Object(n(e))}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,r){var n=r(34),i=r(23).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},function(e,t,r){var n=r(27),i=r(12),o=r(7),a=r(15),s=r(4),l=r(29),u=Object.getOwnPropertyDescriptor;t.f=r(3)?u:function(e,t){if(e=o(e),t=a(t,!0),l)try{return u(e,t)}catch(e){}if(s(e,t))return i(!n.f.call(e,t),e[t])}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(41),o=(n=i)&&n.__esModule?n:{default:n};t.default=o.default,e.exports=t.default},function(e,t,r){"use strict";(function(n){Object.defineProperty(t,"__esModule",{value:!0});var i=d(r(43)),o=d(r(44)),a=d(r(49)),s=d(r(76)),l=r(84),u=d(r(85)),c=d(r(86));function d(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(){return(0,i.default)(this,t),(0,a.default)(this,e.apply(this,arguments))}return(0,s.default)(t,e),t.prototype.bindEvents=function(){this.listenTo(this.core,l.Events.CORE_READY,this.bindPlaybackEvents),l.Events.CORE_ACTIVE_CONTAINER_CHANGED?this.listenTo(this.core,l.Events.CORE_ACTIVE_CONTAINER_CHANGED,this.reload):this.listenTo(this.core.mediaControl,l.Events.MEDIACONTROL_CONTAINERCHANGED,this.reload),this.listenTo(this.core.mediaControl,l.Events.MEDIACONTROL_RENDERED,this.render),this.listenTo(this.core.mediaControl,l.Events.MEDIACONTROL_HIDE,this.hideSelectLevelMenu)},t.prototype.bindPlaybackEvents=function(){this.playback&&(this.listenTo(this.playback,l.Events.PLAYBACK_LEVELS_AVAILABLE,this.fillLevels),this.listenTo(this.playback,l.Events.PLAYBACK_LEVEL_SWITCH_START,this.startLevelSwitch),this.listenTo(this.playback,l.Events.PLAYBACK_LEVEL_SWITCH_END,this.stopLevelSwitch),this.listenTo(this.playback,l.Events.PLAYBACK_BITRATE,this.updateCurrentLevel),this.playback.levels&&this.playback.levels.length>0&&this.fillLevels(this.playback.levels))},t.prototype.reload=function(){var e=this;this.stopListening(),n.nextTick((function(){e.bindEvents(),e.bindPlaybackEvents()}))},t.prototype.shouldRender=function(){if(!this.container||!this.playback)return!1;var e=void 0!==this.playback.currentLevel,t=!!(this.levels&&this.levels.length>1);return e&&t},t.prototype.render=function(){if(this.shouldRender()){var e=l.Styler.getStyleFor(c.default,{baseUrl:this.core.options.baseUrl});this.$el.html(this.template({levels:this.levels,title:this.getTitle()})),this.$el.append(e),this.core.mediaControl.$(".media-control-right-panel").append(this.el),this.$(".level_selector ul").css("max-height",.8*this.core.el.offsetHeight),this.highlightCurrentLevel()}return this},t.prototype.fillLevels=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;void 0===this.selectedLevelId&&(this.selectedLevelId=t);var r=this.core.options&&this.core.options.levelSelectorConfig&&this.core.options.levelSelectorConfig.onLevelsAvailable;if(r){if("function"!=typeof r)throw new TypeError("onLevelsAvailable must be a function");e=r(e.slice())}this.levels=e,this.configureLevelsLabels(),this.render()},t.prototype.configureLevelsLabels=function(){if(void 0!==this.core.options.levelSelectorConfig){var e=this.core.options.levelSelectorConfig.labelCallback;if(e&&"function"!=typeof e)throw new TypeError("labelCallback must be a function");var t=this.core.options.levelSelectorConfig.labels,r=t?this.core.options.levelSelectorConfig.labels:{};if(e||t){var n=void 0,i=void 0;for(var o in this.levels)i=r[(n=this.levels[o]).id],e?n.label=e(n,i):i&&(n.label=i)}}},t.prototype.findLevelBy=function(e){var t=void 0;return this.levels.forEach((function(r){r.id===e&&(t=r)})),t},t.prototype.onLevelSelect=function(e){return this.selectedLevelId=parseInt(e.target.dataset.levelSelectorSelect,10),this.playback.currentLevel==this.selectedLevelId||(this.playback.currentLevel=this.selectedLevelId,this.toggleContextMenu(),e.stopPropagation()),!1},t.prototype.onShowLevelSelectMenu=function(){this.toggleContextMenu()},t.prototype.hideSelectLevelMenu=function(){this.$(".level_selector ul").hide()},t.prototype.toggleContextMenu=function(){this.$(".level_selector ul").toggle()},t.prototype.buttonElement=function(){return this.$(".level_selector button")},t.prototype.levelElement=function(e){return this.$(".level_selector ul a"+(isNaN(e)?"":'[data-level-selector-select="'+e+'"]')).parent()},t.prototype.getTitle=function(){return(this.core.options.levelSelectorConfig||{}).title},t.prototype.startLevelSwitch=function(){this.buttonElement().addClass("changing")},t.prototype.stopLevelSwitch=function(){this.buttonElement().removeClass("changing")},t.prototype.updateText=function(e){-1===e?this.buttonElement().text(this.currentLevel?"AUTO ("+this.currentLevel.label+")":"AUTO"):this.buttonElement().text(this.findLevelBy(e).label)},t.prototype.updateCurrentLevel=function(e){var t=this.findLevelBy(e.level);this.currentLevel=t||null,this.highlightCurrentLevel()},t.prototype.highlightCurrentLevel=function(){var e=this;this.levelElement().removeClass("current"),this.currentLevel&&this.levelElement(this.currentLevel.id).addClass("current"),this.updateText(this.selectedLevelId);var t=this.currentLevel&&this.currentLevel.language;t&&(this.levelElement().removeClass("hidden"),this.levels.forEach((function(r){r.language!=t&&e.levelElement(r.id).addClass("hidden")})))},(0,o.default)(t,[{key:"name",get:function(){return"level_selector"}},{key:"template",get:function(){return(0,l.template)(u.default)}},{key:"attributes",get:function(){return{class:this.name,"data-level-selector":""}}},{key:"events",get:function(){return{"click [data-level-selector-select]":"onLevelSelect","click [data-level-selector-button]":"onShowLevelSelectMenu"}}},{key:"container",get:function(){return this.core.activeContainer?this.core.activeContainer:this.core.mediaControl.container}},{key:"playback",get:function(){return this.core.activePlayback?this.core.activePlayback:this.core.getCurrentPlayback()}}],[{key:"version",get:function(){return VERSION}}]),t}(l.UICorePlugin);t.default=f,e.exports=t.default}).call(t,r(42))},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var l,u=[],c=!1,d=-1;function f(){c&&l&&(c=!1,l.length?u=l.concat(u):d=-1,u.length&&h())}function h(){if(!c){var e=s(f);c=!0;for(var t=u.length;t;){for(l=u,u=[];++d<t;)l&&l[d].run();d=-1,t=u.length}l=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||c||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,r){"use strict";t.__esModule=!0;var n,i=r(45),o=(n=i)&&n.__esModule?n:{default:n};t.default=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),(0,o.default)(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}()},function(e,t,r){e.exports={default:r(46),__esModule:!0}},function(e,t,r){r(47);var n=r(1).Object;e.exports=function(e,t,r){return n.defineProperty(e,t,r)}},function(e,t,r){var n=r(9);n(n.S+n.F*!r(3),"Object",{defineProperty:r(2).f})},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,r){"use strict";t.__esModule=!0;var n,i=r(31),o=(n=i)&&n.__esModule?n:{default:n};t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,o.default)(t))&&"function"!=typeof t?e:t}},function(e,t,r){e.exports={default:r(51),__esModule:!0}},function(e,t,r){r(52),r(62),e.exports=r(25).f("iterator")},function(e,t,r){"use strict";var n=r(53)(!0);r(32)(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=n(t,r),this._i+=e.length,{value:e,done:!1})}))},function(e,t,r){var n=r(16),i=r(17);e.exports=function(e){return function(t,r){var o,a,s=String(i(t)),l=n(r),u=s.length;return l<0||l>=u?e?"":void 0:(o=s.charCodeAt(l))<55296||o>56319||l+1===u||(a=s.charCodeAt(l+1))<56320||a>57343?e?s.charAt(l):o:e?s.slice(l,l+2):a-56320+(o-55296<<10)+65536}}},function(e,t,r){"use strict";var n=r(19),i=r(12),o=r(24),a={};r(5)(a,r(8)("iterator"),(function(){return this})),e.exports=function(e,t,r){e.prototype=n(a,{next:i(1,r)}),o(e,t+" Iterator")}},function(e,t,r){var n=r(2),i=r(10),o=r(20);e.exports=r(3)?Object.defineProperties:function(e,t){i(e);for(var r,a=o(t),s=a.length,l=0;s>l;)n.f(e,r=a[l++],t[r]);return e}},function(e,t,r){var n=r(35);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},function(e,t,r){var n=r(7),i=r(58),o=r(59);e.exports=function(e){return function(t,r,a){var s,l=n(t),u=i(l.length),c=o(a,u);if(e&&r!=r){for(;u>c;)if((s=l[c++])!=s)return!0}else for(;u>c;c++)if((e||c in l)&&l[c]===r)return e||c||0;return!e&&-1}}},function(e,t,r){var n=r(16),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},function(e,t,r){var n=r(16),i=Math.max,o=Math.min;e.exports=function(e,t){return(e=n(e))<0?i(e+t,0):o(e,t)}},function(e,t,r){var n=r(0).document;e.exports=n&&n.documentElement},function(e,t,r){var n=r(4),i=r(36),o=r(21)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),n(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,r){r(63);for(var n=r(0),i=r(5),o=r(18),a=r(8)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l<s.length;l++){var u=s[l],c=n[u],d=c&&c.prototype;d&&!d[a]&&i(d,a,u),o[u]=o.Array}},function(e,t,r){"use strict";var n=r(64),i=r(65),o=r(18),a=r(7);e.exports=r(32)(Array,"Array",(function(e,t){this._t=a(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?r:"values"==t?e[r]:[r,e[r]])}),"values"),o.Arguments=o.Array,n("keys"),n("values"),n("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,r){e.exports={default:r(67),__esModule:!0}},function(e,t,r){r(68),r(73),r(74),r(75),e.exports=r(1).Symbol},function(e,t,r){"use strict";var n=r(0),i=r(4),o=r(3),a=r(9),s=r(33),l=r(69).KEY,u=r(11),c=r(22),d=r(24),f=r(14),h=r(8),p=r(25),m=r(26),g=r(70),y=r(71),v=r(10),b=r(6),_=r(36),A=r(7),E=r(15),T=r(12),S=r(19),w=r(72),k=r(39),x=r(37),C=r(2),R=r(20),L=k.f,j=C.f,P=w.f,I=n.Symbol,O=n.JSON,D=O&&O.stringify,M=h("_hidden"),N=h("toPrimitive"),U={}.propertyIsEnumerable,F=c("symbol-registry"),B=c("symbols"),K=c("op-symbols"),G=Object.prototype,V="function"==typeof I&&!!x.f,H=n.QObject,Y=!H||!H.prototype||!H.prototype.findChild,z=o&&u((function(){return 7!=S(j({},"a",{get:function(){return j(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=L(G,t);n&&delete G[t],j(e,t,r),n&&e!==G&&j(G,t,n)}:j,W=function(e){var t=B[e]=S(I.prototype);return t._k=e,t},$=V&&"symbol"==typeof I.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof I},q=function(e,t,r){return e===G&&q(K,t,r),v(e),t=E(t,!0),v(r),i(B,t)?(r.enumerable?(i(e,M)&&e[M][t]&&(e[M][t]=!1),r=S(r,{enumerable:T(0,!1)})):(i(e,M)||j(e,M,T(1,{})),e[M][t]=!0),z(e,t,r)):j(e,t,r)},X=function(e,t){v(e);for(var r,n=g(t=A(t)),i=0,o=n.length;o>i;)q(e,r=n[i++],t[r]);return e},J=function(e){var t=U.call(this,e=E(e,!0));return!(this===G&&i(B,e)&&!i(K,e))&&(!(t||!i(this,e)||!i(B,e)||i(this,M)&&this[M][e])||t)},Z=function(e,t){if(e=A(e),t=E(t,!0),e!==G||!i(B,t)||i(K,t)){var r=L(e,t);return!r||!i(B,t)||i(e,M)&&e[M][t]||(r.enumerable=!0),r}},Q=function(e){for(var t,r=P(A(e)),n=[],o=0;r.length>o;)i(B,t=r[o++])||t==M||t==l||n.push(t);return n},ee=function(e){for(var t,r=e===G,n=P(r?K:A(e)),o=[],a=0;n.length>a;)!i(B,t=n[a++])||r&&!i(G,t)||o.push(B[t]);return o};V||(s((I=function(){if(this instanceof I)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(r){this===G&&t.call(K,r),i(this,M)&&i(this[M],e)&&(this[M][e]=!1),z(this,e,T(1,r))};return o&&Y&&z(G,e,{configurable:!0,set:t}),W(e)}).prototype,"toString",(function(){return this._k})),k.f=Z,C.f=q,r(38).f=w.f=Q,r(27).f=J,x.f=ee,o&&!r(13)&&s(G,"propertyIsEnumerable",J,!0),p.f=function(e){return W(h(e))}),a(a.G+a.W+a.F*!V,{Symbol:I});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;te.length>re;)h(te[re++]);for(var ne=R(h.store),ie=0;ne.length>ie;)m(ne[ie++]);a(a.S+a.F*!V,"Symbol",{for:function(e){return i(F,e+="")?F[e]:F[e]=I(e)},keyFor:function(e){if(!$(e))throw TypeError(e+" is not a symbol!");for(var t in F)if(F[t]===e)return t},useSetter:function(){Y=!0},useSimple:function(){Y=!1}}),a(a.S+a.F*!V,"Object",{create:function(e,t){return void 0===t?S(e):X(S(e),t)},defineProperty:q,defineProperties:X,getOwnPropertyDescriptor:Z,getOwnPropertyNames:Q,getOwnPropertySymbols:ee});var oe=u((function(){x.f(1)}));a(a.S+a.F*oe,"Object",{getOwnPropertySymbols:function(e){return x.f(_(e))}}),O&&a(a.S+a.F*(!V||u((function(){var e=I();return"[null]"!=D([e])||"{}"!=D({a:e})||"{}"!=D(Object(e))}))),"JSON",{stringify:function(e){for(var t,r,n=[e],i=1;arguments.length>i;)n.push(arguments[i++]);if(r=t=n[1],(b(t)||void 0!==e)&&!$(e))return y(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!$(t))return t}),n[1]=t,D.apply(O,n)}}),I.prototype[N]||r(5)(I.prototype,N,I.prototype.valueOf),d(I,"Symbol"),d(Math,"Math",!0),d(n.JSON,"JSON",!0)},function(e,t,r){var n=r(14)("meta"),i=r(6),o=r(4),a=r(2).f,s=0,l=Object.isExtensible||function(){return!0},u=!r(11)((function(){return l(Object.preventExtensions({}))})),c=function(e){a(e,n,{value:{i:"O"+ ++s,w:{}}})},d=e.exports={KEY:n,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,n)){if(!l(e))return"F";if(!t)return"E";c(e)}return e[n].i},getWeak:function(e,t){if(!o(e,n)){if(!l(e))return!0;if(!t)return!1;c(e)}return e[n].w},onFreeze:function(e){return u&&d.NEED&&l(e)&&!o(e,n)&&c(e),e}}},function(e,t,r){var n=r(20),i=r(37),o=r(27);e.exports=function(e){var t=n(e),r=i.f;if(r)for(var a,s=r(e),l=o.f,u=0;s.length>u;)l.call(e,a=s[u++])&&t.push(a);return t}},function(e,t,r){var n=r(35);e.exports=Array.isArray||function(e){return"Array"==n(e)}},function(e,t,r){var n=r(7),i=r(38).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?function(e){try{return i(e)}catch(e){return a.slice()}}(e):i(n(e))}},function(e,t){},function(e,t,r){r(26)("asyncIterator")},function(e,t,r){r(26)("observable")},function(e,t,r){"use strict";t.__esModule=!0;var n=a(r(77)),i=a(r(81)),o=a(r(31));function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,o.default)(t)));e.prototype=(0,i.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(n.default?(0,n.default)(e,t):e.__proto__=t)}},function(e,t,r){e.exports={default:r(78),__esModule:!0}},function(e,t,r){r(79),e.exports=r(1).Object.setPrototypeOf},function(e,t,r){var n=r(9);n(n.S,"Object",{setPrototypeOf:r(80).set})},function(e,t,r){var n=r(6),i=r(10),o=function(e,t){if(i(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{(n=r(28)(Function.call,r(39).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,r){return o(e,r),t?e.__proto__=r:n(e,r),e}}({},!1):void 0),check:o}},function(e,t,r){e.exports={default:r(82),__esModule:!0}},function(e,t,r){r(83);var n=r(1).Object;e.exports=function(e,t){return n.create(e,t)}},function(e,t,r){var n=r(9);n(n.S,"Object",{create:r(19)})},function(t,r){t.exports=e},function(e,t){e.exports='<button data-level-selector-button>\n Auto\n</button>\n<ul>\n <% if (title) { %>\n <li data-title><%= title %></li>\n <% }; %>\n <li><a href="#" data-level-selector-select="-1">AUTO</a></li>\n <% for (var i = 0; i < levels.length; i++) { %>\n <li><a href="#" data-level-selector-select="<%= levels[i].id %>"><%= levels[i].label %></a></li>\n <% }; %>\n</ul>\n'},function(e,t,r){var n=r(87);"string"==typeof n&&(n=[[e.i,n,""]]),r(89)(n,{singleton:!0}),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(88)(!1)).push([e.i,'.level_selector[data-level-selector] {\n float: right;\n position: relative;\n height: 100%; }\n .level_selector[data-level-selector] button {\n background-color: transparent;\n color: #fff;\n font-family: Roboto,"Open Sans",Arial,sans-serif;\n -webkit-font-smoothing: antialiased;\n border: none;\n font-size: 12px;\n height: 100%; }\n .level_selector[data-level-selector] button:hover {\n color: #c9c9c9; }\n .level_selector[data-level-selector] button.changing {\n -webkit-animation: pulse 0.5s infinite alternate; }\n .level_selector[data-level-selector] > ul {\n overflow-x: hidden;\n overflow-y: auto;\n list-style-type: none;\n position: absolute;\n bottom: 100%;\n display: none;\n background-color: rgba(28, 28, 28, 0.9);\n white-space: nowrap; }\n .level_selector[data-level-selector] li {\n font-size: 12px;\n color: #eee; }\n .level_selector[data-level-selector] li[data-title] {\n background-color: #333;\n padding: 8px 25px; }\n .level_selector[data-level-selector] li a {\n color: #eee;\n padding: 5px 18px;\n display: block;\n text-decoration: none; }\n .level_selector[data-level-selector] li a:hover {\n background-color: rgba(255, 255, 255, 0.1);\n color: #fff; }\n .level_selector[data-level-selector] li a:hover a {\n color: #fff;\n text-decoration: none; }\n .level_selector[data-level-selector] li.current a {\n color: #2ecc71; }\n .level_selector[data-level-selector] li.hidden {\n display: none; }\n',""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=function(e,t){var r,n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var o=(r=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),a=i.sources.map((function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"}));return[n].concat(a).concat([o]).join("\n")}return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r})).join("")},t.i=function(e,r){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(n[o]=!0)}for(i=0;i<e.length;i++){var a=e[i];"number"==typeof a[0]&&n[a[0]]||(r&&!a[2]?a[2]=r:r&&(a[2]="("+a[2]+") and ("+r+")"),t.push(a))}},t}},function(e,t){var r={},n=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}},i=n((function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())})),o=n((function(){return document.head||document.getElementsByTagName("head")[0]})),a=null,s=0;function l(e,t){for(var n=0;n<e.length;n++){var i=e[n],o=r[i.id];if(o){o.refs++;for(var a=0;a<o.parts.length;a++)o.parts[a](i.parts[a]);for(;a<i.parts.length;a++)o.parts.push(d(i.parts[a],t))}else{var s=[];for(a=0;a<i.parts.length;a++)s.push(d(i.parts[a],t));r[i.id]={id:i.id,refs:1,parts:s}}}}function u(e){for(var t=[],r={},n=0;n<e.length;n++){var i=e[n],o=i[0],a={css:i[1],media:i[2],sourceMap:i[3]};r[o]?r[o].parts.push(a):t.push(r[o]={id:o,parts:[a]})}return t}function c(){var e=document.createElement("style"),t=o();return e.type="text/css",t.appendChild(e),e}function d(e,t){var r,n,i,l,u;if(t.singleton){var d=s++;r=a||(a=c()),n=p.bind(null,r,d,!1),i=p.bind(null,r,d,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(l=document.createElement("link"),u=o(),l.rel="stylesheet",u.appendChild(l),r=l,n=g.bind(null,r),i=function(){r.parentNode.removeChild(r),r.href&&URL.revokeObjectURL(r.href)}):(r=c(),n=m.bind(null,r),i=function(){r.parentNode.removeChild(r)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");void 0===(t=t||{}).singleton&&(t.singleton=i());var n=u(e);return l(n,t),function(e){for(var i=[],o=0;o<n.length;o++){var a=n[o];(s=r[a.id]).refs--,i.push(s)}for(e&&l(u(e),t),o=0;o<i.length;o++){var s;if(0===(s=i[o]).refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete r[s.id]}}}};var f,h=(f=[],function(e,t){return f[e]=t,f.filter(Boolean).join("\n")});function p(e,t,r,n){var i=r?"":n.css;if(e.styleSheet)e.styleSheet.cssText=h(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function m(e,t){var r=t.css,n=t.media;if(t.sourceMap,n&&e.setAttribute("media",n),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}function g(e,t){var r=t.css,n=(t.media,t.sourceMap);n&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */");var i=new Blob([r],{type:"text/css"}),o=e.href;e.href=URL.createObjectURL(i),o&&URL.revokeObjectURL(o)}}])},e.exports=n(r(0))},function(module,exports,__webpack_require__){var factory;window,factory=function(__WEBPACK_EXTERNAL_MODULE_clappr__){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="./src/main.js")}({"./node_modules/css-loader/dist/runtime/api.js": +/*! no static exports found */function(t,r){t.exports=e}})},e.exports=n(r(0))},function(e,t,r){var n;"undefined"!=typeof self&&self,n=function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="<%=baseUrl%>/",r(r.s=40)}([function(e,t){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t){var r=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=r)},function(e,t,r){var n=r(10),i=r(29),o=r(15),a=Object.defineProperty;t.f=r(3)?Object.defineProperty:function(e,t,r){if(n(e),t=o(t,!0),n(r),i)try{return a(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){e.exports=!r(11)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){var n=r(2),i=r(12);e.exports=r(3)?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,r){var n=r(56),i=r(17);e.exports=function(e){return n(i(e))}},function(e,t,r){var n=r(22)("wks"),i=r(14),o=r(0).Symbol,a="function"==typeof o;(e.exports=function(e){return n[e]||(n[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=n},function(e,t,r){var n=r(0),i=r(1),o=r(28),a=r(5),s=r(4),l=function(e,t,r){var u,c,d,f=e&l.F,h=e&l.G,p=e&l.S,m=e&l.P,g=e&l.B,y=e&l.W,v=h?i:i[t]||(i[t]={}),b=v.prototype,_=h?n:p?n[t]:(n[t]||{}).prototype;for(u in h&&(r=t),r)(c=!f&&_&&void 0!==_[u])&&s(v,u)||(d=c?_[u]:r[u],v[u]=h&&"function"!=typeof _[u]?r[u]:g&&c?o(d,n):y&&_[u]==d?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(d):m&&"function"==typeof d?o(Function.call,d):d,m&&((v.virtual||(v.virtual={}))[u]=d,e&l.R&&b&&!b[u]&&a(b,u,d)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,r){var n=r(6);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports=!0},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+n).toString(36))}},function(e,t,r){var n=r(6);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){e.exports={}},function(e,t,r){var n=r(10),i=r(55),o=r(23),a=r(21)("IE_PROTO"),s=function(){},l=function(){var e,t=r(30)("iframe"),n=o.length;for(t.style.display="none",r(60).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),l=e.F;n--;)delete l.prototype[o[n]];return l()};e.exports=Object.create||function(e,t){var r;return null!==e?(s.prototype=n(e),r=new s,s.prototype=null,r[a]=e):r=l(),void 0===t?r:i(r,t)}},function(e,t,r){var n=r(34),i=r(23);e.exports=Object.keys||function(e){return n(e,i)}},function(e,t,r){var n=r(22)("keys"),i=r(14);e.exports=function(e){return n[e]||(n[e]=i(e))}},function(e,t,r){var n=r(1),i=r(0),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:n.version,mode:r(13)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,r){var n=r(2).f,i=r(4),o=r(8)("toStringTag");e.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,o)&&n(e,o,{configurable:!0,value:t})}},function(e,t,r){t.f=r(8)},function(e,t,r){var n=r(0),i=r(1),o=r(13),a=r(25),s=r(2).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,r){var n=r(48);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,r){e.exports=!r(3)&&!r(11)((function(){return 7!=Object.defineProperty(r(30)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,r){var n=r(6),i=r(0).document,o=n(i)&&n(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,r){"use strict";t.__esModule=!0;var n=a(r(50)),i=a(r(66)),o="function"==typeof i.default&&"symbol"==typeof n.default?function(e){return typeof e}:function(e){return e&&"function"==typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":typeof e};function a(e){return e&&e.__esModule?e:{default:e}}t.default="function"==typeof i.default&&"symbol"===o(n.default)?function(e){return void 0===e?"undefined":o(e)}:function(e){return e&&"function"==typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":void 0===e?"undefined":o(e)}},function(e,t,r){"use strict";var n=r(13),i=r(9),o=r(33),a=r(5),s=r(18),l=r(54),u=r(24),c=r(61),d=r(8)("iterator"),f=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,r,p,m,g,y){l(r,t,p);var v,b,_,A=function(e){if(!f&&e in w)return w[e];switch(e){case"keys":case"values":return function(){return new r(this,e)}}return function(){return new r(this,e)}},E=t+" Iterator",T="values"==m,S=!1,w=e.prototype,k=w[d]||w["@@iterator"]||m&&w[m],C=k||A(m),x=m?T?A("entries"):C:void 0,R="Array"==t&&w.entries||k;if(R&&(_=c(R.call(new e)))!==Object.prototype&&_.next&&(u(_,E,!0),n||"function"==typeof _[d]||a(_,d,h)),T&&k&&"values"!==k.name&&(S=!0,C=function(){return k.call(this)}),n&&!y||!f&&!S&&w[d]||a(w,d,C),s[t]=C,s[E]=h,m)if(v={values:T?C:A("values"),keys:g?C:A("keys"),entries:x},y)for(b in v)b in w||o(w,b,v[b]);else i(i.P+i.F*(f||S),t,v);return v}},function(e,t,r){e.exports=r(5)},function(e,t,r){var n=r(4),i=r(7),o=r(57)(!1),a=r(21)("IE_PROTO");e.exports=function(e,t){var r,s=i(e),l=0,u=[];for(r in s)r!=a&&n(s,r)&&u.push(r);for(;t.length>l;)n(s,r=t[l++])&&(~o(u,r)||u.push(r));return u}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){var n=r(17);e.exports=function(e){return Object(n(e))}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,r){var n=r(34),i=r(23).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},function(e,t,r){var n=r(27),i=r(12),o=r(7),a=r(15),s=r(4),l=r(29),u=Object.getOwnPropertyDescriptor;t.f=r(3)?u:function(e,t){if(e=o(e),t=a(t,!0),l)try{return u(e,t)}catch(e){}if(s(e,t))return i(!n.f.call(e,t),e[t])}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(41),o=(n=i)&&n.__esModule?n:{default:n};t.default=o.default,e.exports=t.default},function(e,t,r){"use strict";(function(n){Object.defineProperty(t,"__esModule",{value:!0});var i=d(r(43)),o=d(r(44)),a=d(r(49)),s=d(r(76)),l=r(84),u=d(r(85)),c=d(r(86));function d(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(){return(0,i.default)(this,t),(0,a.default)(this,e.apply(this,arguments))}return(0,s.default)(t,e),t.prototype.bindEvents=function(){this.listenTo(this.core,l.Events.CORE_READY,this.bindPlaybackEvents),l.Events.CORE_ACTIVE_CONTAINER_CHANGED?this.listenTo(this.core,l.Events.CORE_ACTIVE_CONTAINER_CHANGED,this.reload):this.listenTo(this.core.mediaControl,l.Events.MEDIACONTROL_CONTAINERCHANGED,this.reload),this.listenTo(this.core.mediaControl,l.Events.MEDIACONTROL_RENDERED,this.render),this.listenTo(this.core.mediaControl,l.Events.MEDIACONTROL_HIDE,this.hideSelectLevelMenu)},t.prototype.bindPlaybackEvents=function(){this.playback&&(this.listenTo(this.playback,l.Events.PLAYBACK_LEVELS_AVAILABLE,this.fillLevels),this.listenTo(this.playback,l.Events.PLAYBACK_LEVEL_SWITCH_START,this.startLevelSwitch),this.listenTo(this.playback,l.Events.PLAYBACK_LEVEL_SWITCH_END,this.stopLevelSwitch),this.listenTo(this.playback,l.Events.PLAYBACK_BITRATE,this.updateCurrentLevel),this.playback.levels&&this.playback.levels.length>0&&this.fillLevels(this.playback.levels))},t.prototype.reload=function(){var e=this;this.stopListening(),n.nextTick((function(){e.bindEvents(),e.bindPlaybackEvents()}))},t.prototype.shouldRender=function(){if(!this.container||!this.playback)return!1;var e=void 0!==this.playback.currentLevel,t=!!(this.levels&&this.levels.length>1);return e&&t},t.prototype.render=function(){if(this.shouldRender()){var e=l.Styler.getStyleFor(c.default,{baseUrl:this.core.options.baseUrl});this.$el.html(this.template({levels:this.levels,title:this.getTitle()})),this.$el.append(e),this.core.mediaControl.$(".media-control-right-panel").append(this.el),this.$(".level_selector ul").css("max-height",.8*this.core.el.offsetHeight),this.highlightCurrentLevel()}return this},t.prototype.fillLevels=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;void 0===this.selectedLevelId&&(this.selectedLevelId=t);var r=this.core.options&&this.core.options.levelSelectorConfig&&this.core.options.levelSelectorConfig.onLevelsAvailable;if(r){if("function"!=typeof r)throw new TypeError("onLevelsAvailable must be a function");e=r(e.slice())}this.levels=e,this.configureLevelsLabels(),this.render()},t.prototype.configureLevelsLabels=function(){if(void 0!==this.core.options.levelSelectorConfig){var e=this.core.options.levelSelectorConfig.labelCallback;if(e&&"function"!=typeof e)throw new TypeError("labelCallback must be a function");var t=this.core.options.levelSelectorConfig.labels,r=t?this.core.options.levelSelectorConfig.labels:{};if(e||t){var n=void 0,i=void 0;for(var o in this.levels)i=r[(n=this.levels[o]).id],e?n.label=e(n,i):i&&(n.label=i)}}},t.prototype.findLevelBy=function(e){var t=void 0;return this.levels.forEach((function(r){r.id===e&&(t=r)})),t},t.prototype.onLevelSelect=function(e){return this.selectedLevelId=parseInt(e.target.dataset.levelSelectorSelect,10),this.playback.currentLevel==this.selectedLevelId||(this.playback.currentLevel=this.selectedLevelId,this.toggleContextMenu(),e.stopPropagation()),!1},t.prototype.onShowLevelSelectMenu=function(){this.toggleContextMenu()},t.prototype.hideSelectLevelMenu=function(){this.$(".level_selector ul").hide()},t.prototype.toggleContextMenu=function(){this.$(".level_selector ul").toggle()},t.prototype.buttonElement=function(){return this.$(".level_selector button")},t.prototype.levelElement=function(e){return this.$(".level_selector ul a"+(isNaN(e)?"":'[data-level-selector-select="'+e+'"]')).parent()},t.prototype.getTitle=function(){return(this.core.options.levelSelectorConfig||{}).title},t.prototype.startLevelSwitch=function(){this.buttonElement().addClass("changing")},t.prototype.stopLevelSwitch=function(){this.buttonElement().removeClass("changing")},t.prototype.updateText=function(e){-1===e?this.buttonElement().text(this.currentLevel?"AUTO ("+this.currentLevel.label+")":"AUTO"):this.buttonElement().text(this.findLevelBy(e).label)},t.prototype.updateCurrentLevel=function(e){var t=this.findLevelBy(e.level);this.currentLevel=t||null,this.highlightCurrentLevel()},t.prototype.highlightCurrentLevel=function(){var e=this;this.levelElement().removeClass("current"),this.currentLevel&&this.levelElement(this.currentLevel.id).addClass("current"),this.updateText(this.selectedLevelId);var t=this.currentLevel&&this.currentLevel.language;t&&(this.levelElement().removeClass("hidden"),this.levels.forEach((function(r){r.language!=t&&e.levelElement(r.id).addClass("hidden")})))},(0,o.default)(t,[{key:"name",get:function(){return"level_selector"}},{key:"template",get:function(){return(0,l.template)(u.default)}},{key:"attributes",get:function(){return{class:this.name,"data-level-selector":""}}},{key:"events",get:function(){return{"click [data-level-selector-select]":"onLevelSelect","click [data-level-selector-button]":"onShowLevelSelectMenu"}}},{key:"container",get:function(){return this.core.activeContainer?this.core.activeContainer:this.core.mediaControl.container}},{key:"playback",get:function(){return this.core.activePlayback?this.core.activePlayback:this.core.getCurrentPlayback()}}],[{key:"version",get:function(){return VERSION}}]),t}(l.UICorePlugin);t.default=f,e.exports=t.default}).call(t,r(42))},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var l,u=[],c=!1,d=-1;function f(){c&&l&&(c=!1,l.length?u=l.concat(u):d=-1,u.length&&h())}function h(){if(!c){var e=s(f);c=!0;for(var t=u.length;t;){for(l=u,u=[];++d<t;)l&&l[d].run();d=-1,t=u.length}l=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||c||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,r){"use strict";t.__esModule=!0;var n,i=r(45),o=(n=i)&&n.__esModule?n:{default:n};t.default=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),(0,o.default)(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}()},function(e,t,r){e.exports={default:r(46),__esModule:!0}},function(e,t,r){r(47);var n=r(1).Object;e.exports=function(e,t,r){return n.defineProperty(e,t,r)}},function(e,t,r){var n=r(9);n(n.S+n.F*!r(3),"Object",{defineProperty:r(2).f})},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,r){"use strict";t.__esModule=!0;var n,i=r(31),o=(n=i)&&n.__esModule?n:{default:n};t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,o.default)(t))&&"function"!=typeof t?e:t}},function(e,t,r){e.exports={default:r(51),__esModule:!0}},function(e,t,r){r(52),r(62),e.exports=r(25).f("iterator")},function(e,t,r){"use strict";var n=r(53)(!0);r(32)(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=n(t,r),this._i+=e.length,{value:e,done:!1})}))},function(e,t,r){var n=r(16),i=r(17);e.exports=function(e){return function(t,r){var o,a,s=String(i(t)),l=n(r),u=s.length;return l<0||l>=u?e?"":void 0:(o=s.charCodeAt(l))<55296||o>56319||l+1===u||(a=s.charCodeAt(l+1))<56320||a>57343?e?s.charAt(l):o:e?s.slice(l,l+2):a-56320+(o-55296<<10)+65536}}},function(e,t,r){"use strict";var n=r(19),i=r(12),o=r(24),a={};r(5)(a,r(8)("iterator"),(function(){return this})),e.exports=function(e,t,r){e.prototype=n(a,{next:i(1,r)}),o(e,t+" Iterator")}},function(e,t,r){var n=r(2),i=r(10),o=r(20);e.exports=r(3)?Object.defineProperties:function(e,t){i(e);for(var r,a=o(t),s=a.length,l=0;s>l;)n.f(e,r=a[l++],t[r]);return e}},function(e,t,r){var n=r(35);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},function(e,t,r){var n=r(7),i=r(58),o=r(59);e.exports=function(e){return function(t,r,a){var s,l=n(t),u=i(l.length),c=o(a,u);if(e&&r!=r){for(;u>c;)if((s=l[c++])!=s)return!0}else for(;u>c;c++)if((e||c in l)&&l[c]===r)return e||c||0;return!e&&-1}}},function(e,t,r){var n=r(16),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},function(e,t,r){var n=r(16),i=Math.max,o=Math.min;e.exports=function(e,t){return(e=n(e))<0?i(e+t,0):o(e,t)}},function(e,t,r){var n=r(0).document;e.exports=n&&n.documentElement},function(e,t,r){var n=r(4),i=r(36),o=r(21)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),n(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,r){r(63);for(var n=r(0),i=r(5),o=r(18),a=r(8)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l<s.length;l++){var u=s[l],c=n[u],d=c&&c.prototype;d&&!d[a]&&i(d,a,u),o[u]=o.Array}},function(e,t,r){"use strict";var n=r(64),i=r(65),o=r(18),a=r(7);e.exports=r(32)(Array,"Array",(function(e,t){this._t=a(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?r:"values"==t?e[r]:[r,e[r]])}),"values"),o.Arguments=o.Array,n("keys"),n("values"),n("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,r){e.exports={default:r(67),__esModule:!0}},function(e,t,r){r(68),r(73),r(74),r(75),e.exports=r(1).Symbol},function(e,t,r){"use strict";var n=r(0),i=r(4),o=r(3),a=r(9),s=r(33),l=r(69).KEY,u=r(11),c=r(22),d=r(24),f=r(14),h=r(8),p=r(25),m=r(26),g=r(70),y=r(71),v=r(10),b=r(6),_=r(36),A=r(7),E=r(15),T=r(12),S=r(19),w=r(72),k=r(39),C=r(37),x=r(2),R=r(20),L=k.f,j=x.f,P=w.f,I=n.Symbol,O=n.JSON,D=O&&O.stringify,M=h("_hidden"),N=h("toPrimitive"),F={}.propertyIsEnumerable,U=c("symbol-registry"),B=c("symbols"),K=c("op-symbols"),G=Object.prototype,V="function"==typeof I&&!!C.f,H=n.QObject,Y=!H||!H.prototype||!H.prototype.findChild,z=o&&u((function(){return 7!=S(j({},"a",{get:function(){return j(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=L(G,t);n&&delete G[t],j(e,t,r),n&&e!==G&&j(G,t,n)}:j,W=function(e){var t=B[e]=S(I.prototype);return t._k=e,t},$=V&&"symbol"==typeof I.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof I},q=function(e,t,r){return e===G&&q(K,t,r),v(e),t=E(t,!0),v(r),i(B,t)?(r.enumerable?(i(e,M)&&e[M][t]&&(e[M][t]=!1),r=S(r,{enumerable:T(0,!1)})):(i(e,M)||j(e,M,T(1,{})),e[M][t]=!0),z(e,t,r)):j(e,t,r)},X=function(e,t){v(e);for(var r,n=g(t=A(t)),i=0,o=n.length;o>i;)q(e,r=n[i++],t[r]);return e},J=function(e){var t=F.call(this,e=E(e,!0));return!(this===G&&i(B,e)&&!i(K,e))&&(!(t||!i(this,e)||!i(B,e)||i(this,M)&&this[M][e])||t)},Z=function(e,t){if(e=A(e),t=E(t,!0),e!==G||!i(B,t)||i(K,t)){var r=L(e,t);return!r||!i(B,t)||i(e,M)&&e[M][t]||(r.enumerable=!0),r}},Q=function(e){for(var t,r=P(A(e)),n=[],o=0;r.length>o;)i(B,t=r[o++])||t==M||t==l||n.push(t);return n},ee=function(e){for(var t,r=e===G,n=P(r?K:A(e)),o=[],a=0;n.length>a;)!i(B,t=n[a++])||r&&!i(G,t)||o.push(B[t]);return o};V||(s((I=function(){if(this instanceof I)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(r){this===G&&t.call(K,r),i(this,M)&&i(this[M],e)&&(this[M][e]=!1),z(this,e,T(1,r))};return o&&Y&&z(G,e,{configurable:!0,set:t}),W(e)}).prototype,"toString",(function(){return this._k})),k.f=Z,x.f=q,r(38).f=w.f=Q,r(27).f=J,C.f=ee,o&&!r(13)&&s(G,"propertyIsEnumerable",J,!0),p.f=function(e){return W(h(e))}),a(a.G+a.W+a.F*!V,{Symbol:I});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;te.length>re;)h(te[re++]);for(var ne=R(h.store),ie=0;ne.length>ie;)m(ne[ie++]);a(a.S+a.F*!V,"Symbol",{for:function(e){return i(U,e+="")?U[e]:U[e]=I(e)},keyFor:function(e){if(!$(e))throw TypeError(e+" is not a symbol!");for(var t in U)if(U[t]===e)return t},useSetter:function(){Y=!0},useSimple:function(){Y=!1}}),a(a.S+a.F*!V,"Object",{create:function(e,t){return void 0===t?S(e):X(S(e),t)},defineProperty:q,defineProperties:X,getOwnPropertyDescriptor:Z,getOwnPropertyNames:Q,getOwnPropertySymbols:ee});var oe=u((function(){C.f(1)}));a(a.S+a.F*oe,"Object",{getOwnPropertySymbols:function(e){return C.f(_(e))}}),O&&a(a.S+a.F*(!V||u((function(){var e=I();return"[null]"!=D([e])||"{}"!=D({a:e})||"{}"!=D(Object(e))}))),"JSON",{stringify:function(e){for(var t,r,n=[e],i=1;arguments.length>i;)n.push(arguments[i++]);if(r=t=n[1],(b(t)||void 0!==e)&&!$(e))return y(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!$(t))return t}),n[1]=t,D.apply(O,n)}}),I.prototype[N]||r(5)(I.prototype,N,I.prototype.valueOf),d(I,"Symbol"),d(Math,"Math",!0),d(n.JSON,"JSON",!0)},function(e,t,r){var n=r(14)("meta"),i=r(6),o=r(4),a=r(2).f,s=0,l=Object.isExtensible||function(){return!0},u=!r(11)((function(){return l(Object.preventExtensions({}))})),c=function(e){a(e,n,{value:{i:"O"+ ++s,w:{}}})},d=e.exports={KEY:n,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,n)){if(!l(e))return"F";if(!t)return"E";c(e)}return e[n].i},getWeak:function(e,t){if(!o(e,n)){if(!l(e))return!0;if(!t)return!1;c(e)}return e[n].w},onFreeze:function(e){return u&&d.NEED&&l(e)&&!o(e,n)&&c(e),e}}},function(e,t,r){var n=r(20),i=r(37),o=r(27);e.exports=function(e){var t=n(e),r=i.f;if(r)for(var a,s=r(e),l=o.f,u=0;s.length>u;)l.call(e,a=s[u++])&&t.push(a);return t}},function(e,t,r){var n=r(35);e.exports=Array.isArray||function(e){return"Array"==n(e)}},function(e,t,r){var n=r(7),i=r(38).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?function(e){try{return i(e)}catch(e){return a.slice()}}(e):i(n(e))}},function(e,t){},function(e,t,r){r(26)("asyncIterator")},function(e,t,r){r(26)("observable")},function(e,t,r){"use strict";t.__esModule=!0;var n=a(r(77)),i=a(r(81)),o=a(r(31));function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,o.default)(t)));e.prototype=(0,i.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(n.default?(0,n.default)(e,t):e.__proto__=t)}},function(e,t,r){e.exports={default:r(78),__esModule:!0}},function(e,t,r){r(79),e.exports=r(1).Object.setPrototypeOf},function(e,t,r){var n=r(9);n(n.S,"Object",{setPrototypeOf:r(80).set})},function(e,t,r){var n=r(6),i=r(10),o=function(e,t){if(i(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{(n=r(28)(Function.call,r(39).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,r){return o(e,r),t?e.__proto__=r:n(e,r),e}}({},!1):void 0),check:o}},function(e,t,r){e.exports={default:r(82),__esModule:!0}},function(e,t,r){r(83);var n=r(1).Object;e.exports=function(e,t){return n.create(e,t)}},function(e,t,r){var n=r(9);n(n.S,"Object",{create:r(19)})},function(t,r){t.exports=e},function(e,t){e.exports='<button data-level-selector-button>\n Auto\n</button>\n<ul>\n <% if (title) { %>\n <li data-title><%= title %></li>\n <% }; %>\n <li><a href="#" data-level-selector-select="-1">AUTO</a></li>\n <% for (var i = 0; i < levels.length; i++) { %>\n <li><a href="#" data-level-selector-select="<%= levels[i].id %>"><%= levels[i].label %></a></li>\n <% }; %>\n</ul>\n'},function(e,t,r){var n=r(87);"string"==typeof n&&(n=[[e.i,n,""]]),r(89)(n,{singleton:!0}),n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(88)(!1)).push([e.i,'.level_selector[data-level-selector] {\n float: right;\n position: relative;\n height: 100%; }\n .level_selector[data-level-selector] button {\n background-color: transparent;\n color: #fff;\n font-family: Roboto,"Open Sans",Arial,sans-serif;\n -webkit-font-smoothing: antialiased;\n border: none;\n font-size: 12px;\n height: 100%; }\n .level_selector[data-level-selector] button:hover {\n color: #c9c9c9; }\n .level_selector[data-level-selector] button.changing {\n -webkit-animation: pulse 0.5s infinite alternate; }\n .level_selector[data-level-selector] > ul {\n overflow-x: hidden;\n overflow-y: auto;\n list-style-type: none;\n position: absolute;\n bottom: 100%;\n display: none;\n background-color: rgba(28, 28, 28, 0.9);\n white-space: nowrap; }\n .level_selector[data-level-selector] li {\n font-size: 12px;\n color: #eee; }\n .level_selector[data-level-selector] li[data-title] {\n background-color: #333;\n padding: 8px 25px; }\n .level_selector[data-level-selector] li a {\n color: #eee;\n padding: 5px 18px;\n display: block;\n text-decoration: none; }\n .level_selector[data-level-selector] li a:hover {\n background-color: rgba(255, 255, 255, 0.1);\n color: #fff; }\n .level_selector[data-level-selector] li a:hover a {\n color: #fff;\n text-decoration: none; }\n .level_selector[data-level-selector] li.current a {\n color: #2ecc71; }\n .level_selector[data-level-selector] li.hidden {\n display: none; }\n',""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=function(e,t){var r,n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var o=(r=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),a=i.sources.map((function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"}));return[n].concat(a).concat([o]).join("\n")}return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r})).join("")},t.i=function(e,r){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(n[o]=!0)}for(i=0;i<e.length;i++){var a=e[i];"number"==typeof a[0]&&n[a[0]]||(r&&!a[2]?a[2]=r:r&&(a[2]="("+a[2]+") and ("+r+")"),t.push(a))}},t}},function(e,t){var r={},n=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}},i=n((function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())})),o=n((function(){return document.head||document.getElementsByTagName("head")[0]})),a=null,s=0;function l(e,t){for(var n=0;n<e.length;n++){var i=e[n],o=r[i.id];if(o){o.refs++;for(var a=0;a<o.parts.length;a++)o.parts[a](i.parts[a]);for(;a<i.parts.length;a++)o.parts.push(d(i.parts[a],t))}else{var s=[];for(a=0;a<i.parts.length;a++)s.push(d(i.parts[a],t));r[i.id]={id:i.id,refs:1,parts:s}}}}function u(e){for(var t=[],r={},n=0;n<e.length;n++){var i=e[n],o=i[0],a={css:i[1],media:i[2],sourceMap:i[3]};r[o]?r[o].parts.push(a):t.push(r[o]={id:o,parts:[a]})}return t}function c(){var e=document.createElement("style"),t=o();return e.type="text/css",t.appendChild(e),e}function d(e,t){var r,n,i,l,u;if(t.singleton){var d=s++;r=a||(a=c()),n=p.bind(null,r,d,!1),i=p.bind(null,r,d,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(l=document.createElement("link"),u=o(),l.rel="stylesheet",u.appendChild(l),r=l,n=g.bind(null,r),i=function(){r.parentNode.removeChild(r),r.href&&URL.revokeObjectURL(r.href)}):(r=c(),n=m.bind(null,r),i=function(){r.parentNode.removeChild(r)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");void 0===(t=t||{}).singleton&&(t.singleton=i());var n=u(e);return l(n,t),function(e){for(var i=[],o=0;o<n.length;o++){var a=n[o];(s=r[a.id]).refs--,i.push(s)}for(e&&l(u(e),t),o=0;o<i.length;o++){var s;if(0===(s=i[o]).refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete r[s.id]}}}};var f,h=(f=[],function(e,t){return f[e]=t,f.filter(Boolean).join("\n")});function p(e,t,r,n){var i=r?"":n.css;if(e.styleSheet)e.styleSheet.cssText=h(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function m(e,t){var r=t.css,n=t.media;if(t.sourceMap,n&&e.setAttribute("media",n),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}function g(e,t){var r=t.css,n=(t.media,t.sourceMap);n&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */");var i=new Blob([r],{type:"text/css"}),o=e.href;e.href=URL.createObjectURL(i),o&&URL.revokeObjectURL(o)}}])},e.exports=n(r(0))},function(module,exports,__webpack_require__){var factory;window,factory=function(__WEBPACK_EXTERNAL_MODULE_clappr__){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="./src/main.js")}({"./node_modules/css-loader/dist/runtime/api.js": /*!*****************************************************!*\ !*** ./node_modules/css-loader/dist/runtime/api.js ***! \*****************************************************/ @@ -1447,5 +1447,5 @@ function dc(){}function fc(){Mu?console.debug("EmeEncryptionSchemePolyfill: Alre /*!******************************************************************************************!*\ !*** external {"amd":"clappr","commonjs":"clappr","commonjs2":"clappr","root":"Clappr"} ***! \******************************************************************************************/ -/*! no static exports found */function(module,exports){eval("module.exports = __WEBPACK_EXTERNAL_MODULE_clappr__;\n\n//# sourceURL=webpack://AudioTrackSelector/external_%7B%22amd%22:%22clappr%22,%22commonjs%22:%22clappr%22,%22commonjs2%22:%22clappr%22,%22root%22:%22Clappr%22%7D?")}}).default},module.exports=factory(__webpack_require__(0))},function(e,t,r){var n=r(5),i=r(6);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1},a=(n(i,o),i.locals?i.locals:{});e.exports=a},function(e,t,r){"use strict";var n,i=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},o=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),a=[];function s(e){for(var t=-1,r=0;r<a.length;r++)if(a[r].identifier===e){t=r;break}return t}function l(e,t){for(var r={},n=[],i=0;i<e.length;i++){var o=e[i],l=t.base?o[0]+t.base:o[0],u=r[l]||0,c="".concat(l," ").concat(u);r[l]=u+1;var d=s(c),f={css:o[1],media:o[2],sourceMap:o[3]};-1!==d?(a[d].references++,a[d].updater(f)):a.push({identifier:c,updater:g(f,t),references:1}),n.push(c)}return n}function u(e){var t=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var i=r.nc;i&&(n.nonce=i)}if(Object.keys(n).forEach((function(e){t.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(t);else{var a=o(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var c,d=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function f(e,t,r,n){var i=r?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=d(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function h(e,t,r){var n=r.css,i=r.media,o=r.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),o&&btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var p=null,m=0;function g(e,t){var r,n,i;if(t.singleton){var o=m++;r=p||(p=u(t)),n=f.bind(null,r,o,!1),i=f.bind(null,r,o,!0)}else r=u(t),n=h.bind(null,r,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)};return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var r=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<r.length;n++){var i=s(r[n]);a[i].references--}for(var o=l(e,t),u=0;u<r.length;u++){var c=s(r[u]);0===a[c].references&&(a[c].updater(),a.splice(c,1))}r=o}}}},function(e,t,r){(t=r(7)(!1)).push([e.i,"button.media-control-button[data-hd-indicator]{display:none !important}\n",""]),e.exports=t},function(e,t,r){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=function(e,t){var r=e[1]||"",n=e[3];if(!n)return r;if(t&&"function"==typeof btoa){var i=(a=n,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),l="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(l," */")),o=n.sources.map((function(e){return"/*# sourceURL=".concat(n.sourceRoot||"").concat(e," */")}));return[r].concat(o).concat([i]).join("\n")}var a,s,l;return[r].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,n){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(n)for(var o=0;o<this.length;o++){var a=this[o][0];null!=a&&(i[a]=!0)}for(var s=0;s<e.length;s++){var l=[].concat(e[s]);n&&i[l[0]]||(r&&(l[2]?l[2]="".concat(r," and ").concat(l[2]):l[2]=r),t.push(l))}},t}},function(e,t,r){"use strict";r.r(t),r.d(t,"Player",(function(){return x})),r.d(t,"Mediator",(function(){return n.Mediator})),r.d(t,"Events",(function(){return n.Events})),r.d(t,"Browser",(function(){return n.Browser})),r.d(t,"PlayerInfo",(function(){return n.PlayerInfo})),r.d(t,"MediaControl",(function(){return n.MediaControl})),r.d(t,"ContainerPlugin",(function(){return n.ContainerPlugin})),r.d(t,"UIContainerPlugin",(function(){return n.UIContainerPlugin})),r.d(t,"CorePlugin",(function(){return n.CorePlugin})),r.d(t,"UICorePlugin",(function(){return n.UICorePlugin})),r.d(t,"Playback",(function(){return n.Playback})),r.d(t,"Container",(function(){return n.Container})),r.d(t,"Core",(function(){return n.Core})),r.d(t,"PlayerError",(function(){return n.PlayerError})),r.d(t,"Loader",(function(){return n.Loader})),r.d(t,"BaseObject",(function(){return n.BaseObject})),r.d(t,"UIObject",(function(){return n.UIObject})),r.d(t,"Utils",(function(){return n.Utils})),r.d(t,"BaseFlashPlayback",(function(){return n.BaseFlashPlayback})),r.d(t,"Flash",(function(){return n.Flash})),r.d(t,"FlasHLS",(function(){return n.FlasHLS})),r.d(t,"HLS",(function(){return n.HLS})),r.d(t,"HTML5Audio",(function(){return n.HTML5Audio})),r.d(t,"HTML5Video",(function(){return n.HTML5Video})),r.d(t,"HTMLImg",(function(){return n.HTMLImg})),r.d(t,"NoOp",(function(){return n.NoOp})),r.d(t,"ClickToPausePlugin",(function(){return n.ClickToPausePlugin})),r.d(t,"DVRControls",(function(){return n.DVRControls})),r.d(t,"Favicon",(function(){return n.Favicon})),r.d(t,"Log",(function(){return n.Log})),r.d(t,"Poster",(function(){return n.Poster})),r.d(t,"SpinnerThreeBouncePlugin",(function(){return n.SpinnerThreeBouncePlugin})),r.d(t,"WaterMarkPlugin",(function(){return n.WaterMarkPlugin})),r.d(t,"Styler",(function(){return n.Styler})),r.d(t,"Vendor",(function(){return n.Vendor})),r.d(t,"version",(function(){return n.version})),r.d(t,"template",(function(){return n.template})),r.d(t,"$",(function(){return n.$}));r(4);var n=r(0),i=r.n(n),o=r(1),a=r.n(o),s=r(2),l=r.n(s),u=r(3),c=r.n(u);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p(e,t,r){return t&&h(e.prototype,t),r&&h(e,r),e}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function y(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(n,e);var t,r=(t=n,function(){var e,r=v(t);if(y()){var n=v(this).constructor;e=Reflect.construct(r,arguments,n)}else e=r.apply(this,arguments);return g(this,e)});function n(){var e;f(this,n);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return(e=r.call.apply(r,[this].concat(i))).timeout=1,e.max_timeout=10,e}return p(n,[{key:"name",get:function(){return"error_plugin"}},{key:"background",get:function(){return"data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%2026.458318%2026.458333%22%3E%3Cpath%20d%3D%22M13.23.302C6.07.302.264%206.107.264%2013.267a12.965%2012.965%200%200%200%20.847%204.595c.19-.497.408-.982.682-1.438.14-.232.294-.457.396-.707.103-.25.15-.533.072-.792a1.362%201.362%200%200%200-.22-.404c-.092-.123-.192-.24-.275-.37a1.662%201.662%200%200%201-.255-1.12%201.5%201.5%200%200%201%20.58-.987c.28-.208.635-.3.985-.288a1.757%201.757%200%200%201%20.346.048c.452.11.852.393%201.148.75.368.447.584%201.01.637%201.586a3.574%203.574%200%200%201-.275%201.693c-.4.955-1.15%201.725-1.565%202.673-.338.775-.435%201.638-.39%202.483.007.077.018.155.025.234a12.965%2012.965%200%200%200%203.62%203.18%2017.63%2017.63%200%200%201-.13-2.11c.002-.56.03-1.12.085-1.675-.34-.236-.65-.51-.87-.86-.392-.62-.466-1.408-.305-2.124.16-.717.54-1.37.997-1.945a7.833%207.833%200%200%201%202.835-2.223%2010.305%2010.305%200%200%201-.09-.126%204.854%204.854%200%200%201-.702-2.176c-.06-.777.064-1.554.115-2.33.037-.543.04-1.085.07-1.627.038-.627.114-1.255.29-1.858a2.36%202.36%200%200%201%20.266-.63%201.4%201.4%200%200%201%20.594-.514c.274-.108.51-.132.776-.087.22.046.425.156.604.294.18.138.335.304.48.477a7.298%207.298%200%200%201%201.04%201.617%203.57%203.57%200%200%201%201.09%200%207.287%207.287%200%200%201%201.04-1.616%203.21%203.21%200%200%201%20.48-.476c.18-.14.383-.248.604-.295a1.268%201.268%200%200%201%20.78.086%201.402%201.402%200%200%201%20.595.517c.124.19.202.408.266.626.175.602.252%201.23.29%201.856.03.543.033%201.087.07%201.628.05.777.175%201.554.116%202.33a4.855%204.855%200%200%201-.705%202.178c-.03.05-.07.096-.103.145.247.278.598.513.898.614a1.956%201.956%200%200%200%201.05.044%201.65%201.65%200%200%200%20.533-.226%201.253%201.253%200%200%200%20.397-.418c.118-.21.166-.45.192-.687.067-.61%200-1.224-.05-1.835-.034-.396-.062-.8.027-1.187.06-.26.177-.518.373-.7a1.106%201.106%200%200%201%20.465-.255%201.312%201.312%200%200%201%20.53-.03c.38.057.736.274.948.594.12.18.194.39.238.604.044.213.06.43.072.648.04.76.04%201.522.018%202.284-.018.665-.055%201.348-.32%201.957-.343.782-1.032%201.366-1.775%201.786a7.052%207.052%200%200%201-1.588.647c.482%201.54.733%203.24.733%204.968a17.6%2017.6%200%200%201-.135%202.125%2012.964%2012.964%200%200%200%206.384-11.152c0-7.16-5.806-12.965-12.965-12.965zM9.602%2016.284v1.483a1.88%201.88%200%200%201%201.083.362%201.738%201.738%200%200%201%20.556.68c.122.27.166.576.116.868a1.493%201.493%200%200%201-.332.708%201.647%201.647%200%200%201-.635.458%201.738%201.738%200%200%201-.787.122v3.73l7.762-4.208-7.762-4.204z%22%20fill%3D%22%23999%22%2F%3E%3C%2Fsvg%3E"}}]),p(n,[{key:"bindEvents",value:function(){this.listenTo(this.container,i.a.Events.CONTAINER_ERROR,this.onError)}},{key:"hide",value:function(){this._err&&this._err.remove()}},{key:"show",value:function(){var e=i.a.$;this.hide();var t="A fatal error occured.";this.options.errorPlugin&&this.options.errorPlugin.text&&(t=this.options.errorPlugin.text),this._err=e("<div>").css({position:"absolute","z-index":"999",width:"100%",height:"100%","background-image":"url("+this.background+")","background-size":"18%","background-repeat":"no-repeat","background-color":"black","background-position":"center","text-align":"center","font-weight":"bold",color:"#eee"});var r=e("<div>").css({position:"absolute",width:"100%","padding-bottom":"5%",bottom:0}).append(e("<h2>").text(t).css({"font-size":"200%"})).append(e("<p>").text("We will be right back").css({"font-size":"120%",margin:"15px"}));this._err.append(r),this.container&&this.container.$el.prepend(this._err)}},{key:"onError",value:function(e){var t=this;if(this.container){var r=this.options.errorPlugin.onError;!r||"function"!=typeof r||r(e,(function(){t.hide(),t.container.getPlugin("click_to_pause").enable()}))?(this.show(),this.container.getPlugin("click_to_pause").disable()):console.log("skipping overlay")}}}]),n}(i.a.ContainerPlugin);function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function A(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function T(e,t){return!t||"object"!==_(t)&&"function"!=typeof t?S(e):t}function S(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var x=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&E(e,t)}(u,e);var t,r,i,o,s=(t=u,function(){var e,r=k(t);if(w()){var n=k(this).constructor;e=Reflect.construct(r,arguments,n)}else e=r.apply(this,arguments);return T(this,e)});function u(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(t=s.call(this)).timeout=5,t.maxTimeout=15;var r=t._options=t._buildConfig(e),i=t._player=new n.Player(r);return t.attachTo=i.attachTo.bind(i),i.core&&i.core.isReady?t._addEventListeners():t.listenToOnce(i,n.Events.PLAYER_READY,t._addEventListeners.bind(S(t))),t}return r=u,(i=[{key:"_buildConfig",value:function(e){var t,r,n,i,o=[c.a,l.a,a.a,b];return e.plugins&&e.plugins.length&&(o=o.concat(e.plugins),console.log("loading plugins"),o.forEach((function(e){return console.log(e.name,e.type)}))),e.vocStream&&(r=e.vocStream,n=e.audioOnly,i="MediaSource"in window,console.log("vp9/vorbis",i&&MediaSource.isTypeSupported('video/webm; codecs="vp9,vorbis"'),"vp9/opus",i&&MediaSource.isTypeSupported('video/webm; codecs="vp9,opus"')),t=i&&MediaSource.isTypeSupported('video/webm; codecs="vp9,opus"')?{source:"//cdn.c3voc.de/dash/".concat(r,"/manifest.mpd")}:n||!i&&""==document.createElement("video").canPlayType("application/vnd.apple.mpegURL")?n?{source:"//cdn.c3voc.de/".concat(r,"_native.mp3"),mimeType:"audio/mp3"}:{source:"//cdn.c3voc.de/".concat(r,"_native_hd.webm"),mimeType:"video/webm"}:{source:"//cdn.c3voc.de/hls/".concat(r,"_native_hd.m3u8"),mimeType:"application/vnd.apple.mpegURL"},delete e.vocStream),Object.assign({source:t,width:"100%",height:"100%",disableErrorScreen:!0,shakaConfiguration:{abr:{defaultBandwidthEstimate:1e6},streaming:{jumpLargeGaps:!0},manifest:{dash:{defaultPresentationDelay:3,ignoreSuggestedPresentationDelay:!0}}},audioTrackSelectorConfig:{title:"Language"},levelSelectorConfig:{labelCallback:function(e,t){var r=e.videoBandwidth||e.level.bitrate;return r<=1e5?"Slides":r<=8e5?"SD":"HD"},title:"Quality"},errorPlugin:{text:"Stream offline",onError:this._handleError.bind(this)}},e,{plugins:o})}},{key:"_containerChanged",value:function(){this.stopListening(),this._addEventListeners()}},{key:"_addEventListeners",value:function(){var e=this._player.core;this._container=e.activeContainer,this.listenTo(this._player,n.Events.PLAYER_PLAY,this._handlePlay),this.listenTo(this._player,n.Events.PLAYER_STOP,this._handleStop),this.listenTo(e,n.Events.CORE_ACTIVE_CONTAINER_CHANGED,this._containerChanged),this.listenTo(this._container,n.Events.CONTAINER_STATE_BUFFERFULL,this._handleBufferFull),this.listenTo(this._container,n.Events.CONTAINER_OPTIONS_CHANGE,(function(){console.log("options changed")}))}},{key:"_getTimeout",value:function(){var e=.6*this.timeout+.4*this.timeout*Math.random();return this.timeout=Math.min(2*this.timeout,this.maxTimeout),e}},{key:"_resetTimeout",value:function(){this.timeout=5}},{key:"_handleError",value:function(e,t){this._recovery?clearTimeout(this._recovery.timeout):this._player.stop();var r=this._getTimeout();return console.log("got error",e.code,"retrying in ".concat(Math.round(r),"s")),this._recovery={clearOverlay:t,state:"restarting",timeout:setTimeout(this._waitForMedia.bind(this),1e3*r)},!0}},{key:"_handlePlay",value:function(){this._recovery&&(console.log("soft recovery: play"),this._recovery.clearOverlay(),clearTimeout(this._recovery.timeout),this._recovery=null),this._resetTimeout()}},{key:"_handleStop",value:function(e){this._recovery&&this._container&&(console.log("soft recovery: stop"),this._container.playback.play.call(this._container.playback))}},{key:"_handleBufferFull",value:function(){if(this._recovery){console.log("seeking to end for recovery");var e=Math.max(this._player.getDuration()-6,0);this._player.seek(e)}}},{key:"_handleMediaCheck",value:function(e){if(e)console.log("try playing again, media should be available"),this._player.play();else{var t=this._getTimeout();console.log("test for media failed, retrying in ~".concat(Math.round(t),"s")),setTimeout(this._waitForMedia.bind(this),1e3*t)}}},{key:"_waitForMedia",value:function(){var e=this._player.options.source;e&&e.source&&(e=e.source),"string"==typeof e?function(e,t){if(!t||"function"!=typeof t)throw new Error("Excepted function, got '".concat(t,"'"));var r=new XMLHttpRequest;r.onreadystatechange=function(){this.readyState===XMLHttpRequest.HEADERS_RECEIVED&&(200===this.status?t(!0):t(!1),r.abort())},r.open("GET",e,!0),r.send(null)}(e,this._handleMediaCheck.bind(this)):this.reset()}},{key:"reset",value:function(){console.log("performing hard reset"),this._recovery=null;var e=0==this._player.getVolume();e||this._player.mute(),this._player.configure({source:this._player.options.source,autoPlay:!0}),e||this._player.unmute()}}])&&A(r.prototype,i),o&&A(r,o),u}(n.BaseObject)}])})); +/*! no static exports found */function(module,exports){eval("module.exports = __WEBPACK_EXTERNAL_MODULE_clappr__;\n\n//# sourceURL=webpack://AudioTrackSelector/external_%7B%22amd%22:%22clappr%22,%22commonjs%22:%22clappr%22,%22commonjs2%22:%22clappr%22,%22root%22:%22Clappr%22%7D?")}}).default},module.exports=factory(__webpack_require__(0))},function(e,t,r){var n=r(5),i=r(6);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1},a=(n(i,o),i.locals?i.locals:{});e.exports=a},function(e,t,r){"use strict";var n,i=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},o=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),a=[];function s(e){for(var t=-1,r=0;r<a.length;r++)if(a[r].identifier===e){t=r;break}return t}function l(e,t){for(var r={},n=[],i=0;i<e.length;i++){var o=e[i],l=t.base?o[0]+t.base:o[0],u=r[l]||0,c="".concat(l," ").concat(u);r[l]=u+1;var d=s(c),f={css:o[1],media:o[2],sourceMap:o[3]};-1!==d?(a[d].references++,a[d].updater(f)):a.push({identifier:c,updater:g(f,t),references:1}),n.push(c)}return n}function u(e){var t=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var i=r.nc;i&&(n.nonce=i)}if(Object.keys(n).forEach((function(e){t.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(t);else{var a=o(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var c,d=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function f(e,t,r,n){var i=r?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=d(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function h(e,t,r){var n=r.css,i=r.media,o=r.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),o&&btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var p=null,m=0;function g(e,t){var r,n,i;if(t.singleton){var o=m++;r=p||(p=u(t)),n=f.bind(null,r,o,!1),i=f.bind(null,r,o,!0)}else r=u(t),n=h.bind(null,r,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)};return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var r=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<r.length;n++){var i=s(r[n]);a[i].references--}for(var o=l(e,t),u=0;u<r.length;u++){var c=s(r[u]);0===a[c].references&&(a[c].updater(),a.splice(c,1))}r=o}}}},function(e,t,r){(t=r(7)(!1)).push([e.i,"button.media-control-button[data-hd-indicator]{display:none !important}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]{height:40px}.media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar]{height:2px;background-color:#ccc}.player-poster[data-poster] .play-wrapper[data-poster] svg path{fill:#ccc}.spinner-three-bounce[data-spinner]>div{background-color:#ccc}.clappr-watermark[data-watermark]{transition:opacity 0.5s ease-out}.clappr-watermark[data-watermark].clappr-watermark-hide{opacity:0}\n",""]),e.exports=t},function(e,t,r){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=function(e,t){var r=e[1]||"",n=e[3];if(!n)return r;if(t&&"function"==typeof btoa){var i=(a=n,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),l="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(l," */")),o=n.sources.map((function(e){return"/*# sourceURL=".concat(n.sourceRoot||"").concat(e," */")}));return[r].concat(o).concat([i]).join("\n")}var a,s,l;return[r].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,n){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(n)for(var o=0;o<this.length;o++){var a=this[o][0];null!=a&&(i[a]=!0)}for(var s=0;s<e.length;s++){var l=[].concat(e[s]);n&&i[l[0]]||(r&&(l[2]?l[2]="".concat(r," and ").concat(l[2]):l[2]=r),t.push(l))}},t}},function(e,t,r){"use strict";r.r(t),r.d(t,"Player",(function(){return x})),r.d(t,"Mediator",(function(){return n.Mediator})),r.d(t,"Events",(function(){return n.Events})),r.d(t,"Browser",(function(){return n.Browser})),r.d(t,"PlayerInfo",(function(){return n.PlayerInfo})),r.d(t,"MediaControl",(function(){return n.MediaControl})),r.d(t,"ContainerPlugin",(function(){return n.ContainerPlugin})),r.d(t,"UIContainerPlugin",(function(){return n.UIContainerPlugin})),r.d(t,"CorePlugin",(function(){return n.CorePlugin})),r.d(t,"UICorePlugin",(function(){return n.UICorePlugin})),r.d(t,"Playback",(function(){return n.Playback})),r.d(t,"Container",(function(){return n.Container})),r.d(t,"Core",(function(){return n.Core})),r.d(t,"PlayerError",(function(){return n.PlayerError})),r.d(t,"Loader",(function(){return n.Loader})),r.d(t,"BaseObject",(function(){return n.BaseObject})),r.d(t,"UIObject",(function(){return n.UIObject})),r.d(t,"Utils",(function(){return n.Utils})),r.d(t,"BaseFlashPlayback",(function(){return n.BaseFlashPlayback})),r.d(t,"Flash",(function(){return n.Flash})),r.d(t,"FlasHLS",(function(){return n.FlasHLS})),r.d(t,"HLS",(function(){return n.HLS})),r.d(t,"HTML5Audio",(function(){return n.HTML5Audio})),r.d(t,"HTML5Video",(function(){return n.HTML5Video})),r.d(t,"HTMLImg",(function(){return n.HTMLImg})),r.d(t,"NoOp",(function(){return n.NoOp})),r.d(t,"ClickToPausePlugin",(function(){return n.ClickToPausePlugin})),r.d(t,"DVRControls",(function(){return n.DVRControls})),r.d(t,"Favicon",(function(){return n.Favicon})),r.d(t,"Log",(function(){return n.Log})),r.d(t,"Poster",(function(){return n.Poster})),r.d(t,"SpinnerThreeBouncePlugin",(function(){return n.SpinnerThreeBouncePlugin})),r.d(t,"WaterMarkPlugin",(function(){return n.WaterMarkPlugin})),r.d(t,"Styler",(function(){return n.Styler})),r.d(t,"Vendor",(function(){return n.Vendor})),r.d(t,"version",(function(){return n.version})),r.d(t,"template",(function(){return n.template})),r.d(t,"$",(function(){return n.$}));var n=r(0),i=r.n(n),o=r(1),a=r.n(o),s=r(2),l=r.n(s),u=r(3),c=r.n(u);r(4);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p(e,t,r){return t&&h(e.prototype,t),r&&h(e,r),e}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function y(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(n,e);var t,r=(t=n,function(){var e,r=v(t);if(y()){var n=v(this).constructor;e=Reflect.construct(r,arguments,n)}else e=r.apply(this,arguments);return g(this,e)});function n(){var e;f(this,n);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return(e=r.call.apply(r,[this].concat(i))).timeout=1,e.max_timeout=10,e}return p(n,[{key:"name",get:function(){return"error_plugin"}},{key:"background",get:function(){return"data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%2026.458318%2026.458333%22%3E%3Cpath%20d%3D%22M13.23.302C6.07.302.264%206.107.264%2013.267a12.965%2012.965%200%200%200%20.847%204.595c.19-.497.408-.982.682-1.438.14-.232.294-.457.396-.707.103-.25.15-.533.072-.792a1.362%201.362%200%200%200-.22-.404c-.092-.123-.192-.24-.275-.37a1.662%201.662%200%200%201-.255-1.12%201.5%201.5%200%200%201%20.58-.987c.28-.208.635-.3.985-.288a1.757%201.757%200%200%201%20.346.048c.452.11.852.393%201.148.75.368.447.584%201.01.637%201.586a3.574%203.574%200%200%201-.275%201.693c-.4.955-1.15%201.725-1.565%202.673-.338.775-.435%201.638-.39%202.483.007.077.018.155.025.234a12.965%2012.965%200%200%200%203.62%203.18%2017.63%2017.63%200%200%201-.13-2.11c.002-.56.03-1.12.085-1.675-.34-.236-.65-.51-.87-.86-.392-.62-.466-1.408-.305-2.124.16-.717.54-1.37.997-1.945a7.833%207.833%200%200%201%202.835-2.223%2010.305%2010.305%200%200%201-.09-.126%204.854%204.854%200%200%201-.702-2.176c-.06-.777.064-1.554.115-2.33.037-.543.04-1.085.07-1.627.038-.627.114-1.255.29-1.858a2.36%202.36%200%200%201%20.266-.63%201.4%201.4%200%200%201%20.594-.514c.274-.108.51-.132.776-.087.22.046.425.156.604.294.18.138.335.304.48.477a7.298%207.298%200%200%201%201.04%201.617%203.57%203.57%200%200%201%201.09%200%207.287%207.287%200%200%201%201.04-1.616%203.21%203.21%200%200%201%20.48-.476c.18-.14.383-.248.604-.295a1.268%201.268%200%200%201%20.78.086%201.402%201.402%200%200%201%20.595.517c.124.19.202.408.266.626.175.602.252%201.23.29%201.856.03.543.033%201.087.07%201.628.05.777.175%201.554.116%202.33a4.855%204.855%200%200%201-.705%202.178c-.03.05-.07.096-.103.145.247.278.598.513.898.614a1.956%201.956%200%200%200%201.05.044%201.65%201.65%200%200%200%20.533-.226%201.253%201.253%200%200%200%20.397-.418c.118-.21.166-.45.192-.687.067-.61%200-1.224-.05-1.835-.034-.396-.062-.8.027-1.187.06-.26.177-.518.373-.7a1.106%201.106%200%200%201%20.465-.255%201.312%201.312%200%200%201%20.53-.03c.38.057.736.274.948.594.12.18.194.39.238.604.044.213.06.43.072.648.04.76.04%201.522.018%202.284-.018.665-.055%201.348-.32%201.957-.343.782-1.032%201.366-1.775%201.786a7.052%207.052%200%200%201-1.588.647c.482%201.54.733%203.24.733%204.968a17.6%2017.6%200%200%201-.135%202.125%2012.964%2012.964%200%200%200%206.384-11.152c0-7.16-5.806-12.965-12.965-12.965zM9.602%2016.284v1.483a1.88%201.88%200%200%201%201.083.362%201.738%201.738%200%200%201%20.556.68c.122.27.166.576.116.868a1.493%201.493%200%200%201-.332.708%201.647%201.647%200%200%201-.635.458%201.738%201.738%200%200%201-.787.122v3.73l7.762-4.208-7.762-4.204z%22%20fill%3D%22%23999%22%2F%3E%3C%2Fsvg%3E"}}]),p(n,[{key:"bindEvents",value:function(){this.listenTo(this.container,i.a.Events.CONTAINER_ERROR,this.onError)}},{key:"hide",value:function(){this._err&&this._err.remove()}},{key:"show",value:function(){var e=i.a.$;this.hide();var t="A fatal error occured.";this.options.errorPlugin&&this.options.errorPlugin.text&&(t=this.options.errorPlugin.text),this._err=e("<div>").css({position:"absolute","z-index":"999",width:"100%",height:"100%","background-image":"url("+this.background+")","background-size":"18%","background-repeat":"no-repeat","background-color":"black","background-position":"center","text-align":"center","font-weight":"bold",color:"#eee"});var r=e("<div>").css({position:"absolute",width:"100%","padding-bottom":"5%",bottom:0}).append(e("<h2>").text(t).css({"font-size":"200%"})).append(e("<p>").text("We will be right back").css({"font-size":"120%",margin:"15px"}));this._err.append(r),this.container&&this.container.$el.prepend(this._err)}},{key:"onError",value:function(e){var t=this;if(this.container){var r=this.options.errorPlugin.onError;!r||"function"!=typeof r||r(e,(function(){t.hide(),t.container.getPlugin("click_to_pause").enable()}))?(this.show(),this.container.getPlugin("click_to_pause").disable()):console.log("skipping overlay")}}}]),n}(i.a.ContainerPlugin),_=function(e){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};new Headers;return fetch("https://media.ccc.de/graphql",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({operationName:e,query:t,variables:r})}).then((function(e){var t=e.body.getReader(),r="",n=new TextDecoder("utf-8");return t.read().then((function e(i){var o=i.done,a=i.value;return o?JSON.parse(r):(r+=n.decode(a),t.read().then(e))}))}))}("LectureBySlug",'\n query LectureBySlug {\n lectureBySlug(slug: "'.concat(e,'") {\n originalLanguage\n videos {\n label\n url\n mimeType\n }\n }\n }\n ')).then((function(e){if(!e.data.lectureBySlug)throw new Error("Lecture could not be found");return e.data.lectureBySlug.videos.map((function(e){var t=e.label,r=e.url;return{label:t,mimeType:e.mimeType,source:r}}))}))};function A(e){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function E(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function T(e,t){return(T=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e,t){return!t||"object"!==A(t)&&"function"!=typeof t?w(e):t}function w(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function C(e){return(C=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var x=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&T(e,t)}(u,e);var t,r,i,o,s=(t=u,function(){var e,r=C(t);if(k()){var n=C(this).constructor;e=Reflect.construct(r,arguments,n)}else e=r.apply(this,arguments);return S(this,e)});function u(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(t=s.call(this)).timeout=5,t.maxTimeout=15,t._playerPromise=t._getConfig(e).then((function(e){return t._options=e,t._player=new n.Player(t._options),t._player.core&&t._player.core.isReady?t._addEventListeners():t.listenToOnce(t._player,n.Events.PLAYER_READY,t._addEventListeners.bind(w(t))),t._player})),t}return r=u,(i=[{key:"attachTo",value:function(){var e=arguments;this._playerPromise.then((function(t){t.attachTo.apply(t,e)}))}},{key:"_getConfig",value:function(e){var t=[c.a,l.a,a.a,b];e.plugins&&e.plugins.length&&(t=t.concat(e.plugins),console.log("loading plugins"),t.forEach((function(e){return console.log(e.name,e.type)})));var r,n=Promise.resolve({});return e.vocStream?n=function(e,t,r,n){var i="MediaSource"in window;console.log("vp9/vorbis",i&&MediaSource.isTypeSupported('video/webm; codecs="vp9,vorbis"'),"vp9/opus",i&&MediaSource.isTypeSupported('video/webm; codecs="vp9,opus"'));var o={levelSelectorConfig:{labelCallback:function(e){var t=e.videoBandwidth||e.level.bitrate;return t<=1e5?"Slides":t<=8e5?"SD":"HD"},title:"Quality"},disableErrorScreen:!0,errorPlugin:{text:"Stream offline",onError:n}};return i&&MediaSource.isTypeSupported('video/webm; codecs="vp9,opus"')?(o.source={source:"//cdn.c3voc.de/dash/".concat(e,"/manifest.mpd")},o.shakaConfiguration={preferredAudioLanguage:r,abr:{defaultBandwidthEstimate:1e6},streaming:{jumpLargeGaps:!0},manifest:{dash:{defaultPresentationDelay:3,ignoreSuggestedPresentationDelay:!0}}}):t||!i&&""==document.createElement("video").canPlayType("application/vnd.apple.mpegURL")?o.source=t?{source:"//cdn.c3voc.de/".concat(e,"_native.mp3"),mimeType:"audio/mp3"}:{source:"//cdn.c3voc.de/".concat(e,"_native_hd.webm"),mimeType:"video/webm"}:o.source={source:"//cdn.c3voc.de/hls/".concat(e,"_native_hd.m3u8"),mimeType:"application/vnd.apple.mpegURL"},Promise.resolve(o)}(e.vocStream,e.audioOnly,e.preferredAudioLanguage,this._handleError.bind(this)):e.vocLecture&&(r=e.vocLecture,n=_(r).then((function(e){return{sources:e,levelSelectorConfig:{labelCallback:function(e,t){console.log("labelCallback",arguments);var r=e.videoBandwidth||e.level.bitrate;return r<=1e5?"Slides":r<=8e5?"SD":"HD"},title:"Quality"}}})).catch((function(e){return console.log("Failed to fetch media sources",e),{playbackNotSupportedMessage:"".concat(e.message)}}))),n.then((function(r){return Object.assign({width:"100%",height:"100%",hideMediaControlDelay:1e3,position:"top-left",watermark:"data:image/svg+xml;utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%0A%3Csvg%0A%20%20%20xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22%0A%20%20%20xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22%0A%20%20%20xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22%0A%20%20%20xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0A%20%20%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0A%20%20%20id%3D%22svg4568%22%0A%20%20%20version%3D%221.1%22%0A%20%20%20viewBox%3D%220%200%2026.458318%2026.458333%22%0A%20%20%20height%3D%22100%22%0A%20%20%20width%3D%22100%22%3E%0A%20%20%3Cmetadata%0A%20%20%20%20%20id%3D%22metadata4574%22%3E%0A%20%20%20%20%3Crdf%3ARDF%3E%0A%20%20%20%20%20%20%3Ccc%3AWork%0A%20%20%20%20%20%20%20%20%20rdf%3Aabout%3D%22%22%3E%0A%20%20%20%20%20%20%20%20%3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E%0A%20%20%20%20%20%20%20%20%3Cdc%3Atype%0A%20%20%20%20%20%20%20%20%20%20%20rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3Cdc%3Atitle%3E%3C%2Fdc%3Atitle%3E%0A%20%20%20%20%20%20%3C%2Fcc%3AWork%3E%0A%20%20%20%20%3C%2Frdf%3ARDF%3E%0A%20%20%3C%2Fmetadata%3E%0A%20%20%3Cdefs%0A%20%20%20%20%20id%3D%22defs4572%22%20%2F%3E%0A%20%20%3Cpath%0A%20%20%20%20%20style%3D%22fill%3A%23ffffff%3Bfill-opacity%3A0.8627451%3Bstroke-width%3A0.79176539%22%0A%20%20%20%20%20id%3D%22path4566%22%0A%20%20%20%20%20d%3D%22m%2012.91039%2C7.1445417%20c%20-5.6690402%2C0%20-10.2660306%2C4.5961993%20-10.2660306%2C10.2652403%20a%2010.265238%2C10.265238%200%200%200%200.6706253%2C3.63816%20c%200.1504354%2C-0.393506%200.3230402%2C-0.777512%200.539984%2C-1.138557%200.1108472%2C-0.18369%200.2327789%2C-0.361837%200.313539%2C-0.559779%200.081551%2C-0.197941%200.1187648%2C-0.42201%200.057007%2C-0.627078%20A%201.0783844%2C1.0783844%200%200%200%204.0513264%2C18.402655%20C%203.9784841%2C18.305267%203.8993075%2C18.212631%203.833591%2C18.109702%20A%201.3159141%2C1.3159141%200%200%201%203.6316909%2C17.222924%201.1876481%2C1.1876481%200%200%201%204.0909148%2C16.441452%20c%200.2216944%2C-0.164688%200.5027709%2C-0.23753%200.7798889%2C-0.228028%20a%201.3911318%2C1.3911318%200%200%201%200.2739508%2C0.03801%20c%200.3578779%2C0.08709%200.6745841%2C0.311164%200.9089467%2C0.593824%200.2913696%2C0.353919%200.462391%2C0.799683%200.5043546%2C1.25574%20a%202.8297696%2C2.8297696%200%200%201%20-0.2177355%2C1.34046%20C%206.0236142%2C20.197593%205.42979%2C20.807252%205.1012074%2C21.557847%204.8335907%2C22.171464%204.7567894%2C22.854758%204.7924189%2C23.5238%20c%200.00554%2C0.06096%200.014251%2C0.122723%200.019794%2C0.185272%20a%2010.265238%2C10.265238%200%200%200%202.866191%2C2.517815%2013.958824%2C13.958824%200%200%201%20-0.1029298%2C-1.670626%20c%200.00161%2C-0.443389%200.023751%2C-0.886777%200.067304%2C-1.326206%20C%207.3735785%2C23.043191%207.1281312%2C22.826248%206.9539421%2C22.54913%206.6435705%2C22.058235%206.5849797%2C21.434324%206.712454%2C20.867421%206.8391365%2C20.299724%207.1400069%2C19.782702%207.5018439%2C19.327437%20A%206.2018984%2C6.2018984%200%200%201%209.7464993%2C17.567343%208.1591425%2C8.1591425%200%200%201%209.6752356%2C17.46758%203.8432293%2C3.8432293%200%200%201%209.1194163%2C15.744698%20c%20-0.047503%2C-0.615201%200.050669%2C-1.230403%200.091055%2C-1.844814%200.02929%2C-0.429928%200.031672%2C-0.859064%200.055423%2C-1.288201%200.030084%2C-0.496437%200.090261%2C-0.993667%200.2296124%2C-1.471101%20a%201.8685664%2C1.8685664%200%200%201%200.21061%2C-0.498812%201.1084716%2C1.1084716%200%200%201%200.4703083%2C-0.406968%20c%200.216945%2C-0.0855%200.403801%2C-0.104512%200.614411%2C-0.06888%200.174189%2C0.03642%200.3365%2C0.123516%200.478227%2C0.232779%200.142518%2C0.109264%200.26524%2C0.240698%200.380047%2C0.377673%20a%205.7783039%2C5.7783039%200%200%201%200.823436%2C1.280285%202.8266025%2C2.8266025%200%200%201%200.863024%2C0%205.7695944%2C5.7695944%200%200%201%200.823436%2C-1.279493%202.5415669%2C2.5415669%200%200%201%200.380047%2C-0.376881%20c%200.142518%2C-0.110847%200.303246%2C-0.196358%200.478227%2C-0.23357%20a%201.0039585%2C1.0039585%200%200%201%200.617577%2C0.06809%201.1100551%2C1.1100551%200%200%201%200.4711%2C0.409343%20c%200.09818%2C0.150436%200.159936%2C0.323041%200.21061%2C0.495645%200.138558%2C0.476643%200.199525%2C0.973872%200.229612%2C1.469517%200.02375%2C0.429928%200.02612%2C0.860649%200.05542%2C1.288995%200.0396%2C0.615201%200.138559%2C1.230403%200.09185%2C1.844813%20a%203.844021%2C3.844021%200%200%201%20-0.558194%2C1.724465%20c%20-0.02375%2C0.0396%20-0.05542%2C0.076%20-0.08154%2C0.114805%200.195565%2C0.220111%200.473476%2C0.406176%200.711006%2C0.486144%20a%201.5486932%2C1.5486932%200%200%200%200.831353%2C0.03484%201.3064129%2C1.3064129%200%200%200%200.42201%2C-0.17894%200.99208205%2C0.99208205%200%200%200%200.314331%2C-0.330957%20c%200.09343%2C-0.166272%200.131433%2C-0.356295%200.152019%2C-0.543944%200.05305%2C-0.482977%200%2C-0.96912%20-0.0396%2C-1.452889%20-0.02692%2C-0.313539%20-0.04909%2C-0.633412%200.02138%2C-0.939826%200.0475%2C-0.205858%200.140142%2C-0.410133%200.295328%2C-0.554235%20a%200.87569253%2C0.87569253%200%200%201%200.36817%2C-0.2019%201.0387963%2C1.0387963%200%200%201%200.419637%2C-0.02375%20c%200.30087%2C0.04514%200.582739%2C0.216942%200.750593%2C0.470308%200.09502%2C0.142517%200.153603%2C0.308788%200.18844%2C0.478226%200.03484%2C0.168646%200.0475%2C0.340459%200.05701%2C0.513064%200.03167%2C0.601741%200.03167%2C1.205067%200.01426%2C1.808392%20-0.01426%2C0.526524%20-0.04355%2C1.0673%20-0.253366%2C1.549486%20-0.271575%2C0.619159%20-0.817101%2C1.08155%20-1.405383%2C1.414092%20a%205.5835296%2C5.5835296%200%200%201%20-1.257323%2C0.512272%20c%200.38163%2C1.219319%200.580363%2C2.56532%200.580363%2C3.93349%20a%2013.935071%2C13.935071%200%200%201%20-0.106901%2C1.682498%2010.264446%2C10.264446%200%200%200%205.054631%2C-8.829768%20c%200%2C-5.669041%20-4.59699%2C-10.2652391%20-10.265238%2C-10.2652391%20z%20M%2010.037865%2C19.798537%20v%201.174188%20a%201.488519%2C1.488519%200%200%201%200.857482%2C0.286619%201.3760882%2C1.3760882%200%200%201%200.440222%2C0.538402%20c%200.0966%2C0.213775%200.131432%2C0.456056%200.09184%2C0.687252%20a%201.1821057%2C1.1821057%200%200%201%20-0.262867%2C0.560568%201.3040376%2C1.3040376%200%200%201%20-0.502772%2C0.36263%201.3760882%2C1.3760882%200%200%201%20-0.623119%2C0.0966%20v%202.953287%20l%206.145683%2C-3.33175%20-6.145683%2C-3.328583%20z%22%20%2F%3E%0A%3C%2Fsvg%3E",watermarkLink:"https://c3voc.de",levelSelectorConfig:{labelCallback:function(e){var t="unknown";return e.height?t=e.height:e.level&&e.level.height&&(t=e.level.height),t+"p"},title:"Quality"},audioTrackSelectorConfig:{title:"Language"}},r,e,{plugins:t})}))}},{key:"_containerChanged",value:function(){this.stopListening(),this._addEventListeners()}},{key:"_addEventListeners",value:function(){var e=this._player.core;this._container=e.activeContainer,this.listenTo(this._player,n.Events.PLAYER_PLAY,this._handlePlay),this.listenTo(this._player,n.Events.PLAYER_STOP,this._handleStop),this.listenTo(e,n.Events.CORE_ACTIVE_CONTAINER_CHANGED,this._containerChanged),this.listenTo(this._container,n.Events.CONTAINER_STATE_BUFFERFULL,this._handleBufferFull),this.listenTo(this._container,n.Events.CONTAINER_MEDIACONTROL_HIDE,this._handleMediaControlHide),this.listenTo(this._container,n.Events.CONTAINER_MEDIACONTROL_SHOW,this._handleMediaControlShow)}},{key:"_handleMediaControlHide",value:function(){this._container.$el.find(".clappr-watermark[data-watermark]").addClass("clappr-watermark-hide")}},{key:"_handleMediaControlShow",value:function(){this._container.$el.find(".clappr-watermark[data-watermark]").removeClass("clappr-watermark-hide")}},{key:"_getTimeout",value:function(){var e=.6*this.timeout+.4*this.timeout*Math.random();return this.timeout=Math.min(2*this.timeout,this.maxTimeout),e}},{key:"_resetTimeout",value:function(){this.timeout=5}},{key:"_handleError",value:function(e,t){this._recovery?clearTimeout(this._recovery.timeout):this._player.stop();var r=this._getTimeout();return console.log("got error",e.code,"retrying in ".concat(Math.round(r),"s")),this._recovery={clearOverlay:t,state:"restarting",timeout:setTimeout(this._waitForMedia.bind(this),1e3*r)},!0}},{key:"_handlePlay",value:function(){this._recovery&&(console.log("soft recovery: play"),this._recovery.clearOverlay(),clearTimeout(this._recovery.timeout),this._recovery=null),this._resetTimeout()}},{key:"_handleStop",value:function(e){this._recovery&&this._container&&(console.log("soft recovery: stop"),this._container.playback.play.call(this._container.playback))}},{key:"_handleBufferFull",value:function(){if(this._recovery){console.log("seeking to end for recovery");var e=Math.max(this._player.getDuration()-6,0);this._player.seek(e)}}},{key:"_handleMediaCheck",value:function(e){if(e)console.log("try playing again, media should be available"),this._player.play();else{var t=this._getTimeout();console.log("test for media failed, retrying in ~".concat(Math.round(t),"s")),setTimeout(this._waitForMedia.bind(this),1e3*t)}}},{key:"_waitForMedia",value:function(){var e=this._player.options.source;e&&e.source&&(e=e.source),"string"==typeof e?function(e,t){if(!t||"function"!=typeof t)throw new Error("Excepted function, got '".concat(t,"'"));var r=new XMLHttpRequest;r.onreadystatechange=function(){this.readyState===XMLHttpRequest.HEADERS_RECEIVED&&(200===this.status?t(!0):t(!1),r.abort())},r.open("GET",e,!0),r.send(null)}(e,this._handleMediaCheck.bind(this)):this.reset()}},{key:"reset",value:function(){console.log("performing hard reset"),this._recovery=null;var e=0==this._player.getVolume();e||this._player.mute(),this._player.configure({source:this._player.options.source,autoPlay:!0}),e||this._player.unmute()}}])&&E(r.prototype,i),o&&E(r,o),u}(n.BaseObject)}])})); //# sourceMappingURL=player.js.map
\ No newline at end of file |