!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Clappr=e():t.Clappr=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="<%=baseUrl%>/",e(e.s=47)}([function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=r(19),s=n(o),l=r(1),u=r(106),c=n(u),f=Array.prototype.slice,d=/\s+/,h=function(t,e,r,n){if(!r)return!0;if("object"===(void 0===r?"undefined":a(r))){for(var i in r)t[e].apply(t,[i,r[i]].concat(n));return!1}if(d.test(r)){for(var o=r.split(d),s=0,l=o.length;s0&&(o+=a+":",i<1&&(o+="00:")),(i&&i>0||e)&&(o+=("0"+i).slice(-2)+":"),o+=("0"+n).slice(-2)+":",o+=("0"+r).slice(-2),o.trim()}function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"t",e=0,r=w.params[t]||w.hashParams[t]||"",n=r.match(/[0-9]+[hms]+/g)||[];return n.length>0?function(){var t={h:3600,m:60,s:1};n.forEach(function(r){if(r){var n=r[r.length-1],i=parseInt(r.slice(0,r.length-1),10);e+=i*t[n]}})}():r&&(e=parseInt(r,10)),e}function f(t){return k[t]||(k[t]=0),t+ ++k[t]}function d(t){return t-parseFloat(t)+1>=0}function h(){var t=document.getElementsByTagName("script");return t.length?t[t.length-1].src:""}function p(){return window.navigator&&window.navigator.language}function g(){return window.performance&&window.performance.now?performance.now():Date.now()}function y(t,e){var r=t.indexOf(e);r>=0&&t.splice(r,1)}Object.defineProperty(e,"__esModule",{value:!0}),e.DomRecycler=e.cancelAnimationFrame=e.requestAnimationFrame=e.QueryString=e.Config=e.Fullscreen=void 0;var v=function(){function t(t,e){for(var r=0;r0?L.shift():(0,E.default)("<"+t+">")},t.garbage=function(t){this.options.recycleVideo&&"VIDEO"===t[0].tagName.toUpperCase()&&(t.children().remove(),L.push(t))},t}();O.options={recycleVideo:!1},e.default={Config:A,Fullscreen:T,QueryString:w,DomRecycler:O,extend:l,formatTime:u,seekStringToSeconds:c,uniqueId:f,currentScriptUrl:h,isNumber:d,requestAnimationFrame:S,cancelAnimationFrame:R,getBrowserLanguage:p,now:g,removeArrayItem:y}},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var r=0;r0&&e-1 in t)}function s(t){return P.call(t,function(t){return null!=t})}function l(t){return t.length>0?w.fn.concat.apply([],t):t}function u(t){return t.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 c(t){return t in x?x[t]:x[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function f(t,e){return"number"!=typeof e||N[u(t)]?e:e+"px"}function d(t){var e,r;return I[t]||(e=D.createElement(t),D.body.appendChild(e),r=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==r&&(r="block"),I[t]=r),I[t]}function h(t){return"children"in t?C.call(t.children):w.map(t.childNodes,function(t){if(1==t.nodeType)return t})}function p(t,e){var r,n=t?t.length:0;for(r=0;r]*>/,F=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,B=/^(?:body|html)$/i,U=["val","css","html","text","data","width","height","offset"],j=["after","prepend","before","append"],G=D.createElement("table"),Y=D.createElement("tr"),V={tr:D.createElement("tbody"),tbody:G,thead:G,tfoot:G,td:Y,th:Y,"*":D.createElement("div")},K=/complete|loaded|interactive/,$=/^[\w-]*$/,z={},H=z.toString,W={},q=D.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"},Z=Array.isArray||function(t){return t instanceof Array};return W.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var r=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(r)return r.call(t,e);var n,i=t.parentNode,a=!i;return a&&(i=q).appendChild(t),n=~W.qsa(i,e).indexOf(t),a&&q.removeChild(t),n},S=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},R=function(t){return P.call(t,function(e,r){return t.indexOf(e)==r})},W.fragment=function(t,e,r){var n,i,o;return F.test(t)&&(n=w(D.createElement(RegExp.$1))),n||(t.replace&&(t=t.replace(/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,"<$1>")),e===T&&(e=M.test(t)&&RegExp.$1),e in V||(e="*"),o=V[e],o.innerHTML=""+t,n=w.each(C.call(o.childNodes),function(){o.removeChild(this)})),a(r)&&(i=w(n),w.each(r,function(t,e){U.indexOf(t)>-1?i[t](e):i.attr(t,e)})),n},W.Z=function(t,e){return new p(t,e)},W.isZ=function(t){return t instanceof W.Z},W.init=function(t,r){var n;if(!t)return W.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&M.test(t))n=W.fragment(t,RegExp.$1,r),t=null;else{if(r!==T)return w(r).find(t);n=W.qsa(D,t)}else{if(e(t))return w(D).ready(t);if(W.isZ(t))return t;if(Z(t))n=s(t);else if(i(t))n=[t],t=null;else if(M.test(t))n=W.fragment(t.trim(),RegExp.$1,r),t=null;else{if(r!==T)return w(r).find(t);n=W.qsa(D,t)}}return W.Z(n,t)},w=function(t,e){return W.init(t,e)},w.extend=function(t){var e,r=C.call(arguments,1);return"boolean"==typeof t&&(e=t,t=r.shift()),r.forEach(function(r){g(t,r,e)}),t},W.qsa=function(t,e){var r,n="#"==e[0],i=!n&&"."==e[0],a=n||i?e.slice(1):e,o=$.test(a);return t.getElementById&&o&&n?(r=t.getElementById(a))?[r]:[]:1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType?[]:C.call(o&&!n&&t.getElementsByClassName?i?t.getElementsByClassName(a):t.getElementsByTagName(e):t.querySelectorAll(e))},w.contains=D.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},w.type=t,w.isFunction=e,w.isWindow=r,w.isArray=Z,w.isPlainObject=a,w.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},w.isNumeric=function(t){var e=Number(t),r=typeof t;return null!=t&&"boolean"!=r&&("string"!=r||t.length)&&!isNaN(e)&&isFinite(e)||!1},w.inArray=function(t,e,r){return L.indexOf.call(e,t,r)},w.camelCase=S,w.trim=function(t){return null==t?"":String.prototype.trim.call(t)},w.uuid=0,w.support={},w.expr={},w.noop=function(){},w.map=function(t,e){var r,n,i,a=[];if(o(t))for(n=0;n=0?t:t+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(t){return L.every.call(this,function(e,r){return!1!==t.call(e,r,e)}),this},filter:function(t){return e(t)?this.not(this.not(t)):w(P.call(this,function(e){return W.matches(e,t)}))},add:function(t,e){return w(R(this.concat(w(t,e))))},is:function(t){return this.length>0&&W.matches(this[0],t)},not:function(t){var r=[];if(e(t)&&t.call!==T)this.each(function(e){t.call(this,e)||r.push(this)});else{var n="string"==typeof t?this.filter(t):o(t)&&e(t.item)?C.call(t):w(t);this.forEach(function(t){n.indexOf(t)<0&&r.push(t)})}return w(r)},has:function(t){return this.filter(function(){return i(t)?w.contains(this,t):w(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!i(t)?t:w(t)},last:function(){var t=this[this.length-1];return t&&!i(t)?t:w(t)},find:function(t){var e=this;return t?"object"==typeof t?w(t).filter(function(){var t=this;return L.some.call(e,function(e){return w.contains(e,t)})}):1==this.length?w(W.qsa(this[0],t)):this.map(function(){return W.qsa(this,t)}):w()},closest:function(t,e){var r=[],i="object"==typeof t&&w(t);return this.each(function(a,o){for(;o&&!(i?i.indexOf(o)>=0:W.matches(o,t));)o=o!==e&&!n(o)&&o.parentNode;o&&r.indexOf(o)<0&&r.push(o)}),w(r)},parents:function(t){for(var e=[],r=this;r.length>0;)r=w.map(r,function(t){if((t=t.parentNode)&&!n(t)&&e.indexOf(t)<0)return e.push(t),t});return y(e,t)},parent:function(t){return y(R(this.pluck("parentNode")),t)},children:function(t){return y(this.map(function(){return h(this)}),t)},contents:function(){return this.map(function(){return this.contentDocument||C.call(this.childNodes)})},siblings:function(t){return y(this.map(function(t,e){return P.call(h(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return w.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=d(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var r=e(t);if(this[0]&&!r)var n=w(t).get(0),i=n.parentNode||this.length>1;return this.each(function(e){w(this).wrapAll(r?t.call(this,e):i?n.cloneNode(!0):n)})},wrapAll:function(t){if(this[0]){w(this[0]).before(t=w(t));for(var e;(e=t.children()).length;)t=e.first();w(t).append(this)}return this},wrapInner:function(t){var r=e(t);return this.each(function(e){var n=w(this),i=n.contents(),a=r?t.call(this,e):t;i.length?i.wrapAll(a):n.append(a)})},unwrap:function(){return this.parent().each(function(){w(this).replaceWith(w(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var e=w(this);(t===T?"none"==e.css("display"):t)?e.show():e.hide()})},prev:function(t){return w(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return w(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var r=this.innerHTML;w(this).empty().append(v(this,t,e,r))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var r=v(this,t,e,this.textContent);this.textContent=null==r?"":""+r}):0 in this?this.pluck("textContent").join(""):null},attr:function(t,e){var r;return"string"!=typeof t||1 in arguments?this.each(function(r){if(1===this.nodeType)if(i(t))for(A in t)m(this,A,t[A]);else m(this,t,v(this,e,r,this.getAttribute(t)))}):0 in this&&1==this[0].nodeType&&null!=(r=this[0].getAttribute(t))?r:T},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){m(this,t)},this)})},prop:function(t,e){return t=X[t]||t,1 in arguments?this.each(function(r){this[t]=v(this,e,r,this[t])}):this[0]&&this[0][t]},removeProp:function(t){return t=X[t]||t,this.each(function(){delete this[t]})},data:function(t,e){var r="data-"+t.replace(/([A-Z])/g,"-$1").toLowerCase(),n=1 in arguments?this.attr(r,e):this.attr(r);return null!==n?_(n):T},val:function(t){return 0 in arguments?(null==t&&(t=""),this.each(function(e){this.value=v(this,t,e,this.value)})):this[0]&&(this[0].multiple?w(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var r=w(this),n=v(this,t,e,r.offset()),i=r.offsetParent().offset(),a={top:n.top-i.top,left:n.left-i.left};"static"==r.css("position")&&(a.position="relative"),r.css(a)});if(!this.length)return null;if(D.documentElement!==this[0]&&!w.contains(D.documentElement,this[0]))return{top:0,left:0};var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(e,r){if(arguments.length<2){var n=this[0];if("string"==typeof e){if(!n)return;return n.style[S(e)]||getComputedStyle(n,"").getPropertyValue(e)}if(Z(e)){if(!n)return;var i={},a=getComputedStyle(n,"");return w.each(e,function(t,e){i[e]=n.style[S(e)]||a.getPropertyValue(e)}),i}}var o="";if("string"==t(e))r||0===r?o=u(e)+":"+f(e,r):this.each(function(){this.style.removeProperty(u(e))});else for(A in e)e[A]||0===e[A]?o+=u(A)+":"+f(A,e[A])+";":this.each(function(){this.style.removeProperty(u(A))});return this.each(function(){this.style.cssText+=";"+o})},index:function(t){return t?this.indexOf(w(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return!!t&&L.some.call(this,function(t){return this.test(b(t))},c(t))},addClass:function(t){return t?this.each(function(e){if("className"in this){k=[];var r=b(this);v(this,t,e,r).split(/\s+/g).forEach(function(t){w(this).hasClass(t)||k.push(t)},this),k.length&&b(this,r+(r?" ":"")+k.join(" "))}}):this},removeClass:function(t){return this.each(function(e){if("className"in this){if(t===T)return b(this,"");k=b(this),v(this,t,e,k).split(/\s+/g).forEach(function(t){k=k.replace(c(t)," ")}),b(this,k.trim())}})},toggleClass:function(t,e){return t?this.each(function(r){var n=w(this);v(this,t,r,b(this)).split(/\s+/g).forEach(function(t){(e===T?!n.hasClass(t):e)?n.addClass(t):n.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===T?e?this[0].scrollTop:this[0].pageYOffset:this.each(e?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var e="scrollLeft"in this[0];return t===T?e?this[0].scrollLeft:this[0].pageXOffset:this.each(e?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),r=this.offset(),n=B.test(e[0].nodeName)?{top:0,left:0}:e.offset();return r.top-=parseFloat(w(t).css("margin-top"))||0,r.left-=parseFloat(w(t).css("margin-left"))||0,n.top+=parseFloat(w(e[0]).css("border-top-width"))||0,n.left+=parseFloat(w(e[0]).css("border-left-width"))||0,{top:r.top-n.top,left:r.left-n.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||D.body;t&&!B.test(t.nodeName)&&"static"==w(t).css("position");)t=t.offsetParent;return t})}},w.fn.detach=w.fn.remove,["width","height"].forEach(function(t){var e=t.replace(/./,function(t){return t[0].toUpperCase()});w.fn[t]=function(i){var a,o=this[0];return i===T?r(o)?o["inner"+e]:n(o)?o.documentElement["scroll"+e]:(a=this.offset())&&a[t]:this.each(function(e){o=w(this),o.css(t,v(this,i,e,o[t]()))})}}),j.forEach(function(e,r){var n=r%2;w.fn[e]=function(){var e,i,a=w.map(arguments,function(r){var n=[];return e=t(r),"array"==e?(r.forEach(function(t){return t.nodeType!==T?n.push(t):w.zepto.isZ(t)?n=n.concat(t.get()):void(n=n.concat(W.fragment(t)))}),n):"object"==e||null==r?r:W.fragment(r)}),o=this.length>1;return a.length<1?this:this.each(function(t,e){i=n?e:e.parentNode,e=0==r?e.nextSibling:1==r?e.firstChild:2==r?e:null;var s=w.contains(D.documentElement,i);a.forEach(function(t){if(o)t=t.cloneNode(!0);else if(!i)return w(t).remove();i.insertBefore(t,e),s&&E(t,function(t){if(!(null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src)){var e=t.ownerDocument?t.ownerDocument.defaultView:window;e.eval.call(e,t.innerHTML)}})})})},w.fn[n?e+"To":"insert"+(r?"Before":"After")]=function(t){return w(t)[e](this),this}}),W.Z.prototype=p.prototype=w.fn,W.uniq=R,W.deserializeValue=_,w.zepto=W,w}();window.Zepto=r,void 0===window.$&&(window.$=r),function(t){function e(e,r,n){var i=t.Event(r);return t(e).trigger(i,n),!i.isDefaultPrevented()}function r(t,r,n,i){if(t.global)return e(r||b,n,i)}function n(e){e.global&&0==t.active++&&r(e,null,"ajaxStart")}function i(e){e.global&&!--t.active&&r(e,null,"ajaxStop")}function a(t,e){var n=e.context;if(!1===e.beforeSend.call(n,t,e)||!1===r(e,n,"ajaxBeforeSend",[t,e]))return!1;r(e,n,"ajaxSend",[t,e])}function o(t,e,n,i){var a=n.context;n.success.call(a,t,"success",e),i&&i.resolveWith(a,[t,"success",e]),r(n,a,"ajaxSuccess",[e,n,t]),l("success",e,n)}function s(t,e,n,i,a){var o=i.context;i.error.call(o,n,e,t),a&&a.rejectWith(o,[n,e,t]),r(i,o,"ajaxError",[n,i,t||e]),l(e,n,i)}function l(t,e,n){var a=n.context;n.complete.call(a,e,t),r(n,a,"ajaxComplete",[e,n]),i(n)}function u(t,e,r){if(r.dataFilter==c)return t;var n=r.context;return r.dataFilter.call(n,t,e)}function c(){}function f(t){return t&&(t=t.split(";",2)[0]),t&&(t==A?"html":t==T?"json":_.test(t)?"script":E.test(t)&&"xml")||"text"}function d(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function h(e){e.processData&&e.data&&"string"!=t.type(e.data)&&(e.data=t.param(e.data,e.traditional)),!e.data||e.type&&"GET"!=e.type.toUpperCase()&&"jsonp"!=e.dataType||(e.url=d(e.url,e.data),e.data=void 0)}function p(e,r,n,i){return t.isFunction(r)&&(i=n,n=r,r=void 0),t.isFunction(n)||(i=n,n=void 0),{url:e,data:r,success:n,dataType:i}}function g(e,r,n,i){var a,o=t.isArray(r),s=t.isPlainObject(r);t.each(r,function(r,l){a=t.type(l),i&&(r=n?i:i+"["+(s||"object"==a||"array"==a?r:"")+"]"),!i&&o?e.add(l.name,l.value):"array"==a||!n&&"object"==a?g(e,l,n,r):e.add(r,l)})}var y,v,m=+new Date,b=window.document,_=/^(?:text|application)\/javascript/i,E=/^(?:text|application)\/xml/i,T="application/json",A="text/html",w=/^\s*$/,k=b.createElement("a");k.href=window.location.href,t.active=0,t.ajaxJSONP=function(e,r){if(!("type"in e))return t.ajax(e);var n,i,l=e.jsonpCallback,u=(t.isFunction(l)?l():l)||"Zepto"+m++,c=b.createElement("script"),f=window[u],d=function(e){t(c).triggerHandler("error",e||"abort")},h={abort:d};return r&&r.promise(h),t(c).on("load error",function(a,l){clearTimeout(i),t(c).off().remove(),"error"!=a.type&&n?o(n[0],h,e,r):s(null,l||"error",h,e,r),window[u]=f,n&&t.isFunction(f)&&f(n[0]),f=n=void 0}),!1===a(h,e)?(d("abort"),h):(window[u]=function(){n=arguments},c.src=e.url.replace(/\?(.+)=\?/,"?$1="+u),b.head.appendChild(c),e.timeout>0&&(i=setTimeout(function(){d("timeout")},e.timeout)),h)},t.ajaxSettings={type:"GET",beforeSend:c,success:c,error:c,complete:c,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:T,xml:"application/xml, text/xml",html:A,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:c},t.ajax=function(e){var r,i,l=t.extend({},e||{}),p=t.Deferred&&t.Deferred();for(y in t.ajaxSettings)void 0===l[y]&&(l[y]=t.ajaxSettings[y]);n(l),l.crossDomain||(r=b.createElement("a"),r.href=l.url,r.href=r.href,l.crossDomain=k.protocol+"//"+k.host!=r.protocol+"//"+r.host),l.url||(l.url=window.location.toString()),(i=l.url.indexOf("#"))>-1&&(l.url=l.url.slice(0,i)),h(l);var g=l.dataType,m=/\?.+=\?/.test(l.url);if(m&&(g="jsonp"),!1!==l.cache&&(e&&!0===e.cache||"script"!=g&&"jsonp"!=g)||(l.url=d(l.url,"_="+Date.now())),"jsonp"==g)return m||(l.url=d(l.url,l.jsonp?l.jsonp+"=?":!1===l.jsonp?"":"callback=?")),t.ajaxJSONP(l,p);var _,E=l.accepts[g],T={},A=function(t,e){T[t.toLowerCase()]=[t,e]},S=/^([\w-]+:)\/\//.test(l.url)?RegExp.$1:window.location.protocol,R=l.xhr(),L=R.setRequestHeader;if(p&&p.promise(R),l.crossDomain||A("X-Requested-With","XMLHttpRequest"),A("Accept",E||"*/*"),(E=l.mimeType||E)&&(E.indexOf(",")>-1&&(E=E.split(",",2)[0]),R.overrideMimeType&&R.overrideMimeType(E)),(l.contentType||!1!==l.contentType&&l.data&&"GET"!=l.type.toUpperCase())&&A("Content-Type",l.contentType||"application/x-www-form-urlencoded"),l.headers)for(v in l.headers)A(v,l.headers[v]);if(R.setRequestHeader=A,R.onreadystatechange=function(){if(4==R.readyState){R.onreadystatechange=c,clearTimeout(_);var e,r=!1;if(R.status>=200&&R.status<300||304==R.status||0==R.status&&"file:"==S){if(g=g||f(l.mimeType||R.getResponseHeader("content-type")),"arraybuffer"==R.responseType||"blob"==R.responseType)e=R.response;else{e=R.responseText;try{e=u(e,g,l),"script"==g?(0,eval)(e):"xml"==g?e=R.responseXML:"json"==g&&(e=w.test(e)?null:t.parseJSON(e))}catch(t){r=t}if(r)return s(r,"parsererror",R,l,p)}o(e,R,l,p)}else s(R.statusText||null,R.status?"error":"abort",R,l,p)}},!1===a(R,l))return R.abort(),s(null,"abort",R,l,p),R;var O=!("async"in l)||l.async;if(R.open(l.type,l.url,O,l.username,l.password),l.xhrFields)for(v in l.xhrFields)R[v]=l.xhrFields[v];for(v in T)L.apply(R,T[v]);return l.timeout>0&&(_=setTimeout(function(){R.onreadystatechange=c,R.abort(),s(null,"timeout",R,l,p)},l.timeout)),R.send(l.data?l.data:null),R},t.get=function(){return t.ajax(p.apply(null,arguments))},t.post=function(){var e=p.apply(null,arguments);return e.type="POST",t.ajax(e)},t.getJSON=function(){var e=p.apply(null,arguments);return e.dataType="json",t.ajax(e)},t.fn.load=function(e,r,n){if(!this.length)return this;var i,a=this,o=e.split(/\s/),s=p(e,r,n),l=s.success;return o.length>1&&(s.url=o[0],i=o[1]),s.success=function(e){a.html(i?t("
").html(e.replace(/)<[^<]*)*<\/script>/gi,"")).find(i):e),l&&l.apply(a,arguments)},t.ajax(s),this};var S=encodeURIComponent;t.param=function(e,r){var n=[];return n.add=function(e,r){t.isFunction(r)&&(r=r()),null==r&&(r=""),this.push(S(e)+"="+S(r))},g(n,e,r),n.join("&").replace(/%20/g,"+")}}(r),function(t){t.Callbacks=function(e){e=t.extend({},e);var r,n,i,a,o,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,n=!0,s=a||0,a=0,o=l.length,i=!0;l&&s-1;)l.splice(n,1),i&&(n<=o&&--o,n<=s&&--s)}),this},has:function(e){return!(!l||!(e?t.inArray(e,l)>-1:l.length))},empty:function(){return o=l.length=0,this},disable:function(){return l=u=r=void 0,this},disabled:function(){return!l},lock:function(){return u=void 0,r||f.disable(),this},locked:function(){return!u},fireWith:function(t,e){return!l||n&&!u||(e=e||[],e=[t,e.slice?e.slice():e],i?u.push(e):c(e)),this},fire:function(){return f.fireWith(this,arguments)},fired:function(){return!!n}};return f}}(r),function(t){function e(r){var n=[["resolve","done",t.Callbacks({once:1,memory:1}),"resolved"],["reject","fail",t.Callbacks({once:1,memory:1}),"rejected"],["notify","progress",t.Callbacks({memory:1})]],i="pending",a={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},then:function(){var r=arguments;return e(function(e){t.each(n,function(n,i){var s=t.isFunction(r[n])&&r[n];o[i[1]](function(){var r=s&&s.apply(this,arguments);if(r&&t.isFunction(r.promise))r.promise().done(e.resolve).fail(e.reject).progress(e.notify);else{var n=this===a?e.promise():this,o=s?[r]:arguments;e[i[0]+"With"](n,o)}})}),r=null}).promise()},promise:function(e){return null!=e?t.extend(e,a):a}},o={};return t.each(n,function(t,e){var r=e[2],s=e[3];a[e[1]]=r.add,s&&r.add(function(){i=s},n[1^t][2].disable,n[2][2].lock),o[e[0]]=function(){return o[e[0]+"With"](this===o?a:this,arguments),this},o[e[0]+"With"]=r.fireWith}),a.promise(o),r&&r.call(o,o),o}var r=Array.prototype.slice;t.when=function(n){var i,a,o,s=r.call(arguments),l=s.length,u=0,c=1!==l||n&&t.isFunction(n.promise)?l:0,f=1===c?n:e(),d=function(t,e,n){return function(a){e[t]=this,n[t]=arguments.length>1?r.call(arguments):a,n===i?f.notifyWith(e,n):--c||f.resolveWith(e,n)}};if(l>1)for(i=new Array(l),a=new Array(l),o=new Array(l);u-1)return this},has:function(t,e,r){if(n.qsa(this,r).length)return this}},s=new RegExp("(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*"),l=/^\s*>/,u="Zepto"+ +new Date;n.qsa=function(e,a){return r(a,function(r,o,s){try{var c;!r&&o?r="*":l.test(r)&&(c=t(e).addClass(u),r="."+u+" "+r);var f=i(e,r)}catch(t){throw console.error("error performing selector: %o",a),t}finally{c&&c.removeClass(u)}return o?n.uniq(t.map(f,function(t,e){return o.call(t,e,f,s)})):f})},n.matches=function(t,e){return r(e,function(e,r,n){return(!e||a(t,e))&&(!r||r.call(t,null,n)===t)})}}(r),t.exports=r},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(3),a=n(i),o=r(5),s=n(o),l={getStyleFor:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{baseUrl:""};return(0,a.default)('').html((0,s.default)(t.toString())(e))}};e.default=l,t.exports=e.default},function(t,e,r){"use strict";var n={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},i={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},a={"&":"&","<":"<",">":">",'"':""","'":"'"},o=new RegExp("[&<>\"']","g"),s=function(t){return null===t?"":(""+t).replace(o,function(t){return a[t]})},l=0,u=function(t,e){var r,a=new RegExp([(n.escape||/(.)^/).source,(n.interpolate||/(.)^/).source,(n.evaluate||/(.)^/).source].join("|")+"|$","g"),o=0,u="__p+='";t.replace(a,function(e,r,n,a,s){return u+=t.slice(o,s).replace(/\\|'|\r|\n|\t|\u2028|\u2029/g,function(t){return"\\"+i[t]}),r&&(u+="'+\n((__t=("+r+"))==null?'':escapeExpr(__t))+\n'"),n&&(u+="'+\n((__t=("+n+"))==null?'':__t)+\n'"),a&&(u+="';\n"+a+"\n__p+='"),o=s+e.length,e}),u+="';\n",n.variable||(u="with(obj||{}){\n"+u+"}\n"),u="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+u+"return __p;\n//# sourceURL=/microtemplates/source["+l+++"]";try{r=new Function(n.variable||"obj","escapeExpr",u)}catch(t){throw t.source=u,t}if(e)return r(e,s);var c=function(t){return r.call(this,t,s)};return c.source="function("+(n.variable||"obj")+"){\n"+u+"}",c};u.settings=n,t.exports=u},function(t,e,r){(function(e){function r(t,e){var r=t[1]||"",i=t[3];if(!i)return r;if(e){var a=n(i);return[r].concat(i.sources.map(function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"})).concat([a]).join("\n")}return[r].join("\n")}function n(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+new e(JSON.stringify(t)).toString("base64")+" */"}t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=r(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,r){"string"==typeof t&&(t=[[null,t,""]]);for(var n={},i=0;i0&&void 0!==arguments[0]?arguments[0]:{};n(this,e);var a=i(this,t.call(this,r));return a._options=r,a.uniqueId=(0,s.uniqueId)("o"),a}return a(e,t),o(e,[{key:"options",get:function(){return this._options}}]),e}(u.default);e.default=c,t.exports=e.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r1?e-1:0),n=1;n1)for(var r=1;r-1}function S(t,e){var r=this.__data__,n=Y(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}function R(t){var e=-1,r=t?t.length:0;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=Gt}function Ct(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Dt(t){return!!t&&"object"==typeof t}function It(t){if(!Dt(t)||xe.call(t)!=qt||f(t))return!1;var e=Ue(t);if(null===e)return!0;var r=De.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Ce.call(r)==Ie}function xt(t){return ct(t,Mt(t))}function Nt(t){return Rt(t)?U(t):X(t)}function Mt(t){return Rt(t)?U(t,!0):Z(t)}function Ft(){return[]}function Bt(){return!1}var Ut=200,jt="__lodash_hash_undefined__",Gt=9007199254740991,Yt="[object Arguments]",Vt="[object Boolean]",Kt="[object Date]",$t="[object Function]",zt="[object GeneratorFunction]",Ht="[object Map]",Wt="[object Number]",qt="[object Object]",Xt="[object RegExp]",Zt="[object Set]",Jt="[object String]",Qt="[object Symbol]",te="[object WeakMap]",ee="[object ArrayBuffer]",re="[object DataView]",ne="[object Float32Array]",ie="[object Float64Array]",ae="[object Int8Array]",oe="[object Int16Array]",se="[object Int32Array]",le="[object Uint8Array]",ue="[object Uint8ClampedArray]",ce="[object Uint16Array]",fe="[object Uint32Array]",de=/\w*$/,he=/^\[object .+?Constructor\]$/,pe=/^(?:0|[1-9]\d*)$/,ge={};ge[ne]=ge[ie]=ge[ae]=ge[oe]=ge[se]=ge[le]=ge[ue]=ge[ce]=ge[fe]=!0,ge[Yt]=ge["[object Array]"]=ge[ee]=ge[Vt]=ge[re]=ge[Kt]=ge["[object Error]"]=ge[$t]=ge[Ht]=ge[Wt]=ge[qt]=ge[Xt]=ge[Zt]=ge[Jt]=ge[te]=!1;var ye={};ye[Yt]=ye["[object Array]"]=ye[ee]=ye[re]=ye[Vt]=ye[Kt]=ye[ne]=ye[ie]=ye[ae]=ye[oe]=ye[se]=ye[Ht]=ye[Wt]=ye[qt]=ye[Xt]=ye[Zt]=ye[Jt]=ye[Qt]=ye[le]=ye[ue]=ye[ce]=ye[fe]=!0,ye["[object Error]"]=ye[$t]=ye[te]=!1;var ve="object"==typeof t&&t&&t.Object===Object&&t,me="object"==typeof self&&self&&self.Object===Object&&self,be=ve||me||Function("return this")(),_e="object"==typeof e&&e&&!e.nodeType&&e,Ee=_e&&"object"==typeof r&&r&&!r.nodeType&&r,Te=Ee&&Ee.exports===_e,Ae=Te&&ve.process,we=function(){try{return Ae&&Ae.binding("util")}catch(t){}}(),ke=we&&we.isTypedArray,Se=Array.prototype,Re=Function.prototype,Le=Object.prototype,Oe=be["__core-js_shared__"],Pe=function(){var t=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ce=Re.toString,De=Le.hasOwnProperty,Ie=Ce.call(Object),xe=Le.toString,Ne=RegExp("^"+Ce.call(De).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Me=Te?be.Buffer:void 0,Fe=be.Symbol,Be=be.Uint8Array,Ue=h(Object.getPrototypeOf,Object),je=Object.create,Ge=Le.propertyIsEnumerable,Ye=Se.splice,Ve=Object.getOwnPropertySymbols,Ke=Me?Me.isBuffer:void 0,$e=h(Object.keys,Object),ze=Math.max,He=pt(be,"DataView"),We=pt(be,"Map"),qe=pt(be,"Promise"),Xe=pt(be,"Set"),Ze=pt(be,"WeakMap"),Je=pt(Object,"create"),Qe=wt(He),tr=wt(We),er=wt(qe),rr=wt(Xe),nr=wt(Ze),ir=Fe?Fe.prototype:void 0,ar=ir?ir.valueOf:void 0;g.prototype.clear=y,g.prototype.delete=v,g.prototype.get=m,g.prototype.has=b,g.prototype.set=_,E.prototype.clear=T,E.prototype.delete=A,E.prototype.get=w,E.prototype.has=k,E.prototype.set=S,R.prototype.clear=L,R.prototype.delete=O,R.prototype.get=P,R.prototype.has=C,R.prototype.set=D,I.prototype.clear=x,I.prototype.delete=N,I.prototype.get=M,I.prototype.has=F,I.prototype.set=B;var or=Ve?h(Ve,Object):Ft,sr=H;(He&&sr(new He(new ArrayBuffer(1)))!=re||We&&sr(new We)!=Ht||qe&&"[object Promise]"!=sr(qe.resolve())||Xe&&sr(new Xe)!=Zt||Ze&&sr(new Ze)!=te)&&(sr=function(t){var e=xe.call(t),r=e==qt?t.constructor:void 0,n=r?wt(r):void 0;if(n)switch(n){case Qe:return re;case tr:return Ht;case er:return"[object Promise]";case rr:return Zt;case nr:return te}return e});var lr=Array.isArray,ur=Ke||Bt,cr=ke?function(t){return function(e){return t(e)}}(ke):q,fr=function(t){return tt(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,o&&bt(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n'},function(t,e,r){t.exports=r.p+"a8c874b93b3d848f39a71260c57e3863.cur"},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r=0&&t<=100){var r=e*(t/100);this.seek(r)}},e.prototype.setVolume=function(t){this.volume=parseInt(t,10),this.trigger(u.default.CONTAINER_VOLUME,t,this.name),this.playback.volume(t)},e.prototype.fullscreen=function(){this.trigger(u.default.CONTAINER_FULLSCREEN,this.name)},e.prototype.onBuffering=function(){this.trigger(u.default.CONTAINER_STATE_BUFFERING,this.name)},e.prototype.bufferfull=function(){this.trigger(u.default.CONTAINER_STATE_BUFFERFULL,this.name)},e.prototype.addPlugin=function(t){this.plugins.push(t)},e.prototype.hasPlugin=function(t){return!!this.getPlugin(t)},e.prototype.getPlugin=function(t){return this.plugins.filter(function(e){return e.name===t})[0]},e.prototype.mouseEnter=function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(u.default.CONTAINER_MOUSE_ENTER)},e.prototype.mouseLeave=function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(u.default.CONTAINER_MOUSE_LEAVE)},e.prototype.settingsUpdate=function(){this.settings=this.playback.settings,this.trigger(u.default.CONTAINER_SETTINGSUPDATE)},e.prototype.highDefinitionUpdate=function(t){this.trigger(u.default.CONTAINER_HIGHDEFINITIONUPDATE,t)},e.prototype.isHighDefinitionInUse=function(){return this.playback.isHighDefinitionInUse()},e.prototype.disableMediaControl=function(){this.mediaControlDisabled||(this.mediaControlDisabled=!0,this.trigger(u.default.CONTAINER_MEDIACONTROL_DISABLE))},e.prototype.enableMediaControl=function(){this.mediaControlDisabled&&(this.mediaControlDisabled=!1,this.trigger(u.default.CONTAINER_MEDIACONTROL_ENABLE))},e.prototype.updateStyle=function(){!this.options.chromeless||this.options.allowUserInteraction?this.$el.removeClass("chromeless"):this.$el.addClass("chromeless")},e.prototype.configure=function(t){this._options=v.default.extend(this._options,t),this.updateStyle(),this.trigger(u.default.CONTAINER_OPTIONS_CHANGE)},e.prototype.render=function(){var t=h.default.getStyleFor(g.default);return this.$el.append(t),this.$el.append(this.playback.render().el),this.updateStyle(),this},e}(f.default);e.default=m,t.exports=e.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:400;this.$volumeBarContainer&&(this.draggingVolumeBar?this.hideVolumeId=setTimeout(function(){return t.hideVolumeBar()},e):(this.hideVolumeId&&clearTimeout(this.hideVolumeId),this.hideVolumeId=setTimeout(function(){return t.$volumeBarContainer.addClass("volume-bar-hide")},e)))},e.prototype.ended=function(){this.changeTogglePlay()},e.prototype.updateProgressBar=function(t){var e=t.start/t.total*100,r=t.current/t.total*100;this.$seekBarLoaded.css({left:e+"%",width:r-e+"%"})},e.prototype.onTimeUpdate=function(t){if(!this.draggingSeekBar){var e=t.current<0?t.total:t.current;this.currentPositionValue=e,this.currentDurationValue=t.total,this.renderSeekBar()}},e.prototype.renderSeekBar=function(){if(null!==this.currentPositionValue&&null!==this.currentDurationValue){this.currentSeekBarPercentage=100,(this.container.getPlaybackType()!==w.default.LIVE||this.container.isDvrInUse())&&(this.currentSeekBarPercentage=this.currentPositionValue/this.currentDurationValue*100),this.setSeekPercentage(this.currentSeekBarPercentage);var t=(0,u.formatTime)(this.currentPositionValue),e=(0,u.formatTime)(this.currentDurationValue);t!==this.displayedPosition&&(this.$position.text(t),this.displayedPosition=t),e!==this.displayedDuration&&(this.$duration.text(e),this.displayedDuration=e)}},e.prototype.seek=function(t){if(this.settings.seekEnabled){var e=t.pageX-this.$seekBarContainer.offset().left,r=e/this.$seekBarContainer.width()*100;return r=Math.min(100,Math.max(r,0)),this.container.seekPercentage(r),this.setSeekPercentage(r),!1}},e.prototype.setKeepVisible=function(){this.keepVisible=!0},e.prototype.resetKeepVisible=function(){this.keepVisible=!1},e.prototype.setUserKeepVisible=function(){this.userKeepVisible=!0},e.prototype.resetUserKeepVisible=function(){this.userKeepVisible=!1},e.prototype.isVisible=function(){return!this.$el.hasClass("media-control-hide")},e.prototype.show=function(t){var e=this;if(!this.disabled){(!t||t.clientX!==this.lastMouseX&&t.clientY!==this.lastMouseY||navigator.userAgent.match(/firefox/i))&&(clearTimeout(this.hideId),this.$el.show(),this.trigger(d.default.MEDIACONTROL_SHOW,this.name),this.$el.removeClass("media-control-hide"),this.hideId=setTimeout(function(){return e.hide()},2e3),t&&(this.lastMouseX=t.clientX,this.lastMouseY=t.clientY))}},e.prototype.hide=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.isVisible()&&(!m.default.isMobile||this.container.isPlaying())){var r=e||2e3;clearTimeout(this.hideId),(this.disabled||!1!==this.options.hideMediaControl)&&(!this.disabled&&(e||this.userKeepVisible||this.keepVisible||this.draggingSeekBar||this.draggingVolumeBar)?this.hideId=setTimeout(function(){return t.hide()},r):(this.trigger(d.default.MEDIACONTROL_HIDE,this.name),this.$el.addClass("media-control-hide"),this.hideVolumeBar(0)))}},e.prototype.settingsUpdate=function(){var t=this.getSettings();!t||this.fullScreenOnVideoTagSupported||u.Fullscreen.fullscreenEnabled()||(t.default&&(0,u.removeArrayItem)(t.default,"fullscreen"),t.left&&(0,u.removeArrayItem)(t.left,"fullscreen"),t.right&&(0,u.removeArrayItem)(t.right,"fullscreen")),JSON.stringify(this.settings)!==JSON.stringify(t)&&(this.settings=t,this.render())},e.prototype.getSettings=function(){return(0,L.default)({},this.container.settings)},e.prototype.highDefinitionUpdate=function(t){var e=t?"addClass":"removeClass";this.$hdIndicator[e]("enabled")},e.prototype.createCachedElements=function(){var t=this.$el.find(".media-control-layer");this.$duration=t.find(".media-control-indicator[data-duration]"),this.$fullscreenToggle=t.find("button.media-control-button[data-fullscreen]"),this.$playPauseToggle=t.find("button.media-control-button[data-playpause]"),this.$playStopToggle=t.find("button.media-control-button[data-playstop]"),this.$position=t.find(".media-control-indicator[data-position]"),this.$seekBarContainer=t.find(".bar-container[data-seekbar]"),this.$seekBarHover=t.find(".bar-hover[data-seekbar]"),this.$seekBarLoaded=t.find(".bar-fill-1[data-seekbar]"),this.$seekBarPosition=t.find(".bar-fill-2[data-seekbar]"),this.$seekBarScrubber=t.find(".bar-scrubber[data-seekbar]"),this.$volumeBarContainer=t.find(".bar-container[data-volume]"),this.$volumeContainer=t.find(".drawer-container[data-volume]"),this.$volumeIcon=t.find(".drawer-icon[data-volume]"),this.$volumeBarBackground=this.$el.find(".bar-background[data-volume]"),this.$volumeBarFill=this.$el.find(".bar-fill-1[data-volume]"),this.$volumeBarScrubber=this.$el.find(".bar-scrubber[data-volume]"),this.$hdIndicator=this.$el.find("button.media-control-button[data-hd-indicator]"),this.resetIndicators(),this.initializeIcons()},e.prototype.resetIndicators=function(){this.displayedPosition=this.$position.text(),this.displayedDuration=this.$duration.text()},e.prototype.initializeIcons=function(){var t=this.$el.find(".media-control-layer");t.find("button.media-control-button[data-play]").append(x.default),t.find("button.media-control-button[data-pause]").append(M.default),t.find("button.media-control-button[data-stop]").append(B.default),this.$playPauseToggle.append(x.default),this.$playStopToggle.append(x.default),this.$volumeIcon.append(j.default),this.$fullscreenToggle.append(K.default),this.$hdIndicator.append(W.default)},e.prototype.setSeekPercentage=function(t){t=Math.max(Math.min(t,100),0),this.displayedSeekBarPercentage!==t&&(this.displayedSeekBarPercentage=t,this.$seekBarPosition.removeClass("media-control-notransition"),this.$seekBarScrubber.removeClass("media-control-notransition"),this.$seekBarPosition.css({width:t+"%"}),this.$seekBarScrubber.css({left:t+"%"}))},e.prototype.seekRelative=function(t){if(this.settings.seekEnabled){var e=this.container.getCurrentTime(),r=this.container.getDuration(),n=Math.min(Math.max(e+t,0),r);n=Math.min(100*n/r,100),this.container.seekPercentage(n)}},e.prototype.bindKeyAndShow=function(t,e){var r=this;this.kibo.down(t,function(){return r.show(),e()})},e.prototype.bindKeyEvents=function(){var t=this;this.unbindKeyEvents(),this.kibo=new c.Kibo(this.options.focusElement),this.bindKeyAndShow("space",function(){return t.togglePlayPause()}),this.bindKeyAndShow("left",function(){return t.seekRelative(-5)}),this.bindKeyAndShow("right",function(){return t.seekRelative(5)}),this.bindKeyAndShow("shift left",function(){return t.seekRelative(-10)}),this.bindKeyAndShow("shift right",function(){return t.seekRelative(10)}),this.bindKeyAndShow("shift ctrl left",function(){return t.seekRelative(-15)}),this.bindKeyAndShow("shift ctrl right",function(){return t.seekRelative(15)}),["1","2","3","4","5","6","7","8","9","0"].forEach(function(e){t.bindKeyAndShow(e,function(){return t.settings.seekEnabled&&t.container.seekPercentage(10*e)})})},e.prototype.unbindKeyEvents=function(){this.kibo&&(this.kibo.off("space"),this.kibo.off("left"),this.kibo.off("right"),this.kibo.off("shift left"),this.kibo.off("shift right"),this.kibo.off("shift ctrl left"),this.kibo.off("shift ctrl right"),this.kibo.off(["1","2","3","4","5","6","7","8","9","0"]))},e.prototype.parseColors=function(){if(this.options.mediacontrol){this.buttonsColor=this.options.mediacontrol.buttons;var t=this.options.mediacontrol.seekbar;this.$el.find(".bar-fill-2[data-seekbar]").css("background-color",t),this.$el.find(".media-control-icon svg path").css("fill",this.buttonsColor),this.$el.find(".segmented-bar-element[data-volume]").css("boxShadow","inset 2px 0 0 "+this.buttonsColor)}},e.prototype.applyButtonStyle=function(t){this.buttonsColor&&t&&(0,S.default)(t).find("svg path").css("fill",this.buttonsColor)},e.prototype.destroy=function(){this.remove(),(0,S.default)(document).unbind("mouseup",this.stopDragHandler),(0,S.default)(document).unbind("mousemove",this.updateDragHandler),this.unbindKeyEvents()},e.prototype.render=function(){var t=this;this.$el.html(this.template({settings:this.settings})),this.$el.append(this.stylesheet),this.createCachedElements(),this.$playPauseToggle.addClass("paused"),this.$playStopToggle.addClass("stopped"),this.changeTogglePlay(),this.hideId=setTimeout(function(){return t.hide()},1e3),this.disabled&&this.hide(),m.default.isSafari&&m.default.isMobile&&this.$volumeContainer.css("display","none"),this.$seekBarPosition.addClass("media-control-notransition"),this.$seekBarScrubber.addClass("media-control-notransition");var e=0;return this.displayedSeekBarPercentage&&(e=this.displayedSeekBarPercentage),this.displayedSeekBarPercentage=null,this.setSeekPercentage(e),n.nextTick(function(){t.settings.seekEnabled||t.$seekBarContainer.addClass("seek-disabled"),m.default.isMobile||t.options.disableKeyboardShortcuts||t.bindKeyEvents(),t.playerResize({width:t.options.width,height:t.options.height}),t.hideVolumeBar(0)}),this.parseColors(),this.highDefinitionUpdate(),this.rendered=!0,this.updateVolumeUI(),this.trigger(d.default.MEDIACONTROL_RENDERED),this},e}(y.default);e.default=q,q.extend=function(t){return(0,u.extend)(q,t)},t.exports=e.default}).call(e,r(21))},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(38),a=n(i),o=r(1),s=n(o),l=r(0),u=n(l),c=r(2),f=n(c),d=r(13),h=n(d),p=r(11),g=n(p),y=r(17),v=n(y),m=r(14),b=n(m),_=r(8),E=n(_),T=r(9),A=n(T),w=r(7),k=n(w),S=r(24),R=n(S),L=r(25),O=n(L),P=r(26),C=n(P),D=r(10),I=n(D),x=r(27),N=n(x),M=r(15),F=n(M),B=r(18),U=n(B),j=r(28),G=n(j),Y=r(29),V=n(Y),K=r(30),$=n(K),z=r(31),H=n(z),W=r(16),q=n(W),X=r(32),Z=n(X),J=r(33),Q=n(J),tt=r(34),et=n(tt),rt=r(19),nt=n(rt),it=r(4),at=n(it),ot=r(20),st=n(ot),lt=r(5),ut=n(lt),ct=r(3),ft=n(ct);e.default={Player:a.default,Mediator:I.default,Events:u.default,Browser:k.default,PlayerInfo:F.default,MediaControl:N.default,ContainerPlugin:h.default,UIContainerPlugin:b.default,CorePlugin:g.default,UICorePlugin:v.default,Playback:f.default,Container:R.default,Core:O.default,Loader:C.default,BaseObject:E.default,UIObject:A.default,Utils:s.default,BaseFlashPlayback:U.default,Flash:G.default,FlasHLS:V.default,HLS:$.default,HTML5Audio:H.default,HTML5Video:q.default,HTMLImg:Z.default,NoOp:Q.default,Poster:et.default,Log:nt.default,Styler:at.default,Vendor:st.default,version:"0.2.66",template:ut.default,$:ft.default},t.exports=e.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r').insertAfter(this.$el),this.getDuration()>0?this._metadataLoaded():p.default.once(this.uniqueId+":timeupdate",this._metadataLoaded,this)):(this._attempts=this._attempts||0,++this._attempts<=60?setTimeout(function(){return t._bootstrap()},50):this.trigger(_.default.PLAYBACK_ERROR,{message:"Max number of attempts reached"},this.name))},e.prototype._metadataLoaded=function(){this._isReadyState=!0,this.trigger(_.default.PLAYBACK_READY,this.name),this.trigger(_.default.PLAYBACK_SETTINGSUPDATE,this.name)},e.prototype.getPlaybackType=function(){return T.default.VOD},e.prototype.isHighDefinitionInUse=function(){return!1},e.prototype._updateTime=function(){this.trigger(_.default.PLAYBACK_TIMEUPDATE,{current:this.el.getPosition(),total:this.el.getDuration()},this.name)},e.prototype._addListeners=function(){p.default.on(this.uniqueId+":progress",this._progress,this),p.default.on(this.uniqueId+":timeupdate",this._updateTime,this),p.default.on(this.uniqueId+":statechanged",this._checkState,this),p.default.on(this.uniqueId+":flashready",this._bootstrap,this)},e.prototype.stopListening=function(){t.prototype.stopListening.call(this),p.default.off(this.uniqueId+":progress"),p.default.off(this.uniqueId+":timeupdate"),p.default.off(this.uniqueId+":statechanged"),p.default.off(this.uniqueId+":flashready")},e.prototype._checkState=function(){this._isIdle||"PAUSED"===this._currentState||("PLAYING_BUFFERING"!==this._currentState&&"PLAYING_BUFFERING"===this.el.getState()?(this._bufferingState=!0,this.trigger(_.default.PLAYBACK_BUFFERING,this.name),this._currentState="PLAYING_BUFFERING"):"PLAYING"===this.el.getState()?(this._bufferingState=!1,this.trigger(_.default.PLAYBACK_BUFFERFULL,this.name),this._currentState="PLAYING"):"IDLE"===this.el.getState()?this._currentState="IDLE":"ENDED"===this.el.getState()&&(this.trigger(_.default.PLAYBACK_ENDED,this.name),this.trigger(_.default.PLAYBACK_TIMEUPDATE,{current:0,total:this.el.getDuration()},this.name),this._currentState="ENDED",this._isIdle=!0))},e.prototype._progress=function(){"IDLE"!==this._currentState&&"ENDED"!==this._currentState&&this.trigger(_.default.PLAYBACK_PROGRESS,{start:0,current:this.el.getBytesLoaded(),total:this.el.getBytesTotal()})},e.prototype._firstPlay=function(){var t=this;this.el.playerPlay?(this._isIdle=!1,this.el.playerPlay(this._src),this.listenToOnce(this,_.default.PLAYBACK_BUFFERFULL,function(){return t._checkInitialSeek()}),this._currentState="PLAYING"):this.listenToOnce(this,_.default.PLAYBACK_READY,this._firstPlay)},e.prototype._checkInitialSeek=function(){var t=(0,l.seekStringToSeconds)(window.location.href);0!==t&&this.seekSeconds(t)},e.prototype.play=function(){this.trigger(_.default.PLAYBACK_PLAY_INTENT),"PAUSED"===this._currentState||"PLAYING_BUFFERING"===this._currentState?(this._currentState="PLAYING",this.el.playerResume(),this.trigger(_.default.PLAYBACK_PLAY,this.name)):"PLAYING"!==this._currentState&&(this._firstPlay(),this.trigger(_.default.PLAYBACK_PLAY,this.name))},e.prototype.volume=function(t){var e=this;this.isReady?this.el.playerVolume(t):this.listenToOnce(this,_.default.PLAYBACK_BUFFERFULL,function(){return e.volume(t)})},e.prototype.pause=function(){this._currentState="PAUSED",this.el.playerPause(),this.trigger(_.default.PLAYBACK_PAUSE,this.name)},e.prototype.stop=function(){this.el.playerStop(),this.trigger(_.default.PLAYBACK_STOP),this.trigger(_.default.PLAYBACK_TIMEUPDATE,{current:0,total:0},this.name)},e.prototype.isPlaying=function(){return!!(this.isReady&&this._currentState.indexOf("PLAYING")>-1)},e.prototype.getDuration=function(){return this.el.getDuration()},e.prototype.seekPercentage=function(t){var e=this;if(this.el.getDuration()>0){var r=this.el.getDuration()*(t/100);this.seek(r)}else this.listenToOnce(this,_.default.PLAYBACK_BUFFERFULL,function(){return e.seekPercentage(t)})},e.prototype.seek=function(t){var e=this;this.isReady&&this.el.playerSeek?(this.el.playerSeek(t),this.trigger(_.default.PLAYBACK_TIMEUPDATE,{current:t,total:this.el.getDuration()},this.name),"PAUSED"===this._currentState&&this.el.playerPause()):this.listenToOnce(this,_.default.PLAYBACK_BUFFERFULL,function(){return e.seek(t)})},e.prototype.destroy=function(){clearInterval(this.bootstrapId),t.prototype.stopListening.call(this),this.$el.remove()},s(e,[{key:"isReady",get:function(){return this._isReadyState}}]),e}(c.default);e.default=k,k.canPlay=function(t){if(d.default.hasFlash&&t&&t.constructor===String){var e=t.split("?")[0].match(/.*\.(.*)$/)||[];return e.length>1&&!d.default.isMobile&&e[1].toLowerCase().match(/^(mp4|mov|f4v|3gpp|3gp)$/)}return!1},t.exports=e.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r=720||e.bitrate/1e3>=2e3,this.trigger(f.default.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinition),this._levels&&0!==this._levels.length||this._fillLevels(),this.trigger(f.default.PLAYBACK_BITRATE,{height:e.height,width:e.width,bandwidth:e.bitrate,bitrate:e.bitrate,level:t}),this.trigger(f.default.PLAYBACK_LEVEL_SWITCH_END))},e.prototype._updateTime=function(t){if("IDLE"!==this._currentState){var e=this._normalizeDuration(t.duration),r=Math.min(Math.max(t.position,0),e),n=this._dvrEnabled,i=this._playbackType===g.default.LIVE;this._dvrEnabled=i&&e>this._hlsMinimumDvrSize,100!==e&&void 0!==i&&(this._dvrEnabled!==n&&(this._updateSettings(),this.trigger(f.default.PLAYBACK_SETTINGSUPDATE,this.name)),!i||this._dvrEnabled&&this._dvrInUse||(r=e),this.trigger(f.default.PLAYBACK_TIMEUPDATE,{current:r,total:e},this.name))}},e.prototype.play=function(){this.trigger(f.default.PLAYBACK_PLAY_INTENT),"PAUSED"===this._currentState?this.el.playerResume():this._srcLoaded||"PLAYING"===this._currentState?this.el.playerPlay():this._firstPlay()},e.prototype.getPlaybackType=function(){return this._playbackType?this._playbackType:null},e.prototype.getCurrentLevelIndex=function(){return this._currentLevel},e.prototype.getCurrentLevel=function(){return this.levels[this.currentLevel]},e.prototype.getCurrentBitrate=function(){return this.levels[this.currentLevel].bitrate},e.prototype.setCurrentLevel=function(t){this.currentLevel=t},e.prototype.isHighDefinitionInUse=function(){return this.highDefinition},e.prototype.getLevels=function(){return this.levels},e.prototype._setPlaybackState=function(t){["PLAYING_BUFFERING","PAUSED_BUFFERING"].indexOf(t)>=0?(this._bufferingState=!0,this.trigger(f.default.PLAYBACK_BUFFERING,this.name),this._updateCurrentState(t)):["PLAYING","PAUSED"].indexOf(t)>=0?(["PLAYING_BUFFERING","PAUSED_BUFFERING","IDLE"].indexOf(this._currentState)>=0&&(this._bufferingState=!1,this.trigger(f.default.PLAYBACK_BUFFERFULL,this.name)),this._updateCurrentState(t)):"IDLE"===t&&(this._srcLoaded=!1,this._loop&&["PLAYING_BUFFERING","PLAYING"].indexOf(this._currentState)>=0?(this.play(),this.seek(0)):(this._updateCurrentState(t),this._hasEnded=!0,this.trigger(f.default.PLAYBACK_TIMEUPDATE,{current:0,total:this.getDuration()},this.name),this.trigger(f.default.PLAYBACK_ENDED,this.name)))},e.prototype._updateCurrentState=function(t){this._currentState=t,"IDLE"!==t&&(this._hasEnded=!1),this._updatePlaybackType(),"PLAYING"===t?this.trigger(f.default.PLAYBACK_PLAY,this.name):"PAUSED"===t&&this.trigger(f.default.PLAYBACK_PAUSE,this.name)},e.prototype._updatePlaybackType=function(){this._playbackType=this.el.getType(),this._playbackType&&(this._playbackType=this._playbackType.toLowerCase(),this._playbackType===g.default.VOD?this._startReportingProgress():this._stopReportingProgress()),this.trigger(f.default.PLAYBACK_PLAYBACKSTATE,{type:this._playbackType})},e.prototype._startReportingProgress=function(){this._reportingProgress||(this._reportingProgress=!0)},e.prototype._stopReportingProgress=function(){this._reportingProgress=!1},e.prototype._onFragmentLoaded=function(t){if(this.trigger(f.default.PLAYBACK_FRAGMENT_LOADED,t),this._reportingProgress&&this.el.getPosition){var e=this.el.getPosition()+this.el.getbufferLength();this.trigger(f.default.PLAYBACK_PROGRESS,{start:this.el.getPosition(),current:e,total:this.el.getDuration()})}},e.prototype._onLevelEndlist=function(){this._updatePlaybackType()},e.prototype._firstPlay=function(){var t=this;this._shouldPlayOnManifestLoaded=!0,this.el.playerLoad&&(v.default.once(this.cid+":manifestloaded",function(e,r){return t._manifestLoaded(e,r)}),this._setFlashSettings(),this.el.playerLoad(this._src),this._srcLoaded=!0)},e.prototype.volume=function(t){var e=this;this.isReady?this.el.playerVolume(t):this.listenToOnce(this,f.default.PLAYBACK_BUFFERFULL,function(){return e.volume(t)})},e.prototype.pause=function(){(this._playbackType!==g.default.LIVE||this._dvrEnabled)&&(this.el.playerPause(),this._playbackType===g.default.LIVE&&this._dvrEnabled&&this._updateDvr(!0))},e.prototype.stop=function(){this._srcLoaded=!1,this.el.playerStop(),this.trigger(f.default.PLAYBACK_STOP),this.trigger(f.default.PLAYBACK_TIMEUPDATE,{current:0,total:0},this.name)},e.prototype.isPlaying=function(){return!!this._currentState&&!!this._currentState.match(/playing/i)},e.prototype.getDuration=function(){return this._normalizeDuration(this.el.getDuration())},e.prototype._normalizeDuration=function(t){return this._playbackType===g.default.LIVE&&(t=Math.max(0,t-10)),t},e.prototype.seekPercentage=function(t){var e=this.el.getDuration(),r=0;t>0&&(r=e*t/100),this.seek(r)},e.prototype.seek=function(t){var e=this.getDuration();if(this._playbackType===g.default.LIVE){var r=e-t>3;this._updateDvr(r)}this.el.playerSeek(t),this.trigger(f.default.PLAYBACK_TIMEUPDATE,{current:t,total:e},this.name)},e.prototype._updateDvr=function(t){var e=!!this._dvrInUse;this._dvrInUse=t,this._dvrInUse!==e&&(this._updateSettings(),this.trigger(f.default.PLAYBACK_DVR,this._dvrInUse),this.trigger(f.default.PLAYBACK_STATS_ADD,{dvr:this._dvrInUse}))},e.prototype._flashPlaybackError=function(t,e,r){this.trigger(f.default.PLAYBACK_ERROR,{code:t,url:e,message:r}),this.trigger(f.default.PLAYBACK_STOP)},e.prototype._manifestLoaded=function(t,e){this._shouldPlayOnManifestLoaded&&(this._shouldPlayOnManifestLoaded=!1,this.el.playerPlay()),this._fillLevels(),this.trigger(f.default.PLAYBACK_LOADEDMETADATA,{duration:t,data:e})},e.prototype._fillLevels=function(){var t=this.el.getLevels(),e=t.length;this._levels=[];for(var r=0;r1&&"m3u8"===r[1].toLowerCase()||"application/x-mpegURL"===e||"application/vnd.apple.mpegurl"===e)},t.exports=e.default},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=r(10),a=function(t){return t&&t.__esModule?t:{default:t}}(i),o=function(){function t(e){n(this,t),this.instanceId=e}return t.prototype.ready=function(){a.default.trigger(this.instanceId+":flashready")},t.prototype.videoSize=function(t,e){a.default.trigger(this.instanceId+":videosizechanged",t,e)},t.prototype.complete=function(){a.default.trigger(this.instanceId+":complete")},t.prototype.error=function(t,e,r){a.default.trigger(this.instanceId+":error",t,e,r)},t.prototype.manifest=function(t,e){a.default.trigger(this.instanceId+":manifestloaded",t,e)},t.prototype.audioLevelLoaded=function(t){a.default.trigger(this.instanceId+":audiolevelloaded",t)},t.prototype.levelLoaded=function(t){a.default.trigger(this.instanceId+":levelloaded",t)},t.prototype.levelEndlist=function(t){a.default.trigger(this.instanceId+":levelendlist",t)},t.prototype.fragmentLoaded=function(t){a.default.trigger(this.instanceId+":fragmentloaded",t)},t.prototype.fragmentPlaying=function(t){a.default.trigger(this.instanceId+":fragmentplaying",t)},t.prototype.position=function(t){a.default.trigger(this.instanceId+":timeupdate",t)},t.prototype.state=function(t){a.default.trigger(this.instanceId+":playbackstate",t)},t.prototype.seekState=function(t){a.default.trigger(this.instanceId+":seekstate",t)},t.prototype.switch=function(t){a.default.trigger(this.instanceId+":levelchanged",t)},t.prototype.audioTracksListChange=function(t){a.default.trigger(this.instanceId+":audiotracklistchanged",t)},t.prototype.audioTrackChange=function(t){a.default.trigger(this.instanceId+":audiotrackchanged",t)},t}();e.default=o,t.exports=e.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e0&&(e=this._duration*(t/100)),this.seek(e)},e.prototype.seek=function(e){e<0&&(T.default.warn("Attempt to seek to a negative time. Resetting to live point. Use seekToLivePoint() to seek to the live point."),e=this.getDuration()),this.dvrEnabled&&this._updateDvr(e0)switch(this._recoverAttemptsRemaining-=1,e.type){case d.default.ErrorTypes.NETWORK_ERROR:T.default.warn("hlsjs: trying to recover from network error, evt "+t+", data "+e+" "),this._hls.startLoad();break;case d.default.ErrorTypes.MEDIA_ERROR:T.default.warn("hlsjs: trying to recover from media error, evt "+t+", data "+e+" "),this._recover(t,e);break;default:T.default.error("hlsjs: trying to recover from error, evt "+t+", data "+e+" "),this.trigger(y.default.PLAYBACK_ERROR,"hlsjs: could not recover from error, evt "+t+", data "+e+" ",this.name)}else T.default.error("hlsjs: could not recover from error after maximum number of attempts, evt "+t+", data "+e+" "),this.trigger(y.default.PLAYBACK_ERROR,{evt:t,data:e},this.name);else T.default.warn("hlsjs: non-fatal error occurred, evt "+t+", data "+e+" ")},e.prototype._onTimeUpdate=function(){var t={current:this.getCurrentTime(),total:this.getDuration()};(0,p.default)(t,this._lastTimeUpdate)||(this._lastTimeUpdate=t,this.trigger(y.default.PLAYBACK_TIMEUPDATE,t,this.name))},e.prototype._onDurationChange=function(){var e=this.getDuration();this._lastDuration!==e&&(this._lastDuration=e,t.prototype._onDurationChange.call(this))},e.prototype._onProgress=function(){if(this.el.buffered.length){for(var t=[],e=0,r=0;r=t[r].start&&this.el.currentTime<=t[r].end&&(e=r);var n={start:t[e].start,current:t[e].end,total:this.getDuration()};this.trigger(y.default.PLAYBACK_PROGRESS,n,t)}},e.prototype.play=function(){this._hls||this._setupHls(),t.prototype.play.call(this)},e.prototype.pause=function(){this._hls&&(t.prototype.pause.call(this),this.dvrEnabled&&this._updateDvr(!0))},e.prototype.stop=function(){this._hls&&(t.prototype.stop.call(this),this._hls.destroy(),delete this._hls)},e.prototype.destroy=function(){this._stopTimeUpdateTimer(),this._hls&&(this._hls.destroy(),delete this._hls),t.prototype.destroy.call(this)},e.prototype._updatePlaybackType=function(t,e){this._playbackType=e.details.live?m.default.LIVE:m.default.VOD,this._fillLevels(),this._onLevelUpdated(t,e)},e.prototype._fillLevels=function(){this._levels=this._hls.levels.map(function(t,e){return{id:e,level:t,label:t.bitrate/1e3+"Kbps"}}),this.trigger(y.default.PLAYBACK_LEVELS_AVAILABLE,this._levels)},e.prototype._onLevelUpdated=function(t,e){this._segmentTargetDuration=e.details.targetduration,this._playlistType=e.details.type||null;var r=!1,n=!1,i=e.details.fragments,a=this._playableRegionStartTime,o=this._playableRegionDuration;if(0!==i.length){if(this._playableRegionStartTime!==i[0].start&&(r=!0,this._playableRegionStartTime=i[0].start),r)if(this._localStartTimeCorrelation){var s=this._localStartTimeCorrelation,l=this._now-s.local,u=(s.remote+l)/1e3;ua+this._extrapolatedWindowDuration&&(this._localStartTimeCorrelation={local:this._now,remote:1e3*Math.max(i[0].start,a+this._extrapolatedWindowDuration)})}else this._localStartTimeCorrelation={local:this._now,remote:1e3*(i[0].start+this._extrapolatedWindowDuration/2)};var c=e.details.totalduration;if(this._playbackType===m.default.LIVE){var f=e.details.targetduration,h=this.options.playback||{},p=h.liveSyncDurationCount||d.default.DefaultConfig.liveSyncDurationCount,g=f*p;g<=c?(c-=g,this._durationExcludesAfterLiveSyncPoint=!0):this._durationExcludesAfterLiveSyncPoint=!1}c!==this._playableRegionDuration&&(n=!0,this._playableRegionDuration=c);var y=i[0].start+c,v=a+o;if(y!==v)if(this._localEndTimeCorrelation){var b=this._localEndTimeCorrelation,_=this._now-b.local,E=(b.remote+_)/1e3;E>y?this._localEndTimeCorrelation={local:this._now,remote:1e3*y}:Ev&&(this._localEndTimeCorrelation={local:this._now,remote:1e3*v})}else this._localEndTimeCorrelation={local:this._now,remote:1e3*y};n&&this._onDurationChange(),r&&this._onProgress()}},e.prototype._onFragmentLoaded=function(t,e){this.trigger(y.default.PLAYBACK_FRAGMENT_LOADED,e)},e.prototype._onLevelSwitch=function(t,e){this.levels.length||this._fillLevels(),this.trigger(y.default.PLAYBACK_LEVEL_SWITCH_END),this.trigger(y.default.PLAYBACK_LEVEL_SWITCH,e);var r=this._hls.levels[e.level];r&&(this.highDefinition=r.height>=720||r.bitrate/1e3>=2e3,this.trigger(y.default.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinition),this.trigger(y.default.PLAYBACK_BITRATE,{height:r.height,width:r.width,bandwidth:r.bitrate,bitrate:r.bitrate,level:e.level}))},e.prototype.getPlaybackType=function(){return this._playbackType},e.prototype.isSeekEnabled=function(){return this._playbackType===m.default.VOD||this.dvrEnabled},l(e,[{key:"dvrEnabled",get:function(){return this._durationExcludesAfterLiveSyncPoint&&this._duration>=this._minDvrSize&&this.getPlaybackType()===m.default.LIVE}}]),e}(c.default);e.default=A,A.canPlay=function(t,e){var r=t.split("?")[0].match(/.*\.(.*)$/)||[],n=r.length>1&&"m3u8"===r[1].toLowerCase()||"application/x-mpegURL"===e||"application/vnd.apple.mpegurl"===e;return!(!d.default.isSupported()||!n)},t.exports=e.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r=0}},{key:"attributes",get:function(){return{"data-html5-video":""}}},{key:"events",get:function(){return{canplay:"_onCanPlay",canplaythrough:"_handleBufferingEvents",durationchange:"_onDurationChange",ended:"_onEnded",error:"_onError",loadeddata:"_onLoadedData",loadedmetadata:"_onLoadedMetadata",pause:"_onPause",playing:"_onPlaying",progress:"_onProgress",seeked:"_handleBufferingEvents",seeking:"_handleBufferingEvents",stalled:"_handleBufferingEvents",timeupdate:"_onTimeUpdate",waiting:"_onWaiting"}}},{key:"ended",get:function(){return this.el.ended}},{key:"buffering",get:function(){return!!this._bufferingState}}]),e.prototype._setupSrc=function(t){this.el.src!==t&&(this._src=t,this.el.src=t)},e.prototype._onLoadedMetadata=function(t){this._handleBufferingEvents(),this.trigger(m.default.PLAYBACK_LOADEDMETADATA,{duration:t.target.duration,data:t}),this._updateSettings();var e=void 0===this._options.autoSeekFromUrl||this._options.autoSeekFromUrl;this.getPlaybackType()!==d.default.LIVE&&e&&this._checkInitialSeek()},e.prototype._onDurationChange=function(){this._updateSettings(),this._onTimeUpdate(),this._onProgress()},e.prototype._updateSettings=function(){this.getPlaybackType()===d.default.VOD||this.getPlaybackType()===d.default.AOD?this.settings.left=["playpause","position","duration"]:this.settings.left=["playstop"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(m.default.PLAYBACK_SETTINGSUPDATE)},e.prototype.isSeekEnabled=function(){return isFinite(this.getDuration())},e.prototype.getPlaybackType=function(){var t="audio"===this.tagName?d.default.AOD:d.default.VOD;return[0,void 0,1/0].indexOf(this.el.duration)>=0?d.default.LIVE:t},e.prototype.isHighDefinitionInUse=function(){return!1},e.prototype.consent=function(){!this.isPlaying()&&this.el.load()},e.prototype.play=function(){this.trigger(m.default.PLAYBACK_PLAY_INTENT),this._stopped=!1,this._setupSrc(this._src),this._handleBufferingEvents(),this.el.play()},e.prototype.pause=function(){this.el.pause()},e.prototype.stop=function(){this.pause(),this._stopped=!0,this.el.removeAttribute("src"),this._stopPlayheadMovingChecks(),this._handleBufferingEvents(),this.trigger(m.default.PLAYBACK_STOP)},e.prototype.volume=function(t){this.el.volume=t/100},e.prototype.mute=function(){this.el.volume=0},e.prototype.unmute=function(){this.el.volume=1},e.prototype.isMuted=function(){return!!this.el.volume},e.prototype.isPlaying=function(){return!this.el.paused&&!this.el.ended},e.prototype._startPlayheadMovingChecks=function(){null===this._playheadMovingTimer&&(this._playheadMovingTimeOnCheck=null,this._determineIfPlayheadMoving(),this._playheadMovingTimer=setInterval(this._determineIfPlayheadMoving.bind(this),500))},e.prototype._stopPlayheadMovingChecks=function(){null!==this._playheadMovingTimer&&(clearInterval(this._playheadMovingTimer),this._playheadMovingTimer=null,this._playheadMoving=!1)},e.prototype._determineIfPlayheadMoving=function(){var t=this._playheadMovingTimeOnCheck,e=this.el.currentTime;this._playheadMoving=t!==e,this._playheadMovingTimeOnCheck=e,this._handleBufferingEvents()},e.prototype._onWaiting=function(){this._loadStarted=!0,this._handleBufferingEvents()},e.prototype._onLoadedData=function(){this._loadStarted=!0,this._handleBufferingEvents()},e.prototype._onCanPlay=function(){this._handleBufferingEvents()},e.prototype._onPlaying=function(){this._startPlayheadMovingChecks(),this._handleBufferingEvents(),this.trigger(m.default.PLAYBACK_PLAY)},e.prototype._onPause=function(){this._stopPlayheadMovingChecks(),this._handleBufferingEvents(),this.trigger(m.default.PLAYBACK_PAUSE)},e.prototype._onEnded=function(){this._handleBufferingEvents(),this.trigger(m.default.PLAYBACK_ENDED,this.name)},e.prototype._handleBufferingEvents=function(){var t=!this.el.ended&&!this.el.paused,e=this._loadStarted&&!this.el.ended&&!this._stopped&&(t&&!this._playheadMoving||this.el.readyState=t[r].start&&this.el.currentTime<=t[r].end&&(e=r);var n={start:t[e].start,current:t[e].end,total:this.el.duration};this.trigger(m.default.PLAYBACK_PROGRESS,n,t)}},e.prototype._typeFor=function(t){var r=e._mimeTypesForUrl(t,A,this.options.mimeType);return 0==r.length&&(r=e._mimeTypesForUrl(t,w,this.options.mimeType)),(r[0]||"").split(";")[0]},e.prototype._ready=function(){this._isReadyState||(this._isReadyState=!0,this.trigger(m.default.PLAYBACK_READY,this.name))},e.prototype.render=function(){var t=p.default.getStyleFor(_.default);return this.options.playback.disableContextMenu&&this.$el.on("contextmenu",function(){return!1}),this.$el.append(t),this._ready(),this},u(e,[{key:"isReady",get:function(){return this._isReadyState}}]),e}(d.default);e.default=S,S._mimeTypesForUrl=function(t,e,r){var n=(t.split("?")[0].match(/.*\.(.*)$/)||[])[1],i=r||n&&e[n.toLowerCase()]||[];return i.constructor===Array?i:[i]},S._canPlay=function(t,e,r,n){var i=S._mimeTypesForUrl(r,e,n),a=document.createElement(t);return!!i.filter(function(t){return!!a.canPlayType(t).replace(/no/,"")})[0]},S.canPlay=function(t,e){return S._canPlay("audio",w,t,e)||S._canPlay("video",A,t,e)},t.exports=S,t.exports=e.default}).call(e,r(21))},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r");e[0].width=16,e[0].height=16;var r=e[0].getContext("2d");r.fillStyle="#000";var n=(0,h.default)(t).find("path").attr("d"),i=new Path2D(n);r.fill(i);var a=(0,h.default)('');return a.attr("href",e[0].toDataURL("image/png")),a},e.prototype.setPlayIcon=function(){this.playIcon||(this.playIcon=this.createIcon(g.default)),this.changeIcon(this.playIcon)},e.prototype.setPauseIcon=function(){this.pauseIcon||(this.pauseIcon=this.createIcon(v.default)),this.changeIcon(this.pauseIcon)},e.prototype.resetIcon=function(){(0,h.default)('link[rel="shortcut icon"]').remove(),(0,h.default)("head").append(this.oldIcon)},e.prototype.changeIcon=function(t){t&&((0,h.default)('link[rel="shortcut icon"]').remove(),(0,h.default)("head").append(t))},e}(u.default);e.default=b,t.exports=e.default},function(t,e,r){"use strict";t.exports=r(62)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:l,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;n(this,t),this.kibo=new i.Kibo,this.kibo.down(["ctrl shift d"],function(){return e.onOff()}),this.BLACKLIST=["timeupdate","playback:timeupdate","playback:progress","container:hover","container:timeupdate","container:progress"],this.level=r,this.offLevel=a}return t.prototype.debug=function(t){this.log(t,0,Array.prototype.slice.call(arguments,1))},t.prototype.info=function(t){this.log(t,l,Array.prototype.slice.call(arguments,1))},t.prototype.warn=function(t){this.log(t,2,Array.prototype.slice.call(arguments,1))},t.prototype.error=function(t){this.log(t,3,Array.prototype.slice.call(arguments,1))},t.prototype.onOff=function(){this.level===this.offLevel?this.level=this.previousLevel:(this.previousLevel=this.level,this.level=this.offLevel),window.console&&window.console.log&&window.console.log("%c[Clappr.Log] set log level to "+f[this.level],o)},t.prototype.level=function(t){this.level=t},t.prototype.log=function(t,e,r){if(!(this.BLACKLIST.indexOf(r[0])>=0||e0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return 3*t.length/4-n(t)}function a(t){var e,r,i,a,o,s,l=t.length;o=n(t),s=new f(3*l/4-o),i=o>0?l-4:l;var u=0;for(e=0,r=0;e>16&255,s[u++]=a>>8&255,s[u++]=255&a;return 2===o?(a=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,s[u++]=255&a):1===o&&(a=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,s[u++]=a>>8&255,s[u++]=255&a),s}function o(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function s(t,e,r){for(var n,i=[],a=e;al?l:o+16383));return 1===n?(e=t[r-1],i+=u[e>>2],i+=u[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=u[e>>10],i+=u[e>>4&63],i+=u[e<<2&63],i+="="),a.push(i),a.join("")}e.byteLength=i,e.toByteArray=a,e.fromByteArray=l;for(var u=[],c=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,p=d.length;h=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|t}function g(t){return+t!=t&&(t=0),a.alloc(+t)}function y(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(n)return K(t).length;e=(""+e).toLowerCase(),n=!0}}function v(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return D(this,e,r);case"utf8":case"utf-8":return L(this,e,r);case"ascii":return P(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return R(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:_(t,e,r,n,i);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):_(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,e,r,n,i){function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}var u;if(i){var c=-1;for(u=r;us&&(r=s-l),u=r;u>=0;u--){for(var f=!0,d=0;di&&(n=i):n=i;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o239?4:a>223?3:a>191?2:1;if(i+s<=r){var l,u,c,f;switch(s){case 1:a<128&&(o=a);break;case 2:l=t[i+1],128==(192&l)&&(f=(31&a)<<6|63&l)>127&&(o=f);break;case 3:l=t[i+1],u=t[i+2],128==(192&l)&&128==(192&u)&&(f=(15&a)<<12|(63&l)<<6|63&u)>2047&&(f<55296||f>57343)&&(o=f);break;case 4:l=t[i+1],u=t[i+2],c=t[i+3],128==(192&l)&&128==(192&u)&&128==(192&c)&&(f=(15&a)<<18|(63&l)<<12|(63&u)<<6|63&c)>65535&&f<1114112&&(o=f)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return O(n)}function O(t){var e=t.length;if(e<=Q)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function M(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function F(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function B(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,i){return i||B(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(t,e,r,n,23,4),r+4}function j(t,e,r,n,i){return i||B(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(t,e,r,n,52,8),r+8}function G(t){if(t=Y(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function Y(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function V(t){return t<16?"0"+t.toString(16):t.toString(16)}function K(t,e){e=e||1/0;for(var r,n=t.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function $(t){for(var e=[],r=0;r>8,i=r%256,a.push(i),a.push(n);return a}function H(t){return X.toByteArray(G(t))}function W(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function q(t){return t!==t}var X=r(79),Z=r(103),J=r(81);e.Buffer=a,e.SlowBuffer=g,e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=n(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,r){return o(null,t,e,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,r){return l(null,t,e,r)},a.allocUnsafe=function(t){return u(null,t)},a.allocUnsafeSlow=function(t){return u(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},a.prototype.compare=function(t,e,r,n,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,l=Math.min(o,s),u=this.slice(n,i),c=t.slice(e,r),f=0;fi)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return T(this,t,e,r);case"ascii":return A(this,t,e,r);case"latin1":case"binary":return w(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return e||x(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||x(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||x(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=this[t],i=1,a=0;++a=i&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},a.prototype.readInt8=function(t,e){return e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){e||x(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){e||x(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||x(t,4,this.length),Z.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||x(t,4,this.length),Z.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||x(t,8,this.length),Z.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||x(t,8,this.length),Z.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){N(this,t,e,r,Math.pow(2,8*r)-1,0)}var i=1,a=0;for(this[e]=255&t;++a=0&&(a*=256);)this[e+i]=t/a&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):F(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):F(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);N(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);N(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):F(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):F(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;odiv{width:18px;height:18px;background-color:#fff;border-radius:100%;display:inline-block;-webkit-animation:bouncedelay 1.4s infinite ease-in-out;-moz-animation:bouncedelay 1.4s infinite ease-in-out;animation:bouncedelay 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;animation-fill-mode:both}.spinner-three-bounce[data-spinner] [data-bounce1]{-webkit-animation-delay:-.32s;-moz-animation-delay:-.32s;animation-delay:-.32s}.spinner-three-bounce[data-spinner] [data-bounce2]{-webkit-animation-delay:-.16s;-moz-animation-delay:-.16s;animation-delay:-.16s}@-webkit-keyframes bouncedelay{0%,80%,to{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@-moz-keyframes bouncedelay{0%,80%,to{-moz-transform:scale(0)}40%{-moz-transform:scale(1)}}@keyframes bouncedelay{0%,80%,to{-webkit-transform:scale(0);-moz-transform:scale(0);-ms-transform:scale(0);-o-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1)}}",""])},function(t,e,r){e=t.exports=r(6)(void 0),e.push([t.i,"[data-watermark]{position:absolute;min-width:70px;max-width:200px;width:12%;text-align:center;z-index:10}[data-watermark] a{outline:none;cursor:pointer}[data-watermark] img{max-width:100%}[data-watermark-bottom-left]{bottom:10px;left:10px}[data-watermark-bottom-right]{bottom:10px;right:42px}[data-watermark-top-left]{top:10px;left:10px}[data-watermark-top-right]{top:10px;right:37px}",""])},function(t,e,r){var n,n;!function(e){t.exports=e()}(function(){var t;return function t(e,r,i){function a(s,l){if(!r[s]){if(!e[s]){var u="function"==typeof n&&n;if(!l&&u)return n(s,!0);if(o)return n(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[s]={exports:{}};e[s][0].call(f.exports,function(t){var r=e[s][1][t];return a(r||t)},f,f.exports,t,e,r,i)}return r[s].exports}for(var o="function"==typeof n&&n,s=0;s0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,a,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],a=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(s=a;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],2:[function(e,r,n){!function(e){var i=/^((?:[^\/;?#]+:)?)(\/\/[^\/\;?#]*)?(.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,a=/^([^\/;?#]*)(.*)$/,o={buildAbsoluteURL:function(t,e,r){if(r=r||{},t=t.trim(),!(e=e.trim())){if(!r.alwaysNormalize)return t;var n=this.parseURL(t);if(!s)throw new Error("Error trying to parse base URL.");return n.path=o.normalizePath(n.path),o.buildURLFromParts(n)}var i=this.parseURL(e);if(!i)throw new Error("Error trying to parse relative URL.");if(i.scheme)return r.alwaysNormalize?(i.path=o.normalizePath(i.path),o.buildURLFromParts(i)):e;var s=this.parseURL(t);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var l=a.exec(s.path);s.netLoc=l[1],s.path=l[2]}s.netLoc&&!s.path&&(s.path="/");var u={scheme:s.scheme,netLoc:i.netLoc,path:null,params:i.params,query:i.query,fragment:i.fragment};if(!i.netLoc&&(u.netLoc=s.netLoc,"/"!==i.path[0]))if(i.path){var c=s.path,f=c.substring(0,c.lastIndexOf("/")+1)+i.path;u.path=o.normalizePath(f)}else u.path=s.path,i.params||(u.params=s.params,i.query||(u.query=s.query));return null===u.path&&(u.path=r.alwaysNormalize?o.normalizePath(i.path):i.path),o.buildURLFromParts(u)},parseURL:function(t){var e=i.exec(t);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(/(?:\/|^)\.(?=\/)/g,"");t.length!==(t=t.replace(/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}};"object"==typeof n&&"object"==typeof r?r.exports=o:"function"==typeof t&&t.amd?t([],function(){return o}):"object"==typeof n?n.URLToolkit=o:e.URLToolkit=o}(this)},{}],3:[function(t,e,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){function r(t){y[t]=!0;for(var e in i[t][1]){var n=i[t][1][e];y[n]||r(n)}}for(var s,l=Object.keys(a),u=0,c=l.length;u500*r.duration/s){var l=t.levels,c=Math.max(1,a.bw?a.bw/8:1e3*a.loaded/o),f=l[r.level],d=f.realBitrate?Math.max(f.realBitrate,f.bitrate):f.bitrate,p=a.total?a.total:Math.max(a.loaded,Math.round(r.duration*d/8)),y=e.currentTime,v=(p-a.loaded)/c,m=(h.default.bufferInfo(e,y,t.config.maxBufferHole).end-y)/s;if(m<2*r.duration/s&&v>m){var b=void 0,_=void 0;for(_=r.level-1;_>i;_--){var E=l[_].realBitrate?Math.max(l[_].realBitrate,l[_].bitrate):l[_].bitrate;if((b=r.duration*E/(6.4*c))=n;u--){var c=l[u],f=c.details,d=f?f.totalduration/f.fragments.length:e,h=!!f&&f.live,p=void 0;p=u<=t?o*r:s*r;var y=l[u].realBitrate?Math.max(l[u].realBitrate,l[u].bitrate):l[u].bitrate,v=y*d/p;if(g.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+u+"/"+Math.round(p)+"/"+y+"/"+d+"/"+a+"/"+v),p>y&&(!v||h||v=0)return d;g.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var p=s?Math.min(s,n.maxStarvationDelay):n.maxStarvationDelay,y=n.abrBandWidthFactor,v=n.abrBandWidthUpFactor;if(0===f){var m=this.bitrateTestDelay;if(m){p=(s?Math.min(s,n.maxLoadingDelay):n.maxLoadingDelay)-m,g.logger.trace("bitrate test took "+Math.round(1e3*m)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*p)+" ms"),y=v=1}}return d=this._findBestLevel(o,s,c,i,e,f+p,y,v,r),Math.max(d,0)}}]),e}(f.default);r.default=m},{30:30,31:31,32:32,34:34,48:48,50:50}],6:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&-1===t?(A.logger.log("audio:override startPosition with lastCurrentTime @"+e.toFixed(3)),this.state=w.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:t,this.state=w.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=t,this.state=w.STOPPED}},{key:"stopLoad",value:function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=w.STOPPED}},{key:"tick",value:function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){var t,e,r,n=this.hls,i=n.config;switch(this.state){case w.ERROR:case w.PAUSED:case w.BUFFER_FLUSHING:break;case w.STARTING:this.state=w.WAITING_TRACK,this.loadedmetadata=!1;break;case w.IDLE:var a=this.tracks;if(!a)break;if(!this.media&&(this.startFragRequested||!i.startFragPrefetch))break;t=this.loadedmetadata?this.media.currentTime:this.nextLoadPosition;var o=this.mediaBuffer?this.mediaBuffer:this.media,s=f.default.bufferInfo(o,t,i.maxBufferHole),l=s.len,c=s.end,d=this.fragPrevious,h=i.maxMaxBufferLength,p=this.audioSwitch,y=this.trackId;if((lb||s.nextStart))return;A.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=b+.05}if(r.initSegment&&!r.initSegment.data)E=r.initSegment;else if(c<=b){if(E=v[0],r.live&&E.loadIdx&&E.loadIdx===this.fragLoadIdx){var k=s.nextStart?s.nextStart:b;return A.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(k+.05)),void(this.media.currentTime=k+.05)}}else{var S=void 0,R=i.maxFragLookUpTolerance,L=d?v[d.sn-v[0].sn+1]:void 0,O=function(t){var e=Math.min(R,t.duration);return t.start+t.duration-e<=c?1:t.start-e>c&&t.start?-1:0};c<_?(c>_-R&&(R=0),S=L&&!O(L)?L:u.default.search(v,O)):S=v[m-1],S&&(E=S,b=S.start,d&&E.level===d.level&&E.sn===d.sn&&(E.snP&&Math.abs(this.fragLoadIdx-E.loadIdx)=D||I)&&(A.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=w.IDLE);break;case w.WAITING_INIT_PTS:case w.STOPPED:case w.FRAG_LOADING:case w.PARSING:case w.PARSED:case w.ENDED:}}},{key:"onMediaAttached",value:function(t){var e=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),e.addEventListener("seeking",this.onvseeking),e.addEventListener("ended",this.onvended);var r=this.config;this.tracks&&r.autoStartLoad&&this.startLoad(r.startPosition)}},{key:"onMediaDetaching",value:function(){var t=this.media;t&&t.ended&&(A.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var e=this.tracks;e&&e.forEach(function(t){t.details&&t.details.fragments.forEach(function(t){t.loadCounter=void 0})}),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()}},{key:"onMediaSeeking",value:function(){this.state===w.ENDED&&(this.state=w.IDLE),this.media&&(this.lastCurrentTime=this.media.currentTime),void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold),this.tick()}},{key:"onMediaEnded",value:function(){this.startPosition=this.lastCurrentTime=0}},{key:"onAudioTracksUpdated",value:function(t){A.logger.log("audio tracks updated"),this.tracks=t.audioTracks}},{key:"onAudioTrackSwitching",value:function(t){var e=!!t.url;this.trackId=t.id,this.state=w.IDLE,this.fragCurrent=null,this.state=w.PAUSED,this.waitingFragment=null,e?this.timer||(this.timer=setInterval(this.ontick,100)):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),e&&(this.audioSwitch=!0,this.state=w.IDLE,void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold)),this.tick()}},{key:"onAudioTrackLoaded",value:function(t){var e=t.details,r=t.id,n=this.tracks[r],i=e.totalduration,a=0;if(A.logger.log("track "+r+" loaded ["+e.startSN+","+e.endSN+"],duration:"+i),e.live){var o=n.details;o&&e.fragments.length>0?(b.default.mergeDetails(o,e),a=e.fragments[0].start,e.PTSKnown?A.logger.log("live audio playlist sliding:"+a.toFixed(3)):A.logger.log("live audio playlist - outdated PTS, unknown sliding")):(e.PTSKnown=!1,A.logger.log("live audio playlist - first load, unknown sliding"))}else e.PTSKnown=!1;if(n.details=e,!this.startFragRequested){if(-1===this.startPosition){var s=e.startTimeOffset;isNaN(s)?this.startPosition=0:(A.logger.log("start time offset found in playlist, adjust startPosition to "+s),this.startPosition=s)}this.nextLoadPosition=this.startPosition}this.state===w.WAITING_TRACK&&(this.state=w.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===w.KEY_LOADING&&(this.state=w.IDLE,this.tick())}},{key:"onFragLoaded",value:function(t){var e=this.fragCurrent,r=t.frag;if(this.state===w.FRAG_LOADING&&e&&"audio"===r.type&&r.level===e.level&&r.sn===e.sn){var n=this.tracks[this.trackId],i=n.details,a=i.totalduration,o=e.level,s=e.sn,l=e.cc,u=this.config.defaultAudioCodec||n.audioCodec||"mp4a.40.2",c=this.stats=t.stats;if("initSegment"===s)this.state=w.IDLE,c.tparsed=c.tbuffered=performance.now(),i.initSegment.data=t.payload,this.hls.trigger(g.default.FRAG_BUFFERED,{stats:c,frag:e,id:"audio"}),this.tick();else{this.state=w.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new h.default(this.hls,"audio"));var f=this.initPTS[l],d=i.initSegment?i.initSegment.data:[];if(d||void 0!==f){this.pendingBuffering=!0,A.logger.log("Demuxing "+s+" of ["+i.startSN+" ,"+i.endSN+"],track "+o);this.demuxer.push(t.payload,d,u,null,e,a,!1,f)}else A.logger.log("unknown video PTS for continuity counter "+l+", waiting for video PTS before demuxing audio frag "+s+" of ["+i.startSN+" ,"+i.endSN+"],track "+o),this.waitingFragment=t,this.state=w.WAITING_INIT_PTS}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(t){var e=this.fragCurrent,r=t.frag;if(e&&"audio"===t.id&&r.sn===e.sn&&r.level===e.level&&this.state===w.PARSING){var n=t.tracks,i=void 0;if(n.video&&delete n.video,i=n.audio){i.levelCodec="mp4a.40.2",i.id=t.id,this.hls.trigger(g.default.BUFFER_CODECS,n),A.logger.log("audio track:audio,container:"+i.container+",codecs[level/parsed]=["+i.levelCodec+"/"+i.codec+"]");var a=i.initSegment;if(a){var o={type:"audio",data:a,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[o]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(g.default.BUFFER_APPENDING,o))}this.tick()}}}},{key:"onFragParsingData",value:function(t){var e=this,r=this.fragCurrent,n=t.frag;if(r&&"audio"===t.id&&"audio"===t.type&&n.sn===r.sn&&n.level===r.level&&this.state===w.PARSING){var i=this.trackId,a=this.tracks[i],o=this.hls;isNaN(t.endPTS)&&(t.endPTS=t.startPTS+r.duration,t.endDTS=t.startDTS+r.duration),A.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),b.default.updateFragPTSDTS(a.details,r.sn,t.startPTS,t.endPTS);var s=this.audioSwitch,l=this.media,u=!1;if(s&&l)if(l.readyState){var c=l.currentTime;A.logger.log("switching audio track : currentTime:"+c),c>=t.startPTS&&(A.logger.log("switching audio track : flushing all audio"),this.state=w.BUFFER_FLUSHING,o.trigger(g.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),u=!0,this.audioSwitch=!1,o.trigger(g.default.AUDIO_TRACK_SWITCHED,{id:i}))}else this.audioSwitch=!1,o.trigger(g.default.AUDIO_TRACK_SWITCHED,{id:i});var f=this.pendingData;this.audioSwitch||([t.data1,t.data2].forEach(function(e){e&&e.length&&f.push({type:t.type,data:e,parent:"audio",content:"data"})}),!u&&f.length&&(f.forEach(function(t){e.state===w.PARSING&&(e.pendingBuffering=!0,e.hls.trigger(g.default.BUFFER_APPENDING,t))}),this.pendingData=[],this.appended=!0)),this.tick()}}},{key:"onFragParsed",value:function(t){var e=this.fragCurrent,r=t.frag;e&&"audio"===t.id&&r.sn===e.sn&&r.level===e.level&&this.state===w.PARSING&&(this.stats.tparsed=performance.now(),this.state=w.PARSED,this._checkAppendedParsed())}},{key:"onBufferCreated",value:function(t){var e=t.tracks.audio;e&&(this.mediaBuffer=e.buffer,this.loadedmetadata=!0)}},{key:"onBufferAppended",value:function(t){if("audio"===t.parent){var e=this.state;e!==w.PARSING&&e!==w.PARSED||(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){if(!(this.state!==w.PARSED||this.appended&&this.pendingBuffering)){var t=this.fragCurrent,e=this.stats,r=this.hls;if(t){this.fragPrevious=t,e.tbuffered=performance.now(),r.trigger(g.default.FRAG_BUFFERED,{stats:e,frag:t,id:"audio"});var n=this.mediaBuffer?this.mediaBuffer:this.media;A.logger.log("audio buffered : "+E.default.toString(n.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,r.trigger(g.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=w.IDLE}this.tick()}}},{key:"onError",value:function(t){var e=t.frag;if(!e||"audio"===e.type)switch(t.details){case T.ErrorDetails.FRAG_LOAD_ERROR:case T.ErrorDetails.FRAG_LOAD_TIMEOUT:if(!t.fatal){var r=this.fragLoadError;r?r++:r=1;var n=this.config;if(r<=n.fragLoadingMaxRetry){this.fragLoadError=r,e.loadCounter=0;var i=Math.min(Math.pow(2,r-1)*n.fragLoadingRetryDelay,n.fragLoadingMaxRetryTimeout);A.logger.warn("audioStreamController: frag loading failed, retry in "+i+" ms"),this.retryDate=performance.now()+i,this.state=w.FRAG_LOADING_WAITING_RETRY}else A.logger.error("audioStreamController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=w.ERROR}break;case T.ErrorDetails.FRAG_LOOP_LOADING_ERROR:case T.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case T.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case T.ErrorDetails.KEY_LOAD_ERROR:case T.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==w.ERROR&&(this.state=t.fatal?w.ERROR:w.IDLE,A.logger.warn("audioStreamController: "+t.details+" while loading frag,switch to "+this.state+" state ..."));break;case T.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===t.parent&&(this.state===w.PARSING||this.state===w.PARSED)){var a=this.mediaBuffer,o=this.media.currentTime;if(a&&f.default.isBuffered(a,o)&&f.default.isBuffered(a,o+.5)){var s=this.config;s.maxMaxBufferLength>=s.maxBufferLength&&(s.maxMaxBufferLength/=2,A.logger.warn("audio:reduce max buffer length to "+s.maxMaxBufferLength+"s"),this.fragLoadIdx+=2*s.fragLoadingLoopThreshold),this.state=w.IDLE}else A.logger.warn("buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=w.BUFFER_FLUSHING,this.hls.trigger(g.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}}}},{key:"onBufferFlushed",value:function(){var t=this,e=this.pendingData;e&&e.length?(A.logger.log("appending pending audio data on Buffer Flushed"),e.forEach(function(e){t.hls.trigger(g.default.BUFFER_APPENDING,e)}),this.appended=!0,this.pendingData=[],this.state=w.PARSED):(this.state=w.IDLE,this.fragPrevious=null,this.tick())}},{key:"state",set:function(t){if(this.state!==t){var e=this.state;this._state=t,A.logger.log("audio stream:"+e+"->"+t)}},get:function(){return this._state}}]),e}(v.default);r.default=k},{24:24,30:30,31:31,32:32,34:34,35:35,45:45,50:50,51:51}],7:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){this.updateTrack(this.trackId)}},{key:"onManifestLoading",value:function(){this.tracks=[],this.trackId=-1}},{key:"onManifestLoaded",value:function(t){var e=this,r=t.audioTracks||[],n=!1;this.tracks=r,this.hls.trigger(u.default.AUDIO_TRACKS_UPDATED,{audioTracks:r});var i=0;r.forEach(function(t){if(t.default)return e.audioTrack=i,void(n=!0);i++}),!1===n&&r.length&&(d.logger.log("no default audio track defined, use first audio track as default"),this.audioTrack=0)}},{key:"onAudioTrackLoaded",value:function(t){t.id=0&&t=0&&t.1){var i=n.updating;try{n.abort()}catch(t){i=!0,d.logger.warn("can not abort audio buffer: "+t)}i?this.audioTimestampOffset=t.start:(d.logger.warn("change mpeg audio timestamp offset from "+n.timestampOffset+" to "+t.start),n.timestampOffset=t.start)}}}},{key:"onManifestParsed",value:function(t){var e=t.audio,r=t.video,n=0;t.altAudio&&(e||r)&&(n=(e?1:0)+(r?1:0),d.logger.log(n+" sourceBuffer(s) expected")),this.sourceBufferNb=n}},{key:"onMediaAttaching",value:function(t){var e=this.media=t.media;if(e){var r=this.mediaSource=new MediaSource;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),r.addEventListener("sourceopen",this.onmso),r.addEventListener("sourceended",this.onmse),r.addEventListener("sourceclose",this.onmsc),e.src=URL.createObjectURL(r)}}},{key:"onMediaDetaching",value:function(){d.logger.log("media source detaching");var t=this.mediaSource;if(t){if("open"===t.readyState)try{t.endOfStream()}catch(t){d.logger.warn("onMediaDetaching:"+t.message+" while calling endOfStream")}t.removeEventListener("sourceopen",this.onmso),t.removeEventListener("sourceended",this.onmse),t.removeEventListener("sourceclose",this.onmsc),this.media&&(URL.revokeObjectURL(this.media.src),this.media.removeAttribute("src"),this.media.load()),this.mediaSource=null,this.media=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(u.default.MEDIA_DETACHED)}},{key:"onMediaSourceOpen",value:function(){d.logger.log("media source opened"),this.hls.trigger(u.default.MEDIA_ATTACHED,{media:this.media});var t=this.mediaSource;t&&t.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()}},{key:"checkPendingTracks",value:function(){var t=this.pendingTracks,e=Object.keys(t).length;e&&(this.sourceBufferNb<=e||0===this.sourceBufferNb)&&(this.createSourceBuffers(t),this.pendingTracks={},this.doAppending())}},{key:"onMediaSourceClose",value:function(){d.logger.log("media source closed")}},{key:"onMediaSourceEnded",value:function(){d.logger.log("media source ended")}},{key:"onSBUpdateEnd",value:function(){if(this.audioTimestampOffset){var t=this.sourceBuffer.audio;d.logger.warn("change mpeg audio timestamp offset from "+t.timestampOffset+" to "+this.audioTimestampOffset),t.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var e=this.parent,r=this.segments.reduce(function(t,r){return r.parent===e?t+1:t},0);this.hls.trigger(u.default.BUFFER_APPENDED,{parent:e,pending:r}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration()}},{key:"onSBUpdateError",value:function(t){d.logger.error("sourceBuffer error:",t),this.hls.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferReset",value:function(){var t=this.sourceBuffer;for(var e in t){var r=t[e];try{this.mediaSource.removeSourceBuffer(r),r.removeEventListener("updateend",this.onsbue),r.removeEventListener("error",this.onsbe)}catch(t){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}},{key:"onBufferCodecs",value:function(t){if(0===Object.keys(this.sourceBuffer).length){for(var e in t)this.pendingTracks[e]=t[e];var r=this.mediaSource;r&&"open"===r.readyState&&this.checkPendingTracks()}}},{key:"createSourceBuffers",value:function(t){var e=this.sourceBuffer,r=this.mediaSource;for(var n in t)if(!e[n]){var i=t[n],a=i.levelCodec||i.codec,o=i.container+";codecs="+a;d.logger.log("creating sourceBuffer("+o+")");try{var s=e[n]=r.addSourceBuffer(o);s.addEventListener("updateend",this.onsbue),s.addEventListener("error",this.onsbe),this.tracks[n]={codec:a,container:i.container},i.buffer=s}catch(t){d.logger.error("error while trying to add sourceBuffer:"+t.message),this.hls.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:t,mimeType:o})}}this.hls.trigger(u.default.BUFFER_CREATED,{tracks:t})}},{key:"onBufferAppending",value:function(t){this._needsFlush||(this.segments?this.segments.push(t):this.segments=[t],this.doAppending())}},{key:"onBufferAppendFail",value:function(t){d.logger.error("sourceBuffer error:",t.event),this.hls.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferEos",value:function(t){var e=this.sourceBuffer,r=t.type;for(var n in e)r&&n!==r||e[n].ended||(e[n].ended=!0,d.logger.log(n+" sourceBuffer now EOS"));this.checkEos()}},{key:"checkEos",value:function(){var t=this.sourceBuffer,e=this.mediaSource;if(!e||"open"!==e.readyState)return void(this._needsEos=!1);for(var r in t){var n=t[r];if(!n.ended)return;if(n.updating)return void(this._needsEos=!0)}d.logger.log("all media data available, signal endOfStream() to MediaSource and stop loading fragment");try{e.endOfStream()}catch(t){d.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1}},{key:"onBufferFlushing",value:function(t){this.flushRange.push({start:t.startOffset,end:t.endOffset,type:t.type}),this.flushBufferCounter=0,this.doFlush()}},{key:"onLevelUpdated",value:function(t){var e=t.details;0!==e.fragments.length&&(this._levelDuration=e.totalduration+e.fragments[0].start,this.updateMediaElementDuration())}},{key:"updateMediaElementDuration",value:function(){var t=this.media,e=this.mediaSource,r=this.sourceBuffer,n=this._levelDuration;if(null!==n&&t&&e&&r&&0!==t.readyState&&"open"===e.readyState){for(var i in r)if(r[i].updating)return;null===this._msDuration&&(this._msDuration=e.duration);var a=t.duration;(n>this._msDuration&&n>a||a===1/0||isNaN(a))&&(d.logger.log("Updating mediasource duration to "+n.toFixed(3)),this._msDuration=e.duration=n)}}},{key:"doFlush",value:function(){for(;this.flushRange.length;){var t=this.flushRange[0];if(!this.flushBuffer(t.start,t.end,t.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var e=0,r=this.sourceBuffer;try{for(var n in r)e+=r[n].buffered.length}catch(t){d.logger.error("error while accessing sourceBuffer.buffered")}this.appended=e,this.hls.trigger(u.default.BUFFER_FLUSHED)}}},{key:"doAppending",value:function(){var t=this.hls,e=this.sourceBuffer,r=this.segments;if(Object.keys(e).length){if(this.media.error)return this.segments=[],void d.logger.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(r&&r.length){var n=r.shift();try{var i=n.type,a=e[i];a?a.updating?r.unshift(n):(a.ended=!1,this.parent=n.parent,a.appendBuffer(n.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(e){d.logger.error("error while trying to append buffer:"+e.message),r.unshift(n);var o={type:h.ErrorTypes.MEDIA_ERROR,parent:n.parent};if(22===e.code)return this.segments=[],o.details=h.ErrorDetails.BUFFER_FULL_ERROR,o.fatal=!1,void t.trigger(u.default.ERROR,o);if(this.appendError?this.appendError++:this.appendError=1,o.details=h.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>t.config.appendErrorMaxRetry)return d.logger.log("fail "+t.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),r=[],o.fatal=!0,void t.trigger(u.default.ERROR,o);o.fatal=!1,t.trigger(u.default.ERROR,o)}}}}},{key:"flushBuffer",value:function(t,e,r){var n,i,a,o,s,l,u=this.sourceBuffer;if(Object.keys(u).length){if(d.logger.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+t+"/"+e),this.flushBufferCounter.5)return this.flushBufferCounter++,d.logger.log("flush "+c+" ["+s+","+l+"], of ["+a+","+o+"], pos:"+this.media.currentTime),n.remove(s,l),!1}catch(t){d.logger.warn("exception while accessing sourcebuffer, it might have been removed from MediaSource")}}}else d.logger.warn("abort flushing too many retries");d.logger.log("buffer flushed")}return!0}}]),e}(f.default);r.default=p},{30:30,31:31,32:32,50:50}],9:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;rthis.autoLevelCapping&&e.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}}},{key:"getMaxLevel",value:function(t){var e=0,r=void 0,n=void 0,i=this.mediaWidth,a=this.mediaHeight,o=0,s=0;for(r=0;r<=t&&(n=this.levels[r],!this.isLevelRestricted(r))&&(e=r,o=n.width,s=n.height,!(i<=o||a<=s));r++);return e}},{key:"isLevelRestricted",value:function(t){return!(!this.restrictedLevels||-1===this.restrictedLevels.indexOf(t))}},{key:"contentScaleFactor",get:function(){var t=1;try{t=window.devicePixelRatio}catch(t){}return t}},{key:"mediaWidth",get:function(){var t=void 0,e=this.media;return e&&(t=e.width||e.clientWidth||e.offsetWidth,t*=this.contentScaleFactor),t}},{key:"mediaHeight",get:function(){var t=void 0,e=this.media;return e&&(t=e.height||e.clientHeight||e.offsetHeight,t*=this.contentScaleFactor),t}}]),e}(f.default);r.default=d},{31:31,32:32}],10:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&a>l.config.fpsDroppedMonitoringThreshold*o){var c=l.currentLevel;d.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+c),c>0&&(-1===l.autoLevelCapping||l.autoLevelCapping>=c)&&(c-=1,l.trigger(u.default.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:l.currentLevel}),l.autoLevelCapping=c,l.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=r,this.lastDecodedFrames=e}}},{key:"checkFPSInterval",value:function(){var t=this.video;if(t)if(this.isVideoPlaybackQualityAvailable){var e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)}}]),e}(f.default);r.default=h},{31:31,32:32,50:50}],11:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0})}else s.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:s.url,reason:"no level with compatible codecs found in manifest"})}},{key:"setLevelInternal",value:function(t){var e=this._levels,r=this.hls;if(t>=0&&t1&&i.loadErrort&&(this._level===t&&void 0!==e[t].details||this.setLevelInternal(t))}},{key:"manualLevel",get:function(){return this._manualLevel},set:function(t){this._manualLevel=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var t=this.hls.config.startLevel;return void 0!==t?t:this._firstLevel}return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return-1!==this._manualLevel?this._manualLevel:this.hls.nextAutoLevel},set:function(t){this.level=t,-1===this._manualLevel&&(this.hls.nextAutoLevel=t)}}]),e}(f.default);r.default=y},{30:30,31:31,32:32,34:34,50:50}],12:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r0&&-1===t&&(A.logger.log("override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e),this.state=w.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this.forceStartLoad=!0,this.state=w.STOPPED}},{key:"stopLoad",value:function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=w.STOPPED,this.forceStartLoad=!1}},{key:"tick",value:function(){1===++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){switch(this.state){case w.ERROR:break;case w.BUFFER_FLUSHING:this.fragLoadError=0;break;case w.IDLE:if(!this._doTickIdle())return;break;case w.WAITING_LEVEL:var t=this.levels[this.level];t&&t.details&&(this.state=w.IDLE);break;case w.FRAG_LOADING_WAITING_RETRY:var e=performance.now(),r=this.retryDate;(!r||e>=r||this.media&&this.media.seeking)&&(A.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=w.IDLE);break;case w.ERROR:case w.STOPPED:case w.FRAG_LOADING:case w.PARSING:case w.PARSED:case w.ENDED:}this._checkBuffer(),this._checkFragmentChanged()}},{key:"_doTickIdle",value:function(){var t=this.hls,e=t.config,r=this.media;if(void 0!==this.levelLastLoaded&&!r&&(this.startFragRequested||!e.startFragPrefetch))return!0;var n=void 0;n=this.loadedmetadata?r.currentTime:this.nextLoadPosition;var i=t.nextLoadLevel,a=this.levels[i],o=a.bitrate,s=void 0;s=o?Math.max(8*e.maxBufferSize/o,e.maxBufferLength):e.maxBufferLength,s=Math.min(s,e.maxMaxBufferLength);var l=f.default.bufferInfo(this.mediaBuffer?this.mediaBuffer:r,n,e.maxBufferHole),u=l.len;if(u>=s)return!0;A.logger.trace("buffer length of "+u.toFixed(3)+" is below max of "+s.toFixed(3)+". checking for more payload ..."),this.level=t.nextLoadLevel=i;var c=a.details;if(void 0===c||c.live&&this.levelLastLoaded!==i)return this.state=w.WAITING_LEVEL,!0;var d=this.fragPrevious;if(!c.live&&d&&d.sn===c.endSN){if(Math.min(r.duration,d.start+d.duration)-Math.max(l.end,d.start)<=Math.max(.2,d.duration/2)){var h={};return this.altAudio&&(h.type="video"),this.hls.trigger(g.default.BUFFER_EOS,h),this.state=w.ENDED,!0}}return this._fetchPayloadOrEos(n,l,c)}},{key:"_fetchPayloadOrEos",value:function(t,e,r){var n=this.fragPrevious,i=this.level,a=r.fragments,o=a.length;if(0===o)return!1;var s=a[0].start,l=a[o-1].start+a[o-1].duration,u=e.end,c=void 0;if(r.initSegment&&!r.initSegment.data)c=r.initSegment;else if(r.live){var f=this.config.initialLiveManifestSize;if(of&&(l.currentTime=f)}if(t.PTSKnown&&e>n&&l&&l.readyState)return null;if(this.startFragRequested&&!t.PTSKnown){if(i){var d=i.sn+1;d>=t.startSN&&d<=t.endSN&&(u=a[d-t.startSN],A.logger.log("live playlist, switching playlist, load frag with next SN: "+u.sn))}u||(u=a[Math.min(o-1,Math.round(o/2))],A.logger.log("live playlist, switching playlist, unknown, load middle frag : "+u.sn))}return u}},{key:"_findFragment",value:function(t,e,r,n,i,a,o){var s=this.hls.config,l=void 0,c=void 0,f=s.maxFragLookUpTolerance,d=e?n[e.sn-n[0].sn+1]:void 0,h=function(t){var e=Math.min(f,t.duration);return t.start+t.duration-e<=i?1:t.start-e>i&&t.start?-1:0};if(ia-f&&(f=0),c=d&&!h(d)?d:u.default.search(n,h)):c=n[r-1],c){l=c;var p=l.sn-o.startSN,g=e&&l.level===e.level,y=n[p-1],v=n[p+1];if(g&&l.sn===e.sn)if(l.sns.maxBufferHole&&e.dropped&&p?(l=y,A.logger.warn("SN just loaded, with large PTS gap between audio and video, maybe frag is not starting with a keyframe ? load previous one to try to overcome this"),e.loadCounter--):(l=v,A.logger.log("SN just loaded, load next one: "+l.sn))}else l=null;else l.dropped&&!g&&(v&&v.backtracked?(A.logger.warn("Already backtracked from fragment "+(p+1)+", will not backtrack to fragment "+p+". Loading fragment "+(p+1)),l=v):(A.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),l.dropped=0,y?(y.loadCounter&&y.loadCounter--,l=y):l=null))}return l}},{key:"_loadFragmentOrKey",value:function(t,e,r,n,i){var a=this.hls,o=a.config;if(!t.decryptdata||null==t.decryptdata.uri||null!=t.decryptdata.key){if(A.logger.log("Loading "+t.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+e+", currentTime:"+n.toFixed(3)+",bufferEnd:"+i.toFixed(3)),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,t.loadCounter){t.loadCounter++;var s=o.fragLoadingLoopThreshold;if(t.loadCounter>s&&Math.abs(this.fragLoadIdx-t.loadIdx)e.endPTS?1:0})}},{key:"followingBufferedFrag",value:function(t){return t?this.getBufferedFrag(t.endPTS+.5):null}},{key:"_checkFragmentChanged",value:function(){var t,e,r=this.media;if(r&&r.readyState&&!1===r.seeking&&(e=r.currentTime,e>r.playbackRate*this.lastCurrentTime&&(this.lastCurrentTime=e),f.default.isBuffered(r,e)?t=this.getBufferedFrag(e):f.default.isBuffered(r,e+.1)&&(t=this.getBufferedFrag(e+.1)),t)){var n=t;if(n!==this.fragPlaying){this.hls.trigger(g.default.FRAG_CHANGED,{frag:n});var i=n.level;this.fragPlaying&&this.fragPlaying.level===i||this.hls.trigger(g.default.LEVEL_SWITCHED,{level:i}),this.fragPlaying=n}}}},{key:"immediateLevelSwitch",value:function(){if(A.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var t=this.media,e=void 0;t?(e=t.paused,t.pause()):e=!0,this.previouslyPaused=e}var r=this.fragCurrent;r&&r.loader&&r.loader.abort(),this.fragCurrent=null,this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}},{key:"immediateLevelSwitchEnd",value:function(){var t=this.media;t&&t.buffered.length&&(this.immediateSwitch=!1,f.default.isBuffered(t,t.currentTime)&&(t.currentTime-=1e-4),this.previouslyPaused||t.play())}},{key:"nextLevelSwitch",value:function(){var t=this.media;if(t&&t.readyState){var e=void 0,r=void 0,n=void 0;if(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,r=this.getBufferedFrag(t.currentTime),r&&r.startPTS>1&&this.flushMainBuffer(0,r.startPTS-1),t.paused)e=0;else{var i=this.hls.nextLoadLevel,a=this.levels[i],o=this.fragLastKbps;e=o&&this.fragCurrent?this.fragCurrent.duration*a.bitrate/(1e3*o)+1:0}if((n=this.getBufferedFrag(t.currentTime+e))&&(n=this.followingBufferedFrag(n))){var s=this.fragCurrent;s&&s.loader&&s.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(n.startPTS,Number.POSITIVE_INFINITY)}}}},{key:"flushMainBuffer",value:function(t,e){this.state=w.BUFFER_FLUSHING;var r={startOffset:t,endOffset:e};this.altAudio&&(r.type="video"),this.hls.trigger(g.default.BUFFER_FLUSHING,r)}},{key:"onMediaAttached",value:function(t){var e=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),e.addEventListener("seeking",this.onvseeking),e.addEventListener("seeked",this.onvseeked),e.addEventListener("ended",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.hls.startLoad(r.startPosition)}},{key:"onMediaDetaching",value:function(){var t=this.media;t&&t.ended&&(A.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var e=this.levels;e&&e.forEach(function(t){t.details&&t.details.fragments.forEach(function(t){t.loadCounter=void 0,t.backtracked=void 0})}),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("seeked",this.onvseeked),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()}},{key:"onMediaSeeking",value:function(){var t=this.media,e=t?t.currentTime:void 0,r=this.config;if(A.logger.log("media seeking to "+e.toFixed(3)),this.state===w.FRAG_LOADING){var n=this.mediaBuffer?this.mediaBuffer:t,i=f.default.bufferInfo(n,e,this.config.maxBufferHole),a=this.fragCurrent;if(0===i.len&&a){var o=r.maxFragLookUpTolerance,s=a.start-o,l=a.start+a.duration+o;el?(a.loader&&(A.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),a.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=w.IDLE):A.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else this.state===w.ENDED&&(this.state=w.IDLE);t&&(this.lastCurrentTime=e),this.state!==w.FRAG_LOADING&&void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*r.fragLoadingLoopThreshold),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=e),this.tick()}},{key:"onMediaSeeked",value:function(){A.logger.log("media seeked to "+this.media.currentTime.toFixed(3)),this.tick()}},{key:"onMediaEnded",value:function(){A.logger.log("media ended"),this.startPosition=this.lastCurrentTime=0}},{key:"onManifestLoading",value:function(){A.logger.log("trigger BUFFER_RESET"),this.hls.trigger(g.default.BUFFER_RESET),this._bufferedFrags=[],this.stalled=!1,this.startPosition=this.lastCurrentTime=0}},{key:"onManifestParsed",value:function(t){var e,r=!1,n=!1;t.levels.forEach(function(t){(e=t.audioCodec)&&(-1!==e.indexOf("mp4a.40.2")&&(r=!0),-1!==e.indexOf("mp4a.40.5")&&(n=!0))}),this.audioCodecSwitch=r&&n,this.audioCodecSwitch&&A.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startLevelLoaded=!1,this.startFragRequested=!1;var i=this.config;(i.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(i.startPosition)}},{key:"onLevelLoaded",value:function(t){var e=t.details,r=t.level,n=this.levels[r],i=e.totalduration,a=0;if(A.logger.log("level "+r+" loaded ["+e.startSN+","+e.endSN+"],duration:"+i),this.levelLastLoaded=r,e.live){var o=n.details;o&&e.fragments.length>0?(b.default.mergeDetails(o,e),a=e.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(a,o),e.PTSKnown?A.logger.log("live playlist sliding:"+a.toFixed(3)):A.logger.log("live playlist - outdated PTS, unknown sliding")):(e.PTSKnown=!1,A.logger.log("live playlist - first load, unknown sliding"))}else e.PTSKnown=!1;if(n.details=e,this.hls.trigger(g.default.LEVEL_UPDATED,{details:e,level:r}),!1===this.startFragRequested){if(-1===this.startPosition||-1===this.lastCurrentTime){var s=e.startTimeOffset;isNaN(s)?e.live?(this.startPosition=this.computeLivePosition(a,e),A.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0:(s<0&&(A.logger.log("negative start time offset "+s+", count from end of last fragment"),s=a+i+s),A.logger.log("start time offset found in playlist, adjust startPosition to "+s),this.startPosition=s),this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===w.WAITING_LEVEL&&(this.state=w.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===w.KEY_LOADING&&(this.state=w.IDLE,this.tick())}},{key:"onFragLoaded",value:function(t){var e=this.fragCurrent,r=t.frag;if(this.state===w.FRAG_LOADING&&e&&"main"===r.type&&r.level===e.level&&r.sn===e.sn){var n=t.stats,i=this.levels[e.level],a=i.details;if(A.logger.log("Loaded "+e.sn+" of ["+a.startSN+" ,"+a.endSN+"],level "+e.level),this.bitrateTest=!1,this.stats=n,!0===r.bitrateTest&&this.hls.nextLoadLevel)this.state=w.IDLE,this.startFragRequested=!1,n.tparsed=n.tbuffered=performance.now(),this.hls.trigger(g.default.FRAG_BUFFERED,{stats:n,frag:e,id:"main"}),this.tick();else if("initSegment"===r.sn)this.state=w.IDLE,n.tparsed=n.tbuffered=performance.now(),a.initSegment.data=t.payload,this.hls.trigger(g.default.FRAG_BUFFERED,{stats:n,frag:e,id:"main"}),this.tick();else{this.state=w.PARSING;var o=a.totalduration,s=e.level,l=e.sn,u=this.config.defaultAudioCodec||i.audioCodec;this.audioCodecSwap&&(A.logger.log("swapping playlist audio codec"),void 0===u&&(u=this.lastAudioCodec),u&&(u=-1!==u.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),this.pendingBuffering=!0,this.appended=!1,A.logger.log("Parsing "+l+" of ["+a.startSN+" ,"+a.endSN+"],level "+s+", cc "+e.cc);var c=this.demuxer;c||(c=this.demuxer=new h.default(this.hls,"main"));var f=this.media,d=f&&f.seeking,p=!d&&(a.PTSKnown||!a.live),y=a.initSegment?a.initSegment.data:[];c.push(t.payload,y,u,i.videoCodec,e,o,p,void 0)}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(t){var e=this.fragCurrent,r=t.frag;if(e&&"main"===t.id&&r.sn===e.sn&&r.level===e.level&&this.state===w.PARSING){var n,i,a=t.tracks;if(a.audio&&this.altAudio&&delete a.audio,i=a.audio){var o=this.levels[this.level].audioCodec,s=navigator.userAgent.toLowerCase();o&&this.audioCodecSwap&&(A.logger.log("swapping playlist audio codec"),o=-1!==o.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==i.metadata.channelCount&&-1===s.indexOf("firefox")&&(o="mp4a.40.5"),-1!==s.indexOf("android")&&"audio/mpeg"!==i.container&&(o="mp4a.40.2",A.logger.log("Android: force audio codec to "+o)),i.levelCodec=o,i.id=t.id}i=a.video,i&&(i.levelCodec=this.levels[this.level].videoCodec,i.id=t.id),this.hls.trigger(g.default.BUFFER_CODECS,a);for(n in a){i=a[n],A.logger.log("main track:"+n+",container:"+i.container+",codecs[level/parsed]=["+i.levelCodec+"/"+i.codec+"]");var l=i.initSegment;l&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(g.default.BUFFER_APPENDING,{type:n,data:l,parent:"main",content:"initSegment"}))}this.tick()}}},{key:"onFragParsingData",value:function(t){var e=this,r=this.fragCurrent,n=t.frag;if(r&&"main"===t.id&&n.sn===r.sn&&n.level===r.level&&("audio"!==t.type||!this.altAudio)&&this.state===w.PARSING){var i=this.levels[this.level],a=r;if(isNaN(t.endPTS)&&(t.endPTS=t.startPTS+r.duration,t.endDTS=t.startDTS+r.duration),A.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+",dropped:"+(t.dropped||0)),"video"===t.type)if(a.dropped=t.dropped,a.dropped){if(!a.backtracked)return a.backtracked=!0,this.nextLoadPosition=t.startPTS,this.state=w.IDLE,void this.tick();A.logger.warn("Already backtracked on this fragment, appending with the gap")}else a.backtracked=!1;var o=b.default.updateFragPTSDTS(i.details,a.sn,t.startPTS,t.endPTS,t.startDTS,t.endDTS),s=this.hls;s.trigger(g.default.LEVEL_PTS_UPDATED,{details:i.details,level:this.level,drift:o,type:t.type,start:t.startPTS,end:t.endPTS}),[t.data1,t.data2].forEach(function(r){r&&r.length&&e.state===w.PARSING&&(e.appended=!0,e.pendingBuffering=!0,s.trigger(g.default.BUFFER_APPENDING,{type:t.type,data:r,parent:"main",content:"data"}))}),this.tick()}}},{key:"onFragParsed",value:function(t){var e=this.fragCurrent,r=t.frag;e&&"main"===t.id&&r.sn===e.sn&&r.level===e.level&&this.state===w.PARSING&&(this.stats.tparsed=performance.now(),this.state=w.PARSED,this._checkAppendedParsed())}},{key:"onAudioTrackSwitching",value:function(t){var e=!!t.url,r=t.id;if(!e){if(this.mediaBuffer!==this.media){A.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var n=this.fragCurrent;n.loader&&(A.logger.log("switching to main audio track, cancel main fragment load"),n.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=w.IDLE}var i=this.hls;i.trigger(g.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),i.trigger(g.default.AUDIO_TRACK_SWITCHED,{id:r}),this.altAudio=!1}}},{key:"onAudioTrackSwitched",value:function(t){var e=t.id,r=!!this.hls.audioTracks[e].url;if(r){var n=this.videoBuffer;n&&this.mediaBuffer!==n&&(A.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=r,this.tick()}},{key:"onBufferCreated",value:function(t){var e=t.tracks,r=void 0,n=void 0,i=!1;for(var a in e){var o=e[a];"main"===o.id?(n=a,r=o,"video"===a&&(this.videoBuffer=e[a].buffer)):i=!0}i&&r?(A.logger.log("alternate track found, use "+n+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}},{key:"onBufferAppended",value:function(t){if("main"===t.parent){var e=this.state;e!==w.PARSING&&e!==w.PARSED||(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){if(!(this.state!==w.PARSED||this.appended&&this.pendingBuffering)){var t=this.fragCurrent;if(t){var e=this.mediaBuffer?this.mediaBuffer:this.media;A.logger.log("main buffered : "+E.default.toString(e.buffered));var r=this._bufferedFrags.filter(function(t){return f.default.isBuffered(e,(t.startPTS+t.endPTS)/2)});r.push(t),this._bufferedFrags=r.sort(function(t,e){return t.startPTS-e.startPTS}),this.fragPrevious=t;var n=this.stats;n.tbuffered=performance.now(),this.fragLastKbps=Math.round(8*n.total/(n.tbuffered-n.tfirst)),this.hls.trigger(g.default.FRAG_BUFFERED,{stats:n,frag:t,id:"main"}),this.state=w.IDLE}this.tick()}}},{key:"onError",value:function(t){var e=t.frag||this.fragCurrent;if(!e||"main"===e.type){var r=this.media,n=r&&f.default.isBuffered(r,r.currentTime)&&f.default.isBuffered(r,r.currentTime+.5);switch(t.details){case T.ErrorDetails.FRAG_LOAD_ERROR:case T.ErrorDetails.FRAG_LOAD_TIMEOUT:case T.ErrorDetails.KEY_LOAD_ERROR:case T.ErrorDetails.KEY_LOAD_TIMEOUT:if(!t.fatal){var i=this.fragLoadError;i?i++:i=1;var a=this.config;if(i<=a.fragLoadingMaxRetry||n||e.autoLevel&&e.level){this.fragLoadError=i,e.loadCounter=0;var o=Math.min(Math.pow(2,i-1)*a.fragLoadingRetryDelay,a.fragLoadingMaxRetryTimeout);A.logger.warn("mediaController: frag loading failed, retry in "+o+" ms"),this.retryDate=performance.now()+o,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.state=w.FRAG_LOADING_WAITING_RETRY}else A.logger.error("mediaController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=w.ERROR}break;case T.ErrorDetails.FRAG_LOOP_LOADING_ERROR:t.fatal||(n?(this._reduceMaxBufferLength(e.duration),this.state=w.IDLE):e.autoLevel&&0!==e.level||(t.fatal=!0,this.state=w.ERROR));break;case T.ErrorDetails.LEVEL_LOAD_ERROR:case T.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==w.ERROR&&(t.fatal?(this.state=w.ERROR,A.logger.warn("streamController: "+t.details+",switch to "+this.state+" state ...")):this.state===w.WAITING_LEVEL&&(this.state=w.IDLE));break;case T.ErrorDetails.BUFFER_FULL_ERROR:"main"!==t.parent||this.state!==w.PARSING&&this.state!==w.PARSED||(n?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=w.IDLE):(A.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)))}}}},{key:"_reduceMaxBufferLength",value:function(t){var e=this.config;e.maxMaxBufferLength>=t&&(e.maxMaxBufferLength/=2,A.logger.warn("main:reduce max buffer length to "+e.maxMaxBufferLength+"s"),this.fragLoadIdx+=2*e.fragLoadingLoopThreshold)}},{key:"_checkBuffer",value:function(){var t=this.media;if(t&&t.readyState){var e=t.currentTime,r=this.mediaBuffer?this.mediaBuffer:t,n=r.buffered;if(!this.loadedmetadata&&n.length){this.loadedmetadata=!0;var i=t.seeking?e:this.startPosition,a=f.default.isBuffered(r,i);e===i&&a||(A.logger.log("target start position:"+i),a||(i=n.start(0),A.logger.log("target start position not buffered, seek to buffered.start(0) "+i)),A.logger.log("adjust currentTime from "+e+" to "+i),t.currentTime=i)}else if(this.immediateSwitch)this.immediateLevelSwitchEnd();else{var o=f.default.bufferInfo(t,e,0),s=!(t.paused||t.ended||0===t.buffered.length),l=e!==this.lastCurrentTime,u=this.config;if(l)this.stallReported&&(A.logger.warn("playback not stuck anymore @"+e+", after "+Math.round(performance.now()-this.stalled)+"ms"),this.stallReported=!1),this.stalled=void 0,this.nudgeRetry=0;else if(s){var c=performance.now(),d=this.hls;if(this.stalled){var h=c-this.stalled,p=o.len,y=this.nudgeRetry||0;if(p<=.5&&h>1e3*u.lowBufferWatchdogPeriod){this.stallReported||(this.stallReported=!0,A.logger.warn("playback stalling in low buffer @"+e),d.trigger(g.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:p}));var v=o.nextStart,m=v-e;if(v&&m0){this.nudgeRetry=++y;var b=y*u.nudgeOffset;A.logger.log("adjust currentTime from "+t.currentTime+" to next buffered @ "+v+" + nudge "+b),t.currentTime=v+b,this.stalled=void 0,d.trigger(g.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,hole:v+b-e})}}else if(p>.5&&h>1e3*u.highBufferWatchdogPeriod)if(this.stallReported||(this.stallReported=!0,A.logger.warn("playback stalling in high buffer @"+e),d.trigger(g.default.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:p})),this.stalled=void 0,this.nudgeRetry=++y,y"+t),this.hls.trigger(g.default.STREAM_STATE_TRANSITION,{previousState:e,nextState:t})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var t=this.media;if(t){var e=this.getBufferedFrag(t.currentTime);if(e)return e.level}return-1}},{key:"nextBufferedFrag",get:function(){var t=this.media;return t?this.followingBufferedFrag(this.getBufferedFrag(t.currentTime)):null}},{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(t){this._liveSyncPosition=t}}]),e}(v.default);r.default=k},{24:24,30:30,31:31,32:32,34:34,35:35,45:45,50:50,51:51}],13:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r-1&&this.vttFragQueues[this.currentTrackId].length){var t=this.currentlyProcessing=this.vttFragQueues[this.currentTrackId].shift();this.hls.trigger(u.default.FRAG_LOADING,{frag:t})}}},{key:"onSubtitleFragProcessed",value:function(t){t.success&&this.vttFragSNsProcessed[t.frag.trackId].push(t.frag.sn),this.currentlyProcessing=null,this.nextFrag()}},{key:"onError",value:function(t){var e=t.frag;e&&"subtitle"!==e.type||this.currentlyProcessing&&(this.currentlyProcessing=null,this.nextFrag())}},{key:"onSubtitleTracksUpdated",value:function(t){var e=this;d.logger.log("subtitle tracks updated"),this.tracks=t.subtitleTracks,this.clearVttFragQueues(),this.vttFragSNsProcessed={},this.tracks.forEach(function(t){e.vttFragSNsProcessed[t.id]=[]})}},{key:"onSubtitleTrackSwitch",value:function(t){this.currentTrackId=t.id,this.clearVttFragQueues()}},{key:"onSubtitleTrackLoaded",value:function(t){var e=this.vttFragSNsProcessed[t.id],r=this.vttFragQueues[t.id],n=this.currentlyProcessing?this.currentlyProcessing.sn:-1,i=function(t){return e.indexOf(t.sn)>-1},a=function(t){return r.some(function(e){return e.sn===t.sn})};t.details.fragments.forEach(function(e){i(e)||e.sn===n||a(e)||(e.trackId=t.id,r.push(e))}),this.nextFrag()}}]),e}(f.default);r.default=h},{31:31,32:32,50:50}],14:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r=0&&t0;)t.removeCue(t.cues[0])}function l(t,e){return t&&t.label===e.name&&!(t.textTrack1||t.textTrack2)}function u(t,e,r,n){return Math.min(e,n)-Math.max(t,r)}Object.defineProperty(r,"__esModule",{value:!0});var c=function(){function t(t,e){for(var r=0;r=0&&(s[0]=Math.min(s[0],e),s[1]=Math.max(s[1],r),a=!0,l/(r-e)>.5))return}a||i.push([e,r]),this.Cues.newCue(this[t],e,r,n)}},{key:"onInitPtsFound",value:function(t){var e=this;void 0===this.initPTS&&(this.initPTS=t.initPTS),this.unparsedVttFrags.length&&(this.unparsedVttFrags.forEach(function(t){e.onFragLoaded(t)}),this.unparsedVttFrags=[])}},{key:"getExistingTrack",value:function(t){var e=this.media;if(e)for(var r=0;r>>8^255&y^99,t[h]=y,e[y]=h;var v=d[h],m=d[v],b=d[m],_=257*d[y]^16843008*y;n[h]=_<<24|_>>>8,i[h]=_<<16|_>>>16,a[h]=_<<8|_>>>24,o[h]=_,_=16843009*b^65537*m^257*v^16843008*h,l[y]=_<<24|_>>>8,u[y]=_<<16|_>>>16,c[y]=_<<8|_>>>24,f[y]=_,h?(h=v^d[d[d[b^v]]],p^=d[d[p]]):h=p=1}}},{key:"expandKey",value:function(t){for(var e=this.uint8ArrayToUint32Array_(t),r=!0,n=0;n>8|t>>>24}},{key:"decrypt",value:function(t,e,r){for(var n,i,a=this.keySize+6,o=this.invKeySchedule,s=this.invSBox,l=this.invSubMix,u=l[0],c=l[1],f=l[2],d=l[3],h=this.uint8ArrayToUint32Array_(r),p=h[0],g=h[1],y=h[2],v=h[3],m=new Int32Array(t),b=new Int32Array(m.length),_=void 0,E=void 0,T=void 0,A=void 0,w=void 0,k=void 0,S=void 0,R=void 0,L=void 0,O=void 0,P=void 0,C=void 0,D=this.networkToHostOrderSwap;e>>24]^c[k>>16&255]^f[S>>8&255]^d[255&R]^o[n],E=u[k>>>24]^c[S>>16&255]^f[R>>8&255]^d[255&w]^o[n+1],T=u[S>>>24]^c[R>>16&255]^f[w>>8&255]^d[255&k]^o[n+2],A=u[R>>>24]^c[w>>16&255]^f[k>>8&255]^d[255&S]^o[n+3],w=_,k=E,S=T,R=A,n+=4;_=s[w>>>24]<<24^s[k>>16&255]<<16^s[S>>8&255]<<8^s[255&R]^o[n],E=s[k>>>24]<<24^s[S>>16&255]<<16^s[R>>8&255]<<8^s[255&w]^o[n+1],T=s[S>>>24]<<24^s[R>>16&255]<<16^s[w>>8&255]<<8^s[255&k]^o[n+2],A=s[R>>>24]<<24^s[w>>16&255]<<16^s[k>>8&255]<<8^s[255&S]^o[n+3],n+=3,b[e]=D(_^p),b[e+1]=D(A^g),b[e+2]=D(T^y),b[e+3]=D(E^v),p=L,g=O,y=P,v=C,e+=4}return b.buffer}},{key:"destroy",value: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}}]),t}();r.default=a},{}],18:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function t(t,e){for(var r=0;r>>5,(o-=h)>0&&d+h+o<=g);)for(p=m+f*u,y={unit:t.subarray(d+h,d+h+o),pts:p,dts:p},i.samples.push(y),i.len+=o,d+=o+h,f++;d>>6),(s=(60&e[r+2])>>>2)>h.length-1?void t.trigger(Event.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+s}):(u=(1&e[r+2])<<2,u|=(192&e[r+3])>>>6,n.logger.log("manifest codec:"+a+",ADTS data:type:"+o+",sampleingIndex:"+s+"["+h[s]+"Hz],channelConfig:"+u),/firefox/i.test(f)?s>=6?(o=5,c=new Array(4),l=s-3):(o=2,c=new Array(2),l=s):-1!==f.indexOf("android")?(o=2,c=new Array(2),l=s):(o=5,c=new Array(4),a&&(-1!==a.indexOf("mp4a.40.29")||-1!==a.indexOf("mp4a.40.5"))||!a&&s>=6?l=s-3:((a&&-1!==a.indexOf("mp4a.40.2")&&s>=6&&1===u||!a&&1===u)&&(o=2,c=new Array(2)),l=s)),c[0]=o<<3,c[0]|=(14&s)>>1,c[1]|=(1&s)<<7,c[1]|=u<<3,5===o&&(c[1]|=(14&l)>>1,c[2]=(1&l)<<7,c[2]|=8,c[3]=0),{config:c,samplerate:h[s],channelCount:u,codec:"mp4a.40."+o,manifestCodec:d})}};e.exports=a},{30:30,50:50}],22:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function t(t,e){for(var r=0;r0&&null!=e&&null!=e.key&&"AES-128"===e.method){var p=this.decrypter;null==p&&(p=this.decrypter=new c.default(this.observer,this.config));var g,y=this;try{g=performance.now()}catch(t){g=Date.now()}p.decrypt(t,e.key.buffer,e.iv.buffer,function(t){var c;try{c=performance.now()}catch(t){c=Date.now()}y.observer.trigger(s.default.FRAG_DECRYPTED,{stats:{tstart:g,tdecrypt:c}}),y.pushDecrypted(new Uint8Array(t),e,new Uint8Array(r),n,i,a,o,l,u,f,d,h)})}else this.pushDecrypted(new Uint8Array(t),e,new Uint8Array(r),n,i,a,o,l,u,f,d,h)}},{key:"pushDecrypted",value:function(t,e,r,n,i,a,o,u,c,f,h,g){var v=this.demuxer;if(!v||o&&!this.probe(t)){var b=this.observer,E=this.typeSupported,T=this.config,A=[{demux:y.default,remux:m.default},{demux:d.default,remux:m.default},{demux:p.default,remux:_.default}];for(var w in A){var k=A[w],S=k.demux.probe;if(S(t)){var R=this.remuxer=new k.remux(b,T,E,this.vendor);v=new k.demux(b,R,T,E),this.probe=S;break}}if(!v)return void b.trigger(s.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});this.demuxer=v}var L=this.remuxer;(o||u)&&(v.resetInitSegment(r,n,i,f),L.resetInitSegment()),o&&(v.resetTimeStamp(),L.resetTimeStamp(g)),"function"==typeof v.setDecryptData&&v.setDecryptData(e),v.append(t,a,c,h)}}]),t}();r.default=E},{18:18,20:20,27:27,29:29,30:30,32:32,42:42,43:43}],23:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(r,"__esModule",{value:!0});var i=t(22),a=n(i),o=t(32),s=n(o),l=t(50),u=t(1),c=n(u),f=function(t){var e=new c.default;e.trigger=function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i1?r-1:0),i=1;i1?e-1:0),n=1;n1?e-1:0),n=1;nt?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,e=t>>3,t-=e>>3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)}},{key:"readBits",value:function(t){var e=Math.min(this.bitsAvailable,t),r=this.word>>>32-e;return t>32&&a.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<<=e:this.bytesAvailable>0&&this.loadWord(),e=t-e,e>0&&this.bitsAvailable?r<>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"skipEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var t=this.skipLZ();return this.readBits(t+1)-1}},{key:"readEG",value:function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)}},{key:"readBoolean",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"readUShort",value:function(){return this.readBits(16)}},{key:"readUInt",value:function(){return this.readBits(32)}},{key:"skipScalingList",value:function(t){var e,r,n=8,i=8;for(e=0;e=8){return["moof","ftyp","styp"].indexOf(t.bin2str(e.subarray(4,8)))>=0}return!1}},{key:"bin2str",value:function(t){return String.fromCharCode.apply(null,t)}},{key:"findBox",value:function(e,r){var n,i,a,o,s,l=[];if(!r.length)return null;for(n=0;n1?n+i:e.byteLength,a===r[0]&&(1===r.length?l.push(e.subarray(n+8,o)):(s=t.findBox(e.subarray(n+8,o),r.slice(1)),s.length&&(l=l.concat(s)))),n=o;return l}},{key:"parseInitSegment",value:function(e){var r=[];return t.findBox(e,["moov","trak"]).forEach(function(e){var n=t.findBox(e,["tkhd"])[0];if(n){var i=n[0],a=0===i?12:20,o=n[a]<<24|n[a+1]<<16|n[a+2]<<8|n[a+3];o=o<0?4294967296+o:o;var s=t.findBox(e,["mdia","mdhd"])[0];if(s){i=s[0],a=0===i?12:20;var l=s[a]<<24|s[a+1]<<16|s[a+2]<<8|s[a+3],u=t.findBox(e,["mdia","hdlr"])[0];if(u){var c=t.bin2str(u.subarray(8,12)),f={soun:"audio",vide:"video"}[c];f&&(r[o]={timescale:l,type:f},r[f]={timescale:l,id:o})}}}}),r}},{key:"startDTS",value:function(e,r){var n,i,a;return n=t.findBox(r,["moof","traf"]),i=[].concat.apply([],n.map(function(r){return t.findBox(r,["tfhd"]).map(function(n){var i,a,o;return i=n[4]<<24|n[5]<<16|n[6]<<8|n[7],a=e[i].timescale||9e4,o=t.findBox(r,["tfdt"]).map(function(t){var e,r;return e=t[0],r=t[4]<<24|t[5]<<16|t[6]<<8|t[7],1===e&&(r*=Math.pow(2,32),r+=t[8]<<24|t[9]<<16|t[10]<<8|t[11]),r})[0],(o=o||1/0)/a})})),a=Math.min.apply(null,i),isFinite(a)?a:0}}]),t}();r.default=s},{32:32}],28:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r=t.length)return void r();if(!(t[e].unit.length<32)){var n=this.decrypter.isSync();if(this.decryptAacSample(t,e,r,n),!n)return}}}},{key:"getAvcEncryptedData",value:function(t){for(var e=16*Math.floor((t.length-48)/160)+16,r=new Int8Array(e),n=0,i=32;i<=t.length-16;i+=160,n+=16)r.set(t.subarray(i,i+16),n);return r}},{key:"getAvcDecryptedUnit",value:function(t,e){e=new Uint8Array(e);for(var r=0,n=32;n<=t.length-16;n+=160,r+=16)t.set(e.subarray(r,r+16),n);return t}},{key:"decryptAvcSample",value:function(t,e,r,n,i,a){var o=this.discardEPB(i.data),s=this.getAvcEncryptedData(o),l=this;this.decryptBuffer(s.buffer,function(s){i.data=l.getAvcDecryptedUnit(o,s),a||l.decryptAvcSamples(t,e,r+1,n)})}},{key:"decryptAvcSamples",value:function(t,e,r,n){for(;;e++,r=0){if(e>=t.length)return void n();for(var i=t[e].units;!(r>=i.length);r++){var a=i[r];if(!(a.length<=48||1!==a.type&&5!==a.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(t,e,r,n,a,o),!o)return}}}}}]),t}();r.default=s},{18:18}],29:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function t(t,e){for(var r=0;r>4>1){if((s=i+5+t[i+4])===i+188)continue}else s=i+4;switch(o){case m:a&&(T&&(l=R(T))&&L(l,!1),T={data:[],size:0}),T&&(T.data.push(t.subarray(s,i+188)),T.size+=i+188-s);break;case b:a&&(A&&(l=R(A))&&(y.isAAC?O(l):P(l)),A={data:[],size:0}),A&&(A.data.push(t.subarray(s,i+188)),A.size+=i+188-s);break;case _:a&&(w&&(l=R(w))&&C(l),w={data:[],size:0}),w&&(w.data.push(t.subarray(s,i+188)),w.size+=i+188-s);break;case 0:a&&(s+=t[s]+1),E=this._pmtId=k(t,s);break;case E:a&&(s+=t[s]+1);var D=S(t,s,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);m=D.avc,m>0&&(h.id=m),b=D.audio,b>0&&(y.id=b,y.isAAC=D.isAAC),_=D.id3,_>0&&(v.id=_),f&&!d&&(p.logger.log("reparse from beginning"),f=!1,i=-188),d=this.pmtParsed=!0;break;case 17:case 8191:break;default:f=!0}}else this.observer.trigger(u.default.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});T&&(l=R(T))?(L(l,!0),h.pesData=null):h.pesData=T,A&&(l=R(A))?(y.isAAC?O(l):P(l),y.pesData=null):(A&&A.size&&p.logger.log("last AAC PES packet truncated,might overlap between fragments"),y.pesData=A),w&&(l=R(w))?(C(l),v.pesData=null):v.pesData=w,null==this.sampleAes?this.remuxer.remux(y,h,v,this._txtTrack,e,r,n):this.decryptAndRemux(y,h,v,this._txtTrack,e,r,n)}},{key:"decryptAndRemux",value:function(t,e,r,n,i,a,o){if(t.samples&&t.isAAC){var s=this;this.sampleAes.decryptAacSamples(t.samples,0,function(){s.decryptAndRemuxAvc(t,e,r,n,i,a,o)})}else this.decryptAndRemuxAvc(t,e,r,n,i,a,o)}},{key:"decryptAndRemuxAvc",value:function(t,e,r,n,i,a,o){if(e.samples){var s=this;this.sampleAes.decryptAvcSamples(e.samples,0,0,function(){s.remuxer.remux(t,e,r,n,i,a,o)})}else this.remuxer.remux(t,e,r,n,i,a,o)}},{key:"destroy",value:function(){this._initPTS=this._initDTS=void 0,this._duration=0}},{key:"_parsePAT",value:function(t,e){return(31&t[e+10])<<8|t[e+11]}},{key:"_parsePMT",value:function(t,e,r,n){var i,a,o,s,l={audio:-1,avc:-1,id3:-1,isAAC:!0};for(i=(15&t[e+1])<<8|t[e+2],a=e+3+i-4,o=(15&t[e+10])<<8|t[e+11],e+=12+o;e1;){var f=new Uint8Array(c[0].length+c[1].length);f.set(c[0]),f.set(c[1],c[0].length),c[0]=f,c.splice(1,1)}if(e=c[0],1===(e[0]<<16)+(e[1]<<8)+e[2]){if((n=(e[4]<<8)+e[5])&&n>t.size-6)return null;r=e[7],192&r&&(o=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,o>4294967295&&(o-=8589934592),64&r?(s=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2,s>4294967295&&(s-=8589934592),o-s>54e5&&(p.logger.warn(Math.round((o-s)/9e4)+"s delta between PTS and DTS, align them"),o=s)):s=o),i=e[8],l=i+9,t.size-=l,a=new Uint8Array(t.size);for(var d=0,h=c.length;dg){l-=g;continue}e=e.subarray(l),g-=l,l=0}a.set(e,u),u+=g}return n&&(n-=i+3),{data:a,pts:o,dts:s,len:n}}return null}},{key:"pushAccesUnit",value:function(t,e){if(t.units.length&&t.frame){var r=e.samples,n=r.length;!this.config.forceKeyFrameOnDiscontinuity||!0===t.key||e.sps&&(n||this.contiguous)?(t.id=n,r.push(t)):e.dropped++}t.debug.length&&p.logger.log(t.pts+"/"+t.dts+":"+t.debug)}},{key:"_parseAVCPES",value:function(t,e){var r,n,i,a=this,o=this._avcTrack,s=this._parseAVCNALu(t.data),l=this.avcSample;t.data=null,s.forEach(function(e){switch(e.type){case 1:n=!0,l.frame=!0;var s=e.data;if(s.length>4){var u=new f.default(s).readSliceType();2!==u&&4!==u&&7!==u&&9!==u||(l.key=!0)}break;case 5:n=!0,l||(l=a.avcSample=a._createAVCSample(!0,t.pts,t.dts,"")),l.key=!0,l.frame=!0;break;case 6:n=!0,r=new f.default(a.discardEPB(e.data)),r.readUByte();for(var c=0,d=0,h=!1,p=0;!h&&r.bytesAvailable>1;){c=0;do{p=r.readUByte(),c+=p}while(255===p);d=0;do{p=r.readUByte(),d+=p}while(255===p);if(4===c&&0!==r.bytesAvailable){h=!0;if(181===r.readUByte()){if(49===r.readUShort()){if(1195456820===r.readUInt()){if(3===r.readUByte()){var g=r.readUByte(),y=r.readUByte(),v=31&g,m=[g,y];for(i=0;i0){if(e.pts>=t[r-1].pts)t.push(e);else for(var n=r-1;n>=0;n--)if(e.pts=0)n={data:t.subarray(d,o-u-1),type:a},f.push(n);else{var h=this._getLastNalUnit();if(h&&(c&&o<=4-c&&h.state&&(h.data=h.data.subarray(0,h.data.byteLength-c)),(r=o-u-1)>0)){var p=new Uint8Array(h.data.byteLength+r);p.set(h.data,0),p.set(t.subarray(0,r),h.data.byteLength),h.data=p}}o=0&&u>=0&&(n={data:t.subarray(d,s),type:a,state:u},f.push(n)),0===f.length){var g=this._getLastNalUnit();if(g){var y=new Uint8Array(g.data.byteLength+t.byteLength);y.set(g.data,0),y.set(t,g.data.byteLength),g.data=y}}return l.naluState=u,f}},{key:"discardEPB",value:function(t){for(var e,r,n=t.byteLength,i=[],a=1;a1&&(p.logger.log("AAC: align PTS for overlapping frames by "+Math.round((A-y)/90)),y=A)}for(;a+5>>5,(r-=o)>0&&a+o+r<=c);)for(l=y+i*n,f={unit:h.subarray(a+o,a+o+r),pts:l,dts:l},d.samples.push(f),d.len+=r,a+=r+o,i++;a0;)o+=e}},{key:"_onMpegFrame",value:function(t,e,r,n,i,a){var o=1152/r*1e3,s=a+i*o,l=this._audioTrack;l.config=[],l.channelCount=n,l.samplerate=r,l.duration=this._duration,l.samples.push({unit:t,pts:s,dts:s}),l.len+=t.length}},{key:"_onMpegNoise",value:function(t){p.logger.warn("mpeg audio has noise: "+t.length+" bytes")}},{key:"_parseMpeg",value:function(t,e,r,n,i){var a=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],o=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3];if(e+2>r)return-1;if(255===t[e]||224==(224&t[e+1])){if(e+24>r)return-1;var s=t[e+1]>>3&3,l=t[e+1]>>1&3,u=t[e+2]>>4&15,c=t[e+2]>>2&3,f=!!(2&t[e+2]);if(1!==s&&0!==u&&15!==u&&3!==c){var d=3===s?3-l:3===l?3:4,h=1e3*a[14*d+u-1],p=3===s?0:2===s?1:2,g=o[3*p+c],y=f?1:0,v=t[e+3]>>6==3?1:2,m=3===l?(3===s?12:6)*h/g+y<<2:(3===s?144:72)*h/g+y|0;return e+m>r?-1:(this._onMpegFrame&&this._onMpegFrame(t.subarray(e,e+m),h,g,v,n,i),m)}}for(var b=e+2;b=564&&71===t[0]&&71===t[188]&&71===t[376]}}]),t}();r.default=y},{21:21,25:25,28:28,30:30,32:32,50:50}],30:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ErrorTypes={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},r.ErrorDetails={MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"manifestIncompatibleCodecsError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",AUDIO_TRACK_LOAD_ERROR:"audioTrackLoadError",AUDIO_TRACK_LOAD_TIMEOUT:"audioTrackLoadTimeOut",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOOP_LOADING_ERROR:"fragLoopLoadingError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_DECRYPT_ERROR:"fragDecryptError",FRAG_PARSING_ERROR:"fragParsingError",REMUX_ALLOC_ERROR:"remuxAllocError",KEY_LOAD_ERROR:"keyLoadError",KEY_LOAD_TIMEOUT:"keyLoadTimeOut",BUFFER_ADD_CODEC_ERROR:"bufferAddCodecError",BUFFER_APPEND_ERROR:"bufferAppendError",BUFFER_APPENDING_ERROR:"bufferAppendingError",BUFFER_STALLED_ERROR:"bufferStalledError",BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",BUFFER_NUDGE_ON_STALL:"bufferNudgeOnStall",INTERNAL_EXCEPTION:"internalException",WEBVTT_EXCEPTION:"webVTTException"}},{}],31:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(){function t(t,e){for(var r=0;r1?r-1:0),a=1;a=r.start(n)&&e<=r.end(n))return!0;return!1},bufferInfo:function(t,e,r){if(t){var n,i=t.buffered,a=[];for(n=0;nc&&(l[u-1].end=t[s].end):l.push(t[s])}else l.push(t[s])}for(s=0,n=0,i=a=e;s=f&&e=0&&st.endSN)return 0;if(s=e-t.startSN,l=t.fragments,u=l[s],!isNaN(u.startPTS)){var f=Math.abs(u.startPTS-r);isNaN(u.deltaPTS)?u.deltaPTS=f:u.deltaPTS=Math.max(f,u.deltaPTS),r=Math.min(r,u.startPTS),n=Math.max(n,u.endPTS),a=Math.min(a,u.startDTS),o=Math.max(o,u.endDTS)}var d=r-u.start;for(u.start=u.startPTS=r,u.endPTS=n,u.startDTS=a,u.endDTS=o,u.duration=n-r,c=s;c>0;c--)i.updatePTS(l,c,c-1);for(c=s;ce?i.start+i.duration:i.start-a.duration:r>e?(i.duration=o-i.start,i.duration<0&&n.logger.warn("negative duration computed for frag "+i.sn+",level "+i.level+", there should be some duration drift between playlist and fragment!")):(a.duration=i.start-o,a.duration<0&&n.logger.warn("negative duration computed for frag "+a.sn+",level "+a.level+", there should be some duration drift between playlist and fragment!"))}};e.exports=i},{50:50}],36:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};i(this,t);var n=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 a in n)a in r||(r[a]=n[a]);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"');(0,E.enableLogs)(r.debug),this.config=r,this._autoLevelCapping=-1;var o=this.observer=new A.default;o.trigger=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n1?e-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:-1;E.logger.log("startLoad("+t+")"),this.networkControllers.forEach(function(e){e.startLoad(t)})}},{key:"stopLoad",value:function(){E.logger.log("stopLoad"),this.networkControllers.forEach(function(t){t.stopLoad()})}},{key:"swapAudioCodec",value:function(){E.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}},{key:"recoverMediaError",value:function(){E.logger.log("recoverMediaError");var t=this.media;this.detachMedia(),this.attachMedia(t)}},{key:"levels",get:function(){return this.levelController.levels}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(t){E.logger.log("set currentLevel:"+t),this.loadLevel=t,this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(t){E.logger.log("set nextLevel:"+t),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(t){E.logger.log("set loadLevel:"+t),this.levelController.manualLevel=t}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(t){this.levelController.nextLoadLevel=t}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(t){E.logger.log("set firstLevel:"+t),this.levelController.firstLevel=t}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(t){E.logger.log("set startLevel:"+t);var e=this;-1!==t&&(t=Math.max(t,e.minAutoLevel)),e.levelController.startLevel=t}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(t){E.logger.log("set autoLevelCapping:"+t),this._autoLevelCapping=t}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){for(var t=this,e=t.levels,r=t.config.minAutoBitrate,n=e?e.length:0,i=0;ir)return i}return 0}},{key:"maxAutoLevel",get:function(){var t=this,e=t.levels,r=t.autoLevelCapping;return-1===r&&e&&e.length?e.length-1:r}},{key:"nextAutoLevel",get:function(){var t=this;return Math.min(Math.max(t.abrController.nextAutoLevel,t.minAutoLevel),t.maxAutoLevel)},set:function(t){var e=this;e.abrController.nextAutoLevel=Math.max(e.minAutoLevel,t)}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var e=this.audioTrackController;e&&(e.audioTrack=t)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}}]),t}();r.default=k},{1:1,11:11,12:12,2:2,30:30,32:32,38:38,39:39,4:4,40:40,50:50}],37:[function(t,e,r){"use strict";e.exports=t(36).default},{36:36}],38:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(r,"__esModule",{value:!0});var s=function(){function t(t,e){for(var r=0;r>8*(15-r)&255;return e}},{key:"fragmentDecryptdataFromLevelkey",value:function(t,e){var r=t;return t&&t.method&&t.uri&&!t.iv&&(r=new E,r.method=t.method,r.baseuri=t.baseuri,r.reluri=t.reluri,r.iv=this.createInitializationVector(e)),r}},{key:"cloneObj",value:function(t){return JSON.parse(JSON.stringify(t))}},{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=u.default.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(t){this._url=t}},{key:"programDateTime",get:function(){return!this._programDateTime&&this.rawProgramDateTime&&(this._programDateTime=new Date(Date.parse(this.rawProgramDateTime))),this._programDateTime}},{key:"byteRange",get:function(){if(!this._byteRange){var t=this._byteRange=[];if(this.rawByteRange){var e=this.rawByteRange.split("@",2);if(1===e.length){var r=this.lastByteRangeEndOffset;t[0]=r||0}else t[0]=parseInt(e[1]);t[1]=parseInt(e[0])+t[0]}}return this._byteRange}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"decryptdata",get:function(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata}}]),t}(),A=function(t){function e(t){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,f.default.MANIFEST_LOADING,f.default.LEVEL_LOADING,f.default.AUDIO_TRACK_LOADING,f.default.SUBTITLE_TRACK_LOADING));return r.loaders={},r}return a(e,t),s(e,[{key:"destroy",value:function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy()}this.loaders={},h.default.prototype.destroy.call(this)}},{key:"onManifestLoading",value:function(t){this.load(t.url,{type:"manifest"})}},{key:"onLevelLoading",value:function(t){this.load(t.url,{type:"level",level:t.level,id:t.id})}},{key:"onAudioTrackLoading",value:function(t){this.load(t.url,{type:"audioTrack",id:t.id})}},{key:"onSubtitleTrackLoading",value:function(t){this.load(t.url,{type:"subtitleTrack",id:t.id})}},{key:"load",value:function(t,e){var r=this.loaders[e.type];if(r){var n=r.context;if(n&&n.url===t)return void v.logger.trace("playlist request ongoing");v.logger.warn("abort previous loader for type:"+e.type),r.abort()}var i=this.hls.config,a=void 0,o=void 0,s=void 0,l=void 0;"manifest"===e.type?(a=i.manifestLoadingMaxRetry,o=i.manifestLoadingTimeOut,s=i.manifestLoadingRetryDelay,l=i.manifestLoadingMaxRetryTimeout):(a=i.levelLoadingMaxRetry,o=i.levelLoadingTimeOut,s=i.levelLoadingRetryDelay,l=i.levelLoadingMaxRetryTimeout,v.logger.log("loading playlist for "+e.type+" "+(e.level||e.id))),r=this.loaders[e.type]=e.loader=void 0!==i.pLoader?new i.pLoader(i):new i.loader(i),e.url=t,e.responseType="";var u=void 0,c=void 0;u={timeout:o,maxRetry:a,retryDelay:s,maxRetryDelay:l},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},r.load(e,u,c)}},{key:"resolve",value:function(t,e){return u.default.buildAbsoluteURL(e,t,{alwaysNormalize:!0})}},{key:"parseMasterPlaylist",value:function(t,e){var r=[],n=void 0;for(m.lastIndex=0;null!=(n=m.exec(t));){var i={},a=i.attrs=new y.default(n[1]);i.url=this.resolve(n[2],e);var o=a.decimalResolution("RESOLUTION");o&&(i.width=o.width,i.height=o.height),i.bitrate=a.decimalInteger("AVERAGE-BANDWIDTH")||a.decimalInteger("BANDWIDTH"),i.name=a.NAME;var s=a.CODECS;if(s){s=s.split(/[ ,]+/);for(var l=0;l2?(e=r.shift()+".",e+=parseInt(r.shift()).toString(16),e+=("000"+parseInt(r.shift()).toString(16)).substr(-4)):e=t,e}},{key:"parseLevelPlaylist",value:function(t,e,r,n){var i,a,o=0,s=0,l={type:null,version:null,url:e,fragments:[],live:!0,startSN:0},u=new E,c=0,f=null,d=new T;for(_.lastIndex=0;null!==(i=_.exec(t));){var h=i[1];if(h){d.duration=parseFloat(h);var p=(" "+i[2]).slice(1);d.title=p||null,d.tagList.push(p?["INF",h,p]:["INF",h])}else if(i[3]){if(!isNaN(d.duration)){var g=o++;d.type=n,d.start=s,d.levelkey=u,d.sn=g,d.level=r,d.cc=c,d.baseurl=e,d.relurl=(" "+i[3]).slice(1),l.fragments.push(d),f=d,s+=d.duration,d=new T}}else if(i[4]){if(d.rawByteRange=(" "+i[4]).slice(1),f){var m=f.byteRangeEndOffset;m&&(d.lastByteRangeEndOffset=m)}}else if(i[5])d.rawProgramDateTime=(" "+i[5]).slice(1),d.tagList.push(["PROGRAM-DATE-TIME",d.rawProgramDateTime]);else{for(i=i[0].match(/(?:(?:#(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?/),a=1;a=0&&(u.method=S,u.baseuri=e,u.reluri=R,u.key=null,u.iv=L));break;case"START":var O=b,P=new y.default(O),C=P.decimalFloatingPoint("TIME-OFFSET");isNaN(C)||(l.startTimeOffset=C);break;case"MAP":var D=new y.default(b);d.relurl=D.URI,d.rawByteRange=D.BYTERANGE,d.baseurl=e,d.level=r,d.type=n,d.sn="initSegment",l.initSegment=d,d=new T;break;default:v.logger.warn("line parsed but not handled: "+i)}}}return d=f,d&&!d.relurl&&(l.fragments.pop(),s-=d.duration),l.totalduration=s,l.averagetargetduration=s/l.fragments.length,l.endSN=o-1,l}},{key:"loadsuccess",value:function(t,e,r){var n=t.data,i=t.url,a=r.type,o=r.id,s=r.level,l=this.hls;if(this.loaders[a]=void 0,void 0!==i&&0!==i.indexOf("data:")||(i=r.url),e.tload=performance.now(),0===n.indexOf("#EXTM3U"))if(n.indexOf("#EXTINF:")>0){var u="audioTrack"!==a&&"subtitleTrack"!==a,c=isNaN(s)?isNaN(o)?0:o:s,d=this.parseLevelPlaylist(n,i,c,"audioTrack"===a?"audio":"subtitleTrack"===a?"subtitle":"main");d.tload=e.tload,"manifest"===a&&l.trigger(f.default.MANIFEST_LOADED,{levels:[{url:i,details:d}],audioTracks:[],url:i,stats:e}),e.tparsed=performance.now(),d.targetduration?u?l.trigger(f.default.LEVEL_LOADED,{details:d,level:s||0,id:o||0,stats:e}):"audioTrack"===a?l.trigger(f.default.AUDIO_TRACK_LOADED,{details:d,id:o,stats:e}):"subtitleTrack"===a&&l.trigger(f.default.SUBTITLE_TRACK_LOADED,{details:d,id:o,stats:e}):l.trigger(f.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:i,reason:"invalid targetduration"})}else{var h=this.parseMasterPlaylist(n,i);if(h.length){var g=this.parseMasterPlaylistMedia(n,i,"AUDIO"),y=this.parseMasterPlaylistMedia(n,i,"SUBTITLES");if(g.length){var m=!1;g.forEach(function(t){t.url||(m=!0)}),!1===m&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(v.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main"}))}l.trigger(f.default.MANIFEST_LOADED,{levels:h,audioTracks:g,subtitles:y,url:i,stats:e})}else l.trigger(f.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:i,reason:"no level found in manifest"})}else l.trigger(f.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:p.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:i,reason:"no EXTM3U delimiter"})}},{key:"loaderror",value:function(t,e){var r,n,i=e.loader;switch(e.type){case"manifest":r=p.ErrorDetails.MANIFEST_LOAD_ERROR,n=!0;break;case"level":r=p.ErrorDetails.LEVEL_LOAD_ERROR,n=!1;break;case"audioTrack":r=p.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,n=!1}i&&(i.abort(),this.loaders[e.type]=void 0),this.hls.trigger(f.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:r,fatal:n,url:i.url,loader:i,response:t,context:e})}},{key:"loadtimeout",value:function(t,e){var r,n,i=e.loader;switch(e.type){case"manifest":r=p.ErrorDetails.MANIFEST_LOAD_TIMEOUT,n=!0;break;case"level":r=p.ErrorDetails.LEVEL_LOAD_TIMEOUT,n=!1;break;case"audioTrack":r=p.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT,n=!1}i&&(i.abort(),this.loaders[e.type]=void 0),this.hls.trigger(f.default.ERROR,{type:p.ErrorTypes.NETWORK_ERROR,details:r,fatal:n,url:i.url,loader:i,context:e})}}]),e}(h.default);r.default=A},{2:2,30:30,31:31,32:32,44:44,50:50}],41:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r>24&255,e[1]=n>>16&255,e[2]=n>>8&255,e[3]=255&n,e.set(t,4),i=0,n=8;i>24&255,e>>16&255,e>>8&255,255&e,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i,85,196,0,0]))}},{key:"mdia",value:function(e){return t.box(t.types.mdia,t.mdhd(e.timescale,e.duration),t.hdlr(e.type),t.minf(e))}},{key:"mfhd",value:function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))}},{key:"minf",value:function(e){return"audio"===e.type?t.box(t.types.minf,t.box(t.types.smhd,t.SMHD),t.DINF,t.stbl(e)):t.box(t.types.minf,t.box(t.types.vmhd,t.VMHD),t.DINF,t.stbl(e))}},{key:"moof",value:function(e,r,n){return t.box(t.types.moof,t.mfhd(e),t.traf(n,r))}},{key:"moov",value:function(e){for(var r=e.length,n=[];r--;)n[r]=t.trak(e[r]);return t.box.apply(null,[t.types.moov,t.mvhd(e[0].timescale,e[0].duration)].concat(n).concat(t.mvex(e)))}},{key:"mvex",value:function(e){for(var r=e.length,n=[];r--;)n[r]=t.trex(e[r]);return t.box.apply(null,[t.types.mvex].concat(n))}},{key:"mvhd",value:function(e,r){r*=e;var n=Math.floor(r/(a+1)),i=Math.floor(r%(a+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t.box(t.types.mvhd,o)}},{key:"sdtp",value:function(e){var r,n,i=e.samples||[],a=new Uint8Array(4+i.length);for(n=0;n>>8&255),a.push(255&i),a=a.concat(Array.prototype.slice.call(n));for(r=0;r>>8&255),o.push(255&i),o=o.concat(Array.prototype.slice.call(n));var s=t.box(t.types.avcC,new Uint8Array([1,a[3],a[4],a[5],255,224|e.sps.length].concat(a).concat([e.pps.length]).concat(o))),l=e.width,u=e.height,c=e.pixelRatio[0],f=e.pixelRatio[1];return t.box(t.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,255&l,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s,t.box(t.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),t.box(t.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,f>>24,f>>16&255,f>>8&255,255&f])))}},{key:"esds",value:function(t){var e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))}},{key:"mp4a",value:function(e){var r=e.samplerate;return t.box(t.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),t.box(t.types.esds,t.esds(e)))}},{key:"mp3",value:function(e){var r=e.samplerate;return t.box(t.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))}},{key:"stsd",value:function(e){return"audio"===e.type?e.isAAC||"mp3"!==e.codec?t.box(t.types.stsd,t.STSD,t.mp4a(e)):t.box(t.types.stsd,t.STSD,t.mp3(e)):t.box(t.types.stsd,t.STSD,t.avc1(e))}},{key:"tkhd",value:function(e){var r=e.id,n=e.duration*e.timescale,i=e.width,o=e.height,s=Math.floor(n/(a+1)),l=Math.floor(n%(a+1));return t.box(t.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,l>>24,l>>16&255,l>>8&255,255&l,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,255&i,0,0,o>>8&255,255&o,0,0]))}},{key:"traf",value:function(e,r){var n=t.sdtp(e),i=e.id,o=Math.floor(r/(a+1)),s=Math.floor(r%(a+1));return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),t.box(t.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,s>>24,s>>16&255,s>>8&255,255&s])),t.trun(e,n.length+16+20+8+16+8+8),n)}},{key:"trak",value:function(e){return e.duration=e.duration||4294967295,t.box(t.types.trak,t.tkhd(e),t.mdia(e))}},{key:"trex",value:function(e){var r=e.id;return t.box(t.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(e,r){var n,i,a,o,s,l,u=e.samples||[],c=u.length,f=12+16*c,d=new Uint8Array(f);for(r+=8+f,d.set([0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,255&c,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),n=0;n>>24&255,a>>>16&255,a>>>8&255,255&a,o>>>24&255,o>>>16&255,o>>>8&255,255&o,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,61440&s.degradPrio,15&s.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*n);return t.box(t.types.trun,d)}},{key:"initSegment",value:function(e){t.types||t.init();var r,n=t.moov(e);return r=new Uint8Array(t.FTYP.byteLength+n.byteLength),r.set(t.FTYP),r.set(n,t.FTYP.byteLength),r}}]),t}();r.default=o},{}],42:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function t(t,e){for(var r=0;r-1&&o&&!o.match("CriOS"),this.ISGenerated=!1}return a(t,[{key:"destroy",value:function(){}},{key:"resetTimeStamp",value:function(t){this._initPTS=this._initDTS=t}},{key:"resetInitSegment",value:function(){this.ISGenerated=!1}},{key:"remux",value:function(t,e,r,n,i,a,o){if(this.ISGenerated||this.generateIS(t,e,i),this.ISGenerated)if(t.samples.length){var s=this.remuxAudio(t,i,a,o);if(e.samples.length){var l=void 0;s&&(l=s.endPTS-s.startPTS),this.remuxVideo(e,i,a,l)}}else{var c=void 0;e.samples.length&&(c=this.remuxVideo(e,i,a)),c&&t.codec&&this.remuxEmptyAudio(t,i,a,c)}r.samples.length&&this.remuxID3(r,i),n.samples.length&&this.remuxText(n,i),this.observer.trigger(u.default.FRAG_PARSED)}},{key:"generateIS",value:function(t,e,r){var n,i,a=this.observer,o=t.samples,s=e.samples,l=this.typeSupported,f="audio/mp4",p={},g={tracks:p},y=void 0===this._initPTS;if(y&&(n=i=1/0),t.config&&o.length&&(t.timescale=t.samplerate,c.logger.log("audio sampling rate : "+t.samplerate),t.isAAC||(l.mpeg?(f="audio/mpeg",t.codec=""):l.mp3&&(t.codec="mp3")),p.audio={container:f,codec:t.codec,initSegment:!t.isAAC&&l.mpeg?new Uint8Array:d.default.initSegment([t]),metadata:{channelCount:t.channelCount}},y&&(n=i=o[0].pts-t.inputTimeScale*r)),e.sps&&e.pps&&s.length){var v=e.inputTimeScale;e.timescale=v,p.video={container:"video/mp4",codec:e.codec,initSegment:d.default.initSegment([e]),metadata:{width:e.width,height:e.height}},y&&(n=Math.min(n,s[0].pts-v*r),i=Math.min(i,s[0].dts-v*r),this.observer.trigger(u.default.INIT_PTS_FOUND,{initPTS:n}))}Object.keys(p).length?(a.trigger(u.default.FRAG_PARSING_INIT_SEGMENT,g),this.ISGenerated=!0,y&&(this._initPTS=n,this._initDTS=i)):a.trigger(u.default.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})}},{key:"remuxVideo",value:function(t,e,r,n){var i,a,o,s,l,f,p,g=8,y=t.timescale,v=t.samples,m=[],b=v.length,_=this._PTSNormalize,E=this._initDTS;v.sort(function(t,e){var r=t.dts-e.dts,n=t.pts-e.pts;return r||(n||t.id-e.id)});var T=v.reduce(function(t,e){return Math.max(Math.min(t,e.pts-e.dts),-18e3)},0);if(T<0){c.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(T/90)+" ms to overcome this issue");for(var A=0;A1?c.logger.log("AVC:"+S+" ms hole between fragments detected,filling it"):S<-1&&c.logger.log("AVC:"+-S+" ms overlapping between fragments detected"),l=w,v[0].dts=l+E,s=Math.max(s-S,w),v[0].pts=s+E,c.logger.log("Video/PTS/DTS adjusted: "+Math.round(s/90)+"/"+Math.round(l/90)+",delta:"+S+" ms")),k=v[v.length-1],p=Math.max(_(k.dts-E,w),0),f=Math.max(_(k.pts-E,w),0),f=Math.max(f,p);var R=this.isSafari;R&&(i=Math.round((p-l)/(v.length-1)));for(var L=0,O=0,P=0;P0?B-1:B].dts;if(W.stretchShortVideoTrack){var X=W.maxBufferHole,Z=W.maxSeekHole,J=Math.floor(Math.min(X,Z)*y),Q=(n?s+n*y:this.nextAudioPts)-U.pts;Q>J?(i=Q-q,i<0&&(i=q),c.logger.log("It is approximately "+Q/90+" ms to the next segment; using duration "+i/90+" ms for the last video frame.")):i=q}else i=q}Y=Math.round(U.pts-U.dts)}m.push({size:G,duration:i,cts:Y,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:U.key?2:1,isNonSync:U.key?0:1}})}this.nextAvcDts=p+i;var tt=t.dropped;if(t.len=0,t.nbNalu=0,t.dropped=0,m.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var et=m[0].flags;et.dependsOn=2,et.isNonSync=0}t.samples=m,o=d.default.moof(t.sequenceNumber++,l,t),t.samples=[];var rt={data1:o,data2:a,startPTS:s/y,endPTS:(f+i)/y,startDTS:l/y,endDTS:this.nextAvcDts/y,type:"video",nb:m.length,dropped:tt};return this.observer.trigger(u.default.FRAG_PARSING_DATA,rt),rt}},{key:"remuxAudio",value:function(t,e,r,n){var i,a,o,l,f,p,g,y,v,m,b,_,E,T,A,w,k=t.inputTimeScale,S=t.timescale,R=k/S,L=t.isAAC?1024:1152,O=L*R,P=this._PTSNormalize,C=this._initDTS,D=!t.isAAC&&this.typeSupported.mpeg,I=D?0:8,x=[],N=[];if(t.samples.sort(function(t,e){return t.pts-e.pts}),N=t.samples,w=this.nextAudioPts,r|=N.length&&w&&(Math.abs(e-w/k)<.1||Math.abs(N[0].pts-w-C)<20*O),r||(w=e*k),n&&t.isAAC)for(var M=0,F=w;M=O&&F){var G=Math.round(j/O);c.logger.warn("Injecting "+G+" audio frame @ "+(F/k).toFixed(3)+"s due to "+1e3*j/k+" ms gap.");for(var Y=0;Y0)z=Math.round((_-w)/O),c.logger.log($+" ms hole between AAC samples detected,filling it"),z>0&&(T=s.default.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),T||(T=l.subarray()),t.len+=z*T.length);else if($<-12){c.logger.log(-$+" ms overlapping between AAC samples detected, drop frame"),t.len-=l.byteLength;continue}_=E=w}if(g=Math.max(0,_),y=Math.max(0,E),!(t.len>0))return;var H=D?t.len:t.len+8;try{f=new Uint8Array(H)}catch(t){return void this.observer.trigger(u.default.ERROR,{type:h.ErrorTypes.MUX_ERROR,details:h.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:H,reason:"fail allocating audio mdat "+H})}D||(i=new DataView(f.buffer),i.setUint32(0,H),f.set(d.default.types.mdat,4));for(var W=0;W=2&&(X=x[Z-2].duration,o.duration=X),Z){this.nextAudioPts=_+R*X,t.len=0,t.samples=x,p=D?new Uint8Array:d.default.moof(t.sequenceNumber++,y/R,t),t.samples=[];var J={data1:p,data2:f,startPTS:g/k,endPTS:this.nextAudioPts/k,startDTS:y/k,endDTS:(E+R*X)/k,type:"audio",nb:Z};return this.observer.trigger(u.default.FRAG_PARSING_DATA,J),J}return null}},{key:"remuxEmptyAudio",value:function(t,e,r,n){var i=t.inputTimeScale,a=t.samplerate?t.samplerate:i,o=i/a,l=this.nextAudioPts,u=(void 0!==l?l:n.startDTS*i)+this._initDTS,f=n.endDTS*i+this._initDTS,d=1024*o,h=Math.ceil((f-u)/d),p=s.default.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(c.logger.warn("remux empty Audio"),!p)return void c.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");for(var g=[],y=0;y4294967296;)t+=r;return t}}]),t}();r.default=p},{30:30,32:32,33:33,41:41,50:50}],43:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;rNumber.MAX_SAFE_INTEGER?1/0:e}},{key:"hexadecimalInteger",value:function(t){if(this[t]){var e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var r=new Uint8Array(e.length/2),n=0;nNumber.MAX_SAFE_INTEGER?1/0:e}},{key:"decimalFloatingPoint",value:function(t){return parseFloat(this[t])}},{key:"enumeratedString",value:function(t){return this[t]}},{key:"decimalResolution",value:function(t){var e=a.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}}}],[{key:"parseAttrList",value:function(t){var e,r={};for(o.lastIndex=0;null!==(e=o.exec(t));){var n=e[2];0===n.indexOf('"')&&n.lastIndexOf('"')===n.length-1&&(n=n.slice(1,-1)),r[e[1]]=n}return r}}]),t}();r.default=s},{}],45:[function(t,e,r){"use strict";var n={search:function(t,e){for(var r=0,n=t.length-1,i=null,a=null;r<=n;){i=(r+n)/2|0,a=t[i];var o=e(a);if(o>0)r=i+1;else{if(!(o<0))return a;n=i-1}}return null}};e.exports=n},{}],46:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r=r&&console.log(this.time+" ["+t+"] "+e)}},g=function(t){for(var e=[],r=0;rl&&(p.log("ERROR","Too large cursor position "+this.pos),this.pos=l)}},{key:"moveCursor",value:function(t){var e=this.pos+t;if(t>1)for(var r=this.pos+1;r=144&&this.backSpace();var e=o(t);if(this.pos>=l)return void p.log("ERROR","Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!");this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1)}},{key:"clearFromPos",value:function(t){var e;for(e=t;e0&&(r=t?"["+e.join(" | ")+"]":e.join("\n")),r}},{key:"getTextAndFormat",value:function(){return this.rows}}]),t}(),_=function(){function t(e,r){n(this,t),this.chNr=e,this.outputFilter=r,this.mode=null,this.verbose=0,this.displayedMemory=new b,this.nonDisplayedMemory=new b,this.lastOutputScreen=new b,this.currRollUpRow=this.displayedMemory.rows[s-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}return i(t,[{key:"reset",value:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[s-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null}},{key:"getHandler",value:function(){return this.outputFilter}},{key:"setHandler",value:function(t){this.outputFilter=t}},{key:"setPAC",value:function(t){this.writeScreen.setPAC(t)}},{key:"setBkgData",value:function(t){this.writeScreen.setBkgData(t)}},{key:"setMode",value:function(t){t!==this.mode&&(this.mode=t,p.log("INFO","MODE="+t),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)}},{key:"insertChars",value:function(t){for(var e=0;e=46,e.italics)e.foreground="white";else{var r=Math.floor(t/2)-16,n=["white","green","blue","cyan","red","yellow","magenta"];e.foreground=n[r]}p.log("INFO","MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)}},{key:"outputDataUpdate",value:function(){var t=p.time;null!==t&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(t,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}},{key:"cueSplitAtTime",value:function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))}}]),t}(),E=function(){function t(e,r,i){n(this,t),this.field=e||1,this.outputs=[r,i],this.channels=[new _(1,r),new _(2,i)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}return i(t,[{key:"getHandler",value:function(t){return this.channels[t].getHandler()}},{key:"setHandler",value:function(t,e){this.channels[t].setHandler(e)}},{key:"addData",value:function(t,e){var r,n,i,a=!1;this.lastTime=t,p.setTime(t);for(var o=0;o ("+g([n,i])+")"),r=this.parseCmd(n,i),r||(r=this.parseMidrow(n,i)),r||(r=this.parsePAC(n,i)),r||(r=this.parseBackgroundAttributes(n,i)),!r&&(a=this.parseChars(n,i)))if(this.currChNr&&this.currChNr>=0){var s=this.channels[this.currChNr-1];s.insertChars(a)}else p.log("WARNING","No channel found yet. TEXT-MODE?");r?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,p.log("WARNING","Couldn't parse cleaned data "+g([n,i])+" orig: "+g([e[o],e[o+1]])))}else this.dataCounters.padding+=2}},{key:"parseCmd",value:function(t,e){var r=null,n=(20===t||28===t)&&32<=e&&e<=47,i=(23===t||31===t)&&33<=e&&e<=35;if(!n&&!i)return!1;if(t===this.lastCmdA&&e===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,p.log("DEBUG","Repeated command ("+g([t,e])+") is dropped"),!0;r=20===t||23===t?1:2;var a=this.channels[r-1];return 20===t||28===t?32===e?a.ccRCL():33===e?a.ccBS():34===e?a.ccAOF():35===e?a.ccAON():36===e?a.ccDER():37===e?a.ccRU(2):38===e?a.ccRU(3):39===e?a.ccRU(4):40===e?a.ccFON():41===e?a.ccRDC():42===e?a.ccTR():43===e?a.ccRTD():44===e?a.ccEDM():45===e?a.ccCR():46===e?a.ccENM():47===e&&a.ccEOC():a.ccTO(e-32),this.lastCmdA=t,this.lastCmdB=e,this.currChNr=r,!0}},{key:"parseMidrow",value:function(t,e){var r=null;if((17===t||25===t)&&32<=e&&e<=47){if((r=17===t?1:2)!==this.currChNr)return p.log("ERROR","Mismatch channel in midrow parsing"),!1;return this.channels[r-1].ccMIDROW(e),p.log("DEBUG","MIDROW ("+g([t,e])+")"),!0}return!1}},{key:"parsePAC",value:function(t,e){var r=null,n=null,i=(17<=t&&t<=23||25<=t&&t<=31)&&64<=e&&e<=127,a=(16===t||24===t)&&64<=e&&e<=95;if(!i&&!a)return!1;if(t===this.lastCmdA&&e===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;r=t<=23?1:2,n=64<=e&&e<=95?1===r?u[t]:f[t]:1===r?c[t]:d[t];var o=this.interpretPAC(n,e);return this.channels[r-1].setPAC(o),this.lastCmdA=t,this.lastCmdB=e,this.currChNr=r,!0}},{key:"interpretPAC",value:function(t,e){var r=e,n={color:null,italics:!1,indent:null,underline:!1,row:t};return r=e>95?e-96:e-64,n.underline=1==(1&r),r<=13?n.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(n.italics=!0,n.color="white"):n.indent=4*Math.floor((r-16)/2),n}},{key:"parseChars",value:function(t,e){var r=null,n=null,i=null;if(t>=25?(r=2,i=t-8):(r=1,i=t),17<=i&&i<=19){var a=e;a=17===i?e+80:18===i?e+112:e+144,p.log("INFO","Special char '"+o(a)+"' in channel "+r),n=[a]}else 32<=t&&t<=127&&(n=0===e?[t]:[t,e]);if(n){var s=g(n);p.log("DEBUG","Char codes = "+s.join(",")),this.lastCmdA=null,this.lastCmdB=null}return n}},{key:"parseBackgroundAttributes",value:function(t,e){var r,n,i,a,o=(16===t||24===t)&&32<=e&&e<=47,s=(23===t||31===t)&&45<=e&&e<=47;return!(!o&&!s)&&(r={},16===t||24===t?(n=Math.floor((e-32)/2),r.background=h[n],e%2==1&&(r.background=r.background+"_semi")):45===e?r.background="transparent":(r.foreground="black",47===e&&(r.underline=!0)),i=t<24?1:2,a=this.channels[i-1],a.setBkgData(r),this.lastCmdA=null,this.lastCmdB=null,!0)}},{key:"reset",value:function(){for(var t=0;t=16?l--:l++,navigator.userAgent.match(/Firefox\//)?o.line=f+1:o.line=f>7?f-2:f+1,o.align="left",o.position=Math.max(0,Math.min(100,l/32*100+(navigator.userAgent.match(/Firefox\//)?50:0))),t.addCue(o)}}};e.exports=i},{53:53}],48:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r=this.minWeight_}},{key:"getEstimate",value:function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}},{key:"destroy",value:function(){}}]),t}();r.default=s},{49:49}],49:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r "+e}function a(t){var e=self.console[t];return e?function(){for(var r=arguments.length,n=Array(r),a=0;a1?e-1:0),n=1;n100)throw new Error("Position must be between 0 and 100.");_=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",r({},u,{get:function(){return E},set:function(t){var r=e(t);if(!r)throw new SyntaxError("An invalid or illegal string was specified.");E=r,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",r({},u,{get:function(){return T},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");T=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",r({},u,{get:function(){return A},set:function(t){var r=e(t);if(!r)throw new SyntaxError("An invalid or illegal string was specified.");A=r,this.hasBeenReset=!0}})),s.displayState=void 0,l)return s}if("undefined"!=typeof window&&window.VTTCue)return window.VTTCue;var i="auto",a={"":!0,lr:!0,rl:!0},o={start:!0,middle:!0,end:!0,left:!0,right:!0};return n.prototype.getCueAsHTML=function(){return window.WebVTT.convertCueToDOMTree(window,this.text)},n}()},{}],53:[function(t,e,r){"use strict";function n(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new f,this.regionList=[]}function i(t){function e(t,e,r,n){return 3600*(0|t)+60*(0|e)+(0|r)+(0|n)/1e3}var r=t.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return r?r[3]?e(r[1],r[2],r[3].replace(":",""),r[4]):r[1]>59?e(r[1],r[2],0,r[4]):e(0,r[1],r[2],r[4]):null}function a(){this.values=Object.create(null)}function o(t,e,r,n){var i=n?t.split(n):[t];for(var a in i)if("string"==typeof i[a]){var o=i[a].split(r);if(2===o.length){var s=o[0],l=o[1];e(s,l)}}}function s(t,e,r){function n(){var e=i(t);if(null===e)throw new Error("Malformed timestamp: "+l);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function s(){t=t.replace(/^\s+/,"")}var l=t;if(s(),e.startTime=n(),s(),"--\x3e"!==t.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+l);t=t.substr(3),s(),e.endTime=n(),s(),function(t,e){var n=new a;o(t,function(t,e){switch(t){case"region":for(var i=r.length-1;i>=0;i--)if(r[i].id===e){n.set(t,r[i].region);break}break;case"vertical":n.alt(t,e,["rl","lr"]);break;case"line":var a=e.split(","),o=a[0];n.integer(t,o),n.percent(t,o)&&n.set("snapToLines",!1),n.alt(t,o,["auto"]),2===a.length&&n.alt("lineAlign",a[1],["start",h,"end"]);break;case"position":a=e.split(","),n.percent(t,a[0]),2===a.length&&n.alt("positionAlign",a[1],["start",h,"end","line-left","line-right","auto"]);break;case"size":n.percent(t,e);break;case"align":n.alt(t,e,["start",h,"end","left","right"])}},/:/,/\s/),e.region=n.get("region",null),e.vertical=n.get("vertical","");var i=n.get("line","auto");"auto"===i&&-1===d.line&&(i=-1),e.line=i,e.lineAlign=n.get("lineAlign","start"),e.snapToLines=n.get("snapToLines",!0),e.size=n.get("size",100),e.align=n.get("align",h);var s=n.get("position","auto");"auto"===s&&50===d.position&&(s="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=s}(t,e)}function l(t){return t.replace(//gi,"\n")}Object.defineProperty(r,"__esModule",{value:!0}),r.fixLineBreaks=void 0;var u=t(52),c=function(t){return t&&t.__esModule?t:{default:t}}(u),f=function(){return{decode:function(t){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}};a.prototype={set:function(t,e){this.get(t)||""===e||(this.values[t]=e)},get:function(t,e,r){return r?this.has(t)?this.values[t]:e[r]:this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,r){for(var n=0;n=0&&e<=100)&&(this.set(t,e),!0)}};var d=new c.default(0,0,0),h="middle"===d.align?"middle":"center";n.prototype={parse:function(t){function e(){var t=r.buffer,e=0;for(t=l(t);e9?parseInt(t.substr(0,t.indexOf(":"))):0;return isNaN(e)||isNaN(r)||isNaN(n)||isNaN(i)?-1:(e+=1e3*r,e+=6e4*n,e+=36e5*i)},o=function(t,e,r){var n=t[e],i=t[n.prevCC];if(!i||!i.new&&n.new)return t.ccOffset=t.presentationOffset=n.start,void(n.new=!1);for(;i&&i.new;)t.ccOffset+=n.start-i.start,n.new=!1,n=i,i=t[n.prevCC];t.presentationOffset=r},s={parse:function(t,e,r,n,s,l){var u=String.fromCharCode.apply(null,new Uint8Array(t)).trim().replace(/\r\n|\n\r|\n|\r/g,"\n").split("\n"),c="00:00.000",f=0,d=0,h=0,p=[],g=void 0,y=!0,v=new i.default;v.oncue=function(t){var e=r[n],i=r.ccOffset;e&&e.new&&(d?i=r.ccOffset=e.start:o(r,n,h)),h&&!d&&(i=h+r.ccOffset-r.presentationOffset),t.startTime+=i-d,t.endTime+=i-d,t.text=decodeURIComponent(escape(t.text)),t.endTime>0&&p.push(t)},v.onparsingerror=function(t){g=t},v.onflush=function(){if(g&&l)return void l(g);s(p)},u.forEach(function(t){if(y){if(t.startsWith("X-TIMESTAMP-MAP=")){y=!1,t.substr(16).split(",").forEach(function(t){t.startsWith("LOCAL:")?c=t.substr(6):t.startsWith("MPEGTS:")&&(f=parseInt(t.substr(7)))});try{e=e<0?e+8589934592:e,f-=e,d=a(c)/1e3,h=f/9e4,-1===d&&(g=new Error("Malformed X-TIMESTAMP-MAP: "+t))}catch(e){g=new Error("Malformed X-TIMESTAMP-MAP: "+t)}return}""===t&&(y=!1)}v.parse(t+"\n")}),v.flush()}};e.exports=s},{53:53}],55:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r=2)if(window.clearTimeout(this.requestTimeout),0===n.tfirst&&(n.tfirst=Math.max(performance.now(),n.trequest)),4===r){var s=e.status;if(s>=200&&s<300){n.tload=Math.max(n.tfirst,performance.now());var l=void 0,u=void 0;"arraybuffer"===i.responseType?(l=e.response,u=l.byteLength):(l=e.responseText,u=l.length),n.loaded=n.total=u;var c={url:e.responseURL,data:l};this.callbacks.onSuccess(c,n,i)}else n.retry>=o.maxRetry||s>=400&&s<499?(a.logger.error(s+" while loading "+i.url),this.callbacks.onError({code:s,text:e.statusText},i)):(a.logger.warn(s+" while loading "+i.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,o.maxRetryDelay),n.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),o.timeout)}},{key:"loadtimeout",value:function(){a.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context)}},{key:"loadprogress",value:function(t){var e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total);var r=this.callbacks.onProgress;r&&r(e,this.context,null)}}]),t}();r.default=o},{50:50}]},{},[37])(37)})},function(t,e){t.exports='
\n
\n <% var renderBar = function(name) { %>\n
>\n
>\n
>
\n
>
\n
>
\n
\n
>\n
>
\n
\n
\n <% }; %>\n <% var renderSegmentedBar = function(name, segments) {\n segments = segments || 10; %>\n
>\n <% for (var i = 0; i < segments; i++) { %>\n
>
\n <% } %>\n
\n <% }; %>\n <% var renderDrawer = function(name, renderContent) { %>\n
>\n
>\n
>
\n >\n
\n <% renderContent(name); %>\n
\n <% }; %>\n <% var renderIndicator = function(name) { %>\n
>
\n <% }; %>\n <% var renderButton = function(name) { %>\n \n <% }; %>\n <% var templates = {\n bar: renderBar,\n segmentedBar: renderSegmentedBar,\n };\n var render = function(settingsList) {\n settingsList.forEach(function(setting) {\n if(setting === "seekbar") {\n renderBar(setting);\n } else if (setting === "volume") {\n renderDrawer(setting, settings.volumeBarTemplate ? templates[settings.volumeBarTemplate] : function(name) { return renderSegmentedBar(name); });\n } else if (setting === "duration" || setting === "position") {\n renderIndicator(setting);\n } else {\n renderButton(setting);\n }\n });\n }; %>\n <% if (settings.default && settings.default.length) { %>\n
\n <% render(settings.default); %>\n
\n <% } %>\n <% if (settings.left && settings.left.length) { %>\n
\n <% render(settings.left); %>\n
\n <% } %>\n <% if (settings.right && settings.right.length) { %>\n
\n <% render(settings.right); %>\n
\n <% } %>\n
\n'},function(t,e){t.exports='\n\n\n\n\n\n\n\n\n\n\n'},function(t,e){t.exports="\n

<%=message%>

\n"},function(t,e){t.exports='

<%= live %>
\n\n'},function(t,e){t.exports='
\n'},function(t,e){t.exports="\n\n"},function(t,e){t.exports="
\n"},function(t,e){t.exports="
>\n<% if(typeof imageLink !== 'undefined') { %>\n\">\n<% } %>\n\">\n<% if(typeof imageLink !== 'undefined') { %>\n\n<% } %>\n
\n"},function(t,e){e.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,c=-7,f=r?i-1:0,d=r?-1:1,h=t[e+f];for(f+=d,a=h&(1<<-c)-1,h>>=-c,c+=s;c>0;a=256*a+t[e+f],f+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=d,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),a-=u}return(h?-1:1)*o*Math.pow(2,a-n)},e.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),e+=o+f>=1?d/l:d*Math.pow(2,1-f),e*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+h]=255&s,h+=p,s/=256,i-=8);for(o=o<0;t[r+h]=255&o,h+=p,o/=256,u-=8);t[r+h-p]|=128*g}},function(t,e,r){(function(t,r){function n(t,e){for(var r=-1,n=null==t?0:t.length,i=0,a=[];++r-1}function T(t,e){var r=this.__data__,n=U(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function A(t){var e=-1,r=null==t?0:t.length;for(this.clear();++eu))return!1;var f=o.get(t);if(f&&o.get(e))return f==e;var d=-1,h=!0,p=r&_t?new O:void 0;for(o.set(t,e),o.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=Et}function dt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ht(t){return null!=t&&"object"==typeof t}function pt(t){return lt(t)?B(t):H(t)}function gt(){return[]}function yt(){return!1}var vt=200,mt="__lodash_hash_undefined__",bt=1,_t=2,Et=9007199254740991,Tt="[object Arguments]",At="[object Array]",wt="[object AsyncFunction]",kt="[object Boolean]",St="[object Date]",Rt="[object Error]",Lt="[object Function]",Ot="[object GeneratorFunction]",Pt="[object Map]",Ct="[object Number]",Dt="[object Null]",It="[object Object]",xt="[object Proxy]",Nt="[object RegExp]",Mt="[object Set]",Ft="[object String]",Bt="[object Symbol]",Ut="[object Undefined]",jt="[object ArrayBuffer]",Gt="[object DataView]",Yt=/^\[object .+?Constructor\]$/,Vt=/^(?:0|[1-9]\d*)$/,Kt={};Kt["[object Float32Array]"]=Kt["[object Float64Array]"]=Kt["[object Int8Array]"]=Kt["[object Int16Array]"]=Kt["[object Int32Array]"]=Kt["[object Uint8Array]"]=Kt["[object Uint8ClampedArray]"]=Kt["[object Uint16Array]"]=Kt["[object Uint32Array]"]=!0,Kt[Tt]=Kt[At]=Kt[jt]=Kt[kt]=Kt[Gt]=Kt[St]=Kt[Rt]=Kt[Lt]=Kt[Pt]=Kt[Ct]=Kt[It]=Kt[Nt]=Kt[Mt]=Kt[Ft]=Kt["[object WeakMap]"]=!1;var $t="object"==typeof t&&t&&t.Object===Object&&t,zt="object"==typeof self&&self&&self.Object===Object&&self,Ht=$t||zt||Function("return this")(),Wt="object"==typeof e&&e&&!e.nodeType&&e,qt=Wt&&"object"==typeof r&&r&&!r.nodeType&&r,Xt=qt&&qt.exports===Wt,Zt=Xt&&$t.process,Jt=function(){try{return Zt&&Zt.binding&&Zt.binding("util")}catch(t){}}(),Qt=Jt&&Jt.isTypedArray,te=Array.prototype,ee=Function.prototype,re=Object.prototype,ne=Ht["__core-js_shared__"],ie=ee.toString,ae=re.hasOwnProperty,oe=function(){var t=/[^.]+$/.exec(ne&&ne.keys&&ne.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),se=re.toString,le=RegExp("^"+ie.call(ae).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ue=Xt?Ht.Buffer:void 0,ce=Ht.Symbol,fe=Ht.Uint8Array,de=re.propertyIsEnumerable,he=te.splice,pe=ce?ce.toStringTag:void 0,ge=Object.getOwnPropertySymbols,ye=ue?ue.isBuffer:void 0,ve=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),me=Q(Ht,"DataView"),be=Q(Ht,"Map"),_e=Q(Ht,"Promise"),Ee=Q(Ht,"Set"),Te=Q(Ht,"WeakMap"),Ae=Q(Object,"create"),we=ot(me),ke=ot(be),Se=ot(_e),Re=ot(Ee),Le=ot(Te),Oe=ce?ce.prototype:void 0,Pe=Oe?Oe.valueOf:void 0;f.prototype.clear=d,f.prototype.delete=h,f.prototype.get=p,f.prototype.has=g,f.prototype.set=y,v.prototype.clear=m,v.prototype.delete=b,v.prototype.get=_,v.prototype.has=E,v.prototype.set=T,A.prototype.clear=w,A.prototype.delete=k,A.prototype.get=S,A.prototype.has=R,A.prototype.set=L,O.prototype.add=O.prototype.push=P,O.prototype.has=C,D.prototype.clear=I,D.prototype.delete=x,D.prototype.get=N,D.prototype.has=M,D.prototype.set=F;var Ce=ge?function(t){return null==t?[]:(t=Object(t),n(ge(t),function(e){return de.call(t,e)}))}:gt,De=G;(me&&De(new me(new ArrayBuffer(1)))!=Gt||be&&De(new be)!=Pt||_e&&"[object Promise]"!=De(_e.resolve())||Ee&&De(new Ee)!=Mt||Te&&"[object WeakMap]"!=De(new Te))&&(De=function(t){var e=G(t),r=e==It?t.constructor:void 0,n=r?ot(r):"";if(n)switch(n){case we:return Gt;case ke:return Pt;case Se:return"[object Promise]";case Re:return Mt;case Le:return"[object WeakMap]"}return e});var Ie=Y(function(){return arguments}())?Y:function(t){return ht(t)&&ae.call(t,"callee")&&!de.call(t,"callee")},xe=Array.isArray,Ne=ye||yt,Me=Qt?function(t){return function(e){return t(e)}}(Qt):z;r.exports=ut}).call(e,r(12),r(23)(t))},function(t,e){function r(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function n(t){return!!t&&"object"==typeof t}function i(t){if(!n(t)||f.call(t)!=a||r(t))return!1;var e=d(t);if(null===e)return!0;var i=u.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&l.call(i)==c}var a="[object Object]",o=Function.prototype,s=Object.prototype,l=o.toString,u=s.hasOwnProperty,c=l.call(Object),f=s.toString,d=function(t,e){return function(r){return t(e(r))}}(Object.getPrototypeOf,Object);t.exports=i},function(t,e){function r(t,e){var r;if("function"!=typeof e)throw new TypeError(c);return t=l(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}function n(t){return r(2,t)}function i(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function a(t){return!!t&&"object"==typeof t}function o(t){return"symbol"==typeof t||a(t)&&E.call(t)==p}function s(t){if(!t)return 0===t?t:0;if((t=u(t))===f||t===-f){return(t<0?-1:1)*d}return t===t?t:0}function l(t){var e=s(t),r=e%1;return e===e?r?e-r:e:0}function u(t){if("number"==typeof t)return t;if(o(t))return h;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(g,"");var r=v.test(t);return r||m.test(t)?b(t.slice(2),r?2:8):y.test(t)?h:+t}var c="Expected a function",f=1/0,d=1.7976931348623157e308,h=NaN,p="[object Symbol]",g=/^\s+|\s+$/g,y=/^[-+]0x[0-9a-f]+$/i,v=/^0b[01]+$/i,m=/^0o[0-7]+$/i,b=parseInt,_=Object.prototype,E=_.toString;t.exports=n},function(t,e,r){(function(e){function r(t,e){return null==t?void 0:t[e]}function n(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function i(t){var e=-1,r=t?t.length:0;for(this.clear();++e-1}function g(t,e){var r=this.__data__,n=T(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}function y(t){var e=-1,r=t?t.length:0;for(this.clear();++e-1}function i(t,e,r){for(var n=-1,i=t?t.length:0;++n-1}function R(t,e){var r=this.__data__,n=K(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}function L(t){var e=-1,r=t?t.length:0;for(this.clear();++e=Gt){var d=e?null:Qe(t);if(d)return g(d);l=!1,o=f,c=new x}else c=e?[]:u;t:for(;++al))return!1;var c=o.get(t);if(c&&o.get(e))return c==e;var f=-1,d=!0,h=i&Kt?new x:void 0;for(o.set(t,e),o.set(e,t);++f-1&&t%1==0&&t-1&&t%1==0&&t<=Ht}function Ct(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Dt(t){return!!t&&"object"==typeof t}function It(t){return"symbol"==typeof t||Dt(t)&&De.call(t)==se}function xt(t){return null==t?"":it(t)}function Nt(t,e,r){var n=null==t?void 0:$(t,e);return void 0===n?r:n}function Mt(t,e){return null!=t&&ht(t,e,H)}function Ft(t){return Rt(t)?V(t):tt(t)}function Bt(t){return t}function Ut(){}function jt(t){return gt(t)?u(Et(t)):nt(t)}var Gt=200,Yt="Expected a function",Vt="__lodash_hash_undefined__",Kt=1,$t=2,zt=1/0,Ht=9007199254740991,Wt="[object Arguments]",qt="[object Array]",Xt="[object Boolean]",Zt="[object Date]",Jt="[object Error]",Qt="[object Function]",te="[object GeneratorFunction]",ee="[object Map]",re="[object Number]",ne="[object Object]",ie="[object RegExp]",ae="[object Set]",oe="[object String]",se="[object Symbol]",le="[object ArrayBuffer]",ue="[object DataView]",ce=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fe=/^\w*$/,de=/^\./,he=/^\[object .+?Constructor\]$/,pe=/^(?:0|[1-9]\d*)$/,ge={};ge["[object Float32Array]"]=ge["[object Float64Array]"]=ge["[object Int8Array]"]=ge["[object Int16Array]"]=ge["[object Int32Array]"]=ge["[object Uint8Array]"]=ge["[object Uint8ClampedArray]"]=ge["[object Uint16Array]"]=ge["[object Uint32Array]"]=!0,ge[Wt]=ge[qt]=ge[le]=ge[Xt]=ge[ue]=ge[Zt]=ge[Jt]=ge[Qt]=ge[ee]=ge[re]=ge[ne]=ge[ie]=ge[ae]=ge[oe]=ge["[object WeakMap]"]=!1;var ye="object"==typeof t&&t&&t.Object===Object&&t,ve="object"==typeof self&&self&&self.Object===Object&&self,me=ye||ve||Function("return this")(),be="object"==typeof e&&e&&!e.nodeType&&e,_e=be&&"object"==typeof r&&r&&!r.nodeType&&r,Ee=_e&&_e.exports===be,Te=Ee&&ye.process,Ae=function(){try{return Te&&Te.binding("util")}catch(t){}}(),we=Ae&&Ae.isTypedArray,ke=Array.prototype,Se=Function.prototype,Re=Object.prototype,Le=me["__core-js_shared__"],Oe=function(){var t=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Pe=Se.toString,Ce=Re.hasOwnProperty,De=Re.toString,Ie=RegExp("^"+Pe.call(Ce).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xe=me.Symbol,Ne=me.Uint8Array,Me=Re.propertyIsEnumerable,Fe=ke.splice,Be=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),Ue=dt(me,"DataView"),je=dt(me,"Map"),Ge=dt(me,"Promise"),Ye=dt(me,"Set"),Ve=dt(me,"WeakMap"),Ke=dt(Object,"create"),$e=Tt(Ue),ze=Tt(je),He=Tt(Ge),We=Tt(Ye),qe=Tt(Ve),Xe=xe?xe.prototype:void 0,Ze=Xe?Xe.valueOf:void 0,Je=Xe?Xe.toString:void 0;y.prototype.clear=v,y.prototype.delete=m,y.prototype.get=b,y.prototype.has=_,y.prototype.set=E,T.prototype.clear=A,T.prototype.delete=w,T.prototype.get=k,T.prototype.has=S,T.prototype.set=R,L.prototype.clear=O,L.prototype.delete=P,L.prototype.get=C,L.prototype.has=D,L.prototype.set=I,x.prototype.add=x.prototype.push=N,x.prototype.has=M,F.prototype.clear=B,F.prototype.delete=U,F.prototype.get=j,F.prototype.has=G,F.prototype.set=Y;var Qe=Ye&&1/g(new Ye([,-0]))[1]==zt?function(t){return new Ye(t)}:Ut,tr=z;(Ue&&tr(new Ue(new ArrayBuffer(1)))!=ue||je&&tr(new je)!=ee||Ge&&"[object Promise]"!=tr(Ge.resolve())||Ye&&tr(new Ye)!=ae||Ve&&"[object WeakMap]"!=tr(new Ve))&&(tr=function(t){var e=De.call(t),r=e==ne?t.constructor:void 0,n=r?Tt(r):void 0;if(n)switch(n){case $e:return ue;case ze:return ee;case He:return"[object Promise]";case We:return ae;case qe:return"[object WeakMap]"}return e});var er=wt(function(t){t=xt(t);var e=[];return de.test(t)&&e.push(""),t.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,function(t,r,n,i){e.push(n?i.replace(/\\(\\)?/g,"$1"):r||t)}),e});wt.Cache=L;var rr=Array.isArray,nr=we?function(t){return function(e){return t(e)}}(we):J;r.exports=At}).call(e,r(12),r(23)(t))},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e){t.exports=''},function(t,e,r){t.exports=r.p+"38861cba61c66739c1452c3a71e39852.ttf"},function(t,e,r){t.exports=r.p+"4b76590b32dab62bc95c1b7951efae78.swf"},function(t,e,r){t.exports=r.p+"809981e5b09d5336c45d72d0869ada2a.swf"}])});