@clappr/player 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var Clappr=function(){"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function t(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?e(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t,r){return t=p(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,n()?Reflect.construct(t,r||[],p(e).constructor):t.apply(e,r))}function n(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(n=function(){return!!e})()}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){h(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,o(i.key),i)}}function d(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}function v(){return v="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=p(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},v.apply(this,arguments)}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,n,a,s,o=[],l=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=a.call(r)).done)&&(o.push(i.value),o.length!==t);l=!0);}catch(e){u=!0,n=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw n}}return o}}(e,t)||A(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||A(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(e,t){if(e){if("string"==typeof e)return E(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(e,t):void 0}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function T(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=A(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw a}}}}Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n<r;){var a=t[n];if(e.call(i,a,n,t))return a;n++}}}),Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}),Object.values||(Object.values=function(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=e[t[r]];return i}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(e),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])}return r},writable:!0,configurable:!0}),Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n<r;){var a=t[n];if(e.call(i,a,n,t))return n;n++}return-1},configurable:!0,writable:!0});var b={mp4:"data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAC721kYXQhEAUgpBv/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3pwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcCEQBSCkG//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADengAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAsJtb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAALwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAB7HRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAIAAAAAAAAALwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAC8AAAAAAAEAAAAAAWRtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAIAFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAEPbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAADTc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAgAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgACAASAgIAUQBUAAAAAAfQAAAHz+QWAgIACEhAGgICAAQIAAAAYc3R0cwAAAAAAAAABAAAAAgAABAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAIAAAABAAAAHHN0c3oAAAAAAAAAAAAAAAIAAAFzAAABdAAAABRzdGNvAAAAAAAAAAEAAAAsAAAAYnVkdGEAAABabWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAtaWxzdAAAACWpdG9vAAAAHWRhdGEAAAABAAAAAExhdmY1Ni40MC4xMDE="};function k(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var S=function(){var e,t,r,i,n,a,s=[],o=s.concat,l=s.filter,u=s.slice,c=window.document,d={},h={},f={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},p=/^\s*<(\w+|!)[^>]*>/,g=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,m=/^(?:body|html)$/i,y=/([A-Z])/g,A=["val","css","html","text","data","width","height","offset"],E=c.createElement("table"),T=c.createElement("tr"),b={tr:c.createElement("tbody"),tbody:E,thead:E,tfoot:E,td:T,th:T,"*":c.createElement("div")},k=/complete|loaded|interactive/,S=/^[\w-]*$/,_={},C=_.toString,L={},D=c.createElement("div"),I={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},R=Array.isArray||function(e){return e instanceof Array};function O(e){return null==e?String(e):_[C.call(e)]||"object"}function w(e){return"function"==O(e)}function P(e){return null!=e&&e==e.window}function x(e){return null!=e&&e.nodeType==e.DOCUMENT_NODE}function N(e){return"object"==O(e)}function M(e){return N(e)&&!P(e)&&Object.getPrototypeOf(e)==Object.prototype}function F(e){var t=!!e&&"length"in e&&e.length,i=r.type(e);return"function"!=i&&!P(e)&&("array"==i||0===t||"number"==typeof t&&t>0&&t-1 in e)}function B(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function U(e){return e in h?h[e]:h[e]=new RegExp("(^|\\s)"+e+"(\\s|$)")}function G(e,t){return"number"!=typeof t||f[B(e)]?t:t+"px"}function V(e){return"children"in e?u.call(e.children):r.map(e.childNodes,(function(e){if(1==e.nodeType)return e}))}function K(e,t){var r,i=e?e.length:0;for(r=0;r<i;r++)this[r]=e[r];this.length=i,this.selector=t||""}function j(r,i,n){for(t in i)n&&(M(i[t])||R(i[t]))?(M(i[t])&&!M(r[t])&&(r[t]={}),R(i[t])&&!R(r[t])&&(r[t]=[]),j(r[t],i[t],n)):i[t]!==e&&(r[t]=i[t])}function H(e,t){return null==t?r(e):r(e).filter(t)}function Y(e,t,r,i){return w(t)?t.call(e,r,i):t}function W(e,t,r){null==r?e.removeAttribute(t):e.setAttribute(t,r)}function $(t,r){var i=t.className||"",n=i&&i.baseVal!==e;if(r===e)return n?i.baseVal:i;n?i.baseVal=r:t.className=r}function z(e){try{return e?"true"==e||"false"!=e&&("null"==e?null:+e+""==e?+e:/^[\[\{]/.test(e)?r.parseJSON(e):e):e}catch(t){return e}}function q(e,t){t(e);for(var r=0,i=e.childNodes.length;r<i;r++)q(e.childNodes[r],t)}return L.matches=function(e,t){if(!t||!e||1!==e.nodeType)return!1;var r=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.matchesSelector;if(r)return r.call(e,t);var i,n=e.parentNode,a=!n;return a&&(n=D).appendChild(e),i=~L.qsa(n,t).indexOf(e),a&&D.removeChild(e),i},n=function(e){return e.replace(/-+(.)?/g,(function(e,t){return t?t.toUpperCase():""}))},a=function(e){return l.call(e,(function(t,r){return e.indexOf(t)==r}))},L.fragment=function(t,i,n){var a,s,o;return g.test(t)&&(a=r(c.createElement(RegExp.$1))),a||(t.replace&&(t=t.replace(v,"<$1></$2>")),i===e&&(i=p.test(t)&&RegExp.$1),i in b||(i="*"),(o=b[i]).innerHTML=""+t,a=r.each(u.call(o.childNodes),(function(){o.removeChild(this)}))),M(n)&&(s=r(a),r.each(n,(function(e,t){A.indexOf(e)>-1?s[e](t):s.attr(e,t)}))),a},L.Z=function(e,t){return new K(e,t)},L.isZ=function(e){return e instanceof L.Z},L.init=function(t,i){var n,a;if(!t)return L.Z();if("string"==typeof t)if("<"==(t=t.trim())[0]&&p.test(t))n=L.fragment(t,RegExp.$1,i),t=null;else{if(i!==e)return r(i).find(t);n=L.qsa(c,t)}else{if(w(t))return r(c).ready(t);if(L.isZ(t))return t;if(R(t))a=t,n=l.call(a,(function(e){return null!=e}));else if(N(t))n=[t],t=null;else if(p.test(t))n=L.fragment(t.trim(),RegExp.$1,i),t=null;else{if(i!==e)return r(i).find(t);n=L.qsa(c,t)}}return L.Z(n,t)},(r=function(e,t){return L.init(e,t)}).extend=function(e){var t,r=u.call(arguments,1);return"boolean"==typeof e&&(t=e,e=r.shift()),r.forEach((function(r){j(e,r,t)})),e},L.qsa=function(e,t){var r,i="#"==t[0],n=!i&&"."==t[0],a=i||n?t.slice(1):t,s=S.test(a);return e.getElementById&&s&&i?(r=e.getElementById(a))?[r]:[]:1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType?[]:u.call(s&&!i&&e.getElementsByClassName?n?e.getElementsByClassName(a):e.getElementsByTagName(t):e.querySelectorAll(t))},r.contains=c.documentElement.contains?function(e,t){return e!==t&&e.contains(t)}:function(e,t){for(;t&&(t=t.parentNode);)if(t===e)return!0;return!1},r.type=O,r.isFunction=w,r.isWindow=P,r.isArray=R,r.isPlainObject=M,r.isEmptyObject=function(e){var t;for(t in e)return!1;return!0},r.isNumeric=function(e){var t=Number(e),r=typeof e;return null!=e&&"boolean"!=r&&("string"!=r||e.length)&&!isNaN(t)&&isFinite(t)||!1},r.inArray=function(e,t,r){return s.indexOf.call(t,e,r)},r.camelCase=n,r.trim=function(e){return null==e?"":String.prototype.trim.call(e)},r.uuid=0,r.support={},r.expr={},r.noop=function(){},r.map=function(e,t){var i,n,a,s,o=[];if(F(e))for(n=0;n<e.length;n++)null!=(i=t(e[n],n))&&o.push(i);else for(a in e)null!=(i=t(e[a],a))&&o.push(i);return(s=o).length>0?r.fn.concat.apply([],s):s},r.each=function(e,t){var r,i;if(F(e)){for(r=0;r<e.length;r++)if(!1===t.call(e[r],r,e[r]))return e}else for(i in e)if(!1===t.call(e[i],i,e[i]))return e;return e},r.grep=function(e,t){return l.call(e,t)},window.JSON&&(r.parseJSON=JSON.parse),r.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),(function(e,t){_["[object "+t+"]"]=t.toLowerCase()})),r.fn={constructor:L.Z,length:0,forEach:s.forEach,reduce:s.reduce,push:s.push,sort:s.sort,splice:s.splice,indexOf:s.indexOf,concat:function(){var e,t,r=[];for(e=0;e<arguments.length;e++)t=arguments[e],r[e]=L.isZ(t)?t.toArray():t;return o.apply(L.isZ(this)?this.toArray():this,r)},map:function(e){return r(r.map(this,(function(t,r){return e.call(t,r,t)})))},slice:function(){return r(u.apply(this,arguments))},ready:function(e){return k.test(c.readyState)&&c.body?e(r):c.addEventListener("DOMContentLoaded",(function(){e(r)}),!1),this},get:function(t){return t===e?u.call(this):this[t>=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(e){return s.every.call(this,(function(t,r){return!1!==e.call(t,r,t)})),this},filter:function(e){return w(e)?this.not(this.not(e)):r(l.call(this,(function(t){return L.matches(t,e)})))},add:function(e,t){return r(a(this.concat(r(e,t))))},is:function(e){return this.length>0&&L.matches(this[0],e)},not:function(t){var i=[];if(w(t)&&t.call!==e)this.each((function(e){t.call(this,e)||i.push(this)}));else{var n="string"==typeof t?this.filter(t):F(t)&&w(t.item)?u.call(t):r(t);this.forEach((function(e){n.indexOf(e)<0&&i.push(e)}))}return r(i)},has:function(e){return this.filter((function(){return N(e)?r.contains(this,e):r(this).find(e).size()}))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){var e=this[0];return e&&!N(e)?e:r(e)},last:function(){var e=this[this.length-1];return e&&!N(e)?e:r(e)},find:function(e){var t=this;return e?"object"==typeof e?r(e).filter((function(){var e=this;return s.some.call(t,(function(t){return r.contains(t,e)}))})):1==this.length?r(L.qsa(this[0],e)):this.map((function(){return L.qsa(this,e)})):r()},closest:function(e,t){var i=[],n="object"==typeof e&&r(e);return this.each((function(r,a){for(;a&&!(n?n.indexOf(a)>=0:L.matches(a,e));)a=a!==t&&!x(a)&&a.parentNode;a&&i.indexOf(a)<0&&i.push(a)})),r(i)},parents:function(e){for(var t=[],i=this;i.length>0;)i=r.map(i,(function(e){if((e=e.parentNode)&&!x(e)&&t.indexOf(e)<0)return t.push(e),e}));return H(t,e)},parent:function(e){return H(a(this.pluck("parentNode")),e)},children:function(e){return H(this.map((function(){return V(this)})),e)},contents:function(){return this.map((function(){return this.contentDocument||u.call(this.childNodes)}))},siblings:function(e){return H(this.map((function(e,t){return l.call(V(t.parentNode),(function(e){return e!==t}))})),e)},empty:function(){return this.each((function(){this.innerHTML=""}))},pluck:function(e){return r.map(this,(function(t){return t[e]}))},show:function(){return this.each((function(){var e,t,r;"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=(e=this.nodeName,d[e]||(t=c.createElement(e),c.body.appendChild(t),r=getComputedStyle(t,"").getPropertyValue("display"),t.parentNode.removeChild(t),"none"==r&&(r="block"),d[e]=r),d[e]))}))},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){var t=w(e);if(this[0]&&!t)var i=r(e).get(0),n=i.parentNode||this.length>1;return this.each((function(a){r(this).wrapAll(t?e.call(this,a):n?i.cloneNode(!0):i)}))},wrapAll:function(e){if(this[0]){var t;for(r(this[0]).before(e=r(e));(t=e.children()).length;)e=t.first();r(e).append(this)}return this},wrapInner:function(e){var t=w(e);return this.each((function(i){var n=r(this),a=n.contents(),s=t?e.call(this,i):e;a.length?a.wrapAll(s):n.append(s)}))},unwrap:function(){return this.parent().each((function(){r(this).replaceWith(r(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 i=r(this);(t===e?"none"==i.css("display"):t)?i.show():i.hide()}))},prev:function(e){return r(this.pluck("previousElementSibling")).filter(e||"*")},next:function(e){return r(this.pluck("nextElementSibling")).filter(e||"*")},html:function(e){return 0 in arguments?this.each((function(t){var i=this.innerHTML;r(this).empty().append(Y(this,e,t,i))})):0 in this?this[0].innerHTML:null},text:function(e){return 0 in arguments?this.each((function(t){var r=Y(this,e,t,this.textContent);this.textContent=null==r?"":""+r})):0 in this?this.pluck("textContent").join(""):null},attr:function(r,i){var n;return"string"!=typeof r||1 in arguments?this.each((function(e){if(1===this.nodeType)if(N(r))for(t in r)W(this,t,r[t]);else W(this,r,Y(this,i,e,this.getAttribute(r)))})):0 in this&&1==this[0].nodeType&&null!=(n=this[0].getAttribute(r))?n:e},removeAttr:function(e){return this.each((function(){1===this.nodeType&&e.split(" ").forEach((function(e){W(this,e)}),this)}))},prop:function(e,t){return e=I[e]||e,1 in arguments?this.each((function(r){this[e]=Y(this,t,r,this[e])})):this[0]&&this[0][e]},removeProp:function(e){return e=I[e]||e,this.each((function(){delete this[e]}))},data:function(t,r){var i="data-"+t.replace(y,"-$1").toLowerCase(),n=1 in arguments?this.attr(i,r):this.attr(i);return null!==n?z(n):e},val:function(e){return 0 in arguments?(null==e&&(e=""),this.each((function(t){this.value=Y(this,e,t,this.value)}))):this[0]&&(this[0].multiple?r(this[0]).find("option").filter((function(){return this.selected})).pluck("value"):this[0].value)},offset:function(e){if(e)return this.each((function(t){var i=r(this),n=Y(this,e,t,i.offset()),a=i.offsetParent().offset(),s={top:n.top-a.top,left:n.left-a.left};"static"==i.css("position")&&(s.position="relative"),i.css(s)}));if(!this.length)return null;if(c.documentElement!==this[0]&&!r.contains(c.documentElement,this[0]))return{top:0,left:0};var t=this[0].getBoundingClientRect();return{left:t.left+window.pageXOffset,top:t.top+window.pageYOffset,width:Math.round(t.width),height:Math.round(t.height)}},css:function(e,i){if(arguments.length<2){var a=this[0];if("string"==typeof e){if(!a)return;return a.style[n(e)]||getComputedStyle(a,"").getPropertyValue(e)}if(R(e)){if(!a)return;var s={},o=getComputedStyle(a,"");return r.each(e,(function(e,t){s[t]=a.style[n(t)]||o.getPropertyValue(t)})),s}}var l="";if("string"==O(e))i||0===i?l=B(e)+":"+G(e,i):this.each((function(){this.style.removeProperty(B(e))}));else for(t in e)e[t]||0===e[t]?l+=B(t)+":"+G(t,e[t])+";":this.each((function(){this.style.removeProperty(B(t))}));return this.each((function(){this.style.cssText+=";"+l}))},index:function(e){return e?this.indexOf(r(e)[0]):this.parent().children().indexOf(this[0])},hasClass:function(e){return!!e&&s.some.call(this,(function(e){return this.test($(e))}),U(e))},addClass:function(e){return e?this.each((function(t){if("className"in this){i=[];var n=$(this);Y(this,e,t,n).split(/\s+/g).forEach((function(e){r(this).hasClass(e)||i.push(e)}),this),i.length&&$(this,n+(n?" ":"")+i.join(" "))}})):this},removeClass:function(t){return this.each((function(r){if("className"in this){if(t===e)return $(this,"");i=$(this),Y(this,t,r,i).split(/\s+/g).forEach((function(e){i=i.replace(U(e)," ")})),$(this,i.trim())}}))},toggleClass:function(t,i){return t?this.each((function(n){var a=r(this);Y(this,t,n,$(this)).split(/\s+/g).forEach((function(t){(i===e?!a.hasClass(t):i)?a.addClass(t):a.removeClass(t)}))})):this},scrollTop:function(t){if(this.length){var r="scrollTop"in this[0];return t===e?r?this[0].scrollTop:this[0].pageYOffset:this.each(r?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var r="scrollLeft"in this[0];return t===e?r?this[0].scrollLeft:this[0].pageXOffset:this.each(r?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var e=this[0],t=this.offsetParent(),i=this.offset(),n=m.test(t[0].nodeName)?{top:0,left:0}:t.offset();return i.top-=parseFloat(r(e).css("margin-top"))||0,i.left-=parseFloat(r(e).css("margin-left"))||0,n.top+=parseFloat(r(t[0]).css("border-top-width"))||0,n.left+=parseFloat(r(t[0]).css("border-left-width"))||0,{top:i.top-n.top,left:i.left-n.left}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent||c.body;e&&!m.test(e.nodeName)&&"static"==r(e).css("position");)e=e.offsetParent;return e}))}},r.fn.detach=r.fn.remove,["width","height"].forEach((function(t){var i=t.replace(/./,(function(e){return e[0].toUpperCase()}));r.fn[t]=function(n){var a,s=this[0];return n===e?P(s)?s["inner"+i]:x(s)?s.documentElement["scroll"+i]:(a=this.offset())&&a[t]:this.each((function(e){(s=r(this)).css(t,Y(this,n,e,s[t]()))}))}})),["after","prepend","before","append"].forEach((function(t,i){var n=i%2;r.fn[t]=function(){var t,a,s=r.map(arguments,(function(i){var n=[];return"array"==(t=O(i))?(i.forEach((function(t){return t.nodeType!==e?n.push(t):r.zepto.isZ(t)?n=n.concat(t.get()):void(n=n.concat(L.fragment(t)))})),n):"object"==t||null==i?i:L.fragment(i)})),o=this.length>1;return s.length<1?this:this.each((function(e,t){a=n?t:t.parentNode,t=0==i?t.nextSibling:1==i?t.firstChild:2==i?t:null;var l=r.contains(c.documentElement,a);s.forEach((function(e){if(o)e=e.cloneNode(!0);else if(!a)return r(e).remove();a.insertBefore(e,t),l&&q(e,(function(e){if(!(null==e.nodeName||"SCRIPT"!==e.nodeName.toUpperCase()||e.type&&"text/javascript"!==e.type||e.src)){var t=e.ownerDocument?e.ownerDocument.defaultView:window;t.eval.call(t,e.innerHTML)}}))}))}))},r.fn[n?t+"To":"insert"+(i?"Before":"After")]=function(e){return r(e)[t](this),this}})),L.Z.prototype=K.prototype=r.fn,L.uniq=a,L.deserializeValue=z,r.zepto=L,r}();window.Zepto=S,void 0===window.$&&(window.$=S),function(e){var t,r,i=+new Date,n=window.document,a=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,s=/^(?:text|application)\/javascript/i,o=/^(?:text|application)\/xml/i,l="application/json",u="text/html",c=/^\s*$/,d=n.createElement("a");function h(t,r,i,a){if(t.global)return function(t,r,i){var n=e.Event(r);return e(t).trigger(n,i),!n.isDefaultPrevented()}(r||n,i,a)}function f(e,t){var r=t.context;if(!1===t.beforeSend.call(r,e,t)||!1===h(t,r,"ajaxBeforeSend",[e,t]))return!1;h(t,r,"ajaxSend",[e,t])}function p(e,t,r,i){var n=r.context,a="success";r.success.call(n,e,a,t),i&&i.resolveWith(n,[e,a,t]),h(r,n,"ajaxSuccess",[t,r,e]),v(a,t,r)}function g(e,t,r,i,n){var a=i.context;i.error.call(a,r,t,e),n&&n.rejectWith(a,[r,t,e]),h(i,a,"ajaxError",[r,i,e||t]),v(t,r,i)}function v(t,r,i){var n=i.context;i.complete.call(n,r,t),h(i,n,"ajaxComplete",[r,i]),function(t){t.global&&! --e.active&&h(t,null,"ajaxStop")}(i)}function m(){}function y(e,t){return""==t?e:(e+"&"+t).replace(/[&?]{1,2}/,"?")}function A(t,r,i,n){return e.isFunction(r)&&(n=i,i=r,r=void 0),e.isFunction(i)||(n=i,i=void 0),{url:t,data:r,success:i,dataType:n}}d.href=window.location.href,e.active=0,e.ajaxJSONP=function(t,r){if(!("type"in t))return e.ajax(t);var a,s,o=t.jsonpCallback,l=(e.isFunction(o)?o():o)||"Zepto"+i++,u=n.createElement("script"),c=window[l],d=function(t){e(u).triggerHandler("error",t||"abort")},h={abort:d};return r&&r.promise(h),e(u).on("load error",(function(i,n){clearTimeout(s),e(u).off().remove(),"error"!=i.type&&a?p(a[0],h,t,r):g(null,n||"error",h,t,r),window[l]=c,a&&e.isFunction(c)&&c(a[0]),c=a=void 0})),!1===f(h,t)?(d("abort"),h):(window[l]=function(){a=arguments},u.src=t.url.replace(/\?(.+)=\?/,"?$1="+l),n.head.appendChild(u),t.timeout>0&&(s=setTimeout((function(){d("timeout")}),t.timeout)),h)},e.ajaxSettings={type:"GET",beforeSend:m,success:m,error:m,complete:m,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:l,xml:"application/xml, text/xml",html:u,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:m},e.ajax=function(i){var a,v,A=e.extend({},i||{}),E=e.Deferred&&e.Deferred();for(t in e.ajaxSettings)void 0===A[t]&&(A[t]=e.ajaxSettings[t]);!function(t){t.global&&0==e.active++&&h(t,null,"ajaxStart")}(A),A.crossDomain||((a=n.createElement("a")).href=A.url,a.href=a.href,A.crossDomain=d.protocol+"//"+d.host!=a.protocol+"//"+a.host),A.url||(A.url=window.location.toString()),(v=A.url.indexOf("#"))>-1&&(A.url=A.url.slice(0,v)),function(t){t.processData&&t.data&&"string"!=e.type(t.data)&&(t.data=e.param(t.data,t.traditional)),!t.data||t.type&&"GET"!=t.type.toUpperCase()&&"jsonp"!=t.dataType||(t.url=y(t.url,t.data),t.data=void 0)}(A);var T=A.dataType,b=/\?.+=\?/.test(A.url);if(b&&(T="jsonp"),!1!==A.cache&&(i&&!0===i.cache||"script"!=T&&"jsonp"!=T)||(A.url=y(A.url,"_="+Date.now())),"jsonp"==T)return b||(A.url=y(A.url,A.jsonp?A.jsonp+"=?":!1===A.jsonp?"":"callback=?")),e.ajaxJSONP(A,E);var k,S=A.accepts[T],_={},C=function(e,t){_[e.toLowerCase()]=[e,t]},L=/^([\w-]+:)\/\//.test(A.url)?RegExp.$1:window.location.protocol,D=A.xhr(),I=D.setRequestHeader;if(E&&E.promise(D),A.crossDomain||C("X-Requested-With","XMLHttpRequest"),C("Accept",S||"*/*"),(S=A.mimeType||S)&&(S.indexOf(",")>-1&&(S=S.split(",",2)[0]),D.overrideMimeType&&D.overrideMimeType(S)),(A.contentType||!1!==A.contentType&&A.data&&"GET"!=A.type.toUpperCase())&&C("Content-Type",A.contentType||"application/x-www-form-urlencoded"),A.headers)for(r in A.headers)C(r,A.headers[r]);if(D.setRequestHeader=C,D.onreadystatechange=function(){if(4==D.readyState){D.onreadystatechange=m,clearTimeout(k);var t,r=!1;if(D.status>=200&&D.status<300||304==D.status||0==D.status&&"file:"==L){if(T=T||function(e){return e&&(e=e.split(";",2)[0]),e&&(e==u?"html":e==l?"json":s.test(e)?"script":o.test(e)&&"xml")||"text"}(A.mimeType||D.getResponseHeader("content-type")),"arraybuffer"==D.responseType||"blob"==D.responseType)t=D.response;else{t=D.responseText;try{t=function(e,t,r){if(r.dataFilter==m)return e;var i=r.context;return r.dataFilter.call(i,e,t)}(t,T,A),"script"==T?(0,eval)(t):"xml"==T?t=D.responseXML:"json"==T&&(t=c.test(t)?null:e.parseJSON(t))}catch(e){r=e}if(r)return g(r,"parsererror",D,A,E)}p(t,D,A,E)}else g(D.statusText||null,D.status?"error":"abort",D,A,E)}},!1===f(D,A))return D.abort(),g(null,"abort",D,A,E),D;var R=!("async"in A)||A.async;if(D.open(A.type,A.url,R,A.username,A.password),A.xhrFields)for(r in A.xhrFields)D[r]=A.xhrFields[r];for(r in _)I.apply(D,_[r]);return A.timeout>0&&(k=setTimeout((function(){D.onreadystatechange=m,D.abort(),g(null,"timeout",D,A,E)}),A.timeout)),D.send(A.data?A.data:null),D},e.get=function(){return e.ajax(A.apply(null,arguments))},e.post=function(){var t=A.apply(null,arguments);return t.type="POST",e.ajax(t)},e.getJSON=function(){var t=A.apply(null,arguments);return t.dataType="json",e.ajax(t)},e.fn.load=function(t,r,i){if(!this.length)return this;var n,s=this,o=t.split(/\s/),l=A(t,r,i),u=l.success;return o.length>1&&(l.url=o[0],n=o[1]),l.success=function(t){s.html(n?e("<div>").html(t.replace(a,"")).find(n):t),u&&u.apply(s,arguments)},e.ajax(l),this};var E=encodeURIComponent;function T(t,r,i,n){var a,s=e.isArray(r),o=e.isPlainObject(r);e.each(r,(function(r,l){a=e.type(l),n&&(r=i?n:n+"["+(o||"object"==a||"array"==a?r:"")+"]"),!n&&s?t.add(l.name,l.value):"array"==a||!i&&"object"==a?T(t,l,i,r):t.add(r,l)}))}e.param=function(t,r){var i=[];return i.add=function(t,r){e.isFunction(r)&&(r=r()),null==r&&(r=""),this.push(E(t)+"="+E(r))},T(i,t,r),i.join("&").replace(/%20/g,"+")}}(S),function(e){e.Callbacks=function(t){t=e.extend({},t);var r,i,n,a,s,o,l=[],u=!t.once&&[],c=function(e){for(r=t.memory&&e,i=!0,o=a||0,a=0,s=l.length,n=!0;l&&o<s;++o)if(!1===l[o].apply(e[0],e[1])&&t.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l.length=0:d.disable())},d={add:function(){if(l){var i=l.length,o=function(r){e.each(r,(function(e,r){"function"==typeof r?t.unique&&d.has(r)||l.push(r):r&&r.length&&"string"!=typeof r&&o(r)}))};o(arguments),n?s=l.length:r&&(a=i,c(r))}return this},remove:function(){return l&&e.each(arguments,(function(t,r){for(var i;(i=e.inArray(r,l,i))>-1;)l.splice(i,1),n&&(i<=s&&--s,i<=o&&--o)})),this},has:function(t){return!(!l||!(t?e.inArray(t,l)>-1:l.length))},empty:function(){return s=l.length=0,this},disable:function(){return l=u=r=void 0,this},disabled:function(){return!l},lock:function(){return u=void 0,r||d.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=[e,(t=t||[]).slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return d.fireWith(this,arguments)},fired:function(){return!!i}};return d}}(S),function(e){var t=Array.prototype.slice;function r(t){var i=[["resolve","done",e.Callbacks({once:1,memory:1}),"resolved"],["reject","fail",e.Callbacks({once:1,memory:1}),"rejected"],["notify","progress",e.Callbacks({memory:1})]],n="pending",a={state:function(){return n},always:function(){return s.done(arguments).fail(arguments),this},then:function(){var t=arguments;return r((function(r){e.each(i,(function(i,n){var o=e.isFunction(t[i])&&t[i];s[n[1]]((function(){var t=o&&o.apply(this,arguments);if(t&&e.isFunction(t.promise))t.promise().done(r.resolve).fail(r.reject).progress(r.notify);else{var i=this===a?r.promise():this,s=o?[t]:arguments;r[n[0]+"With"](i,s)}}))})),t=null})).promise()},promise:function(t){return null!=t?e.extend(t,a):a}},s={};return e.each(i,(function(e,t){var r=t[2],o=t[3];a[t[1]]=r.add,o&&r.add((function(){n=o}),i[1^e][2].disable,i[2][2].lock),s[t[0]]=function(){return s[t[0]+"With"](this===s?a:this,arguments),this},s[t[0]+"With"]=r.fireWith})),a.promise(s),t&&t.call(s,s),s}e.when=function(i){var n,a,s,o=t.call(arguments),l=o.length,u=0,c=1!==l||i&&e.isFunction(i.promise)?l:0,d=1===c?i:r(),h=function(e,r,i){return function(a){r[e]=this,i[e]=arguments.length>1?t.call(arguments):a,i===n?d.notifyWith(r,i):--c||d.resolveWith(r,i)}};if(l>1)for(n=new Array(l),a=new Array(l),s=new Array(l);u<l;++u)o[u]&&e.isFunction(o[u].promise)?o[u].promise().done(h(u,s,o)).fail(d.reject).progress(h(u,a,n)):--c;return c||d.resolveWith(s,o),d.promise()},e.Deferred=r}(S),function(e){var t,r=1,i=Array.prototype.slice,n=e.isFunction,a=function(e){return"string"==typeof e},s={},o={},l="onfocusin"in window,u={focus:"focusin",blur:"focusout"},c={mouseenter:"mouseover",mouseleave:"mouseout"};function d(e){return e._zid||(e._zid=r++)}function h(e,t,r,i){if((t=f(t)).ns)var n=(a=t.ns,new RegExp("(?:^| )"+a.replace(" "," .* ?")+"(?: |$)"));var a;return(s[d(e)]||[]).filter((function(e){return e&&(!t.e||e.e==t.e)&&(!t.ns||n.test(e.ns))&&(!r||d(e.fn)===d(r))&&(!i||e.sel==i)}))}function f(e){var t=(""+e).split(".");return{e:t[0],ns:t.slice(1).sort().join(" ")}}function p(e,t){return e.del&&!l&&e.e in u||!!t}function g(e){return c[e]||l&&u[e]||e}function v(r,i,n,a,o,l,u){var h=d(r),v=s[h]||(s[h]=[]);i.split(/\s/).forEach((function(i){if("ready"==i)return e(document).ready(n);var s=f(i);s.fn=n,s.sel=o,s.e in c&&(n=function(t){var r=t.relatedTarget;if(!r||r!==this&&!e.contains(this,r))return s.fn.apply(this,arguments)}),s.del=l;var d=l||n;s.proxy=function(e){if(!(e=b(e)).isImmediatePropagationStopped()){e.data=a;var i=d.apply(r,e._args==t?[e]:[e].concat(e._args));return!1===i&&(e.preventDefault(),e.stopPropagation()),i}},s.i=v.length,v.push(s),"addEventListener"in r&&r.addEventListener(g(s.e),s.proxy,p(s,u))}))}function m(e,t,r,i,n){var a=d(e);(t||"").split(/\s/).forEach((function(t){h(e,t,r,i).forEach((function(t){delete s[a][t.i],"removeEventListener"in e&&e.removeEventListener(g(t.e),t.proxy,p(t,n))}))}))}o.click=o.mousedown=o.mouseup=o.mousemove="MouseEvents",e.event={add:v,remove:m},e.proxy=function(t,r){var s=2 in arguments&&i.call(arguments,2);if(n(t)){var o=function(){return t.apply(r,s?s.concat(i.call(arguments)):arguments)};return o._zid=d(t),o}if(a(r))return s?(s.unshift(t[r],t),e.proxy.apply(null,s)):e.proxy(t[r],t);throw new TypeError("expected function")},e.fn.bind=function(e,t,r){return this.on(e,t,r)},e.fn.unbind=function(e,t){return this.off(e,t)},e.fn.one=function(e,t,r,i){return this.on(e,t,r,i,1)};var y=function(){return!0},A=function(){return!1},E=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,T={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};function b(r,i){return!i&&r.isDefaultPrevented||(i||(i=r),e.each(T,(function(e,t){var n=i[e];r[e]=function(){return this[t]=y,n&&n.apply(i,arguments)},r[t]=A})),r.timeStamp||(r.timeStamp=Date.now()),(i.defaultPrevented!==t?i.defaultPrevented:"returnValue"in i?!1===i.returnValue:i.getPreventDefault&&i.getPreventDefault())&&(r.isDefaultPrevented=y)),r}function k(e){var r,i={originalEvent:e};for(r in e)E.test(r)||e[r]===t||(i[r]=e[r]);return b(i,e)}e.fn.delegate=function(e,t,r){return this.on(t,e,r)},e.fn.undelegate=function(e,t,r){return this.off(t,e,r)},e.fn.live=function(t,r){return e(document.body).delegate(this.selector,t,r),this},e.fn.die=function(t,r){return e(document.body).undelegate(this.selector,t,r),this},e.fn.on=function(r,s,o,l,u){var c,d,h=this;return r&&!a(r)?(e.each(r,(function(e,t){h.on(e,s,o,t,u)})),h):(a(s)||n(l)||!1===l||(l=o,o=s,s=t),l!==t&&!1!==o||(l=o,o=t),!1===l&&(l=A),h.each((function(t,n){u&&(c=function(e){return m(n,e.type,l),l.apply(this,arguments)}),s&&(d=function(t){var r,a=e(t.target).closest(s,n).get(0);if(a&&a!==n)return r=e.extend(k(t),{currentTarget:a,liveFired:n}),(c||l).apply(a,[r].concat(i.call(arguments,1)))}),v(n,r,l,o,s,d||c)})))},e.fn.off=function(r,i,s){var o=this;return r&&!a(r)?(e.each(r,(function(e,t){o.off(e,i,t)})),o):(a(i)||n(s)||!1===s||(s=i,i=t),!1===s&&(s=A),o.each((function(){m(this,r,s,i)})))},e.fn.trigger=function(t,r){return(t=a(t)||e.isPlainObject(t)?e.Event(t):b(t))._args=r,this.each((function(){t.type in u&&"function"==typeof this[t.type]?this[t.type]():"dispatchEvent"in this?this.dispatchEvent(t):e(this).triggerHandler(t,r)}))},e.fn.triggerHandler=function(t,r){var i,n;return this.each((function(s,o){(i=k(a(t)?e.Event(t):t))._args=r,i.target=o,e.each(h(o,t.type||t),(function(e,t){if(n=t.proxy(i),i.isImmediatePropagationStopped())return!1}))})),n},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach((function(t){e.fn[t]=function(e){return 0 in arguments?this.bind(t,e):this.trigger(t)}})),e.Event=function(e,t){a(e)||(e=(t=e).type);var r=document.createEvent(o[e]||"Events"),i=!0;if(t)for(var n in t)"bubbles"==n?i=!!t[n]:r[n]=t[n];return r.initEvent(e,i,!0),b(r)}}(S),function(){try{getComputedStyle(void 0)}catch(t){var e=getComputedStyle;window.getComputedStyle=function(t,r){try{return e(t,r)}catch(e){return null}}}}(),function(e){var t=e.zepto,r=t.qsa,i=t.matches;function n(t){return!(!(t=e(t)).width()&&!t.height())&&"none"!==t.css("display")}var a=e.expr[":"]={visible:function(){if(n(this))return this},hidden:function(){if(!n(this))return this},selected:function(){if(this.selected)return this},checked:function(){if(this.checked)return this},parent:function(){return this.parentNode},first:function(e){if(0===e)return this},last:function(e,t){if(e===t.length-1)return this},eq:function(e,t,r){if(e===r)return this},contains:function(t,r,i){if(e(this).text().indexOf(i)>-1)return this},has:function(e,r,i){if(t.qsa(this,i).length)return this}},s=new RegExp("(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*"),o=/^\s*>/,l="Zepto"+ +new Date;function u(e,t){e=e.replace(/=#\]/g,'="#"]');var r,i,n=s.exec(e);if(n&&n[2]in a&&(r=a[n[2]],i=n[3],e=n[1],i)){var o=Number(i);i=isNaN(o)?i.replace(/^["']|["']$/g,""):o}return t(e,r,i)}t.qsa=function(i,n){return u(n,(function(a,s,u){try{var c;!a&&s?a="*":o.test(a)&&(c=e(i).addClass(l),a="."+l+" "+a);var d=r(i,a)}catch(e){throw console.error("error performing selector: %o",n),e}finally{c&&c.removeClass(l)}return s?t.uniq(e.map(d,(function(e,t){return s.call(e,t,d,u)}))):d}))},t.matches=function(e,t){return u(t,(function(t,r,n){return(!t||i(e,t))&&(!r||r.call(e,null,n)===e)}))}}(S);var _,C,L,D=k(S),I=[{name:"Chromium",group:"Chrome",identifier:"Chromium/([0-9.]*)"},{name:"Chrome Mobile",group:"Chrome",identifier:"Chrome/([0-9.]*) Mobile",versionIdentifier:"Chrome/([0-9.]*)"},{name:"Chrome",group:"Chrome",identifier:"Chrome/([0-9.]*)"},{name:"Chrome for iOS",group:"Chrome",identifier:"CriOS/([0-9.]*)"},{name:"Android Browser",group:"Chrome",identifier:"CrMo/([0-9.]*)"},{name:"Firefox",group:"Firefox",identifier:"Firefox/([0-9.]*)"},{name:"Opera Mini",group:"Opera",identifier:"Opera Mini/([0-9.]*)"},{name:"Opera",group:"Opera",identifier:"Opera ([0-9.]*)"},{name:"Opera",group:"Opera",identifier:"Opera/([0-9.]*)",versionIdentifier:"Version/([0-9.]*)"},{name:"IEMobile",group:"Explorer",identifier:"IEMobile/([0-9.]*)"},{name:"Internet Explorer",group:"Explorer",identifier:"MSIE ([a-zA-Z0-9.]*)"},{name:"Internet Explorer",group:"Explorer",identifier:"Trident/([0-9.]*)",versionIdentifier:"rv:([0-9.]*)"},{name:"Spartan",group:"Spartan",identifier:"Edge/([0-9.]*)",versionIdentifier:"Edge/([0-9.]*)"},{name:"Safari",group:"Safari",identifier:"Safari/([0-9.]*)",versionIdentifier:"Version/([0-9.]*)"}],R=[{name:"Windows 2000",group:"Windows",identifier:"Windows NT 5.0",version:"5.0"},{name:"Windows XP",group:"Windows",identifier:"Windows NT 5.1",version:"5.1"},{name:"Windows Vista",group:"Windows",identifier:"Windows NT 6.0",version:"6.0"},{name:"Windows 7",group:"Windows",identifier:"Windows NT 6.1",version:"7.0"},{name:"Windows 8",group:"Windows",identifier:"Windows NT 6.2",version:"8.0"},{name:"Windows 8.1",group:"Windows",identifier:"Windows NT 6.3",version:"8.1"},{name:"Windows 10",group:"Windows",identifier:"Windows NT 10.0",version:"10.0"},{name:"Windows Phone",group:"Windows Phone",identifier:"Windows Phone ([0-9.]*)"},{name:"Windows Phone",group:"Windows Phone",identifier:"Windows Phone OS ([0-9.]*)"},{name:"Windows",group:"Windows",identifier:"Windows"},{name:"Chrome OS",group:"Chrome OS",identifier:"CrOS"},{name:"Android",group:"Android",identifier:"Android",versionIdentifier:"Android ([a-zA-Z0-9.-]*)"},{name:"iPad",group:"iOS",identifier:"iPad",versionIdentifier:"OS ([0-9_]*)",versionSeparator:"[_|.]"},{name:"iPod",group:"iOS",identifier:"iPod",versionIdentifier:"OS ([0-9_]*)",versionSeparator:"[_|.]"},{name:"iPhone",group:"iOS",identifier:"iPhone OS",versionIdentifier:"OS ([0-9_]*)",versionSeparator:"[_|.]"},{name:"Mac OS X High Sierra",group:"Mac OS",identifier:"Mac OS X (10([_|.])13([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Sierra",group:"Mac OS",identifier:"Mac OS X (10([_|.])12([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X El Capitan",group:"Mac OS",identifier:"Mac OS X (10([_|.])11([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Yosemite",group:"Mac OS",identifier:"Mac OS X (10([_|.])10([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Mavericks",group:"Mac OS",identifier:"Mac OS X (10([_|.])9([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Mountain Lion",group:"Mac OS",identifier:"Mac OS X (10([_|.])8([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Lion",group:"Mac OS",identifier:"Mac OS X (10([_|.])7([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Snow Leopard",group:"Mac OS",identifier:"Mac OS X (10([_|.])6([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Leopard",group:"Mac OS",identifier:"Mac OS X (10([_|.])5([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Tiger",group:"Mac OS",identifier:"Mac OS X (10([_|.])4([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Panther",group:"Mac OS",identifier:"Mac OS X (10([_|.])3([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Jaguar",group:"Mac OS",identifier:"Mac OS X (10([_|.])2([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Puma",group:"Mac OS",identifier:"Mac OS X (10([_|.])1([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Cheetah",group:"Mac OS",identifier:"Mac OS X (10([_|.])0([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS",group:"Mac OS",identifier:"Mac OS"},{name:"Ubuntu",group:"Linux",identifier:"Ubuntu",versionIdentifier:"Ubuntu/([0-9.]*)"},{name:"Debian",group:"Linux",identifier:"Debian"},{name:"Gentoo",group:"Linux",identifier:"Gentoo"},{name:"Linux",group:"Linux",identifier:"Linux"},{name:"BlackBerry",group:"BlackBerry",identifier:"BlackBerry"}],O={},w=function(e,t){var r=e.split(".",2);t.fullVersion=e,r[0]&&(t.majorVersion=parseInt(r[0])),r[1]&&(t.minorVersion=parseInt(r[1]))},P=function(e,t,r){var i="["==t.substr(0,1)?new RegExp(t,"g"):t,n=e.split(i,2);"."!=t&&(e=e.replace(new RegExp(t,"g"),".")),r.fullVersion=e,n&&n[0]&&(r.majorVersion=parseInt(n[0])),n&&n[1]&&(r.minorVersion=parseInt(n[1]))},x=function(e){var t,r=e.match(/\b(playstation 4|nx|opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];if(/trident/i.test(r[1]))return t=/\brv[ :]+(\d+)/g.exec(e)||[],{name:"IE",version:parseInt(t[1]||"")};if("Chrome"===r[1]){if(null!=(t=e.match(/\bOPR\/(\d+)/)))return{name:"Opera",version:parseInt(t[1])};if(null!=(t=e.match(/\bEdge\/(\d+)/)))return{name:"Edge",version:parseInt(t[1])}}else/android/i.test(e)&&(t=e.match(/version\/(\d+)/i))&&(r.splice(1,1,"Android WebView"),r.splice(2,1,t[1]));return{name:(r=r[2]?[r[1],r[2]]:[navigator.appName,navigator.appVersion,"-?"])[0],version:parseInt(r[1])}}(navigator.userAgent);O.isEdge=/Edg|EdgiOS|EdgA/i.test(navigator.userAgent),O.isChrome=/Chrome|CriOS/i.test(navigator.userAgent)&&!O.isEdge,O.isSafari=/Safari/i.test(navigator.userAgent)&&!O.isChrome&&!O.isEdge,O.isFirefox=/Firefox/i.test(navigator.userAgent),O.isLegacyIE=!!window.ActiveXObject,O.isIE=O.isLegacyIE||/trident.*rv:1\d/i.test(navigator.userAgent),O.isIE11=/trident.*rv:11/i.test(navigator.userAgent),O.isChromecast=O.isChrome&&/CrKey/i.test(navigator.userAgent),O.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone|IEMobile|Mobile Safari|Opera Mini/i.test(navigator.userAgent),O.isiOS=/iPad|iPhone|iPod/i.test(navigator.userAgent),O.isAndroid=/Android/i.test(navigator.userAgent),O.isWindowsPhone=/Windows Phone/i.test(navigator.userAgent),O.isWin8App=/MSAppHost/i.test(navigator.userAgent),O.isWiiU=/WiiU/i.test(navigator.userAgent),O.isPS4=/PlayStation 4/i.test(navigator.userAgent),O.hasLocalstorage=function(){try{return localStorage.setItem("clappr","clappr"),localStorage.removeItem("clappr"),!0}catch(e){return!1}}(),O.hasFlash=function(){try{return!!new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){return!(!navigator.mimeTypes||void 0===navigator.mimeTypes["application/x-shockwave-flash"]||!navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)}}(),O.name=x.name,O.version=x.version,O.userAgent=navigator.userAgent,O.data=function(){var e,t={},r=O.userAgent.toLowerCase(),i=T(I);try{for(i.s();!(e=i.n()).done;){var n=e.value,a=new RegExp(n.identifier.toLowerCase()).exec(r);if(null!=a&&a[1]){if(t.name=n.name,t.group=n.group,n.versionIdentifier){var s=new RegExp(n.versionIdentifier.toLowerCase()).exec(r);null!=s&&s[1]&&w(s[1],t)}else w(a[1],t);break}}}catch(e){i.e(e)}finally{i.f()}return t}(),O.os=function(){var e,t={},r=O.userAgent.toLowerCase(),i=T(R);try{for(i.s();!(e=i.n()).done;){var n=e.value,a=new RegExp(n.identifier.toLowerCase()).exec(r);if(null!=a){if(t.name=n.name,t.group=n.group,n.version)P(n.version,n.versionSeparator?n.versionSeparator:".",t);else if(a[1])P(a[1],n.versionSeparator?n.versionSeparator:".",t);else if(n.versionIdentifier){var s=new RegExp(n.versionIdentifier.toLowerCase()).exec(r);null!=s&&s[1]&&P(s[1],n.versionSeparator?n.versionSeparator:".",t)}break}}}catch(e){i.e(e)}finally{i.f()}return t}(),O.isWindows=/^Windows$/i.test(O.os.group),O.isMacOS=/^Mac OS$/i.test(O.os.group),O.isLinux=/^Linux$/i.test(O.os.group),O.viewport=((_={}).width=D(window).width(),_.height=D(window).height(),_),O.device=(C=O.userAgent,(L=/\((iP(?:hone|ad|od))?(?:[^;]*; ){0,2}([^)]+(?=\)))/.exec(C))&&(L[1]||L[2])||""),void 0!==window.orientation&&function(){switch(window.orientation){case-90:case 90:O.viewport.orientation="landscape";break;default:O.viewport.orientation="portrait"}}();var N={},M=[],F=(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}).bind(window),B=(window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout).bind(window);function U(e,t){if(t)for(var r in t){var i=Object.getOwnPropertyDescriptor(t,r);i?Object.defineProperty(e,r,i):e[r]=t[r]}return e}function G(e,t){var r=function(e){function r(){var e;u(this,r);for(var n=arguments.length,a=new Array(n),s=0;s<n;s++)a[s]=arguments[s];return e=i(this,r,[].concat(a)),t.initialize&&t.initialize.apply(e,a),e}return f(r,e),d(r)}(e);return U(r.prototype,t),r}var V={fullscreenElement:function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},requestFullscreen:function(e){if(e.requestFullscreen)return e.requestFullscreen();if(e.webkitRequestFullscreen){if("function"==typeof e.then)return e.webkitRequestFullscreen();e.webkitRequestFullscreen()}else{if(e.mozRequestFullScreen)return e.mozRequestFullScreen();if(e.msRequestFullscreen)return e.msRequestFullscreen();e.querySelector&&e.querySelector("video")&&e.querySelector("video").webkitEnterFullScreen?e.querySelector("video").webkitEnterFullScreen():e.webkitEnterFullScreen&&e.webkitEnterFullScreen()}},cancelFullscreen:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;e.exitFullscreen?e.exitFullscreen():e.webkitCancelFullScreen?e.webkitCancelFullScreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.msExitFullscreen&&e.msExitFullscreen()},fullscreenEnabled:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},K=function(){return d((function e(){u(this,e)}),null,[{key:"_defaultConfig",value:function(){return{volume:{value:100,parse:parseInt}}}},{key:"_defaultValueFor",value:function(e){try{return this._defaultConfig()[e].parse(this._defaultConfig()[e].value)}catch(e){return}}},{key:"_createKeyspace",value:function(e){return"clappr.".concat(document.domain,".").concat(e)}},{key:"restore",value:function(e){return O.hasLocalstorage&&localStorage[this._createKeyspace(e)]?this._defaultConfig()[e].parse(localStorage[this._createKeyspace(e)]):this._defaultValueFor(e)}},{key:"persist",value:function(e,t){if(O.hasLocalstorage)try{return localStorage[this._createKeyspace(e)]=t,!0}catch(e){return!1}}}])}(),j=function(){return d((function e(){u(this,e)}),null,[{key:"params",get:function(){var e=window.location.search.substring(1);return e!==this.query&&(this._urlParams=this.parse(e),this.query=e),this._urlParams}},{key:"hashParams",get:function(){var e=window.location.hash.substring(1);return e!==this.hash&&(this._hashParams=this.parse(e),this.hash=e),this._hashParams}},{key:"parse",value:function(e){for(var t,r=/\+/g,i=/([^&=]+)=?([^&]*)/g,n=function(e){return decodeURIComponent(e.replace(r," "))},a={};t=i.exec(e);)a[n(t[1]).toLowerCase()]=n(t[2]);return a}}])}();function H(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"t",t=0,r=j.params[e]||j.hashParams[e]||"",i=r.match(/[0-9]+[hms]+/g)||[];if(i.length>0){var n={h:3600,m:60,s:1};i.forEach((function(e){if(e){var r=e[e.length-1],i=parseInt(e.slice(0,e.length-1),10);t+=i*n[r]}}))}else r&&(t=parseInt(r,10));return t}function Y(e){return N[e]||(N[e]=0),e+ ++N[e]}function W(e){return e-parseFloat(e)+1>=0}function $(){var e=document.getElementsByTagName("script");return e.length?e[e.length-1].src:""}function z(){return window.navigator&&window.navigator.language}function q(e,t){var r=(t=Object.assign({inline:!1,muted:!1,timeout:250,type:"video",source:b.mp4,element:null},t)).element?t.element:document.createElement(t.type);r.muted=t.muted,!0===t.muted&&r.setAttribute("muted","muted"),!0===t.inline&&r.setAttribute("playsinline","playsinline"),r.src=t.source;var i=r.play(),n=setTimeout((function(){a(!1,new Error("Timeout ".concat(t.timeout," ms has been reached")))}),t.timeout),a=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;clearTimeout(n),e(t,r)};void 0!==i?i.then((function(){return a(!0)})).catch((function(e){return a(!1,e)})):a(!0)}var X=function(){return d((function e(){u(this,e)}),null,[{key:"configure",value:function(e){this.options=D.extend(!0,this.options,e)}},{key:"create",value:function(e){return this.options.recycleVideo&&"video"===e&&M.length>0?M.shift():document.createElement(e)}},{key:"garbage",value:function(e){this.options.recycleVideo&&"VIDEO"===e.tagName.toUpperCase()&&(D(e).children().remove(),Object.values(e.attributes).forEach((function(t){return e.removeAttribute(t.name)})),M.push(e))}}])}();X.options={recycleVideo:!1};var Z=function(){return d((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;u(this,e),this.delay=t,this.lastTime=0}),[{key:"handle",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=(new Date).getTime(),n=i-this.lastTime;n<this.delay&&n>0&&(t(),r&&e.preventDefault()),this.lastTime=i}}])}(),Q={Config:K,Fullscreen:V,QueryString:j,DomRecycler:X,assign:U,extend:G,formatTime:function(e,t){if(!isFinite(e))return"--:--";e*=1e3;var r=(e=parseInt(e/1e3))%60,i=(e=parseInt(e/60))%60,n=(e=parseInt(e/60))%24,a=parseInt(e/24),s="";return a&&a>0&&(s+=a+":",n<1&&(s+="00:")),(n&&n>0||t)&&(s+=("0"+n).slice(-2)+":"),s+=("0"+i).slice(-2)+":",(s+=("0"+r).slice(-2)).trim()},seekStringToSeconds:H,uniqueId:Y,currentScriptUrl:$,isNumber:W,requestAnimationFrame:F,cancelAnimationFrame:B,getBrowserLanguage:z,now:function(){return window.performance&&window.performance.now?performance.now():Date.now()},removeArrayItem:function(e,t){var r=e.indexOf(t);r>=0&&e.splice(r,1)},listContainsIgnoreCase:function(e,t){return void 0!==e&&void 0!==t&&void 0!==t.find((function(t){return e.toLowerCase()===t.toLowerCase()}))},canAutoPlayMedia:q,Media:b,DoubleEventHandler:Z},J="font-weight: bold; font-size: 13px;",ee="color: #ff8000;"+J,te="color: #ff0000;"+J,re=["color: #0000ff;"+J,"color: #006600;"+J,ee,te,te],ie=["debug","info","warn","error","disabled"],ne=function(){return d((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;u(this,e),this.EXCLUDE_LIST=["timeupdate","playback:timeupdate","playback:progress","container:hover","container:timeupdate","container:progress"],this.level=t,this.previousLevel=this.level,this.offLevel=r}),[{key:"level",get:function(){return this._level},set:function(e){this._level=e}},{key:"debug",value:function(e){this.log(e,0,Array.prototype.slice.call(arguments,1))}},{key:"info",value:function(e){this.log(e,1,Array.prototype.slice.call(arguments,1))}},{key:"warn",value:function(e){this.log(e,2,Array.prototype.slice.call(arguments,1))}},{key:"error",value:function(e){this.log(e,3,Array.prototype.slice.call(arguments,1))}},{key:"onOff",value: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 "+ie[this.level],ee)}},{key:"log",value:function(e,t,r){if(!(this.EXCLUDE_LIST.indexOf(r[0])>=0||t<this.level)){r||(r=e,e=null);var i=re[t],n="";e&&(n="["+e+"]"),window.console&&window.console.log&&window.console.log.apply(console,["%c["+ie[t]+"]"+n,i].concat(r))}}}])}();ne.LEVEL_DEBUG=0,ne.LEVEL_INFO=1,ne.LEVEL_WARN=2,ne.LEVEL_ERROR=3,ne.getInstance=function(){return void 0===this._instance&&(this._instance=new this),this._instance},ne.setLevel=function(e){this.getInstance().level=e},ne.debug=function(){this.getInstance().debug.apply(this.getInstance(),arguments)},ne.info=function(){this.getInstance().info.apply(this.getInstance(),arguments)},ne.warn=function(){this.getInstance().warn.apply(this.getInstance(),arguments)},ne.error=function(){this.getInstance().error.apply(this.getInstance(),arguments)};var ae=Array.prototype.slice,se=/\s+/,oe=function(e,t,r,i){if(!r)return!0;if("object"===l(r)){for(var n in r)e[t].apply(e,[n,r[n]].concat(i));return!1}if(se.test(r)){for(var a=r.split(se),s=0,o=a.length;s<o;s++)e[t].apply(e,[a[s]].concat(i));return!1}return!0},le=function(e,t,r,i){var n,a=-1,s=e.length,o=t[0],l=t[1],u=t[2];!function c(){try{switch(t.length){case 0:for(;++a<s;)(n=e[a]).callback.call(n.ctx);return;case 1:for(;++a<s;)(n=e[a]).callback.call(n.ctx,o);return;case 2:for(;++a<s;)(n=e[a]).callback.call(n.ctx,o,l);return;case 3:for(;++a<s;)(n=e[a]).callback.call(n.ctx,o,l,u);return;default:for(;++a<s;)(n=e[a]).callback.apply(n.ctx,t);return}}catch(e){ne.error.apply(ne,[r,"error on event",i,"trigger","-",e]),c()}}()},ue=function(){function e(){u(this,e)}return d(e,[{key:"on",value:function(e,t,r){return oe(this,"on",e,[t,r])&&t?(this._events||(this._events={}),(this._events[e]||(this._events[e]=[])).push({callback:t,context:r,ctx:r||this}),this):this}},{key:"once",value:function(e,t,r){var i,n=this;if(!oe(this,"once",e,[t,r])||!t)return this;return i=function(){n.off(e,i),t.apply(this,arguments)},this.on(e,i,r)}},{key:"off",value:function(e,t,r){var i,n,a,s,o,l,u,c;if(!this._events||!oe(this,"off",e,[t,r]))return this;if(!e&&!t&&!r)return this._events=void 0,this;for(o=0,l=(s=e?[e]:Object.keys(this._events)).length;o<l;o++)if(e=s[o],a=this._events[e]){if(this._events[e]=i=[],t||r)for(u=0,c=a.length;u<c;u++)n=a[u],(t&&t!==n.callback&&t!==n.callback._callback||r&&r!==n.context)&&i.push(n);i.length||delete this._events[e]}return this}},{key:"trigger",value:function(e){var t=this.name||this.constructor.name;if(ne.debug.apply(ne,[t].concat(Array.prototype.slice.call(arguments))),!this._events)return this;var r=ae.call(arguments,1);if(!oe(this,"trigger",e,r))return this;var i=this._events[e],n=this._events.all;return i&&le(i,r,t,e),n&&le(n,arguments,t,e),this}},{key:"stopListening",value:function(e,t,r){var i=this._listeningTo;if(!i)return this;var n=!t&&!r;for(var a in r||"object"!==l(t)||(r=this),e&&((i={})[e._listenId]=e),i)(e=i[a]).off(t,r,this),(n||0===Object.keys(e._events).length)&&delete this._listeningTo[a];return this}}],[{key:"register",value:function(t){e.Custom||(e.Custom={});var r="string"==typeof t&&t.toUpperCase().trim();r&&!e.Custom[r]?e.Custom[r]=r.toLowerCase().split("_").map((function(e,t){return 0===t?e:e=e[0].toUpperCase()+e.slice(1)})).join(""):ne.error("Events","Error when register event: "+t)}},{key:"listAvailableCustomEvents",value:function(){return e.Custom||(e.Custom={}),Object.keys(e.Custom).filter((function(t){return"string"==typeof e.Custom[t]}))}}])}(),ce={listenTo:"on",listenToOnce:"once"};Object.keys(ce).forEach((function(e){ue.prototype[e]=function(t,r,i){return(this._listeningTo||(this._listeningTo={}))[t._listenId||(t._listenId=Y("l"))]=t,i||"object"!==l(r)||(i=this),t[ce[e]](r,i,this),this}})),ue.PLAYER_READY="ready",ue.PLAYER_RESIZE="resize",ue.PLAYER_FULLSCREEN="fullscreen",ue.PLAYER_PLAY="play",ue.PLAYER_PAUSE="pause",ue.PLAYER_STOP="stop",ue.PLAYER_ENDED="ended",ue.PLAYER_SEEK="seek",ue.PLAYER_ERROR="playererror",ue.ERROR="error",ue.PLAYER_TIMEUPDATE="timeupdate",ue.PLAYER_VOLUMEUPDATE="volumeupdate",ue.PLAYER_SUBTITLE_AVAILABLE="subtitleavailable",ue.PLAYBACK_PIP_ENTER="playback:picture-in-picture:enter",ue.PLAYBACK_PIP_EXIT="playback:picture-in-picture:exit",ue.PLAYBACK_PROGRESS="playback:progress",ue.PLAYBACK_TIMEUPDATE="playback:timeupdate",ue.PLAYBACK_READY="playback:ready",ue.PLAYBACK_BUFFERING="playback:buffering",ue.PLAYBACK_BUFFERFULL="playback:bufferfull",ue.PLAYBACK_SETTINGSUPDATE="playback:settingsupdate",ue.PLAYBACK_LOADEDMETADATA="playback:loadedmetadata",ue.PLAYBACK_HIGHDEFINITIONUPDATE="playback:highdefinitionupdate",ue.PLAYBACK_BITRATE="playback:bitrate",ue.PLAYBACK_LEVELS_AVAILABLE="playback:levels:available",ue.PLAYBACK_LEVEL_SWITCH_START="playback:levels:switch:start",ue.PLAYBACK_LEVEL_SWITCH_END="playback:levels:switch:end",ue.PLAYBACK_PLAYBACKSTATE="playback:playbackstate",ue.PLAYBACK_DVR="playback:dvr",ue.PLAYBACK_MEDIACONTROL_DISABLE="playback:mediacontrol:disable",ue.PLAYBACK_MEDIACONTROL_ENABLE="playback:mediacontrol:enable",ue.PLAYBACK_ENDED="playback:ended",ue.PLAYBACK_PLAY_INTENT="playback:play:intent",ue.PLAYBACK_PLAY="playback:play",ue.PLAYBACK_PAUSE="playback:pause",ue.PLAYBACK_SEEK="playback:seek",ue.PLAYBACK_SEEKED="playback:seeked",ue.PLAYBACK_STOP="playback:stop",ue.PLAYBACK_ERROR="playback:error",ue.PLAYBACK_STATS_ADD="playback:stats:add",ue.PLAYBACK_FRAGMENT_LOADED="playback:fragment:loaded",ue.PLAYBACK_LEVEL_SWITCH="playback:level:switch",ue.PLAYBACK_SUBTITLE_AVAILABLE="playback:subtitle:available",ue.PLAYBACK_SUBTITLE_CHANGED="playback:subtitle:changed",ue.PLAYBACK_AUDIO_AVAILABLE="playback:audio:available",ue.PLAYBACK_AUDIO_CHANGED="playback:audio:changed",ue.CORE_CONTAINERS_CREATED="core:containers:created",ue.CORE_ACTIVE_CONTAINER_CHANGED="core:active:container:changed",ue.CORE_OPTIONS_CHANGE="core:options:change",ue.CORE_READY="core:ready",ue.CORE_FULLSCREEN="core:fullscreen",ue.CORE_RESIZE="core:resize",ue.CORE_SCREEN_ORIENTATION_CHANGED="core:screen:orientation:changed",ue.CORE_MOUSE_MOVE="core:mousemove",ue.CORE_MOUSE_LEAVE="core:mouseleave",ue.CONTAINER_PLAYBACKSTATE="container:playbackstate",ue.CONTAINER_PLAYBACKDVRSTATECHANGED="container:dvr",ue.CONTAINER_BITRATE="container:bitrate",ue.CONTAINER_STATS_REPORT="container:stats:report",ue.CONTAINER_DESTROYED="container:destroyed",ue.CONTAINER_READY="container:ready",ue.CONTAINER_RESIZE="container:resize",ue.CONTAINER_ERROR="container:error",ue.CONTAINER_LOADEDMETADATA="container:loadedmetadata",ue.CONTAINER_SUBTITLE_AVAILABLE="container:subtitle:available",ue.CONTAINER_SUBTITLE_CHANGED="container:subtitle:changed",ue.CONTAINER_AUDIO_AVAILABLE="container:audio:available",ue.CONTAINER_AUDIO_CHANGED="container:audio:changed",ue.CONTAINER_TIMEUPDATE="container:timeupdate",ue.CONTAINER_PROGRESS="container:progress",ue.CONTAINER_PLAY="container:play",ue.CONTAINER_STOP="container:stop",ue.CONTAINER_PAUSE="container:pause",ue.CONTAINER_ENDED="container:ended",ue.CONTAINER_CLICK="container:click",ue.CONTAINER_DBLCLICK="container:dblclick",ue.CONTAINER_CONTEXTMENU="container:contextmenu",ue.CONTAINER_MOUSE_ENTER="container:mouseenter",ue.CONTAINER_MOUSE_LEAVE="container:mouseleave",ue.CONTAINER_MOUSE_UP="container:mouseup",ue.CONTAINER_MOUSE_DOWN="container:mousedown",ue.CONTAINER_PIP_ENTER="container:picture-in-picture:enter",ue.CONTAINER_PIP_EXIT="container:picture-in-picture:exit",ue.CONTAINER_SEEK="container:seek",ue.CONTAINER_SEEKED="container:seeked",ue.CONTAINER_VOLUME="container:volume",ue.CONTAINER_FULLSCREEN="container:fullscreen",ue.CONTAINER_STATE_BUFFERING="container:state:buffering",ue.CONTAINER_STATE_BUFFERFULL="container:state:bufferfull",ue.CONTAINER_SETTINGSUPDATE="container:settingsupdate",ue.CONTAINER_HIGHDEFINITIONUPDATE="container:highdefinitionupdate",ue.CONTAINER_MEDIACONTROL_SHOW="container:mediacontrol:show",ue.CONTAINER_MEDIACONTROL_HIDE="container:mediacontrol:hide",ue.CONTAINER_MEDIACONTROL_DISABLE="container:mediacontrol:disable",ue.CONTAINER_MEDIACONTROL_ENABLE="container:mediacontrol:enable",ue.CONTAINER_STATS_ADD="container:stats:add",ue.CONTAINER_OPTIONS_CHANGE="container:options:change",ue.MEDIACONTROL_RENDERED="mediacontrol:rendered",ue.MEDIACONTROL_FULLSCREEN="mediacontrol:fullscreen",ue.MEDIACONTROL_SHOW="mediacontrol:show",ue.MEDIACONTROL_HIDE="mediacontrol:hide",ue.MEDIACONTROL_MOUSEMOVE_SEEKBAR="mediacontrol:mousemove:seekbar",ue.MEDIACONTROL_MOUSELEAVE_SEEKBAR="mediacontrol:mouseleave:seekbar",ue.MEDIACONTROL_PLAYING="mediacontrol:playing",ue.MEDIACONTROL_NOTPLAYING="mediacontrol:notplaying",ue.MEDIACONTROL_CONTAINERCHANGED="mediacontrol:containerchanged",ue.MEDIACONTROL_OPTIONS_CHANGE="mediacontrol:options:change";var de=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return u(this,t),(e=i(this,t,[r]))._options=r,e.uniqueId=Y("o"),e}return f(t,e),d(t,[{key:"options",get:function(){return this._options}}])}(ue),he={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},fe=/(.)^/,pe={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},ge=/\\|'|\r|\n|\t|\u2028|\u2029/g,ve={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},me=new RegExp("[&<>\"']","g"),ye=function(e){return null===e?"":(""+e).replace(me,(function(e){return ve[e]}))},Ae=0,Ee=function(e,t){var r,i=new RegExp([(he.escape||fe).source,(he.interpolate||fe).source,(he.evaluate||fe).source].join("|")+"|$","g"),n=0,a="__p+='";e.replace(i,(function(t,r,i,s,o){return a+=e.slice(n,o).replace(ge,(function(e){return"\\"+pe[e]})),r&&(a+="'+\n((__t=("+r+"))==null?'':escapeExpr(__t))+\n'"),i&&(a+="'+\n((__t=("+i+"))==null?'':__t)+\n'"),s&&(a+="';\n"+s+"\n__p+='"),n=o+t.length,t})),a+="';\n",he.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n//# sourceURL=/microtemplates/source["+Ae+++"]";try{r=new Function(he.variable||"obj","escapeExpr",a)}catch(e){throw e.source=a,e}if(t)return r(t,ye);var s=function(e){return r.call(this,e,ye)};return s.source="function("+(he.variable||"obj")+"){\n"+a+"}",s};Ee.settings=he;var Te={getStyleFor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{baseUrl:""};return D('<style class="clappr-style"></style>').html(Ee(e.toString())(t))}},be=/^(\S+)\s*(.*)$/,ke=function(e){function t(e){var r;return u(this,t),(r=i(this,t,[e])).cid=Y("c"),r._ensureElement(),r.delegateEvents(),r}return f(t,e),d(t,[{key:"tagName",get:function(){return"div"}},{key:"events",get:function(){return{}}},{key:"attributes",get:function(){return{}}},{key:"$",value:function(e){return this.$el.find(e)}},{key:"render",value:function(){return this}},{key:"destroy",value:function(){return this.$el.remove(),this.stopListening(),this.undelegateEvents(),this}},{key:"setElement",value:function(e,t){return this.$el&&this.undelegateEvents(),this.$el=D.zepto.isZ(e)?e:D(e),this.el=this.$el[0],!1!==t&&this.delegateEvents(),this}},{key:"delegateEvents",value:function(e){for(var t in e||(e=this.events),this.undelegateEvents(),e){var r=e[t];if(r&&r.constructor!==Function&&(r=this[e[t]]),r){var i=t.match(be),n=i[1],a=i[2];n+=".delegateEvents"+this.cid,""===a?this.$el.on(n,r.bind(this)):this.$el.on(n,a,r.bind(this))}}return this}},{key:"undelegateEvents",value:function(){return this.$el.off(".delegateEvents"+this.cid),this}},{key:"_ensureElement",value:function(){if(this.el)this.setElement(this.el,!1);else{var e=D.extend(!0,{},this.attributes);this.id&&(e.id=this.id),this.className&&(e.class=this.className);var t=D(X.create(this.tagName)).attr(e);this.setElement(t,!1)}}}])}(de),Se=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return u(this,t),(e=i(this,t,[r])).core=n,e}return f(t,e),d(t,[{key:"name",get:function(){return"error"}},{key:"createError",value:function(e){this.core?this.core.trigger(ue.ERROR,e):ne.warn(this.name,"Core is not set. Error: ",e)}}],[{key:"Levels",get:function(){return{FATAL:"FATAL",WARN:"WARN",INFO:"INFO"}}}])}(de),_e={createError:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{useCodePrefix:!0},r=this.constructor&&this.constructor.type||"",i=this.name||r,n=this.i18n||this.core&&this.core.i18n||this.container&&this.container.i18n,a="".concat(i,":").concat(e&&e.code||"unknown"),s={description:"",level:Se.Levels.FATAL,origin:i,scope:r,raw:{}},o=Object.assign({},s,e,{code:t.useCodePrefix?a:e.code});if(n&&o.level==Se.Levels.FATAL&&!o.UI){var l={title:n.t("default_error_title"),message:n.t("default_error_message")};o.UI=l}return this.playerError?this.playerError.createError(o):ne.warn(i,"PlayerError is not defined. Error: ",o),o}},Ce=function(e){function t(e){var r;return u(this,t),(r=i(this,t,[e.options])).core=e,r.enabled=!0,r.bindEvents(),r.render(),r}return f(t,e),d(t,[{key:"playerError",get:function(){return this.core.playerError}},{key:"bindEvents",value:function(){}},{key:"getExternalInterface",value:function(){return{}}},{key:"enable",value:function(){this.enabled||(this.bindEvents(),this.$el.show(),this.enabled=!0)}},{key:"disable",value:function(){this.stopListening(),this.$el.hide(),this.enabled=!1}},{key:"render",value:function(){return this}}])}(ke);Object.assign(Ce.prototype,_e),Ce.extend=function(e){return G(Ce,e)},Ce.type="core";var Le=function(e){function t(e,r,n){var a;return u(this,t),(a=i(this,t,[e]))._i18n=r,a.currentTime=0,a.volume=100,a.playback=e.playback,a.playerError=n,a.settings=D.extend(!0,{},a.playback.settings),a.isReady=!1,a.mediaControlDisabled=!1,a.plugins=[a.playback],a.dblTapHandler=new Z(500),a.clickTimer=null,a.clickDelay=200,a.actionsMetadata={},a.bindEvents(),a}return f(t,e),d(t,[{key:"name",get:function(){return"Container"}},{key:"attributes",get:function(){return{class:"container","data-container":""}}},{key:"events",get:function(){return{click:"clicked",dblclick:"dblClicked",touchend:"dblTap",contextmenu:"onContextMenu",mouseenter:"mouseEnter",mouseleave:"mouseLeave",mouseup:"onMouseUp",mousedown:"onMouseDown"}}},{key:"ended",get:function(){return this.playback.ended}},{key:"buffering",get:function(){return this.playback.buffering}},{key:"i18n",get:function(){return this._i18n}},{key:"hasClosedCaptionsTracks",get:function(){return this.playback.hasClosedCaptionsTracks}},{key:"closedCaptionsTracks",get:function(){return this.playback.closedCaptionsTracks}},{key:"closedCaptionsTrackId",get:function(){return this.playback.closedCaptionsTrackId},set:function(e){this.playback.closedCaptionsTrackId=e}},{key:"audioTracks",get:function(){return this.playback.audioTracks}},{key:"currentAudioTrack",get:function(){return this.playback.currentAudioTrack}},{key:"isPiPActive",get:function(){return this.playback.isPiPActive}},{key:"bindEvents",value:function(){this.listenTo(this.playback,ue.PLAYBACK_PROGRESS,this.onProgress),this.listenTo(this.playback,ue.PLAYBACK_TIMEUPDATE,this.timeUpdated),this.listenTo(this.playback,ue.PLAYBACK_READY,this.ready),this.listenTo(this.playback,ue.PLAYBACK_BUFFERING,this.onBuffering),this.listenTo(this.playback,ue.PLAYBACK_BUFFERFULL,this.bufferfull),this.listenTo(this.playback,ue.PLAYBACK_SETTINGSUPDATE,this.settingsUpdate),this.listenTo(this.playback,ue.PLAYBACK_LOADEDMETADATA,this.loadedMetadata),this.listenTo(this.playback,ue.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinitionUpdate),this.listenTo(this.playback,ue.PLAYBACK_BITRATE,this.updateBitrate),this.listenTo(this.playback,ue.PLAYBACK_PLAYBACKSTATE,this.playbackStateChanged),this.listenTo(this.playback,ue.PLAYBACK_DVR,this.playbackDvrStateChanged),this.listenTo(this.playback,ue.PLAYBACK_MEDIACONTROL_DISABLE,this.disableMediaControl),this.listenTo(this.playback,ue.PLAYBACK_MEDIACONTROL_ENABLE,this.enableMediaControl),this.listenTo(this.playback,ue.PLAYBACK_SEEK,this.onSeek),this.listenTo(this.playback,ue.PLAYBACK_SEEKED,this.onSeeked),this.listenTo(this.playback,ue.PLAYBACK_ENDED,this.onEnded),this.listenTo(this.playback,ue.PLAYBACK_PLAY,this.playing),this.listenTo(this.playback,ue.PLAYBACK_PAUSE,this.paused),this.listenTo(this.playback,ue.PLAYBACK_STOP,this.stopped),this.listenTo(this.playback,ue.PLAYBACK_ERROR,this.error),this.listenTo(this.playback,ue.PLAYBACK_SUBTITLE_AVAILABLE,this.subtitleAvailable),this.listenTo(this.playback,ue.PLAYBACK_SUBTITLE_CHANGED,this.subtitleChanged),this.listenTo(this.playback,ue.PLAYBACK_AUDIO_AVAILABLE,this.audioAvailable),this.listenTo(this.playback,ue.PLAYBACK_AUDIO_CHANGED,this.audioChanged),this.listenTo(this.playback,ue.PLAYBACK_PIP_ENTER,this.onEnterPiP),this.listenTo(this.playback,ue.PLAYBACK_PIP_EXIT,this.onExitPiP)}},{key:"subtitleAvailable",value:function(){this.trigger(ue.CONTAINER_SUBTITLE_AVAILABLE)}},{key:"subtitleChanged",value:function(e){this.trigger(ue.CONTAINER_SUBTITLE_CHANGED,e)}},{key:"audioAvailable",value:function(e){this.trigger(ue.CONTAINER_AUDIO_AVAILABLE,e)}},{key:"audioChanged",value:function(e){this.trigger(ue.CONTAINER_AUDIO_CHANGED,e)}},{key:"playbackStateChanged",value:function(e){this.trigger(ue.CONTAINER_PLAYBACKSTATE,e)}},{key:"playbackDvrStateChanged",value:function(e){this.settings=this.playback.settings,this.dvrInUse=e,this.trigger(ue.CONTAINER_PLAYBACKDVRSTATECHANGED,e)}},{key:"updateBitrate",value:function(e){this.trigger(ue.CONTAINER_BITRATE,e)}},{key:"statsReport",value:function(e){this.trigger(ue.CONTAINER_STATS_REPORT,e)}},{key:"getPlaybackType",value:function(){return this.playback.getPlaybackType()}},{key:"isDvrEnabled",value:function(){return!!this.playback.dvrEnabled}},{key:"isDvrInUse",value:function(){return!!this.dvrInUse}},{key:"destroy",value:function(){this.disableResizeObserver(),this.trigger(ue.CONTAINER_DESTROYED,this,this.name),this.stopListening(),this.plugins.forEach((function(e){return e.destroy()})),this.$el.remove()}},{key:"setStyle",value:function(e){this.$el.css(e)}},{key:"animate",value:function(e,t){return this.$el.animate(e,t).promise()}},{key:"ready",value:function(){this.isReady=!0,this.trigger(ue.CONTAINER_READY,this.name)}},{key:"isPlaying",value:function(){return this.playback.isPlaying()}},{key:"getStartTimeOffset",value:function(){return this.playback.getStartTimeOffset()}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getDuration",value:function(){return this.playback.getDuration()}},{key:"error",value:function(e){this.isReady||this.ready(),this.trigger(ue.CONTAINER_ERROR,e,this.name)}},{key:"loadedMetadata",value:function(e){this.trigger(ue.CONTAINER_LOADEDMETADATA,e)}},{key:"timeUpdated",value:function(e){this.currentTime=e.current,this.trigger(ue.CONTAINER_TIMEUPDATE,e,this.name)}},{key:"onProgress",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.trigger.apply(this,[ue.CONTAINER_PROGRESS].concat(t,[this.name]))}},{key:"playing",value:function(){this.trigger(ue.CONTAINER_PLAY,this.name,this.actionsMetadata.playEvent||{}),this.actionsMetadata.playEvent={}}},{key:"paused",value:function(){this.trigger(ue.CONTAINER_PAUSE,this.name,this.actionsMetadata.pauseEvent||{}),this.actionsMetadata.pauseEvent={}}},{key:"stopped",value:function(){this.trigger(ue.CONTAINER_STOP,this.actionsMetadata.stopEvent||{}),this.actionsMetadata.stopEvent={}}},{key:"play",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.actionsMetadata.playEvent=e,this.playback.play(e)}},{key:"stop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.actionsMetadata.stopEvent=e,this.playback.stop(e),this.currentTime=0}},{key:"switchAudioTrack",value:function(e){this.playback.switchAudioTrack(e)}},{key:"pause",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.actionsMetadata.pauseEvent=e,this.playback.pause(e)}},{key:"onEnded",value:function(){this.trigger(ue.CONTAINER_ENDED,this,this.name),this.currentTime=0}},{key:"clicked",value:function(){var e=this;this.options.chromeless&&!this.options.allowUserInteraction||(this.clickTimer=setTimeout((function(){e.clickTimer&&e.trigger(ue.CONTAINER_CLICK,e,e.name)}),this.clickDelay))}},{key:"cancelClicked",value:function(){clearTimeout(this.clickTimer),this.clickTimer=null}},{key:"dblClicked",value:function(){this.options.chromeless&&!this.options.allowUserInteraction||(this.cancelClicked(),this.trigger(ue.CONTAINER_DBLCLICK,this,this.name))}},{key:"dblTap",value:function(e){var t=this;this.options.chromeless&&!this.options.allowUserInteraction||this.dblTapHandler.handle(e,(function(){t.cancelClicked(),t.trigger(ue.CONTAINER_DBLCLICK,t,t.name)}))}},{key:"onContextMenu",value:function(e){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(ue.CONTAINER_CONTEXTMENU,e,this.name)}},{key:"seek",value:function(e){this.playback.seek(e)}},{key:"onSeek",value:function(e){this.trigger(ue.CONTAINER_SEEK,e,this.name)}},{key:"onSeeked",value:function(){this.trigger(ue.CONTAINER_SEEKED,this.name)}},{key:"seekPercentage",value:function(e){var t=this.getDuration();if(e>=0&&e<=100){var r=t*(e/100);this.seek(r)}}},{key:"setVolume",value:function(e){this.volume=parseFloat(e),this.trigger(ue.CONTAINER_VOLUME,this.volume,this.name),this.playback.volume(this.volume)}},{key:"fullscreen",value:function(){this.trigger(ue.CONTAINER_FULLSCREEN,this.name)}},{key:"onBuffering",value:function(){this.trigger(ue.CONTAINER_STATE_BUFFERING,this.name)}},{key:"bufferfull",value:function(){this.trigger(ue.CONTAINER_STATE_BUFFERFULL,this.name)}},{key:"onEnterPiP",value:function(){this.trigger(ue.CONTAINER_PIP_ENTER,this.name)}},{key:"onExitPiP",value:function(){this.trigger(ue.CONTAINER_PIP_EXIT,this.name)}},{key:"addPlugin",value:function(e){this.plugins.push(e)}},{key:"hasPlugin",value:function(e){return!!this.getPlugin(e)}},{key:"getPlugin",value:function(e){return this.plugins.filter((function(t){return t.name===e}))[0]}},{key:"mouseEnter",value:function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(ue.CONTAINER_MOUSE_ENTER)}},{key:"mouseLeave",value:function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(ue.CONTAINER_MOUSE_LEAVE)}},{key:"mouseUp",value:function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(ue.CONTAINER_MOUSE_UP)}},{key:"mouseDown",value:function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(ue.CONTAINER_MOUSE_DOWN)}},{key:"enterPiP",value:function(){this.playback.enterPiP()}},{key:"exitPiP",value:function(){this.playback.exitPiP()}},{key:"settingsUpdate",value:function(){this.settings=this.playback.settings,this.trigger(ue.CONTAINER_SETTINGSUPDATE)}},{key:"highDefinitionUpdate",value:function(e){this.trigger(ue.CONTAINER_HIGHDEFINITIONUPDATE,e)}},{key:"isHighDefinitionInUse",value:function(){return this.playback.isHighDefinitionInUse()}},{key:"disableMediaControl",value:function(){this.mediaControlDisabled||(this.mediaControlDisabled=!0,this.trigger(ue.CONTAINER_MEDIACONTROL_DISABLE))}},{key:"enableMediaControl",value:function(){this.mediaControlDisabled&&(this.mediaControlDisabled=!1,this.trigger(ue.CONTAINER_MEDIACONTROL_ENABLE))}},{key:"updateStyle",value:function(){!this.options.chromeless||this.options.allowUserInteraction?this.$el.removeClass("chromeless"):this.$el.addClass("chromeless")}},{key:"enableResizeObserver",value:function(){var e=this;this.disableResizeObserver(),this.resizeObserverInterval=setInterval((function(){return e.checkResize()}),500)}},{key:"disableResizeObserver",value:function(){this.resizeObserverInterval&&clearInterval(this.resizeObserverInterval)}},{key:"checkResize",value:function(){var e={width:this.el.clientWidth,height:this.el.clientHeight},t=this.currentSize||{},r=t.width;(t.height!==e.height||r!==e.width)&&(this.currentSize=e,this.trigger(ue.CONTAINER_RESIZE,e))}},{key:"configure",value:function(e){this._options=D.extend(!0,this._options,e),this.updateStyle(),this.playback.configure(this.options),this.trigger(ue.CONTAINER_OPTIONS_CHANGE)}},{key:"render",value:function(){var e=Te.getStyleFor(".container[data-container] {\n position: absolute;\n background-color: black;\n height: 100%;\n width: 100%;\n max-width: 100%; }\n .container[data-container] .chromeless {\n cursor: default; }\n\n[data-player]:not(.nocursor) .container[data-container]:not(.chromeless).pointer-enabled {\n cursor: pointer; }\n".toString(),{baseUrl:this.options.baseUrl});return this.$el.append(e[0]),this.$el.append(this.playback.render().el),this.updateStyle(),this.checkResize(),this.enableResizeObserver(),this}}])}(ke);Object.assign(Le.prototype,_e);var De=function(e){function t(e,r,n){var a;return u(this,t),(a=i(this,t,[e])).settings={},a._i18n=r,a.playerError=n,a._consented=!1,a}return f(t,e),d(t,[{key:"isAudioOnly",get:function(){return!1}},{key:"isAdaptive",get:function(){return!1}},{key:"ended",get:function(){return!1}},{key:"i18n",get:function(){return this._i18n}},{key:"buffering",get:function(){return!1}},{key:"latency",get:function(){return null}},{key:"currentProgramDateTime",get:function(){return null}},{key:"isPiPActive",get:function(){return!1}},{key:"consent",value:function(e){"function"==typeof e&&e()}},{key:"play",value:function(){}},{key:"pause",value:function(){}},{key:"stop",value:function(){}},{key:"enterPiP",value:function(){}},{key:"exitPiP",value:function(){}},{key:"seek",value:function(e){}},{key:"seekPercentage",value:function(e){}},{key:"getStartTimeOffset",value:function(){return 0}},{key:"getDuration",value:function(){return 0}},{key:"isPlaying",value:function(){return!1}},{key:"isReady",get:function(){return!1}},{key:"hasClosedCaptionsTracks",get:function(){return this.closedCaptionsTracks.length>0}},{key:"closedCaptionsTracks",get:function(){return[]}},{key:"closedCaptionsTrackId",get:function(){return-1},set:function(e){}},{key:"audioTracks",get:function(){return[]}},{key:"currentAudioTrack",get:function(){return null}},{key:"switchAudioTrack",value:function(e){}},{key:"getPlaybackType",value:function(){return t.NO_OP}},{key:"isHighDefinitionInUse",value:function(){return!1}},{key:"mute",value:function(){}},{key:"unmute",value:function(){}},{key:"volume",value:function(e){}},{key:"configure",value:function(e){this._options=D.extend(!0,this._options,e)}},{key:"attemptAutoPlay",value:function(){var e=this;this.canAutoPlay((function(t,r){t&&e.play()}))}},{key:"canAutoPlay",value:function(e){e(!0,null)}}])}(ke);Object.assign(De.prototype,_e),De.extend=function(e){return G(De,e)},De.canPlay=function(e,t){return!1},De.VOD="vod",De.AOD="aod",De.LIVE="live",De.NO_OP="no_op",De.type="playback";var Ie=function(e){function t(e,r,n,a){var s;return u(this,t),(s=i(this,t,[e]))._i18n=n,s.loader=r,s.playerError=a,s}return f(t,e),d(t,[{key:"options",get:function(){return this._options},set:function(e){this._options=e}},{key:"createContainers",value:function(){var e=this;return D.Deferred((function(t){t.resolve(e.options.sources.map((function(t){return e.createContainer(t)})))}))}},{key:"findPlaybackPlugin",value:function(e,t){return this.loader.playbackPlugins.filter((function(r){return r.canPlay(e,t)}))[0]}},{key:"createContainer",value:function(e){var t=null,r=this.options.mimeType;"object"===l(e)?(t=e.source.toString(),e.mimeType&&(r=e.mimeType)):t=e.toString(),t.match(/^\/\//)&&(t=window.location.protocol+t);var i=s(s({},this.options),{},{src:t,mimeType:r}),n=this.findPlaybackPlugin(t,r),a=n?new n(i,this._i18n,this.playerError):new De;i=s(s({},i),{},{playback:a});var o=new Le(i,this._i18n,this.playerError),u=D.Deferred();return u.promise(o),this.addContainerPlugins(o),this.listenToOnce(o,ue.CONTAINER_READY,(function(){return u.resolve(o)})),o}},{key:"addContainerPlugins",value:function(e){this.loader.containerPlugins.forEach((function(t){e.addPlugin(new t(e))}))}}])}(de),Re=function(e){function t(e){var r;return u(this,t),(r=i(this,t,[e])).playerError=new Se(e,r),r.configureDomRecycler(),r.firstResize=!0,r.styleRendered=!1,r.plugins=[],r.containers=[],r._boundFullscreenHandler=function(){return r.handleFullscreenChange()},D(document).bind("fullscreenchange",r._boundFullscreenHandler),D(document).bind("MSFullscreenChange",r._boundFullscreenHandler),D(document).bind("mozfullscreenchange",r._boundFullscreenHandler),O.isMobile&&D(window).bind("resize",(function(e){r.handleWindowResize(e)})),r}return f(t,e),d(t,[{key:"events",get:function(){return{webkitfullscreenchange:"handleFullscreenChange",mousemove:"onMouseMove",mouseleave:"onMouseLeave"}}},{key:"attributes",get:function(){return{"data-player":"",tabindex:9999}}},{key:"isReady",get:function(){return!!this.ready}},{key:"i18n",get:function(){return this.getPlugin("strings")||{t:function(e){return e}}}},{key:"mediaControl",get:function(){return this._mediaControl||(this._mediaControl=this.getPlugin("media_control"))||this.dummyMediaControl}},{key:"dummyMediaControl",get:function(){return this._dummyMediaControl||(this._dummyMediaControl=new Ce(this)),this._dummyMediaControl}},{key:"activeContainer",get:function(){return this._activeContainer},set:function(e){this._activeContainer=e,this.trigger(ue.CORE_ACTIVE_CONTAINER_CHANGED,this._activeContainer)}},{key:"activePlayback",get:function(){return this.activeContainer&&this.activeContainer.playback}},{key:"activePlaybackEl",get:function(){if(this.activePlayback)return this.activePlayback.$el?this.activePlayback.$el.find("video")[0]:this.activePlayback.el}},{key:"configureDomRecycler",value:function(){var e=this.options&&this.options.playback&&this.options.playback.recycleVideo;X.configure({recycleVideo:e})}},{key:"createContainers",value:function(e){this.defer=D.Deferred(),this.defer.promise(this),this.containerFactory=new Ie(e,e.loader,this.i18n,this.playerError),this.prepareContainers()}},{key:"prepareContainers",value:function(){var e=this;this.containerFactory.createContainers().then((function(t){return e.setupContainers(t)})).then((function(t){return e.resolveOnContainersReady(t)}))}},{key:"updateSize",value:function(){this.isFullscreen()?this.setFullscreen():this.setPlayerSize()}},{key:"setFullscreen",value:function(){O.isiOS||(this.$el.addClass("fullscreen"),this.$el.removeAttr("style"),this.previousSize={width:this.options.width,height:this.options.height},this.currentSize={width:D(window).width(),height:D(window).height()})}},{key:"setPlayerSize",value:function(){this.$el.removeClass("fullscreen"),this.currentSize=this.previousSize,this.previousSize={width:D(window).width(),height:D(window).height()},this.resize(this.currentSize)}},{key:"resize",value:function(e){W(e.height)||W(e.width)?(this.el.style.height="".concat(e.height,"px"),this.el.style.width="".concat(e.width,"px")):(this.el.style.height="".concat(e.height),this.el.style.width="".concat(e.width)),this.previousSize={width:this.options.width,height:this.options.height},this.options.width=e.width,this.options.height=e.height,this.currentSize=e,this.triggerResize(this.currentSize)}},{key:"enableResizeObserver",value:function(){var e=this;this.disableResizeObserver();this.resizeObserverInterval=setInterval((function(){e.triggerResize({width:e.el.clientWidth,height:e.el.clientHeight})}),500)}},{key:"triggerResize",value:function(e){(this.firstResize||this.oldHeight!==e.height||this.oldWidth!==e.width)&&(this.oldHeight=e.height,this.oldWidth=e.width,this.computedSize=e,this.firstResize=!1,this.trigger(ue.CORE_RESIZE,e))}},{key:"disableResizeObserver",value:function(){this.resizeObserverInterval&&clearInterval(this.resizeObserverInterval),this.resizeObserverInterval=null}},{key:"resolveOnContainersReady",value:function(e){var t=this;D.when.apply(D,e).done((function(){t.defer.resolve(t),t.ready=!0,t.trigger(ue.CORE_READY)}))}},{key:"addPlugin",value:function(e){this.plugins.push(e)}},{key:"hasPlugin",value:function(e){return!!this.getPlugin(e)}},{key:"getPlugin",value:function(e){return this.plugins.filter((function(t){return t.name===e}))[0]}},{key:"load",value:function(e,t){this.options.mimeType=t,e=e&&e.constructor===Array?e:[e],this.options.sources=e,this.containers.forEach((function(e){return e.destroy()})),this.containerFactory.options=D.extend(!0,this.options,{sources:e}),this.prepareContainers()}},{key:"destroy",value:function(){this.disableResizeObserver(),this.containers.forEach((function(e){return e.destroy()})),this.plugins.forEach((function(e){return e.destroy()})),this.$el.remove(),D(document).unbind("fullscreenchange",this._boundFullscreenHandler),D(document).unbind("MSFullscreenChange",this._boundFullscreenHandler),D(document).unbind("mozfullscreenchange",this._boundFullscreenHandler),this.stopListening()}},{key:"handleFullscreenChange",value:function(){this.trigger(ue.CORE_FULLSCREEN,this.isFullscreen()),this.updateSize()}},{key:"handleWindowResize",value:function(e){var t=window.innerWidth>window.innerHeight?"landscape":"portrait";this._screenOrientation!==t&&(this._screenOrientation=t,this.triggerResize({width:this.el.clientWidth,height:this.el.clientHeight}),this.trigger(ue.CORE_SCREEN_ORIENTATION_CHANGED,{event:e,orientation:this._screenOrientation}))}},{key:"removeContainer",value:function(e){this.stopListening(e),this.containers=this.containers.filter((function(t){return t!==e}))}},{key:"setupContainer",value:function(e){this.listenTo(e,ue.CONTAINER_DESTROYED,this.removeContainer),this.containers.push(e)}},{key:"setupContainers",value:function(e){return e.forEach(this.setupContainer.bind(this)),this.trigger(ue.CORE_CONTAINERS_CREATED),this.renderContainers(),this.activeContainer=e[0],this.render(),this.appendToParent(),this.containers}},{key:"renderContainers",value:function(){var e=this;this.containers.forEach((function(t){return e.el.appendChild(t.render().el)}))}},{key:"createContainer",value:function(e,t){var r=this.containerFactory.createContainer(e,t);return this.setupContainer(r),this.el.appendChild(r.render().el),r}},{key:"getCurrentContainer",value:function(){return this.activeContainer}},{key:"getCurrentPlayback",value:function(){return this.activePlayback}},{key:"getPlaybackType",value:function(){return this.activeContainer&&this.activeContainer.getPlaybackType()}},{key:"isFullscreen",value:function(){var e=V.fullscreenElement();return e&&e===this.el||e&&e===this.activePlaybackEl||this.activePlaybackEl&&this.activePlaybackEl.webkitDisplayingFullscreen||!1}},{key:"toggleFullscreen",value:function(){var e=this;if(this.isFullscreen()){var t=O.isiOS?this.activePlaybackEl:document;V.cancelFullscreen(t),!O.isiOS&&this.$el.removeClass("fullscreen nocursor")}else{var r=O.isiOS?this.activePlaybackEl:this.el;if(!r)return;O.isSafari||O.isiOS?V.requestFullscreen(r):V.requestFullscreen(r).then((function(e){return e}),(function(t){return setTimeout((function(){if(!e.isFullscreen())throw new ReferenceError(t)}),600)})),!O.isiOS&&this.$el.addClass("fullscreen")}}},{key:"onMouseMove",value:function(e){this.trigger(ue.CORE_MOUSE_MOVE,e)}},{key:"onMouseLeave",value:function(e){this.trigger(ue.CORE_MOUSE_LEAVE,e)}},{key:"configure",value:function(e){var t=this;this._options=D.extend(!0,this._options,e),this.configureDomRecycler();var r=e.source||e.sources;r&&this.load(r,e.mimeType||this.options.mimeType),this.trigger(ue.CORE_OPTIONS_CHANGE,e),this.containers.forEach((function(e){return e.configure(t.options)}))}},{key:"appendToParent",value:function(){!(this.$el.parent()&&this.$el.parent().length)&&this.$el.appendTo(this.options.parentElement)}},{key:"appendStyles",value:function(){if(!this.styleRendered){var e=Te.getStyleFor('[data-player] {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -o-user-select: none;\n user-select: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n transform: translate3d(0, 0, 0);\n position: relative;\n margin: 0;\n padding: 0;\n border: 0;\n font-style: normal;\n font-weight: normal;\n text-align: center;\n overflow: hidden;\n font-size: 100%;\n font-family: "Roboto", "Open Sans", Arial, sans-serif;\n text-shadow: 0 0 0;\n box-sizing: border-box; }\n [data-player]:focus {\n outline: 0; }\n [data-player] * {\n box-sizing: inherit; }\n [data-player] > * {\n float: none;\n max-width: none; }\n [data-player] > div {\n display: block; }\n [data-player].fullscreen {\n width: 100% !important;\n height: 100% !important;\n top: 0;\n left: 0; }\n [data-player].nocursor {\n cursor: none; }\n\n.clappr-style {\n display: none !important; }\n'.toString(),{baseUrl:this.options.baseUrl});if(this.$el.append(e[0]),this.options.includeResetStyle){var t=Te.getStyleFor('[data-player] div, [data-player] span, [data-player] applet, [data-player] object, [data-player] iframe,\n[data-player] h1, [data-player] h2, [data-player] h3, [data-player] h4, [data-player] h5, [data-player] h6, [data-player] p, [data-player] blockquote, [data-player] pre,\n[data-player] a, [data-player] abbr, [data-player] acronym, [data-player] address, [data-player] big, [data-player] cite, [data-player] code,\n[data-player] del, [data-player] dfn, [data-player] em, [data-player] img, [data-player] ins, [data-player] kbd, [data-player] q, [data-player] s, [data-player] samp,\n[data-player] small, [data-player] strike, [data-player] strong, [data-player] sub, [data-player] sup, [data-player] tt, [data-player] var,\n[data-player] b, [data-player] u, [data-player] i, [data-player] center,\n[data-player] dl, [data-player] dt, [data-player] dd, [data-player] ol, [data-player] ul, [data-player] li,\n[data-player] fieldset, [data-player] form, [data-player] label, [data-player] legend,\n[data-player] table, [data-player] caption, [data-player] tbody, [data-player] tfoot, [data-player] thead, [data-player] tr, [data-player] th, [data-player] td,\n[data-player] article, [data-player] aside, [data-player] canvas, [data-player] details, [data-player] embed,\n[data-player] figure, [data-player] figcaption, [data-player] footer, [data-player] header, [data-player] hgroup,\n[data-player] menu, [data-player] nav, [data-player] output, [data-player] ruby, [data-player] section, [data-player] summary,\n[data-player] time, [data-player] mark, [data-player] audio, [data-player] video {\n margin: 0;\n padding: 0;\n border: 0;\n font: inherit;\n font-size: 100%;\n vertical-align: baseline; }\n\n[data-player] table {\n border-collapse: collapse;\n border-spacing: 0; }\n\n[data-player] caption, [data-player] th, [data-player] td {\n text-align: left;\n font-weight: normal;\n vertical-align: middle; }\n\n[data-player] q, [data-player] blockquote {\n quotes: none; }\n [data-player] q:before, [data-player] q:after, [data-player] blockquote:before, [data-player] blockquote:after {\n content: "";\n content: none; }\n\n[data-player] a img {\n border: none; }\n'.toString(),{baseUrl:this.options.baseUrl});this.$el.append(t[0])}this.styleRendered=!0}}},{key:"render",value:function(){this.appendStyles(),this.options.width=this.options.width||this.$el.width(),this.options.height=this.options.height||this.$el.height();var e={width:this.options.width,height:this.options.height};return this.previousSize=this.currentSize=this.computedSize=e,this.updateSize(),this.enableResizeObserver(),this}}])}(ke);Object.assign(Re.prototype,_e);var Oe,we,Pe=function(e){function t(e){var r;return u(this,t),(r=i(this,t,[e.options])).player=e,r}return f(t,e),d(t,[{key:"loader",get:function(){return this.player.loader}},{key:"create",value:function(){return this.options.loader=this.loader,this.core=new Re(this.options),this.addCorePlugins(),this.core.createContainers(this.options),this.core}},{key:"addCorePlugins",value:function(){var e=this;return this.loader.corePlugins.forEach((function(t){var r=new t(e.core);e.core.addPlugin(r),e.setupExternalInterface(r)})),this.core}},{key:"setupExternalInterface",value:function(e){var t=e.getExternalInterface();for(var r in t)this.player[r]=t[r].bind(e)}}])}(de),xe=/(\d+)(?:\.(\d+))?(?:\.(\d+))?/,Ne=function(){function e(t,r,i){u(this,e),this.major=parseInt(t||0,10),this.minor=parseInt(r||0,10),this.patch=parseInt(i||0,10)}return d(e,[{key:"compare",value:function(e){var t=this.major-e.major;return t=(t=t||this.minor-e.minor)||this.patch-e.patch}},{key:"inc",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"patch";return void 0!==this[e]&&(this[e]+=1),this}},{key:"satisfies",value:function(e,t){return this.compare(e)>=0&&(!t||this.compare(t)<0)}},{key:"toString",value:function(){return"".concat(this.major,".").concat(this.minor,".").concat(this.patch)}}],[{key:"parse",value:function(){var t=m((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").match(xe)||[],4),r=t[1],i=t[2],n=t[3];return void 0===r?null:new e(r,i,n)}}])}(),Me=function(e,t){return e&&t?Object.entries(e).filter((function(e){return m(e,2)[1].type===t})).reduce((function(e,t){var r=m(t,2),i=r[0],n=r[1];return e[i]=n,e}),{}):{}},Fe=(Oe={plugins:{},playbacks:[]},we="0.7.2",function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;u(this,e),this.playerId=r,this.playbackPlugins=y(Oe.playbacks);var i=e.registeredPlugins,n=i.core,a=i.container;this.containerPlugins=Object.values(a),this.corePlugins=Object.values(n),Array.isArray(t)||this.validateExternalPluginsType(t),this.addExternalPlugins(t)}return d(e,[{key:"groupPluginsByType",value:function(e){return Array.isArray(e)&&(e=e.reduce((function(e,t){return e[t.type]||(e[t.type]=[]),e[t.type].push(t),e}),{})),e}},{key:"removeDups",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.reduceRight((function(e,r){return e[r.prototype.name]&&t||(e[r.prototype.name]&&delete e[r.prototype.name],e[r.prototype.name]=r),e}),Object.create(null)),i=[];for(var n in r)i.unshift(r[n]);return i}},{key:"addExternalPlugins",value:function(t){var r="boolean"!=typeof t.loadExternalPluginsFirst||t.loadExternalPluginsFirst,i="boolean"!=typeof t.loadExternalPlaybacksFirst||t.loadExternalPlaybacksFirst;if((t=this.groupPluginsByType(t)).playback){var n=t.playback.filter((function(t){return e.checkVersionSupport(t),!0}));this.playbackPlugins=i?this.removeDups(n.concat(this.playbackPlugins)):this.removeDups(this.playbackPlugins.concat(n),!0)}if(t.container){var a=t.container.filter((function(t){return e.checkVersionSupport(t),!0}));this.containerPlugins=r?this.removeDups(a.concat(this.containerPlugins)):this.removeDups(this.containerPlugins.concat(a),!0)}if(t.core){var s=t.core.filter((function(t){return e.checkVersionSupport(t),!0}));this.corePlugins=r?this.removeDups(s.concat(this.corePlugins)):this.removeDups(this.corePlugins.concat(s),!0)}}},{key:"validateExternalPluginsType",value:function(e){["playback","container","core"].forEach((function(t){(e[t]||[]).forEach((function(e){var r="external "+e.type+" plugin on "+t+" array";if(e.type!==t)throw new ReferenceError(r)}))}))}}],[{key:"registeredPlaybacks",get:function(){return y(Oe.playbacks)}},{key:"registeredPlugins",get:function(){var e=Oe.plugins;return{core:Me(e,"core"),container:Me(e,"container")}}},{key:"checkVersionSupport",value:function(e){var t=e.prototype,r=t.supportedVersion,i=t.name;if(!r||!r.min)return ne.warn("Loader","missing version information for ".concat(i)),!1;var n=r.max?Ne.parse(r.max):Ne.parse(r.min).inc("minor"),a=Ne.parse(r.min);return!!Ne.parse(we).satisfies(a,n)||(ne.warn("Loader","unsupported plugin ".concat(i,": Clappr version ").concat(we," does not match required range [").concat(a,",").concat(n,")")),!1)}},{key:"registerPlugin",value:function(t){if(!t||!t.prototype.name)return ne.warn("Loader","missing information to register plugin: ".concat(t)),!1;e.checkVersionSupport(t);var r=Oe.plugins;if(!r)return!1;var i=r[t.prototype.name];return i&&ne.warn("Loader","overriding plugin entry: ".concat(t.prototype.name," - ").concat(i)),r[t.prototype.name]=t,!0}},{key:"registerPlayback",value:function(t){if(!t||!t.prototype.name)return!1;e.checkVersionSupport(t);var r=Oe.playbacks,i=r.findIndex((function(e){return e.prototype.name===t.prototype.name}));if(i>=0){var n=r[i];r.splice(i,1),ne.warn("Loader","overriding playback entry: ".concat(n.name," - ").concat(n))}return Oe.playbacks=[t].concat(y(r)),!0}},{key:"unregisterPlugin",value:function(e){if(!e)return!1;var t=Oe.plugins;return!!t[e]&&(delete t[e],!0)}},{key:"unregisterPlayback",value:function(e){if(!e)return!1;var t=Oe.playbacks,r=t.findIndex((function(t){return t.prototype.name===e}));return!(r<0||(t.splice(r,1),Oe.playbacks=t,0))}},{key:"clearPlugins",value:function(){Oe.plugins={}}},{key:"clearPlaybacks",value:function(){Oe.playbacks=[]}}])}()),Be=$().replace(/\/[^/]+$/,""),Ue=function(e){function t(e){var r;u(this,t),r=i(this,t,[e]);var n={playerId:Y(""),persistConfig:!0,width:640,height:360,baseUrl:Be,allowUserInteraction:O.isMobile,includeResetStyle:!0,playback:{recycleVideo:!0}};r._options=D.extend(!0,n,e),r.options.sources=r._normalizeSources(e),r.options.chromeless||(r.options.allowUserInteraction=!0),r.options.allowUserInteraction||(r.options.disableKeyboardShortcuts=!0),r._registerOptionEventListeners(r.options.events),r._coreFactory=new Pe(r);var a=r._getParentElement(r.options);return a&&r.attachTo(a),r}return f(t,e),d(t,[{key:"loader",get:function(){return this._loader||(this._loader=new Fe(this.options.plugins||{},this.options.playerId)),this._loader},set:function(e){this._loader=e}},{key:"ended",get:function(){return this.core.activeContainer.ended}},{key:"buffering",get:function(){return this.core.activeContainer.buffering}},{key:"isReady",get:function(){return!!this._ready}},{key:"eventsMapping",get:function(){return{onReady:ue.PLAYER_READY,onResize:ue.PLAYER_RESIZE,onPlay:ue.PLAYER_PLAY,onPause:ue.PLAYER_PAUSE,onStop:ue.PLAYER_STOP,onEnded:ue.PLAYER_ENDED,onSeek:ue.PLAYER_SEEK,onError:ue.PLAYER_ERROR,onTimeUpdate:ue.PLAYER_TIMEUPDATE,onVolumeUpdate:ue.PLAYER_VOLUMEUPDATE,onSubtitleAvailable:ue.PLAYER_SUBTITLE_AVAILABLE}}},{key:"_getParentElement",value:function(e){var t=e.parentId,r=e.parent;return t?document.querySelector(t):r}},{key:"attachTo",value:function(e){return this.options.parentElement=e,this.core=this._coreFactory.create(),this._addEventListeners(),this}},{key:"_addEventListeners",value:function(){return this.core.isReady?this._onReady():this.listenToOnce(this.core,ue.CORE_READY,this._onReady),this.listenTo(this.core,ue.CORE_ACTIVE_CONTAINER_CHANGED,this._containerChanged),this.listenTo(this.core,ue.CORE_FULLSCREEN,this._onFullscreenChange),this.listenTo(this.core,ue.CORE_RESIZE,this._onResize),this}},{key:"_addContainerEventListeners",value:function(){var e=this.core.activeContainer;return e&&(this.listenTo(e,ue.CONTAINER_PLAY,this._onPlay),this.listenTo(e,ue.CONTAINER_PAUSE,this._onPause),this.listenTo(e,ue.CONTAINER_STOP,this._onStop),this.listenTo(e,ue.CONTAINER_ENDED,this._onEnded),this.listenTo(e,ue.CONTAINER_SEEK,this._onSeek),this.listenTo(e,ue.CONTAINER_ERROR,this._onError),this.listenTo(e,ue.CONTAINER_TIMEUPDATE,this._onTimeUpdate),this.listenTo(e,ue.CONTAINER_VOLUME,this._onVolumeUpdate),this.listenTo(e,ue.CONTAINER_SUBTITLE_AVAILABLE,this._onSubtitleAvailable)),this}},{key:"_registerOptionEventListeners",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(t).length>0&&Object.keys(r).forEach((function(t){var i=e.eventsMapping[t];i&&e.off(i,r[t])})),Object.keys(t).forEach((function(r){var i=e.eventsMapping[r];if(i){var n=t[r];(n="function"==typeof n&&n)&&e.on(i,n)}})),this}},{key:"_containerChanged",value:function(){this.stopListening(),this._addEventListeners()}},{key:"_onReady",value:function(){this._ready=!0,this._addContainerEventListeners(),this.trigger(ue.PLAYER_READY)}},{key:"_onFullscreenChange",value:function(e){this.trigger(ue.PLAYER_FULLSCREEN,e)}},{key:"_onVolumeUpdate",value:function(e){this.trigger(ue.PLAYER_VOLUMEUPDATE,e)}},{key:"_onSubtitleAvailable",value:function(){this.trigger(ue.PLAYER_SUBTITLE_AVAILABLE)}},{key:"_onResize",value:function(e){this.trigger(ue.PLAYER_RESIZE,e)}},{key:"_onPlay",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.trigger(ue.PLAYER_PLAY,t)}},{key:"_onPause",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.trigger(ue.PLAYER_PAUSE,t)}},{key:"_onStop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.trigger(ue.PLAYER_STOP,this.getCurrentTime(),e)}},{key:"_onEnded",value:function(){this.trigger(ue.PLAYER_ENDED)}},{key:"_onSeek",value:function(e){this.trigger(ue.PLAYER_SEEK,e)}},{key:"_onTimeUpdate",value:function(e){this.trigger(ue.PLAYER_TIMEUPDATE,e)}},{key:"_onError",value:function(e){this.trigger(ue.PLAYER_ERROR,e)}},{key:"_normalizeSources",value:function(e){var t=e.sources||(void 0!==e.source?[e.source]:[]);return 0===t.length?[{source:"",mimeType:""}]:t}},{key:"resize",value:function(e){return this.core.resize(e),this}},{key:"load",value:function(e,t,r){return void 0!==r&&this.configure({autoPlay:!!r}),this.core.load(e,t),this}},{key:"destroy",value:function(){return this.stopListening(),this.core.destroy(),this}},{key:"consent",value:function(e){this.core.getCurrentPlayback().consent(e)}},{key:"play",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.core.activeContainer.play(e),this}},{key:"pause",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.core.activeContainer.pause(e),this}},{key:"stop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.core.activeContainer.stop(e),this}},{key:"seek",value:function(e){return this.core.activeContainer.seek(e),this}},{key:"seekPercentage",value:function(e){return this.core.activeContainer.seekPercentage(e),this}},{key:"mute",value:function(){return this.core.activePlayback.mute(),this}},{key:"unmute",value:function(){return this.core.activePlayback.unmute(),this}},{key:"isPlaying",value:function(){return this.core.activeContainer.isPlaying()}},{key:"isDvrEnabled",value:function(){return this.core.activeContainer.isDvrEnabled()}},{key:"isDvrInUse",value:function(){return this.core.activeContainer.isDvrInUse()}},{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._registerOptionEventListeners(e.events,this.options.events),this.core.configure(e),this}},{key:"getPlugin",value:function(e){return this.core.plugins.concat(this.core.activeContainer.plugins).filter((function(t){return t.name===e}))[0]}},{key:"getCurrentTime",value:function(){return this.core.activeContainer.getCurrentTime()}},{key:"getStartTimeOffset",value:function(){return this.core.activeContainer.getStartTimeOffset()}},{key:"getDuration",value:function(){return this.core.activeContainer.getDuration()}}])}(de);Object.assign(Ue.prototype,_e);var Ge=function(e){function t(e){var r;return u(this,t),(r=i(this,t,[e.options])).container=e,r.enabled=!0,r.bindEvents(),r}return f(t,e),d(t,[{key:"playerError",get:function(){return this.container.playerError}},{key:"enable",value:function(){this.enabled||(this.bindEvents(),this.enabled=!0)}},{key:"disable",value:function(){this.enabled&&(this.stopListening(),this.enabled=!1)}},{key:"bindEvents",value:function(){}},{key:"destroy",value:function(){this.stopListening()}}])}(de);Object.assign(Ge.prototype,_e),Ge.extend=function(e){return G(Ge,e)},Ge.type="container";var Ve=function(e){function t(e){var r;return u(this,t),(r=i(this,t,[e.options])).core=e,r.enabled=!0,r.bindEvents(),r}return f(t,e),d(t,[{key:"playerError",get:function(){return this.core.playerError}},{key:"bindEvents",value:function(){}},{key:"enable",value:function(){this.enabled||(this.bindEvents(),this.enabled=!0)}},{key:"disable",value:function(){this.enabled&&(this.stopListening(),this.enabled=!1)}},{key:"getExternalInterface",value:function(){return{}}},{key:"destroy",value:function(){this.stopListening()}}])}(de);Object.assign(Ve.prototype,_e),Ve.extend=function(e){return G(Ve,e)},Ve.type="core";var Ke=function(e){function t(e){var r;return u(this,t),(r=i(this,t,[e.options])).container=e,r.enabled=!0,r.bindEvents(),r}return f(t,e),d(t,[{key:"playerError",get:function(){return this.container.playerError}},{key:"enable",value:function(){this.enabled||(this.bindEvents(),this.$el.show(),this.enabled=!0)}},{key:"disable",value:function(){this.stopListening(),this.$el.hide(),this.enabled=!1}},{key:"bindEvents",value:function(){}}])}(ke);Object.assign(Ke.prototype,_e),Ke.extend=function(e){return G(Ke,e)},Ke.type="container";var je={mp4:["avc1.42E01E","avc1.58A01E","avc1.4D401E","avc1.64001E","mp4v.20.8","mp4v.20.240","mp4a.40.2"].map((function(e){return'video/mp4; codecs="'+e+', mp4a.40.2"'})),ogg:['video/ogg; codecs="theora, vorbis"','video/ogg; codecs="dirac"','video/ogg; codecs="theora, speex"'],"3gpp":['video/3gpp; codecs="mp4v.20.8, samr"'],webm:['video/webm; codecs="vp8, vorbis"'],mkv:['video/x-matroska; codecs="theora, vorbis"'],m3u8:["application/x-mpegurl"]};je.ogv=je.ogg,je["3gp"]=je["3gpp"];var He={wav:["audio/wav"],mp3:["audio/mp3",'audio/mpeg;codecs="mp3"'],aac:['audio/mp4;codecs="mp4a.40.5"'],oga:["audio/ogg"]},Ye=Object.keys(He).reduce((function(e,t){return[].concat(y(e),y(He[t]))}),[]),We={code:"unknown",message:"unknown"},$e=function(e){function t(){var e;u(this,t);for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];(e=i(this,t,[].concat(n)))._destroyed=!1,e._loadStarted=!1,e._isBuffering=!1,e._playheadMoving=!1,e._playheadMovingTimer=null,e._stopped=!1,e._ccTrackId=-1,e._playheadMovingCheckEnabled=!e.options.disablePlayheadMovingCheck,e._setupSrc(e.options.src),e._playheadMovingCheckInterval=e.options.playheadMovingCheckInterval||500,e.options.playback||(e.options.playback=e.options||{}),e.options.playback.disableContextMenu=e.options.playback.disableContextMenu||e.options.disableVideoTagContextMenu,e._minDvrSize=e.isValidMinimumDVRSizeConfig?e.minimumDVRSizeConfig:60;var s,o=e.options.playback,l=o.preload||(O.isSafari?"auto":e.options.preload);return e.options.poster&&("string"==typeof e.options.poster?s=e.options.poster:"string"==typeof e.options.poster.url&&(s=e.options.poster.url)),D.extend(!0,e.el,{muted:e.options.mute,defaultMuted:e.options.mute,loop:e.options.loop,poster:s,preload:l||"metadata",crossOrigin:o.crossOrigin,"x-webkit-playsinline":o.playInline}),(o.controls||e.options.useVideoTagDefaultControls)&&e.$el.attr("controls",""),o.playInline&&e.$el.attr({playsinline:"playsinline"}),o.crossOrigin&&e.$el.attr({crossorigin:o.crossOrigin}),e.settings={default:["seekbar"]},e.settings.left=["playpause","position","duration"],e.settings.right=["fullscreen","volume","hd-indicator"],o.externalTracks&&e._setupExternalTracks(o.externalTracks),e.options.autoPlay&&e.attemptAutoPlay(),e}return f(t,e),d(t,[{key:"name",get:function(){return"html5_video"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"tagName",get:function(){return this.isAudioOnly?"audio":"video"}},{key:"isAudioOnly",get:function(){var e=this.options.src,r=t._mimeTypesForUrl(e,He,this.options.mimeType);return this.options.playback&&this.options.playback.audioOnly||this.options.audioOnly||Ye.indexOf(r[0])>=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",seeking:"_onSeeking",seeked:"_onSeeked",stalled:"_handleBufferingEvents",timeupdate:"_onTimeUpdate",waiting:"_onWaiting",enterpictureinpicture:"_onEnterPiP",leavepictureinpicture:"_onExitPiP"}}},{key:"ended",get:function(){return this.el.ended}},{key:"buffering",get:function(){return this._isBuffering}},{key:"isPiPActive",get:function(){return this.el===document.pictureInPictureElement}},{key:"isLive",get:function(){return this.getPlaybackType()===De.LIVE}},{key:"dvrEnabled",get:function(){return this.getDuration()>=this._minDvrSize&&this.isLive}},{key:"minimumDVRSizeConfig",get:function(){return this.options.playback&&this.options.playback.minimumDvrSize}},{key:"isValidMinimumDVRSizeConfig",get:function(){return void 0!==this.minimumDVRSizeConfig&&"number"==typeof this.minimumDVRSizeConfig}},{key:"sourceMedia",get:function(){return this._src}},{key:"configure",value:function(e){v(p(t.prototype),"configure",this).call(this,e),this.el.loop=!!e.loop}},{key:"attemptAutoPlay",value:function(){var e=this;this.canAutoPlay((function(t,r){r&&ne.warn(e.name,"autoplay error.",{result:t,error:r}),t&&setTimeout((function(){return!e._destroyed&&e.play()}),0)}))}},{key:"canAutoPlay",value:function(e){if(this.options.disableCanAutoPlay)e(!0,null);else{var t={timeout:this.options.autoPlayTimeout||500,inline:this.options.playback.playInline||!1,muted:this.options.mute||!1};O.isMobile&&X.options.recycleVideo&&(t.element=this.el),q(e,t)}}},{key:"_setupExternalTracks",value:function(e){this._externalTracks=e.map((function(e){return{kind:e.kind||"subtitles",label:e.label,lang:e.lang,src:e.src}}))}},{key:"load",value:function(e){this._setupSrc(e)}},{key:"_setupSrc",value:function(e){this.el.src!==e&&(this._ccIsSetup=!1,this.el.src=e,this._src=this.el.src)}},{key:"_onLoadedMetadata",value:function(e){this._handleBufferingEvents(),this.trigger(ue.PLAYBACK_LOADEDMETADATA,{duration:e.target.duration,data:e}),this._updateSettings();var t=void 0===this._options.autoSeekFromUrl||this._options.autoSeekFromUrl;this.getPlaybackType()!==De.LIVE&&t&&this._checkInitialSeek()}},{key:"_onDurationChange",value:function(){this._updateSettings(),this._onTimeUpdate(),this._onProgress()}},{key:"_updateSettings",value:function(){this.getPlaybackType()===De.VOD||this.getPlaybackType()===De.AOD?this.settings.left=["playpause","position","duration"]:this.settings.left=["playstop"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(ue.PLAYBACK_SETTINGSUPDATE)}},{key:"isSeekEnabled",value:function(){return isFinite(this.getDuration())}},{key:"getPlaybackType",value:function(){var e="audio"===this.tagName?De.AOD:De.VOD;return[0,void 0,1/0].indexOf(this.el.duration)>=0?De.LIVE:e}},{key:"isHighDefinitionInUse",value:function(){return!1}},{key:"consent",value:function(e){var r=this;if(this.isPlaying()||this.el._consented)v(p(t.prototype),"consent",this).call(this,e);else{var i=function i(){r.el.removeEventListener("loadedmetadata",i,!1),r.el.removeEventListener("error",i,!1),r.el._consented=!0,v(p(t.prototype),"consent",r).call(r,e)};this.el.addEventListener("loadedmetadata",i,!1),this.el.addEventListener("error",i,!1),this.el.load()}}},{key:"play",value:function(){var e=this;this.trigger(ue.PLAYBACK_PLAY_INTENT),this._stopped=!1,this._setupSrc(this._src),this._handleBufferingEvents();var t=this.el.play();return t&&t.catch&&t.catch((function(t){return ne.warn(e.name,"HTML5 play failed",t)})),t}},{key:"pause",value:function(){this.el.pause(),this.dvrEnabled&&this._updateDvr(!0)}},{key:"stop",value:function(){this.pause(),this._stopped=!0,this.el.removeAttribute("src"),this.el.load(),this._stopPlayheadMovingChecks(),this._handleBufferingEvents(),this.trigger(ue.PLAYBACK_STOP)}},{key:"volume",value:function(e){0===e?(this.$el.attr({muted:"true"}),this.el.muted=!0):(this.$el.attr({muted:null}),this.el.muted=!1,this.el.volume=e/100)}},{key:"mute",value:function(){this.el.muted=!0}},{key:"unmute",value:function(){this.el.muted=!1}},{key:"isMuted",value:function(){return!0===this.el.muted||0===this.el.volume}},{key:"isPlaying",value:function(){return!this.el.paused&&!this.el.ended}},{key:"isReady",get:function(){return this._isReadyState}},{key:"_startPlayheadMovingChecks",value:function(){null===this._playheadMovingTimer&&this._playheadMovingCheckEnabled&&(this._playheadMovingTimeOnCheck=null,this._determineIfPlayheadMoving(),this._playheadMovingTimer=setInterval(this._determineIfPlayheadMoving.bind(this),this._playheadMovingCheckInterval))}},{key:"_stopPlayheadMovingChecks",value:function(){null!==this._playheadMovingTimer&&(clearInterval(this._playheadMovingTimer),this._playheadMovingTimer=null,this._playheadMoving=!1)}},{key:"_determineIfPlayheadMoving",value:function(){var e=this._playheadMovingTimeOnCheck,t=this.el.currentTime;this._playheadMoving=e!==t,this._playheadMovingTimeOnCheck=t,this._handleBufferingEvents()}},{key:"_onWaiting",value:function(){this._loadStarted=!0,this._handleBufferingEvents()}},{key:"_onLoadedData",value:function(){this._loadStarted=!0,this._handleBufferingEvents()}},{key:"_onCanPlay",value:function(){this._handleBufferingEvents()}},{key:"_onPlaying",value:function(){this._checkForClosedCaptions(),this._startPlayheadMovingChecks(),this._handleBufferingEvents(),this.trigger(ue.PLAYBACK_PLAY)}},{key:"_onPause",value:function(){this._stopPlayheadMovingChecks(),this._handleBufferingEvents(),this.trigger(ue.PLAYBACK_PAUSE)}},{key:"_onSeeking",value:function(){this.trigger(ue.PLAYBACK_SEEK,this.getCurrentTime()),this._handleBufferingEvents()}},{key:"_onSeeked",value:function(){this._handleBufferingEvents(),this.trigger(ue.PLAYBACK_SEEKED)}},{key:"_onEnded",value:function(){this._handleBufferingEvents(),this.trigger(ue.PLAYBACK_ENDED,this.name)}},{key:"_onEnterPiP",value:function(){this.trigger(ue.PLAYBACK_PIP_ENTER,this.name)}},{key:"_onExitPiP",value:function(){this.trigger(ue.PLAYBACK_PIP_EXIT,this.name)}},{key:"enterPiP",value:function(){var e=this;this.el.requestPictureInPicture().then((function(){ne.info(e.name,"enter PIP success")})).catch((function(t){ne.warn(e.name,"enter PIP failed",t)}))}},{key:"exitPiP",value:function(){var e=this;document.exitPictureInPicture().then((function(){ne.info(e.name,"exit PIP success")})).catch((function(t){ne.warn(e.name,"exit PIP failed",t)}))}},{key:"_handleBufferingEvents",value:function(){var e=this._loadStarted&&!this.el.ended&&!this._stopped,t=this.el.readyState<this.el.HAVE_FUTURE_DATA,r=!this.el.ended&&!this.el.paused&&!this._playheadMoving,i=e&&t;this._playheadMovingCheckEnabled&&(i=i||e&&r),this._isBuffering!==i&&(this._isBuffering=i,i?this.trigger(ue.PLAYBACK_BUFFERING,this.name):this.trigger(ue.PLAYBACK_BUFFERFULL,this.name))}},{key:"_onError",value:function(){var e=this.el.error||We,t=e.code,r=e.message,i=t===We.code,n=this.createError({code:t,description:r,raw:this.el.error,level:i?Se.Levels.WARN:Se.Levels.FATAL});i?ne.warn(this.name,"HTML5 unknown error: ",n):this.trigger(ue.PLAYBACK_ERROR,n)}},{key:"destroy",value:function(){this._destroyed=!0,this.handleTextTrackChange&&this.el.textTracks.removeEventListener("change",this.handleTextTrackChange),this.$el.off("contextmenu"),v(p(t.prototype),"destroy",this).call(this),this.el.removeAttribute("src"),this.el.load(),this._src=null,X.garbage(this.el)}},{key:"_updateDvr",value:function(e){this.trigger(ue.PLAYBACK_DVR,e),this.trigger(ue.PLAYBACK_STATS_ADD,{dvr:e})}},{key:"seek",value:function(e){e<0&&(ne.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(e<this.getDuration()-3),e+=this.el.seekable.start(0),this.el.currentTime=e}},{key:"seekPercentage",value:function(e){var t=this.el.duration*(e/100);this.seek(t)}},{key:"_checkInitialSeek",value:function(){var e=H();0!==e&&this.seek(e)}},{key:"getCurrentTime",value:function(){return this.el.currentTime}},{key:"getDuration",value:function(){if(this.isLive){if(this.el.seekable.length>0)return this.el.seekable.end(0)-this.el.seekable.start(0);this._scheduleUpdateSettingsCheck()}return this.el.duration}},{key:"_scheduleUpdateSettingsCheck",value:function(){var e=this;this._updateSettingsCheckInFlight||(this._updateSettingsCheckInFlight=setTimeout((function(){e._updateSettings(),e._updateSettingsCheckInFlight=null}),1e3))}},{key:"_onTimeUpdate",value:function(){var e=this.isLive?this.getDuration():this.el.duration;this.trigger(ue.PLAYBACK_TIMEUPDATE,{current:this.el.currentTime,total:e},this.name)}},{key:"_onProgress",value:function(){if(this.el.buffered.length){for(var e=[],t=0,r=0;r<this.el.buffered.length;r++)e=[].concat(y(e),[{start:this.el.buffered.start(r),end:this.el.buffered.end(r)}]),this.el.currentTime>=e[r].start&&this.el.currentTime<=e[r].end&&(t=r);var i={start:e[t].start,current:e[t].end,total:this.el.duration};this.trigger(ue.PLAYBACK_PROGRESS,i,e)}}},{key:"_typeFor",value:function(e){var r=t._mimeTypesForUrl(e,je,this.options.mimeType);return 0===r.length&&(r=t._mimeTypesForUrl(e,He,this.options.mimeType)),(r[0]||"").split(";")[0]}},{key:"_ready",value:function(){this._isReadyState||(this._isReadyState=!0,this.trigger(ue.PLAYBACK_READY,this.name))}},{key:"_checkForClosedCaptions",value:function(){if(this.isHTML5Video&&!this._ccIsSetup){if(this.hasClosedCaptionsTracks){this.trigger(ue.PLAYBACK_SUBTITLE_AVAILABLE);var e=this.closedCaptionsTrackId;this.closedCaptionsTrackId=e,this.handleTextTrackChange=this._handleTextTrackChange.bind(this),this.el.textTracks.addEventListener("change",this.handleTextTrackChange)}this._ccIsSetup=!0}}},{key:"_handleTextTrackChange",value:function(){var e=this.closedCaptionsTracks.find((function(e){return"showing"===e.track.mode}))||{id:-1};this._ccTrackId!==e.id&&(this._ccTrackId=e.id,this.trigger(ue.PLAYBACK_SUBTITLE_CHANGED,{id:e.id}))}},{key:"isHTML5Video",get:function(){return this.name===t.prototype.name}},{key:"closedCaptionsTracks",get:function(){var e=0;return(this.el.textTracks?Array.from(this.el.textTracks):[]).filter((function(e){return"subtitles"===e.kind||"captions"===e.kind})).map((function(t){return{id:e++,name:t.label,track:t}}))}},{key:"closedCaptionsTrackId",get:function(){return this._ccTrackId},set:function(e){if(W(e)){var t,r=this.closedCaptionsTracks;if(-1!==e){if(!(t=r.find((function(t){return t.id===e}))))return;if("showing"===t.track.mode)return}r.filter((function(e){return"hidden"!==e.track.mode})).forEach((function(e){return e.track.mode="hidden"})),t&&(t.track.mode="showing"),this._ccTrackId=e,this.trigger(ue.PLAYBACK_SUBTITLE_CHANGED,{id:e})}}},{key:"template",get:function(){return Ee('<% for (var i = 0; i < tracks.length; i++) { %>\n <track data-html5-video-track="<%= i %>" kind="<%= tracks[i].kind %>" label="<%= tracks[i].label %>" srclang="<%= tracks[i].lang %>" src="<%= tracks[i].src %>">\n<% }; %>\n')}},{key:"render",value:function(){this.options.playback.disableContextMenu&&this.$el.on("contextmenu",(function(){return!1})),this._externalTracks&&this._externalTracks.length>0&&this.$el.html(this.template({tracks:this._externalTracks})),this._ready();var e=Te.getStyleFor("[data-html5-video] {\n position: absolute;\n height: 100%;\n width: 100%;\n display: block; }\n".toString(),{baseUrl:this.options.baseUrl});return this.$el.append(e[0]),this}}])}(De);$e._mimeTypesForUrl=function(){var e=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0,r=((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split("?")[0].match(/.*\.(.*)$/)||[])[1],i=t||r&&e[r.toLowerCase()]||[];return i.constructor===Array?i:[i]},$e._canPlay=function(e,t,r,i){var n=$e._mimeTypesForUrl(r,t,i),a=document.createElement(e);return!!n.filter((function(e){return!!a.canPlayType(e).replace(/no/,"")}))[0]},$e.canPlay=function(e,t){return $e._canPlay("audio",He,e,t)||$e._canPlay("video",je,e,t)};var ze=function(e){function t(){return u(this,t),i(this,t,arguments)}return f(t,e),d(t,[{key:"name",get:function(){return"html5_audio"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"tagName",get:function(){return"audio"}},{key:"isAudioOnly",get:function(){return!0}},{key:"updateSettings",value:function(){this.settings.left=["playpause","position","duration"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(ue.PLAYBACK_SETTINGSUPDATE)}},{key:"getPlaybackType",value:function(){return De.AOD}}])}($e);ze.canPlay=function(e,t){return $e._canPlay("audio",{wav:["audio/wav"],mp3:["audio/mp3",'audio/mpeg;codecs="mp3"'],aac:['audio/mp4;codecs="mp4a.40.5"'],oga:["audio/ogg"]},e,t)};var qe=function(e){function t(e){var r;return u(this,t),(r=i(this,t,[e])).el.src=e.src,r}return f(t,e),d(t,[{key:"name",get:function(){return"html_img"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"tagName",get:function(){return"img"}},{key:"attributes",get:function(){return{"data-html-img":""}}},{key:"events",get:function(){return{load:"_onLoad",abort:"_onError",error:"_onError"}}},{key:"getPlaybackType",value:function(){return De.NO_OP}},{key:"render",value:function(){var e=Te.getStyleFor("[data-html-img] {\n max-width: 100%;\n max-height: 100%; }\n".toString(),{baseUrl:this.options.baseUrl});return this.$el.append(e[0]),this.trigger(ue.PLAYBACK_READY,this.name),this}},{key:"_onLoad",value:function(){this.trigger(ue.PLAYBACK_ENDED,this.name)}},{key:"_onError",value:function(e){var t="error"===e.type?"load error":"loading aborted";this.trigger(ue.PLAYBACK_ERROR,{message:t},this.name)}}])}(De);qe.canPlay=function(e){return/\.(png|jpg|jpeg|gif|bmp|tiff|pgm|pnm|webp)(|\?.*)$/i.test(e)};var Xe=function(e){function t(){var e;u(this,t);for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return(e=i(this,t,[].concat(n)))._noiseFrameNum=-1,e}return f(t,e),d(t,[{key:"name",get:function(){return"no_op"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"template",get:function(){return Ee("<canvas data-no-op-canvas></canvas>\n<p data-no-op-msg><%=message%></p><p>\n</p>")}},{key:"attributes",get:function(){return{"data-no-op":""}}},{key:"render",value:function(){var e=this.options.playbackNotSupportedMessage||this.i18n.t("playback_not_supported"),t=Te.getStyleFor("[data-no-op] {\n position: absolute;\n height: 100%;\n width: 100%;\n text-align: center; }\n\n[data-no-op] p[data-no-op-msg] {\n position: absolute;\n text-align: center;\n font-size: 25px;\n left: 0;\n right: 0;\n color: white;\n padding: 10px;\n /* center vertically */\n top: 50%;\n transform: translateY(-50%);\n max-height: 100%;\n overflow: auto; }\n\n[data-no-op] canvas[data-no-op-canvas] {\n background-color: #777;\n height: 100%;\n width: 100%; }\n".toString(),{baseUrl:this.options.baseUrl});this.$el.append(t[0]),this.$el.html(this.template({message:e})),this.trigger(ue.PLAYBACK_READY,this.name);var r=!(!this.options.poster||!this.options.poster.showForNoOp);return!this.options.autoPlay&&r||this._animate(),this}},{key:"_noise",value:function(){if(this._noiseFrameNum=(this._noiseFrameNum+1)%5,!this._noiseFrameNum){var e,t=this.context.createImageData(this.context.canvas.width,this.context.canvas.height);try{e=new Uint32Array(t.data.buffer)}catch(n){e=new Uint32Array(this.context.canvas.width*this.context.canvas.height*4);for(var r=t.data,i=0;i<r.length;i++)e[i]=r[i]}for(var n=e.length,a=6*Math.random()+4,s=0,o=0,l=0;l<n;){if(s<0)s=a*Math.random(),o=255*Math.pow(Math.random(),.4)<<24;s-=1,e[l++]=o}this.context.putImageData(t,0,0)}}},{key:"_loop",value:function(){var e=this;this._stop||(this._noise(),this._animationHandle=F((function(){return e._loop()})))}},{key:"destroy",value:function(){this._animationHandle&&(B(this._animationHandle),this._stop=!0)}},{key:"_animate",value:function(){this.canvas=this.$el.find("canvas[data-no-op-canvas]")[0],this.context=this.canvas.getContext("2d"),this._loop()}}])}(De);Xe.canPlay=function(e){return!0};var Ze=function(e){function t(e){var r;return u(this,t),(r=i(this,t,[e]))._initializeMessages(),r}return f(t,e),d(t,[{key:"name",get:function(){return"strings"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"t",value:function(e){var t=this._language(),r=this._messages.en;return(t&&this._messages[t]||r)[e]||r[e]||e}},{key:"_language",value:function(){return this.core.options.language||z()}},{key:"_initializeMessages",value:function(){this._messages=D.extend(!0,{en:{live:"live",back_to_live:"back to live",disabled:"Disabled",playback_not_supported:"Your browser does not support the playback of this video. Please try using a different browser.",default_error_title:"Could not play video.",default_error_message:"There was a problem trying to load the video."},de:{live:"Live",back_to_live:"Zurück zum Live-Video",disabled:"Deaktiviert",playback_not_supported:"Ihr Browser unterstützt das Playback Verfahren nicht. Bitte vesuchen Sie es mit einem anderen Browser.",default_error_title:"Video kann nicht abgespielt werden",default_error_message:"Es gab ein Problem beim Laden des Videos"},pt:{live:"ao vivo",back_to_live:"voltar para o ao vivo",disabled:"Desativado",playback_not_supported:"Seu navegador não suporta a reprodução deste video. Por favor, tente usar um navegador diferente.",default_error_title:"Não foi possível reproduzir o vídeo.",default_error_message:"Ocorreu um problema ao tentar carregar o vídeo."},es_am:{live:"vivo",back_to_live:"volver en vivo",disabled:"No disponible",playback_not_supported:"Su navegador no soporta la reproducción de este video. Por favor, utilice un navegador diferente.",default_error_title:"No se puede reproducir el video.",default_error_message:"Se ha producido un error al cargar el video."},es:{live:"en directo",back_to_live:"volver al directo",disabled:"No disponible",playback_not_supported:"Este navegador no es compatible para reproducir este vídeo. Utilice un navegador diferente.",default_error_title:"No se puede reproducir el vídeo.",default_error_message:"Se ha producido un problema al cargar el vídeo."},ru:{live:"прямой эфир",back_to_live:"к прямому эфиру",disabled:"Отключено",playback_not_supported:"Ваш браузер не поддерживает воспроизведение этого видео. Пожалуйста, попробуйте другой браузер."},bg:{live:"на живо",back_to_live:"Върни на живо",disabled:"Изключено",playback_not_supported:"Вашият браузър не поддържа възпроизвеждането на това видео. Моля, пробвайте с друг браузър.",default_error_title:"Видеото не може да се възпроизведе.",default_error_message:"Възникна проблем при зареждането на видеото."},fr:{live:"en direct",back_to_live:"retour au direct",disabled:"Désactivé",playback_not_supported:"Votre navigateur ne supporte pas la lecture de cette vidéo. Merci de tenter sur un autre navigateur.",default_error_title:"Impossible de lire la vidéo.",default_error_message:"Un problème est survenu lors du chargement de la vidéo."},tr:{live:"canlı",back_to_live:"canlı yayına dön",disabled:"Engelli",playback_not_supported:"Tarayıcınız bu videoyu oynatma desteğine sahip değil. Lütfen farklı bir tarayıcı ile deneyin."},et:{live:"Otseülekanne",back_to_live:"Tagasi otseülekande juurde",disabled:"Keelatud",playback_not_supported:"Teie brauser ei toeta selle video taasesitust. Proovige kasutada muud brauserit."},ar:{live:"مباشر",back_to_live:"الرجوع إلى المباشر",disabled:"معطّل",playback_not_supported:"المتصفح الذي تستخدمه لا يدعم تشغيل هذا الفيديو. الرجاء إستخدام متصفح آخر.",default_error_title:"غير قادر الى التشغيل.",default_error_message:"حدثت مشكلة أثناء تحميل الفيديو."},zh:{live:"直播",back_to_live:"返回直播",disabled:"已禁用",playback_not_supported:"您的浏览器不支持该视频的播放。请尝试使用另一个浏览器。",default_error_title:"无法播放视频。",default_error_message:"在尝试加载视频时出现了问题。"}},this.core.options.strings||{}),this._messages["de-DE"]=this._messages.de,this._messages["pt-BR"]=this._messages.pt,this._messages["en-US"]=this._messages.en,this._messages["bg-BG"]=this._messages.bg,this._messages["es-419"]=this._messages.es_am,this._messages["es-ES"]=this._messages.es,this._messages["fr-FR"]=this._messages.fr,this._messages["tr-TR"]=this._messages.tr,this._messages["et-EE"]=this._messages.et,this._messages["ar-IQ"]=this._messages.ar,this._messages["zh-CN"]=this._messages.zh}}])}(Ve),Qe=function(e){function t(){return u(this,t),i(this,t,arguments)}return f(t,e),d(t,[{key:"name",get:function(){return"sources"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"bindEvents",value:function(){this.listenTo(this.core,ue.CORE_CONTAINERS_CREATED,this.onContainersCreated)}},{key:"onContainersCreated",value:function(){var e=this.core.containers.filter((function(e){return"no_op"!==e.playback.name}))[0]||this.core.containers[0];e&&this.core.containers.forEach((function(t){t!==e&&t.destroy()}))}}])}(Ve);Fe.registerPlugin(Ze),Fe.registerPlugin(Qe),Fe.registerPlayback(Xe),Fe.registerPlayback(qe),Fe.registerPlayback(ze),Fe.registerPlayback($e);var Je={Player:Ue,Events:ue,Browser:O,ContainerPlugin:Ge,UIContainerPlugin:Ke,CorePlugin:Ve,UICorePlugin:Ce,Playback:De,Container:Le,Core:Re,PlayerError:Se,Loader:Fe,BaseObject:de,UIObject:ke,Utils:Q,HTML5Audio:ze,HTML5Video:$e,HTMLImg:qe,Log:ne,Styler:Te,version:"0.7.2",template:Ee,$:D};function et(e,t,r){return t=ot(t),ut(e,tt()?Reflect.construct(t,r||[],ot(e).constructor):t.apply(e,r))}function tt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(tt=function(){return!!e})()}function rt(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function it(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nt(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,rt(i.key),i)}}function at(e,t,r){return t&&nt(e.prototype,t),r&&nt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function st(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lt(e,t)}function ot(e){return ot=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ot(e)}function lt(e,t){return lt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lt(e,t)}function ut(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ct(){return ct="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ot(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},ct.apply(this,arguments)}var dt=function(e){function t(e){return it(this,t),et(this,t,[e])}return st(t,e),at(t,[{key:"name",get:function(){return"click_to_pause"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"config",get:function(){return this.container.options.clickToPauseConfig||{}}},{key:"bindEvents",value:function(){this.listenTo(this.container,ue.CONTAINER_CLICK,this.click),this.listenTo(this.container,ue.CONTAINER_SETTINGSUPDATE,this.settingsUpdate)}},{key:"click",value:function(){var e=this.config.onClickPayload;(this.container.getPlaybackType()!==De.LIVE||this.container.isDvrEnabled())&&(this.container.isPlaying()?this.container.pause(e):this.container.play(e))}},{key:"settingsUpdate",value:function(){var e=this.container.getPlaybackType()!==De.LIVE||this.container.isDvrEnabled();if(e!==this.pointerEnabled){var t=e?"addClass":"removeClass";this.container.$el[t]("pointer-enabled"),this.pointerEnabled=e}}}])}(Ge),ht=function(e){function t(e){var r;it(this,t),r=et(this,t,[e]);var i=e.options.closedCaptionsConfig;return r._title=i&&i.title?i.title:null,r._ariaLabel=i&&i.ariaLabel?i.ariaLabel:"cc-button",r._labelCb=i&&i.labelCallback&&"function"==typeof i.labelCallback?i.labelCallback:function(e){return e.name},r}return st(t,e),at(t,[{key:"name",get:function(){return"closed_captions"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"template",get:function(){return Ee('<button type="button" class="cc-button media-control-button media-control-icon" data-cc-button aria-label="<%= ariaLabel %>"></button>\n<ul>\n <% if (title) { %>\n <li data-title><%= title %></li>\n <% }; %>\n <li><a href="#" data-cc-select="-1"><%= disabledLabel %></a></li>\n <% for (var i = 0; i < tracks.length; i++) { %>\n <li><a href="#" data-cc-select="<%= tracks[i].id %>"><%= tracks[i].label %></a></li>\n <% }; %>\n</ul>\n')}},{key:"events",get:function(){return{"click [data-cc-button]":"toggleContextMenu","click [data-cc-select]":"onTrackSelect"}}},{key:"attributes",get:function(){return{class:"cc-controls","data-cc-controls":""}}},{key:"bindEvents",value:function(){this.listenTo(this.core,ue.CORE_ACTIVE_CONTAINER_CHANGED,this.containerChanged),this.listenTo(this.core.mediaControl,ue.MEDIACONTROL_RENDERED,this.render),this.listenTo(this.core.mediaControl,ue.MEDIACONTROL_HIDE,this.hideContextMenu),this.bindContainerEvents()}},{key:"bindContainerEvents",value:function(){this.container=this.core.activeContainer,this.container&&(this.listenTo(this.container,ue.CONTAINER_SUBTITLE_AVAILABLE,this.onSubtitleAvailable),this.listenTo(this.container,ue.CONTAINER_SUBTITLE_CHANGED,this.onSubtitleChanged),this.listenTo(this.container,ue.CONTAINER_STOP,this.onContainerStop))}},{key:"onContainerStop",value:function(){this.ccAvailable(!1)}},{key:"containerChanged",value:function(){this.ccAvailable(!1),this.stopListening(),this.bindEvents()}},{key:"onSubtitleAvailable",value:function(){this.renderCcButton(),this.ccAvailable(!0)}},{key:"onSubtitleChanged",value:function(e){this.setCurrentContextMenuElement(e.id)}},{key:"onTrackSelect",value:function(e){var t=parseInt(e.target.dataset.ccSelect,10);return this.container.closedCaptionsTrackId=t,this.hideContextMenu(),e.stopPropagation(),!1}},{key:"ccAvailable",value:function(e){var t=e?"addClass":"removeClass";this.$el[t]("available")}},{key:"toggleContextMenu",value:function(){this.$el.find("ul").toggle()}},{key:"hideContextMenu",value:function(){this.$el.find("ul").hide()}},{key:"contextMenuElement",value:function(e){return this.$el.find("ul a"+(isNaN(e)?"":'[data-cc-select="'+e+'"]')).parent()}},{key:"setCurrentContextMenuElement",value:function(e){if(this._trackId!==e){this.contextMenuElement().removeClass("current"),this.contextMenuElement(e).addClass("current");var t=e>-1?"addClass":"removeClass";this.$ccButton[t]("enabled"),this._trackId=e}}},{key:"renderCcButton",value:function(){for(var e=this.container?this.container.closedCaptionsTracks:[],t=0;t<e.length;t++)e[t].label=this._labelCb(e[t]);var r=Te.getStyleFor(".cc-controls[data-cc-controls] {\n float: right;\n position: relative;\n display: none; }\n .cc-controls[data-cc-controls].available {\n display: block; }\n .cc-controls[data-cc-controls] .cc-button {\n padding: 6px !important; }\n .cc-controls[data-cc-controls] .cc-button.enabled {\n display: block;\n opacity: 1.0; }\n .cc-controls[data-cc-controls] .cc-button.enabled:hover {\n opacity: 1.0;\n text-shadow: none; }\n .cc-controls[data-cc-controls] > ul {\n list-style-type: none;\n position: absolute;\n bottom: 25px;\n border: 1px solid black;\n display: none;\n background-color: #e6e6e6; }\n .cc-controls[data-cc-controls] li {\n font-size: 10px; }\n .cc-controls[data-cc-controls] li[data-title] {\n background-color: #c3c2c2;\n padding: 5px; }\n .cc-controls[data-cc-controls] li a {\n color: #444;\n padding: 2px 10px;\n display: block;\n text-decoration: none; }\n .cc-controls[data-cc-controls] li a:hover {\n background-color: #555;\n color: white; }\n .cc-controls[data-cc-controls] li a:hover a {\n color: white;\n text-decoration: none; }\n .cc-controls[data-cc-controls] li.current a {\n color: #f00; }\n",{baseUrl:this.options.baseUrl});this.$el.html(this.template({ariaLabel:this._ariaLabel,disabledLabel:this.core.i18n.t("disabled"),title:this._title,tracks:e})),this.$ccButton=this.$el.find("button.cc-button[data-cc-button]"),this.$ccButton.append('<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 49 41.8" style="enable-background:new 0 0 49 41.8;" xml:space="preserve">\n<path d="M47.1,0H3.2C1.6,0,0,1.2,0,2.8v31.5C0,35.9,1.6,37,3.2,37h11.9l3.2,1.9l4.7,2.7c0.9,0.5,2-0.1,2-1.1V37h22.1\n\tc1.6,0,1.9-1.1,1.9-2.7V2.8C49,1.2,48.7,0,47.1,0z M7.2,18.6c0-4.8,3.5-9.3,9.9-9.3c4.8,0,7.1,2.7,7.1,2.7l-2.5,4\n\tc0,0-1.7-1.7-4.2-1.7c-2.8,0-4.3,2.1-4.3,4.3c0,2.1,1.5,4.4,4.5,4.4c2.5,0,4.9-2.1,4.9-2.1l2.2,4.2c0,0-2.7,2.9-7.6,2.9\n\tC10.8,27.9,7.2,23.5,7.2,18.6z M36.9,27.9c-6.4,0-9.9-4.4-9.9-9.3c0-4.8,3.5-9.3,9.9-9.3C41.7,9.3,44,12,44,12l-2.5,4\n\tc0,0-1.7-1.7-4.2-1.7c-2.8,0-4.3,2.1-4.3,4.3c0,2.1,1.5,4.4,4.5,4.4c2.5,0,4.9-2.1,4.9-2.1l2.2,4.2C44.5,25,41.9,27.9,36.9,27.9z"/>\n</svg>'),this.$el.append(r[0])}},{key:"render",value:function(){this.renderCcButton();var e=this.core.mediaControl.$el.find("button[data-fullscreen]");return e[0]?this.$el.insertAfter(e):this.core.mediaControl.$el.find(".media-control-right-panel[data-media-control]").prepend(this.$el),this}}])}(Ce),ft=function(e){function t(e){var r;return it(this,t),(r=et(this,t,[e])).settingsUpdate(),r}return st(t,e),at(t,[{key:"template",get:function(){return Ee('<div class="live-info"><%= live %></div>\n<button type="button" class="live-button" aria-label="<%= backToLive %>"><%= backToLive %></button>\n')}},{key:"name",get:function(){return"dvr_controls"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"events",get:function(){return{"click .live-button":"click"}}},{key:"attributes",get:function(){return{class:"dvr-controls","data-dvr-controls":""}}},{key:"bindEvents",value:function(){this.bindCoreEvents(),this.bindContainerEvents()}},{key:"bindCoreEvents",value:function(){var e=this;this.core.mediaControl.settings?(this.listenTo(this.core.mediaControl,ue.MEDIACONTROL_CONTAINERCHANGED,this.containerChanged),this.listenTo(this.core.mediaControl,ue.MEDIACONTROL_RENDERED,this.settingsUpdate),this.listenTo(this.core,ue.CORE_OPTIONS_CHANGE,this.render)):setTimeout((function(){return e.bindCoreEvents()}),100)}},{key:"bindContainerEvents",value:function(){this.core.activeContainer&&(this.listenToOnce(this.core.activeContainer,ue.CONTAINER_TIMEUPDATE,this.render),this.listenTo(this.core.activeContainer,ue.CONTAINER_PLAYBACKDVRSTATECHANGED,this.dvrChanged))}},{key:"containerChanged",value:function(){this.stopListening(),this.bindEvents()}},{key:"dvrChanged",value:function(e){this.core.getPlaybackType()===De.LIVE&&(this.settingsUpdate(),this.core.mediaControl.$el.addClass("live"),e?(this.core.mediaControl.$el.addClass("dvr"),this.core.mediaControl.$el.find(".media-control-indicator[data-position], .media-control-indicator[data-duration]").hide()):this.core.mediaControl.$el.removeClass("dvr"))}},{key:"click",value:function(){var e=this.core.mediaControl,t=e.container;t.isPlaying()||t.play(),e.$el.hasClass("dvr")&&t.seek(t.getDuration())}},{key:"settingsUpdate",value:function(){var e=this;this.stopListening(),this.core.mediaControl.$el.removeClass("live"),this.shouldRender()&&(this.render(),this.$el.click((function(){return e.click()}))),this.bindEvents()}},{key:"shouldRender",value:function(){return(void 0===this.core.options.useDvrControls||!!this.core.options.useDvrControls)&&this.core.getPlaybackType()===De.LIVE}},{key:"render",value:function(){var e=Te.getStyleFor('.dvr-controls[data-dvr-controls] {\n display: inline-block;\n float: left;\n color: #fff;\n line-height: 32px;\n font-size: 10px;\n font-weight: bold;\n margin-left: 6px; }\n .dvr-controls[data-dvr-controls] .live-info {\n cursor: default;\n font-family: "Roboto", "Open Sans", Arial, sans-serif;\n text-transform: uppercase; }\n .dvr-controls[data-dvr-controls] .live-info:before {\n content: "";\n display: inline-block;\n position: relative;\n width: 7px;\n height: 7px;\n border-radius: 3.5px;\n margin-right: 3.5px;\n background-color: #ff0101; }\n .dvr-controls[data-dvr-controls] .live-info.disabled {\n opacity: 0.3; }\n .dvr-controls[data-dvr-controls] .live-info.disabled:before {\n background-color: #fff; }\n .dvr-controls[data-dvr-controls] .live-button {\n cursor: pointer;\n outline: none;\n display: none;\n border: 0;\n color: #fff;\n background-color: transparent;\n height: 32px;\n padding: 0;\n opacity: 0.7;\n font-family: "Roboto", "Open Sans", Arial, sans-serif;\n text-transform: uppercase;\n transition: all 0.1s ease; }\n .dvr-controls[data-dvr-controls] .live-button:before {\n content: "";\n display: inline-block;\n position: relative;\n width: 7px;\n height: 7px;\n border-radius: 3.5px;\n margin-right: 3.5px;\n background-color: #fff; }\n .dvr-controls[data-dvr-controls] .live-button:hover {\n opacity: 1;\n text-shadow: rgba(255, 255, 255, 0.75) 0 0 5px; }\n\n.dvr .dvr-controls[data-dvr-controls] .live-info {\n display: none; }\n\n.dvr .dvr-controls[data-dvr-controls] .live-button {\n display: block; }\n\n.dvr.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar] {\n background-color: #005aff; }\n\n.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar] {\n background-color: #ff0101; }\n',{baseUrl:this.options.baseUrl});return this.$el.html(this.template({live:this.core.i18n.t("live"),backToLive:this.core.i18n.t("back_to_live")})),this.$el.append(e[0]),this.shouldRender()&&(this.core.mediaControl.$el.addClass("live"),this.core.mediaControl.$(".media-control-left-panel[data-media-control]").append(this.$el)),this}}])}(Ce),pt=function(e){function t(){return it(this,t),et(this,t,arguments)}return st(t,e),at(t,[{key:"name",get:function(){return"end_video"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"bindEvents",value:function(){this.listenTo(this.core,ue.CORE_ACTIVE_CONTAINER_CHANGED,this.containerChanged);var e=this.core.activeContainer;e&&(this.listenTo(e,ue.CONTAINER_ENDED,this.ended),this.listenTo(e,ue.CONTAINER_STOP,this.ended))}},{key:"containerChanged",value:function(){this.stopListening(),this.bindEvents()}},{key:"ended",value:function(){(void 0===this.core.options.exitFullscreenOnEnd||this.core.options.exitFullscreenOnEnd)&&this.core.isFullscreen()&&this.core.toggleFullscreen()}}])}(Ve),gt=function(e){function t(e){var r;return it(this,t),(r=et(this,t,[e])).options.disableErrorScreen?ut(r,r.disable()):r}return st(t,e),at(t,[{key:"name",get:function(){return"error_screen"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"template",get:function(){return Ee('<div class="player-error-screen__content" data-error-screen>\n <% if (icon) { %>\n <div class="player-error-screen__icon" data-error-screen><%= icon %></div>\n <% } %>\n <div class="player-error-screen__title" data-error-screen><%= title %></div>\n <div class="player-error-screen__message" data-error-screen><%= message %></div>\n <div class="player-error-screen__code" data-error-screen>Error code: <%= code %></div>\n <div class="player-error-screen__reload" data-error-screen><%= reloadIcon %></div>\n</div>\n')}},{key:"container",get:function(){return this.core.getCurrentContainer()}},{key:"attributes",get:function(){return{class:"player-error-screen","data-error-screen":""}}},{key:"bindEvents",value:function(){this.listenTo(this.core,ue.ERROR,this.onError),this.listenTo(this.core,ue.CORE_ACTIVE_CONTAINER_CHANGED,this.onContainerChanged)}},{key:"bindReload",value:function(){this.reloadButton=this.$el.find(".player-error-screen__reload"),this.reloadButton&&this.reloadButton.on("click",this.reload.bind(this))}},{key:"reload",value:function(){var e=this;this.listenToOnce(this.core,ue.CORE_READY,(function(){return e.container.play()})),this.core.load(this.options.sources,this.options.mimeType),this.unbindReload()}},{key:"unbindReload",value:function(){this.reloadButton&&this.reloadButton.off("click")}},{key:"onContainerChanged",value:function(){this.err=null,this.unbindReload(),this.hide()}},{key:"onError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.level===Se.Levels.FATAL&&(this.err=e,this.container.disableMediaControl(),this.container.stop(),this.show())}},{key:"show",value:function(){this.render(),this.$el.show()}},{key:"hide",value:function(){this.$el.hide()}},{key:"render",value:function(){if(this.err){var e=Te.getStyleFor("[data-player] .player-error-screen {\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n color: #CCCACA;\n position: absolute;\n top: 0;\n height: 100%;\n width: 100%;\n background-color: rgba(0, 0, 0, 0.7);\n z-index: 2000;\n display: flex;\n flex-direction: column;\n justify-content: center; }\n [data-player] .player-error-screen__content[data-error-screen] {\n font-size: 14px;\n color: #CCCACA;\n margin-top: 45px; }\n [data-player] .player-error-screen__title[data-error-screen] {\n font-weight: bold;\n line-height: 30px;\n font-size: 18px; }\n [data-player] .player-error-screen__message[data-error-screen] {\n width: 90%;\n margin: 0 auto; }\n [data-player] .player-error-screen__code[data-error-screen] {\n font-size: 13px;\n margin-top: 15px; }\n [data-player] .player-error-screen__reload {\n cursor: pointer;\n width: 30px;\n margin: 15px auto 0 !important; }\n",{baseUrl:this.options.baseUrl});return this.$el.html(this.template({title:this.err.UI.title,message:this.err.UI.message,code:this.err.code,icon:this.err.UI.icon||"",reloadIcon:'<svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">\n <path d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/>\n <path d="M0 0h24v24H0z" fill="none"/>\n</svg>'})),this.$el.append(e[0]),this.core.$el.append(this.el),this.bindReload(),this}}}])}(Ce),vt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\n <path fill="#010101" d="M1.425.35L14.575 8l-13.15 7.65V.35z"/>\n</svg>',mt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\n <path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M1.712 14.76H6.43V1.24H1.71v13.52zm7.86-13.52v13.52h4.716V1.24H9.573z"/>\n</svg>',yt=D('link[rel="shortcut icon"]'),At=function(e){function t(e){var r;return it(this,t),(r=et(this,t,[e]))._container=null,r.configure(),r}return st(t,e),at(t,[{key:"name",get:function(){return"favicon"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"oldIcon",get:function(){return yt}},{key:"configure",value:function(){this.core.options.changeFavicon?this.enabled||(this.stopListening(this.core,ue.CORE_OPTIONS_CHANGE),this.enable()):this.enabled&&(this.disable(),this.listenTo(this.core,ue.CORE_OPTIONS_CHANGE,this.configure))}},{key:"bindEvents",value:function(){this.listenTo(this.core,ue.CORE_OPTIONS_CHANGE,this.configure),this.listenTo(this.core,ue.CORE_ACTIVE_CONTAINER_CHANGED,this.containerChanged),this.core.activeContainer&&this.containerChanged()}},{key:"containerChanged",value:function(){this._container&&this.stopListening(this._container),this._container=this.core.activeContainer,this.listenTo(this._container,ue.CONTAINER_PLAY,this.setPlayIcon),this.listenTo(this._container,ue.CONTAINER_PAUSE,this.setPauseIcon),this.listenTo(this._container,ue.CONTAINER_STOP,this.resetIcon),this.listenTo(this._container,ue.CONTAINER_ENDED,this.resetIcon),this.listenTo(this._container,ue.CONTAINER_ERROR,this.resetIcon),this.resetIcon()}},{key:"disable",value:function(){ct(ot(t.prototype),"disable",this).call(this),this.resetIcon()}},{key:"destroy",value:function(){ct(ot(t.prototype),"destroy",this).call(this),this.resetIcon()}},{key:"createIcon",value:function(e){var t=D("<canvas/>");t[0].width=16,t[0].height=16;var r=t[0].getContext("2d");r.fillStyle="#000";var i=D(e).find("path").attr("d"),n=new Path2D(i);r.fill(n);var a=D('<link rel="shortcut icon" type="image/png"/>');return a.attr("href",t[0].toDataURL("image/png")),a}},{key:"setPlayIcon",value:function(){this.playIcon||(this.playIcon=this.createIcon(vt)),this.changeIcon(this.playIcon)}},{key:"setPauseIcon",value:function(){this.pauseIcon||(this.pauseIcon=this.createIcon(mt)),this.changeIcon(this.pauseIcon)}},{key:"resetIcon",value:function(){D('link[rel="shortcut icon"]').remove(),D("head").append(this.oldIcon)}},{key:"changeIcon",value:function(e){e&&(D('link[rel="shortcut icon"]').remove(),D("head").append(e))}}])}(Ve),Et=function(e){function t(e){var r;return it(this,t),(r=et(this,t,[e])).container.options.gaAccount&&(r.account=r.container.options.gaAccount,r.trackerName=r.container.options.gaTrackerName?r.container.options.gaTrackerName+".":"Clappr.",r.domainName=r.container.options.gaDomainName,r.currentHDState=void 0,r.embedScript()),r}return st(t,e),at(t,[{key:"name",get:function(){return"google_analytics"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"embedScript",value:function(){var e=this;if(window._gat)this.addEventListeners();else{var t=document.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("async","async"),t.setAttribute("src","//www.google-analytics.com/ga.js"),t.onload=function(){return e.addEventListeners()},document.body.appendChild(t)}}},{key:"addEventListeners",value:function(){var e=this;this.container&&(this.listenTo(this.container,ue.CONTAINER_READY,this.onReady),this.listenTo(this.container,ue.CONTAINER_PLAY,this.onPlay),this.listenTo(this.container,ue.CONTAINER_STOP,this.onStop),this.listenTo(this.container,ue.CONTAINER_PAUSE,this.onPause),this.listenTo(this.container,ue.CONTAINER_ENDED,this.onEnded),this.listenTo(this.container,ue.CONTAINER_STATE_BUFFERING,this.onBuffering),this.listenTo(this.container,ue.CONTAINER_STATE_BUFFERFULL,this.onBufferFull),this.listenTo(this.container,ue.CONTAINER_ERROR,this.onError),this.listenTo(this.container,ue.CONTAINER_PLAYBACKSTATE,this.onPlaybackChanged),this.listenTo(this.container,ue.CONTAINER_VOLUME,(function(t){return e.onVolumeChanged(t)})),this.listenTo(this.container,ue.CONTAINER_SEEK,(function(t){return e.onSeek(t)})),this.listenTo(this.container,ue.CONTAINER_FULL_SCREEN,this.onFullscreen),this.listenTo(this.container,ue.CONTAINER_HIGHDEFINITIONUPDATE,this.onHD),this.listenTo(this.container,ue.CONTAINER_PLAYBACKDVRSTATECHANGED,this.onDVR)),_gaq.push([this.trackerName+"_setAccount",this.account]),this.domainName&&_gaq.push([this.trackerName+"_setDomainName",this.domainName])}},{key:"onReady",value:function(){this.push(["Video","Playback",this.container.playback.name])}},{key:"onPlay",value:function(){this.push(["Video","Play",this.container.playback.src])}},{key:"onStop",value:function(){this.push(["Video","Stop",this.container.playback.src])}},{key:"onEnded",value:function(){this.push(["Video","Ended",this.container.playback.src])}},{key:"onBuffering",value:function(){this.push(["Video","Buffering",this.container.playback.src])}},{key:"onBufferFull",value:function(){this.push(["Video","Bufferfull",this.container.playback.src])}},{key:"onError",value:function(){this.push(["Video","Error",this.container.playback.src])}},{key:"onHD",value:function(e){var t=e?"ON":"OFF";t!==this.currentHDState&&(this.currentHDState=t,this.push(["Video","HD - "+t,this.container.playback.src]))}},{key:"onPlaybackChanged",value:function(e){null!==e.type&&this.push(["Video","Playback Type - "+e.type,this.container.playback.src])}},{key:"onDVR",value:function(e){var t=e?"ON":"OFF";this.push(["Interaction","DVR - "+t,this.container.playback.src])}},{key:"onPause",value:function(){this.push(["Video","Pause",this.container.playback.src])}},{key:"onSeek",value:function(){this.push(["Video","Seek",this.container.playback.src])}},{key:"onVolumeChanged",value:function(){this.push(["Interaction","Volume",this.container.playback.src])}},{key:"onFullscreen",value:function(){this.push(["Interaction","Fullscreen",this.container.playback.src])}},{key:"push",value:function(e){var t=[this.trackerName+"_trackEvent"].concat(e);_gaq.push(t)}}])}(Ge),Tt=function(e){this.element=e||window.document,this.initialize()};Tt.KEY_NAMES_BY_CODE={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"caps_lock",27:"esc",32:"space",37:"left",38:"up",39:"right",40:"down",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12"},Tt.KEY_CODES_BY_NAME={},function(){for(var e in Tt.KEY_NAMES_BY_CODE)Object.prototype.hasOwnProperty.call(Tt.KEY_NAMES_BY_CODE,e)&&(Tt.KEY_CODES_BY_NAME[Tt.KEY_NAMES_BY_CODE[e]]=+e)}(),Tt.MODIFIERS=["shift","ctrl","alt"],Tt.registerEvent=document.addEventListener?function(e,t,r){e.addEventListener(t,r,!1)}:document.attachEvent?function(e,t,r){e.attachEvent("on"+t,r)}:void 0,Tt.unregisterEvent=document.removeEventListener?function(e,t,r){e.removeEventListener(t,r,!1)}:document.detachEvent?function(e,t,r){e.detachEvent("on"+t,r)}:void 0,Tt.stringContains=function(e,t){return-1!==e.indexOf(t)},Tt.neatString=function(e){return e.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")},Tt.capitalize=function(e){return e.toLowerCase().replace(/^./,(function(e){return e.toUpperCase()}))},Tt.isString=function(e){return Tt.stringContains(Object.prototype.toString.call(e),"String")},Tt.arrayIncludes=Array.prototype.indexOf?function(e,t){return-1!==e.indexOf(t)}:function(e,t){for(var r=0;r<e.length;r++)if(e[r]===t)return!0;return!1},Tt.extractModifiers=function(e){var t,r;for(t=[],r=0;r<Tt.MODIFIERS.length;r++)Tt.stringContains(e,Tt.MODIFIERS[r])&&t.push(Tt.MODIFIERS[r]);return t},Tt.extractKey=function(e){var t,r;for(t=Tt.neatString(e).split(" "),r=0;r<t.length;r++)if(!Tt.arrayIncludes(Tt.MODIFIERS,t[r]))return t[r]},Tt.modifiersAndKey=function(e){var t,r;return Tt.stringContains(e,"any")?Tt.neatString(e).split(" ").slice(0,2).join(" "):(t=Tt.extractModifiers(e),(r=Tt.extractKey(e))&&!Tt.arrayIncludes(Tt.MODIFIERS,r)&&t.push(r),t.join(" "))},Tt.keyName=function(e){return Tt.KEY_NAMES_BY_CODE[e+""]},Tt.keyCode=function(e){return+Tt.KEY_CODES_BY_NAME[e]},Tt.prototype.initialize=function(){var e,t=this;for(this.lastKeyCode=-1,this.lastModifiers={},e=0;e<Tt.MODIFIERS.length;e++)this.lastModifiers[Tt.MODIFIERS[e]]=!1;this.keysDown={any:[]},this.keysUp={any:[]},this.downHandler=this.handler("down"),this.upHandler=this.handler("up"),Tt.registerEvent(this.element,"keydown",this.downHandler),Tt.registerEvent(this.element,"keyup",this.upHandler),Tt.registerEvent(window,"unload",(function e(){Tt.unregisterEvent(t.element,"keydown",t.downHandler),Tt.unregisterEvent(t.element,"keyup",t.upHandler),Tt.unregisterEvent(window,"unload",e)}))},Tt.prototype.handler=function(e){var t=this;return function(r){var i,n,a;for(r=r||window.event,t.lastKeyCode=r.keyCode,i=0;i<Tt.MODIFIERS.length;i++)t.lastModifiers[Tt.MODIFIERS[i]]=r[Tt.MODIFIERS[i]+"Key"];for(Tt.arrayIncludes(Tt.MODIFIERS,Tt.keyName(t.lastKeyCode))&&(t.lastModifiers[Tt.keyName(t.lastKeyCode)]=!0),n=t["keys"+Tt.capitalize(e)],i=0;i<n.any.length;i++)!1===n.any[i](r)&&r.preventDefault&&r.preventDefault();if(n[a=t.lastModifiersAndKey()])for(i=0;i<n[a].length;i++)!1===n[a][i](r)&&r.preventDefault&&r.preventDefault()}},Tt.prototype.registerKeys=function(e,t,r){var i,n,a=this["keys"+Tt.capitalize(e)];for(Tt.isString(t)&&(t=[t]),i=0;i<t.length;i++)n=t[i],a[n=Tt.modifiersAndKey(n+"")]?a[n].push(r):a[n]=[r];return this},Tt.prototype.unregisterKeys=function(e,t,r){var i,n,a,s=this["keys"+Tt.capitalize(e)];for(Tt.isString(t)&&(t=[t]),i=0;i<t.length;i++)if(a=t[i],a=Tt.modifiersAndKey(a+""),null===r)delete s[a];else if(s[a])for(n=0;n<s[a].length;n++)if(String(s[a][n])===String(r)){s[a].splice(n,1);break}return this},Tt.prototype.off=function(e){return this.unregisterKeys("down",e,null)},Tt.prototype.delegate=function(e,t,r){return null!==r||void 0!==r?this.registerKeys(e,t,r):this.unregisterKeys(e,t,r)},Tt.prototype.down=function(e,t){return this.delegate("down",e,t)},Tt.prototype.up=function(e,t){return this.delegate("up",e,t)},Tt.prototype.lastKey=function(e){return e?this.lastModifiers[e]:Tt.keyName(this.lastKeyCode)},Tt.prototype.lastModifiersAndKey=function(){var e,t;for(e=[],t=0;t<Tt.MODIFIERS.length;t++)this.lastKey(Tt.MODIFIERS[t])&&e.push(Tt.MODIFIERS[t]);return Tt.arrayIncludes(e,this.lastKey())||e.push(this.lastKey()),e.join(" ")};var bt={Kibo:Tt},kt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\n <path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M1.712 1.24h12.6v13.52h-12.6z"/>\n</svg>',St='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\n <path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M11.5 11h-.002v1.502L7.798 10H4.5V6h3.297l3.7-2.502V4.5h.003V11zM11 4.49L7.953 6.5H5v3h2.953L11 11.51V4.49z"/>\n</svg>',_t='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\n <path fill="#010101" d="M7.156 8L4 11.156V8.5H3V13h4.5v-1H4.844L8 8.844 7.156 8zM8.5 3v1h2.657L8 7.157 8.846 8 12 4.844V7.5h1V3H8.5z"/>\n</svg>',Ct=Q.Config,Lt=Q.Fullscreen,Dt=Q.formatTime,It=Q.extend,Rt=Q.removeArrayItem,Ot=function(e){function t(e){var r;return it(this,t),(r=et(this,t,[e])).persistConfig=r.options.persistConfig,r.currentPositionValue=null,r.currentDurationValue=null,r.keepVisible=!1,r.fullScreenOnVideoTagSupported=null,r.setInitialVolume(),r.settings={left:["play","stop","pause"],right:["volume"],default:["position","seekbar","duration"]},r.kibo=new Tt(r.options.focusElement),r.bindKeyEvents(),r.container?D.isEmptyObject(r.container.settings)||(r.settings=D.extend({},r.container.settings)):r.settings={},r.userDisabled=!1,(r.container&&r.container.mediaControlDisabled||r.options.chromeless)&&r.disable(),r.stopDragHandler=function(e){return r.stopDrag(e)},r.updateDragHandler=function(e){return r.updateDrag(e)},D(document).bind("mouseup",r.stopDragHandler),D(document).bind("mousemove",r.updateDragHandler),r}return st(t,e),at(t,[{key:"name",get:function(){return"media_control"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"disabled",get:function(){var e=this.container&&this.container.getPlaybackType()===De.NO_OP;return this.userDisabled||e}},{key:"container",get:function(){return this.core&&this.core.activeContainer}},{key:"playback",get:function(){return this.core&&this.core.activePlayback}},{key:"attributes",get:function(){return{class:"media-control","data-media-control":""}}},{key:"events",get:function(){return{"click [data-play]":"play","click [data-pause]":"pause","click [data-playpause]":"togglePlayPause","click [data-stop]":"stop","click [data-playstop]":"togglePlayStop","click [data-fullscreen]":"toggleFullscreen","click .bar-container[data-seekbar]":"seek","click .bar-container[data-volume]":"onVolumeClick","click .drawer-icon[data-volume]":"toggleMute","mouseenter .drawer-container[data-volume]":"showVolumeBar","mouseleave .drawer-container[data-volume]":"hideVolumeBar","mousedown .bar-container[data-volume]":"startVolumeDrag","mousemove .bar-container[data-volume]":"mousemoveOnVolumeBar","mousedown .bar-scrubber[data-seekbar]":"startSeekDrag","mousemove .bar-container[data-seekbar]":"mousemoveOnSeekBar","mouseleave .bar-container[data-seekbar]":"mouseleaveOnSeekBar","mouseenter .media-control-layer[data-controls]":"setUserKeepVisible","mouseleave .media-control-layer[data-controls]":"resetUserKeepVisible"}}},{key:"template",get:function(){return Ee('<div class="media-control-background" data-background></div>\n<div class="media-control-layer" data-controls>\n <% var renderBar = function(name) { %>\n <div class="bar-container" data-<%= name %>>\n <div class="bar-background" data-<%= name %>>\n <div class="bar-fill-1" data-<%= name %>></div>\n <div class="bar-fill-2" data-<%= name %>></div>\n <div class="bar-hover" data-<%= name %>></div>\n </div>\n <div class="bar-scrubber" data-<%= name %>>\n <div class="bar-scrubber-icon" data-<%= name %>></div>\n </div>\n </div>\n <% }; %>\n <% var renderSegmentedBar = function(name, segments) {\n segments = segments || 10; %>\n <div class="bar-container" data-<%= name %>>\n <% for (var i = 0; i < segments; i++) { %>\n <div class="segmented-bar-element" data-<%= name %>></div>\n <% } %>\n </div>\n <% }; %>\n <% var renderDrawer = function(name, renderContent) { %>\n <div class="drawer-container" data-<%= name %>>\n <div class="drawer-icon-container" data-<%= name %>>\n <div class="drawer-icon media-control-icon" data-<%= name %>></div>\n <span class="drawer-text" data-<%= name %>></span>\n </div>\n <% renderContent(name); %>\n </div>\n <% }; %>\n <% var renderIndicator = function(name) { %>\n <div class="media-control-indicator" data-<%= name %>></div>\n <% }; %>\n <% var renderButton = function(name) { %>\n <button type="button" class="media-control-button media-control-icon" data-<%= name %> aria-label="<%= name %>"></button>\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 <div class="media-control-center-panel" data-media-control>\n <% render(settings.default); %>\n </div>\n <% } %>\n <% if (settings.left && settings.left.length) { %>\n <div class="media-control-left-panel" data-media-control>\n <% render(settings.left); %>\n </div>\n <% } %>\n <% if (settings.right && settings.right.length) { %>\n <div class="media-control-right-panel" data-media-control>\n <% render(settings.right); %>\n </div>\n <% } %>\n</div>\n')}},{key:"volume",get:function(){return this.container&&this.container.isReady?this.container.volume:this.intendedVolume}},{key:"muted",get:function(){return 0===this.volume}},{key:"getExternalInterface",value:function(){var e=this;return{setVolume:this.setVolume,getVolume:function(){return e.volume}}}},{key:"bindEvents",value:function(){var e=this;this.stopListening(),this.listenTo(this.core,ue.CORE_ACTIVE_CONTAINER_CHANGED,this.onActiveContainerChanged),this.listenTo(this.core,ue.CORE_MOUSE_MOVE,this.show),this.listenTo(this.core,ue.CORE_MOUSE_LEAVE,(function(){return e.hide(e.options.hideMediaControlDelay)})),this.listenTo(this.core,ue.CORE_FULLSCREEN,this.show),this.listenTo(this.core,ue.CORE_OPTIONS_CHANGE,this.configure),this.listenTo(this.core,ue.CORE_RESIZE,this.playerResize),this.bindContainerEvents()}},{key:"bindContainerEvents",value:function(){this.container&&(this.listenTo(this.container,ue.CONTAINER_PLAY,this.changeTogglePlay),this.listenTo(this.container,ue.CONTAINER_PAUSE,this.changeTogglePlay),this.listenTo(this.container,ue.CONTAINER_STOP,this.changeTogglePlay),this.listenTo(this.container,ue.CONTAINER_DBLCLICK,this.toggleFullscreen),this.listenTo(this.container,ue.CONTAINER_TIMEUPDATE,this.onTimeUpdate),this.listenTo(this.container,ue.CONTAINER_PROGRESS,this.updateProgressBar),this.listenTo(this.container,ue.CONTAINER_SETTINGSUPDATE,this.settingsUpdate),this.listenTo(this.container,ue.CONTAINER_PLAYBACKDVRSTATECHANGED,this.settingsUpdate),this.listenTo(this.container,ue.CONTAINER_HIGHDEFINITIONUPDATE,this.highDefinitionUpdate),this.listenTo(this.container,ue.CONTAINER_MEDIACONTROL_DISABLE,this.disable),this.listenTo(this.container,ue.CONTAINER_MEDIACONTROL_ENABLE,this.enable),this.listenTo(this.container,ue.CONTAINER_ENDED,this.ended),this.listenTo(this.container,ue.CONTAINER_VOLUME,this.onVolumeChanged),this.listenTo(this.container,ue.CONTAINER_OPTIONS_CHANGE,this.setInitialVolume),"video"===this.container.playback.el.nodeName.toLowerCase()&&this.listenToOnce(this.container,ue.CONTAINER_LOADEDMETADATA,this.onLoadedMetadataOnVideoTag))}},{key:"disable",value:function(){this.userDisabled=!0,this.hide(),this.unbindKeyEvents(),this.$el.hide()}},{key:"enable",value:function(){this.options.chromeless||(this.userDisabled=!1,this.bindKeyEvents(),this.show())}},{key:"play",value:function(){this.container&&this.container.play()}},{key:"pause",value:function(){this.container&&this.container.pause()}},{key:"stop",value:function(){this.container&&this.container.stop()}},{key:"setInitialVolume",value:function(){var e=this.persistConfig?Ct.restore("volume"):100,t=this.container&&this.container.options||this.options;this.setVolume(t.mute?0:e,!0)}},{key:"onVolumeChanged",value:function(){this.updateVolumeUI()}},{key:"onLoadedMetadataOnVideoTag",value:function(){var e=this.playback&&this.playback.el;!Lt.fullscreenEnabled()&&e.webkitSupportsFullscreen&&(this.fullScreenOnVideoTagSupported=!0,this.settingsUpdate())}},{key:"updateVolumeUI",value:function(){if(this.rendered){this.$volumeBarContainer.find(".bar-fill-2").css({});var e=this.$volumeBarContainer.width(),t=this.$volumeBarBackground.width(),r=(e-t)/2,i=t*this.volume/100+r;this.$volumeBarFill.css({width:"".concat(this.volume,"%")}),this.$volumeBarScrubber.css({left:i}),this.$volumeBarContainer.find(".segmented-bar-element").removeClass("fill");var n=Math.ceil(this.volume/10);this.$volumeBarContainer.find(".segmented-bar-element").slice(0,n).addClass("fill"),this.$volumeIcon.html(""),this.$volumeIcon.removeClass("muted"),this.muted?(this.$volumeIcon.append('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\n <path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M9.75 11.51L6.7 9.5H3.75v-3H6.7L9.75 4.49v.664l.497.498V3.498L6.547 6H3.248v4h3.296l3.7 2.502v-2.154l-.497.5v.662zm3-5.165L12.404 6l-1.655 1.653L9.093 6l-.346.345L10.402 8 8.747 9.654l.346.347 1.655-1.653L12.403 10l.348-.346L11.097 8l1.655-1.655z"/>\n</svg>'),this.$volumeIcon.addClass("muted")):this.$volumeIcon.append(St),this.applyButtonStyle(this.$volumeIcon)}}},{key:"changeTogglePlay",value:function(){this.$playPauseToggle.html(""),this.$playStopToggle.html(""),this.container&&this.container.isPlaying()?(this.$playPauseToggle.append(mt),this.$playStopToggle.append(kt),this.trigger(ue.MEDIACONTROL_PLAYING)):(this.$playPauseToggle.append(vt),this.$playStopToggle.append(vt),this.trigger(ue.MEDIACONTROL_NOTPLAYING),O.isMobile&&this.show()),this.applyButtonStyle(this.$playPauseToggle),this.applyButtonStyle(this.$playStopToggle)}},{key:"mousemoveOnSeekBar",value:function(e){if(this.settings.seekEnabled){var t=e.pageX-this.$seekBarContainer.offset().left-this.$seekBarHover.width()/2;this.$seekBarHover.css({left:t})}this.trigger(ue.MEDIACONTROL_MOUSEMOVE_SEEKBAR,e)}},{key:"mouseleaveOnSeekBar",value:function(e){this.trigger(ue.MEDIACONTROL_MOUSELEAVE_SEEKBAR,e)}},{key:"onVolumeClick",value:function(e){this.setVolume(this.getVolumeFromUIEvent(e))}},{key:"mousemoveOnVolumeBar",value:function(e){this.draggingVolumeBar&&this.setVolume(this.getVolumeFromUIEvent(e))}},{key:"playerResize",value:function(e){this.$fullscreenToggle.html("");var t=this.core.isFullscreen()?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\n <path fill="#010101" d="M13.5 3.344l-.844-.844L9.5 5.656V3h-1v4.5H13v-1h-2.656L13.5 3.344zM3 9.5h2.656L2.5 12.656l.844.844L6.5 10.344V13h1V8.5H3v1z"/>\n</svg>':_t;this.$fullscreenToggle.append(t),this.applyButtonStyle(this.$fullscreenToggle),0!==this.$el.find(".media-control").length&&this.$el.removeClass("w320"),(e.width<=320||this.options.hideVolumeBar)&&this.$el.addClass("w320")}},{key:"togglePlayPause",value:function(){return this.container.isPlaying()?this.container.pause():this.container.play(),!1}},{key:"togglePlayStop",value:function(){this.container.isPlaying()?this.container.stop():this.container.play()}},{key:"startSeekDrag",value:function(e){this.settings.seekEnabled&&(this.draggingSeekBar=!0,this.$el.addClass("dragging"),this.$seekBarLoaded.addClass("media-control-notransition"),this.$seekBarPosition.addClass("media-control-notransition"),this.$seekBarScrubber.addClass("media-control-notransition"),e&&e.preventDefault())}},{key:"startVolumeDrag",value:function(e){this.draggingVolumeBar=!0,this.$el.addClass("dragging"),e&&e.preventDefault()}},{key:"stopDrag",value:function(e){this.draggingSeekBar&&this.seek(e),this.$el.removeClass("dragging"),this.$seekBarLoaded.removeClass("media-control-notransition"),this.$seekBarPosition.removeClass("media-control-notransition"),this.$seekBarScrubber.removeClass("media-control-notransition dragging"),this.draggingSeekBar=!1,this.draggingVolumeBar=!1}},{key:"updateDrag",value:function(e){if(this.draggingSeekBar){e.preventDefault();var t=(e.pageX-this.$seekBarContainer.offset().left)/this.$seekBarContainer.width()*100;t=Math.min(100,Math.max(t,0)),this.setSeekPercentage(t)}else this.draggingVolumeBar&&(e.preventDefault(),this.setVolume(this.getVolumeFromUIEvent(e)))}},{key:"getVolumeFromUIEvent",value:function(e){return(e.pageX-this.$volumeBarContainer.offset().left)/this.$volumeBarContainer.width()*100}},{key:"toggleMute",value:function(){this.setVolume(this.muted?100:0)}},{key:"setVolume",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e=Math.min(100,Math.max(e,0)),this.intendedVolume=e,this.persistConfig&&!r&&Ct.persist("volume",e);var i=function(){t.container&&t.container.isReady?t.container.setVolume(e):t.listenToOnce(t.container,ue.CONTAINER_READY,(function(){t.container.setVolume(e)}))};this.container?i():this.listenToOnce(this,ue.MEDIACONTROL_CONTAINERCHANGED,(function(){return i()}))}},{key:"toggleFullscreen",value:function(){this.trigger(ue.MEDIACONTROL_FULLSCREEN,this.name),this.container.fullscreen(),this.core.toggleFullscreen(),this.resetUserKeepVisible()}},{key:"onActiveContainerChanged",value:function(){this.fullScreenOnVideoTagSupported=null,this.bindEvents(),this.setInitialVolume(),this.changeTogglePlay(),this.bindContainerEvents(),this.settingsUpdate(),this.container&&this.container.trigger(ue.CONTAINER_PLAYBACKDVRSTATECHANGED,this.container.isDvrInUse()),this.container&&this.container.mediaControlDisabled&&this.disable(),this.trigger(ue.MEDIACONTROL_CONTAINERCHANGED)}},{key:"showVolumeBar",value:function(){this.hideVolumeId&&clearTimeout(this.hideVolumeId),this.$volumeBarContainer.removeClass("volume-bar-hide")}},{key:"hideVolumeBar",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:400;this.$volumeBarContainer&&(this.draggingVolumeBar?this.hideVolumeId=setTimeout((function(){return e.hideVolumeBar()}),t):(this.hideVolumeId&&clearTimeout(this.hideVolumeId),this.hideVolumeId=setTimeout((function(){return e.$volumeBarContainer.addClass("volume-bar-hide")}),t)))}},{key:"ended",value:function(){this.changeTogglePlay()}},{key:"updateProgressBar",value:function(e){var t=e.start/e.total*100,r=e.current/e.total*100;this.$seekBarLoaded.css({left:"".concat(t,"%"),width:"".concat(r-t,"%")})}},{key:"onTimeUpdate",value:function(e){if(!this.draggingSeekBar){var t=e.current<0?e.total:e.current;this.currentPositionValue=t,this.currentDurationValue=e.total,this.renderSeekBar()}}},{key:"renderSeekBar",value:function(){if(null!==this.currentPositionValue&&null!==this.currentDurationValue){this.currentSeekBarPercentage=100,this.container&&(this.container.getPlaybackType()!==De.LIVE||this.container.isDvrInUse())&&(this.currentSeekBarPercentage=this.currentPositionValue/this.currentDurationValue*100),this.setSeekPercentage(this.currentSeekBarPercentage);var e=Dt(this.currentPositionValue),t=Dt(this.currentDurationValue);e!==this.displayedPosition&&(this.$position.text(e),this.displayedPosition=e),t!==this.displayedDuration&&(this.$duration.text(t),this.displayedDuration=t)}}},{key:"seek",value:function(e){if(this.settings.seekEnabled){var t=(e.pageX-this.$seekBarContainer.offset().left)/this.$seekBarContainer.width()*100;return t=Math.min(100,Math.max(t,0)),this.container&&this.container.seekPercentage(t),this.setSeekPercentage(t),!1}}},{key:"setKeepVisible",value:function(){this.keepVisible=!0}},{key:"resetKeepVisible",value:function(){this.keepVisible=!1}},{key:"setUserKeepVisible",value:function(){this.userKeepVisible=!0}},{key:"resetUserKeepVisible",value:function(){this.userKeepVisible=!1}},{key:"isVisible",value:function(){return!this.$el.hasClass("media-control-hide")}},{key:"show",value:function(e){var t=this;if(!this.disabled){var r=e&&e.clientX!==this.lastMouseX&&e.clientY!==this.lastMouseY;(!e||r||navigator.userAgent.match(/firefox/i))&&(clearTimeout(this.hideId),this.$el.show(),this.trigger(ue.MEDIACONTROL_SHOW,this.name),this.container&&this.container.trigger(ue.CONTAINER_MEDIACONTROL_SHOW,this.name),this.$el.removeClass("media-control-hide"),this.hideId=setTimeout((function(){return t.hide()}),2e3),e&&(this.lastMouseX=e.clientX,this.lastMouseY=e.clientY));this.updateCursorStyle(!0)}}},{key:"hide",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.isVisible()){var r=t||2e3;if(clearTimeout(this.hideId),this.disabled||!1!==this.options.hideMediaControl){var i=this.userKeepVisible||this.keepVisible,n=this.draggingSeekBar||this.draggingVolumeBar;if(!this.disabled&&(t||i||n))this.hideId=setTimeout((function(){return e.hide()}),r);else{this.trigger(ue.MEDIACONTROL_HIDE,this.name),this.container&&this.container.trigger(ue.CONTAINER_MEDIACONTROL_HIDE,this.name),this.$el.addClass("media-control-hide"),this.hideVolumeBar(0);this.updateCursorStyle(!1)}}}}},{key:"updateCursorStyle",value:function(e){e?this.core.$el.removeClass("nocursor"):this.core.isFullscreen()&&this.core.$el.addClass("nocursor")}},{key:"settingsUpdate",value:function(){var e=this.getSettings();!e||this.fullScreenOnVideoTagSupported||Lt.fullscreenEnabled()||(e.default&&Rt(e.default,"fullscreen"),e.left&&Rt(e.left,"fullscreen"),e.right&&Rt(e.right,"fullscreen")),JSON.stringify(this.settings)!==JSON.stringify(e)&&(this.settings=e,this.render())}},{key:"getSettings",value:function(){return D.extend(!0,{},this.container&&this.container.settings)}},{key:"highDefinitionUpdate",value:function(e){this.isHD=e;var t=e?"addClass":"removeClass";this.$hdIndicator[t]("enabled")}},{key:"createCachedElements",value:function(){var e=this.$el.find(".media-control-layer");this.$duration=e.find(".media-control-indicator[data-duration]"),this.$fullscreenToggle=e.find("button.media-control-button[data-fullscreen]"),this.$playPauseToggle=e.find("button.media-control-button[data-playpause]"),this.$playStopToggle=e.find("button.media-control-button[data-playstop]"),this.$position=e.find(".media-control-indicator[data-position]"),this.$seekBarContainer=e.find(".bar-container[data-seekbar]"),this.$seekBarHover=e.find(".bar-hover[data-seekbar]"),this.$seekBarLoaded=e.find(".bar-fill-1[data-seekbar]"),this.$seekBarPosition=e.find(".bar-fill-2[data-seekbar]"),this.$seekBarScrubber=e.find(".bar-scrubber[data-seekbar]"),this.$volumeBarContainer=e.find(".bar-container[data-volume]"),this.$volumeContainer=e.find(".drawer-container[data-volume]"),this.$volumeIcon=e.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()}},{key:"resetIndicators",value:function(){this.displayedPosition=this.$position.text(),this.displayedDuration=this.$duration.text()}},{key:"initializeIcons",value:function(){var e=this.$el.find(".media-control-layer");e.find("button.media-control-button[data-play]").append(vt),e.find("button.media-control-button[data-pause]").append(mt),e.find("button.media-control-button[data-stop]").append(kt),this.$playPauseToggle.append(vt),this.$playStopToggle.append(vt),this.$volumeIcon.append(St),this.$fullscreenToggle.append(_t),this.$hdIndicator.append('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\n <path fill="#010101" d="M5.375 7.062H2.637V4.26H.502v7.488h2.135V8.9h2.738v2.848h2.133V4.26H5.375v2.802zm5.97-2.81h-2.84v7.496h2.798c2.65 0 4.195-1.607 4.195-3.77v-.022c0-2.162-1.523-3.704-4.154-3.704zm2.06 3.758c0 1.21-.81 1.896-2.03 1.896h-.83V6.093h.83c1.22 0 2.03.696 2.03 1.896v.02z"/>\n</svg>')}},{key:"setSeekPercentage",value:function(e){e=Math.max(Math.min(e,100),0),this.displayedSeekBarPercentage!==e&&(this.displayedSeekBarPercentage=e,this.$seekBarPosition.removeClass("media-control-notransition"),this.$seekBarScrubber.removeClass("media-control-notransition"),this.$seekBarPosition.css({width:"".concat(e,"%")}),this.$seekBarScrubber.css({left:"".concat(e,"%")}))}},{key:"seekRelative",value:function(e){if(this.settings.seekEnabled){var t=this.container.getCurrentTime(),r=this.container.getDuration(),i=Math.min(Math.max(t+e,0),r);i=Math.min(100*i/r,100),this.container.seekPercentage(i)}}},{key:"bindKeyAndShow",value:function(e,t){var r=this;this.kibo.down(e,(function(){return r.show(),t()}))}},{key:"bindKeyEvents",value:function(){var e=this;if(!O.isMobile&&!this.options.disableKeyboardShortcuts){this.unbindKeyEvents(),this.kibo=new Tt(this.options.focusElement||this.options.parentElement),this.bindKeyAndShow("space",(function(){return e.togglePlayPause()})),this.bindKeyAndShow("left",(function(){return e.seekRelative(-5)})),this.bindKeyAndShow("right",(function(){return e.seekRelative(5)})),this.bindKeyAndShow("shift left",(function(){return e.seekRelative(-10)})),this.bindKeyAndShow("shift right",(function(){return e.seekRelative(10)})),this.bindKeyAndShow("shift ctrl left",(function(){return e.seekRelative(-15)})),this.bindKeyAndShow("shift ctrl right",(function(){return e.seekRelative(15)}));["1","2","3","4","5","6","7","8","9","0"].forEach((function(t){e.bindKeyAndShow(t,(function(){e.settings.seekEnabled&&e.container&&e.container.seekPercentage(10*t)}))}))}}},{key:"unbindKeyEvents",value: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"]))}},{key:"parseColors",value:function(){if(this.options.mediacontrol){this.buttonsColor=this.options.mediacontrol.buttons;var e=this.options.mediacontrol.seekbar;this.$el.find(".bar-fill-2[data-seekbar]").css("background-color",e),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)}}},{key:"applyButtonStyle",value:function(e){this.buttonsColor&&e&&D(e).find("svg path").css("fill",this.buttonsColor)}},{key:"destroy",value:function(){D(document).unbind("mouseup",this.stopDragHandler),D(document).unbind("mousemove",this.updateDragHandler),this.unbindKeyEvents(),this.stopListening(),ct(ot(t.prototype),"destroy",this).call(this)}},{key:"configure",value:function(e){this.options.chromeless||e.source||e.sources?this.disable():this.enable(),this.trigger(ue.MEDIACONTROL_OPTIONS_CHANGE)}},{key:"render",value:function(){var e=this,t=this.options.hideMediaControlDelay||2e3;this.settings&&this.$el.html(this.template({settings:this.settings}));var r=Te.getStyleFor('.media-control-notransition {\n transition: none !important; }\n\n.media-control[data-media-control] {\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 9999;\n pointer-events: none; }\n .media-control[data-media-control].dragging {\n pointer-events: auto;\n cursor: grabbing !important;\n cursor: url("closed-hand.cur"), move; }\n .media-control[data-media-control].dragging * {\n cursor: grabbing !important;\n cursor: url("closed-hand.cur"), move; }\n .media-control[data-media-control] .media-control-background[data-background] {\n position: absolute;\n height: 40%;\n width: 100%;\n bottom: 0;\n background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));\n will-change: transform, opacity;\n transition: opacity 0.6s ease-out; }\n .media-control[data-media-control] .media-control-icon {\n line-height: 0;\n letter-spacing: 0;\n speak: none;\n color: #fff;\n opacity: 0.5;\n vertical-align: middle;\n text-align: left;\n transition: all 0.1s ease; }\n .media-control[data-media-control] .media-control-icon:hover {\n color: white;\n opacity: 0.75;\n text-shadow: rgba(255, 255, 255, 0.8) 0 0 5px; }\n .media-control[data-media-control].media-control-hide .media-control-background[data-background] {\n opacity: 0; }\n .media-control[data-media-control].media-control-hide .media-control-layer[data-controls] {\n transform: translateY(50px); }\n .media-control[data-media-control].media-control-hide .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] {\n opacity: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] {\n position: absolute;\n transform: translateY(-7px);\n bottom: 0;\n width: 100%;\n height: 32px;\n font-size: 0;\n vertical-align: middle;\n pointer-events: auto;\n transition: bottom 0.4s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-left-panel[data-media-control] {\n position: absolute;\n top: 0;\n left: 4px;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-center-panel[data-media-control] {\n height: 100%;\n text-align: center;\n line-height: 32px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-right-panel[data-media-control] {\n position: absolute;\n top: 0;\n right: 4px;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button {\n background-color: transparent;\n border: 0;\n margin: 0 6px;\n padding: 0;\n cursor: pointer;\n display: inline-block;\n width: 32px;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg {\n width: 100%;\n height: 22px; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg path {\n fill: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button:focus {\n outline: none; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-play] {\n float: left;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-pause] {\n float: left;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-stop] {\n float: left;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-fullscreen] {\n float: right;\n background-color: transparent;\n border: 0;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator] {\n background-color: transparent;\n border: 0;\n cursor: default;\n display: none;\n float: right;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled {\n display: block;\n opacity: 1.0; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled:hover {\n opacity: 1.0;\n text-shadow: none; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause] {\n float: left; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop] {\n float: left; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position], .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration] {\n display: inline-block;\n font-size: 10px;\n color: white;\n cursor: default;\n line-height: 32px;\n position: relative; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position] {\n margin: 0 6px 0 7px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration] {\n color: rgba(255, 255, 255, 0.5);\n margin-right: 6px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]:before {\n content: "|";\n margin-right: 7px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] {\n position: absolute;\n top: -20px;\n left: 0;\n display: inline-block;\n vertical-align: middle;\n width: 100%;\n height: 25px;\n cursor: pointer; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] {\n width: 100%;\n height: 1px;\n position: relative;\n top: 12px;\n background-color: #666666; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-1[data-seekbar] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #c2c2c2;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #005aff;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-hover[data-seekbar] {\n opacity: 0;\n position: absolute;\n top: -3px;\n width: 5px;\n height: 7px;\n background-color: rgba(255, 255, 255, 0.5);\n transition: opacity 0.1s ease; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]:hover .bar-background[data-seekbar] .bar-hover[data-seekbar] {\n opacity: 1; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled {\n cursor: default; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled:hover .bar-background[data-seekbar] .bar-hover[data-seekbar] {\n opacity: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] {\n position: absolute;\n transform: translateX(-50%);\n top: 2px;\n left: 0;\n width: 20px;\n height: 20px;\n opacity: 1;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] .bar-scrubber-icon[data-seekbar] {\n position: absolute;\n left: 6px;\n top: 6px;\n width: 8px;\n height: 8px;\n border-radius: 10px;\n box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2);\n background-color: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] {\n float: right;\n display: inline-block;\n height: 32px;\n cursor: pointer;\n margin: 0 6px;\n box-sizing: border-box; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] {\n float: left;\n bottom: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] {\n background-color: transparent;\n border: 0;\n box-sizing: content-box;\n width: 32px;\n height: 32px;\n opacity: 0.5; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]:hover {\n opacity: 0.75; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg {\n height: 24px;\n position: relative;\n top: 3px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg path {\n fill: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume].muted svg {\n margin-left: 2px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] {\n float: left;\n position: relative;\n overflow: hidden;\n top: 6px;\n width: 42px;\n height: 18px;\n padding: 3px 0;\n transition: width .2s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] {\n height: 1px;\n position: relative;\n top: 7px;\n margin: 0 3px;\n background-color: #666666; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-1[data-volume] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #c2c2c2;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-2[data-volume] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #005aff;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-hover[data-volume] {\n opacity: 0;\n position: absolute;\n top: -3px;\n width: 5px;\n height: 7px;\n background-color: rgba(255, 255, 255, 0.5);\n transition: opacity 0.1s ease; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] {\n position: absolute;\n transform: translateX(-50%);\n top: 0px;\n left: 0;\n width: 20px;\n height: 20px;\n opacity: 1;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] .bar-scrubber-icon[data-volume] {\n position: absolute;\n left: 6px;\n top: 6px;\n width: 8px;\n height: 8px;\n border-radius: 10px;\n box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2);\n background-color: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume] {\n float: left;\n width: 4px;\n padding-left: 2px;\n height: 12px;\n opacity: 0.5;\n box-shadow: inset 2px 0 0 white;\n transition: transform .2s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume].fill {\n box-shadow: inset 2px 0 0 #fff;\n opacity: 1; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:nth-of-type(1) {\n padding-left: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:hover {\n transform: scaleY(1.5); }\n .media-control[data-media-control].w320 .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume].volume-bar-hide {\n width: 0;\n height: 12px;\n top: 9px;\n padding: 0; }\n',{baseUrl:this.options.baseUrl});this.$el.append(r[0]),this.createCachedElements(),this.$playPauseToggle.addClass("paused"),this.$playStopToggle.addClass("stopped"),this.changeTogglePlay(),this.container&&(this.hideId=setTimeout((function(){return e.hide()}),t),this.disabled&&this.hide()),O.isSafari&&O.isMobile&&(O.version<10?this.$volumeContainer.css("display","none"):this.$volumeBarContainer.css("display","none")),this.$seekBarPosition.addClass("media-control-notransition"),this.$seekBarScrubber.addClass("media-control-notransition");var i=0;return this.displayedSeekBarPercentage&&(i=this.displayedSeekBarPercentage),this.displayedSeekBarPercentage=null,this.setSeekPercentage(i),setTimeout((function(){!e.settings.seekEnabled&&e.$seekBarContainer.addClass("seek-disabled"),!O.isMobile&&!e.options.disableKeyboardShortcuts&&e.bindKeyEvents(),e.playerResize({width:e.options.width,height:e.options.height}),e.hideVolumeBar(0)}),0),this.parseColors(),this.highDefinitionUpdate(this.isHD),this.core.$el.append(this.el),this.rendered=!0,this.updateVolumeUI(),this.trigger(ue.MEDIACONTROL_RENDERED),this}}])}(Ce);Ot.extend=function(e){return It(Ot,e)};for(var wt=function(e){function t(e){var r;return it(this,t),(r=et(this,t,[e])).hasStartedPlaying=!1,r.playRequested=!1,r.render(),setTimeout((function(){return r.update()}),0),r}return st(t,e),at(t,[{key:"name",get:function(){return"poster"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"template",get:function(){return Ee('<div class="play-wrapper" data-poster></div>\n')}},{key:"shouldRender",get:function(){var e=!(!this.options.poster||!this.options.poster.showForNoOp);return"html_img"!==this.container.playback.name&&(this.container.playback.getPlaybackType()!==De.NO_OP||e)}},{key:"attributes",get:function(){return{class:"player-poster","data-poster":""}}},{key:"events",get:function(){return{click:"clicked"}}},{key:"showOnVideoEnd",get:function(){return!this.options.poster||this.options.poster.showOnVideoEnd||void 0===this.options.poster.showOnVideoEnd}},{key:"bindEvents",value:function(){this.listenTo(this.container,ue.CONTAINER_STOP,this.onStop),this.listenTo(this.container,ue.CONTAINER_PLAY,this.onPlay),this.listenTo(this.container,ue.CONTAINER_STATE_BUFFERING,this.update),this.listenTo(this.container,ue.CONTAINER_STATE_BUFFERFULL,this.update),this.listenTo(this.container,ue.CONTAINER_OPTIONS_CHANGE,this.render),this.listenTo(this.container,ue.CONTAINER_ERROR,this.onError),this.showOnVideoEnd&&this.listenTo(this.container,ue.CONTAINER_ENDED,this.onStop)}},{key:"onError",value:function(e){this.hasFatalError=e.level===Se.Levels.FATAL,this.hasFatalError&&(this.hasStartedPlaying=!1,this.playRequested=!1,this.showPlayButton())}},{key:"onPlay",value:function(){this.hasStartedPlaying=!0,this.update()}},{key:"onStop",value:function(){this.hasStartedPlaying=!1,this.playRequested=!1,this.update()}},{key:"updatePlayButton",value:function(e){!e||this.options.chromeless&&!this.options.allowUserInteraction?this.hidePlayButton():this.showPlayButton()}},{key:"showPlayButton",value:function(){this.hasFatalError&&!this.options.disableErrorScreen||(this.$playButton.show(),this.$el.addClass("clickable"))}},{key:"hidePlayButton",value:function(){this.$playButton.hide(),this.$el.removeClass("clickable")}},{key:"clicked",value:function(){if(!this.hasStartedPlaying)return this.options.chromeless&&!this.options.allowUserInteraction||(this.playRequested=!0,this.update(),this.container.playback&&(this.container.playback._consented=!0),this.container.play()),!1}},{key:"shouldHideOnPlay",value:function(){return!this.container.playback.isAudioOnly}},{key:"update",value:function(){if(this.shouldRender){var e=!this.playRequested&&!this.hasStartedPlaying&&!this.container.buffering;this.updatePlayButton(e),this.updatePoster()}}},{key:"updatePoster",value:function(){this.hasStartedPlaying?this.hidePoster():this.showPoster()}},{key:"showPoster",value:function(){this.container.disableMediaControl(),this.$el.show()}},{key:"hidePoster",value:function(){this.container.enableMediaControl(),this.shouldHideOnPlay()&&this.$el.hide()}},{key:"render",value:function(){if(this.shouldRender){var e=Te.getStyleFor(".player-poster[data-poster] {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n height: 100%;\n width: 100%;\n z-index: 998;\n top: 0;\n left: 0;\n background-color: transparent;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: 50% 50%; }\n .player-poster[data-poster].clickable {\n cursor: pointer; }\n .player-poster[data-poster]:hover .play-wrapper[data-poster] {\n opacity: 1; }\n .player-poster[data-poster] .play-wrapper[data-poster] {\n width: 100%;\n height: 25%;\n margin: 0 auto;\n opacity: 0.75;\n transition: opacity 0.1s ease; }\n .player-poster[data-poster] .play-wrapper[data-poster] svg {\n height: 100%; }\n .player-poster[data-poster] .play-wrapper[data-poster] svg path {\n fill: #fff; }\n",{baseUrl:this.options.baseUrl});if(this.$el.html(this.template()),this.$el.append(e[0]),this.options.poster&&void 0===this.options.poster.custom){var t=this.options.poster.url||this.options.poster;this.$el.css({"background-image":"url("+t+")"}),this.removeVideoElementPoster()}else this.options.poster&&(this.$el.css({background:this.options.poster.custom}),this.removeVideoElementPoster());this.container.$el.append(this.el),this.$playWrapper=this.$el.find(".play-wrapper"),this.$playWrapper.append(vt),this.$playButton=this.$playWrapper.find("svg"),this.$playButton.addClass("poster-icon"),this.$playButton.attr("data-poster","");var r=this.options.mediacontrol&&this.options.mediacontrol.buttons;return r&&this.$el.find("svg path").css("fill",r),this.options.mediacontrol&&this.options.mediacontrol.buttons&&(r=this.options.mediacontrol.buttons,this.$playButton.css("color",r)),this.update(),this}}},{key:"removeVideoElementPoster",value:function(){this.container.playback&&this.container.playback.$el&&this.container.playback.$el[0]&&this.container.playback.$el[0].removeAttribute&&this.container.playback.$el[0].removeAttribute("poster")}}])}(Ke),Pt=Q.formatTime,xt=function(e){function t(e){var r;return it(this,t),(r=et(this,t,[e])).hoveringOverSeekBar=!1,r.hoverPosition=null,r.duration=null,r.firstFragDateTime=null,r.actualLiveTime=!!r.mediaControl.options.actualLiveTime,r.actualLiveTime&&(r.mediaControl.options.actualLiveServerTime?r.actualLiveServerTimeDiff=(new Date).getTime()-new Date(r.mediaControl.options.actualLiveServerTime).getTime():r.actualLiveServerTimeDiff=0),r}return st(t,e),at(t,[{key:"name",get:function(){return"seek_time"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"template",get:function(){return Ee("<span data-seek-time></span>\n<span data-duration></span>\n")}},{key:"attributes",get:function(){return{class:"seek-time","data-seek-time":""}}},{key:"mediaControl",get:function(){return this.core.mediaControl}},{key:"mediaControlContainer",get:function(){return this.mediaControl.container}},{key:"isLiveStreamWithDvr",get:function(){return this.mediaControlContainer&&this.mediaControlContainer.getPlaybackType()===De.LIVE&&this.mediaControlContainer.isDvrEnabled()}},{key:"durationShown",get:function(){return this.isLiveStreamWithDvr&&!this.actualLiveTime}},{key:"useActualLiveTime",get:function(){return this.actualLiveTime&&this.isLiveStreamWithDvr}},{key:"bindEvents",value:function(){this.listenTo(this.mediaControl,ue.MEDIACONTROL_RENDERED,this.render),this.listenTo(this.mediaControl,ue.MEDIACONTROL_MOUSEMOVE_SEEKBAR,this.showTime),this.listenTo(this.mediaControl,ue.MEDIACONTROL_MOUSELEAVE_SEEKBAR,this.hideTime),this.listenTo(this.mediaControl,ue.MEDIACONTROL_CONTAINERCHANGED,this.onContainerChanged),this.mediaControlContainer&&(this.listenTo(this.mediaControlContainer,ue.CONTAINER_PLAYBACKDVRSTATECHANGED,this.update),this.listenTo(this.mediaControlContainer,ue.CONTAINER_TIMEUPDATE,this.updateDuration))}},{key:"onContainerChanged",value:function(){this.stopListening(),this.bindEvents()}},{key:"updateDuration",value:function(e){this.duration=e.total,this.firstFragDateTime=e.firstFragDateTime,this.update()}},{key:"showTime",value:function(e){this.hoveringOverSeekBar=!0,this.calculateHoverPosition(e),this.update()}},{key:"hideTime",value:function(){this.hoveringOverSeekBar=!1,this.update()}},{key:"calculateHoverPosition",value:function(e){var t=e.pageX-this.mediaControl.$seekBarContainer.offset().left;this.hoverPosition=Math.min(1,Math.max(t/this.mediaControl.$seekBarContainer.width(),0))}},{key:"getSeekTime",value:function(){var e,t,r,i;return this.useActualLiveTime?(this.firstFragDateTime?(i=new Date(this.firstFragDateTime),(r=new Date(this.firstFragDateTime)).setHours(0,0,0,0),t=(i.getTime()-r.getTime())/1e3+this.duration):(r=new Date((new Date).getTime()-this.actualLiveServerTimeDiff),t=((i=new Date(r))-r.setHours(0,0,0,0))/1e3),(e=t-this.duration+this.hoverPosition*this.duration)<0&&(e+=86400)):e=this.hoverPosition*this.duration,{seekTime:e,secondsSinceMidnight:t}}},{key:"update",value:function(){if(this.rendered)if(this.shouldBeVisible()){var e=this.getSeekTime(),t=Pt(e.seekTime,this.useActualLiveTime);if(t!==this.displayedSeekTime&&(this.$seekTimeEl.text(t),this.displayedSeekTime=t),this.durationShown){this.$durationEl.show();var r=Pt(this.actualLiveTime?e.secondsSinceMidnight:this.duration,this.actualLiveTime);r!==this.displayedDuration&&(this.$durationEl.text(r),this.displayedDuration=r)}else this.$durationEl.hide();this.$el.show();var i=this.mediaControl.$seekBarContainer.width(),n=this.$el.width(),a=this.hoverPosition*i;a-=n/2,a=Math.max(0,Math.min(a,i-n)),this.$el.css("left",a)}else this.$el.hide(),this.$el.css("left","-100%")}},{key:"shouldBeVisible",value:function(){return this.mediaControlContainer&&this.mediaControlContainer.settings.seekEnabled&&this.hoveringOverSeekBar&&null!==this.hoverPosition&&null!==this.duration}},{key:"render",value:function(){var e=Te.getStyleFor('.seek-time[data-seek-time] {\n position: absolute;\n white-space: nowrap;\n height: 20px;\n line-height: 20px;\n font-size: 0;\n left: -100%;\n bottom: 55px;\n background-color: rgba(2, 2, 2, 0.5);\n z-index: 9999;\n transition: opacity 0.1s ease; }\n .seek-time[data-seek-time].hidden[data-seek-time] {\n opacity: 0; }\n .seek-time[data-seek-time] [data-seek-time] {\n display: inline-block;\n color: white;\n font-size: 10px;\n padding-left: 7px;\n padding-right: 7px;\n vertical-align: top; }\n .seek-time[data-seek-time] [data-duration] {\n display: inline-block;\n color: rgba(255, 255, 255, 0.5);\n font-size: 10px;\n padding-right: 7px;\n vertical-align: top; }\n .seek-time[data-seek-time] [data-duration]:before {\n content: "|";\n margin-right: 7px; }\n',{baseUrl:this.options.baseUrl});this.rendered=!0,this.displayedDuration=null,this.displayedSeekTime=null,this.$el.html(this.template()),this.$el.append(e[0]),this.$el.hide(),this.mediaControl.$el.append(this.el),this.$seekTimeEl=this.$el.find("[data-seek-time]"),this.$durationEl=this.$el.find("[data-duration]"),this.$durationEl.hide(),this.update()}}])}(Ce),Nt={ClickToPause:dt,ClosedCaptions:ht,DVRControls:ft,EndVideo:pt,ErrorScreen:gt,Favicon:At,GoogleAnalytics:Et,MediaControl:Ot,Poster:wt,SeekTime:xt,SpinnerThreeBounce:function(e){function t(e){var r;return it(this,t),(r=et(this,t,[e])).template=Ee("<div data-bounce1></div><div data-bounce2></div><div data-bounce3></div>\n"),r.showTimeout=null,r.listenTo(r.container,ue.CONTAINER_STATE_BUFFERING,r.onBuffering),r.listenTo(r.container,ue.CONTAINER_STATE_BUFFERFULL,r.onBufferFull),r.listenTo(r.container,ue.CONTAINER_STOP,r.onStop),r.listenTo(r.container,ue.CONTAINER_ENDED,r.onStop),r.listenTo(r.container,ue.CONTAINER_ERROR,r.onStop),r.render(),r}return st(t,e),at(t,[{key:"name",get:function(){return"spinner"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"attributes",get:function(){return{"data-spinner":"",class:"spinner-three-bounce"}}},{key:"onBuffering",value:function(){this.show()}},{key:"onBufferFull",value:function(){this.hide()}},{key:"onStop",value:function(){this.hide()}},{key:"show",value:function(){var e=this;null===this.showTimeout&&(this.showTimeout=setTimeout((function(){return e.$el.show()}),300))}},{key:"hide",value:function(){null!==this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=null),this.$el.hide()}},{key:"render",value:function(){var e=Te.getStyleFor(".spinner-three-bounce[data-spinner] {\n position: absolute;\n margin: 0 auto;\n width: 70px;\n text-align: center;\n z-index: 999;\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n /* center vertically */\n top: 50%;\n transform: translateY(-50%); }\n .spinner-three-bounce[data-spinner] > div {\n width: 18px;\n height: 18px;\n background-color: #FFFFFF;\n border-radius: 100%;\n display: inline-block;\n animation: bouncedelay 1.4s infinite ease-in-out;\n /* Prevent first frame from flickering when animation starts */\n animation-fill-mode: both; }\n .spinner-three-bounce[data-spinner] [data-bounce1] {\n animation-delay: -0.32s; }\n .spinner-three-bounce[data-spinner] [data-bounce2] {\n animation-delay: -0.16s; }\n\n@keyframes bouncedelay {\n 0%, 80%, 100% {\n transform: scale(0); }\n 40% {\n transform: scale(1); } }\n",{baseUrl:this.options.baseUrl});return this.$el.html(this.template()),this.$el.append(e[0]),this.container.$el.append(this.$el),this.$el.hide(),this.container.buffering&&this.onBuffering(),this}}])}(Ke),Stats:function(e){function t(e){var r;return it(this,t),(r=et(this,t,[e])).setInitialAttrs(),r.reportInterval=r.options.reportInterval||5e3,r.state="IDLE",r}return st(t,e),at(t,[{key:"name",get:function(){return"stats"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"bindEvents",value:function(){this.listenTo(this.container.playback,ue.PLAYBACK_PLAY,this.onPlay),this.listenTo(this.container,ue.CONTAINER_STOP,this.onStop),this.listenTo(this.container,ue.CONTAINER_ENDED,this.onStop),this.listenTo(this.container,ue.CONTAINER_DESTROYED,this.onStop),this.listenTo(this.container,ue.CONTAINER_STATE_BUFFERING,this.onBuffering),this.listenTo(this.container,ue.CONTAINER_STATE_BUFFERFULL,this.onBufferFull),this.listenTo(this.container,ue.CONTAINER_STATS_ADD,this.onStatsAdd),this.listenTo(this.container,ue.CONTAINER_BITRATE,this.onStatsAdd),this.listenTo(this.container.playback,ue.PLAYBACK_STATS_ADD,this.onStatsAdd)}},{key:"setInitialAttrs",value:function(){this.firstPlay=!0,this.startupTime=0,this.rebufferingTime=0,this.watchingTime=0,this.rebuffers=0,this.externalMetrics={}}},{key:"onPlay",value:function(){this.state="PLAYING",this.watchingTimeInit=Date.now(),this.intervalId||(this.intervalId=setInterval(this.report.bind(this),this.reportInterval))}},{key:"onStop",value:function(){clearInterval(this.intervalId),this.report(),this.intervalId=void 0,this.state="STOPPED"}},{key:"onBuffering",value:function(){this.firstPlay?this.startupTimeInit=Date.now():this.rebufferingTimeInit=Date.now(),this.state="BUFFERING",this.rebuffers++}},{key:"onBufferFull",value:function(){this.firstPlay&&this.startupTimeInit?(this.firstPlay=!1,this.startupTime=Date.now()-this.startupTimeInit,this.watchingTimeInit=Date.now()):this.rebufferingTimeInit&&(this.rebufferingTime+=this.getRebufferingTime()),this.rebufferingTimeInit=void 0,this.state="PLAYING"}},{key:"getRebufferingTime",value:function(){return Date.now()-this.rebufferingTimeInit}},{key:"getWatchingTime",value:function(){return Date.now()-this.watchingTimeInit-this.rebufferingTime}},{key:"isRebuffering",value:function(){return!!this.rebufferingTimeInit}},{key:"onStatsAdd",value:function(e){D.extend(this.externalMetrics,e)}},{key:"getStats",value:function(){var e={startupTime:this.startupTime,rebuffers:this.rebuffers,rebufferingTime:this.isRebuffering()?this.rebufferingTime+this.getRebufferingTime():this.rebufferingTime,watchingTime:this.isRebuffering()?this.getWatchingTime()-this.getRebufferingTime():this.getWatchingTime()};return D.extend(e,this.externalMetrics),e}},{key:"report",value:function(){this.container.statsReport(this.getStats())}}])}(Ge),WaterMark:function(e){function t(e){var r;return it(this,t),(r=et(this,t,[e])).configure(),r}return st(t,e),at(t,[{key:"name",get:function(){return"watermark"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"template",get:function(){return Ee('<div class="clappr-watermark" data-watermark data-watermark-<%=position %>>\n<% if(typeof imageLink !== \'undefined\') { %>\n<a target="_blank" href="<%= imageLink %>">\n<% } %>\n<img src="<%= imageUrl %>">\n<% if(typeof imageLink !== \'undefined\') { %>\n</a>\n<% } %>\n</div>\n')}},{key:"bindEvents",value:function(){this.listenTo(this.container,ue.CONTAINER_PLAY,this.onPlay),this.listenTo(this.container,ue.CONTAINER_STOP,this.onStop),this.listenTo(this.container,ue.CONTAINER_OPTIONS_CHANGE,this.configure)}},{key:"configure",value:function(){this.position=this.options.position||"bottom-right",this.options.watermark?(this.imageUrl=this.options.watermark,this.imageLink=this.options.watermarkLink,this.render()):this.$el.remove()}},{key:"onPlay",value:function(){this.hidden||this.$el.show()}},{key:"onStop",value:function(){this.$el.hide()}},{key:"render",value:function(){this.$el.hide();var e=Te.getStyleFor(".clappr-watermark[data-watermark] {\n position: absolute;\n min-width: 70px;\n max-width: 200px;\n width: 12%;\n text-align: center;\n z-index: 10; }\n\n.clappr-watermark[data-watermark] a {\n outline: none;\n cursor: pointer; }\n\n.clappr-watermark[data-watermark] img {\n max-width: 100%; }\n\n.clappr-watermark[data-watermark-bottom-left] {\n bottom: 10px;\n left: 10px; }\n\n.clappr-watermark[data-watermark-bottom-right] {\n bottom: 10px;\n right: 42px; }\n\n.clappr-watermark[data-watermark-top-left] {\n top: 10px;\n left: 10px; }\n\n.clappr-watermark[data-watermark-top-right] {\n top: 10px;\n right: 37px; }\n",{baseUrl:this.options.baseUrl}),t={position:this.position,imageUrl:this.imageUrl,imageLink:this.imageLink};return this.$el.html(this.template(t)),this.$el.append(e[0]),this.container.$el.append(this.$el),this}}])}(Ke)},Mt=0,Ft=Object.values(Nt);Mt<Ft.length;Mt++){var Bt=Ft[Mt];Fe.registerPlugin(Bt)}var Ut=Nt.ClickToPause,Gt=Nt.ClosedCaptions,Vt=Nt.DVRControls,Kt=Nt.EndVideo,jt=Nt.ErrorScreen,Ht=Nt.Favicon,Yt=Nt.GoogleAnalytics,Wt=Nt.MediaControl,$t=Nt.Poster,zt=Nt.SeekTime,qt=Nt.SpinnerThreeBounce,Xt=Nt.Stats,Zt=Nt.WaterMark,Qt=t(t({},Je),{},{ClickToPause:Ut,ClosedCaptions:Gt,DVRControls:Vt,EndVideo:Kt,ErrorScreen:jt,Favicon:Ht,GoogleAnalytics:Yt,MediaControl:Wt,Poster:$t,SeekTime:zt,SpinnerThreeBounce:qt,Stats:Xt,WaterMark:Zt,Vendor:bt,Plugins:Nt,version:"0.6.0"});function Jt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function er(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Jt(Object(r),!0).forEach((function(t){rr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function tr(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,cr(i.key),i)}}function rr(e,t,r){return(t=cr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ir(e){return ir=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ir(e)}function nr(e,t){return nr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},nr(e,t)}function ar(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function sr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=ir(e);if(t){var n=ir(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return ar(this,r)}}function or(){return or="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ir(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},or.apply(this,arguments)}function lr(e){return function(e){if(Array.isArray(e))return ur(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ur(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ur(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ur(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function cr(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function dr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hr,fr,pr={exports:{}};hr=pr,"undefined"!=typeof window&&(fr=()=>(()=>{var e={"./src/config.ts":
1
+ var Clappr=function(){"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function t(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?e(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t,r){return t=p(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,n()?Reflect.construct(t,r||[],p(e).constructor):t.apply(e,r))}function n(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(n=function(){return!!e})()}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){h(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,o(i.key),i)}}function d(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}function v(){return v="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=p(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},v.apply(this,arguments)}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,n,a,s,o=[],l=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=a.call(r)).done)&&(o.push(i.value),o.length!==t);l=!0);}catch(e){u=!0,n=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw n}}return o}}(e,t)||A(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||A(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(e,t){if(e){if("string"==typeof e)return E(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(e,t):void 0}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function T(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=A(e))||t){r&&(e=r);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw a}}}}function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var k=function(){var e,t,r,i,n,a,s=[],o=s.concat,l=s.filter,u=s.slice,c=window.document,d={},h={},f={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},p=/^\s*<(\w+|!)[^>]*>/,g=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,m=/^(?:body|html)$/i,y=/([A-Z])/g,A=["val","css","html","text","data","width","height","offset"],E=c.createElement("table"),T=c.createElement("tr"),b={tr:c.createElement("tbody"),tbody:E,thead:E,tfoot:E,td:T,th:T,"*":c.createElement("div")},k=/complete|loaded|interactive/,S=/^[\w-]*$/,_={},C=_.toString,L={},D=c.createElement("div"),I={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},R=Array.isArray||function(e){return e instanceof Array};function O(e){return null==e?String(e):_[C.call(e)]||"object"}function w(e){return"function"==O(e)}function P(e){return null!=e&&e==e.window}function x(e){return null!=e&&e.nodeType==e.DOCUMENT_NODE}function N(e){return"object"==O(e)}function M(e){return N(e)&&!P(e)&&Object.getPrototypeOf(e)==Object.prototype}function F(e){var t=!!e&&"length"in e&&e.length,i=r.type(e);return"function"!=i&&!P(e)&&("array"==i||0===t||"number"==typeof t&&t>0&&t-1 in e)}function B(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function U(e){return e in h?h[e]:h[e]=new RegExp("(^|\\s)"+e+"(\\s|$)")}function G(e,t){return"number"!=typeof t||f[B(e)]?t:t+"px"}function V(e){return"children"in e?u.call(e.children):r.map(e.childNodes,(function(e){if(1==e.nodeType)return e}))}function K(e,t){var r,i=e?e.length:0;for(r=0;r<i;r++)this[r]=e[r];this.length=i,this.selector=t||""}function j(r,i,n){for(t in i)n&&(M(i[t])||R(i[t]))?(M(i[t])&&!M(r[t])&&(r[t]={}),R(i[t])&&!R(r[t])&&(r[t]=[]),j(r[t],i[t],n)):i[t]!==e&&(r[t]=i[t])}function H(e,t){return null==t?r(e):r(e).filter(t)}function Y(e,t,r,i){return w(t)?t.call(e,r,i):t}function W(e,t,r){null==r?e.removeAttribute(t):e.setAttribute(t,r)}function $(t,r){var i=t.className||"",n=i&&i.baseVal!==e;if(r===e)return n?i.baseVal:i;n?i.baseVal=r:t.className=r}function z(e){try{return e?"true"==e||"false"!=e&&("null"==e?null:+e+""==e?+e:/^[\[\{]/.test(e)?r.parseJSON(e):e):e}catch(t){return e}}function q(e,t){t(e);for(var r=0,i=e.childNodes.length;r<i;r++)q(e.childNodes[r],t)}return L.matches=function(e,t){if(!t||!e||1!==e.nodeType)return!1;var r=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.matchesSelector;if(r)return r.call(e,t);var i,n=e.parentNode,a=!n;return a&&(n=D).appendChild(e),i=~L.qsa(n,t).indexOf(e),a&&D.removeChild(e),i},n=function(e){return e.replace(/-+(.)?/g,(function(e,t){return t?t.toUpperCase():""}))},a=function(e){return l.call(e,(function(t,r){return e.indexOf(t)==r}))},L.fragment=function(t,i,n){var a,s,o;return g.test(t)&&(a=r(c.createElement(RegExp.$1))),a||(t.replace&&(t=t.replace(v,"<$1></$2>")),i===e&&(i=p.test(t)&&RegExp.$1),i in b||(i="*"),(o=b[i]).innerHTML=""+t,a=r.each(u.call(o.childNodes),(function(){o.removeChild(this)}))),M(n)&&(s=r(a),r.each(n,(function(e,t){A.indexOf(e)>-1?s[e](t):s.attr(e,t)}))),a},L.Z=function(e,t){return new K(e,t)},L.isZ=function(e){return e instanceof L.Z},L.init=function(t,i){var n,a;if(!t)return L.Z();if("string"==typeof t)if("<"==(t=t.trim())[0]&&p.test(t))n=L.fragment(t,RegExp.$1,i),t=null;else{if(i!==e)return r(i).find(t);n=L.qsa(c,t)}else{if(w(t))return r(c).ready(t);if(L.isZ(t))return t;if(R(t))a=t,n=l.call(a,(function(e){return null!=e}));else if(N(t))n=[t],t=null;else if(p.test(t))n=L.fragment(t.trim(),RegExp.$1,i),t=null;else{if(i!==e)return r(i).find(t);n=L.qsa(c,t)}}return L.Z(n,t)},(r=function(e,t){return L.init(e,t)}).extend=function(e){var t,r=u.call(arguments,1);return"boolean"==typeof e&&(t=e,e=r.shift()),r.forEach((function(r){j(e,r,t)})),e},L.qsa=function(e,t){var r,i="#"==t[0],n=!i&&"."==t[0],a=i||n?t.slice(1):t,s=S.test(a);return e.getElementById&&s&&i?(r=e.getElementById(a))?[r]:[]:1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType?[]:u.call(s&&!i&&e.getElementsByClassName?n?e.getElementsByClassName(a):e.getElementsByTagName(t):e.querySelectorAll(t))},r.contains=c.documentElement.contains?function(e,t){return e!==t&&e.contains(t)}:function(e,t){for(;t&&(t=t.parentNode);)if(t===e)return!0;return!1},r.type=O,r.isFunction=w,r.isWindow=P,r.isArray=R,r.isPlainObject=M,r.isEmptyObject=function(e){var t;for(t in e)return!1;return!0},r.isNumeric=function(e){var t=Number(e),r=typeof e;return null!=e&&"boolean"!=r&&("string"!=r||e.length)&&!isNaN(t)&&isFinite(t)||!1},r.inArray=function(e,t,r){return s.indexOf.call(t,e,r)},r.camelCase=n,r.trim=function(e){return null==e?"":String.prototype.trim.call(e)},r.uuid=0,r.support={},r.expr={},r.noop=function(){},r.map=function(e,t){var i,n,a,s,o=[];if(F(e))for(n=0;n<e.length;n++)null!=(i=t(e[n],n))&&o.push(i);else for(a in e)null!=(i=t(e[a],a))&&o.push(i);return(s=o).length>0?r.fn.concat.apply([],s):s},r.each=function(e,t){var r,i;if(F(e)){for(r=0;r<e.length;r++)if(!1===t.call(e[r],r,e[r]))return e}else for(i in e)if(!1===t.call(e[i],i,e[i]))return e;return e},r.grep=function(e,t){return l.call(e,t)},window.JSON&&(r.parseJSON=JSON.parse),r.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),(function(e,t){_["[object "+t+"]"]=t.toLowerCase()})),r.fn={constructor:L.Z,length:0,forEach:s.forEach,reduce:s.reduce,push:s.push,sort:s.sort,splice:s.splice,indexOf:s.indexOf,concat:function(){var e,t,r=[];for(e=0;e<arguments.length;e++)t=arguments[e],r[e]=L.isZ(t)?t.toArray():t;return o.apply(L.isZ(this)?this.toArray():this,r)},map:function(e){return r(r.map(this,(function(t,r){return e.call(t,r,t)})))},slice:function(){return r(u.apply(this,arguments))},ready:function(e){return k.test(c.readyState)&&c.body?e(r):c.addEventListener("DOMContentLoaded",(function(){e(r)}),!1),this},get:function(t){return t===e?u.call(this):this[t>=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(e){return s.every.call(this,(function(t,r){return!1!==e.call(t,r,t)})),this},filter:function(e){return w(e)?this.not(this.not(e)):r(l.call(this,(function(t){return L.matches(t,e)})))},add:function(e,t){return r(a(this.concat(r(e,t))))},is:function(e){return this.length>0&&L.matches(this[0],e)},not:function(t){var i=[];if(w(t)&&t.call!==e)this.each((function(e){t.call(this,e)||i.push(this)}));else{var n="string"==typeof t?this.filter(t):F(t)&&w(t.item)?u.call(t):r(t);this.forEach((function(e){n.indexOf(e)<0&&i.push(e)}))}return r(i)},has:function(e){return this.filter((function(){return N(e)?r.contains(this,e):r(this).find(e).size()}))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){var e=this[0];return e&&!N(e)?e:r(e)},last:function(){var e=this[this.length-1];return e&&!N(e)?e:r(e)},find:function(e){var t=this;return e?"object"==typeof e?r(e).filter((function(){var e=this;return s.some.call(t,(function(t){return r.contains(t,e)}))})):1==this.length?r(L.qsa(this[0],e)):this.map((function(){return L.qsa(this,e)})):r()},closest:function(e,t){var i=[],n="object"==typeof e&&r(e);return this.each((function(r,a){for(;a&&!(n?n.indexOf(a)>=0:L.matches(a,e));)a=a!==t&&!x(a)&&a.parentNode;a&&i.indexOf(a)<0&&i.push(a)})),r(i)},parents:function(e){for(var t=[],i=this;i.length>0;)i=r.map(i,(function(e){if((e=e.parentNode)&&!x(e)&&t.indexOf(e)<0)return t.push(e),e}));return H(t,e)},parent:function(e){return H(a(this.pluck("parentNode")),e)},children:function(e){return H(this.map((function(){return V(this)})),e)},contents:function(){return this.map((function(){return this.contentDocument||u.call(this.childNodes)}))},siblings:function(e){return H(this.map((function(e,t){return l.call(V(t.parentNode),(function(e){return e!==t}))})),e)},empty:function(){return this.each((function(){this.innerHTML=""}))},pluck:function(e){return r.map(this,(function(t){return t[e]}))},show:function(){return this.each((function(){var e,t,r;"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=(e=this.nodeName,d[e]||(t=c.createElement(e),c.body.appendChild(t),r=getComputedStyle(t,"").getPropertyValue("display"),t.parentNode.removeChild(t),"none"==r&&(r="block"),d[e]=r),d[e]))}))},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){var t=w(e);if(this[0]&&!t)var i=r(e).get(0),n=i.parentNode||this.length>1;return this.each((function(a){r(this).wrapAll(t?e.call(this,a):n?i.cloneNode(!0):i)}))},wrapAll:function(e){if(this[0]){var t;for(r(this[0]).before(e=r(e));(t=e.children()).length;)e=t.first();r(e).append(this)}return this},wrapInner:function(e){var t=w(e);return this.each((function(i){var n=r(this),a=n.contents(),s=t?e.call(this,i):e;a.length?a.wrapAll(s):n.append(s)}))},unwrap:function(){return this.parent().each((function(){r(this).replaceWith(r(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 i=r(this);(t===e?"none"==i.css("display"):t)?i.show():i.hide()}))},prev:function(e){return r(this.pluck("previousElementSibling")).filter(e||"*")},next:function(e){return r(this.pluck("nextElementSibling")).filter(e||"*")},html:function(e){return 0 in arguments?this.each((function(t){var i=this.innerHTML;r(this).empty().append(Y(this,e,t,i))})):0 in this?this[0].innerHTML:null},text:function(e){return 0 in arguments?this.each((function(t){var r=Y(this,e,t,this.textContent);this.textContent=null==r?"":""+r})):0 in this?this.pluck("textContent").join(""):null},attr:function(r,i){var n;return"string"!=typeof r||1 in arguments?this.each((function(e){if(1===this.nodeType)if(N(r))for(t in r)W(this,t,r[t]);else W(this,r,Y(this,i,e,this.getAttribute(r)))})):0 in this&&1==this[0].nodeType&&null!=(n=this[0].getAttribute(r))?n:e},removeAttr:function(e){return this.each((function(){1===this.nodeType&&e.split(" ").forEach((function(e){W(this,e)}),this)}))},prop:function(e,t){return e=I[e]||e,1 in arguments?this.each((function(r){this[e]=Y(this,t,r,this[e])})):this[0]&&this[0][e]},removeProp:function(e){return e=I[e]||e,this.each((function(){delete this[e]}))},data:function(t,r){var i="data-"+t.replace(y,"-$1").toLowerCase(),n=1 in arguments?this.attr(i,r):this.attr(i);return null!==n?z(n):e},val:function(e){return 0 in arguments?(null==e&&(e=""),this.each((function(t){this.value=Y(this,e,t,this.value)}))):this[0]&&(this[0].multiple?r(this[0]).find("option").filter((function(){return this.selected})).pluck("value"):this[0].value)},offset:function(e){if(e)return this.each((function(t){var i=r(this),n=Y(this,e,t,i.offset()),a=i.offsetParent().offset(),s={top:n.top-a.top,left:n.left-a.left};"static"==i.css("position")&&(s.position="relative"),i.css(s)}));if(!this.length)return null;if(c.documentElement!==this[0]&&!r.contains(c.documentElement,this[0]))return{top:0,left:0};var t=this[0].getBoundingClientRect();return{left:t.left+window.pageXOffset,top:t.top+window.pageYOffset,width:Math.round(t.width),height:Math.round(t.height)}},css:function(e,i){if(arguments.length<2){var a=this[0];if("string"==typeof e){if(!a)return;return a.style[n(e)]||getComputedStyle(a,"").getPropertyValue(e)}if(R(e)){if(!a)return;var s={},o=getComputedStyle(a,"");return r.each(e,(function(e,t){s[t]=a.style[n(t)]||o.getPropertyValue(t)})),s}}var l="";if("string"==O(e))i||0===i?l=B(e)+":"+G(e,i):this.each((function(){this.style.removeProperty(B(e))}));else for(t in e)e[t]||0===e[t]?l+=B(t)+":"+G(t,e[t])+";":this.each((function(){this.style.removeProperty(B(t))}));return this.each((function(){this.style.cssText+=";"+l}))},index:function(e){return e?this.indexOf(r(e)[0]):this.parent().children().indexOf(this[0])},hasClass:function(e){return!!e&&s.some.call(this,(function(e){return this.test($(e))}),U(e))},addClass:function(e){return e?this.each((function(t){if("className"in this){i=[];var n=$(this);Y(this,e,t,n).split(/\s+/g).forEach((function(e){r(this).hasClass(e)||i.push(e)}),this),i.length&&$(this,n+(n?" ":"")+i.join(" "))}})):this},removeClass:function(t){return this.each((function(r){if("className"in this){if(t===e)return $(this,"");i=$(this),Y(this,t,r,i).split(/\s+/g).forEach((function(e){i=i.replace(U(e)," ")})),$(this,i.trim())}}))},toggleClass:function(t,i){return t?this.each((function(n){var a=r(this);Y(this,t,n,$(this)).split(/\s+/g).forEach((function(t){(i===e?!a.hasClass(t):i)?a.addClass(t):a.removeClass(t)}))})):this},scrollTop:function(t){if(this.length){var r="scrollTop"in this[0];return t===e?r?this[0].scrollTop:this[0].pageYOffset:this.each(r?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var r="scrollLeft"in this[0];return t===e?r?this[0].scrollLeft:this[0].pageXOffset:this.each(r?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var e=this[0],t=this.offsetParent(),i=this.offset(),n=m.test(t[0].nodeName)?{top:0,left:0}:t.offset();return i.top-=parseFloat(r(e).css("margin-top"))||0,i.left-=parseFloat(r(e).css("margin-left"))||0,n.top+=parseFloat(r(t[0]).css("border-top-width"))||0,n.left+=parseFloat(r(t[0]).css("border-left-width"))||0,{top:i.top-n.top,left:i.left-n.left}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent||c.body;e&&!m.test(e.nodeName)&&"static"==r(e).css("position");)e=e.offsetParent;return e}))}},r.fn.detach=r.fn.remove,["width","height"].forEach((function(t){var i=t.replace(/./,(function(e){return e[0].toUpperCase()}));r.fn[t]=function(n){var a,s=this[0];return n===e?P(s)?s["inner"+i]:x(s)?s.documentElement["scroll"+i]:(a=this.offset())&&a[t]:this.each((function(e){(s=r(this)).css(t,Y(this,n,e,s[t]()))}))}})),["after","prepend","before","append"].forEach((function(t,i){var n=i%2;r.fn[t]=function(){var t,a,s=r.map(arguments,(function(i){var n=[];return"array"==(t=O(i))?(i.forEach((function(t){return t.nodeType!==e?n.push(t):r.zepto.isZ(t)?n=n.concat(t.get()):void(n=n.concat(L.fragment(t)))})),n):"object"==t||null==i?i:L.fragment(i)})),o=this.length>1;return s.length<1?this:this.each((function(e,t){a=n?t:t.parentNode,t=0==i?t.nextSibling:1==i?t.firstChild:2==i?t:null;var l=r.contains(c.documentElement,a);s.forEach((function(e){if(o)e=e.cloneNode(!0);else if(!a)return r(e).remove();a.insertBefore(e,t),l&&q(e,(function(e){if(!(null==e.nodeName||"SCRIPT"!==e.nodeName.toUpperCase()||e.type&&"text/javascript"!==e.type||e.src)){var t=e.ownerDocument?e.ownerDocument.defaultView:window;t.eval.call(t,e.innerHTML)}}))}))}))},r.fn[n?t+"To":"insert"+(i?"Before":"After")]=function(e){return r(e)[t](this),this}})),L.Z.prototype=K.prototype=r.fn,L.uniq=a,L.deserializeValue=z,r.zepto=L,r}();window.Zepto=k,void 0===window.$&&(window.$=k),function(e){var t,r,i=+new Date,n=window.document,a=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,s=/^(?:text|application)\/javascript/i,o=/^(?:text|application)\/xml/i,l="application/json",u="text/html",c=/^\s*$/,d=n.createElement("a");function h(t,r,i,a){if(t.global)return function(t,r,i){var n=e.Event(r);return e(t).trigger(n,i),!n.isDefaultPrevented()}(r||n,i,a)}function f(e,t){var r=t.context;if(!1===t.beforeSend.call(r,e,t)||!1===h(t,r,"ajaxBeforeSend",[e,t]))return!1;h(t,r,"ajaxSend",[e,t])}function p(e,t,r,i){var n=r.context,a="success";r.success.call(n,e,a,t),i&&i.resolveWith(n,[e,a,t]),h(r,n,"ajaxSuccess",[t,r,e]),v(a,t,r)}function g(e,t,r,i,n){var a=i.context;i.error.call(a,r,t,e),n&&n.rejectWith(a,[r,t,e]),h(i,a,"ajaxError",[r,i,e||t]),v(t,r,i)}function v(t,r,i){var n=i.context;i.complete.call(n,r,t),h(i,n,"ajaxComplete",[r,i]),function(t){t.global&&! --e.active&&h(t,null,"ajaxStop")}(i)}function m(){}function y(e,t){return""==t?e:(e+"&"+t).replace(/[&?]{1,2}/,"?")}function A(t,r,i,n){return e.isFunction(r)&&(n=i,i=r,r=void 0),e.isFunction(i)||(n=i,i=void 0),{url:t,data:r,success:i,dataType:n}}d.href=window.location.href,e.active=0,e.ajaxJSONP=function(t,r){if(!("type"in t))return e.ajax(t);var a,s,o=t.jsonpCallback,l=(e.isFunction(o)?o():o)||"Zepto"+i++,u=n.createElement("script"),c=window[l],d=function(t){e(u).triggerHandler("error",t||"abort")},h={abort:d};return r&&r.promise(h),e(u).on("load error",(function(i,n){clearTimeout(s),e(u).off().remove(),"error"!=i.type&&a?p(a[0],h,t,r):g(null,n||"error",h,t,r),window[l]=c,a&&e.isFunction(c)&&c(a[0]),c=a=void 0})),!1===f(h,t)?(d("abort"),h):(window[l]=function(){a=arguments},u.src=t.url.replace(/\?(.+)=\?/,"?$1="+l),n.head.appendChild(u),t.timeout>0&&(s=setTimeout((function(){d("timeout")}),t.timeout)),h)},e.ajaxSettings={type:"GET",beforeSend:m,success:m,error:m,complete:m,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:l,xml:"application/xml, text/xml",html:u,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:m},e.ajax=function(i){var a,v,A=e.extend({},i||{}),E=e.Deferred&&e.Deferred();for(t in e.ajaxSettings)void 0===A[t]&&(A[t]=e.ajaxSettings[t]);!function(t){t.global&&0==e.active++&&h(t,null,"ajaxStart")}(A),A.crossDomain||((a=n.createElement("a")).href=A.url,a.href=a.href,A.crossDomain=d.protocol+"//"+d.host!=a.protocol+"//"+a.host),A.url||(A.url=window.location.toString()),(v=A.url.indexOf("#"))>-1&&(A.url=A.url.slice(0,v)),function(t){t.processData&&t.data&&"string"!=e.type(t.data)&&(t.data=e.param(t.data,t.traditional)),!t.data||t.type&&"GET"!=t.type.toUpperCase()&&"jsonp"!=t.dataType||(t.url=y(t.url,t.data),t.data=void 0)}(A);var T=A.dataType,b=/\?.+=\?/.test(A.url);if(b&&(T="jsonp"),!1!==A.cache&&(i&&!0===i.cache||"script"!=T&&"jsonp"!=T)||(A.url=y(A.url,"_="+Date.now())),"jsonp"==T)return b||(A.url=y(A.url,A.jsonp?A.jsonp+"=?":!1===A.jsonp?"":"callback=?")),e.ajaxJSONP(A,E);var k,S=A.accepts[T],_={},C=function(e,t){_[e.toLowerCase()]=[e,t]},L=/^([\w-]+:)\/\//.test(A.url)?RegExp.$1:window.location.protocol,D=A.xhr(),I=D.setRequestHeader;if(E&&E.promise(D),A.crossDomain||C("X-Requested-With","XMLHttpRequest"),C("Accept",S||"*/*"),(S=A.mimeType||S)&&(S.indexOf(",")>-1&&(S=S.split(",",2)[0]),D.overrideMimeType&&D.overrideMimeType(S)),(A.contentType||!1!==A.contentType&&A.data&&"GET"!=A.type.toUpperCase())&&C("Content-Type",A.contentType||"application/x-www-form-urlencoded"),A.headers)for(r in A.headers)C(r,A.headers[r]);if(D.setRequestHeader=C,D.onreadystatechange=function(){if(4==D.readyState){D.onreadystatechange=m,clearTimeout(k);var t,r=!1;if(D.status>=200&&D.status<300||304==D.status||0==D.status&&"file:"==L){if(T=T||function(e){return e&&(e=e.split(";",2)[0]),e&&(e==u?"html":e==l?"json":s.test(e)?"script":o.test(e)&&"xml")||"text"}(A.mimeType||D.getResponseHeader("content-type")),"arraybuffer"==D.responseType||"blob"==D.responseType)t=D.response;else{t=D.responseText;try{t=function(e,t,r){if(r.dataFilter==m)return e;var i=r.context;return r.dataFilter.call(i,e,t)}(t,T,A),"script"==T?(0,eval)(t):"xml"==T?t=D.responseXML:"json"==T&&(t=c.test(t)?null:e.parseJSON(t))}catch(e){r=e}if(r)return g(r,"parsererror",D,A,E)}p(t,D,A,E)}else g(D.statusText||null,D.status?"error":"abort",D,A,E)}},!1===f(D,A))return D.abort(),g(null,"abort",D,A,E),D;var R=!("async"in A)||A.async;if(D.open(A.type,A.url,R,A.username,A.password),A.xhrFields)for(r in A.xhrFields)D[r]=A.xhrFields[r];for(r in _)I.apply(D,_[r]);return A.timeout>0&&(k=setTimeout((function(){D.onreadystatechange=m,D.abort(),g(null,"timeout",D,A,E)}),A.timeout)),D.send(A.data?A.data:null),D},e.get=function(){return e.ajax(A.apply(null,arguments))},e.post=function(){var t=A.apply(null,arguments);return t.type="POST",e.ajax(t)},e.getJSON=function(){var t=A.apply(null,arguments);return t.dataType="json",e.ajax(t)},e.fn.load=function(t,r,i){if(!this.length)return this;var n,s=this,o=t.split(/\s/),l=A(t,r,i),u=l.success;return o.length>1&&(l.url=o[0],n=o[1]),l.success=function(t){s.html(n?e("<div>").html(t.replace(a,"")).find(n):t),u&&u.apply(s,arguments)},e.ajax(l),this};var E=encodeURIComponent;function T(t,r,i,n){var a,s=e.isArray(r),o=e.isPlainObject(r);e.each(r,(function(r,l){a=e.type(l),n&&(r=i?n:n+"["+(o||"object"==a||"array"==a?r:"")+"]"),!n&&s?t.add(l.name,l.value):"array"==a||!i&&"object"==a?T(t,l,i,r):t.add(r,l)}))}e.param=function(t,r){var i=[];return i.add=function(t,r){e.isFunction(r)&&(r=r()),null==r&&(r=""),this.push(E(t)+"="+E(r))},T(i,t,r),i.join("&").replace(/%20/g,"+")}}(k),function(e){e.Callbacks=function(t){t=e.extend({},t);var r,i,n,a,s,o,l=[],u=!t.once&&[],c=function(e){for(r=t.memory&&e,i=!0,o=a||0,a=0,s=l.length,n=!0;l&&o<s;++o)if(!1===l[o].apply(e[0],e[1])&&t.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l.length=0:d.disable())},d={add:function(){if(l){var i=l.length,o=function(r){e.each(r,(function(e,r){"function"==typeof r?t.unique&&d.has(r)||l.push(r):r&&r.length&&"string"!=typeof r&&o(r)}))};o(arguments),n?s=l.length:r&&(a=i,c(r))}return this},remove:function(){return l&&e.each(arguments,(function(t,r){for(var i;(i=e.inArray(r,l,i))>-1;)l.splice(i,1),n&&(i<=s&&--s,i<=o&&--o)})),this},has:function(t){return!(!l||!(t?e.inArray(t,l)>-1:l.length))},empty:function(){return s=l.length=0,this},disable:function(){return l=u=r=void 0,this},disabled:function(){return!l},lock:function(){return u=void 0,r||d.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=[e,(t=t||[]).slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return d.fireWith(this,arguments)},fired:function(){return!!i}};return d}}(k),function(e){var t=Array.prototype.slice;function r(t){var i=[["resolve","done",e.Callbacks({once:1,memory:1}),"resolved"],["reject","fail",e.Callbacks({once:1,memory:1}),"rejected"],["notify","progress",e.Callbacks({memory:1})]],n="pending",a={state:function(){return n},always:function(){return s.done(arguments).fail(arguments),this},then:function(){var t=arguments;return r((function(r){e.each(i,(function(i,n){var o=e.isFunction(t[i])&&t[i];s[n[1]]((function(){var t=o&&o.apply(this,arguments);if(t&&e.isFunction(t.promise))t.promise().done(r.resolve).fail(r.reject).progress(r.notify);else{var i=this===a?r.promise():this,s=o?[t]:arguments;r[n[0]+"With"](i,s)}}))})),t=null})).promise()},promise:function(t){return null!=t?e.extend(t,a):a}},s={};return e.each(i,(function(e,t){var r=t[2],o=t[3];a[t[1]]=r.add,o&&r.add((function(){n=o}),i[1^e][2].disable,i[2][2].lock),s[t[0]]=function(){return s[t[0]+"With"](this===s?a:this,arguments),this},s[t[0]+"With"]=r.fireWith})),a.promise(s),t&&t.call(s,s),s}e.when=function(i){var n,a,s,o=t.call(arguments),l=o.length,u=0,c=1!==l||i&&e.isFunction(i.promise)?l:0,d=1===c?i:r(),h=function(e,r,i){return function(a){r[e]=this,i[e]=arguments.length>1?t.call(arguments):a,i===n?d.notifyWith(r,i):--c||d.resolveWith(r,i)}};if(l>1)for(n=new Array(l),a=new Array(l),s=new Array(l);u<l;++u)o[u]&&e.isFunction(o[u].promise)?o[u].promise().done(h(u,s,o)).fail(d.reject).progress(h(u,a,n)):--c;return c||d.resolveWith(s,o),d.promise()},e.Deferred=r}(k),function(e){var t,r=1,i=Array.prototype.slice,n=e.isFunction,a=function(e){return"string"==typeof e},s={},o={},l="onfocusin"in window,u={focus:"focusin",blur:"focusout"},c={mouseenter:"mouseover",mouseleave:"mouseout"};function d(e){return e._zid||(e._zid=r++)}function h(e,t,r,i){if((t=f(t)).ns)var n=(a=t.ns,new RegExp("(?:^| )"+a.replace(" "," .* ?")+"(?: |$)"));var a;return(s[d(e)]||[]).filter((function(e){return e&&(!t.e||e.e==t.e)&&(!t.ns||n.test(e.ns))&&(!r||d(e.fn)===d(r))&&(!i||e.sel==i)}))}function f(e){var t=(""+e).split(".");return{e:t[0],ns:t.slice(1).sort().join(" ")}}function p(e,t){return e.del&&!l&&e.e in u||!!t}function g(e){return c[e]||l&&u[e]||e}function v(r,i,n,a,o,l,u){var h=d(r),v=s[h]||(s[h]=[]);i.split(/\s/).forEach((function(i){if("ready"==i)return e(document).ready(n);var s=f(i);s.fn=n,s.sel=o,s.e in c&&(n=function(t){var r=t.relatedTarget;if(!r||r!==this&&!e.contains(this,r))return s.fn.apply(this,arguments)}),s.del=l;var d=l||n;s.proxy=function(e){if(!(e=b(e)).isImmediatePropagationStopped()){e.data=a;var i=d.apply(r,e._args==t?[e]:[e].concat(e._args));return!1===i&&(e.preventDefault(),e.stopPropagation()),i}},s.i=v.length,v.push(s),"addEventListener"in r&&r.addEventListener(g(s.e),s.proxy,p(s,u))}))}function m(e,t,r,i,n){var a=d(e);(t||"").split(/\s/).forEach((function(t){h(e,t,r,i).forEach((function(t){delete s[a][t.i],"removeEventListener"in e&&e.removeEventListener(g(t.e),t.proxy,p(t,n))}))}))}o.click=o.mousedown=o.mouseup=o.mousemove="MouseEvents",e.event={add:v,remove:m},e.proxy=function(t,r){var s=2 in arguments&&i.call(arguments,2);if(n(t)){var o=function(){return t.apply(r,s?s.concat(i.call(arguments)):arguments)};return o._zid=d(t),o}if(a(r))return s?(s.unshift(t[r],t),e.proxy.apply(null,s)):e.proxy(t[r],t);throw new TypeError("expected function")},e.fn.bind=function(e,t,r){return this.on(e,t,r)},e.fn.unbind=function(e,t){return this.off(e,t)},e.fn.one=function(e,t,r,i){return this.on(e,t,r,i,1)};var y=function(){return!0},A=function(){return!1},E=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,T={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};function b(r,i){return!i&&r.isDefaultPrevented||(i||(i=r),e.each(T,(function(e,t){var n=i[e];r[e]=function(){return this[t]=y,n&&n.apply(i,arguments)},r[t]=A})),r.timeStamp||(r.timeStamp=Date.now()),(i.defaultPrevented!==t?i.defaultPrevented:"returnValue"in i?!1===i.returnValue:i.getPreventDefault&&i.getPreventDefault())&&(r.isDefaultPrevented=y)),r}function k(e){var r,i={originalEvent:e};for(r in e)E.test(r)||e[r]===t||(i[r]=e[r]);return b(i,e)}e.fn.delegate=function(e,t,r){return this.on(t,e,r)},e.fn.undelegate=function(e,t,r){return this.off(t,e,r)},e.fn.live=function(t,r){return e(document.body).delegate(this.selector,t,r),this},e.fn.die=function(t,r){return e(document.body).undelegate(this.selector,t,r),this},e.fn.on=function(r,s,o,l,u){var c,d,h=this;return r&&!a(r)?(e.each(r,(function(e,t){h.on(e,s,o,t,u)})),h):(a(s)||n(l)||!1===l||(l=o,o=s,s=t),l!==t&&!1!==o||(l=o,o=t),!1===l&&(l=A),h.each((function(t,n){u&&(c=function(e){return m(n,e.type,l),l.apply(this,arguments)}),s&&(d=function(t){var r,a=e(t.target).closest(s,n).get(0);if(a&&a!==n)return r=e.extend(k(t),{currentTarget:a,liveFired:n}),(c||l).apply(a,[r].concat(i.call(arguments,1)))}),v(n,r,l,o,s,d||c)})))},e.fn.off=function(r,i,s){var o=this;return r&&!a(r)?(e.each(r,(function(e,t){o.off(e,i,t)})),o):(a(i)||n(s)||!1===s||(s=i,i=t),!1===s&&(s=A),o.each((function(){m(this,r,s,i)})))},e.fn.trigger=function(t,r){return(t=a(t)||e.isPlainObject(t)?e.Event(t):b(t))._args=r,this.each((function(){t.type in u&&"function"==typeof this[t.type]?this[t.type]():"dispatchEvent"in this?this.dispatchEvent(t):e(this).triggerHandler(t,r)}))},e.fn.triggerHandler=function(t,r){var i,n;return this.each((function(s,o){(i=k(a(t)?e.Event(t):t))._args=r,i.target=o,e.each(h(o,t.type||t),(function(e,t){if(n=t.proxy(i),i.isImmediatePropagationStopped())return!1}))})),n},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach((function(t){e.fn[t]=function(e){return 0 in arguments?this.bind(t,e):this.trigger(t)}})),e.Event=function(e,t){a(e)||(e=(t=e).type);var r=document.createEvent(o[e]||"Events"),i=!0;if(t)for(var n in t)"bubbles"==n?i=!!t[n]:r[n]=t[n];return r.initEvent(e,i,!0),b(r)}}(k),function(){try{getComputedStyle(void 0)}catch(t){var e=getComputedStyle;window.getComputedStyle=function(t,r){try{return e(t,r)}catch(e){return null}}}}(),function(e){var t=e.zepto,r=t.qsa,i=t.matches;function n(t){return!(!(t=e(t)).width()&&!t.height())&&"none"!==t.css("display")}var a=e.expr[":"]={visible:function(){if(n(this))return this},hidden:function(){if(!n(this))return this},selected:function(){if(this.selected)return this},checked:function(){if(this.checked)return this},parent:function(){return this.parentNode},first:function(e){if(0===e)return this},last:function(e,t){if(e===t.length-1)return this},eq:function(e,t,r){if(e===r)return this},contains:function(t,r,i){if(e(this).text().indexOf(i)>-1)return this},has:function(e,r,i){if(t.qsa(this,i).length)return this}},s=new RegExp("(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*"),o=/^\s*>/,l="Zepto"+ +new Date;function u(e,t){e=e.replace(/=#\]/g,'="#"]');var r,i,n=s.exec(e);if(n&&n[2]in a&&(r=a[n[2]],i=n[3],e=n[1],i)){var o=Number(i);i=isNaN(o)?i.replace(/^["']|["']$/g,""):o}return t(e,r,i)}t.qsa=function(i,n){return u(n,(function(a,s,u){try{var c;!a&&s?a="*":o.test(a)&&(c=e(i).addClass(l),a="."+l+" "+a);var d=r(i,a)}catch(e){throw console.error("error performing selector: %o",n),e}finally{c&&c.removeClass(l)}return s?t.uniq(e.map(d,(function(e,t){return s.call(e,t,d,u)}))):d}))},t.matches=function(e,t){return u(t,(function(t,r,n){return(!t||i(e,t))&&(!r||r.call(e,null,n)===e)}))}}(k);var S=b(k);Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n<r;){var a=t[n];if(e.call(i,a,n,t))return a;n++}}}),Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}),Object.values||(Object.values=function(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=e[t[r]];return i}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(e),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])}return r},writable:!0,configurable:!0}),Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n<r;){var a=t[n];if(e.call(i,a,n,t))return n;n++}return-1},configurable:!0,writable:!0});var _,C,L,D={mp4:"data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAC721kYXQhEAUgpBv/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3pwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcCEQBSCkG//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADengAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAsJtb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAALwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAB7HRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAIAAAAAAAAALwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAC8AAAAAAAEAAAAAAWRtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAIAFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAEPbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAADTc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAgAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgACAASAgIAUQBUAAAAAAfQAAAHz+QWAgIACEhAGgICAAQIAAAAYc3R0cwAAAAAAAAABAAAAAgAABAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAIAAAABAAAAHHN0c3oAAAAAAAAAAAAAAAIAAAFzAAABdAAAABRzdGNvAAAAAAAAAAEAAAAsAAAAYnVkdGEAAABabWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAtaWxzdAAAACWpdG9vAAAAHWRhdGEAAAABAAAAAExhdmY1Ni40MC4xMDE="},I=[{name:"Chromium",group:"Chrome",identifier:"Chromium/([0-9.]*)"},{name:"Chrome Mobile",group:"Chrome",identifier:"Chrome/([0-9.]*) Mobile",versionIdentifier:"Chrome/([0-9.]*)"},{name:"Chrome",group:"Chrome",identifier:"Chrome/([0-9.]*)"},{name:"Chrome for iOS",group:"Chrome",identifier:"CriOS/([0-9.]*)"},{name:"Android Browser",group:"Chrome",identifier:"CrMo/([0-9.]*)"},{name:"Firefox",group:"Firefox",identifier:"Firefox/([0-9.]*)"},{name:"Opera Mini",group:"Opera",identifier:"Opera Mini/([0-9.]*)"},{name:"Opera",group:"Opera",identifier:"Opera ([0-9.]*)"},{name:"Opera",group:"Opera",identifier:"Opera/([0-9.]*)",versionIdentifier:"Version/([0-9.]*)"},{name:"IEMobile",group:"Explorer",identifier:"IEMobile/([0-9.]*)"},{name:"Internet Explorer",group:"Explorer",identifier:"MSIE ([a-zA-Z0-9.]*)"},{name:"Internet Explorer",group:"Explorer",identifier:"Trident/([0-9.]*)",versionIdentifier:"rv:([0-9.]*)"},{name:"Spartan",group:"Spartan",identifier:"Edge/([0-9.]*)",versionIdentifier:"Edge/([0-9.]*)"},{name:"Safari",group:"Safari",identifier:"Safari/([0-9.]*)",versionIdentifier:"Version/([0-9.]*)"}],R=[{name:"Windows 2000",group:"Windows",identifier:"Windows NT 5.0",version:"5.0"},{name:"Windows XP",group:"Windows",identifier:"Windows NT 5.1",version:"5.1"},{name:"Windows Vista",group:"Windows",identifier:"Windows NT 6.0",version:"6.0"},{name:"Windows 7",group:"Windows",identifier:"Windows NT 6.1",version:"7.0"},{name:"Windows 8",group:"Windows",identifier:"Windows NT 6.2",version:"8.0"},{name:"Windows 8.1",group:"Windows",identifier:"Windows NT 6.3",version:"8.1"},{name:"Windows 10",group:"Windows",identifier:"Windows NT 10.0",version:"10.0"},{name:"Windows Phone",group:"Windows Phone",identifier:"Windows Phone ([0-9.]*)"},{name:"Windows Phone",group:"Windows Phone",identifier:"Windows Phone OS ([0-9.]*)"},{name:"Windows",group:"Windows",identifier:"Windows"},{name:"Chrome OS",group:"Chrome OS",identifier:"CrOS"},{name:"Android",group:"Android",identifier:"Android",versionIdentifier:"Android ([a-zA-Z0-9.-]*)"},{name:"iPad",group:"iOS",identifier:"iPad",versionIdentifier:"OS ([0-9_]*)",versionSeparator:"[_|.]"},{name:"iPod",group:"iOS",identifier:"iPod",versionIdentifier:"OS ([0-9_]*)",versionSeparator:"[_|.]"},{name:"iPhone",group:"iOS",identifier:"iPhone OS",versionIdentifier:"OS ([0-9_]*)",versionSeparator:"[_|.]"},{name:"Mac OS X High Sierra",group:"Mac OS",identifier:"Mac OS X (10([_|.])13([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Sierra",group:"Mac OS",identifier:"Mac OS X (10([_|.])12([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X El Capitan",group:"Mac OS",identifier:"Mac OS X (10([_|.])11([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Yosemite",group:"Mac OS",identifier:"Mac OS X (10([_|.])10([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Mavericks",group:"Mac OS",identifier:"Mac OS X (10([_|.])9([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Mountain Lion",group:"Mac OS",identifier:"Mac OS X (10([_|.])8([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Lion",group:"Mac OS",identifier:"Mac OS X (10([_|.])7([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Snow Leopard",group:"Mac OS",identifier:"Mac OS X (10([_|.])6([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Leopard",group:"Mac OS",identifier:"Mac OS X (10([_|.])5([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Tiger",group:"Mac OS",identifier:"Mac OS X (10([_|.])4([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Panther",group:"Mac OS",identifier:"Mac OS X (10([_|.])3([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Jaguar",group:"Mac OS",identifier:"Mac OS X (10([_|.])2([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Puma",group:"Mac OS",identifier:"Mac OS X (10([_|.])1([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS X Cheetah",group:"Mac OS",identifier:"Mac OS X (10([_|.])0([0-9_.]*))",versionSeparator:"[_|.]"},{name:"Mac OS",group:"Mac OS",identifier:"Mac OS"},{name:"Ubuntu",group:"Linux",identifier:"Ubuntu",versionIdentifier:"Ubuntu/([0-9.]*)"},{name:"Debian",group:"Linux",identifier:"Debian"},{name:"Gentoo",group:"Linux",identifier:"Gentoo"},{name:"Linux",group:"Linux",identifier:"Linux"},{name:"BlackBerry",group:"BlackBerry",identifier:"BlackBerry"}],O={},w=function(e,t){var r=e.split(".",2);t.fullVersion=e,r[0]&&(t.majorVersion=parseInt(r[0])),r[1]&&(t.minorVersion=parseInt(r[1]))},P=function(e,t,r){var i="["==t.substr(0,1)?new RegExp(t,"g"):t,n=e.split(i,2);"."!=t&&(e=e.replace(new RegExp(t,"g"),".")),r.fullVersion=e,n&&n[0]&&(r.majorVersion=parseInt(n[0])),n&&n[1]&&(r.minorVersion=parseInt(n[1]))},x=function(e){var t,r=e.match(/\b(playstation 4|nx|opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];if(/trident/i.test(r[1]))return t=/\brv[ :]+(\d+)/g.exec(e)||[],{name:"IE",version:parseInt(t[1]||"")};if("Chrome"===r[1]){if(null!=(t=e.match(/\bOPR\/(\d+)/)))return{name:"Opera",version:parseInt(t[1])};if(null!=(t=e.match(/\bEdge\/(\d+)/)))return{name:"Edge",version:parseInt(t[1])}}else/android/i.test(e)&&(t=e.match(/version\/(\d+)/i))&&(r.splice(1,1,"Android WebView"),r.splice(2,1,t[1]));return{name:(r=r[2]?[r[1],r[2]]:[navigator.appName,navigator.appVersion,"-?"])[0],version:parseInt(r[1])}}(navigator.userAgent);O.isEdge=/Edg|EdgiOS|EdgA/i.test(navigator.userAgent),O.isChrome=/Chrome|CriOS/i.test(navigator.userAgent)&&!O.isEdge,O.isSafari=/Safari/i.test(navigator.userAgent)&&!O.isChrome&&!O.isEdge,O.isFirefox=/Firefox/i.test(navigator.userAgent),O.isLegacyIE=!!window.ActiveXObject,O.isIE=O.isLegacyIE||/trident.*rv:1\d/i.test(navigator.userAgent),O.isIE11=/trident.*rv:11/i.test(navigator.userAgent),O.isChromecast=O.isChrome&&/CrKey/i.test(navigator.userAgent),O.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone|IEMobile|Mobile Safari|Opera Mini/i.test(navigator.userAgent),O.isiOS=/iPad|iPhone|iPod/i.test(navigator.userAgent),O.isAndroid=/Android/i.test(navigator.userAgent),O.isWindowsPhone=/Windows Phone/i.test(navigator.userAgent),O.isWin8App=/MSAppHost/i.test(navigator.userAgent),O.isWiiU=/WiiU/i.test(navigator.userAgent),O.isPS4=/PlayStation 4/i.test(navigator.userAgent),O.hasLocalstorage=function(){try{return localStorage.setItem("clappr","clappr"),localStorage.removeItem("clappr"),!0}catch(e){return!1}}(),O.hasFlash=function(){try{return!!new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){return!(!navigator.mimeTypes||void 0===navigator.mimeTypes["application/x-shockwave-flash"]||!navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)}}(),O.name=x.name,O.version=x.version,O.userAgent=navigator.userAgent,O.data=function(){var e,t={},r=O.userAgent.toLowerCase(),i=T(I);try{for(i.s();!(e=i.n()).done;){var n=e.value,a=new RegExp(n.identifier.toLowerCase()).exec(r);if(null!=a&&a[1]){if(t.name=n.name,t.group=n.group,n.versionIdentifier){var s=new RegExp(n.versionIdentifier.toLowerCase()).exec(r);null!=s&&s[1]&&w(s[1],t)}else w(a[1],t);break}}}catch(e){i.e(e)}finally{i.f()}return t}(),O.os=function(){var e,t={},r=O.userAgent.toLowerCase(),i=T(R);try{for(i.s();!(e=i.n()).done;){var n=e.value,a=new RegExp(n.identifier.toLowerCase()).exec(r);if(null!=a){if(t.name=n.name,t.group=n.group,n.version)P(n.version,n.versionSeparator?n.versionSeparator:".",t);else if(a[1])P(a[1],n.versionSeparator?n.versionSeparator:".",t);else if(n.versionIdentifier){var s=new RegExp(n.versionIdentifier.toLowerCase()).exec(r);null!=s&&s[1]&&P(s[1],n.versionSeparator?n.versionSeparator:".",t)}break}}}catch(e){i.e(e)}finally{i.f()}return t}(),O.isWindows=/^Windows$/i.test(O.os.group),O.isMacOS=/^Mac OS$/i.test(O.os.group),O.isLinux=/^Linux$/i.test(O.os.group),O.viewport=((_={}).width=S(window).width(),_.height=S(window).height(),_),O.device=(C=O.userAgent,(L=/\((iP(?:hone|ad|od))?(?:[^;]*; ){0,2}([^)]+(?=\)))/.exec(C))&&(L[1]||L[2])||""),void 0!==window.orientation&&function(){switch(window.orientation){case-90:case 90:O.viewport.orientation="landscape";break;default:O.viewport.orientation="portrait"}}();var N={},M=[],F=(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}).bind(window),B=(window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout).bind(window);function U(e,t){if(t)for(var r in t){var i=Object.getOwnPropertyDescriptor(t,r);i?Object.defineProperty(e,r,i):e[r]=t[r]}return e}function G(e,t){var r=function(e){function r(){var e;u(this,r);for(var n=arguments.length,a=new Array(n),s=0;s<n;s++)a[s]=arguments[s];return e=i(this,r,[].concat(a)),t.initialize&&t.initialize.apply(e,a),e}return f(r,e),d(r)}(e);return U(r.prototype,t),r}var V={fullscreenElement:function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},requestFullscreen:function(e){if(e.requestFullscreen)return e.requestFullscreen();if(e.webkitRequestFullscreen){if("function"==typeof e.then)return e.webkitRequestFullscreen();e.webkitRequestFullscreen()}else{if(e.mozRequestFullScreen)return e.mozRequestFullScreen();if(e.msRequestFullscreen)return e.msRequestFullscreen();e.querySelector&&e.querySelector("video")&&e.querySelector("video").webkitEnterFullScreen?e.querySelector("video").webkitEnterFullScreen():e.webkitEnterFullScreen&&e.webkitEnterFullScreen()}},cancelFullscreen:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;e.exitFullscreen?e.exitFullscreen():e.webkitCancelFullScreen?e.webkitCancelFullScreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.msExitFullscreen&&e.msExitFullscreen()},fullscreenEnabled:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},K=function(){return d((function e(){u(this,e)}),null,[{key:"_defaultConfig",value:function(){return{volume:{value:100,parse:parseInt}}}},{key:"_defaultValueFor",value:function(e){try{return this._defaultConfig()[e].parse(this._defaultConfig()[e].value)}catch(e){return}}},{key:"_createKeyspace",value:function(e){return"clappr.".concat(document.domain,".").concat(e)}},{key:"restore",value:function(e){return O.hasLocalstorage&&localStorage[this._createKeyspace(e)]?this._defaultConfig()[e].parse(localStorage[this._createKeyspace(e)]):this._defaultValueFor(e)}},{key:"persist",value:function(e,t){if(O.hasLocalstorage)try{return localStorage[this._createKeyspace(e)]=t,!0}catch(e){return!1}}}])}(),j=function(){return d((function e(){u(this,e)}),null,[{key:"params",get:function(){var e=window.location.search.substring(1);return e!==this.query&&(this._urlParams=this.parse(e),this.query=e),this._urlParams}},{key:"hashParams",get:function(){var e=window.location.hash.substring(1);return e!==this.hash&&(this._hashParams=this.parse(e),this.hash=e),this._hashParams}},{key:"parse",value:function(e){for(var t,r=/\+/g,i=/([^&=]+)=?([^&]*)/g,n=function(e){return decodeURIComponent(e.replace(r," "))},a={};t=i.exec(e);)a[n(t[1]).toLowerCase()]=n(t[2]);return a}}])}();function H(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"t",t=0,r=j.params[e]||j.hashParams[e]||"",i=r.match(/[0-9]+[hms]+/g)||[];if(i.length>0){var n={h:3600,m:60,s:1};i.forEach((function(e){if(e){var r=e[e.length-1],i=parseInt(e.slice(0,e.length-1),10);t+=i*n[r]}}))}else r&&(t=parseInt(r,10));return t}function Y(e){return N[e]||(N[e]=0),e+ ++N[e]}function W(e){return e-parseFloat(e)+1>=0}function $(){var e=document.getElementsByTagName("script");return e.length?e[e.length-1].src:""}function z(){return window.navigator&&window.navigator.language}function q(e,t){var r=(t=Object.assign({inline:!1,muted:!1,timeout:250,type:"video",source:D.mp4,element:null},t)).element?t.element:document.createElement(t.type);r.muted=t.muted,!0===t.muted&&r.setAttribute("muted","muted"),!0===t.inline&&r.setAttribute("playsinline","playsinline"),r.src=t.source;var i=r.play(),n=setTimeout((function(){a(!1,new Error("Timeout ".concat(t.timeout," ms has been reached")))}),t.timeout),a=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;clearTimeout(n),e(t,r)};void 0!==i?i.then((function(){return a(!0)})).catch((function(e){return a(!1,e)})):a(!0)}var X=function(){return d((function e(){u(this,e)}),null,[{key:"configure",value:function(e){this.options=S.extend(!0,this.options,e)}},{key:"create",value:function(e){return this.options.recycleVideo&&"video"===e&&M.length>0?M.shift():document.createElement(e)}},{key:"garbage",value:function(e){this.options.recycleVideo&&"VIDEO"===e.tagName.toUpperCase()&&(S(e).children().remove(),Object.values(e.attributes).forEach((function(t){return e.removeAttribute(t.name)})),M.push(e))}}])}();X.options={recycleVideo:!1};var Z=function(){return d((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;u(this,e),this.delay=t,this.lastTime=0}),[{key:"handle",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=(new Date).getTime(),n=i-this.lastTime;n<this.delay&&n>0&&(t(),r&&e.preventDefault()),this.lastTime=i}}])}(),Q={Config:K,Fullscreen:V,QueryString:j,DomRecycler:X,assign:U,extend:G,formatTime:function(e,t){if(!isFinite(e))return"--:--";e*=1e3;var r=(e=parseInt(e/1e3))%60,i=(e=parseInt(e/60))%60,n=(e=parseInt(e/60))%24,a=parseInt(e/24),s="";return a&&a>0&&(s+=a+":",n<1&&(s+="00:")),(n&&n>0||t)&&(s+=("0"+n).slice(-2)+":"),s+=("0"+i).slice(-2)+":",(s+=("0"+r).slice(-2)).trim()},seekStringToSeconds:H,uniqueId:Y,currentScriptUrl:$,isNumber:W,requestAnimationFrame:F,cancelAnimationFrame:B,getBrowserLanguage:z,now:function(){return window.performance&&window.performance.now?performance.now():Date.now()},removeArrayItem:function(e,t){var r=e.indexOf(t);r>=0&&e.splice(r,1)},listContainsIgnoreCase:function(e,t){return void 0!==e&&void 0!==t&&void 0!==t.find((function(t){return e.toLowerCase()===t.toLowerCase()}))},canAutoPlayMedia:q,Media:D,DoubleEventHandler:Z},J="font-weight: bold; font-size: 13px;",ee="color: #ff8000;"+J,te="color: #ff0000;"+J,re=["color: #0000ff;"+J,"color: #006600;"+J,ee,te,te],ie=["debug","info","warn","error","disabled"],ne=function(){return d((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;u(this,e),this.EXCLUDE_LIST=["timeupdate","playback:timeupdate","playback:progress","container:hover","container:timeupdate","container:progress"],this.level=t,this.previousLevel=this.level,this.offLevel=r}),[{key:"level",get:function(){return this._level},set:function(e){this._level=e}},{key:"debug",value:function(e){this.log(e,0,Array.prototype.slice.call(arguments,1))}},{key:"info",value:function(e){this.log(e,1,Array.prototype.slice.call(arguments,1))}},{key:"warn",value:function(e){this.log(e,2,Array.prototype.slice.call(arguments,1))}},{key:"error",value:function(e){this.log(e,3,Array.prototype.slice.call(arguments,1))}},{key:"onOff",value: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 "+ie[this.level],ee)}},{key:"log",value:function(e,t,r){if(!(this.EXCLUDE_LIST.indexOf(r[0])>=0||t<this.level)){r||(r=e,e=null);var i=re[t],n="";e&&(n="["+e+"]"),window.console&&window.console.log&&window.console.log.apply(console,["%c["+ie[t]+"]"+n,i].concat(r))}}}])}();ne.LEVEL_DEBUG=0,ne.LEVEL_INFO=1,ne.LEVEL_WARN=2,ne.LEVEL_ERROR=3,ne.getInstance=function(){return void 0===this._instance&&(this._instance=new this),this._instance},ne.setLevel=function(e){this.getInstance().level=e},ne.debug=function(){this.getInstance().debug.apply(this.getInstance(),arguments)},ne.info=function(){this.getInstance().info.apply(this.getInstance(),arguments)},ne.warn=function(){this.getInstance().warn.apply(this.getInstance(),arguments)},ne.error=function(){this.getInstance().error.apply(this.getInstance(),arguments)};var ae=Array.prototype.slice,se=/\s+/,oe=function(e,t,r,i){if(!r)return!0;if("object"===l(r)){for(var n in r)e[t].apply(e,[n,r[n]].concat(i));return!1}if(se.test(r)){for(var a=r.split(se),s=0,o=a.length;s<o;s++)e[t].apply(e,[a[s]].concat(i));return!1}return!0},le=function(e,t,r,i){var n,a=-1,s=e.length,o=t[0],l=t[1],u=t[2];!function c(){try{switch(t.length){case 0:for(;++a<s;)(n=e[a]).callback.call(n.ctx);return;case 1:for(;++a<s;)(n=e[a]).callback.call(n.ctx,o);return;case 2:for(;++a<s;)(n=e[a]).callback.call(n.ctx,o,l);return;case 3:for(;++a<s;)(n=e[a]).callback.call(n.ctx,o,l,u);return;default:for(;++a<s;)(n=e[a]).callback.apply(n.ctx,t);return}}catch(e){ne.error.apply(ne,[r,"error on event",i,"trigger","-",e]),c()}}()},ue=function(){function e(){u(this,e)}return d(e,[{key:"on",value:function(e,t,r){return oe(this,"on",e,[t,r])&&t?(this._events||(this._events={}),(this._events[e]||(this._events[e]=[])).push({callback:t,context:r,ctx:r||this}),this):this}},{key:"once",value:function(e,t,r){var i,n=this;if(!oe(this,"once",e,[t,r])||!t)return this;return i=function(){n.off(e,i),t.apply(this,arguments)},i._callback=t,this.on(e,i,r)}},{key:"off",value:function(e,t,r){var i,n,a,s,o,l,u,c;if(!this._events||!oe(this,"off",e,[t,r]))return this;if(!e&&!t&&!r)return this._events=void 0,this;for(o=0,l=(s=e?[e]:Object.keys(this._events)).length;o<l;o++)if(e=s[o],a=this._events[e]){if(this._events[e]=i=[],t||r)for(u=0,c=a.length;u<c;u++)n=a[u],(t&&t!==n.callback&&t!==n.callback._callback||r&&r!==n.context)&&i.push(n);i.length||delete this._events[e]}return this}},{key:"trigger",value:function(e){var t=this.name||this.constructor.name;if(ne.debug.apply(ne,[t].concat(Array.prototype.slice.call(arguments))),!this._events)return this;var r=ae.call(arguments,1);if(!oe(this,"trigger",e,r))return this;var i=this._events[e],n=this._events.all;return i&&le(i,r,t,e),n&&le(n,arguments,t,e),this}},{key:"stopListening",value:function(e,t,r){var i=this._listeningTo;if(!i)return this;var n=!t&&!r;for(var a in r||"object"!==l(t)||(r=this),e&&((i={})[e._listenId]=e),i)(e=i[a]).off(t,r,this),(n||0===Object.keys(e._events).length)&&delete this._listeningTo[a];return this}}],[{key:"register",value:function(t){e.Custom||(e.Custom={});var r="string"==typeof t&&t.toUpperCase().trim();r&&!e.Custom[r]?e.Custom[r]=r.toLowerCase().split("_").map((function(e,t){return 0===t?e:e=e[0].toUpperCase()+e.slice(1)})).join(""):ne.error("Events","Error when register event: "+t)}},{key:"listAvailableCustomEvents",value:function(){return e.Custom||(e.Custom={}),Object.keys(e.Custom).filter((function(t){return"string"==typeof e.Custom[t]}))}}])}();ue.prototype.listenTo=function(e,t,r){return(this._listeningTo||(this._listeningTo={}))[e._listenId||(e._listenId=Y("l"))]=e,r||"object"!==l(t)||(r=this),e.on(t,r,this),this},ue.prototype.listenToOnce=function(e,t,r){return(this._listeningTo||(this._listeningTo={}))[e._listenId||(e._listenId=Y("l"))]=e,r||"object"!==l(t)||(r=this),e.once(t,r,this),this},ue.PLAYER_READY="ready",ue.PLAYER_RESIZE="resize",ue.PLAYER_FULLSCREEN="fullscreen",ue.PLAYER_PLAY="play",ue.PLAYER_PAUSE="pause",ue.PLAYER_STOP="stop",ue.PLAYER_ENDED="ended",ue.PLAYER_SEEK="seek",ue.PLAYER_ERROR="playererror",ue.ERROR="error",ue.PLAYER_TIMEUPDATE="timeupdate",ue.PLAYER_VOLUMEUPDATE="volumeupdate",ue.PLAYER_SUBTITLE_AVAILABLE="subtitleavailable",ue.PLAYBACK_PIP_ENTER="playback:picture-in-picture:enter",ue.PLAYBACK_PIP_EXIT="playback:picture-in-picture:exit",ue.PLAYBACK_PROGRESS="playback:progress",ue.PLAYBACK_TIMEUPDATE="playback:timeupdate",ue.PLAYBACK_READY="playback:ready",ue.PLAYBACK_BUFFERING="playback:buffering",ue.PLAYBACK_BUFFERFULL="playback:bufferfull",ue.PLAYBACK_SETTINGSUPDATE="playback:settingsupdate",ue.PLAYBACK_LOADEDMETADATA="playback:loadedmetadata",ue.PLAYBACK_HIGHDEFINITIONUPDATE="playback:highdefinitionupdate",ue.PLAYBACK_BITRATE="playback:bitrate",ue.PLAYBACK_LEVELS_AVAILABLE="playback:levels:available",ue.PLAYBACK_LEVEL_SWITCH_START="playback:levels:switch:start",ue.PLAYBACK_LEVEL_SWITCH_END="playback:levels:switch:end",ue.PLAYBACK_PLAYBACKSTATE="playback:playbackstate",ue.PLAYBACK_DVR="playback:dvr",ue.PLAYBACK_MEDIACONTROL_DISABLE="playback:mediacontrol:disable",ue.PLAYBACK_MEDIACONTROL_ENABLE="playback:mediacontrol:enable",ue.PLAYBACK_ENDED="playback:ended",ue.PLAYBACK_PLAY_INTENT="playback:play:intent",ue.PLAYBACK_PLAY="playback:play",ue.PLAYBACK_PAUSE="playback:pause",ue.PLAYBACK_SEEK="playback:seek",ue.PLAYBACK_SEEKED="playback:seeked",ue.PLAYBACK_STOP="playback:stop",ue.PLAYBACK_ERROR="playback:error",ue.PLAYBACK_STATS_ADD="playback:stats:add",ue.PLAYBACK_FRAGMENT_LOADED="playback:fragment:loaded",ue.PLAYBACK_LEVEL_SWITCH="playback:level:switch",ue.PLAYBACK_SUBTITLE_AVAILABLE="playback:subtitle:available",ue.PLAYBACK_SUBTITLE_CHANGED="playback:subtitle:changed",ue.PLAYBACK_AUDIO_AVAILABLE="playback:audio:available",ue.PLAYBACK_AUDIO_CHANGED="playback:audio:changed",ue.CORE_CONTAINERS_CREATED="core:containers:created",ue.CORE_ACTIVE_CONTAINER_CHANGED="core:active:container:changed",ue.CORE_OPTIONS_CHANGE="core:options:change",ue.CORE_READY="core:ready",ue.CORE_FULLSCREEN="core:fullscreen",ue.CORE_RESIZE="core:resize",ue.CORE_SCREEN_ORIENTATION_CHANGED="core:screen:orientation:changed",ue.CORE_MOUSE_MOVE="core:mousemove",ue.CORE_MOUSE_LEAVE="core:mouseleave",ue.CONTAINER_PLAYBACKSTATE="container:playbackstate",ue.CONTAINER_PLAYBACKDVRSTATECHANGED="container:dvr",ue.CONTAINER_BITRATE="container:bitrate",ue.CONTAINER_STATS_REPORT="container:stats:report",ue.CONTAINER_DESTROYED="container:destroyed",ue.CONTAINER_READY="container:ready",ue.CONTAINER_RESIZE="container:resize",ue.CONTAINER_ERROR="container:error",ue.CONTAINER_LOADEDMETADATA="container:loadedmetadata",ue.CONTAINER_SUBTITLE_AVAILABLE="container:subtitle:available",ue.CONTAINER_SUBTITLE_CHANGED="container:subtitle:changed",ue.CONTAINER_AUDIO_AVAILABLE="container:audio:available",ue.CONTAINER_AUDIO_CHANGED="container:audio:changed",ue.CONTAINER_TIMEUPDATE="container:timeupdate",ue.CONTAINER_PROGRESS="container:progress",ue.CONTAINER_PLAY="container:play",ue.CONTAINER_STOP="container:stop",ue.CONTAINER_PAUSE="container:pause",ue.CONTAINER_ENDED="container:ended",ue.CONTAINER_CLICK="container:click",ue.CONTAINER_DBLCLICK="container:dblclick",ue.CONTAINER_CONTEXTMENU="container:contextmenu",ue.CONTAINER_MOUSE_ENTER="container:mouseenter",ue.CONTAINER_MOUSE_LEAVE="container:mouseleave",ue.CONTAINER_MOUSE_UP="container:mouseup",ue.CONTAINER_MOUSE_DOWN="container:mousedown",ue.CONTAINER_PIP_ENTER="container:picture-in-picture:enter",ue.CONTAINER_PIP_EXIT="container:picture-in-picture:exit",ue.CONTAINER_SEEK="container:seek",ue.CONTAINER_SEEKED="container:seeked",ue.CONTAINER_VOLUME="container:volume",ue.CONTAINER_FULLSCREEN="container:fullscreen",ue.CONTAINER_STATE_BUFFERING="container:state:buffering",ue.CONTAINER_STATE_BUFFERFULL="container:state:bufferfull",ue.CONTAINER_SETTINGSUPDATE="container:settingsupdate",ue.CONTAINER_HIGHDEFINITIONUPDATE="container:highdefinitionupdate",ue.CONTAINER_MEDIACONTROL_SHOW="container:mediacontrol:show",ue.CONTAINER_MEDIACONTROL_HIDE="container:mediacontrol:hide",ue.CONTAINER_MEDIACONTROL_DISABLE="container:mediacontrol:disable",ue.CONTAINER_MEDIACONTROL_ENABLE="container:mediacontrol:enable",ue.CONTAINER_STATS_ADD="container:stats:add",ue.CONTAINER_OPTIONS_CHANGE="container:options:change",ue.MEDIACONTROL_RENDERED="mediacontrol:rendered",ue.MEDIACONTROL_FULLSCREEN="mediacontrol:fullscreen",ue.MEDIACONTROL_SHOW="mediacontrol:show",ue.MEDIACONTROL_HIDE="mediacontrol:hide",ue.MEDIACONTROL_MOUSEMOVE_SEEKBAR="mediacontrol:mousemove:seekbar",ue.MEDIACONTROL_MOUSELEAVE_SEEKBAR="mediacontrol:mouseleave:seekbar",ue.MEDIACONTROL_PLAYING="mediacontrol:playing",ue.MEDIACONTROL_NOTPLAYING="mediacontrol:notplaying",ue.MEDIACONTROL_CONTAINERCHANGED="mediacontrol:containerchanged",ue.MEDIACONTROL_OPTIONS_CHANGE="mediacontrol:options:change";var ce=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return u(this,t),(e=i(this,t,[r]))._options=r,e.uniqueId=Y("o"),e}return f(t,e),d(t,[{key:"options",get:function(){return this._options}}])}(ue),de={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},he=/(.)^/,fe={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},pe=/\\|'|\r|\n|\t|\u2028|\u2029/g,ge={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},ve=new RegExp("[&<>\"']","g"),me=function(e){return null===e?"":(""+e).replace(ve,(function(e){return ge[e]}))},ye=0,Ae=function(e,t){var r,i=new RegExp([(de.escape||he).source,(de.interpolate||he).source,(de.evaluate||he).source].join("|")+"|$","g"),n=0,a="__p+='";e.replace(i,(function(t,r,i,s,o){return a+=e.slice(n,o).replace(pe,(function(e){return"\\"+fe[e]})),r&&(a+="'+\n((__t=("+r+"))==null?'':escapeExpr(__t))+\n'"),i&&(a+="'+\n((__t=("+i+"))==null?'':__t)+\n'"),s&&(a+="';\n"+s+"\n__p+='"),n=o+t.length,t})),a+="';\n",de.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n//# sourceURL=/microtemplates/source["+ye+++"]";try{r=new Function(de.variable||"obj","escapeExpr",a)}catch(e){throw e.source=a,e}if(t)return r(t,me);var s=function(e){return r.call(this,e,me)};return s.source="function("+(de.variable||"obj")+"){\n"+a+"}",s};Ae.settings=de;var Ee={getStyleFor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{baseUrl:""};return S('<style class="clappr-style"></style>').html(Ae(e.toString())(t))}},Te=/^(\S+)\s*(.*)$/,be=function(e){function t(e){var r;return u(this,t),(r=i(this,t,[e])).cid=Y("c"),r._ensureElement(),r.delegateEvents(),r}return f(t,e),d(t,[{key:"tagName",get:function(){return"div"}},{key:"events",get:function(){return{}}},{key:"attributes",get:function(){return{}}},{key:"$",value:function(e){return this.$el.find(e)}},{key:"render",value:function(){return this}},{key:"destroy",value:function(){return this.$el.remove(),this.stopListening(),this.undelegateEvents(),this}},{key:"setElement",value:function(e,t){return this.$el&&this.undelegateEvents(),this.$el=S.zepto.isZ(e)?e:S(e),this.el=this.$el[0],!1!==t&&this.delegateEvents(),this}},{key:"delegateEvents",value:function(e){for(var t in e||(e=this.events),this.undelegateEvents(),e){var r=e[t];if(r&&r.constructor!==Function&&(r=this[e[t]]),r){var i=t.match(Te),n=i[1],a=i[2];n+=".delegateEvents"+this.cid,""===a?this.$el.on(n,r.bind(this)):this.$el.on(n,a,r.bind(this))}}return this}},{key:"undelegateEvents",value:function(){return this.$el.off(".delegateEvents"+this.cid),this}},{key:"_ensureElement",value:function(){if(this.el)this.setElement(this.el,!1);else{var e=S.extend(!0,{},this.attributes);this.id&&(e.id=this.id),this.className&&(e.class=this.className);var t=S(X.create(this.tagName)).attr(e);this.setElement(t,!1)}}}])}(ce),ke=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return u(this,t),(e=i(this,t,[r])).core=n,e}return f(t,e),d(t,[{key:"name",get:function(){return"error"}},{key:"createError",value:function(e){this.core?this.core.trigger(ue.ERROR,e):ne.warn(this.name,"Core is not set. Error: ",e)}}],[{key:"Levels",get:function(){return{FATAL:"FATAL",WARN:"WARN",INFO:"INFO"}}}])}(ce),Se={createError:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{useCodePrefix:!0},r=this.constructor&&this.constructor.type||"",i=this.name||r,n=this.i18n||this.core&&this.core.i18n||this.container&&this.container.i18n,a="".concat(i,":").concat(e&&e.code||"unknown"),s={description:"",level:ke.Levels.FATAL,origin:i,scope:r,raw:{}},o=Object.assign({},s,e,{code:t.useCodePrefix?a:e.code});if(n&&o.level==ke.Levels.FATAL&&!o.UI){var l={title:n.t("default_error_title"),message:n.t("default_error_message")};o.UI=l}return this.playerError?this.playerError.createError(o):ne.warn(i,"PlayerError is not defined. Error: ",o),o}},_e=function(e){function t(e){var r;return u(this,t),(r=i(this,t,[e.options])).core=e,r.enabled=!0,r.bindEvents(),r.render(),r}return f(t,e),d(t,[{key:"playerError",get:function(){return this.core.playerError}},{key:"bindEvents",value:function(){}},{key:"getExternalInterface",value:function(){return{}}},{key:"enable",value:function(){this.enabled||(this.bindEvents(),this.$el.show(),this.enabled=!0)}},{key:"disable",value:function(){this.stopListening(),this.$el.hide(),this.enabled=!1}},{key:"render",value:function(){return this}}])}(be);Object.assign(_e.prototype,Se),_e.extend=function(e){return G(_e,e)},_e.type="core";var Ce=function(e){function t(e,r,n){var a;return u(this,t),(a=i(this,t,[e]))._i18n=r,a.currentTime=0,a.volume=100,a.playback=e.playback,a.playerError=n,a.settings=S.extend(!0,{},a.playback.settings),a.isReady=!1,a.mediaControlDisabled=!1,a.plugins=[a.playback],a.dblTapHandler=new Z(500),a.clickTimer=null,a.clickDelay=200,a.actionsMetadata={},a.bindEvents(),a}return f(t,e),d(t,[{key:"name",get:function(){return"Container"}},{key:"attributes",get:function(){return{class:"container","data-container":""}}},{key:"events",get:function(){return{click:"clicked",dblclick:"dblClicked",touchend:"dblTap",contextmenu:"onContextMenu",mouseenter:"mouseEnter",mouseleave:"mouseLeave",mouseup:"onMouseUp",mousedown:"onMouseDown"}}},{key:"ended",get:function(){return this.playback.ended}},{key:"buffering",get:function(){return this.playback.buffering}},{key:"i18n",get:function(){return this._i18n}},{key:"hasClosedCaptionsTracks",get:function(){return this.playback.hasClosedCaptionsTracks}},{key:"closedCaptionsTracks",get:function(){return this.playback.closedCaptionsTracks}},{key:"closedCaptionsTrackId",get:function(){return this.playback.closedCaptionsTrackId},set:function(e){this.playback.closedCaptionsTrackId=e}},{key:"audioTracks",get:function(){return this.playback.audioTracks}},{key:"currentAudioTrack",get:function(){return this.playback.currentAudioTrack}},{key:"isPiPActive",get:function(){return this.playback.isPiPActive}},{key:"bindEvents",value:function(){this.listenTo(this.playback,ue.PLAYBACK_PROGRESS,this.onProgress),this.listenTo(this.playback,ue.PLAYBACK_TIMEUPDATE,this.timeUpdated),this.listenTo(this.playback,ue.PLAYBACK_READY,this.ready),this.listenTo(this.playback,ue.PLAYBACK_BUFFERING,this.onBuffering),this.listenTo(this.playback,ue.PLAYBACK_BUFFERFULL,this.bufferfull),this.listenTo(this.playback,ue.PLAYBACK_SETTINGSUPDATE,this.settingsUpdate),this.listenTo(this.playback,ue.PLAYBACK_LOADEDMETADATA,this.loadedMetadata),this.listenTo(this.playback,ue.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinitionUpdate),this.listenTo(this.playback,ue.PLAYBACK_BITRATE,this.updateBitrate),this.listenTo(this.playback,ue.PLAYBACK_PLAYBACKSTATE,this.playbackStateChanged),this.listenTo(this.playback,ue.PLAYBACK_DVR,this.playbackDvrStateChanged),this.listenTo(this.playback,ue.PLAYBACK_MEDIACONTROL_DISABLE,this.disableMediaControl),this.listenTo(this.playback,ue.PLAYBACK_MEDIACONTROL_ENABLE,this.enableMediaControl),this.listenTo(this.playback,ue.PLAYBACK_SEEK,this.onSeek),this.listenTo(this.playback,ue.PLAYBACK_SEEKED,this.onSeeked),this.listenTo(this.playback,ue.PLAYBACK_ENDED,this.onEnded),this.listenTo(this.playback,ue.PLAYBACK_PLAY,this.playing),this.listenTo(this.playback,ue.PLAYBACK_PAUSE,this.paused),this.listenTo(this.playback,ue.PLAYBACK_STOP,this.stopped),this.listenTo(this.playback,ue.PLAYBACK_ERROR,this.error),this.listenTo(this.playback,ue.PLAYBACK_SUBTITLE_AVAILABLE,this.subtitleAvailable),this.listenTo(this.playback,ue.PLAYBACK_SUBTITLE_CHANGED,this.subtitleChanged),this.listenTo(this.playback,ue.PLAYBACK_AUDIO_AVAILABLE,this.audioAvailable),this.listenTo(this.playback,ue.PLAYBACK_AUDIO_CHANGED,this.audioChanged),this.listenTo(this.playback,ue.PLAYBACK_PIP_ENTER,this.onEnterPiP),this.listenTo(this.playback,ue.PLAYBACK_PIP_EXIT,this.onExitPiP)}},{key:"subtitleAvailable",value:function(){this.trigger(ue.CONTAINER_SUBTITLE_AVAILABLE)}},{key:"subtitleChanged",value:function(e){this.trigger(ue.CONTAINER_SUBTITLE_CHANGED,e)}},{key:"audioAvailable",value:function(e){this.trigger(ue.CONTAINER_AUDIO_AVAILABLE,e)}},{key:"audioChanged",value:function(e){this.trigger(ue.CONTAINER_AUDIO_CHANGED,e)}},{key:"playbackStateChanged",value:function(e){this.trigger(ue.CONTAINER_PLAYBACKSTATE,e)}},{key:"playbackDvrStateChanged",value:function(e){this.settings=this.playback.settings,this.dvrInUse=e,this.trigger(ue.CONTAINER_PLAYBACKDVRSTATECHANGED,e)}},{key:"updateBitrate",value:function(e){this.trigger(ue.CONTAINER_BITRATE,e)}},{key:"statsReport",value:function(e){this.trigger(ue.CONTAINER_STATS_REPORT,e)}},{key:"getPlaybackType",value:function(){return this.playback.getPlaybackType()}},{key:"isDvrEnabled",value:function(){return!!this.playback.dvrEnabled}},{key:"isDvrInUse",value:function(){return!!this.dvrInUse}},{key:"destroy",value:function(){this.disableResizeObserver(),this.trigger(ue.CONTAINER_DESTROYED,this,this.name),this.stopListening(),this.plugins.forEach((function(e){return e.destroy()})),this.$el.remove(),this.undelegateEvents()}},{key:"setStyle",value:function(e){this.$el.css(e)}},{key:"animate",value:function(e,t){return this.$el.animate(e,t).promise()}},{key:"ready",value:function(){this.isReady=!0,this.trigger(ue.CONTAINER_READY,this.name)}},{key:"isPlaying",value:function(){return this.playback.isPlaying()}},{key:"getStartTimeOffset",value:function(){return this.playback.getStartTimeOffset()}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getDuration",value:function(){return this.playback.getDuration()}},{key:"error",value:function(e){this.isReady||this.ready(),this.trigger(ue.CONTAINER_ERROR,e,this.name)}},{key:"loadedMetadata",value:function(e){this.trigger(ue.CONTAINER_LOADEDMETADATA,e)}},{key:"timeUpdated",value:function(e){this.currentTime=e.current,this.trigger(ue.CONTAINER_TIMEUPDATE,e,this.name)}},{key:"onProgress",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.trigger.apply(this,[ue.CONTAINER_PROGRESS].concat(t,[this.name]))}},{key:"playing",value:function(){this.trigger(ue.CONTAINER_PLAY,this.name,this.actionsMetadata.playEvent||{}),this.actionsMetadata.playEvent={}}},{key:"paused",value:function(){this.trigger(ue.CONTAINER_PAUSE,this.name,this.actionsMetadata.pauseEvent||{}),this.actionsMetadata.pauseEvent={}}},{key:"stopped",value:function(){this.trigger(ue.CONTAINER_STOP,this.actionsMetadata.stopEvent||{}),this.actionsMetadata.stopEvent={}}},{key:"play",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.actionsMetadata.playEvent=e,this.playback.play(e)}},{key:"stop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.actionsMetadata.stopEvent=e,this.playback.stop(e),this.currentTime=0}},{key:"switchAudioTrack",value:function(e){this.playback.switchAudioTrack(e)}},{key:"pause",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.actionsMetadata.pauseEvent=e,this.playback.pause(e)}},{key:"onEnded",value:function(){this.trigger(ue.CONTAINER_ENDED,this,this.name),this.currentTime=0}},{key:"clicked",value:function(){var e=this;this.options.chromeless&&!this.options.allowUserInteraction||(this.clickTimer=setTimeout((function(){e.clickTimer&&e.trigger(ue.CONTAINER_CLICK,e,e.name)}),this.clickDelay))}},{key:"cancelClicked",value:function(){clearTimeout(this.clickTimer),this.clickTimer=null}},{key:"dblClicked",value:function(){this.options.chromeless&&!this.options.allowUserInteraction||(this.cancelClicked(),this.trigger(ue.CONTAINER_DBLCLICK,this,this.name))}},{key:"dblTap",value:function(e){var t=this;this.options.chromeless&&!this.options.allowUserInteraction||this.dblTapHandler.handle(e,(function(){t.cancelClicked(),t.trigger(ue.CONTAINER_DBLCLICK,t,t.name)}))}},{key:"onContextMenu",value:function(e){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(ue.CONTAINER_CONTEXTMENU,e,this.name)}},{key:"seek",value:function(e){this.playback.seek(e)}},{key:"onSeek",value:function(e){this.trigger(ue.CONTAINER_SEEK,e,this.name)}},{key:"onSeeked",value:function(){this.trigger(ue.CONTAINER_SEEKED,this.name)}},{key:"seekPercentage",value:function(e){var t=this.getDuration();if(e>=0&&e<=100){var r=t*(e/100);this.seek(r)}}},{key:"setVolume",value:function(e){this.volume=parseFloat(e),this.trigger(ue.CONTAINER_VOLUME,this.volume,this.name),this.playback.volume(this.volume)}},{key:"fullscreen",value:function(){this.trigger(ue.CONTAINER_FULLSCREEN,this.name)}},{key:"onBuffering",value:function(){this.trigger(ue.CONTAINER_STATE_BUFFERING,this.name)}},{key:"bufferfull",value:function(){this.trigger(ue.CONTAINER_STATE_BUFFERFULL,this.name)}},{key:"onEnterPiP",value:function(){this.trigger(ue.CONTAINER_PIP_ENTER,this.name)}},{key:"onExitPiP",value:function(){this.trigger(ue.CONTAINER_PIP_EXIT,this.name)}},{key:"addPlugin",value:function(e){this.plugins.push(e)}},{key:"hasPlugin",value:function(e){return!!this.getPlugin(e)}},{key:"getPlugin",value:function(e){return this.plugins.filter((function(t){return t.name===e}))[0]}},{key:"mouseEnter",value:function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(ue.CONTAINER_MOUSE_ENTER)}},{key:"mouseLeave",value:function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(ue.CONTAINER_MOUSE_LEAVE)}},{key:"mouseUp",value:function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(ue.CONTAINER_MOUSE_UP)}},{key:"mouseDown",value:function(){this.options.chromeless&&!this.options.allowUserInteraction||this.trigger(ue.CONTAINER_MOUSE_DOWN)}},{key:"enterPiP",value:function(){this.playback.enterPiP()}},{key:"exitPiP",value:function(){this.playback.exitPiP()}},{key:"settingsUpdate",value:function(){this.settings=this.playback.settings,this.trigger(ue.CONTAINER_SETTINGSUPDATE)}},{key:"highDefinitionUpdate",value:function(e){this.trigger(ue.CONTAINER_HIGHDEFINITIONUPDATE,e)}},{key:"isHighDefinitionInUse",value:function(){return this.playback.isHighDefinitionInUse()}},{key:"disableMediaControl",value:function(){this.mediaControlDisabled||(this.mediaControlDisabled=!0,this.trigger(ue.CONTAINER_MEDIACONTROL_DISABLE))}},{key:"enableMediaControl",value:function(){this.mediaControlDisabled&&(this.mediaControlDisabled=!1,this.trigger(ue.CONTAINER_MEDIACONTROL_ENABLE))}},{key:"updateStyle",value:function(){!this.options.chromeless||this.options.allowUserInteraction?this.$el.removeClass("chromeless"):this.$el.addClass("chromeless")}},{key:"enableResizeObserver",value:function(){var e=this;this.disableResizeObserver(),this.resizeObserverInterval=setInterval((function(){return e.checkResize()}),500)}},{key:"disableResizeObserver",value:function(){this.resizeObserverInterval&&clearInterval(this.resizeObserverInterval)}},{key:"checkResize",value:function(){var e={width:this.el.clientWidth,height:this.el.clientHeight},t=this.currentSize||{},r=t.width;(t.height!==e.height||r!==e.width)&&(this.currentSize=e,this.trigger(ue.CONTAINER_RESIZE,e))}},{key:"configure",value:function(e){this._options=S.extend(!0,this._options,e),this.updateStyle(),this.playback.configure(this.options),this.trigger(ue.CONTAINER_OPTIONS_CHANGE)}},{key:"render",value:function(){var e=Ee.getStyleFor(".container[data-container] {\n position: absolute;\n background-color: black;\n height: 100%;\n width: 100%;\n max-width: 100%; }\n .container[data-container] .chromeless {\n cursor: default; }\n\n[data-player]:not(.nocursor) .container[data-container]:not(.chromeless).pointer-enabled {\n cursor: pointer; }\n".toString(),{baseUrl:this.options.baseUrl});return this.$el.append(e[0]),this.$el.append(this.playback.render().el),this.updateStyle(),this.checkResize(),this.enableResizeObserver(),this}}])}(be);Object.assign(Ce.prototype,Se);var Le=function(e){function t(e,r,n){var a;return u(this,t),(a=i(this,t,[e])).settings={},a._i18n=r,a.playerError=n,a._consented=!1,a}return f(t,e),d(t,[{key:"isAudioOnly",get:function(){return!1}},{key:"isAdaptive",get:function(){return!1}},{key:"ended",get:function(){return!1}},{key:"i18n",get:function(){return this._i18n}},{key:"buffering",get:function(){return!1}},{key:"latency",get:function(){return null}},{key:"currentProgramDateTime",get:function(){return null}},{key:"isPiPActive",get:function(){return!1}},{key:"consent",value:function(e){"function"==typeof e&&e()}},{key:"play",value:function(){}},{key:"pause",value:function(){}},{key:"stop",value:function(){}},{key:"enterPiP",value:function(){}},{key:"exitPiP",value:function(){}},{key:"seek",value:function(e){}},{key:"seekPercentage",value:function(e){}},{key:"getStartTimeOffset",value:function(){return 0}},{key:"getDuration",value:function(){return 0}},{key:"isPlaying",value:function(){return!1}},{key:"isReady",get:function(){return!1}},{key:"hasClosedCaptionsTracks",get:function(){return this.closedCaptionsTracks.length>0}},{key:"closedCaptionsTracks",get:function(){return[]}},{key:"closedCaptionsTrackId",get:function(){return-1},set:function(e){}},{key:"audioTracks",get:function(){return[]}},{key:"currentAudioTrack",get:function(){return null}},{key:"switchAudioTrack",value:function(e){}},{key:"getPlaybackType",value:function(){return t.NO_OP}},{key:"isHighDefinitionInUse",value:function(){return!1}},{key:"mute",value:function(){}},{key:"unmute",value:function(){}},{key:"volume",value:function(e){}},{key:"configure",value:function(e){this._options=S.extend(!0,this._options,e)}},{key:"attemptAutoPlay",value:function(){var e=this;this.canAutoPlay((function(t,r){t&&e.play()}))}},{key:"canAutoPlay",value:function(e){e(!0,null)}}])}(be);Object.assign(Le.prototype,Se),Le.extend=function(e){return G(Le,e)},Le.canPlay=function(e,t){return!1},Le.VOD="vod",Le.AOD="aod",Le.LIVE="live",Le.NO_OP="no_op",Le.type="playback";var De=function(e){function t(e,r,n,a){var s;return u(this,t),(s=i(this,t,[e]))._i18n=n,s.loader=r,s.playerError=a,s}return f(t,e),d(t,[{key:"options",get:function(){return this._options},set:function(e){this._options=e}},{key:"createContainers",value:function(){var e=this;return S.Deferred((function(t){t.resolve(e.options.sources.map((function(t){return e.createContainer(t)})))}))}},{key:"findPlaybackPlugin",value:function(e,t){return this.loader.playbackPlugins.filter((function(r){return r.canPlay(e,t)}))[0]}},{key:"createContainer",value:function(e){var t=null,r=this.options.mimeType;"object"===l(e)?(t=e.source.toString(),e.mimeType&&(r=e.mimeType)):t=e.toString(),t.match(/^\/\//)&&(t=window.location.protocol+t);var i=s(s({},this.options),{},{src:t,mimeType:r}),n=this.findPlaybackPlugin(t,r),a=n?new n(i,this._i18n,this.playerError):new Le;i=s(s({},i),{},{playback:a});var o=new Ce(i,this._i18n,this.playerError),u=S.Deferred();return u.promise(o),this.addContainerPlugins(o),this.listenToOnce(o,ue.CONTAINER_READY,(function(){return u.resolve(o)})),o}},{key:"addContainerPlugins",value:function(e){this.loader.containerPlugins.forEach((function(t){e.addPlugin(new t(e))}))}}])}(ce),Ie=function(e){function t(e){var r;return u(this,t),(r=i(this,t,[e])).playerError=new ke(e,r),r.configureDomRecycler(),r.firstResize=!0,r.styleRendered=!1,r.plugins=[],r.containers=[],r._boundFullscreenHandler=function(){return r.handleFullscreenChange()},r._boundHandleWindowResize=function(e){return r.handleWindowResize(e)},S(document).bind("fullscreenchange",r._boundFullscreenHandler),S(document).bind("MSFullscreenChange",r._boundFullscreenHandler),S(document).bind("mozfullscreenchange",r._boundFullscreenHandler),O.isMobile&&S(window).bind("resize",r._boundHandleWindowResize),r}return f(t,e),d(t,[{key:"events",get:function(){return{webkitfullscreenchange:"handleFullscreenChange",mousemove:"onMouseMove",mouseleave:"onMouseLeave"}}},{key:"attributes",get:function(){return{"data-player":"",tabindex:9999}}},{key:"isReady",get:function(){return!!this.ready}},{key:"i18n",get:function(){return this.getPlugin("strings")||{t:function(e){return e}}}},{key:"mediaControl",get:function(){return this._mediaControl||(this._mediaControl=this.getPlugin("media_control"))||this.dummyMediaControl}},{key:"dummyMediaControl",get:function(){return this._dummyMediaControl||(this._dummyMediaControl=new _e(this)),this._dummyMediaControl}},{key:"activeContainer",get:function(){return this._activeContainer},set:function(e){this._activeContainer=e,this.trigger(ue.CORE_ACTIVE_CONTAINER_CHANGED,this._activeContainer)}},{key:"activePlayback",get:function(){return this.activeContainer&&this.activeContainer.playback}},{key:"activePlaybackEl",get:function(){if(this.activePlayback)return this.activePlayback.$el?this.activePlayback.$el.find("video")[0]:this.activePlayback.el}},{key:"configureDomRecycler",value:function(){var e=this.options&&this.options.playback&&this.options.playback.recycleVideo;X.configure({recycleVideo:e})}},{key:"createContainers",value:function(e){this.defer=S.Deferred(),this.defer.promise(this),this.containerFactory=new De(e,e.loader,this.i18n,this.playerError),this.prepareContainers()}},{key:"prepareContainers",value:function(){var e=this;this.containerFactory.createContainers().then((function(t){return e.setupContainers(t)})).then((function(t){return e.resolveOnContainersReady(t)}))}},{key:"updateSize",value:function(){this.isFullscreen()?this.setFullscreen():this.setPlayerSize()}},{key:"setFullscreen",value:function(){O.isiOS||(this.$el.addClass("fullscreen"),this.$el.removeAttr("style"),this.previousSize={width:this.options.width,height:this.options.height},this.currentSize={width:S(window).width(),height:S(window).height()})}},{key:"setPlayerSize",value:function(){this.$el.removeClass("fullscreen"),this.currentSize=this.previousSize,this.previousSize={width:S(window).width(),height:S(window).height()},this.resize(this.currentSize)}},{key:"resize",value:function(e){W(e.height)||W(e.width)?(this.el.style.height="".concat(e.height,"px"),this.el.style.width="".concat(e.width,"px")):(this.el.style.height="".concat(e.height),this.el.style.width="".concat(e.width)),this.previousSize={width:this.options.width,height:this.options.height},this.options.width=e.width,this.options.height=e.height,this.currentSize=e,this.triggerResize(this.currentSize)}},{key:"enableResizeObserver",value:function(){var e=this;this.disableResizeObserver();this.resizeObserverInterval=setInterval((function(){e.triggerResize({width:e.el.clientWidth,height:e.el.clientHeight})}),500)}},{key:"triggerResize",value:function(e){(this.firstResize||this.oldHeight!==e.height||this.oldWidth!==e.width)&&(this.oldHeight=e.height,this.oldWidth=e.width,this.computedSize=e,this.firstResize=!1,this.trigger(ue.CORE_RESIZE,e))}},{key:"disableResizeObserver",value:function(){this.resizeObserverInterval&&clearInterval(this.resizeObserverInterval),this.resizeObserverInterval=null}},{key:"resolveOnContainersReady",value:function(e){var t=this;S.when.apply(S,e).done((function(){t.defer.resolve(t),t.ready=!0,t.trigger(ue.CORE_READY)}))}},{key:"addPlugin",value:function(e){this.plugins.push(e)}},{key:"hasPlugin",value:function(e){return!!this.getPlugin(e)}},{key:"getPlugin",value:function(e){return this.plugins.filter((function(t){return t.name===e}))[0]}},{key:"load",value:function(e,t){this.options.mimeType=t,e=e&&e.constructor===Array?e:[e],this.options.sources=e,this.containers.forEach((function(e){return e.destroy()})),this.containerFactory.options=S.extend(!0,this.options,{sources:e}),this.prepareContainers()}},{key:"destroy",value:function(){this.disableResizeObserver(),this.containers.forEach((function(e){return e.destroy()})),this.plugins.forEach((function(e){return e.destroy()})),this.$el.remove(),S(document).unbind("fullscreenchange",this._boundFullscreenHandler),S(document).unbind("MSFullscreenChange",this._boundFullscreenHandler),S(document).unbind("mozfullscreenchange",this._boundFullscreenHandler),O.isMobile&&S(window).unbind("resize",this._boundHandleWindowResize),this.stopListening(),this.undelegateEvents()}},{key:"handleFullscreenChange",value:function(){this.trigger(ue.CORE_FULLSCREEN,this.isFullscreen()),this.updateSize()}},{key:"handleWindowResize",value:function(e){var t=window.innerWidth>window.innerHeight?"landscape":"portrait";this._screenOrientation!==t&&(this._screenOrientation=t,this.triggerResize({width:this.el.clientWidth,height:this.el.clientHeight}),this.trigger(ue.CORE_SCREEN_ORIENTATION_CHANGED,{event:e,orientation:this._screenOrientation}))}},{key:"removeContainer",value:function(e){this.stopListening(e),this.containerFactory.stopListening(e),this.containers=this.containers.filter((function(t){return t!==e}))}},{key:"setupContainer",value:function(e){this.listenTo(e,ue.CONTAINER_DESTROYED,this.removeContainer),this.containers.push(e)}},{key:"setupContainers",value:function(e){return e.forEach(this.setupContainer.bind(this)),this.trigger(ue.CORE_CONTAINERS_CREATED),this.renderContainers(),this.activeContainer=e[0],this.render(),this.appendToParent(),this.containers}},{key:"renderContainers",value:function(){var e=this;this.containers.forEach((function(t){return e.el.appendChild(t.render().el)}))}},{key:"createContainer",value:function(e,t){var r=this.containerFactory.createContainer(e,t);return this.setupContainer(r),this.el.appendChild(r.render().el),r}},{key:"getCurrentContainer",value:function(){return this.activeContainer}},{key:"getCurrentPlayback",value:function(){return this.activePlayback}},{key:"getPlaybackType",value:function(){return this.activeContainer&&this.activeContainer.getPlaybackType()}},{key:"isFullscreen",value:function(){var e=V.fullscreenElement();return e&&e===this.el||e&&e===this.activePlaybackEl||this.activePlaybackEl&&this.activePlaybackEl.webkitDisplayingFullscreen||!1}},{key:"toggleFullscreen",value:function(){var e=this;if(this.isFullscreen()){var t=O.isiOS?this.activePlaybackEl:document;V.cancelFullscreen(t),!O.isiOS&&this.$el.removeClass("fullscreen nocursor")}else{var r=O.isiOS?this.activePlaybackEl:this.el;if(!r)return;O.isSafari||O.isiOS?V.requestFullscreen(r):V.requestFullscreen(r).then((function(e){return e}),(function(t){return setTimeout((function(){if(!e.isFullscreen())throw new ReferenceError(t)}),600)})),!O.isiOS&&this.$el.addClass("fullscreen")}}},{key:"onMouseMove",value:function(e){this.trigger(ue.CORE_MOUSE_MOVE,e)}},{key:"onMouseLeave",value:function(e){this.trigger(ue.CORE_MOUSE_LEAVE,e)}},{key:"configure",value:function(e){var t=this;this._options=S.extend(!0,this._options,e),this.configureDomRecycler();var r=e.source||e.sources;r&&this.load(r,e.mimeType||this.options.mimeType),this.trigger(ue.CORE_OPTIONS_CHANGE,e),this.containers.forEach((function(e){return e.configure(t.options)}))}},{key:"appendToParent",value:function(){!(this.$el.parent()&&this.$el.parent().length)&&this.$el.appendTo(this.options.parentElement)}},{key:"appendStyles",value:function(){if(!this.styleRendered){var e=Ee.getStyleFor('[data-player] {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -o-user-select: none;\n user-select: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n transform: translate3d(0, 0, 0);\n position: relative;\n margin: 0;\n padding: 0;\n border: 0;\n font-style: normal;\n font-weight: normal;\n text-align: center;\n overflow: hidden;\n font-size: 100%;\n font-family: "Roboto", "Open Sans", Arial, sans-serif;\n text-shadow: 0 0 0;\n box-sizing: border-box; }\n [data-player]:focus {\n outline: 0; }\n [data-player] * {\n box-sizing: inherit; }\n [data-player] > * {\n float: none;\n max-width: none; }\n [data-player] > div {\n display: block; }\n [data-player].fullscreen {\n width: 100% !important;\n height: 100% !important;\n top: 0;\n left: 0; }\n [data-player].nocursor {\n cursor: none; }\n\n.clappr-style {\n display: none !important; }\n'.toString(),{baseUrl:this.options.baseUrl});if(this.$el.append(e[0]),this.options.includeResetStyle){var t=Ee.getStyleFor('[data-player] div, [data-player] span, [data-player] applet, [data-player] object, [data-player] iframe,\n[data-player] h1, [data-player] h2, [data-player] h3, [data-player] h4, [data-player] h5, [data-player] h6, [data-player] p, [data-player] blockquote, [data-player] pre,\n[data-player] a, [data-player] abbr, [data-player] acronym, [data-player] address, [data-player] big, [data-player] cite, [data-player] code,\n[data-player] del, [data-player] dfn, [data-player] em, [data-player] img, [data-player] ins, [data-player] kbd, [data-player] q, [data-player] s, [data-player] samp,\n[data-player] small, [data-player] strike, [data-player] strong, [data-player] sub, [data-player] sup, [data-player] tt, [data-player] var,\n[data-player] b, [data-player] u, [data-player] i, [data-player] center,\n[data-player] dl, [data-player] dt, [data-player] dd, [data-player] ol, [data-player] ul, [data-player] li,\n[data-player] fieldset, [data-player] form, [data-player] label, [data-player] legend,\n[data-player] table, [data-player] caption, [data-player] tbody, [data-player] tfoot, [data-player] thead, [data-player] tr, [data-player] th, [data-player] td,\n[data-player] article, [data-player] aside, [data-player] canvas, [data-player] details, [data-player] embed,\n[data-player] figure, [data-player] figcaption, [data-player] footer, [data-player] header, [data-player] hgroup,\n[data-player] menu, [data-player] nav, [data-player] output, [data-player] ruby, [data-player] section, [data-player] summary,\n[data-player] time, [data-player] mark, [data-player] audio, [data-player] video {\n margin: 0;\n padding: 0;\n border: 0;\n font: inherit;\n font-size: 100%;\n vertical-align: baseline; }\n\n[data-player] table {\n border-collapse: collapse;\n border-spacing: 0; }\n\n[data-player] caption, [data-player] th, [data-player] td {\n text-align: left;\n font-weight: normal;\n vertical-align: middle; }\n\n[data-player] q, [data-player] blockquote {\n quotes: none; }\n [data-player] q:before, [data-player] q:after, [data-player] blockquote:before, [data-player] blockquote:after {\n content: "";\n content: none; }\n\n[data-player] a img {\n border: none; }\n'.toString(),{baseUrl:this.options.baseUrl});this.$el.append(t[0])}this.styleRendered=!0}}},{key:"render",value:function(){this.appendStyles(),this.options.width=this.options.width||this.$el.width(),this.options.height=this.options.height||this.$el.height();var e={width:this.options.width,height:this.options.height};return this.previousSize=this.currentSize=this.computedSize=e,this.updateSize(),this.enableResizeObserver(),this}}])}(be);Object.assign(Ie.prototype,Se);var Re,Oe,we=function(e){function t(e){var r;return u(this,t),(r=i(this,t,[e.options])).player=e,r}return f(t,e),d(t,[{key:"loader",get:function(){return this.player.loader}},{key:"create",value:function(){return this.options.loader=this.loader,this.core=new Ie(this.options),this.addCorePlugins(),this.core.createContainers(this.options),this.core}},{key:"addCorePlugins",value:function(){var e=this;return this.loader.corePlugins.forEach((function(t){var r=new t(e.core);e.core.addPlugin(r),e.setupExternalInterface(r)})),this.core}},{key:"setupExternalInterface",value:function(e){var t=e.getExternalInterface();for(var r in t)this.player[r]=t[r].bind(e)}}])}(ce),Pe=/(\d+)(?:\.(\d+))?(?:\.(\d+))?/,xe=function(){function e(t,r,i){u(this,e),this.major=parseInt(t||0,10),this.minor=parseInt(r||0,10),this.patch=parseInt(i||0,10)}return d(e,[{key:"compare",value:function(e){var t=this.major-e.major;return t=(t=t||this.minor-e.minor)||this.patch-e.patch}},{key:"inc",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"patch";return void 0!==this[e]&&(this[e]+=1),this}},{key:"satisfies",value:function(e,t){return this.compare(e)>=0&&(!t||this.compare(t)<0)}},{key:"toString",value:function(){return"".concat(this.major,".").concat(this.minor,".").concat(this.patch)}}],[{key:"parse",value:function(){var t=m((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").match(Pe)||[],4),r=t[1],i=t[2],n=t[3];return void 0===r?null:new e(r,i,n)}}])}(),Ne=function(e,t){return e&&t?Object.entries(e).filter((function(e){return m(e,2)[1].type===t})).reduce((function(e,t){var r=m(t,2),i=r[0],n=r[1];return e[i]=n,e}),{}):{}},Me=(Re={plugins:{},playbacks:[]},Oe="0.8.0",function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;u(this,e),this.playerId=r,this.playbackPlugins=y(Re.playbacks);var i=e.registeredPlugins,n=i.core,a=i.container;this.containerPlugins=Object.values(a),this.corePlugins=Object.values(n),Array.isArray(t)||this.validateExternalPluginsType(t),this.addExternalPlugins(t)}return d(e,[{key:"groupPluginsByType",value:function(e){return Array.isArray(e)&&(e=e.reduce((function(e,t){return e[t.type]||(e[t.type]=[]),e[t.type].push(t),e}),{})),e}},{key:"removeDups",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.reduceRight((function(e,r){return e[r.prototype.name]&&t||(e[r.prototype.name]&&delete e[r.prototype.name],e[r.prototype.name]=r),e}),Object.create(null)),i=[];for(var n in r)i.unshift(r[n]);return i}},{key:"addExternalPlugins",value:function(t){var r="boolean"!=typeof t.loadExternalPluginsFirst||t.loadExternalPluginsFirst,i="boolean"!=typeof t.loadExternalPlaybacksFirst||t.loadExternalPlaybacksFirst;if((t=this.groupPluginsByType(t)).playback){var n=t.playback.filter((function(t){return e.checkVersionSupport(t),!0}));this.playbackPlugins=i?this.removeDups(n.concat(this.playbackPlugins)):this.removeDups(this.playbackPlugins.concat(n),!0)}if(t.container){var a=t.container.filter((function(t){return e.checkVersionSupport(t),!0}));this.containerPlugins=r?this.removeDups(a.concat(this.containerPlugins)):this.removeDups(this.containerPlugins.concat(a),!0)}if(t.core){var s=t.core.filter((function(t){return e.checkVersionSupport(t),!0}));this.corePlugins=r?this.removeDups(s.concat(this.corePlugins)):this.removeDups(this.corePlugins.concat(s),!0)}}},{key:"validateExternalPluginsType",value:function(e){["playback","container","core"].forEach((function(t){(e[t]||[]).forEach((function(e){var r="external "+e.type+" plugin on "+t+" array";if(e.type!==t)throw new ReferenceError(r)}))}))}}],[{key:"registeredPlaybacks",get:function(){return y(Re.playbacks)}},{key:"registeredPlugins",get:function(){var e=Re.plugins;return{core:Ne(e,"core"),container:Ne(e,"container")}}},{key:"checkVersionSupport",value:function(e){var t=e.prototype,r=t.supportedVersion,i=t.name;if(!r||!r.min)return ne.warn("Loader","missing version information for ".concat(i)),!1;var n=r.max?xe.parse(r.max):xe.parse(r.min).inc("minor"),a=xe.parse(r.min);return!!xe.parse(Oe).satisfies(a,n)||(ne.warn("Loader","unsupported plugin ".concat(i,": Clappr version ").concat(Oe," does not match required range [").concat(a,",").concat(n,")")),!1)}},{key:"registerPlugin",value:function(t){if(!t||!t.prototype.name)return ne.warn("Loader","missing information to register plugin: ".concat(t)),!1;e.checkVersionSupport(t);var r=Re.plugins;if(!r)return!1;var i=r[t.prototype.name];return i&&ne.warn("Loader","overriding plugin entry: ".concat(t.prototype.name," - ").concat(i)),r[t.prototype.name]=t,!0}},{key:"registerPlayback",value:function(t){if(!t||!t.prototype.name)return!1;e.checkVersionSupport(t);var r=Re.playbacks,i=r.findIndex((function(e){return e.prototype.name===t.prototype.name}));if(i>=0){var n=r[i];r.splice(i,1),ne.warn("Loader","overriding playback entry: ".concat(n.name," - ").concat(n))}return Re.playbacks=[t].concat(y(r)),!0}},{key:"unregisterPlugin",value:function(e){if(!e)return!1;var t=Re.plugins;return!!t[e]&&(delete t[e],!0)}},{key:"unregisterPlayback",value:function(e){if(!e)return!1;var t=Re.playbacks,r=t.findIndex((function(t){return t.prototype.name===e}));return!(r<0||(t.splice(r,1),Re.playbacks=t,0))}},{key:"clearPlugins",value:function(){Re.plugins={}}},{key:"clearPlaybacks",value:function(){Re.playbacks=[]}}])}()),Fe=$().replace(/\/[^/]+$/,""),Be=function(e){function t(e){var r;u(this,t),r=i(this,t,[e]);var n={playerId:Y(""),persistConfig:!0,width:640,height:360,baseUrl:Fe,allowUserInteraction:O.isMobile,includeResetStyle:!0,playback:{recycleVideo:!0}};r._options=S.extend(!0,n,e),r.options.sources=r._normalizeSources(e),r.options.chromeless||(r.options.allowUserInteraction=!0),r.options.allowUserInteraction||(r.options.disableKeyboardShortcuts=!0),r._registerOptionEventListeners(r.options.events),r._coreFactory=new we(r);var a=r._getParentElement(r.options);return a&&r.attachTo(a),r}return f(t,e),d(t,[{key:"loader",get:function(){return this._loader||(this._loader=new Me(this.options.plugins||{},this.options.playerId)),this._loader},set:function(e){this._loader=e}},{key:"ended",get:function(){return this.core.activeContainer.ended}},{key:"buffering",get:function(){return this.core.activeContainer.buffering}},{key:"isReady",get:function(){return!!this._ready}},{key:"eventsMapping",get:function(){return{onReady:ue.PLAYER_READY,onResize:ue.PLAYER_RESIZE,onPlay:ue.PLAYER_PLAY,onPause:ue.PLAYER_PAUSE,onStop:ue.PLAYER_STOP,onEnded:ue.PLAYER_ENDED,onSeek:ue.PLAYER_SEEK,onError:ue.PLAYER_ERROR,onTimeUpdate:ue.PLAYER_TIMEUPDATE,onVolumeUpdate:ue.PLAYER_VOLUMEUPDATE,onSubtitleAvailable:ue.PLAYER_SUBTITLE_AVAILABLE}}},{key:"_getParentElement",value:function(e){var t=e.parentId,r=e.parent;return t?document.querySelector(t):r}},{key:"attachTo",value:function(e){return this.options.parentElement=e,this.core=this._coreFactory.create(),this._addEventListeners(),this}},{key:"_addEventListeners",value:function(){return this.core.isReady?this._onReady():this.listenToOnce(this.core,ue.CORE_READY,this._onReady),this.listenTo(this.core,ue.CORE_ACTIVE_CONTAINER_CHANGED,this._containerChanged),this.listenTo(this.core,ue.CORE_FULLSCREEN,this._onFullscreenChange),this.listenTo(this.core,ue.CORE_RESIZE,this._onResize),this}},{key:"_addContainerEventListeners",value:function(){var e=this.core.activeContainer;return e&&(this.listenTo(e,ue.CONTAINER_PLAY,this._onPlay),this.listenTo(e,ue.CONTAINER_PAUSE,this._onPause),this.listenTo(e,ue.CONTAINER_STOP,this._onStop),this.listenTo(e,ue.CONTAINER_ENDED,this._onEnded),this.listenTo(e,ue.CONTAINER_SEEK,this._onSeek),this.listenTo(e,ue.CONTAINER_ERROR,this._onError),this.listenTo(e,ue.CONTAINER_TIMEUPDATE,this._onTimeUpdate),this.listenTo(e,ue.CONTAINER_VOLUME,this._onVolumeUpdate),this.listenTo(e,ue.CONTAINER_SUBTITLE_AVAILABLE,this._onSubtitleAvailable)),this}},{key:"_registerOptionEventListeners",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(t).length>0&&Object.keys(r).forEach((function(t){var i=e.eventsMapping[t];i&&e.off(i,r[t])})),Object.keys(t).forEach((function(r){var i=e.eventsMapping[r];if(i){var n=t[r];(n="function"==typeof n&&n)&&e.on(i,n)}})),this}},{key:"_containerChanged",value:function(){this.stopListening(),this._addEventListeners()}},{key:"_onReady",value:function(){this._ready=!0,this._addContainerEventListeners(),this.trigger(ue.PLAYER_READY)}},{key:"_onFullscreenChange",value:function(e){this.trigger(ue.PLAYER_FULLSCREEN,e)}},{key:"_onVolumeUpdate",value:function(e){this.trigger(ue.PLAYER_VOLUMEUPDATE,e)}},{key:"_onSubtitleAvailable",value:function(){this.trigger(ue.PLAYER_SUBTITLE_AVAILABLE)}},{key:"_onResize",value:function(e){this.trigger(ue.PLAYER_RESIZE,e)}},{key:"_onPlay",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.trigger(ue.PLAYER_PLAY,t)}},{key:"_onPause",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.trigger(ue.PLAYER_PAUSE,t)}},{key:"_onStop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.trigger(ue.PLAYER_STOP,this.getCurrentTime(),e)}},{key:"_onEnded",value:function(){this.trigger(ue.PLAYER_ENDED)}},{key:"_onSeek",value:function(e){this.trigger(ue.PLAYER_SEEK,e)}},{key:"_onTimeUpdate",value:function(e){this.trigger(ue.PLAYER_TIMEUPDATE,e)}},{key:"_onError",value:function(e){this.trigger(ue.PLAYER_ERROR,e)}},{key:"_normalizeSources",value:function(e){var t=e.sources||(void 0!==e.source?[e.source]:[]);return 0===t.length?[{source:"",mimeType:""}]:t}},{key:"resize",value:function(e){return this.core.resize(e),this}},{key:"load",value:function(e,t,r){return void 0!==r&&this.configure({autoPlay:!!r}),this.core.load(e,t),this}},{key:"destroy",value:function(){return this.stopListening(),this.core.destroy(),this}},{key:"consent",value:function(e){this.core.getCurrentPlayback().consent(e)}},{key:"play",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.core.activeContainer.play(e),this}},{key:"pause",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.core.activeContainer.pause(e),this}},{key:"stop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.core.activeContainer.stop(e),this}},{key:"seek",value:function(e){return this.core.activeContainer.seek(e),this}},{key:"seekPercentage",value:function(e){return this.core.activeContainer.seekPercentage(e),this}},{key:"mute",value:function(){return this.core.activePlayback.mute(),this}},{key:"unmute",value:function(){return this.core.activePlayback.unmute(),this}},{key:"isPlaying",value:function(){return this.core.activeContainer.isPlaying()}},{key:"isDvrEnabled",value:function(){return this.core.activeContainer.isDvrEnabled()}},{key:"isDvrInUse",value:function(){return this.core.activeContainer.isDvrInUse()}},{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._registerOptionEventListeners(e.events,this.options.events),this.core.configure(e),this}},{key:"getPlugin",value:function(e){return this.core.plugins.concat(this.core.activeContainer.plugins).filter((function(t){return t.name===e}))[0]}},{key:"getCurrentTime",value:function(){return this.core.activeContainer.getCurrentTime()}},{key:"getStartTimeOffset",value:function(){return this.core.activeContainer.getStartTimeOffset()}},{key:"getDuration",value:function(){return this.core.activeContainer.getDuration()}}])}(ce);Object.assign(Be.prototype,Se);var Ue=function(e){function t(e){var r;return u(this,t),(r=i(this,t,[e.options])).container=e,r.enabled=!0,r.bindEvents(),r}return f(t,e),d(t,[{key:"playerError",get:function(){return this.container.playerError}},{key:"enable",value:function(){this.enabled||(this.bindEvents(),this.enabled=!0)}},{key:"disable",value:function(){this.enabled&&(this.stopListening(),this.enabled=!1)}},{key:"bindEvents",value:function(){}},{key:"destroy",value:function(){this.stopListening()}}])}(ce);Object.assign(Ue.prototype,Se),Ue.extend=function(e){return G(Ue,e)},Ue.type="container";var Ge=function(e){function t(e){var r;return u(this,t),(r=i(this,t,[e.options])).core=e,r.enabled=!0,r.bindEvents(),r}return f(t,e),d(t,[{key:"playerError",get:function(){return this.core.playerError}},{key:"bindEvents",value:function(){}},{key:"enable",value:function(){this.enabled||(this.bindEvents(),this.enabled=!0)}},{key:"disable",value:function(){this.enabled&&(this.stopListening(),this.enabled=!1)}},{key:"getExternalInterface",value:function(){return{}}},{key:"destroy",value:function(){this.stopListening()}}])}(ce);Object.assign(Ge.prototype,Se),Ge.extend=function(e){return G(Ge,e)},Ge.type="core";var Ve=function(e){function t(e){var r;return u(this,t),(r=i(this,t,[e.options])).container=e,r.enabled=!0,r.bindEvents(),r}return f(t,e),d(t,[{key:"playerError",get:function(){return this.container.playerError}},{key:"enable",value:function(){this.enabled||(this.bindEvents(),this.$el.show(),this.enabled=!0)}},{key:"disable",value:function(){this.stopListening(),this.$el.hide(),this.enabled=!1}},{key:"bindEvents",value:function(){}}])}(be);Object.assign(Ve.prototype,Se),Ve.extend=function(e){return G(Ve,e)},Ve.type="container";var Ke={mp4:["avc1.42E01E","avc1.58A01E","avc1.4D401E","avc1.64001E","mp4v.20.8","mp4v.20.240","mp4a.40.2"].map((function(e){return'video/mp4; codecs="'+e+', mp4a.40.2"'})),ogg:['video/ogg; codecs="theora, vorbis"','video/ogg; codecs="dirac"','video/ogg; codecs="theora, speex"'],"3gpp":['video/3gpp; codecs="mp4v.20.8, samr"'],webm:['video/webm; codecs="vp8, vorbis"'],mkv:['video/x-matroska; codecs="theora, vorbis"'],m3u8:["application/x-mpegurl"]};Ke.ogv=Ke.ogg,Ke["3gp"]=Ke["3gpp"];var je={wav:["audio/wav"],mp3:["audio/mp3",'audio/mpeg;codecs="mp3"'],aac:['audio/mp4;codecs="mp4a.40.5"'],oga:["audio/ogg"]},He=Object.keys(je).reduce((function(e,t){return[].concat(y(e),y(je[t]))}),[]),Ye={code:"unknown",message:"unknown"},We=function(e){function t(){var e;u(this,t);for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];(e=i(this,t,[].concat(n)))._destroyed=!1,e._loadStarted=!1,e._isBuffering=!1,e._playheadMoving=!1,e._playheadMovingTimer=null,e._stopped=!1,e._ccTrackId=-1,e._playheadMovingCheckEnabled=!e.options.disablePlayheadMovingCheck,e._setupSrc(e.options.src),e._playheadMovingCheckInterval=e.options.playheadMovingCheckInterval||500,e.options.playback||(e.options.playback=e.options||{}),e.options.playback.disableContextMenu=e.options.playback.disableContextMenu||e.options.disableVideoTagContextMenu,e._minDvrSize=e.isValidMinimumDVRSizeConfig?e.minimumDVRSizeConfig:60;var s,o=e.options.playback,l=o.preload||(O.isSafari?"auto":e.options.preload);return e.options.poster&&("string"==typeof e.options.poster?s=e.options.poster:"string"==typeof e.options.poster.url&&(s=e.options.poster.url)),S.extend(!0,e.el,{muted:e.options.mute,defaultMuted:e.options.mute,loop:e.options.loop,poster:s,preload:l||"metadata",crossOrigin:o.crossOrigin,"x-webkit-playsinline":o.playInline}),(o.controls||e.options.useVideoTagDefaultControls)&&e.$el.attr("controls",""),o.playInline&&e.$el.attr({playsinline:"playsinline"}),o.crossOrigin&&e.$el.attr({crossorigin:o.crossOrigin}),e.settings={default:["seekbar"]},e.settings.left=["playpause","position","duration"],e.settings.right=["fullscreen","volume","hd-indicator"],o.externalTracks&&e._setupExternalTracks(o.externalTracks),e.options.autoPlay&&e.attemptAutoPlay(),e}return f(t,e),d(t,[{key:"name",get:function(){return"html5_video"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"tagName",get:function(){return this.isAudioOnly?"audio":"video"}},{key:"isAudioOnly",get:function(){var e=this.options.src,r=t._mimeTypesForUrl(e,je,this.options.mimeType);return this.options.playback&&this.options.playback.audioOnly||this.options.audioOnly||He.indexOf(r[0])>=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",seeking:"_onSeeking",seeked:"_onSeeked",stalled:"_handleBufferingEvents",timeupdate:"_onTimeUpdate",waiting:"_onWaiting",enterpictureinpicture:"_onEnterPiP",leavepictureinpicture:"_onExitPiP"}}},{key:"ended",get:function(){return this.el.ended}},{key:"buffering",get:function(){return this._isBuffering}},{key:"isPiPActive",get:function(){return this.el===document.pictureInPictureElement}},{key:"isLive",get:function(){return this.getPlaybackType()===Le.LIVE}},{key:"dvrEnabled",get:function(){return this.getDuration()>=this._minDvrSize&&this.isLive}},{key:"minimumDVRSizeConfig",get:function(){return this.options.playback&&this.options.playback.minimumDvrSize}},{key:"isValidMinimumDVRSizeConfig",get:function(){return void 0!==this.minimumDVRSizeConfig&&"number"==typeof this.minimumDVRSizeConfig}},{key:"sourceMedia",get:function(){return this._src}},{key:"configure",value:function(e){v(p(t.prototype),"configure",this).call(this,e),this.el.loop=!!e.loop}},{key:"attemptAutoPlay",value:function(){var e=this;this.canAutoPlay((function(t,r){r&&ne.warn(e.name,"autoplay error.",{result:t,error:r}),t&&setTimeout((function(){return!e._destroyed&&e.play()}),0)}))}},{key:"canAutoPlay",value:function(e){if(this.options.disableCanAutoPlay)e(!0,null);else{var t={timeout:this.options.autoPlayTimeout||500,inline:this.options.playback.playInline||!1,muted:this.options.mute||!1};O.isMobile&&X.options.recycleVideo&&(t.element=this.el),q(e,t)}}},{key:"_setupExternalTracks",value:function(e){this._externalTracks=e.map((function(e){return{kind:e.kind||"subtitles",label:e.label,lang:e.lang,src:e.src}}))}},{key:"load",value:function(e){this._setupSrc(e)}},{key:"_setupSrc",value:function(e){this.el.src!==e&&(this._ccIsSetup=!1,this.el.src=e,this._src=this.el.src)}},{key:"_onLoadedMetadata",value:function(e){this._handleBufferingEvents(),this.trigger(ue.PLAYBACK_LOADEDMETADATA,{duration:e.target.duration,data:e}),this._updateSettings();var t=void 0===this._options.autoSeekFromUrl||this._options.autoSeekFromUrl;this.getPlaybackType()!==Le.LIVE&&t&&this._checkInitialSeek()}},{key:"_onDurationChange",value:function(){this._updateSettings(),this._onTimeUpdate(),this._onProgress()}},{key:"_updateSettings",value:function(){this.getPlaybackType()===Le.VOD||this.getPlaybackType()===Le.AOD?this.settings.left=["playpause","position","duration"]:this.settings.left=["playstop"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(ue.PLAYBACK_SETTINGSUPDATE)}},{key:"isSeekEnabled",value:function(){return isFinite(this.getDuration())}},{key:"getPlaybackType",value:function(){var e="audio"===this.tagName?Le.AOD:Le.VOD;return[0,void 0,1/0].indexOf(this.el.duration)>=0?Le.LIVE:e}},{key:"isHighDefinitionInUse",value:function(){return!1}},{key:"consent",value:function(e){var r=this;if(this.isPlaying()||this.el._consented)v(p(t.prototype),"consent",this).call(this,e);else{var i=function i(){r.el.removeEventListener("loadedmetadata",i,!1),r.el.removeEventListener("error",i,!1),r.el._consented=!0,v(p(t.prototype),"consent",r).call(r,e)};this.el.addEventListener("loadedmetadata",i,!1),this.el.addEventListener("error",i,!1),this.el.load()}}},{key:"play",value:function(){var e=this;this.trigger(ue.PLAYBACK_PLAY_INTENT),this._stopped=!1,this._setupSrc(this._src),this._handleBufferingEvents();var t=this.el.play();return t&&t.catch&&t.catch((function(t){return ne.warn(e.name,"HTML5 play failed",t)})),t}},{key:"pause",value:function(){this.el.pause(),this.dvrEnabled&&this._updateDvr(!0)}},{key:"stop",value:function(){this.pause(),this._stopped=!0,this.el.removeAttribute("src"),this.el.load(),this._stopPlayheadMovingChecks(),this._handleBufferingEvents(),this.trigger(ue.PLAYBACK_STOP)}},{key:"volume",value:function(e){0===e?(this.$el.attr({muted:"true"}),this.el.muted=!0):(this.$el.attr({muted:null}),this.el.muted=!1,this.el.volume=e/100)}},{key:"mute",value:function(){this.el.muted=!0}},{key:"unmute",value:function(){this.el.muted=!1}},{key:"isMuted",value:function(){return!0===this.el.muted||0===this.el.volume}},{key:"isPlaying",value:function(){return!this.el.paused&&!this.el.ended}},{key:"isReady",get:function(){return this._isReadyState}},{key:"_startPlayheadMovingChecks",value:function(){null===this._playheadMovingTimer&&this._playheadMovingCheckEnabled&&(this._playheadMovingTimeOnCheck=null,this._determineIfPlayheadMoving(),this._playheadMovingTimer=setInterval(this._determineIfPlayheadMoving.bind(this),this._playheadMovingCheckInterval))}},{key:"_stopPlayheadMovingChecks",value:function(){null!==this._playheadMovingTimer&&(clearInterval(this._playheadMovingTimer),this._playheadMovingTimer=null,this._playheadMoving=!1)}},{key:"_determineIfPlayheadMoving",value:function(){var e=this._playheadMovingTimeOnCheck,t=this.el.currentTime;this._playheadMoving=e!==t,this._playheadMovingTimeOnCheck=t,this._handleBufferingEvents()}},{key:"_onWaiting",value:function(){this._loadStarted=!0,this._handleBufferingEvents()}},{key:"_onLoadedData",value:function(){this._loadStarted=!0,this._handleBufferingEvents()}},{key:"_onCanPlay",value:function(){this._handleBufferingEvents()}},{key:"_onPlaying",value:function(){this._checkForClosedCaptions(),this._startPlayheadMovingChecks(),this._handleBufferingEvents(),this.trigger(ue.PLAYBACK_PLAY)}},{key:"_onPause",value:function(){this._stopPlayheadMovingChecks(),this._handleBufferingEvents(),this.trigger(ue.PLAYBACK_PAUSE)}},{key:"_onSeeking",value:function(){this.trigger(ue.PLAYBACK_SEEK,this.getCurrentTime()),this._handleBufferingEvents()}},{key:"_onSeeked",value:function(){this._handleBufferingEvents(),this.trigger(ue.PLAYBACK_SEEKED)}},{key:"_onEnded",value:function(){this._handleBufferingEvents(),this.trigger(ue.PLAYBACK_ENDED,this.name)}},{key:"_onEnterPiP",value:function(){this.trigger(ue.PLAYBACK_PIP_ENTER,this.name)}},{key:"_onExitPiP",value:function(){this.trigger(ue.PLAYBACK_PIP_EXIT,this.name)}},{key:"enterPiP",value:function(){var e=this;this.el.requestPictureInPicture().then((function(){ne.info(e.name,"enter PIP success")})).catch((function(t){ne.warn(e.name,"enter PIP failed",t)}))}},{key:"exitPiP",value:function(){var e=this;document.exitPictureInPicture().then((function(){ne.info(e.name,"exit PIP success")})).catch((function(t){ne.warn(e.name,"exit PIP failed",t)}))}},{key:"_handleBufferingEvents",value:function(){var e=this._loadStarted&&!this.el.ended&&!this._stopped,t=this.el.readyState<this.el.HAVE_FUTURE_DATA,r=!this.el.ended&&!this.el.paused&&!this._playheadMoving,i=e&&t;this._playheadMovingCheckEnabled&&(i=i||e&&r),this._isBuffering!==i&&(this._isBuffering=i,i?this.trigger(ue.PLAYBACK_BUFFERING,this.name):this.trigger(ue.PLAYBACK_BUFFERFULL,this.name))}},{key:"_onError",value:function(){var e=this.el.error||Ye,t=e.code,r=e.message,i=t===Ye.code,n=this.createError({code:t,description:r,raw:this.el.error,level:i?ke.Levels.WARN:ke.Levels.FATAL});i?ne.warn(this.name,"HTML5 unknown error: ",n):this.trigger(ue.PLAYBACK_ERROR,n)}},{key:"destroy",value:function(){this._destroyed=!0,this._stopPlayheadMovingChecks(),this.handleTextTrackChange&&this.el.textTracks.removeEventListener("change",this.handleTextTrackChange),this.$el.off("contextmenu"),v(p(t.prototype),"destroy",this).call(this),this.el.removeAttribute("src"),this.el.load(),this._src=null,X.garbage(this.el)}},{key:"_updateDvr",value:function(e){this.trigger(ue.PLAYBACK_DVR,e),this.trigger(ue.PLAYBACK_STATS_ADD,{dvr:e})}},{key:"seek",value:function(e){e<0&&(ne.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(e<this.getDuration()-3),e+=this.el.seekable.start(0),this.el.currentTime=e}},{key:"seekPercentage",value:function(e){var t=this.el.duration*(e/100);this.seek(t)}},{key:"_checkInitialSeek",value:function(){var e=H();0!==e&&this.seek(e)}},{key:"getCurrentTime",value:function(){return this.el.currentTime}},{key:"getDuration",value:function(){if(this.isLive){if(this.el.seekable.length>0)return this.el.seekable.end(0)-this.el.seekable.start(0);this._scheduleUpdateSettingsCheck()}return this.el.duration}},{key:"_scheduleUpdateSettingsCheck",value:function(){var e=this;this._updateSettingsCheckInFlight||(this._updateSettingsCheckInFlight=setTimeout((function(){e._updateSettings(),e._updateSettingsCheckInFlight=null}),1e3))}},{key:"_onTimeUpdate",value:function(){var e=this.isLive?this.getDuration():this.el.duration;this.trigger(ue.PLAYBACK_TIMEUPDATE,{current:this.el.currentTime,total:e},this.name)}},{key:"_onProgress",value:function(){if(this.el.buffered.length){for(var e=[],t=0,r=0;r<this.el.buffered.length;r++)e=[].concat(y(e),[{start:this.el.buffered.start(r),end:this.el.buffered.end(r)}]),this.el.currentTime>=e[r].start&&this.el.currentTime<=e[r].end&&(t=r);var i={start:e[t].start,current:e[t].end,total:this.el.duration};this.trigger(ue.PLAYBACK_PROGRESS,i,e)}}},{key:"_typeFor",value:function(e){var r=t._mimeTypesForUrl(e,Ke,this.options.mimeType);return 0===r.length&&(r=t._mimeTypesForUrl(e,je,this.options.mimeType)),(r[0]||"").split(";")[0]}},{key:"_ready",value:function(){this._isReadyState||(this._isReadyState=!0,this.trigger(ue.PLAYBACK_READY,this.name))}},{key:"_checkForClosedCaptions",value:function(){if(this.isHTML5Video&&!this._ccIsSetup){if(this.hasClosedCaptionsTracks){this.trigger(ue.PLAYBACK_SUBTITLE_AVAILABLE);var e=this.closedCaptionsTrackId;this.closedCaptionsTrackId=e,this.handleTextTrackChange=this._handleTextTrackChange.bind(this),this.el.textTracks.addEventListener("change",this.handleTextTrackChange)}this._ccIsSetup=!0}}},{key:"_handleTextTrackChange",value:function(){var e=this.closedCaptionsTracks.find((function(e){return"showing"===e.track.mode}))||{id:-1};this._ccTrackId!==e.id&&(this._ccTrackId=e.id,this.trigger(ue.PLAYBACK_SUBTITLE_CHANGED,{id:e.id}))}},{key:"isHTML5Video",get:function(){return this.name===t.prototype.name}},{key:"closedCaptionsTracks",get:function(){var e=0;return(this.el.textTracks?Array.from(this.el.textTracks):[]).filter((function(e){return"subtitles"===e.kind||"captions"===e.kind})).map((function(t){return{id:e++,name:t.label,track:t}}))}},{key:"closedCaptionsTrackId",get:function(){return this._ccTrackId},set:function(e){if(W(e)){var t,r=this.closedCaptionsTracks;if(-1!==e){if(!(t=r.find((function(t){return t.id===e}))))return;if("showing"===t.track.mode)return}r.filter((function(e){return"hidden"!==e.track.mode})).forEach((function(e){return e.track.mode="hidden"})),t&&(t.track.mode="showing"),this._ccTrackId=e,this.trigger(ue.PLAYBACK_SUBTITLE_CHANGED,{id:e})}}},{key:"template",get:function(){return Ae('<% for (var i = 0; i < tracks.length; i++) { %>\n <track data-html5-video-track="<%= i %>" kind="<%= tracks[i].kind %>" label="<%= tracks[i].label %>" srclang="<%= tracks[i].lang %>" src="<%= tracks[i].src %>">\n<% }; %>\n')}},{key:"render",value:function(){this.options.playback.disableContextMenu&&this.$el.on("contextmenu",(function(){return!1})),this._externalTracks&&this._externalTracks.length>0&&this.$el.html(this.template({tracks:this._externalTracks})),this._ready();var e=Ee.getStyleFor("[data-html5-video] {\n position: absolute;\n height: 100%;\n width: 100%;\n display: block; }\n".toString(),{baseUrl:this.options.baseUrl});return this.$el.append(e[0]),this}}])}(Le);We._mimeTypesForUrl=function(){var e=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0,r=((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split("?")[0].match(/.*\.(.*)$/)||[])[1],i=t||r&&e[r.toLowerCase()]||[];return i.constructor===Array?i:[i]},We._canPlay=function(e,t,r,i){var n=We._mimeTypesForUrl(r,t,i),a=document.createElement(e);return!!n.filter((function(e){return!!a.canPlayType(e).replace(/no/,"")}))[0]},We.canPlay=function(e,t){return We._canPlay("audio",je,e,t)||We._canPlay("video",Ke,e,t)};var $e=function(e){function t(){return u(this,t),i(this,t,arguments)}return f(t,e),d(t,[{key:"name",get:function(){return"html5_audio"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"tagName",get:function(){return"audio"}},{key:"isAudioOnly",get:function(){return!0}},{key:"updateSettings",value:function(){this.settings.left=["playpause","position","duration"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(ue.PLAYBACK_SETTINGSUPDATE)}},{key:"getPlaybackType",value:function(){return Le.AOD}}])}(We);$e.canPlay=function(e,t){return We._canPlay("audio",{wav:["audio/wav"],mp3:["audio/mp3",'audio/mpeg;codecs="mp3"'],aac:['audio/mp4;codecs="mp4a.40.5"'],oga:["audio/ogg"]},e,t)};var ze=function(e){function t(e){var r;return u(this,t),(r=i(this,t,[e])).el.src=e.src,r}return f(t,e),d(t,[{key:"name",get:function(){return"html_img"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"tagName",get:function(){return"img"}},{key:"attributes",get:function(){return{"data-html-img":""}}},{key:"events",get:function(){return{load:"_onLoad",abort:"_onError",error:"_onError"}}},{key:"getPlaybackType",value:function(){return Le.NO_OP}},{key:"render",value:function(){var e=Ee.getStyleFor("[data-html-img] {\n max-width: 100%;\n max-height: 100%; }\n".toString(),{baseUrl:this.options.baseUrl});return this.$el.append(e[0]),this.trigger(ue.PLAYBACK_READY,this.name),this}},{key:"_onLoad",value:function(){this.trigger(ue.PLAYBACK_ENDED,this.name)}},{key:"_onError",value:function(e){var t="error"===e.type?"load error":"loading aborted";this.trigger(ue.PLAYBACK_ERROR,{message:t},this.name)}}])}(Le);ze.canPlay=function(e){return/\.(png|jpg|jpeg|gif|bmp|tiff|pgm|pnm|webp)(|\?.*)$/i.test(e)};var qe=function(e){function t(){var e;u(this,t);for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return(e=i(this,t,[].concat(n)))._noiseFrameNum=-1,e}return f(t,e),d(t,[{key:"name",get:function(){return"no_op"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"template",get:function(){return Ae("<canvas data-no-op-canvas></canvas>\n<p data-no-op-msg><%=message%></p><p>\n</p>")}},{key:"attributes",get:function(){return{"data-no-op":""}}},{key:"render",value:function(){var e=this.options.playbackNotSupportedMessage||this.i18n.t("playback_not_supported"),t=Ee.getStyleFor("[data-no-op] {\n position: absolute;\n height: 100%;\n width: 100%;\n text-align: center; }\n\n[data-no-op] p[data-no-op-msg] {\n position: absolute;\n text-align: center;\n font-size: 25px;\n left: 0;\n right: 0;\n color: white;\n padding: 10px;\n /* center vertically */\n top: 50%;\n transform: translateY(-50%);\n max-height: 100%;\n overflow: auto; }\n\n[data-no-op] canvas[data-no-op-canvas] {\n background-color: #777;\n height: 100%;\n width: 100%; }\n".toString(),{baseUrl:this.options.baseUrl});this.$el.append(t[0]),this.$el.html(this.template({message:e})),this.trigger(ue.PLAYBACK_READY,this.name);var r=!(!this.options.poster||!this.options.poster.showForNoOp);return!this.options.autoPlay&&r||this._animate(),this}},{key:"_noise",value:function(){if(this._noiseFrameNum=(this._noiseFrameNum+1)%5,!this._noiseFrameNum){var e,t=this.context.createImageData(this.context.canvas.width,this.context.canvas.height);try{e=new Uint32Array(t.data.buffer)}catch(n){e=new Uint32Array(this.context.canvas.width*this.context.canvas.height*4);for(var r=t.data,i=0;i<r.length;i++)e[i]=r[i]}for(var n=e.length,a=6*Math.random()+4,s=0,o=0,l=0;l<n;){if(s<0)s=a*Math.random(),o=255*Math.pow(Math.random(),.4)<<24;s-=1,e[l++]=o}this.context.putImageData(t,0,0)}}},{key:"_loop",value:function(){var e=this;this._stop||(this._noise(),this._animationHandle=F((function(){return e._loop()})))}},{key:"destroy",value:function(){this._animationHandle&&(B(this._animationHandle),this._stop=!0)}},{key:"_animate",value:function(){this.canvas=this.$el.find("canvas[data-no-op-canvas]")[0],this.context=this.canvas.getContext("2d"),this._loop()}}])}(Le);qe.canPlay=function(e){return!0};var Xe=function(e){function t(e){var r;return u(this,t),(r=i(this,t,[e]))._initializeMessages(),r}return f(t,e),d(t,[{key:"name",get:function(){return"strings"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"t",value:function(e){var t=this._language(),r=this._messages.en;return(t&&this._messages[t]||r)[e]||r[e]||e}},{key:"_language",value:function(){return this.core.options.language||z()}},{key:"_initializeMessages",value:function(){this._messages=S.extend(!0,{en:{live:"live",back_to_live:"back to live",disabled:"Disabled",playback_not_supported:"Your browser does not support the playback of this video. Please try using a different browser.",default_error_title:"Could not play video.",default_error_message:"There was a problem trying to load the video."},de:{live:"Live",back_to_live:"Zurück zum Live-Video",disabled:"Deaktiviert",playback_not_supported:"Ihr Browser unterstützt das Playback Verfahren nicht. Bitte vesuchen Sie es mit einem anderen Browser.",default_error_title:"Video kann nicht abgespielt werden",default_error_message:"Es gab ein Problem beim Laden des Videos"},pt:{live:"ao vivo",back_to_live:"voltar para o ao vivo",disabled:"Desativado",playback_not_supported:"Seu navegador não suporta a reprodução deste video. Por favor, tente usar um navegador diferente.",default_error_title:"Não foi possível reproduzir o vídeo.",default_error_message:"Ocorreu um problema ao tentar carregar o vídeo."},es_am:{live:"vivo",back_to_live:"volver en vivo",disabled:"No disponible",playback_not_supported:"Su navegador no soporta la reproducción de este video. Por favor, utilice un navegador diferente.",default_error_title:"No se puede reproducir el video.",default_error_message:"Se ha producido un error al cargar el video."},es:{live:"en directo",back_to_live:"volver al directo",disabled:"No disponible",playback_not_supported:"Este navegador no es compatible para reproducir este vídeo. Utilice un navegador diferente.",default_error_title:"No se puede reproducir el vídeo.",default_error_message:"Se ha producido un problema al cargar el vídeo."},ru:{live:"прямой эфир",back_to_live:"к прямому эфиру",disabled:"Отключено",playback_not_supported:"Ваш браузер не поддерживает воспроизведение этого видео. Пожалуйста, попробуйте другой браузер."},bg:{live:"на живо",back_to_live:"Върни на живо",disabled:"Изключено",playback_not_supported:"Вашият браузър не поддържа възпроизвеждането на това видео. Моля, пробвайте с друг браузър.",default_error_title:"Видеото не може да се възпроизведе.",default_error_message:"Възникна проблем при зареждането на видеото."},fr:{live:"en direct",back_to_live:"retour au direct",disabled:"Désactivé",playback_not_supported:"Votre navigateur ne supporte pas la lecture de cette vidéo. Merci de tenter sur un autre navigateur.",default_error_title:"Impossible de lire la vidéo.",default_error_message:"Un problème est survenu lors du chargement de la vidéo."},tr:{live:"canlı",back_to_live:"canlı yayına dön",disabled:"Engelli",playback_not_supported:"Tarayıcınız bu videoyu oynatma desteğine sahip değil. Lütfen farklı bir tarayıcı ile deneyin."},et:{live:"Otseülekanne",back_to_live:"Tagasi otseülekande juurde",disabled:"Keelatud",playback_not_supported:"Teie brauser ei toeta selle video taasesitust. Proovige kasutada muud brauserit."},ar:{live:"مباشر",back_to_live:"الرجوع إلى المباشر",disabled:"معطّل",playback_not_supported:"المتصفح الذي تستخدمه لا يدعم تشغيل هذا الفيديو. الرجاء إستخدام متصفح آخر.",default_error_title:"غير قادر الى التشغيل.",default_error_message:"حدثت مشكلة أثناء تحميل الفيديو."},zh:{live:"直播",back_to_live:"返回直播",disabled:"已禁用",playback_not_supported:"您的浏览器不支持该视频的播放。请尝试使用另一个浏览器。",default_error_title:"无法播放视频。",default_error_message:"在尝试加载视频时出现了问题。"}},this.core.options.strings||{}),this._messages["de-DE"]=this._messages.de,this._messages["pt-BR"]=this._messages.pt,this._messages["en-US"]=this._messages.en,this._messages["bg-BG"]=this._messages.bg,this._messages["es-419"]=this._messages.es_am,this._messages["es-ES"]=this._messages.es,this._messages["fr-FR"]=this._messages.fr,this._messages["tr-TR"]=this._messages.tr,this._messages["et-EE"]=this._messages.et,this._messages["ar-IQ"]=this._messages.ar,this._messages["zh-CN"]=this._messages.zh}}])}(Ge),Ze=function(e){function t(){return u(this,t),i(this,t,arguments)}return f(t,e),d(t,[{key:"name",get:function(){return"sources"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"bindEvents",value:function(){this.listenTo(this.core,ue.CORE_CONTAINERS_CREATED,this.onContainersCreated)}},{key:"onContainersCreated",value:function(){var e=this.core.containers.filter((function(e){return"no_op"!==e.playback.name}))[0]||this.core.containers[0];e&&this.core.containers.forEach((function(t){t!==e&&t.destroy()}))}}])}(Ge);Me.registerPlugin(Xe),Me.registerPlugin(Ze),Me.registerPlayback(qe),Me.registerPlayback(ze),Me.registerPlayback($e),Me.registerPlayback(We);var Qe={Player:Be,Events:ue,Browser:O,ContainerPlugin:Ue,UIContainerPlugin:Ve,CorePlugin:Ge,UICorePlugin:_e,Playback:Le,Container:Ce,Core:Ie,PlayerError:ke,Loader:Me,BaseObject:ce,UIObject:be,Utils:Q,HTML5Audio:$e,HTML5Video:We,HTMLImg:ze,Log:ne,Styler:Ee,version:"0.8.0",template:Ae,$:S};function Je(e,t,r){return t=st(t),lt(e,et()?Reflect.construct(t,r||[],st(e).constructor):t.apply(e,r))}function et(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(et=function(){return!!e})()}function tt(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function rt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function it(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,tt(i.key),i)}}function nt(e,t,r){return t&&it(e.prototype,t),r&&it(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function at(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ot(e,t)}function st(e){return st=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},st(e)}function ot(e,t){return ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ot(e,t)}function lt(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ut(){return ut="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=st(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},ut.apply(this,arguments)}var ct=function(e){function t(e){return rt(this,t),Je(this,t,[e])}return at(t,e),nt(t,[{key:"name",get:function(){return"click_to_pause"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"config",get:function(){return this.container.options.clickToPauseConfig||{}}},{key:"bindEvents",value:function(){this.listenTo(this.container,ue.CONTAINER_CLICK,this.click),this.listenTo(this.container,ue.CONTAINER_SETTINGSUPDATE,this.settingsUpdate)}},{key:"click",value:function(){var e=this.config.onClickPayload;(this.container.getPlaybackType()!==Le.LIVE||this.container.isDvrEnabled())&&(this.container.isPlaying()?this.container.pause(e):this.container.play(e))}},{key:"settingsUpdate",value:function(){var e=this.container.getPlaybackType()!==Le.LIVE||this.container.isDvrEnabled();if(e!==this.pointerEnabled){var t=e?"addClass":"removeClass";this.container.$el[t]("pointer-enabled"),this.pointerEnabled=e}}}])}(Ue),dt=function(e){function t(e){var r;rt(this,t),r=Je(this,t,[e]);var i=e.options.closedCaptionsConfig;return r._title=i&&i.title?i.title:null,r._ariaLabel=i&&i.ariaLabel?i.ariaLabel:"cc-button",r._labelCb=i&&i.labelCallback&&"function"==typeof i.labelCallback?i.labelCallback:function(e){return e.name},r}return at(t,e),nt(t,[{key:"name",get:function(){return"closed_captions"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"template",get:function(){return Ae('<button type="button" class="cc-button media-control-button media-control-icon" data-cc-button aria-label="<%= ariaLabel %>"></button>\n<ul>\n <% if (title) { %>\n <li data-title><%= title %></li>\n <% }; %>\n <li><a href="#" data-cc-select="-1"><%= disabledLabel %></a></li>\n <% for (var i = 0; i < tracks.length; i++) { %>\n <li><a href="#" data-cc-select="<%= tracks[i].id %>"><%= tracks[i].label %></a></li>\n <% }; %>\n</ul>\n')}},{key:"events",get:function(){return{"click [data-cc-button]":"toggleContextMenu","click [data-cc-select]":"onTrackSelect"}}},{key:"attributes",get:function(){return{class:"cc-controls","data-cc-controls":""}}},{key:"bindEvents",value:function(){this.listenTo(this.core,ue.CORE_ACTIVE_CONTAINER_CHANGED,this.containerChanged),this.listenTo(this.core.mediaControl,ue.MEDIACONTROL_RENDERED,this.render),this.listenTo(this.core.mediaControl,ue.MEDIACONTROL_HIDE,this.hideContextMenu),this.bindContainerEvents()}},{key:"bindContainerEvents",value:function(){this.container=this.core.activeContainer,this.container&&(this.listenTo(this.container,ue.CONTAINER_SUBTITLE_AVAILABLE,this.onSubtitleAvailable),this.listenTo(this.container,ue.CONTAINER_SUBTITLE_CHANGED,this.onSubtitleChanged),this.listenTo(this.container,ue.CONTAINER_STOP,this.onContainerStop))}},{key:"onContainerStop",value:function(){this.ccAvailable(!1)}},{key:"containerChanged",value:function(){this.ccAvailable(!1),this.stopListening(),this.bindEvents()}},{key:"onSubtitleAvailable",value:function(){this.renderCcButton(),this.ccAvailable(!0)}},{key:"onSubtitleChanged",value:function(e){this.setCurrentContextMenuElement(e.id)}},{key:"onTrackSelect",value:function(e){var t=parseInt(e.target.dataset.ccSelect,10);return this.container.closedCaptionsTrackId=t,this.hideContextMenu(),e.stopPropagation(),!1}},{key:"ccAvailable",value:function(e){var t=e?"addClass":"removeClass";this.$el[t]("available")}},{key:"toggleContextMenu",value:function(){this.$el.find("ul").toggle()}},{key:"hideContextMenu",value:function(){this.$el.find("ul").hide()}},{key:"contextMenuElement",value:function(e){return this.$el.find("ul a"+(isNaN(e)?"":'[data-cc-select="'+e+'"]')).parent()}},{key:"setCurrentContextMenuElement",value:function(e){if(this._trackId!==e){this.contextMenuElement().removeClass("current"),this.contextMenuElement(e).addClass("current");var t=e>-1?"addClass":"removeClass";this.$ccButton[t]("enabled"),this._trackId=e}}},{key:"renderCcButton",value:function(){for(var e=this.container?this.container.closedCaptionsTracks:[],t=0;t<e.length;t++)e[t].label=this._labelCb(e[t]);var r=Ee.getStyleFor(".cc-controls[data-cc-controls] {\n float: right;\n position: relative;\n display: none; }\n .cc-controls[data-cc-controls].available {\n display: block; }\n .cc-controls[data-cc-controls] .cc-button {\n padding: 6px !important; }\n .cc-controls[data-cc-controls] .cc-button.enabled {\n display: block;\n opacity: 1.0; }\n .cc-controls[data-cc-controls] .cc-button.enabled:hover {\n opacity: 1.0;\n text-shadow: none; }\n .cc-controls[data-cc-controls] > ul {\n list-style-type: none;\n position: absolute;\n bottom: 25px;\n border: 1px solid black;\n display: none;\n background-color: #e6e6e6; }\n .cc-controls[data-cc-controls] li {\n font-size: 10px; }\n .cc-controls[data-cc-controls] li[data-title] {\n background-color: #c3c2c2;\n padding: 5px; }\n .cc-controls[data-cc-controls] li a {\n color: #444;\n padding: 2px 10px;\n display: block;\n text-decoration: none; }\n .cc-controls[data-cc-controls] li a:hover {\n background-color: #555;\n color: white; }\n .cc-controls[data-cc-controls] li a:hover a {\n color: white;\n text-decoration: none; }\n .cc-controls[data-cc-controls] li.current a {\n color: #f00; }\n",{baseUrl:this.options.baseUrl});this.$el.html(this.template({ariaLabel:this._ariaLabel,disabledLabel:this.core.i18n.t("disabled"),title:this._title,tracks:e})),this.$ccButton=this.$el.find("button.cc-button[data-cc-button]"),this.$ccButton.append('<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 49 41.8" style="enable-background:new 0 0 49 41.8;" xml:space="preserve">\n<path d="M47.1,0H3.2C1.6,0,0,1.2,0,2.8v31.5C0,35.9,1.6,37,3.2,37h11.9l3.2,1.9l4.7,2.7c0.9,0.5,2-0.1,2-1.1V37h22.1\n\tc1.6,0,1.9-1.1,1.9-2.7V2.8C49,1.2,48.7,0,47.1,0z M7.2,18.6c0-4.8,3.5-9.3,9.9-9.3c4.8,0,7.1,2.7,7.1,2.7l-2.5,4\n\tc0,0-1.7-1.7-4.2-1.7c-2.8,0-4.3,2.1-4.3,4.3c0,2.1,1.5,4.4,4.5,4.4c2.5,0,4.9-2.1,4.9-2.1l2.2,4.2c0,0-2.7,2.9-7.6,2.9\n\tC10.8,27.9,7.2,23.5,7.2,18.6z M36.9,27.9c-6.4,0-9.9-4.4-9.9-9.3c0-4.8,3.5-9.3,9.9-9.3C41.7,9.3,44,12,44,12l-2.5,4\n\tc0,0-1.7-1.7-4.2-1.7c-2.8,0-4.3,2.1-4.3,4.3c0,2.1,1.5,4.4,4.5,4.4c2.5,0,4.9-2.1,4.9-2.1l2.2,4.2C44.5,25,41.9,27.9,36.9,27.9z"/>\n</svg>'),this.$el.append(r[0])}},{key:"render",value:function(){this.renderCcButton();var e=this.core.mediaControl.$el.find("button[data-fullscreen]");return e[0]?this.$el.insertAfter(e):this.core.mediaControl.$el.find(".media-control-right-panel[data-media-control]").prepend(this.$el),this}}])}(_e),ht=function(e){function t(e){var r;return rt(this,t),(r=Je(this,t,[e])).settingsUpdate(),r}return at(t,e),nt(t,[{key:"template",get:function(){return Ae('<div class="live-info"><%= live %></div>\n<button type="button" class="live-button" aria-label="<%= backToLive %>"><%= backToLive %></button>\n')}},{key:"name",get:function(){return"dvr_controls"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"events",get:function(){return{"click .live-button":"click"}}},{key:"attributes",get:function(){return{class:"dvr-controls","data-dvr-controls":""}}},{key:"bindEvents",value:function(){this.bindCoreEvents(),this.bindContainerEvents()}},{key:"bindCoreEvents",value:function(){var e=this;this.core.mediaControl.settings?(this.listenTo(this.core.mediaControl,ue.MEDIACONTROL_CONTAINERCHANGED,this.containerChanged),this.listenTo(this.core.mediaControl,ue.MEDIACONTROL_RENDERED,this.settingsUpdate),this.listenTo(this.core,ue.CORE_OPTIONS_CHANGE,this.render)):setTimeout((function(){return e.bindCoreEvents()}),100)}},{key:"bindContainerEvents",value:function(){this.core.activeContainer&&(this.listenToOnce(this.core.activeContainer,ue.CONTAINER_TIMEUPDATE,this.render),this.listenTo(this.core.activeContainer,ue.CONTAINER_PLAYBACKDVRSTATECHANGED,this.dvrChanged))}},{key:"containerChanged",value:function(){this.stopListening(),this.bindEvents()}},{key:"dvrChanged",value:function(e){this.core.getPlaybackType()===Le.LIVE&&(this.settingsUpdate(),this.core.mediaControl.$el.addClass("live"),e?(this.core.mediaControl.$el.addClass("dvr"),this.core.mediaControl.$el.find(".media-control-indicator[data-position], .media-control-indicator[data-duration]").hide()):this.core.mediaControl.$el.removeClass("dvr"))}},{key:"click",value:function(){var e=this.core.mediaControl,t=e.container;t.isPlaying()||t.play(),e.$el.hasClass("dvr")&&t.seek(t.getDuration())}},{key:"settingsUpdate",value:function(){var e=this;this.stopListening(),this.core.mediaControl.$el.removeClass("live"),this.shouldRender()&&(this.render(),this.$el.click((function(){return e.click()}))),this.bindEvents()}},{key:"shouldRender",value:function(){return(void 0===this.core.options.useDvrControls||!!this.core.options.useDvrControls)&&this.core.getPlaybackType()===Le.LIVE}},{key:"render",value:function(){var e=Ee.getStyleFor('.dvr-controls[data-dvr-controls] {\n display: inline-block;\n float: left;\n color: #fff;\n line-height: 32px;\n font-size: 10px;\n font-weight: bold;\n margin-left: 6px; }\n .dvr-controls[data-dvr-controls] .live-info {\n cursor: default;\n font-family: "Roboto", "Open Sans", Arial, sans-serif;\n text-transform: uppercase; }\n .dvr-controls[data-dvr-controls] .live-info:before {\n content: "";\n display: inline-block;\n position: relative;\n width: 7px;\n height: 7px;\n border-radius: 3.5px;\n margin-right: 3.5px;\n background-color: #ff0101; }\n .dvr-controls[data-dvr-controls] .live-info.disabled {\n opacity: 0.3; }\n .dvr-controls[data-dvr-controls] .live-info.disabled:before {\n background-color: #fff; }\n .dvr-controls[data-dvr-controls] .live-button {\n cursor: pointer;\n outline: none;\n display: none;\n border: 0;\n color: #fff;\n background-color: transparent;\n height: 32px;\n padding: 0;\n opacity: 0.7;\n font-family: "Roboto", "Open Sans", Arial, sans-serif;\n text-transform: uppercase;\n transition: all 0.1s ease; }\n .dvr-controls[data-dvr-controls] .live-button:before {\n content: "";\n display: inline-block;\n position: relative;\n width: 7px;\n height: 7px;\n border-radius: 3.5px;\n margin-right: 3.5px;\n background-color: #fff; }\n .dvr-controls[data-dvr-controls] .live-button:hover {\n opacity: 1;\n text-shadow: rgba(255, 255, 255, 0.75) 0 0 5px; }\n\n.dvr .dvr-controls[data-dvr-controls] .live-info {\n display: none; }\n\n.dvr .dvr-controls[data-dvr-controls] .live-button {\n display: block; }\n\n.dvr.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar] {\n background-color: #005aff; }\n\n.media-control.live[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar] {\n background-color: #ff0101; }\n',{baseUrl:this.options.baseUrl});return this.$el.html(this.template({live:this.core.i18n.t("live"),backToLive:this.core.i18n.t("back_to_live")})),this.$el.append(e[0]),this.shouldRender()&&(this.core.mediaControl.$el.addClass("live"),this.core.mediaControl.$(".media-control-left-panel[data-media-control]").append(this.$el)),this}}])}(_e),ft=function(e){function t(){return rt(this,t),Je(this,t,arguments)}return at(t,e),nt(t,[{key:"name",get:function(){return"end_video"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"bindEvents",value:function(){this.listenTo(this.core,ue.CORE_ACTIVE_CONTAINER_CHANGED,this.containerChanged);var e=this.core.activeContainer;e&&(this.listenTo(e,ue.CONTAINER_ENDED,this.ended),this.listenTo(e,ue.CONTAINER_STOP,this.ended))}},{key:"containerChanged",value:function(){this.stopListening(),this.bindEvents()}},{key:"ended",value:function(){(void 0===this.core.options.exitFullscreenOnEnd||this.core.options.exitFullscreenOnEnd)&&this.core.isFullscreen()&&this.core.toggleFullscreen()}}])}(Ge),pt=function(e){function t(e){var r;return rt(this,t),(r=Je(this,t,[e])).options.disableErrorScreen?lt(r,r.disable()):r}return at(t,e),nt(t,[{key:"name",get:function(){return"error_screen"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"template",get:function(){return Ae('<div class="player-error-screen__content" data-error-screen>\n <% if (icon) { %>\n <div class="player-error-screen__icon" data-error-screen><%= icon %></div>\n <% } %>\n <div class="player-error-screen__title" data-error-screen><%= title %></div>\n <div class="player-error-screen__message" data-error-screen><%= message %></div>\n <div class="player-error-screen__code" data-error-screen>Error code: <%= code %></div>\n <div class="player-error-screen__reload" data-error-screen><%= reloadIcon %></div>\n</div>\n')}},{key:"container",get:function(){return this.core.getCurrentContainer()}},{key:"attributes",get:function(){return{class:"player-error-screen","data-error-screen":""}}},{key:"bindEvents",value:function(){this.listenTo(this.core,ue.ERROR,this.onError),this.listenTo(this.core,ue.CORE_ACTIVE_CONTAINER_CHANGED,this.onContainerChanged)}},{key:"bindReload",value:function(){this.reloadButton=this.$el.find(".player-error-screen__reload"),this.reloadButton&&this.reloadButton.on("click",this.reload.bind(this))}},{key:"reload",value:function(){var e=this;this.listenToOnce(this.core,ue.CORE_READY,(function(){return e.container.play()})),this.core.load(this.options.sources,this.options.mimeType),this.unbindReload()}},{key:"unbindReload",value:function(){this.reloadButton&&this.reloadButton.off("click")}},{key:"onContainerChanged",value:function(){this.err=null,this.unbindReload(),this.hide()}},{key:"onError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.level===ke.Levels.FATAL&&(this.err=e,this.container.disableMediaControl(),this.container.stop(),this.show())}},{key:"show",value:function(){this.render(),this.$el.show()}},{key:"hide",value:function(){this.$el.hide()}},{key:"render",value:function(){if(this.err){var e=Ee.getStyleFor("[data-player] .player-error-screen {\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n color: #CCCACA;\n position: absolute;\n top: 0;\n height: 100%;\n width: 100%;\n background-color: rgba(0, 0, 0, 0.7);\n z-index: 2000;\n display: flex;\n flex-direction: column;\n justify-content: center; }\n [data-player] .player-error-screen__content[data-error-screen] {\n font-size: 14px;\n color: #CCCACA;\n margin-top: 45px; }\n [data-player] .player-error-screen__title[data-error-screen] {\n font-weight: bold;\n line-height: 30px;\n font-size: 18px; }\n [data-player] .player-error-screen__message[data-error-screen] {\n width: 90%;\n margin: 0 auto; }\n [data-player] .player-error-screen__code[data-error-screen] {\n font-size: 13px;\n margin-top: 15px; }\n [data-player] .player-error-screen__reload {\n cursor: pointer;\n width: 30px;\n margin: 15px auto 0 !important; }\n",{baseUrl:this.options.baseUrl});return this.$el.html(this.template({title:this.err.UI.title,message:this.err.UI.message,code:this.err.code,icon:this.err.UI.icon||"",reloadIcon:'<svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">\n <path d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/>\n <path d="M0 0h24v24H0z" fill="none"/>\n</svg>'})),this.$el.append(e[0]),this.core.$el.append(this.el),this.bindReload(),this}}}])}(_e),gt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\n <path fill="#010101" d="M1.425.35L14.575 8l-13.15 7.65V.35z"/>\n</svg>',vt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\n <path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M1.712 14.76H6.43V1.24H1.71v13.52zm7.86-13.52v13.52h4.716V1.24H9.573z"/>\n</svg>',mt=S('link[rel="shortcut icon"]'),yt=function(e){function t(e){var r;return rt(this,t),(r=Je(this,t,[e]))._container=null,r.configure(),r}return at(t,e),nt(t,[{key:"name",get:function(){return"favicon"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"oldIcon",get:function(){return mt}},{key:"configure",value:function(){this.core.options.changeFavicon?this.enabled||(this.stopListening(this.core,ue.CORE_OPTIONS_CHANGE),this.enable()):this.enabled&&(this.disable(),this.listenTo(this.core,ue.CORE_OPTIONS_CHANGE,this.configure))}},{key:"bindEvents",value:function(){this.listenTo(this.core,ue.CORE_OPTIONS_CHANGE,this.configure),this.listenTo(this.core,ue.CORE_ACTIVE_CONTAINER_CHANGED,this.containerChanged),this.core.activeContainer&&this.containerChanged()}},{key:"containerChanged",value:function(){this._container&&this.stopListening(this._container),this._container=this.core.activeContainer,this.listenTo(this._container,ue.CONTAINER_PLAY,this.setPlayIcon),this.listenTo(this._container,ue.CONTAINER_PAUSE,this.setPauseIcon),this.listenTo(this._container,ue.CONTAINER_STOP,this.resetIcon),this.listenTo(this._container,ue.CONTAINER_ENDED,this.resetIcon),this.listenTo(this._container,ue.CONTAINER_ERROR,this.resetIcon),this.resetIcon()}},{key:"disable",value:function(){ut(st(t.prototype),"disable",this).call(this),this.resetIcon()}},{key:"destroy",value:function(){ut(st(t.prototype),"destroy",this).call(this),this.resetIcon()}},{key:"createIcon",value:function(e){var t=S("<canvas/>");t[0].width=16,t[0].height=16;var r=t[0].getContext("2d");r.fillStyle="#000";var i=S(e).find("path").attr("d"),n=new Path2D(i);r.fill(n);var a=S('<link rel="shortcut icon" type="image/png"/>');return a.attr("href",t[0].toDataURL("image/png")),a}},{key:"setPlayIcon",value:function(){this.playIcon||(this.playIcon=this.createIcon(gt)),this.changeIcon(this.playIcon)}},{key:"setPauseIcon",value:function(){this.pauseIcon||(this.pauseIcon=this.createIcon(vt)),this.changeIcon(this.pauseIcon)}},{key:"resetIcon",value:function(){S('link[rel="shortcut icon"]').remove(),S("head").append(this.oldIcon)}},{key:"changeIcon",value:function(e){e&&(S('link[rel="shortcut icon"]').remove(),S("head").append(e))}}])}(Ge),At=function(e){function t(e){var r;return rt(this,t),(r=Je(this,t,[e])).container.options.gaAccount&&(r.account=r.container.options.gaAccount,r.trackerName=r.container.options.gaTrackerName?r.container.options.gaTrackerName+".":"Clappr.",r.domainName=r.container.options.gaDomainName,r.currentHDState=void 0,r.embedScript()),r}return at(t,e),nt(t,[{key:"name",get:function(){return"google_analytics"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"embedScript",value:function(){var e=this;if(window._gat)this.addEventListeners();else{var t=document.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("async","async"),t.setAttribute("src","//www.google-analytics.com/ga.js"),t.onload=function(){return e.addEventListeners()},document.body.appendChild(t)}}},{key:"addEventListeners",value:function(){var e=this;this.container&&(this.listenTo(this.container,ue.CONTAINER_READY,this.onReady),this.listenTo(this.container,ue.CONTAINER_PLAY,this.onPlay),this.listenTo(this.container,ue.CONTAINER_STOP,this.onStop),this.listenTo(this.container,ue.CONTAINER_PAUSE,this.onPause),this.listenTo(this.container,ue.CONTAINER_ENDED,this.onEnded),this.listenTo(this.container,ue.CONTAINER_STATE_BUFFERING,this.onBuffering),this.listenTo(this.container,ue.CONTAINER_STATE_BUFFERFULL,this.onBufferFull),this.listenTo(this.container,ue.CONTAINER_ERROR,this.onError),this.listenTo(this.container,ue.CONTAINER_PLAYBACKSTATE,this.onPlaybackChanged),this.listenTo(this.container,ue.CONTAINER_VOLUME,(function(t){return e.onVolumeChanged(t)})),this.listenTo(this.container,ue.CONTAINER_SEEK,(function(t){return e.onSeek(t)})),this.listenTo(this.container,ue.CONTAINER_FULL_SCREEN,this.onFullscreen),this.listenTo(this.container,ue.CONTAINER_HIGHDEFINITIONUPDATE,this.onHD),this.listenTo(this.container,ue.CONTAINER_PLAYBACKDVRSTATECHANGED,this.onDVR)),_gaq.push([this.trackerName+"_setAccount",this.account]),this.domainName&&_gaq.push([this.trackerName+"_setDomainName",this.domainName])}},{key:"onReady",value:function(){this.push(["Video","Playback",this.container.playback.name])}},{key:"onPlay",value:function(){this.push(["Video","Play",this.container.playback.src])}},{key:"onStop",value:function(){this.push(["Video","Stop",this.container.playback.src])}},{key:"onEnded",value:function(){this.push(["Video","Ended",this.container.playback.src])}},{key:"onBuffering",value:function(){this.push(["Video","Buffering",this.container.playback.src])}},{key:"onBufferFull",value:function(){this.push(["Video","Bufferfull",this.container.playback.src])}},{key:"onError",value:function(){this.push(["Video","Error",this.container.playback.src])}},{key:"onHD",value:function(e){var t=e?"ON":"OFF";t!==this.currentHDState&&(this.currentHDState=t,this.push(["Video","HD - "+t,this.container.playback.src]))}},{key:"onPlaybackChanged",value:function(e){null!==e.type&&this.push(["Video","Playback Type - "+e.type,this.container.playback.src])}},{key:"onDVR",value:function(e){var t=e?"ON":"OFF";this.push(["Interaction","DVR - "+t,this.container.playback.src])}},{key:"onPause",value:function(){this.push(["Video","Pause",this.container.playback.src])}},{key:"onSeek",value:function(){this.push(["Video","Seek",this.container.playback.src])}},{key:"onVolumeChanged",value:function(){this.push(["Interaction","Volume",this.container.playback.src])}},{key:"onFullscreen",value:function(){this.push(["Interaction","Fullscreen",this.container.playback.src])}},{key:"push",value:function(e){var t=[this.trackerName+"_trackEvent"].concat(e);_gaq.push(t)}}])}(Ue),Et=function(e){this.element=e||window.document,this.initialize()};Et.KEY_NAMES_BY_CODE={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"caps_lock",27:"esc",32:"space",37:"left",38:"up",39:"right",40:"down",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12"},Et.KEY_CODES_BY_NAME={},function(){for(var e in Et.KEY_NAMES_BY_CODE)Object.prototype.hasOwnProperty.call(Et.KEY_NAMES_BY_CODE,e)&&(Et.KEY_CODES_BY_NAME[Et.KEY_NAMES_BY_CODE[e]]=+e)}(),Et.MODIFIERS=["shift","ctrl","alt"],Et.registerEvent=document.addEventListener?function(e,t,r){e.addEventListener(t,r,!1)}:document.attachEvent?function(e,t,r){e.attachEvent("on"+t,r)}:void 0,Et.unregisterEvent=document.removeEventListener?function(e,t,r){e.removeEventListener(t,r,!1)}:document.detachEvent?function(e,t,r){e.detachEvent("on"+t,r)}:void 0,Et.stringContains=function(e,t){return-1!==e.indexOf(t)},Et.neatString=function(e){return e.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")},Et.capitalize=function(e){return e.toLowerCase().replace(/^./,(function(e){return e.toUpperCase()}))},Et.isString=function(e){return Et.stringContains(Object.prototype.toString.call(e),"String")},Et.arrayIncludes=Array.prototype.indexOf?function(e,t){return-1!==e.indexOf(t)}:function(e,t){for(var r=0;r<e.length;r++)if(e[r]===t)return!0;return!1},Et.extractModifiers=function(e){var t,r;for(t=[],r=0;r<Et.MODIFIERS.length;r++)Et.stringContains(e,Et.MODIFIERS[r])&&t.push(Et.MODIFIERS[r]);return t},Et.extractKey=function(e){var t,r;for(t=Et.neatString(e).split(" "),r=0;r<t.length;r++)if(!Et.arrayIncludes(Et.MODIFIERS,t[r]))return t[r]},Et.modifiersAndKey=function(e){var t,r;return Et.stringContains(e,"any")?Et.neatString(e).split(" ").slice(0,2).join(" "):(t=Et.extractModifiers(e),(r=Et.extractKey(e))&&!Et.arrayIncludes(Et.MODIFIERS,r)&&t.push(r),t.join(" "))},Et.keyName=function(e){return Et.KEY_NAMES_BY_CODE[e+""]},Et.keyCode=function(e){return+Et.KEY_CODES_BY_NAME[e]},Et.prototype.initialize=function(){var e,t=this;for(this.lastKeyCode=-1,this.lastModifiers={},e=0;e<Et.MODIFIERS.length;e++)this.lastModifiers[Et.MODIFIERS[e]]=!1;this.keysDown={any:[]},this.keysUp={any:[]},this.downHandler=this.handler("down"),this.upHandler=this.handler("up"),Et.registerEvent(this.element,"keydown",this.downHandler),Et.registerEvent(this.element,"keyup",this.upHandler),Et.registerEvent(window,"unload",(function e(){Et.unregisterEvent(t.element,"keydown",t.downHandler),Et.unregisterEvent(t.element,"keyup",t.upHandler),Et.unregisterEvent(window,"unload",e)}))},Et.prototype.handler=function(e){var t=this;return function(r){var i,n,a;for(r=r||window.event,t.lastKeyCode=r.keyCode,i=0;i<Et.MODIFIERS.length;i++)t.lastModifiers[Et.MODIFIERS[i]]=r[Et.MODIFIERS[i]+"Key"];for(Et.arrayIncludes(Et.MODIFIERS,Et.keyName(t.lastKeyCode))&&(t.lastModifiers[Et.keyName(t.lastKeyCode)]=!0),n=t["keys"+Et.capitalize(e)],i=0;i<n.any.length;i++)!1===n.any[i](r)&&r.preventDefault&&r.preventDefault();if(n[a=t.lastModifiersAndKey()])for(i=0;i<n[a].length;i++)!1===n[a][i](r)&&r.preventDefault&&r.preventDefault()}},Et.prototype.registerKeys=function(e,t,r){var i,n,a=this["keys"+Et.capitalize(e)];for(Et.isString(t)&&(t=[t]),i=0;i<t.length;i++)n=t[i],a[n=Et.modifiersAndKey(n+"")]?a[n].push(r):a[n]=[r];return this},Et.prototype.unregisterKeys=function(e,t,r){var i,n,a,s=this["keys"+Et.capitalize(e)];for(Et.isString(t)&&(t=[t]),i=0;i<t.length;i++)if(a=t[i],a=Et.modifiersAndKey(a+""),null===r)delete s[a];else if(s[a])for(n=0;n<s[a].length;n++)if(String(s[a][n])===String(r)){s[a].splice(n,1);break}return this},Et.prototype.off=function(e){return this.unregisterKeys("down",e,null)},Et.prototype.delegate=function(e,t,r){return null!==r||void 0!==r?this.registerKeys(e,t,r):this.unregisterKeys(e,t,r)},Et.prototype.down=function(e,t){return this.delegate("down",e,t)},Et.prototype.up=function(e,t){return this.delegate("up",e,t)},Et.prototype.lastKey=function(e){return e?this.lastModifiers[e]:Et.keyName(this.lastKeyCode)},Et.prototype.lastModifiersAndKey=function(){var e,t;for(e=[],t=0;t<Et.MODIFIERS.length;t++)this.lastKey(Et.MODIFIERS[t])&&e.push(Et.MODIFIERS[t]);return Et.arrayIncludes(e,this.lastKey())||e.push(this.lastKey()),e.join(" ")};var Tt={Kibo:Et},bt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\n <path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M1.712 1.24h12.6v13.52h-12.6z"/>\n</svg>',kt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\n <path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M11.5 11h-.002v1.502L7.798 10H4.5V6h3.297l3.7-2.502V4.5h.003V11zM11 4.49L7.953 6.5H5v3h2.953L11 11.51V4.49z"/>\n</svg>',St='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\n <path fill="#010101" d="M7.156 8L4 11.156V8.5H3V13h4.5v-1H4.844L8 8.844 7.156 8zM8.5 3v1h2.657L8 7.157 8.846 8 12 4.844V7.5h1V3H8.5z"/>\n</svg>',_t=Q.Config,Ct=Q.Fullscreen,Lt=Q.formatTime,Dt=Q.extend,It=Q.removeArrayItem,Rt=function(e){function t(e){var r;return rt(this,t),(r=Je(this,t,[e])).persistConfig=r.options.persistConfig,r.currentPositionValue=null,r.currentDurationValue=null,r.keepVisible=!1,r.fullScreenOnVideoTagSupported=null,r.setInitialVolume(),r.settings={left:["play","stop","pause"],right:["volume"],default:["position","seekbar","duration"]},r.kibo=new Et(r.options.focusElement),r.bindKeyEvents(),r.container?S.isEmptyObject(r.container.settings)||(r.settings=S.extend({},r.container.settings)):r.settings={},r.userDisabled=!1,(r.container&&r.container.mediaControlDisabled||r.options.chromeless)&&r.disable(),r.stopDragHandler=function(e){return r.stopDrag(e)},r.updateDragHandler=function(e){return r.updateDrag(e)},S(document).bind("mouseup",r.stopDragHandler),S(document).bind("mousemove",r.updateDragHandler),r}return at(t,e),nt(t,[{key:"name",get:function(){return"media_control"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"disabled",get:function(){var e=this.container&&this.container.getPlaybackType()===Le.NO_OP;return this.userDisabled||e}},{key:"container",get:function(){return this.core&&this.core.activeContainer}},{key:"playback",get:function(){return this.core&&this.core.activePlayback}},{key:"attributes",get:function(){return{class:"media-control","data-media-control":""}}},{key:"events",get:function(){return{"click [data-play]":"play","click [data-pause]":"pause","click [data-playpause]":"togglePlayPause","click [data-stop]":"stop","click [data-playstop]":"togglePlayStop","click [data-fullscreen]":"toggleFullscreen","click .bar-container[data-seekbar]":"seek","click .bar-container[data-volume]":"onVolumeClick","click .drawer-icon[data-volume]":"toggleMute","mouseenter .drawer-container[data-volume]":"showVolumeBar","mouseleave .drawer-container[data-volume]":"hideVolumeBar","mousedown .bar-container[data-volume]":"startVolumeDrag","mousemove .bar-container[data-volume]":"mousemoveOnVolumeBar","mousedown .bar-scrubber[data-seekbar]":"startSeekDrag","mousemove .bar-container[data-seekbar]":"mousemoveOnSeekBar","mouseleave .bar-container[data-seekbar]":"mouseleaveOnSeekBar","mouseenter .media-control-layer[data-controls]":"setUserKeepVisible","mouseleave .media-control-layer[data-controls]":"resetUserKeepVisible"}}},{key:"template",get:function(){return Ae('<div class="media-control-background" data-background></div>\n<div class="media-control-layer" data-controls>\n <% var renderBar = function(name) { %>\n <div class="bar-container" data-<%= name %>>\n <div class="bar-background" data-<%= name %>>\n <div class="bar-fill-1" data-<%= name %>></div>\n <div class="bar-fill-2" data-<%= name %>></div>\n <div class="bar-hover" data-<%= name %>></div>\n </div>\n <div class="bar-scrubber" data-<%= name %>>\n <div class="bar-scrubber-icon" data-<%= name %>></div>\n </div>\n </div>\n <% }; %>\n <% var renderSegmentedBar = function(name, segments) {\n segments = segments || 10; %>\n <div class="bar-container" data-<%= name %>>\n <% for (var i = 0; i < segments; i++) { %>\n <div class="segmented-bar-element" data-<%= name %>></div>\n <% } %>\n </div>\n <% }; %>\n <% var renderDrawer = function(name, renderContent) { %>\n <div class="drawer-container" data-<%= name %>>\n <div class="drawer-icon-container" data-<%= name %>>\n <div class="drawer-icon media-control-icon" data-<%= name %>></div>\n <span class="drawer-text" data-<%= name %>></span>\n </div>\n <% renderContent(name); %>\n </div>\n <% }; %>\n <% var renderIndicator = function(name) { %>\n <div class="media-control-indicator" data-<%= name %>></div>\n <% }; %>\n <% var renderButton = function(name) { %>\n <button type="button" class="media-control-button media-control-icon" data-<%= name %> aria-label="<%= name %>"></button>\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 <div class="media-control-center-panel" data-media-control>\n <% render(settings.default); %>\n </div>\n <% } %>\n <% if (settings.left && settings.left.length) { %>\n <div class="media-control-left-panel" data-media-control>\n <% render(settings.left); %>\n </div>\n <% } %>\n <% if (settings.right && settings.right.length) { %>\n <div class="media-control-right-panel" data-media-control>\n <% render(settings.right); %>\n </div>\n <% } %>\n</div>\n')}},{key:"volume",get:function(){return this.container&&this.container.isReady?this.container.volume:this.intendedVolume}},{key:"muted",get:function(){return 0===this.volume}},{key:"getExternalInterface",value:function(){var e=this;return{setVolume:this.setVolume,getVolume:function(){return e.volume}}}},{key:"bindEvents",value:function(){var e=this;this.stopListening(),this.listenTo(this.core,ue.CORE_ACTIVE_CONTAINER_CHANGED,this.onActiveContainerChanged),this.listenTo(this.core,ue.CORE_MOUSE_MOVE,this.show),this.listenTo(this.core,ue.CORE_MOUSE_LEAVE,(function(){return e.hide(e.options.hideMediaControlDelay)})),this.listenTo(this.core,ue.CORE_FULLSCREEN,this.show),this.listenTo(this.core,ue.CORE_OPTIONS_CHANGE,this.configure),this.listenTo(this.core,ue.CORE_RESIZE,this.playerResize),this.bindContainerEvents()}},{key:"bindContainerEvents",value:function(){this.container&&(this.listenTo(this.container,ue.CONTAINER_PLAY,this.changeTogglePlay),this.listenTo(this.container,ue.CONTAINER_PAUSE,this.changeTogglePlay),this.listenTo(this.container,ue.CONTAINER_STOP,this.changeTogglePlay),this.listenTo(this.container,ue.CONTAINER_DBLCLICK,this.toggleFullscreen),this.listenTo(this.container,ue.CONTAINER_TIMEUPDATE,this.onTimeUpdate),this.listenTo(this.container,ue.CONTAINER_PROGRESS,this.updateProgressBar),this.listenTo(this.container,ue.CONTAINER_SETTINGSUPDATE,this.settingsUpdate),this.listenTo(this.container,ue.CONTAINER_PLAYBACKDVRSTATECHANGED,this.settingsUpdate),this.listenTo(this.container,ue.CONTAINER_HIGHDEFINITIONUPDATE,this.highDefinitionUpdate),this.listenTo(this.container,ue.CONTAINER_MEDIACONTROL_DISABLE,this.disable),this.listenTo(this.container,ue.CONTAINER_MEDIACONTROL_ENABLE,this.enable),this.listenTo(this.container,ue.CONTAINER_ENDED,this.ended),this.listenTo(this.container,ue.CONTAINER_VOLUME,this.onVolumeChanged),this.listenTo(this.container,ue.CONTAINER_OPTIONS_CHANGE,this.setInitialVolume),"video"===this.container.playback.el.nodeName.toLowerCase()&&this.listenToOnce(this.container,ue.CONTAINER_LOADEDMETADATA,this.onLoadedMetadataOnVideoTag))}},{key:"disable",value:function(){this.userDisabled=!0,this.hide(),this.unbindKeyEvents(),this.$el.hide()}},{key:"enable",value:function(){this.options.chromeless||(this.userDisabled=!1,this.bindKeyEvents(),this.show())}},{key:"play",value:function(){this.container&&this.container.play()}},{key:"pause",value:function(){this.container&&this.container.pause()}},{key:"stop",value:function(){this.container&&this.container.stop()}},{key:"setInitialVolume",value:function(){var e=this.persistConfig?_t.restore("volume"):100,t=this.container&&this.container.options||this.options;this.setVolume(t.mute?0:e,!0)}},{key:"onVolumeChanged",value:function(){this.updateVolumeUI()}},{key:"onLoadedMetadataOnVideoTag",value:function(){var e=this.playback&&this.playback.el;!Ct.fullscreenEnabled()&&e.webkitSupportsFullscreen&&(this.fullScreenOnVideoTagSupported=!0,this.settingsUpdate())}},{key:"updateVolumeUI",value:function(){if(this.rendered){this.$volumeBarContainer.find(".bar-fill-2").css({});var e=this.$volumeBarContainer.width(),t=this.$volumeBarBackground.width(),r=(e-t)/2,i=t*this.volume/100+r;this.$volumeBarFill.css({width:"".concat(this.volume,"%")}),this.$volumeBarScrubber.css({left:i}),this.$volumeBarContainer.find(".segmented-bar-element").removeClass("fill");var n=Math.ceil(this.volume/10);this.$volumeBarContainer.find(".segmented-bar-element").slice(0,n).addClass("fill"),this.$volumeIcon.html(""),this.$volumeIcon.removeClass("muted"),this.muted?(this.$volumeIcon.append('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\n <path fill-rule="evenodd" clip-rule="evenodd" fill="#010101" d="M9.75 11.51L6.7 9.5H3.75v-3H6.7L9.75 4.49v.664l.497.498V3.498L6.547 6H3.248v4h3.296l3.7 2.502v-2.154l-.497.5v.662zm3-5.165L12.404 6l-1.655 1.653L9.093 6l-.346.345L10.402 8 8.747 9.654l.346.347 1.655-1.653L12.403 10l.348-.346L11.097 8l1.655-1.655z"/>\n</svg>'),this.$volumeIcon.addClass("muted")):this.$volumeIcon.append(kt),this.applyButtonStyle(this.$volumeIcon)}}},{key:"changeTogglePlay",value:function(){this.$playPauseToggle.html(""),this.$playStopToggle.html(""),this.container&&this.container.isPlaying()?(this.$playPauseToggle.append(vt),this.$playStopToggle.append(bt),this.trigger(ue.MEDIACONTROL_PLAYING)):(this.$playPauseToggle.append(gt),this.$playStopToggle.append(gt),this.trigger(ue.MEDIACONTROL_NOTPLAYING),O.isMobile&&this.show()),this.applyButtonStyle(this.$playPauseToggle),this.applyButtonStyle(this.$playStopToggle)}},{key:"mousemoveOnSeekBar",value:function(e){if(this.settings.seekEnabled){var t=e.pageX-this.$seekBarContainer.offset().left-this.$seekBarHover.width()/2;this.$seekBarHover.css({left:t})}this.trigger(ue.MEDIACONTROL_MOUSEMOVE_SEEKBAR,e)}},{key:"mouseleaveOnSeekBar",value:function(e){this.trigger(ue.MEDIACONTROL_MOUSELEAVE_SEEKBAR,e)}},{key:"onVolumeClick",value:function(e){this.setVolume(this.getVolumeFromUIEvent(e))}},{key:"mousemoveOnVolumeBar",value:function(e){this.draggingVolumeBar&&this.setVolume(this.getVolumeFromUIEvent(e))}},{key:"playerResize",value:function(e){this.$fullscreenToggle.html("");var t=this.core.isFullscreen()?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\n <path fill="#010101" d="M13.5 3.344l-.844-.844L9.5 5.656V3h-1v4.5H13v-1h-2.656L13.5 3.344zM3 9.5h2.656L2.5 12.656l.844.844L6.5 10.344V13h1V8.5H3v1z"/>\n</svg>':St;this.$fullscreenToggle.append(t),this.applyButtonStyle(this.$fullscreenToggle),0!==this.$el.find(".media-control").length&&this.$el.removeClass("w320"),(e.width<=320||this.options.hideVolumeBar)&&this.$el.addClass("w320")}},{key:"togglePlayPause",value:function(){return this.container.isPlaying()?this.container.pause():this.container.play(),!1}},{key:"togglePlayStop",value:function(){this.container.isPlaying()?this.container.stop():this.container.play()}},{key:"startSeekDrag",value:function(e){this.settings.seekEnabled&&(this.draggingSeekBar=!0,this.$el.addClass("dragging"),this.$seekBarLoaded.addClass("media-control-notransition"),this.$seekBarPosition.addClass("media-control-notransition"),this.$seekBarScrubber.addClass("media-control-notransition"),e&&e.preventDefault())}},{key:"startVolumeDrag",value:function(e){this.draggingVolumeBar=!0,this.$el.addClass("dragging"),e&&e.preventDefault()}},{key:"stopDrag",value:function(e){this.draggingSeekBar&&this.seek(e),this.$el.removeClass("dragging"),this.$seekBarLoaded.removeClass("media-control-notransition"),this.$seekBarPosition.removeClass("media-control-notransition"),this.$seekBarScrubber.removeClass("media-control-notransition dragging"),this.draggingSeekBar=!1,this.draggingVolumeBar=!1}},{key:"updateDrag",value:function(e){if(this.draggingSeekBar){e.preventDefault();var t=(e.pageX-this.$seekBarContainer.offset().left)/this.$seekBarContainer.width()*100;t=Math.min(100,Math.max(t,0)),this.setSeekPercentage(t)}else this.draggingVolumeBar&&(e.preventDefault(),this.setVolume(this.getVolumeFromUIEvent(e)))}},{key:"getVolumeFromUIEvent",value:function(e){return(e.pageX-this.$volumeBarContainer.offset().left)/this.$volumeBarContainer.width()*100}},{key:"toggleMute",value:function(){this.setVolume(this.muted?100:0)}},{key:"setVolume",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e=Math.min(100,Math.max(e,0)),this.intendedVolume=e,this.persistConfig&&!r&&_t.persist("volume",e);var i=function(){t.container&&t.container.isReady?t.container.setVolume(e):t.listenToOnce(t.container,ue.CONTAINER_READY,(function(){t.container.setVolume(e)}))};this.container?i():this.listenToOnce(this,ue.MEDIACONTROL_CONTAINERCHANGED,(function(){return i()}))}},{key:"toggleFullscreen",value:function(){this.trigger(ue.MEDIACONTROL_FULLSCREEN,this.name),this.container.fullscreen(),this.core.toggleFullscreen(),this.resetUserKeepVisible()}},{key:"onActiveContainerChanged",value:function(){this.fullScreenOnVideoTagSupported=null,this.bindEvents(),this.setInitialVolume(),this.changeTogglePlay(),this.bindContainerEvents(),this.settingsUpdate(),this.container&&this.container.trigger(ue.CONTAINER_PLAYBACKDVRSTATECHANGED,this.container.isDvrInUse()),this.container&&this.container.mediaControlDisabled&&this.disable(),this.trigger(ue.MEDIACONTROL_CONTAINERCHANGED)}},{key:"showVolumeBar",value:function(){this.hideVolumeId&&clearTimeout(this.hideVolumeId),this.$volumeBarContainer.removeClass("volume-bar-hide")}},{key:"hideVolumeBar",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:400;this.$volumeBarContainer&&(this.draggingVolumeBar?this.hideVolumeId=setTimeout((function(){return e.hideVolumeBar()}),t):(this.hideVolumeId&&clearTimeout(this.hideVolumeId),this.hideVolumeId=setTimeout((function(){return e.$volumeBarContainer.addClass("volume-bar-hide")}),t)))}},{key:"ended",value:function(){this.changeTogglePlay()}},{key:"updateProgressBar",value:function(e){var t=e.start/e.total*100,r=e.current/e.total*100;this.$seekBarLoaded.css({left:"".concat(t,"%"),width:"".concat(r-t,"%")})}},{key:"onTimeUpdate",value:function(e){if(!this.draggingSeekBar){var t=e.current<0?e.total:e.current;this.currentPositionValue=t,this.currentDurationValue=e.total,this.renderSeekBar()}}},{key:"renderSeekBar",value:function(){if(null!==this.currentPositionValue&&null!==this.currentDurationValue){this.currentSeekBarPercentage=100,this.container&&(this.container.getPlaybackType()!==Le.LIVE||this.container.isDvrInUse())&&(this.currentSeekBarPercentage=this.currentPositionValue/this.currentDurationValue*100),this.setSeekPercentage(this.currentSeekBarPercentage);var e=Lt(this.currentPositionValue),t=Lt(this.currentDurationValue);e!==this.displayedPosition&&(this.$position.text(e),this.displayedPosition=e),t!==this.displayedDuration&&(this.$duration.text(t),this.displayedDuration=t)}}},{key:"seek",value:function(e){if(this.settings.seekEnabled){var t=(e.pageX-this.$seekBarContainer.offset().left)/this.$seekBarContainer.width()*100;return t=Math.min(100,Math.max(t,0)),this.container&&this.container.seekPercentage(t),this.setSeekPercentage(t),!1}}},{key:"setKeepVisible",value:function(){this.keepVisible=!0}},{key:"resetKeepVisible",value:function(){this.keepVisible=!1}},{key:"setUserKeepVisible",value:function(){this.userKeepVisible=!0}},{key:"resetUserKeepVisible",value:function(){this.userKeepVisible=!1}},{key:"isVisible",value:function(){return!this.$el.hasClass("media-control-hide")}},{key:"show",value:function(e){var t=this;if(!this.disabled){var r=e&&e.clientX!==this.lastMouseX&&e.clientY!==this.lastMouseY;(!e||r||navigator.userAgent.match(/firefox/i))&&(clearTimeout(this.hideId),this.$el.show(),this.trigger(ue.MEDIACONTROL_SHOW,this.name),this.container&&this.container.trigger(ue.CONTAINER_MEDIACONTROL_SHOW,this.name),this.$el.removeClass("media-control-hide"),this.hideId=setTimeout((function(){return t.hide()}),2e3),e&&(this.lastMouseX=e.clientX,this.lastMouseY=e.clientY));this.updateCursorStyle(!0)}}},{key:"hide",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.isVisible()){var r=t||2e3;if(clearTimeout(this.hideId),this.disabled||!1!==this.options.hideMediaControl){var i=this.userKeepVisible||this.keepVisible,n=this.draggingSeekBar||this.draggingVolumeBar;if(!this.disabled&&(t||i||n))this.hideId=setTimeout((function(){return e.hide()}),r);else{this.trigger(ue.MEDIACONTROL_HIDE,this.name),this.container&&this.container.trigger(ue.CONTAINER_MEDIACONTROL_HIDE,this.name),this.$el.addClass("media-control-hide"),this.hideVolumeBar(0);this.updateCursorStyle(!1)}}}}},{key:"updateCursorStyle",value:function(e){e?this.core.$el.removeClass("nocursor"):this.core.isFullscreen()&&this.core.$el.addClass("nocursor")}},{key:"settingsUpdate",value:function(){var e=this.getSettings();!e||this.fullScreenOnVideoTagSupported||Ct.fullscreenEnabled()||(e.default&&It(e.default,"fullscreen"),e.left&&It(e.left,"fullscreen"),e.right&&It(e.right,"fullscreen")),JSON.stringify(this.settings)!==JSON.stringify(e)&&(this.settings=e,this.render())}},{key:"getSettings",value:function(){return S.extend(!0,{},this.container&&this.container.settings)}},{key:"highDefinitionUpdate",value:function(e){this.isHD=e;var t=e?"addClass":"removeClass";this.$hdIndicator[t]("enabled")}},{key:"createCachedElements",value:function(){var e=this.$el.find(".media-control-layer");this.$duration=e.find(".media-control-indicator[data-duration]"),this.$fullscreenToggle=e.find("button.media-control-button[data-fullscreen]"),this.$playPauseToggle=e.find("button.media-control-button[data-playpause]"),this.$playStopToggle=e.find("button.media-control-button[data-playstop]"),this.$position=e.find(".media-control-indicator[data-position]"),this.$seekBarContainer=e.find(".bar-container[data-seekbar]"),this.$seekBarHover=e.find(".bar-hover[data-seekbar]"),this.$seekBarLoaded=e.find(".bar-fill-1[data-seekbar]"),this.$seekBarPosition=e.find(".bar-fill-2[data-seekbar]"),this.$seekBarScrubber=e.find(".bar-scrubber[data-seekbar]"),this.$volumeBarContainer=e.find(".bar-container[data-volume]"),this.$volumeContainer=e.find(".drawer-container[data-volume]"),this.$volumeIcon=e.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()}},{key:"resetIndicators",value:function(){this.displayedPosition=this.$position.text(),this.displayedDuration=this.$duration.text()}},{key:"initializeIcons",value:function(){var e=this.$el.find(".media-control-layer");e.find("button.media-control-button[data-play]").append(gt),e.find("button.media-control-button[data-pause]").append(vt),e.find("button.media-control-button[data-stop]").append(bt),this.$playPauseToggle.append(gt),this.$playStopToggle.append(gt),this.$volumeIcon.append(kt),this.$fullscreenToggle.append(St),this.$hdIndicator.append('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">\n <path fill="#010101" d="M5.375 7.062H2.637V4.26H.502v7.488h2.135V8.9h2.738v2.848h2.133V4.26H5.375v2.802zm5.97-2.81h-2.84v7.496h2.798c2.65 0 4.195-1.607 4.195-3.77v-.022c0-2.162-1.523-3.704-4.154-3.704zm2.06 3.758c0 1.21-.81 1.896-2.03 1.896h-.83V6.093h.83c1.22 0 2.03.696 2.03 1.896v.02z"/>\n</svg>')}},{key:"setSeekPercentage",value:function(e){e=Math.max(Math.min(e,100),0),this.displayedSeekBarPercentage!==e&&(this.displayedSeekBarPercentage=e,this.$seekBarPosition.removeClass("media-control-notransition"),this.$seekBarScrubber.removeClass("media-control-notransition"),this.$seekBarPosition.css({width:"".concat(e,"%")}),this.$seekBarScrubber.css({left:"".concat(e,"%")}))}},{key:"seekRelative",value:function(e){if(this.settings.seekEnabled){var t=this.container.getCurrentTime(),r=this.container.getDuration(),i=Math.min(Math.max(t+e,0),r);i=Math.min(100*i/r,100),this.container.seekPercentage(i)}}},{key:"bindKeyAndShow",value:function(e,t){var r=this;this.kibo.down(e,(function(){return r.show(),t()}))}},{key:"bindKeyEvents",value:function(){var e=this;if(!O.isMobile&&!this.options.disableKeyboardShortcuts){this.unbindKeyEvents(),this.kibo=new Et(this.options.focusElement||this.options.parentElement),this.bindKeyAndShow("space",(function(){return e.togglePlayPause()})),this.bindKeyAndShow("left",(function(){return e.seekRelative(-5)})),this.bindKeyAndShow("right",(function(){return e.seekRelative(5)})),this.bindKeyAndShow("shift left",(function(){return e.seekRelative(-10)})),this.bindKeyAndShow("shift right",(function(){return e.seekRelative(10)})),this.bindKeyAndShow("shift ctrl left",(function(){return e.seekRelative(-15)})),this.bindKeyAndShow("shift ctrl right",(function(){return e.seekRelative(15)}));["1","2","3","4","5","6","7","8","9","0"].forEach((function(t){e.bindKeyAndShow(t,(function(){e.settings.seekEnabled&&e.container&&e.container.seekPercentage(10*t)}))}))}}},{key:"unbindKeyEvents",value: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"]))}},{key:"parseColors",value:function(){if(this.options.mediacontrol){this.buttonsColor=this.options.mediacontrol.buttons;var e=this.options.mediacontrol.seekbar;this.$el.find(".bar-fill-2[data-seekbar]").css("background-color",e),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)}}},{key:"applyButtonStyle",value:function(e){this.buttonsColor&&e&&S(e).find("svg path").css("fill",this.buttonsColor)}},{key:"destroy",value:function(){S(document).unbind("mouseup",this.stopDragHandler),S(document).unbind("mousemove",this.updateDragHandler),this.unbindKeyEvents(),this.stopListening(),ut(st(t.prototype),"destroy",this).call(this)}},{key:"configure",value:function(e){this.options.chromeless||e.source||e.sources?this.disable():this.enable(),this.trigger(ue.MEDIACONTROL_OPTIONS_CHANGE)}},{key:"render",value:function(){var e=this,t=this.options.hideMediaControlDelay||2e3;this.settings&&this.$el.html(this.template({settings:this.settings}));var r=Ee.getStyleFor('.media-control-notransition {\n transition: none !important; }\n\n.media-control[data-media-control] {\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 9999;\n pointer-events: none; }\n .media-control[data-media-control].dragging {\n pointer-events: auto;\n cursor: grabbing !important;\n cursor: url("closed-hand.cur"), move; }\n .media-control[data-media-control].dragging * {\n cursor: grabbing !important;\n cursor: url("closed-hand.cur"), move; }\n .media-control[data-media-control] .media-control-background[data-background] {\n position: absolute;\n height: 40%;\n width: 100%;\n bottom: 0;\n background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));\n will-change: transform, opacity;\n transition: opacity 0.6s ease-out; }\n .media-control[data-media-control] .media-control-icon {\n line-height: 0;\n letter-spacing: 0;\n speak: none;\n color: #fff;\n opacity: 0.5;\n vertical-align: middle;\n text-align: left;\n transition: all 0.1s ease; }\n .media-control[data-media-control] .media-control-icon:hover {\n color: white;\n opacity: 0.75;\n text-shadow: rgba(255, 255, 255, 0.8) 0 0 5px; }\n .media-control[data-media-control].media-control-hide .media-control-background[data-background] {\n opacity: 0; }\n .media-control[data-media-control].media-control-hide .media-control-layer[data-controls] {\n transform: translateY(50px); }\n .media-control[data-media-control].media-control-hide .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] {\n opacity: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] {\n position: absolute;\n transform: translateY(-7px);\n bottom: 0;\n width: 100%;\n height: 32px;\n font-size: 0;\n vertical-align: middle;\n pointer-events: auto;\n transition: bottom 0.4s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-left-panel[data-media-control] {\n position: absolute;\n top: 0;\n left: 4px;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-center-panel[data-media-control] {\n height: 100%;\n text-align: center;\n line-height: 32px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-right-panel[data-media-control] {\n position: absolute;\n top: 0;\n right: 4px;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button {\n background-color: transparent;\n border: 0;\n margin: 0 6px;\n padding: 0;\n cursor: pointer;\n display: inline-block;\n width: 32px;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg {\n width: 100%;\n height: 22px; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button svg path {\n fill: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button:focus {\n outline: none; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-play] {\n float: left;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-pause] {\n float: left;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-stop] {\n float: left;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-fullscreen] {\n float: right;\n background-color: transparent;\n border: 0;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator] {\n background-color: transparent;\n border: 0;\n cursor: default;\n display: none;\n float: right;\n height: 100%; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled {\n display: block;\n opacity: 1.0; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-hd-indicator].enabled:hover {\n opacity: 1.0;\n text-shadow: none; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playpause] {\n float: left; }\n .media-control[data-media-control] .media-control-layer[data-controls] button.media-control-button[data-playstop] {\n float: left; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position], .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration] {\n display: inline-block;\n font-size: 10px;\n color: white;\n cursor: default;\n line-height: 32px;\n position: relative; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-position] {\n margin: 0 6px 0 7px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration] {\n color: rgba(255, 255, 255, 0.5);\n margin-right: 6px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .media-control-indicator[data-duration]:before {\n content: "|";\n margin-right: 7px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] {\n position: absolute;\n top: -20px;\n left: 0;\n display: inline-block;\n vertical-align: middle;\n width: 100%;\n height: 25px;\n cursor: pointer; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] {\n width: 100%;\n height: 1px;\n position: relative;\n top: 12px;\n background-color: #666666; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-1[data-seekbar] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #c2c2c2;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-fill-2[data-seekbar] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #005aff;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-background[data-seekbar] .bar-hover[data-seekbar] {\n opacity: 0;\n position: absolute;\n top: -3px;\n width: 5px;\n height: 7px;\n background-color: rgba(255, 255, 255, 0.5);\n transition: opacity 0.1s ease; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar]:hover .bar-background[data-seekbar] .bar-hover[data-seekbar] {\n opacity: 1; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled {\n cursor: default; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar].seek-disabled:hover .bar-background[data-seekbar] .bar-hover[data-seekbar] {\n opacity: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] {\n position: absolute;\n transform: translateX(-50%);\n top: 2px;\n left: 0;\n width: 20px;\n height: 20px;\n opacity: 1;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .bar-container[data-seekbar] .bar-scrubber[data-seekbar] .bar-scrubber-icon[data-seekbar] {\n position: absolute;\n left: 6px;\n top: 6px;\n width: 8px;\n height: 8px;\n border-radius: 10px;\n box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2);\n background-color: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] {\n float: right;\n display: inline-block;\n height: 32px;\n cursor: pointer;\n margin: 0 6px;\n box-sizing: border-box; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] {\n float: left;\n bottom: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] {\n background-color: transparent;\n border: 0;\n box-sizing: content-box;\n width: 32px;\n height: 32px;\n opacity: 0.5; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume]:hover {\n opacity: 0.75; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg {\n height: 24px;\n position: relative;\n top: 3px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume] svg path {\n fill: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .drawer-icon-container[data-volume] .drawer-icon[data-volume].muted svg {\n margin-left: 2px; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] {\n float: left;\n position: relative;\n overflow: hidden;\n top: 6px;\n width: 42px;\n height: 18px;\n padding: 3px 0;\n transition: width .2s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] {\n height: 1px;\n position: relative;\n top: 7px;\n margin: 0 3px;\n background-color: #666666; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-1[data-volume] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #c2c2c2;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-fill-2[data-volume] {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n background-color: #005aff;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-background[data-volume] .bar-hover[data-volume] {\n opacity: 0;\n position: absolute;\n top: -3px;\n width: 5px;\n height: 7px;\n background-color: rgba(255, 255, 255, 0.5);\n transition: opacity 0.1s ease; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] {\n position: absolute;\n transform: translateX(-50%);\n top: 0px;\n left: 0;\n width: 20px;\n height: 20px;\n opacity: 1;\n transition: all 0.1s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .bar-scrubber[data-volume] .bar-scrubber-icon[data-volume] {\n position: absolute;\n left: 6px;\n top: 6px;\n width: 8px;\n height: 8px;\n border-radius: 10px;\n box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.2);\n background-color: white; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume] {\n float: left;\n width: 4px;\n padding-left: 2px;\n height: 12px;\n opacity: 0.5;\n box-shadow: inset 2px 0 0 white;\n transition: transform .2s ease-out; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume].fill {\n box-shadow: inset 2px 0 0 #fff;\n opacity: 1; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:nth-of-type(1) {\n padding-left: 0; }\n .media-control[data-media-control] .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume] .segmented-bar-element[data-volume]:hover {\n transform: scaleY(1.5); }\n .media-control[data-media-control].w320 .media-control-layer[data-controls] .drawer-container[data-volume] .bar-container[data-volume].volume-bar-hide {\n width: 0;\n height: 12px;\n top: 9px;\n padding: 0; }\n',{baseUrl:this.options.baseUrl});this.$el.append(r[0]),this.createCachedElements(),this.$playPauseToggle.addClass("paused"),this.$playStopToggle.addClass("stopped"),this.changeTogglePlay(),this.container&&(this.hideId=setTimeout((function(){return e.hide()}),t),this.disabled&&this.hide()),O.isSafari&&O.isMobile&&(O.version<10?this.$volumeContainer.css("display","none"):this.$volumeBarContainer.css("display","none")),this.$seekBarPosition.addClass("media-control-notransition"),this.$seekBarScrubber.addClass("media-control-notransition");var i=0;return this.displayedSeekBarPercentage&&(i=this.displayedSeekBarPercentage),this.displayedSeekBarPercentage=null,this.setSeekPercentage(i),setTimeout((function(){!e.settings.seekEnabled&&e.$seekBarContainer.addClass("seek-disabled"),!O.isMobile&&!e.options.disableKeyboardShortcuts&&e.bindKeyEvents(),e.playerResize({width:e.options.width,height:e.options.height}),e.hideVolumeBar(0)}),0),this.parseColors(),this.highDefinitionUpdate(this.isHD),this.core.$el.append(this.el),this.rendered=!0,this.updateVolumeUI(),this.trigger(ue.MEDIACONTROL_RENDERED),this}}])}(_e);Rt.extend=function(e){return Dt(Rt,e)};for(var Ot=function(e){function t(e){var r;return rt(this,t),(r=Je(this,t,[e])).hasStartedPlaying=!1,r.playRequested=!1,r.render(),setTimeout((function(){return r.update()}),0),r}return at(t,e),nt(t,[{key:"name",get:function(){return"poster"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"template",get:function(){return Ae('<div class="play-wrapper" data-poster></div>\n')}},{key:"shouldRender",get:function(){var e=!(!this.options.poster||!this.options.poster.showForNoOp);return"html_img"!==this.container.playback.name&&(this.container.playback.getPlaybackType()!==Le.NO_OP||e)}},{key:"attributes",get:function(){return{class:"player-poster","data-poster":""}}},{key:"events",get:function(){return{click:"clicked"}}},{key:"showOnVideoEnd",get:function(){return!this.options.poster||this.options.poster.showOnVideoEnd||void 0===this.options.poster.showOnVideoEnd}},{key:"bindEvents",value:function(){this.listenTo(this.container,ue.CONTAINER_STOP,this.onStop),this.listenTo(this.container,ue.CONTAINER_PLAY,this.onPlay),this.listenTo(this.container,ue.CONTAINER_STATE_BUFFERING,this.update),this.listenTo(this.container,ue.CONTAINER_STATE_BUFFERFULL,this.update),this.listenTo(this.container,ue.CONTAINER_OPTIONS_CHANGE,this.render),this.listenTo(this.container,ue.CONTAINER_ERROR,this.onError),this.showOnVideoEnd&&this.listenTo(this.container,ue.CONTAINER_ENDED,this.onStop)}},{key:"onError",value:function(e){this.hasFatalError=e.level===ke.Levels.FATAL,this.hasFatalError&&(this.hasStartedPlaying=!1,this.playRequested=!1,this.showPlayButton())}},{key:"onPlay",value:function(){this.hasStartedPlaying=!0,this.update()}},{key:"onStop",value:function(){this.hasStartedPlaying=!1,this.playRequested=!1,this.update()}},{key:"updatePlayButton",value:function(e){!e||this.options.chromeless&&!this.options.allowUserInteraction?this.hidePlayButton():this.showPlayButton()}},{key:"showPlayButton",value:function(){this.hasFatalError&&!this.options.disableErrorScreen||(this.$playButton.show(),this.$el.addClass("clickable"))}},{key:"hidePlayButton",value:function(){this.$playButton.hide(),this.$el.removeClass("clickable")}},{key:"clicked",value:function(){if(!this.hasStartedPlaying)return this.options.chromeless&&!this.options.allowUserInteraction||(this.playRequested=!0,this.update(),this.container.playback&&(this.container.playback._consented=!0),this.container.play()),!1}},{key:"shouldHideOnPlay",value:function(){return!this.container.playback.isAudioOnly}},{key:"update",value:function(){if(this.shouldRender){var e=!this.playRequested&&!this.hasStartedPlaying&&!this.container.buffering;this.updatePlayButton(e),this.updatePoster()}}},{key:"updatePoster",value:function(){this.hasStartedPlaying?this.hidePoster():this.showPoster()}},{key:"showPoster",value:function(){this.container.disableMediaControl(),this.$el.show()}},{key:"hidePoster",value:function(){this.container.enableMediaControl(),this.shouldHideOnPlay()&&this.$el.hide()}},{key:"render",value:function(){if(this.shouldRender){var e=Ee.getStyleFor(".player-poster[data-poster] {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n height: 100%;\n width: 100%;\n z-index: 998;\n top: 0;\n left: 0;\n background-color: transparent;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: 50% 50%; }\n .player-poster[data-poster].clickable {\n cursor: pointer; }\n .player-poster[data-poster]:hover .play-wrapper[data-poster] {\n opacity: 1; }\n .player-poster[data-poster] .play-wrapper[data-poster] {\n width: 100%;\n height: 25%;\n margin: 0 auto;\n opacity: 0.75;\n transition: opacity 0.1s ease; }\n .player-poster[data-poster] .play-wrapper[data-poster] svg {\n height: 100%; }\n .player-poster[data-poster] .play-wrapper[data-poster] svg path {\n fill: #fff; }\n",{baseUrl:this.options.baseUrl});if(this.$el.html(this.template()),this.$el.append(e[0]),this.options.poster&&void 0===this.options.poster.custom){var t=this.options.poster.url||this.options.poster;this.$el.css({"background-image":"url("+t+")"}),this.removeVideoElementPoster()}else this.options.poster&&(this.$el.css({background:this.options.poster.custom}),this.removeVideoElementPoster());this.container.$el.append(this.el),this.$playWrapper=this.$el.find(".play-wrapper"),this.$playWrapper.append(gt),this.$playButton=this.$playWrapper.find("svg"),this.$playButton.addClass("poster-icon"),this.$playButton.attr("data-poster","");var r=this.options.mediacontrol&&this.options.mediacontrol.buttons;return r&&this.$el.find("svg path").css("fill",r),this.options.mediacontrol&&this.options.mediacontrol.buttons&&(r=this.options.mediacontrol.buttons,this.$playButton.css("color",r)),this.update(),this}}},{key:"removeVideoElementPoster",value:function(){this.container.playback&&this.container.playback.$el&&this.container.playback.$el[0]&&this.container.playback.$el[0].removeAttribute&&this.container.playback.$el[0].removeAttribute("poster")}}])}(Ve),wt=Q.formatTime,Pt=function(e){function t(e){var r;return rt(this,t),(r=Je(this,t,[e])).hoveringOverSeekBar=!1,r.hoverPosition=null,r.duration=null,r.firstFragDateTime=null,r.actualLiveTime=!!r.mediaControl.options.actualLiveTime,r.actualLiveTime&&(r.mediaControl.options.actualLiveServerTime?r.actualLiveServerTimeDiff=(new Date).getTime()-new Date(r.mediaControl.options.actualLiveServerTime).getTime():r.actualLiveServerTimeDiff=0),r}return at(t,e),nt(t,[{key:"name",get:function(){return"seek_time"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"template",get:function(){return Ae("<span data-seek-time></span>\n<span data-duration></span>\n")}},{key:"attributes",get:function(){return{class:"seek-time","data-seek-time":""}}},{key:"mediaControl",get:function(){return this.core.mediaControl}},{key:"mediaControlContainer",get:function(){return this.mediaControl.container}},{key:"isLiveStreamWithDvr",get:function(){return this.mediaControlContainer&&this.mediaControlContainer.getPlaybackType()===Le.LIVE&&this.mediaControlContainer.isDvrEnabled()}},{key:"durationShown",get:function(){return this.isLiveStreamWithDvr&&!this.actualLiveTime}},{key:"useActualLiveTime",get:function(){return this.actualLiveTime&&this.isLiveStreamWithDvr}},{key:"bindEvents",value:function(){this.listenTo(this.mediaControl,ue.MEDIACONTROL_RENDERED,this.render),this.listenTo(this.mediaControl,ue.MEDIACONTROL_MOUSEMOVE_SEEKBAR,this.showTime),this.listenTo(this.mediaControl,ue.MEDIACONTROL_MOUSELEAVE_SEEKBAR,this.hideTime),this.listenTo(this.mediaControl,ue.MEDIACONTROL_CONTAINERCHANGED,this.onContainerChanged),this.mediaControlContainer&&(this.listenTo(this.mediaControlContainer,ue.CONTAINER_PLAYBACKDVRSTATECHANGED,this.update),this.listenTo(this.mediaControlContainer,ue.CONTAINER_TIMEUPDATE,this.updateDuration))}},{key:"onContainerChanged",value:function(){this.stopListening(),this.bindEvents()}},{key:"updateDuration",value:function(e){this.duration=e.total,this.firstFragDateTime=e.firstFragDateTime,this.update()}},{key:"showTime",value:function(e){this.hoveringOverSeekBar=!0,this.calculateHoverPosition(e),this.update()}},{key:"hideTime",value:function(){this.hoveringOverSeekBar=!1,this.update()}},{key:"calculateHoverPosition",value:function(e){var t=e.pageX-this.mediaControl.$seekBarContainer.offset().left;this.hoverPosition=Math.min(1,Math.max(t/this.mediaControl.$seekBarContainer.width(),0))}},{key:"getSeekTime",value:function(){var e,t,r,i;return this.useActualLiveTime?(this.firstFragDateTime?(i=new Date(this.firstFragDateTime),(r=new Date(this.firstFragDateTime)).setHours(0,0,0,0),t=(i.getTime()-r.getTime())/1e3+this.duration):(r=new Date((new Date).getTime()-this.actualLiveServerTimeDiff),t=((i=new Date(r))-r.setHours(0,0,0,0))/1e3),(e=t-this.duration+this.hoverPosition*this.duration)<0&&(e+=86400)):e=this.hoverPosition*this.duration,{seekTime:e,secondsSinceMidnight:t}}},{key:"update",value:function(){if(this.rendered)if(this.shouldBeVisible()){var e=this.getSeekTime(),t=wt(e.seekTime,this.useActualLiveTime);if(t!==this.displayedSeekTime&&(this.$seekTimeEl.text(t),this.displayedSeekTime=t),this.durationShown){this.$durationEl.show();var r=wt(this.actualLiveTime?e.secondsSinceMidnight:this.duration,this.actualLiveTime);r!==this.displayedDuration&&(this.$durationEl.text(r),this.displayedDuration=r)}else this.$durationEl.hide();this.$el.show();var i=this.mediaControl.$seekBarContainer.width(),n=this.$el.width(),a=this.hoverPosition*i;a-=n/2,a=Math.max(0,Math.min(a,i-n)),this.$el.css("left",a)}else this.$el.hide(),this.$el.css("left","-100%")}},{key:"shouldBeVisible",value:function(){return this.mediaControlContainer&&this.mediaControlContainer.settings.seekEnabled&&this.hoveringOverSeekBar&&null!==this.hoverPosition&&null!==this.duration}},{key:"render",value:function(){var e=Ee.getStyleFor('.seek-time[data-seek-time] {\n position: absolute;\n white-space: nowrap;\n height: 20px;\n line-height: 20px;\n font-size: 0;\n left: -100%;\n bottom: 55px;\n background-color: rgba(2, 2, 2, 0.5);\n z-index: 9999;\n transition: opacity 0.1s ease; }\n .seek-time[data-seek-time].hidden[data-seek-time] {\n opacity: 0; }\n .seek-time[data-seek-time] [data-seek-time] {\n display: inline-block;\n color: white;\n font-size: 10px;\n padding-left: 7px;\n padding-right: 7px;\n vertical-align: top; }\n .seek-time[data-seek-time] [data-duration] {\n display: inline-block;\n color: rgba(255, 255, 255, 0.5);\n font-size: 10px;\n padding-right: 7px;\n vertical-align: top; }\n .seek-time[data-seek-time] [data-duration]:before {\n content: "|";\n margin-right: 7px; }\n',{baseUrl:this.options.baseUrl});this.rendered=!0,this.displayedDuration=null,this.displayedSeekTime=null,this.$el.html(this.template()),this.$el.append(e[0]),this.$el.hide(),this.mediaControl.$el.append(this.el),this.$seekTimeEl=this.$el.find("[data-seek-time]"),this.$durationEl=this.$el.find("[data-duration]"),this.$durationEl.hide(),this.update()}}])}(_e),xt={ClickToPause:ct,ClosedCaptions:dt,DVRControls:ht,EndVideo:ft,ErrorScreen:pt,Favicon:yt,GoogleAnalytics:At,MediaControl:Rt,Poster:Ot,SeekTime:Pt,SpinnerThreeBounce:function(e){function t(e){var r;return rt(this,t),(r=Je(this,t,[e])).template=Ae("<div data-bounce1></div><div data-bounce2></div><div data-bounce3></div>\n"),r.showTimeout=null,r.listenTo(r.container,ue.CONTAINER_STATE_BUFFERING,r.onBuffering),r.listenTo(r.container,ue.CONTAINER_STATE_BUFFERFULL,r.onBufferFull),r.listenTo(r.container,ue.CONTAINER_STOP,r.onStop),r.listenTo(r.container,ue.CONTAINER_ENDED,r.onStop),r.listenTo(r.container,ue.CONTAINER_ERROR,r.onStop),r.render(),r}return at(t,e),nt(t,[{key:"name",get:function(){return"spinner"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"attributes",get:function(){return{"data-spinner":"",class:"spinner-three-bounce"}}},{key:"onBuffering",value:function(){this.show()}},{key:"onBufferFull",value:function(){this.hide()}},{key:"onStop",value:function(){this.hide()}},{key:"show",value:function(){var e=this;null===this.showTimeout&&(this.showTimeout=setTimeout((function(){return e.$el.show()}),300))}},{key:"hide",value:function(){null!==this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=null),this.$el.hide()}},{key:"render",value:function(){var e=Ee.getStyleFor(".spinner-three-bounce[data-spinner] {\n position: absolute;\n margin: 0 auto;\n width: 70px;\n text-align: center;\n z-index: 999;\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n /* center vertically */\n top: 50%;\n transform: translateY(-50%); }\n .spinner-three-bounce[data-spinner] > div {\n width: 18px;\n height: 18px;\n background-color: #FFFFFF;\n border-radius: 100%;\n display: inline-block;\n animation: bouncedelay 1.4s infinite ease-in-out;\n /* Prevent first frame from flickering when animation starts */\n animation-fill-mode: both; }\n .spinner-three-bounce[data-spinner] [data-bounce1] {\n animation-delay: -0.32s; }\n .spinner-three-bounce[data-spinner] [data-bounce2] {\n animation-delay: -0.16s; }\n\n@keyframes bouncedelay {\n 0%, 80%, 100% {\n transform: scale(0); }\n 40% {\n transform: scale(1); } }\n",{baseUrl:this.options.baseUrl});return this.$el.html(this.template()),this.$el.append(e[0]),this.container.$el.append(this.$el),this.$el.hide(),this.container.buffering&&this.onBuffering(),this}}])}(Ve),Stats:function(e){function t(e){var r;return rt(this,t),(r=Je(this,t,[e])).setInitialAttrs(),r.reportInterval=r.options.reportInterval||5e3,r.state="IDLE",r}return at(t,e),nt(t,[{key:"name",get:function(){return"stats"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"bindEvents",value:function(){this.listenTo(this.container.playback,ue.PLAYBACK_PLAY,this.onPlay),this.listenTo(this.container,ue.CONTAINER_STOP,this.onStop),this.listenTo(this.container,ue.CONTAINER_ENDED,this.onStop),this.listenTo(this.container,ue.CONTAINER_DESTROYED,this.onStop),this.listenTo(this.container,ue.CONTAINER_STATE_BUFFERING,this.onBuffering),this.listenTo(this.container,ue.CONTAINER_STATE_BUFFERFULL,this.onBufferFull),this.listenTo(this.container,ue.CONTAINER_STATS_ADD,this.onStatsAdd),this.listenTo(this.container,ue.CONTAINER_BITRATE,this.onStatsAdd),this.listenTo(this.container.playback,ue.PLAYBACK_STATS_ADD,this.onStatsAdd)}},{key:"setInitialAttrs",value:function(){this.firstPlay=!0,this.startupTime=0,this.rebufferingTime=0,this.watchingTime=0,this.rebuffers=0,this.externalMetrics={}}},{key:"onPlay",value:function(){this.state="PLAYING",this.watchingTimeInit=Date.now(),this.intervalId||(this.intervalId=setInterval(this.report.bind(this),this.reportInterval))}},{key:"onStop",value:function(){clearInterval(this.intervalId),this.report(),this.intervalId=void 0,this.state="STOPPED"}},{key:"onBuffering",value:function(){this.firstPlay?this.startupTimeInit=Date.now():this.rebufferingTimeInit=Date.now(),this.state="BUFFERING",this.rebuffers++}},{key:"onBufferFull",value:function(){this.firstPlay&&this.startupTimeInit?(this.firstPlay=!1,this.startupTime=Date.now()-this.startupTimeInit,this.watchingTimeInit=Date.now()):this.rebufferingTimeInit&&(this.rebufferingTime+=this.getRebufferingTime()),this.rebufferingTimeInit=void 0,this.state="PLAYING"}},{key:"getRebufferingTime",value:function(){return Date.now()-this.rebufferingTimeInit}},{key:"getWatchingTime",value:function(){return Date.now()-this.watchingTimeInit-this.rebufferingTime}},{key:"isRebuffering",value:function(){return!!this.rebufferingTimeInit}},{key:"onStatsAdd",value:function(e){S.extend(this.externalMetrics,e)}},{key:"getStats",value:function(){var e={startupTime:this.startupTime,rebuffers:this.rebuffers,rebufferingTime:this.isRebuffering()?this.rebufferingTime+this.getRebufferingTime():this.rebufferingTime,watchingTime:this.isRebuffering()?this.getWatchingTime()-this.getRebufferingTime():this.getWatchingTime()};return S.extend(e,this.externalMetrics),e}},{key:"report",value:function(){this.container.statsReport(this.getStats())}}])}(Ue),WaterMark:function(e){function t(e){var r;return rt(this,t),(r=Je(this,t,[e])).configure(),r}return at(t,e),nt(t,[{key:"name",get:function(){return"watermark"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"template",get:function(){return Ae('<div class="clappr-watermark" data-watermark data-watermark-<%=position %>>\n<% if(typeof imageLink !== \'undefined\') { %>\n<a target="_blank" href="<%= imageLink %>">\n<% } %>\n<img src="<%= imageUrl %>">\n<% if(typeof imageLink !== \'undefined\') { %>\n</a>\n<% } %>\n</div>\n')}},{key:"bindEvents",value:function(){this.listenTo(this.container,ue.CONTAINER_PLAY,this.onPlay),this.listenTo(this.container,ue.CONTAINER_STOP,this.onStop),this.listenTo(this.container,ue.CONTAINER_OPTIONS_CHANGE,this.configure)}},{key:"configure",value:function(){this.position=this.options.position||"bottom-right",this.options.watermark?(this.imageUrl=this.options.watermark,this.imageLink=this.options.watermarkLink,this.render()):this.$el.remove()}},{key:"onPlay",value:function(){this.hidden||this.$el.show()}},{key:"onStop",value:function(){this.$el.hide()}},{key:"render",value:function(){this.$el.hide();var e=Ee.getStyleFor(".clappr-watermark[data-watermark] {\n position: absolute;\n min-width: 70px;\n max-width: 200px;\n width: 12%;\n text-align: center;\n z-index: 10; }\n\n.clappr-watermark[data-watermark] a {\n outline: none;\n cursor: pointer; }\n\n.clappr-watermark[data-watermark] img {\n max-width: 100%; }\n\n.clappr-watermark[data-watermark-bottom-left] {\n bottom: 10px;\n left: 10px; }\n\n.clappr-watermark[data-watermark-bottom-right] {\n bottom: 10px;\n right: 42px; }\n\n.clappr-watermark[data-watermark-top-left] {\n top: 10px;\n left: 10px; }\n\n.clappr-watermark[data-watermark-top-right] {\n top: 10px;\n right: 37px; }\n",{baseUrl:this.options.baseUrl}),t={position:this.position,imageUrl:this.imageUrl,imageLink:this.imageLink};return this.$el.html(this.template(t)),this.$el.append(e[0]),this.container.$el.append(this.$el),this}}])}(Ve)},Nt=0,Mt=Object.values(xt);Nt<Mt.length;Nt++){var Ft=Mt[Nt];Me.registerPlugin(Ft)}var Bt=xt.ClickToPause,Ut=xt.ClosedCaptions,Gt=xt.DVRControls,Vt=xt.EndVideo,Kt=xt.ErrorScreen,jt=xt.Favicon,Ht=xt.GoogleAnalytics,Yt=xt.MediaControl,Wt=xt.Poster,$t=xt.SeekTime,zt=xt.SpinnerThreeBounce,qt=xt.Stats,Xt=xt.WaterMark,Zt=t(t({},Qe),{},{ClickToPause:Bt,ClosedCaptions:Ut,DVRControls:Gt,EndVideo:Vt,ErrorScreen:Kt,Favicon:jt,GoogleAnalytics:Ht,MediaControl:Yt,Poster:Wt,SeekTime:$t,SpinnerThreeBounce:zt,Stats:qt,WaterMark:Xt,Vendor:Tt,Plugins:xt,version:"0.7.0"});function Qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function Jt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qt(Object(r),!0).forEach((function(t){tr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function er(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,ur(i.key),i)}}function tr(e,t,r){return(t=ur(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rr(e){return rr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rr(e)}function ir(e,t){return ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ir(e,t)}function nr(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ar(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=rr(e);if(t){var n=rr(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return nr(this,r)}}function sr(){return sr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=rr(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},sr.apply(this,arguments)}function or(e){return function(e){if(Array.isArray(e))return lr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return lr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lr(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function ur(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function cr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dr,hr,fr={exports:{}};dr=fr,"undefined"!=typeof window&&(hr=()=>(()=>{var e={"./src/config.ts":
2
2
  /*!***********************!*\
3
3
  !*** ./src/config.ts ***!
4
4
  \***********************/
@@ -218,7 +218,7 @@ var Clappr=function(){"use strict";function e(e,t){var r=Object.keys(e);if(Objec
218
218
  /*!***********************************!*\
219
219
  !*** ./src/loader/m3u8-parser.ts ***!
220
220
  \***********************************/
221
- (e,t,r)=>{r.r(t),r.d(t,{default:()=>m});var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),a=r(/*! ./date-range */"./src/loader/date-range.ts"),s=r(/*! ./fragment */"./src/loader/fragment.ts"),o=r(/*! ./level-details */"./src/loader/level-details.ts"),l=r(/*! ./level-key */"./src/loader/level-key.ts"),u=r(/*! ../utils/attr-list */"./src/utils/attr-list.ts"),c=r(/*! ../utils/logger */"./src/utils/logger.ts"),d=r(/*! ../utils/codecs */"./src/utils/codecs.ts"),h=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,f=/#EXT-X-MEDIA:(.*)/g,p=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),g=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|"0.6.0"): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),v=/\.(mp4|m4s|m4v|m4a)$/i,m=function(){function e(){}return e.findGroup=function(e,t){for(var r=0;r<e.length;r++){var i=e[r];if(i.id===t)return i}},e.convertAVC1ToAVCOTI=function(e){var t=e.split(".");if(t.length>2){var r=t.shift()+".";return r+=parseInt(t.shift()).toString(16),r+=("000"+parseInt(t.shift()).toString(16)).slice(-4)}return e},e.resolve=function(e,t){return n.buildAbsoluteURL(t,e,{alwaysNormalize:!0})},e.parseMasterPlaylist=function(t,r){var i,n=[],a=[],s={},o=!1;for(h.lastIndex=0;null!=(i=h.exec(t));)if(i[1]){var l,c=new u.AttrList(i[1]),d={attrs:c,bitrate:c.decimalInteger("AVERAGE-BANDWIDTH")||c.decimalInteger("BANDWIDTH"),name:c.NAME,url:e.resolve(i[2],r)},f=c.decimalResolution("RESOLUTION");f&&(d.width=f.width,d.height=f.height),y((c.CODECS||"").split(/[ ,]+/).filter((function(e){return e})),d),d.videoCodec&&-1!==d.videoCodec.indexOf("avc1")&&(d.videoCodec=e.convertAVC1ToAVCOTI(d.videoCodec)),null!==(l=d.unknownCodecs)&&void 0!==l&&l.length||a.push(d),n.push(d)}else if(i[3]){var p=new u.AttrList(i[3]);p["DATA-ID"]&&(o=!0,s[p["DATA-ID"]]=p)}return{levels:a.length>0&&a.length<n.length?a:n,sessionData:o?s:null}},e.parseMasterPlaylistMedia=function(t,r,i,n){var a;void 0===n&&(n=[]);var s=[],o=0;for(f.lastIndex=0;null!==(a=f.exec(t));){var l=new u.AttrList(a[1]);if(l.TYPE===i){var c={attrs:l,bitrate:0,id:o++,groupId:l["GROUP-ID"],instreamId:l["INSTREAM-ID"],name:l.NAME||l.LANGUAGE||"",type:i,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:l.LANGUAGE,url:l.URI?e.resolve(l.URI,r):""};if(n.length){var d=e.findGroup(n,c.groupId)||n[0];A(c,d,"audioCodec"),A(c,d,"textCodec")}s.push(c)}}return s},e.parseLevelPlaylist=function(e,t,r,d,h){var f,m,y,A=new o.LevelDetails(t),b=A.fragments,k=null,S=0,_=0,C=0,L=0,D=null,I=new s.Fragment(d,t),R=-1,O=!1;for(p.lastIndex=0,A.m3u8=e;null!==(f=p.exec(e));){O&&(O=!1,(I=new s.Fragment(d,t)).start=C,I.sn=S,I.cc=L,I.level=r,k&&(I.initSegment=k,I.rawProgramDateTime=k.rawProgramDateTime,k.rawProgramDateTime=null));var w=f[1];if(w){I.duration=parseFloat(w);var P=(" "+f[2]).slice(1);I.title=P||null,I.tagList.push(P?["INF",w,P]:["INF",w])}else if(f[3])(0,i.isFiniteNumber)(I.duration)&&(I.start=C,y&&(I.levelkey=y),I.sn=S,I.level=r,I.cc=L,I.urlId=h,b.push(I),I.relurl=(" "+f[3]).slice(1),E(I,D),D=I,C+=I.duration,S++,_=0,O=!0);else if(f[4]){var x=(" "+f[4]).slice(1);D?I.setByteRange(x,D):I.setByteRange(x)}else if(f[5])I.rawProgramDateTime=(" "+f[5]).slice(1),I.tagList.push(["PROGRAM-DATE-TIME",I.rawProgramDateTime]),-1===R&&(R=b.length);else{if(!(f=f[0].match(g))){c.logger.warn("No matches on slow regex match for level playlist!");continue}for(m=1;m<f.length&&void 0===f[m];m++);var N=(" "+f[m]).slice(1),M=(" "+f[m+1]).slice(1),F=f[m+2]?(" "+f[m+2]).slice(1):"";switch(N){case"PLAYLIST-TYPE":A.type=M.toUpperCase();break;case"MEDIA-SEQUENCE":S=A.startSN=parseInt(M);break;case"SKIP":var B=new u.AttrList(M),U=B.decimalInteger("SKIPPED-SEGMENTS");if((0,i.isFiniteNumber)(U)){A.skippedSegments=U;for(var G=U;G--;)b.unshift(null);S+=U}var V=B.enumeratedString("RECENTLY-REMOVED-DATERANGES");V&&(A.recentlyRemovedDateranges=V.split("\t"));break;case"TARGETDURATION":A.targetduration=parseFloat(M);break;case'"0.6.0"':A.version=parseInt(M);break;case"EXTM3U":break;case"ENDLIST":A.live=!1;break;case"#":(M||F)&&I.tagList.push(F?[M,F]:[M]);break;case"DISCONTINUITY":L++,I.tagList.push(["DIS"]);break;case"GAP":I.tagList.push([N]);break;case"BITRATE":I.tagList.push([N,M]);break;case"DATERANGE":var K=new u.AttrList(M),j=new a.DateRange(K,A.dateRanges[K.ID]);j.isValid||A.skippedSegments?A.dateRanges[j.id]=j:c.logger.warn('Ignoring invalid DATERANGE tag: "'+M+'"'),I.tagList.push(["EXT-X-DATERANGE",M]);break;case"DISCONTINUITY-SEQUENCE":L=parseInt(M);break;case"KEY":var H,Y=new u.AttrList(M),W=Y.enumeratedString("METHOD"),$=Y.URI,z=Y.hexadecimalInteger("IV"),q=Y.enumeratedString("KEYFORMATVERSIONS"),X=Y.enumeratedString("KEYID"),Z=null!=(H=Y.enumeratedString("KEYFORMAT"))?H:"identity";if(["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"].indexOf(Z)>-1){c.logger.warn("Keyformat "+Z+" is not supported from the manifest");continue}if("identity"!==Z)continue;W&&(y=l.LevelKey.fromURL(t,$),$&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(W)>=0&&(y.method=W,y.keyFormat=Z,X&&(y.keyID=X),q&&(y.keyFormatVersions=q),y.iv=z));break;case"START":var Q=new u.AttrList(M).decimalFloatingPoint("TIME-OFFSET");(0,i.isFiniteNumber)(Q)&&(A.startTimeOffset=Q);break;case"MAP":var J=new u.AttrList(M);if(I.duration){var ee=new s.Fragment(d,t);T(ee,J,r,y),k=ee,I.initSegment=k,k.rawProgramDateTime&&!I.rawProgramDateTime&&(I.rawProgramDateTime=k.rawProgramDateTime)}else T(I,J,r,y),k=I,O=!0;break;case"SERVER-CONTROL":var te=new u.AttrList(M);A.canBlockReload=te.bool("CAN-BLOCK-RELOAD"),A.canSkipUntil=te.optionalFloat("CAN-SKIP-UNTIL",0),A.canSkipDateRanges=A.canSkipUntil>0&&te.bool("CAN-SKIP-DATERANGES"),A.partHoldBack=te.optionalFloat("PART-HOLD-BACK",0),A.holdBack=te.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var re=new u.AttrList(M);A.partTarget=re.decimalFloatingPoint("PART-TARGET");break;case"PART":var ie=A.partList;ie||(ie=A.partList=[]);var ne=_>0?ie[ie.length-1]:void 0,ae=_++,se=new s.Part(new u.AttrList(M),I,t,ae,ne);ie.push(se),I.duration+=se.duration;break;case"PRELOAD-HINT":var oe=new u.AttrList(M);A.preloadHint=oe;break;case"RENDITION-REPORT":var le=new u.AttrList(M);A.renditionReports=A.renditionReports||[],A.renditionReports.push(le);break;default:c.logger.warn("line parsed but not handled: "+f)}}}D&&!D.relurl?(b.pop(),C-=D.duration,A.partList&&(A.fragmentHint=D)):A.partList&&(E(I,D),I.cc=L,A.fragmentHint=I);var ue=b.length,ce=b[0],de=b[ue-1];if((C+=A.skippedSegments*A.targetduration)>0&&ue&&de){A.averagetargetduration=C/ue;var he=de.sn;A.endSN="initSegment"!==he?he:0,ce&&(A.startCC=ce.cc,ce.initSegment||A.fragments.every((function(e){return e.relurl&&(t=e.relurl,v.test(null!=(r=null===(i=n.parseURL(t))||void 0===i?void 0:i.path)?r:""));var t,r,i}))&&(c.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(I=new s.Fragment(d,t)).relurl=de.relurl,I.level=r,I.sn="initSegment",ce.initSegment=I,A.needSidxRanges=!0))}else A.endSN=0,A.startCC=0;return A.fragmentHint&&(C+=A.fragmentHint.duration),A.totalduration=C,A.endCC=L,R>0&&function(e,t){for(var r=e[t],i=t;i--;){var n=e[i];if(!n)return;n.programDateTime=r.programDateTime-1e3*n.duration,r=n}}(b,R),A},e}();function y(e,t){["video","audio","text"].forEach((function(r){var i=e.filter((function(e){return(0,d.isCodecType)(e,r)}));if(i.length){var n=i.filter((function(e){return 0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)}));t[r+"Codec"]=n.length>0?n[0]:i[0],e=e.filter((function(e){return-1===i.indexOf(e)}))}})),t.unknownCodecs=e}function A(e,t,r){var i=t[r];i&&(e[r]=i)}function E(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),(0,i.isFiniteNumber)(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}function T(e,t,r,i){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=r,e.sn="initSegment",i&&(e.levelkey=i),e.initSegment=null}},"./src/loader/playlist-loader.ts":
221
+ (e,t,r)=>{r.r(t),r.d(t,{default:()=>m});var i=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=r(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),a=r(/*! ./date-range */"./src/loader/date-range.ts"),s=r(/*! ./fragment */"./src/loader/fragment.ts"),o=r(/*! ./level-details */"./src/loader/level-details.ts"),l=r(/*! ./level-key */"./src/loader/level-key.ts"),u=r(/*! ../utils/attr-list */"./src/utils/attr-list.ts"),c=r(/*! ../utils/logger */"./src/utils/logger.ts"),d=r(/*! ../utils/codecs */"./src/utils/codecs.ts"),h=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,f=/#EXT-X-MEDIA:(.*)/g,p=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),g=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|"0.7.0"): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),v=/\.(mp4|m4s|m4v|m4a)$/i,m=function(){function e(){}return e.findGroup=function(e,t){for(var r=0;r<e.length;r++){var i=e[r];if(i.id===t)return i}},e.convertAVC1ToAVCOTI=function(e){var t=e.split(".");if(t.length>2){var r=t.shift()+".";return r+=parseInt(t.shift()).toString(16),r+=("000"+parseInt(t.shift()).toString(16)).slice(-4)}return e},e.resolve=function(e,t){return n.buildAbsoluteURL(t,e,{alwaysNormalize:!0})},e.parseMasterPlaylist=function(t,r){var i,n=[],a=[],s={},o=!1;for(h.lastIndex=0;null!=(i=h.exec(t));)if(i[1]){var l,c=new u.AttrList(i[1]),d={attrs:c,bitrate:c.decimalInteger("AVERAGE-BANDWIDTH")||c.decimalInteger("BANDWIDTH"),name:c.NAME,url:e.resolve(i[2],r)},f=c.decimalResolution("RESOLUTION");f&&(d.width=f.width,d.height=f.height),y((c.CODECS||"").split(/[ ,]+/).filter((function(e){return e})),d),d.videoCodec&&-1!==d.videoCodec.indexOf("avc1")&&(d.videoCodec=e.convertAVC1ToAVCOTI(d.videoCodec)),null!==(l=d.unknownCodecs)&&void 0!==l&&l.length||a.push(d),n.push(d)}else if(i[3]){var p=new u.AttrList(i[3]);p["DATA-ID"]&&(o=!0,s[p["DATA-ID"]]=p)}return{levels:a.length>0&&a.length<n.length?a:n,sessionData:o?s:null}},e.parseMasterPlaylistMedia=function(t,r,i,n){var a;void 0===n&&(n=[]);var s=[],o=0;for(f.lastIndex=0;null!==(a=f.exec(t));){var l=new u.AttrList(a[1]);if(l.TYPE===i){var c={attrs:l,bitrate:0,id:o++,groupId:l["GROUP-ID"],instreamId:l["INSTREAM-ID"],name:l.NAME||l.LANGUAGE||"",type:i,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:l.LANGUAGE,url:l.URI?e.resolve(l.URI,r):""};if(n.length){var d=e.findGroup(n,c.groupId)||n[0];A(c,d,"audioCodec"),A(c,d,"textCodec")}s.push(c)}}return s},e.parseLevelPlaylist=function(e,t,r,d,h){var f,m,y,A=new o.LevelDetails(t),b=A.fragments,k=null,S=0,_=0,C=0,L=0,D=null,I=new s.Fragment(d,t),R=-1,O=!1;for(p.lastIndex=0,A.m3u8=e;null!==(f=p.exec(e));){O&&(O=!1,(I=new s.Fragment(d,t)).start=C,I.sn=S,I.cc=L,I.level=r,k&&(I.initSegment=k,I.rawProgramDateTime=k.rawProgramDateTime,k.rawProgramDateTime=null));var w=f[1];if(w){I.duration=parseFloat(w);var P=(" "+f[2]).slice(1);I.title=P||null,I.tagList.push(P?["INF",w,P]:["INF",w])}else if(f[3])(0,i.isFiniteNumber)(I.duration)&&(I.start=C,y&&(I.levelkey=y),I.sn=S,I.level=r,I.cc=L,I.urlId=h,b.push(I),I.relurl=(" "+f[3]).slice(1),E(I,D),D=I,C+=I.duration,S++,_=0,O=!0);else if(f[4]){var x=(" "+f[4]).slice(1);D?I.setByteRange(x,D):I.setByteRange(x)}else if(f[5])I.rawProgramDateTime=(" "+f[5]).slice(1),I.tagList.push(["PROGRAM-DATE-TIME",I.rawProgramDateTime]),-1===R&&(R=b.length);else{if(!(f=f[0].match(g))){c.logger.warn("No matches on slow regex match for level playlist!");continue}for(m=1;m<f.length&&void 0===f[m];m++);var N=(" "+f[m]).slice(1),M=(" "+f[m+1]).slice(1),F=f[m+2]?(" "+f[m+2]).slice(1):"";switch(N){case"PLAYLIST-TYPE":A.type=M.toUpperCase();break;case"MEDIA-SEQUENCE":S=A.startSN=parseInt(M);break;case"SKIP":var B=new u.AttrList(M),U=B.decimalInteger("SKIPPED-SEGMENTS");if((0,i.isFiniteNumber)(U)){A.skippedSegments=U;for(var G=U;G--;)b.unshift(null);S+=U}var V=B.enumeratedString("RECENTLY-REMOVED-DATERANGES");V&&(A.recentlyRemovedDateranges=V.split("\t"));break;case"TARGETDURATION":A.targetduration=parseFloat(M);break;case'"0.7.0"':A.version=parseInt(M);break;case"EXTM3U":break;case"ENDLIST":A.live=!1;break;case"#":(M||F)&&I.tagList.push(F?[M,F]:[M]);break;case"DISCONTINUITY":L++,I.tagList.push(["DIS"]);break;case"GAP":I.tagList.push([N]);break;case"BITRATE":I.tagList.push([N,M]);break;case"DATERANGE":var K=new u.AttrList(M),j=new a.DateRange(K,A.dateRanges[K.ID]);j.isValid||A.skippedSegments?A.dateRanges[j.id]=j:c.logger.warn('Ignoring invalid DATERANGE tag: "'+M+'"'),I.tagList.push(["EXT-X-DATERANGE",M]);break;case"DISCONTINUITY-SEQUENCE":L=parseInt(M);break;case"KEY":var H,Y=new u.AttrList(M),W=Y.enumeratedString("METHOD"),$=Y.URI,z=Y.hexadecimalInteger("IV"),q=Y.enumeratedString("KEYFORMATVERSIONS"),X=Y.enumeratedString("KEYID"),Z=null!=(H=Y.enumeratedString("KEYFORMAT"))?H:"identity";if(["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"].indexOf(Z)>-1){c.logger.warn("Keyformat "+Z+" is not supported from the manifest");continue}if("identity"!==Z)continue;W&&(y=l.LevelKey.fromURL(t,$),$&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(W)>=0&&(y.method=W,y.keyFormat=Z,X&&(y.keyID=X),q&&(y.keyFormatVersions=q),y.iv=z));break;case"START":var Q=new u.AttrList(M).decimalFloatingPoint("TIME-OFFSET");(0,i.isFiniteNumber)(Q)&&(A.startTimeOffset=Q);break;case"MAP":var J=new u.AttrList(M);if(I.duration){var ee=new s.Fragment(d,t);T(ee,J,r,y),k=ee,I.initSegment=k,k.rawProgramDateTime&&!I.rawProgramDateTime&&(I.rawProgramDateTime=k.rawProgramDateTime)}else T(I,J,r,y),k=I,O=!0;break;case"SERVER-CONTROL":var te=new u.AttrList(M);A.canBlockReload=te.bool("CAN-BLOCK-RELOAD"),A.canSkipUntil=te.optionalFloat("CAN-SKIP-UNTIL",0),A.canSkipDateRanges=A.canSkipUntil>0&&te.bool("CAN-SKIP-DATERANGES"),A.partHoldBack=te.optionalFloat("PART-HOLD-BACK",0),A.holdBack=te.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var re=new u.AttrList(M);A.partTarget=re.decimalFloatingPoint("PART-TARGET");break;case"PART":var ie=A.partList;ie||(ie=A.partList=[]);var ne=_>0?ie[ie.length-1]:void 0,ae=_++,se=new s.Part(new u.AttrList(M),I,t,ae,ne);ie.push(se),I.duration+=se.duration;break;case"PRELOAD-HINT":var oe=new u.AttrList(M);A.preloadHint=oe;break;case"RENDITION-REPORT":var le=new u.AttrList(M);A.renditionReports=A.renditionReports||[],A.renditionReports.push(le);break;default:c.logger.warn("line parsed but not handled: "+f)}}}D&&!D.relurl?(b.pop(),C-=D.duration,A.partList&&(A.fragmentHint=D)):A.partList&&(E(I,D),I.cc=L,A.fragmentHint=I);var ue=b.length,ce=b[0],de=b[ue-1];if((C+=A.skippedSegments*A.targetduration)>0&&ue&&de){A.averagetargetduration=C/ue;var he=de.sn;A.endSN="initSegment"!==he?he:0,ce&&(A.startCC=ce.cc,ce.initSegment||A.fragments.every((function(e){return e.relurl&&(t=e.relurl,v.test(null!=(r=null===(i=n.parseURL(t))||void 0===i?void 0:i.path)?r:""));var t,r,i}))&&(c.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(I=new s.Fragment(d,t)).relurl=de.relurl,I.level=r,I.sn="initSegment",ce.initSegment=I,A.needSidxRanges=!0))}else A.endSN=0,A.startCC=0;return A.fragmentHint&&(C+=A.fragmentHint.duration),A.totalduration=C,A.endCC=L,R>0&&function(e,t){for(var r=e[t],i=t;i--;){var n=e[i];if(!n)return;n.programDateTime=r.programDateTime-1e3*n.duration,r=n}}(b,R),A},e}();function y(e,t){["video","audio","text"].forEach((function(r){var i=e.filter((function(e){return(0,d.isCodecType)(e,r)}));if(i.length){var n=i.filter((function(e){return 0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)}));t[r+"Codec"]=n.length>0?n[0]:i[0],e=e.filter((function(e){return-1===i.indexOf(e)}))}})),t.unknownCodecs=e}function A(e,t,r){var i=t[r];i&&(e[r]=i)}function E(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),(0,i.isFiniteNumber)(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}function T(e,t,r,i){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=r,e.sn="initSegment",i&&(e.levelkey=i),e.initSegment=null}},"./src/loader/playlist-loader.ts":
222
222
  /*!***************************************!*\
223
223
  !*** ./src/loader/playlist-loader.ts ***!
224
224
  \***************************************/
@@ -370,5 +370,5 @@ e=>{var t=Object.prototype.hasOwnProperty,r="~";function i(){}function n(e,t,r){
370
370
  /*!*****************************************************!*\
371
371
  !*** ./node_modules/url-toolkit/src/url-toolkit.js ***!
372
372
  \*****************************************************/
373
- function(e){var t,r,i,n,a;t=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var n=a.parseURL(e);if(!n)throw new Error("Error trying to parse base URL.");return n.path=a.normalizePath(n.path),a.buildURLFromParts(n)}var s=a.parseURL(t);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return i.alwaysNormalize?(s.path=a.normalizePath(s.path),a.buildURLFromParts(s)):t;var o=a.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=r.exec(o.path);o.netLoc=l[1],o.path=l[2]}o.netLoc&&!o.path&&(o.path="/");var u={scheme:o.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc&&(u.netLoc=o.netLoc,"/"!==s.path[0]))if(s.path){var c=o.path,d=c.substring(0,c.lastIndexOf("/")+1)+s.path;u.path=a.normalizePath(d)}else u.path=o.path,s.params||(u.params=o.params,s.query||(u.query=o.query));return null===u.path&&(u.path=i.alwaysNormalize?a.normalizePath(s.path):s.path),a.buildURLFromParts(u)},parseURL:function(e){var r=t.exec(e);return r?{scheme:r[1]||"",netLoc:r[2]||"",path:r[3]||"",params:r[4]||"",query:r[5]||"",fragment:r[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(i,"");e.length!==(e=e.replace(n,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=a}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var a=t[i]={exports:{}};return e[i].call(a.exports,a,a.exports,r),a.exports}r.m=e,r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i=r("./src/hls.ts");return i=i.default})(),hr.exports=fr());var gr=dr(pr.exports),vr=Q.now,mr=Q.listContainsIgnoreCase;ue.register("PLAYBACK_FRAGMENT_CHANGED"),ue.register("PLAYBACK_FRAGMENT_PARSING_METADATA");var yr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nr(e,t)}(a,e);var t,r,i,n=sr(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return(e=n.call.apply(n,[this].concat(r))).options.hlsPlayback=er(er({},e.defaultOptions),e.options.hlsPlayback),e._setInitialState(),e}return t=a,r=[{key:"name",get:function(){return"hls"}},{key:"supportedVersion",get:function(){return{min:"0.7.2"}}},{key:"levels",get:function(){return this._levels||[]}},{key:"currentLevel",get:function(){return null===this._currentLevel||void 0===this._currentLevel?-1:this._currentLevel},set:function(e){this._currentLevel=e,this.trigger(ue.PLAYBACK_LEVEL_SWITCH_START),this.options.playback.hlsUseNextLevel?this._hls.nextLevel=this._currentLevel:this._hls.currentLevel=this._currentLevel}},{key:"isReady",get:function(){return this._isReadyState}},{key:"latency",get:function(){return this._hls.latency}},{key:"currentProgramDateTime",get:function(){return this._hls.playingDate}},{key:"_startTime",get:function(){return this._playbackType===De.LIVE&&"EVENT"!==this._playlistType?this._extrapolatedStartTime:this._playableRegionStartTime}},{key:"_now",get:function(){return vr()}},{key:"_extrapolatedStartTime",get:function(){if(!this._localStartTimeCorrelation)return this._playableRegionStartTime;var e=this._localStartTimeCorrelation,t=this._now-e.local,r=(e.remote+t)/1e3;return Math.min(r,this._playableRegionStartTime+this._extrapolatedWindowDuration)}},{key:"_extrapolatedEndTime",get:function(){var e=this._playableRegionStartTime+this._playableRegionDuration;if(!this._localEndTimeCorrelation)return e;var t=this._localEndTimeCorrelation,r=this._now-t.local,i=(t.remote+r)/1e3;return Math.max(e-this._extrapolatedWindowDuration,Math.min(i,e))}},{key:"_duration",get:function(){return this._extrapolatedEndTime-this._startTime}},{key:"_extrapolatedWindowDuration",get:function(){return null===this._segmentTargetDuration?0:this._extrapolatedWindowNumSegments*this._segmentTargetDuration}},{key:"bandwidthEstimate",get:function(){return this._hls&&this._hls.bandwidthEstimate}},{key:"defaultOptions",get:function(){return{preload:!0}}},{key:"customListeners",get:function(){return this.options.hlsPlayback&&this.options.hlsPlayback.customListeners||[]}},{key:"sourceMedia",get:function(){return this.options.src}},{key:"currentTimestamp",get:function(){return this._currentFragment?(this._currentFragment.programDateTime+1e3*(this.el.currentTime-this._currentFragment.start))/1e3:null}},{key:"_setInitialState",value:function(){this._minDvrSize=void 0===this.options.hlsMinimumDvrSize?60:this.options.hlsMinimumDvrSize,this._extrapolatedWindowNumSegments=this.options.playback&&void 0!==this.options.playback.extrapolatedWindowNumSegments?this.options.playback.extrapolatedWindowNumSegments:2,this._playbackType=De.VOD,this._lastTimeUpdate={current:0,total:0},this._lastDuration=null,this._playableRegionStartTime=0,this._localStartTimeCorrelation=null,this._localEndTimeCorrelation=null,this._playableRegionDuration=0,this._programDateTime=0,this._durationExcludesAfterLiveSyncPoint=!1,this._segmentTargetDuration=null,this._playlistType=null,this._recoverAttemptsRemaining=this.options.hlsRecoverAttempts||16}},{key:"_setup",value:function(){this._destroyHLSInstance(),this._createHLSInstance(),this._listenHLSEvents(),this._attachHLSMedia()}},{key:"_destroyHLSInstance",value:function(){this._hls&&(this._manifestParsed=!1,this._ccIsSetup=!1,this._ccTracksUpdated=!1,this._setInitialState(),this._hls.destroy(),this._hls=null)}},{key:"_createHLSInstance",value:function(){var e=er({},this.options.playback.hlsjsConfig);this._hls=new gr(e)}},{key:"_attachHLSMedia",value:function(){this._hls&&this._hls.attachMedia(this.el)}},{key:"_listenHLSEvents",value:function(){var e=this;this._hls&&(this._hls.once(gr.Events.MEDIA_ATTACHED,(function(){e.options.hlsPlayback.preload&&e._hls.loadSource(e.options.src)})),this._hls.on(gr.Events.MANIFEST_PARSED,(function(){return e._manifestParsed=!0})),this._hls.on(gr.Events.LEVEL_LOADED,(function(t,r){return e._updatePlaybackType(t,r)})),this._hls.on(gr.Events.LEVEL_UPDATED,(function(t,r){return e._onLevelUpdated(t,r)})),this._hls.on(gr.Events.LEVEL_SWITCHING,(function(t,r){return e._onLevelSwitch(t,r)})),this._hls.on(gr.Events.FRAG_CHANGED,(function(t,r){return e._onFragmentChanged(t,r)})),this._hls.on(gr.Events.FRAG_LOADED,(function(t,r){return e._onFragmentLoaded(t,r)})),this._hls.on(gr.Events.FRAG_PARSING_METADATA,(function(t,r){return e._onFragmentParsingMetadata(t,r)})),this._hls.on(gr.Events.ERROR,(function(t,r){return e._onHLSJSError(t,r)})),this._hls.on(gr.Events.SUBTITLE_TRACK_LOADED,(function(t,r){return e._onSubtitleLoaded(t,r)})),this._hls.on(gr.Events.SUBTITLE_TRACKS_UPDATED,(function(){return e._ccTracksUpdated=!0})),this.bindCustomListeners())}},{key:"bindCustomListeners",value:function(){var e=this;this.customListeners.forEach((function(t){var r=t.eventName,i=t.once?"once":"on";r&&e._hls["".concat(i)](r,t.callback)}))}},{key:"unbindCustomListeners",value:function(){var e=this;this.customListeners.forEach((function(t){var r=t.eventName;r&&e._hls.off(r,t.callback)}))}},{key:"_onFragmentParsingMetadata",value:function(e,t){this.trigger(ue.Custom.PLAYBACK_FRAGMENT_PARSING_METADATA,{evt:e,data:t})}},{key:"render",value:function(){return this._ready(),or(ir(a.prototype),"render",this).call(this)}},{key:"_ready",value:function(){this._isReadyState||(!this._hls&&this._setup(),this._isReadyState=!0,this.trigger(ue.PLAYBACK_READY,this.name))}},{key:"_recover",value:function(e,t,r){if(this._recoveredDecodingError)if(this._recoveredAudioCodecError){ne.error("hlsjs: failed to recover",{evt:e,data:t}),r.level=Se.Levels.FATAL;var i=this.createError(r);this.trigger(ue.PLAYBACK_ERROR,i),this.stop()}else this._recoveredAudioCodecError=!0,this._hls.swapAudioCodec(),this._hls.recoverMediaError();else this._recoveredDecodingError=!0,this._hls.recoverMediaError()}},{key:"_setupSrc",value:function(e){}},{key:"_startTimeUpdateTimer",value:function(){var e=this;this._timeUpdateTimer||(this._timeUpdateTimer=setInterval((function(){e._onDurationChange(),e._onTimeUpdate()}),100))}},{key:"_stopTimeUpdateTimer",value:function(){this._timeUpdateTimer&&(clearInterval(this._timeUpdateTimer),this._timeUpdateTimer=null)}},{key:"getProgramDateTime",value:function(){return this._programDateTime}},{key:"getDuration",value:function(){return this._duration}},{key:"getCurrentTime",value:function(){return Math.max(0,this.el.currentTime-this._startTime)}},{key:"getStartTimeOffset",value:function(){return this._startTime}},{key:"seekPercentage",value:function(e){var t=e>0?this._duration*(e/100):this._duration;this.seek(t)}},{key:"seek",value:function(e){e<0&&(ne.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(e<this.getDuration()-3),e+=this._startTime,this.el.currentTime=e}},{key:"seekToLivePoint",value:function(){this.seek(this.getDuration())}},{key:"_updateDvr",value:function(e){this.trigger(ue.PLAYBACK_DVR,e),this.trigger(ue.PLAYBACK_STATS_ADD,{dvr:e})}},{key:"_updateSettings",value:function(){this._playbackType===De.VOD?this.settings.left=["playpause","position","duration"]:this.dvrEnabled?this.settings.left=["playpause"]:this.settings.left=["playstop"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(ue.PLAYBACK_SETTINGSUPDATE)}},{key:"_onHLSJSError",value:function(e,t){var r,i={code:"".concat(t.type,"_").concat(t.details),description:"".concat(this.name," error: type: ").concat(t.type,", details: ").concat(t.details),raw:t};if(t.response&&(i.description+=", response: ".concat(JSON.stringify(t.response))),t.fatal)if(this._recoverAttemptsRemaining>0)switch(this._recoverAttemptsRemaining-=1,t.type){case gr.ErrorTypes.NETWORK_ERROR:switch(t.details){case gr.ErrorDetails.MANIFEST_LOAD_ERROR:case gr.ErrorDetails.MANIFEST_LOAD_TIMEOUT:case gr.ErrorDetails.MANIFEST_PARSING_ERROR:case gr.ErrorDetails.LEVEL_LOAD_ERROR:case gr.ErrorDetails.LEVEL_LOAD_TIMEOUT:ne.error("hlsjs: unrecoverable network fatal error.",{evt:e,data:t}),r=this.createError(i),this.trigger(ue.PLAYBACK_ERROR,r),this.stop();break;default:ne.warn("hlsjs: trying to recover from network error.",{evt:e,data:t}),i.level=Se.Levels.WARN,this._hls.startLoad()}break;case gr.ErrorTypes.MEDIA_ERROR:ne.warn("hlsjs: trying to recover from media error.",{evt:e,data:t}),i.level=Se.Levels.WARN,this._recover(e,t,i);break;default:ne.error("hlsjs: could not recover from error.",{evt:e,data:t}),r=this.createError(i),this.trigger(ue.PLAYBACK_ERROR,r),this.stop()}else ne.error("hlsjs: could not recover from error after maximum number of attempts.",{evt:e,data:t}),r=this.createError(i),this.trigger(ue.PLAYBACK_ERROR,r),this.stop();else{if(this.options.playback.triggerFatalErrorOnResourceDenied&&this._keyIsDenied(t))return ne.error("hlsjs: could not load decrypt key.",{evt:e,data:t}),r=this.createError(i),this.trigger(ue.PLAYBACK_ERROR,r),void this.stop();i.level=Se.Levels.WARN,ne.warn("hlsjs: non-fatal error occurred",{evt:e,data:t})}}},{key:"_keyIsDenied",value:function(e){return e.type===gr.ErrorTypes.NETWORK_ERROR&&e.details===gr.ErrorDetails.KEY_LOAD_ERROR&&e.response&&e.response.code>=400}},{key:"_onTimeUpdate",value:function(){var e={current:this.getCurrentTime(),total:this.getDuration(),firstFragDateTime:this.getProgramDateTime()};this._lastTimeUpdate&&e.current===this._lastTimeUpdate.current&&e.total===this._lastTimeUpdate.total||(this._lastTimeUpdate=e,this.trigger(ue.PLAYBACK_TIMEUPDATE,e,this.name))}},{key:"_onDurationChange",value:function(){var e=this.getDuration();this._lastDuration!==e&&(this._lastDuration=e,or(ir(a.prototype),"_onDurationChange",this).call(this))}},{key:"_onProgress",value:function(){if(this.el.buffered.length){for(var e=[],t=0,r=0;r<this.el.buffered.length;r++)e=[].concat(lr(e),[{start:Math.max(0,this.el.buffered.start(r)-this._playableRegionStartTime),end:Math.max(0,this.el.buffered.end(r)-this._playableRegionStartTime)}]),this.el.currentTime>=e[r].start&&this.el.currentTime<=e[r].end&&(t=r);var i={start:e[t].start,current:e[t].end,total:this.getDuration()};this.trigger(ue.PLAYBACK_PROGRESS,i,e)}}},{key:"load",value:function(e){this._stopTimeUpdateTimer(),this.options.src=e,this._setup()}},{key:"play",value:function(){!this._hls&&this._setup(),!this._manifestParsed&&!this.options.hlsPlayback.preload&&this._hls.loadSource(this.options.src),or(ir(a.prototype),"play",this).call(this),this._startTimeUpdateTimer()}},{key:"pause",value:function(){this._hls&&(this.el.pause(),this.dvrEnabled&&this._updateDvr(!0))}},{key:"stop",value:function(){this._stopTimeUpdateTimer(),this._hls&&or(ir(a.prototype),"stop",this).call(this),this._destroyHLSInstance()}},{key:"destroy",value:function(){this._stopTimeUpdateTimer(),this._destroyHLSInstance(),or(ir(a.prototype),"destroy",this).call(this)}},{key:"_updatePlaybackType",value:function(e,t){this._playbackType=t.details.live?De.LIVE:De.VOD,this._onLevelUpdated(e,t),this._ccTracksUpdated&&this._playbackType===De.LIVE&&this.hasClosedCaptionsTracks&&this._onSubtitleLoaded()}},{key:"_fillLevels",value:function(){this._levels=this._hls.levels.map((function(e,t){return{id:t,level:e,label:"".concat(e.bitrate/1e3,"Kbps")}})),this.trigger(ue.PLAYBACK_LEVELS_AVAILABLE,this._levels)}},{key:"_onLevelUpdated",value:function(e,t){this._segmentTargetDuration=t.details.targetduration,this._playlistType=t.details.type||null;var r=!1,i=!1,n=t.details.fragments,a=this._playableRegionStartTime,s=this._playableRegionDuration;if(0!==n.length){if(n[0].rawProgramDateTime&&(this._programDateTime=n[0].rawProgramDateTime),this._playableRegionStartTime!==n[0].start&&(r=!0,this._playableRegionStartTime=n[0].start),r)if(this._localStartTimeCorrelation){var o=this._localStartTimeCorrelation,l=this._now-o.local,u=(o.remote+l)/1e3;u<n[0].start?this._localStartTimeCorrelation={local:this._now,remote:1e3*n[0].start}:u>a+this._extrapolatedWindowDuration&&(this._localStartTimeCorrelation={local:this._now,remote:1e3*Math.max(n[0].start,a+this._extrapolatedWindowDuration)})}else this._localStartTimeCorrelation={local:this._now,remote:1e3*(n[0].start+this._extrapolatedWindowDuration/2)};var c=t.details.totalduration;if(this._playbackType===De.LIVE){var d=t.details.targetduration*((this.options.playback.hlsjsConfig||{}).liveSyncDurationCount||gr.DefaultConfig.liveSyncDurationCount);d<=c?(c-=d,this._durationExcludesAfterLiveSyncPoint=!0):this._durationExcludesAfterLiveSyncPoint=!1}c!==this._playableRegionDuration&&(i=!0,this._playableRegionDuration=c);var h=n[0].start+c,f=a+s;if(h!==f)if(this._localEndTimeCorrelation){var p=this._localEndTimeCorrelation,g=this._now-p.local,v=(p.remote+g)/1e3;v>h?this._localEndTimeCorrelation={local:this._now,remote:1e3*h}:v<h-this._extrapolatedWindowDuration?this._localEndTimeCorrelation={local:this._now,remote:1e3*(h-this._extrapolatedWindowDuration)}:v>f&&(this._localEndTimeCorrelation={local:this._now,remote:1e3*f})}else this._localEndTimeCorrelation={local:this._now,remote:1e3*h};i&&this._onDurationChange(),r&&this._onProgress()}}},{key:"_onFragmentChanged",value:function(e,t){this._currentFragment=t.frag,this.trigger(ue.Custom.PLAYBACK_FRAGMENT_CHANGED,t)}},{key:"_onFragmentLoaded",value:function(e,t){this.trigger(ue.PLAYBACK_FRAGMENT_LOADED,t)}},{key:"_onSubtitleLoaded",value:function(){if(!this._ccIsSetup){this.trigger(ue.PLAYBACK_SUBTITLE_AVAILABLE);var e=this._playbackType===De.LIVE?-1:this.closedCaptionsTrackId;this.closedCaptionsTrackId=e,this._ccIsSetup=!0}}},{key:"_onLevelSwitch",value:function(e,t){this.levels.length||this._fillLevels(),this.trigger(ue.PLAYBACK_LEVEL_SWITCH_END),this.trigger(ue.PLAYBACK_LEVEL_SWITCH,t);var r=this._hls.levels[t.level];r&&(this.highDefinition=r.height>=720||r.bitrate/1e3>=2e3,this.trigger(ue.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinition),this.trigger(ue.PLAYBACK_BITRATE,{height:r.height,width:r.width,bandwidth:r.bitrate,bitrate:r.bitrate,level:t.level}))}},{key:"dvrEnabled",get:function(){return this._durationExcludesAfterLiveSyncPoint&&this._duration>=this._minDvrSize&&this.getPlaybackType()===De.LIVE}},{key:"getPlaybackType",value:function(){return this._playbackType}},{key:"isSeekEnabled",value:function(){return this._playbackType===De.VOD||this.dvrEnabled}}],i=[{key:"HLSJS",get:function(){return gr}}],r&&tr(t.prototype,r),i&&tr(t,i),Object.defineProperty(t,"prototype",{writable:!1}),a}($e);return yr.canPlay=function(e,t){var r=e.split("?")[0].match(/.*\.(.*)$/)||[],i=r.length>1&&"m3u8"===r[1].toLowerCase()||mr(t,["application/vnd.apple.mpegurl","application/x-mpegURL"]);return!(!gr.isSupported()||!i)},Qt.Loader.registerPlayback(yr),t(t({},Qt),{},{HLS:yr})}();
373
+ function(e){var t,r,i,n,a;t=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var n=a.parseURL(e);if(!n)throw new Error("Error trying to parse base URL.");return n.path=a.normalizePath(n.path),a.buildURLFromParts(n)}var s=a.parseURL(t);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return i.alwaysNormalize?(s.path=a.normalizePath(s.path),a.buildURLFromParts(s)):t;var o=a.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=r.exec(o.path);o.netLoc=l[1],o.path=l[2]}o.netLoc&&!o.path&&(o.path="/");var u={scheme:o.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc&&(u.netLoc=o.netLoc,"/"!==s.path[0]))if(s.path){var c=o.path,d=c.substring(0,c.lastIndexOf("/")+1)+s.path;u.path=a.normalizePath(d)}else u.path=o.path,s.params||(u.params=o.params,s.query||(u.query=o.query));return null===u.path&&(u.path=i.alwaysNormalize?a.normalizePath(s.path):s.path),a.buildURLFromParts(u)},parseURL:function(e){var r=t.exec(e);return r?{scheme:r[1]||"",netLoc:r[2]||"",path:r[3]||"",params:r[4]||"",query:r[5]||"",fragment:r[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(i,"");e.length!==(e=e.replace(n,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=a}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var a=t[i]={exports:{}};return e[i].call(a.exports,a,a.exports,r),a.exports}r.m=e,r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i=r("./src/hls.ts");return i=i.default})(),dr.exports=hr());var pr=cr(fr.exports),gr=Q.now,vr=Q.listContainsIgnoreCase;ue.register("PLAYBACK_FRAGMENT_CHANGED"),ue.register("PLAYBACK_FRAGMENT_PARSING_METADATA");var mr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ir(e,t)}(a,e);var t,r,i,n=ar(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return(e=n.call.apply(n,[this].concat(r))).options.hlsPlayback=Jt(Jt({},e.defaultOptions),e.options.hlsPlayback),e._setInitialState(),e}return t=a,r=[{key:"name",get:function(){return"hls"}},{key:"supportedVersion",get:function(){return{min:"0.8.0"}}},{key:"levels",get:function(){return this._levels||[]}},{key:"currentLevel",get:function(){return null===this._currentLevel||void 0===this._currentLevel?-1:this._currentLevel},set:function(e){this._currentLevel=e,this.trigger(ue.PLAYBACK_LEVEL_SWITCH_START),this.options.playback.hlsUseNextLevel?this._hls.nextLevel=this._currentLevel:this._hls.currentLevel=this._currentLevel}},{key:"isReady",get:function(){return this._isReadyState}},{key:"latency",get:function(){return this._hls.latency}},{key:"currentProgramDateTime",get:function(){return this._hls.playingDate}},{key:"_startTime",get:function(){return this._playbackType===Le.LIVE&&"EVENT"!==this._playlistType?this._extrapolatedStartTime:this._playableRegionStartTime}},{key:"_now",get:function(){return gr()}},{key:"_extrapolatedStartTime",get:function(){if(!this._localStartTimeCorrelation)return this._playableRegionStartTime;var e=this._localStartTimeCorrelation,t=this._now-e.local,r=(e.remote+t)/1e3;return Math.min(r,this._playableRegionStartTime+this._extrapolatedWindowDuration)}},{key:"_extrapolatedEndTime",get:function(){var e=this._playableRegionStartTime+this._playableRegionDuration;if(!this._localEndTimeCorrelation)return e;var t=this._localEndTimeCorrelation,r=this._now-t.local,i=(t.remote+r)/1e3;return Math.max(e-this._extrapolatedWindowDuration,Math.min(i,e))}},{key:"_duration",get:function(){return this._extrapolatedEndTime-this._startTime}},{key:"_extrapolatedWindowDuration",get:function(){return null===this._segmentTargetDuration?0:this._extrapolatedWindowNumSegments*this._segmentTargetDuration}},{key:"bandwidthEstimate",get:function(){return this._hls&&this._hls.bandwidthEstimate}},{key:"defaultOptions",get:function(){return{preload:!0}}},{key:"customListeners",get:function(){return this.options.hlsPlayback&&this.options.hlsPlayback.customListeners||[]}},{key:"sourceMedia",get:function(){return this.options.src}},{key:"currentTimestamp",get:function(){return this._currentFragment?(this._currentFragment.programDateTime+1e3*(this.el.currentTime-this._currentFragment.start))/1e3:null}},{key:"_setInitialState",value:function(){this._minDvrSize=void 0===this.options.hlsMinimumDvrSize?60:this.options.hlsMinimumDvrSize,this._extrapolatedWindowNumSegments=this.options.playback&&void 0!==this.options.playback.extrapolatedWindowNumSegments?this.options.playback.extrapolatedWindowNumSegments:2,this._playbackType=Le.VOD,this._lastTimeUpdate={current:0,total:0},this._lastDuration=null,this._playableRegionStartTime=0,this._localStartTimeCorrelation=null,this._localEndTimeCorrelation=null,this._playableRegionDuration=0,this._programDateTime=0,this._durationExcludesAfterLiveSyncPoint=!1,this._segmentTargetDuration=null,this._playlistType=null,this._recoverAttemptsRemaining=this.options.hlsRecoverAttempts||16}},{key:"_setup",value:function(){this._destroyHLSInstance(),this._createHLSInstance(),this._listenHLSEvents(),this._attachHLSMedia()}},{key:"_destroyHLSInstance",value:function(){this._hls&&(this._manifestLoading=!1,this._ccIsSetup=!1,this._ccTracksUpdated=!1,this._setInitialState(),this._hls.destroy(),this._hls=null)}},{key:"_createHLSInstance",value:function(){var e=Jt({},this.options.playback.hlsjsConfig);this._hls=new pr(e)}},{key:"_attachHLSMedia",value:function(){this._hls&&this._hls.attachMedia(this.el)}},{key:"_listenHLSEvents",value:function(){var e=this;this._hls&&(this._hls.once(pr.Events.MEDIA_ATTACHED,(function(){e.options.hlsPlayback.preload&&e._hls.loadSource(e.options.src)})),this._hls.on(pr.Events.MANIFEST_LOADING,(function(){return e._manifestLoading=!0})),this._hls.on(pr.Events.LEVEL_LOADED,(function(t,r){return e._updatePlaybackType(t,r)})),this._hls.on(pr.Events.LEVEL_UPDATED,(function(t,r){return e._onLevelUpdated(t,r)})),this._hls.on(pr.Events.LEVEL_SWITCHING,(function(t,r){return e._onLevelSwitch(t,r)})),this._hls.on(pr.Events.FRAG_CHANGED,(function(t,r){return e._onFragmentChanged(t,r)})),this._hls.on(pr.Events.FRAG_LOADED,(function(t,r){return e._onFragmentLoaded(t,r)})),this._hls.on(pr.Events.FRAG_PARSING_METADATA,(function(t,r){return e._onFragmentParsingMetadata(t,r)})),this._hls.on(pr.Events.ERROR,(function(t,r){return e._onHLSJSError(t,r)})),this._hls.on(pr.Events.SUBTITLE_TRACK_LOADED,(function(t,r){return e._onSubtitleLoaded(t,r)})),this._hls.on(pr.Events.SUBTITLE_TRACKS_UPDATED,(function(){return e._ccTracksUpdated=!0})),this.bindCustomListeners())}},{key:"bindCustomListeners",value:function(){var e=this;this.customListeners.forEach((function(t){var r=t.eventName,i=t.once?"once":"on";r&&e._hls["".concat(i)](r,t.callback)}))}},{key:"unbindCustomListeners",value:function(){var e=this;this.customListeners.forEach((function(t){var r=t.eventName;r&&e._hls.off(r,t.callback)}))}},{key:"_onFragmentParsingMetadata",value:function(e,t){this.trigger(ue.Custom.PLAYBACK_FRAGMENT_PARSING_METADATA,{evt:e,data:t})}},{key:"render",value:function(){return this._ready(),sr(rr(a.prototype),"render",this).call(this)}},{key:"_ready",value:function(){this._isReadyState||(!this._hls&&this._setup(),this._isReadyState=!0,this.trigger(ue.PLAYBACK_READY,this.name))}},{key:"_recover",value:function(e,t,r){if(this._recoveredDecodingError)if(this._recoveredAudioCodecError){ne.error("hlsjs: failed to recover",{evt:e,data:t}),r.level=ke.Levels.FATAL;var i=this.createError(r);this.trigger(ue.PLAYBACK_ERROR,i),this.stop()}else this._recoveredAudioCodecError=!0,this._hls.swapAudioCodec(),this._hls.recoverMediaError();else this._recoveredDecodingError=!0,this._hls.recoverMediaError()}},{key:"_setupSrc",value:function(e){}},{key:"_startTimeUpdateTimer",value:function(){var e=this;this._timeUpdateTimer||(this._timeUpdateTimer=setInterval((function(){e._onDurationChange(),e._onTimeUpdate()}),100))}},{key:"_stopTimeUpdateTimer",value:function(){this._timeUpdateTimer&&(clearInterval(this._timeUpdateTimer),this._timeUpdateTimer=null)}},{key:"getProgramDateTime",value:function(){return this._programDateTime}},{key:"getDuration",value:function(){return this._duration}},{key:"getCurrentTime",value:function(){return Math.max(0,this.el.currentTime-this._startTime)}},{key:"getStartTimeOffset",value:function(){return this._startTime}},{key:"seekPercentage",value:function(e){var t=e>0?this._duration*(e/100):this._duration;this.seek(t)}},{key:"seek",value:function(e){e<0&&(ne.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(e<this.getDuration()-3),e+=this._startTime,this.el.currentTime=e}},{key:"seekToLivePoint",value:function(){this.seek(this.getDuration())}},{key:"_updateDvr",value:function(e){this.trigger(ue.PLAYBACK_DVR,e),this.trigger(ue.PLAYBACK_STATS_ADD,{dvr:e})}},{key:"_updateSettings",value:function(){this._playbackType===Le.VOD?this.settings.left=["playpause","position","duration"]:this.dvrEnabled?this.settings.left=["playpause"]:this.settings.left=["playstop"],this.settings.seekEnabled=this.isSeekEnabled(),this.trigger(ue.PLAYBACK_SETTINGSUPDATE)}},{key:"_onHLSJSError",value:function(e,t){var r,i={code:"".concat(t.type,"_").concat(t.details),description:"".concat(this.name," error: type: ").concat(t.type,", details: ").concat(t.details),raw:t};if(t.response&&(i.description+=", response: ".concat(JSON.stringify(t.response))),t.fatal)if(this._recoverAttemptsRemaining>0)switch(this._recoverAttemptsRemaining-=1,t.type){case pr.ErrorTypes.NETWORK_ERROR:switch(t.details){case pr.ErrorDetails.MANIFEST_LOAD_ERROR:case pr.ErrorDetails.MANIFEST_LOAD_TIMEOUT:case pr.ErrorDetails.MANIFEST_PARSING_ERROR:case pr.ErrorDetails.LEVEL_LOAD_ERROR:case pr.ErrorDetails.LEVEL_LOAD_TIMEOUT:ne.error("hlsjs: unrecoverable network fatal error.",{evt:e,data:t}),r=this.createError(i),this.trigger(ue.PLAYBACK_ERROR,r),this.stop();break;default:ne.warn("hlsjs: trying to recover from network error.",{evt:e,data:t}),i.level=ke.Levels.WARN,this._hls.startLoad()}break;case pr.ErrorTypes.MEDIA_ERROR:ne.warn("hlsjs: trying to recover from media error.",{evt:e,data:t}),i.level=ke.Levels.WARN,this._recover(e,t,i);break;default:ne.error("hlsjs: could not recover from error.",{evt:e,data:t}),r=this.createError(i),this.trigger(ue.PLAYBACK_ERROR,r),this.stop()}else ne.error("hlsjs: could not recover from error after maximum number of attempts.",{evt:e,data:t}),r=this.createError(i),this.trigger(ue.PLAYBACK_ERROR,r),this.stop();else{if(this.options.playback.triggerFatalErrorOnResourceDenied&&this._keyIsDenied(t))return ne.error("hlsjs: could not load decrypt key.",{evt:e,data:t}),r=this.createError(i),this.trigger(ue.PLAYBACK_ERROR,r),void this.stop();i.level=ke.Levels.WARN,ne.warn("hlsjs: non-fatal error occurred",{evt:e,data:t})}}},{key:"_keyIsDenied",value:function(e){return e.type===pr.ErrorTypes.NETWORK_ERROR&&e.details===pr.ErrorDetails.KEY_LOAD_ERROR&&e.response&&e.response.code>=400}},{key:"_onTimeUpdate",value:function(){var e={current:this.getCurrentTime(),total:this.getDuration(),firstFragDateTime:this.getProgramDateTime()};this._lastTimeUpdate&&e.current===this._lastTimeUpdate.current&&e.total===this._lastTimeUpdate.total||(this._lastTimeUpdate=e,this.trigger(ue.PLAYBACK_TIMEUPDATE,e,this.name))}},{key:"_onDurationChange",value:function(){var e=this.getDuration();this._lastDuration!==e&&(this._lastDuration=e,sr(rr(a.prototype),"_onDurationChange",this).call(this))}},{key:"_onProgress",value:function(){if(this.el.buffered.length){for(var e=[],t=0,r=0;r<this.el.buffered.length;r++)e=[].concat(or(e),[{start:Math.max(0,this.el.buffered.start(r)-this._playableRegionStartTime),end:Math.max(0,this.el.buffered.end(r)-this._playableRegionStartTime)}]),this.el.currentTime>=e[r].start&&this.el.currentTime<=e[r].end&&(t=r);var i={start:e[t].start,current:e[t].end,total:this.getDuration()};this.trigger(ue.PLAYBACK_PROGRESS,i,e)}}},{key:"load",value:function(e){this._stopTimeUpdateTimer(),this.options.src=e,this._setup()}},{key:"play",value:function(){!this._hls&&this._setup(),!this._manifestLoading&&!this.options.hlsPlayback.preload&&this._hls.loadSource(this.options.src),sr(rr(a.prototype),"play",this).call(this),this._startTimeUpdateTimer()}},{key:"pause",value:function(){this._hls&&(this.el.pause(),this.dvrEnabled&&this._updateDvr(!0))}},{key:"stop",value:function(){this._stopTimeUpdateTimer(),this._hls&&sr(rr(a.prototype),"stop",this).call(this),this._destroyHLSInstance()}},{key:"destroy",value:function(){this._stopTimeUpdateTimer(),this._destroyHLSInstance(),sr(rr(a.prototype),"destroy",this).call(this)}},{key:"_updatePlaybackType",value:function(e,t){this._playbackType=t.details.live?Le.LIVE:Le.VOD,this._onLevelUpdated(e,t),this._ccTracksUpdated&&this._playbackType===Le.LIVE&&this.hasClosedCaptionsTracks&&this._onSubtitleLoaded()}},{key:"_fillLevels",value:function(){this._levels=this._hls.levels.map((function(e,t){return{id:t,level:e,label:"".concat(e.bitrate/1e3,"Kbps")}})),this.trigger(ue.PLAYBACK_LEVELS_AVAILABLE,this._levels)}},{key:"_onLevelUpdated",value:function(e,t){this._segmentTargetDuration=t.details.targetduration,this._playlistType=t.details.type||null;var r=!1,i=!1,n=t.details.fragments,a=this._playableRegionStartTime,s=this._playableRegionDuration;if(0!==n.length){if(n[0].rawProgramDateTime&&(this._programDateTime=n[0].rawProgramDateTime),this._playableRegionStartTime!==n[0].start&&(r=!0,this._playableRegionStartTime=n[0].start),r)if(this._localStartTimeCorrelation){var o=this._localStartTimeCorrelation,l=this._now-o.local,u=(o.remote+l)/1e3;u<n[0].start?this._localStartTimeCorrelation={local:this._now,remote:1e3*n[0].start}:u>a+this._extrapolatedWindowDuration&&(this._localStartTimeCorrelation={local:this._now,remote:1e3*Math.max(n[0].start,a+this._extrapolatedWindowDuration)})}else this._localStartTimeCorrelation={local:this._now,remote:1e3*(n[0].start+this._extrapolatedWindowDuration/2)};var c=t.details.totalduration;if(this._playbackType===Le.LIVE){var d=t.details.targetduration*((this.options.playback.hlsjsConfig||{}).liveSyncDurationCount||pr.DefaultConfig.liveSyncDurationCount);d<=c?(c-=d,this._durationExcludesAfterLiveSyncPoint=!0):this._durationExcludesAfterLiveSyncPoint=!1}c!==this._playableRegionDuration&&(i=!0,this._playableRegionDuration=c);var h=n[0].start+c,f=a+s;if(h!==f)if(this._localEndTimeCorrelation){var p=this._localEndTimeCorrelation,g=this._now-p.local,v=(p.remote+g)/1e3;v>h?this._localEndTimeCorrelation={local:this._now,remote:1e3*h}:v<h-this._extrapolatedWindowDuration?this._localEndTimeCorrelation={local:this._now,remote:1e3*(h-this._extrapolatedWindowDuration)}:v>f&&(this._localEndTimeCorrelation={local:this._now,remote:1e3*f})}else this._localEndTimeCorrelation={local:this._now,remote:1e3*h};i&&this._onDurationChange(),r&&this._onProgress()}}},{key:"_onFragmentChanged",value:function(e,t){this._currentFragment=t.frag,this.trigger(ue.Custom.PLAYBACK_FRAGMENT_CHANGED,t)}},{key:"_onFragmentLoaded",value:function(e,t){this.trigger(ue.PLAYBACK_FRAGMENT_LOADED,t)}},{key:"_onSubtitleLoaded",value:function(){if(!this._ccIsSetup){this.trigger(ue.PLAYBACK_SUBTITLE_AVAILABLE);var e=this._playbackType===Le.LIVE?-1:this.closedCaptionsTrackId;this.closedCaptionsTrackId=e,this._ccIsSetup=!0}}},{key:"_onLevelSwitch",value:function(e,t){this.levels.length||this._fillLevels(),this.trigger(ue.PLAYBACK_LEVEL_SWITCH_END),this.trigger(ue.PLAYBACK_LEVEL_SWITCH,t);var r=this._hls.levels[t.level];r&&(this.highDefinition=r.height>=720||r.bitrate/1e3>=2e3,this.trigger(ue.PLAYBACK_HIGHDEFINITIONUPDATE,this.highDefinition),this.trigger(ue.PLAYBACK_BITRATE,{height:r.height,width:r.width,bandwidth:r.bitrate,bitrate:r.bitrate,level:t.level}))}},{key:"dvrEnabled",get:function(){return this._durationExcludesAfterLiveSyncPoint&&this._duration>=this._minDvrSize&&this.getPlaybackType()===Le.LIVE}},{key:"getPlaybackType",value:function(){return this._playbackType}},{key:"isSeekEnabled",value:function(){return this._playbackType===Le.VOD||this.dvrEnabled}}],i=[{key:"HLSJS",get:function(){return pr}}],r&&er(t.prototype,r),i&&er(t,i),Object.defineProperty(t,"prototype",{writable:!1}),a}(We);return mr.canPlay=function(e,t){var r=e.split("?")[0].match(/.*\.(.*)$/)||[],i=r.length>1&&"m3u8"===r[1].toLowerCase()||vr(t,["application/vnd.apple.mpegurl","application/x-mpegURL"]);return!(!pr.isSupported()||!i)},Zt.Loader.registerPlayback(mr),t(t({},Zt),{},{HLS:mr})}();
374
374
  //# sourceMappingURL=clappr.min.js.map