!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("global/window"),require("global/document")):"function"==typeof define&&define.amd?define(["global/window","global/document"],t):(e=e||self).videojs=t(e.window,e.document)}(this,(function(e,t){function n(e,t){Ye(e).forEach((function(n){return t(e[n],n)}))}function r(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i0)for(var n=e.attributes,r=n.length-1;r>=0;r--){var i=n[r].name,o=n[r].value;"boolean"!=typeof e[i]&&-1===",autoplay,stretch,fluent,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+i+",")||(o=null!==o),t[i]=o}return t}function S(e,t){return e.getAttribute(t)}function w(e,t,n){e.setAttribute(t,n)}function k(e,t){e.removeAttribute(t)}function E(){t.body.focus(),t.onselectstart=function(){return!1}}function C(){t.onselectstart=function(){return!0}}function A(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(n[e]=t[e])})),n.height||(n.height=parseFloat(a(e,"height"))),n.width||(n.width=parseFloat(a(e,"width"))),n}}function j(n){var r;if(n.getBoundingClientRect&&n.parentNode&&(r=n.getBoundingClientRect()),!r)return{left:0,top:0};var i=t.documentElement,o=t.body,a=i.clientLeft||o.clientLeft||0,s=e.pageXOffset||o.scrollLeft,u=r.left+s-a,l=i.clientTop||o.clientTop||0,c=e.pageYOffset||o.scrollTop,d=r.top+c-l;return{left:Math.round(u),top:Math.round(d)}}function x(e,t){var n={},r=j(e),i=e.offsetWidth,o=e.offsetHeight,a=r.top,s=r.left,u=t.pageY,l=t.pageX;return t.changedTouches&&(l=t.changedTouches[0].pageX,u=t.changedTouches[0].pageY),n.y=Math.max(0,Math.min(1,(a-u+o)/o)),n.x=Math.max(0,Math.min(1,(l-s)/i)),n}function O(e){return i(e)&&3===e.nodeType}function L(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function P(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"==typeof e&&(e=e()),c(e)||O(e)?e:"string"==typeof e&&/\S/.test(e)?t.createTextNode(e):void 0})).filter((function(e){return e}))}function R(e,t){return P(t).forEach((function(t){return e.appendChild(t)})),e}function I(e,t){return R(L(e),t)}function M(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}function D(){return et++}function U(e,t){if(Qe.has(e)){var n=Qe.get(e);0===n.handlers[t].length&&(delete n.handlers[t],e.removeEventListener?e.removeEventListener(t,n.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,n.dispatcher)),Object.getOwnPropertyNames(n.handlers).length<=0&&(delete n.handlers,delete n.dispatcher,delete n.disabled),0===Object.getOwnPropertyNames(n).length&&Qe.delete(e)}}function B(e,t,n,r){n.forEach((function(n){e(t,n,r)}))}function N(n){function r(){return!0}function i(){return!1}if(!n||!n.isPropagationStopped){var o=n||e.event;for(var a in n={},o)"layerX"!==a&&"layerY"!==a&&"keyLocation"!==a&&"webkitMovementX"!==a&&"webkitMovementY"!==a&&("returnValue"===a&&o.preventDefault||(n[a]=o[a]));if(n.target||(n.target=n.srcElement||t),n.relatedTarget||(n.relatedTarget=n.fromElement===n.target?n.toElement:n.fromElement),n.preventDefault=function(){o.preventDefault&&o.preventDefault(),n.returnValue=!1,o.returnValue=!1,n.defaultPrevented=!0},n.defaultPrevented=!1,n.stopPropagation=function(){o.stopPropagation&&o.stopPropagation(),n.cancelBubble=!0,o.cancelBubble=!0,n.isPropagationStopped=r},n.isPropagationStopped=i,n.stopImmediatePropagation=function(){o.stopImmediatePropagation&&o.stopImmediatePropagation(),n.isImmediatePropagationStopped=r,n.stopPropagation()},n.isImmediatePropagationStopped=i,null!==n.clientX&&void 0!==n.clientX){var s=t.documentElement,u=t.body;n.pageX=n.clientX+(s&&s.scrollLeft||u&&u.scrollLeft||0)-(s&&s.clientLeft||u&&u.clientLeft||0),n.pageY=n.clientY+(s&&s.scrollTop||u&&u.scrollTop||0)-(s&&s.clientTop||u&&u.clientTop||0)}n.which=n.charCode||n.keyCode,null!==n.button&&void 0!==n.button&&(n.button=1&n.button?0:4&n.button?1:2&n.button?2:0)}return n}function F(e,t,n){if(Array.isArray(t))return B(F,e,t,n);Qe.has(e)||Qe.set(e,{});var r=Qe.get(e);if(r.handlers||(r.handlers={}),r.handlers[t]||(r.handlers[t]=[]),n.guid||(n.guid=D()),r.handlers[t].push(n),r.dispatcher||(r.disabled=!1,r.dispatcher=function(t,n){if(!r.disabled){t=N(t);var i=r.handlers[t.type];if(i)for(var o=i.slice(0),a=0,s=o.length;a-1&&(i={passive:!0}),e.addEventListener(t,r.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,r.dispatcher)}function V(e,t,n){if(Qe.has(e)){var r=Qe.get(e);if(r.handlers){if(Array.isArray(t))return B(V,e,t,n);var i=function(e,t){r.handlers[t]=[],U(e,t)};if(void 0!==t){var o=r.handlers[t];if(o){if(!n)return void i(e,t);if(n.guid)for(var a=0;an)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+n+").")}(e,r,n.length-1),n[r][t]}function te(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:ee.bind(null,"start",0,e),end:ee.bind(null,"end",1,e)}}function ne(e,t){return Array.isArray(e)?te(e):void 0===e||void 0===t?te():te([[e,t]])}function re(e,t){var n,r,i=0;if(!t)return 0;e&&e.length||(e=ne(0,0));for(var o=0;ot&&(r=t),i+=r-n;return i/t}function ie(e){if(e instanceof ie)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:i(e)&&("number"==typeof e.code&&(this.code=e.code),r(this,e)),this.message||(this.message=ie.defaultMessages[this.code]||"")}function oe(e){return null!=e&&"function"==typeof e.then}function ae(e){oe(e)&&e.then(null,(function(e){}))}function se(e,t){return e(t={exports:{}},t.exports),t.exports}function ue(e,t,n){var r=e;return jn(t)?(n=t,"string"==typeof e&&(r={uri:e})):r=$r(t,{uri:e}),r.callback=n,r}function le(e,t,n){return ce(t=ue(e,t,n))}function ce(e){function t(){var e=void 0;if(e=a.response?a.response:a.responseText||function(e){if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;return""!==e.responseType||t?null:e.responseXML}(a),v)try{e=JSON.parse(e)}catch(e){}return e}function n(e){return clearTimeout(l),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,o(e,m)}function r(){if(!u){var n;clearTimeout(l),n=e.useXDR&&void 0===a.status?200:1223===a.status?204:a.status;var r=m,i=null;return 0!==n?(r={body:t(),statusCode:n,method:d,headers:{},url:c,rawRequest:a},a.getAllResponseHeaders&&(r.headers=qr(a.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),o(i,r,r.body)}}if(void 0===e.callback)throw new Error("callback argument missing");var i=!1,o=function(t,n,r){i||(i=!0,e.callback(t,n,r))},a=e.xhr||null;a||(a=e.cors||e.useXDR?new le.XDomainRequest:new le.XMLHttpRequest);var s,u,l,c=a.url=e.uri||e.url,d=a.method=e.method||"GET",f=e.body||e.data,h=a.headers=e.headers||{},p=!!e.sync,v=!1,m={body:void 0,headers:{},statusCode:0,method:d,url:c,rawRequest:a};if("json"in e&&!1!==e.json&&(v=!0,h.accept||h.Accept||(h.Accept="application/json"),"GET"!==d&&"HEAD"!==d&&(h["content-type"]||h["Content-Type"]||(h["Content-Type"]="application/json"),f=JSON.stringify(!0===e.json?f:e.json))),a.onreadystatechange=function(){4===a.readyState&&setTimeout(r,0)},a.onload=r,a.onerror=n,a.onprogress=function(){},a.onabort=function(){u=!0},a.ontimeout=n,a.open(d,c,!p,e.username,e.password),p||(a.withCredentials=!!e.withCredentials),!p&&e.timeout>0&&(l=setTimeout((function(){if(!u){u=!0,a.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",n(e)}}),e.timeout)),a.setRequestHeader)for(s in h)h.hasOwnProperty(s)&&a.setRequestHeader(s,h[s]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(a.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(a),a.send(f||null),a}function de(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function fe(e){function t(e,t,n,r){return 3600*(0|e)+60*(0|t)+(0|n)+(0|r)/1e3}var n=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return n?n[3]?t(n[1],n[2],n[3].replace(":",""),n[4]):n[1]>59?t(n[1],n[2],0,n[4]):t(0,n[1],n[2],n[4]):null}function he(){this.values=oi(null)}function pe(e,t,n,r){var i=r?e.split(r):[e];for(var o in i)if("string"==typeof i[o]){var a=i[o].split(n);if(2===a.length)t(a[0],a[1])}}function ve(e,t,n){function r(){var t=fe(e);if(null===t)throw new de(de.Errors.BadTimeStamp,"Malformed timestamp: "+o);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function i(){e=e.replace(/^\s+/,"")}var o=e;if(i(),t.startTime=r(),i(),"--\x3e"!==e.substr(0,3))throw new de(de.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+o);e=e.substr(3),i(),t.endTime=r(),i(),function(e,t){var r=new he;pe(e,(function(e,t){switch(e){case"region":for(var i=n.length-1;i>=0;i--)if(n[i].id===t){r.set(e,n[i].region);break}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":var o=t.split(","),a=o[0];r.integer(e,a),r.percent(e,a)&&r.set("snapToLines",!1),r.alt(e,a,["auto"]),2===o.length&&r.alt("lineAlign",o[1],["start","middle","end"]);break;case"position":o=t.split(","),r.percent(e,o[0]),2===o.length&&r.alt("positionAlign",o[1],["start","middle","end"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start","middle","end","left","right"])}}),/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical",""),t.line=r.get("line","auto"),t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100),t.align=r.get("align","middle"),t.position=r.get("position",{start:0,left:0,middle:50,end:100,right:100},t.align),t.positionAlign=r.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},t.align)}(e,t)}function me(e,t){function n(e){return ai[e]}for(var r,i=e.document.createElement("div"),o=i,a=[];null!==(r=function(){if(!t)return null;var e=t.match(/^([^<]*)(<[^>]*>?)?/);return function(e){return t=t.substr(e.length),e}(e[1]?e[1]:e[2])}());)if("<"!==r[0])o.appendChild(e.document.createTextNode(function(e){for(;l=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)e=e.replace(l[0],n);return e}(r)));else{if("/"===r[1]){a.length&&a[a.length-1]===r.substr(2).replace(">","")&&(a.pop(),o=o.parentNode);continue}var s,u=fe(r.substr(1,r.length-2));if(u){s=e.document.createProcessingInstruction("timestamp",u),o.appendChild(s);continue}var l=r.match(/^<([^.\s\/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!l)continue;if(!(s=function(t,n){var r=si[t];if(!r)return null;var i=e.document.createElement(r);i.localName=r;var o=ui[t];return o&&n&&(i[o]=n.trim()),i}(l[1],l[3])))continue;if(!function(e,t){return!li[t.localName]||li[t.localName]===e.localName}(o,s))continue;l[2]&&(s.className=l[2].substr(1).replace("."," ")),a.push(l[1]),o.appendChild(s),o=s}return i}function ge(e){for(var t=0;t=n[0]&&e<=n[1])return!0}return!1}function ye(e){function t(e,t){for(var n=t.childNodes.length-1;n>=0;n--)e.push(t.childNodes[n])}function n(e){if(!e||!e.length)return null;var r=e.pop(),i=r.textContent||r.innerText;if(i){var o=i.match(/^.*(\n|\r)/);return o?(e.length=0,o[0]):i}return"ruby"===r.tagName?n(e):r.childNodes?(t(e,r),n(e)):void 0}var r=[],i="";if(!e||!e.childNodes)return"ltr";for(t(r,e);i=n(r);)for(var o=0;o=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,n=t.textTrackList,r=0,i=0;id&&(c=c<0?-1:1,c*=Math.ceil(d/l)*l),a<0&&(c+=""===o.vertical?n.height:n.width,s=s.reverse()),i.move(f,c)}else{var h=i.lineHeight/n.height*100;switch(o.lineAlign){case"middle":a-=h/2;break;case"end":a-=h}switch(o.vertical){case"":t.applyStyles({top:t.formatStyle(a,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(a,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(a,"%")})}s=["+y","-x","+x","-y"],i=new Te(t)}var p=function(e,t){for(var i,o=new Te(e),a=1,s=0;su&&(i=new Te(e),a=u),e=new Te(o)}return i||o}(i,s);t.move(p.toCSSCompatValues(n))}function we(){}function ke(e){return"string"==typeof e&&!!pi[e.toLowerCase()]&&e.toLowerCase()}function Ee(e,t,n){this.hasBeenReset=!1;var r="",i=!1,o=e,a=t,s=n,u=null,l="",c=!0,d="auto",f="start",h=50,p="middle",v=50,m="middle";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return r},set:function(e){r=""+e}},pauseOnExit:{enumerable:!0,get:function(){return i},set:function(e){i=!!e}},startTime:{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");o=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");a=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return s},set:function(e){s=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(e){u=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return l},set:function(e){var t=function(e){return"string"==typeof e&&!!hi[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");l=t,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return c},set:function(e){c=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return d},set:function(e){if("number"!=typeof e&&e!==fi)throw new SyntaxError("An invalid number or illegal string was specified.");d=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return f},set:function(e){var t=ke(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");f=t,this.hasBeenReset=!0}},position:{enumerable:!0,get:function(){return h},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");h=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return p},set:function(e){var t=ke(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");p=t,this.hasBeenReset=!0}},size:{enumerable:!0,get:function(){return v},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");v=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return m},set:function(e){var t=ke(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");m=t,this.hasBeenReset=!0}}}),this.displayState=void 0}function Ce(e){return"number"==typeof e&&e>=0&&e<=100}function Ae(e,t,n){e.setTimeout((function(){return function e(t,n,i,o,a,s){void 0===t&&(t={}),void 0===n&&(n=[]),void 0===a&&(a=[]),void 0===s&&(s=!1);var u=n,l=u[0],c=u.slice(1);if("string"==typeof l)e(t,bi[l],i,o,a,s);else if(l){var d=function(e,t){var n=Ti[e.id()],r=null;if(null==n)return r=t(e),Ti[e.id()]=[[t,r]],r;for(var i=0;i=0;i--){var o=e[i];o[t]&&o[t](r,n)}}(e,n,s,a),s}function xe(e){return function(t,n){return t===Si?Si:n[e]?n[e](t):t}}function Oe(e){if(!e.type){var t=Ai(e.src);t&&(e.type=t)}return e}function Le(e,t){var n;if(4===e.length)n=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");n=e.slice(1)}return"rgba("+parseInt(n.slice(0,2),16)+","+parseInt(n.slice(2,4),16)+","+parseInt(n.slice(4,6),16)+","+t+")"}function Pe(e,t,n){try{e.style[t]=n}catch(e){return}}function Re(e,t){return void 0===t&&(t=e),Ni(e,t)}function Ie(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}function Me(e,t,n){var r=Me.getPlayer(e);if(r)return t&&qe.warn('Player "'+e+'" is already initialised. Options will not be applied.'),n&&r.ready(n),r;var o="string"==typeof e?Xe("#"+ya(e)):e;if(!c(o))throw new TypeError("The element or ID supplied is not valid. (videojs)");o.ownerDocument.defaultView&&o.ownerDocument.body.contains(o)||qe.warn("The element supplied is not included in the DOM"),t=t||{},Me.hooks("beforesetup").forEach((function(e){var n=e(o,K(t));i(n)&&!Array.isArray(n)?t=K(t,n):qe.error("please return an object in beforesetup hooks")}));var a=Et.getComponent("Player");return r=new a(o,t,n),Me.hooks("setup").forEach((function(e){return e(r)})),r}function De(){return(De=Object.assign||function(e){for(var t=1;t0)for(var o=0,a=i.length;o=n&&(t.apply(void 0,arguments),r=i)}},ht=function(){};ht.prototype.allowedEvents_={},ht.prototype.on=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},F(this,e,t),this.addEventListener=n},ht.prototype.addEventListener=ht.prototype.on,ht.prototype.off=function(e,t){V(this,e,t)},ht.prototype.removeEventListener=ht.prototype.off,ht.prototype.one=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},z(this,e,t),this.addEventListener=n},ht.prototype.any=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},G(this,e,t),this.addEventListener=n},ht.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=N(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),H(this,e)},ht.prototype.dispatchEvent=ht.prototype.trigger,ht.prototype.queueTrigger=function(t){var n=this;st||(st=new Map);var r=t.type||t,i=st.get(this);i||(i=new Map,st.set(this,i));var o=i.get(r);i.delete(r),e.clearTimeout(o);var a=e.setTimeout((function(){0===i.size&&(i=null,st.delete(n)),n.trigger(t)}),0);i.set(r,a)};var pt=function(e){return e instanceof ht||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"==typeof e[t]}))},vt=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},mt=function(e){if(!e.nodeName&&!pt(e))throw new Error("Invalid target; must be a DOM node or evented object.")},gt=function(e){if(!vt(e))throw new Error("Invalid event type; must be a non-empty string or array.")},yt=function(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")},_t=function(e,t){var n,r,i,o=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return o?(n=e.eventBusEl_,t.length>=3&&t.shift(),r=t[0],i=t[1]):(n=t[0],r=t[1],i=t[2]),mt(n),gt(r),yt(i),{isTargetingSelf:o,target:n,type:r,listener:i=dt(e,i)}},bt=function(e,t,n,r){mt(e),e.nodeName?it[t](e,n,r):e[t](n,r)},Tt={on:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),Qe.has(this.el_)&&Qe.delete(this.el_),this.el_=null),this.player_=null},n.player=function(){return this.player_},n.options=function(e){return e?(this.options_=K(this.options_,e),this.options_):this.options_},n.el=function(){return this.el_},n.createEl=function(e,t,n){return h(e,t,n)},n.localize=function(e,t,n){void 0===n&&(n=e);var r=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),o=i&&i[r],a=r&&r.split("-")[0],s=i&&i[a],u=n;return o&&o[e]?u=o[e]:s&&s[e]&&(u=s[e]),t&&(u=u.replace(/\{(\d+)\}/g,(function(e,n){var r=t[n-1],i=r;return void 0===r&&(i=e),i}))),u},n.contentEl=function(){return this.contentEl_||this.el_},n.id=function(){return this.id_},n.name=function(){return this.name_},n.children=function(){return this.children_},n.getChildById=function(e){return this.childIndex_[e]},n.getChild=function(e){if(e)return this.childNameIndex_[e]},n.addChild=function(e,n,r){var i,o;if(void 0===n&&(n={}),void 0===r&&(r=this.children_.length),"string"==typeof e){o=kt(e);var a=n.componentClass||o;n.name=o;var s=t.getComponent(a);if(!s)throw new Error("Component "+a+" does not exist");if("function"!=typeof s)return null;i=new s(this.player_||this,n)}else i=e;if(i.parentComponent_&&i.parentComponent_.removeChild(i),this.children_.splice(r,0,i),i.parentComponent_=this,"function"==typeof i.id&&(this.childIndex_[i.id()]=i),(o=o||i.name&&kt(i.name()))&&(this.childNameIndex_[o]=i,this.childNameIndex_[wt(o)]=i),"function"==typeof i.el&&i.el()){var u=this.contentEl().children[r]||null;this.contentEl().insertBefore(i.el(),u)}return i},n.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[kt(e.name())]=null,this.childNameIndex_[wt(e.name())]=null;var r=e.el();r&&r.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},n.initChildren=function(){var e=this,n=this.options_.children;if(n){var r,i=this.options_,o=t.getComponent("Tech");(r=Array.isArray(n)?n:Object.keys(n)).concat(Object.keys(this.options_).filter((function(e){return!r.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((function(t){var r,i;return"string"==typeof t?i=n[r=t]||e.options_[r]||{}:(r=t.name,i=t),{name:r,opts:i}})).filter((function(e){var n=t.getComponent(e.opts.componentClass||kt(e.name));return n&&!o.isTech(n)})).forEach((function(t){var n=t.name,r=t.opts;if(void 0!==i[n]&&(r=i[n]),!1!==r){!0===r&&(r={}),r.playerOptions=e.options_.playerOptions;var o=e.addChild(n,r);o&&(e[n]=o)}}))}},n.buildCSSClass=function(){return""},n.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},n.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},n.$=function(e,t){return Xe(e,t||this.contentEl())},n.$$=function(e,t){return Je(e,t||this.contentEl())},n.hasClass=function(e){return m(this.el_,e)},n.addClass=function(e){g(this.el_,e)},n.removeClass=function(e){y(this.el_,e)},n.toggleClass=function(e,t){_(this.el_,e,t)},n.show=function(){this.removeClass("vjs-hidden")},n.hide=function(){this.addClass("vjs-hidden")},n.lockShowing=function(){this.addClass("vjs-lock-showing")},n.unlockShowing=function(){this.removeClass("vjs-lock-showing")},n.getAttribute=function(e){return S(this.el_,e)},n.setAttribute=function(e,t){w(this.el_,e,t)},n.removeAttribute=function(e){k(this.el_,e)},n.width=function(e,t){return this.dimension("width",e,t)},n.height=function(e,t){return this.dimension("height",e,t)},n.dimensions=function(e,t){this.width(e,!0),this.height(t)},n.dimension=function(e,t,n){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;var r=this.el_.style[e],i=r.indexOf("px");return-1!==i?parseInt(r.slice(0,i),10):parseInt(this.el_["offset"+kt(e)],10)},n.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=a(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var n="offset"+kt(e);t=this.el_[n]}return t},n.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},n.currentWidth=function(){return this.currentDimension("width")},n.currentHeight=function(){return this.currentDimension("height")},n.focus=function(){this.el_.focus()},n.blur=function(){this.el_.blur()},n.handleKeyDown=function(e){this.player_&&(e.stopPropagation(),this.player_.handleKeyDown(e))},n.handleKeyPress=function(e){this.handleKeyDown(e)},n.emitTapEvents=function(){var t,n=0,r=null;this.on("touchstart",(function(i){1===i.touches.length&&(r={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY},n=e.performance.now(),t=!0)})),this.on("touchmove",(function(e){if(e.touches.length>1)t=!1;else if(r){var n=e.touches[0].pageX-r.pageX,i=e.touches[0].pageY-r.pageY;Math.sqrt(n*n+i*i)>10&&(t=!1)}}));var i=function(){t=!1};this.on("touchleave",i),this.on("touchcancel",i),this.on("touchend",(function(i){r=null,!0===t&&e.performance.now()-n<200&&(i.preventDefault(),this.trigger("tap"))}))},n.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=dt(this.player(),this.player().reportUserActivity);this.on("touchstart",(function(){t(),this.clearInterval(e),e=this.setInterval(t,250)}));var n=function(n){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",n),this.on("touchcancel",n)}},n.setTimeout=function(t,n){var r,i=this;return t=dt(this,t),this.clearTimersOnDispose_(),r=e.setTimeout((function(){i.setTimeoutIds_.has(r)&&i.setTimeoutIds_.delete(r),t()}),n),this.setTimeoutIds_.add(r),r},n.clearTimeout=function(t){return this.setTimeoutIds_.has(t)&&(this.setTimeoutIds_.delete(t),e.clearTimeout(t)),t},n.setInterval=function(t,n){t=dt(this,t),this.clearTimersOnDispose_();var r=e.setInterval(t,n);return this.setIntervalIds_.add(r),r},n.clearInterval=function(t){return this.setIntervalIds_.has(t)&&(this.setIntervalIds_.delete(t),e.clearInterval(t)),t},n.requestAnimationFrame=function(t){var n,r=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),t=dt(this,t),n=e.requestAnimationFrame((function(){r.rafIds_.has(n)&&r.rafIds_.delete(n),t()})),this.rafIds_.add(n),n):this.setTimeout(t,1e3/60)},n.cancelAnimationFrame=function(t){return this.supportsRaf_?(this.rafIds_.has(t)&&(this.rafIds_.delete(t),e.cancelAnimationFrame(t)),t):this.clearTimeout(t)},n.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(function(){[["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((function(t){var n=t[0],r=t[1];e[n].forEach(e[r],e)})),e.clearingTimersOnDispose_=!1})))},t.registerComponent=function(e,n){if("string"!=typeof e||!e)throw new Error('Illegal component name, "'+e+'"; must be a non-empty string.');var r=t.getComponent("Tech"),i=r&&r.isTech(n),o=t===n||t.prototype.isPrototypeOf(n.prototype);if(i||!o)throw new Error('Illegal component, "'+e+'"; '+(i?"techs must be registered using Tech.registerTech()":"must be a Component subclass")+".");e=kt(e),t.components_||(t.components_={});var a=t.getComponent("Player");if("Player"===e&&a&&a.players){var s=a.players,u=Object.keys(s);if(s&&u.length>0&&u.map((function(e){return s[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return t.components_[e]=n,t.components_[wt(e)]=n,n},t.getComponent=function(e){if(e&&t.components_)return t.components_[e]},t}();Et.prototype.supportsRaf_="function"==typeof e.requestAnimationFrame&&"function"==typeof e.cancelAnimationFrame,Et.registerComponent("Component",Et);for(var Ct,At=e.navigator&&e.navigator.userAgent||"",jt=/AppleWebKit\/([\d.]+)/i.exec(At),xt=jt?parseFloat(jt.pop()):null,Ot=/iPad/i.test(At),Lt=/iPhone/i.test(At)&&!Ot,Pt=/iPod/i.test(At),Rt=Lt||Ot||Pt,It=function(){var e=At.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Mt=/Android/i.test(At),Dt=function(){var e=At.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return t&&n?parseFloat(e[1]+"."+e[2]):t||null}(),Ut=Mt&&Dt<5&&xt<537,Bt=/Firefox/i.test(At),Nt=/Edge/i.test(At),Ft=!Nt&&(/Chrome/i.test(At)||/CriOS/i.test(At)),Vt=function(){var e=At.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Ht=function(){var e=/MSIE\s(\d+)\.\d/.exec(At),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(At)&&/rv:11.0/.test(At)&&(t=11),t}(),zt=/Safari/i.test(At)&&!Ft&&!Mt&&!Nt,Gt=(zt||Rt)&&!Ft,Wt=/Windows/i.test(At),qt=(l()&&("ontouchstart"in e||e.navigator.maxTouchPoints||e.DocumentTouch&&e.document instanceof e.DocumentTouch)),$t=Object.freeze({IS_IPAD:Ot,IS_IPHONE:Lt,IS_IPOD:Pt,IS_IOS:Rt,IOS_VERSION:It,IS_ANDROID:Mt,ANDROID_VERSION:Dt,IS_NATIVE_ANDROID:Ut,IS_FIREFOX:Bt,IS_EDGE:Nt,IS_CHROME:Ft,CHROME_VERSION:Vt,IE_VERSION:Ht,IS_SAFARI:zt,IS_ANY_SAFARI:Gt,IS_WINDOWS:Wt,TOUCH_ENABLED:qt}),Kt={prefixed:!0},Yt=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],Xt=Yt[0],Jt=0;Jt=0;r--)if(t[r].enabled){dn(t,t[r]);break}return(n=e.call(this,t)||this).changing_=!1,n}Y(t,e);var n=t.prototype;return n.addTrack=function(t){var n=this;t.enabled&&dn(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){n.changing_||(n.changing_=!0,dn(n,t),n.changing_=!1,n.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},n.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(un),hn=function(e,t){for(var n=0;n=0;r--)if(t[r].selected){hn(t,t[r]);break}return(n=e.call(this,t)||this).changing_=!1,Object.defineProperty(Q(n),"selectedIndex",{get:function(){for(var e=0;e',i=o.firstChild,o.setAttribute("style","display:none; position:absolute;"),t.body.appendChild(o));for(var s={},u=0;ux',e=n.firstChild.href}return e},En=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""},Cn=function(t){var n=e.location,r=wn(t);return(":"===r.protocol?n.protocol:r.protocol)+r.host!==n.protocol+n.host},An=Object.freeze({parseUrl:wn,getAbsoluteURL:kn,getFileExtension:En,isCrossOrigin:Cn}),jn=function(e){var t=xn.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},xn=Object.prototype.toString,On=Array.prototype.slice,Ln=Object.prototype.toString,Pn=Function.prototype.bind||function(e){var t=this;if("function"!=typeof t||"[object Function]"!==Ln.call(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var n,r=On.call(arguments,1),i=function(){if(this instanceof n){var i=t.apply(this,r.concat(On.call(arguments)));return Object(i)===i?i:this}return t.apply(e,r.concat(On.call(arguments)))},o=Math.max(0,t.length-r.length),a=[],s=0;s=0&&"[object Function]"===Rn.call(e.callee)),n};if(!Object.keys){var Mn=Object.prototype.hasOwnProperty,Dn=Object.prototype.toString,Un=In,Bn=Object.prototype.propertyIsEnumerable,Nn=!Bn.call({toString:null},"toString"),Fn=Bn.call((function(){}),"prototype"),Vn=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Hn=function(e){var t=e.constructor;return t&&t.prototype===e},zn={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Gn=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!zn["$"+e]&&Mn.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{Hn(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();cn=function(e){var t=null!==e&&"object"==typeof e,n="[object Function]"===Dn.call(e),r=Un(e),i=t&&"[object String]"===Dn.call(e),o=[];if(!t&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var a=Fn&&n;if(i&&e.length>0&&!Mn.call(e,0))for(var s=0;s0)for(var u=0;u2?arguments[2]:{},r=Xn(t);Jn&&(r=Qn.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i1&&"boolean"!=typeof t)throw new TypeError('"allowMissing" argument must be a boolean');var n="$ "+e;if(!(n in lr))throw new SyntaxError("intrinsic "+e+" does not exist!");if(void 0===lr[n]&&!t)throw new TypeError("intrinsic "+e+" exists, but is not available. Please file an issue!");return lr[n]},dr=Pn.call(Function.call,Object.prototype.hasOwnProperty),fr=cr("%TypeError%"),hr=cr("%SyntaxError%"),pr={"Property Descriptor":function(e,t){if("Object"!==e.Type(t))return!1;var n={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(dr(t,r)&&!n[r])return!1;var i=dr(t,"[[Value]]"),o=dr(t,"[[Get]]")||dr(t,"[[Set]]");if(i&&o)throw new fr("Property Descriptors may not be both accessor and data descriptors");return!0}},vr=function(e,t,n,r){var i=pr[t];if("function"!=typeof i)throw new hr("unknown record type: "+t);if(!i(e,r))throw new fr(n+" must be a "+t);console.log(i(e,r),r)},mr=Number.isNaN||function(e){return e!=e},gr=Number.isNaN||function(e){return e!=e},yr=Number.isFinite||function(e){return"number"==typeof e&&!gr(e)&&e!==1/0&&e!==-1/0},_r=function(e){return e>=0?1:-1},br=Function.prototype.toString,Tr=/^\s*class\b/,Sr=function(e){try{var t=br.call(e);return Tr.test(t)}catch(e){return!1}},wr=Object.prototype.toString,kr="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,Er=function(e){if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(kr)return function(e){try{return!Sr(e)&&(br.call(e),!0)}catch(e){return!1}}(e);if(Sr(e))return!1;var t=wr.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t},Cr=function(e){return null===e||"function"!=typeof e&&"object"!=typeof e},Ar=Object.prototype.toString,jr=function(e){var t;if((t=arguments.length>1?arguments[1]:"[object Date]"===Ar.call(e)?String:Number)===String||t===Number){var n,r,i=t===String?["toString","valueOf"]:["valueOf","toString"];for(r=0;r1?jr(e,arguments[1]):jr(e)},ToBoolean:function(e){return!!e},ToNumber:function(e){return+e},ToInteger:function(e){var t=this.ToNumber(e);return mr(t)?0:0!==t&&yr(t)?_r(t)*Math.floor(Math.abs(t)):t},ToInt32:function(e){return this.ToNumber(e)>>0},ToUint32:function(e){return this.ToNumber(e)>>>0},ToUint16:function(e){var t=this.ToNumber(e);return mr(t)||0===t||!yr(t)?0:function(e,t){var n=e%t;return Math.floor(n>=0?n:n+t)}(_r(t)*Math.floor(Math.abs(t)),65536)},ToString:function(e){return Lr(e)},ToObject:function(e){return this.CheckObjectCoercible(e),xr(e)},CheckObjectCoercible:function(e,t){if(null==e)throw new Or(t||"Cannot call method on "+e);return e},IsCallable:Er,SameValue:function(e,t){return e===t?0!==e||1/e==1/t:mr(e)&&mr(t)},Type:function(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":void 0},IsPropertyDescriptor:function(e){if("Object"!==this.Type(e))return!1;var t={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(dr(e,n)&&!t[n])return!1;var r=dr(e,"[[Value]]"),i=dr(e,"[[Get]]")||dr(e,"[[Set]]");if(r&&i)throw new Or("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(e){return void 0!==e&&(vr(this,"Property Descriptor","Desc",e),!(!dr(e,"[[Get]]")&&!dr(e,"[[Set]]")))},IsDataDescriptor:function(e){return void 0!==e&&(vr(this,"Property Descriptor","Desc",e),!(!dr(e,"[[Value]]")&&!dr(e,"[[Writable]]")))},IsGenericDescriptor:function(e){return void 0!==e&&(vr(this,"Property Descriptor","Desc",e),!this.IsAccessorDescriptor(e)&&!this.IsDataDescriptor(e))},FromPropertyDescriptor:function(e){if(void 0===e)return e;if(vr(this,"Property Descriptor","Desc",e),this.IsDataDescriptor(e))return{value:e["[[Value]]"],writable:!!e["[[Writable]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};if(this.IsAccessorDescriptor(e))return{get:e["[[Get]]"],set:e["[[Set]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};throw new Or("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(e){if("Object"!==this.Type(e))throw new Or("ToPropertyDescriptor requires an object");var t={};if(dr(e,"enumerable")&&(t["[[Enumerable]]"]=this.ToBoolean(e.enumerable)),dr(e,"configurable")&&(t["[[Configurable]]"]=this.ToBoolean(e.configurable)),dr(e,"value")&&(t["[[Value]]"]=e.value),dr(e,"writable")&&(t["[[Writable]]"]=this.ToBoolean(e.writable)),dr(e,"get")){var n=e.get;if(void 0!==n&&!this.IsCallable(n))throw new TypeError("getter must be a function");t["[[Get]]"]=n}if(dr(e,"set")){var r=e.set;if(void 0!==r&&!this.IsCallable(r))throw new Or("setter must be a function");t["[[Set]]"]=r}if((dr(t,"[[Get]]")||dr(t,"[[Set]]"))&&(dr(t,"[[Value]]")||dr(t,"[[Writable]]")))throw new Or("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t}},Rr=Pn.call(Function.call,String.prototype.replace),Ir=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,Mr=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/,Dr=function(){var e=Pr.ToString(Pr.CheckObjectCoercible(this));return Rr(Rr(e,Ir,""),Mr,"")},Ur=function(){return String.prototype.trim&&"​"==="​".trim()?String.prototype.trim:Dr},Br=Pn.call(Function.call,Ur());ir(Br,{getPolyfill:Ur,implementation:Dr,shim:function(){var e=Ur();return ir(String.prototype,{trim:e},{trim:function(){return String.prototype.trim!==e}}),e}});var Nr=Br,Fr=Object.prototype.toString,Vr=Object.prototype.hasOwnProperty,Hr=function(e,t,n){for(var r=0,i=e.length;r=3&&(r=n),"[object Array]"===Fr.call(e)?Hr(e,t,r):"string"==typeof e?zr(e,t,r):Gr(e,t,r)},qr=function(e){if(!e)return{};var t={};return Wr(Nr(e).split("\n"),(function(e){var n=e.indexOf(":"),r=Nr(e.slice(0,n)).toLowerCase(),i=Nr(e.slice(n+1));void 0===t[r]?t[r]=i:function(e){return"[object Array]"===Object.prototype.toString.call(e)}(t[r])?t[r].push(i):t[r]=[t[r],i]})),t},$r=function(){for(var e={},t=0;t0&&(e.console&&e.console.groupCollapsed&&e.console.groupCollapsed("Text Track parsing errors for "+n.src),i.forEach((function(e){return qe.error(e)})),e.console&&e.console.groupEnd&&e.console.groupEnd()),r.flush()},Jr=function(t,n){var r={uri:t},i=Cn(t);i&&(r.cors=i),Yr(r,dt(this,(function(t,r,i){if(t)return qe.error(t,r);n.loaded_=!0,"function"!=typeof e.WebVTT?n.tech_&&n.tech_.any(["vttjsloaded","vttjserror"],(function(e){return"vttjserror"===e.type?void qe.error("vttjs failed to load, stopping trying to process "+n.src):Xr(i,n)})):Xr(i,n)})))},Zr=function(t){function n(e){var n;if(void 0===e&&(e={}),!e.tech)throw new Error("A tech was not provided.");var r=K(e,{kind:bn[e.kind]||"subtitles",language:e.language||e.srclang||""}),i=Tn[r.mode]||"disabled",o=r.default;"metadata"!==r.kind&&"chapters"!==r.kind||(i="hidden"),(n=t.call(this,r)||this).tech_=r.tech,n.cues_=[],n.activeCues_=[];var a=new gn(n.cues_),s=new gn(n.activeCues_),u=!1,l=dt(Q(n),(function(){this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1)}));return"disabled"!==i&&n.tech_.ready((function(){n.tech_.on("timeupdate",l)}),!0),Object.defineProperties(Q(n),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return i},set:function(e){var t=this;Tn[e]&&("disabled"!==(i=e)?this.tech_.ready((function(){t.tech_.on("timeupdate",l)}),!0):this.tech_.off("timeupdate",l),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?a:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return s;for(var e=this.tech_.currentTime(),t=[],n=0,r=this.cues.length;n=e||i.startTime===i.endTime&&i.startTime<=e&&i.startTime+.5>=e)&&t.push(i)}if(u=!1,t.length!==this.activeCues_.length)u=!0;else for(var o=0;o=0&&t<=100)&&(this.set(e,t),!0)}};var ai={"&":"&","<":"<",">":">","‎":"‎","‏":"‏"," ":" "},si={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},ui={v:"title",lang:"lang"},li={rt:"ruby"},ci=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];_e.prototype.applyStyles=function(e,t){for(var n in t=t||this.div,e)e.hasOwnProperty(n)&&(t.style[n]=e[n])},_e.prototype.formatStyle=function(e,t){return 0===e?0:e+t},be.prototype=oi(_e.prototype),be.prototype.constructor=be,Te.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},Te.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},Te.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},Te.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},Te.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},Te.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},Te.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,n=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,r=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||n}},we.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},we.convertCueToDOMTree=function(e,t){return e&&t?me(e,t):null},we.processCues=function(e,t,n){if(!e||!t||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var r=e.document.createElement("div");if(r.style.position="absolute",r.style.left="0",r.style.right="0",r.style.top="0",r.style.bottom="0",r.style.margin="1.5%",n.appendChild(r),function(e){for(var t=0;t0)return void this.trigger("vttjsloaded");var r=t.createElement("script");r.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",r.onload=function(){n.trigger("vttjsloaded")},r.onerror=function(){n.trigger("vttjserror")},this.on("dispose",(function(){r.onload=null,r.onerror=null})),e.WebVTT=!0,this.el().parentNode.appendChild(r)}else this.ready(this.addWebVttScript_)},i.emulateTextTracks=function(){var e=this,t=this.textTracks(),n=this.remoteTextTracks(),r=function(e){return t.addTrack(e.track)},i=function(e){return t.removeTrack(e.track)};n.on("addtrack",r),n.on("removetrack",i),this.addWebVttScript_();var o=function(){return e.trigger("texttrackchange")},a=function(){o();for(var e=0;e