\n"})).replace(/~0/g,""),n--,e};var y=function(e){return e=(e=(e+="~0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(e,t,n){var r=t,o=n;return r=w(D(r)),r=(r=(r=N(r)).replace(/^\n+/g,"")).replace(/\n+$/g,""),b(r=""+r+"\n
")+o})).replace(/~0/,"")},b=function(e){return e=e.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(s.push(e)-1)+"K\n\n"},x=function(e){return e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(e,t,n,r,o){var i=r;return i=(i=i.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),t+""+(i=w(i))+"
"})},w=function(e){return e=(e=(e=e.replace(/&/g,"&")).replace(//g,">"),e=q(e,"*_{}[]\\",!1)},T=function(e){return e=(e=e.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"$2")).replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"$2")},k=function(e){return e=e.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(e,t){var n=t;return n=(n=(n=n.replace(/^[ \t]*>[ \t]?/gm,"~0")).replace(/~0/g,"")).replace(/^[ \t]+$/gm,""),n=(n=(n=a(n)).replace(/(^|\n)/g,"$1 ")).replace(/(\s*[^\r]+?<\/pre>)/gm,function(e,t){var n=t;return n=(n=n.replace(/^ /gm,"~0")).replace(/~0/g,"")}),b("\n"+n+"\n
")})},C=function(e){for(var t=(e=(e=e.replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),n=new Array,r=t.length,o=0;o"),i+="",n.push(i))}r=n.length;for(o=0;o#+-.!])/g,$)},S=function(e){return e=(e=e.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,'$1')).replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,function(e,t){return E(j(t))})},E=function(e){var n=[function(e){return""+e.charCodeAt(0)+";"},function(e){return""+function(e){var t="0123456789ABCDEF",n=e.charCodeAt(0);return t.charAt(n>>4)+t.charAt(15&n)}(e)+";"},function(e){return e}];return e=(e=''+e+"").replace(/">.+:/g,'">')},j=function(e){return e=e.replace(/~E(\d+)E/g,function(e,t){var n=parseInt(t);return String.fromCharCode(n)})},D=function(e){return e=(e=e.replace(/^(\t|[ ]{1,4})/gm,"~0")).replace(/~0/g,"")},N=function(e){return e=(e=(e=(e=(e=e.replace(/\t(?=\t)/g," ")).replace(/\t/g,"~A~B")).replace(/~B(.+?)~A/g,function(e,t,n){for(var r=t,o=4-r.length%4,i=0;i');n.append($('####################################################
Uploading... '+t.name+"
")),$(n).appendTo($(".queue"));var r=new XMLHttpRequest;r.upload.addEventListener("progress",function(e){var t=parseInt(e.loaded/e.total*100);$(".upload-progress",$(n)).show(),$(".upload-progress .bar",$(n)).css("width",t+"%"),$(".upload-progress span ",$(n)).empty().append(t+"%")},!1),r.onreadystatechange=function(){if(4===r.readyState){$("#web").addClass("uploading"),200===r.status?$(n).html(''+r.responseText+""):$(n).html("Error ("+r.status+") during upload of file "+t.name+"");var e=a.indexOf(r);-1 e.removeAttribute("style"));
+Array.prototype.slice.call(document.getElementsByClassName("nojs")).forEach(e => e.style.display = "none");
+document.getElementById('fileinput').setAttribute('multiple','');
+
+// get form
+const form = document.getElementById('dropzone');
+
+function upload(file) {
+ // create the XHR
+ const xhr = new XMLHttpRequest();
+
+ // Create list item
+ const list=document.getElementById('links');
+ var entry=document.createElement('li');
+ entry.innerHTML = file.name + '
';
+ list.appendChild(entry);
+
+ // Progress bar
+ xhr.upload.addEventListener('progress', function(e) {
+ entry.innerHTML = file.name + '
';
+ });
+
+ // Links response
+ xhr.onload = () => {
+ entry.innerHTML = '' + xhr.responseText + '';
+ };
+
+ // create and send the request
+ xhr.open('PUT', '/' + file.name);
+ xhr.send(file);
+}
+
+// add event listener on form
+form.addEventListener('submit', e => {
+ // disable normal sending
+ e.preventDefault();
+
+ // get file list
+ const files = document.getElementById('fileinput').files;
+
+ // upload each file
+ for (let i = 0; i < files.length; i++) {
+ upload(files[i]);
+ }
+});
diff --git a/scripts/vendor/modernizr.js b/scripts/vendor/modernizr.js
deleted file mode 100644
index d8ddf6f..0000000
--- a/scripts/vendor/modernizr.js
+++ /dev/null
@@ -1 +0,0 @@
-window.Modernizr=function(r,d,i){var e,o,a,c={},f=d.documentElement,m="modernizr",t=d.createElement(m),s=t.style,u=d.createElement("input"),l=":)",n={}.toString,p=" -webkit- -moz- -o- -ms- ".split(" "),h="Webkit Moz O ms",g=h.split(" "),v=h.toLowerCase().split(" "),y="http://www.w3.org/2000/svg",b={},E={},x={},w=[],S=w.slice,C=function(e,t,n,r){var o,a,i,c,s=d.createElement("div"),u=d.body,l=u||d.createElement("body");if(parseInt(n,10))for(;n--;)(i=d.createElement("div")).id=r?r[n]:m+(n+1),s.appendChild(i);return o=["",'"].join(""),s.id=m,(u?s:l).innerHTML+=o,l.appendChild(s),u||(l.style.background="",l.style.overflow="hidden",c=f.style.overflow,f.style.overflow="hidden",f.appendChild(l)),a=t(s,e),u?s.parentNode.removeChild(s):(l.parentNode.removeChild(l),f.style.overflow=c),!!a},k=(a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"},function(e,t){t=t||d.createElement(a[e]||"div");var n=(e="on"+e)in t;return n||(t.setAttribute||(t=d.createElement("div")),t.setAttribute&&t.removeAttribute&&(t.setAttribute(e,""),n=M(t[e],"function"),M(t[e],"undefined")||(t[e]=i),t.removeAttribute(e))),t=null,n}),T={}.hasOwnProperty;function N(e){s.cssText=e}function M(e,t){return typeof e===t}function P(e,t){return!!~(""+e).indexOf(t)}function j(e,t){for(var n in e){var r=e[n];if(!P(r,"-")&&s[r]!==i)return"pfx"!=t||r}return!1}function $(e,t,n){var r=e.charAt(0).toUpperCase()+e.slice(1),o=(e+" "+g.join(r+" ")+r).split(" ");return M(t,"string")||M(t,"undefined")?j(o,t):function(e,t,n){for(var r in e){var o=t[e[r]];if(o!==i)return!1===n?e[r]:M(o,"function")?o.bind(n||t):o}return!1}(o=(e+" "+v.join(r+" ")+r).split(" "),t,n)}for(var D in o=M(T,"undefined")||M(T.call,"undefined")?function(e,t){return t in e&&M(e.constructor.prototype[t],"undefined")}:function(e,t){return T.call(e,t)},Function.prototype.bind||(Function.prototype.bind=function(r){var o=this;if("function"!=typeof o)throw new TypeError;var a=S.call(arguments,1),i=function(){if(this instanceof i){var e=function(){};e.prototype=o.prototype;var t=new e,n=o.apply(t,a.concat(S.call(arguments)));return Object(n)===n?n:t}return o.apply(r,a.concat(S.call(arguments)))};return i}),b.flexbox=function(){return $("flexWrap")},b.flexboxlegacy=function(){return $("boxDirection")},b.canvas=function(){var e=d.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))},b.canvastext=function(){return!(!c.canvas||!M(d.createElement("canvas").getContext("2d").fillText,"function"))},b.webgl=function(){return!!r.WebGLRenderingContext},b.touch=function(){var t;return"ontouchstart"in r||r.DocumentTouch&&d instanceof DocumentTouch?t=!0:C(["@media (",p.join("touch-enabled),("),m,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(e){t=9===e.offsetTop}),t},b.geolocation=function(){return"geolocation"in navigator},b.postmessage=function(){return!!r.postMessage},b.websqldatabase=function(){return!!r.openDatabase},b.indexedDB=function(){return!!$("indexedDB",r)},b.hashchange=function(){return k("hashchange",r)&&(d.documentMode===i||7",r.insertBefore(n.lastChild,r.firstChild)}(e,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),c||function(t,n){n.cache||(n.cache={},n.createElem=t.createElement,n.createFrag=t.createDocumentFragment,n.frag=n.createFrag()),t.createElement=function(e){return p.shivMethods?f(e,t,n):n.createElem(e)},t.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(e){return n.createElem(e),n.frag.createElement(e),'c("'+e+'")'})+");return n}")(p,n.frag)}(e,t),e}!function(){try{var e=i.createElement("a");e.innerHTML="",n="hidden"in e,c=1==e.childNodes.length||function(){i.createElement("a");var e=i.createDocumentFragment();return void 0===e.cloneNode||void 0===e.createDocumentFragment||void 0===e.createElement}()}catch(e){c=n=!0}}();var p={elements:t.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:!1!==t.shivCSS,supportsUnknownElements:c,shivMethods:!1!==t.shivMethods,type:"default",shivDocument:m,createElement:f,createDocumentFragment:function(e,t){if(e||(e=i),c)return e.createDocumentFragment();for(var n=(t=t||d(e)).frag.cloneNode(),r=0,o=l(),a=o.length;r',i=n.firstChild,n.setAttribute("style","display:none; position:absolute;"),d.body.appendChild(n));for(var a={},s=0;sx',e=t.firstChild.href}return e},Qt=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""},Jt=function(e,t){void 0===t&&(t=T.location);var i=Yt(e);return(":"===i.protocol?t.protocol:i.protocol)+i.host!==t.protocol+t.host},Zt=Object.freeze({__proto__:null,parseUrl:Yt,getAbsoluteURL:$t,getFileExtension:Qt,isCrossOrigin:Jt}),ei=function(e){var t=ti.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},ti=Object.prototype.toString;var ii=function(e){var r={};return e&&e.trim().split("\n").forEach(function(e){var t=e.indexOf(":"),i=e.slice(0,t).trim().toLowerCase(),n=e.slice(t+1).trim();void 0===r[i]?r[i]=n:Array.isArray(r[i])?r[i].push(n):r[i]=[r[i],n]}),r},ni=si,ri=si;function ai(e,t,i){var n=e;return ei(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=m({},t,{uri:e}),n.callback=i,n}function si(e,t,i){return oi(t=ai(e,t,i))}function oi(n){if(void 0===n.callback)throw new Error("callback argument missing");var r=!1,a=function(e,t,i){r||(r=!0,n.callback(e,t,i))};function t(e){return clearTimeout(u),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,a(e,m)}function e(){if(!s){var e;clearTimeout(u),e=n.useXDR&&void 0===o.status?200:1223===o.status?204:o.status;var t=m,i=null;return 0!==e?(t={body:function(){var e=void 0;if(e=o.response?o.response:o.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(o),f)try{e=JSON.parse(e)}catch(e){}return e}(),statusCode:e,method:c,headers:{},url:l,rawRequest:o},o.getAllResponseHeaders&&(t.headers=ii(o.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),a(i,t,t.body)}}var i,s,o=n.xhr||null;o||(o=n.cors||n.useXDR?new si.XDomainRequest:new si.XMLHttpRequest);var u,l=o.url=n.uri||n.url,c=o.method=n.method||"GET",d=n.body||n.data,h=o.headers=n.headers||{},p=!!n.sync,f=!1,m={body:void 0,headers:{},statusCode:0,method:c,url:l,rawRequest:o};if("json"in n&&!1!==n.json&&(f=!0,h.accept||h.Accept||(h.Accept="application/json"),"GET"!==c&&"HEAD"!==c&&(h["content-type"]||h["Content-Type"]||(h["Content-Type"]="application/json"),d=JSON.stringify(!0===n.json?d:n.json))),o.onreadystatechange=function(){4===o.readyState&&setTimeout(e,0)},o.onload=e,o.onerror=t,o.onprogress=function(){},o.onabort=function(){s=!0},o.ontimeout=t,o.open(c,l,!p,n.username,n.password),p||(o.withCredentials=!!n.withCredentials),!p&&0=e?t.push(r):r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e&&t.push(r)}if(o=!1,t.length!==this.activeCues_.length)o=!0;else for(var a=0;a]*>?)?/);return e=t[1]?t[1]:t[2],i=i.substr(e.length),e}function t(e,t){var i=Ci[e];if(!i)return null;var n=a.document.createElement(i),r=wi[e];return r&&t&&(n[r]=t.trim()),n}for(var n,r,s,o,u=a.document.createElement("div"),l=u,c=[];null!==(n=e());)if("<"!==n[0])l.appendChild(a.document.createTextNode((r=n,ki.innerHTML=r,r=ki.textContent,ki.textContent="",r)));else{if("/"===n[1]){c.length&&c[c.length-1]===n.substr(2).replace(">","")&&(c.pop(),l=l.parentNode);continue}var d,h=_i(n.substr(1,n.length-2));if(h){d=a.document.createProcessingInstruction("timestamp",h),l.appendChild(d);continue}var p=n.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!p)continue;if(!(d=t(p[1],p[3])))continue;if(s=l,Ii[(o=d).localName]&&Ii[o.localName]!==s.localName)continue;if(p[2]){var f=p[2].split(".");f.forEach(function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(Ei.hasOwnProperty(i)){var n=t?"background-color":"color",r=Ei[i];d.style[n]=r}}),d.className=f.join(" ")}c.push(p[1]),l.appendChild(d),l=d}return u}var xi=[[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 Pi(e){for(var t=0;t=i[0]&&e<=i[1])return!0}return!1}function Li(){}function Di(e,t,i){Li.call(this),this.cue=t,this.cueDiv=Ai(e,t.text);var n={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:function(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function r(e,t){for(var i=t.childNodes.length-1;0<=i;i--)e.push(t.childNodes[i])}function a(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var n=i.match(/^.*(\n|\r)/);return n?n[e.length=0]:i}return"ruby"===t.tagName?a(e):t.childNodes?(r(e,t),a(e)):void 0}for(r(t,e);i=a(t);)for(var n=0;nd&&(c=c<0?-1:1,c*=Math.ceil(d/l)*l),r<0&&(c+=""===n.vertical?o.height:o.width,a=a.reverse()),i.move(h,c)}else{var p=i.lineHeight/o.height*100;switch(n.lineAlign){case"center":r-=p/2;break;case"end":r-=p}switch(n.vertical){case"":t.applyStyles({top:t.formatStyle(r,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(r,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(r,"%")})}a=["+y","-x","+x","-y"],i=new Oi(t)}var f=function(e,t){for(var i,n=new Oi(e),r=1,a=0;ae.left&&this.tope.top},Oi.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},Oi.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},Oi.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},Oi.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},Oi.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},Ri.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},Ri.convertCueToDOMTree=function(e,t){return e&&t?Ai(e,t):null};Ri.processCues=function(n,r,e){if(!n||!r||!e)return null;for(;e.firstChild;)e.removeChild(e.firstChild);var a=n.document.createElement("div");if(a.style.position="absolute",a.style.left="0",a.style.right="0",a.style.top="0",a.style.bottom="0",a.style.margin="1.5%",e.appendChild(a),function(e){for(var t=0;t',className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&p.error("Creating a ClickableComponent with an HTML element of "+e+" is not supported; use a Button instead."),i=g({role:"button"},i),this.tabIndex_=t.tabIndex;var n=r.prototype.createEl.call(this,e,t,i);return this.createControlTextEl(n),n},t.dispose=function(){this.controlTextEl_=null,r.prototype.dispose.call(this)},t.createControlTextEl=function(e){return this.controlTextEl_=k("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},t.controlText=function(e,t){if(void 0===t&&(t=this.el()),void 0===e)return this.controlText_||"Need Text";var i=this.localize(e);this.controlText_=e,C(this.controlTextEl_,i),this.nonIconControl||t.setAttribute("title",i)},t.buildCSSClass=function(){return"vjs-control vjs-button "+r.prototype.buildCSSClass.call(this)},t.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("keydown",this.handleKeyDown))},t.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver),this.off("mouseout",this.handleMouseOut),this.off(["tap","click"],this.handleClick),this.off("keydown",this.handleKeyDown)},t.handleClick=function(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},t.handleKeyDown=function(e){Dt.isEventKey(e,"Space")||Dt.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):r.prototype.handleKeyDown.call(this,e)},e}(je);je.registerComponent("ClickableComponent",un);var ln=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).update(),e.on("posterchange",_e(Ve(i),i.update)),i}Ge(e,n);var t=e.prototype;return t.dispose=function(){this.player().off("posterchange",this.update),n.prototype.dispose.call(this)},t.createEl=function(){return k("div",{className:"vjs-poster",tabIndex:-1})},t.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},t.setSrc=function(e){var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t},t.handleClick=function(e){if(this.player_.controls()){var t=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&0',className:this.buildCSSClass()},t),i=g({type:"button"},i);var n=je.prototype.createEl.call(this,"button",t,i);return this.createControlTextEl(n),n},i.addChild=function(e,t){void 0===t&&(t={});var i=this.constructor.name;return p.warn("Adding an actionable (user controllable) child to a Button ("+i+") is not supported; use a ClickableComponent instead."),je.prototype.addChild.call(this,e,t)},i.enable=function(){t.prototype.enable.call(this),this.el_.removeAttribute("disabled")},i.disable=function(){t.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},i.handleKeyDown=function(e){Dt.isEventKey(e,"Space")||Dt.isEventKey(e,"Enter")?e.stopPropagation():t.prototype.handleKeyDown.call(this,e)},e}(un);je.registerComponent("Button",gn);var vn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).mouseused_=!1,i.on("mousedown",i.handleMouseDown),i}Ge(e,n);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-big-play-button"},t.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){var i=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&0'+this.localize(this.labelText_)+" "});return this.contentEl_=k("span",{className:e+"-display"},{"aria-live":"off",role:"presentation"}),t.appendChild(this.contentEl_),t},t.dispose=function(){this.contentEl_=null,this.textNode_=null,n.prototype.dispose.call(this)},t.updateTextNode_=function(e){var t=this;void 0===e&&(e=0),e=Sn(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(t.contentEl_){var e=t.textNode_;t.textNode_=d.createTextNode(t.formattedTime_),t.textNode_&&(e?t.contentEl_.replaceChild(t.textNode_,e):t.contentEl_.appendChild(t.textNode_))}}))},t.updateContent=function(e){},e}(je);kn.prototype.labelText_="Time",kn.prototype.controlText_="Time",je.registerComponent("TimeDisplay",kn);var Cn=function(e){function t(){return e.apply(this,arguments)||this}Ge(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-current-time"},i.updateContent=function(e){var t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)},t}(kn);Cn.prototype.labelText_="Current Time",Cn.prototype.controlText_="Current Time",je.registerComponent("CurrentTimeDisplay",Cn);var En=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).on(e,"durationchange",i.updateContent),i.on(e,"loadstart",i.updateContent),i.on(e,"loadedmetadata",i.updateContent),i}Ge(e,n);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-duration"},t.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t)},e}(kn);En.prototype.labelText_="Duration",En.prototype.controlText_="Duration",je.registerComponent("DurationDisplay",En);var wn=function(e){function t(){return e.apply(this,arguments)||this}return Ge(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"/
"},{"aria-hidden":!0})},t}(je);je.registerComponent("TimeDivider",wn);var In=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).on(e,"durationchange",i.updateContent),i}Ge(e,n);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-remaining-time"},t.createEl=function(){var e=n.prototype.createEl.call(this);return e.insertBefore(k("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e},t.updateContent=function(e){var t;"number"==typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t))},e}(kn);In.prototype.labelText_="Remaining Time",In.prototype.controlText_="Remaining Time",je.registerComponent("RemainingTimeDisplay",In);var An=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).updateShowing(),i.on(i.player(),"durationchange",i.updateShowing),i}Ge(e,n);var t=e.prototype;return t.createEl=function(){var e=n.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=k("div",{className:"vjs-live-display",innerHTML:''+this.localize("Stream Type")+" "+this.localize("LIVE")},{"aria-live":"off"}),e.appendChild(this.contentEl_),e},t.dispose=function(){this.contentEl_=null,n.prototype.dispose.call(this)},t.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},e}(je);je.registerComponent("LiveDisplay",An);var xn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).updateLiveEdgeStatus(),i.player_.liveTracker&&i.on(i.player_.liveTracker,"liveedgechange",i.updateLiveEdgeStatus),i}Ge(e,n);var t=e.prototype;return t.createEl=function(){var e=n.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=k("span",{className:"vjs-seek-to-live-text",innerHTML:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e},t.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"))},t.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},t.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatus),this.textEl_=null,n.prototype.dispose.call(this)},e}(gn);xn.prototype.controlText_="Seek to live, currently playing live",je.registerComponent("SeekToLive",xn);var Pn=function(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))},Ln=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).bar=i.getChild(i.options_.barName),i.vertical(!!i.options_.vertical),i.enable(),i}Ge(e,n);var t=e.prototype;return t.enabled=function(){return this.enabled_},t.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)},t.disable=function(){if(this.enabled()){var e=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(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},t.createEl=function(e,t,i){return void 0===t&&(t={}),void 0===i&&(i={}),t.className=t.className+" vjs-slider",t=g({tabIndex:0},t),i=g({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},i),n.prototype.createEl.call(this,e,t,i)},t.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||nt||e.preventDefault(),R(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchmove",this.handleMouseMove),this.on(t,"touchend",this.handleMouseUp),this.handleMouseMove(e)},t.handleMouseMove=function(e){},t.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;N(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp),this.update()},t.update=function(){var t=this;if(this.el_&&this.bar){var i=this.getProgress();return i===this.progress_||(this.progress_=i,this.requestNamedAnimationFrame("Slider#update",function(){var e=t.vertical()?"height":"width";t.bar.el().style[e]=(100*i).toFixed(2)+"%"})),i}},t.getProgress=function(){return Number(Pn(this.getPercent(),0,1).toFixed(4))},t.calculateDistance=function(e){var t=B(this.el_,e);return this.vertical()?t.y:t.x},t.handleKeyDown=function(e){Dt.isEventKey(e,"Left")||Dt.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):Dt.isEventKey(e,"Right")||Dt.isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):n.prototype.handleKeyDown.call(this,e)},t.handleClick=function(e){e.stopPropagation(),e.preventDefault()},t.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},e}(je);je.registerComponent("Slider",Ln);var Dn=function(e,t){return Pn(e/t*100,0,100).toFixed(2)+"%"},On=function(r){function e(e,t){var i;return(i=r.call(this,e,t)||this).partEls_=[],i.on(e,"progress",i.update),i}Ge(e,r);var t=e.prototype;return t.createEl=function(){var e=r.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),t=k("span",{className:"vjs-control-text"}),i=k("span",{textContent:this.localize("Loaded")}),n=d.createTextNode(": ");return this.percentageEl_=k("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(n),t.appendChild(this.percentageEl_),e},t.dispose=function(){this.partEls_=null,this.percentageEl_=null,r.prototype.dispose.call(this)},t.update=function(e){var d=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var e=d.player_.liveTracker,t=d.player_.buffered(),i=e&&e.isLive()?e.seekableEnd():d.player_.duration(),n=d.player_.bufferedEnd(),r=d.partEls_,a=Dn(n,i);d.percent_!==a&&(d.el_.style.width=a,C(d.percentageEl_,a),d.percent_=a);for(var s=0;st.length;c--)d.el_.removeChild(r[c-1]);r.length=t.length})},e}(je);je.registerComponent("LoadProgressBar",On);var Mn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).update=be(_e(Ve(i),i.update),30),i}Ge(e,n);var t=e.prototype;return t.createEl=function(){return n.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},t.update=function(e,t,i){var n=F(this.el_),r=U(this.player_.el()),a=e.width*t;if(r&&n){var s=e.left-r.left+a,o=e.width-a+(r.right-e.right),u=n.width/2;sn.width&&(u=n.width),this.el_.style.right="-"+u+"px",this.write(i)}},t.write=function(e){C(this.el_,e)},t.updateTime=function(r,a,s,o){var u=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var e,t=u.player_.duration();if(u.player_.liveTracker&&u.player_.liveTracker.isLive()){var i=u.player_.liveTracker.liveWindow(),n=i-a*i;e=(n<1?"":"-")+Sn(n,i)}else e=Sn(s,t);u.update(r,a,e),o&&o()})},e}(je);je.registerComponent("TimeTooltip",Mn);var Rn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).update=be(_e(Ve(i),i.update),30),i}Ge(e,n);var t=e.prototype;return t.createEl=function(){return n.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},t.update=function(e,t){var i=this.getChild("timeTooltip");if(i){var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,n)}},e}(je);Rn.prototype.options_={children:[]},dt||Je||Rn.prototype.options_.children.push("timeTooltip"),je.registerComponent("PlayProgressBar",Rn);var Nn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).update=be(_e(Ve(i),i.update),30),i}Ge(e,n);var t=e.prototype;return t.createEl=function(){return n.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(e,t){var i=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,function(){i.el_.style.left=e.width*t+"px"})},e}(je);Nn.prototype.options_={children:["timeTooltip"]},je.registerComponent("MouseTimeDisplay",Nn);var Un=function(a){function e(e,t){var i;return(i=a.call(this,e,t)||this).setEventHandlers_(),i}Ge(e,a);var t=e.prototype;return t.setEventHandlers_=function(){this.update_=_e(this,this.update),this.update=be(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.on(this.player_,["playing"],this.enableInterval_),this.on(this.player_,["ended","pause","waiting"],this.disableInterval_),"hidden"in d&&"visibilityState"in d&&this.on(d,"visibilitychange",this.toggleVisibility_)},t.toggleVisibility_=function(e){d.hidden?this.disableInterval_(e):(this.enableInterval_(),this.update())},t.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30))},t.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},t.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.update=function(e){var n=this,r=a.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var e=n.player_.ended()?n.player_.duration():n.getCurrentTime_(),t=n.player_.liveTracker,i=n.player_.duration();t&&t.isLive()&&(i=n.player_.liveTracker.liveCurrentTime()),n.percent_!==r&&(n.el_.setAttribute("aria-valuenow",(100*r).toFixed(2)),n.percent_=r),n.currentTime_===e&&n.duration_===i||(n.el_.setAttribute("aria-valuetext",n.localize("progress bar timing: currentTime={1} duration={2}",[Sn(e,i),Sn(i,i)],"{1} of {2}")),n.currentTime_=e,n.duration_=i),n.bar&&n.bar.update(U(n.el()),n.getProgress())}),r},t.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.getPercent=function(){var e,t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e},t.handleMouseDown=function(e){z(e)&&(e.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),a.prototype.handleMouseDown.call(this,e))},t.handleMouseMove=function(e){if(z(e)){var t,i=this.calculateDistance(e),n=this.player_.liveTracker;if(n&&n.isLive()){if(.99<=i)return void n.seekToLiveEdge();var r=n.seekableStart(),a=n.liveCurrentTime();if(a<=(t=r+i*n.liveWindow())&&(t=a),t<=r&&(t=r+.1),t===1/0)return}else(t=i*this.player_.duration())===this.player_.duration()&&(t-=.1);this.player_.currentTime(t)}},t.enable=function(){a.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.show()},t.disable=function(){a.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.hide()},t.handleMouseUp=function(e){a.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?At(this.player_.play()):this.update_()},t.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},t.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},t.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.handleKeyDown=function(e){if(Dt.isEventKey(e,"Space")||Dt.isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(Dt.isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.player_.currentTime(0);else if(Dt.isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),this.player_.currentTime(this.player_.duration());else if(/^[0-9]$/.test(Dt(e))){e.preventDefault(),e.stopPropagation();var t=10*(Dt.codes[Dt(e)]-Dt.codes[0])/100;this.player_.currentTime(this.player_.duration()*t)}else Dt.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.player_.currentTime(this.player_.currentTime()-60)):Dt.isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.player_.currentTime(this.player_.currentTime()+60)):a.prototype.handleKeyDown.call(this,e)},t.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableInterval_),this.off(this.player_,["ended","pause","waiting"],this.disableInterval_),"hidden"in d&&"visibilityState"in d&&this.off(d,"visibilitychange",this.toggleVisibility_),a.prototype.dispose.call(this)},e}(Ln);Un.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},dt||Je||Un.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),je.registerComponent("SeekBar",Un);var Fn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).handleMouseMove=be(_e(Ve(i),i.handleMouseMove),30),i.throttledHandleMouseSeek=be(_e(Ve(i),i.handleMouseSeek),30),i.enable(),i}Ge(e,n);var t=e.prototype;return t.createEl=function(){return n.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(i||n){var r=t.el(),a=F(r),s=B(r,e).x;s=Pn(s,0,1),n&&n.update(a,s),i&&i.update(a,t.getProgress())}}},t.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},t.enabled=function(){return this.enabled_},t.disable=function(){this.children().forEach(function(e){return e.disable&&e.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},t.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},t.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.handleMouseUp=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseUp(e),this.off(t,"mousemove",this.throttledHandleMouseSeek),this.off(t,"touchmove",this.throttledHandleMouseSeek),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},e}(je);Fn.prototype.options_={children:["seekBar"]},je.registerComponent("ProgressControl",Fn);var Bn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).on(e,["enterpictureinpicture","leavepictureinpicture"],i.handlePictureInPictureChange),i.on(e,["disablepictureinpicturechanged","loadedmetadata"],i.handlePictureInPictureEnabledChange),i.disable(),i}Ge(e,n);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-picture-in-picture-control "+n.prototype.buildCSSClass.call(this)},t.handlePictureInPictureEnabledChange=function(){d.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},t.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},t.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},e}(gn);Bn.prototype.controlText_="Picture-in-Picture",je.registerComponent("PictureInPictureToggle",Bn);var jn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).on(e,"fullscreenchange",i.handleFullscreenChange),!1===d[e.fsApi_.fullscreenEnabled]&&i.disable(),i}Ge(e,n);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-fullscreen-control "+n.prototype.buildCSSClass.call(this)},t.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},e}(gn);jn.prototype.controlText_="Fullscreen",je.registerComponent("FullscreenToggle",jn);var Vn=function(e){function t(){return e.apply(this,arguments)||this}return Ge(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:''})},t}(je);je.registerComponent("VolumeLevel",Vn);var qn=function(n){function e(e,t){var i;return(i=n.call(this,e,t)||this).on("slideractive",i.updateLastVolume_),i.on(e,"volumechange",i.updateARIAAttributes),e.ready(function(){return i.updateARIAAttributes()}),i}Ge(e,n);var t=e.prototype;return t.createEl=function(){return n.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},t.handleMouseDown=function(e){z(e)&&n.prototype.handleMouseDown.call(this,e)},t.handleMouseMove=function(e){z(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},t.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},t.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},t.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(t)})},e}(Ln);qn.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},qn.prototype.playerEvent="volumechange",je.registerComponent("VolumeBar",qn);var Hn=function(n){function e(e,t){var i;return void 0===t&&(t={}),t.vertical=t.vertical||!1,(void 0===t.volumeBar||o(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),i=n.call(this,e,t)||this,function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})}(Ve(i),e),i.throttledHandleMouseMove=be(_e(Ve(i),i.handleMouseMove),30),i.on("mousedown",i.handleMouseDown),i.on("touchstart",i.handleMouseDown),i.on(i.volumeBar,["focus","slideractive"],function(){i.volumeBar.addClass("vjs-slider-active"),i.addClass("vjs-slider-active"),i.trigger("slideractive")}),i.on(i.volumeBar,["blur","sliderinactive"],function(){i.volumeBar.removeClass("vjs-slider-active"),i.removeClass("vjs-slider-active"),i.trigger("sliderinactive")}),i}Ge(e,n);var t=e.prototype;return t.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),n.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},t.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},e}(je);Hn.prototype.options_={children:["volumeBar"]},je.registerComponent("VolumeControl",Hn);var Wn=function(n){function e(e,t){var i;return i=n.call(this,e,t)||this,function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})}(Ve(i),e),i.on(e,["loadstart","volumechange"],i.update),i}Ge(e,n);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-mute-control "+n.prototype.buildCSSClass.call(this)},t.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){var n=i<.1?.1:i;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},t.update=function(e){this.updateIcon_(),this.updateControlText_()},t.updateIcon_=function(){var e=this.player_.volume(),t=3;dt&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)A(this.el_,"vjs-vol-"+i);I(this.el_,"vjs-vol-"+t)},t.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},e}(gn);Wn.prototype.controlText_="Mute",je.registerComponent("MuteToggle",Wn);var zn=function(n){function e(e,t){var i;return void 0===t&&(t={}),void 0!==t.inline?t.inline=t.inline:t.inline=!0,(void 0===t.volumeControl||o(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),(i=n.call(this,e,t)||this).on(e,["loadstart"],i.volumePanelState_),i.on(i.muteToggle,"keyup",i.handleKeyPress),i.on(i.volumeControl,"keyup",i.handleVolumeControlKeyUp),i.on("keydown",i.handleKeyPress),i.on("mouseover",i.handleMouseOver),i.on("mouseout",i.handleMouseOut),i.on(i.volumeControl,["slideractive"],i.sliderActive_),i.on(i.volumeControl,["sliderinactive"],i.sliderInactive_),i}Ge(e,n);var t=e.prototype;return t.sliderActive_=function(){this.addClass("vjs-slider-active")},t.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.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")},t.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),n.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},t.dispose=function(){this.handleMouseOut(),n.prototype.dispose.call(this)},t.handleVolumeControlKeyUp=function(e){Dt.isEventKey(e,"Esc")&&this.muteToggle.focus()},t.handleMouseOver=function(e){this.addClass("vjs-hover"),he(d,"keyup",_e(this,this.handleKeyPress))},t.handleMouseOut=function(e){this.removeClass("vjs-hover"),pe(d,"keyup",_e(this,this.handleKeyPress))},t.handleKeyPress=function(e){Dt.isEventKey(e,"Esc")&&this.handleMouseOut()},e}(je);zn.prototype.options_={children:["muteToggle","volumeControl"]},je.registerComponent("VolumePanel",zn);var Gn=function(n){function e(e,t){var i;return i=n.call(this,e,t)||this,t&&(i.menuButton_=t.menuButton),i.focusedChild_=-1,i.on("keydown",i.handleKeyDown),i.boundHandleBlur_=_e(Ve(i),i.handleBlur),i.boundHandleTapClick_=_e(Ve(i),i.handleTapClick),i}Ge(e,n);var t=e.prototype;return t.addEventListenerForItem=function(e){e instanceof je&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},t.removeEventListenerForItem=function(e){e instanceof je&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},t.removeChild=function(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),n.prototype.removeChild.call(this,e)},t.addItem=function(e){var t=this.addChild(e);t&&this.addEventListenerForItem(t)},t.createEl=function(){var e=this.options_.contentElType||"ul";this.contentEl_=k(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var t=n.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),he(t,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),t},t.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,n.prototype.dispose.call(this)},t.handleBlur=function(e){var t=e.relatedTarget||d.activeElement;if(!this.children().some(function(e){return e.el()===t})){var i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}},t.handleTapClick=function(t){if(this.menuButton_){this.menuButton_.unpressButton();var e=this.children();if(!Array.isArray(e))return;var i=e.filter(function(e){return e.el()===t.target})[0];if(!i)return;"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}},t.handleKeyDown=function(e){Dt.isEventKey(e,"Left")||Dt.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(Dt.isEventKey(e,"Right")||Dt.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},t.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},t.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},t.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className)&&t.shift(),0=t.length&&(e=t.length-1),t[this.focusedChild_=e].el_.focus())},e}(je);je.registerComponent("Menu",Gn);var Xn=function(r){function e(e,t){var i;void 0===t&&(t={}),(i=r.call(this,e,t)||this).menuButton_=new gn(e,t),i.menuButton_.controlText(i.controlText_),i.menuButton_.el_.setAttribute("aria-haspopup","true");var n=gn.prototype.buildCSSClass();return i.menuButton_.el_.className=i.buildCSSClass()+" "+n,i.menuButton_.removeClass("vjs-control"),i.addChild(i.menuButton_),i.update(),i.enabled_=!0,i.on(i.menuButton_,"tap",i.handleClick),i.on(i.menuButton_,"click",i.handleClick),i.on(i.menuButton_,"keydown",i.handleKeyDown),i.on(i.menuButton_,"mouseenter",function(){i.addClass("vjs-hover"),i.menu.show(),he(d,"keyup",_e(Ve(i),i.handleMenuKeyUp))}),i.on("mouseleave",i.handleMouseLeave),i.on("keydown",i.handleSubmenuKeyDown),i}Ge(e,r);var t=e.prototype;return t.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},t.createMenu=function(){var e=new Gn(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=k("li",{className:"vjs-menu-title",innerHTML:Me(this.options_.title),tabIndex:-1});this.hideThreshold_+=1;var i=new je(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(var n=0;n