diff --git a/media/player/videojs/amd/build/video-lazy.min.js b/media/player/videojs/amd/build/video-lazy.min.js
index d49435a7a82..72bad06d90a 100644
--- a/media/player/videojs/amd/build/video-lazy.min.js
+++ b/media/player/videojs/amd/build/video-lazy.min.js
@@ -1,6 +1,6 @@
/**
* @license
- * Video.js 7.20.3
+ * Video.js 8.3.0
* Copyright Brightcove, Inc.
* Available under Apache License Version 2.0
*
@@ -9,7 +9,7 @@
* Available under Apache License Version 2.0
*
*/
-!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory():"function"==typeof define&&define.amd?define("media_videojs/video-lazy",factory):(global="undefined"!=typeof globalThis?globalThis:global||self).videojs=factory()}(window,(function(){for(var browserApi,hooks_={},hooks=function(type,fn){return hooks_[type]=hooks_[type]||[],fn&&(hooks_[type]=hooks_[type].concat(fn)),hooks_[type]},removeHook=function(type,fn){var index=hooks(type).indexOf(fn);return!(index<=-1)&&(hooks_[type]=hooks_[type].slice(),hooks_[type].splice(index,1),!0)},FullscreenApi={prefixed:!0},apiMap=[["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"]],specApi=apiMap[0],i=0;i0?splice:0)}if(window.console){var fn=window.console[type];fn||"debug"!==type||(fn=window.console.info||window.console.log),fn&&lvl&&lvlRegExp.test(type)&&fn[Array.isArray(args)?"apply":"call"](window.console,args)}}}(name,log),log.createLogger=function(subname){return createLogger$1(name+": "+subname)},log.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:level},log.level=function(lvl){if("string"==typeof lvl){if(!log.levels.hasOwnProperty(lvl))throw new Error('"'+lvl+'" in not a valid log level');level=lvl}return level},(log.history=function(){return history?[].concat(history):[]}).filter=function(fname){return(history||[]).filter((function(historyItem){return new RegExp(".*"+fname+".*").test(historyItem[0])}))},log.history.clear=function(){history&&(history.length=0)},log.history.disable=function(){null!==history&&(history.length=0,history=null)},log.history.enable=function(){null===history&&(history=[])},log.error=function(){for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++)args[_key2]=arguments[_key2];return logByType("error",level,args)},log.warn=function(){for(var _len3=arguments.length,args=new Array(_len3),_key3=0;_key3<_len3;_key3++)args[_key3]=arguments[_key3];return logByType("warn",level,args)},log.debug=function(){for(var _len4=arguments.length,args=new Array(_len4),_key4=0;_key4<_len4;_key4++)args[_key4]=arguments[_key4];return logByType("debug",level,args)},log}("VIDEOJS"),createLogger=log$1.createLogger,commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(fn,module){return fn(module={exports:{}},module.exports),module.exports}var _extends_1=createCommonjsModule((function(module){function _extends(){return module.exports=_extends=Object.assign||function(target){for(var i=1;i1?_len-1:0),_key=1;_key<_len;_key++)sources[_key-1]=arguments[_key];return Object.assign?_extends_1.apply(void 0,[target].concat(sources)):(sources.forEach((function(source){source&&each(source,(function(value,key){target[key]=value}))})),target)}function isObject$1(value){return!!value&&"object"==typeof value}function isPlain(value){return isObject$1(value)&&"[object Object]"===toString$1.call(value)&&value.constructor===Object}function computedStyle(el,prop){if(!el||!prop)return"";if("function"==typeof window.getComputedStyle){var computedStyleValue;try{computedStyleValue=window.getComputedStyle(el)}catch(e){return""}return computedStyleValue?computedStyleValue.getPropertyValue(prop)||computedStyleValue[prop]:""}return""}var match,USER_AGENT=window.navigator&&window.navigator.userAgent||"",webkitVersionMap=/AppleWebKit\/([\d.]+)/i.exec(USER_AGENT),appleWebkitVersion=webkitVersionMap?parseFloat(webkitVersionMap.pop()):null,IS_IPOD=/iPod/i.test(USER_AGENT),IOS_VERSION=(match=USER_AGENT.match(/OS (\d+)_/i))&&match[1]?match[1]:null,IS_ANDROID=/Android/i.test(USER_AGENT),ANDROID_VERSION=function(){var match=USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!match)return null;var major=match[1]&&parseFloat(match[1]),minor=match[2]&&parseFloat(match[2]);return major&&minor?parseFloat(match[1]+"."+match[2]):major||null}(),IS_NATIVE_ANDROID=IS_ANDROID&&ANDROID_VERSION<5&&appleWebkitVersion<537,IS_FIREFOX=/Firefox/i.test(USER_AGENT),IS_EDGE=/Edg/i.test(USER_AGENT),IS_CHROME=!IS_EDGE&&(/Chrome/i.test(USER_AGENT)||/CriOS/i.test(USER_AGENT)),CHROME_VERSION=function(){var match=USER_AGENT.match(/(Chrome|CriOS)\/(\d+)/);return match&&match[2]?parseFloat(match[2]):null}(),IE_VERSION=function(){var result=/MSIE\s(\d+)\.\d/.exec(USER_AGENT),version=result&&parseFloat(result[1]);return!version&&/Trident\/7.0/i.test(USER_AGENT)&&/rv:11.0/.test(USER_AGENT)&&(version=11),version}(),IS_SAFARI=/Safari/i.test(USER_AGENT)&&!IS_CHROME&&!IS_ANDROID&&!IS_EDGE,IS_WINDOWS=/Windows/i.test(USER_AGENT),TOUCH_ENABLED=Boolean(isReal()&&("ontouchstart"in window||window.navigator.maxTouchPoints||window.DocumentTouch&&window.document instanceof window.DocumentTouch)),IS_IPAD=/iPad/i.test(USER_AGENT)||IS_SAFARI&&TOUCH_ENABLED&&!/iPhone/i.test(USER_AGENT),IS_IPHONE=/iPhone/i.test(USER_AGENT)&&!IS_IPAD,IS_IOS=IS_IPHONE||IS_IPAD||IS_IPOD,IS_ANY_SAFARI=(IS_SAFARI||IS_IOS)&&!IS_CHROME,browser=Object.freeze({__proto__:null,IS_IPOD:IS_IPOD,IOS_VERSION:IOS_VERSION,IS_ANDROID:IS_ANDROID,ANDROID_VERSION:ANDROID_VERSION,IS_NATIVE_ANDROID:IS_NATIVE_ANDROID,IS_FIREFOX:IS_FIREFOX,IS_EDGE:IS_EDGE,IS_CHROME:IS_CHROME,CHROME_VERSION:CHROME_VERSION,IE_VERSION:IE_VERSION,IS_SAFARI:IS_SAFARI,IS_WINDOWS:IS_WINDOWS,TOUCH_ENABLED:TOUCH_ENABLED,IS_IPAD:IS_IPAD,IS_IPHONE:IS_IPHONE,IS_IOS:IS_IOS,IS_ANY_SAFARI:IS_ANY_SAFARI});function isNonBlankString(str){return"string"==typeof str&&Boolean(str.trim())}function throwIfWhitespace(str){if(str.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function isReal(){return document===window.document}function isEl(value){return isObject$1(value)&&1===value.nodeType}function isInFrame(){try{return window.parent!==window.self}catch(x){return!0}}function createQuerier(method){return function(selector,context){if(!isNonBlankString(selector))return document[method](null);isNonBlankString(context)&&(context=document.querySelector(context));var ctx=isEl(context)?context:document;return ctx[method]&&ctx[method](selector)}}function createEl(tagName,properties,attributes,content){void 0===tagName&&(tagName="div"),void 0===properties&&(properties={}),void 0===attributes&&(attributes={});var el=document.createElement(tagName);return Object.getOwnPropertyNames(properties).forEach((function(propName){var val=properties[propName];-1!==propName.indexOf("aria-")||"role"===propName||"type"===propName?(log$1.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+propName+" to "+val+"."),el.setAttribute(propName,val)):"textContent"===propName?textContent(el,val):el[propName]===val&&"tabIndex"!==propName||(el[propName]=val)})),Object.getOwnPropertyNames(attributes).forEach((function(attrName){el.setAttribute(attrName,attributes[attrName])})),content&&appendContent(el,content),el}function textContent(el,text){return void 0===el.textContent?el.innerText=text:el.textContent=text,el}function prependTo(child,parent){parent.firstChild?parent.insertBefore(child,parent.firstChild):parent.appendChild(child)}function hasClass(element,classToCheck){return throwIfWhitespace(classToCheck),element.classList?element.classList.contains(classToCheck):(className=classToCheck,new RegExp("(^|\\s)"+className+"($|\\s)")).test(element.className);var className}function addClass(element,classToAdd){return element.classList?element.classList.add(classToAdd):hasClass(element,classToAdd)||(element.className=(element.className+" "+classToAdd).trim()),element}function removeClass(element,classToRemove){return element?(element.classList?element.classList.remove(classToRemove):(throwIfWhitespace(classToRemove),element.className=element.className.split(/\s+/).filter((function(c){return c!==classToRemove})).join(" ")),element):(log$1.warn("removeClass was called with an element that doesn't exist"),null)}function toggleClass(element,classToToggle,predicate){var has=hasClass(element,classToToggle);if("function"==typeof predicate&&(predicate=predicate(element,classToToggle)),"boolean"!=typeof predicate&&(predicate=!has),predicate!==has)return predicate?addClass(element,classToToggle):removeClass(element,classToToggle),element}function setAttributes(el,attributes){Object.getOwnPropertyNames(attributes).forEach((function(attrName){var attrValue=attributes[attrName];null==attrValue||!1===attrValue?el.removeAttribute(attrName):el.setAttribute(attrName,!0===attrValue?"":attrValue)}))}function getAttributes(tag){var obj={},knownBooleans=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(tag&&tag.attributes&&tag.attributes.length>0)for(var attrs=tag.attributes,i=attrs.length-1;i>=0;i--){var attrName=attrs[i].name,attrVal=attrs[i].value;"boolean"!=typeof tag[attrName]&&-1===knownBooleans.indexOf(","+attrName+",")||(attrVal=null!==attrVal),obj[attrName]=attrVal}return obj}function getAttribute(el,attribute){return el.getAttribute(attribute)}function setAttribute(el,attribute,value){el.setAttribute(attribute,value)}function removeAttribute(el,attribute){el.removeAttribute(attribute)}function blockTextSelection(){document.body.focus(),document.onselectstart=function(){return!1}}function unblockTextSelection(){document.onselectstart=function(){return!0}}function getBoundingClientRect(el){if(el&&el.getBoundingClientRect&&el.parentNode){var rect=el.getBoundingClientRect(),result={};return["bottom","height","left","right","top","width"].forEach((function(k){void 0!==rect[k]&&(result[k]=rect[k])})),result.height||(result.height=parseFloat(computedStyle(el,"height"))),result.width||(result.width=parseFloat(computedStyle(el,"width"))),result}}function findPosition(el){if(!el||el&&!el.offsetParent)return{left:0,top:0,width:0,height:0};for(var width=el.offsetWidth,height=el.offsetHeight,left=0,top=0;el.offsetParent&&el!==document[FullscreenApi.fullscreenElement];)left+=el.offsetLeft,top+=el.offsetTop,el=el.offsetParent;return{left:left,top:top,width:width,height:height}}function getPointerPosition(el,event){var translated={x:0,y:0};if(IS_IOS)for(var item=el;item&&"html"!==item.nodeName.toLowerCase();){var transform=computedStyle(item,"transform");if(/^matrix/.test(transform)){var values=transform.slice(7,-1).split(/,\s/).map(Number);translated.x+=values[4],translated.y+=values[5]}else if(/^matrix3d/.test(transform)){var _values=transform.slice(9,-1).split(/,\s/).map(Number);translated.x+=_values[12],translated.y+=_values[13]}item=item.parentNode}var position={},boxTarget=findPosition(event.target),box=findPosition(el),boxW=box.width,boxH=box.height,offsetY=event.offsetY-(box.top-boxTarget.top),offsetX=event.offsetX-(box.left-boxTarget.left);return event.changedTouches&&(offsetX=event.changedTouches[0].pageX-box.left,offsetY=event.changedTouches[0].pageY+box.top,IS_IOS&&(offsetX-=translated.x,offsetY-=translated.y)),position.y=1-Math.max(0,Math.min(1,offsetY/boxH)),position.x=Math.max(0,Math.min(1,offsetX/boxW)),position}function isTextNode(value){return isObject$1(value)&&3===value.nodeType}function emptyEl(el){for(;el.firstChild;)el.removeChild(el.firstChild);return el}function normalizeContent(content){return"function"==typeof content&&(content=content()),(Array.isArray(content)?content:[content]).map((function(value){return"function"==typeof value&&(value=value()),isEl(value)||isTextNode(value)?value:"string"==typeof value&&/\S/.test(value)?document.createTextNode(value):void 0})).filter((function(value){return value}))}function appendContent(el,content){return normalizeContent(content).forEach((function(node){return el.appendChild(node)})),el}function insertContent(el,content){return appendContent(emptyEl(el),content)}function isSingleLeftClick(event){return void 0===event.button&&void 0===event.buttons||(0===event.button&&void 0===event.buttons||("mouseup"===event.type&&0===event.button&&0===event.buttons||0===event.button&&1===event.buttons))}var videojs$1,$=createQuerier("querySelector"),$$=createQuerier("querySelectorAll"),Dom=Object.freeze({__proto__:null,isReal:isReal,isEl:isEl,isInFrame:isInFrame,createEl:createEl,textContent:textContent,prependTo:prependTo,hasClass:hasClass,addClass:addClass,removeClass:removeClass,toggleClass:toggleClass,setAttributes:setAttributes,getAttributes:getAttributes,getAttribute:getAttribute,setAttribute:setAttribute,removeAttribute:removeAttribute,blockTextSelection:blockTextSelection,unblockTextSelection:unblockTextSelection,getBoundingClientRect:getBoundingClientRect,findPosition:findPosition,getPointerPosition:getPointerPosition,isTextNode:isTextNode,emptyEl:emptyEl,normalizeContent:normalizeContent,appendContent:appendContent,insertContent:insertContent,isSingleLeftClick:isSingleLeftClick,$:$,$$:$$}),_windowLoaded=!1,autoSetup=function(){if(!1!==videojs$1.options.autoSetup){var vids=Array.prototype.slice.call(document.getElementsByTagName("video")),audios=Array.prototype.slice.call(document.getElementsByTagName("audio")),divs=Array.prototype.slice.call(document.getElementsByTagName("video-js")),mediaEls=vids.concat(audios,divs);if(mediaEls&&mediaEls.length>0)for(var i=0,e=mediaEls.length;i-1&&(options={passive:!0}),elem.addEventListener(type,data.dispatcher,options)}else elem.attachEvent&&elem.attachEvent("on"+type,data.dispatcher)}function off(elem,type,fn){if(DomData.has(elem)){var data=DomData.get(elem);if(data.handlers){if(Array.isArray(type))return _handleMultipleEvents(off,elem,type,fn);var removeType=function(el,t){data.handlers[t]=[],_cleanUpEvents(el,t)};if(void 0!==type){var handlers=data.handlers[type];if(handlers)if(fn){if(fn.guid)for(var n=0;n=wait&&(fn.apply(void 0,arguments),last=now)}},EventTarget$2=function(){};EventTarget$2.prototype.allowedEvents_={},EventTarget$2.prototype.on=function(type,fn){var ael=this.addEventListener;this.addEventListener=function(){},on(this,type,fn),this.addEventListener=ael},EventTarget$2.prototype.addEventListener=EventTarget$2.prototype.on,EventTarget$2.prototype.off=function(type,fn){off(this,type,fn)},EventTarget$2.prototype.removeEventListener=EventTarget$2.prototype.off,EventTarget$2.prototype.one=function(type,fn){var ael=this.addEventListener;this.addEventListener=function(){},one(this,type,fn),this.addEventListener=ael},EventTarget$2.prototype.any=function(type,fn){var ael=this.addEventListener;this.addEventListener=function(){},any(this,type,fn),this.addEventListener=ael},EventTarget$2.prototype.trigger=function(event){var type=event.type||event;"string"==typeof event&&(event={type:type}),event=fixEvent(event),this.allowedEvents_[type]&&this["on"+type]&&this["on"+type](event),trigger(this,event)},EventTarget$2.prototype.dispatchEvent=EventTarget$2.prototype.trigger,EventTarget$2.prototype.queueTrigger=function(event){var _this=this;EVENT_MAP||(EVENT_MAP=new Map);var type=event.type||event,map=EVENT_MAP.get(this);map||(map=new Map,EVENT_MAP.set(this,map));var oldTimeout=map.get(type);map.delete(type),window.clearTimeout(oldTimeout);var timeout=window.setTimeout((function(){0===map.size&&(map=null,EVENT_MAP.delete(_this)),_this.trigger(event)}),0);map.set(type,timeout)};var objName=function(obj){return"function"==typeof obj.name?obj.name():"string"==typeof obj.name?obj.name:obj.name_?obj.name_:obj.constructor&&obj.constructor.name?obj.constructor.name:typeof obj},isEvented=function(object){return object instanceof EventTarget$2||!!object.eventBusEl_&&["on","one","off","trigger"].every((function(k){return"function"==typeof object[k]}))},isValidEventType=function(type){return"string"==typeof type&&/\S/.test(type)||Array.isArray(type)&&!!type.length},validateTarget=function(target,obj,fnName){if(!target||!target.nodeName&&!isEvented(target))throw new Error("Invalid target for "+objName(obj)+"#"+fnName+"; must be a DOM node or evented object.")},validateEventType=function(type,obj,fnName){if(!isValidEventType(type))throw new Error("Invalid event type for "+objName(obj)+"#"+fnName+"; must be a non-empty string or array.")},validateListener=function(listener,obj,fnName){if("function"!=typeof listener)throw new Error("Invalid listener for "+objName(obj)+"#"+fnName+"; must be a function.")},normalizeListenArgs=function(self,args,fnName){var target,type,listener,isTargetingSelf=args.length<3||args[0]===self||args[0]===self.eventBusEl_;return isTargetingSelf?(target=self.eventBusEl_,args.length>=3&&args.shift(),type=args[0],listener=args[1]):(target=args[0],type=args[1],listener=args[2]),validateTarget(target,self,fnName),validateEventType(type,self,fnName),validateListener(listener,self,fnName),{isTargetingSelf:isTargetingSelf,target:target,type:type,listener:listener=bind(self,listener)}},listen=function(target,method,type,listener){validateTarget(target,target,method),target.nodeName?Events[method](target,type,listener):target[method](type,listener)},EventedMixin={on:function(){for(var _this=this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];var _normalizeListenArgs=normalizeListenArgs(this,args,"on"),isTargetingSelf=_normalizeListenArgs.isTargetingSelf,target=_normalizeListenArgs.target,type=_normalizeListenArgs.type,listener=_normalizeListenArgs.listener;if(listen(target,"on",type,listener),!isTargetingSelf){var removeListenerOnDispose=function(){return _this.off(target,type,listener)};removeListenerOnDispose.guid=listener.guid;var removeRemoverOnTargetDispose=function(){return _this.off("dispose",removeListenerOnDispose)};removeRemoverOnTargetDispose.guid=listener.guid,listen(this,"on","dispose",removeListenerOnDispose),listen(target,"on","dispose",removeRemoverOnTargetDispose)}},one:function(){for(var _this2=this,_len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++)args[_key2]=arguments[_key2];var _normalizeListenArgs2=normalizeListenArgs(this,args,"one"),isTargetingSelf=_normalizeListenArgs2.isTargetingSelf,target=_normalizeListenArgs2.target,type=_normalizeListenArgs2.type,listener=_normalizeListenArgs2.listener;if(isTargetingSelf)listen(target,"one",type,listener);else{var wrapper=function wrapper(){_this2.off(target,type,wrapper);for(var _len3=arguments.length,largs=new Array(_len3),_key3=0;_key3<_len3;_key3++)largs[_key3]=arguments[_key3];listener.apply(null,largs)};wrapper.guid=listener.guid,listen(target,"one",type,wrapper)}},any:function(){for(var _this3=this,_len4=arguments.length,args=new Array(_len4),_key4=0;_key4<_len4;_key4++)args[_key4]=arguments[_key4];var _normalizeListenArgs3=normalizeListenArgs(this,args,"any"),isTargetingSelf=_normalizeListenArgs3.isTargetingSelf,target=_normalizeListenArgs3.target,type=_normalizeListenArgs3.type,listener=_normalizeListenArgs3.listener;if(isTargetingSelf)listen(target,"any",type,listener);else{var wrapper=function wrapper(){_this3.off(target,type,wrapper);for(var _len5=arguments.length,largs=new Array(_len5),_key5=0;_key5<_len5;_key5++)largs[_key5]=arguments[_key5];listener.apply(null,largs)};wrapper.guid=listener.guid,listen(target,"any",type,wrapper)}},off:function(targetOrType,typeOrListener,listener){if(!targetOrType||isValidEventType(targetOrType))off(this.eventBusEl_,targetOrType,typeOrListener);else{var target=targetOrType,type=typeOrListener;validateTarget(target,this,"off"),validateEventType(type,this,"off"),validateListener(listener,this,"off"),listener=bind(this,listener),this.off("dispose",listener),target.nodeName?(off(target,type,listener),off(target,"dispose",listener)):isEvented(target)&&(target.off(type,listener),target.off("dispose",listener))}},trigger:function(event,hash){validateTarget(this.eventBusEl_,this,"trigger");var type=event&&"string"!=typeof event?event.type:event;if(!isValidEventType(type)){var error="Invalid event type for "+objName(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.";if(!event)throw new Error(error);(this.log||log$1).error(error)}return trigger(this.eventBusEl_,event,hash)}};function evented(target,options){void 0===options&&(options={});var eventBusKey=options.eventBusKey;if(eventBusKey){if(!target[eventBusKey].nodeName)throw new Error('The eventBusKey "'+eventBusKey+'" does not refer to an element.');target.eventBusEl_=target[eventBusKey]}else target.eventBusEl_=createEl("span",{className:"vjs-event-bus"});return assign(target,EventedMixin),target.eventedCallbacks&&target.eventedCallbacks.forEach((function(callback){callback()})),target.on("dispose",(function(){target.off(),[target,target.el_,target.eventBusEl_].forEach((function(val){val&&DomData.has(val)&&DomData.delete(val)})),window.setTimeout((function(){target.eventBusEl_=null}),0)})),target}var StatefulMixin={state:{},setState:function(stateUpdates){var changes,_this=this;return"function"==typeof stateUpdates&&(stateUpdates=stateUpdates()),each(stateUpdates,(function(value,key){_this.state[key]!==value&&((changes=changes||{})[key]={from:_this.state[key],to:value}),_this.state[key]=value})),changes&&isEvented(this)&&this.trigger({changes:changes,type:"statechanged"}),changes}};function stateful(target,defaultState){return assign(target,StatefulMixin),target.state=assign({},target.state,defaultState),"function"==typeof target.handleStateChanged&&isEvented(target)&&target.on("statechanged",target.handleStateChanged),target}var toLowerCase=function(string){return"string"!=typeof string?string:string.replace(/./,(function(w){return w.toLowerCase()}))},toTitleCase$1=function(string){return"string"!=typeof string?string:string.replace(/./,(function(w){return w.toUpperCase()}))};function mergeOptions$3(){for(var result={},_len=arguments.length,sources=new Array(_len),_key=0;_key<_len;_key++)sources[_key]=arguments[_key];return sources.forEach((function(source){source&&each(source,(function(value,key){isPlain(value)?(isPlain(result[key])||(result[key]={}),result[key]=mergeOptions$3(result[key],value)):result[key]=value}))})),result}var MapSham=function(){function MapSham(){this.map_={}}var _proto=MapSham.prototype;return _proto.has=function(key){return key in this.map_},_proto.delete=function(key){var has=this.has(key);return delete this.map_[key],has},_proto.set=function(key,value){return this.map_[key]=value,this},_proto.forEach=function(callback,thisArg){for(var key in this.map_)callback.call(thisArg,this.map_[key],key,this)},MapSham}(),Map$1=window.Map?window.Map:MapSham,SetSham=function(){function SetSham(){this.set_={}}var _proto=SetSham.prototype;return _proto.has=function(key){return key in this.set_},_proto.delete=function(key){var has=this.has(key);return delete this.set_[key],has},_proto.add=function(key){return this.set_[key]=1,this},_proto.forEach=function(callback,thisArg){for(var key in this.set_)callback.call(thisArg,key,key,this)},SetSham}(),Set$1=window.Set?window.Set:SetSham,keycode=createCommonjsModule((function(module,exports){function keyCode(searchInput){if(searchInput&&"object"==typeof searchInput){var hasKeyCode=searchInput.which||searchInput.keyCode||searchInput.charCode;hasKeyCode&&(searchInput=hasKeyCode)}if("number"==typeof searchInput)return names[searchInput];var foundNamedKey,search=String(searchInput);return(foundNamedKey=codes[search.toLowerCase()])?foundNamedKey:(foundNamedKey=aliases[search.toLowerCase()])||(1===search.length?search.charCodeAt(0):void 0)}keyCode.isEventKey=function(event,nameOrCode){if(event&&"object"==typeof event){var keyCode=event.which||event.keyCode||event.charCode;if(null==keyCode)return!1;if("string"==typeof nameOrCode){var foundNamedKey;if(foundNamedKey=codes[nameOrCode.toLowerCase()])return foundNamedKey===keyCode;if(foundNamedKey=aliases[nameOrCode.toLowerCase()])return foundNamedKey===keyCode}else if("number"==typeof nameOrCode)return nameOrCode===keyCode;return!1}};var codes=(exports=module.exports=keyCode).code=exports.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},aliases=exports.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(i=97;i<123;i++)codes[String.fromCharCode(i)]=i-32;for(var i=48;i<58;i++)codes[i-48]=i;for(i=1;i<13;i++)codes["f"+i]=i+111;for(i=0;i<10;i++)codes["numpad "+i]=i+96;var names=exports.names=exports.title={};for(i in codes)names[codes[i]]=i;for(var alias in aliases)codes[alias]=aliases[alias]}));keycode.code,keycode.codes,keycode.aliases,keycode.names,keycode.title;var Component$1=function(){function Component(player,options,ready){var _this=this;if(!player&&this.play?this.player_=player=this:this.player_=player,this.isDisposed_=!1,this.parentComponent_=null,this.options_=mergeOptions$3({},this.options_),options=this.options_=mergeOptions$3(this.options_,options),this.id_=options.id||options.el&&options.el.id,!this.id_){var id=player&&player.id&&player.id()||"no_player";this.id_=id+"_component_"+newGUID()}this.name_=options.name||null,options.el?this.el_=options.el:!1!==options.createEl&&(this.el_=this.createEl()),options.className&&this.el_&&options.className.split(" ").forEach((function(c){return _this.addClass(c)})),!1!==options.evented&&(evented(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),stateful(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set$1,this.setIntervalIds_=new Set$1,this.rafIds_=new Set$1,this.namedRafs_=new Map$1,this.clearingTimersOnDispose_=!1,!1!==options.initChildren&&this.initChildren(),this.ready(ready),!1!==options.reportTouchActivity&&this.enableTouchActivity()}var _proto=Component.prototype;return _proto.dispose=function(options){if(void 0===options&&(options={}),!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var i=this.children_.length-1;i>=0;i--)this.children_[i].dispose&&this.children_[i].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(options.restoreEl?this.el_.parentNode.replaceChild(options.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}},_proto.isDisposed=function(){return Boolean(this.isDisposed_)},_proto.player=function(){return this.player_},_proto.options=function(obj){return obj?(this.options_=mergeOptions$3(this.options_,obj),this.options_):this.options_},_proto.el=function(){return this.el_},_proto.createEl=function(tagName,properties,attributes){return createEl(tagName,properties,attributes)},_proto.localize=function(string,tokens,defaultValue){void 0===defaultValue&&(defaultValue=string);var code=this.player_.language&&this.player_.language(),languages=this.player_.languages&&this.player_.languages(),language=languages&&languages[code],primaryCode=code&&code.split("-")[0],primaryLang=languages&&languages[primaryCode],localizedString=defaultValue;return language&&language[string]?localizedString=language[string]:primaryLang&&primaryLang[string]&&(localizedString=primaryLang[string]),tokens&&(localizedString=localizedString.replace(/\{(\d+)\}/g,(function(match,index){var value=tokens[index-1],ret=value;return void 0===value&&(ret=match),ret}))),localizedString},_proto.handleLanguagechange=function(){},_proto.contentEl=function(){return this.contentEl_||this.el_},_proto.id=function(){return this.id_},_proto.name=function(){return this.name_},_proto.children=function(){return this.children_},_proto.getChildById=function(id){return this.childIndex_[id]},_proto.getChild=function(name){if(name)return this.childNameIndex_[name]},_proto.getDescendant=function(){for(var _len=arguments.length,names=new Array(_len),_key=0;_key<_len;_key++)names[_key]=arguments[_key];names=names.reduce((function(acc,n){return acc.concat(n)}),[]);for(var currentChild=this,i=0;i=0;i--)if(this.children_[i]===component){childFound=!0,this.children_.splice(i,1);break}if(childFound){component.parentComponent_=null,this.childIndex_[component.id()]=null,this.childNameIndex_[toTitleCase$1(component.name())]=null,this.childNameIndex_[toLowerCase(component.name())]=null;var compEl=component.el();compEl&&compEl.parentNode===this.contentEl()&&this.contentEl().removeChild(component.el())}}},_proto.initChildren=function(){var _this2=this,children=this.options_.children;if(children){var workingChildren,parentOptions=this.options_,Tech=Component.getComponent("Tech");(workingChildren=Array.isArray(children)?children:Object.keys(children)).concat(Object.keys(this.options_).filter((function(child){return!workingChildren.some((function(wchild){return"string"==typeof wchild?child===wchild:child===wchild.name}))}))).map((function(child){var name,opts;return"string"==typeof child?opts=children[name=child]||_this2.options_[name]||{}:(name=child.name,opts=child),{name:name,opts:opts}})).filter((function(child){var c=Component.getComponent(child.opts.componentClass||toTitleCase$1(child.name));return c&&!Tech.isTech(c)})).forEach((function(child){var name=child.name,opts=child.opts;if(void 0!==parentOptions[name]&&(opts=parentOptions[name]),!1!==opts){!0===opts&&(opts={}),opts.playerOptions=_this2.options_.playerOptions;var newChild=_this2.addChild(name,opts);newChild&&(_this2[name]=newChild)}}))}},_proto.buildCSSClass=function(){return""},_proto.ready=function(fn,sync){if(void 0===sync&&(sync=!1),fn)return this.isReady_?void(sync?fn.call(this):this.setTimeout(fn,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(fn))},_proto.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var readyQueue=this.readyQueue_;this.readyQueue_=[],readyQueue&&readyQueue.length>0&&readyQueue.forEach((function(fn){fn.call(this)}),this),this.trigger("ready")}),1)},_proto.$=function(selector,context){return $(selector,context||this.contentEl())},_proto.$$=function(selector,context){return $$(selector,context||this.contentEl())},_proto.hasClass=function(classToCheck){return hasClass(this.el_,classToCheck)},_proto.addClass=function(classToAdd){addClass(this.el_,classToAdd)},_proto.removeClass=function(classToRemove){removeClass(this.el_,classToRemove)},_proto.toggleClass=function(classToToggle,predicate){toggleClass(this.el_,classToToggle,predicate)},_proto.show=function(){this.removeClass("vjs-hidden")},_proto.hide=function(){this.addClass("vjs-hidden")},_proto.lockShowing=function(){this.addClass("vjs-lock-showing")},_proto.unlockShowing=function(){this.removeClass("vjs-lock-showing")},_proto.getAttribute=function(attribute){return getAttribute(this.el_,attribute)},_proto.setAttribute=function(attribute,value){setAttribute(this.el_,attribute,value)},_proto.removeAttribute=function(attribute){removeAttribute(this.el_,attribute)},_proto.width=function(num,skipListeners){return this.dimension("width",num,skipListeners)},_proto.height=function(num,skipListeners){return this.dimension("height",num,skipListeners)},_proto.dimensions=function(width,height){this.width(width,!0),this.height(height)},_proto.dimension=function(widthOrHeight,num,skipListeners){if(void 0!==num)return null!==num&&num==num||(num=0),-1!==(""+num).indexOf("%")||-1!==(""+num).indexOf("px")?this.el_.style[widthOrHeight]=num:this.el_.style[widthOrHeight]="auto"===num?"":num+"px",void(skipListeners||this.trigger("componentresize"));if(!this.el_)return 0;var val=this.el_.style[widthOrHeight],pxIndex=val.indexOf("px");return-1!==pxIndex?parseInt(val.slice(0,pxIndex),10):parseInt(this.el_["offset"+toTitleCase$1(widthOrHeight)],10)},_proto.currentDimension=function(widthOrHeight){var computedWidthOrHeight=0;if("width"!==widthOrHeight&&"height"!==widthOrHeight)throw new Error("currentDimension only accepts width or height value");if(computedWidthOrHeight=computedStyle(this.el_,widthOrHeight),0===(computedWidthOrHeight=parseFloat(computedWidthOrHeight))||isNaN(computedWidthOrHeight)){var rule="offset"+toTitleCase$1(widthOrHeight);computedWidthOrHeight=this.el_[rule]}return computedWidthOrHeight},_proto.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},_proto.currentWidth=function(){return this.currentDimension("width")},_proto.currentHeight=function(){return this.currentDimension("height")},_proto.focus=function(){this.el_.focus()},_proto.blur=function(){this.el_.blur()},_proto.handleKeyDown=function(event){this.player_&&(keycode.isEventKey(event,"Tab")||event.stopPropagation(),this.player_.handleKeyDown(event))},_proto.handleKeyPress=function(event){this.handleKeyDown(event)},_proto.emitTapEvents=function(){var couldBeTap,touchStart=0,firstTouch=null;this.on("touchstart",(function(event){1===event.touches.length&&(firstTouch={pageX:event.touches[0].pageX,pageY:event.touches[0].pageY},touchStart=window.performance.now(),couldBeTap=!0)})),this.on("touchmove",(function(event){if(event.touches.length>1)couldBeTap=!1;else if(firstTouch){var xdiff=event.touches[0].pageX-firstTouch.pageX,ydiff=event.touches[0].pageY-firstTouch.pageY;Math.sqrt(xdiff*xdiff+ydiff*ydiff)>10&&(couldBeTap=!1)}}));var noTap=function(){couldBeTap=!1};this.on("touchleave",noTap),this.on("touchcancel",noTap),this.on("touchend",(function(event){(firstTouch=null,!0===couldBeTap)&&(window.performance.now()-touchStart<200&&(event.preventDefault(),this.trigger("tap")))}))},_proto.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var touchHolding,report=bind(this.player(),this.player().reportUserActivity);this.on("touchstart",(function(){report(),this.clearInterval(touchHolding),touchHolding=this.setInterval(report,250)}));var touchEnd=function(event){report(),this.clearInterval(touchHolding)};this.on("touchmove",report),this.on("touchend",touchEnd),this.on("touchcancel",touchEnd)}},_proto.setTimeout=function(fn,timeout){var timeoutId,_this3=this;return fn=bind(this,fn),this.clearTimersOnDispose_(),timeoutId=window.setTimeout((function(){_this3.setTimeoutIds_.has(timeoutId)&&_this3.setTimeoutIds_.delete(timeoutId),fn()}),timeout),this.setTimeoutIds_.add(timeoutId),timeoutId},_proto.clearTimeout=function(timeoutId){return this.setTimeoutIds_.has(timeoutId)&&(this.setTimeoutIds_.delete(timeoutId),window.clearTimeout(timeoutId)),timeoutId},_proto.setInterval=function(fn,interval){fn=bind(this,fn),this.clearTimersOnDispose_();var intervalId=window.setInterval(fn,interval);return this.setIntervalIds_.add(intervalId),intervalId},_proto.clearInterval=function(intervalId){return this.setIntervalIds_.has(intervalId)&&(this.setIntervalIds_.delete(intervalId),window.clearInterval(intervalId)),intervalId},_proto.requestAnimationFrame=function(fn){var id,_this4=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),fn=bind(this,fn),id=window.requestAnimationFrame((function(){_this4.rafIds_.has(id)&&_this4.rafIds_.delete(id),fn()})),this.rafIds_.add(id),id):this.setTimeout(fn,1e3/60)},_proto.requestNamedAnimationFrame=function(name,fn){var _this5=this;if(!this.namedRafs_.has(name)){this.clearTimersOnDispose_(),fn=bind(this,fn);var id=this.requestAnimationFrame((function(){fn(),_this5.namedRafs_.has(name)&&_this5.namedRafs_.delete(name)}));return this.namedRafs_.set(name,id),name}},_proto.cancelNamedAnimationFrame=function(name){this.namedRafs_.has(name)&&(this.cancelAnimationFrame(this.namedRafs_.get(name)),this.namedRafs_.delete(name))},_proto.cancelAnimationFrame=function(id){return this.supportsRaf_?(this.rafIds_.has(id)&&(this.rafIds_.delete(id),window.cancelAnimationFrame(id)),id):this.clearTimeout(id)},_proto.clearTimersOnDispose_=function(){var _this6=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((function(_ref){var idName=_ref[0],cancelName=_ref[1];_this6[idName].forEach((function(val,key){return _this6[cancelName](key)}))})),_this6.clearingTimersOnDispose_=!1})))},Component.registerComponent=function(name,ComponentToRegister){if("string"!=typeof name||!name)throw new Error('Illegal component name, "'+name+'"; must be a non-empty string.');var reason,Tech=Component.getComponent("Tech"),isTech=Tech&&Tech.isTech(ComponentToRegister),isComp=Component===ComponentToRegister||Component.prototype.isPrototypeOf(ComponentToRegister.prototype);if(isTech||!isComp)throw reason=isTech?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+name+'"; '+reason+".");name=toTitleCase$1(name),Component.components_||(Component.components_={});var Player=Component.getComponent("Player");if("Player"===name&&Player&&Player.players){var players=Player.players,playerNames=Object.keys(players);if(players&&playerNames.length>0&&playerNames.map((function(pname){return players[pname]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return Component.components_[name]=ComponentToRegister,Component.components_[toLowerCase(name)]=ComponentToRegister,ComponentToRegister},Component.getComponent=function(name){if(name&&Component.components_)return Component.components_[name]},Component}();Component$1.prototype.supportsRaf_="function"==typeof window.requestAnimationFrame&&"function"==typeof window.cancelAnimationFrame,Component$1.registerComponent("Component",Component$1);var assertThisInitialized=function(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self};var inheritsLoose=function(subClass,superClass){subClass.prototype=Object.create(superClass.prototype),subClass.prototype.constructor=subClass,subClass.__proto__=superClass};function getRange(fnName,valueIndex,ranges,rangeIndex){return function(fnName,index,maxIndex){if("number"!=typeof index||index<0||index>maxIndex)throw new Error("Failed to execute '"+fnName+"' on 'TimeRanges': The index provided ("+index+") is non-numeric or out of bounds (0-"+maxIndex+").")}(fnName,rangeIndex,ranges.length-1),ranges[rangeIndex][valueIndex]}function createTimeRangesObj(ranges){var timeRangesObj;return timeRangesObj=void 0===ranges||0===ranges.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:ranges.length,start:getRange.bind(null,"start",0,ranges),end:getRange.bind(null,"end",1,ranges)},window.Symbol&&window.Symbol.iterator&&(timeRangesObj[window.Symbol.iterator]=function(){return(ranges||[]).values()}),timeRangesObj}function createTimeRanges(start,end){return Array.isArray(start)?createTimeRangesObj(start):void 0===start||void 0===end?createTimeRangesObj():createTimeRangesObj([[start,end]])}function bufferedPercent(buffered,duration){var start,end,bufferedDuration=0;if(!duration)return 0;buffered&&buffered.length||(buffered=createTimeRanges(0,0));for(var i=0;iduration&&(end=duration),bufferedDuration+=end-start;return bufferedDuration/duration}function MediaError(value){if(value instanceof MediaError)return value;"number"==typeof value?this.code=value:"string"==typeof value?this.message=value:isObject$1(value)&&("number"==typeof value.code&&(this.code=value.code),assign(this,value)),this.message||(this.message=MediaError.defaultMessages[this.code]||"")}MediaError.prototype.code=0,MediaError.prototype.message="",MediaError.prototype.status=null,MediaError.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],MediaError.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var errNum=0;errNum=0;i--)if(tracks[i].enabled){disableOthers$1(tracks,tracks[i]);break}return(_this=_TrackList.call(this,tracks)||this).changing_=!1,_this}inheritsLoose(AudioTrackList,_TrackList);var _proto=AudioTrackList.prototype;return _proto.addTrack=function(track){var _this2=this;track.enabled&&disableOthers$1(this,track),_TrackList.prototype.addTrack.call(this,track),track.addEventListener&&(track.enabledChange_=function(){_this2.changing_||(_this2.changing_=!0,disableOthers$1(_this2,track),_this2.changing_=!1,_this2.trigger("change"))},track.addEventListener("enabledchange",track.enabledChange_))},_proto.removeTrack=function(rtrack){_TrackList.prototype.removeTrack.call(this,rtrack),rtrack.removeEventListener&&rtrack.enabledChange_&&(rtrack.removeEventListener("enabledchange",rtrack.enabledChange_),rtrack.enabledChange_=null)},AudioTrackList}(TrackList),disableOthers=function(list,track){for(var i=0;i=0;i--)if(tracks[i].selected){disableOthers(tracks,tracks[i]);break}return(_this=_TrackList.call(this,tracks)||this).changing_=!1,Object.defineProperty(assertThisInitialized(_this),"selectedIndex",{get:function(){for(var _i=0;_i=400&&response.statusCode<=599){var cause=responseBody;if(decodeResponseBody)if(window_1.TextDecoder){var charset=function(contentTypeHeader){void 0===contentTypeHeader&&(contentTypeHeader="");return contentTypeHeader.toLowerCase().split(";").reduce((function(charset,contentType){var _contentType$split=contentType.split("="),type=_contentType$split[0],value=_contentType$split[1];return"charset"===type.trim()?value.trim():charset}),"utf-8")}(response.headers&&response.headers["content-type"]);try{cause=new TextDecoder(charset).decode(responseBody)}catch(e){}}else cause=String.fromCharCode.apply(null,new Uint8Array(responseBody));callback({cause:cause})}else callback(null,responseBody)}};createXHR.httpHandler=httpHandler;
+!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory():"function"==typeof define&&define.amd?define("media_videojs/video-lazy",factory):(global="undefined"!=typeof globalThis?globalThis:global||self).videojs=factory()}(window,(function(){const hooks_={},hooks=function(type,fn){return hooks_[type]=hooks_[type]||[],fn&&(hooks_[type]=hooks_[type].concat(fn)),hooks_[type]},removeHook=function(type,fn){const index=hooks(type).indexOf(fn);return!(index<=-1)&&(hooks_[type]=hooks_[type].slice(),hooks_[type].splice(index,1),!0)},FullscreenApi={prefixed:!0},apiMap=[["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"]],specApi=apiMap[0];let browserApi;for(let i=0;i(type,level,args)=>{const lvl=log.levels[level],lvlRegExp=new RegExp("^(".concat(lvl,")$"));if("log"!==type&&args.unshift(type.toUpperCase()+":"),args.unshift(name+":"),history){history.push([].concat(args));const splice=history.length-1e3;history.splice(0,splice>0?splice:0)}if(!window.console)return;let fn=window.console[type];fn||"debug"!==type||(fn=window.console.info||window.console.log),fn&&lvl&&lvlRegExp.test(type)&&fn[Array.isArray(args)?"apply":"call"](window.console,args)})(name,log),log.createLogger=subname=>createLogger$1(name+": "+subname),log.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:level},log.level=lvl=>{if("string"==typeof lvl){if(!log.levels.hasOwnProperty(lvl))throw new Error('"'.concat(lvl,'" in not a valid log level'));level=lvl}return level},(log.history=()=>history?[].concat(history):[]).filter=fname=>(history||[]).filter((historyItem=>new RegExp(".*".concat(fname,".*")).test(historyItem[0]))),log.history.clear=()=>{history&&(history.length=0)},log.history.disable=()=>{null!==history&&(history.length=0,history=null)},log.history.enable=()=>{null===history&&(history=[])},log.error=function(){for(var _len3=arguments.length,args=new Array(_len3),_key3=0;_key3<_len3;_key3++)args[_key3]=arguments[_key3];return logByType("error",level,args)},log.warn=function(){for(var _len4=arguments.length,args=new Array(_len4),_key4=0;_key4<_len4;_key4++)args[_key4]=arguments[_key4];return logByType("warn",level,args)},log.debug=function(){for(var _len5=arguments.length,args=new Array(_len5),_key5=0;_key5<_len5;_key5++)args[_key5]=arguments[_key5];return logByType("debug",level,args)},log}("VIDEOJS"),createLogger=log$1.createLogger,toString$1=Object.prototype.toString,keys=function(object){return isObject$1(object)?Object.keys(object):[]};function each(object,fn){keys(object).forEach((key=>fn(object[key],key)))}function reduce(object,fn){let initial=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return keys(object).reduce(((accum,key)=>fn(accum,object[key],key)),initial)}function isObject$1(value){return!!value&&"object"==typeof value}function isPlain(value){return isObject$1(value)&&"[object Object]"===toString$1.call(value)&&value.constructor===Object}function merge$2(){const result={};for(var _len6=arguments.length,sources=new Array(_len6),_key6=0;_key6<_len6;_key6++)sources[_key6]=arguments[_key6];return sources.forEach((source=>{source&&each(source,((value,key)=>{isPlain(value)?(isPlain(result[key])||(result[key]={}),result[key]=merge$2(result[key],value)):result[key]=value}))})),result}function defineLazyProperty(obj,key,getValue){let setter=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const set=value=>Object.defineProperty(obj,key,{value:value,enumerable:!0,writable:!0}),options={configurable:!0,enumerable:!0,get(){const value=getValue();return set(value),value}};return setter&&(options.set=set),Object.defineProperty(obj,key,options)}var Obj=Object.freeze({__proto__:null,each:each,reduce:reduce,isObject:isObject$1,isPlain:isPlain,merge:merge$2,defineLazyProperty:defineLazyProperty});let ANDROID_VERSION,IS_IPOD=!1,IOS_VERSION=null,IS_ANDROID=!1,IS_FIREFOX=!1,IS_EDGE=!1,IS_CHROMIUM=!1,IS_CHROME=!1,CHROMIUM_VERSION=null,CHROME_VERSION=null,IE_VERSION=null,IS_SAFARI=!1,IS_WINDOWS=!1,IS_IPAD=!1,IS_IPHONE=!1;const TOUCH_ENABLED=Boolean(isReal()&&("ontouchstart"in window||window.navigator.maxTouchPoints||window.DocumentTouch&&window.document instanceof window.DocumentTouch)),UAD=window.navigator&&window.navigator.userAgentData;if(UAD&&(IS_ANDROID="Android"===UAD.platform,IS_EDGE=Boolean(UAD.brands.find((b=>"Microsoft Edge"===b.brand))),IS_CHROMIUM=Boolean(UAD.brands.find((b=>"Chromium"===b.brand))),IS_CHROME=!IS_EDGE&&IS_CHROMIUM,CHROMIUM_VERSION=CHROME_VERSION=(UAD.brands.find((b=>"Chromium"===b.brand))||{}).version||null,IS_WINDOWS="Windows"===UAD.platform),!IS_CHROMIUM){const USER_AGENT=window.navigator&&window.navigator.userAgent||"";IS_IPOD=/iPod/i.test(USER_AGENT),IOS_VERSION=function(){const match=USER_AGENT.match(/OS (\d+)_/i);return match&&match[1]?match[1]:null}(),IS_ANDROID=/Android/i.test(USER_AGENT),ANDROID_VERSION=function(){const match=USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!match)return null;const major=match[1]&&parseFloat(match[1]),minor=match[2]&&parseFloat(match[2]);return major&&minor?parseFloat(match[1]+"."+match[2]):major||null}(),IS_FIREFOX=/Firefox/i.test(USER_AGENT),IS_EDGE=/Edg/i.test(USER_AGENT),IS_CHROMIUM=/Chrome/i.test(USER_AGENT)||/CriOS/i.test(USER_AGENT),IS_CHROME=!IS_EDGE&&IS_CHROMIUM,CHROMIUM_VERSION=CHROME_VERSION=function(){const match=USER_AGENT.match(/(Chrome|CriOS)\/(\d+)/);return match&&match[2]?parseFloat(match[2]):null}(),IE_VERSION=function(){const result=/MSIE\s(\d+)\.\d/.exec(USER_AGENT);let version=result&&parseFloat(result[1]);return!version&&/Trident\/7.0/i.test(USER_AGENT)&&/rv:11.0/.test(USER_AGENT)&&(version=11),version}(),IS_SAFARI=/Safari/i.test(USER_AGENT)&&!IS_CHROME&&!IS_ANDROID&&!IS_EDGE,IS_WINDOWS=/Windows/i.test(USER_AGENT),IS_IPAD=/iPad/i.test(USER_AGENT)||IS_SAFARI&&TOUCH_ENABLED&&!/iPhone/i.test(USER_AGENT),IS_IPHONE=/iPhone/i.test(USER_AGENT)&&!IS_IPAD}const IS_IOS=IS_IPHONE||IS_IPAD||IS_IPOD,IS_ANY_SAFARI=(IS_SAFARI||IS_IOS)&&!IS_CHROME;var browser=Object.freeze({__proto__:null,get IS_IPOD(){return IS_IPOD},get IOS_VERSION(){return IOS_VERSION},get IS_ANDROID(){return IS_ANDROID},get ANDROID_VERSION(){return ANDROID_VERSION},get IS_FIREFOX(){return IS_FIREFOX},get IS_EDGE(){return IS_EDGE},get IS_CHROMIUM(){return IS_CHROMIUM},get IS_CHROME(){return IS_CHROME},get CHROMIUM_VERSION(){return CHROMIUM_VERSION},get CHROME_VERSION(){return CHROME_VERSION},get IE_VERSION(){return IE_VERSION},get IS_SAFARI(){return IS_SAFARI},get IS_WINDOWS(){return IS_WINDOWS},get IS_IPAD(){return IS_IPAD},get IS_IPHONE(){return IS_IPHONE},TOUCH_ENABLED:TOUCH_ENABLED,IS_IOS:IS_IOS,IS_ANY_SAFARI:IS_ANY_SAFARI});function isNonBlankString(str){return"string"==typeof str&&Boolean(str.trim())}function isReal(){return document===window.document}function isEl(value){return isObject$1(value)&&1===value.nodeType}function isInFrame(){try{return window.parent!==window.self}catch(x){return!0}}function createQuerier(method){return function(selector,context){if(!isNonBlankString(selector))return document[method](null);isNonBlankString(context)&&(context=document.querySelector(context));const ctx=isEl(context)?context:document;return ctx[method]&&ctx[method](selector)}}function createEl(){let tagName=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",properties=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},attributes=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},content=arguments.length>3?arguments[3]:void 0;const el=document.createElement(tagName);return Object.getOwnPropertyNames(properties).forEach((function(propName){const val=properties[propName];"textContent"===propName?textContent(el,val):el[propName]===val&&"tabIndex"!==propName||(el[propName]=val)})),Object.getOwnPropertyNames(attributes).forEach((function(attrName){el.setAttribute(attrName,attributes[attrName])})),content&&appendContent(el,content),el}function textContent(el,text){return void 0===el.textContent?el.innerText=text:el.textContent=text,el}function prependTo(child,parent){parent.firstChild?parent.insertBefore(child,parent.firstChild):parent.appendChild(child)}function hasClass(element,classToCheck){return function(str){if(str.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}(classToCheck),element.classList.contains(classToCheck)}function addClass(element){for(var _len7=arguments.length,classesToAdd=new Array(_len7>1?_len7-1:0),_key7=1;_key7<_len7;_key7++)classesToAdd[_key7-1]=arguments[_key7];return element.classList.add(...classesToAdd.reduce(((prev,current)=>prev.concat(current.split(/\s+/))),[])),element}function removeClass(element){if(!element)return log$1.warn("removeClass was called with an element that doesn't exist"),null;for(var _len8=arguments.length,classesToRemove=new Array(_len8>1?_len8-1:0),_key8=1;_key8<_len8;_key8++)classesToRemove[_key8-1]=arguments[_key8];return element.classList.remove(...classesToRemove.reduce(((prev,current)=>prev.concat(current.split(/\s+/))),[])),element}function toggleClass(element,classToToggle,predicate){return"function"==typeof predicate&&(predicate=predicate(element,classToToggle)),"boolean"!=typeof predicate&&(predicate=void 0),classToToggle.split(/\s+/).forEach((className=>element.classList.toggle(className,predicate))),element}function setAttributes(el,attributes){Object.getOwnPropertyNames(attributes).forEach((function(attrName){const attrValue=attributes[attrName];null==attrValue||!1===attrValue?el.removeAttribute(attrName):el.setAttribute(attrName,!0===attrValue?"":attrValue)}))}function getAttributes(tag){const obj={},knownBooleans=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(tag&&tag.attributes&&tag.attributes.length>0){const attrs=tag.attributes;for(let i=attrs.length-1;i>=0;i--){const attrName=attrs[i].name;let attrVal=attrs[i].value;"boolean"!=typeof tag[attrName]&&-1===knownBooleans.indexOf(","+attrName+",")||(attrVal=null!==attrVal),obj[attrName]=attrVal}}return obj}function getAttribute(el,attribute){return el.getAttribute(attribute)}function setAttribute(el,attribute,value){el.setAttribute(attribute,value)}function removeAttribute(el,attribute){el.removeAttribute(attribute)}function blockTextSelection(){document.body.focus(),document.onselectstart=function(){return!1}}function unblockTextSelection(){document.onselectstart=function(){return!0}}function getBoundingClientRect(el){if(el&&el.getBoundingClientRect&&el.parentNode){const rect=el.getBoundingClientRect(),result={};return["bottom","height","left","right","top","width"].forEach((k=>{void 0!==rect[k]&&(result[k]=rect[k])})),result.height||(result.height=parseFloat(computedStyle(el,"height"))),result.width||(result.width=parseFloat(computedStyle(el,"width"))),result}}function findPosition(el){if(!el||el&&!el.offsetParent)return{left:0,top:0,width:0,height:0};const width=el.offsetWidth,height=el.offsetHeight;let left=0,top=0;for(;el.offsetParent&&el!==document[FullscreenApi.fullscreenElement];)left+=el.offsetLeft,top+=el.offsetTop,el=el.offsetParent;return{left:left,top:top,width:width,height:height}}function getPointerPosition(el,event){const translated={x:0,y:0};if(IS_IOS){let item=el;for(;item&&"html"!==item.nodeName.toLowerCase();){const transform=computedStyle(item,"transform");if(/^matrix/.test(transform)){const values=transform.slice(7,-1).split(/,\s/).map(Number);translated.x+=values[4],translated.y+=values[5]}else if(/^matrix3d/.test(transform)){const values=transform.slice(9,-1).split(/,\s/).map(Number);translated.x+=values[12],translated.y+=values[13]}item=item.parentNode}}const position={},boxTarget=findPosition(event.target),box=findPosition(el),boxW=box.width,boxH=box.height;let offsetY=event.offsetY-(box.top-boxTarget.top),offsetX=event.offsetX-(box.left-boxTarget.left);return event.changedTouches&&(offsetX=event.changedTouches[0].pageX-box.left,offsetY=event.changedTouches[0].pageY+box.top,IS_IOS&&(offsetX-=translated.x,offsetY-=translated.y)),position.y=1-Math.max(0,Math.min(1,offsetY/boxH)),position.x=Math.max(0,Math.min(1,offsetX/boxW)),position}function isTextNode$1(value){return isObject$1(value)&&3===value.nodeType}function emptyEl(el){for(;el.firstChild;)el.removeChild(el.firstChild);return el}function normalizeContent(content){return"function"==typeof content&&(content=content()),(Array.isArray(content)?content:[content]).map((value=>("function"==typeof value&&(value=value()),isEl(value)||isTextNode$1(value)?value:"string"==typeof value&&/\S/.test(value)?document.createTextNode(value):void 0))).filter((value=>value))}function appendContent(el,content){return normalizeContent(content).forEach((node=>el.appendChild(node))),el}function insertContent(el,content){return appendContent(emptyEl(el),content)}function isSingleLeftClick(event){return void 0===event.button&&void 0===event.buttons||(0===event.button&&void 0===event.buttons||("mouseup"===event.type&&0===event.button&&0===event.buttons||0===event.button&&1===event.buttons))}const $=createQuerier("querySelector"),$$=createQuerier("querySelectorAll");function computedStyle(el,prop){if(!el||!prop)return"";if("function"==typeof window.getComputedStyle){let computedStyleValue;try{computedStyleValue=window.getComputedStyle(el)}catch(e){return""}return computedStyleValue?computedStyleValue.getPropertyValue(prop)||computedStyleValue[prop]:""}return""}var Dom=Object.freeze({__proto__:null,isReal:isReal,isEl:isEl,isInFrame:isInFrame,createEl:createEl,textContent:textContent,prependTo:prependTo,hasClass:hasClass,addClass:addClass,removeClass:removeClass,toggleClass:toggleClass,setAttributes:setAttributes,getAttributes:getAttributes,getAttribute:getAttribute,setAttribute:setAttribute,removeAttribute:removeAttribute,blockTextSelection:blockTextSelection,unblockTextSelection:unblockTextSelection,getBoundingClientRect:getBoundingClientRect,findPosition:findPosition,getPointerPosition:getPointerPosition,isTextNode:isTextNode$1,emptyEl:emptyEl,normalizeContent:normalizeContent,appendContent:appendContent,insertContent:insertContent,isSingleLeftClick:isSingleLeftClick,$:$,$$:$$,computedStyle:computedStyle});let videojs$1,_windowLoaded=!1;const autoSetup=function(){if(!1===videojs$1.options.autoSetup)return;const vids=Array.prototype.slice.call(document.getElementsByTagName("video")),audios=Array.prototype.slice.call(document.getElementsByTagName("audio")),divs=Array.prototype.slice.call(document.getElementsByTagName("video-js")),mediaEls=vids.concat(audios,divs);if(mediaEls&&mediaEls.length>0)for(let i=0,e=mediaEls.length;i-1&&(options={passive:!0}),elem.addEventListener(type,data.dispatcher,options)}else elem.attachEvent&&elem.attachEvent("on"+type,data.dispatcher)}function off(elem,type,fn){if(!DomData.has(elem))return;const data=DomData.get(elem);if(!data.handlers)return;if(Array.isArray(type))return _handleMultipleEvents(off,elem,type,fn);const removeType=function(el,t){data.handlers[t]=[],_cleanUpEvents(el,t)};if(void 0===type){for(const t in data.handlers)Object.prototype.hasOwnProperty.call(data.handlers||{},t)&&removeType(elem,t);return}const handlers=data.handlers[type];if(handlers)if(fn){if(fn.guid)for(let n=0;n=wait&&(fn(...arguments),last=now)}},debounce=function(func,wait,immediate){let timeout,context=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window;const cancel=()=>{context.clearTimeout(timeout),timeout=null},debounced=function(){const self=this,args=arguments;let later=function(){timeout=null,later=null,immediate||func.apply(self,args)};!timeout&&immediate&&func.apply(self,args),context.clearTimeout(timeout),timeout=context.setTimeout(later,wait)};return debounced.cancel=cancel,debounced};var Fn=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:30,bind_:bind_,throttle:throttle,debounce:debounce});let EVENT_MAP;class EventTarget$2{on(type,fn){const ael=this.addEventListener;this.addEventListener=()=>{},on(this,type,fn),this.addEventListener=ael}off(type,fn){off(this,type,fn)}one(type,fn){const ael=this.addEventListener;this.addEventListener=()=>{},one(this,type,fn),this.addEventListener=ael}any(type,fn){const ael=this.addEventListener;this.addEventListener=()=>{},any(this,type,fn),this.addEventListener=ael}trigger(event){const type=event.type||event;"string"==typeof event&&(event={type:type}),event=fixEvent(event),this.allowedEvents_[type]&&this["on"+type]&&this["on"+type](event),trigger(this,event)}queueTrigger(event){EVENT_MAP||(EVENT_MAP=new Map);const type=event.type||event;let map=EVENT_MAP.get(this);map||(map=new Map,EVENT_MAP.set(this,map));const oldTimeout=map.get(type);map.delete(type),window.clearTimeout(oldTimeout);const timeout=window.setTimeout((()=>{map.delete(type),0===map.size&&(map=null,EVENT_MAP.delete(this)),this.trigger(event)}),0);map.set(type,timeout)}}EventTarget$2.prototype.allowedEvents_={},EventTarget$2.prototype.addEventListener=EventTarget$2.prototype.on,EventTarget$2.prototype.removeEventListener=EventTarget$2.prototype.off,EventTarget$2.prototype.dispatchEvent=EventTarget$2.prototype.trigger;const objName=obj=>"function"==typeof obj.name?obj.name():"string"==typeof obj.name?obj.name:obj.name_?obj.name_:obj.constructor&&obj.constructor.name?obj.constructor.name:typeof obj,isEvented=object=>object instanceof EventTarget$2||!!object.eventBusEl_&&["on","one","off","trigger"].every((k=>"function"==typeof object[k])),isValidEventType=type=>"string"==typeof type&&/\S/.test(type)||Array.isArray(type)&&!!type.length,validateTarget=(target,obj,fnName)=>{if(!target||!target.nodeName&&!isEvented(target))throw new Error("Invalid target for ".concat(objName(obj),"#").concat(fnName,"; must be a DOM node or evented object."))},validateEventType=(type,obj,fnName)=>{if(!isValidEventType(type))throw new Error("Invalid event type for ".concat(objName(obj),"#").concat(fnName,"; must be a non-empty string or array."))},validateListener=(listener,obj,fnName)=>{if("function"!=typeof listener)throw new Error("Invalid listener for ".concat(objName(obj),"#").concat(fnName,"; must be a function."))},normalizeListenArgs=(self,args,fnName)=>{const isTargetingSelf=args.length<3||args[0]===self||args[0]===self.eventBusEl_;let target,type,listener;return isTargetingSelf?(target=self.eventBusEl_,args.length>=3&&args.shift(),[type,listener]=args):[target,type,listener]=args,validateTarget(target,self,fnName),validateEventType(type,self,fnName),validateListener(listener,self,fnName),listener=bind_(self,listener),{isTargetingSelf:isTargetingSelf,target:target,type:type,listener:listener}},listen=(target,method,type,listener)=>{validateTarget(target,target,method),target.nodeName?Events[method](target,type,listener):target[method](type,listener)},EventedMixin={on(){for(var _len9=arguments.length,args=new Array(_len9),_key9=0;_key9<_len9;_key9++)args[_key9]=arguments[_key9];const{isTargetingSelf:isTargetingSelf,target:target,type:type,listener:listener}=normalizeListenArgs(this,args,"on");if(listen(target,"on",type,listener),!isTargetingSelf){const removeListenerOnDispose=()=>this.off(target,type,listener);removeListenerOnDispose.guid=listener.guid;const removeRemoverOnTargetDispose=()=>this.off("dispose",removeListenerOnDispose);removeRemoverOnTargetDispose.guid=listener.guid,listen(this,"on","dispose",removeListenerOnDispose),listen(target,"on","dispose",removeRemoverOnTargetDispose)}},one(){for(var _this=this,_len10=arguments.length,args=new Array(_len10),_key10=0;_key10<_len10;_key10++)args[_key10]=arguments[_key10];const{isTargetingSelf:isTargetingSelf,target:target,type:type,listener:listener}=normalizeListenArgs(this,args,"one");if(isTargetingSelf)listen(target,"one",type,listener);else{const wrapper=function(){_this.off(target,type,wrapper);for(var _len11=arguments.length,largs=new Array(_len11),_key11=0;_key11<_len11;_key11++)largs[_key11]=arguments[_key11];listener.apply(null,largs)};wrapper.guid=listener.guid,listen(target,"one",type,wrapper)}},any(){for(var _this2=this,_len12=arguments.length,args=new Array(_len12),_key12=0;_key12<_len12;_key12++)args[_key12]=arguments[_key12];const{isTargetingSelf:isTargetingSelf,target:target,type:type,listener:listener}=normalizeListenArgs(this,args,"any");if(isTargetingSelf)listen(target,"any",type,listener);else{const wrapper=function(){_this2.off(target,type,wrapper);for(var _len13=arguments.length,largs=new Array(_len13),_key13=0;_key13<_len13;_key13++)largs[_key13]=arguments[_key13];listener.apply(null,largs)};wrapper.guid=listener.guid,listen(target,"any",type,wrapper)}},off(targetOrType,typeOrListener,listener){if(!targetOrType||isValidEventType(targetOrType))off(this.eventBusEl_,targetOrType,typeOrListener);else{const target=targetOrType,type=typeOrListener;validateTarget(target,this,"off"),validateEventType(type,this,"off"),validateListener(listener,this,"off"),listener=bind_(this,listener),this.off("dispose",listener),target.nodeName?(off(target,type,listener),off(target,"dispose",listener)):isEvented(target)&&(target.off(type,listener),target.off("dispose",listener))}},trigger(event,hash){validateTarget(this.eventBusEl_,this,"trigger");const type=event&&"string"!=typeof event?event.type:event;if(!isValidEventType(type))throw new Error("Invalid event type for ".concat(objName(this),"#trigger; ")+"must be a non-empty string or object with a type key that has a non-empty value.");return trigger(this.eventBusEl_,event,hash)}};function evented(target){let options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{eventBusKey:eventBusKey}=options;if(eventBusKey){if(!target[eventBusKey].nodeName)throw new Error('The eventBusKey "'.concat(eventBusKey,'" does not refer to an element.'));target.eventBusEl_=target[eventBusKey]}else target.eventBusEl_=createEl("span",{className:"vjs-event-bus"});return Object.assign(target,EventedMixin),target.eventedCallbacks&&target.eventedCallbacks.forEach((callback=>{callback()})),target.on("dispose",(()=>{target.off(),[target,target.el_,target.eventBusEl_].forEach((function(val){val&&DomData.has(val)&&DomData.delete(val)})),window.setTimeout((()=>{target.eventBusEl_=null}),0)})),target}const StatefulMixin={state:{},setState(stateUpdates){let changes;return"function"==typeof stateUpdates&&(stateUpdates=stateUpdates()),each(stateUpdates,((value,key)=>{this.state[key]!==value&&(changes=changes||{},changes[key]={from:this.state[key],to:value}),this.state[key]=value})),changes&&isEvented(this)&&this.trigger({changes:changes,type:"statechanged"}),changes}};function stateful(target,defaultState){return Object.assign(target,StatefulMixin),target.state=Object.assign({},target.state,defaultState),"function"==typeof target.handleStateChanged&&isEvented(target)&&target.on("statechanged",target.handleStateChanged),target}const toLowerCase=function(string){return"string"!=typeof string?string:string.replace(/./,(w=>w.toLowerCase()))},toTitleCase$1=function(string){return"string"!=typeof string?string:string.replace(/./,(w=>w.toUpperCase()))},titleCaseEquals=function(str1,str2){return toTitleCase$1(str1)===toTitleCase$1(str2)};var Str=Object.freeze({__proto__:null,toLowerCase:toLowerCase,toTitleCase:toTitleCase$1,titleCaseEquals:titleCaseEquals}),commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(fn,module){return fn(module={exports:{}},module.exports),module.exports}var keycode=createCommonjsModule((function(module,exports){function keyCode(searchInput){if(searchInput&&"object"==typeof searchInput){var hasKeyCode=searchInput.which||searchInput.keyCode||searchInput.charCode;hasKeyCode&&(searchInput=hasKeyCode)}if("number"==typeof searchInput)return names[searchInput];var foundNamedKey,search=String(searchInput);return(foundNamedKey=codes[search.toLowerCase()])?foundNamedKey:(foundNamedKey=aliases[search.toLowerCase()])||(1===search.length?search.charCodeAt(0):void 0)}keyCode.isEventKey=function(event,nameOrCode){if(event&&"object"==typeof event){var keyCode=event.which||event.keyCode||event.charCode;if(null==keyCode)return!1;if("string"==typeof nameOrCode){var foundNamedKey;if(foundNamedKey=codes[nameOrCode.toLowerCase()])return foundNamedKey===keyCode;if(foundNamedKey=aliases[nameOrCode.toLowerCase()])return foundNamedKey===keyCode}else if("number"==typeof nameOrCode)return nameOrCode===keyCode;return!1}};var codes=(exports=module.exports=keyCode).code=exports.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},aliases=exports.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(i=97;i<123;i++)codes[String.fromCharCode(i)]=i-32;for(var i=48;i<58;i++)codes[i-48]=i;for(i=1;i<13;i++)codes["f"+i]=i+111;for(i=0;i<10;i++)codes["numpad "+i]=i+96;var names=exports.names=exports.title={};for(i in codes)names[codes[i]]=i;for(var alias in aliases)codes[alias]=aliases[alias]}));keycode.code,keycode.codes,keycode.aliases,keycode.names,keycode.title;class Component$1{constructor(player,options,ready){if(!player&&this.play?this.player_=player=this:this.player_=player,this.isDisposed_=!1,this.parentComponent_=null,this.options_=merge$2({},this.options_),options=this.options_=merge$2(this.options_,options),this.id_=options.id||options.el&&options.el.id,!this.id_){const id=player&&player.id&&player.id()||"no_player";this.id_="".concat(id,"_component_").concat(newGUID())}this.name_=options.name||null,options.el?this.el_=options.el:!1!==options.createEl&&(this.el_=this.createEl()),options.className&&this.el_&&options.className.split(" ").forEach((c=>this.addClass(c))),["on","off","one","any","trigger"].forEach((fn=>{this[fn]=void 0})),!1!==options.evented&&(evented(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),stateful(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,!1!==options.initChildren&&this.initChildren(),this.ready(ready),!1!==options.reportTouchActivity&&this.enableTouchActivity()}on(type,fn){}off(type,fn){}one(type,fn){}any(type,fn){}trigger(event){}dispose(){let options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let i=this.children_.length-1;i>=0;i--)this.children_[i].dispose&&this.children_[i].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(options.restoreEl?this.el_.parentNode.replaceChild(options.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(obj){return obj?(this.options_=merge$2(this.options_,obj),this.options_):this.options_}el(){return this.el_}createEl(tagName,properties,attributes){return createEl(tagName,properties,attributes)}localize(string,tokens){let defaultValue=arguments.length>2&&void 0!==arguments[2]?arguments[2]:string;const code=this.player_.language&&this.player_.language(),languages=this.player_.languages&&this.player_.languages(),language=languages&&languages[code],primaryCode=code&&code.split("-")[0],primaryLang=languages&&languages[primaryCode];let localizedString=defaultValue;return language&&language[string]?localizedString=language[string]:primaryLang&&primaryLang[string]&&(localizedString=primaryLang[string]),tokens&&(localizedString=localizedString.replace(/\{(\d+)\}/g,(function(match,index){const value=tokens[index-1];let ret=value;return void 0===value&&(ret=match),ret}))),localizedString}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(id){return this.childIndex_[id]}getChild(name){if(name)return this.childNameIndex_[name]}getDescendant(){for(var _len14=arguments.length,names=new Array(_len14),_key14=0;_key14<_len14;_key14++)names[_key14]=arguments[_key14];names=names.reduce(((acc,n)=>acc.concat(n)),[]);let currentChild=this;for(let i=0;i1&&void 0!==arguments[1]?arguments[1]:{},index=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length;if("string"==typeof child){componentName=toTitleCase$1(child);const componentClassName=options.componentClass||componentName;options.name=componentName;const ComponentClass=Component$1.getComponent(componentClassName);if(!ComponentClass)throw new Error("Component ".concat(componentClassName," does not exist"));if("function"!=typeof ComponentClass)return null;component=new ComponentClass(this.player_||this,options)}else component=child;if(component.parentComponent_&&component.parentComponent_.removeChild(component),this.children_.splice(index,0,component),component.parentComponent_=this,"function"==typeof component.id&&(this.childIndex_[component.id()]=component),componentName=componentName||component.name&&toTitleCase$1(component.name()),componentName&&(this.childNameIndex_[componentName]=component,this.childNameIndex_[toLowerCase(componentName)]=component),"function"==typeof component.el&&component.el()){let refNode=null;this.children_[index+1]&&(this.children_[index+1].el_?refNode=this.children_[index+1].el_:isEl(this.children_[index+1])&&(refNode=this.children_[index+1])),this.contentEl().insertBefore(component.el(),refNode)}return component}removeChild(component){if("string"==typeof component&&(component=this.getChild(component)),!component||!this.children_)return;let childFound=!1;for(let i=this.children_.length-1;i>=0;i--)if(this.children_[i]===component){childFound=!0,this.children_.splice(i,1);break}if(!childFound)return;component.parentComponent_=null,this.childIndex_[component.id()]=null,this.childNameIndex_[toTitleCase$1(component.name())]=null,this.childNameIndex_[toLowerCase(component.name())]=null;const compEl=component.el();compEl&&compEl.parentNode===this.contentEl()&&this.contentEl().removeChild(component.el())}initChildren(){const children=this.options_.children;if(children){const parentOptions=this.options_,handleAdd=child=>{const name=child.name;let opts=child.opts;if(void 0!==parentOptions[name]&&(opts=parentOptions[name]),!1===opts)return;!0===opts&&(opts={}),opts.playerOptions=this.options_.playerOptions;const newChild=this.addChild(name,opts);newChild&&(this[name]=newChild)};let workingChildren;const Tech=Component$1.getComponent("Tech");workingChildren=Array.isArray(children)?children:Object.keys(children),workingChildren.concat(Object.keys(this.options_).filter((function(child){return!workingChildren.some((function(wchild){return"string"==typeof wchild?child===wchild:child===wchild.name}))}))).map((child=>{let name,opts;return"string"==typeof child?(name=child,opts=children[name]||this.options_[name]||{}):(name=child.name,opts=child),{name:name,opts:opts}})).filter((child=>{const c=Component$1.getComponent(child.opts.componentClass||toTitleCase$1(child.name));return c&&!Tech.isTech(c)})).forEach(handleAdd)}}buildCSSClass(){return""}ready(fn){let sync=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(fn)return this.isReady_?void(sync?fn.call(this):this.setTimeout(fn,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(fn))}triggerReady(){this.isReady_=!0,this.setTimeout((function(){const readyQueue=this.readyQueue_;this.readyQueue_=[],readyQueue&&readyQueue.length>0&&readyQueue.forEach((function(fn){fn.call(this)}),this),this.trigger("ready")}),1)}$(selector,context){return $(selector,context||this.contentEl())}$$(selector,context){return $$(selector,context||this.contentEl())}hasClass(classToCheck){return hasClass(this.el_,classToCheck)}addClass(){for(var _len15=arguments.length,classesToAdd=new Array(_len15),_key15=0;_key15<_len15;_key15++)classesToAdd[_key15]=arguments[_key15];addClass(this.el_,...classesToAdd)}removeClass(){for(var _len16=arguments.length,classesToRemove=new Array(_len16),_key16=0;_key16<_len16;_key16++)classesToRemove[_key16]=arguments[_key16];removeClass(this.el_,...classesToRemove)}toggleClass(classToToggle,predicate){toggleClass(this.el_,classToToggle,predicate)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(attribute){return getAttribute(this.el_,attribute)}setAttribute(attribute,value){setAttribute(this.el_,attribute,value)}removeAttribute(attribute){removeAttribute(this.el_,attribute)}width(num,skipListeners){return this.dimension("width",num,skipListeners)}height(num,skipListeners){return this.dimension("height",num,skipListeners)}dimensions(width,height){this.width(width,!0),this.height(height)}dimension(widthOrHeight,num,skipListeners){if(void 0!==num)return null!==num&&num==num||(num=0),-1!==(""+num).indexOf("%")||-1!==(""+num).indexOf("px")?this.el_.style[widthOrHeight]=num:this.el_.style[widthOrHeight]="auto"===num?"":num+"px",void(skipListeners||this.trigger("componentresize"));if(!this.el_)return 0;const val=this.el_.style[widthOrHeight],pxIndex=val.indexOf("px");return-1!==pxIndex?parseInt(val.slice(0,pxIndex),10):parseInt(this.el_["offset"+toTitleCase$1(widthOrHeight)],10)}currentDimension(widthOrHeight){let computedWidthOrHeight=0;if("width"!==widthOrHeight&&"height"!==widthOrHeight)throw new Error("currentDimension only accepts width or height value");if(computedWidthOrHeight=computedStyle(this.el_,widthOrHeight),computedWidthOrHeight=parseFloat(computedWidthOrHeight),0===computedWidthOrHeight||isNaN(computedWidthOrHeight)){const rule="offset".concat(toTitleCase$1(widthOrHeight));computedWidthOrHeight=this.el_[rule]}return computedWidthOrHeight}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(event){this.player_&&(keycode.isEventKey(event,"Tab")||event.stopPropagation(),this.player_.handleKeyDown(event))}handleKeyPress(event){this.handleKeyDown(event)}emitTapEvents(){let touchStart=0,firstTouch=null;let couldBeTap;this.on("touchstart",(function(event){1===event.touches.length&&(firstTouch={pageX:event.touches[0].pageX,pageY:event.touches[0].pageY},touchStart=window.performance.now(),couldBeTap=!0)})),this.on("touchmove",(function(event){if(event.touches.length>1)couldBeTap=!1;else if(firstTouch){const xdiff=event.touches[0].pageX-firstTouch.pageX,ydiff=event.touches[0].pageY-firstTouch.pageY;Math.sqrt(xdiff*xdiff+ydiff*ydiff)>10&&(couldBeTap=!1)}}));const noTap=function(){couldBeTap=!1};this.on("touchleave",noTap),this.on("touchcancel",noTap),this.on("touchend",(function(event){if(firstTouch=null,!0===couldBeTap){window.performance.now()-touchStart<200&&(event.preventDefault(),this.trigger("tap"))}}))}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const report=bind_(this.player(),this.player().reportUserActivity);let touchHolding;this.on("touchstart",(function(){report(),this.clearInterval(touchHolding),touchHolding=this.setInterval(report,250)}));const touchEnd=function(event){report(),this.clearInterval(touchHolding)};this.on("touchmove",report),this.on("touchend",touchEnd),this.on("touchcancel",touchEnd)}setTimeout(fn,timeout){var timeoutId;return fn=bind_(this,fn),this.clearTimersOnDispose_(),timeoutId=window.setTimeout((()=>{this.setTimeoutIds_.has(timeoutId)&&this.setTimeoutIds_.delete(timeoutId),fn()}),timeout),this.setTimeoutIds_.add(timeoutId),timeoutId}clearTimeout(timeoutId){return this.setTimeoutIds_.has(timeoutId)&&(this.setTimeoutIds_.delete(timeoutId),window.clearTimeout(timeoutId)),timeoutId}setInterval(fn,interval){fn=bind_(this,fn),this.clearTimersOnDispose_();const intervalId=window.setInterval(fn,interval);return this.setIntervalIds_.add(intervalId),intervalId}clearInterval(intervalId){return this.setIntervalIds_.has(intervalId)&&(this.setIntervalIds_.delete(intervalId),window.clearInterval(intervalId)),intervalId}requestAnimationFrame(fn){var id;return this.clearTimersOnDispose_(),fn=bind_(this,fn),id=window.requestAnimationFrame((()=>{this.rafIds_.has(id)&&this.rafIds_.delete(id),fn()})),this.rafIds_.add(id),id}requestNamedAnimationFrame(name,fn){if(this.namedRafs_.has(name))return;this.clearTimersOnDispose_(),fn=bind_(this,fn);const id=this.requestAnimationFrame((()=>{fn(),this.namedRafs_.has(name)&&this.namedRafs_.delete(name)}));return this.namedRafs_.set(name,id),name}cancelNamedAnimationFrame(name){this.namedRafs_.has(name)&&(this.cancelAnimationFrame(this.namedRafs_.get(name)),this.namedRafs_.delete(name))}cancelAnimationFrame(id){return this.rafIds_.has(id)&&(this.rafIds_.delete(id),window.cancelAnimationFrame(id)),id}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((_ref4=>{let[idName,cancelName]=_ref4;this[idName].forEach(((val,key)=>this[cancelName](key)))})),this.clearingTimersOnDispose_=!1})))}static registerComponent(name,ComponentToRegister){if("string"!=typeof name||!name)throw new Error('Illegal component name, "'.concat(name,'"; must be a non-empty string.'));const Tech=Component$1.getComponent("Tech"),isTech=Tech&&Tech.isTech(ComponentToRegister),isComp=Component$1===ComponentToRegister||Component$1.prototype.isPrototypeOf(ComponentToRegister.prototype);if(isTech||!isComp){let reason;throw reason=isTech?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'.concat(name,'"; ').concat(reason,"."))}name=toTitleCase$1(name),Component$1.components_||(Component$1.components_={});const Player=Component$1.getComponent("Player");if("Player"===name&&Player&&Player.players){const players=Player.players,playerNames=Object.keys(players);if(players&&playerNames.length>0&&playerNames.map((pname=>players[pname])).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return Component$1.components_[name]=ComponentToRegister,Component$1.components_[toLowerCase(name)]=ComponentToRegister,ComponentToRegister}static getComponent(name){if(name&&Component$1.components_)return Component$1.components_[name]}}function getRange(fnName,valueIndex,ranges,rangeIndex){return function(fnName,index,maxIndex){if("number"!=typeof index||index<0||index>maxIndex)throw new Error("Failed to execute '".concat(fnName,"' on 'TimeRanges': The index provided (").concat(index,") is non-numeric or out of bounds (0-").concat(maxIndex,")."))}(fnName,rangeIndex,ranges.length-1),ranges[rangeIndex][valueIndex]}function createTimeRangesObj(ranges){let timeRangesObj;return timeRangesObj=void 0===ranges||0===ranges.length?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:ranges.length,start:getRange.bind(null,"start",0,ranges),end:getRange.bind(null,"end",1,ranges)},window.Symbol&&window.Symbol.iterator&&(timeRangesObj[window.Symbol.iterator]=()=>(ranges||[]).values()),timeRangesObj}function createTimeRanges$1(start,end){return Array.isArray(start)?createTimeRangesObj(start):void 0===start||void 0===end?createTimeRangesObj():createTimeRangesObj([[start,end]])}Component$1.registerComponent("Component",Component$1);const defaultImplementation=function(seconds,guide){seconds=seconds<0?0:seconds;let s=Math.floor(seconds%60),m=Math.floor(seconds/60%60),h=Math.floor(seconds/3600);const gm=Math.floor(guide/60%60),gh=Math.floor(guide/3600);return(isNaN(seconds)||seconds===1/0)&&(h=m=s="-"),h=h>0||gh>0?h+":":"",m=((h||gm>=10)&&m<10?"0"+m:m)+":",s=s<10?"0"+s:s,h+m+s};let implementation=defaultImplementation;function setFormatTime(customImplementation){implementation=customImplementation}function resetFormatTime(){implementation=defaultImplementation}function formatTime(seconds){let guide=arguments.length>1&&void 0!==arguments[1]?arguments[1]:seconds;return implementation(seconds,guide)}var Time=Object.freeze({__proto__:null,createTimeRanges:createTimeRanges$1,createTimeRange:createTimeRanges$1,setFormatTime:setFormatTime,resetFormatTime:resetFormatTime,formatTime:formatTime});function bufferedPercent(buffered,duration){let start,end,bufferedDuration=0;if(!duration)return 0;buffered&&buffered.length||(buffered=createTimeRanges$1(0,0));for(let i=0;iduration&&(end=duration),bufferedDuration+=end-start;return bufferedDuration/duration}function MediaError(value){if(value instanceof MediaError)return value;"number"==typeof value?this.code=value:"string"==typeof value?this.message=value:isObject$1(value)&&("number"==typeof value.code&&(this.code=value.code),Object.assign(this,value)),this.message||(this.message=MediaError.defaultMessages[this.code]||"")}MediaError.prototype.code=0,MediaError.prototype.message="",MediaError.prototype.status=null,MediaError.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],MediaError.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(let errNum=0;errNum{}))}const trackToJson_=function(track){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(((acc,prop,i)=>(track[prop]&&(acc[prop]=track[prop]),acc)),{cues:track.cues&&Array.prototype.map.call(track.cues,(function(cue){return{startTime:cue.startTime,endTime:cue.endTime,text:cue.text,id:cue.id}}))})};var textTrackConverter_textTracksToJson=function(tech){const trackEls=tech.$$("track"),trackObjs=Array.prototype.map.call(trackEls,(t=>t.track));return Array.prototype.map.call(trackEls,(function(trackEl){const json=trackToJson_(trackEl.track);return trackEl.src&&(json.src=trackEl.src),json})).concat(Array.prototype.filter.call(tech.textTracks(),(function(track){return-1===trackObjs.indexOf(track)})).map(trackToJson_))},textTrackConverter_jsonToTextTracks=function(json,tech){return json.forEach((function(track){const addedTrack=tech.addRemoteTextTrack(track).track;!track.src&&track.cues&&track.cues.forEach((cue=>addedTrack.addCue(cue)))})),tech.textTracks()};class ModalDialog extends Component$1{constructor(player,options){super(player,options),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=createEl("div",{className:"".concat("vjs-modal-dialog","-content")},{role:"document"}),this.descEl_=createEl("p",{className:"".concat("vjs-modal-dialog","-description vjs-control-text"),id:this.el().getAttribute("aria-describedby")}),textContent(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":"".concat(this.id(),"_description"),"aria-hidden":"true","aria-label":this.label(),role:"dialog"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return"".concat("vjs-modal-dialog"," vjs-hidden ").concat(super.buildCSSClass())}label(){return this.localize(this.options_.label||"Modal Window")}description(){let desc=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(desc+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),desc}open(){if(!this.opened_){const player=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!player.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&player.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=player.controls(),player.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}}opened(value){return"boolean"==typeof value&&this[value?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const player=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&player.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&player.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(value){if("boolean"==typeof value){const closeable=this.closeable_=!!value;let close=this.getChild("closeButton");if(closeable&&!close){const temp=this.contentEl_;this.contentEl_=this.el_,close=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=temp,this.on(close,"close",this.close_)}!closeable&&close&&(this.off(close,"close",this.close_),this.removeChild(close),close.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(content){const contentEl=this.contentEl(),parentEl=contentEl.parentNode,nextSiblingEl=contentEl.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,parentEl.removeChild(contentEl),this.empty(),insertContent(contentEl,content),this.trigger("modalfill"),nextSiblingEl?parentEl.insertBefore(contentEl,nextSiblingEl):parentEl.appendChild(contentEl);const closeButton=this.getChild("closeButton");closeButton&&parentEl.appendChild(closeButton.el_)}empty(){this.trigger("beforemodalempty"),emptyEl(this.contentEl()),this.trigger("modalempty")}content(value){return void 0!==value&&(this.content_=value),this.content_}conditionalFocus_(){const activeEl=document.activeElement,playerEl=this.player_.el_;this.previouslyActiveEl_=null,(playerEl.contains(activeEl)||playerEl===activeEl)&&(this.previouslyActiveEl_=activeEl,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(event){if(event.stopPropagation(),keycode.isEventKey(event,"Escape")&&this.closeable())return event.preventDefault(),void this.close();if(!keycode.isEventKey(event,"Tab"))return;const focusableEls=this.focusableEls_(),activeEl=this.el_.querySelector(":focus");let focusIndex;for(let i=0;i(child instanceof window.HTMLAnchorElement||child instanceof window.HTMLAreaElement)&&child.hasAttribute("href")||(child instanceof window.HTMLInputElement||child instanceof window.HTMLSelectElement||child instanceof window.HTMLTextAreaElement||child instanceof window.HTMLButtonElement)&&!child.hasAttribute("disabled")||child instanceof window.HTMLIFrameElement||child instanceof window.HTMLObjectElement||child instanceof window.HTMLEmbedElement||child.hasAttribute("tabindex")&&-1!==child.getAttribute("tabindex")||child.hasAttribute("contenteditable")))}}ModalDialog.prototype.options_={pauseOnOpen:!0,temporary:!0},Component$1.registerComponent("ModalDialog",ModalDialog);class TrackList extends EventTarget$2{constructor(){let tracks=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let i=0;i{this.trigger({track:track,type:"labelchange",target:this})},isEvented(track)&&track.addEventListener("labelchange",track.labelchange_)}removeTrack(rtrack){let track;for(let i=0,l=this.length;ithis.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),track.addEventListener("modechange",this.queueChange_);-1===["metadata","chapters"].indexOf(track.kind)&&track.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(rtrack){super.removeTrack(rtrack),rtrack.removeEventListener&&(this.queueChange_&&rtrack.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&rtrack.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class TextTrackCueList{constructor(cues){TextTrackCueList.prototype.setCues_.call(this,cues),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(cues){const oldLength=this.length||0;let i=0;const l=cues.length;this.cues_=cues,this.length_=cues.length;const defineProp=function(index){""+index in this||Object.defineProperty(this,""+index,{get(){return this.cues_[index]}})};if(oldLength0&&void 0!==arguments[0]?arguments[0]:{};super();const trackProps={id:options.id||"vjs_track_"+newGUID(),kind:options.kind||"",language:options.language||""};let label=options.label||"";for(const key in trackProps)Object.defineProperty(this,key,{get:()=>trackProps[key],set(){}});Object.defineProperty(this,"label",{get:()=>label,set(newLabel){newLabel!==label&&(label=newLabel,this.trigger("labelchange"))}})}}const parseUrl=function(url){const props=["protocol","hostname","port","pathname","search","hash","host"],a=document.createElement("a");a.href=url;const details={};for(let i=0;i1&&void 0!==arguments[1]?arguments[1]:window.location;const urlInfo=parseUrl(url),srcProtocol=":"===urlInfo.protocol?winLoc.protocol:urlInfo.protocol,crossOrigin=srcProtocol+urlInfo.host!==winLoc.protocol+winLoc.host;return crossOrigin};var x,Url=Object.freeze({__proto__:null,parseUrl:parseUrl,getAbsoluteURL:getAbsoluteURL,getFileExtension:getFileExtension,isCrossOrigin:isCrossOrigin}),window_1="undefined"!=typeof window?window:void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:{},_extends_1=createCommonjsModule((function(module){function _extends(){return module.exports=_extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i=400&&response.statusCode<=599){var cause=responseBody;if(decodeResponseBody)if(window_1.TextDecoder){var charset=function(contentTypeHeader){void 0===contentTypeHeader&&(contentTypeHeader="");return contentTypeHeader.toLowerCase().split(";").reduce((function(charset,contentType){var _contentType$split=contentType.split("="),type=_contentType$split[0],value=_contentType$split[1];return"charset"===type.trim()?value.trim():charset}),"utf-8")}(response.headers&&response.headers["content-type"]);try{cause=new TextDecoder(charset).decode(responseBody)}catch(e){}}else cause=String.fromCharCode.apply(null,new Uint8Array(responseBody));callback({cause:cause})}else callback(null,responseBody)}};createXHR.httpHandler=httpHandler;
/**
* @license
* slighly modified parse-headers 2.0.2
@@ -17,11 +17,15 @@
* Available under the MIT license
*
*/
-var lib=createXHR,default_1=createXHR;function initParams(uri,options,callback){var params=uri;return isFunction_1(options)?(callback=options,"string"==typeof uri&&(params={uri:uri})):params=_extends_1({},options,{uri:uri}),params.callback=callback,params}function createXHR(uri,options,callback){return _createXHR(options=initParams(uri,options,callback))}function _createXHR(options){if(void 0===options.callback)throw new Error("callback argument missing");var called=!1,callback=function(err,response,body){called||(called=!0,options.callback(err,response,body))};function getBody(){var body=void 0;if(body=xhr.response?xhr.response:xhr.responseText||function(xhr){try{if("document"===xhr.responseType)return xhr.responseXML;var firefoxBugTakenEffect=xhr.responseXML&&"parsererror"===xhr.responseXML.documentElement.nodeName;if(""===xhr.responseType&&!firefoxBugTakenEffect)return xhr.responseXML}catch(e){}return null}(xhr),isJson)try{body=JSON.parse(body)}catch(e){}return body}function errorFunc(evt){return clearTimeout(timeoutTimer),evt instanceof Error||(evt=new Error(""+(evt||"Unknown XMLHttpRequest Error"))),evt.statusCode=0,callback(evt,failureResponse)}function loadFunc(){if(!aborted){var status;clearTimeout(timeoutTimer),status=options.useXDR&&void 0===xhr.status?200:1223===xhr.status?204:xhr.status;var response=failureResponse,err=null;return 0!==status?(response={body:getBody(),statusCode:status,method:method,headers:{},url:uri,rawRequest:xhr},xhr.getAllResponseHeaders&&(response.headers=function(headers){var result={};return headers?(headers.trim().split("\n").forEach((function(row){var index=row.indexOf(":"),key=row.slice(0,index).trim().toLowerCase(),value=row.slice(index+1).trim();void 0===result[key]?result[key]=value:Array.isArray(result[key])?result[key].push(value):result[key]=[result[key],value]})),result):result}(xhr.getAllResponseHeaders()))):err=new Error("Internal XMLHttpRequest Error"),callback(err,response,response.body)}}var key,aborted,xhr=options.xhr||null;xhr||(xhr=options.cors||options.useXDR?new createXHR.XDomainRequest:new createXHR.XMLHttpRequest);var timeoutTimer,uri=xhr.url=options.uri||options.url,method=xhr.method=options.method||"GET",body=options.body||options.data,headers=xhr.headers=options.headers||{},sync=!!options.sync,isJson=!1,failureResponse={body:void 0,headers:{},statusCode:0,method:method,url:uri,rawRequest:xhr};if("json"in options&&!1!==options.json&&(isJson=!0,headers.accept||headers.Accept||(headers.Accept="application/json"),"GET"!==method&&"HEAD"!==method&&(headers["content-type"]||headers["Content-Type"]||(headers["Content-Type"]="application/json"),body=JSON.stringify(!0===options.json?body:options.json))),xhr.onreadystatechange=function(){4===xhr.readyState&&setTimeout(loadFunc,0)},xhr.onload=loadFunc,xhr.onerror=errorFunc,xhr.onprogress=function(){},xhr.onabort=function(){aborted=!0},xhr.ontimeout=errorFunc,xhr.open(method,uri,!sync,options.username,options.password),sync||(xhr.withCredentials=!!options.withCredentials),!sync&&options.timeout>0&&(timeoutTimer=setTimeout((function(){if(!aborted){aborted=!0,xhr.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",errorFunc(e)}}),options.timeout)),xhr.setRequestHeader)for(key in headers)headers.hasOwnProperty(key)&&xhr.setRequestHeader(key,headers[key]);else if(options.headers&&!function(obj){for(var i in obj)if(obj.hasOwnProperty(i))return!1;return!0}(options.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in options&&(xhr.responseType=options.responseType),"beforeSend"in options&&"function"==typeof options.beforeSend&&options.beforeSend(xhr),xhr.send(body||null),xhr}createXHR.XMLHttpRequest=window_1.XMLHttpRequest||function(){},createXHR.XDomainRequest="withCredentials"in new createXHR.XMLHttpRequest?createXHR.XMLHttpRequest:window_1.XDomainRequest,function(array,iterator){for(var i=0;i0&&(window.console&&window.console.groupCollapsed&&window.console.groupCollapsed("Text Track parsing errors for "+track.src),errors.forEach((function(error){return log$1.error(error)})),window.console&&window.console.groupEnd&&window.console.groupEnd()),parser.flush()},loadTrack=function(src,track){var opts={uri:src},crossOrigin=isCrossOrigin(src);crossOrigin&&(opts.cors=crossOrigin);var withCredentials="use-credentials"===track.tech_.crossOrigin();withCredentials&&(opts.withCredentials=withCredentials),lib(opts,bind(this,(function(err,response,responseBody){if(err)return log$1.error(err,response);track.loaded_=!0,"function"!=typeof window.WebVTT?track.tech_&&track.tech_.any(["vttjsloaded","vttjserror"],(function(event){if("vttjserror"!==event.type)return parseCues(responseBody,track);log$1.error("vttjs failed to load, stopping trying to process "+track.src)})):parseCues(responseBody,track)})))},TextTrack=function(_Track){function TextTrack(options){var _this;if(void 0===options&&(options={}),!options.tech)throw new Error("A tech was not provided.");var settings=mergeOptions$3(options,{kind:TextTrackKind[options.kind]||"subtitles",language:options.language||options.srclang||""}),mode=TextTrackMode[settings.mode]||"disabled",default_=settings.default;"metadata"!==settings.kind&&"chapters"!==settings.kind||(mode="hidden"),(_this=_Track.call(this,settings)||this).tech_=settings.tech,_this.cues_=[],_this.activeCues_=[],_this.preload_=!1!==_this.tech_.preloadTextTracks;var cues=new TextTrackCueList(_this.cues_),activeCues=new TextTrackCueList(_this.activeCues_),changed=!1;_this.timeupdateHandler=bind(assertThisInitialized(_this),(function(event){void 0===event&&(event={}),this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,changed&&(this.trigger("cuechange"),changed=!1),"timeupdate"!==event.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==event.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))}));return _this.tech_.one("dispose",(function(){_this.stopTracking()})),"disabled"!==mode&&_this.startTracking(),Object.defineProperties(assertThisInitialized(_this),{default:{get:function(){return default_},set:function(){}},mode:{get:function(){return mode},set:function(newMode){TextTrackMode[newMode]&&mode!==newMode&&(mode=newMode,this.preload_||"disabled"===mode||0!==this.cues.length||loadTrack(this.src,this),this.stopTracking(),"disabled"!==mode&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?cues:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return activeCues;for(var ct=this.tech_.currentTime(),active=[],i=0,l=this.cues.length;i=ct||cue.startTime===cue.endTime&&cue.startTime<=ct&&cue.startTime+.5>=ct)&&active.push(cue)}if(changed=!1,active.length!==this.activeCues_.length)changed=!0;else for(var _i=0;_i59?computeSeconds(m[1],m[2],0,m[4]):computeSeconds(0,m[1],m[2],m[4]):null}function Settings(){this.values=_objCreate(null)}function parseOptions(input,callback,keyValueDelim,groupDelim){var groups=groupDelim?input.split(groupDelim):[input];for(var i in groups)if("string"==typeof groups[i]){var kv=groups[i].split(keyValueDelim);if(2===kv.length)callback(kv[0].trim(),kv[1].trim())}}function parseCue(input,cue,regionList){var oInput=input;function consumeTimeStamp(){var ts=parseTimeStamp(input);if(null===ts)throw new ParsingError(ParsingError.Errors.BadTimeStamp,"Malformed timestamp: "+oInput);return input=input.replace(/^[^\sa-zA-Z-]+/,""),ts}function skipWhitespace(){input=input.replace(/^\s+/,"")}if(skipWhitespace(),cue.startTime=consumeTimeStamp(),skipWhitespace(),"--\x3e"!==input.substr(0,3))throw new ParsingError(ParsingError.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+oInput);input=input.substr(3),skipWhitespace(),cue.endTime=consumeTimeStamp(),skipWhitespace(),function(input,cue){var settings=new Settings;parseOptions(input,(function(k,v){switch(k){case"region":for(var i=regionList.length-1;i>=0;i--)if(regionList[i].id===v){settings.set(k,regionList[i].region);break}break;case"vertical":settings.alt(k,v,["rl","lr"]);break;case"line":var vals=v.split(","),vals0=vals[0];settings.integer(k,vals0),settings.percent(k,vals0)&&settings.set("snapToLines",!1),settings.alt(k,vals0,["auto"]),2===vals.length&&settings.alt("lineAlign",vals[1],["start","center","end"]);break;case"position":vals=v.split(","),settings.percent(k,vals[0]),2===vals.length&&settings.alt("positionAlign",vals[1],["start","center","end"]);break;case"size":settings.percent(k,v);break;case"align":settings.alt(k,v,["start","center","end","left","right"])}}),/:/,/\s/),cue.region=settings.get("region",null),cue.vertical=settings.get("vertical","");try{cue.line=settings.get("line","auto")}catch(e){}cue.lineAlign=settings.get("lineAlign","start"),cue.snapToLines=settings.get("snapToLines",!0),cue.size=settings.get("size",100);try{cue.align=settings.get("align","center")}catch(e){cue.align=settings.get("align","middle")}try{cue.position=settings.get("position","auto")}catch(e){cue.position=settings.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},cue.align)}cue.positionAlign=settings.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},cue.align)}(input,cue)}ParsingError.prototype=_objCreate(Error.prototype),ParsingError.prototype.constructor=ParsingError,ParsingError.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},Settings.prototype={set:function(k,v){this.get(k)||""===v||(this.values[k]=v)},get:function(k,dflt,defaultKey){return defaultKey?this.has(k)?this.values[k]:dflt[defaultKey]:this.has(k)?this.values[k]:dflt},has:function(k){return k in this.values},alt:function(k,v,a){for(var n=0;n=0&&v<=100)&&(this.set(k,v),!0)}};var TEXTAREA_ELEMENT=document_1.createElement&&document_1.createElement("textarea"),TAG_NAME={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},DEFAULT_COLOR_CLASS={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},TAG_ANNOTATION={v:"title",lang:"lang"},NEEDS_PARENT={rt:"ruby"};function parseContent(window,input){function nextToken(){if(!input)return null;var result,m=input.match(/^([^<]*)(<[^>]*>?)?/);return result=m[1]?m[1]:m[2],input=input.substr(result.length),result}function shouldAdd(current,element){return!NEEDS_PARENT[element.localName]||NEEDS_PARENT[element.localName]===current.localName}function createElement(type,annotation){var tagName=TAG_NAME[type];if(!tagName)return null;var element=window.document.createElement(tagName),name=TAG_ANNOTATION[type];return name&&annotation&&(element[name]=annotation.trim()),element}for(var t,s,rootDiv=window.document.createElement("div"),current=rootDiv,tagStack=[];null!==(t=nextToken());)if("<"!==t[0])current.appendChild(window.document.createTextNode((s=t,TEXTAREA_ELEMENT.innerHTML=s,s=TEXTAREA_ELEMENT.textContent,TEXTAREA_ELEMENT.textContent="",s)));else{if("/"===t[1]){tagStack.length&&tagStack[tagStack.length-1]===t.substr(2).replace(">","")&&(tagStack.pop(),current=current.parentNode);continue}var node,ts=parseTimeStamp(t.substr(1,t.length-2));if(ts){node=window.document.createProcessingInstruction("timestamp",ts),current.appendChild(node);continue}var m=t.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!m)continue;if(!(node=createElement(m[1],m[3])))continue;if(!shouldAdd(current,node))continue;if(m[2]){var classes=m[2].split(".");classes.forEach((function(cl){var bgColor=/^bg_/.test(cl),colorName=bgColor?cl.slice(3):cl;if(DEFAULT_COLOR_CLASS.hasOwnProperty(colorName)){var propName=bgColor?"background-color":"color",propValue=DEFAULT_COLOR_CLASS[colorName];node.style[propName]=propValue}})),node.className=classes.join(" ")}tagStack.push(m[1]),current.appendChild(node),current=node}return rootDiv}var strongRTLRanges=[[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]];function isStrongRTLChar(charCode){for(var i=0;i=currentRange[0]&&charCode<=currentRange[1])return!0}return!1}function determineBidi(cueDiv){var nodeStack=[],text="";if(!cueDiv||!cueDiv.childNodes)return"ltr";function pushNodes(nodeStack,node){for(var i=node.childNodes.length-1;i>=0;i--)nodeStack.push(node.childNodes[i])}function nextTextNode(nodeStack){if(!nodeStack||!nodeStack.length)return null;var node=nodeStack.pop(),text=node.textContent||node.innerText;if(text){var m=text.match(/^.*(\n|\r)/);return m?(nodeStack.length=0,m[0]):text}return"ruby"===node.tagName?nextTextNode(nodeStack):node.childNodes?(pushNodes(nodeStack,node),nextTextNode(nodeStack)):void 0}for(pushNodes(nodeStack,cueDiv);text=nextTextNode(nodeStack);)for(var i=0;i=0&&cue.line<=100))return cue.line;if(!cue.track||!cue.track.textTrackList||!cue.track.textTrackList.mediaElement)return-1;for(var track=cue.track,trackList=track.textTrackList,count=0,i=0;imaxPosition&&(position=position<0?-1:1,position*=Math.ceil(maxPosition/step)*step),linePos<0&&(position+=""===cue.vertical?containerBox.height:containerBox.width,axis=axis.reverse()),boxPosition.move(initialAxis,position)}else{var calculatedPercentage=boxPosition.lineHeight/containerBox.height*100;switch(cue.lineAlign){case"center":linePos-=calculatedPercentage/2;break;case"end":linePos-=calculatedPercentage}switch(cue.vertical){case"":styleBox.applyStyles({top:styleBox.formatStyle(linePos,"%")});break;case"rl":styleBox.applyStyles({left:styleBox.formatStyle(linePos,"%")});break;case"lr":styleBox.applyStyles({right:styleBox.formatStyle(linePos,"%")})}axis=["+y","-x","+x","-y"],boxPosition=new BoxPosition(styleBox)}var bestPosition=function(b,axis){for(var bestPosition,specifiedPosition=new BoxPosition(b),percentage=1,i=0;ip&&(bestPosition=new BoxPosition(b),percentage=p),b=new BoxPosition(specifiedPosition)}return bestPosition||specifiedPosition}(boxPosition,axis);styleBox.move(bestPosition.toCSSCompatValues(containerBox))}function WebVTT$1(){}StyleBox.prototype.applyStyles=function(styles,div){for(var prop in div=div||this.div,styles)styles.hasOwnProperty(prop)&&(div.style[prop]=styles[prop])},StyleBox.prototype.formatStyle=function(val,unit){return 0===val?0:val+unit},CueStyleBox.prototype=_objCreate(StyleBox.prototype),CueStyleBox.prototype.constructor=CueStyleBox,BoxPosition.prototype.move=function(axis,toMove){switch(toMove=void 0!==toMove?toMove:this.lineHeight,axis){case"+x":this.left+=toMove,this.right+=toMove;break;case"-x":this.left-=toMove,this.right-=toMove;break;case"+y":this.top+=toMove,this.bottom+=toMove;break;case"-y":this.top-=toMove,this.bottom-=toMove}},BoxPosition.prototype.overlaps=function(b2){return this.leftb2.left&&this.topb2.top},BoxPosition.prototype.overlapsAny=function(boxes){for(var i=0;i=container.top&&this.bottom<=container.bottom&&this.left>=container.left&&this.right<=container.right},BoxPosition.prototype.overlapsOppositeAxis=function(container,axis){switch(axis){case"+x":return this.leftcontainer.right;case"+y":return this.topcontainer.bottom}},BoxPosition.prototype.intersectPercentage=function(b2){return Math.max(0,Math.min(this.right,b2.right)-Math.max(this.left,b2.left))*Math.max(0,Math.min(this.bottom,b2.bottom)-Math.max(this.top,b2.top))/(this.height*this.width)},BoxPosition.prototype.toCSSCompatValues=function(reference){return{top:this.top-reference.top,bottom:reference.bottom-this.bottom,left:this.left-reference.left,right:reference.right-this.right,height:this.height,width:this.width}},BoxPosition.getSimpleBoxPosition=function(obj){var height=obj.div?obj.div.offsetHeight:obj.tagName?obj.offsetHeight:0,width=obj.div?obj.div.offsetWidth:obj.tagName?obj.offsetWidth:0,top=obj.div?obj.div.offsetTop:obj.tagName?obj.offsetTop:0;return{left:(obj=obj.div?obj.div.getBoundingClientRect():obj.tagName?obj.getBoundingClientRect():obj).left,right:obj.right,top:obj.top||top,height:obj.height||height,bottom:obj.bottom||top+(obj.height||height),width:obj.width||width}},WebVTT$1.StringDecoder=function(){return{decode:function(data){if(!data)return"";if("string"!=typeof data)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(data))}}},WebVTT$1.convertCueToDOMTree=function(window,cuetext){return window&&cuetext?parseContent(window,cuetext):null};WebVTT$1.processCues=function(window,cues,overlay){if(!window||!cues||!overlay)return null;for(;overlay.firstChild;)overlay.removeChild(overlay.firstChild);var paddedOverlay=window.document.createElement("div");if(paddedOverlay.style.position="absolute",paddedOverlay.style.left="0",paddedOverlay.style.right="0",paddedOverlay.style.top="0",paddedOverlay.style.bottom="0",paddedOverlay.style.margin="1.5%",overlay.appendChild(paddedOverlay),function(cues){for(var i=0;i100)throw new Error("Position must be between 0 and 100.");_position=value,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return _positionAlign},set:function(value){var setting=findAlignSetting(value);setting?(_positionAlign=setting,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return _size},set:function(value){if(value<0||value>100)throw new Error("Size must be between 0 and 100.");_size=value,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return _align},set:function(value){var setting=findAlignSetting(value);if(!setting)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");_align=setting,this.hasBeenReset=!0}}}),this.displayState=void 0}VTTCue.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var vttcue=VTTCue,scrollSetting={"":!0,up:!0};function isValidPercentValue(value){return"number"==typeof value&&value>=0&&value<=100}var vttregion=function(){var _width=100,_lines=3,_regionAnchorX=0,_regionAnchorY=100,_viewportAnchorX=0,_viewportAnchorY=100,_scroll="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return _width},set:function(value){if(!isValidPercentValue(value))throw new Error("Width must be between 0 and 100.");_width=value}},lines:{enumerable:!0,get:function(){return _lines},set:function(value){if("number"!=typeof value)throw new TypeError("Lines must be set to a number.");_lines=value}},regionAnchorY:{enumerable:!0,get:function(){return _regionAnchorY},set:function(value){if(!isValidPercentValue(value))throw new Error("RegionAnchorX must be between 0 and 100.");_regionAnchorY=value}},regionAnchorX:{enumerable:!0,get:function(){return _regionAnchorX},set:function(value){if(!isValidPercentValue(value))throw new Error("RegionAnchorY must be between 0 and 100.");_regionAnchorX=value}},viewportAnchorY:{enumerable:!0,get:function(){return _viewportAnchorY},set:function(value){if(!isValidPercentValue(value))throw new Error("ViewportAnchorY must be between 0 and 100.");_viewportAnchorY=value}},viewportAnchorX:{enumerable:!0,get:function(){return _viewportAnchorX},set:function(value){if(!isValidPercentValue(value))throw new Error("ViewportAnchorX must be between 0 and 100.");_viewportAnchorX=value}},scroll:{enumerable:!0,get:function(){return _scroll},set:function(value){var setting=function(value){return"string"==typeof value&&!!scrollSetting[value.toLowerCase()]&&value.toLowerCase()}(value);!1===setting?console.warn("Scroll: an invalid or illegal string was specified."):_scroll=setting}}})},browserIndex=createCommonjsModule((function(module){var vttjs=module.exports={WebVTT:vtt,VTTCue:vttcue,VTTRegion:vttregion};window_1.vttjs=vttjs,window_1.WebVTT=vttjs.WebVTT;var cueShim=vttjs.VTTCue,regionShim=vttjs.VTTRegion,nativeVTTCue=window_1.VTTCue,nativeVTTRegion=window_1.VTTRegion;vttjs.shim=function(){window_1.VTTCue=cueShim,window_1.VTTRegion=regionShim},vttjs.restore=function(){window_1.VTTCue=nativeVTTCue,window_1.VTTRegion=nativeVTTRegion},window_1.VTTCue||vttjs.shim()}));browserIndex.WebVTT,browserIndex.VTTCue,browserIndex.VTTRegion;var Tech=function(_Component){function Tech(options,ready){var _this;return void 0===options&&(options={}),void 0===ready&&(ready=function(){}),options.reportTouchActivity=!1,(_this=_Component.call(this,null,options,ready)||this).onDurationChange_=function(e){return _this.onDurationChange(e)},_this.trackProgress_=function(e){return _this.trackProgress(e)},_this.trackCurrentTime_=function(e){return _this.trackCurrentTime(e)},_this.stopTrackingCurrentTime_=function(e){return _this.stopTrackingCurrentTime(e)},_this.disposeSourceHandler_=function(e){return _this.disposeSourceHandler(e)},_this.queuedHanders_=new Set,_this.hasStarted_=!1,_this.on("playing",(function(){this.hasStarted_=!0})),_this.on("loadstart",(function(){this.hasStarted_=!1})),ALL.names.forEach((function(name){var props=ALL[name];options&&options[props.getterName]&&(_this[props.privateName]=options[props.getterName])})),_this.featuresProgressEvents||_this.manualProgressOn(),_this.featuresTimeupdateEvents||_this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((function(track){!1===options["native"+track+"Tracks"]&&(_this["featuresNative"+track+"Tracks"]=!1)})),!1===options.nativeCaptions||!1===options.nativeTextTracks?_this.featuresNativeTextTracks=!1:!0!==options.nativeCaptions&&!0!==options.nativeTextTracks||(_this.featuresNativeTextTracks=!0),_this.featuresNativeTextTracks||_this.emulateTextTracks(),_this.preloadTextTracks=!1!==options.preloadTextTracks,_this.autoRemoteTextTracks_=new ALL.text.ListClass,_this.initTrackListeners(),options.nativeControlsForTouch||_this.emitTapEvents(),_this.constructor&&(_this.name_=_this.constructor.name||"Unknown Tech"),_this}inheritsLoose(Tech,_Component);var _proto=Tech.prototype;return _proto.triggerSourceset=function(src){var _this2=this;this.isReady_||this.one("ready",(function(){return _this2.setTimeout((function(){return _this2.triggerSourceset(src)}),1)})),this.trigger({src:src,type:"sourceset"})},_proto.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},_proto.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},_proto.trackProgress=function(event){this.stopTrackingProgress(),this.progressInterval=this.setInterval(bind(this,(function(){var numBufferedPercent=this.bufferedPercent();this.bufferedPercent_!==numBufferedPercent&&this.trigger("progress"),this.bufferedPercent_=numBufferedPercent,1===numBufferedPercent&&this.stopTrackingProgress()})),500)},_proto.onDurationChange=function(event){this.duration_=this.duration()},_proto.buffered=function(){return createTimeRanges(0,0)},_proto.bufferedPercent=function(){return bufferedPercent(this.buffered(),this.duration_)},_proto.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},_proto.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},_proto.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},_proto.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)},_proto.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},_proto.dispose=function(){this.clearTracks(NORMAL.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),_Component.prototype.dispose.call(this)},_proto.clearTracks=function(types){var _this3=this;(types=[].concat(types)).forEach((function(type){for(var list=_this3[type+"Tracks"]()||[],i=list.length;i--;){var track=list[i];"text"===type&&_this3.removeRemoteTextTrack(track),list.removeTrack(track)}}))},_proto.cleanupAutoTextTracks=function(){for(var list=this.autoRemoteTextTracks_||[],i=list.length;i--;){var track=list[i];this.removeRemoteTextTrack(track)}},_proto.reset=function(){},_proto.crossOrigin=function(){},_proto.setCrossOrigin=function(){},_proto.error=function(err){return void 0!==err&&(this.error_=new MediaError(err),this.trigger("error")),this.error_},_proto.played=function(){return this.hasStarted_?createTimeRanges(0,0):createTimeRanges()},_proto.play=function(){},_proto.setScrubbing=function(){},_proto.scrubbing=function(){},_proto.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},_proto.initTrackListeners=function(){var _this4=this;NORMAL.names.forEach((function(name){var props=NORMAL[name],trackListChanges=function(){_this4.trigger(name+"trackchange")},tracks=_this4[props.getterName]();tracks.addEventListener("removetrack",trackListChanges),tracks.addEventListener("addtrack",trackListChanges),_this4.on("dispose",(function(){tracks.removeEventListener("removetrack",trackListChanges),tracks.removeEventListener("addtrack",trackListChanges)}))}))},_proto.addWebVttScript_=function(){var _this5=this;if(!window.WebVTT)if(document.body.contains(this.el())){if(!this.options_["vtt.js"]&&isPlain(browserIndex)&&Object.keys(browserIndex).length>0)return void this.trigger("vttjsloaded");var script=document.createElement("script");script.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",script.onload=function(){_this5.trigger("vttjsloaded")},script.onerror=function(){_this5.trigger("vttjserror")},this.on("dispose",(function(){script.onload=null,script.onerror=null})),window.WebVTT=!0,this.el().parentNode.appendChild(script)}else this.ready(this.addWebVttScript_)},_proto.emulateTextTracks=function(){var _this6=this,tracks=this.textTracks(),remoteTracks=this.remoteTextTracks(),handleAddTrack=function(e){return tracks.addTrack(e.track)},handleRemoveTrack=function(e){return tracks.removeTrack(e.track)};remoteTracks.on("addtrack",handleAddTrack),remoteTracks.on("removetrack",handleRemoveTrack),this.addWebVttScript_();var updateDisplay=function(){return _this6.trigger("texttrackchange")},textTracksChanges=function(){updateDisplay();for(var i=0;i=0;i--){var mw=mws[i];mw[method]&&mw[method](terminated,value)}}(middleware,method,returnValue,terminated),returnValue}var allowedGetters={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},allowedSetters={setCurrentTime:1,setMuted:1,setVolume:1},allowedMediators={play:1,pause:1};function middlewareIterator(method){return function(value,mw){return value===TERMINATOR?TERMINATOR:mw[method]?mw[method](value):value}}function setSourceHelper(src,middleware,next,player,acc,lastRun){void 0===src&&(src={}),void 0===middleware&&(middleware=[]),void 0===acc&&(acc=[]),void 0===lastRun&&(lastRun=!1);var _middleware=middleware,mwFactory=_middleware[0],mwrest=_middleware.slice(1);if("string"==typeof mwFactory)setSourceHelper(src,middlewares[mwFactory],next,player,acc,lastRun);else if(mwFactory){var mw=function(player,mwFactory){var mws=middlewareInstances[player.id()],mw=null;if(null==mws)return mw=mwFactory(player),middlewareInstances[player.id()]=[[mwFactory,mw]],mw;for(var i=0;i0;!this.player_.tech(!0)||(IE_VERSION||IS_EDGE)&&sourceIsEncrypted||this.player_.tech(!0).focus(),this.player_.paused()?silencePromise(this.player_.play()):this.player_.pause()}},PosterImage}(ClickableComponent);Component$1.registerComponent("PosterImage",PosterImage);var fontMap={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function constructColor(color,opacity){var hex;if(4===color.length)hex=color[1]+color[1]+color[2]+color[2]+color[3]+color[3];else{if(7!==color.length)throw new Error("Invalid color code provided, "+color+"; must be formatted as e.g. #f0e or #f604e2.");hex=color.slice(1)}return"rgba("+parseInt(hex.slice(0,2),16)+","+parseInt(hex.slice(2,4),16)+","+parseInt(hex.slice(4,6),16)+","+opacity+")"}function tryUpdateStyle(el,style,rule){try{el.style[style]=rule}catch(e){return}}var TextTrackDisplay=function(_Component){function TextTrackDisplay(player,options,ready){var _this;_this=_Component.call(this,player,options,ready)||this;var updateDisplayHandler=function(e){return _this.updateDisplay(e)};return player.on("loadstart",(function(e){return _this.toggleDisplay(e)})),player.on("texttrackchange",updateDisplayHandler),player.on("loadedmetadata",(function(e){return _this.preselectTrack(e)})),player.ready(bind(assertThisInitialized(_this),(function(){if(player.tech_&&player.tech_.featuresNativeTextTracks)this.hide();else{player.on("fullscreenchange",updateDisplayHandler),player.on("playerresize",updateDisplayHandler),window.addEventListener("orientationchange",updateDisplayHandler),player.on("dispose",(function(){return window.removeEventListener("orientationchange",updateDisplayHandler)}));for(var tracks=this.options_.playerOptions.tracks||[],i=0;i0;return silencePromise(playPromise),void(!this.player_.tech(!0)||(IE_VERSION||IS_EDGE)&&sourceIsEncrypted||this.player_.tech(!0).focus())}var cb=this.player_.getChild("controlBar"),playToggle=cb&&cb.getChild("playToggle");if(playToggle){var playFocus=function(){return playToggle.focus()};isPromise(playPromise)?playPromise.then(playFocus,(function(){})):this.setTimeout(playFocus,1)}else this.player_.tech(!0).focus()},_proto.handleKeyDown=function(event){this.mouseused_=!1,_Button.prototype.handleKeyDown.call(this,event)},_proto.handleMouseDown=function(event){this.mouseused_=!0},BigPlayButton}(Button);BigPlayButton.prototype.controlText_="Play Video",Component$1.registerComponent("BigPlayButton",BigPlayButton);var CloseButton=function(_Button){function CloseButton(player,options){var _this;return(_this=_Button.call(this,player,options)||this).controlText(options&&options.controlText||_this.localize("Close")),_this}inheritsLoose(CloseButton,_Button);var _proto=CloseButton.prototype;return _proto.buildCSSClass=function(){return"vjs-close-button "+_Button.prototype.buildCSSClass.call(this)},_proto.handleClick=function(event){this.trigger({type:"close",bubbles:!1})},_proto.handleKeyDown=function(event){keycode.isEventKey(event,"Esc")?(event.preventDefault(),event.stopPropagation(),this.trigger("click")):_Button.prototype.handleKeyDown.call(this,event)},CloseButton}(Button);Component$1.registerComponent("CloseButton",CloseButton);var PlayToggle=function(_Button){function PlayToggle(player,options){var _this;return void 0===options&&(options={}),_this=_Button.call(this,player,options)||this,options.replay=void 0===options.replay||options.replay,_this.on(player,"play",(function(e){return _this.handlePlay(e)})),_this.on(player,"pause",(function(e){return _this.handlePause(e)})),options.replay&&_this.on(player,"ended",(function(e){return _this.handleEnded(e)})),_this}inheritsLoose(PlayToggle,_Button);var _proto=PlayToggle.prototype;return _proto.buildCSSClass=function(){return"vjs-play-control "+_Button.prototype.buildCSSClass.call(this)},_proto.handleClick=function(event){this.player_.paused()?silencePromise(this.player_.play()):this.player_.pause()},_proto.handleSeeked=function(event){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(event):this.handlePlay(event)},_proto.handlePlay=function(event){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},_proto.handlePause=function(event){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},_proto.handleEnded=function(event){var _this2=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",(function(e){return _this2.handleSeeked(e)}))},PlayToggle}(Button);PlayToggle.prototype.controlText_="Play",Component$1.registerComponent("PlayToggle",PlayToggle);var defaultImplementation=function(seconds,guide){seconds=seconds<0?0:seconds;var s=Math.floor(seconds%60),m=Math.floor(seconds/60%60),h=Math.floor(seconds/3600),gm=Math.floor(guide/60%60),gh=Math.floor(guide/3600);return(isNaN(seconds)||seconds===1/0)&&(h=m=s="-"),(h=h>0||gh>0?h+":":"")+(m=((h||gm>=10)&&m<10?"0"+m:m)+":")+(s=s<10?"0"+s:s)},implementation=defaultImplementation;function formatTime(seconds,guide){return void 0===guide&&(guide=seconds),implementation(seconds,guide)}var TimeDisplay=function(_Component){function TimeDisplay(player,options){var _this;return(_this=_Component.call(this,player,options)||this).on(player,["timeupdate","ended"],(function(e){return _this.updateContent(e)})),_this.updateTextNode_(),_this}inheritsLoose(TimeDisplay,_Component);var _proto=TimeDisplay.prototype;return _proto.createEl=function(){var className=this.buildCSSClass(),el=_Component.prototype.createEl.call(this,"div",{className:className+" vjs-time-control vjs-control"}),span=createEl("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return el.appendChild(span),this.contentEl_=createEl("span",{className:className+"-display"},{"aria-live":"off",role:"presentation"}),el.appendChild(this.contentEl_),el},_proto.dispose=function(){this.contentEl_=null,this.textNode_=null,_Component.prototype.dispose.call(this)},_proto.updateTextNode_=function(time){var _this2=this;void 0===time&&(time=0),time=formatTime(time),this.formattedTime_!==time&&(this.formattedTime_=time,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(function(){if(_this2.contentEl_){var oldNode=_this2.textNode_;oldNode&&_this2.contentEl_.firstChild!==oldNode&&(oldNode=null,log$1.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),_this2.textNode_=document.createTextNode(_this2.formattedTime_),_this2.textNode_&&(oldNode?_this2.contentEl_.replaceChild(_this2.textNode_,oldNode):_this2.contentEl_.appendChild(_this2.textNode_))}})))},_proto.updateContent=function(event){},TimeDisplay}(Component$1);TimeDisplay.prototype.labelText_="Time",TimeDisplay.prototype.controlText_="Time",Component$1.registerComponent("TimeDisplay",TimeDisplay);var CurrentTimeDisplay=function(_TimeDisplay){function CurrentTimeDisplay(){return _TimeDisplay.apply(this,arguments)||this}inheritsLoose(CurrentTimeDisplay,_TimeDisplay);var _proto=CurrentTimeDisplay.prototype;return _proto.buildCSSClass=function(){return"vjs-current-time"},_proto.updateContent=function(event){var time;time=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(time)},CurrentTimeDisplay}(TimeDisplay);CurrentTimeDisplay.prototype.labelText_="Current Time",CurrentTimeDisplay.prototype.controlText_="Current Time",Component$1.registerComponent("CurrentTimeDisplay",CurrentTimeDisplay);var DurationDisplay=function(_TimeDisplay){function DurationDisplay(player,options){var _this,updateContent=function(e){return _this.updateContent(e)};return(_this=_TimeDisplay.call(this,player,options)||this).on(player,"durationchange",updateContent),_this.on(player,"loadstart",updateContent),_this.on(player,"loadedmetadata",updateContent),_this}inheritsLoose(DurationDisplay,_TimeDisplay);var _proto=DurationDisplay.prototype;return _proto.buildCSSClass=function(){return"vjs-duration"},_proto.updateContent=function(event){var duration=this.player_.duration();this.updateTextNode_(duration)},DurationDisplay}(TimeDisplay);DurationDisplay.prototype.labelText_="Duration",DurationDisplay.prototype.controlText_="Duration",Component$1.registerComponent("DurationDisplay",DurationDisplay);var TimeDivider=function(_Component){function TimeDivider(){return _Component.apply(this,arguments)||this}return inheritsLoose(TimeDivider,_Component),TimeDivider.prototype.createEl=function(){var el=_Component.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),div=_Component.prototype.createEl.call(this,"div"),span=_Component.prototype.createEl.call(this,"span",{textContent:"/"});return div.appendChild(span),el.appendChild(div),el},TimeDivider}(Component$1);Component$1.registerComponent("TimeDivider",TimeDivider);var RemainingTimeDisplay=function(_TimeDisplay){function RemainingTimeDisplay(player,options){var _this;return(_this=_TimeDisplay.call(this,player,options)||this).on(player,"durationchange",(function(e){return _this.updateContent(e)})),_this}inheritsLoose(RemainingTimeDisplay,_TimeDisplay);var _proto=RemainingTimeDisplay.prototype;return _proto.buildCSSClass=function(){return"vjs-remaining-time"},_proto.createEl=function(){var el=_TimeDisplay.prototype.createEl.call(this);return!1!==this.options_.displayNegative&&el.insertBefore(createEl("span",{},{"aria-hidden":!0},"-"),this.contentEl_),el},_proto.updateContent=function(event){var time;"number"==typeof this.player_.duration()&&(time=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(time))},RemainingTimeDisplay}(TimeDisplay);RemainingTimeDisplay.prototype.labelText_="Remaining Time",RemainingTimeDisplay.prototype.controlText_="Remaining Time",Component$1.registerComponent("RemainingTimeDisplay",RemainingTimeDisplay);var LiveDisplay=function(_Component){function LiveDisplay(player,options){var _this;return(_this=_Component.call(this,player,options)||this).updateShowing(),_this.on(_this.player(),"durationchange",(function(e){return _this.updateShowing(e)})),_this}inheritsLoose(LiveDisplay,_Component);var _proto=LiveDisplay.prototype;return _proto.createEl=function(){var el=_Component.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=createEl("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(createEl("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(document.createTextNode(this.localize("LIVE"))),el.appendChild(this.contentEl_),el},_proto.dispose=function(){this.contentEl_=null,_Component.prototype.dispose.call(this)},_proto.updateShowing=function(event){this.player().duration()===1/0?this.show():this.hide()},LiveDisplay}(Component$1);Component$1.registerComponent("LiveDisplay",LiveDisplay);var SeekToLive=function(_Button){function SeekToLive(player,options){var _this;return(_this=_Button.call(this,player,options)||this).updateLiveEdgeStatus(),_this.player_.liveTracker&&(_this.updateLiveEdgeStatusHandler_=function(e){return _this.updateLiveEdgeStatus(e)},_this.on(_this.player_.liveTracker,"liveedgechange",_this.updateLiveEdgeStatusHandler_)),_this}inheritsLoose(SeekToLive,_Button);var _proto=SeekToLive.prototype;return _proto.createEl=function(){var el=_Button.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=createEl("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),el.appendChild(this.textEl_),el},_proto.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},_proto.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},_proto.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,_Button.prototype.dispose.call(this)},SeekToLive}(Button);SeekToLive.prototype.controlText_="Seek to live, currently playing live",Component$1.registerComponent("SeekToLive",SeekToLive);var clamp=function(number,min,max){return number=Number(number),Math.min(max,Math.max(min,isNaN(number)?min:number))},Slider=function(_Component){function Slider(player,options){var _this;return(_this=_Component.call(this,player,options)||this).handleMouseDown_=function(e){return _this.handleMouseDown(e)},_this.handleMouseUp_=function(e){return _this.handleMouseUp(e)},_this.handleKeyDown_=function(e){return _this.handleKeyDown(e)},_this.handleClick_=function(e){return _this.handleClick(e)},_this.handleMouseMove_=function(e){return _this.handleMouseMove(e)},_this.update_=function(e){return _this.update(e)},_this.bar=_this.getChild(_this.options_.barName),_this.vertical(!!_this.options_.vertical),_this.enable(),_this}inheritsLoose(Slider,_Component);var _proto=Slider.prototype;return _proto.enabled=function(){return this.enabled_},_proto.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},_proto.disable=function(){if(this.enabled()){var doc=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(doc,"mousemove",this.handleMouseMove_),this.off(doc,"mouseup",this.handleMouseUp_),this.off(doc,"touchmove",this.handleMouseMove_),this.off(doc,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},_proto.createEl=function(type,props,attributes){return void 0===props&&(props={}),void 0===attributes&&(attributes={}),props.className=props.className+" vjs-slider",props=assign({tabIndex:0},props),attributes=assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},attributes),_Component.prototype.createEl.call(this,type,props,attributes)},_proto.handleMouseDown=function(event){var doc=this.bar.el_.ownerDocument;"mousedown"===event.type&&event.preventDefault(),"touchstart"!==event.type||IS_CHROME||event.preventDefault(),blockTextSelection(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(doc,"mousemove",this.handleMouseMove_),this.on(doc,"mouseup",this.handleMouseUp_),this.on(doc,"touchmove",this.handleMouseMove_),this.on(doc,"touchend",this.handleMouseUp_),this.handleMouseMove(event,!0)},_proto.handleMouseMove=function(event){},_proto.handleMouseUp=function(){var doc=this.bar.el_.ownerDocument;unblockTextSelection(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(doc,"mousemove",this.handleMouseMove_),this.off(doc,"mouseup",this.handleMouseUp_),this.off(doc,"touchmove",this.handleMouseMove_),this.off(doc,"touchend",this.handleMouseUp_),this.update()},_proto.update=function(){var _this2=this;if(this.el_&&this.bar){var progress=this.getProgress();return progress===this.progress_||(this.progress_=progress,this.requestNamedAnimationFrame("Slider#update",(function(){var sizeKey=_this2.vertical()?"height":"width";_this2.bar.el().style[sizeKey]=(100*progress).toFixed(2)+"%"}))),progress}},_proto.getProgress=function(){return Number(clamp(this.getPercent(),0,1).toFixed(4))},_proto.calculateDistance=function(event){var position=getPointerPosition(this.el_,event);return this.vertical()?position.y:position.x},_proto.handleKeyDown=function(event){keycode.isEventKey(event,"Left")||keycode.isEventKey(event,"Down")?(event.preventDefault(),event.stopPropagation(),this.stepBack()):keycode.isEventKey(event,"Right")||keycode.isEventKey(event,"Up")?(event.preventDefault(),event.stopPropagation(),this.stepForward()):_Component.prototype.handleKeyDown.call(this,event)},_proto.handleClick=function(event){event.stopPropagation(),event.preventDefault()},_proto.vertical=function(bool){if(void 0===bool)return this.vertical_||!1;this.vertical_=!!bool,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},Slider}(Component$1);Component$1.registerComponent("Slider",Slider);var percentify=function(time,end){return clamp(time/end*100,0,100).toFixed(2)+"%"},LoadProgressBar=function(_Component){function LoadProgressBar(player,options){var _this;return(_this=_Component.call(this,player,options)||this).partEls_=[],_this.on(player,"progress",(function(e){return _this.update(e)})),_this}inheritsLoose(LoadProgressBar,_Component);var _proto=LoadProgressBar.prototype;return _proto.createEl=function(){var el=_Component.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),wrapper=createEl("span",{className:"vjs-control-text"}),loadedText=createEl("span",{textContent:this.localize("Loaded")}),separator=document.createTextNode(": ");return this.percentageEl_=createEl("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),el.appendChild(wrapper),wrapper.appendChild(loadedText),wrapper.appendChild(separator),wrapper.appendChild(this.percentageEl_),el},_proto.dispose=function(){this.partEls_=null,this.percentageEl_=null,_Component.prototype.dispose.call(this)},_proto.update=function(event){var _this2=this;this.requestNamedAnimationFrame("LoadProgressBar#update",(function(){var liveTracker=_this2.player_.liveTracker,buffered=_this2.player_.buffered(),duration=liveTracker&&liveTracker.isLive()?liveTracker.seekableEnd():_this2.player_.duration(),bufferedEnd=_this2.player_.bufferedEnd(),children=_this2.partEls_,percent=percentify(bufferedEnd,duration);_this2.percent_!==percent&&(_this2.el_.style.width=percent,textContent(_this2.percentageEl_,percent),_this2.percent_=percent);for(var i=0;ibuffered.length;_i--)_this2.el_.removeChild(children[_i-1]);children.length=buffered.length}))},LoadProgressBar}(Component$1);Component$1.registerComponent("LoadProgressBar",LoadProgressBar);var TimeTooltip=function(_Component){function TimeTooltip(player,options){var _this;return(_this=_Component.call(this,player,options)||this).update=throttle(bind(assertThisInitialized(_this),_this.update),30),_this}inheritsLoose(TimeTooltip,_Component);var _proto=TimeTooltip.prototype;return _proto.createEl=function(){return _Component.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},_proto.update=function(seekBarRect,seekBarPoint,content){var tooltipRect=findPosition(this.el_),playerRect=getBoundingClientRect(this.player_.el()),seekBarPointPx=seekBarRect.width*seekBarPoint;if(playerRect&&tooltipRect){var spaceLeftOfPoint=seekBarRect.left-playerRect.left+seekBarPointPx,spaceRightOfPoint=seekBarRect.width-seekBarPointPx+(playerRect.right-seekBarRect.right),pullTooltipBy=tooltipRect.width/2;spaceLeftOfPointtooltipRect.width&&(pullTooltipBy=tooltipRect.width),pullTooltipBy=Math.round(pullTooltipBy),this.el_.style.right="-"+pullTooltipBy+"px",this.write(content)}},_proto.write=function(content){textContent(this.el_,content)},_proto.updateTime=function(seekBarRect,seekBarPoint,time,cb){var _this2=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",(function(){var content,duration=_this2.player_.duration();if(_this2.player_.liveTracker&&_this2.player_.liveTracker.isLive()){var liveWindow=_this2.player_.liveTracker.liveWindow(),secondsBehind=liveWindow-seekBarPoint*liveWindow;content=(secondsBehind<1?"":"-")+formatTime(secondsBehind,liveWindow)}else content=formatTime(time,duration);_this2.update(seekBarRect,seekBarPoint,content),cb&&cb()}))},TimeTooltip}(Component$1);Component$1.registerComponent("TimeTooltip",TimeTooltip);var PlayProgressBar=function(_Component){function PlayProgressBar(player,options){var _this;return(_this=_Component.call(this,player,options)||this).update=throttle(bind(assertThisInitialized(_this),_this.update),30),_this}inheritsLoose(PlayProgressBar,_Component);var _proto=PlayProgressBar.prototype;return _proto.createEl=function(){return _Component.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},_proto.update=function(seekBarRect,seekBarPoint){var timeTooltip=this.getChild("timeTooltip");if(timeTooltip){var time=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();timeTooltip.updateTime(seekBarRect,seekBarPoint,time)}},PlayProgressBar}(Component$1);PlayProgressBar.prototype.options_={children:[]},IS_IOS||IS_ANDROID||PlayProgressBar.prototype.options_.children.push("timeTooltip"),Component$1.registerComponent("PlayProgressBar",PlayProgressBar);var MouseTimeDisplay=function(_Component){function MouseTimeDisplay(player,options){var _this;return(_this=_Component.call(this,player,options)||this).update=throttle(bind(assertThisInitialized(_this),_this.update),30),_this}inheritsLoose(MouseTimeDisplay,_Component);var _proto=MouseTimeDisplay.prototype;return _proto.createEl=function(){return _Component.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},_proto.update=function(seekBarRect,seekBarPoint){var _this2=this,time=seekBarPoint*this.player_.duration();this.getChild("timeTooltip").updateTime(seekBarRect,seekBarPoint,time,(function(){_this2.el_.style.left=seekBarRect.width*seekBarPoint+"px"}))},MouseTimeDisplay}(Component$1);MouseTimeDisplay.prototype.options_={children:["timeTooltip"]},Component$1.registerComponent("MouseTimeDisplay",MouseTimeDisplay);var SeekBar=function(_Slider){function SeekBar(player,options){var _this;return(_this=_Slider.call(this,player,options)||this).setEventHandlers_(),_this}inheritsLoose(SeekBar,_Slider);var _proto=SeekBar.prototype;return _proto.setEventHandlers_=function(){var _this2=this;this.update_=bind(this,this.update),this.update=throttle(this.update_,30),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(e){return _this2.enableInterval_(e)},this.disableIntervalHandler_=function(e){return _this2.disableInterval_(e)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in document&&"visibilityState"in document&&this.on(document,"visibilitychange",this.toggleVisibility_)},_proto.toggleVisibility_=function(e){"hidden"===document.visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())},_proto.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30))},_proto.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},_proto.createEl=function(){return _Slider.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},_proto.update=function(event){var _this3=this;if("hidden"!==document.visibilityState){var percent=_Slider.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",(function(){var currentTime=_this3.player_.ended()?_this3.player_.duration():_this3.getCurrentTime_(),liveTracker=_this3.player_.liveTracker,duration=_this3.player_.duration();liveTracker&&liveTracker.isLive()&&(duration=_this3.player_.liveTracker.liveCurrentTime()),_this3.percent_!==percent&&(_this3.el_.setAttribute("aria-valuenow",(100*percent).toFixed(2)),_this3.percent_=percent),_this3.currentTime_===currentTime&&_this3.duration_===duration||(_this3.el_.setAttribute("aria-valuetext",_this3.localize("progress bar timing: currentTime={1} duration={2}",[formatTime(currentTime,duration),formatTime(duration,duration)],"{1} of {2}")),_this3.currentTime_=currentTime,_this3.duration_=duration),_this3.bar&&_this3.bar.update(getBoundingClientRect(_this3.el()),_this3.getProgress())})),percent}},_proto.userSeek_=function(ct){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(ct)},_proto.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},_proto.getPercent=function(){var percent,currentTime=this.getCurrentTime_(),liveTracker=this.player_.liveTracker;return liveTracker&&liveTracker.isLive()?(percent=(currentTime-liveTracker.seekableStart())/liveTracker.liveWindow(),liveTracker.atLiveEdge()&&(percent=1)):percent=currentTime/this.player_.duration(),percent},_proto.handleMouseDown=function(event){isSingleLeftClick(event)&&(event.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),_Slider.prototype.handleMouseDown.call(this,event))},_proto.handleMouseMove=function(event,mouseDown){if(void 0===mouseDown&&(mouseDown=!1),isSingleLeftClick(event)){var newTime;mouseDown||this.player_.scrubbing()||this.player_.scrubbing(!0);var distance=this.calculateDistance(event),liveTracker=this.player_.liveTracker;if(liveTracker&&liveTracker.isLive()){if(distance>=.99)return void liveTracker.seekToLiveEdge();var seekableStart=liveTracker.seekableStart(),seekableEnd=liveTracker.liveCurrentTime();if((newTime=seekableStart+distance*liveTracker.liveWindow())>=seekableEnd&&(newTime=seekableEnd),newTime<=seekableStart&&(newTime=seekableStart+.1),newTime===1/0)return}else(newTime=distance*this.player_.duration())===this.player_.duration()&&(newTime-=.1);this.userSeek_(newTime)}},_proto.enable=function(){_Slider.prototype.enable.call(this);var mouseTimeDisplay=this.getChild("mouseTimeDisplay");mouseTimeDisplay&&mouseTimeDisplay.show()},_proto.disable=function(){_Slider.prototype.disable.call(this);var mouseTimeDisplay=this.getChild("mouseTimeDisplay");mouseTimeDisplay&&mouseTimeDisplay.hide()},_proto.handleMouseUp=function(event){_Slider.prototype.handleMouseUp.call(this,event),event&&event.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?silencePromise(this.player_.play()):this.update_()},_proto.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},_proto.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},_proto.handleAction=function(event){this.player_.paused()?this.player_.play():this.player_.pause()},_proto.handleKeyDown=function(event){var liveTracker=this.player_.liveTracker;if(keycode.isEventKey(event,"Space")||keycode.isEventKey(event,"Enter"))event.preventDefault(),event.stopPropagation(),this.handleAction(event);else if(keycode.isEventKey(event,"Home"))event.preventDefault(),event.stopPropagation(),this.userSeek_(0);else if(keycode.isEventKey(event,"End"))event.preventDefault(),event.stopPropagation(),liveTracker&&liveTracker.isLive()?this.userSeek_(liveTracker.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(keycode(event))){event.preventDefault(),event.stopPropagation();var gotoFraction=10*(keycode.codes[keycode(event)]-keycode.codes[0])/100;liveTracker&&liveTracker.isLive()?this.userSeek_(liveTracker.seekableStart()+liveTracker.liveWindow()*gotoFraction):this.userSeek_(this.player_.duration()*gotoFraction)}else keycode.isEventKey(event,"PgDn")?(event.preventDefault(),event.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):keycode.isEventKey(event,"PgUp")?(event.preventDefault(),event.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):_Slider.prototype.handleKeyDown.call(this,event)},_proto.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in document&&"visibilityState"in document&&this.off(document,"visibilitychange",this.toggleVisibility_),_Slider.prototype.dispose.call(this)},SeekBar}(Slider);SeekBar.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},IS_IOS||IS_ANDROID||SeekBar.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Component$1.registerComponent("SeekBar",SeekBar);var ProgressControl=function(_Component){function ProgressControl(player,options){var _this;return(_this=_Component.call(this,player,options)||this).handleMouseMove=throttle(bind(assertThisInitialized(_this),_this.handleMouseMove),30),_this.throttledHandleMouseSeek=throttle(bind(assertThisInitialized(_this),_this.handleMouseSeek),30),_this.handleMouseUpHandler_=function(e){return _this.handleMouseUp(e)},_this.handleMouseDownHandler_=function(e){return _this.handleMouseDown(e)},_this.enable(),_this}inheritsLoose(ProgressControl,_Component);var _proto=ProgressControl.prototype;return _proto.createEl=function(){return _Component.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},_proto.handleMouseMove=function(event){var seekBar=this.getChild("seekBar");if(seekBar){var playProgressBar=seekBar.getChild("playProgressBar"),mouseTimeDisplay=seekBar.getChild("mouseTimeDisplay");if(playProgressBar||mouseTimeDisplay){var seekBarEl=seekBar.el(),seekBarRect=findPosition(seekBarEl),seekBarPoint=getPointerPosition(seekBarEl,event).x;seekBarPoint=clamp(seekBarPoint,0,1),mouseTimeDisplay&&mouseTimeDisplay.update(seekBarRect,seekBarPoint),playProgressBar&&playProgressBar.update(seekBarRect,seekBar.getProgress())}}},_proto.handleMouseSeek=function(event){var seekBar=this.getChild("seekBar");seekBar&&seekBar.handleMouseMove(event)},_proto.enabled=function(){return this.enabled_},_proto.disable=function(){if(this.children().forEach((function(child){return child.disable&&child.disable()})),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var seekBar=this.getChild("seekBar");this.player_.scrubbing(!1),seekBar.videoWasPlaying&&silencePromise(this.player_.play())}},_proto.enable=function(){this.children().forEach((function(child){return child.enable&&child.enable()})),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},_proto.removeListenersAddedOnMousedownAndTouchstart=function(){var doc=this.el_.ownerDocument;this.off(doc,"mousemove",this.throttledHandleMouseSeek),this.off(doc,"touchmove",this.throttledHandleMouseSeek),this.off(doc,"mouseup",this.handleMouseUpHandler_),this.off(doc,"touchend",this.handleMouseUpHandler_)},_proto.handleMouseDown=function(event){var doc=this.el_.ownerDocument,seekBar=this.getChild("seekBar");seekBar&&seekBar.handleMouseDown(event),this.on(doc,"mousemove",this.throttledHandleMouseSeek),this.on(doc,"touchmove",this.throttledHandleMouseSeek),this.on(doc,"mouseup",this.handleMouseUpHandler_),this.on(doc,"touchend",this.handleMouseUpHandler_)},_proto.handleMouseUp=function(event){var seekBar=this.getChild("seekBar");seekBar&&seekBar.handleMouseUp(event),this.removeListenersAddedOnMousedownAndTouchstart()},ProgressControl}(Component$1);ProgressControl.prototype.options_={children:["seekBar"]},Component$1.registerComponent("ProgressControl",ProgressControl);var PictureInPictureToggle=function(_Button){function PictureInPictureToggle(player,options){var _this;return(_this=_Button.call(this,player,options)||this).on(player,["enterpictureinpicture","leavepictureinpicture"],(function(e){return _this.handlePictureInPictureChange(e)})),_this.on(player,["disablepictureinpicturechanged","loadedmetadata"],(function(e){return _this.handlePictureInPictureEnabledChange(e)})),_this.on(player,["loadedmetadata","audioonlymodechange","audiopostermodechange"],(function(){"audio"===player.currentType().substring(0,5)||player.audioPosterMode()||player.audioOnlyMode()?(player.isInPictureInPicture()&&player.exitPictureInPicture(),_this.hide()):_this.show()})),_this.disable(),_this}inheritsLoose(PictureInPictureToggle,_Button);var _proto=PictureInPictureToggle.prototype;return _proto.buildCSSClass=function(){return"vjs-picture-in-picture-control "+_Button.prototype.buildCSSClass.call(this)},_proto.handlePictureInPictureEnabledChange=function(){document.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},_proto.handlePictureInPictureChange=function(event){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},_proto.handleClick=function(event){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},PictureInPictureToggle}(Button);PictureInPictureToggle.prototype.controlText_="Picture-in-Picture",Component$1.registerComponent("PictureInPictureToggle",PictureInPictureToggle);var FullscreenToggle=function(_Button){function FullscreenToggle(player,options){var _this;return(_this=_Button.call(this,player,options)||this).on(player,"fullscreenchange",(function(e){return _this.handleFullscreenChange(e)})),!1===document[player.fsApi_.fullscreenEnabled]&&_this.disable(),_this}inheritsLoose(FullscreenToggle,_Button);var _proto=FullscreenToggle.prototype;return _proto.buildCSSClass=function(){return"vjs-fullscreen-control "+_Button.prototype.buildCSSClass.call(this)},_proto.handleFullscreenChange=function(event){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},_proto.handleClick=function(event){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},FullscreenToggle}(Button);FullscreenToggle.prototype.controlText_="Fullscreen",Component$1.registerComponent("FullscreenToggle",FullscreenToggle);var VolumeLevel=function(_Component){function VolumeLevel(){return _Component.apply(this,arguments)||this}return inheritsLoose(VolumeLevel,_Component),VolumeLevel.prototype.createEl=function(){var el=_Component.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return el.appendChild(_Component.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),el},VolumeLevel}(Component$1);Component$1.registerComponent("VolumeLevel",VolumeLevel);var VolumeLevelTooltip=function(_Component){function VolumeLevelTooltip(player,options){var _this;return(_this=_Component.call(this,player,options)||this).update=throttle(bind(assertThisInitialized(_this),_this.update),30),_this}inheritsLoose(VolumeLevelTooltip,_Component);var _proto=VolumeLevelTooltip.prototype;return _proto.createEl=function(){return _Component.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},_proto.update=function(rangeBarRect,rangeBarPoint,vertical,content){if(!vertical){var tooltipRect=getBoundingClientRect(this.el_),playerRect=getBoundingClientRect(this.player_.el()),volumeBarPointPx=rangeBarRect.width*rangeBarPoint;if(!playerRect||!tooltipRect)return;var spaceLeftOfPoint=rangeBarRect.left-playerRect.left+volumeBarPointPx,spaceRightOfPoint=rangeBarRect.width-volumeBarPointPx+(playerRect.right-rangeBarRect.right),pullTooltipBy=tooltipRect.width/2;spaceLeftOfPointtooltipRect.width&&(pullTooltipBy=tooltipRect.width),this.el_.style.right="-"+pullTooltipBy+"px"}this.write(content+"%")},_proto.write=function(content){textContent(this.el_,content)},_proto.updateVolume=function(rangeBarRect,rangeBarPoint,vertical,volume,cb){var _this2=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(function(){_this2.update(rangeBarRect,rangeBarPoint,vertical,volume.toFixed(0)),cb&&cb()}))},VolumeLevelTooltip}(Component$1);Component$1.registerComponent("VolumeLevelTooltip",VolumeLevelTooltip);var MouseVolumeLevelDisplay=function(_Component){function MouseVolumeLevelDisplay(player,options){var _this;return(_this=_Component.call(this,player,options)||this).update=throttle(bind(assertThisInitialized(_this),_this.update),30),_this}inheritsLoose(MouseVolumeLevelDisplay,_Component);var _proto=MouseVolumeLevelDisplay.prototype;return _proto.createEl=function(){return _Component.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},_proto.update=function(rangeBarRect,rangeBarPoint,vertical){var _this2=this,volume=100*rangeBarPoint;this.getChild("volumeLevelTooltip").updateVolume(rangeBarRect,rangeBarPoint,vertical,volume,(function(){vertical?_this2.el_.style.bottom=rangeBarRect.height*rangeBarPoint+"px":_this2.el_.style.left=rangeBarRect.width*rangeBarPoint+"px"}))},MouseVolumeLevelDisplay}(Component$1);MouseVolumeLevelDisplay.prototype.options_={children:["volumeLevelTooltip"]},Component$1.registerComponent("MouseVolumeLevelDisplay",MouseVolumeLevelDisplay);var VolumeBar=function(_Slider){function VolumeBar(player,options){var _this;return(_this=_Slider.call(this,player,options)||this).on("slideractive",(function(e){return _this.updateLastVolume_(e)})),_this.on(player,"volumechange",(function(e){return _this.updateARIAAttributes(e)})),player.ready((function(){return _this.updateARIAAttributes()})),_this}inheritsLoose(VolumeBar,_Slider);var _proto=VolumeBar.prototype;return _proto.createEl=function(){return _Slider.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},_proto.handleMouseDown=function(event){isSingleLeftClick(event)&&_Slider.prototype.handleMouseDown.call(this,event)},_proto.handleMouseMove=function(event){var mouseVolumeLevelDisplay=this.getChild("mouseVolumeLevelDisplay");if(mouseVolumeLevelDisplay){var volumeBarEl=this.el(),volumeBarRect=getBoundingClientRect(volumeBarEl),vertical=this.vertical(),volumeBarPoint=getPointerPosition(volumeBarEl,event);volumeBarPoint=vertical?volumeBarPoint.y:volumeBarPoint.x,volumeBarPoint=clamp(volumeBarPoint,0,1),mouseVolumeLevelDisplay.update(volumeBarRect,volumeBarPoint,vertical)}isSingleLeftClick(event)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(event)))},_proto.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},_proto.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},_proto.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},_proto.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},_proto.updateARIAAttributes=function(event){var ariaValue=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",ariaValue),this.el_.setAttribute("aria-valuetext",ariaValue+"%")},_proto.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},_proto.updateLastVolume_=function(){var _this2=this,volumeBeforeDrag=this.player_.volume();this.one("sliderinactive",(function(){0===_this2.player_.volume()&&_this2.player_.lastVolume_(volumeBeforeDrag)}))},VolumeBar}(Slider);VolumeBar.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},IS_IOS||IS_ANDROID||VolumeBar.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),VolumeBar.prototype.playerEvent="volumechange",Component$1.registerComponent("VolumeBar",VolumeBar);var VolumeControl=function(_Component){function VolumeControl(player,options){var _this;return void 0===options&&(options={}),options.vertical=options.vertical||!1,(void 0===options.volumeBar||isPlain(options.volumeBar))&&(options.volumeBar=options.volumeBar||{},options.volumeBar.vertical=options.vertical),_this=_Component.call(this,player,options)||this,function(self,player){player.tech_&&!player.tech_.featuresVolumeControl&&self.addClass("vjs-hidden"),self.on(player,"loadstart",(function(){player.tech_.featuresVolumeControl?self.removeClass("vjs-hidden"):self.addClass("vjs-hidden")}))}(assertThisInitialized(_this),player),_this.throttledHandleMouseMove=throttle(bind(assertThisInitialized(_this),_this.handleMouseMove),30),_this.handleMouseUpHandler_=function(e){return _this.handleMouseUp(e)},_this.on("mousedown",(function(e){return _this.handleMouseDown(e)})),_this.on("touchstart",(function(e){return _this.handleMouseDown(e)})),_this.on("mousemove",(function(e){return _this.handleMouseMove(e)})),_this.on(_this.volumeBar,["focus","slideractive"],(function(){_this.volumeBar.addClass("vjs-slider-active"),_this.addClass("vjs-slider-active"),_this.trigger("slideractive")})),_this.on(_this.volumeBar,["blur","sliderinactive"],(function(){_this.volumeBar.removeClass("vjs-slider-active"),_this.removeClass("vjs-slider-active"),_this.trigger("sliderinactive")})),_this}inheritsLoose(VolumeControl,_Component);var _proto=VolumeControl.prototype;return _proto.createEl=function(){var orientationClass="vjs-volume-horizontal";return this.options_.vertical&&(orientationClass="vjs-volume-vertical"),_Component.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+orientationClass})},_proto.handleMouseDown=function(event){var doc=this.el_.ownerDocument;this.on(doc,"mousemove",this.throttledHandleMouseMove),this.on(doc,"touchmove",this.throttledHandleMouseMove),this.on(doc,"mouseup",this.handleMouseUpHandler_),this.on(doc,"touchend",this.handleMouseUpHandler_)},_proto.handleMouseUp=function(event){var doc=this.el_.ownerDocument;this.off(doc,"mousemove",this.throttledHandleMouseMove),this.off(doc,"touchmove",this.throttledHandleMouseMove),this.off(doc,"mouseup",this.handleMouseUpHandler_),this.off(doc,"touchend",this.handleMouseUpHandler_)},_proto.handleMouseMove=function(event){this.volumeBar.handleMouseMove(event)},VolumeControl}(Component$1);VolumeControl.prototype.options_={children:["volumeBar"]},Component$1.registerComponent("VolumeControl",VolumeControl);var MuteToggle=function(_Button){function MuteToggle(player,options){var _this;return _this=_Button.call(this,player,options)||this,function(self,player){player.tech_&&!player.tech_.featuresMuteControl&&self.addClass("vjs-hidden"),self.on(player,"loadstart",(function(){player.tech_.featuresMuteControl?self.removeClass("vjs-hidden"):self.addClass("vjs-hidden")}))}(assertThisInitialized(_this),player),_this.on(player,["loadstart","volumechange"],(function(e){return _this.update(e)})),_this}inheritsLoose(MuteToggle,_Button);var _proto=MuteToggle.prototype;return _proto.buildCSSClass=function(){return"vjs-mute-control "+_Button.prototype.buildCSSClass.call(this)},_proto.handleClick=function(event){var vol=this.player_.volume(),lastVolume=this.player_.lastVolume_();if(0===vol){var volumeToSet=lastVolume<.1?.1:lastVolume;this.player_.volume(volumeToSet),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},_proto.update=function(event){this.updateIcon_(),this.updateControlText_()},_proto.updateIcon_=function(){var vol=this.player_.volume(),level=3;IS_IOS&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===vol||this.player_.muted()?level=0:vol<.33?level=1:vol<.67&&(level=2);for(var i=0;i<4;i++)removeClass(this.el_,"vjs-vol-"+i);addClass(this.el_,"vjs-vol-"+level)},_proto.updateControlText_=function(){var text=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==text&&this.controlText(text)},MuteToggle}(Button);MuteToggle.prototype.controlText_="Mute",Component$1.registerComponent("MuteToggle",MuteToggle);var VolumePanel=function(_Component){function VolumePanel(player,options){var _this;return void 0===options&&(options={}),void 0!==options.inline?options.inline=options.inline:options.inline=!0,(void 0===options.volumeControl||isPlain(options.volumeControl))&&(options.volumeControl=options.volumeControl||{},options.volumeControl.vertical=!options.inline),(_this=_Component.call(this,player,options)||this).handleKeyPressHandler_=function(e){return _this.handleKeyPress(e)},_this.on(player,["loadstart"],(function(e){return _this.volumePanelState_(e)})),_this.on(_this.muteToggle,"keyup",(function(e){return _this.handleKeyPress(e)})),_this.on(_this.volumeControl,"keyup",(function(e){return _this.handleVolumeControlKeyUp(e)})),_this.on("keydown",(function(e){return _this.handleKeyPress(e)})),_this.on("mouseover",(function(e){return _this.handleMouseOver(e)})),_this.on("mouseout",(function(e){return _this.handleMouseOut(e)})),_this.on(_this.volumeControl,["slideractive"],_this.sliderActive_),_this.on(_this.volumeControl,["sliderinactive"],_this.sliderInactive_),_this}inheritsLoose(VolumePanel,_Component);var _proto=VolumePanel.prototype;return _proto.sliderActive_=function(){this.addClass("vjs-slider-active")},_proto.sliderInactive_=function(){this.removeClass("vjs-slider-active")},_proto.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},_proto.createEl=function(){var orientationClass="vjs-volume-panel-horizontal";return this.options_.inline||(orientationClass="vjs-volume-panel-vertical"),_Component.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+orientationClass})},_proto.dispose=function(){this.handleMouseOut(),_Component.prototype.dispose.call(this)},_proto.handleVolumeControlKeyUp=function(event){keycode.isEventKey(event,"Esc")&&this.muteToggle.focus()},_proto.handleMouseOver=function(event){this.addClass("vjs-hover"),on(document,"keyup",this.handleKeyPressHandler_)},_proto.handleMouseOut=function(event){this.removeClass("vjs-hover"),off(document,"keyup",this.handleKeyPressHandler_)},_proto.handleKeyPress=function(event){keycode.isEventKey(event,"Esc")&&this.handleMouseOut()},VolumePanel}(Component$1);VolumePanel.prototype.options_={children:["muteToggle","volumeControl"]},Component$1.registerComponent("VolumePanel",VolumePanel);var Menu=function(_Component){function Menu(player,options){var _this;return _this=_Component.call(this,player,options)||this,options&&(_this.menuButton_=options.menuButton),_this.focusedChild_=-1,_this.on("keydown",(function(e){return _this.handleKeyDown(e)})),_this.boundHandleBlur_=function(e){return _this.handleBlur(e)},_this.boundHandleTapClick_=function(e){return _this.handleTapClick(e)},_this}inheritsLoose(Menu,_Component);var _proto=Menu.prototype;return _proto.addEventListenerForItem=function(component){component instanceof Component$1&&(this.on(component,"blur",this.boundHandleBlur_),this.on(component,["tap","click"],this.boundHandleTapClick_))},_proto.removeEventListenerForItem=function(component){component instanceof Component$1&&(this.off(component,"blur",this.boundHandleBlur_),this.off(component,["tap","click"],this.boundHandleTapClick_))},_proto.removeChild=function(component){"string"==typeof component&&(component=this.getChild(component)),this.removeEventListenerForItem(component),_Component.prototype.removeChild.call(this,component)},_proto.addItem=function(component){var childComponent=this.addChild(component);childComponent&&this.addEventListenerForItem(childComponent)},_proto.createEl=function(){var contentElType=this.options_.contentElType||"ul";this.contentEl_=createEl(contentElType,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var el=_Component.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return el.appendChild(this.contentEl_),on(el,"click",(function(event){event.preventDefault(),event.stopImmediatePropagation()})),el},_proto.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,_Component.prototype.dispose.call(this)},_proto.handleBlur=function(event){var relatedTarget=event.relatedTarget||document.activeElement;if(!this.children().some((function(element){return element.el()===relatedTarget}))){var btn=this.menuButton_;btn&&btn.buttonPressed_&&relatedTarget!==btn.el().firstChild&&btn.unpressButton()}},_proto.handleTapClick=function(event){if(this.menuButton_){this.menuButton_.unpressButton();var childComponents=this.children();if(!Array.isArray(childComponents))return;var foundComponent=childComponents.filter((function(component){return component.el()===event.target}))[0];if(!foundComponent)return;"CaptionSettingsMenuItem"!==foundComponent.name()&&this.menuButton_.focus()}},_proto.handleKeyDown=function(event){keycode.isEventKey(event,"Left")||keycode.isEventKey(event,"Down")?(event.preventDefault(),event.stopPropagation(),this.stepForward()):(keycode.isEventKey(event,"Right")||keycode.isEventKey(event,"Up"))&&(event.preventDefault(),event.stopPropagation(),this.stepBack())},_proto.stepForward=function(){var stepChild=0;void 0!==this.focusedChild_&&(stepChild=this.focusedChild_+1),this.focus(stepChild)},_proto.stepBack=function(){var stepChild=0;void 0!==this.focusedChild_&&(stepChild=this.focusedChild_-1),this.focus(stepChild)},_proto.focus=function(item){void 0===item&&(item=0);var children=this.children().slice();children.length&&children[0].hasClass("vjs-menu-title")&&children.shift(),children.length>0&&(item<0?item=0:item>=children.length&&(item=children.length-1),this.focusedChild_=item,children[item].el_.focus())},Menu}(Component$1);Component$1.registerComponent("Menu",Menu);var MenuButton=function(_Component){function MenuButton(player,options){var _this;void 0===options&&(options={}),(_this=_Component.call(this,player,options)||this).menuButton_=new Button(player,options),_this.menuButton_.controlText(_this.controlText_),_this.menuButton_.el_.setAttribute("aria-haspopup","true");var buttonClass=Button.prototype.buildCSSClass();_this.menuButton_.el_.className=_this.buildCSSClass()+" "+buttonClass,_this.menuButton_.removeClass("vjs-control"),_this.addChild(_this.menuButton_),_this.update(),_this.enabled_=!0;var handleClick=function(e){return _this.handleClick(e)};return _this.handleMenuKeyUp_=function(e){return _this.handleMenuKeyUp(e)},_this.on(_this.menuButton_,"tap",handleClick),_this.on(_this.menuButton_,"click",handleClick),_this.on(_this.menuButton_,"keydown",(function(e){return _this.handleKeyDown(e)})),_this.on(_this.menuButton_,"mouseenter",(function(){_this.addClass("vjs-hover"),_this.menu.show(),on(document,"keyup",_this.handleMenuKeyUp_)})),_this.on("mouseleave",(function(e){return _this.handleMouseLeave(e)})),_this.on("keydown",(function(e){return _this.handleSubmenuKeyDown(e)})),_this}inheritsLoose(MenuButton,_Component);var _proto=MenuButton.prototype;return _proto.update=function(){var menu=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=menu,this.addChild(menu),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))},_proto.createMenu=function(){var menu=new Menu(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var titleEl=createEl("li",{className:"vjs-menu-title",textContent:toTitleCase$1(this.options_.title),tabIndex:-1}),titleComponent=new Component$1(this.player_,{el:titleEl});menu.addItem(titleComponent)}if(this.items=this.createItems(),this.items)for(var i=0;i-1&&"showing"===track.mode){shouldBeSelected=!1;break}}shouldBeSelected!==this.isSelected_&&this.selected(shouldBeSelected)},_proto.handleSelectedLanguageChange=function(event){for(var tracks=this.player().textTracks(),allHidden=!0,i=0,l=tracks.length;i-1&&"showing"===track.mode){allHidden=!1;break}}allHidden&&(this.player_.cache_.selectedLanguage={enabled:!1})},OffTextTrackMenuItem}(TextTrackMenuItem);Component$1.registerComponent("OffTextTrackMenuItem",OffTextTrackMenuItem);var TextTrackButton=function(_TrackButton){function TextTrackButton(player,options){return void 0===options&&(options={}),options.tracks=player.textTracks(),_TrackButton.call(this,player,options)||this}return inheritsLoose(TextTrackButton,_TrackButton),TextTrackButton.prototype.createItems=function(items,TrackMenuItem){var label;void 0===items&&(items=[]),void 0===TrackMenuItem&&(TrackMenuItem=TextTrackMenuItem),this.label_&&(label=this.label_+" off"),items.push(new OffTextTrackMenuItem(this.player_,{kinds:this.kinds_,kind:this.kind_,label:label})),this.hideThreshold_+=1;var tracks=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var i=0;i-1){var item=new TrackMenuItem(this.player_,{track:track,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});item.addClass("vjs-"+track.kind+"-menu-item"),items.push(item)}}return items},TextTrackButton}(TrackButton);Component$1.registerComponent("TextTrackButton",TextTrackButton);var ChaptersTrackMenuItem=function(_MenuItem){function ChaptersTrackMenuItem(player,options){var _this,track=options.track,cue=options.cue,currentTime=player.currentTime();return options.selectable=!0,options.multiSelectable=!1,options.label=cue.text,options.selected=cue.startTime<=currentTime&¤tTime=0;i--){var track=tracks[i];if(track.kind===this.kind_)return track}},_proto.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(toTitleCase$1(this.kind_))},_proto.createMenu=function(){return this.options_.title=this.getMenuCaption(),_TextTrackButton.prototype.createMenu.call(this)},_proto.createItems=function(){var items=[];if(!this.track_)return items;var cues=this.track_.cues;if(!cues)return items;for(var i=0,l=cues.length;i-1&&(_this.label_="captions"),_this.menuButton_.controlText(toTitleCase$1(_this.label_)),_this}inheritsLoose(SubsCapsButton,_TextTrackButton);var _proto=SubsCapsButton.prototype;return _proto.buildCSSClass=function(){return"vjs-subs-caps-button "+_TextTrackButton.prototype.buildCSSClass.call(this)},_proto.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+_TextTrackButton.prototype.buildWrapperCSSClass.call(this)},_proto.createItems=function(){var items=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(items.push(new CaptionSettingsMenuItem(this.player_,{kind:this.label_})),this.hideThreshold_+=1),items=_TextTrackButton.prototype.createItems.call(this,items,SubsCapsMenuItem)},SubsCapsButton}(TextTrackButton);SubsCapsButton.prototype.kinds_=["captions","subtitles"],SubsCapsButton.prototype.controlText_="Subtitles",Component$1.registerComponent("SubsCapsButton",SubsCapsButton);var AudioTrackMenuItem=function(_MenuItem){function AudioTrackMenuItem(player,options){var _this,track=options.track,tracks=player.audioTracks();options.label=track.label||track.language||"Unknown",options.selected=track.enabled,(_this=_MenuItem.call(this,player,options)||this).track=track,_this.addClass("vjs-"+track.kind+"-menu-item");var changeHandler=function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];_this.handleTracksChange.apply(assertThisInitialized(_this),args)};return tracks.addEventListener("change",changeHandler),_this.on("dispose",(function(){tracks.removeEventListener("change",changeHandler)})),_this}inheritsLoose(AudioTrackMenuItem,_MenuItem);var _proto=AudioTrackMenuItem.prototype;return _proto.createEl=function(type,props,attrs){var el=_MenuItem.prototype.createEl.call(this,type,props,attrs),parentSpan=el.querySelector(".vjs-menu-item-text");return"main-desc"===this.options_.track.kind&&(parentSpan.appendChild(createEl("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),parentSpan.appendChild(createEl("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),el},_proto.handleClick=function(event){if(_MenuItem.prototype.handleClick.call(this,event),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks)for(var tracks=this.player_.audioTracks(),i=0;i=0;i--)items.push(new PlaybackRateMenuItem(this.player(),{rate:rates[i]+"x"}));return items},_proto.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},_proto.handleClick=function(event){var currentRate=this.player().playbackRate(),rates=this.playbackRates(),newIndex=(rates.indexOf(currentRate)+1)%rates.length;this.player().playbackRate(rates[newIndex])},_proto.handlePlaybackRateschange=function(event){this.update()},_proto.playbackRates=function(){var player=this.player();return player.playbackRates&&player.playbackRates()||[]},_proto.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},_proto.updateVisibility=function(event){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},_proto.updateLabel=function(event){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},PlaybackRateMenuButton}(MenuButton);PlaybackRateMenuButton.prototype.controlText_="Playback Rate",Component$1.registerComponent("PlaybackRateMenuButton",PlaybackRateMenuButton);var Spacer=function(_Component){function Spacer(){return _Component.apply(this,arguments)||this}inheritsLoose(Spacer,_Component);var _proto=Spacer.prototype;return _proto.buildCSSClass=function(){return"vjs-spacer "+_Component.prototype.buildCSSClass.call(this)},_proto.createEl=function(tag,props,attributes){return void 0===tag&&(tag="div"),void 0===props&&(props={}),void 0===attributes&&(attributes={}),props.className||(props.className=this.buildCSSClass()),_Component.prototype.createEl.call(this,tag,props,attributes)},Spacer}(Component$1);Component$1.registerComponent("Spacer",Spacer);var CustomControlSpacer=function(_Spacer){function CustomControlSpacer(){return _Spacer.apply(this,arguments)||this}inheritsLoose(CustomControlSpacer,_Spacer);var _proto=CustomControlSpacer.prototype;return _proto.buildCSSClass=function(){return"vjs-custom-control-spacer "+_Spacer.prototype.buildCSSClass.call(this)},_proto.createEl=function(){return _Spacer.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "})},CustomControlSpacer}(Spacer);Component$1.registerComponent("CustomControlSpacer",CustomControlSpacer);var ControlBar=function(_Component){function ControlBar(){return _Component.apply(this,arguments)||this}return inheritsLoose(ControlBar,_Component),ControlBar.prototype.createEl=function(){return _Component.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},ControlBar}(Component$1);ControlBar.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in document&&ControlBar.prototype.options_.children.splice(ControlBar.prototype.options_.children.length-1,0,"pictureInPictureToggle"),Component$1.registerComponent("ControlBar",ControlBar);var ErrorDisplay=function(_ModalDialog){function ErrorDisplay(player,options){var _this;return(_this=_ModalDialog.call(this,player,options)||this).on(player,"error",(function(e){return _this.open(e)})),_this}inheritsLoose(ErrorDisplay,_ModalDialog);var _proto=ErrorDisplay.prototype;return _proto.buildCSSClass=function(){return"vjs-error-display "+_ModalDialog.prototype.buildCSSClass.call(this)},_proto.content=function(){var error=this.player().error();return error?this.localize(error.message):""},ErrorDisplay}(ModalDialog);ErrorDisplay.prototype.options_=_extends_1({},ModalDialog.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Component$1.registerComponent("ErrorDisplay",ErrorDisplay);var COLOR_BLACK=["#000","Black"],COLOR_BLUE=["#00F","Blue"],COLOR_CYAN=["#0FF","Cyan"],COLOR_GREEN=["#0F0","Green"],COLOR_MAGENTA=["#F0F","Magenta"],COLOR_RED=["#F00","Red"],COLOR_WHITE=["#FFF","White"],COLOR_YELLOW=["#FF0","Yellow"],OPACITY_OPAQUE=["1","Opaque"],OPACITY_SEMI=["0.5","Semi-Transparent"],OPACITY_TRANS=["0","Transparent"],selectConfigs={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[COLOR_BLACK,COLOR_WHITE,COLOR_RED,COLOR_GREEN,COLOR_BLUE,COLOR_YELLOW,COLOR_MAGENTA,COLOR_CYAN]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[OPACITY_OPAQUE,OPACITY_SEMI,OPACITY_TRANS]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[COLOR_WHITE,COLOR_BLACK,COLOR_RED,COLOR_GREEN,COLOR_BLUE,COLOR_YELLOW,COLOR_MAGENTA,COLOR_CYAN]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(v){return"1.00"===v?null:Number(v)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[OPACITY_OPAQUE,OPACITY_SEMI]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[OPACITY_TRANS,OPACITY_SEMI,OPACITY_OPAQUE]}};function parseOptionValue(value,parser){if(parser&&(value=parser(value)),value&&"none"!==value)return value}selectConfigs.windowColor.options=selectConfigs.backgroundColor.options;var TextTrackSettings=function(_ModalDialog){function TextTrackSettings(player,options){var _this;return options.temporary=!1,(_this=_ModalDialog.call(this,player,options)||this).updateDisplay=_this.updateDisplay.bind(assertThisInitialized(_this)),_this.fill(),_this.hasBeenOpened_=_this.hasBeenFilled_=!0,_this.endDialog=createEl("p",{className:"vjs-control-text",textContent:_this.localize("End of dialog window.")}),_this.el().appendChild(_this.endDialog),_this.setDefaults(),void 0===options.persistTextTrackSettings&&(_this.options_.persistTextTrackSettings=_this.options_.playerOptions.persistTextTrackSettings),_this.on(_this.$(".vjs-done-button"),"click",(function(){_this.saveSettings(),_this.close()})),_this.on(_this.$(".vjs-default-button"),"click",(function(){_this.setDefaults(),_this.updateDisplay()})),each(selectConfigs,(function(config){_this.on(_this.$(config.selector),"change",_this.updateDisplay)})),_this.options_.persistTextTrackSettings&&_this.restoreSettings(),_this}inheritsLoose(TextTrackSettings,_ModalDialog);var _proto=TextTrackSettings.prototype;return _proto.dispose=function(){this.endDialog=null,_ModalDialog.prototype.dispose.call(this)},_proto.createElSelect_=function(key,legendId,type){var _this2=this;void 0===legendId&&(legendId=""),void 0===type&&(type="label");var config=selectConfigs[key],id=config.id.replace("%s",this.id_),selectLabelledbyIds=[legendId,id].join(" ").trim();return["<"+type+' id="'+id+'" class="'+("label"===type?"vjs-label":"")+'">',this.localize(config.label),""+type+">",'").join("")},_proto.createElFgColor_=function(){var legendId="captions-text-legend-"+this.id_;return['"].join("")},_proto.createElBgColor_=function(){var legendId="captions-background-"+this.id_;return['"].join("")},_proto.createElWinColor_=function(){var legendId="captions-window-"+this.id_;return['"].join("")},_proto.createElColors_=function(){return createEl("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},_proto.createElFont_=function(){return createEl("div",{className:"vjs-track-settings-font",innerHTML:['",'",'"].join("")})},_proto.createElControls_=function(){var defaultsDescription=this.localize("restore all settings to the default values");return createEl("div",{className:"vjs-track-settings-controls",innerHTML:['",'"].join("")})},_proto.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},_proto.label=function(){return this.localize("Caption Settings Dialog")},_proto.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},_proto.buildCSSClass=function(){return _ModalDialog.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},_proto.getValues=function(){var object,fn,initial,_this3=this;return fn=function(accum,config,key){var el,parser,value=(el=_this3.$(config.selector),parser=config.parser,parseOptionValue(el.options[el.options.selectedIndex].value,parser));return void 0!==value&&(accum[key]=value),accum},void 0===(initial={})&&(initial=0),keys(object=selectConfigs).reduce((function(accum,key){return fn(accum,object[key],key)}),initial)},_proto.setValues=function(values){var _this4=this;each(selectConfigs,(function(config,key){!function(el,value,parser){if(value)for(var i=0;ithis.options_.liveTolerance;this.timeupdateSeen_&&liveCurrentTime!==1/0||(isBehind=!1),isBehind!==this.behindLiveEdge_&&(this.behindLiveEdge_=isBehind,this.trigger("liveedgechange"))}},_proto.handleDurationchange=function(){this.toggleTracking()},_proto.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},_proto.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},_proto.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},_proto.handleSeeked=function(){var timeDiff=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&timeDiff>2,this.nextSeekedFromUser_=!1,this.trackLive_()},_proto.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},_proto.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},_proto.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},_proto.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},_proto.seekableEnd=function(){for(var seekable=this.player_.seekable(),seekableEnds=[],i=seekable?seekable.length:0;i--;)seekableEnds.push(seekable.end(i));return seekableEnds.length?seekableEnds.sort()[seekableEnds.length-1]:1/0},_proto.seekableStart=function(){for(var seekable=this.player_.seekable(),seekableStarts=[],i=seekable?seekable.length:0;i--;)seekableStarts.push(seekable.start(i));return seekableStarts.length?seekableStarts.sort()[0]:0},_proto.liveWindow=function(){var liveCurrentTime=this.liveCurrentTime();return liveCurrentTime===1/0?0:liveCurrentTime-this.seekableStart()},_proto.isLive=function(){return this.isTracking()},_proto.atLiveEdge=function(){return!this.behindLiveEdge()},_proto.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},_proto.pastSeekEnd=function(){var seekableEnd=this.seekableEnd();return-1!==this.lastSeekEnd_&&seekableEnd!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=seekableEnd,this.pastSeekEnd_},_proto.behindLiveEdge=function(){return this.behindLiveEdge_},_proto.isTracking=function(){return"number"==typeof this.trackingInterval_},_proto.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},_proto.dispose=function(){this.off(document,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),_Component.prototype.dispose.call(this)},LiveTracker}(Component$1);Component$1.registerComponent("LiveTracker",LiveTracker);var canPlayType,sourcesetLoad=function(tech){var el=tech.el();if(el.hasAttribute("src"))return tech.triggerSourceset(el.src),!0;var sources=tech.$$("source"),srcUrls=[],src="";if(!sources.length)return!1;for(var i=0;i=2&&eventsToTrigger.push("loadeddata"),el.readyState>=3&&eventsToTrigger.push("canplay"),el.readyState>=4&&eventsToTrigger.push("canplaythrough"),this.ready((function(){eventsToTrigger.forEach((function(type){this.trigger(type)}),this)}))}},_proto.setScrubbing=function(isScrubbing){this.isScrubbing_=isScrubbing},_proto.scrubbing=function(){return this.isScrubbing_},_proto.setCurrentTime=function(seconds){try{this.isScrubbing_&&this.el_.fastSeek&&IS_ANY_SAFARI?this.el_.fastSeek(seconds):this.el_.currentTime=seconds}catch(e){log$1(e,"Video is not ready. (Video.js)")}},_proto.duration=function(){var _this5=this;if(this.el_.duration===1/0&&IS_ANDROID&&IS_CHROME&&0===this.el_.currentTime){return this.on("timeupdate",(function checkProgress(){_this5.el_.currentTime>0&&(_this5.el_.duration===1/0&&_this5.trigger("durationchange"),_this5.off("timeupdate",checkProgress))})),NaN}return this.el_.duration||NaN},_proto.width=function(){return this.el_.offsetWidth},_proto.height=function(){return this.el_.offsetHeight},_proto.proxyWebkitFullscreen_=function(){var _this6=this;if("webkitDisplayingFullscreen"in this.el_){var endFn=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},beginFn=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",endFn),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",beginFn),this.on("dispose",(function(){_this6.off("webkitbeginfullscreen",beginFn),_this6.off("webkitendfullscreen",endFn)}))}},_proto.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var userAgent=window.navigator&&window.navigator.userAgent||"";if(/Android/.test(userAgent)||!/Chrome|Mac OS X 10.5/.test(userAgent))return!0}return!1},_proto.enterFullScreen=function(){var video=this.el_;if(video.paused&&video.networkState<=video.HAVE_METADATA)silencePromise(this.el_.play()),this.setTimeout((function(){video.pause();try{video.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}),0);else try{video.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},_proto.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},_proto.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},_proto.requestVideoFrameCallback=function(cb){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(cb):_Tech.prototype.requestVideoFrameCallback.call(this,cb)},_proto.cancelVideoFrameCallback=function(id){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(id):_Tech.prototype.cancelVideoFrameCallback.call(this,id)},_proto.src=function(_src){if(void 0===_src)return this.el_.src;this.setSrc(_src)},_proto.reset=function(){Html5.resetMediaElement(this.el_)},_proto.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},_proto.setControls=function(val){this.el_.controls=!!val},_proto.addTextTrack=function(kind,label,language){return this.featuresNativeTextTracks?this.el_.addTextTrack(kind,label,language):_Tech.prototype.addTextTrack.call(this,kind,label,language)},_proto.createRemoteTextTrack=function(options){if(!this.featuresNativeTextTracks)return _Tech.prototype.createRemoteTextTrack.call(this,options);var htmlTrackElement=document.createElement("track");return options.kind&&(htmlTrackElement.kind=options.kind),options.label&&(htmlTrackElement.label=options.label),(options.language||options.srclang)&&(htmlTrackElement.srclang=options.language||options.srclang),options.default&&(htmlTrackElement.default=options.default),options.id&&(htmlTrackElement.id=options.id),options.src&&(htmlTrackElement.src=options.src),htmlTrackElement},_proto.addRemoteTextTrack=function(options,manualCleanup){var htmlTrackElement=_Tech.prototype.addRemoteTextTrack.call(this,options,manualCleanup);return this.featuresNativeTextTracks&&this.el().appendChild(htmlTrackElement),htmlTrackElement},_proto.removeRemoteTextTrack=function(track){if(_Tech.prototype.removeRemoteTextTrack.call(this,track),this.featuresNativeTextTracks)for(var tracks=this.$$("track"),i=tracks.length;i--;)track!==tracks[i]&&track!==tracks[i].track||this.el().removeChild(tracks[i])},_proto.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var videoPlaybackQuality={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(videoPlaybackQuality.droppedVideoFrames=this.el().webkitDroppedFrameCount,videoPlaybackQuality.totalVideoFrames=this.el().webkitDecodedFrameCount),window.performance&&"function"==typeof window.performance.now?videoPlaybackQuality.creationTime=window.performance.now():window.performance&&window.performance.timing&&"number"==typeof window.performance.timing.navigationStart&&(videoPlaybackQuality.creationTime=window.Date.now()-window.performance.timing.navigationStart),videoPlaybackQuality},Html5}(Tech);defineLazyProperty(Html5,"TEST_VID",(function(){if(isReal()){var video=document.createElement("video"),track=document.createElement("track");return track.kind="captions",track.srclang="en",track.label="English",video.appendChild(track),video}})),Html5.isSupported=function(){try{Html5.TEST_VID.volume=.5}catch(e){return!1}return!(!Html5.TEST_VID||!Html5.TEST_VID.canPlayType)},Html5.canPlayType=function(type){return Html5.TEST_VID.canPlayType(type)},Html5.canPlaySource=function(srcObj,options){return Html5.canPlayType(srcObj.type)},Html5.canControlVolume=function(){try{var volume=Html5.TEST_VID.volume;Html5.TEST_VID.volume=volume/2+.1;var canControl=volume!==Html5.TEST_VID.volume;return canControl&&IS_IOS?(window.setTimeout((function(){Html5&&Html5.prototype&&(Html5.prototype.featuresVolumeControl=volume!==Html5.TEST_VID.volume)})),!1):canControl}catch(e){return!1}},Html5.canMuteVolume=function(){try{var muted=Html5.TEST_VID.muted;return Html5.TEST_VID.muted=!muted,Html5.TEST_VID.muted?setAttribute(Html5.TEST_VID,"muted","muted"):removeAttribute(Html5.TEST_VID,"muted"),muted!==Html5.TEST_VID.muted}catch(e){return!1}},Html5.canControlPlaybackRate=function(){if(IS_ANDROID&&IS_CHROME&&CHROME_VERSION<58)return!1;try{var playbackRate=Html5.TEST_VID.playbackRate;return Html5.TEST_VID.playbackRate=playbackRate/2+.1,playbackRate!==Html5.TEST_VID.playbackRate}catch(e){return!1}},Html5.canOverrideAttributes=function(){try{var noop=function(){};Object.defineProperty(document.createElement("video"),"src",{get:noop,set:noop}),Object.defineProperty(document.createElement("audio"),"src",{get:noop,set:noop}),Object.defineProperty(document.createElement("video"),"innerHTML",{get:noop,set:noop}),Object.defineProperty(document.createElement("audio"),"innerHTML",{get:noop,set:noop})}catch(e){return!1}return!0},Html5.supportsNativeTextTracks=function(){return IS_ANY_SAFARI||IS_IOS&&IS_CHROME},Html5.supportsNativeVideoTracks=function(){return!(!Html5.TEST_VID||!Html5.TEST_VID.videoTracks)},Html5.supportsNativeAudioTracks=function(){return!(!Html5.TEST_VID||!Html5.TEST_VID.audioTracks)},Html5.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function(_ref){var key=_ref[0],fn=_ref[1];defineLazyProperty(Html5.prototype,key,(function(){return Html5[fn]()}),!0)})),Html5.prototype.featuresVolumeControl=Html5.canControlVolume(),Html5.prototype.movingMediaElementInDOM=!IS_IOS,Html5.prototype.featuresFullscreenResize=!0,Html5.prototype.featuresProgressEvents=!0,Html5.prototype.featuresTimeupdateEvents=!0,Html5.prototype.featuresVideoFrameCallback=!(!Html5.TEST_VID||!Html5.TEST_VID.requestVideoFrameCallback),Html5.patchCanPlayType=function(){ANDROID_VERSION>=4&&!IS_FIREFOX&&!IS_CHROME&&(canPlayType=Html5.TEST_VID&&Html5.TEST_VID.constructor.prototype.canPlayType,Html5.TEST_VID.constructor.prototype.canPlayType=function(type){return type&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(type)?"maybe":canPlayType.call(this,type)})},Html5.unpatchCanPlayType=function(){var r=Html5.TEST_VID.constructor.prototype.canPlayType;return canPlayType&&(Html5.TEST_VID.constructor.prototype.canPlayType=canPlayType),r},Html5.patchCanPlayType(),Html5.disposeMediaElement=function(el){if(el){for(el.parentNode&&el.parentNode.removeChild(el);el.hasChildNodes();)el.removeChild(el.firstChild);el.removeAttribute("src"),"function"==typeof el.load&&function(){try{el.load()}catch(e){}}()}},Html5.resetMediaElement=function(el){if(el){for(var sources=el.querySelectorAll("source"),i=sources.length;i--;)el.removeChild(sources[i]);el.removeAttribute("src"),"function"==typeof el.load&&function(){try{el.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(prop){Html5.prototype[prop]=function(){return this.el_[prop]||this.el_.hasAttribute(prop)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(prop){Html5.prototype["set"+toTitleCase$1(prop)]=function(v){this.el_[prop]=v,v?this.el_.setAttribute(prop,prop):this.el_.removeAttribute(prop)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach((function(prop){Html5.prototype[prop]=function(){return this.el_[prop]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(prop){Html5.prototype["set"+toTitleCase$1(prop)]=function(v){this.el_[prop]=v}})),["pause","load","play"].forEach((function(prop){Html5.prototype[prop]=function(){return this.el_[prop]()}})),Tech.withSourceHandlers(Html5),Html5.nativeSourceHandler={},Html5.nativeSourceHandler.canPlayType=function(type){try{return Html5.TEST_VID.canPlayType(type)}catch(e){return""}},Html5.nativeSourceHandler.canHandleSource=function(source,options){if(source.type)return Html5.nativeSourceHandler.canPlayType(source.type);if(source.src){var ext=getFileExtension(source.src);return Html5.nativeSourceHandler.canPlayType("video/"+ext)}return""},Html5.nativeSourceHandler.handleSource=function(source,tech,options){tech.setSrc(source.src)},Html5.nativeSourceHandler.dispose=function(){},Html5.registerSourceHandler(Html5.nativeSourceHandler),Tech.registerTech("Html5",Html5);var TECH_EVENTS_RETRIGGER=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],TECH_EVENTS_QUEUE={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},BREAKPOINT_ORDER=["tiny","xsmall","small","medium","large","xlarge","huge"],BREAKPOINT_CLASSES={};BREAKPOINT_ORDER.forEach((function(k){var v="x"===k.charAt(0)?"x-"+k.substring(1):k;BREAKPOINT_CLASSES[k]="vjs-layout-"+v}));var DEFAULT_BREAKPOINTS={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Player=function(_Component){function Player(tag,options,ready){var _this;if(tag.id=tag.id||options.id||"vjs_video_"+newGUID(),(options=assign(Player.getTagSettings(tag),options)).initChildren=!1,options.createEl=!1,options.evented=!1,options.reportTouchActivity=!1,!options.language)if("function"==typeof tag.closest){var closest=tag.closest("[lang]");closest&&closest.getAttribute&&(options.language=closest.getAttribute("lang"))}else for(var element=tag;element&&1===element.nodeType;){if(getAttributes(element).hasOwnProperty("lang")){options.language=element.getAttribute("lang");break}element=element.parentNode}if((_this=_Component.call(this,null,options,ready)||this).boundDocumentFullscreenChange_=function(e){return _this.documentFullscreenChange_(e)},_this.boundFullWindowOnEscKey_=function(e){return _this.fullWindowOnEscKey(e)},_this.boundUpdateStyleEl_=function(e){return _this.updateStyleEl_(e)},_this.boundApplyInitTime_=function(e){return _this.applyInitTime_(e)},_this.boundUpdateCurrentBreakpoint_=function(e){return _this.updateCurrentBreakpoint_(e)},_this.boundHandleTechClick_=function(e){return _this.handleTechClick_(e)},_this.boundHandleTechDoubleClick_=function(e){return _this.handleTechDoubleClick_(e)},_this.boundHandleTechTouchStart_=function(e){return _this.handleTechTouchStart_(e)},_this.boundHandleTechTouchMove_=function(e){return _this.handleTechTouchMove_(e)},_this.boundHandleTechTouchEnd_=function(e){return _this.handleTechTouchEnd_(e)},_this.boundHandleTechTap_=function(e){return _this.handleTechTap_(e)},_this.isFullscreen_=!1,_this.log=createLogger(_this.id_),_this.fsApi_=FullscreenApi,_this.isPosterFromTech_=!1,_this.queuedCallbacks_=[],_this.isReady_=!1,_this.hasStarted_=!1,_this.userActive_=!1,_this.debugEnabled_=!1,_this.audioOnlyMode_=!1,_this.audioPosterMode_=!1,_this.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!_this.options_||!_this.options_.techOrder||!_this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(_this.tag=tag,_this.tagAttributes=tag&&getAttributes(tag),_this.language(_this.options_.language),options.languages){var languagesToLower={};Object.getOwnPropertyNames(options.languages).forEach((function(name){languagesToLower[name.toLowerCase()]=options.languages[name]})),_this.languages_=languagesToLower}else _this.languages_=Player.prototype.options_.languages;_this.resetCache_(),_this.poster_=options.poster||"",_this.controls_=!!options.controls,tag.controls=!1,tag.removeAttribute("controls"),_this.changingSrc_=!1,_this.playCallbacks_=[],_this.playTerminatedQueue_=[],tag.hasAttribute("autoplay")?_this.autoplay(!0):_this.autoplay(_this.options_.autoplay),options.plugins&&Object.keys(options.plugins).forEach((function(name){if("function"!=typeof _this[name])throw new Error('plugin "'+name+'" does not exist')})),_this.scrubbing_=!1,_this.el_=_this.createEl(),evented(assertThisInitialized(_this),{eventBusKey:"el_"}),_this.fsApi_.requestFullscreen&&(on(document,_this.fsApi_.fullscreenchange,_this.boundDocumentFullscreenChange_),_this.on(_this.fsApi_.fullscreenchange,_this.boundDocumentFullscreenChange_)),_this.fluid_&&_this.on(["playerreset","resize"],_this.boundUpdateStyleEl_);var playerOptionsCopy=mergeOptions$3(_this.options_);options.plugins&&Object.keys(options.plugins).forEach((function(name){_this[name](options.plugins[name])})),options.debug&&_this.debug(!0),_this.options_.playerOptions=playerOptionsCopy,_this.middleware_=[],_this.playbackRates(options.playbackRates),_this.initChildren(),_this.isAudio("audio"===tag.nodeName.toLowerCase()),_this.controls()?_this.addClass("vjs-controls-enabled"):_this.addClass("vjs-controls-disabled"),_this.el_.setAttribute("role","region"),_this.isAudio()?_this.el_.setAttribute("aria-label",_this.localize("Audio Player")):_this.el_.setAttribute("aria-label",_this.localize("Video Player")),_this.isAudio()&&_this.addClass("vjs-audio"),_this.flexNotSupported_()&&_this.addClass("vjs-no-flex"),TOUCH_ENABLED&&_this.addClass("vjs-touch-enabled"),IS_IOS||_this.addClass("vjs-workinghover"),Player.players[_this.id_]=assertThisInitialized(_this);var majorVersion="7.20.3".split(".")[0];return _this.addClass("vjs-v"+majorVersion),_this.userActive(!0),_this.reportUserActivity(),_this.one("play",(function(e){return _this.listenForUserActivity_(e)})),_this.on("stageclick",(function(e){return _this.handleStageClick_(e)})),_this.on("keydown",(function(e){return _this.handleKeyDown(e)})),_this.on("languagechange",(function(e){return _this.handleLanguagechange(e)})),_this.breakpoints(_this.options_.breakpoints),_this.responsive(_this.options_.responsive),_this.on("ready",(function(){_this.audioPosterMode(_this.options_.audioPosterMode),_this.audioOnlyMode(_this.options_.audioOnlyMode)})),_this}inheritsLoose(Player,_Component);var _proto=Player.prototype;return _proto.dispose=function(){var _this2=this;this.trigger("dispose"),this.off("dispose"),off(document,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),off(document,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Player.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),middlewareInstances[this.id()]=null,ALL.names.forEach((function(name){var props=ALL[name],list=_this2[props.getterName]();list&&list.off&&list.off()})),_Component.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},_proto.createEl=function(){var el,tag=this.tag,playerElIngest=this.playerElIngest_=tag.parentNode&&tag.parentNode.hasAttribute&&tag.parentNode.hasAttribute("data-vjs-player"),divEmbed="video-js"===this.tag.tagName.toLowerCase();playerElIngest?el=this.el_=tag.parentNode:divEmbed||(el=this.el_=_Component.prototype.createEl.call(this,"div"));var attrs=getAttributes(tag);if(divEmbed){for(el=this.el_=tag,tag=this.tag=document.createElement("video");el.children.length;)tag.appendChild(el.firstChild);hasClass(el,"video-js")||addClass(el,"video-js"),el.appendChild(tag),playerElIngest=this.playerElIngest_=el,Object.keys(el).forEach((function(k){try{tag[k]=el[k]}catch(e){}}))}if(tag.setAttribute("tabindex","-1"),attrs.tabindex="-1",(IE_VERSION||IS_CHROME&&IS_WINDOWS)&&(tag.setAttribute("role","application"),attrs.role="application"),tag.removeAttribute("width"),tag.removeAttribute("height"),"width"in attrs&&delete attrs.width,"height"in attrs&&delete attrs.height,Object.getOwnPropertyNames(attrs).forEach((function(attr){divEmbed&&"class"===attr||el.setAttribute(attr,attrs[attr]),divEmbed&&tag.setAttribute(attr,attrs[attr])})),tag.playerId=tag.id,tag.id+="_html5_api",tag.className="vjs-tech",tag.player=el.player=this,this.addClass("vjs-paused"),!0!==window.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=createStyleElement("vjs-styles-dimensions");var defaultsStyleEl=$(".vjs-styles-defaults"),head=$("head");head.insertBefore(this.styleEl_,defaultsStyleEl?defaultsStyleEl.nextSibling:head.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var links=tag.getElementsByTagName("a"),i=0;i0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),ratioMultiplier=ratioParts[1]/ratioParts[0];width=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/ratioMultiplier:this.videoWidth()||300,height=void 0!==this.height_?this.height_:width*ratioMultiplier,idClass=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(idClass),setTextContent(this.styleEl_,"\n ."+idClass+" {\n width: "+width+"px;\n height: "+height+"px;\n }\n\n ."+idClass+".vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: "+100*ratioMultiplier+"%;\n }\n ")}else{var _width="number"==typeof this.width_?this.width_:this.options_.width,_height="number"==typeof this.height_?this.height_:this.options_.height,techEl=this.tech_&&this.tech_.el();techEl&&(_width>=0&&(techEl.width=_width),_height>=0&&(techEl.height=_height))}},_proto.loadTech_=function(techName,source){var _this4=this;this.tech_&&this.unloadTech_();var titleTechName=toTitleCase$1(techName),camelTechName=techName.charAt(0).toLowerCase()+techName.slice(1);"Html5"!==titleTechName&&this.tag&&(Tech.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=titleTechName,this.isReady_=!1;var autoplay=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(autoplay=!1);var techOptions={source:source,autoplay:autoplay,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+camelTechName+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};ALL.names.forEach((function(name){var props=ALL[name];techOptions[props.getterName]=_this4[props.privateName]})),assign(techOptions,this.options_[titleTechName]),assign(techOptions,this.options_[camelTechName]),assign(techOptions,this.options_[techName.toLowerCase()]),this.tag&&(techOptions.tag=this.tag),source&&source.src===this.cache_.src&&this.cache_.currentTime>0&&(techOptions.startTime=this.cache_.currentTime);var TechClass=Tech.getTech(techName);if(!TechClass)throw new Error("No Tech named '"+titleTechName+"' exists! '"+titleTechName+"' should be registered using videojs.registerTech()'");this.tech_=new TechClass(techOptions),this.tech_.ready(bind(this,this.handleTechReady_),!0),textTrackConverter_jsonToTextTracks(this.textTracksJson_||[],this.tech_),TECH_EVENTS_RETRIGGER.forEach((function(event){_this4.on(_this4.tech_,event,(function(e){return _this4["handleTech"+toTitleCase$1(event)+"_"](e)}))})),Object.keys(TECH_EVENTS_QUEUE).forEach((function(event){_this4.on(_this4.tech_,event,(function(eventObj){0===_this4.tech_.playbackRate()&&_this4.tech_.seeking()?_this4.queuedCallbacks_.push({callback:_this4["handleTech"+TECH_EVENTS_QUEUE[event]+"_"].bind(_this4),event:eventObj}):_this4["handleTech"+TECH_EVENTS_QUEUE[event]+"_"](eventObj)}))})),this.on(this.tech_,"loadstart",(function(e){return _this4.handleTechLoadStart_(e)})),this.on(this.tech_,"sourceset",(function(e){return _this4.handleTechSourceset_(e)})),this.on(this.tech_,"waiting",(function(e){return _this4.handleTechWaiting_(e)})),this.on(this.tech_,"ended",(function(e){return _this4.handleTechEnded_(e)})),this.on(this.tech_,"seeking",(function(e){return _this4.handleTechSeeking_(e)})),this.on(this.tech_,"play",(function(e){return _this4.handleTechPlay_(e)})),this.on(this.tech_,"firstplay",(function(e){return _this4.handleTechFirstPlay_(e)})),this.on(this.tech_,"pause",(function(e){return _this4.handleTechPause_(e)})),this.on(this.tech_,"durationchange",(function(e){return _this4.handleTechDurationChange_(e)})),this.on(this.tech_,"fullscreenchange",(function(e,data){return _this4.handleTechFullscreenChange_(e,data)})),this.on(this.tech_,"fullscreenerror",(function(e,err){return _this4.handleTechFullscreenError_(e,err)})),this.on(this.tech_,"enterpictureinpicture",(function(e){return _this4.handleTechEnterPictureInPicture_(e)})),this.on(this.tech_,"leavepictureinpicture",(function(e){return _this4.handleTechLeavePictureInPicture_(e)})),this.on(this.tech_,"error",(function(e){return _this4.handleTechError_(e)})),this.on(this.tech_,"posterchange",(function(e){return _this4.handleTechPosterChange_(e)})),this.on(this.tech_,"textdata",(function(e){return _this4.handleTechTextData_(e)})),this.on(this.tech_,"ratechange",(function(e){return _this4.handleTechRateChange_(e)})),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===titleTechName&&this.tag||prependTo(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},_proto.unloadTech_=function(){var _this5=this;ALL.names.forEach((function(name){var props=ALL[name];_this5[props.privateName]=_this5[props.getterName]()})),this.textTracksJson_=textTrackConverter_textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},_proto.tech=function(safety){return void 0===safety&&log$1.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_},_proto.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},_proto.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},_proto.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},_proto.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())},_proto.manualAutoplay_=function(type){var _this6=this;if(this.tech_&&"string"==typeof type){var promise,resolveMuted=function(){var previouslyMuted=_this6.muted();_this6.muted(!0);var restoreMuted=function(){_this6.muted(previouslyMuted)};_this6.playTerminatedQueue_.push(restoreMuted);var mutedPromise=_this6.play();if(isPromise(mutedPromise))return mutedPromise.catch((function(err){throw restoreMuted(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(err||""))}))};if("any"!==type||this.muted()?promise="muted"!==type||this.muted()?this.play():resolveMuted():isPromise(promise=this.play())&&(promise=promise.catch(resolveMuted)),isPromise(promise))return promise.then((function(){_this6.trigger({type:"autoplay-success",autoplay:type})})).catch((function(){_this6.trigger({type:"autoplay-failure",autoplay:type})}))}},_proto.updateSourceCaches_=function(srcObj){void 0===srcObj&&(srcObj="");var src=srcObj,type="";"string"!=typeof src&&(src=srcObj.src,type=srcObj.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],src&&!type&&(type=function(player,src){if(!src)return"";if(player.cache_.source.src===src&&player.cache_.source.type)return player.cache_.source.type;var matchingSources=player.cache_.sources.filter((function(s){return s.src===src}));if(matchingSources.length)return matchingSources[0].type;for(var sources=player.$$("source"),i=0;i0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((function(queued){return queued.callback(queued.event)})),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},_proto.handleTechWaiting_=function(){var _this8=this;this.addClass("vjs-waiting"),this.trigger("waiting");var timeWhenWaiting=this.currentTime();this.on("timeupdate",(function timeUpdateListener(){timeWhenWaiting!==_this8.currentTime()&&(_this8.removeClass("vjs-waiting"),_this8.off("timeupdate",timeUpdateListener))}))},_proto.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},_proto.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},_proto.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},_proto.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},_proto.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},_proto.handleTechFirstPlay_=function(){this.options_.starttime&&(log$1.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},_proto.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},_proto.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},_proto.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},_proto.handleTechClick_=function(event){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,event):this.paused()?silencePromise(this.play()):this.pause()))},_proto.handleTechDoubleClick_=function(event){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(function(el){return el.contains(event.target)}))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,event):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},_proto.handleTechTap_=function(){this.userActive(!this.userActive())},_proto.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},_proto.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},_proto.handleTechTouchEnd_=function(event){event.cancelable&&event.preventDefault()},_proto.handleStageClick_=function(){this.reportUserActivity()},_proto.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},_proto.documentFullscreenChange_=function(e){var targetPlayer=e.target.player;if(!targetPlayer||targetPlayer===this){var el=this.el(),isFs=document[this.fsApi_.fullscreenElement]===el;!isFs&&el.matches?isFs=el.matches(":"+this.fsApi_.fullscreen):!isFs&&el.msMatchesSelector&&(isFs=el.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(isFs)}},_proto.handleTechFullscreenChange_=function(event,data){var _this9=this;data&&(data.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",(function(){_this9.removeClass("vjs-ios-native-fs")}))),this.isFullscreen(data.isFullscreen))},_proto.handleTechFullscreenError_=function(event,err){this.trigger("fullscreenerror",err)},_proto.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},_proto.handleTechEnterPictureInPicture_=function(event){this.isInPictureInPicture(!0)},_proto.handleTechLeavePictureInPicture_=function(event){this.isInPictureInPicture(!1)},_proto.handleTechError_=function(){var error=this.tech_.error();this.error(error)},_proto.handleTechTextData_=function(){var data=null;arguments.length>1&&(data=arguments[1]),this.trigger("textdata",data)},_proto.getCache=function(){return this.cache_},_proto.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},_proto.techCall_=function(method,arg){this.ready((function(){if(method in allowedSetters)return function(middleware,tech,method,arg){return tech[method](middleware.reduce(middlewareIterator(method),arg))}(this.middleware_,this.tech_,method,arg);if(method in allowedMediators)return mediate(this.middleware_,this.tech_,method,arg);try{this.tech_&&this.tech_[method](arg)}catch(e){throw log$1(e),e}}),!0)},_proto.techGet_=function(method){if(this.tech_&&this.tech_.isReady_){if(method in allowedGetters)return function(middleware,tech,method){return middleware.reduceRight(middlewareIterator(method),tech[method]())}(this.middleware_,this.tech_,method);if(method in allowedMediators)return mediate(this.middleware_,this.tech_,method);try{return this.tech_[method]()}catch(e){if(void 0===this.tech_[method])throw log$1("Video.js: "+method+" method not defined for "+this.techName_+" playback technology.",e),e;if("TypeError"===e.name)throw log$1("Video.js: "+method+" unavailable on "+this.techName_+" playback technology element.",e),this.tech_.isReady_=!1,e;throw log$1(e),e}}},_proto.play=function(){var _this10=this,PromiseClass=this.options_.Promise||window.Promise;return PromiseClass?new PromiseClass((function(resolve){_this10.play_(resolve)})):this.play_()},_proto.play_=function(callback){var _this11=this;void 0===callback&&(callback=silencePromise),this.playCallbacks_.push(callback);var isSrcReady=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!isSrcReady)return this.waitToPlay_=function(e){_this11.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(isSrcReady||!IS_ANY_SAFARI&&!IS_IOS||this.load());var val=this.techGet_("play");null===val?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(val)},_proto.runPlayTerminatedQueue_=function(){var queue=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],queue.forEach((function(q){q()}))},_proto.runPlayCallbacks_=function(val){var callbacks=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],callbacks.forEach((function(cb){cb(val)}))},_proto.pause=function(){this.techCall_("pause")},_proto.paused=function(){return!1!==this.techGet_("paused")},_proto.played=function(){return this.techGet_("played")||createTimeRanges(0,0)},_proto.scrubbing=function(isScrubbing){if(void 0===isScrubbing)return this.scrubbing_;this.scrubbing_=!!isScrubbing,this.techCall_("setScrubbing",this.scrubbing_),isScrubbing?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},_proto.currentTime=function(seconds){return void 0!==seconds?(seconds<0&&(seconds=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",seconds),void(this.cache_.initTime=0)):(this.cache_.initTime=seconds,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},_proto.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},_proto.duration=function(seconds){if(void 0===seconds)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(seconds=parseFloat(seconds))<0&&(seconds=1/0),seconds!==this.cache_.duration&&(this.cache_.duration=seconds,seconds===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(seconds)||this.trigger("durationchange"))},_proto.remainingTime=function(){return this.duration()-this.currentTime()},_proto.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},_proto.buffered=function(){var buffered=this.techGet_("buffered");return buffered&&buffered.length||(buffered=createTimeRanges(0,0)),buffered},_proto.bufferedPercent=function(){return bufferedPercent(this.buffered(),this.duration())},_proto.bufferedEnd=function(){var buffered=this.buffered(),duration=this.duration(),end=buffered.end(buffered.length-1);return end>duration&&(end=duration),end},_proto.volume=function(percentAsDecimal){var vol;return void 0!==percentAsDecimal?(vol=Math.max(0,Math.min(1,parseFloat(percentAsDecimal))),this.cache_.volume=vol,this.techCall_("setVolume",vol),void(vol>0&&this.lastVolume_(vol))):(vol=parseFloat(this.techGet_("volume")),isNaN(vol)?1:vol)},_proto.muted=function(_muted){if(void 0===_muted)return this.techGet_("muted")||!1;this.techCall_("setMuted",_muted)},_proto.defaultMuted=function(_defaultMuted){return void 0!==_defaultMuted?this.techCall_("setDefaultMuted",_defaultMuted):this.techGet_("defaultMuted")||!1},_proto.lastVolume_=function(percentAsDecimal){if(void 0===percentAsDecimal||0===percentAsDecimal)return this.cache_.lastVolume;this.cache_.lastVolume=percentAsDecimal},_proto.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},_proto.isFullscreen=function(isFS){if(void 0!==isFS){var oldValue=this.isFullscreen_;return this.isFullscreen_=Boolean(isFS),this.isFullscreen_!==oldValue&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_},_proto.requestFullscreen=function(fullscreenOptions){var PromiseClass=this.options_.Promise||window.Promise;if(PromiseClass){var self=this;return new PromiseClass((function(resolve,reject){function offHandler(){self.off("fullscreenerror",errorHandler),self.off("fullscreenchange",changeHandler)}function changeHandler(){offHandler(),resolve()}function errorHandler(e,err){offHandler(),reject(err)}self.one("fullscreenchange",changeHandler),self.one("fullscreenerror",errorHandler);var promise=self.requestFullscreenHelper_(fullscreenOptions);promise&&(promise.then(offHandler,offHandler),promise.then(resolve,reject))}))}return this.requestFullscreenHelper_()},_proto.requestFullscreenHelper_=function(fullscreenOptions){var fsOptions,_this12=this;if(this.fsApi_.prefixed||(fsOptions=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==fullscreenOptions&&(fsOptions=fullscreenOptions)),this.fsApi_.requestFullscreen){var promise=this.el_[this.fsApi_.requestFullscreen](fsOptions);return promise&&promise.then((function(){return _this12.isFullscreen(!0)}),(function(){return _this12.isFullscreen(!1)})),promise}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},_proto.exitFullscreen=function(){var PromiseClass=this.options_.Promise||window.Promise;if(PromiseClass){var self=this;return new PromiseClass((function(resolve,reject){function offHandler(){self.off("fullscreenerror",errorHandler),self.off("fullscreenchange",changeHandler)}function changeHandler(){offHandler(),resolve()}function errorHandler(e,err){offHandler(),reject(err)}self.one("fullscreenchange",changeHandler),self.one("fullscreenerror",errorHandler);var promise=self.exitFullscreenHelper_();promise&&(promise.then(offHandler,offHandler),promise.then(resolve,reject))}))}return this.exitFullscreenHelper_()},_proto.exitFullscreenHelper_=function(){var _this13=this;if(this.fsApi_.requestFullscreen){var promise=document[this.fsApi_.exitFullscreen]();return promise&&silencePromise(promise.then((function(){return _this13.isFullscreen(!1)}))),promise}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},_proto.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=document.documentElement.style.overflow,on(document,"keydown",this.boundFullWindowOnEscKey_),document.documentElement.style.overflow="hidden",addClass(document.body,"vjs-full-window"),this.trigger("enterFullWindow")},_proto.fullWindowOnEscKey=function(event){keycode.isEventKey(event,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},_proto.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,off(document,"keydown",this.boundFullWindowOnEscKey_),document.documentElement.style.overflow=this.docOrigOverflow,removeClass(document.body,"vjs-full-window"),this.trigger("exitFullWindow")},_proto.disablePictureInPicture=function(value){if(void 0===value)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",value),this.options_.disablePictureInPicture=value,this.trigger("disablepictureinpicturechanged")},_proto.isInPictureInPicture=function(isPiP){return void 0!==isPiP?(this.isInPictureInPicture_=!!isPiP,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},_proto.requestPictureInPicture=function(){if("pictureInPictureEnabled"in document&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},_proto.exitPictureInPicture=function(){if("pictureInPictureEnabled"in document)return document.exitPictureInPicture()},_proto.handleKeyDown=function(event){var userActions=this.options_.userActions;if(userActions&&userActions.hotkeys){(function(el){var tagName=el.tagName.toLowerCase();if(el.isContentEditable)return!0;if("input"===tagName)return-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(el.type);return-1!==["textarea"].indexOf(tagName)})(this.el_.ownerDocument.activeElement)||("function"==typeof userActions.hotkeys?userActions.hotkeys.call(this,event):this.handleHotkeys(event))}},_proto.handleHotkeys=function(event){var hotkeys=this.options_.userActions?this.options_.userActions.hotkeys:{},_hotkeys$fullscreenKe=hotkeys.fullscreenKey,fullscreenKey=void 0===_hotkeys$fullscreenKe?function(keydownEvent){return keycode.isEventKey(keydownEvent,"f")}:_hotkeys$fullscreenKe,_hotkeys$muteKey=hotkeys.muteKey,muteKey=void 0===_hotkeys$muteKey?function(keydownEvent){return keycode.isEventKey(keydownEvent,"m")}:_hotkeys$muteKey,_hotkeys$playPauseKey=hotkeys.playPauseKey,playPauseKey=void 0===_hotkeys$playPauseKey?function(keydownEvent){return keycode.isEventKey(keydownEvent,"k")||keycode.isEventKey(keydownEvent,"Space")}:_hotkeys$playPauseKey;if(fullscreenKey.call(this,event)){event.preventDefault(),event.stopPropagation();var FSToggle=Component$1.getComponent("FullscreenToggle");!1!==document[this.fsApi_.fullscreenEnabled]&&FSToggle.prototype.handleClick.call(this,event)}else if(muteKey.call(this,event)){event.preventDefault(),event.stopPropagation(),Component$1.getComponent("MuteToggle").prototype.handleClick.call(this,event)}else if(playPauseKey.call(this,event)){event.preventDefault(),event.stopPropagation(),Component$1.getComponent("PlayToggle").prototype.handleClick.call(this,event)}},_proto.canPlayType=function(type){for(var can,i=0,j=this.options_.techOrder;i1?_this15.handleSrc_(sources.slice(1)):(_this15.changingSrc_=!1,_this15.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0),void _this15.triggerReady());middleware=mws,tech=_this15.tech_,middleware.forEach((function(mw){return mw.setTech&&mw.setTech(tech)}))})),this.options_.retryOnError&&sources.length>1){var retry=function(){_this15.error(null),_this15.handleSrc_(sources.slice(1),!0)},stopListeningForErrors=function(){_this15.off("error",retry)};this.one("error",retry),this.one("playing",stopListeningForErrors),this.resetRetryOnError_=function(){_this15.off("error",retry),_this15.off("playing",stopListeningForErrors)}}}else this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0)},_proto.src=function(source){return this.handleSrc_(source,!1)},_proto.src_=function(source){var str1,str2,_this16=this,sourceTech=this.selectSource([source]);return!sourceTech||(str1=sourceTech.tech,str2=this.techName_,toTitleCase$1(str1)!==toTitleCase$1(str2)?(this.changingSrc_=!0,this.loadTech_(sourceTech.tech,sourceTech.source),this.tech_.ready((function(){_this16.changingSrc_=!1})),!1):(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",source):this.techCall_("src",source.src),this.changingSrc_=!1}),!0),!1))},_proto.load=function(){this.techCall_("load")},_proto.reset=function(){var _this17=this,PromiseClass=this.options_.Promise||window.Promise;this.paused()||!PromiseClass?this.doReset_():silencePromise(this.play().then((function(){return _this17.doReset_()})))},_proto.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),isEvented(this)&&this.trigger("playerreset")},_proto.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},_proto.resetProgressBar_=function(){this.currentTime(0);var _ref3=this.controlBar||{},durationDisplay=_ref3.durationDisplay,remainingTimeDisplay=_ref3.remainingTimeDisplay;durationDisplay&&durationDisplay.updateContent(),remainingTimeDisplay&&remainingTimeDisplay.updateContent()},_proto.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},_proto.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},_proto.currentSources=function(){var source=this.currentSource(),sources=[];return 0!==Object.keys(source).length&&sources.push(source),this.cache_.sources||sources},_proto.currentSource=function(){return this.cache_.source||{}},_proto.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},_proto.currentType=function(){return this.currentSource()&&this.currentSource().type||""},_proto.preload=function(value){return void 0!==value?(this.techCall_("setPreload",value),void(this.options_.preload=value)):this.techGet_("preload")},_proto.autoplay=function(value){if(void 0===value)return this.options_.autoplay||!1;var techAutoplay;"string"==typeof value&&/(any|play|muted)/.test(value)||!0===value&&this.options_.normalizeAutoplay?(this.options_.autoplay=value,this.manualAutoplay_("string"==typeof value?value:"play"),techAutoplay=!1):this.options_.autoplay=!!value,techAutoplay=void 0===techAutoplay?this.options_.autoplay:techAutoplay,this.tech_&&this.techCall_("setAutoplay",techAutoplay)},_proto.playsinline=function(value){return void 0!==value?(this.techCall_("setPlaysinline",value),this.options_.playsinline=value,this):this.techGet_("playsinline")},_proto.loop=function(value){return void 0!==value?(this.techCall_("setLoop",value),void(this.options_.loop=value)):this.techGet_("loop")},_proto.poster=function(src){if(void 0===src)return this.poster_;src||(src=""),src!==this.poster_&&(this.poster_=src,this.techCall_("setPoster",src),this.isPosterFromTech_=!1,this.trigger("posterchange"))},_proto.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var newPoster=this.tech_.poster()||"";newPoster!==this.poster_&&(this.poster_=newPoster,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},_proto.controls=function(bool){if(void 0===bool)return!!this.controls_;bool=!!bool,this.controls_!==bool&&(this.controls_=bool,this.usingNativeControls()&&this.techCall_("setControls",bool),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},_proto.usingNativeControls=function(bool){if(void 0===bool)return!!this.usingNativeControls_;bool=!!bool,this.usingNativeControls_!==bool&&(this.usingNativeControls_=bool,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},_proto.error=function(err){var _this18=this;if(void 0===err)return this.error_||null;if(hooks("beforeerror").forEach((function(hookFunction){var newErr=hookFunction(_this18,err);isObject$1(newErr)&&!Array.isArray(newErr)||"string"==typeof newErr||"number"==typeof newErr||null===newErr?err=newErr:_this18.log.error("please return a value that MediaError expects in beforeerror hooks")})),this.options_.suppressNotSupportedError&&err&&4===err.code){var triggerSuppressedError=function(){this.error(err)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],triggerSuppressedError),void this.one("loadstart",(function(){this.off(["click","touchstart"],triggerSuppressedError)}))}if(null===err)return this.error_=err,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new MediaError(err),this.addClass("vjs-error"),log$1.error("(CODE:"+this.error_.code+" "+MediaError.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),hooks("error").forEach((function(hookFunction){return hookFunction(_this18,_this18.error_)}))},_proto.reportUserActivity=function(event){this.userActivity_=!0},_proto.userActive=function(bool){if(void 0===bool)return this.userActive_;if((bool=!!bool)!==this.userActive_){if(this.userActive_=bool,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},_proto.listenForUserActivity_=function(){var mouseInProgress,lastMoveX,lastMoveY,handleActivity=bind(this,this.reportUserActivity),handleMouseUpAndMouseLeave=function(event){handleActivity(),this.clearInterval(mouseInProgress)};this.on("mousedown",(function(){handleActivity(),this.clearInterval(mouseInProgress),mouseInProgress=this.setInterval(handleActivity,250)})),this.on("mousemove",(function(e){e.screenX===lastMoveX&&e.screenY===lastMoveY||(lastMoveX=e.screenX,lastMoveY=e.screenY,handleActivity())})),this.on("mouseup",handleMouseUpAndMouseLeave),this.on("mouseleave",handleMouseUpAndMouseLeave);var inactivityTimeout,controlBar=this.getChild("controlBar");!controlBar||IS_IOS||IS_ANDROID||(controlBar.on("mouseenter",(function(event){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0})),controlBar.on("mouseleave",(function(event){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",handleActivity),this.on("keyup",handleActivity),this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(inactivityTimeout);var timeout=this.options_.inactivityTimeout;timeout<=0||(inactivityTimeout=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),timeout))}}),250)},_proto.playbackRate=function(rate){if(void 0===rate)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",rate)},_proto.defaultPlaybackRate=function(rate){return void 0!==rate?this.techCall_("setDefaultPlaybackRate",rate):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},_proto.isAudio=function(bool){if(void 0===bool)return!!this.isAudio_;this.isAudio_=!!bool},_proto.enableAudioOnlyUI_=function(){var _this19=this;this.addClass("vjs-audio-only-mode");var playerChildren=this.children(),controlBar=this.getChild("ControlBar"),controlBarHeight=controlBar&&controlBar.currentHeight();playerChildren.forEach((function(child){child!==controlBar&&child.el_&&!child.hasClass("vjs-hidden")&&(child.hide(),_this19.audioOnlyCache_.hiddenChildren.push(child))})),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(controlBarHeight),this.trigger("audioonlymodechange")},_proto.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach((function(child){return child.show()})),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},_proto.audioOnlyMode=function(value){var _this20=this;if("boolean"!=typeof value||value===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=value;var PromiseClass=this.options_.Promise||window.Promise;if(PromiseClass){if(value){var exitPromises=[];return this.isInPictureInPicture()&&exitPromises.push(this.exitPictureInPicture()),this.isFullscreen()&&exitPromises.push(this.exitFullscreen()),this.audioPosterMode()&&exitPromises.push(this.audioPosterMode(!1)),PromiseClass.all(exitPromises).then((function(){return _this20.enableAudioOnlyUI_()}))}return PromiseClass.resolve().then((function(){return _this20.disableAudioOnlyUI_()}))}value?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},_proto.enablePosterModeUI_=function(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},_proto.disablePosterModeUI_=function(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},_proto.audioPosterMode=function(value){var _this21=this;if("boolean"!=typeof value||value===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=value;var PromiseClass=this.options_.Promise||window.Promise;return PromiseClass?value?this.audioOnlyMode()?this.audioOnlyMode(!1).then((function(){_this21.enablePosterModeUI_()})):PromiseClass.resolve().then((function(){_this21.enablePosterModeUI_()})):PromiseClass.resolve().then((function(){_this21.disablePosterModeUI_()})):value?(this.audioOnlyMode()&&this.audioOnlyMode(!1),void this.enablePosterModeUI_()):void this.disablePosterModeUI_()},_proto.addTextTrack=function(kind,label,language){if(this.tech_)return this.tech_.addTextTrack(kind,label,language)},_proto.addRemoteTextTrack=function(options,manualCleanup){if(this.tech_)return this.tech_.addRemoteTextTrack(options,manualCleanup)},_proto.removeRemoteTextTrack=function(obj){void 0===obj&&(obj={});var track=obj.track;if(track||(track=obj),this.tech_)return this.tech_.removeRemoteTextTrack(track)},_proto.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},_proto.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},_proto.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},_proto.language=function(code){if(void 0===code)return this.language_;this.language_!==String(code).toLowerCase()&&(this.language_=String(code).toLowerCase(),isEvented(this)&&this.trigger("languagechange"))},_proto.languages=function(){return mergeOptions$3(Player.prototype.options_.languages,this.languages_)},_proto.toJSON=function(){var options=mergeOptions$3(this.options_),tracks=options.tracks;options.tracks=[];for(var i=0;i-1},_proto.trigger=function(type){var callbacks=this.listeners[type];if(callbacks)if(2===arguments.length)for(var length=callbacks.length,i=0;i-1;nextNewline=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,nextNewline)),this.buffer=this.buffer.substring(nextNewline+1)},LineStream}(Stream),TAB=String.fromCharCode(9),parseByterange=function(byterangeString){var match=/([0-9.]*)?@?([0-9.]*)?/.exec(byterangeString||""),result={};return match[1]&&(result.length=parseInt(match[1],10)),match[2]&&(result.offset=parseInt(match[2],10)),result},parseAttributes$1=function(attributes){for(var attr,attrs=attributes.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),result={},i=attrs.length;i--;)""!==attrs[i]&&((attr=/([^=]*)=(.*)/.exec(attrs[i]).slice(1))[0]=attr[0].replace(/^\s+|\s+$/g,""),attr[1]=attr[1].replace(/^\s+|\s+$/g,""),attr[1]=attr[1].replace(/^['"](.*)['"]$/g,"$1"),result[attr[0]]=attr[1]);return result},ParseStream=function(_Stream){function ParseStream(){var _this;return(_this=_Stream.call(this)||this).customParsers=[],_this.tagMappers=[],_this}inheritsLoose(ParseStream,_Stream);var _proto=ParseStream.prototype;return _proto.push=function(line){var match,event,_this2=this;0!==(line=line.trim()).length&&("#"===line[0]?this.tagMappers.reduce((function(acc,mapper){var mappedLine=mapper(line);return mappedLine===line?acc:acc.concat([mappedLine])}),[line]).forEach((function(newLine){for(var i=0;i<_this2.customParsers.length;i++)if(_this2.customParsers[i].call(_this2,newLine))return;if(0===newLine.indexOf("#EXT"))if(newLine=newLine.replace("\r",""),match=/^#EXTM3U/.exec(newLine))_this2.trigger("data",{type:"tag",tagType:"m3u"});else{if(match=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(newLine))return event={type:"tag",tagType:"inf"},match[1]&&(event.duration=parseFloat(match[1])),match[2]&&(event.title=match[2]),void _this2.trigger("data",event);if(match=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(newLine))return event={type:"tag",tagType:"targetduration"},match[1]&&(event.duration=parseInt(match[1],10)),void _this2.trigger("data",event);if(match=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(newLine))return event={type:"tag",tagType:"version"},match[1]&&(event.version=parseInt(match[1],10)),void _this2.trigger("data",event);if(match=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(newLine))return event={type:"tag",tagType:"media-sequence"},match[1]&&(event.number=parseInt(match[1],10)),void _this2.trigger("data",event);if(match=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(newLine))return event={type:"tag",tagType:"discontinuity-sequence"},match[1]&&(event.number=parseInt(match[1],10)),void _this2.trigger("data",event);if(match=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(newLine))return event={type:"tag",tagType:"playlist-type"},match[1]&&(event.playlistType=match[1]),void _this2.trigger("data",event);if(match=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(newLine))return event=_extends_1(parseByterange(match[1]),{type:"tag",tagType:"byterange"}),void _this2.trigger("data",event);if(match=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(newLine))return event={type:"tag",tagType:"allow-cache"},match[1]&&(event.allowed=!/NO/.test(match[1])),void _this2.trigger("data",event);if(match=/^#EXT-X-MAP:?(.*)$/.exec(newLine)){if(event={type:"tag",tagType:"map"},match[1]){var attributes=parseAttributes$1(match[1]);attributes.URI&&(event.uri=attributes.URI),attributes.BYTERANGE&&(event.byterange=parseByterange(attributes.BYTERANGE))}_this2.trigger("data",event)}else if(match=/^#EXT-X-STREAM-INF:?(.*)$/.exec(newLine)){if(event={type:"tag",tagType:"stream-inf"},match[1]){if(event.attributes=parseAttributes$1(match[1]),event.attributes.RESOLUTION){var split=event.attributes.RESOLUTION.split("x"),resolution={};split[0]&&(resolution.width=parseInt(split[0],10)),split[1]&&(resolution.height=parseInt(split[1],10)),event.attributes.RESOLUTION=resolution}event.attributes.BANDWIDTH&&(event.attributes.BANDWIDTH=parseInt(event.attributes.BANDWIDTH,10)),event.attributes["PROGRAM-ID"]&&(event.attributes["PROGRAM-ID"]=parseInt(event.attributes["PROGRAM-ID"],10))}_this2.trigger("data",event)}else{if(match=/^#EXT-X-MEDIA:?(.*)$/.exec(newLine))return event={type:"tag",tagType:"media"},match[1]&&(event.attributes=parseAttributes$1(match[1])),void _this2.trigger("data",event);if(match=/^#EXT-X-ENDLIST/.exec(newLine))_this2.trigger("data",{type:"tag",tagType:"endlist"});else if(match=/^#EXT-X-DISCONTINUITY/.exec(newLine))_this2.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(match=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(newLine))return event={type:"tag",tagType:"program-date-time"},match[1]&&(event.dateTimeString=match[1],event.dateTimeObject=new Date(match[1])),void _this2.trigger("data",event);if(match=/^#EXT-X-KEY:?(.*)$/.exec(newLine))return event={type:"tag",tagType:"key"},match[1]&&(event.attributes=parseAttributes$1(match[1]),event.attributes.IV&&("0x"===event.attributes.IV.substring(0,2).toLowerCase()&&(event.attributes.IV=event.attributes.IV.substring(2)),event.attributes.IV=event.attributes.IV.match(/.{8}/g),event.attributes.IV[0]=parseInt(event.attributes.IV[0],16),event.attributes.IV[1]=parseInt(event.attributes.IV[1],16),event.attributes.IV[2]=parseInt(event.attributes.IV[2],16),event.attributes.IV[3]=parseInt(event.attributes.IV[3],16),event.attributes.IV=new Uint32Array(event.attributes.IV))),void _this2.trigger("data",event);if(match=/^#EXT-X-START:?(.*)$/.exec(newLine))return event={type:"tag",tagType:"start"},match[1]&&(event.attributes=parseAttributes$1(match[1]),event.attributes["TIME-OFFSET"]=parseFloat(event.attributes["TIME-OFFSET"]),event.attributes.PRECISE=/YES/.test(event.attributes.PRECISE)),void _this2.trigger("data",event);if(match=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(newLine))return event={type:"tag",tagType:"cue-out-cont"},match[1]?event.data=match[1]:event.data="",void _this2.trigger("data",event);if(match=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(newLine))return event={type:"tag",tagType:"cue-out"},match[1]?event.data=match[1]:event.data="",void _this2.trigger("data",event);if(match=/^#EXT-X-CUE-IN:?(.*)?$/.exec(newLine))return event={type:"tag",tagType:"cue-in"},match[1]?event.data=match[1]:event.data="",void _this2.trigger("data",event);if((match=/^#EXT-X-SKIP:(.*)$/.exec(newLine))&&match[1])return(event={type:"tag",tagType:"skip"}).attributes=parseAttributes$1(match[1]),event.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(event.attributes["SKIPPED-SEGMENTS"]=parseInt(event.attributes["SKIPPED-SEGMENTS"],10)),event.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(event.attributes["RECENTLY-REMOVED-DATERANGES"]=event.attributes["RECENTLY-REMOVED-DATERANGES"].split(TAB)),void _this2.trigger("data",event);if((match=/^#EXT-X-PART:(.*)$/.exec(newLine))&&match[1])return(event={type:"tag",tagType:"part"}).attributes=parseAttributes$1(match[1]),["DURATION"].forEach((function(key){event.attributes.hasOwnProperty(key)&&(event.attributes[key]=parseFloat(event.attributes[key]))})),["INDEPENDENT","GAP"].forEach((function(key){event.attributes.hasOwnProperty(key)&&(event.attributes[key]=/YES/.test(event.attributes[key]))})),event.attributes.hasOwnProperty("BYTERANGE")&&(event.attributes.byterange=parseByterange(event.attributes.BYTERANGE)),void _this2.trigger("data",event);if((match=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(newLine))&&match[1])return(event={type:"tag",tagType:"server-control"}).attributes=parseAttributes$1(match[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(key){event.attributes.hasOwnProperty(key)&&(event.attributes[key]=parseFloat(event.attributes[key]))})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(key){event.attributes.hasOwnProperty(key)&&(event.attributes[key]=/YES/.test(event.attributes[key]))})),void _this2.trigger("data",event);if((match=/^#EXT-X-PART-INF:(.*)$/.exec(newLine))&&match[1])return(event={type:"tag",tagType:"part-inf"}).attributes=parseAttributes$1(match[1]),["PART-TARGET"].forEach((function(key){event.attributes.hasOwnProperty(key)&&(event.attributes[key]=parseFloat(event.attributes[key]))})),void _this2.trigger("data",event);if((match=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(newLine))&&match[1])return(event={type:"tag",tagType:"preload-hint"}).attributes=parseAttributes$1(match[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(key){if(event.attributes.hasOwnProperty(key)){event.attributes[key]=parseInt(event.attributes[key],10);var subkey="BYTERANGE-LENGTH"===key?"length":"offset";event.attributes.byterange=event.attributes.byterange||{},event.attributes.byterange[subkey]=event.attributes[key],delete event.attributes[key]}})),void _this2.trigger("data",event);if((match=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(newLine))&&match[1])return(event={type:"tag",tagType:"rendition-report"}).attributes=parseAttributes$1(match[1]),["LAST-MSN","LAST-PART"].forEach((function(key){event.attributes.hasOwnProperty(key)&&(event.attributes[key]=parseInt(event.attributes[key],10))})),void _this2.trigger("data",event);_this2.trigger("data",{type:"tag",data:newLine.slice(4)})}}}else _this2.trigger("data",{type:"comment",text:newLine.slice(1)})})):this.trigger("data",{type:"uri",uri:line}))},_proto.addParser=function(_ref){var _this3=this,expression=_ref.expression,customType=_ref.customType,dataParser=_ref.dataParser,segment=_ref.segment;"function"!=typeof dataParser&&(dataParser=function(line){return line}),this.customParsers.push((function(line){if(expression.exec(line))return _this3.trigger("data",{type:"custom",data:dataParser(line),customType:customType,segment:segment}),!0}))},_proto.addTagMapper=function(_ref2){var expression=_ref2.expression,map=_ref2.map;this.tagMappers.push((function(line){return expression.test(line)?map(line):line}))},ParseStream}(Stream),camelCaseKeys=function(attributes){var result={};return Object.keys(attributes).forEach((function(key){var str;result[(str=key,str.toLowerCase().replace(/-(\w)/g,(function(a){return a[1].toUpperCase()})))]=attributes[key]})),result},setHoldBack=function(manifest){var serverControl=manifest.serverControl,targetDuration=manifest.targetDuration,partTargetDuration=manifest.partTargetDuration;if(serverControl){var tag="#EXT-X-SERVER-CONTROL",hb="holdBack",phb="partHoldBack",minTargetDuration=targetDuration&&3*targetDuration,minPartDuration=partTargetDuration&&2*partTargetDuration;targetDuration&&!serverControl.hasOwnProperty(hb)&&(serverControl[hb]=minTargetDuration,this.trigger("info",{message:tag+" defaulting HOLD-BACK to targetDuration * 3 ("+minTargetDuration+")."})),minTargetDuration&&serverControl[hb]0&&(currentUri.duration=entry.duration),0===entry.duration&&(currentUri.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=uris},key:function(){if(entry.attributes)if("NONE"!==entry.attributes.METHOD)if(entry.attributes.URI){if("com.apple.streamingkeydelivery"===entry.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:entry.attributes});if("com.microsoft.playready"===entry.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:entry.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===entry.attributes.KEYFORMAT){return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(entry.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===entry.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==entry.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):entry.attributes.KEYID&&"0x"===entry.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:entry.attributes.KEYFORMAT,keyId:entry.attributes.KEYID.substring(2)},pssh:decodeB64ToUint8Array$1(entry.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}entry.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),_key={method:entry.attributes.METHOD||"AES-128",uri:entry.attributes.URI},void 0!==entry.attributes.IV&&(_key.iv=entry.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else _key=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(entry.number)?this.manifest.mediaSequence=entry.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+entry.number})},"discontinuity-sequence":function(){isFinite(entry.number)?(this.manifest.discontinuitySequence=entry.number,currentTimeline=entry.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+entry.number})},"playlist-type":function(){/VOD|EVENT/.test(entry.playlistType)?this.manifest.playlistType=entry.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+entry.playlist})},map:function(){currentMap={},entry.uri&&(currentMap.uri=entry.uri),entry.byterange&&(currentMap.byterange=entry.byterange),_key&&(currentMap.key=_key)},"stream-inf":function(){this.manifest.playlists=uris,this.manifest.mediaGroups=this.manifest.mediaGroups||defaultMediaGroups,entry.attributes?(currentUri.attributes||(currentUri.attributes={}),_extends_1(currentUri.attributes,entry.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||defaultMediaGroups,entry.attributes&&entry.attributes.TYPE&&entry.attributes["GROUP-ID"]&&entry.attributes.NAME){var mediaGroupType=this.manifest.mediaGroups[entry.attributes.TYPE];mediaGroupType[entry.attributes["GROUP-ID"]]=mediaGroupType[entry.attributes["GROUP-ID"]]||{},mediaGroup=mediaGroupType[entry.attributes["GROUP-ID"]],(rendition={default:/yes/i.test(entry.attributes.DEFAULT)}).default?rendition.autoselect=!0:rendition.autoselect=/yes/i.test(entry.attributes.AUTOSELECT),entry.attributes.LANGUAGE&&(rendition.language=entry.attributes.LANGUAGE),entry.attributes.URI&&(rendition.uri=entry.attributes.URI),entry.attributes["INSTREAM-ID"]&&(rendition.instreamId=entry.attributes["INSTREAM-ID"]),entry.attributes.CHARACTERISTICS&&(rendition.characteristics=entry.attributes.CHARACTERISTICS),entry.attributes.FORCED&&(rendition.forced=/yes/i.test(entry.attributes.FORCED)),mediaGroup[entry.attributes.NAME]=rendition}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){currentTimeline+=1,currentUri.discontinuity=!0,this.manifest.discontinuityStarts.push(uris.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=entry.dateTimeString,this.manifest.dateTimeObject=entry.dateTimeObject),currentUri.dateTimeString=entry.dateTimeString,currentUri.dateTimeObject=entry.dateTimeObject},targetduration:function(){!isFinite(entry.duration)||entry.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+entry.duration}):(this.manifest.targetDuration=entry.duration,setHoldBack.call(this,this.manifest))},start:function(){entry.attributes&&!isNaN(entry.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:entry.attributes["TIME-OFFSET"],precise:entry.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){currentUri.cueOut=entry.data},"cue-out-cont":function(){currentUri.cueOutCont=entry.data},"cue-in":function(){currentUri.cueIn=entry.data},skip:function(){this.manifest.skip=camelCaseKeys(entry.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",entry.attributes,["SKIPPED-SEGMENTS"])},part:function(){var _this2=this;hasParts=!0;var segmentIndex=this.manifest.segments.length,part=camelCaseKeys(entry.attributes);currentUri.parts=currentUri.parts||[],currentUri.parts.push(part),part.byterange&&(part.byterange.hasOwnProperty("offset")||(part.byterange.offset=lastPartByterangeEnd),lastPartByterangeEnd=part.byterange.offset+part.byterange.length);var partIndex=currentUri.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+partIndex+" for segment #"+segmentIndex,entry.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((function(r,i){r.hasOwnProperty("lastPart")||_this2.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+i+" lacks required attribute(s): LAST-PART"})}))},"server-control":function(){var attrs=this.manifest.serverControl=camelCaseKeys(entry.attributes);attrs.hasOwnProperty("canBlockReload")||(attrs.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),setHoldBack.call(this,this.manifest),attrs.canSkipDateranges&&!attrs.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var segmentIndex=this.manifest.segments.length,hint=camelCaseKeys(entry.attributes),isPart=hint.type&&"PART"===hint.type;currentUri.preloadHints=currentUri.preloadHints||[],currentUri.preloadHints.push(hint),hint.byterange&&(hint.byterange.hasOwnProperty("offset")||(hint.byterange.offset=isPart?lastPartByterangeEnd:0,isPart&&(lastPartByterangeEnd=hint.byterange.offset+hint.byterange.length)));var index=currentUri.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+index+" for segment #"+segmentIndex,entry.attributes,["TYPE","URI"]),hint.type)for(var i=0;imax&&(number-=max,number-=max,number-=BigInt(2))}return Number(number)},numberToBytes=function(number,_temp2){var _ref2$le=(void 0===_temp2?{}:_temp2).le,le=void 0!==_ref2$le&&_ref2$le;("bigint"!=typeof number&&"number"!=typeof number||"number"==typeof number&&number!=number)&&(number=0),number=BigInt(number);for(var x,byteCount=(x=number,Math.ceil(function(x){return x.toString(2).length}(x)/8)),bytes=new Uint8Array(new ArrayBuffer(byteCount)),i=0;i=b.length&&fn.call(b,(function(bByte,i){return bByte===(mask[i]?mask[i]&a[offset+i]:a[offset+i])}))},resolveUrl$1=function(baseUrl,relativeUrl){if(/^[a-z]+:/i.test(relativeUrl))return relativeUrl;/^data:/.test(baseUrl)&&(baseUrl=window.location&&window.location.href||"");var nativeURL="function"==typeof window.URL,protocolLess=/^\/\//.test(baseUrl),removeLocation=!window.location&&!/\/\//i.test(baseUrl);if(nativeURL?baseUrl=new window.URL(baseUrl,window.location||"http://example.com"):/\/\//i.test(baseUrl)||(baseUrl=urlToolkit.buildAbsoluteURL(window.location&&window.location.href||"",baseUrl)),nativeURL){var newUrl=new URL(relativeUrl,baseUrl);return removeLocation?newUrl.href.slice("http://example.com".length):protocolLess?newUrl.href.slice(newUrl.protocol.length):newUrl.href}return urlToolkit.buildAbsoluteURL(baseUrl,relativeUrl)};function decodeB64ToUint8Array(b64Text){for(var s,decodedString=(s=b64Text,window.atob?window.atob(s):Buffer.from(s,"base64").toString("binary")),array=new Uint8Array(decodedString.length),i=0;i=0))throw DOMException(NOT_FOUND_ERR,new Error(el.tagName+"@"+attr));for(var lastIndex=list.length-1;i"==c&&">")||"&"==c&&"&"||'"'==c&&"""||""+c.charCodeAt()+";"}function _visitNode(node,callback){if(callback(node))return!0;if(node=node.firstChild)do{if(_visitNode(node,callback))return!0}while(node=node.nextSibling)}function Document(){}function _onRemoveAttribute(doc,el,newAttr,remove){doc&&doc._inc++,newAttr.namespaceURI===NAMESPACE$2.XMLNS&&delete el._nsMap[newAttr.prefix?newAttr.localName:""]}function _onUpdateChild(doc,el,newChild){if(doc&&doc._inc){doc._inc++;var cs=el.childNodes;if(newChild)cs[cs.length++]=newChild;else{for(var child=el.firstChild,i=0;child;)cs[i++]=child,child=child.nextSibling;cs.length=i}}}function _removeChild(parentNode,child){var previous=child.previousSibling,next=child.nextSibling;return previous?previous.nextSibling=next:parentNode.firstChild=next,next?next.previousSibling=previous:parentNode.lastChild=previous,_onUpdateChild(parentNode.ownerDocument,parentNode),child}function _insertBefore(parentNode,newChild,nextChild){var cp=newChild.parentNode;if(cp&&cp.removeChild(newChild),newChild.nodeType===DOCUMENT_FRAGMENT_NODE){var newFirst=newChild.firstChild;if(null==newFirst)return newChild;var newLast=newChild.lastChild}else newFirst=newLast=newChild;var pre=nextChild?nextChild.previousSibling:parentNode.lastChild;newFirst.previousSibling=pre,newLast.nextSibling=nextChild,pre?pre.nextSibling=newFirst:parentNode.firstChild=newFirst,null==nextChild?parentNode.lastChild=newLast:nextChild.previousSibling=newLast;do{newFirst.parentNode=parentNode}while(newFirst!==newLast&&(newFirst=newFirst.nextSibling));return _onUpdateChild(parentNode.ownerDocument||parentNode,parentNode),newChild.nodeType==DOCUMENT_FRAGMENT_NODE&&(newChild.firstChild=newChild.lastChild=null),newChild}function Element(){this._nsMap={}}function Attr(){}function CharacterData(){}function Text(){}function Comment(){}function CDATASection(){}function DocumentType(){}function Notation(){}function Entity(){}function EntityReference(){}function DocumentFragment(){}function ProcessingInstruction(){}function XMLSerializer$1(){}function nodeSerializeToString(isHtml,nodeFilter){var buf=[],refNode=9==this.nodeType&&this.documentElement||this,prefix=refNode.prefix,uri=refNode.namespaceURI;if(uri&&null==prefix&&null==(prefix=refNode.lookupPrefix(uri)))var visibleNamespaces=[{namespace:uri,prefix:null}];return serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces),buf.join("")}function needNamespaceDefine(node,isHTML,visibleNamespaces){var prefix=node.prefix||"",uri=node.namespaceURI;if(!uri)return!1;if("xml"===prefix&&uri===NAMESPACE$2.XML||uri===NAMESPACE$2.XMLNS)return!1;for(var i=visibleNamespaces.length;i--;){var ns=visibleNamespaces[i];if(ns.prefix===prefix)return ns.namespace!==uri}return!0}function addSerializedAttribute(buf,qualifiedName,value){buf.push(" ",qualifiedName,'="',value.replace(/[<&"]/g,_xmlEncoder),'"')}function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){if(visibleNamespaces||(visibleNamespaces=[]),nodeFilter){if(!(node=nodeFilter(node)))return;if("string"==typeof node)return void buf.push(node)}switch(node.nodeType){case ELEMENT_NODE:var attrs=node.attributes,len=attrs.length,child=node.firstChild,nodeName=node.tagName,prefixedNodeName=nodeName;if(!(isHTML=NAMESPACE$2.isHTML(node.namespaceURI)||isHTML)&&!node.prefix&&node.namespaceURI){for(var defaultNS,ai=0;ai=0;nsi--){if(""===(namespace=visibleNamespaces[nsi]).prefix&&namespace.namespace===node.namespaceURI){defaultNS=namespace.namespace;break}}if(defaultNS!==node.namespaceURI)for(nsi=visibleNamespaces.length-1;nsi>=0;nsi--){var namespace;if((namespace=visibleNamespaces[nsi]).namespace===node.namespaceURI){namespace.prefix&&(prefixedNodeName=namespace.prefix+":"+nodeName);break}}}buf.push("<",prefixedNodeName);for(var i=0;i"),isHTML&&/^script$/i.test(nodeName))for(;child;)child.data?buf.push(child.data):serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces.slice()),child=child.nextSibling;else for(;child;)serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces.slice()),child=child.nextSibling;buf.push("",prefixedNodeName,">")}else buf.push("/>");return;case DOCUMENT_NODE:case DOCUMENT_FRAGMENT_NODE:for(child=node.firstChild;child;)serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces.slice()),child=child.nextSibling;return;case ATTRIBUTE_NODE:return addSerializedAttribute(buf,node.name,node.value);case TEXT_NODE:return buf.push(node.data.replace(/[<&]/g,_xmlEncoder).replace(/]]>/g,"]]>"));case CDATA_SECTION_NODE:return buf.push("");case COMMENT_NODE:return buf.push("\x3c!--",node.data,"--\x3e");case DOCUMENT_TYPE_NODE:var pubid=node.publicId,sysid=node.systemId;if(buf.push("");else if(sysid&&"."!=sysid)buf.push(" SYSTEM ",sysid,">");else{var sub=node.internalSubset;sub&&buf.push(" [",sub,"]"),buf.push(">")}return;case PROCESSING_INSTRUCTION_NODE:return buf.push("",node.target," ",node.data,"?>");case ENTITY_REFERENCE_NODE:return buf.push("&",node.nodeName,";");default:buf.push("??",node.nodeName)}}function _importNode(doc,node,deep){var node2;switch(node.nodeType){case ELEMENT_NODE:(node2=node.cloneNode(!1)).ownerDocument=doc;case DOCUMENT_FRAGMENT_NODE:break;case ATTRIBUTE_NODE:deep=!0}if(node2||(node2=node.cloneNode(!1)),node2.ownerDocument=doc,node2.parentNode=null,deep)for(var child=node.firstChild;child;)node2.appendChild(_importNode(doc,child,deep)),child=child.nextSibling;return node2}function _cloneNode(doc,node,deep){var node2=new node.constructor;for(var n in node){var v=node[n];"object"!=typeof v&&v!=node2[n]&&(node2[n]=v)}switch(node.childNodes&&(node2.childNodes=new NodeList),node2.ownerDocument=doc,node2.nodeType){case ELEMENT_NODE:var attrs=node.attributes,attrs2=node2.attributes=new NamedNodeMap,len=attrs.length;attrs2._ownerElement=node2;for(var i=0;i0},lookupPrefix:function(namespaceURI){for(var el=this;el;){var map=el._nsMap;if(map)for(var n in map)if(map[n]==namespaceURI)return n;el=el.nodeType==ATTRIBUTE_NODE?el.ownerDocument:el.parentNode}return null},lookupNamespaceURI:function(prefix){for(var el=this;el;){var map=el._nsMap;if(map&&prefix in map)return map[prefix];el=el.nodeType==ATTRIBUTE_NODE?el.ownerDocument:el.parentNode}return null},isDefaultNamespace:function(namespaceURI){return null==this.lookupPrefix(namespaceURI)}},copy(NodeType,Node),copy(NodeType,Node.prototype),Document.prototype={nodeName:"#document",nodeType:DOCUMENT_NODE,doctype:null,documentElement:null,_inc:1,insertBefore:function(newChild,refChild){if(newChild.nodeType==DOCUMENT_FRAGMENT_NODE){for(var child=newChild.firstChild;child;){var next=child.nextSibling;this.insertBefore(child,refChild),child=next}return newChild}return null==this.documentElement&&newChild.nodeType==ELEMENT_NODE&&(this.documentElement=newChild),_insertBefore(this,newChild,refChild),newChild.ownerDocument=this,newChild},removeChild:function(oldChild){return this.documentElement==oldChild&&(this.documentElement=null),_removeChild(this,oldChild)},importNode:function(importedNode,deep){return _importNode(this,importedNode,deep)},getElementById:function(id){var rtv=null;return _visitNode(this.documentElement,(function(node){if(node.nodeType==ELEMENT_NODE&&node.getAttribute("id")==id)return rtv=node,!0})),rtv},getElementsByClassName:function(classNames){var classNamesSet=toOrderedSet(classNames);return new LiveNodeList(this,(function(base){var ls=[];return classNamesSet.length>0&&_visitNode(base.documentElement,(function(node){if(node!==base&&node.nodeType===ELEMENT_NODE){var nodeClassNames=node.getAttribute("class");if(nodeClassNames){var matches=classNames===nodeClassNames;if(!matches){var nodeClassNamesSet=toOrderedSet(nodeClassNames);matches=classNamesSet.every((list=nodeClassNamesSet,function(element){return list&&-1!==list.indexOf(element)}))}matches&&ls.push(node)}}var list})),ls}))},createElement:function(tagName){var node=new Element;return node.ownerDocument=this,node.nodeName=tagName,node.tagName=tagName,node.localName=tagName,node.childNodes=new NodeList,(node.attributes=new NamedNodeMap)._ownerElement=node,node},createDocumentFragment:function(){var node=new DocumentFragment;return node.ownerDocument=this,node.childNodes=new NodeList,node},createTextNode:function(data){var node=new Text;return node.ownerDocument=this,node.appendData(data),node},createComment:function(data){var node=new Comment;return node.ownerDocument=this,node.appendData(data),node},createCDATASection:function(data){var node=new CDATASection;return node.ownerDocument=this,node.appendData(data),node},createProcessingInstruction:function(target,data){var node=new ProcessingInstruction;return node.ownerDocument=this,node.tagName=node.target=target,node.nodeValue=node.data=data,node},createAttribute:function(name){var node=new Attr;return node.ownerDocument=this,node.name=name,node.nodeName=name,node.localName=name,node.specified=!0,node},createEntityReference:function(name){var node=new EntityReference;return node.ownerDocument=this,node.nodeName=name,node},createElementNS:function(namespaceURI,qualifiedName){var node=new Element,pl=qualifiedName.split(":"),attrs=node.attributes=new NamedNodeMap;return node.childNodes=new NodeList,node.ownerDocument=this,node.nodeName=qualifiedName,node.tagName=qualifiedName,node.namespaceURI=namespaceURI,2==pl.length?(node.prefix=pl[0],node.localName=pl[1]):node.localName=qualifiedName,attrs._ownerElement=node,node},createAttributeNS:function(namespaceURI,qualifiedName){var node=new Attr,pl=qualifiedName.split(":");return node.ownerDocument=this,node.nodeName=qualifiedName,node.name=qualifiedName,node.namespaceURI=namespaceURI,node.specified=!0,2==pl.length?(node.prefix=pl[0],node.localName=pl[1]):node.localName=qualifiedName,node}},_extends(Document,Node),Element.prototype={nodeType:ELEMENT_NODE,hasAttribute:function(name){return null!=this.getAttributeNode(name)},getAttribute:function(name){var attr=this.getAttributeNode(name);return attr&&attr.value||""},getAttributeNode:function(name){return this.attributes.getNamedItem(name)},setAttribute:function(name,value){var attr=this.ownerDocument.createAttribute(name);attr.value=attr.nodeValue=""+value,this.setAttributeNode(attr)},removeAttribute:function(name){var attr=this.getAttributeNode(name);attr&&this.removeAttributeNode(attr)},appendChild:function(newChild){return newChild.nodeType===DOCUMENT_FRAGMENT_NODE?this.insertBefore(newChild,null):function(parentNode,newChild){var cp=newChild.parentNode;if(cp){var pre=parentNode.lastChild;cp.removeChild(newChild),pre=parentNode.lastChild}return pre=parentNode.lastChild,newChild.parentNode=parentNode,newChild.previousSibling=pre,newChild.nextSibling=null,pre?pre.nextSibling=newChild:parentNode.firstChild=newChild,parentNode.lastChild=newChild,_onUpdateChild(parentNode.ownerDocument,parentNode,newChild),newChild}(this,newChild)},setAttributeNode:function(newAttr){return this.attributes.setNamedItem(newAttr)},setAttributeNodeNS:function(newAttr){return this.attributes.setNamedItemNS(newAttr)},removeAttributeNode:function(oldAttr){return this.attributes.removeNamedItem(oldAttr.nodeName)},removeAttributeNS:function(namespaceURI,localName){var old=this.getAttributeNodeNS(namespaceURI,localName);old&&this.removeAttributeNode(old)},hasAttributeNS:function(namespaceURI,localName){return null!=this.getAttributeNodeNS(namespaceURI,localName)},getAttributeNS:function(namespaceURI,localName){var attr=this.getAttributeNodeNS(namespaceURI,localName);return attr&&attr.value||""},setAttributeNS:function(namespaceURI,qualifiedName,value){var attr=this.ownerDocument.createAttributeNS(namespaceURI,qualifiedName);attr.value=attr.nodeValue=""+value,this.setAttributeNode(attr)},getAttributeNodeNS:function(namespaceURI,localName){return this.attributes.getNamedItemNS(namespaceURI,localName)},getElementsByTagName:function(tagName){return new LiveNodeList(this,(function(base){var ls=[];return _visitNode(base,(function(node){node===base||node.nodeType!=ELEMENT_NODE||"*"!==tagName&&node.tagName!=tagName||ls.push(node)})),ls}))},getElementsByTagNameNS:function(namespaceURI,localName){return new LiveNodeList(this,(function(base){var ls=[];return _visitNode(base,(function(node){node===base||node.nodeType!==ELEMENT_NODE||"*"!==namespaceURI&&node.namespaceURI!==namespaceURI||"*"!==localName&&node.localName!=localName||ls.push(node)})),ls}))}},Document.prototype.getElementsByTagName=Element.prototype.getElementsByTagName,Document.prototype.getElementsByTagNameNS=Element.prototype.getElementsByTagNameNS,_extends(Element,Node),Attr.prototype.nodeType=ATTRIBUTE_NODE,_extends(Attr,Node),CharacterData.prototype={data:"",substringData:function(offset,count){return this.data.substring(offset,offset+count)},appendData:function(text){text=this.data+text,this.nodeValue=this.data=text,this.length=text.length},insertData:function(offset,text){this.replaceData(offset,0,text)},appendChild:function(newChild){throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])},deleteData:function(offset,count){this.replaceData(offset,count,"")},replaceData:function(offset,count,text){text=this.data.substring(0,offset)+text+this.data.substring(offset+count),this.nodeValue=this.data=text,this.length=text.length}},_extends(CharacterData,Node),Text.prototype={nodeName:"#text",nodeType:TEXT_NODE,splitText:function(offset){var text=this.data,newText=text.substring(offset);text=text.substring(0,offset),this.data=this.nodeValue=text,this.length=text.length;var newNode=this.ownerDocument.createTextNode(newText);return this.parentNode&&this.parentNode.insertBefore(newNode,this.nextSibling),newNode}},_extends(Text,CharacterData),Comment.prototype={nodeName:"#comment",nodeType:COMMENT_NODE},_extends(Comment,CharacterData),CDATASection.prototype={nodeName:"#cdata-section",nodeType:CDATA_SECTION_NODE},_extends(CDATASection,CharacterData),DocumentType.prototype.nodeType=DOCUMENT_TYPE_NODE,_extends(DocumentType,Node),Notation.prototype.nodeType=NOTATION_NODE,_extends(Notation,Node),Entity.prototype.nodeType=ENTITY_NODE,_extends(Entity,Node),EntityReference.prototype.nodeType=ENTITY_REFERENCE_NODE,_extends(EntityReference,Node),DocumentFragment.prototype.nodeName="#document-fragment",DocumentFragment.prototype.nodeType=DOCUMENT_FRAGMENT_NODE,_extends(DocumentFragment,Node),ProcessingInstruction.prototype.nodeType=PROCESSING_INSTRUCTION_NODE,_extends(ProcessingInstruction,Node),XMLSerializer$1.prototype.serializeToString=function(node,isHtml,nodeFilter){return nodeSerializeToString.call(node,isHtml,nodeFilter)},Node.prototype.toString=nodeSerializeToString;try{if(Object.defineProperty){var getTextContent=function getTextContent(node){switch(node.nodeType){case ELEMENT_NODE:case DOCUMENT_FRAGMENT_NODE:var buf=[];for(node=node.firstChild;node;)7!==node.nodeType&&8!==node.nodeType&&buf.push(getTextContent(node)),node=node.nextSibling;return buf.join("");default:return node.nodeValue}};Object.defineProperty(LiveNodeList.prototype,"length",{get:function(){return _updateLiveList(this),this.$$length}}),Object.defineProperty(Node.prototype,"textContent",{get:function(){return getTextContent(this)},set:function(data){switch(this.nodeType){case ELEMENT_NODE:case DOCUMENT_FRAGMENT_NODE:for(;this.firstChild;)this.removeChild(this.firstChild);(data||String(data))&&this.appendChild(this.ownerDocument.createTextNode(data));break;default:this.data=data,this.value=data,this.nodeValue=data}}}),__set__=function(object,key,value){object["$$"+key]=value}}}catch(e){}var dom={DocumentType:DocumentType,DOMException:DOMException,DOMImplementation:DOMImplementation$1,Element:Element,Node:Node,NodeList:NodeList,XMLSerializer:XMLSerializer$1},entities=createCommonjsModule((function(module,exports){var freeze=conventions.freeze;exports.XML_ENTITIES=freeze({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),exports.HTML_ENTITIES=freeze({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),exports.entityMap=exports.HTML_ENTITIES}));entities.XML_ENTITIES,entities.HTML_ENTITIES,entities.entityMap;var NAMESPACE$1=conventions.NAMESPACE,nameStartChar=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,nameChar=new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),tagNamePattern=new RegExp("^"+nameStartChar.source+nameChar.source+"*(?::"+nameStartChar.source+nameChar.source+"*)?$");function ParseError$1(message,locator){this.message=message,this.locator=locator,Error.captureStackTrace&&Error.captureStackTrace(this,ParseError$1)}function XMLReader$1(){}function copyLocator(f,t){return t.lineNumber=f.lineNumber,t.columnNumber=f.columnNumber,t}function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){function addAttribute(qname,value,startIndex){el.attributeNames.hasOwnProperty(qname)&&errorHandler.fatalError("Attribute "+qname+" redefined"),el.addValue(qname,value,startIndex)}for(var attrName,p=++start,s=0;;){var c=source.charAt(p);switch(c){case"=":if(1===s)attrName=source.slice(start,p),s=3;else{if(2!==s)throw new Error("attribute equal must after attrName");s=3}break;case"'":case'"':if(3===s||1===s){if(1===s&&(errorHandler.warning('attribute value must after "="'),attrName=source.slice(start,p)),start=p+1,!((p=source.indexOf(c,start))>0))throw new Error("attribute value no end '"+c+"' match");addAttribute(attrName,value=source.slice(start,p).replace(/?\w+;/g,entityReplacer),start-1),s=5}else{if(4!=s)throw new Error('attribute value must after "="');addAttribute(attrName,value=source.slice(start,p).replace(/?\w+;/g,entityReplacer),start),errorHandler.warning('attribute "'+attrName+'" missed start quot('+c+")!!"),start=p+1,s=5}break;case"/":switch(s){case 0:el.setTagName(source.slice(start,p));case 5:case 6:case 7:s=7,el.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return errorHandler.error("unexpected end of input"),0==s&&el.setTagName(source.slice(start,p)),p;case">":switch(s){case 0:el.setTagName(source.slice(start,p));case 5:case 6:case 7:break;case 4:case 1:"/"===(value=source.slice(start,p)).slice(-1)&&(el.closed=!0,value=value.slice(0,-1));case 2:2===s&&(value=attrName),4==s?(errorHandler.warning('attribute "'+value+'" missed quot(")!'),addAttribute(attrName,value.replace(/?\w+;/g,entityReplacer),start)):(NAMESPACE$1.isHTML(currentNSMap[""])&&value.match(/^(?:disabled|checked|selected)$/i)||errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!'),addAttribute(value,value,start));break;case 3:throw new Error("attribute value missed!!")}return p;case"":c=" ";default:if(c<=" ")switch(s){case 0:el.setTagName(source.slice(start,p)),s=6;break;case 1:attrName=source.slice(start,p),s=2;break;case 4:var value=source.slice(start,p).replace(/?\w+;/g,entityReplacer);errorHandler.warning('attribute "'+value+'" missed quot(")!!'),addAttribute(attrName,value,start);case 5:s=6}else switch(s){case 2:el.tagName,NAMESPACE$1.isHTML(currentNSMap[""])&&attrName.match(/^(?:disabled|checked|selected)$/i)||errorHandler.warning('attribute "'+attrName+'" missed value!! "'+attrName+'" instead2!!'),addAttribute(attrName,attrName,start),start=p,s=1;break;case 5:errorHandler.warning('attribute space is required"'+attrName+'"!!');case 6:s=1,start=p;break;case 3:s=4,start=p;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}p++}}function appendElement$1(el,domBuilder,currentNSMap){for(var tagName=el.tagName,localNSMap=null,i=el.length;i--;){var a=el[i],qName=a.qName,value=a.value;if((nsp=qName.indexOf(":"))>0)var prefix=a.prefix=qName.slice(0,nsp),localName=qName.slice(nsp+1),nsPrefix="xmlns"===prefix&&localName;else localName=qName,prefix=null,nsPrefix="xmlns"===qName&&"";a.localName=localName,!1!==nsPrefix&&(null==localNSMap&&(localNSMap={},_copy(currentNSMap,currentNSMap={})),currentNSMap[nsPrefix]=localNSMap[nsPrefix]=value,a.uri=NAMESPACE$1.XMLNS,domBuilder.startPrefixMapping(nsPrefix,value))}for(i=el.length;i--;){(prefix=(a=el[i]).prefix)&&("xml"===prefix&&(a.uri=NAMESPACE$1.XML),"xmlns"!==prefix&&(a.uri=currentNSMap[prefix||""]))}var nsp;(nsp=tagName.indexOf(":"))>0?(prefix=el.prefix=tagName.slice(0,nsp),localName=el.localName=tagName.slice(nsp+1)):(prefix=null,localName=el.localName=tagName);var ns=el.uri=currentNSMap[prefix||""];if(domBuilder.startElement(ns,localName,tagName,el),!el.closed)return el.currentNSMap=currentNSMap,el.localNSMap=localNSMap,!0;if(domBuilder.endElement(ns,localName,tagName),localNSMap)for(prefix in localNSMap)domBuilder.endPrefixMapping(prefix)}function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){if(/^(?:script|textarea)$/i.test(tagName)){var elEndStart=source.indexOf(""+tagName+">",elStartEnd),text=source.substring(elStartEnd+1,elEndStart);if(/[&<]/.test(text))return/^script$/i.test(tagName)?(domBuilder.characters(text,0,text.length),elEndStart):(text=text.replace(/?\w+;/g,entityReplacer),domBuilder.characters(text,0,text.length),elEndStart)}return elStartEnd+1}function fixSelfClosed(source,elStartEnd,tagName,closeMap){var pos=closeMap[tagName];return null==pos&&((pos=source.lastIndexOf(""+tagName+">"))start?(domBuilder.comment(source,start+4,end-start-4),end+3):(errorHandler.error("Unclosed comment"),-1):-1;if("CDATA["==source.substr(start+3,6)){var end=source.indexOf("]]>",start+9);return domBuilder.startCDATA(),domBuilder.characters(source,start+9,end-start-9),domBuilder.endCDATA(),end+3}var matchs=function(source,start){var match,buf=[],reg=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;reg.lastIndex=start,reg.exec(source);for(;match=reg.exec(source);)if(buf.push(match),match[1])return buf}(source,start),len=matchs.length;if(len>1&&/!doctype/i.test(matchs[0][0])){var name=matchs[1][0],pubid=!1,sysid=!1;len>3&&(/^public$/i.test(matchs[2][0])?(pubid=matchs[3][0],sysid=len>4&&matchs[4][0]):/^system$/i.test(matchs[2][0])&&(sysid=matchs[3][0]));var lastMatch=matchs[len-1];return domBuilder.startDTD(name,pubid,sysid),domBuilder.endDTD(),lastMatch.index+lastMatch[0].length}return-1}function parseInstruction(source,start,domBuilder){var end=source.indexOf("?>",start);if(end){var match=source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return match?(match[0].length,domBuilder.processingInstruction(match[1],match[2]),end+2):-1}return-1}function ElementAttributes(){this.attributeNames={}}ParseError$1.prototype=new Error,ParseError$1.prototype.name=ParseError$1.name,XMLReader$1.prototype={parse:function(source,defaultNSMap,entityMap){var domBuilder=this.domBuilder;domBuilder.startDocument(),_copy(defaultNSMap,defaultNSMap={}),function(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){function fixedFromCharCode(code){if(code>65535){var surrogate1=55296+((code-=65536)>>10),surrogate2=56320+(1023&code);return String.fromCharCode(surrogate1,surrogate2)}return String.fromCharCode(code)}function entityReplacer(a){var k=a.slice(1,-1);return k in entityMap?entityMap[k]:"#"===k.charAt(0)?fixedFromCharCode(parseInt(k.substr(1).replace("x","0x"))):(errorHandler.error("entity not found:"+a),a)}function appendText(end){if(end>start){var xt=source.substring(start,end).replace(/?\w+;/g,entityReplacer);locator&&position(start),domBuilder.characters(xt,0,end-start),start=end}}function position(p,m){for(;p>=lineEnd&&(m=linePattern.exec(source));)lineStart=m.index,lineEnd=lineStart+m[0].length,locator.lineNumber++;locator.columnNumber=p-lineStart+1}var lineStart=0,lineEnd=0,linePattern=/.*(?:\r\n?|\n)|.*$/g,locator=domBuilder.locator,parseStack=[{currentNSMap:defaultNSMapCopy}],closeMap={},start=0;for(;;){try{var tagStart=source.indexOf("<",start);if(tagStart<0){if(!source.substr(start).match(/^\s*$/)){var doc=domBuilder.doc,text=doc.createTextNode(source.substr(start));doc.appendChild(text),domBuilder.currentElement=text}return}switch(tagStart>start&&appendText(tagStart),source.charAt(tagStart+1)){case"/":var end=source.indexOf(">",tagStart+3),tagName=source.substring(tagStart+2,end).replace(/[ \t\n\r]+$/g,""),config=parseStack.pop();end<0?(tagName=source.substring(tagStart+2).replace(/[\s<].*/,""),errorHandler.error("end tag name: "+tagName+" is not complete:"+config.tagName),end=tagStart+1+tagName.length):tagName.match(/\s)&&(tagName=tagName.replace(/[\s<].*/,""),errorHandler.error("end tag name: "+tagName+" maybe not complete"),end=tagStart+1+tagName.length);var localNSMap=config.localNSMap,endMatch=config.tagName==tagName;if(endMatch||config.tagName&&config.tagName.toLowerCase()==tagName.toLowerCase()){if(domBuilder.endElement(config.uri,config.localName,tagName),localNSMap)for(var prefix in localNSMap)domBuilder.endPrefixMapping(prefix);endMatch||errorHandler.fatalError("end tag name: "+tagName+" is not match the current start tagName:"+config.tagName)}else parseStack.push(config);end++;break;case"?":locator&&position(tagStart),end=parseInstruction(source,tagStart,domBuilder);break;case"!":locator&&position(tagStart),end=parseDCC(source,tagStart,domBuilder,errorHandler);break;default:locator&&position(tagStart);var el=new ElementAttributes,currentNSMap=parseStack[parseStack.length-1].currentNSMap,len=(end=parseElementStartPart(source,tagStart,el,currentNSMap,entityReplacer,errorHandler),el.length);if(!el.closed&&fixSelfClosed(source,end,el.tagName,closeMap)&&(el.closed=!0,entityMap.nbsp||errorHandler.warning("unclosed xml attribute")),locator&&len){for(var locator2=copyLocator(locator,{}),i=0;istart?start=end:appendText(Math.max(tagStart,start)+1)}}(source,defaultNSMap,entityMap,domBuilder,this.errorHandler),domBuilder.endDocument()}},ElementAttributes.prototype={setTagName:function(tagName){if(!tagNamePattern.test(tagName))throw new Error("invalid tagName:"+tagName);this.tagName=tagName},addValue:function(qName,value,offset){if(!tagNamePattern.test(qName))throw new Error("invalid attribute:"+qName);this.attributeNames[qName]=this.length,this[this.length++]={qName:qName,value:value,offset:offset}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}};var sax={XMLReader:XMLReader$1,ParseError:ParseError$1},DOMImplementation=dom.DOMImplementation,NAMESPACE=conventions.NAMESPACE,ParseError=sax.ParseError,XMLReader=sax.XMLReader;function DOMParser$1(options){this.options=options||{locator:{}}}function DOMHandler(){this.cdata=!1}function position(locator,node){node.lineNumber=locator.lineNumber,node.columnNumber=locator.columnNumber}function _locator(l){if(l)return"\n@"+(l.systemId||"")+"#[line:"+l.lineNumber+",col:"+l.columnNumber+"]"}function _toString(chars,start,length){return"string"==typeof chars?chars.substr(start,length):chars.length>=start+length||start?new java.lang.String(chars,start,length)+"":chars}function appendElement(hander,node){hander.currentElement?hander.currentElement.appendChild(node):hander.doc.appendChild(node)}DOMParser$1.prototype.parseFromString=function(source,mimeType){var options=this.options,sax=new XMLReader,domBuilder=options.domBuilder||new DOMHandler,errorHandler=options.errorHandler,locator=options.locator,defaultNSMap=options.xmlns||{},isHTML=/\/x?html?$/.test(mimeType),entityMap=isHTML?entities.HTML_ENTITIES:entities.XML_ENTITIES;return locator&&domBuilder.setDocumentLocator(locator),sax.errorHandler=function(errorImpl,domBuilder,locator){if(!errorImpl){if(domBuilder instanceof DOMHandler)return domBuilder;errorImpl=domBuilder}var errorHandler={},isCallback=errorImpl instanceof Function;function build(key){var fn=errorImpl[key];!fn&&isCallback&&(fn=2==errorImpl.length?function(msg){errorImpl(key,msg)}:errorImpl),errorHandler[key]=fn&&function(msg){fn("[xmldom "+key+"]\t"+msg+_locator(locator))}||function(){}}return locator=locator||{},build("warning"),build("error"),build("fatalError"),errorHandler}(errorHandler,domBuilder,locator),sax.domBuilder=options.domBuilder||domBuilder,isHTML&&(defaultNSMap[""]=NAMESPACE.HTML),defaultNSMap.xml=defaultNSMap.xml||NAMESPACE.XML,source&&"string"==typeof source?sax.parse(source,defaultNSMap,entityMap):sax.errorHandler.error("invalid doc source"),domBuilder.doc},DOMHandler.prototype={startDocument:function(){this.doc=(new DOMImplementation).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(namespaceURI,localName,qName,attrs){var doc=this.doc,el=doc.createElementNS(namespaceURI,qName||localName),len=attrs.length;appendElement(this,el),this.currentElement=el,this.locator&&position(this.locator,el);for(var i=0;ib.timeline?1:-1}));var lists,keyFunction},getMediaGroupPlaylists=function(manifest){var master,callback,mediaGroupPlaylists=[];return master=manifest,callback=function(properties,type,group,label){mediaGroupPlaylists=mediaGroupPlaylists.concat(properties.playlists||[])},SUPPORTED_MEDIA_TYPES.forEach((function(mediaType){for(var groupKey in master.mediaGroups[mediaType])for(var labelKey in master.mediaGroups[mediaType][groupKey]){var mediaProperties=master.mediaGroups[mediaType][groupKey][labelKey];callback(mediaProperties,mediaType,groupKey,labelKey)}})),mediaGroupPlaylists},updateMediaSequenceForPlaylist=function(_ref2){var playlist=_ref2.playlist,mediaSequence=_ref2.mediaSequence;playlist.mediaSequence=mediaSequence,playlist.segments.forEach((function(segment,index){segment.number=playlist.mediaSequence+index}))},positionManifestOnTimeline=function(_ref5){var oldManifest=_ref5.oldManifest,newManifest=_ref5.newManifest,oldPlaylists=oldManifest.playlists.concat(getMediaGroupPlaylists(oldManifest)),newPlaylists=newManifest.playlists.concat(getMediaGroupPlaylists(newManifest));return newManifest.timelineStarts=getUniqueTimelineStarts([oldManifest.timelineStarts,newManifest.timelineStarts]),function(_ref3){var oldPlaylists=_ref3.oldPlaylists,newPlaylists=_ref3.newPlaylists,timelineStarts=_ref3.timelineStarts;newPlaylists.forEach((function(playlist){playlist.discontinuitySequence=findIndex(timelineStarts,(function(_ref4){return _ref4.timeline===playlist.timeline}));var oldPlaylist=function(playlists,name){for(var i=0;ioldPlaylist.timeline||oldPlaylist.segments.length&&playlist.timeline>oldPlaylist.segments[oldPlaylist.segments.length-1].timeline)&&playlist.discontinuitySequence--);oldPlaylist.segments[oldMatchingSegmentIndex].discontinuity&&!firstNewSegment.discontinuity&&(firstNewSegment.discontinuity=!0,playlist.discontinuityStarts.unshift(0),playlist.discontinuitySequence--),updateMediaSequenceForPlaylist({playlist:playlist,mediaSequence:oldPlaylist.segments[oldMatchingSegmentIndex].number})}}))}({oldPlaylists:oldPlaylists,newPlaylists:newPlaylists,timelineStarts:newManifest.timelineStarts}),newManifest},generateSidxKey=function(sidx){return sidx&&sidx.uri+"-"+(byterange=sidx.byterange,endRange="bigint"==typeof byterange.offset||"bigint"==typeof byterange.length?window.BigInt(byterange.offset)+window.BigInt(byterange.length)-window.BigInt(1):byterange.offset+byterange.length-1,byterange.offset+"-"+endRange);var byterange,endRange},mergeDiscontiguousPlaylists=function(playlists){return values(playlists.reduce((function(acc,playlist){var name=playlist.attributes.id+(playlist.attributes.lang||"");if(acc[name]){var _acc$name$segments;if(playlist.segments)playlist.segments[0]&&(playlist.segments[0].discontinuity=!0),(_acc$name$segments=acc[name].segments).push.apply(_acc$name$segments,playlist.segments);playlist.attributes.contentProtection&&(acc[name].attributes.contentProtection=playlist.attributes.contentProtection)}else acc[name]=playlist,acc[name].attributes.timelineStarts=[];return acc[name].attributes.timelineStarts.push({start:playlist.attributes.periodStart,timeline:playlist.attributes.periodStart}),acc}),{})).map((function(playlist){var l,key;return playlist.discontinuityStarts=(l=playlist.segments||[],key="discontinuity",l.reduce((function(a,e,i){return e[key]&&a.push(i),a}),[])),playlist}))},addSidxSegmentsToPlaylist=function(playlist,sidxMapping){var sidxKey=generateSidxKey(playlist.sidx),sidxMatch=sidxKey&&sidxMapping[sidxKey]&&sidxMapping[sidxKey].sidx;return sidxMatch&&addSidxSegmentsToPlaylist$1(playlist,sidxMatch,playlist.sidx.resolvedUri),playlist},addSidxSegmentsToPlaylists=function(playlists,sidxMapping){if(void 0===sidxMapping&&(sidxMapping={}),!Object.keys(sidxMapping).length)return playlists;for(var i in playlists)playlists[i]=addSidxSegmentsToPlaylist(playlists[i],sidxMapping);return playlists},formatVideoPlaylist=function(_ref3){var _attributes2,attributes=_ref3.attributes,segments=_ref3.segments,sidx=_ref3.sidx,discontinuityStarts=_ref3.discontinuityStarts,playlist={attributes:(_attributes2={NAME:attributes.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:attributes.width,height:attributes.height},CODECS:attributes.codecs,BANDWIDTH:attributes.bandwidth},_attributes2["PROGRAM-ID"]=1,_attributes2),uri:"",endList:"static"===attributes.type,timeline:attributes.periodStart,resolvedUri:"",targetDuration:attributes.duration,discontinuityStarts:discontinuityStarts,timelineStarts:attributes.timelineStarts,segments:segments};return attributes.contentProtection&&(playlist.contentProtection=attributes.contentProtection),sidx&&(playlist.sidx=sidx),playlist},videoOnly=function(_ref4){var attributes=_ref4.attributes;return"video/mp4"===attributes.mimeType||"video/webm"===attributes.mimeType||"video"===attributes.contentType},audioOnly=function(_ref5){var attributes=_ref5.attributes;return"audio/mp4"===attributes.mimeType||"audio/webm"===attributes.mimeType||"audio"===attributes.contentType},vttOnly=function(_ref6){var attributes=_ref6.attributes;return"text/vtt"===attributes.mimeType||"text"===attributes.contentType},flattenMediaGroupPlaylists=function(mediaGroupObject){return mediaGroupObject?Object.keys(mediaGroupObject).reduce((function(acc,label){var labelContents=mediaGroupObject[label];return acc.concat(labelContents.playlists)}),[]):[]},toM3u8=function(_ref8){var _mediaGroups,dashPlaylists=_ref8.dashPlaylists,locations=_ref8.locations,_ref8$sidxMapping=_ref8.sidxMapping,sidxMapping=void 0===_ref8$sidxMapping?{}:_ref8$sidxMapping,previousManifest=_ref8.previousManifest;if(!dashPlaylists.length)return{};var _dashPlaylists$0$attr=dashPlaylists[0].attributes,duration=_dashPlaylists$0$attr.sourceDuration,type=_dashPlaylists$0$attr.type,suggestedPresentationDelay=_dashPlaylists$0$attr.suggestedPresentationDelay,minimumUpdatePeriod=_dashPlaylists$0$attr.minimumUpdatePeriod,videoPlaylists=mergeDiscontiguousPlaylists(dashPlaylists.filter(videoOnly)).map(formatVideoPlaylist),audioPlaylists=mergeDiscontiguousPlaylists(dashPlaylists.filter(audioOnly)),vttPlaylists=mergeDiscontiguousPlaylists(dashPlaylists.filter(vttOnly)),captions=dashPlaylists.map((function(playlist){return playlist.attributes.captionServices})).filter(Boolean),manifest={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(_mediaGroups={AUDIO:{},VIDEO:{}},_mediaGroups["CLOSED-CAPTIONS"]={},_mediaGroups.SUBTITLES={},_mediaGroups),uri:"",duration:duration,playlists:addSidxSegmentsToPlaylists(videoPlaylists,sidxMapping)};minimumUpdatePeriod>=0&&(manifest.minimumUpdatePeriod=1e3*minimumUpdatePeriod),locations&&(manifest.locations=locations),"dynamic"===type&&(manifest.suggestedPresentationDelay=suggestedPresentationDelay);var playlists,timelineStarts,isAudioOnly=0===manifest.playlists.length,organizedAudioGroup=audioPlaylists.length?function(playlists,sidxMapping,isAudioOnly){var mainPlaylist;void 0===sidxMapping&&(sidxMapping={}),void 0===isAudioOnly&&(isAudioOnly=!1);var formattedPlaylists=playlists.reduce((function(a,playlist){var role=playlist.attributes.role&&playlist.attributes.role.value||"",language=playlist.attributes.lang||"",label=playlist.attributes.label||"main";if(language&&!playlist.attributes.label){var roleLabel=role?" ("+role+")":"";label=""+playlist.attributes.lang+roleLabel}a[label]||(a[label]={language:language,autoselect:!0,default:"main"===role,playlists:[],uri:""});var formatted=addSidxSegmentsToPlaylist(function(_ref,isAudioOnly){var _attributes,attributes=_ref.attributes,segments=_ref.segments,sidx=_ref.sidx,mediaSequence=_ref.mediaSequence,discontinuitySequence=_ref.discontinuitySequence,discontinuityStarts=_ref.discontinuityStarts,playlist={attributes:(_attributes={NAME:attributes.id,BANDWIDTH:attributes.bandwidth,CODECS:attributes.codecs},_attributes["PROGRAM-ID"]=1,_attributes),uri:"",endList:"static"===attributes.type,timeline:attributes.periodStart,resolvedUri:"",targetDuration:attributes.duration,discontinuitySequence:discontinuitySequence,discontinuityStarts:discontinuityStarts,timelineStarts:attributes.timelineStarts,mediaSequence:mediaSequence,segments:segments};return attributes.contentProtection&&(playlist.contentProtection=attributes.contentProtection),sidx&&(playlist.sidx=sidx),isAudioOnly&&(playlist.attributes.AUDIO="audio",playlist.attributes.SUBTITLES="subs"),playlist}(playlist,isAudioOnly),sidxMapping);return a[label].playlists.push(formatted),void 0===mainPlaylist&&"main"===role&&((mainPlaylist=playlist).default=!0),a}),{});return mainPlaylist||(formattedPlaylists[Object.keys(formattedPlaylists)[0]].default=!0),formattedPlaylists}(audioPlaylists,sidxMapping,isAudioOnly):null,organizedVttGroup=vttPlaylists.length?function(playlists,sidxMapping){return void 0===sidxMapping&&(sidxMapping={}),playlists.reduce((function(a,playlist){var label=playlist.attributes.lang||"text";return a[label]||(a[label]={language:label,default:!1,autoselect:!1,playlists:[],uri:""}),a[label].playlists.push(addSidxSegmentsToPlaylist(function(_ref2){var _m3u8Attributes,attributes=_ref2.attributes,segments=_ref2.segments,mediaSequence=_ref2.mediaSequence,discontinuityStarts=_ref2.discontinuityStarts,discontinuitySequence=_ref2.discontinuitySequence;void 0===segments&&(segments=[{uri:attributes.baseUrl,timeline:attributes.periodStart,resolvedUri:attributes.baseUrl||"",duration:attributes.sourceDuration,number:0}],attributes.duration=attributes.sourceDuration);var m3u8Attributes=((_m3u8Attributes={NAME:attributes.id,BANDWIDTH:attributes.bandwidth})["PROGRAM-ID"]=1,_m3u8Attributes);return attributes.codecs&&(m3u8Attributes.CODECS=attributes.codecs),{attributes:m3u8Attributes,uri:"",endList:"static"===attributes.type,timeline:attributes.periodStart,resolvedUri:attributes.baseUrl||"",targetDuration:attributes.duration,timelineStarts:attributes.timelineStarts,discontinuityStarts:discontinuityStarts,discontinuitySequence:discontinuitySequence,mediaSequence:mediaSequence,segments:segments}}(playlist),sidxMapping)),a}),{})}(vttPlaylists,sidxMapping):null,formattedPlaylists=videoPlaylists.concat(flattenMediaGroupPlaylists(organizedAudioGroup),flattenMediaGroupPlaylists(organizedVttGroup)),playlistTimelineStarts=formattedPlaylists.map((function(_ref9){return _ref9.timelineStarts}));return manifest.timelineStarts=getUniqueTimelineStarts(playlistTimelineStarts),playlists=formattedPlaylists,timelineStarts=manifest.timelineStarts,playlists.forEach((function(playlist){playlist.mediaSequence=0,playlist.discontinuitySequence=findIndex(timelineStarts,(function(_ref7){return _ref7.timeline===playlist.timeline})),playlist.segments&&playlist.segments.forEach((function(segment,index){segment.number=index}))})),organizedAudioGroup&&(manifest.mediaGroups.AUDIO.audio=organizedAudioGroup),organizedVttGroup&&(manifest.mediaGroups.SUBTITLES.subs=organizedVttGroup),captions.length&&(manifest.mediaGroups["CLOSED-CAPTIONS"].cc=captions.reduce((function(svcObj,svc){return svc?(svc.forEach((function(service){var channel=service.channel,language=service.language;svcObj[language]={autoselect:!1,default:!1,instreamId:channel,language:language},service.hasOwnProperty("aspectRatio")&&(svcObj[language].aspectRatio=service.aspectRatio),service.hasOwnProperty("easyReader")&&(svcObj[language].easyReader=service.easyReader),service.hasOwnProperty("3D")&&(svcObj[language]["3D"]=service["3D"])})),svcObj):svcObj}),{})),previousManifest?positionManifestOnTimeline({oldManifest:previousManifest,newManifest:manifest}):manifest},getLiveRValue=function(attributes,time,duration){var NOW=attributes.NOW,clientOffset=attributes.clientOffset,availabilityStartTime=attributes.availabilityStartTime,_attributes$timescale=attributes.timescale,timescale=void 0===_attributes$timescale?1:_attributes$timescale,_attributes$periodSta=attributes.periodStart,periodStart=void 0===_attributes$periodSta?0:_attributes$periodSta,_attributes$minimumUp=attributes.minimumUpdatePeriod,periodDuration=(NOW+clientOffset)/1e3+(void 0===_attributes$minimumUp?0:_attributes$minimumUp)-(availabilityStartTime+periodStart);return Math.ceil((periodDuration*timescale-time)/duration)},parseByTimeline=function(attributes,segmentTimeline){for(var type=attributes.type,_attributes$minimumUp2=attributes.minimumUpdatePeriod,minimumUpdatePeriod=void 0===_attributes$minimumUp2?0:_attributes$minimumUp2,_attributes$media=attributes.media,media=void 0===_attributes$media?"":_attributes$media,sourceDuration=attributes.sourceDuration,_attributes$timescale2=attributes.timescale,timescale=void 0===_attributes$timescale2?1:_attributes$timescale2,_attributes$startNumb=attributes.startNumber,startNumber=void 0===_attributes$startNumb?1:_attributes$startNumb,timeline=attributes.periodStart,segments=[],time=-1,sIndex=0;sIndextime&&(time=segmentTime);var count=void 0;if(repeat<0){var nextS=sIndex+1;count=nextS===segmentTimeline.length?"dynamic"===type&&minimumUpdatePeriod>0&&media.indexOf("$Number$")>0?getLiveRValue(attributes,time,duration):(sourceDuration*timescale-time)/duration:(segmentTimeline[nextS].t-time)/duration}else count=repeat+1;for(var end=startNumber+segments.length+count,number=startNumber+segments.length;number=width?value:""+new Array(width-value.length+1).join("0")+value)}}(values))},segmentsFromTemplate=function(attributes,segmentTimeline){var templateValues={RepresentationID:attributes.id,Bandwidth:attributes.bandwidth||0},_attributes$initializ=attributes.initialization,initialization=void 0===_attributes$initializ?{sourceURL:"",range:""}:_attributes$initializ,mapSegment=urlTypeToSegment({baseUrl:attributes.baseUrl,source:constructTemplateUrl(initialization.sourceURL,templateValues),range:initialization.range}),segments=function(attributes,segmentTimeline){return attributes.duration||segmentTimeline?attributes.duration?parseByDuration(attributes):parseByTimeline(attributes,segmentTimeline):[{number:attributes.startNumber||1,duration:attributes.sourceDuration,time:0,timeline:attributes.periodStart}]}(attributes,segmentTimeline);return segments.map((function(segment){templateValues.Number=segment.number,templateValues.Time=segment.time;var uri=constructTemplateUrl(attributes.media||"",templateValues),timescale=attributes.timescale||1,presentationTimeOffset=attributes.presentationTimeOffset||0,presentationTime=attributes.periodStart+(segment.time-presentationTimeOffset)/timescale;return{uri:uri,timeline:segment.timeline,duration:segment.duration,resolvedUri:resolveUrl$1(attributes.baseUrl||"",uri),map:mapSegment,number:segment.number,presentationTime:presentationTime}}))},segmentsFromList=function(attributes,segmentTimeline){var duration=attributes.duration,_attributes$segmentUr=attributes.segmentUrls,segmentUrls=void 0===_attributes$segmentUr?[]:_attributes$segmentUr,periodStart=attributes.periodStart;if(!duration&&!segmentTimeline||duration&&segmentTimeline)throw new Error(errors_SEGMENT_TIME_UNSPECIFIED);var segmentTimeInfo,segmentUrlMap=segmentUrls.map((function(segmentUrlObject){return function(attributes,segmentUrl){var baseUrl=attributes.baseUrl,_attributes$initializ=attributes.initialization,initialization=void 0===_attributes$initializ?{}:_attributes$initializ,initSegment=urlTypeToSegment({baseUrl:baseUrl,source:initialization.sourceURL,range:initialization.range}),segment=urlTypeToSegment({baseUrl:baseUrl,source:segmentUrl.media,range:segmentUrl.mediaRange});return segment.map=initSegment,segment}(attributes,segmentUrlObject)}));return duration&&(segmentTimeInfo=parseByDuration(attributes)),segmentTimeline&&(segmentTimeInfo=parseByTimeline(attributes,segmentTimeline)),segmentTimeInfo.map((function(segmentTime,index){if(segmentUrlMap[index]){var segment=segmentUrlMap[index],timescale=attributes.timescale||1,presentationTimeOffset=attributes.presentationTimeOffset||0;return segment.timeline=segmentTime.timeline,segment.duration=segmentTime.duration,segment.number=segmentTime.number,segment.presentationTime=periodStart+(segmentTime.time-presentationTimeOffset)/timescale,segment}})).filter((function(segment){return segment}))},generateSegments=function(_ref){var segmentAttributes,segmentsFn,attributes=_ref.attributes,segmentInfo=_ref.segmentInfo;segmentInfo.template?(segmentsFn=segmentsFromTemplate,segmentAttributes=merge(attributes,segmentInfo.template)):segmentInfo.base?(segmentsFn=segmentsFromBase,segmentAttributes=merge(attributes,segmentInfo.base)):segmentInfo.list&&(segmentsFn=segmentsFromList,segmentAttributes=merge(attributes,segmentInfo.list));var segmentsInfo={attributes:attributes};if(!segmentsFn)return segmentsInfo;var segments=segmentsFn(segmentAttributes,segmentInfo.segmentTimeline);if(segmentAttributes.duration){var _segmentAttributes=segmentAttributes,duration=_segmentAttributes.duration,_segmentAttributes$ti=_segmentAttributes.timescale,timescale=void 0===_segmentAttributes$ti?1:_segmentAttributes$ti;segmentAttributes.duration=duration/timescale}else segments.length?segmentAttributes.duration=segments.reduce((function(max,segment){return Math.max(max,Math.ceil(segment.duration))}),0):segmentAttributes.duration=0;return segmentsInfo.attributes=segmentAttributes,segmentsInfo.segments=segments,segmentInfo.base&&segmentAttributes.indexRange&&(segmentsInfo.sidx=segments[0],segmentsInfo.segments=[]),segmentsInfo},findChildren=function(element,name){return from(element.childNodes).filter((function(_ref){return _ref.tagName===name}))},getContent=function(element){return element.textContent.trim()},parseDuration=function(str){var match=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(str);if(!match)return 0;var _match$slice=match.slice(1),year=_match$slice[0],month=_match$slice[1],day=_match$slice[2],hour=_match$slice[3],minute=_match$slice[4],second=_match$slice[5];return 31536e3*parseFloat(year||0)+2592e3*parseFloat(month||0)+86400*parseFloat(day||0)+3600*parseFloat(hour||0)+60*parseFloat(minute||0)+parseFloat(second||0)},parsers={mediaPresentationDuration:function(value){return parseDuration(value)},availabilityStartTime:function(value){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(str=value)&&(str+="Z"),Date.parse(str)/1e3;var str},minimumUpdatePeriod:function(value){return parseDuration(value)},suggestedPresentationDelay:function(value){return parseDuration(value)},type:function(value){return value},timeShiftBufferDepth:function(value){return parseDuration(value)},start:function(value){return parseDuration(value)},width:function(value){return parseInt(value,10)},height:function(value){return parseInt(value,10)},bandwidth:function(value){return parseInt(value,10)},startNumber:function(value){return parseInt(value,10)},timescale:function(value){return parseInt(value,10)},presentationTimeOffset:function(value){return parseInt(value,10)},duration:function(value){var parsedValue=parseInt(value,10);return isNaN(parsedValue)?parseDuration(value):parsedValue},d:function(value){return parseInt(value,10)},t:function(value){return parseInt(value,10)},r:function(value){return parseInt(value,10)},DEFAULT:function(value){return value}},parseAttributes=function(el){return el&&el.attributes?from(el.attributes).reduce((function(a,e){var parseFn=parsers[e.name]||parsers.DEFAULT;return a[e.name]=parseFn(e.value),a}),{}):{}},keySystemsMap={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},buildBaseUrls=function(referenceUrls,baseUrlElements){return baseUrlElements.length?flatten(referenceUrls.map((function(reference){return baseUrlElements.map((function(baseUrlElement){return resolveUrl$1(reference,getContent(baseUrlElement))}))}))):referenceUrls},getSegmentInformation=function(adaptationSet){var segmentTemplate=findChildren(adaptationSet,"SegmentTemplate")[0],segmentList=findChildren(adaptationSet,"SegmentList")[0],segmentUrls=segmentList&&findChildren(segmentList,"SegmentURL").map((function(s){return merge({tag:"SegmentURL"},parseAttributes(s))})),segmentBase=findChildren(adaptationSet,"SegmentBase")[0],segmentTimelineParentNode=segmentList||segmentTemplate,segmentTimeline=segmentTimelineParentNode&&findChildren(segmentTimelineParentNode,"SegmentTimeline")[0],segmentInitializationParentNode=segmentList||segmentBase||segmentTemplate,segmentInitialization=segmentInitializationParentNode&&findChildren(segmentInitializationParentNode,"Initialization")[0],template=segmentTemplate&&parseAttributes(segmentTemplate);template&&segmentInitialization?template.initialization=segmentInitialization&&parseAttributes(segmentInitialization):template&&template.initialization&&(template.initialization={sourceURL:template.initialization});var segmentInfo={template:template,segmentTimeline:segmentTimeline&&findChildren(segmentTimeline,"S").map((function(s){return parseAttributes(s)})),list:segmentList&&merge(parseAttributes(segmentList),{segmentUrls:segmentUrls,initialization:parseAttributes(segmentInitialization)}),base:segmentBase&&merge(parseAttributes(segmentBase),{initialization:parseAttributes(segmentInitialization)})};return Object.keys(segmentInfo).forEach((function(key){segmentInfo[key]||delete segmentInfo[key]})),segmentInfo},toRepresentations=function(periodAttributes,periodBaseUrls,periodSegmentInfo){return function(adaptationSet){var service,adaptationSetAttributes=parseAttributes(adaptationSet),adaptationSetBaseUrls=buildBaseUrls(periodBaseUrls,findChildren(adaptationSet,"BaseURL")),role=findChildren(adaptationSet,"Role")[0],roleAttributes={role:parseAttributes(role)},attrs=merge(periodAttributes,adaptationSetAttributes,roleAttributes),accessibility=findChildren(adaptationSet,"Accessibility")[0],captionServices="urn:scte:dash:cc:cea-608:2015"===(service=parseAttributes(accessibility)).schemeIdUri?("string"!=typeof service.value?[]:service.value.split(";")).map((function(value){var channel,language;if(language=value,/^CC\d=/.test(value)){var _value$split=value.split("=");channel=_value$split[0],language=_value$split[1]}else/^CC\d$/.test(value)&&(channel=value);return{channel:channel,language:language}})):"urn:scte:dash:cc:cea-708:2015"===service.schemeIdUri?("string"!=typeof service.value?[]:service.value.split(";")).map((function(value){var flags={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(value)){var _value$split2=value.split("="),channel=_value$split2[0],_value$split2$=_value$split2[1],opts=void 0===_value$split2$?"":_value$split2$;flags.channel=channel,flags.language=value,opts.split(",").forEach((function(opt){var _opt$split=opt.split(":"),name=_opt$split[0],val=_opt$split[1];"lang"===name?flags.language=val:"er"===name?flags.easyReader=Number(val):"war"===name?flags.aspectRatio=Number(val):"3D"===name&&(flags["3D"]=Number(val))}))}else flags.language=value;return flags.channel&&(flags.channel="SERVICE"+flags.channel),flags})):void 0;captionServices&&(attrs=merge(attrs,{captionServices:captionServices}));var label=findChildren(adaptationSet,"Label")[0];if(label&&label.childNodes.length){var labelVal=label.childNodes[0].nodeValue.trim();attrs=merge(attrs,{label:labelVal})}var contentProtection=findChildren(adaptationSet,"ContentProtection").reduce((function(acc,node){var attributes=parseAttributes(node);attributes.schemeIdUri&&(attributes.schemeIdUri=attributes.schemeIdUri.toLowerCase());var keySystem=keySystemsMap[attributes.schemeIdUri];if(keySystem){acc[keySystem]={attributes:attributes};var psshNode=findChildren(node,"cenc:pssh")[0];if(psshNode){var pssh=getContent(psshNode);acc[keySystem].pssh=pssh&&decodeB64ToUint8Array(pssh)}}return acc}),{});Object.keys(contentProtection).length&&(attrs=merge(attrs,{contentProtection:contentProtection}));var segmentInfo=getSegmentInformation(adaptationSet),representations=findChildren(adaptationSet,"Representation"),adaptationSetSegmentInfo=merge(periodSegmentInfo,segmentInfo);return flatten(representations.map(function(adaptationSetAttributes,adaptationSetBaseUrls,adaptationSetSegmentInfo){return function(representation){var repBaseUrlElements=findChildren(representation,"BaseURL"),repBaseUrls=buildBaseUrls(adaptationSetBaseUrls,repBaseUrlElements),attributes=merge(adaptationSetAttributes,parseAttributes(representation)),representationSegmentInfo=getSegmentInformation(representation);return repBaseUrls.map((function(baseUrl){return{segmentInfo:merge(adaptationSetSegmentInfo,representationSegmentInfo),attributes:merge(attributes,{baseUrl:baseUrl})}}))}}(attrs,adaptationSetBaseUrls,adaptationSetSegmentInfo)))}},toAdaptationSets=function(mpdAttributes,mpdBaseUrls){return function(period,index){var periodBaseUrls=buildBaseUrls(mpdBaseUrls,findChildren(period.node,"BaseURL")),periodAttributes=merge(mpdAttributes,{periodStart:period.attributes.start});"number"==typeof period.attributes.duration&&(periodAttributes.periodDuration=period.attributes.duration);var adaptationSets=findChildren(period.node,"AdaptationSet"),periodSegmentInfo=getSegmentInformation(period.node);return flatten(adaptationSets.map(toRepresentations(periodAttributes,periodBaseUrls,periodSegmentInfo)))}},stringToMpdXml=function(manifestString){if(""===manifestString)throw new Error(errors_DASH_EMPTY_MANIFEST);var xml,mpd,parser=new DOMParser;try{mpd=(xml=parser.parseFromString(manifestString,"application/xml"))&&"MPD"===xml.documentElement.tagName?xml.documentElement:null}catch(e){}if(!mpd||mpd&&mpd.getElementsByTagName("parsererror").length>0)throw new Error(errors_DASH_INVALID_XML);return mpd},parse=function(manifestString,options){void 0===options&&(options={});var parsedManifestInfo=function(mpd,options){void 0===options&&(options={});var _options=options,_options$manifestUri=_options.manifestUri,manifestUri=void 0===_options$manifestUri?"":_options$manifestUri,_options$NOW=_options.NOW,NOW=void 0===_options$NOW?Date.now():_options$NOW,_options$clientOffset=_options.clientOffset,clientOffset=void 0===_options$clientOffset?0:_options$clientOffset,periodNodes=findChildren(mpd,"Period");if(!periodNodes.length)throw new Error(errors_INVALID_NUMBER_OF_PERIOD);var locations=findChildren(mpd,"Location"),mpdAttributes=parseAttributes(mpd),mpdBaseUrls=buildBaseUrls([manifestUri],findChildren(mpd,"BaseURL"));mpdAttributes.type=mpdAttributes.type||"static",mpdAttributes.sourceDuration=mpdAttributes.mediaPresentationDuration||0,mpdAttributes.NOW=NOW,mpdAttributes.clientOffset=clientOffset,locations.length&&(mpdAttributes.locations=locations.map(getContent));var periods=[];return periodNodes.forEach((function(node,index){var attributes=parseAttributes(node),priorPeriod=periods[index-1];attributes.start=function(_ref){var attributes=_ref.attributes,priorPeriodAttributes=_ref.priorPeriodAttributes,mpdType=_ref.mpdType;return"number"==typeof attributes.start?attributes.start:priorPeriodAttributes&&"number"==typeof priorPeriodAttributes.start&&"number"==typeof priorPeriodAttributes.duration?priorPeriodAttributes.start+priorPeriodAttributes.duration:priorPeriodAttributes||"static"!==mpdType?null:0}({attributes:attributes,priorPeriodAttributes:priorPeriod?priorPeriod.attributes:null,mpdType:mpdAttributes.type}),periods.push({node:node,attributes:attributes})})),{locations:mpdAttributes.locations,representationInfo:flatten(periods.map(toAdaptationSets(mpdAttributes,mpdBaseUrls)))}}(stringToMpdXml(manifestString),options),playlists=parsedManifestInfo.representationInfo.map(generateSegments);return toM3u8({dashPlaylists:playlists,locations:parsedManifestInfo.locations,sidxMapping:options.sidxMapping,previousManifest:options.previousManifest})},parseUTCTiming=function(manifestString){return function(mpd){var UTCTimingNode=findChildren(mpd,"UTCTiming")[0];if(!UTCTimingNode)return null;var attributes=parseAttributes(UTCTimingNode);switch(attributes.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":attributes.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":attributes.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":attributes.method="DIRECT",attributes.value=Date.parse(attributes.value);break;default:throw new Error(errors_UNSUPPORTED_UTC_TIMING_SCHEME)}return attributes}(stringToMpdXml(manifestString))},MAX_UINT32=Math.pow(2,32),getUint64=function(uint8){var value,dv=new DataView(uint8.buffer,uint8.byteOffset,uint8.byteLength);return dv.getBigUint64?(value=dv.getBigUint64(0))0;i+=12,referenceCount--)result.references.push({referenceType:(128&data[i])>>>7,referencedSize:2147483647&view.getUint32(i),subsegmentDuration:view.getUint32(i+4),startsWithSap:!!(128&data[i+8]),sapType:(112&data[i+8])>>>4,sapDeltaTime:268435455&view.getUint32(i+8)});return result},ID3=toUint8([73,68,51]),getId3Offset=function getId3Offset(bytes,offset){return void 0===offset&&(offset=0),(bytes=toUint8(bytes)).length-offset<10||!bytesMatch(bytes,ID3,{offset:offset})?offset:(offset+=function(bytes,offset){void 0===offset&&(offset=0);var flags=(bytes=toUint8(bytes))[offset+5],returnSize=bytes[offset+6]<<21|bytes[offset+7]<<14|bytes[offset+8]<<7|bytes[offset+9];return(16&flags)>>4?returnSize+20:returnSize+10}(bytes,offset),getId3Offset(bytes,offset))},normalizePath$1=function(path){return"string"==typeof path?stringToBytes(path):path},findBox=function findBox(bytes,paths,complete){void 0===complete&&(complete=!1),paths=function(paths){return Array.isArray(paths)?paths.map((function(p){return normalizePath$1(p)})):[normalizePath$1(paths)]}(paths),bytes=toUint8(bytes);var results=[];if(!paths.length)return results;for(var i=0;i>>0,type=bytes.subarray(i+4,i+8);if(0===size)break;var end=i+size;if(end>bytes.length){if(complete)break;end=bytes.length}var data=bytes.subarray(i+8,end);bytesMatch(type,paths[0])&&(1===paths.length?results.push(data):results.push.apply(results,findBox(data,paths.slice(1),complete))),i=end}return results},EBML_TAGS={EBML:toUint8([26,69,223,163]),DocType:toUint8([66,130]),Segment:toUint8([24,83,128,103]),SegmentInfo:toUint8([21,73,169,102]),Tracks:toUint8([22,84,174,107]),Track:toUint8([174]),TrackNumber:toUint8([215]),DefaultDuration:toUint8([35,227,131]),TrackEntry:toUint8([174]),TrackType:toUint8([131]),FlagDefault:toUint8([136]),CodecID:toUint8([134]),CodecPrivate:toUint8([99,162]),VideoTrack:toUint8([224]),AudioTrack:toUint8([225]),Cluster:toUint8([31,67,182,117]),Timestamp:toUint8([231]),TimestampScale:toUint8([42,215,177]),BlockGroup:toUint8([160]),BlockDuration:toUint8([155]),Block:toUint8([161]),SimpleBlock:toUint8([163])},LENGTH_TABLE=[128,64,32,16,8,4,2,1],getvint=function(bytes,offset,removeLength,signed){void 0===removeLength&&(removeLength=!0),void 0===signed&&(signed=!1);var length=function(_byte){for(var len=1,i=0;i=bytes.length)return bytes.length;var innerid=getvint(bytes,offset,!1);if(bytesMatch(id.bytes,innerid.bytes))return offset;var dataHeader=getvint(bytes,offset+innerid.length);return getInfinityDataSize(id,bytes,offset+dataHeader.length+dataHeader.value+innerid.length)},findEbml=function findEbml(bytes,paths){paths=function(paths){return Array.isArray(paths)?paths.map((function(p){return normalizePath(p)})):[normalizePath(paths)]}(paths),bytes=toUint8(bytes);var results=[];if(!paths.length)return results;for(var i=0;i