!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){Ke(e).forEach((function(n){return t(e[n],n)}))}function i(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r0)for(var n=e.attributes,i=n.length-1;i>=0;i--){var r=n[i].name,a=n[i].value;"boolean"!=typeof e[r]&&-1===",autoplay,stretch,fluent,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+r+",")||(a=null!==a),t[r]=a}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 A(){t.onselectstart=function(){return!0}}function C(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(o(e,"height"))),n.width||(n.width=parseFloat(o(e,"width"))),n}}function O(n){var i;if(n.getBoundingClientRect&&n.parentNode&&(i=n.getBoundingClientRect()),!i)return{left:0,top:0};var r=t.documentElement,a=t.body,o=r.clientLeft||a.clientLeft||0,s=e.pageXOffset||a.scrollLeft,u=i.left+s-o,l=r.clientTop||a.clientTop||0,c=e.pageYOffset||a.scrollTop,d=i.top+c-l;return{left:Math.round(u),top:Math.round(d)}}function j(e,t){var n={},i=O(e),r=e.offsetWidth,a=e.offsetHeight,o=i.top,s=i.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,(o-u+a)/a)),n.x=Math.max(0,Math.min(1,(l-s)/r)),n}function L(e){return r(e)&&3===e.nodeType}function x(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function I(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"==typeof e&&(e=e()),c(e)||L(e)?e:"string"==typeof e&&/\S/.test(e)?t.createTextNode(e):void 0})).filter((function(e){return e}))}function P(e,t){return I(t).forEach((function(t){return e.appendChild(t)})),e}function R(e,t){return P(x(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,i){n.forEach((function(n){e(t,n,i)}))}function N(n){function i(){return!0}function r(){return!1}if(!n||!n.isPropagationStopped){var a=n||e.event;for(var o in n={},a)"layerX"!==o&&"layerY"!==o&&"keyLocation"!==o&&"webkitMovementX"!==o&&"webkitMovementY"!==o&&("returnValue"===o&&a.preventDefault||(n[o]=a[o]));if(n.target||(n.target=n.srcElement||t),n.relatedTarget||(n.relatedTarget=n.fromElement===n.target?n.toElement:n.fromElement),n.preventDefault=function(){a.preventDefault&&a.preventDefault(),n.returnValue=!1,a.returnValue=!1,n.defaultPrevented=!0},n.defaultPrevented=!1,n.stopPropagation=function(){a.stopPropagation&&a.stopPropagation(),n.cancelBubble=!0,a.cancelBubble=!0,n.isPropagationStopped=i},n.isPropagationStopped=r,n.stopImmediatePropagation=function(){a.stopImmediatePropagation&&a.stopImmediatePropagation(),n.isImmediatePropagationStopped=i,n.stopPropagation()},n.isImmediatePropagationStopped=r,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 i=Qe.get(e);if(i.handlers||(i.handlers={}),i.handlers[t]||(i.handlers[t]=[]),n.guid||(n.guid=D()),i.handlers[t].push(n),i.dispatcher||(i.disabled=!1,i.dispatcher=function(t,n){if(!i.disabled){t=N(t);var r=i.handlers[t.type];if(r)for(var a=r.slice(0),o=0,s=a.length;o-1&&(r={passive:!0}),e.addEventListener(t,i.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,i.dispatcher)}function V(e,t,n){if(Qe.has(e)){var i=Qe.get(e);if(i.handlers){if(Array.isArray(t))return B(V,e,t,n);var r=function(e,t){i.handlers[t]=[],U(e,t)};if(void 0!==t){var a=i.handlers[t];if(a){if(!n)return void r(e,t);if(n.guid)for(var o=0;on)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+n+").")}(e,i,n.length-1),n[i][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 ie(e,t){var n,i,r=0;if(!t)return 0;e&&e.length||(e=ne(0,0));for(var a=0;at&&(i=t),r+=i-n;return r/t}function re(e){if(e instanceof re)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:r(e)&&("number"==typeof e.code&&(this.code=e.code),i(this,e)),this.message||(this.message=re.defaultMessages[this.code]||"")}function ae(e){return null!=e&&"function"==typeof e.then}function oe(e){ae(e)&&e.then(null,(function(e){}))}function se(e,t){return e(t={exports:{}},t.exports),t.exports}function ue(e,t,n){var i=e;return On(t)?(n=t,"string"==typeof e&&(i={uri:e})):i=$i(t,{uri:e}),i.callback=n,i}function le(e,t,n){return ce(t=ue(e,t,n))}function ce(e){function t(){var e=void 0;if(e=o.response?o.response:o.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}(o),m)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,a(e,v)}function i(){if(!u){var n;clearTimeout(l),n=e.useXDR&&void 0===o.status?200:1223===o.status?204:o.status;var i=v,r=null;return 0!==n?(i={body:t(),statusCode:n,method:d,headers:{},url:c,rawRequest:o},o.getAllResponseHeaders&&(i.headers=Wi(o.getAllResponseHeaders()))):r=new Error("Internal XMLHttpRequest Error"),a(r,i,i.body)}}if(void 0===e.callback)throw new Error("callback argument missing");var r=!1,a=function(t,n,i){r||(r=!0,e.callback(t,n,i))},o=e.xhr||null;o||(o=e.cors||e.useXDR?new le.XDomainRequest:new le.XMLHttpRequest);var s,u,l,c=o.url=e.uri||e.url,d=o.method=e.method||"GET",f=e.body||e.data,h=o.headers=e.headers||{},p=!!e.sync,m=!1,v={body:void 0,headers:{},statusCode:0,method:d,url:c,rawRequest:o};if("json"in e&&!1!==e.json&&(m=!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))),o.onreadystatechange=function(){4===o.readyState&&setTimeout(i,0)},o.onload=i,o.onerror=n,o.onprogress=function(){},o.onabort=function(){u=!0},o.ontimeout=n,o.open(d,c,!p,e.username,e.password),p||(o.withCredentials=!!e.withCredentials),!p&&e.timeout>0&&(l=setTimeout((function(){if(!u){u=!0,o.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",n(e)}}),e.timeout)),o.setRequestHeader)for(s in h)h.hasOwnProperty(s)&&o.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&&(o.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(o),o.send(f||null),o}function de(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function fe(e){function t(e,t,n,i){return 3600*(0|e)+60*(0|t)+(0|n)+(0|i)/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=ar(null)}function pe(e,t,n,i){var r=i?e.split(i):[e];for(var a in r)if("string"==typeof r[a]){var o=r[a].split(n);if(2===o.length)t(o[0],o[1])}}function me(e,t,n){function i(){var t=fe(e);if(null===t)throw new de(de.Errors.BadTimeStamp,"Malformed timestamp: "+a);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function r(){e=e.replace(/^\s+/,"")}var a=e;if(r(),t.startTime=i(),r(),"--\x3e"!==e.substr(0,3))throw new de(de.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+a);e=e.substr(3),r(),t.endTime=i(),r(),function(e,t){var i=new he;pe(e,(function(e,t){switch(e){case"region":for(var r=n.length-1;r>=0;r--)if(n[r].id===t){i.set(e,n[r].region);break}break;case"vertical":i.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),o=a[0];i.integer(e,o),i.percent(e,o)&&i.set("snapToLines",!1),i.alt(e,o,["auto"]),2===a.length&&i.alt("lineAlign",a[1],["start","middle","end"]);break;case"position":a=t.split(","),i.percent(e,a[0]),2===a.length&&i.alt("positionAlign",a[1],["start","middle","end"]);break;case"size":i.percent(e,t);break;case"align":i.alt(e,t,["start","middle","end","left","right"])}}),/:/,/\s/),t.region=i.get("region",null),t.vertical=i.get("vertical",""),t.line=i.get("line","auto"),t.lineAlign=i.get("lineAlign","start"),t.snapToLines=i.get("snapToLines",!0),t.size=i.get("size",100),t.align=i.get("align","middle"),t.position=i.get("position",{start:0,left:0,middle:50,end:100,right:100},t.align),t.positionAlign=i.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},t.align)}(e,t)}function ve(e,t){function n(e){return or[e]}for(var i,r=e.document.createElement("div"),a=r,o=[];null!==(i=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("<"!==i[0])a.appendChild(e.document.createTextNode(function(e){for(;l=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)e=e.replace(l[0],n);return e}(i)));else{if("/"===i[1]){o.length&&o[o.length-1]===i.substr(2).replace(">","")&&(o.pop(),a=a.parentNode);continue}var s,u=fe(i.substr(1,i.length-2));if(u){s=e.document.createProcessingInstruction("timestamp",u),a.appendChild(s);continue}var l=i.match(/^<([^.\s\/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!l)continue;if(!(s=function(t,n){var i=sr[t];if(!i)return null;var r=e.document.createElement(i);r.localName=i;var a=ur[t];return a&&n&&(r[a]=n.trim()),r}(l[1],l[3])))continue;if(!function(e,t){return!lr[t.localName]||lr[t.localName]===e.localName}(a,s))continue;l[2]&&(s.className=l[2].substr(1).replace("."," ")),o.push(l[1]),a.appendChild(s),a=s}return r}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 i=e.pop(),r=i.textContent||i.innerText;if(r){var a=r.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):r}return"ruby"===i.tagName?n(e):i.childNodes?(t(e,i),n(e)):void 0}var i=[],r="";if(!e||!e.childNodes)return"ltr";for(t(i,e);r=n(i);)for(var a=0;a=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,i=0,r=0;rd&&(c=c<0?-1:1,c*=Math.ceil(d/l)*l),o<0&&(c+=""===a.vertical?n.height:n.width,s=s.reverse()),r.move(f,c)}else{var h=r.lineHeight/n.height*100;switch(a.lineAlign){case"middle":o-=h/2;break;case"end":o-=h}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(o,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(o,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(o,"%")})}s=["+y","-x","+x","-y"],r=new Te(t)}var p=function(e,t){for(var r,a=new Te(e),o=1,s=0;su&&(r=new Te(e),o=u),e=new Te(a)}return r||a}(r,s);t.move(p.toCSSCompatValues(n))}function we(){}function ke(e){return"string"==typeof e&&!!pr[e.toLowerCase()]&&e.toLowerCase()}function Ee(e,t,n){this.hasBeenReset=!1;var i="",r=!1,a=e,o=t,s=n,u=null,l="",c=!0,d="auto",f="start",h=50,p="middle",m=50,v="middle";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return i},set:function(e){i=""+e}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(e){r=!!e}},startTime:{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");a=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");o=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&&!!hr[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!==fr)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 m},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");m=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return v},set:function(e){var t=ke(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");v=t,this.hasBeenReset=!0}}}),this.displayState=void 0}function Ae(e){return"number"==typeof e&&e>=0&&e<=100}function Ce(e,t,n){e.setTimeout((function(){return function e(t,n,r,a,o,s){void 0===t&&(t={}),void 0===n&&(n=[]),void 0===o&&(o=[]),void 0===s&&(s=!1);var u=n,l=u[0],c=u.slice(1);if("string"==typeof l)e(t,br[l],r,a,o,s);else if(l){var d=function(e,t){var n=Tr[e.id()],i=null;if(null==n)return i=t(e),Tr[e.id()]=[[t,i]],i;for(var r=0;r=0;r--){var a=e[r];a[t]&&a[t](i,n)}}(e,n,s,o),s}function je(e){return function(t,n){return t===Sr?Sr:n[e]?n[e](t):t}}function Le(e){if(!e.type){var t=Cr(e.src);t&&(e.type=t)}return e}function xe(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 Ie(e,t,n){try{e.style[t]=n}catch(e){return}}function Pe(e,t){return void 0===t&&(t=e),Nr(e,t)}function Re(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}function Me(e,t,n){var i=Me.getPlayer(e);if(i)return t&&We.warn('Player "'+e+'" is already initialised. Options will not be applied.'),n&&i.ready(n),i;var a="string"==typeof e?Ye("#"+yo(e)):e;if(!c(a))throw new TypeError("The element or ID supplied is not valid. (videojs)");a.ownerDocument.defaultView&&a.ownerDocument.body.contains(a)||We.warn("The element supplied is not included in the DOM"),t=t||{},Me.hooks("beforesetup").forEach((function(e){var n=e(a,X(t));r(n)&&!Array.isArray(n)?t=X(t,n):We.error("please return an object in beforesetup hooks")}));var o=Et.getComponent("Player");return i=new o(a,t,n),Me.hooks("setup").forEach((function(e){return e(i)})),i}function De(){return(De=Object.assign||function(e){for(var t=1;t0)for(var a=0,o=r.length;a=n&&(t.apply(void 0,arguments),i=r)}},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(){},q(this,e,t),this.addEventListener=n},ht.prototype.any=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},z(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 i=t.type||t,r=st.get(this);r||(r=new Map,st.set(this,r));var a=r.get(i);r.delete(i),e.clearTimeout(a);var o=e.setTimeout((function(){0===r.size&&(r=null,st.delete(n)),n.trigger(t)}),0);r.set(i,o)};var pt=function(e){return e instanceof ht||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"==typeof e[t]}))},mt=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},vt=function(e){if(!e.nodeName&&!pt(e))throw new Error("Invalid target; must be a DOM node or evented object.")},gt=function(e){if(!mt(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,i,r,a=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return a?(n=e.eventBusEl_,t.length>=3&&t.shift(),i=t[0],r=t[1]):(n=t[0],i=t[1],r=t[2]),vt(n),gt(i),yt(r),{isTargetingSelf:a,target:n,type:i,listener:r=dt(e,r)}},bt=function(e,t,n,i){vt(e),e.nodeName?rt[t](e,n,i):e[t](n,i)},Tt={on:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i=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_=X(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 i=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[i],o=i&&i.split("-")[0],s=r&&r[o],u=n;return a&&a[e]?u=a[e]:s&&s[e]&&(u=s[e]),t&&(u=u.replace(/\{(\d+)\}/g,(function(e,n){var i=t[n-1],r=i;return void 0===i&&(r=e),r}))),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,i){var r,a;if(void 0===n&&(n={}),void 0===i&&(i=this.children_.length),"string"==typeof e){a=kt(e);var o=n.componentClass||a;n.name=a;var s=t.getComponent(o);if(!s)throw new Error("Component "+o+" does not exist");if("function"!=typeof s)return null;r=new s(this.player_||this,n)}else r=e;if(r.parentComponent_&&r.parentComponent_.removeChild(r),this.children_.splice(i,0,r),r.parentComponent_=this,"function"==typeof r.id&&(this.childIndex_[r.id()]=r),(a=a||r.name&&kt(r.name()))&&(this.childNameIndex_[a]=r,this.childNameIndex_[wt(a)]=r),"function"==typeof r.el&&r.el()){var u=this.contentEl().children[i]||null;this.contentEl().insertBefore(r.el(),u)}return r},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 i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},n.initChildren=function(){var e=this,n=this.options_.children;if(n){var i,r=this.options_,a=t.getComponent("Tech");(i=Array.isArray(n)?n:Object.keys(n)).concat(Object.keys(this.options_).filter((function(e){return!i.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((function(t){var i,r;return"string"==typeof t?r=n[i=t]||e.options_[i]||{}:(i=t.name,r=t),{name:i,opts:r}})).filter((function(e){var n=t.getComponent(e.opts.componentClass||kt(e.name));return n&&!a.isTech(n)})).forEach((function(t){var n=t.name,i=t.opts;if(void 0!==r[n]&&(i=r[n]),!1!==i){!0===i&&(i={}),i.playerOptions=e.options_.playerOptions;var a=e.addChild(n,i);a&&(e[n]=a)}}))}},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 Ye(e,t||this.contentEl())},n.$$=function(e,t){return Je(e,t||this.contentEl())},n.hasClass=function(e){return v(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 i=this.el_.style[e],r=i.indexOf("px");return-1!==r?parseInt(i.slice(0,r),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=o(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,i=null;this.on("touchstart",(function(r){1===r.touches.length&&(i={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},n=e.performance.now(),t=!0)})),this.on("touchmove",(function(e){if(e.touches.length>1)t=!1;else if(i){var n=e.touches[0].pageX-i.pageX,r=e.touches[0].pageY-i.pageY;Math.sqrt(n*n+r*r)>10&&(t=!1)}}));var r=function(){t=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",(function(r){i=null,!0===t&&e.performance.now()-n<200&&(r.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 i,r=this;return t=dt(this,t),this.clearTimersOnDispose_(),i=e.setTimeout((function(){r.setTimeoutIds_.has(i)&&r.setTimeoutIds_.delete(i),t()}),n),this.setTimeoutIds_.add(i),i},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 i=e.setInterval(t,n);return this.setIntervalIds_.add(i),i},n.clearInterval=function(t){return this.setIntervalIds_.has(t)&&(this.setIntervalIds_.delete(t),e.clearInterval(t)),t},n.requestAnimationFrame=function(t){var n,i=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),t=dt(this,t),n=e.requestAnimationFrame((function(){i.rafIds_.has(n)&&i.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],i=t[1];e[n].forEach(e[i],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 i=t.getComponent("Tech"),r=i&&i.isTech(n),a=t===n||t.prototype.isPrototypeOf(n.prototype);if(r||!a)throw new Error('Illegal component, "'+e+'"; '+(r?"techs must be registered using Tech.registerTech()":"must be a Component subclass")+".");e=kt(e),t.components_||(t.components_={});var o=t.getComponent("Player");if("Player"===e&&o&&o.players){var s=o.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 At,Ct=e.navigator&&e.navigator.userAgent||"",Ot=/AppleWebKit\/([\d.]+)/i.exec(Ct),jt=Ot?parseFloat(Ot.pop()):null,Lt=/iPad/i.test(Ct),xt=/iPhone/i.test(Ct)&&!Lt,It=/iPod/i.test(Ct),Pt=xt||Lt||It,Rt=function(){var e=Ct.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Mt=/Android/i.test(Ct),Dt=function(){var e=Ct.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&&jt<537,Bt=/Firefox/i.test(Ct),Nt=/Edge/i.test(Ct),Ft=!Nt&&(/Chrome/i.test(Ct)||/CriOS/i.test(Ct)),Vt=function(){var e=Ct.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Ht=function(){var e=/MSIE\s(\d+)\.\d/.exec(Ct),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(Ct)&&/rv:11.0/.test(Ct)&&(t=11),t}(),qt=/Safari/i.test(Ct)&&!Ft&&!Mt&&!Nt,zt=(qt||Pt)&&!Ft,Gt=/Windows/i.test(Ct),Wt=(l()&&("ontouchstart"in e||e.navigator.maxTouchPoints||e.DocumentTouch&&e.document instanceof e.DocumentTouch)),$t=Object.freeze({IS_IPAD:Lt,IS_IPHONE:xt,IS_IPOD:It,IS_IOS:Pt,IOS_VERSION:Rt,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:qt,IS_ANY_SAFARI:zt,IS_WINDOWS:Gt,TOUCH_ENABLED:Wt}),Xt={prefixed:!0},Kt=[["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"]],Yt=Kt[0],Jt=0;Jt=0;i--)if(t[i].enabled){dn(t,t[i]);break}return(n=e.call(this,t)||this).changing_=!1,n}K(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;i--)if(t[i].selected){hn(t,t[i]);break}return(n=e.call(this,t)||this).changing_=!1,Object.defineProperty(Q(n),"selectedIndex",{get:function(){for(var e=0;e',r=a.firstChild,a.setAttribute("style","display:none; position:absolute;"),t.body.appendChild(a));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""},An=function(t){var n=e.location,i=wn(t);return(":"===i.protocol?n.protocol:i.protocol)+i.host!==n.protocol+n.host},Cn=Object.freeze({parseUrl:wn,getAbsoluteURL:kn,getFileExtension:En,isCrossOrigin:An}),On=function(e){var t=jn.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)},jn=Object.prototype.toString,Ln=Array.prototype.slice,xn=Object.prototype.toString,In=Function.prototype.bind||function(e){var t=this;if("function"!=typeof t||"[object Function]"!==xn.call(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var n,i=Ln.call(arguments,1),r=function(){if(this instanceof n){var r=t.apply(this,i.concat(Ln.call(arguments)));return Object(r)===r?r:this}return t.apply(e,i.concat(Ln.call(arguments)))},a=Math.max(0,t.length-i.length),o=[],s=0;s=0&&"[object Function]"===Pn.call(e.callee)),n};if(!Object.keys){var Mn=Object.prototype.hasOwnProperty,Dn=Object.prototype.toString,Un=Rn,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},qn={$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},zn=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!qn["$"+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),i=Un(e),r=t&&"[object String]"===Dn.call(e),a=[];if(!t&&!n&&!i)throw new TypeError("Object.keys called on a non-object");var o=Fn&&n;if(r&&e.length>0&&!Mn.call(e,0))for(var s=0;s0)for(var u=0;u2?arguments[2]:{},i=Yn(t);Jn&&(i=Qn.call(i,Object.getOwnPropertySymbols(t)));for(var r=0;r1&&"boolean"!=typeof t)throw new TypeError('"allowMissing" argument must be a boolean');var n="$ "+e;if(!(n in li))throw new SyntaxError("intrinsic "+e+" does not exist!");if(void 0===li[n]&&!t)throw new TypeError("intrinsic "+e+" exists, but is not available. Please file an issue!");return li[n]},di=In.call(Function.call,Object.prototype.hasOwnProperty),fi=ci("%TypeError%"),hi=ci("%SyntaxError%"),pi={"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 i in t)if(di(t,i)&&!n[i])return!1;var r=di(t,"[[Value]]"),a=di(t,"[[Get]]")||di(t,"[[Set]]");if(r&&a)throw new fi("Property Descriptors may not be both accessor and data descriptors");return!0}},mi=function(e,t,n,i){var r=pi[t];if("function"!=typeof r)throw new hi("unknown record type: "+t);if(!r(e,i))throw new fi(n+" must be a "+t);r(e,i)},vi=Number.isNaN||function(e){return e!=e},gi=Number.isNaN||function(e){return e!=e},yi=Number.isFinite||function(e){return"number"==typeof e&&!gi(e)&&e!==1/0&&e!==-1/0},_i=function(e){return e>=0?1:-1},bi=Function.prototype.toString,Ti=/^\s*class\b/,Si=function(e){try{var t=bi.call(e);return Ti.test(t)}catch(e){return!1}},wi=Object.prototype.toString,ki="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,Ei=function(e){if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(ki)return function(e){try{return!Si(e)&&(bi.call(e),!0)}catch(e){return!1}}(e);if(Si(e))return!1;var t=wi.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t},Ai=function(e){return null===e||"function"!=typeof e&&"object"!=typeof e},Ci=Object.prototype.toString,Oi=function(e){var t;if((t=arguments.length>1?arguments[1]:"[object Date]"===Ci.call(e)?String:Number)===String||t===Number){var n,i,r=t===String?["toString","valueOf"]:["valueOf","toString"];for(i=0;i1?Oi(e,arguments[1]):Oi(e)},ToBoolean:function(e){return!!e},ToNumber:function(e){return+e},ToInteger:function(e){var t=this.ToNumber(e);return vi(t)?0:0!==t&&yi(t)?_i(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 vi(t)||0===t||!yi(t)?0:function(e,t){var n=e%t;return Math.floor(n>=0?n:n+t)}(_i(t)*Math.floor(Math.abs(t)),65536)},ToString:function(e){return xi(e)},ToObject:function(e){return this.CheckObjectCoercible(e),ji(e)},CheckObjectCoercible:function(e,t){if(null==e)throw new Li(t||"Cannot call method on "+e);return e},IsCallable:Ei,SameValue:function(e,t){return e===t?0!==e||1/e==1/t:vi(e)&&vi(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(di(e,n)&&!t[n])return!1;var i=di(e,"[[Value]]"),r=di(e,"[[Get]]")||di(e,"[[Set]]");if(i&&r)throw new Li("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(e){return void 0!==e&&(mi(this,"Property Descriptor","Desc",e),!(!di(e,"[[Get]]")&&!di(e,"[[Set]]")))},IsDataDescriptor:function(e){return void 0!==e&&(mi(this,"Property Descriptor","Desc",e),!(!di(e,"[[Value]]")&&!di(e,"[[Writable]]")))},IsGenericDescriptor:function(e){return void 0!==e&&(mi(this,"Property Descriptor","Desc",e),!this.IsAccessorDescriptor(e)&&!this.IsDataDescriptor(e))},FromPropertyDescriptor:function(e){if(void 0===e)return e;if(mi(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 Li("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(e){if("Object"!==this.Type(e))throw new Li("ToPropertyDescriptor requires an object");var t={};if(di(e,"enumerable")&&(t["[[Enumerable]]"]=this.ToBoolean(e.enumerable)),di(e,"configurable")&&(t["[[Configurable]]"]=this.ToBoolean(e.configurable)),di(e,"value")&&(t["[[Value]]"]=e.value),di(e,"writable")&&(t["[[Writable]]"]=this.ToBoolean(e.writable)),di(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(di(e,"set")){var i=e.set;if(void 0!==i&&!this.IsCallable(i))throw new Li("setter must be a function");t["[[Set]]"]=i}if((di(t,"[[Get]]")||di(t,"[[Set]]"))&&(di(t,"[[Value]]")||di(t,"[[Writable]]")))throw new Li("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t}},Pi=In.call(Function.call,String.prototype.replace),Ri=/^[\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]+/,Mi=/[\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]+$/,Di=function(){var e=Ii.ToString(Ii.CheckObjectCoercible(this));return Pi(Pi(e,Ri,""),Mi,"")},Ui=function(){return String.prototype.trim&&"​"==="​".trim()?String.prototype.trim:Di},Bi=In.call(Function.call,Ui());ri(Bi,{getPolyfill:Ui,implementation:Di,shim:function(){var e=Ui();return ri(String.prototype,{trim:e},{trim:function(){return String.prototype.trim!==e}}),e}});var Ni=Bi,Fi=Object.prototype.toString,Vi=Object.prototype.hasOwnProperty,Hi=function(e,t,n){for(var i=0,r=e.length;i=3&&(i=n),"[object Array]"===Fi.call(e)?Hi(e,t,i):"string"==typeof e?qi(e,t,i):zi(e,t,i)},Wi=function(e){if(!e)return{};var t={};return Gi(Ni(e).split("\n"),(function(e){var n=e.indexOf(":"),i=Ni(e.slice(0,n)).toLowerCase(),r=Ni(e.slice(n+1));void 0===t[i]?t[i]=r:function(e){return"[object Array]"===Object.prototype.toString.call(e)}(t[i])?t[i].push(r):t[i]=[t[i],r]})),t},$i=function(){for(var e={},t=0;t0&&(e.console&&e.console.groupCollapsed&&e.console.groupCollapsed("Text Track parsing errors for "+n.src),r.forEach((function(e){return We.error(e)})),e.console&&e.console.groupEnd&&e.console.groupEnd()),i.flush()},Ji=function(t,n){var i={uri:t},r=An(t);r&&(i.cors=r),Ki(i,dt(this,(function(t,i,r){if(t)return We.error(t,i);n.loaded_=!0,"function"!=typeof e.WebVTT?n.tech_&&n.tech_.any(["vttjsloaded","vttjserror"],(function(e){return"vttjserror"===e.type?void We.error("vttjs failed to load, stopping trying to process "+n.src):Yi(r,n)})):Yi(r,n)})))},Zi=function(t){function n(e){var n;if(void 0===e&&(e={}),!e.tech)throw new Error("A tech was not provided.");var i=X(e,{kind:bn[e.kind]||"subtitles",language:e.language||e.srclang||""}),r=Tn[i.mode]||"disabled",a=i.default;"metadata"!==i.kind&&"chapters"!==i.kind||(r="hidden"),(n=t.call(this,i)||this).tech_=i.tech,n.cues_=[],n.activeCues_=[];var o=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"!==r&&n.tech_.ready((function(){n.tech_.on("timeupdate",l)}),!0),Object.defineProperties(Q(n),{default:{get:function(){return a},set:function(){}},mode:{get:function(){return r},set:function(e){var t=this;Tn[e]&&("disabled"!==(r=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_?o: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,i=this.cues.length;n=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r)}if(u=!1,t.length!==this.activeCues_.length)u=!0;else for(var a=0;a=0&&t<=100)&&(this.set(e,t),!0)}};var or={"&":"&","<":"<",">":">","‎":"‎","‏":"‏"," ":" "},sr={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},ur={v:"title",lang:"lang"},lr={rt:"ruby"},cr=[[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=ar(_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,i=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||i,height:e.height||t,bottom:e.bottom||i+(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?ve(e,t):null},we.processCues=function(e,t,n){if(!e||!t||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var i=e.document.createElement("div");if(i.style.position="absolute",i.style.left="0",i.style.right="0",i.style.top="0",i.style.bottom="0",i.style.margin="1.5%",n.appendChild(i),function(e){for(var t=0;t0)return void this.trigger("vttjsloaded");var i=t.createElement("script");i.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",i.onload=function(){n.trigger("vttjsloaded")},i.onerror=function(){n.trigger("vttjserror")},this.on("dispose",(function(){i.onload=null,i.onerror=null})),e.WebVTT=!0,this.el().parentNode.appendChild(i)}else this.ready(this.addWebVttScript_)},r.emulateTextTracks=function(){var e=this,t=this.textTracks(),n=this.remoteTextTracks(),i=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};n.on("addtrack",i),n.on("removetrack",r),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},o=function(){a();for(var e=0;e