// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("../../chunks/tslib.es6 ../../core/Accessor ../../core/Logger ../../core/mathUtils ../../core/reactiveUtils ../../core/XHRAdapter ../../core/accessorSupport/decorators/property ../../core/has ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ./VideoCameraSensorModel ./videoUtils ../../chunks/_commonjsHelpers".split(" "),function(ya,fm,gm,hm,Gd,im,Aa,Gr,Hr,jm,km,Hd,jb){function pc(d,f){if(!(this instanceof pc))return new pc(d,f);this.nodeValue=this.data=d;this.length=d.length; this.ownerDocument=f||null}function Sb(d,f){if(!(this instanceof Sb))return new Sb(d);this.data=d||"";this.length=this.data.length;this.ownerDocument=f||null}function oh(d){switch(d.nodeType){case 3:return We(d.data);case 8:return"\x3c!--"+d.data+"--\x3e";default:var f=[],k=d.tagName;"http://www.w3.org/1999/xhtml"===d.namespaceURI&&(k=k.toLowerCase());var n=f.push,u="\x3c"+k;var a=[];for(var b in d){var c=d;var e=b,g=typeof c[e];c="style"===e&&0/g,"\x26gt;")}function fa(d,f,k){if(!(this instanceof fa))return new fa(d);k=void 0===k?"http://www.w3.org/1999/xhtml":k||null;this.nodeName=this.tagName="http://www.w3.org/1999/xhtml"===k?String(d).toUpperCase():d;this.className="";this.dataset= {};this.childNodes=[];this.parentNode=null;this.style={};this.ownerDocument=f||null;this.namespaceURI=k;this._attributes={};"INPUT"===this.tagName&&(this.type="text")}function tb(d){if(!(this instanceof tb))return new tb;this.childNodes=[];this.parentNode=null;this.ownerDocument=d||null}function Xe(d){}function Id(){if(!(this instanceof Id))return new Id;this.head=this.createElement("head");this.body=this.createElement("body");this.documentElement=this.createElement("html");this.documentElement.appendChild(this.head); this.documentElement.appendChild(this.body);this.childNodes=[this.documentElement];this.nodeType=9}function nm(d){void 0===d&&(d="");return d.toLowerCase().split(";").reduce(function(f,k){k=k.split("\x3d");var n=k[1];return"charset"===k[0].trim()?n.trim():f},"utf-8")}function om(d){for(var f in d)if(d.hasOwnProperty(f))return!1;return!0}function qh(d,f,k){var n=d;if(f){var u=pm.call(f);u="[object Function]"===u||"function"===typeof f&&"[object RegExp]"!==u||"undefined"!==typeof window&&(f===window.setTimeout|| f===window.alert||f===window.confirm||f===window.prompt)}else u=!1;u?(k=f,"string"===typeof d&&(n={uri:d})):n=qm({},f,{uri:d});n.callback=k;return n}function ub(d,f,k){f=qh(d,f,k);return rh(f)}function rh(d){function f(A){clearTimeout(x);A instanceof Error||(A=Error(""+(A||"Unknown XMLHttpRequest Error")));A.statusCode=0;var z=y;n||(n=!0,d.callback(A,z,void 0))}function k(){if(!b){clearTimeout(x);var A=d.useXDR&&void 0===u.status?200:1223===u.status?204:u.status;var z=y,E=null;if(0!==A){z=void 0; if(u.response)var I=u.response;else{if(!(z=u.responseText))a:{try{if("document"===u.responseType){z=u.responseXML;break a}I=u.responseXML&&"parsererror"===u.responseXML.documentElement.nodeName;if(""===u.responseType&&!I){z=u.responseXML;break a}}catch(G){}z=null}I=z}z=I;if(t)try{z=JSON.parse(z)}catch(G){}z={body:z,statusCode:A,method:e,headers:{},url:c,rawRequest:u};u.getAllResponseHeaders&&(z.headers=rm(u.getAllResponseHeaders()))}else E=Error("Internal XMLHttpRequest Error");A=z.body;n||(n=!0, d.callback(E,z,A))}}if("undefined"===typeof d.callback)throw Error("callback argument missing");var n=!1,u=d.xhr||null;u||=d.cors||d.useXDR?new ub.XDomainRequest:new ub.XMLHttpRequest;var a,b,c=u.url=d.uri||d.url,e=u.method=d.method||"GET",g=d.body||d.data,l=u.headers=d.headers||{},p=!!d.sync,t=!1,x,y={body:void 0,headers:{},statusCode:0,method:e,url:c,rawRequest:u};"json"in d&&!1!==d.json&&(t=!0,l.accept||l.Accept||(l.Accept="application/json"),"GET"!==e&&"HEAD"!==e&&(l["content-type"]||l["Content-Type"]|| (l["Content-Type"]="application/json"),g=JSON.stringify(!0===d.json?g:d.json)));u.onreadystatechange=function(){4===u.readyState&&setTimeout(k,0)};u.onload=k;u.onerror=f;u.onprogress=function(){};u.onabort=function(){b=!0};u.ontimeout=f;u.open(e,c,!p,d.username,d.password);p||(u.withCredentials=!!d.withCredentials);!p&&0]*>?)?/);p=p[1]?p[1]:p[2];f=f.substr(p.length);return p}function n(p){$e.innerHTML= p;p=$e.textContent;$e.textContent="";return p}function u(p,t){var x=um[p];if(!x)return null;x=d.document.createElement(x);(p=vm[p])&&t&&(x[p]=t.trim());return x}for(var a=d.document.createElement("div"),b=a,c,e=[];null!==(c=k());)if("\x3c"===c[0])if("/"===c[1])e.length&&e[e.length-1]===c.substr(2).replace("\x3e","")&&(e.pop(),b=b.parentNode);else{var g=Ye(c.substr(1,c.length-2));if(g){var l=d.document.createProcessingInstruction("timestamp",g);b.appendChild(l)}else if(c=c.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/))!(l= u(c[1],c[3]))||th[l.localName]&&th[l.localName]!==b.localName||(c[2]&&(g=c[2].split("."),g.forEach(function(p){var t=/^bg_/.test(p);p=t?p.slice(3):p;uh.hasOwnProperty(p)&&(l.style[t?"background-color":"color"]=uh[p])}),l.className=g.join(" ")),e.push(c[1]),b.appendChild(l),b=l)}else b.appendChild(d.document.createTextNode(n(c)));return a}function wm(d){for(var f=0;f=k[0]&&d<=k[1])return!0}return!1}function xm(d){function f(b,c){for(var e=c.childNodes.length-1;0<=e;e--)b.push(c.childNodes[e])} function k(b){if(!b||!b.length)return null;var c=b.pop(),e=c.textContent||c.innerText;if(e)return(c=e.match(/^.*(\n|\r)/))?(b.length=0,c[0]):e;if("ruby"===c.tagName)return k(b);if(c.childNodes)return f(b,c),k(b)}var n=[],u="";if(!d||!d.childNodes)return"ltr";for(f(n,d);u=k(n);)for(var a=0;aE||100E||100=d}function nb(){nb=Object.assign?Object.assign.bind():function(d){for(var f=1;fd.indexOf(f))}function Hh(d,f){d=d.childNodes||[];if(wb(d,function(n){return vb(n)&&n!==f}))return!1;var k=wb(d,Ib);return!(f&&k&&d.indexOf(k)>d.indexOf(f))}function Dm(d,f,k){var n=d.childNodes|| [],u=f.childNodes||[];if(f.nodeType===ka.DOCUMENT_FRAGMENT_NODE){var a=u.filter(vb);if(1&"\t\n\r]/g,Eh),'"')}function uc(d,f,k,n,u){u||=[];if(n)if(d=n(d)){if("string"==typeof d){f.push(d);return}}else return;switch(d.nodeType){case ob:var a=d.attributes,b=a.length,c=d.firstChild,e=d.tagName;k=sc.isHTML(d.namespaceURI)||k;var g=e;if(!k&&!d.prefix&&d.namespaceURI){for(var l,p=0;p]/g, Eh));case Nh:return f.push("\x3c![CDATA[",d.data,"]]\x3e");case Oh:return f.push("\x3c!--",d.data,"--\x3e");case Ph:k=d.publicId;n=d.systemId;f.push("\x3c!DOCTYPE ",d.name);k?(f.push(" PUBLIC ",k),n&&"."!=n&&f.push(" ",n),f.push("\x3e")):n&&"."!=n?f.push(" SYSTEM ",n,"\x3e"):((d=d.internalSubset)&&f.push(" [",d,"]"),f.push("\x3e"));break;case Qh:return f.push("\x3c?",d.target," ",d.data,"?\x3e");case Rh:return f.push("\x26",d.nodeName,";");default:f.push("??",d.nodeName)}}function Sh(d,f,k){switch(f.nodeType){case ob:var n= f.cloneNode(!1);n.ownerDocument=d;case Jb:break;case vc:k=!0}n||=f.cloneNode(!1);n.ownerDocument=d;n.parentNode=null;if(k)for(f=f.firstChild;f;)n.appendChild(Sh(d,f,k)),f=f.nextSibling;return n}function nf(d,f,k){var n=new f.constructor;for(a in f)if(Object.prototype.hasOwnProperty.call(f,a)){var u=f[a];"object"!=typeof u&&u!=n[a]&&(n[a]=u)}f.childNodes&&(n.childNodes=new Tb);n.ownerDocument=d;switch(n.nodeType){case ob:var a=f.attributes;var b=n.attributes=new Ld;u=a.length;b._ownerElement=n;for(b= 0;b>10),56320+(W&1023))):W=String.fromCharCode(W),W;u.error("entity not found:"+W);return W}function b(W){if(W>x){var Da=d.substring(x,W).replace(/&#?\w+;/g,a);p&&c(x);n.characters(Da,0,W-x);x=W}}function c(W,Da){for(;W>=g&&(Da=l.exec(d));)e=Da.index,g=e+Da[0].length,p.lineNumber++;p.columnNumber=W-e+1}var e=0,g=0,l=/.*(?:\r\n?|\n)|.*$/g,p=n.locator;f=[{currentNSMap:f}];for(var t={},x=0;;){try{var y=d.indexOf("\x3c",x);if(0>y){if(!d.substr(x).match(/^\s*$/)){var A=n.doc,z=A.createTextNode(d.substr(x)); A.appendChild(z);n.currentElement=z}break}y>x&&b(y);switch(d.charAt(y+1)){case "/":var E=d.indexOf("\x3e",y+3),I=d.substring(y+2,E).replace(/[ \t\n\r]+$/g,""),G=f.pop();0>E?(I=d.substring(y+2).replace(/[\s<].*/,""),u.error("end tag name: "+I+" is not complete:"+G.tagName),E=y+1+I.length):I.match(/\sx?x=E:b(Math.max(y,x)+1)}}function Vh(d,f){f.lineNumber=d.lineNumber;f.columnNumber=d.columnNumber;return f}function Hm(d,f,k,n,u,a){function b(t,x,y){k.attributeNames.hasOwnProperty(t)&&a.fatalError("Attribute "+t+" redefined");k.addValue(t, x.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,u),y)}for(var c,e,g=++f,l=0;;){var p=d.charAt(g);switch(p){case "\x3d":if(1===l)c=d.slice(f,g),l=3;else if(2===l)l=3;else throw Error("attribute equal must after attrName");break;case "'":case '"':if(3===l||1===l)if(1===l&&(a.warning('attribute value must after "\x3d"'),c=d.slice(f,g)),f=g+1,g=d.indexOf(p,f),0=p)switch(l){case 0:k.setTagName(d.slice(f,g));l=6;break;case 1:c=d.slice(f,g);l=2;break;case 4:e=d.slice(f,g),a.warning('attribute "'+e+'" missed quot(")!!'), b(c,e,f);case 5:l=6}else switch(l){case 2:k.tagName;cd.isHTML(n[""])&&c.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+c+'" missed value!! "'+c+'" instead2!!');b(c,c,f);f=g;l=1;break;case 5:a.warning('attribute space is required"'+c+'"!!');case 6:l=1;f=g;break;case 3:l=4;f=g;break;case 7:throw Error("elements closed character '/' and '\x3e' must be connected to");}}g++}}function Wh(d,f,k){for(var n=d.tagName,u=null,a=d.length;a--;){var b=d[a],c=b.qName,e=b.value,g=c.indexOf(":"); if(0f)return k.comment(d,f+4,u-f-4),u+3;n.error("Unclosed comment")}break;default:if("CDATA["==d.substr(f+3,6))return u=d.indexOf("]]\x3e",f+9),k.startCDATA(),k.characters(d,f+9,u-f-9),k.endCDATA(),u+3;a:{n=[];u=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;u.lastIndex=f;for(u.exec(d);f=u.exec(d);)if(n.push(f),f[1]){u=n;break a}u=void 0}var a=u.length;if(1=f+k||f?new java.lang.String(d,f,k)+"":d}function Rd(d,f){d.currentElement?d.currentElement.appendChild(f):d.doc.appendChild(f)}function pf(d,f=":",k=""){let n="info",u;const a=function(...b){u("log",n,b)};u=Mm(d,a,k);a.createLogger=(b,c,e)=>{c=void 0!==c?c:f;return pf(`${d} ${c} ${b}`,c,void 0!==e?e:k)};a.createNewLogger=(b,c,e)=>pf(b,c,e);a.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error", error:"error",DEFAULT:n};a.level=b=>{if("string"===typeof b){if(!a.levels.hasOwnProperty(b))throw Error(`"${b}" in not a valid log level`);n=b}return n};a.history=()=>Wa?[].concat(Wa):[];a.history.filter=b=>(Wa||[]).filter(c=>(new RegExp(`.*${b}.*`)).test(c[0]));a.history.clear=()=>{Wa&&(Wa.length=0)};a.history.disable=()=>{null!==Wa&&(Wa.length=0,Wa=null)};a.history.enable=()=>{null===Wa&&(Wa=[])};a.error=(...b)=>u("error",n,b);a.warn=(...b)=>u("warn",n,b);a.debug=(...b)=>u("debug",n,b);return a} function yc(d,f){$h(d).forEach(k=>f(d[k],k))}function ai(d,f,k=0){return $h(d).reduce((n,u)=>f(n,d[u],u),k)}function xb(d){return!!d&&"object"===typeof d}function zc(d){return xb(d)&&"[object Object]"===Nm.call(d)&&d.constructor===Object}function ma(...d){const f={};d.forEach(k=>{k&&yc(k,(n,u)=>{zc(n)?(zc(f[u])||(f[u]={}),f[u]=ma(f[u],n)):f[u]=n})});return f}function bi(d={}){const f=[];for(const k in d)d.hasOwnProperty(k)&&f.push(d[k]);return f}function Sd(d,f,k,n=!0){const u=b=>Object.defineProperty(d, f,{value:b,enumerable:!0,writable:!0}),a={configurable:!0,enumerable:!0,get(){const b=k();u(b);return b}};n&&(a.set=u);return Object.defineProperty(d,f,a)}function Ac(){return P===D.document}function Bc(d){return xb(d)&&1===d.nodeType}function ci(){try{return D.parent!==D.self}catch(d){return!0}}function di(d){return function(f,k){if("string"!==typeof f||!f.trim())return P[d](null);"string"===typeof k&&k.trim()&&(k=P.querySelector(k));k=Bc(k)?k:P;return k[d]&&k[d](f)}}function aa(d="div",f={},k={}, n){const u=P.createElement(d);Object.getOwnPropertyNames(f).forEach(function(a){const b=f[a];if("textContent"===a)Ub(u,b);else if(u[a]!==b||"tabIndex"===a)u[a]=b});Object.getOwnPropertyNames(k).forEach(function(a){u.setAttribute(a,k[a])});n&&qf(u,n);return u}function Ub(d,f){"undefined"===typeof d.textContent?d.innerText=f:d.textContent=f;return d}function rf(d,f){f.firstChild?f.insertBefore(d,f.firstChild):f.appendChild(d)}function dd(d,f){if(0<=f.indexOf(" "))throw Error("class has illegal whitespace characters"); return d.classList.contains(f)}function cc(d,...f){d.classList.add(...f.reduce((k,n)=>k.concat(n.split(/\s+/)),[]));return d}function Td(d,...f){if(!d)return da.warn("removeClass was called with an element that doesn't exist"),null;d.classList.remove(...f.reduce((k,n)=>k.concat(n.split(/\s+/)),[]));return d}function ei(d,f,k){"function"===typeof k&&(k=k(d,f));"boolean"!==typeof k&&(k=void 0);f.split(/\s+/).forEach(n=>d.classList.toggle(n,k));return d}function fi(d,f){Object.getOwnPropertyNames(f).forEach(function(k){const n= f[k];null===n||"undefined"===typeof n||!1===n?d.removeAttribute(k):d.setAttribute(k,!0===n?"":n)})}function Vb(d){const f={},k="autoplay controls playsinline loop muted default defaultMuted".split(" ");if(d&&d.attributes&&0{void 0!==f[n]&&(k[n]=f[n])});k.height||(k.height=parseFloat(Dc(d,"height")));k.width||(k.width=parseFloat(Dc(d,"width")));return k}}function ed(d){if(!d||d&&!d.offsetParent)return{left:0,top:0,width:0,height:0};const f=d.offsetWidth,k=d.offsetHeight;let n=0,u=0;for(;d.offsetParent&&d!==P[Ud.fullscreenElement];)n+=d.offsetLeft,u+=d.offsetTop,d=d.offsetParent;return{left:n, top:u,width:f,height:k}}function Vd(d,f){var k=0,n=0;if(Qa)for(var u=d;u&&"html"!==u.nodeName.toLowerCase();){var a=Dc(u,"transform");/^matrix/.test(a)?(a=a.slice(7,-1).split(/,\s/).map(Number),k+=a[4],n+=a[5]):/^matrix3d/.test(a)&&(a=a.slice(9,-1).split(/,\s/).map(Number),k+=a[12],n+=a[13]);u=u.parentNode}u={};a=ed(f.target);d=ed(d);const b=d.width,c=d.height;let e=f.offsetY-(d.top-a.top);a=f.offsetX-(d.left-a.left);f.changedTouches&&(a=f.changedTouches[0].pageX-d.left,e=f.changedTouches[0].pageY+ d.top,Qa&&(a-=k,e-=n));u.y=1-Math.max(0,Math.min(1,e/c));u.x=Math.max(0,Math.min(1,a/b));return u}function ii(d){return xb(d)&&3===d.nodeType}function Wd(d){for(;d.firstChild;)d.removeChild(d.firstChild);return d}function ji(d){"function"===typeof d&&(d=d());return(Array.isArray(d)?d:[d]).map(f=>{"function"===typeof f&&(f=f());if(Bc(f)||ii(f))return f;if("string"===typeof f&&/\S/.test(f))return P.createTextNode(f)}).filter(f=>f)}function qf(d,f){ji(f).forEach(k=>d.appendChild(k));return d}function ki(d, f){return qf(Wd(d),f)}function fd(d){return void 0===d.button&&void 0===d.buttons||0===d.button&&void 0===d.buttons||"mouseup"===d.type&&0===d.button&&0===d.buttons?!0:0!==d.button||1!==d.buttons?!1:!0}function Dc(d,f){if(!d||!f)return"";if("function"===typeof D.getComputedStyle){let k;try{k=D.getComputedStyle(d)}catch(n){return""}return k?k.getPropertyValue(f)||k[f]:""}return""}function li(d){[...P.styleSheets].forEach(f=>{try{var k=[...f.cssRules].map(u=>u.cssText).join("");const n=P.createElement("style"); n.textContent=k;d.document.head.appendChild(n)}catch(n){k=P.createElement("link"),k.rel="stylesheet",k.type=f.type,k.media=f.media.mediaText,k.href=f.href,d.document.head.appendChild(k)}})}function sf(d,f){Ac()&&(f&&(tf=f),D.setTimeout(Om,d))}function uf(){mi=!0;D.removeEventListener("load",uf)}function ni(d,f){if(Ra.has(d)){var k=Ra.get(d);0===k.handlers[f].length&&(delete k.handlers[f],d.removeEventListener?d.removeEventListener(f,k.dispatcher,!1):d.detachEvent&&d.detachEvent("on"+f,k.dispatcher)); 0>=Object.getOwnPropertyNames(k.handlers).length&&(delete k.handlers,delete k.dispatcher,delete k.disabled);0===Object.getOwnPropertyNames(k).length&&Ra.delete(d)}}function vf(d,f,k,n){k.forEach(function(u){d(f,u,n)})}function Xd(d){function f(){return!0}function k(){return!1}if(d.fixed_)return d;if(!d||!d.isPropagationStopped||!d.isImmediatePropagationStopped){const u=d||D.event;d={};for(var n in u)"layerX"!==n&&"layerY"!==n&&"keyLocation"!==n&&"webkitMovementX"!==n&&"webkitMovementY"!==n&&"path"!== n&&("returnValue"===n&&u.preventDefault||(d[n]=u[n]));d.target||(d.target=d.srcElement||P);d.relatedTarget||(d.relatedTarget=d.fromElement===d.target?d.toElement:d.fromElement);d.preventDefault=function(){u.preventDefault&&u.preventDefault();d.returnValue=!1;u.returnValue=!1;d.defaultPrevented=!0};d.defaultPrevented=!1;d.stopPropagation=function(){u.stopPropagation&&u.stopPropagation();d.cancelBubble=!0;u.cancelBubble=!0;d.isPropagationStopped=f};d.isPropagationStopped=k;d.stopImmediatePropagation= function(){u.stopImmediatePropagation&&u.stopImmediatePropagation();d.isImmediatePropagationStopped=f;d.stopPropagation()};d.isImmediatePropagationStopped=k;if(null!==d.clientX&&void 0!==d.clientX){n=P.documentElement;const a=P.body;d.pageX=d.clientX+(n&&n.scrollLeft||a&&a.scrollLeft||0)-(n&&n.clientLeft||a&&a.clientLeft||0);d.pageY=d.clientY+(n&&n.scrollTop||a&&a.scrollTop||0)-(n&&n.clientTop||a&&a.clientTop||0)}d.which=d.charCode||d.keyCode;null!==d.button&&void 0!==d.button&&(d.button=d.button& 1?0:d.button&4?1:d.button&2?2:0)}d.fixed_=!0;return d}function ab(d,f,k){if(Array.isArray(f))return vf(ab,d,f,k);Ra.has(d)||Ra.set(d,{});const n=Ra.get(d);n.handlers||(n.handlers={});n.handlers[f]||(n.handlers[f]=[]);k.guid||(k.guid=pb++);n.handlers[f].push(k);n.dispatcher||(n.disabled=!1,n.dispatcher=function(u,a){if(!n.disabled){u=Xd(u);var b=n.handlers[u.type];if(b){b=b.slice(0);for(let c=0,e=b.length;c{k()});d.on("dispose",()=>{d.off();[d,d.el_,d.eventBusEl_].forEach(function(k){k&&Ra.has(k)&&Ra.delete(k)});D.setTimeout(()=>{d.eventBusEl_=null},0)});return d}function oi(d,f){Object.assign(d,Sm);d.state=Object.assign({},d.state,f);if("function"===typeof d.handleStateChanged&&Kb(d))d.on("statechanged",d.handleStateChanged);return d}function pi(d,f,k,n){var u=k.length-1;if("number"!==typeof n||0>n||n>u)throw Error(`Failed to execute '${d}' on 'TimeRanges': The index provided (${n}) is non-numeric or out of bounds (0-${u}).`); return k[n][f]}function yf(d){let f;f=void 0===d||0===d.length?{length:0,start(){throw Error("This TimeRanges object is empty");},end(){throw Error("This TimeRanges object is empty");}}:{length:d.length,start:pi.bind(null,"start",0,d),end:pi.bind(null,"end",1,d)};D.Symbol&&D.Symbol.iterator&&(f[D.Symbol.iterator]=()=>(d||[]).values());return f}function qb(d,f){return Array.isArray(d)?yf(d):void 0===d||void 0===f?yf():yf([[d,f]])}function qi(d){zf=d}function ri(){zf=si}function dc(d,f=d){return zf(d, f)}function ti(d,f){let k=0,n,u;if(!f)return 0;d&&d.length||(d=qb(0,0));for(let a=0;af&&(u=f),k+=u-n;return k/f}function ua(d){if(d instanceof ua)return d;"number"===typeof d?this.code=d:"string"===typeof d?this.message=d:xb(d)&&("number"===typeof d.code&&(this.code=d.code),Object.assign(this,d));this.message||(this.message=ua.defaultMessages[this.code]||"")}function gd(d){return void 0!==d&&null!==d&&"function"===typeof d.then}function yb(d){gd(d)&&d.then(null, f=>{})}function Tm(d,f,k,n,u={}){const a=d.textTracks();u.kind=f;k&&(u.label=k);n&&(u.language=n);u.tech=d;d=new Sa.text.TrackClass(u);a.addTrack(d);return d}function Um(d,f,k){d.setTimeout(()=>ec(f,fc[f.type],k,d),1)}function Vm(d,f){d.forEach(k=>k.setTech&&k.setTech(f))}function ui(d,f,k,n=null){var u="call"+wa(k);u=d.reduce(Af(u),n);f=(n=u===Zd)?null:f[k](u);for(u=d.length-1;0<=u;u--){const a=d[u];if(a[k])a[k](n,f)}return f}function Af(d){return(f,k)=>f===Zd?Zd:k[d]?k[d](f):f}function Wm(d,f){const k= Bf[d.id()];let n=null;if(void 0===k||null===k)return n=f(d),Bf[d.id()]=[[f,n]],n;for(let u=0;u{a=a(u,ma(f));!xb(a)||Array.isArray(a)?da.error("please return an object in beforesetup hooks"):f=ma(f,a)});n=new (M.getComponent("Player"))(u, f,k);Xb("setup").forEach(a=>a(n));return n}function ia(...d){const f=H.obj||H;return(f.merge||f.mergeOptions).apply(f,d)}function Na(...d){const f=H.time||H;return(f.createTimeRanges||f.createTimeRanges).apply(f,d)}function yi(d){try{return(new URL(d)).pathname.split("/").slice(-2).join("/")}catch(f){return""}}function Lb(){}var bb="undefined"!==typeof window?window:"undefined"!==typeof jb.commonjsGlobal?jb.commonjsGlobal:"undefined"!==typeof self?self:{};const D=jb.getDefaultExportFromCjs(bb);var zi= Array.prototype.slice,ae=function(d,f){"length"in d||(d=[d]);for(d=zi.call(d);d.length;){var k=d.shift(),n=f(k);if(n)return n;k.childNodes&&k.childNodes.length&&(d=zi.call(k.childNodes).concat(d))}};pc.prototype.nodeType=8;pc.prototype.nodeName="#comment";pc.prototype.toString=function(){return"[object Comment]"};Sb.prototype.type="DOMTextNode";Sb.prototype.nodeType=3;Sb.prototype.nodeName="#text";Sb.prototype.toString=function(){return this.data};Sb.prototype.replaceData=function(d,f,k){var n=this.data, u=n.substring(0,d);d=n.substring(d+f,n.length);this.data=u+k+d;this.length=this.data.length};var Ai=function(d){var f=this,k=d.type;d.target||(d.target=f);f.listeners||(f.listeners={});if(k=f.listeners[k])return k.forEach(function(n){d.currentTarget=f;"function"===typeof n?n(d):n.handleEvent(d)});f.parentNode&&f.parentNode.dispatchEvent(d)},Bi=function(d,f){this.listeners||(this.listeners={});this.listeners[d]||(this.listeners[d]=[]);-1===this.listeners[d].indexOf(f)&&this.listeners[d].push(f)},Ci= function(d,f){this.listeners&&this.listeners[d]&&(d=this.listeners[d],f=d.indexOf(f),-1!==f&&d.splice(f,1))},lm="area base br col embed hr img input keygen link menuitem meta param source track wbr".split(" ");fa.prototype.type="DOMElement";fa.prototype.nodeType=1;fa.prototype.appendChild=function(d){d.parentNode&&d.parentNode.removeChild(d);this.childNodes.push(d);d.parentNode=this;return d};fa.prototype.replaceChild=function(d,f){d.parentNode&&d.parentNode.removeChild(d);var k=this.childNodes.indexOf(f); f.parentNode=null;this.childNodes[k]=d;d.parentNode=this;return f};fa.prototype.removeChild=function(d){var f=this.childNodes.indexOf(d);this.childNodes.splice(f,1);d.parentNode=null;return d};fa.prototype.insertBefore=function(d,f){d.parentNode&&d.parentNode.removeChild(d);f=null===f||void 0===f?-1:this.childNodes.indexOf(f);-1d;d++)n[String.fromCharCode(d)]=d-32;for(d=48;58>d;d++)n[d-48]=d;for(d=1;13>d;d++)n["f"+d]=d+111;for(d=0;10>d;d++)n["numpad "+d]=d+96;var a=f.names=f.title={};for(d in n)a[n[d]]=d;for(var b in u)n[b]=u[b]})(Ff,Ff.exports);const Y=jb.getDefaultExportFromCjs(Ff.exports),Zm=jb.getDefaultExportFromCjs(function(d,f){var k=null;try{var n=JSON.parse(d,f)}catch(u){k=u}return[k,n]}); var Gf={},Ei={exports:{}};(function(d){function f(){d.exports=f=Object.assign?Object.assign.bind():function(k){for(var n=1;n=n.statusCode){k=u;if(f)if(bb.TextDecoder){n=nm(n.headers&&n.headers["content-type"]);try{k=(new TextDecoder(n)).decode(u)}catch(a){}}else k=String.fromCharCode.apply(null,new Uint8Array(u));d({cause:k})}else d(null,u)}};var rm=function(d){var f={};if(!d)return f;d.trim().split("\n").forEach(function(k){var n=k.indexOf(":"),u=k.slice(0,n).trim().toLowerCase();k=k.slice(n+1).trim();"undefined"===typeof f[u]?f[u]=k:Array.isArray(f[u])?f[u].push(k):f[u]= [f[u],k]});return f};Gf=ub;Gf.default=ub;ub.XMLHttpRequest=bb.XMLHttpRequest||sm;ub.XDomainRequest="withCredentials"in new ub.XMLHttpRequest?ub.XMLHttpRequest:bb.XDomainRequest;(function(d,f){for(var k=0;k=f)?(this.set(d,f),!0):!1}};var $e=Ef.createElement&&Ef.createElement("textarea"),um={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},uh={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)"}, vm={v:"title",lang:"lang"},th={rt:"ruby"},vh=[[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]];af.prototype.applyStyles=function(d,f){f=f||this.div;for(var k in d)d.hasOwnProperty(k)&&(f.style[k]=d[k])};af.prototype.formatStyle=function(d,f){return 0===d?0:d+f};Jd.prototype=Ze(af.prototype);Jd.prototype.constructor=Jd;Pa.prototype.move=function(d,f){f=void 0!==f?f:this.lineHeight;switch(d){case "+x":this.left+=f;this.right+=f;break;case "-x":this.left-=f;this.right-=f;break;case "+y":this.top+=f;this.bottom+=f;break;case "-y":this.top-=f,this.bottom-=f}};Pa.prototype.overlaps=function(d){return this.left< d.right&&this.right>d.left&&this.topd.top};Pa.prototype.overlapsAny=function(d){for(var f=0;f=d.top&&this.bottom<=d.bottom&&this.left>=d.left&&this.right<=d.right};Pa.prototype.overlapsOppositeAxis=function(d,f){switch(f){case "+x":return this.leftd.right;case "+y":return this.topd.bottom}};Pa.prototype.intersectPercentage= function(d){return Math.max(0,Math.min(this.right,d.right)-Math.max(this.left,d.left))*Math.max(0,Math.min(this.bottom,d.bottom)-Math.max(this.top,d.top))/(this.height*this.width)};Pa.prototype.toCSSCompatValues=function(d){return{top:this.top-d.top,bottom:d.bottom-this.bottom,left:this.left-d.left,right:d.right-this.right,height:this.height,width:this.width}};Pa.getSimpleBoxPosition=function(d){var f=d.div?d.div.offsetHeight:d.tagName?d.offsetHeight:0,k=d.div?d.div.offsetWidth:d.tagName?d.offsetWidth: 0,n=d.div?d.div.offsetTop:d.tagName?d.offsetTop:0;d=d.div?d.div.getBoundingClientRect():d.tagName?d.getBoundingClientRect():d;return{left:d.left,right:d.right,top:d.top||n,height:d.height||f,bottom:d.bottom||n+(d.height||f),width:d.width||k}};qc.StringDecoder=function(){return{decode:function(d){if(!d)return"";if("string"!==typeof d)throw Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(d))}}};qc.convertCueToDOMTree=function(d,f){return d&&f?sh(d,f):null};qc.processCues= function(d,f,k){if(!d||!f||!k)return null;for(;k.firstChild;)k.removeChild(k.firstChild);var n=d.document.createElement("div");n.style.position="absolute";n.style.left="0";n.style.right="0";n.style.top="0";n.style.bottom="0";n.style.margin="1.5%";k.appendChild(n);if(function(c){for(var e=0;e=z.line))var E=z.line;else if(z.track&&z.track.textTrackList&&z.track.textTrackList.mediaElement){E=z.track;for(var I=E.textTrackList,G=0,O=0;Ot&&(O=(0>O?-1:1)*Math.ceil(t/G)*G);0>E&&(O+=""===z.vertical?y.height:y.width,I=I.reverse());A.move(Q,O)}else{A=A.lineHeight/y.height*100;switch(z.lineAlign){case "center":E-=A/2;break;case "end":E-=A}switch(z.vertical){case "":x.applyStyles({top:x.formatStyle(E,"%")});break;case "rl":x.applyStyles({left:x.formatStyle(E,"%")});break;case "lr":x.applyStyles({right:x.formatStyle(E,"%")})}I=["+y","-x","+x", "-y"];A=new Pa(x)}a:{z=A;A=I;t=new Pa(z);E=1;for(I=0;IG&&(l=new Pa(z),E=G);z=new Pa(t)}p=l||t}x.move(p.toCSSCompatValues(y));e.displayState=c.div;u.push(Pa.getSimpleBoxPosition(c))}})()}else for(k=0;k{u=u(d);return u===d?n:n.concat([u])},[d]).forEach(n=>{for(var u=0;uu);this.customParsers.push(u=>{if(d.exec(u))return this.trigger("data",{type:"custom",data:k(u),customType:f,segment:n}),!0})}addTagMapper({expression:d,map:f}){this.tagMappers.push(k=>d.test(k)?f(k):k)}}const hn=d=>d.toLowerCase().replace(/-(\w)/g,f=>f[1].toUpperCase()),Yb=function(d){const f={};Object.keys(d).forEach(function(k){f[hn(k)]=d[k]});return f},Jf=function(d){const {serverControl:f,targetDuration:k,partTargetDuration:n}= d;if(f){d=k&&3*k;var u=n&&2*n;k&&!f.hasOwnProperty("holdBack")&&(f.holdBack=d,this.trigger("info",{message:`${"#EXT-X-SERVER-CONTROL"} defaulting HOLD-BACK to targetDuration * 3 (${d}).`}));d&&f.holdBack{k.uri||!k.parts&&!k.preloadHints||(!k.map&&n&&(k.map=n),!k.key&&u&&(k.key=u),k.timeline||"number"!==typeof e||(k.timeline=e),this.manifest.preloadSegment=k)});this.parseStream.on("data",function(t){let x,y;({tag(){({version(){t.version&&(this.manifest.version=t.version)},["allow-cache"](){this.manifest.allowCache=t.allowed;"allowed"in t||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)}, byterange(){const A={};"length"in t&&(k.byterange=A,A.length=t.length,"offset"in t||(t.offset=g));"offset"in t&&(k.byterange=A,A.offset=t.offset);g=A.offset+A.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"}));"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"}));t.title&& (k.title=t.title);0{E.programDateTime=z-1E3*E.duration;return E.programDateTime},this.lastProgramDateTime)},targetduration(){!isFinite(t.duration)||0>t.duration?this.trigger("warn",{message:"ignoring invalid target duration: "+t.duration}):(this.manifest.targetDuration=t.duration,Jf.call(this,this.manifest))},start(){!t.attributes||isNaN(t.attributes["TIME-OFFSET"])?this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"}):this.manifest.start= {timeOffset:t.attributes["TIME-OFFSET"],precise:t.attributes.PRECISE}},["cue-out"](){k.cueOut=t.data},["cue-out-cont"](){k.cueOutCont=t.data},["cue-in"](){k.cueIn=t.data},skip(){this.manifest.skip=Yb(t.attributes);this.warnOnMissingAttributes_("#EXT-X-SKIP",t.attributes,["SKIPPED-SEGMENTS"])},part(){a=!0;const A=this.manifest.segments.length,z=Yb(t.attributes);k.parts=k.parts||[];k.parts.push(z);z.byterange&&(z.byterange.hasOwnProperty("offset")||(z.byterange.offset=l),l=z.byterange.offset+z.byterange.length); this.warnOnMissingAttributes_(`#EXT-X-PART #${k.parts.length-1} for segment #${A}`,t.attributes,["URI","DURATION"]);this.manifest.renditionReports&&this.manifest.renditionReports.forEach((E,I)=>{E.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${I} lacks required attribute(s): LAST-PART`})})},["server-control"](){const A=this.manifest.serverControl=Yb(t.attributes);A.hasOwnProperty("canBlockReload")||(A.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})); Jf.call(this,this.manifest);A.canSkipDateranges&&!A.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"](){const A=this.manifest.segments.length,z=Yb(t.attributes);var E=z.type&&"PART"===z.type;k.preloadHints=k.preloadHints||[];k.preloadHints.push(z);z.byterange&&!z.byterange.hasOwnProperty("offset")&&(z.byterange.offset=E?l:0,E&&(l=z.byterange.offset+z.byterange.length)); E=k.preloadHints.length-1;this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${E} for segment #${A}`,t.attributes,["TYPE","URI"]);if(z.type)for(let I=0;Iz.duration&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"});z.plannedDuration&&0>z.plannedDuration&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"}); var E=!!z.endOnNext;E&&!z.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT\x3dYES attribute must have a CLASS attribute"});E&&(z.duration||z.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT\x3dYES attribute must not contain DURATION or END-DATE attributes"});z.duration&&z.endDate&&(E=z.startDate.getTime()+1E3*z.duration,this.manifest.dateRanges[A].endDate=new Date(E));if(p[z.id]){for(const I in p[z.id])if(z[I]&&JSON.stringify(p[z.id][I])!==JSON.stringify(z[I])){this.trigger("warn", {message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}A=this.manifest.dateRanges.findIndex(I=>I.id===z.id);this.manifest.dateRanges[A]=nb(this.manifest.dateRanges[A],z);p[z.id]=nb(p[z.id],z);this.manifest.dateRanges.pop()}else p[z.id]=z},["independent-segments"](){this.manifest.independentSegments=!0},["content-steering"](){this.manifest.contentSteering=Yb(t.attributes);this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",t.attributes,["SERVER-URI"])}}[t.tagType]|| b).call(d)},uri(){k.uri=t.uri;f.push(k);!this.manifest.targetDuration||"duration"in k||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),k.duration=this.manifest.targetDuration);u&&(k.key=u);k.timeline=e;n&&(k.map=n);l=0;null!==this.lastProgramDateTime&&(k.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1E3*k.duration);k={}},comment(){},custom(){t.segment?(k.custom=k.custom||{},k.custom[t.customType]=t.data):(this.manifest.custom=this.manifest.custom|| {},this.manifest.custom[t.customType]=t.data)}})[t.type].call(d)})}warnOnMissingAttributes_(d,f,k){const n=[];k.forEach(function(u){f.hasOwnProperty(u)||n.push(u)});n.length&&this.trigger("warn",{message:`${d} lacks required attribute(s): ${n.join(", ")}`})}push(d){this.lineStream.push(d)}end(){this.lineStream.push("\n");this.manifest.dateRanges.length&&null===this.lastProgramDateTime&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}); this.lastProgramDateTime=null;this.trigger("end")}addParser(d){this.parseStream.addParser(d)}addTagMapper(d){this.parseStream.addTagMapper(d)}}var ic={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/}, kn=["video","audio","text"],Ki=["Video","Audio","Text"],Li=function(d){return d?d.replace(/avc1\.(\d+)\.(\d+)/i,function(f,k,n){f=("00"+Number(k).toString(16)).slice(-2);n=("00"+Number(n).toString(16)).slice(-2);return"avc1."+f+"00"+n}):d},zb=function(d){void 0===d&&(d="");var f=[];d.split(",").forEach(function(k){k=k.trim();var n;kn.forEach(function(u){var a=ic[u].exec(k.toLowerCase());if(a&&!(1>=a.length)){n=u;a=k.substring(0,a[1].length);var b=k.replace(a,"");f.push({type:a,details:b,mediaType:u})}}); n||f.push({type:k,details:"",mediaType:"unknown"})});return f},ln=function(d,f){if(!d.mediaGroups.AUDIO||!f)return null;d=d.mediaGroups.AUDIO[f];if(!d)return null;for(var k in d)if(f=d[k],f.default&&f.playlists)return zb(f.playlists[0].attributes.CODECS);return null},Mi=function(d){void 0===d&&(d="");return ic.audio.test(d.trim().toLowerCase())},mn=function(d){void 0===d&&(d="");return ic.text.test(d.trim().toLowerCase())},id=function(d){if(d&&"string"===typeof d){var f=d.toLowerCase().split(",").map(function(u){return Li(u.trim())}), k="video";1===f.length&&Mi(f[0])?k="audio":1===f.length&&mn(f[0])&&(k="application");var n="mp4";f.every(function(u){return ic.mp4.test(u)})?n="mp4":f.every(function(u){return ic.webm.test(u)})?n="webm":f.every(function(u){return ic.ogg.test(u)})&&(n="ogg");return k+"/"+n+';codecs\x3d"'+d+'"'}},be=function(d){void 0===d&&(d="");return D.MediaSource&&D.MediaSource.isTypeSupported&&D.MediaSource.isTypeSupported(id(d))||!1},Kf=function(d){void 0===d&&(d="");return d.toLowerCase().split(",").every(function(f){f= f.trim();for(var k=0;kf&&(k=k-f-f-Ka(2)));return Number(k)},qn=function(d,f){f={}.le;f=void 0===f?!1:f;if("bigint"!==typeof d&&"number"!==typeof d||"number"===typeof d&&d!==d)d=0;d=Ka(d);for(var k=Math.ceil(d.toString(2).length/8),n=new Uint8Array(new ArrayBuffer(k)), u=0;ud&&(n[a]=Math.abs(~n[a]),n[a]-=0===u?1:2)}return n},Pi=function(d,f){"string"!==typeof d&&d&&"function"===typeof d.toString&&(d=d.toString());if("string"!==typeof d)return new Uint8Array;f||(d=unescape(encodeURIComponent(d)));f=new Uint8Array(d.length);for(var k=0;k=f.length)return U(f[0]);d=f.reduce(function(a,b,c){return a+(b.byteLength||b.length)},0);var n=new Uint8Array(d),u=0;f.forEach(function(a){a=U(a);n.set(a,u);u+=a.byteLength});return n},pa=function(d,f,k){k=void 0===k?{}:k;var n=k.offset,u=void 0===n?0:n;k=k.mask;var a=void 0===k?[]:k;d=U(d);f=U(f);k=f.every?f.every:Array.prototype.every;return f.length&&d.length-u>=f.length&&k.call(f,function(b,c){return b===(a[c]?a[c]&d[u+c]:d[u+c])})},sn=function(d, f,k){f.forEach(function(n){for(var u in d.mediaGroups[n])for(var a in d.mediaGroups[n][u])k(d.mediaGroups[n][u][a],n,u,a)})},tn=Kd({HTML:"text/html",isHTML:function(d){return d===tn.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),Qi=Kd({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(d){return d===Qi.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"}); var ce=Qi;var wb=function(d,f,k){void 0===k&&(k=Array.prototype);if(d&&"function"===typeof k.find)return k.find.call(d,f);for(k=0;k!!d&&"object"===typeof d,Ga=(...d)=>d.reduce((f,k)=>{if("object"!==typeof k)return f;Object.keys(k).forEach(n=>{Array.isArray(f[n])&&Array.isArray(k[n])?f[n]=f[n].concat(k[n]):Ui(f[n])&&Ui(k[n])?f[n]=Ga(f[n],k[n]):f[n]=k[n]});return f},{}),Vi=d=>Object.keys(d).map(f=>d[f]),Fc=d=>d.reduce((f,k)=>f.concat(k),[]),Wi=d=>{if(!d.length)return[];const f=[];for(let k=0;kd.reduce((k,n,u)=>{n[f]&& k.push(u);return k},[]),xn=(d,f)=>Vi(d.reduce((k,n)=>{n.forEach(u=>{k[f(u)]=u});return k},{})),jd=({baseUrl:d="",source:f="",range:k="",indexRange:n=""})=>{d={uri:f,resolvedUri:Ja(d||"",f)};if(k||n)n=(k?k:n).split("-"),k=D.BigInt?D.BigInt(n[0]):parseInt(n[0],10),n=D.BigInt?D.BigInt(n[1]):parseInt(n[1],10),k{d&&"number"!==typeof d&&(d=parseInt(d,10));return isNaN(d)?null:d},yn={static(d){const {duration:f,timescale:k=1,sourceDuration:n,periodDuration:u}=d;d=Xi(d.endNumber);const a=f/k;return"number"===typeof d?{start:0,end:d}:"number"===typeof u?{start:0,end:u/a}:{start:0,end:n/a}},dynamic(d){const {NOW:f,clientOffset:k,availabilityStartTime:n,timescale:u=1,duration:a,periodStart:b=0,minimumUpdatePeriod:c= 0,timeShiftBufferDepth:e=Infinity}=d;d=Xi(d.endNumber);const g=(f+k)/1E3,l=n+b,p=Math.ceil((g+c-l)*u/a),t=Math.floor((g-l)*u/a);return{start:Math.max(0,Math.floor((g-l-e)*u/a)),end:"number"===typeof d?d:Math.min(p,t)}}},zn=d=>f=>{const {duration:k,timescale:n=1,periodStart:u,startNumber:a=1}=d;return{number:a+f,duration:k/n,timeline:u,time:f*k}},Of=d=>{const {type:f,duration:k,timescale:n=1,periodDuration:u,sourceDuration:a}=d,{start:b,end:c}=yn[f](d);var e=[];for(let g=b;g{const {baseUrl:f,initialization:k={},sourceDuration:n,indexRange:u="",periodStart:a,presentationTime:b,number:c=0,duration:e}=d;if(!f)throw Error("NO_BASE_URL");const g=jd({baseUrl:f,source:k.sourceURL,range:k.range}),l=jd({baseUrl:f,source:f,indexRange:u});l.map=g;e?(d=Of(d),d.length&&(l.duration=d[0].duration,l.timeline=d[0].timeline)):n&&(l.duration=n,l.timeline=a);l.presentationTime=b||a;l.number=c;return[l]}, Pf=(d,f,k)=>{const n=d.sidx.map?d.sidx.map:null,u=d.sidx.duration,a=d.timeline||0;var b=d.sidx.byterange,c=b.offset+b.length;b=f.timescale;const e=f.references.filter(z=>1!==z.referenceType),g=[],l=d.endList?"static":"dynamic",p=d.sidx.timeline;let t=p,x=d.mediaSequence||0;c="bigint"===typeof f.firstOffset?D.BigInt(c)+f.firstOffset:c+f.firstOffset;for(let z=0;zxn(d,({timeline:f})=>f).sort((f,k)=>f.timeline>k.timeline?1:-1),Cn=(d,f)=>{for(let k=0;k{let f=[];sn(d,An,(k,n,u,a)=>{f=f.concat(k.playlists|| [])});return f},aj=({playlist:d,mediaSequence:f})=>{d.mediaSequence=f;d.segments.forEach((k,n)=>{k.number=d.mediaSequence+n})},Dn=({oldPlaylists:d,newPlaylists:f,timelineStarts:k})=>{f.forEach(n=>{n.discontinuitySequence=k.findIndex(function({timeline:c}){return c===n.timeline});const u=Cn(d,n.attributes.NAME);if(u&&!n.sidx){var a=n.segments[0],b=u.segments.findIndex(function(c){return Math.abs(c.presentationTime-a.presentationTime)u.timeline||u.segments.length&&n.timeline>u.segments[u.segments.length-1].timeline)&&n.discontinuitySequence--):(u.segments[b].discontinuity&&!a.discontinuity&&(a.discontinuity=!0,n.discontinuityStarts.unshift(0),n.discontinuitySequence--),aj({playlist:n,mediaSequence:u.segments[b].number}))}})},En=({oldManifest:d,newManifest:f})=>{const k=d.playlists.concat($i(d)),n=f.playlists.concat($i(f));f.timelineStarts= Zi([d.timelineStarts,f.timelineStarts]);Dn({oldPlaylists:k,newPlaylists:n,timelineStarts:f.timelineStarts});return f},de=d=>{var f;if(f=d){f=d.uri+"-";d=d.byterange;let k;k="bigint"===typeof d.offset||"bigint"===typeof d.length?D.BigInt(d.offset)+D.BigInt(d.length)-D.BigInt(1):d.offset+d.length-1;f+=`${d.offset}-${k}`}return f},Qf=d=>{d=d.reduce(function(k,n){k[n.attributes.baseUrl]||(k[n.attributes.baseUrl]=[]);k[n.attributes.baseUrl].push(n);return k},{});let f=[];Object.values(d).forEach(k=>{k= Vi(k.reduce((n,u)=>{const a=u.attributes.id+(u.attributes.lang||"");n[a]?(u.segments&&(u.segments[0]&&(u.segments[0].discontinuity=!0),n[a].segments.push(...u.segments)),u.attributes.contentProtection&&(n[a].attributes.contentProtection=u.attributes.contentProtection)):(n[a]=u,n[a].attributes.timelineStarts=[]);n[a].attributes.timelineStarts.push({start:u.attributes.periodStart,timeline:u.attributes.periodStart});return n},{}));f=f.concat(k)});return f.map(k=>{k.discontinuityStarts=wn(k.segments|| [],"discontinuity");return k})},Rf=(d,f)=>{const k=de(d.sidx);(f=k&&f[k]&&f[k].sidx)&&Pf(d,f,d.sidx.resolvedUri);return d},Fn=(d,f={})=>{if(!Object.keys(f).length)return d;for(const k in d)d[k]=Rf(d[k],f);return d},Gn=({attributes:d,segments:f,sidx:k,mediaSequence:n,discontinuitySequence:u,discontinuityStarts:a},b)=>{f={attributes:{NAME:d.id,BANDWIDTH:d.bandwidth,CODECS:d.codecs,["PROGRAM-ID"]:1},uri:"",endList:"static"===d.type,timeline:d.periodStart,resolvedUri:d.baseUrl||"",targetDuration:d.duration, discontinuitySequence:u,discontinuityStarts:a,timelineStarts:d.timelineStarts,mediaSequence:n,segments:f};d.contentProtection&&(f.contentProtection=d.contentProtection);d.serviceLocation&&(f.attributes.serviceLocation=d.serviceLocation);k&&(f.sidx=k);b&&(f.attributes.AUDIO="audio",f.attributes.SUBTITLES="subs");return f},Hn=({attributes:d,segments:f,mediaSequence:k,discontinuityStarts:n,discontinuitySequence:u})=>{"undefined"===typeof f&&(f=[{uri:d.baseUrl,timeline:d.periodStart,resolvedUri:d.baseUrl|| "",duration:d.sourceDuration,number:0}],d.duration=d.sourceDuration);const a={NAME:d.id,BANDWIDTH:d.bandwidth,["PROGRAM-ID"]:1};d.codecs&&(a.CODECS=d.codecs);f={attributes:a,uri:"",endList:"static"===d.type,timeline:d.periodStart,resolvedUri:d.baseUrl||"",targetDuration:d.duration,timelineStarts:d.timelineStarts,discontinuityStarts:n,discontinuitySequence:u,mediaSequence:k,segments:f};d.serviceLocation&&(f.attributes.serviceLocation=d.serviceLocation);return f},In=(d,f={},k=!1)=>{let n;d=d.reduce((u, a)=>{const b=a.attributes.role&&a.attributes.role.value||"";var c=a.attributes.lang||"";let e=a.attributes.label||"main";c&&!a.attributes.label&&(e=`${a.attributes.lang}${b?` (${b})`:""}`);u[e]||(u[e]={language:c,autoselect:!0,default:"main"===b,playlists:[],uri:""});c=Rf(Gn(a,k),f);u[e].playlists.push(c);"undefined"===typeof n&&"main"===b&&(n=a,n.default=!0);return u},{});if(!n){const u=Object.keys(d)[0];d[u].default=!0}return d},Jn=(d,f={})=>d.reduce((k,n)=>{const u=n.attributes.label||n.attributes.lang|| "text";k[u]||(k[u]={language:u,default:!1,autoselect:!1,playlists:[],uri:""});k[u].playlists.push(Rf(Hn(n),f));return k},{}),Kn=d=>d.reduce((f,k)=>{if(!k)return f;k.forEach(n=>{const {channel:u,language:a}=n;f[a]={autoselect:!1,default:!1,instreamId:u,language:a};n.hasOwnProperty("aspectRatio")&&(f[a].aspectRatio=n.aspectRatio);n.hasOwnProperty("easyReader")&&(f[a].easyReader=n.easyReader);n.hasOwnProperty("3D")&&(f[a]["3D"]=n["3D"])});return f},{}),Ln=({attributes:d,segments:f,sidx:k,discontinuityStarts:n})=> {f={attributes:{NAME:d.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:d.width,height:d.height},CODECS:d.codecs,BANDWIDTH:d.bandwidth,["PROGRAM-ID"]:1},uri:"",endList:"static"===d.type,timeline:d.periodStart,resolvedUri:d.baseUrl||"",targetDuration:d.duration,discontinuityStarts:n,timelineStarts:d.timelineStarts,segments:f};d.frameRate&&(f.attributes["FRAME-RATE"]=d.frameRate);d.contentProtection&&(f.contentProtection=d.contentProtection);d.serviceLocation&&(f.attributes.serviceLocation=d.serviceLocation); k&&(f.sidx=k);return f},Mn=({attributes:d})=>"video/mp4"===d.mimeType||"video/webm"===d.mimeType||"video"===d.contentType,Nn=({attributes:d})=>"audio/mp4"===d.mimeType||"audio/webm"===d.mimeType||"audio"===d.contentType,On=({attributes:d})=>"text/vtt"===d.mimeType||"text"===d.contentType,Pn=(d,f)=>{d.forEach(k=>{k.mediaSequence=0;k.discontinuitySequence=f.findIndex(function({timeline:n}){return n===k.timeline});k.segments&&k.segments.forEach((n,u)=>{n.number=u})})},bj=d=>d?Object.keys(d).reduce((f, k)=>f.concat(d[k].playlists),[]):[],Qn=({dashPlaylists:d,locations:f,contentSteering:k,sidxMapping:n={},previousManifest:u,eventStream:a})=>{if(!d.length)return{};const {sourceDuration:b,type:c,suggestedPresentationDelay:e,minimumUpdatePeriod:g}=d[0].attributes;var l=Qf(d.filter(Mn)).map(Ln),p=Qf(d.filter(Nn)),t=Qf(d.filter(On));d=d.map(y=>y.attributes.captionServices).filter(Boolean);const x={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},["CLOSED-CAPTIONS"]:{}, SUBTITLES:{}},uri:"",duration:b,playlists:Fn(l,n)};0<=g&&(x.minimumUpdatePeriod=1E3*g);f&&(x.locations=f);k&&(x.contentSteering=k);"dynamic"===c&&(x.suggestedPresentationDelay=e);a&&0y);x.timelineStarts=Zi(t);Pn(l,x.timelineStarts);p&&(x.mediaGroups.AUDIO.audio=p);n&&(x.mediaGroups.SUBTITLES.subs=n);d.length&&(x.mediaGroups["CLOSED-CAPTIONS"].cc= Kn(d));return u?En({oldManifest:u,newManifest:x}):x},cj=(d,f)=>{const {type:k,minimumUpdatePeriod:n=0,media:u="",sourceDuration:a,timescale:b=1,startNumber:c=1,periodStart:e}=d,g=[];let l=-1;for(let x=0;xl&&(l=p);p&&p>l&&(l=p);if(0>t)if(t=x+1,t===f.length)if("dynamic"===k&&0(f,k,n,u)=>{if("$$"===f)return"$";if("undefined"===typeof d[k])return f;f=""+d[k];if("RepresentationID"===k)return f;u=n?parseInt(u,10):1;return f.length>=u?f:`${Array(u-f.length+1).join("0")}${f}`},Rn=(d,f)=>d.duration||f?d.duration?Of(d):cj(d,f):[{number:d.startNumber||1,duration:d.sourceDuration, time:0,timeline:d.periodStart}],Sn=(d,f)=>{const k={RepresentationID:d.id,Bandwidth:d.bandwidth||0},{initialization:n={sourceURL:"",range:""}}=d,u=jd({baseUrl:d.baseUrl,source:n.sourceURL.replace(dj,ej(k)),range:n.range});return Rn(d,f).map(a=>{k.Number=a.number;k.Time=a.time;const b=(d.media||"").replace(dj,ej(k)),c=d.periodStart+(a.time-(d.presentationTimeOffset||0))/(d.timescale||1);return{uri:b,timeline:a.timeline,duration:a.duration,resolvedUri:Ja(d.baseUrl||"",b),map:u,number:a.number,presentationTime:c}})}, Tn=(d,f)=>{const {duration:k,segmentUrls:n=[],periodStart:u}=d;if(!k&&!f||k&&f)throw Error("SEGMENT_TIME_UNSPECIFIED");const a=n.map(c=>{const {baseUrl:e,initialization:g={}}=d,l=jd({baseUrl:e,source:g.sourceURL,range:g.range});c=jd({baseUrl:e,source:c.media,range:c.mediaRange});c.map=l;return c});let b;k&&(b=Of(d));f&&(b=cj(d,f));return b.map((c,e)=>{if(a[e]){e=a[e];const g=d.timescale||1,l=d.presentationTimeOffset||0;e.timeline=c.timeline;e.duration=c.duration;e.number=c.number;e.presentationTime= u+(c.time-l)/g;return e}}).filter(c=>c)},Un=({attributes:d,segmentInfo:f})=>{let k;if(f.template){var n=Sn;k=Ga(d,f.template)}else f.base?(n=Yi,k=Ga(d,f.base)):f.list&&(n=Tn,k=Ga(d,f.list));d={attributes:d};if(!n)return d;n=n(k,f.segmentTimeline);if(k.duration){const {duration:u,timescale:a=1}=k;k.duration=u/a}else k.duration=n.length?n.reduce((u,a)=>Math.max(u,Math.ceil(a.duration)),0):0;d.attributes=k;d.segments=n;f.base&&k.indexRange&&(d.sidx=n[0],d.segments=[]);return d},qa=(d,f)=>Wi(d.childNodes).filter(({tagName:k})=> k===f),Vn=d=>d.textContent.trim(),Wn=d=>parseFloat(d.split("/").reduce((f,k)=>f/k)),Gc=d=>{d=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(d);if(!d)return 0;const [f,k,n,u,a,b]=d.slice(1);return 31536E3*parseFloat(f||0)+2592E3*parseFloat(k||0)+86400*parseFloat(n||0)+3600*parseFloat(u||0)+60*parseFloat(a||0)+parseFloat(b||0)},fj={mediaPresentationDuration(d){return Gc(d)},availabilityStartTime(d){/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(d)&&(d+="Z");return Date.parse(d)/ 1E3},minimumUpdatePeriod(d){return Gc(d)},suggestedPresentationDelay(d){return Gc(d)},type(d){return d},timeShiftBufferDepth(d){return Gc(d)},start(d){return Gc(d)},width(d){return parseInt(d,10)},height(d){return parseInt(d,10)},bandwidth(d){return parseInt(d,10)},frameRate(d){return Wn(d)},startNumber(d){return parseInt(d,10)},timescale(d){return parseInt(d,10)},presentationTimeOffset(d){return parseInt(d,10)},duration(d){const f=parseInt(d,10);return isNaN(f)?Gc(d):f},d(d){return parseInt(d,10)}, t(d){return parseInt(d,10)},r(d){return parseInt(d,10)},presentationTime(d){return parseInt(d,10)},DEFAULT(d){return d}},Ca=d=>d&&d.attributes?Wi(d.attributes).reduce((f,k)=>{f[k.name]=(fj[k.name]||fj.DEFAULT)(k.value);return f},{}):{},Xn={"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", "urn:mpeg:dash:mp4protection:2011":"mp4protection"},ee=(d,f)=>f.length?Fc(d.map(function(k){return f.map(function(n){const u=n.textContent.trim(),a=Ja(k.baseUrl,u);n=Ga(Ca(n),{baseUrl:a});a!==u&&!n.serviceLocation&&k.serviceLocation&&(n.serviceLocation=k.serviceLocation);return n})})):d,Sf=d=>{var f=qa(d,"SegmentTemplate")[0];const k=qa(d,"SegmentList")[0],n=k&&qa(k,"SegmentURL").map(c=>Ga({tag:"SegmentURL"},Ca(c)));d=qa(d,"SegmentBase")[0];var u=k||f;u=u&&qa(u,"SegmentTimeline")[0];var a=k||d||f; a=a&&qa(a,"Initialization")[0];(f=f&&Ca(f))&&a?f.initialization=a&&Ca(a):f&&f.initialization&&(f.initialization={sourceURL:f.initialization});const b={template:f,segmentTimeline:u&&qa(u,"S").map(c=>Ca(c)),list:k&&Ga(Ca(k),{segmentUrls:n,initialization:Ca(a)}),base:d&&Ga(Ca(d),{initialization:Ca(a)})};Object.keys(b).forEach(c=>{b[c]||delete b[c]});return b},Yn=(d,f,k)=>n=>{var u=qa(n,"BaseURL");u=ee(f,u);const a=Ga(d,Ca(n)),b=Sf(n);return u.map(c=>({segmentInfo:Ga(k,b),attributes:Ga(a,c)}))},Zn=d=> d.reduce((f,k)=>{var n=Ca(k);n.schemeIdUri&&(n.schemeIdUri=n.schemeIdUri.toLowerCase());var u=Xn[n.schemeIdUri];if(u&&(f[u]={attributes:n},k=qa(k,"cenc:pssh")[0])){k=k.textContent.trim();u=f[u];if(n=k){k=D.atob?D.atob(k):Buffer.from(k,"base64").toString("binary");n=new Uint8Array(k.length);for(var a=0;a{if("urn:scte:dash:cc:cea-608:2015"===d.schemeIdUri)return("string"!==typeof d.value?[]:d.value.split(";")).map(f=>{let k,n;n=f;/^CC\d=/.test(f)? [k,n]=f.split("\x3d"):/^CC\d$/.test(f)&&(k=f);return{channel:k,language:n}});if("urn:scte:dash:cc:cea-708:2015"===d.schemeIdUri)return("string"!==typeof d.value?[]:d.value.split(";")).map(f=>{const k={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(f)){const [n,u=""]=f.split("\x3d");k.channel=n;k.language=f;u.split(",").forEach(a=>{const [b,c]=a.split(":");"lang"===b?k.language=c:"er"===b?k.easyReader=Number(c):"war"===b?k.aspectRatio=Number(c):"3D"===b&&(k["3D"]=Number(c))})}else k.language= f;k.channel&&(k.channel="SERVICE"+k.channel);return k})},ao=d=>Fc(qa(d.node,"EventStream").map(f=>{const k=Ca(f),n=k.schemeIdUri;return qa(f,"Event").map(u=>{const a=Ca(u),b=k.timescale||1,c=(a.presentationTime||0)/b+d.attributes.start;return{schemeIdUri:n,value:k.value,id:a.id,start:c,end:c+(a.duration||0)/b,messageData:u.textContent.trim()||a.messageData,contentEncoding:k.contentEncoding,presentationTimeOffset:k.presentationTimeOffset||0}})})),bo=(d,f,k)=>n=>{var u=Ca(n);const a=ee(f,qa(n,"BaseURL")); var b=qa(n,"Role")[0];b={role:Ca(b)};u=Ga(d,u,b);b=qa(n,"Accessibility")[0];(b=$n(Ca(b)))&&(u=Ga(u,{captionServices:b}));(b=qa(n,"Label")[0])&&b.childNodes.length&&(b=b.childNodes[0].nodeValue.trim(),u=Ga(u,{label:b}));b=Zn(qa(n,"ContentProtection"));Object.keys(b).length&&(u=Ga(u,{contentProtection:b}));b=Sf(n);n=qa(n,"Representation");b=Ga(k,b);return Fc(n.map(Yn(u,a,b)))},co=(d,f)=>(k,n)=>{n=ee(f,qa(k.node,"BaseURL"));const u=Ga(d,{periodStart:k.attributes.start});"number"===typeof k.attributes.duration&& (u.periodDuration=k.attributes.duration);const a=qa(k.node,"AdaptationSet");k=Sf(k.node);return Fc(a.map(bo(u,n,k)))},eo=(d,f)=>{1"number"===typeof d.start?d.start:f&&"number"===typeof f.start&&"number"===typeof f.duration? f.start+f.duration:f||"static"!==k?null:0,go=(d,f={})=>{const {manifestUri:k="",NOW:n=Date.now(),clientOffset:u=0,eventHandler:a=function(){}}=f;f=qa(d,"Period");if(!f.length)throw Error("INVALID_NUMBER_OF_PERIOD");const b=qa(d,"Location"),c=Ca(d),e=ee([{baseUrl:k}],qa(d,"BaseURL"));d=qa(d,"ContentSteering");c.type=c.type||"static";c.sourceDuration=c.mediaPresentationDuration||0;c.NOW=n;c.clientOffset=u;b.length&&(c.locations=b.map(Vn));const g=[];f.forEach((l,p)=>{const t=Ca(l);p=g[p-1];t.start= fo({attributes:t,priorPeriodAttributes:p?p.attributes:null,mpdType:c.type});g.push({node:l,attributes:t})});return{locations:c.locations,contentSteeringInfo:eo(d,a),representationInfo:Fc(g.map(co(c,e))),eventStream:Fc(g.map(ao))}},gj=d=>{if(""===d)throw Error("DASH_EMPTY_MANIFEST");const f=new Yh;let k,n;try{n=(k=f.parseFromString(d,"application/xml"))&&"MPD"===k.documentElement.tagName?k.documentElement:null}catch(u){}if(!n||n&&0{d=qa(d,"UTCTiming")[0];if(!d)return null;d=Ca(d);switch(d.schemeIdUri){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":d.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":d.method="GET";break;case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":d.method="DIRECT";d.value=Date.parse(d.value);break;default:throw Error("UNSUPPORTED_UTC_TIMING_SCHEME"); }return d},io=(d,f={})=>{d=go(gj(d),f);const k=d.representationInfo.map(Un);return Qn({dashPlaylists:k,locations:d.locations,contentSteering:d.contentSteeringInfo,sidxMapping:f.sidxMapping,previousManifest:f.previousManifest,eventStream:d.eventStream})};var jo=Math.pow(2,32),hj=function(d){d=new DataView(d.buffer,d.byteOffset,d.byteLength);return d.getBigUint64?(d=d.getBigUint64(0),d>>7,referencedSize:f.getUint32(n)&2147483647,subsegmentDuration:f.getUint32(n+ 4),startsWithSap:!!(d[n+8]&128),sapType:(d[n+8]&112)>>>4,sapDeltaTime:f.getUint32(n+8)&268435455});return k});var lo=U([73,68,51]),kd=function n(f,k){void 0===k&&(k=0);f=U(f);if(10>f.length-k||!pa(f,lo,{offset:k}))return k;var u=k;var a=k;void 0===a&&(a=0);k=U(f);var b=k[a+6]<<21|k[a+7]<<14|k[a+8]<<7|k[a+9];k=(k[a+5]&16)>>4?b+20:b+10;k=u+k;return n(f,k)},ij=function(f){return"string"===typeof f?Pi(f):f},mo=function(f){return Array.isArray(f)?f.map(function(k){return ij(k)}):[ij(f)]},no=function a(k, n,u){void 0===u&&(u=!1);n=mo(n);k=U(k);var b=[];if(!n.length)return b;for(var c=0;c>>0,g=k.subarray(c+4,c+8);if(0===e)break;e=c+e;if(e>k.length){if(u)break;e=k.length}c=k.subarray(c+8,e);pa(g,n[0])&&(1===n.length?b.push(c):b.push.apply(b,a(c,n.slice(1),u)));c=e}return b},jj=U([26,69,223,163]),kj=U([66,130]);U([24,83,128,103]);U([21,73,169,102]);U([22,84,174,107]);U([174]);U([215]);U([35,227,131]);U([174]);U([131]);U([136]);U([134]);U([99,162]); U([224]);U([225]);U([31,67,182,117]);U([231]);U([42,215,177]);U([160]);U([155]);U([161]);U([163]);var Tf=[128,64,32,16,8,4,2,1],fe=function(k,n,u,a){void 0===u&&(u=!0);void 0===a&&(a=!1);var b=1;for(var c=0;c=a.length)return a.length;var e=fe(a,b,!1);if(pa(u.bytes,e.bytes))return b;var g=fe(a,b+e.length);return c(u,a,b+g.length+g.value+e.length)},mj=function c(a,b){b=oo(b);a=U(a);var e=[];if(!b.length)return e;for(var g=0;ga.length?a.length:t+p.value);pa(b[0],l.bytes)&&(1=== b.length?e.push(t):e=e.concat(c(t,b.slice(1))));g+=l.length+p.length+t.length}return e},qo=U([0,0,0,1]),ro=U([0,0,1]),so=U([0,0,3]),nj=function(a,b,c,e){a=U(a);c=[].concat(c);for(var g=0,l,p=0;g>1&63);-1!==c.indexOf(x)&&(l=g+t);g+=t+("h264"===b?1:2)}else g++}return a.subarray(0,0)},Ta={webm:U([119,101,98,109]),matroska:U([109,97,116,114,111,115,107,97]),flac:U([102,76,97,67]),ogg:U([79,103,103,83]),ac3:U([11,119]),riff:U([82,73,70,70]),avi:U([65,86,73]),wav:U([87,65,86,69]),"3gp":U([102,116,121,112,51,103]),mp4:U([102,116,121,112]),fmp4:U([115,116,121,112]),mov:U([102,116,121,112,113,116]),moov:U([109,111,111,118]), moof:U([109,111,111,102])},Hc={aac:function(a){var b=kd(a);return pa(a,[255,16],{offset:b,mask:[255,22]})},mp3:function(a){var b=kd(a);return pa(a,[255,2],{offset:b,mask:[255,6]})},webm:function(a){a=mj(a,[jj,kj])[0];return pa(a,Ta.webm)},mkv:function(a){a=mj(a,[jj,kj])[0];return pa(a,Ta.matroska)},mp4:function(a){if(Hc["3gp"](a)||Hc.mov(a))return!1;if(pa(a,Ta.mp4,{offset:4})||pa(a,Ta.fmp4,{offset:4})||pa(a,Ta.moof,{offset:4})||pa(a,Ta.moov,{offset:4}))return!0},mov:function(a){return pa(a,Ta.mov, {offset:4})},"3gp":function(a){return pa(a,Ta["3gp"],{offset:4})},ac3:function(a){var b=kd(a);return pa(a,Ta.ac3,{offset:b})},ts:function(a){if(189>a.length&&1<=a.length)return 71===a[0];for(var b=0;b+188b;){if(71===a[b]&&71===a[b+188])return!0;b+=1}return!1},flac:function(a){var b=kd(a);return pa(a,Ta.flac,{offset:b})},ogg:function(a){return pa(a,Ta.ogg)},avi:function(a){return pa(a,Ta.riff)&&pa(a,Ta.avi,{offset:8})},wav:function(a){return pa(a,Ta.riff)&&pa(a,Ta.wav,{offset:8})},h264:function(a){return nj(a, "h264",7,3).length},h265:function(a){return nj(a,"h265",[32,33],3).length}},Uf=Object.keys(Hc).filter(function(a){return"ts"!==a&&"h264"!==a&&"h265"!==a}).concat(["ts","h264","h265"]);Uf.forEach(function(a){var b=Hc[a];Hc[a]=function(c){return b(U(c))}});var to=Hc,Vf=function(a){a=U(a);for(var b=0;b=b)return!1;Mb[a]= Mb[a].slice();Mb[a].splice(b,1);return!0},Ud={prefixed:!0},ge=["requestFullscreen exitFullscreen fullscreenElement fullscreenEnabled fullscreenchange fullscreenerror fullscreen".split(" "),"webkitRequestFullscreen webkitExitFullscreen webkitFullscreenElement webkitFullscreenEnabled webkitfullscreenchange webkitfullscreenerror -webkit-full-screen".split(" ")],pj=ge[0];let ld;for(let a=0;a(e,g,l)=>{g=b.levels[g];const p=new RegExp(`^(${g})$`);var t=a;"log"!==e&&l.unshift(e.toUpperCase()+":");c&&(t=`%c${a}`,l.unshift(c));l.unshift(t+":");Wa&&(Wa.push([].concat(l)),t=Wa.length-1E3,Wa.splice(0,0"Microsoft Edge"=== a.brand),Jc=!!Zb.brands.find(a=>"Chromium"===a.brand),Bb=!Ic&&Jc,Xf=he=(Zb.brands.find(a=>"Chromium"===a.brand)||{}).version||null,je="Windows"===Zb.platform);if(!Jc){const a=D.navigator&&D.navigator.userAgent||"";Wf=/iPod/i.test(a);rj=function(){const b=a.match(/OS (\d+)_/i);return b&&b[1]?b[1]:null}();Ab=/Android/i.test(a);sj=function(){const b=a.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!b)return null;const c=b[1]&&parseFloat(b[1]),e=b[2]&&parseFloat(b[2]);return c&&e?parseFloat(b[1]+ "."+b[2]):c?c:null}();tj=/Firefox/i.test(a);Ic=/Edg/i.test(a);Jc=/Chrome/i.test(a)||/CriOS/i.test(a);Bb=!Ic&&Jc;Xf=he=function(){const b=a.match(/(Chrome|CriOS)\/(\d+)/);return b&&b[2]?parseFloat(b[2]):null}();uj=function(){var b=/MSIE\s(\d+)\.\d/.exec(a);b=b&&parseFloat(b[1]);!b&&/Trident\/7.0/i.test(a)&&/rv:11.0/.test(a)&&(b=11);return b}();Yf=/Tizen/i.test(a);Zf=/Web0S/i.test(a);$f=Yf||Zf;ie=/Safari/i.test(a)&&!Bb&&!Ab&&!Ic&&!$f;je=/Windows/i.test(a);ke=/iPad/i.test(a)||ie&&md&&!/iPhone/i.test(a); le=/iPhone/i.test(a)&&!ke}const Qa=le||ke||Wf,me=(ie||Qa)&&!Bb;var vj=Object.freeze({__proto__:null,get IS_IPOD(){return Wf},get IOS_VERSION(){return rj},get IS_ANDROID(){return Ab},get ANDROID_VERSION(){return sj},get IS_FIREFOX(){return tj},get IS_EDGE(){return Ic},get IS_CHROMIUM(){return Jc},get IS_CHROME(){return Bb},get CHROMIUM_VERSION(){return Xf},get CHROME_VERSION(){return he},get IE_VERSION(){return uj},get IS_SAFARI(){return ie},get IS_WINDOWS(){return je},get IS_IPAD(){return ke},get IS_IPHONE(){return le}, get IS_TIZEN(){return Yf},get IS_WEBOS(){return Zf},get IS_SMART_TV(){return $f},TOUCH_ENABLED:md,IS_IOS:Qa,IS_ANY_SAFARI:me});const Wb=di("querySelector"),wj=di("querySelectorAll");var xj=Object.freeze({__proto__:null,isReal:Ac,isEl:Bc,isInFrame:ci,createEl:aa,textContent:Ub,prependTo:rf,hasClass:dd,addClass:cc,removeClass:Td,toggleClass:ei,setAttributes:fi,getAttributes:Vb,getAttribute:function(a,b){return a.getAttribute(b)},setAttribute:function(a,b,c){a.setAttribute(b,c)},removeAttribute:function(a, b){a.removeAttribute(b)},blockTextSelection:gi,unblockTextSelection:hi,getBoundingClientRect:Cc,findPosition:ed,getPointerPosition:Vd,isTextNode:ii,emptyEl:Wd,normalizeContent:ji,appendContent:qf,insertContent:ki,isSingleLeftClick:fd,$:Wb,$$:wj,computedStyle:Dc,copyStyleSheetsToWindow:li});let mi=!1,tf;const Om=function(){if(!1!==tf.options.autoSetup){var a=Array.prototype.slice.call(P.getElementsByTagName("video")),b=Array.prototype.slice.call(P.getElementsByTagName("audio")),c=Array.prototype.slice.call(P.getElementsByTagName("video-js")); if((a=a.concat(b,c))&&0=b&&(a(...e),c=g)}},Aj=function(a,b,c,e=D){let g;const l=function(){const p= this,t=arguments;let x=function(){x=g=null;c||a.apply(p,t)};!g&&c&&a.apply(p,t);e.clearTimeout(g);g=e.setTimeout(x,b)};l.cancel=()=>{e.clearTimeout(g);g=null};return l};var wo=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:30,bind_:na,throttle:Cb,debounce:Aj});let oe;class kb{on(a,b){const c=this.addEventListener;this.addEventListener=()=>{};ab(this,a,b);this.addEventListener=c}off(a,b){Ma(this,a,b)}one(a,b){const c=this.addEventListener;this.addEventListener=()=>{};Yd(this,a,b);this.addEventListener= c}any(a,b){const c=this.addEventListener;this.addEventListener=()=>{};wf(this,a,b);this.addEventListener=c}trigger(a){const b=a.type||a;"string"===typeof a&&(a={type:b});a=Xd(a);if(this.allowedEvents_[b]&&this["on"+b])this["on"+b](a);Ec(this,a)}queueTrigger(a){oe||=new Map;const b=a.type||a;let c=oe.get(this);c||(c=new Map,oe.set(this,c));var e=c.get(b);c.delete(b);D.clearTimeout(e);e=D.setTimeout(()=>{c.delete(b);0===c.size&&(c=null,oe.delete(this));this.trigger(a)},0);c.set(b,e)}}kb.prototype.allowedEvents_= {};kb.prototype.addEventListener=kb.prototype.on;kb.prototype.removeEventListener=kb.prototype.off;kb.prototype.dispatchEvent=kb.prototype.trigger;const pe=a=>"function"===typeof a.name?a.name():"string"===typeof a.name?a.name:a.name_?a.name_:a.constructor&&a.constructor.name?a.constructor.name:typeof a,Kb=a=>a instanceof kb||!!a.eventBusEl_&&["on","one","off","trigger"].every(b=>"function"===typeof a[b]),xo=(a,b)=>{Kb(a)?b():(a.eventedCallbacks||(a.eventedCallbacks=[]),a.eventedCallbacks.push(b))}, ag=a=>"string"===typeof a&&/\S/.test(a)||Array.isArray(a)&&!!a.length,qe=(a,b,c)=>{if(!a||!a.nodeName&&!Kb(a))throw Error(`Invalid target for ${pe(b)}#${c}; must be a DOM node or evented object.`);},Bj=(a,b,c)=>{if(!ag(a))throw Error(`Invalid event type for ${pe(b)}#${c}; must be a non-empty string or array.`);},Cj=(a,b,c)=>{if("function"!==typeof a)throw Error(`Invalid listener for ${pe(b)}#${c}; must be a function.`);},bg=(a,b,c)=>{const e=3>b.length||b[0]===a||b[0]===a.eventBusEl_;let g,l;e?(g= a.eventBusEl_,3<=b.length&&b.shift(),[b,l]=b):[g,b,l]=b;qe(g,a,c);Bj(b,a,c);Cj(l,a,c);l=na(a,l);return{isTargetingSelf:e,target:g,type:b,listener:l}},jc=(a,b,c,e)=>{qe(a,a,b);if(a.nodeName)vo[b](a,c,e);else a[b](c,e)},Rm={on(...a){const {isTargetingSelf:b,target:c,type:e,listener:g}=bg(this,a,"on");jc(c,"on",e,g);if(!b){const l=()=>this.off(c,e,g);l.guid=g.guid;a=()=>this.off("dispose",l);a.guid=g.guid;jc(this,"on","dispose",l);jc(c,"on","dispose",a)}},one(...a){const {isTargetingSelf:b,target:c, type:e,listener:g}=bg(this,a,"one");if(b)jc(c,"one",e,g);else{const l=(...p)=>{this.off(c,e,l);g.apply(null,p)};l.guid=g.guid;jc(c,"one",e,l)}},any(...a){const {isTargetingSelf:b,target:c,type:e,listener:g}=bg(this,a,"any");if(b)jc(c,"any",e,g);else{const l=(...p)=>{this.off(c,e,l);g.apply(null,p)};l.guid=g.guid;jc(c,"any",e,l)}},off(a,b,c){!a||ag(a)?Ma(this.eventBusEl_,a,b):(qe(a,this,"off"),Bj(b,this,"off"),Cj(c,this,"off"),c=na(this,c),this.off("dispose",c),a.nodeName?(Ma(a,b,c),Ma(a,"dispose", c)):Kb(a)&&(a.off(b,c),a.off("dispose",c)))},trigger(a,b){qe(this.eventBusEl_,this,"trigger");if(!ag(a&&"string"!==typeof a?a.type:a))throw Error(`Invalid event type for ${pe(this)}#trigger; `+"must be a non-empty string or object with a type key that has a non-empty value.");return Ec(this.eventBusEl_,a,b)}},Sm={state:{},setState(a){"function"===typeof a&&(a=a());let b;yc(a,(c,e)=>{this.state[e]!==c&&(b=b||{},b[e]={from:this.state[e],to:c});this.state[e]=c});b&&Kb(this)&&this.trigger({changes:b, type:"statechanged"});return b}},nd=function(a){return"string"!==typeof a?a:a.replace(/./,b=>b.toLowerCase())},wa=function(a){return"string"!==typeof a?a:a.replace(/./,b=>b.toUpperCase())},Dj=function(a,b){return wa(a)===wa(b)};var yo=Object.freeze({__proto__:null,toLowerCase:nd,toTitleCase:wa,titleCaseEquals:Dj});class M{constructor(a,b,c){this.player_=!a&&this.play?a=this:a;this.isDisposed_=!1;this.parentComponent_=null;this.options_=ma({},this.options_);b=this.options_=ma(this.options_,b);this.id_= b.id||b.el&&b.el.id;this.id_||(this.id_=`${a&&a.id&&a.id()||"no_player"}_component_${pb++}`);this.name_=b.name||null;b.el?this.el_=b.el:!1!==b.createEl&&(this.el_=this.createEl());b.className&&this.el_&&b.className.split(" ").forEach(e=>this.addClass(e));["on","off","one","any","trigger"].forEach(e=>{this[e]=void 0});!1!==b.evented&&(xf(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)); oi(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!==b.initChildren&&this.initChildren();this.ready(c);!1!==b.reportTouchActivity&&this.enableTouchActivity()}on(a,b){}off(a,b){}one(a,b){}any(a,b){}trigger(a,b){}dispose(a={}){if(!this.isDisposed_){this.readyQueue_&&(this.readyQueue_.length=0);this.trigger({type:"dispose", bubbles:!1});this.isDisposed_=!0;if(this.children_)for(let b=this.children_.length-1;0<=b;b--)this.children_[b].dispose&&this.children_[b].dispose();this.parentComponent_=this.childNameIndex_=this.childIndex_=this.children_=null;this.el_&&(this.el_.parentNode&&(a.restoreEl?this.el_.parentNode.replaceChild(a.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null);this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(a){return a?this.options_= ma(this.options_,a):this.options_}el(){return this.el_}createEl(a,b,c){return aa(a,b,c)}localize(a,b,c=a){var e=this.player_.language&&this.player_.language(),g=this.player_.languages&&this.player_.languages();const l=g&&g[e];e=e&&e.split("-")[0];g=g&&g[e];l&&l[a]?c=l[a]:g&&g[a]&&(c=g[a]);b&&(c=c.replace(/\{(\d+)\}/g,function(p,t){let x=t=b[t-1];"undefined"===typeof t&&(x=p);return x}));return c}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(a){return this.childIndex_[a]}getChild(a){if(a)return this.childNameIndex_[a]}getDescendant(...a){a= a.reduce((c,e)=>c.concat(e),[]);let b=this;for(let c=0;c{let l;"string"===typeof g?(l=g,g=a[l]||this.options_[l]||{}):l=g.name;return{name:l,opts:g}}).filter(g=>(g=M.getComponent(g.opts.componentClass||wa(g.name)))&&!e.isTech(g)).forEach(g=>{const l=g.name;g=g.opts;void 0!==b[l]&&(g=b[l]);!1!==g&&(!0===g&&(g={}),g.playerOptions=this.options_.playerOptions,(g=this.addChild(l,g))&&(this[l]=g))})}}buildCSSClass(){return""}ready(a,b=!1){a&&(this.isReady_?b?a.call(this):this.setTimeout(a,1):(this.readyQueue_=this.readyQueue_|| [],this.readyQueue_.push(a)))}triggerReady(){this.isReady_=!0;this.setTimeout(function(){const a=this.readyQueue_;this.readyQueue_=[];a&&0D.performance.now()-a&&(g.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(this.player()&&this.player().reportUserActivity){var a=na(this.player(),this.player().reportUserActivity),b;this.on("touchstart",function(){a();this.clearInterval(b);b=this.setInterval(a,250)});var c=function(e){a();this.clearInterval(b)};this.on("touchmove",a);this.on("touchend",c);this.on("touchcancel",c)}}setTimeout(a,b){a=na(this, a);this.clearTimersOnDispose_();var c=D.setTimeout(()=>{this.setTimeoutIds_.has(c)&&this.setTimeoutIds_.delete(c);a()},b);this.setTimeoutIds_.add(c);return c}clearTimeout(a){this.setTimeoutIds_.has(a)&&(this.setTimeoutIds_.delete(a),D.clearTimeout(a));return a}setInterval(a,b){a=na(this,a);this.clearTimersOnDispose_();a=D.setInterval(a,b);this.setIntervalIds_.add(a);return a}clearInterval(a){this.setIntervalIds_.has(a)&&(this.setIntervalIds_.delete(a),D.clearInterval(a));return a}requestAnimationFrame(a){this.clearTimersOnDispose_(); a=na(this,a);var b=D.requestAnimationFrame(()=>{this.rafIds_.has(b)&&this.rafIds_.delete(b);a()});this.rafIds_.add(b);return b}requestNamedAnimationFrame(a,b){if(!this.namedRafs_.has(a)){this.clearTimersOnDispose_();b=na(this,b);var c=this.requestAnimationFrame(()=>{b();this.namedRafs_.has(a)&&this.namedRafs_.delete(a)});this.namedRafs_.set(a,c);return a}}cancelNamedAnimationFrame(a){this.namedRafs_.has(a)&&(this.cancelAnimationFrame(this.namedRafs_.get(a)),this.namedRafs_.delete(a))}cancelAnimationFrame(a){this.rafIds_.has(a)&& (this.rafIds_.delete(a),D.cancelAnimationFrame(a));return a}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([a,b])=>{this[a].forEach((c,e)=>this[b](e))});this.clearingTimersOnDispose_=!1}))}static registerComponent(a,b){if("string"!==typeof a||!a)throw Error(`Illegal component name, "${a}"; must be a non-empty string.`); var c=M.getComponent("Tech");c=c&&c.isTech(b);const e=M===b||M.prototype.isPrototypeOf(b.prototype);if(c||!e)throw Error(`Illegal component, "${a}"; ${c?"techs must be registered using Tech.registerTech()":"must be a Component subclass"}.`);a=wa(a);M.components_||(M.components_={});c=M.getComponent("Player");if("Player"===a&&c&&c.players){const g=c.players;c=Object.keys(g);if(g&&0g[l]).every(Boolean))throw Error("Can not register Player component after player has been created."); }M.components_[a]=b;return M.components_[nd(a)]=b}static getComponent(a){if(a&&M.components_)return M.components_[a]}}M.registerComponent("Component",M);const si=function(a,b){a=0>a?0:a;let c=Math.floor(a%60),e=Math.floor(a/60%60),g=Math.floor(a/3600);const l=Math.floor(b/60%60);b=Math.floor(b/3600);if(isNaN(a)||Infinity===a)g=e=c="-";g=0e?"0"+e:e)+":")+(10>c?"0"+c:c)};let zf=si;var zo=Object.freeze({__proto__:null,createTimeRanges:qb,createTimeRange:qb, setFormatTime:qi,resetFormatTime:ri,formatTime:dc});ua.prototype.code=0;ua.prototype.message="";ua.prototype.status=null;ua.prototype.metadata=null;ua.errorTypes="MEDIA_ERR_CUSTOM MEDIA_ERR_ABORTED MEDIA_ERR_NETWORK MEDIA_ERR_DECODE MEDIA_ERR_SRC_NOT_SUPPORTED MEDIA_ERR_ENCRYPTED".split(" ");ua.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."};ua.MEDIA_ERR_CUSTOM=0;ua.prototype.MEDIA_ERR_CUSTOM=0;ua.MEDIA_ERR_ABORTED=1;ua.prototype.MEDIA_ERR_ABORTED=1;ua.MEDIA_ERR_NETWORK=2;ua.prototype.MEDIA_ERR_NETWORK=2;ua.MEDIA_ERR_DECODE=3;ua.prototype.MEDIA_ERR_DECODE=3;ua.MEDIA_ERR_SRC_NOT_SUPPORTED=4;ua.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;ua.MEDIA_ERR_ENCRYPTED= 5;ua.prototype.MEDIA_ERR_ENCRYPTED=5;const cg=function(a){return"kind label language id inBandMetadataTrackDispatchType mode src".split(" ").reduce((b,c,e)=>{a[c]&&(b[c]=a[c]);return b},{cues:a.cues&&Array.prototype.map.call(a.cues,function(b){return{startTime:b.startTime,endTime:b.endTime,text:b.text,id:b.id}})})};var Ej={textTracksToJson:function(a){const b=a.$$("track"),c=Array.prototype.map.call(b,e=>e.track);return Array.prototype.map.call(b,function(e){const g=cg(e.track);e.src&&(g.src=e.src); return g}).concat(Array.prototype.filter.call(a.textTracks(),function(e){return-1===c.indexOf(e)}).map(cg))},jsonToTextTracks:function(a,b){a.forEach(function(c){const e=b.addRemoteTextTrack(c).track;!c.src&&c.cues&&c.cues.forEach(g=>e.addCue(g))});return b.textTracks()},trackToJson_:cg};class Kc extends M{constructor(a,b){super(a,b);this.handleKeyDown_=c=>this.handleKeyDown(c);this.close_=c=>this.close(c);this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1;this.closeable(!this.options_.uncloseable); this.content(this.options_.content);this.contentEl_=aa("div",{className:"vjs-modal-dialog-content"},{role:"document"});this.descEl_=aa("p",{className:"vjs-modal-dialog-description vjs-control-text",id:this.el().getAttribute("aria-describedby")});Ub(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":`${this.id()}_description`,"aria-hidden":"true", "aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.previouslyActiveEl_=this.descEl_=this.contentEl_=null;super.dispose()}buildCSSClass(){return`${"vjs-modal-dialog"} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let a=this.options_.description||this.localize("This is a modal window.");this.closeable()&&(a+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")); return a}open(){if(this.opened_)this.options_.fillAlways&&this.fill();else{var a=this.player();this.trigger("beforemodalopen");this.opened_=!0;(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill();this.wasPlaying_=!a.paused();this.options_.pauseOnOpen&&this.wasPlaying_&&a.pause();this.on("keydown",this.handleKeyDown_);this.hadControls_=a.controls();a.controls(!1);this.show();this.conditionalFocus_();this.el().setAttribute("aria-hidden","false");this.trigger("modalopen"); this.hasBeenOpened_=!0}}opened(a){if("boolean"===typeof a)this[a?"open":"close"]();return this.opened_}close(){if(this.opened_){var a=this.player();this.trigger("beforemodalclose");this.opened_=!1;this.wasPlaying_&&this.options_.pauseOnOpen&&a.play();this.off("keydown",this.handleKeyDown_);this.hadControls_&&a.controls(!0);this.hide();this.el().setAttribute("aria-hidden","true");this.trigger("modalclose");this.conditionalBlur_();this.options_.temporary&&this.dispose()}}closeable(a){if("boolean"=== typeof a){a=this.closeable_=!!a;let b=this.getChild("closeButton");if(a&&!b){const c=this.contentEl_;this.contentEl_=this.el_;b=this.addChild("closeButton",{controlText:"Close Modal Dialog"});this.contentEl_=c;this.on(b,"close",this.close_)}!a&&b&&(this.off(b,"close",this.close_),this.removeChild(b),b.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(a){const b=this.contentEl(),c=b.parentNode,e=b.nextSibling;this.trigger("beforemodalfill");this.hasBeenFilled_=!0;c.removeChild(b); this.empty();ki(b,a);this.trigger("modalfill");e?c.insertBefore(b,e):c.appendChild(b);(a=this.getChild("closeButton"))&&c.appendChild(a.el_)}empty(){this.trigger("beforemodalempty");Wd(this.contentEl());this.trigger("modalempty")}content(a){"undefined"!==typeof a&&(this.content_=a);return this.content_}conditionalFocus_(){const a=P.activeElement,b=this.player_.el_;this.previouslyActiveEl_=null;if(b.contains(a)||b===a)this.previouslyActiveEl_=a,this.focus()}conditionalBlur_(){this.previouslyActiveEl_&& (this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(a){a.stopPropagation();if(Y.isEventKey(a,"Escape")&&this.closeable())a.preventDefault(),this.close();else if(Y.isEventKey(a,"Tab")){var b=this.focusableEls_(),c=this.el_.querySelector(":focus");for(let g=0;g(b instanceof D.HTMLAnchorElement||b instanceof D.HTMLAreaElement)&&b.hasAttribute("href")||(b instanceof D.HTMLInputElement||b instanceof D.HTMLSelectElement||b instanceof D.HTMLTextAreaElement||b instanceof D.HTMLButtonElement)&&!b.hasAttribute("disabled")||b instanceof D.HTMLIFrameElement||b instanceof D.HTMLObjectElement||b instanceof D.HTMLEmbedElement||b.hasAttribute("tabindex")&&-1!==b.getAttribute("tabindex")||b.hasAttribute("contenteditable"))}} Kc.prototype.options_={pauseOnOpen:!0,temporary:!0};M.registerComponent("ModalDialog",Kc);class Lc extends kb{constructor(a=[]){super();this.tracks_=[];Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let b=0;b{this.trigger({track:a,type:"labelchange",target:this})};Kb(a)&&a.addEventListener("labelchange",a.labelchange_)}removeTrack(a){let b;for(let c=0,e=this.length;c{this.changing_||(this.changing_=!0,dg(this,a),this.changing_=!1,this.trigger("change"))}, a.addEventListener("enabledchange",a.enabledChange_))}removeTrack(a){super.removeTrack(a);a.removeEventListener&&a.enabledChange_&&(a.removeEventListener("enabledchange",a.enabledChange_),a.enabledChange_=null)}}const eg=function(a,b){for(let c=0;c{this.changing_||(this.changing_=!0,eg(this,a),this.changing_=!1,this.trigger("change"))},a.addEventListener("selectedchange",a.selectedChange_))}removeTrack(a){super.removeTrack(a);a.removeEventListener&&a.selectedChange_&&(a.removeEventListener("selectedchange",a.selectedChange_),a.selectedChange_=null)}}class Fj extends Lc{addTrack(a){super.addTrack(a); this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change"));this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange"));a.addEventListener("modechange",this.queueChange_);-1===["metadata","chapters"].indexOf(a.kind)&&a.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(a){super.removeTrack(a);a.removeEventListener&&(this.queueChange_&&a.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&& a.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class Co{constructor(a=[]){this.trackElements_=[];Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let b=0,c=a.length;bda.error(g)),D.console&&D.console.groupEnd&&D.console.groupEnd());c.flush()},Jj=function(a,b){const c={uri:a};if(a=re(a))c.cors=a;if(a="use-credentials"=== b.tech_.crossOrigin())c.withCredentials=a;Fi(c,na(this,function(e,g,l){if(e)return da.error(e,g);b.loaded_=!0;"function"!==typeof D.WebVTT?b.tech_&&b.tech_.any(["vttjsloaded","vttjserror"],p=>{if("vttjserror"===p.type)da.error(`vttjs failed to load, stopping trying to process ${b.src}`);else return Ij(l,b)}):Ij(l,b)}))};class od extends gg{constructor(a={}){if(!a.tech)throw Error("A tech was not provided.");a=ma(a,{kind:Fo[a.kind]||"subtitles",language:a.language||a.srclang||""});let b=Gj[a.mode]|| "disabled";const c=a.default;if("metadata"===a.kind||"chapters"===a.kind)b="hidden";super(a);this.tech_=a.tech;this.cues_=[];this.activeCues_=[];this.preload_=!1!==this.tech_.preloadTextTracks;const e=new fg(this.cues_),g=new fg(this.activeCues_);let l=!1;this.timeupdateHandler=na(this,function(p={}){this.tech_.isDisposed()||(this.tech_.isReady_&&(this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1)),"timeupdate"!==p.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))}); this.tech_.one("dispose",()=>{this.stopTracking()});"disabled"!==b&&this.startTracking();Object.defineProperties(this,{default:{get(){return c},set(){}},mode:{get(){return b},set(p){Gj[p]&&b!==p&&(b=p,this.preload_||"disabled"===b||0!==this.cues.length||Jj(this.src,this),this.stopTracking(),"disabled"!==b&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?e:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return g;var p=this.tech_.currentTime(); const t=[];for(let x=0,y=this.cues.length;x=p&&t.push(A)}l=!1;if(t.length!==this.activeCues_.length)l=!0;else for(p=0;p{b=$b.LOADED;this.trigger({type:"load",target:this})})}}$b.prototype.allowedEvents_={load:"load"};$b.NONE=0;$b.LOADING=1;$b.LOADED=2;$b.ERROR=3;const lb={audio:{ListClass:Ao,TrackClass:Kj,capitalName:"Audio"},video:{ListClass:Bo,TrackClass:Lj,capitalName:"Video"},text:{ListClass:Fj,TrackClass:od,capitalName:"Text"}};Object.keys(lb).forEach(function(a){lb[a].getterName=`${a}Tracks`;lb[a].privateName=`${a}Tracks_`});const Mc={remoteText:{ListClass:Fj,TrackClass:od,capitalName:"RemoteText",getterName:"remoteTextTracks", privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Co,TrackClass:$b,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Sa=Object.assign({},lb,Mc);Mc.names=Object.keys(Mc);lb.names=Object.keys(lb);Sa.names=[].concat(Mc.names).concat(lb.names);class Z extends M{constructor(a={},b=function(){}){a.reportTouchActivity=!1;super(null,a,b);this.onDurationChange_=c=>this.onDurationChange(c);this.trackProgress_=c=>this.trackProgress(c);this.trackCurrentTime_= c=>this.trackCurrentTime(c);this.stopTrackingCurrentTime_=c=>this.stopTrackingCurrentTime(c);this.disposeSourceHandler_=c=>this.disposeSourceHandler(c);this.queuedHanders_=new Set;this.hasStarted_=!1;this.on("playing",function(){this.hasStarted_=!0});this.on("loadstart",function(){this.hasStarted_=!1});Sa.names.forEach(c=>{c=Sa[c];a&&a[c.getterName]&&(this[c.privateName]=a[c.getterName])});this.featuresProgressEvents||this.manualProgressOn();this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(); ["Text","Audio","Video"].forEach(c=>{!1===a[`native${c}Tracks`]&&(this[`featuresNative${c}Tracks`]=!1)});if(!1===a.nativeCaptions||!1===a.nativeTextTracks)this.featuresNativeTextTracks=!1;else if(!0===a.nativeCaptions||!0===a.nativeTextTracks)this.featuresNativeTextTracks=!0;this.featuresNativeTextTracks||this.emulateTextTracks();this.preloadTextTracks=!1!==a.preloadTextTracks;this.autoRemoteTextTracks_=new Sa.text.ListClass;this.initTrackListeners();a.nativeControlsForTouch||this.emitTapEvents(); this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(a){if(!this.isReady_)this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(a),1));this.trigger({src:a,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_);this.manualProgress=!0;this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1;this.stopTrackingProgress();this.off("durationchange",this.onDurationChange_)}trackProgress(a){this.stopTrackingProgress(); this.progressInterval=this.setInterval(na(this,function(){const b=this.bufferedPercent();this.bufferedPercent_!==b&&this.trigger("progress");this.bufferedPercent_=b;1===b&&this.stopTrackingProgress()}),500)}onDurationChange(a){this.duration_=this.duration()}buffered(){return qb(0,0)}bufferedPercent(){return ti(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0;this.on("play",this.trackCurrentTime_);this.on("pause", this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1;this.stopTrackingCurrentTime();this.off("play",this.trackCurrentTime_);this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime();this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval);this.trigger({type:"timeupdate", target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(lb.names);this.manualProgress&&this.manualProgressOff();this.manualTimeUpdates&&this.manualTimeUpdatesOff();super.dispose()}clearTracks(a){a=[].concat(a);a.forEach(b=>{const c=this[`${b}Tracks`]()||[];let e=c.length;for(;e--;){const g=c[e];"text"===b&&this.removeRemoteTextTrack(g);c.removeTrack(g)}})}cleanupAutoTextTracks(){const a=this.autoRemoteTextTracks_||[];let b=a.length;for(;b--;)this.removeRemoteTextTrack(a[b])}reset(){}crossOrigin(){}setCrossOrigin(){}error(a){void 0!== a&&(this.error_=new ua(a),this.trigger("error"));return this.error_}played(){return this.hasStarted_?qb(0,0):qb()}play(){}setScrubbing(a){}scrubbing(){}setCurrentTime(a){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){lb.names.forEach(a=>{const b=()=>{this.trigger(`${a}trackchange`)},c=this[lb[a].getterName]();c.addEventListener("removetrack",b);c.addEventListener("addtrack",b);this.on("dispose",()=>{c.removeEventListener("removetrack", b);c.removeEventListener("addtrack",b)})})}addWebVttScript_(){if(!D.WebVTT)if(P.body.contains(this.el()))if(!this.options_["vtt.js"]&&zc(Hi)&&0{this.trigger("vttjsloaded")};a.onerror=()=>{this.trigger("vttjserror")};this.on("dispose",()=>{a.onload=null;a.onerror=null});D.WebVTT=!0;this.el().parentNode.appendChild(a)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const a= this.textTracks(),b=this.remoteTextTracks(),c=p=>a.addTrack(p.track),e=p=>a.removeTrack(p.track);b.on("addtrack",c);b.on("removetrack",e);this.addWebVttScript_();const g=()=>this.trigger("texttrackchange"),l=()=>{g();for(let p=0;pthis.autoRemoteTextTracks_.addTrack(c.track));return c}removeRemoteTextTrack(a){const b=this.remoteTextTrackEls().getTrackElementByTrack_(a);this.remoteTextTrackEls().removeTrackElement_(b);this.remoteTextTracks().removeTrack(a);this.autoRemoteTextTracks_.removeTrack(a)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(a){const b= pb++;!this.isReady_||this.paused()?(this.queuedHanders_.add(b),this.one("playing",()=>{this.queuedHanders_.has(b)&&(this.queuedHanders_.delete(b),a())})):this.requestNamedAnimationFrame(b,a);return b}cancelVideoFrameCallback(a){this.queuedHanders_.has(a)?this.queuedHanders_.delete(a):this.cancelNamedAnimationFrame(a)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(a){}overrideNativeVideoTracks(a){}canPlayType(a){return""}static canPlayType(a){return""}static canPlaySource(a, b){return Z.canPlayType(a.type)}static isTech(a){return a.prototype instanceof Z||a instanceof Z||a===Z}static registerTech(a,b){Z.techs_||(Z.techs_={});if(!Z.isTech(b))throw Error(`Tech ${a} must be a Tech`);if(!Z.canPlayType)throw Error("Techs must have a static canPlayType method on them");if(!Z.canPlaySource)throw Error("Techs must have a static canPlaySource method on them");a=wa(a);Z.techs_[a]=b;Z.techs_[nd(a)]=b;"Tech"!==a&&Z.defaultTechOrder_.push(a);return b}static getTech(a){if(a){if(Z.techs_&& Z.techs_[a])return Z.techs_[a];a=wa(a);if(D&&D.videojs&&D.videojs[a])return da.warn(`The ${a} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),D.videojs[a]}}}Sa.names.forEach(function(a){const b=Sa[a];Z.prototype[b.getterName]=function(){this[b.privateName]=this[b.privateName]||new b.ListClass;return this[b.privateName]}});Z.prototype.featuresVolumeControl=!0;Z.prototype.featuresMuteControl=!0;Z.prototype.featuresFullscreenResize=!1;Z.prototype.featuresPlaybackRate= !1;Z.prototype.featuresProgressEvents=!1;Z.prototype.featuresSourceset=!1;Z.prototype.featuresTimeupdateEvents=!1;Z.prototype.featuresNativeTextTracks=!1;Z.prototype.featuresVideoFrameCallback=!1;Z.withSourceHandlers=function(a){a.registerSourceHandler=function(b,c){let e=a.sourceHandlers;e||(e=a.sourceHandlers=[]);void 0===c&&(c=e.length);e.splice(c,0,b)};a.canPlayType=function(b){const c=a.sourceHandlers||[];let e;for(let g=0;g{if(!b)return"";if(a.cache_.source.src===b&&a.cache_.source.type)return a.cache_.source.type;var c=a.cache_.sources.filter(e=>e.src=== b);if(c.length)return c[0].type;a=a.$$("source");for(c=0;cthis.handleMouseOver(c);this.handleMouseOut_=c=>this.handleMouseOut(c);this.handleClick_=c=>this.handleClick(c); this.handleKeyDown_=c=>this.handleKeyDown(c);this.emitTapEvents();this.enable()}createEl(a="div",b={},c={}){b=Object.assign({className:this.buildCSSClass(),tabIndex:0},b);"button"===a&&da.error(`Creating a ClickableComponent with an HTML element of ${a} is not supported; use a Button instead.`);c=Object.assign({role:"button"},c);this.tabIndex_=b.tabIndex;a=aa(a,b,c);this.player_.options_.experimentalSvgIcons||a.appendChild(aa("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0}));this.createControlTextEl(a); return a}dispose(){this.controlTextEl_=null;super.dispose()}createControlTextEl(a){this.controlTextEl_=aa("span",{className:"vjs-control-text"},{"aria-live":"polite"});a&&a.appendChild(this.controlTextEl_);this.controlText(this.controlText_,a);return this.controlTextEl_}controlText(a,b=this.el()){if(void 0===a)return this.controlText_||"Need Text";const c=this.localize(a);this.controlText_=a;Ub(this.controlTextEl_,c);this.nonIconControl||this.player_.options_.noUITitleAttributes||b.setAttribute("title", c)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),"undefined"!==typeof this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1;this.addClass("vjs-disabled");this.el_.setAttribute("aria-disabled","true");"undefined"!==typeof 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_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(a){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(a){Y.isEventKey(a,"Space")||Y.isEventKey(a,"Enter")?(a.preventDefault(),a.stopPropagation(),this.trigger("click")):super.handleKeyDown(a)}} M.registerComponent("ClickableComponent",se);class jg extends se{constructor(a,b){super(a,b);this.update();this.update_=c=>this.update(c);a.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_);super.dispose()}createEl(){return aa("div",{className:"vjs-poster"})}crossOrigin(a){if("undefined"===typeof a)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin|| null;null!==a&&"anonymous"!==a&&"use-credentials"!==a?this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${a}"`):this.$("img")&&(this.$("img").crossOrigin=a)}update(a){a=this.player().poster();this.setSrc(a);a?this.show():this.hide()}setSrc(a){a?(this.$("img")||this.el_.appendChild(aa("picture",{className:"vjs-poster",tabIndex:-1},{},aa("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=a):this.el_.textContent=""}handleClick(a){this.player_.controls()&& (this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?yb(this.player_.play()):this.player_.pause())}}jg.prototype.crossorigin=jg.prototype.crossOrigin;M.registerComponent("PosterImage",jg);const Mo={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'};class No extends M{constructor(a,b,c){super(a,b,c);const e=g=>{this.updateDisplayOverlay();this.updateDisplay(g)};a.on("loadstart",g=>this.toggleDisplay(g));a.on("texttrackchange",g=>this.updateDisplay(g));a.on("loadedmetadata",g=>{this.updateDisplayOverlay();this.preselectTrack(g)});a.ready(na(this,function(){if(a.tech_&&a.tech_.featuresNativeTextTracks)this.hide();else{a.on("fullscreenchange",e);a.on("playerresize",e);var g=D.screen.orientation|| D,l=D.screen.orientation?"change":"orientationchange";g.addEventListener(l,e);a.on("dispose",()=>g.removeEventListener(l,e));var p=this.options_.playerOptions.tracks||[];for(let t=0;te?g=Math.round((a-b*e)/2):l=Math.round((b-a/e)/2));hd(this.el_,"insetInline",g?`${g}px`:"");hd(this.el_,"insetBlock",l?`${l}px`:"")}}updateDisplayState(a){const b=this.player_.textTrackSettings.getValues();a=a.activeCues;let c=a.length;for(;c--;){var e=a[c];if(e){e=e.displayState;b.color&&(e.firstChild.style.color= b.color);b.textOpacity&&hd(e.firstChild,"color",Cf(b.color||"#fff",b.textOpacity));b.backgroundColor&&(e.firstChild.style.backgroundColor=b.backgroundColor);b.backgroundOpacity&&hd(e.firstChild,"backgroundColor",Cf(b.backgroundColor||"#000",b.backgroundOpacity));b.windowColor&&(b.windowOpacity?hd(e,"backgroundColor",Cf(b.windowColor,b.windowOpacity)):e.style.backgroundColor=b.windowColor);b.edgeStyle&&("dropshadow"===b.edgeStyle?e.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222": "raised"===b.edgeStyle?e.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px #222":"depressed"===b.edgeStyle?e.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222":"uniform"===b.edgeStyle&&(e.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222"));if(b.fontPercent&&1!==b.fontPercent){const g=D.parseFloat(e.style.fontSize);e.style.fontSize=g*b.fontPercent+"px";e.style.height="auto";e.style.top="auto"}b.fontFamily&&"default"!== b.fontFamily&&("small-caps"===b.fontFamily?e.firstChild.style.fontVariant="small-caps":e.firstChild.style.fontFamily=Mo[b.fontFamily])}}}updateForTrack(a){Array.isArray(a)||(a=[a]);if("function"===typeof D.WebVTT&&!a.every(l=>!l.activeCues)){var b=[];for(var c=0;cthis.handleMouseDown(c))}buildCSSClass(){return"vjs-big-play-button"}handleClick(a){const b= this.player_.play();if(this.mouseused_&&"clientX"in a&&"clientY"in a)yb(b),this.player_.tech(!0)&&this.player_.tech(!0).focus();else{var c=(a=this.player_.getChild("controlBar"))&&a.getChild("playToggle");c?(a=()=>c.focus(),gd(b)?b.then(a,()=>{}):this.setTimeout(a,1)):this.player_.tech(!0).focus()}}handleKeyDown(a){this.mouseused_=!1;super.handleKeyDown(a)}handleMouseDown(a){this.mouseused_=!0}}Oj.prototype.controlText_="Play Video";M.registerComponent("BigPlayButton",Oj);class Po extends eb{constructor(a, b){super(a,b);this.setIcon("cancel");this.controlText(b&&b.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(a){this.trigger({type:"close",bubbles:!1})}handleKeyDown(a){Y.isEventKey(a,"Esc")?(a.preventDefault(),a.stopPropagation(),this.trigger("click")):super.handleKeyDown(a)}}M.registerComponent("CloseButton",Po);class Pj extends eb{constructor(a,b={}){super(a,b);b.replay=void 0===b.replay||b.replay;this.setIcon("play");this.on(a,"play", c=>this.handlePlay(c));this.on(a,"pause",c=>this.handlePause(c));if(b.replay)this.on(a,"ended",c=>this.handleEnded(c))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(a){this.player_.paused()?yb(this.player_.play()):this.player_.pause()}handleSeeked(a){this.removeClass("vjs-ended");this.player_.paused()?this.handlePause(a):this.handlePlay(a)}handlePlay(a){this.removeClass("vjs-ended","vjs-paused");this.addClass("vjs-playing");this.setIcon("pause");this.controlText("Pause")}handlePause(a){this.removeClass("vjs-playing"); this.addClass("vjs-paused");this.setIcon("play");this.controlText("Play")}handleEnded(a){this.removeClass("vjs-playing");this.addClass("vjs-ended");this.setIcon("replay");this.controlText("Replay");this.one(this.player_,"seeked",b=>this.handleSeeked(b))}}Pj.prototype.controlText_="Play";M.registerComponent("PlayToggle",Pj);class Nc extends M{constructor(a,b){super(a,b);this.on(a,["timeupdate","ended","seeking"],c=>this.update(c));this.updateTextNode_()}createEl(){const a=this.buildCSSClass(),b=super.createEl("div", {className:`${a} vjs-time-control vjs-control`}),c=aa("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}\u00a0`},{role:"presentation"});b.appendChild(c);this.contentEl_=aa("span",{className:`${a}-display`},{role:"presentation"});b.appendChild(this.contentEl_);return b}dispose(){this.textNode_=this.contentEl_=null;super.dispose()}update(a){(this.player_.options_.enableSmoothSeeking||"seeking"!==a.type)&&this.updateContent(a)}updateTextNode_(a=0){a=dc(a);this.formattedTime_!== a&&(this.formattedTime_=a,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(this.contentEl_){var b=this.textNode_;b&&this.contentEl_.firstChild!==b&&(b=null,da.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead."));(this.textNode_=P.createTextNode(this.formattedTime_))&&(b?this.contentEl_.replaceChild(this.textNode_,b):this.contentEl_.appendChild(this.textNode_))}}))}updateContent(a){}} Nc.prototype.labelText_="Time";Nc.prototype.controlText_="Time";M.registerComponent("TimeDisplay",Nc);class kg extends Nc{buildCSSClass(){return"vjs-current-time"}updateContent(a){a=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateTextNode_(a)}}kg.prototype.labelText_="Current Time";kg.prototype.controlText_="Current Time";M.registerComponent("CurrentTimeDisplay",kg);class lg extends Nc{constructor(a,b){super(a, b);b=c=>this.updateContent(c);this.on(a,"durationchange",b);this.on(a,"loadstart",b);this.on(a,"loadedmetadata",b)}buildCSSClass(){return"vjs-duration"}updateContent(a){a=this.player_.duration();this.updateTextNode_(a)}}lg.prototype.labelText_="Duration";lg.prototype.controlText_="Duration";M.registerComponent("DurationDisplay",lg);class Qo extends M{createEl(){const a=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),b=super.createEl("div"),c=super.createEl("span", {textContent:"/"});b.appendChild(c);a.appendChild(b);return a}}M.registerComponent("TimeDivider",Qo);class mg extends Nc{constructor(a,b){super(a,b);this.on(a,"durationchange",c=>this.updateContent(c))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const a=super.createEl();!1!==this.options_.displayNegative&&a.insertBefore(aa("span",{},{"aria-hidden":!0},"-"),this.contentEl_);return a}updateContent(a){"number"===typeof this.player_.duration()&&(a=this.player_.ended()?0:this.player_.remainingTimeDisplay? this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(a))}}mg.prototype.labelText_="Remaining Time";mg.prototype.controlText_="Remaining Time";M.registerComponent("RemainingTimeDisplay",mg);class Ro extends M{constructor(a,b){super(a,b);this.updateShowing();this.on(this.player(),"durationchange",c=>this.updateShowing(c))}createEl(){const a=super.createEl("div",{className:"vjs-live-control vjs-control"});this.contentEl_=aa("div",{className:"vjs-live-display"},{"aria-live":"off"}); this.contentEl_.appendChild(aa("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")}\u00a0`}));this.contentEl_.appendChild(P.createTextNode(this.localize("LIVE")));a.appendChild(this.contentEl_);return a}dispose(){this.contentEl_=null;super.dispose()}updateShowing(a){Infinity===this.player().duration()?this.show():this.hide()}}M.registerComponent("LiveDisplay",Ro);class Qj extends eb{constructor(a,b){super(a,b);this.updateLiveEdgeStatus();this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_= c=>this.updateLiveEdgeStatus(c),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const a=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});this.setIcon("circle",a);this.textEl_=aa("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"});a.appendChild(this.textEl_);return a}updateLiveEdgeStatus(){!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"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_);this.textEl_=null;super.dispose()}}Qj.prototype.controlText_="Seek to live, currently playing live"; M.registerComponent("SeekToLive",Qj);var So=Object.freeze({__proto__:null,clamp:gc});class ng extends M{constructor(a,b){super(a,b);this.handleMouseDown_=c=>this.handleMouseDown(c);this.handleMouseUp_=c=>this.handleMouseUp(c);this.handleKeyDown_=c=>this.handleKeyDown(c);this.handleClick_=c=>this.handleClick(c);this.handleMouseMove_=c=>this.handleMouseMove(c);this.update_=c=>this.update(c);this.bar=this.getChild(this.options_.barName);this.vertical(!!this.options_.vertical);this.enable()}enabled(){return this.enabled_}enable(){if(!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);if(this.playerEvent)this.on(this.player_,this.playerEvent,this.update);this.removeClass("disabled");this.setAttribute("tabindex",0);this.enabled_=!0}}disable(){if(this.enabled()){var a=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(a,"mousemove",this.handleMouseMove_);this.off(a,"mouseup",this.handleMouseUp_);this.off(a,"touchmove",this.handleMouseMove_);this.off(a,"touchend",this.handleMouseUp_);this.removeAttribute("tabindex");this.addClass("disabled");this.playerEvent&&this.off(this.player_,this.playerEvent,this.update);this.enabled_=!1}}createEl(a,b={},c={}){b.className+=" vjs-slider";b=Object.assign({tabIndex:0}, b);c=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},c);return super.createEl(a,b,c)}handleMouseDown(a){const b=this.bar.el_.ownerDocument;"mousedown"===a.type&&a.preventDefault();"touchstart"!==a.type||Bb||a.preventDefault();gi();this.addClass("vjs-sliding");this.trigger("slideractive");this.on(b,"mousemove",this.handleMouseMove_);this.on(b,"mouseup",this.handleMouseUp_);this.on(b,"touchmove",this.handleMouseMove_);this.on(b,"touchend",this.handleMouseUp_);this.handleMouseMove(a, !0)}handleMouseMove(a){}handleMouseUp(a){a=this.bar.el_.ownerDocument;hi();this.removeClass("vjs-sliding");this.trigger("sliderinactive");this.off(a,"mousemove",this.handleMouseMove_);this.off(a,"mouseup",this.handleMouseUp_);this.off(a,"touchmove",this.handleMouseMove_);this.off(a,"touchend",this.handleMouseUp_);this.update()}update(){if(this.el_&&this.bar){var a=this.getProgress();if(a===this.progress_)return a;this.progress_=a;this.requestNamedAnimationFrame("Slider#update",()=>{const b=this.vertical()? "height":"width";this.bar.el().style[b]=(100*a).toFixed(2)+"%"});return a}}getProgress(){return Number(gc(this.getPercent(),0,1).toFixed(4))}calculateDistance(a){a=Vd(this.el_,a);return this.vertical()?a.y:a.x}handleKeyDown(a){Y.isEventKey(a,"Left")||Y.isEventKey(a,"Down")?(a.preventDefault(),a.stopPropagation(),this.stepBack()):Y.isEventKey(a,"Right")||Y.isEventKey(a,"Up")?(a.preventDefault(),a.stopPropagation(),this.stepForward()):super.handleKeyDown(a)}handleClick(a){a.stopPropagation();a.preventDefault()}vertical(a){if(void 0=== a)return this.vertical_||!1;(this.vertical_=!!a)?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}M.registerComponent("Slider",ng);class To extends M{constructor(a,b){super(a,b);this.partEls_=[];this.on(a,"progress",c=>this.update(c))}createEl(){const a=super.createEl("div",{className:"vjs-load-progress"}),b=aa("span",{className:"vjs-control-text"}),c=aa("span",{textContent:this.localize("Loaded")}),e=P.createTextNode(": ");this.percentageEl_=aa("span",{className:"vjs-control-text-loaded-percentage", textContent:"0%"});a.appendChild(b);b.appendChild(c);b.appendChild(e);b.appendChild(this.percentageEl_);return a}dispose(){this.percentageEl_=this.partEls_=null;super.dispose()}update(a){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{var b=this.player_.liveTracker;const c=this.player_.buffered();var e=b&&b.isLive()?b.seekableEnd():this.player_.duration(),g=this.player_.bufferedEnd();b=this.partEls_;e=gc(g/e*100,0,100).toFixed(2)+"%";this.percent_!==e&&(this.el_.style.width=e,Ub(this.percentageEl_, e),this.percent_=e);for(e=0;ec.length;g--)this.el_.removeChild(b[g-1]);b.length=c.length})}}M.registerComponent("LoadProgressBar",To);class Uo extends M{constructor(a,b){super(a,b);this.update=Cb(na(this,this.update), 30)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(a,b,c){const e=ed(this.el_);var g=Cc(this.player_.el());const l=a.width*b;g&&e&&(b=a.left-g.left+l,g=a.width-l+(g.right-a.right),g||(g=a.width-l,b=l),a=e.width/2,ba?a=0:a>e.width&&(a=e.width),a=Math.round(a),this.el_.style.right=`-${a}px`,this.write(c))}write(a){Ub(this.el_,a)}updateTime(a,b,c,e){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{var g=this.player_.duration(); if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){g=this.player_.liveTracker.liveWindow();const l=g-b*g;g=(1>l?"":"-")+dc(l,g)}else g=dc(c,g);this.update(a,b,g);e&&e()})}}M.registerComponent("TimeTooltip",Uo);class og extends M{constructor(a,b){super(a,b);this.setIcon("circle");this.update=Cb(na(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(a,b){const c=this.getChild("timeTooltip");if(c){var e= this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();c.updateTime(a,b,e)}}}og.prototype.options_={children:[]};Qa||Ab||og.prototype.options_.children.push("timeTooltip");M.registerComponent("PlayProgressBar",og);class Rj extends M{constructor(a,b){super(a,b);this.update=Cb(na(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(a,b){const c=b*this.player_.duration();this.getChild("timeTooltip").updateTime(a,b,c,()=> {this.el_.style.left=`${a.width*b}px`})}}Rj.prototype.options_={children:["timeTooltip"]};M.registerComponent("MouseTimeDisplay",Rj);class pg extends ng{constructor(a,b){super(a,b);this.setEventHandlers_()}setEventHandlers_(){this.update_=na(this,this.update);this.update=Cb(this.update_,30);this.on(this.player_,["ended","durationchange","timeupdate"],this.update);if(this.player_.liveTracker)this.on(this.player_.liveTracker,"liveedgechange",this.update);this.updateInterval=null;this.enableIntervalHandler_= a=>this.enableInterval_(a);this.disableIntervalHandler_=a=>this.disableInterval_(a);this.on(this.player_,["playing"],this.enableIntervalHandler_);this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_);if("hidden"in P&&"visibilityState"in P)this.on(P,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(a){"hidden"===P.visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(a)):(this.player_.ended()|| this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30))}disableInterval_(a){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&a&&"ended"!==a.type||!this.updateInterval||(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(a){if("hidden"!==P.visibilityState){var b= super.update();this.requestNamedAnimationFrame("SeekBar#update",()=>{const c=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),e=this.player_.liveTracker;let g=this.player_.duration();e&&e.isLive()&&(g=this.player_.liveTracker.liveCurrentTime());this.percent_!==b&&(this.el_.setAttribute("aria-valuenow",(100*b).toFixed(2)),this.percent_=b);if(this.currentTime_!==c||this.duration_!==g)this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime\x3d{1} duration\x3d{2}", [dc(c,g),dc(g,g)],"{1} of {2}")),this.currentTime_=c,this.duration_=g;this.bar&&this.bar.update(Cc(this.el()),this.getProgress())});return b}}userSeek_(a){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser();this.player_.currentTime(a)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){var a=this.getCurrentTime_();const b=this.player_.liveTracker;b&&b.isLive()?(a=(a-b.seekableStart())/ b.liveWindow(),b.atLiveEdge()&&(a=1)):a/=this.player_.duration();return a}handleMouseDown(a){fd(a)&&(a.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(a))}handleMouseMove(a,b=!1){if(fd(a)&&!isNaN(this.player_.duration())){b||this.player_.scrubbing()||this.player_.scrubbing(!0);var c=this.calculateDistance(a);var e=this.player_.liveTracker;if(e&&e.isLive()){if(.99<=c){e.seekToLiveEdge();return}a=e.seekableStart();b=e.liveCurrentTime();c=a+c* e.liveWindow();c>=b&&(c=b);c<=a&&(c=a+.1);if(Infinity===c)return}else c*=this.player_.duration(),c===this.player_.duration()&&(c-=.1);this.userSeek_(c);this.player_.options_.enableSmoothSeeking&&this.update()}}enable(){super.enable();const a=this.getChild("mouseTimeDisplay");a&&a.show()}disable(){super.disable();const a=this.getChild("mouseTimeDisplay");a&&a.hide()}handleMouseUp(a){super.handleMouseUp(a);a&&a.stopPropagation();this.player_.scrubbing(!1);this.player_.trigger({type:"timeupdate",target:this, manuallyTriggered:!0});this.videoWasPlaying?yb(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+5)}stepBack(){this.userSeek_(this.player_.currentTime()-5)}handleAction(a){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(a){const b=this.player_.liveTracker;Y.isEventKey(a,"Space")||Y.isEventKey(a,"Enter")?(a.preventDefault(),a.stopPropagation(),this.handleAction(a)):Y.isEventKey(a,"Home")?(a.preventDefault(),a.stopPropagation(), this.userSeek_(0)):Y.isEventKey(a,"End")?(a.preventDefault(),a.stopPropagation(),b&&b.isLive()?this.userSeek_(b.liveCurrentTime()):this.userSeek_(this.player_.duration())):/^[0-9]$/.test(Y(a))?(a.preventDefault(),a.stopPropagation(),a=10*(Y.codes[Y(a)]-Y.codes["0"])/100,b&&b.isLive()?this.userSeek_(b.seekableStart()+b.liveWindow()*a):this.userSeek_(this.player_.duration()*a)):Y.isEventKey(a,"PgDn")?(a.preventDefault(),a.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):Y.isEventKey(a, "PgUp")?(a.preventDefault(),a.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):super.handleKeyDown(a)}dispose(){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 P&&"visibilityState"in P&&this.off(P, "visibilitychange",this.toggleVisibility_);super.dispose()}}pg.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};Qa||Ab||pg.prototype.options_.children.splice(1,0,"mouseTimeDisplay");M.registerComponent("SeekBar",pg);class Sj extends M{constructor(a,b){super(a,b);this.handleMouseMove=Cb(na(this,this.handleMouseMove),30);this.throttledHandleMouseSeek=Cb(na(this,this.handleMouseSeek),30);this.handleMouseUpHandler_=c=>this.handleMouseUp(c);this.handleMouseDownHandler_= c=>this.handleMouseDown(c);this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(a){const b=this.getChild("seekBar");if(b){var c=b.getChild("playProgressBar"),e=b.getChild("mouseTimeDisplay");if(c||e){var g=b.el(),l=ed(g);a=Vd(g,a).x;a=gc(a,0,1);e&&e.update(l,a);c&&c.update(l,b.getProgress())}}}handleMouseSeek(a){const b=this.getChild("seekBar");b&&b.handleMouseMove(a)}enabled(){return this.enabled_}disable(){this.children().forEach(a=> a.disable&&a.disable());if(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())){const a=this.getChild("seekBar");this.player_.scrubbing(!1);a.videoWasPlaying&&yb(this.player_.play())}}enable(){this.children().forEach(a=>a.enable&&a.enable());this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_), this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const a=this.el_.ownerDocument;this.off(a,"mousemove",this.throttledHandleMouseSeek);this.off(a,"touchmove",this.throttledHandleMouseSeek);this.off(a,"mouseup",this.handleMouseUpHandler_);this.off(a,"touchend",this.handleMouseUpHandler_)}handleMouseDown(a){const b=this.el_.ownerDocument,c=this.getChild("seekBar");c&&c.handleMouseDown(a);this.on(b,"mousemove", this.throttledHandleMouseSeek);this.on(b,"touchmove",this.throttledHandleMouseSeek);this.on(b,"mouseup",this.handleMouseUpHandler_);this.on(b,"touchend",this.handleMouseUpHandler_)}handleMouseUp(a){const b=this.getChild("seekBar");b&&b.handleMouseUp(a);this.removeListenersAddedOnMousedownAndTouchstart()}}Sj.prototype.options_={children:["seekBar"]};M.registerComponent("ProgressControl",Sj);class Tj extends eb{constructor(a,b){super(a,b);this.setIcon("picture-in-picture-enter");this.on(a,["enterpictureinpicture", "leavepictureinpicture"],c=>this.handlePictureInPictureChange(c));this.on(a,["disablepictureinpicturechanged","loadedmetadata"],c=>this.handlePictureInPictureEnabledChange(c));this.on(a,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange());this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){"audio"===this.player_.currentType().substring(0,5)||this.player_.audioPosterMode()|| this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){P.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in D?this.enable():this.disable()}handlePictureInPictureChange(a){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")): (this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture"));this.handlePictureInPictureEnabledChange()}handleClick(a){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){"function"===typeof P.exitPictureInPicture&&super.show()}}Tj.prototype.controlText_="Picture-in-Picture";M.registerComponent("PictureInPictureToggle",Tj);class Uj extends eb{constructor(a,b){super(a,b);this.setIcon("fullscreen-enter");this.on(a, "fullscreenchange",c=>this.handleFullscreenChange(c));!1===P[a.fsApi_.fullscreenEnabled]&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(a){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(a){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}Uj.prototype.controlText_="Fullscreen"; M.registerComponent("FullscreenToggle",Uj);const Vo=function(a,b){b.tech_&&!b.tech_.featuresVolumeControl&&a.addClass("vjs-hidden");a.on(b,"loadstart",function(){b.tech_.featuresVolumeControl?a.removeClass("vjs-hidden"):a.addClass("vjs-hidden")})};class Wo extends M{createEl(){const a=super.createEl("div",{className:"vjs-volume-level"});this.setIcon("circle",a);a.appendChild(super.createEl("span",{className:"vjs-control-text"}));return a}}M.registerComponent("VolumeLevel",Wo);class Xo extends M{constructor(a, b){super(a,b);this.update=Cb(na(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(a,b,c,e){if(!c){c=Cc(this.el_);var g=Cc(this.player_.el());const l=a.width*b;if(!g||!c)return;b=a.left-g.left+l;a=a.width-l+(g.right-a.right);g=c.width/2;bg?g=0:g>c.width&&(g=c.width);this.el_.style.right=`-${g}px`}this.write(`${e}%`)}write(a){Ub(this.el_,a)}updateVolume(a,b,c,e,g){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume", ()=>{this.update(a,b,c,e.toFixed(0));g&&g()})}}M.registerComponent("VolumeLevelTooltip",Xo);class Vj extends M{constructor(a,b){super(a,b);this.update=Cb(na(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(a,b,c){const e=100*b;this.getChild("volumeLevelTooltip").updateVolume(a,b,c,e,()=>{c?this.el_.style.bottom=`${a.height*b}px`:this.el_.style.left=`${a.width*b}px`})}}Vj.prototype.options_={children:["volumeLevelTooltip"]};M.registerComponent("MouseVolumeLevelDisplay", Vj);class te extends ng{constructor(a,b){super(a,b);this.on("slideractive",c=>this.updateLastVolume_(c));this.on(a,"volumechange",c=>this.updateARIAAttributes(c));a.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(a){fd(a)&&super.handleMouseDown(a)}handleMouseMove(a){const b=this.getChild("mouseVolumeLevelDisplay");if(b){var c=this.el();const e= Cc(c),g=this.vertical();c=Vd(c,a);c=g?c.y:c.x;c=gc(c,0,1);b.update(e,c,g)}fd(a)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(a)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted();this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted();this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(a){a=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow", a);this.el_.setAttribute("aria-valuetext",a+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){const a=this.player_.volume();this.one("sliderinactive",()=>{0===this.player_.volume()&&this.player_.lastVolume_(a)})}}te.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};Qa||Ab||te.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");te.prototype.playerEvent="volumechange";M.registerComponent("VolumeBar",te);class Wj extends M{constructor(a, b={}){b.vertical=b.vertical||!1;if("undefined"===typeof b.volumeBar||zc(b.volumeBar))b.volumeBar=b.volumeBar||{},b.volumeBar.vertical=b.vertical;super(a,b);Vo(this,a);this.throttledHandleMouseMove=Cb(na(this,this.handleMouseMove),30);this.handleMouseUpHandler_=c=>this.handleMouseUp(c);this.on("mousedown",c=>this.handleMouseDown(c));this.on("touchstart",c=>this.handleMouseDown(c));this.on("mousemove",c=>this.handleMouseMove(c));this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"); this.addClass("vjs-slider-active");this.trigger("slideractive")});this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active");this.removeClass("vjs-slider-active");this.trigger("sliderinactive")})}createEl(){let a="vjs-volume-horizontal";this.options_.vertical&&(a="vjs-volume-vertical");return super.createEl("div",{className:`vjs-volume-control vjs-control ${a}`})}handleMouseDown(a){a=this.el_.ownerDocument;this.on(a,"mousemove",this.throttledHandleMouseMove); this.on(a,"touchmove",this.throttledHandleMouseMove);this.on(a,"mouseup",this.handleMouseUpHandler_);this.on(a,"touchend",this.handleMouseUpHandler_)}handleMouseUp(a){a=this.el_.ownerDocument;this.off(a,"mousemove",this.throttledHandleMouseMove);this.off(a,"touchmove",this.throttledHandleMouseMove);this.off(a,"mouseup",this.handleMouseUpHandler_);this.off(a,"touchend",this.handleMouseUpHandler_)}handleMouseMove(a){this.volumeBar.handleMouseMove(a)}}Wj.prototype.options_={children:["volumeBar"]};M.registerComponent("VolumeControl", Wj);const Yo=function(a,b){b.tech_&&!b.tech_.featuresMuteControl&&a.addClass("vjs-hidden");a.on(b,"loadstart",function(){b.tech_.featuresMuteControl?a.removeClass("vjs-hidden"):a.addClass("vjs-hidden")})};class Xj extends eb{constructor(a,b){super(a,b);Yo(this,a);this.on(a,["loadstart","volumechange"],c=>this.update(c))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(a){a=this.player_.volume();const b=this.player_.lastVolume_();0===a?(this.player_.volume(.1>b?.1:b),this.player_.muted(!1)): this.player_.muted(this.player_.muted()?!1:!0)}update(a){this.updateIcon_();this.updateControlText_()}updateIcon_(){const a=this.player_.volume();let b=3;this.setIcon("volume-high");Qa&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted);0===a||this.player_.muted()?(this.setIcon("volume-mute"),b=0):.33>a?(this.setIcon("volume-low"),b=1):.67>a&&(this.setIcon("volume-medium"),b=2);Td(this.el_,[0,1,2,3].reduce((c,e)=>c+`${e?" ":""}vjs-vol-${e}`,""));cc(this.el_, `vjs-vol-${b}`)}updateControlText_(){const a=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==a&&this.controlText(a)}}Xj.prototype.controlText_="Mute";M.registerComponent("MuteToggle",Xj);class Yj extends M{constructor(a,b={}){b.inline="undefined"!==typeof b.inline?b.inline:!0;if("undefined"===typeof b.volumeControl||zc(b.volumeControl))b.volumeControl=b.volumeControl||{},b.volumeControl.vertical=!b.inline;super(a,b);this.handleKeyPressHandler_=c=>this.handleKeyPress(c); this.on(a,["loadstart"],c=>this.volumePanelState_(c));this.on(this.muteToggle,"keyup",c=>this.handleKeyPress(c));this.on(this.volumeControl,"keyup",c=>this.handleVolumeControlKeyUp(c));this.on("keydown",c=>this.handleKeyPress(c));this.on("mouseover",c=>this.handleMouseOver(c));this.on("mouseout",c=>this.handleMouseOut(c));this.on(this.volumeControl,["slideractive"],this.sliderActive_);this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){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")}createEl(){let a="vjs-volume-panel-horizontal";this.options_.inline||(a="vjs-volume-panel-vertical");return super.createEl("div",{className:`vjs-volume-panel vjs-control ${a}`})}dispose(){this.handleMouseOut();super.dispose()}handleVolumeControlKeyUp(a){Y.isEventKey(a,"Esc")&&this.muteToggle.focus()}handleMouseOver(a){this.addClass("vjs-hover"); ab(P,"keyup",this.handleKeyPressHandler_)}handleMouseOut(a){this.removeClass("vjs-hover");Ma(P,"keyup",this.handleKeyPressHandler_)}handleKeyPress(a){Y.isEventKey(a,"Esc")&&this.handleMouseOut()}}Yj.prototype.options_={children:["muteToggle","volumeControl"]};M.registerComponent("VolumePanel",Yj);class Zj extends eb{constructor(a,b){super(a,b);this.validOptions=[5,10,30];(this.skipTime=this.getSkipForwardTime())&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`), this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(a.language())])),this.show()):this.hide()}getSkipForwardTime(){const a=this.options_.playerOptions;return a.controlBar&&a.controlBar.skipButtons&&a.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(a){if(!isNaN(this.player_.duration())){a=this.player_.currentTime();var b=this.player_.liveTracker;b=b&&b.isLive()?b.seekableEnd(): this.player_.duration();this.player_.currentTime(a+this.skipTime<=b?a+this.skipTime:b)}}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Zj.prototype.controlText_="Skip Forward";M.registerComponent("SkipForward",Zj);class ak extends eb{constructor(a,b){super(a,b);this.validOptions=[5,10,30];(this.skipTime=this.getSkipBackwardTime())&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds", [this.skipTime.toLocaleString(a.language())])),this.show()):this.hide()}getSkipBackwardTime(){const a=this.options_.playerOptions;return a.controlBar&&a.controlBar.skipButtons&&a.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(a){a=this.player_.currentTime();var b=this.player_.liveTracker;b=b&&b.isLive()&&b.seekableStart();this.player_.currentTime(b&&a-this.skipTime<=b?b:a>=this.skipTime?a-this.skipTime:0)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds", [this.skipTime]))}}ak.prototype.controlText_="Skip Backward";M.registerComponent("SkipBackward",ak);class bk extends M{constructor(a,b){super(a,b);b&&(this.menuButton_=b.menuButton);this.focusedChild_=-1;this.on("keydown",c=>this.handleKeyDown(c));this.boundHandleBlur_=c=>this.handleBlur(c);this.boundHandleTapClick_=c=>this.handleTapClick(c)}addEventListenerForItem(a){a instanceof M&&(this.on(a,"blur",this.boundHandleBlur_),this.on(a,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(a){a instanceof M&&(this.off(a,"blur",this.boundHandleBlur_),this.off(a,["tap","click"],this.boundHandleTapClick_))}removeChild(a){"string"===typeof a&&(a=this.getChild(a));this.removeEventListenerForItem(a);super.removeChild(a)}addItem(a){(a=this.addChild(a))&&this.addEventListenerForItem(a)}createEl(){this.contentEl_=aa(this.options_.contentElType||"ul",{className:"vjs-menu-content"});this.contentEl_.setAttribute("role","menu");const a=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});a.appendChild(this.contentEl_); ab(a,"click",function(b){b.preventDefault();b.stopImmediatePropagation()});return a}dispose(){this.boundHandleTapClick_=this.boundHandleBlur_=this.contentEl_=null;super.dispose()}handleBlur(a){const b=a.relatedTarget||P.activeElement;this.children().some(c=>c.el()===b)||(a=this.menuButton_)&&a.buttonPressed_&&b!==a.el().firstChild&&a.unpressButton()}handleTapClick(a){if(this.menuButton_){this.menuButton_.unpressButton();var b=this.children();Array.isArray(b)&&(b=b.filter(c=>c.el()===a.target)[0])&& "CaptionSettingsMenuItem"!==b.name()&&this.menuButton_.focus()}}handleKeyDown(a){if(Y.isEventKey(a,"Left")||Y.isEventKey(a,"Down"))a.preventDefault(),a.stopPropagation(),this.stepForward();else if(Y.isEventKey(a,"Right")||Y.isEventKey(a,"Up"))a.preventDefault(),a.stopPropagation(),this.stepBack()}stepForward(){let a=0;void 0!==this.focusedChild_&&(a=this.focusedChild_+1);this.focus(a)}stepBack(){let a=0;void 0!==this.focusedChild_&&(a=this.focusedChild_-1);this.focus(a)}focus(a=0){const b=this.children().slice(); b.length&&b[0].hasClass("vjs-menu-title")&&b.shift();0a?a=0:a>=b.length&&(a=b.length-1),this.focusedChild_=a,b[a].el_.focus())}}M.registerComponent("Menu",bk);class qg extends M{constructor(a,b={}){super(a,b);this.menuButton_=new eb(a,b);this.menuButton_.controlText(this.controlText_);this.menuButton_.el_.setAttribute("aria-haspopup","true");a=eb.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+a;this.menuButton_.removeClass("vjs-control");this.addChild(this.menuButton_); this.update();this.enabled_=!0;a=c=>this.handleClick(c);this.handleMenuKeyUp_=c=>this.handleMenuKeyUp(c);this.on(this.menuButton_,"tap",a);this.on(this.menuButton_,"click",a);this.on(this.menuButton_,"keydown",c=>this.handleKeyDown(c));this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover");this.menu.show();ab(P,"keyup",this.handleMenuKeyUp_)});this.on("mouseleave",c=>this.handleMouseLeave(c));this.on("keydown",c=>this.handleSubmenuKeyDown(c))}update(){const a=this.createMenu();this.menu&& (this.menu.dispose(),this.removeChild(this.menu));this.menu=a;this.addChild(a);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"))}createMenu(){const a=new bk(this.player_,{menuButton:this});this.hideThreshold_=0;if(this.options_.title){var b=aa("li",{className:"vjs-menu-title",textContent:wa(this.options_.title), tabIndex:-1});b=new M(this.player_,{el:b});a.addItem(b)}if(this.items=this.createItems())for(b=0;b=this.items.length&&this.hide();if(c){var e=na(this,this.update);c.addEventListener("removetrack",e);c.addEventListener("addtrack",e);c.addEventListener("labelchange",e);this.player_.on("ready",e);this.player_.on("dispose",function(){c.removeEventListener("removetrack",e);c.removeEventListener("addtrack",e);c.removeEventListener("labelchange", e)})}}}M.registerComponent("TrackButton",rg);const Zo="Tab Esc Up Down Right Left".split(" ");class pd extends se{constructor(a,b){super(a,b);this.selectable=b.selectable;this.isSelected_=b.selected||!1;this.multiSelectable=b.multiSelectable;this.selected(this.isSelected_);this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(a,b,c){this.nonIconControl=!0;a=super.createEl("li", Object.assign({className:"vjs-menu-item",tabIndex:-1},b),c);b=aa("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});this.player_.options_.experimentalSvgIcons?a.appendChild(b):a.replaceChild(b,a.querySelector(".vjs-icon-placeholder"));return a}handleKeyDown(a){Zo.some(b=>Y.isEventKey(a,b))||super.handleKeyDown(a)}handleClick(a){this.selected(!0)}selected(a){this.selectable&&(a?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"), this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}M.registerComponent("MenuItem",pd);class qd extends pd{constructor(a,b){const c=b.track,e=a.textTracks();b.label=c.label||c.language||"Unknown";b.selected="showing"===c.mode;super(a,b);this.track=c;this.kinds=(b.kinds||[b.kind||this.track.kind]).filter(Boolean);const g=(...p)=>{this.handleTracksChange.apply(this,p)},l=(...p)=>{this.handleSelectedLanguageChange.apply(this, p)};a.on(["loadstart","texttrackchange"],g);e.addEventListener("change",g);e.addEventListener("selectedlanguagechange",l);this.on("dispose",function(){a.off(["loadstart","texttrackchange"],g);e.removeEventListener("change",g);e.removeEventListener("selectedlanguagechange",l)});if(void 0===e.onchange){let p;this.on(["tap","click"],function(){if("object"!==typeof D.Event)try{p=new D.Event("change")}catch(t){}p||(p=P.createEvent("Event"),p.initEvent("change",!0,!0));e.dispatchEvent(p)})}this.handleTracksChange()}handleClick(a){const b= this.track,c=this.player_.textTracks();super.handleClick(a);if(c)for(a=0;a{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(a){a&&a.track&&"chapters"!==a.track.kind||(a=this.findChaptersTrack(),a!==this.track_?(this.setTrack(a),super.update()):(!this.items||a&&a.cues&&a.cues.length!==this.items.length)&&super.update())}setTrack(a){if(this.track_!== a){this.updateHandler_||(this.updateHandler_=this.update.bind(this));if(this.track_){const b=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);b&&b.removeEventListener("load",this.updateHandler_);this.track_.removeEventListener("cuechange",this.selectCurrentItem_);this.track_=null}if(this.track_=a)this.track_.mode="hidden",(a=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_))&&a.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange", this.selectCurrentItem_)}}findChaptersTrack(){const a=this.player_.textTracks()||[];for(let b=a.length-1;0<=b;b--){const c=a[b];if(c.kind===this.kind_)return c}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(wa(this.kind_))}createMenu(){this.options_.title=this.getMenuCaption();return super.createMenu()}createItems(){const a=[];if(!this.track_)return a;const b=this.track_.cues;if(!b)return a;for(let c=0,e=b.length;c{this.handleTracksChange.apply(this,l)};e.addEventListener("change",g);this.on("dispose",()=>{e.removeEventListener("change",g)})}createEl(a,b,c){a=super.createEl(a,b,c);b=a.querySelector(".vjs-menu-item-text");0<=["main-desc","description"].indexOf(this.options_.track.kind)&&(b.appendChild(aa("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),b.appendChild(aa("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))); return a}handleClick(a){super.handleClick(a);this.track.enabled=!0;if(this.player_.tech_.featuresNativeAudioTracks){a=this.player_.audioTracks();for(let b=0;bthis.update(g))}handleClick(a){super.handleClick(); this.player().playbackRate(this.rate)}update(a){this.selected(this.player().playbackRate()===this.rate)}}yg.prototype.contentElType="button";M.registerComponent("PlaybackRateMenuItem",yg);class hk extends qg{constructor(a,b){super(a,b);this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_);this.updateVisibility();this.updateLabel();this.on(a,"loadstart",c=>this.updateVisibility(c));this.on(a,"ratechange",c=>this.updateLabel(c));this.on(a,"playbackrateschange",c=>this.handlePlaybackRateschange(c))}createEl(){const a= super.createEl();this.labelElId_="vjs-playback-rate-value-label-"+this.id_;this.labelEl_=aa("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"});a.appendChild(this.labelEl_);return a}dispose(){this.labelEl_=null;super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const a=this.playbackRates(),b=[];for(let c=a.length-1;0<=c;c--)b.push(new yg(this.player(), {rate:a[c]+"x"}));return b}handlePlaybackRateschange(a){this.update()}playbackRates(){const a=this.player();return a.playbackRates&&a.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&0{this.open(c)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const a=this.player().error();return a?this.localize(a.message):""}}kk.prototype.options_=Object.assign({},Kc.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});M.registerComponent("ErrorDisplay",kk);const lk=["#000","Black"],mk=["#00F","Blue"],nk=["#0FF","Cyan"],ok=["#0F0","Green"],pk=["#F0F","Magenta"],qk= ["#F00","Red"],rk=["#FFF","White"],sk=["#FF0","Yellow"],zg=["1","Opaque"],Ag=["0.5","Semi-Transparent"],tk=["0","Transparent"],kc={backgroundColor:{selector:".vjs-bg-color \x3e select",id:"captions-background-color-%s",label:"Color",options:[lk,rk,qk,ok,mk,sk,pk,nk]},backgroundOpacity:{selector:".vjs-bg-opacity \x3e select",id:"captions-background-opacity-%s",label:"Opacity",options:[zg,Ag,tk]},color:{selector:".vjs-text-color \x3e select",id:"captions-foreground-color-%s",label:"Color",options:[rk, lk,qk,ok,mk,sk,pk,nk]},edgeStyle:{selector:".vjs-edge-style \x3e select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family \x3e 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 \x3e 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:a=>"1.00"===a?null:Number(a)},textOpacity:{selector:".vjs-text-opacity \x3e select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[zg,Ag]},windowColor:{selector:".vjs-window-color \x3e select", id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity \x3e select",id:"captions-window-opacity-%s",label:"Opacity",options:[tk,Ag,zg]}};kc.windowColor.options=kc.backgroundColor.options;class ap extends Kc{constructor(a,b){b.temporary=!1;super(a,b);this.updateDisplay=this.updateDisplay.bind(this);this.fill();this.hasBeenOpened_=this.hasBeenFilled_=!0;this.endDialog=aa("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")});this.el().appendChild(this.endDialog); this.setDefaults();void 0===b.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings);this.on(this.$(".vjs-done-button"),"click",()=>{this.saveSettings();this.close()});this.on(this.$(".vjs-default-button"),"click",()=>{this.setDefaults();this.updateDisplay()});yc(kc,c=>{this.on(this.$(c.selector),"change",this.updateDisplay)});this.options_.persistTextTrackSettings&&this.restoreSettings()}dispose(){this.endDialog=null;super.dispose()}createElSelect_(a, b="",c="label"){a=kc[a];const e=a.id.replace("%s",this.id_),g=[b,e].join(" ").trim();b=`vjs_select_${pb++}`;return[`<${c} id="${e}"${"label"===c?` for="${b}" class="vjs-label"`:""}>`,this.localize(a.label),``,`